<s> from msrest . service_client import ServiceClient <EOL> from msrest import Serializer , Deserializer <EOL> from msrestazure import AzureConfiguration <EOL> from . version import VERSION <EOL> from msrest . pipeline import ClientRawResponse <EOL> from msrestazure . azure_exceptions import CloudError <EOL> import uuid <EOL> from . operations . application_gateways_operations import ApplicationGatewaysOperations <EOL> from . operations . express_route_circuit_authorizations_operations import ExpressRouteCircuitAuthorizationsOperations <EOL> from . operations . express_route_circuit_peerings_operations import ExpressRouteCircuitPeeringsOperations <EOL> from . operations . express_route_circuits_operations import ExpressRouteCircuitsOperations <EOL> from . operations . express_route_service_providers_operations import ExpressRouteServiceProvidersOperations <EOL> from . operations . load_balancers_operations import LoadBalancersOperations <EOL> from . operations . local_network_gateways_operations import LocalNetworkGatewaysOperations <EOL> from . operations . network_interfaces_operations import NetworkInterfacesOperations <EOL> from . operations . network_security_groups_operations import NetworkSecurityGroupsOperations <EOL> from . operations . public_ip_addresses_operations import PublicIPAddressesOperations <EOL> from . operations . route_tables_operations import RouteTablesOperations <EOL> from . operations . routes_operations import RoutesOperations <EOL> from . operations . security_rules_operations import SecurityRulesOperations <EOL> from . operations . subnets_operations import SubnetsOperations <EOL> from . operations . usages_operations import UsagesOperations <EOL> from . operations . virtual_network_gateway_connections_operations import VirtualNetworkGatewayConnectionsOperations <EOL> from . operations . virtual_network_gateways_operations import VirtualNetworkGatewaysOperations <EOL> from . operations . virtual_networks_operations import VirtualNetworksOperations <EOL> from . import models <EOL> class NetworkManagementClientConfiguration ( AzureConfiguration ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( <EOL> self , credentials , subscription_id , api_version = '<STR_LIT>' , accept_language = '<STR_LIT>' , long_running_operation_retry_timeout = <NUM_LIT:30> , generate_client_request_id = True , base_url = None , filepath = None ) : <EOL> if credentials is None : <EOL> raise ValueError ( "<STR_LIT>" ) <EOL> if subscription_id is None : <EOL> raise ValueError ( "<STR_LIT>" ) <EOL> if not isinstance ( subscription_id , str ) : <EOL> raise TypeError ( "<STR_LIT>" ) <EOL> if api_version is not None and not isinstance ( api_version , str ) : <EOL> raise TypeError ( "<STR_LIT>" ) <EOL> if accept_language is not None and not isinstance ( accept_language , str ) : <EOL> raise TypeError ( "<STR_LIT>" ) <EOL> if not base_url : <EOL> base_url = '<STR_LIT>' <EOL> super ( NetworkManagementClientConfiguration , self ) . __init__ ( base_url , filepath ) <EOL> self . add_user_agent ( '<STR_LIT>' . format ( VERSION ) ) <EOL> self . add_user_agent ( '<STR_LIT>' ) <EOL> self . credentials = credentials <EOL> self . subscription_id = subscription_id <EOL> self . api_version = api_version <EOL> self . accept_language = accept_language <EOL> self . long_running_operation_retry_timeout = long_running_operation_retry_timeout <EOL> self . generate_client_request_id = generate_client_request_id <EOL> class NetworkManagementClient ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , config ) : <EOL> self . _client = ServiceClient ( config . credentials , config ) <EOL> client_models = { k : v for k , v in models . __dict__ . items ( ) if isinstance ( v , type ) } <EOL> self . _serialize = Serializer ( ) <EOL> self . _deserialize = Deserializer ( client_models ) <EOL> self . config = config <EOL> self . application_gateways = ApplicationGatewaysOperations ( <EOL> self . _client , self . config , self . _serialize , self . _deserialize ) <EOL> self . express_route_circuit_authorizations = ExpressRouteCircuitAuthorizationsOperations ( <EOL> self . _client , self . config , self . _serialize , self . _deserialize ) <EOL> self . express_route_circuit_peerings = ExpressRouteCircuitPeeringsOperations ( <EOL> self . _client , self . config , self . _serialize , self . _deserialize ) <EOL> self . express_route_circuits = ExpressRouteCircuitsOperations ( <EOL> self . _client , self . config , self . _serialize , self . _deserialize ) <EOL> self . express_route_service_providers = ExpressRouteServiceProvidersOperations ( <EOL> self . _client , self . config , self . _serialize , self . _deserialize ) <EOL> self . load_balancers = LoadBalancersOperations ( <EOL> self . _client , self . config , self . _serialize , self . _deserialize ) <EOL> self . local_network_gateways = LocalNetworkGatewaysOperations ( <EOL> self . _client , self . config , self . _serialize , self . _deserialize ) <EOL> self . network_interfaces = NetworkInterfacesOperations ( <EOL> self . _client , self . config , self . _serialize , self . _deserialize ) <EOL> self . network_security_groups = NetworkSecurityGroupsOperations ( <EOL> self . _client , self . config , self . _serialize , self . _deserialize ) <EOL> self . public_ip_addresses = PublicIPAddressesOperations ( <EOL> self . _client , self . config , self . _serialize , self . _deserialize ) <EOL> self . route_tables = RouteTablesOperations ( <EOL> self . _client , self . config , self . _serialize , self . _deserialize ) <EOL> self . routes = RoutesOperations ( <EOL> self . _client , self . config , self . _serialize , self . _deserialize ) <EOL> self . security_rules = SecurityRulesOperations ( <EOL> self . _client , self . config , self . _serialize , self . _deserialize ) <EOL> self . subnets = SubnetsOperations ( <EOL> self . _client , self . config , self . _serialize , self . _deserialize ) <EOL> self . usages = UsagesOperations ( <EOL> self . _client , self . config , self . _serialize , self . _deserialize ) <EOL> self . virtual_network_gateway_connections = VirtualNetworkGatewayConnectionsOperations ( <EOL> self . _client , self . config , self . _serialize , self . _deserialize ) <EOL> self . virtual_network_gateways = VirtualNetworkGatewaysOperations ( <EOL> self . _client , self . config , self . _serialize , self . _deserialize ) <EOL> self . virtual_networks = VirtualNetworksOperations ( <EOL> self . _client , self . config , self . _serialize , self . _deserialize ) <EOL> def check_dns_name_availability ( <EOL> self , location , domain_name_label = None , custom_headers = { } , raw = False , ** operation_config ) : <EOL> """<STR_LIT>""" <EOL> url = '<STR_LIT>' <EOL> path_format_arguments = { <EOL> '<STR_LIT:location>' : self . _serialize . url ( "<STR_LIT:location>" , location , '<STR_LIT:str>' ) , <EOL> '<STR_LIT>' : self . _serialize . url ( "<STR_LIT>" , self . config . subscription_id , '<STR_LIT:str>' ) <EOL> } <EOL> url = self . _client . format_url ( url , ** path_format_arguments ) <EOL> query_parameters = { } <EOL> if domain_name_label is not None : <EOL> query_parameters [ '<STR_LIT>' ] = self . _serialize . query ( "<STR_LIT>" , domain_name_label , '<STR_LIT:str>' ) <EOL> query_parameters [ '<STR_LIT>' ] = self . _serialize . query ( "<STR_LIT>" , self . config . api_version , '<STR_LIT:str>' ) <EOL> header_parameters = { } <EOL> header_parameters [ '<STR_LIT:Content-Type>' ] = '<STR_LIT>' <EOL> if self . config . generate_client_request_id : <EOL> header_parameters [ '<STR_LIT>' ] = str ( uuid . uuid1 ( ) ) <EOL> if custom_headers : <EOL> header_parameters . update ( custom_headers ) <EOL> if self . config . accept_language is not None : <EOL> header_parameters [ '<STR_LIT>' ] = self . _serialize . header ( "<STR_LIT>" , self . config . accept_language , '<STR_LIT:str>' ) <EOL> request = self . _client . get ( url , query_parameters ) <EOL> response = self . _client . send ( request , header_parameters , ** operation_config ) <EOL> if response . status_code not in [ <NUM_LIT:200> ] : <EOL> exp = CloudError ( response ) <EOL> exp . request_id = response . headers . get ( '<STR_LIT>' ) <EOL> raise exp <EOL> deserialized = None <EOL> if response . status_code == <NUM_LIT:200> : <EOL> deserialized = self . _deserialize ( '<STR_LIT>' , response ) <EOL> if raw : <EOL> client_raw_response = ClientRawResponse ( deserialized , response ) <EOL> return client_raw_response <EOL> return deserialized </s>
