# Source code for azure.mgmt.web.operations.hosting_environments_operations

    # coding=utf-8
    # --------------------------------------------------------------------------
    # Copyright (c) Microsoft Corporation. All rights reserved.
    # Licensed under the MIT License. See License.txt in the project root for
    # license information.
    #
    # Code generated by Microsoft (R) AutoRest Code Generator.
    # Changes may cause incorrect behavior and will be lost if the code is
    # regenerated.
    # --------------------------------------------------------------------------

    from msrest.pipeline import ClientRawResponse
    from msrestazure.azure_exceptions import CloudError
    from msrestazure.azure_operation import AzureOperationPoller
    import uuid

    from .. import models

    class HostingEnvironmentsOperations(object):
        """HostingEnvironmentsOperations operations.

        :param client: Client for service requests.
        :param config: Configuration of service client.
        :param serializer: An object model serializer.
        :param deserializer: An objec model deserializer.
        """

        def __init__(self, client, config, serializer, deserializer):

            self._client = client
            self._serialize = serializer
            self._deserialize = deserializer

            self.config = config

        def get_hosting_environment(
                self, resource_group_name, name, custom_headers=None, raw=False, **operation_config):
            """Get properties of hostingEnvironment (App Service Environment).

            :param resource_group_name: Name of resource group
            :type resource_group_name: str
            :param name: Name of hostingEnvironment (App Service Environment)
            :type name: 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:`HostingEnvironment
             <azure.mgmt.web.models.HostingEnvironment>`
            :rtype: :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>`
             if raw=true
            """
            # Construct URL
            url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}'
            path_format_arguments = {
                'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
                'name': self._serialize.url("name", name, 'str'),
                'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
            }
            url = self._client.format_url(url, **path_format_arguments)

            # Construct parameters
            query_parameters = {}
            query_parameters['api-version'] = self._serialize.query("self.config.api_version", self.config.api_version, 'str')

            # Construct headers
            header_parameters = {}
            header_parameters['Content-Type'] = 'application/json; charset=utf-8'
            if self.config.generate_client_request_id:
                header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
            if custom_headers:
                header_parameters.update(custom_headers)
            if self.config.accept_language is not None:
                header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')

            # Construct and send request
            request = self._client.get(url, query_parameters)
            response = self._client.send(request, header_parameters, **operation_config)

            if response.status_code not in [200]:
                exp = CloudError(response)
                exp.request_id = response.headers.get('x-ms-request-id')
                raise exp

            deserialized = None

            if response.status_code == 200:
                deserialized = self._deserialize('HostingEnvironment', response)

            if raw:
                client_raw_response = ClientRawResponse(deserialized, response)
                return client_raw_response

            return deserialized

        def create_or_update_hosting_environment(
                self, resource_group_name, name, hosting_environment_envelope, custom_headers=None, raw=False, **operation_config):
            """Create or update a hostingEnvironment (App Service Environment).

            :param resource_group_name: Name of resource group
            :type resource_group_name: str
            :param name: Name of hostingEnvironment (App Service Environment)
            :type name: str
            :param hosting_environment_envelope: Properties of hostingEnvironment
             (App Service Environment)
            :type hosting_environment_envelope: :class:`HostingEnvironment
             <azure.mgmt.web.models.HostingEnvironment>`
            :param dict custom_headers: headers that will be added to the request
            :param bool raw: returns the direct response alongside the
             deserialized response
            :rtype:
             :class:`AzureOperationPoller<msrestazure.azure_operation.AzureOperationPoller>`
             instance that returns :class:`HostingEnvironment
             <azure.mgmt.web.models.HostingEnvironment>`
            :rtype: :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>`
             if raw=true
            """
            # Construct URL
            url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}'
            path_format_arguments = {
                'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
                'name': self._serialize.url("name", name, 'str'),
                'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
            }
            url = self._client.format_url(url, **path_format_arguments)

            # Construct parameters
            query_parameters = {}
            query_parameters['api-version'] = self._serialize.query("self.config.api_version", self.config.api_version, 'str')

            # Construct headers
            header_parameters = {}
            header_parameters['Content-Type'] = 'application/json; charset=utf-8'
            if self.config.generate_client_request_id:
                header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
            if custom_headers:
                header_parameters.update(custom_headers)
            if self.config.accept_language is not None:
                header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')

            # Construct body
            body_content = self._serialize.body(hosting_environment_envelope, 'HostingEnvironment')

            # Construct and send request
            def long_running_send():

                request = self._client.put(url, query_parameters)
                return self._client.send(
                    request, header_parameters, body_content, **operation_config)

            def get_long_running_status(status_link, headers=None):

                request = self._client.get(status_link)
                if headers:
                    request.headers.update(headers)
                return self._client.send(
                    request, header_parameters, **operation_config)

            def get_long_running_output(response):

                if response.status_code not in [200, 202, 400, 404, 409]:
                    exp = CloudError(response)
                    exp.request_id = response.headers.get('x-ms-request-id')
                    raise exp

                deserialized = None

                if response.status_code == 200:
                    deserialized = self._deserialize('HostingEnvironment', response)
                if response.status_code == 202:
                    deserialized = self._deserialize('HostingEnvironment', response)

                if raw:
                    client_raw_response = ClientRawResponse(deserialized, response)
                    return client_raw_response

                return deserialized

            if raw:
                response = long_running_send()
                return get_long_running_output(response)

            long_running_operation_timeout = operation_config.get(
                'long_running_operation_timeout',
                self.config.long_running_operation_timeout)
            return AzureOperationPoller(
                long_running_send, get_long_running_output,
                get_long_running_status, long_running_operation_timeout)

        def delete_hosting_environment(
                self, resource_group_name, name, force_delete=None, custom_headers=None, raw=False, **operation_config):
            """Delete a hostingEnvironment (App Service Environment).

            :param resource_group_name: Name of resource group
            :type resource_group_name: str
            :param name: Name of hostingEnvironment (App Service Environment)
            :type name: str
            :param force_delete: Delete even if the hostingEnvironment (App
             Service Environment) contains resources
            :type force_delete: bool
            :param dict custom_headers: headers that will be added to the request
            :param bool raw: returns the direct response alongside the
             deserialized response
            :rtype:
             :class:`AzureOperationPoller<msrestazure.azure_operation.AzureOperationPoller>`
             instance that returns object
            :rtype: :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>`
             if raw=true
            """
            # Construct URL
            url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}'
            path_format_arguments = {
                'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
                'name': self._serialize.url("name", name, 'str'),
                'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
            }
            url = self._client.format_url(url, **path_format_arguments)

            # Construct parameters
            query_parameters = {}
            if force_delete is not None:
                query_parameters['forceDelete'] = self._serialize.query("force_delete", force_delete, 'bool')
            query_parameters['api-version'] = self._serialize.query("self.config.api_version", self.config.api_version, 'str')

            # Construct headers
            header_parameters = {}
            header_parameters['Content-Type'] = 'application/json; charset=utf-8'
            if self.config.generate_client_request_id:
                header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
            if custom_headers:
                header_parameters.update(custom_headers)
            if self.config.accept_language is not None:
                header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')

            # Construct and send request
            def long_running_send():

                request = self._client.delete(url, query_parameters)
                return self._client.send(request, header_parameters, **operation_config)

            def get_long_running_status(status_link, headers=None):

                request = self._client.get(status_link)
                if headers:
                    request.headers.update(headers)
                return self._client.send(
                    request, header_parameters, **operation_config)

            def get_long_running_output(response):

                if response.status_code not in [200, 202, 400, 404, 409]:
                    exp = CloudError(response)
                    exp.request_id = response.headers.get('x-ms-request-id')
                    raise exp

                deserialized = None

                if response.status_code == 200:
                    deserialized = self._deserialize('object', response)
                if response.status_code == 202:
                    deserialized = self._deserialize('object', response)

                if raw:
                    client_raw_response = ClientRawResponse(deserialized, response)
                    return client_raw_response

                return deserialized

            if raw:
                response = long_running_send()
                return get_long_running_output(response)

            long_running_operation_timeout = operation_config.get(
                'long_running_operation_timeout',
                self.config.long_running_operation_timeout)
            return AzureOperationPoller(
                long_running_send, get_long_running_output,
                get_long_running_status, long_running_operation_timeout)

        def get_hosting_environment_diagnostics(
                self, resource_group_name, name, custom_headers=None, raw=False, **operation_config):
            """Get diagnostic information for hostingEnvironment (App Service
            Environment).

            :param resource_group_name: Name of resource group
            :type resource_group_name: str
            :param name: Name of hostingEnvironment (App Service Environment)
            :type name: 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: list of :class:`HostingEnvironmentDiagnostics
             <azure.mgmt.web.models.HostingEnvironmentDiagnostics>`
            :rtype: :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>`
             if raw=true
            """
            # Construct URL
            url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/diagnostics'
            path_format_arguments = {
                'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
                'name': self._serialize.url("name", name, 'str'),
                'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
            }
            url = self._client.format_url(url, **path_format_arguments)

            # Construct parameters
            query_parameters = {}
            query_parameters['api-version'] = self._serialize.query("self.config.api_version", self.config.api_version, 'str')

            # Construct headers
            header_parameters = {}
            header_parameters['Content-Type'] = 'application/json; charset=utf-8'
            if self.config.generate_client_request_id:
                header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
            if custom_headers:
                header_parameters.update(custom_headers)
            if self.config.accept_language is not None:
                header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')

            # Construct and send request
            request = self._client.get(url, query_parameters)
            response = self._client.send(request, header_parameters, **operation_config)

            if response.status_code not in [200]:
                exp = CloudError(response)
                exp.request_id = response.headers.get('x-ms-request-id')
                raise exp

            deserialized = None

            if response.status_code == 200:
                deserialized = self._deserialize('[HostingEnvironmentDiagnostics]', response)

            if raw:
                client_raw_response = ClientRawResponse(deserialized, response)
                return client_raw_response

            return deserialized

        def get_hosting_environment_diagnostics_item(
                self, resource_group_name, name, diagnostics_name, custom_headers=None, raw=False, **operation_config):
            """Get diagnostic information for hostingEnvironment (App Service
            Environment).

            :param resource_group_name: Name of resource group
            :type resource_group_name: str
            :param name: Name of hostingEnvironment (App Service Environment)
            :type name: str
            :param diagnostics_name: Name of the diagnostics
            :type diagnostics_name: 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:`HostingEnvironmentDiagnostics
             <azure.mgmt.web.models.HostingEnvironmentDiagnostics>`
            :rtype: :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>`
             if raw=true
            """
            # Construct URL
            url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/diagnostics/{diagnosticsName}'
            path_format_arguments = {
                'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
                'name': self._serialize.url("name", name, 'str'),
                'diagnosticsName': self._serialize.url("diagnostics_name", diagnostics_name, 'str'),
                'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
            }
            url = self._client.format_url(url, **path_format_arguments)

            # Construct parameters
            query_parameters = {}
            query_parameters['api-version'] = self._serialize.query("self.config.api_version", self.config.api_version, 'str')

            # Construct headers
            header_parameters = {}
            header_parameters['Content-Type'] = 'application/json; charset=utf-8'
            if self.config.generate_client_request_id:
                header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
            if custom_headers:
                header_parameters.update(custom_headers)
            if self.config.accept_language is not None:
                header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')

            # Construct and send request
            request = self._client.get(url, query_parameters)
            response = self._client.send(request, header_parameters, **operation_config)

            if response.status_code not in [200]:
                exp = CloudError(response)
                exp.request_id = response.headers.get('x-ms-request-id')
                raise exp

            deserialized = None

            if response.status_code == 200:
                deserialized = self._deserialize('HostingEnvironmentDiagnostics', response)

            if raw:
                client_raw_response = ClientRawResponse(deserialized, response)
                return client_raw_response

            return deserialized

        def get_hosting_environment_capacities(
                self, resource_group_name, name, custom_headers=None, raw=False, **operation_config):
            """Get used, available, and total worker capacity for hostingEnvironment
            (App Service Environment).

            :param resource_group_name: Name of resource group
            :type resource_group_name: str
            :param name: Name of hostingEnvironment (App Service Environment)
            :type name: 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:`StampCapacityPaged
             <azure.mgmt.web.models.StampCapacityPaged>`
            """
            def internal_paging(next_link=None, raw=False):

                if not next_link:
                    # Construct URL
                    url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/capacities/compute'
                    path_format_arguments = {
                        'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
                        'name': self._serialize.url("name", name, 'str'),
                        'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
                    }
                    url = self._client.format_url(url, **path_format_arguments)

                    # Construct parameters
                    query_parameters = {}
                    query_parameters['api-version'] = self._serialize.query("self.config.api_version", self.config.api_version, 'str')

                else:
                    url = next_link
                    query_parameters = {}

                # Construct headers
                header_parameters = {}
                header_parameters['Content-Type'] = 'application/json; charset=utf-8'
                if self.config.generate_client_request_id:
                    header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
                if custom_headers:
                    header_parameters.update(custom_headers)
                if self.config.accept_language is not None:
                    header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')

                # Construct and send request
                request = self._client.get(url, query_parameters)
                response = self._client.send(
                    request, header_parameters, **operation_config)

                if response.status_code not in [200]:
                    exp = CloudError(response)
                    exp.request_id = response.headers.get('x-ms-request-id')
                    raise exp

                return response

            # Deserialize response
            deserialized = models.StampCapacityPaged(internal_paging, self._deserialize.dependencies)

            if raw:
                header_dict = {}
                client_raw_response = models.StampCapacityPaged(internal_paging, self._deserialize.dependencies, header_dict)
                return client_raw_response

            return deserialized

        def get_hosting_environment_vips(
                self, resource_group_name, name, custom_headers=None, raw=False, **operation_config):
            """Get IP addresses assigned to the hostingEnvironment (App Service
            Environment).

            :param resource_group_name: Name of resource group
            :type resource_group_name: str
            :param name: Name of hostingEnvironment (App Service Environment)
            :type name: 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:`AddressResponse
             <azure.mgmt.web.models.AddressResponse>`
            :rtype: :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>`
             if raw=true
            """
            # Construct URL
            url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/capacities/virtualip'
            path_format_arguments = {
                'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
                'name': self._serialize.url("name", name, 'str'),
                'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
            }
            url = self._client.format_url(url, **path_format_arguments)

            # Construct parameters
            query_parameters = {}
            query_parameters['api-version'] = self._serialize.query("self.config.api_version", self.config.api_version, 'str')

            # Construct headers
            header_parameters = {}
            header_parameters['Content-Type'] = 'application/json; charset=utf-8'
            if self.config.generate_client_request_id:
                header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
            if custom_headers:
                header_parameters.update(custom_headers)
            if self.config.accept_language is not None:
                header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')

            # Construct and send request
            request = self._client.get(url, query_parameters)
            response = self._client.send(request, header_parameters, **operation_config)

            if response.status_code not in [200]:
                exp = CloudError(response)
                exp.request_id = response.headers.get('x-ms-request-id')
                raise exp

            deserialized = None

            if response.status_code == 200:
                deserialized = self._deserialize('AddressResponse', response)

            if raw:
                client_raw_response = ClientRawResponse(deserialized, response)
                return client_raw_response

            return deserialized

        def get_hosting_environments(
                self, resource_group_name, custom_headers=None, raw=False, **operation_config):
            """Get all hostingEnvironments (App Service Environments) in a resource
            group.

            :param resource_group_name: Name of resource group
            :type resource_group_name: 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:`HostingEnvironmentPaged
             <azure.mgmt.web.models.HostingEnvironmentPaged>`
            """
            def internal_paging(next_link=None, raw=False):

                if not next_link:
                    # Construct URL
                    url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments'
                    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 = {}
                    query_parameters['api-version'] = self._serialize.query("self.config.api_version", self.config.api_version, 'str')

                else:
                    url = next_link
                    query_parameters = {}

                # Construct headers
                header_parameters = {}
                header_parameters['Content-Type'] = 'application/json; charset=utf-8'
                if self.config.generate_client_request_id:
                    header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
                if custom_headers:
                    header_parameters.update(custom_headers)
                if self.config.accept_language is not None:
                    header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')

                # Construct and send request
                request = self._client.get(url, query_parameters)
                response = self._client.send(
                    request, header_parameters, **operation_config)

                if response.status_code not in [200]:
                    exp = CloudError(response)
                    exp.request_id = response.headers.get('x-ms-request-id')
                    raise exp

                return response

            # Deserialize response
            deserialized = models.HostingEnvironmentPaged(internal_paging, self._deserialize.dependencies)

            if raw:
                header_dict = {}
                client_raw_response = models.HostingEnvironmentPaged(internal_paging, self._deserialize.dependencies, header_dict)
                return client_raw_response

            return deserialized

        def reboot_hosting_environment(
                self, resource_group_name, name, custom_headers=None, raw=False, **operation_config):
            """Reboots all machines in a hostingEnvironment (App Service Environment).

            :param resource_group_name: Name of resource group
            :type resource_group_name: str
            :param name: Name of hostingEnvironment (App Service Environment)
            :type name: 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: object
            :rtype: :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>`
             if raw=true
            """
            # Construct URL
            url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/reboot'
            path_format_arguments = {
                'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
                'name': self._serialize.url("name", name, 'str'),
                'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
            }
            url = self._client.format_url(url, **path_format_arguments)

            # Construct parameters
            query_parameters = {}
            query_parameters['api-version'] = self._serialize.query("self.config.api_version", self.config.api_version, 'str')

            # Construct headers
            header_parameters = {}
            header_parameters['Content-Type'] = 'application/json; charset=utf-8'
            if self.config.generate_client_request_id:
                header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
            if custom_headers:
                header_parameters.update(custom_headers)
            if self.config.accept_language is not None:
                header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')

            # Construct and send request
            request = self._client.post(url, query_parameters)
            response = self._client.send(request, header_parameters, **operation_config)

            if response.status_code not in [202, 400, 404, 409]:
                exp = CloudError(response)
                exp.request_id = response.headers.get('x-ms-request-id')
                raise exp

            deserialized = None

            if response.status_code == 202:
                deserialized = self._deserialize('object', response)

            if raw:
                client_raw_response = ClientRawResponse(deserialized, response)
                return client_raw_response

            return deserialized

        def get_hosting_environment_operations(
                self, resource_group_name, name, custom_headers=None, raw=False, **operation_config):
            """List all currently running operations on the hostingEnvironment (App
            Service Environment).

            :param resource_group_name: Name of resource group
            :type resource_group_name: str
            :param name: Name of hostingEnvironment (App Service Environment)
            :type name: 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: object
            :rtype: :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>`
             if raw=true
            """
            # Construct URL
            url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/operations'
            path_format_arguments = {
                'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
                'name': self._serialize.url("name", name, 'str'),
                'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
            }
            url = self._client.format_url(url, **path_format_arguments)

            # Construct parameters
            query_parameters = {}
            query_parameters['api-version'] = self._serialize.query("self.config.api_version", self.config.api_version, 'str')

            # Construct headers
            header_parameters = {}
            header_parameters['Content-Type'] = 'application/json; charset=utf-8'
            if self.config.generate_client_request_id:
                header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
            if custom_headers:
                header_parameters.update(custom_headers)
            if self.config.accept_language is not None:
                header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')

            # Construct and send request
            request = self._client.get(url, query_parameters)
            response = self._client.send(request, header_parameters, **operation_config)

            if response.status_code not in [200]:
                exp = CloudError(response)
                exp.request_id = response.headers.get('x-ms-request-id')
                raise exp

            deserialized = None

            if response.status_code == 200:
                deserialized = self._deserialize('object', response)

            if raw:
                client_raw_response = ClientRawResponse(deserialized, response)
                return client_raw_response

            return deserialized

        def get_hosting_environment_operation(
                self, resource_group_name, name, operation_id, custom_headers=None, raw=False, **operation_config):
            """Get status of an operation on a hostingEnvironment (App Service
            Environment).

            :param resource_group_name: Name of resource group
            :type resource_group_name: str
            :param name: Name of hostingEnvironment (App Service Environment)
            :type name: str
            :param operation_id: operation identifier GUID
            :type operation_id: 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: object
            :rtype: :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>`
             if raw=true
            """
            # Construct URL
            url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/operations/{operationId}'
            path_format_arguments = {
                'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
                'name': self._serialize.url("name", name, 'str'),
                'operationId': self._serialize.url("operation_id", operation_id, 'str'),
                'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
            }
            url = self._client.format_url(url, **path_format_arguments)

            # Construct parameters
            query_parameters = {}
            query_parameters['api-version'] = self._serialize.query("self.config.api_version", self.config.api_version, 'str')

            # Construct headers
            header_parameters = {}
            header_parameters['Content-Type'] = 'application/json; charset=utf-8'
            if self.config.generate_client_request_id:
                header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
            if custom_headers:
                header_parameters.update(custom_headers)
            if self.config.accept_language is not None:
                header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')

            # Construct and send request
            request = self._client.get(url, query_parameters)
            response = self._client.send(request, header_parameters, **operation_config)

            if response.status_code not in [200, 202, 404, 500]:
                exp = CloudError(response)
                exp.request_id = response.headers.get('x-ms-request-id')
                raise exp

            deserialized = None

            if response.status_code == 200:
                deserialized = self._deserialize('object', response)
            if response.status_code == 202:
                deserialized = self._deserialize('object', response)

            if raw:
                client_raw_response = ClientRawResponse(deserialized, response)
                return client_raw_response

            return deserialized

        def get_hosting_environment_metrics(
                self, resource_group_name, name, details=None, filter=None, custom_headers=None, raw=False, **operation_config):
            """Get global metrics of hostingEnvironment (App Service Environment).

            :param resource_group_name: Name of resource group
            :type resource_group_name: str
            :param name: Name of hostingEnvironment (App Service Environment)
            :type name: str
            :param details: Include instance details
            :type details: bool
            :param filter: Return only usages/metrics specified in the filter.
             Filter conforms to odata syntax. Example: $filter=(name.value eq
             'Metric1' or name.value eq 'Metric2') and startTime eq
             '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and
             timeGrain eq duration'[Hour|Minute|Day]'.
            :type filter: 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:`ResourceMetricPaged
             <azure.mgmt.web.models.ResourceMetricPaged>`
            """
            def internal_paging(next_link=None, raw=False):

                if not next_link:
                    # Construct URL
                    url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/metrics'
                    path_format_arguments = {
                        'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
                        'name': self._serialize.url("name", name, 'str'),
                        'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
                    }
                    url = self._client.format_url(url, **path_format_arguments)

                    # Construct parameters
                    query_parameters = {}
                    if details is not None:
                        query_parameters['details'] = self._serialize.query("details", details, 'bool')
                    if filter is not None:
                        query_parameters['$filter'] = self._serialize.query("filter", filter, 'str')
                    query_parameters['api-version'] = self._serialize.query("self.config.api_version", self.config.api_version, 'str')

                else:
                    url = next_link
                    query_parameters = {}

                # Construct headers
                header_parameters = {}
                header_parameters['Content-Type'] = 'application/json; charset=utf-8'
                if self.config.generate_client_request_id:
                    header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
                if custom_headers:
                    header_parameters.update(custom_headers)
                if self.config.accept_language is not None:
                    header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')

                # Construct and send request
                request = self._client.get(url, query_parameters)
                response = self._client.send(
                    request, header_parameters, **operation_config)

                if response.status_code not in [200]:
                    exp = CloudError(response)
                    exp.request_id = response.headers.get('x-ms-request-id')
                    raise exp

                return response

            # Deserialize response
            deserialized = models.ResourceMetricPaged(internal_paging, self._deserialize.dependencies)

            if raw:
                header_dict = {}
                client_raw_response = models.ResourceMetricPaged(internal_paging, self._deserialize.dependencies, header_dict)
                return client_raw_response

            return deserialized

        def get_hosting_environment_metric_definitions(
                self, resource_group_name, name, custom_headers=None, raw=False, **operation_config):
            """Get global metric definitions of hostingEnvironment (App Service
            Environment).

            :param resource_group_name: Name of resource group
            :type resource_group_name: str
            :param name: Name of hostingEnvironment (App Service Environment)
            :type name: 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:`MetricDefinition
             <azure.mgmt.web.models.MetricDefinition>`
            :rtype: :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>`
             if raw=true
            """
            # Construct URL
            url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/metricdefinitions'
            path_format_arguments = {
                'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
                'name': self._serialize.url("name", name, 'str'),
                'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
            }
            url = self._client.format_url(url, **path_format_arguments)

            # Construct parameters
            query_parameters = {}
            query_parameters['api-version'] = self._serialize.query("self.config.api_version", self.config.api_version, 'str')

            # Construct headers
            header_parameters = {}
            header_parameters['Content-Type'] = 'application/json; charset=utf-8'
            if self.config.generate_client_request_id:
                header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
            if custom_headers:
                header_parameters.update(custom_headers)
            if self.config.accept_language is not None:
                header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')

            # Construct and send request
            request = self._client.get(url, query_parameters)
            response = self._client.send(request, header_parameters, **operation_config)

            if response.status_code not in [200]:
                exp = CloudError(response)
                exp.request_id = response.headers.get('x-ms-request-id')
                raise exp

            deserialized = None

            if response.status_code == 200:
                deserialized = self._deserialize('MetricDefinition', response)

            if raw:
                client_raw_response = ClientRawResponse(deserialized, response)
                return client_raw_response

            return deserialized

        def get_hosting_environment_usages(
                self, resource_group_name, name, filter=None, custom_headers=None, raw=False, **operation_config):
            """Get global usages of hostingEnvironment (App Service Environment).

            :param resource_group_name: Name of resource group
            :type resource_group_name: str
            :param name: Name of hostingEnvironment (App Service Environment)
            :type name: str
            :param filter: Return only usages/metrics specified in the filter.
             Filter conforms to odata syntax. Example: $filter=(name.value eq
             'Metric1' or name.value eq 'Metric2') and startTime eq
             '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and
             timeGrain eq duration'[Hour|Minute|Day]'.
            :type filter: 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:`CsmUsageQuotaPaged
             <azure.mgmt.web.models.CsmUsageQuotaPaged>`
            """
            def internal_paging(next_link=None, raw=False):

                if not next_link:
                    # Construct URL
                    url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/usages'
                    path_format_arguments = {
                        'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
                        'name': self._serialize.url("name", name, 'str'),
                        'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
                    }
                    url = self._client.format_url(url, **path_format_arguments)

                    # Construct parameters
                    query_parameters = {}
                    if filter is not None:
                        query_parameters['$filter'] = self._serialize.query("filter", filter, 'str')
                    query_parameters['api-version'] = self._serialize.query("self.config.api_version", self.config.api_version, 'str')

                else:
                    url = next_link
                    query_parameters = {}

                # Construct headers
                header_parameters = {}
                header_parameters['Content-Type'] = 'application/json; charset=utf-8'
                if self.config.generate_client_request_id:
                    header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
                if custom_headers:
                    header_parameters.update(custom_headers)
                if self.config.accept_language is not None:
                    header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')

                # Construct and send request
                request = self._client.get(url, query_parameters)
                response = self._client.send(
                    request, header_parameters, **operation_config)

                if response.status_code not in [200]:
                    exp = CloudError(response)
                    exp.request_id = response.headers.get('x-ms-request-id')
                    raise exp

                return response

            # Deserialize response
            deserialized = models.CsmUsageQuotaPaged(internal_paging, self._deserialize.dependencies)

            if raw:
                header_dict = {}
                client_raw_response = models.CsmUsageQuotaPaged(internal_paging, self._deserialize.dependencies, header_dict)
                return client_raw_response

            return deserialized

        def get_hosting_environment_multi_role_metrics(
                self, resource_group_name, name, start_time=None, end_time=None, time_grain=None, details=None, filter=None, custom_headers=None, raw=False, **operation_config):
            """Get metrics for a multiRole pool of a hostingEnvironment (App Service
            Environment).

            :param resource_group_name: Name of resource group
            :type resource_group_name: str
            :param name: Name of hostingEnvironment (App Service Environment)
            :type name: str
            :param start_time: Beginning time of metrics query
            :type start_time: str
            :param end_time: End time of metrics query
            :type end_time: str
            :param time_grain: Time granularity of metrics query
            :type time_grain: str
            :param details: Include instance details
            :type details: bool
            :param filter: Return only usages/metrics specified in the filter.
             Filter conforms to odata syntax. Example: $filter=(name.value eq
             'Metric1' or name.value eq 'Metric2') and startTime eq
             '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and
             timeGrain eq duration'[Hour|Minute|Day]'.
            :type filter: 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:`ResourceMetricPaged
             <azure.mgmt.web.models.ResourceMetricPaged>`
            """
            def internal_paging(next_link=None, raw=False):

                if not next_link:
                    # Construct URL
                    url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/metrics'
                    path_format_arguments = {
                        'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
                        'name': self._serialize.url("name", name, 'str'),
                        'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
                    }
                    url = self._client.format_url(url, **path_format_arguments)

                    # Construct parameters
                    query_parameters = {}
                    if start_time is not None:
                        query_parameters['startTime'] = self._serialize.query("start_time", start_time, 'str')
                    if end_time is not None:
                        query_parameters['endTime'] = self._serialize.query("end_time", end_time, 'str')
                    if time_grain is not None:
                        query_parameters['timeGrain'] = self._serialize.query("time_grain", time_grain, 'str')
                    if details is not None:
                        query_parameters['details'] = self._serialize.query("details", details, 'bool')
                    if filter is not None:
                        query_parameters['$filter'] = self._serialize.query("filter", filter, 'str')
                    query_parameters['api-version'] = self._serialize.query("self.config.api_version", self.config.api_version, 'str')

                else:
                    url = next_link
                    query_parameters = {}

                # Construct headers
                header_parameters = {}
                header_parameters['Content-Type'] = 'application/json; charset=utf-8'
                if self.config.generate_client_request_id:
                    header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
                if custom_headers:
                    header_parameters.update(custom_headers)
                if self.config.accept_language is not None:
                    header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')

                # Construct and send request
                request = self._client.get(url, query_parameters)
                response = self._client.send(
                    request, header_parameters, **operation_config)

                if response.status_code not in [200]:
                    exp = CloudError(response)
                    exp.request_id = response.headers.get('x-ms-request-id')
                    raise exp

                return response

            # Deserialize response
            deserialized = models.ResourceMetricPaged(internal_paging, self._deserialize.dependencies)

            if raw:
                header_dict = {}
                client_raw_response = models.ResourceMetricPaged(internal_paging, self._deserialize.dependencies, header_dict)
                return client_raw_response

            return deserialized

        def get_hosting_environment_web_worker_metrics(
                self, resource_group_name, name, worker_pool_name, details=None, filter=None, custom_headers=None, raw=False, **operation_config):
            """Get metrics for a worker pool of a hostingEnvironment (App Service
            Environment).

            :param resource_group_name: Name of resource group
            :type resource_group_name: str
            :param name: Name of hostingEnvironment (App Service Environment)
            :type name: str
            :param worker_pool_name: Name of worker pool
            :type worker_pool_name: str
            :param details: Include instance details
            :type details: bool
            :param filter: Return only usages/metrics specified in the filter.
             Filter conforms to odata syntax. Example: $filter=(name.value eq
             'Metric1' or name.value eq 'Metric2') and startTime eq
             '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and
             timeGrain eq duration'[Hour|Minute|Day]'.
            :type filter: 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:`ResourceMetricPaged
             <azure.mgmt.web.models.ResourceMetricPaged>`
            """
            def internal_paging(next_link=None, raw=False):

                if not next_link:
                    # Construct URL
                    url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/metrics'
                    path_format_arguments = {
                        'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
                        'name': self._serialize.url("name", name, 'str'),
                        'workerPoolName': self._serialize.url("worker_pool_name", worker_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 = {}
                    if details is not None:
                        query_parameters['details'] = self._serialize.query("details", details, 'bool')
                    if filter is not None:
                        query_parameters['$filter'] = self._serialize.query("filter", filter, 'str')
                    query_parameters['api-version'] = self._serialize.query("self.config.api_version", self.config.api_version, 'str')

                else:
                    url = next_link
                    query_parameters = {}

                # Construct headers
                header_parameters = {}
                header_parameters['Content-Type'] = 'application/json; charset=utf-8'
                if self.config.generate_client_request_id:
                    header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
                if custom_headers:
                    header_parameters.update(custom_headers)
                if self.config.accept_language is not None:
                    header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')

                # Construct and send request
                request = self._client.get(url, query_parameters)
                response = self._client.send(
                    request, header_parameters, **operation_config)

                if response.status_code not in [200]:
                    exp = CloudError(response)
                    exp.request_id = response.headers.get('x-ms-request-id')
                    raise exp

                return response

            # Deserialize response
            deserialized = models.ResourceMetricPaged(internal_paging, self._deserialize.dependencies)

            if raw:
                header_dict = {}
                client_raw_response = models.ResourceMetricPaged(internal_paging, self._deserialize.dependencies, header_dict)
                return client_raw_response

            return deserialized

        def get_hosting_environment_multi_role_metric_definitions(
                self, resource_group_name, name, custom_headers=None, raw=False, **operation_config):
            """Get metric definitions for a multiRole pool of a hostingEnvironment
            (App Service Environment).

            :param resource_group_name: Name of resource group
            :type resource_group_name: str
            :param name: Name of hostingEnvironment (App Service Environment)
            :type name: 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:`MetricDefinitionPaged
             <azure.mgmt.web.models.MetricDefinitionPaged>`
            """
            def internal_paging(next_link=None, raw=False):

                if not next_link:
                    # Construct URL
                    url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/metricdefinitions'
                    path_format_arguments = {
                        'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
                        'name': self._serialize.url("name", name, 'str'),
                        'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
                    }
                    url = self._client.format_url(url, **path_format_arguments)

                    # Construct parameters
                    query_parameters = {}
                    query_parameters['api-version'] = self._serialize.query("self.config.api_version", self.config.api_version, 'str')

                else:
                    url = next_link
                    query_parameters = {}

                # Construct headers
                header_parameters = {}
                header_parameters['Content-Type'] = 'application/json; charset=utf-8'
                if self.config.generate_client_request_id:
                    header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
                if custom_headers:
                    header_parameters.update(custom_headers)
                if self.config.accept_language is not None:
                    header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')

                # Construct and send request
                request = self._client.get(url, query_parameters)
                response = self._client.send(
                    request, header_parameters, **operation_config)

                if response.status_code not in [200]:
                    exp = CloudError(response)
                    exp.request_id = response.headers.get('x-ms-request-id')
                    raise exp

                return response

            # Deserialize response
            deserialized = models.MetricDefinitionPaged(internal_paging, self._deserialize.dependencies)

            if raw:
                header_dict = {}
                client_raw_response = models.MetricDefinitionPaged(internal_paging, self._deserialize.dependencies, header_dict)
                return client_raw_response

            return deserialized

        def get_hosting_environment_web_worker_metric_definitions(
                self, resource_group_name, name, worker_pool_name, custom_headers=None, raw=False, **operation_config):
            """Get metric definitions for a worker pool of a hostingEnvironment (App
            Service Environment).

            :param resource_group_name: Name of resource group
            :type resource_group_name: str
            :param name: Name of hostingEnvironment (App Service Environment)
            :type name: str
            :param worker_pool_name: Name of worker pool
            :type worker_pool_name: 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:`MetricDefinitionPaged
             <azure.mgmt.web.models.MetricDefinitionPaged>`
            """
            def internal_paging(next_link=None, raw=False):

                if not next_link:
                    # Construct URL
                    url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/metricdefinitions'
                    path_format_arguments = {
                        'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
                        'name': self._serialize.url("name", name, 'str'),
                        'workerPoolName': self._serialize.url("worker_pool_name", worker_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 = {}
                    query_parameters['api-version'] = self._serialize.query("self.config.api_version", self.config.api_version, 'str')

                else:
                    url = next_link
                    query_parameters = {}

                # Construct headers
                header_parameters = {}
                header_parameters['Content-Type'] = 'application/json; charset=utf-8'
                if self.config.generate_client_request_id:
                    header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
                if custom_headers:
                    header_parameters.update(custom_headers)
                if self.config.accept_language is not None:
                    header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')

                # Construct and send request
                request = self._client.get(url, query_parameters)
                response = self._client.send(
                    request, header_parameters, **operation_config)

                if response.status_code not in [200]:
                    exp = CloudError(response)
                    exp.request_id = response.headers.get('x-ms-request-id')
                    raise exp

                return response

            # Deserialize response
            deserialized = models.MetricDefinitionPaged(internal_paging, self._deserialize.dependencies)

            if raw:
                header_dict = {}
                client_raw_response = models.MetricDefinitionPaged(internal_paging, self._deserialize.dependencies, header_dict)
                return client_raw_response

            return deserialized

        def get_hosting_environment_multi_role_usages(
                self, resource_group_name, name, custom_headers=None, raw=False, **operation_config):
            """Get usages for a multiRole pool of a hostingEnvironment (App Service
            Environment).

            :param resource_group_name: Name of resource group
            :type resource_group_name: str
            :param name: Name of hostingEnvironment (App Service Environment)
            :type name: 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:`UsagePaged <azure.mgmt.web.models.UsagePaged>`
            """
            def internal_paging(next_link=None, raw=False):

                if not next_link:
                    # Construct URL
                    url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/usages'
                    path_format_arguments = {
                        'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
                        'name': self._serialize.url("name", name, 'str'),
                        'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
                    }
                    url = self._client.format_url(url, **path_format_arguments)

                    # Construct parameters
                    query_parameters = {}
                    query_parameters['api-version'] = self._serialize.query("self.config.api_version", self.config.api_version, 'str')

                else:
                    url = next_link
                    query_parameters = {}

                # Construct headers
                header_parameters = {}
                header_parameters['Content-Type'] = 'application/json; charset=utf-8'
                if self.config.generate_client_request_id:
                    header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
                if custom_headers:
                    header_parameters.update(custom_headers)
                if self.config.accept_language is not None:
                    header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')

                # Construct and send request
                request = self._client.get(url, query_parameters)
                response = self._client.send(
                    request, header_parameters, **operation_config)

                if response.status_code not in [200]:
                    exp = CloudError(response)
                    exp.request_id = response.headers.get('x-ms-request-id')
                    raise exp

                return response

            # Deserialize response
            deserialized = models.UsagePaged(internal_paging, self._deserialize.dependencies)

            if raw:
                header_dict = {}
                client_raw_response = models.UsagePaged(internal_paging, self._deserialize.dependencies, header_dict)
                return client_raw_response

            return deserialized

        def get_hosting_environment_web_worker_usages(
                self, resource_group_name, name, worker_pool_name, custom_headers=None, raw=False, **operation_config):
            """Get usages for a worker pool of a hostingEnvironment (App Service
            Environment).

            :param resource_group_name: Name of resource group
            :type resource_group_name: str
            :param name: Name of hostingEnvironment (App Service Environment)
            :type name: str
            :param worker_pool_name: Name of worker pool
            :type worker_pool_name: 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:`UsagePaged <azure.mgmt.web.models.UsagePaged>`
            """
            def internal_paging(next_link=None, raw=False):

                if not next_link:
                    # Construct URL
                    url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/usages'
                    path_format_arguments = {
                        'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
                        'name': self._serialize.url("name", name, 'str'),
                        'workerPoolName': self._serialize.url("worker_pool_name", worker_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 = {}
                    query_parameters['api-version'] = self._serialize.query("self.config.api_version", self.config.api_version, 'str')

                else:
                    url = next_link
                    query_parameters = {}

                # Construct headers
                header_parameters = {}
                header_parameters['Content-Type'] = 'application/json; charset=utf-8'
                if self.config.generate_client_request_id:
                    header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
                if custom_headers:
                    header_parameters.update(custom_headers)
                if self.config.accept_language is not None:
                    header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')

                # Construct and send request
                request = self._client.get(url, query_parameters)
                response = self._client.send(
                    request, header_parameters, **operation_config)

                if response.status_code not in [200]:
                    exp = CloudError(response)
                    exp.request_id = response.headers.get('x-ms-request-id')
                    raise exp

                return response

            # Deserialize response
            deserialized = models.UsagePaged(internal_paging, self._deserialize.dependencies)

            if raw:
                header_dict = {}
                client_raw_response = models.UsagePaged(internal_paging, self._deserialize.dependencies, header_dict)
                return client_raw_response

            return deserialized

        def get_hosting_environment_sites(
                self, resource_group_name, name, properties_to_include=None, custom_headers=None, raw=False, **operation_config):
            """Get all sites on the hostingEnvironment (App Service Environment).

            :param resource_group_name: Name of resource group
            :type resource_group_name: str
            :param name: Name of hostingEnvironment (App Service Environment)
            :type name: str
            :param properties_to_include: Comma separated list of site properties
             to include
            :type properties_to_include: 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:`SitePaged <azure.mgmt.web.models.SitePaged>`
            """
            def internal_paging(next_link=None, raw=False):

                if not next_link:
                    # Construct URL
                    url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/sites'
                    path_format_arguments = {
                        'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
                        'name': self._serialize.url("name", name, 'str'),
                        'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
                    }
                    url = self._client.format_url(url, **path_format_arguments)

                    # Construct parameters
                    query_parameters = {}
                    if properties_to_include is not None:
                        query_parameters['propertiesToInclude'] = self._serialize.query("properties_to_include", properties_to_include, 'str')
                    query_parameters['api-version'] = self._serialize.query("self.config.api_version", self.config.api_version, 'str')

                else:
                    url = next_link
                    query_parameters = {}

                # Construct headers
                header_parameters = {}
                header_parameters['Content-Type'] = 'application/json; charset=utf-8'
                if self.config.generate_client_request_id:
                    header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
                if custom_headers:
                    header_parameters.update(custom_headers)
                if self.config.accept_language is not None:
                    header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')

                # Construct and send request
                request = self._client.get(url, query_parameters)
                response = self._client.send(
                    request, header_parameters, **operation_config)

                if response.status_code not in [200]:
                    exp = CloudError(response)
                    exp.request_id = response.headers.get('x-ms-request-id')
                    raise exp

                return response

            # Deserialize response
            deserialized = models.SitePaged(internal_paging, self._deserialize.dependencies)

            if raw:
                header_dict = {}
                client_raw_response = models.SitePaged(internal_paging, self._deserialize.dependencies, header_dict)
                return client_raw_response

            return deserialized

        def get_hosting_environment_web_hosting_plans(
                self, resource_group_name, name, custom_headers=None, raw=False, **operation_config):
            """Get all serverfarms (App Service Plans) on the hostingEnvironment (App
            Service Environment).

            :param resource_group_name: Name of resource group
            :type resource_group_name: str
            :param name: Name of hostingEnvironment (App Service Environment)
            :type name: 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:`ServerFarmWithRichSkuPaged
             <azure.mgmt.web.models.ServerFarmWithRichSkuPaged>`
            """
            def internal_paging(next_link=None, raw=False):

                if not next_link:
                    # Construct URL
                    url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/webhostingplans'
                    path_format_arguments = {
                        'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
                        'name': self._serialize.url("name", name, 'str'),
                        'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
                    }
                    url = self._client.format_url(url, **path_format_arguments)

                    # Construct parameters
                    query_parameters = {}
                    query_parameters['api-version'] = self._serialize.query("self.config.api_version", self.config.api_version, 'str')

                else:
                    url = next_link
                    query_parameters = {}

                # Construct headers
                header_parameters = {}
                header_parameters['Content-Type'] = 'application/json; charset=utf-8'
                if self.config.generate_client_request_id:
                    header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
                if custom_headers:
                    header_parameters.update(custom_headers)
                if self.config.accept_language is not None:
                    header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')

                # Construct and send request
                request = self._client.get(url, query_parameters)
                response = self._client.send(
                    request, header_parameters, **operation_config)

                if response.status_code not in [200]:
                    exp = CloudError(response)
                    exp.request_id = response.headers.get('x-ms-request-id')
                    raise exp

                return response

            # Deserialize response
            deserialized = models.ServerFarmWithRichSkuPaged(internal_paging, self._deserialize.dependencies)

            if raw:
                header_dict = {}
                client_raw_response = models.ServerFarmWithRichSkuPaged(internal_paging, self._deserialize.dependencies, header_dict)
                return client_raw_response

            return deserialized

        def get_hosting_environment_server_farms(
                self, resource_group_name, name, custom_headers=None, raw=False, **operation_config):
            """Get all serverfarms (App Service Plans) on the hostingEnvironment (App
            Service Environment).

            :param resource_group_name: Name of resource group
            :type resource_group_name: str
            :param name: Name of hostingEnvironment (App Service Environment)
            :type name: 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:`ServerFarmWithRichSkuPaged
             <azure.mgmt.web.models.ServerFarmWithRichSkuPaged>`
            """
            def internal_paging(next_link=None, raw=False):

                if not next_link:
                    # Construct URL
                    url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/serverfarms'
                    path_format_arguments = {
                        'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
                        'name': self._serialize.url("name", name, 'str'),
                        'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
                    }
                    url = self._client.format_url(url, **path_format_arguments)

                    # Construct parameters
                    query_parameters = {}
                    query_parameters['api-version'] = self._serialize.query("self.config.api_version", self.config.api_version, 'str')

                else:
                    url = next_link
                    query_parameters = {}

                # Construct headers
                header_parameters = {}
                header_parameters['Content-Type'] = 'application/json; charset=utf-8'
                if self.config.generate_client_request_id:
                    header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
                if custom_headers:
                    header_parameters.update(custom_headers)
                if self.config.accept_language is not None:
                    header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')

                # Construct and send request
                request = self._client.get(url, query_parameters)
                response = self._client.send(
                    request, header_parameters, **operation_config)

                if response.status_code not in [200]:
                    exp = CloudError(response)
                    exp.request_id = response.headers.get('x-ms-request-id')
                    raise exp

                return response

            # Deserialize response
            deserialized = models.ServerFarmWithRichSkuPaged(internal_paging, self._deserialize.dependencies)

            if raw:
                header_dict = {}
                client_raw_response = models.ServerFarmWithRichSkuPaged(internal_paging, self._deserialize.dependencies, header_dict)
                return client_raw_response

            return deserialized

        def get_multi_role_pools(
                self, resource_group_name, name, custom_headers=None, raw=False, **operation_config):
            """Get all multi role pools.

            :param resource_group_name: Name of resource group
            :type resource_group_name: str
            :param name: Name of hostingEnvironment (App Service Environment)
            :type name: 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:`WorkerPoolPaged
             <azure.mgmt.web.models.WorkerPoolPaged>`
            """
            def internal_paging(next_link=None, raw=False):

                if not next_link:
                    # Construct URL
                    url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools'
                    path_format_arguments = {
                        'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
                        'name': self._serialize.url("name", name, 'str'),
                        'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
                    }
                    url = self._client.format_url(url, **path_format_arguments)

                    # Construct parameters
                    query_parameters = {}
                    query_parameters['api-version'] = self._serialize.query("self.config.api_version", self.config.api_version, 'str')

                else:
                    url = next_link
                    query_parameters = {}

                # Construct headers
                header_parameters = {}
                header_parameters['Content-Type'] = 'application/json; charset=utf-8'
                if self.config.generate_client_request_id:
                    header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
                if custom_headers:
                    header_parameters.update(custom_headers)
                if self.config.accept_language is not None:
                    header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')

                # Construct and send request
                request = self._client.get(url, query_parameters)
                response = self._client.send(
                    request, header_parameters, **operation_config)

                if response.status_code not in [200]:
                    exp = CloudError(response)
                    exp.request_id = response.headers.get('x-ms-request-id')
                    raise exp

                return response

            # Deserialize response
            deserialized = models.WorkerPoolPaged(internal_paging, self._deserialize.dependencies)

            if raw:
                header_dict = {}
                client_raw_response = models.WorkerPoolPaged(internal_paging, self._deserialize.dependencies, header_dict)
                return client_raw_response

            return deserialized

        def get_multi_role_pool(
                self, resource_group_name, name, custom_headers=None, raw=False, **operation_config):
            """Get properties of a multiRool pool.

            :param resource_group_name: Name of resource group
            :type resource_group_name: str
            :param name: Name of hostingEnvironment (App Service Environment)
            :type name: 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:`WorkerPool <azure.mgmt.web.models.WorkerPool>`
            :rtype: :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>`
             if raw=true
            """
            # Construct URL
            url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default'
            path_format_arguments = {
                'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
                'name': self._serialize.url("name", name, 'str'),
                'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
            }
            url = self._client.format_url(url, **path_format_arguments)

            # Construct parameters
            query_parameters = {}
            query_parameters['api-version'] = self._serialize.query("self.config.api_version", self.config.api_version, 'str')

            # Construct headers
            header_parameters = {}
            header_parameters['Content-Type'] = 'application/json; charset=utf-8'
            if self.config.generate_client_request_id:
                header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
            if custom_headers:
                header_parameters.update(custom_headers)
            if self.config.accept_language is not None:
                header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')

            # Construct and send request
            request = self._client.get(url, query_parameters)
            response = self._client.send(request, header_parameters, **operation_config)

            if response.status_code not in [200]:
                exp = CloudError(response)
                exp.request_id = response.headers.get('x-ms-request-id')
                raise exp

            deserialized = None

            if response.status_code == 200:
                deserialized = self._deserialize('WorkerPool', response)

            if raw:
                client_raw_response = ClientRawResponse(deserialized, response)
                return client_raw_response

            return deserialized

        def create_or_update_multi_role_pool(
                self, resource_group_name, name, multi_role_pool_envelope, custom_headers=None, raw=False, **operation_config):
            """Create or update a multiRole pool.

            :param resource_group_name: Name of resource group
            :type resource_group_name: str
            :param name: Name of hostingEnvironment (App Service Environment)
            :type name: str
            :param multi_role_pool_envelope: Properties of multiRole pool
            :type multi_role_pool_envelope: :class:`WorkerPool
             <azure.mgmt.web.models.WorkerPool>`
            :param dict custom_headers: headers that will be added to the request
            :param bool raw: returns the direct response alongside the
             deserialized response
            :rtype:
             :class:`AzureOperationPoller<msrestazure.azure_operation.AzureOperationPoller>`
             instance that returns :class:`WorkerPool
             <azure.mgmt.web.models.WorkerPool>`
            :rtype: :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>`
             if raw=true
            """
            # Construct URL
            url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default'
            path_format_arguments = {
                'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
                'name': self._serialize.url("name", name, 'str'),
                'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
            }
            url = self._client.format_url(url, **path_format_arguments)

            # Construct parameters
            query_parameters = {}
            query_parameters['api-version'] = self._serialize.query("self.config.api_version", self.config.api_version, 'str')

            # Construct headers
            header_parameters = {}
            header_parameters['Content-Type'] = 'application/json; charset=utf-8'
            if self.config.generate_client_request_id:
                header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
            if custom_headers:
                header_parameters.update(custom_headers)
            if self.config.accept_language is not None:
                header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')

            # Construct body
            body_content = self._serialize.body(multi_role_pool_envelope, 'WorkerPool')

            # Construct and send request
            def long_running_send():

                request = self._client.put(url, query_parameters)
                return self._client.send(
                    request, header_parameters, body_content, **operation_config)

            def get_long_running_status(status_link, headers=None):

                request = self._client.get(status_link)
                if headers:
                    request.headers.update(headers)
                return self._client.send(
                    request, header_parameters, **operation_config)

            def get_long_running_output(response):

                if response.status_code not in [200, 202, 400, 404, 409]:
                    exp = CloudError(response)
                    exp.request_id = response.headers.get('x-ms-request-id')
                    raise exp

                deserialized = None

                if response.status_code == 200:
                    deserialized = self._deserialize('WorkerPool', response)
                if response.status_code == 202:
                    deserialized = self._deserialize('WorkerPool', response)

                if raw:
                    client_raw_response = ClientRawResponse(deserialized, response)
                    return client_raw_response

                return deserialized

            if raw:
                response = long_running_send()
                return get_long_running_output(response)

            long_running_operation_timeout = operation_config.get(
                'long_running_operation_timeout',
                self.config.long_running_operation_timeout)
            return AzureOperationPoller(
                long_running_send, get_long_running_output,
                get_long_running_status, long_running_operation_timeout)

        def get_multi_role_pool_skus(
                self, resource_group_name, name, custom_headers=None, raw=False, **operation_config):
            """Get available skus for scaling a multiRole pool.

            :param resource_group_name: Name of resource group
            :type resource_group_name: str
            :param name: Name of hostingEnvironment (App Service Environment)
            :type name: 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:`SkuInfoPaged <azure.mgmt.web.models.SkuInfoPaged>`
            """
            def internal_paging(next_link=None, raw=False):

                if not next_link:
                    # Construct URL
                    url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/skus'
                    path_format_arguments = {
                        'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
                        'name': self._serialize.url("name", name, 'str'),
                        'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
                    }
                    url = self._client.format_url(url, **path_format_arguments)

                    # Construct parameters
                    query_parameters = {}
                    query_parameters['api-version'] = self._serialize.query("self.config.api_version", self.config.api_version, 'str')

                else:
                    url = next_link
                    query_parameters = {}

                # Construct headers
                header_parameters = {}
                header_parameters['Content-Type'] = 'application/json; charset=utf-8'
                if self.config.generate_client_request_id:
                    header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
                if custom_headers:
                    header_parameters.update(custom_headers)
                if self.config.accept_language is not None:
                    header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')

                # Construct and send request
                request = self._client.get(url, query_parameters)
                response = self._client.send(
                    request, header_parameters, **operation_config)

                if response.status_code not in [200]:
                    exp = CloudError(response)
                    exp.request_id = response.headers.get('x-ms-request-id')
                    raise exp

                return response

            # Deserialize response
            deserialized = models.SkuInfoPaged(internal_paging, self._deserialize.dependencies)

            if raw:
                header_dict = {}
                client_raw_response = models.SkuInfoPaged(internal_paging, self._deserialize.dependencies, header_dict)
                return client_raw_response

            return deserialized

        def get_worker_pools(
                self, resource_group_name, name, custom_headers=None, raw=False, **operation_config):
            """Get all worker pools.

            :param resource_group_name: Name of resource group
            :type resource_group_name: str
            :param name: Name of hostingEnvironment (App Service Environment)
            :type name: 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:`WorkerPoolPaged
             <azure.mgmt.web.models.WorkerPoolPaged>`
            """
            def internal_paging(next_link=None, raw=False):

                if not next_link:
                    # Construct URL
                    url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools'
                    path_format_arguments = {
                        'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
                        'name': self._serialize.url("name", name, 'str'),
                        'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
                    }
                    url = self._client.format_url(url, **path_format_arguments)

                    # Construct parameters
                    query_parameters = {}
                    query_parameters['api-version'] = self._serialize.query("self.config.api_version", self.config.api_version, 'str')

                else:
                    url = next_link
                    query_parameters = {}

                # Construct headers
                header_parameters = {}
                header_parameters['Content-Type'] = 'application/json; charset=utf-8'
                if self.config.generate_client_request_id:
                    header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
                if custom_headers:
                    header_parameters.update(custom_headers)
                if self.config.accept_language is not None:
                    header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')

                # Construct and send request
                request = self._client.get(url, query_parameters)
                response = self._client.send(
                    request, header_parameters, **operation_config)

                if response.status_code not in [200]:
                    exp = CloudError(response)
                    exp.request_id = response.headers.get('x-ms-request-id')
                    raise exp

                return response

            # Deserialize response
            deserialized = models.WorkerPoolPaged(internal_paging, self._deserialize.dependencies)

            if raw:
                header_dict = {}
                client_raw_response = models.WorkerPoolPaged(internal_paging, self._deserialize.dependencies, header_dict)
                return client_raw_response

            return deserialized

        def get_worker_pool(
                self, resource_group_name, name, worker_pool_name, custom_headers=None, raw=False, **operation_config):
            """Get properties of a worker pool.

            :param resource_group_name: Name of resource group
            :type resource_group_name: str
            :param name: Name of hostingEnvironment (App Service Environment)
            :type name: str
            :param worker_pool_name: Name of worker pool
            :type worker_pool_name: 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:`WorkerPool <azure.mgmt.web.models.WorkerPool>`
            :rtype: :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>`
             if raw=true
            """
            # Construct URL
            url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}'
            path_format_arguments = {
                'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
                'name': self._serialize.url("name", name, 'str'),
                'workerPoolName': self._serialize.url("worker_pool_name", worker_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 = {}
            query_parameters['api-version'] = self._serialize.query("self.config.api_version", self.config.api_version, 'str')

            # Construct headers
            header_parameters = {}
            header_parameters['Content-Type'] = 'application/json; charset=utf-8'
            if self.config.generate_client_request_id:
                header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
            if custom_headers:
                header_parameters.update(custom_headers)
            if self.config.accept_language is not None:
                header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')

            # Construct and send request
            request = self._client.get(url, query_parameters)
            response = self._client.send(request, header_parameters, **operation_config)

            if response.status_code not in [200]:
                exp = CloudError(response)
                exp.request_id = response.headers.get('x-ms-request-id')
                raise exp

            deserialized = None

            if response.status_code == 200:
                deserialized = self._deserialize('WorkerPool', response)

            if raw:
                client_raw_response = ClientRawResponse(deserialized, response)
                return client_raw_response

            return deserialized

        def create_or_update_worker_pool(
                self, resource_group_name, name, worker_pool_name, worker_pool_envelope, custom_headers=None, raw=False, **operation_config):
            """Create or update a worker pool.

            :param resource_group_name: Name of resource group
            :type resource_group_name: str
            :param name: Name of hostingEnvironment (App Service Environment)
            :type name: str
            :param worker_pool_name: Name of worker pool
            :type worker_pool_name: str
            :param worker_pool_envelope: Properties of worker pool
            :type worker_pool_envelope: :class:`WorkerPool
             <azure.mgmt.web.models.WorkerPool>`
            :param dict custom_headers: headers that will be added to the request
            :param bool raw: returns the direct response alongside the
             deserialized response
            :rtype:
             :class:`AzureOperationPoller<msrestazure.azure_operation.AzureOperationPoller>`
             instance that returns :class:`WorkerPool
             <azure.mgmt.web.models.WorkerPool>`
            :rtype: :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>`
             if raw=true
            """
            # Construct URL
            url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}'
            path_format_arguments = {
                'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
                'name': self._serialize.url("name", name, 'str'),
                'workerPoolName': self._serialize.url("worker_pool_name", worker_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 = {}
            query_parameters['api-version'] = self._serialize.query("self.config.api_version", self.config.api_version, 'str')

            # Construct headers
            header_parameters = {}
            header_parameters['Content-Type'] = 'application/json; charset=utf-8'
            if self.config.generate_client_request_id:
                header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
            if custom_headers:
                header_parameters.update(custom_headers)
            if self.config.accept_language is not None:
                header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')

            # Construct body
            body_content = self._serialize.body(worker_pool_envelope, 'WorkerPool')

            # Construct and send request
            def long_running_send():

                request = self._client.put(url, query_parameters)
                return self._client.send(
                    request, header_parameters, body_content, **operation_config)

            def get_long_running_status(status_link, headers=None):

                request = self._client.get(status_link)
                if headers:
                    request.headers.update(headers)
                return self._client.send(
                    request, header_parameters, **operation_config)

            def get_long_running_output(response):

                if response.status_code not in [200, 202, 400, 404, 409]:
                    exp = CloudError(response)
                    exp.request_id = response.headers.get('x-ms-request-id')
                    raise exp

                deserialized = None

                if response.status_code == 200:
                    deserialized = self._deserialize('WorkerPool', response)
                if response.status_code == 202:
                    deserialized = self._deserialize('WorkerPool', response)

                if raw:
                    client_raw_response = ClientRawResponse(deserialized, response)
                    return client_raw_response

                return deserialized

            if raw:
                response = long_running_send()
                return get_long_running_output(response)

            long_running_operation_timeout = operation_config.get(
                'long_running_operation_timeout',
                self.config.long_running_operation_timeout)
            return AzureOperationPoller(
                long_running_send, get_long_running_output,
                get_long_running_status, long_running_operation_timeout)

        def get_worker_pool_skus(
                self, resource_group_name, name, worker_pool_name, custom_headers=None, raw=False, **operation_config):
            """Get available skus for scaling a worker pool.

            :param resource_group_name: Name of resource group
            :type resource_group_name: str
            :param name: Name of hostingEnvironment (App Service Environment)
            :type name: str
            :param worker_pool_name: Name of worker pool
            :type worker_pool_name: 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:`SkuInfoPaged <azure.mgmt.web.models.SkuInfoPaged>`
            """
            def internal_paging(next_link=None, raw=False):

                if not next_link:
                    # Construct URL
                    url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/skus'
                    path_format_arguments = {
                        'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
                        'name': self._serialize.url("name", name, 'str'),
                        'workerPoolName': self._serialize.url("worker_pool_name", worker_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 = {}
                    query_parameters['api-version'] = self._serialize.query("self.config.api_version", self.config.api_version, 'str')

                else:
                    url = next_link
                    query_parameters = {}

                # Construct headers
                header_parameters = {}
                header_parameters['Content-Type'] = 'application/json; charset=utf-8'
                if self.config.generate_client_request_id:
                    header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
                if custom_headers:
                    header_parameters.update(custom_headers)
                if self.config.accept_language is not None:
                    header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')

                # Construct and send request
                request = self._client.get(url, query_parameters)
                response = self._client.send(
                    request, header_parameters, **operation_config)

                if response.status_code not in [200]:
                    exp = CloudError(response)
                    exp.request_id = response.headers.get('x-ms-request-id')
                    raise exp

                return response

            # Deserialize response
            deserialized = models.SkuInfoPaged(internal_paging, self._deserialize.dependencies)

            if raw:
                header_dict = {}
                client_raw_response = models.SkuInfoPaged(internal_paging, self._deserialize.dependencies, header_dict)
                return client_raw_response

            return deserialized

        def get_worker_pool_instance_metrics(
                self, resource_group_name, name, worker_pool_name, instance, details=None, filter=None, custom_headers=None, raw=False, **operation_config):
            """Get metrics for a specific instance of a worker pool of a
            hostingEnvironment (App Service Environment).

            :param resource_group_name: Name of resource group
            :type resource_group_name: str
            :param name: Name of hostingEnvironment (App Service Environment)
            :type name: str
            :param worker_pool_name: Name of worker pool
            :type worker_pool_name: str
            :param instance: Name of instance in the worker pool
            :type instance: str
            :param details: Include instance details
            :type details: bool
            :param filter: Return only usages/metrics specified in the filter.
             Filter conforms to odata syntax. Example: $filter=(name.value eq
             'Metric1' or name.value eq 'Metric2') and startTime eq
             '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and
             timeGrain eq duration'[Hour|Minute|Day]'.
            :type filter: 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: object
            :rtype: :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>`
             if raw=true
            """
            # Construct URL
            url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/instances/{instance}/metrics'
            path_format_arguments = {
                'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
                'name': self._serialize.url("name", name, 'str'),
                'workerPoolName': self._serialize.url("worker_pool_name", worker_pool_name, 'str'),
                'instance': self._serialize.url("instance", instance, 'str'),
                'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
            }
            url = self._client.format_url(url, **path_format_arguments)

            # Construct parameters
            query_parameters = {}
            if details is not None:
                query_parameters['details'] = self._serialize.query("details", details, 'bool')
            if filter is not None:
                query_parameters['$filter'] = self._serialize.query("filter", filter, 'str')
            query_parameters['api-version'] = self._serialize.query("self.config.api_version", self.config.api_version, 'str')

            # Construct headers
            header_parameters = {}
            header_parameters['Content-Type'] = 'application/json; charset=utf-8'
            if self.config.generate_client_request_id:
                header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
            if custom_headers:
                header_parameters.update(custom_headers)
            if self.config.accept_language is not None:
                header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')

            # Construct and send request
            request = self._client.get(url, query_parameters)
            response = self._client.send(request, header_parameters, **operation_config)

            if response.status_code not in [200]:
                exp = CloudError(response)
                exp.request_id = response.headers.get('x-ms-request-id')
                raise exp

            deserialized = None

            if response.status_code == 200:
                deserialized = self._deserialize('object', response)

            if raw:
                client_raw_response = ClientRawResponse(deserialized, response)
                return client_raw_response

            return deserialized

        def get_worker_pool_instance_metric_definitions(
                self, resource_group_name, name, worker_pool_name, instance, custom_headers=None, raw=False, **operation_config):
            """Get metric definitions for a specific instance of a worker pool of a
            hostingEnvironment (App Service Environment).

            :param resource_group_name: Name of resource group
            :type resource_group_name: str
            :param name: Name of hostingEnvironment (App Service Environment)
            :type name: str
            :param worker_pool_name: Name of worker pool
            :type worker_pool_name: str
            :param instance: Name of instance in the worker pool
            :type instance: 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: object
            :rtype: :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>`
             if raw=true
            """
            # Construct URL
            url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/instances/{instance}/metricdefinitions'
            path_format_arguments = {
                'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
                'name': self._serialize.url("name", name, 'str'),
                'workerPoolName': self._serialize.url("worker_pool_name", worker_pool_name, 'str'),
                'instance': self._serialize.url("instance", instance, 'str'),
                'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
            }
            url = self._client.format_url(url, **path_format_arguments)

            # Construct parameters
            query_parameters = {}
            query_parameters['api-version'] = self._serialize.query("self.config.api_version", self.config.api_version, 'str')

            # Construct headers
            header_parameters = {}
            header_parameters['Content-Type'] = 'application/json; charset=utf-8'
            if self.config.generate_client_request_id:
                header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
            if custom_headers:
                header_parameters.update(custom_headers)
            if self.config.accept_language is not None:
                header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')

            # Construct and send request
            request = self._client.get(url, query_parameters)
            response = self._client.send(request, header_parameters, **operation_config)

            if response.status_code not in [200]:
                exp = CloudError(response)
                exp.request_id = response.headers.get('x-ms-request-id')
                raise exp

            deserialized = None

            if response.status_code == 200:
                deserialized = self._deserialize('object', response)

            if raw:
                client_raw_response = ClientRawResponse(deserialized, response)
                return client_raw_response

            return deserialized

        def get_multi_role_pool_instance_metrics(
                self, resource_group_name, name, instance, details=None, custom_headers=None, raw=False, **operation_config):
            """Get metrics for a specific instance of a multiRole pool of a
            hostingEnvironment (App Service Environment).

            :param resource_group_name: Name of resource group
            :type resource_group_name: str
            :param name: Name of hostingEnvironment (App Service Environment)
            :type name: str
            :param instance: Name of instance in the multiRole pool
            :type instance: str
            :param details: Include instance details
            :type details: bool
            :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: object
            :rtype: :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>`
             if raw=true
            """
            # Construct URL
            url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/instances/{instance}/metrics'
            path_format_arguments = {
                'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
                'name': self._serialize.url("name", name, 'str'),
                'instance': self._serialize.url("instance", instance, 'str'),
                'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
            }
            url = self._client.format_url(url, **path_format_arguments)

            # Construct parameters
            query_parameters = {}
            if details is not None:
                query_parameters['details'] = self._serialize.query("details", details, 'bool')
            query_parameters['api-version'] = self._serialize.query("self.config.api_version", self.config.api_version, 'str')

            # Construct headers
            header_parameters = {}
            header_parameters['Content-Type'] = 'application/json; charset=utf-8'
            if self.config.generate_client_request_id:
                header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
            if custom_headers:
                header_parameters.update(custom_headers)
            if self.config.accept_language is not None:
                header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')

            # Construct and send request
            request = self._client.get(url, query_parameters)
            response = self._client.send(request, header_parameters, **operation_config)

            if response.status_code not in [200]:
                exp = CloudError(response)
                exp.request_id = response.headers.get('x-ms-request-id')
                raise exp

            deserialized = None

            if response.status_code == 200:
                deserialized = self._deserialize('object', response)

            if raw:
                client_raw_response = ClientRawResponse(deserialized, response)
                return client_raw_response

            return deserialized

        def get_multi_role_pool_instance_metric_definitions(
                self, resource_group_name, name, instance, custom_headers=None, raw=False, **operation_config):
            """Get metric definitions for a specific instance of a multiRole pool of
            a hostingEnvironment (App Service Environment).

            :param resource_group_name: Name of resource group
            :type resource_group_name: str
            :param name: Name of hostingEnvironment (App Service Environment)
            :type name: str
            :param instance: Name of instance in the multiRole pool&gt;
            :type instance: 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: object
            :rtype: :class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>`
             if raw=true
            """
            # Construct URL
            url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/instances/{instance}/metricdefinitions'
            path_format_arguments = {
                'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
                'name': self._serialize.url("name", name, 'str'),
                'instance': self._serialize.url("instance", instance, 'str'),
                'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
            }
            url = self._client.format_url(url, **path_format_arguments)

            # Construct parameters
            query_parameters = {}
            query_parameters['api-version'] = self._serialize.query("self.config.api_version", self.config.api_version, 'str')

            # Construct headers
            header_parameters = {}
            header_parameters['Content-Type'] = 'application/json; charset=utf-8'
            if self.config.generate_client_request_id:
                header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
            if custom_headers:
                header_parameters.update(custom_headers)
            if self.config.accept_language is not None:
                header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')

            # Construct and send request
            request = self._client.get(url, query_parameters)
            response = self._client.send(request, header_parameters, **operation_config)

            if response.status_code not in [200]:
                exp = CloudError(response)
                exp.request_id = response.headers.get('x-ms-request-id')
                raise exp

            deserialized = None

            if response.status_code == 200:
                deserialized = self._deserialize('object', response)

            if raw:
                client_raw_response = ClientRawResponse(deserialized, response)
                return client_raw_response

            return deserialized

        def suspend_hosting_environment(
                self, resource_group_name, name, custom_headers=None, raw=False, **operation_config):
            """Suspends the hostingEnvironment.

            :param resource_group_name: Name of resource group
            :type resource_group_name: str
            :param name: Name of hostingEnvironment (App Service Environment)
            :type name: 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:`SitePaged <azure.mgmt.web.models.SitePaged>`
            """
            def internal_paging(next_link=None, raw=False):

                if not next_link:
                    # Construct URL
                    url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/suspend'
                    path_format_arguments = {
                        'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
                        'name': self._serialize.url("name", name, 'str'),
                        'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
                    }
                    url = self._client.format_url(url, **path_format_arguments)

                    # Construct parameters
                    query_parameters = {}
                    query_parameters['api-version'] = self._serialize.query("self.config.api_version", self.config.api_version, 'str')

                else:
                    url = next_link
                    query_parameters = {}

                # Construct headers
                header_parameters = {}
                header_parameters['Content-Type'] = 'application/json; charset=utf-8'
                if self.config.generate_client_request_id:
                    header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
                if custom_headers:
                    header_parameters.update(custom_headers)
                if self.config.accept_language is not None:
                    header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')

                # Construct and send request
                request = self._client.post(url, query_parameters)
                response = self._client.send(
                    request, header_parameters, **operation_config)

                if response.status_code not in [200, 202]:
                    exp = CloudError(response)
                    exp.request_id = response.headers.get('x-ms-request-id')
                    raise exp

                return response

            # Deserialize response
            deserialized = models.SitePaged(internal_paging, self._deserialize.dependencies)

            if raw:
                header_dict = {}
                client_raw_response = models.SitePaged(internal_paging, self._deserialize.dependencies, header_dict)
                return client_raw_response

            return deserialized

        def resume_hosting_environment(
                self, resource_group_name, name, custom_headers=None, raw=False, **operation_config):
            """Resumes the hostingEnvironment.

            :param resource_group_name: Name of resource group
            :type resource_group_name: str
            :param name: Name of hostingEnvironment (App Service Environment)
            :type name: 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:`SitePaged <azure.mgmt.web.models.SitePaged>`
            """
            def internal_paging(next_link=None, raw=False):

                if not next_link:
                    # Construct URL
                    url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/resume'
                    path_format_arguments = {
                        'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
                        'name': self._serialize.url("name", name, 'str'),
                        'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
                    }
                    url = self._client.format_url(url, **path_format_arguments)

                    # Construct parameters
                    query_parameters = {}
                    query_parameters['api-version'] = self._serialize.query("self.config.api_version", self.config.api_version, 'str')

                else:
                    url = next_link
                    query_parameters = {}

                # Construct headers
                header_parameters = {}
                header_parameters['Content-Type'] = 'application/json; charset=utf-8'
                if self.config.generate_client_request_id:
                    header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
                if custom_headers:
                    header_parameters.update(custom_headers)
                if self.config.accept_language is not None:
                    header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')

                # Construct and send request
                request = self._client.post(url, query_parameters)
                response = self._client.send(
                    request, header_parameters, **operation_config)

                if response.status_code not in [200, 202]:
                    exp = CloudError(response)
                    exp.request_id = response.headers.get('x-ms-request-id')
                    raise exp

                return response

            # Deserialize response
            deserialized = models.SitePaged(internal_paging, self._deserialize.dependencies)

            if raw:
                header_dict = {}
                client_raw_response = models.SitePaged(internal_paging, self._deserialize.dependencies, header_dict)
                return client_raw_response

            return deserialized