'Checks whether a domain name in the cloudapp.net 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
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:rtype: :class:`DnsNameAvailabilityResult
<azure.mgmt.network.v20160901.models.DnsNameAvailabilityResult>`
:rtype: :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>`
if raw=true
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`'

def check_dns_name_availability(self, location, domain_name_label=None, custom_headers=None, raw=False, **operation_config):

    if (self.api_version == '2017-06-01'):
        from .v2017_06_01 import NetworkManagementClient as ClientClass
    elif (self.api_version == '2017-03-01'):
        from .v2017_03_01 import NetworkManagementClient as ClientClass
    elif (self.api_version == '2016-12-01'):
        from .v2016_12_01 import NetworkManagementClient as ClientClass
    elif (self.api_version == '2016-09-01'):
        from .v2016_09_01 import NetworkManagementClient as ClientClass
    elif (self.api_version == '2015-06-15'):
        from .v2015_06_15 import NetworkManagementClient as ClientClass
    localclient = ClientClass(self.config.credentials, self.config.subscription_id, self.config.base_url)
    return localclient.check_dns_name_availability(location, domain_name_label, custom_headers, raw, **operation_config)
