# coding=utf-8
# --------------------------------------------------------------------------
# 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 msrest.exceptions import HttpOperationError

from .. import models


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

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

    models = models

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

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

        self.config = config

    def retrieve(
            self, alarm_id=None, alarm_source_name=None, priority_from=None, priority_to=None, state=None, acknowledgeable=None, type=None, originally_alarmed_on_or_after=None, originally_alarmed_before=None, transitioned_on_or_after=None, transitioned_before=None, order_by=None, take=None, skip=None, custom_headers=None, raw=False, **operation_config):
        """Returns all AlarmEvents which fit the filter criteria supplied.  All
        filter parameters are optional.  AlarmEvents will be ordered and paged
        as requested.

        :param alarm_id: Return only AlarmEvent for the referenced Alarm.
        :type alarm_id: str
        :param alarm_source_name: Return only AlarmEvent with the specified
         source name.
        :type alarm_source_name: str
        :param priority_from: Return only AlarmEvent with a Priority greater
         or equal to the value supplied.
        :type priority_from: int
        :param priority_to: Return only AlarmEvent with a Priority less or
         equal to the value supplied.
        :type priority_to: int
        :param state: Return only AlarmEvent with this State value. Possible
         values include: 'Normal', 'Active', 'Acknowledged', 'Reset',
         'Disabled'
        :type state: str
        :param acknowledgeable: Return only AlarmEvent with this
         Acknowledgeable value. Possible values include: 'No', 'Yes',
         'Required'
        :type acknowledgeable: str
        :param type: Return only AlarmEvent with this Type value.
        :type type: str
        :param originally_alarmed_on_or_after: Return only AlarmEvent with
         OccuredOn which is on or after this value.
        :type originally_alarmed_on_or_after: datetime
        :param originally_alarmed_before: Return only AlarmEvent with
         OccuredOn which is before this value.
        :type originally_alarmed_before: datetime
        :param transitioned_on_or_after: Return only AlarmEvent with
         LastTransitionedOn which is on or after this value.
        :type transitioned_on_or_after: datetime
        :param transitioned_before: Return only AlarmEvent with
         LastTransitionedOn which is before this value.
        :type transitioned_before: datetime
        :param order_by: AlarmEvent will be returned in this order.
         TransitionedAtAscending by default. Possible values include:
         'TransitionedAtAscending', 'TransitionedAtDescending',
         'OriginallyAlarmedAtAscending', 'OriginallyAlarmedAtDescending'
        :type order_by: str
        :param take: Number of AlarmEvent that should be returned.  200 by
         default.
        :type take: int
        :param skip: Number of AlarmEvent that should be skipped before items
         are returned.  0 by default.
        :type skip: int
        :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>`.
        :return: list or ClientRawResponse if raw=true
        :rtype: list[~ewsrestgatewayswagger.models.AlarmEventModel] or
         ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`HttpOperationError<msrest.exceptions.HttpOperationError>`
        """
        # Construct URL
        url = self.retrieve.metadata['url']

        # Construct parameters
        query_parameters = {}
        if alarm_id is not None:
            query_parameters['alarmId'] = self._serialize.query("alarm_id", alarm_id, 'str')
        if alarm_source_name is not None:
            query_parameters['alarmSourceName'] = self._serialize.query("alarm_source_name", alarm_source_name, 'str')
        if priority_from is not None:
            query_parameters['priorityFrom'] = self._serialize.query("priority_from", priority_from, 'int')
        if priority_to is not None:
            query_parameters['priorityTo'] = self._serialize.query("priority_to", priority_to, 'int')
        if state is not None:
            query_parameters['state'] = self._serialize.query("state", state, 'str')
        if acknowledgeable is not None:
            query_parameters['acknowledgeable'] = self._serialize.query("acknowledgeable", acknowledgeable, 'str')
        if type is not None:
            query_parameters['type'] = self._serialize.query("type", type, 'str')
        if originally_alarmed_on_or_after is not None:
            query_parameters['originallyAlarmedOnOrAfter'] = self._serialize.query("originally_alarmed_on_or_after", originally_alarmed_on_or_after, 'iso-8601')
        if originally_alarmed_before is not None:
            query_parameters['originallyAlarmedBefore'] = self._serialize.query("originally_alarmed_before", originally_alarmed_before, 'iso-8601')
        if transitioned_on_or_after is not None:
            query_parameters['transitionedOnOrAfter'] = self._serialize.query("transitioned_on_or_after", transitioned_on_or_after, 'iso-8601')
        if transitioned_before is not None:
            query_parameters['transitionedBefore'] = self._serialize.query("transitioned_before", transitioned_before, 'iso-8601')
        if order_by is not None:
            query_parameters['orderBy'] = self._serialize.query("order_by", order_by, 'str')
        if take is not None:
            query_parameters['take'] = self._serialize.query("take", take, 'int')
        if skip is not None:
            query_parameters['skip'] = self._serialize.query("skip", skip, 'int')

        # Construct headers
        header_parameters = {}
        header_parameters['Accept'] = 'application/json'
        if custom_headers:
            header_parameters.update(custom_headers)

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

        if response.status_code not in [200]:
            raise HttpOperationError(self._deserialize, response)

        deserialized = None

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

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

        return deserialized
    retrieve.metadata = {'url': '/AlarmEvents'}

    def retrieve_by_id(
            self, id, custom_headers=None, raw=False, **operation_config):
        """Returns the AlarmEvent with the Id provided.

        :param id: Id of the AlarmEvent requested.  Must be double URL
         encoded.
        :type 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>`.
        :return: AlarmEventModel or ClientRawResponse if raw=true
        :rtype: ~ewsrestgatewayswagger.models.AlarmEventModel or
         ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`HttpOperationError<msrest.exceptions.HttpOperationError>`
        """
        # Construct URL
        url = self.retrieve_by_id.metadata['url']
        path_format_arguments = {
            'id': self._serialize.url("id", id, 'str')
        }
        url = self._client.format_url(url, **path_format_arguments)

        # Construct parameters
        query_parameters = {}

        # Construct headers
        header_parameters = {}
        header_parameters['Accept'] = 'application/json'
        if custom_headers:
            header_parameters.update(custom_headers)

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

        if response.status_code not in [200]:
            raise HttpOperationError(self._deserialize, response)

        deserialized = None

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

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

        return deserialized
    retrieve_by_id.metadata = {'url': '/AlarmEvents/{id}'}

    def retrieve_alarm_id(
            self, id, custom_headers=None, raw=False, **operation_config):
        """Returns the AlarmId property for the AlarmEvent with the Id provided.

        :param id: Id of the AlarmEvent whose AlarmId property is to be
         returned.  Must be double URL encoded.
        :type 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>`.
        :return: str or ClientRawResponse if raw=true
        :rtype: str or ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`HttpOperationError<msrest.exceptions.HttpOperationError>`
        """
        # Construct URL
        url = self.retrieve_alarm_id.metadata['url']
        path_format_arguments = {
            'id': self._serialize.url("id", id, 'str')
        }
        url = self._client.format_url(url, **path_format_arguments)

        # Construct parameters
        query_parameters = {}

        # Construct headers
        header_parameters = {}
        header_parameters['Accept'] = 'application/json'
        if custom_headers:
            header_parameters.update(custom_headers)

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

        if response.status_code not in [200]:
            raise HttpOperationError(self._deserialize, response)

        deserialized = None

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

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

        return deserialized
    retrieve_alarm_id.metadata = {'url': '/AlarmEvents/{id}/AlarmId'}

    def retrieve_alarm(
            self, id, custom_headers=None, raw=False, **operation_config):
        """Returns the referenced Alarm for the AlarmEvent with the Id provided.

        :param id: Id of the AlarmEvent for which the referenced Alarm is to
         be returned.  Value must be double URL encoded
        :type 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>`.
        :return: AlarmModel or ClientRawResponse if raw=true
        :rtype: ~ewsrestgatewayswagger.models.AlarmModel or
         ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`HttpOperationError<msrest.exceptions.HttpOperationError>`
        """
        # Construct URL
        url = self.retrieve_alarm.metadata['url']
        path_format_arguments = {
            'id': self._serialize.url("id", id, 'str')
        }
        url = self._client.format_url(url, **path_format_arguments)

        # Construct parameters
        query_parameters = {}

        # Construct headers
        header_parameters = {}
        header_parameters['Accept'] = 'application/json'
        if custom_headers:
            header_parameters.update(custom_headers)

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

        if response.status_code not in [200]:
            raise HttpOperationError(self._deserialize, response)

        deserialized = None

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

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

        return deserialized
    retrieve_alarm.metadata = {'url': '/AlarmEvents/{id}/Alarm'}

    def retrieve_alarm_source_name(
            self, id, custom_headers=None, raw=False, **operation_config):
        """Returns the AlarmSourceName property for the AlarmEvent with the Id
        provided.

        :param id: Id of the AlarmEvent whose AlarmSourceName property is to
         be returned.  Must be double URL encoded.
        :type 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>`.
        :return: int or ClientRawResponse if raw=true
        :rtype: int or ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`HttpOperationError<msrest.exceptions.HttpOperationError>`
        """
        # Construct URL
        url = self.retrieve_alarm_source_name.metadata['url']
        path_format_arguments = {
            'id': self._serialize.url("id", id, 'str')
        }
        url = self._client.format_url(url, **path_format_arguments)

        # Construct parameters
        query_parameters = {}

        # Construct headers
        header_parameters = {}
        header_parameters['Accept'] = 'application/json'
        if custom_headers:
            header_parameters.update(custom_headers)

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

        if response.status_code not in [200]:
            raise HttpOperationError(self._deserialize, response)

        deserialized = None

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

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

        return deserialized
    retrieve_alarm_source_name.metadata = {'url': '/AlarmEvents/{id}/AlarmSourceName'}

    def retrieve_acknowledgeable(
            self, id, custom_headers=None, raw=False, **operation_config):
        """Returns the Acknowledgeable property for the AlarmEvent with the Id
        provided.

        :param id: Id of the AlarmEvent whose Acknowledgeable property is to
         be returned.  Must be double URL encoded.
        :type 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>`.
        :return: enum or ClientRawResponse if raw=true
        :rtype: str or ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`HttpOperationError<msrest.exceptions.HttpOperationError>`
        """
        # Construct URL
        url = self.retrieve_acknowledgeable.metadata['url']
        path_format_arguments = {
            'id': self._serialize.url("id", id, 'str')
        }
        url = self._client.format_url(url, **path_format_arguments)

        # Construct parameters
        query_parameters = {}

        # Construct headers
        header_parameters = {}
        header_parameters['Accept'] = 'application/json'
        if custom_headers:
            header_parameters.update(custom_headers)

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

        if response.status_code not in [200]:
            raise HttpOperationError(self._deserialize, response)

        deserialized = None

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

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

        return deserialized
    retrieve_acknowledgeable.metadata = {'url': '/AlarmEvents/{id}/Acknowledgeable'}

    def retrieve_occurred_on(
            self, id, custom_headers=None, raw=False, **operation_config):
        """Returns the OccurredOn property for the AlarmEvent with the Id
        provided.

        :param id: Id of the AlarmEvent whose OccurredOn property is to be
         returned.  Must be double URL encoded.
        :type 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>`.
        :return: datetime or ClientRawResponse if raw=true
        :rtype: datetime or ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`HttpOperationError<msrest.exceptions.HttpOperationError>`
        """
        # Construct URL
        url = self.retrieve_occurred_on.metadata['url']
        path_format_arguments = {
            'id': self._serialize.url("id", id, 'str')
        }
        url = self._client.format_url(url, **path_format_arguments)

        # Construct parameters
        query_parameters = {}

        # Construct headers
        header_parameters = {}
        header_parameters['Accept'] = 'application/json'
        if custom_headers:
            header_parameters.update(custom_headers)

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

        if response.status_code not in [200]:
            raise HttpOperationError(self._deserialize, response)

        deserialized = None

        if response.status_code == 200:
            deserialized = self._deserialize('iso-8601', response)

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

        return deserialized
    retrieve_occurred_on.metadata = {'url': '/AlarmEvents/{id}/OccurredOn'}

    def retrieve_last_transitioned_on(
            self, id, custom_headers=None, raw=False, **operation_config):
        """Returns the LastTransitionedOn property for the AlarmEvent with the Id
        provided.

        :param id: Id of the AlarmEvent whose LastTransitionedOn property is
         to be returned.  Must be double URL encoded.
        :type 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>`.
        :return: datetime or ClientRawResponse if raw=true
        :rtype: datetime or ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`HttpOperationError<msrest.exceptions.HttpOperationError>`
        """
        # Construct URL
        url = self.retrieve_last_transitioned_on.metadata['url']
        path_format_arguments = {
            'id': self._serialize.url("id", id, 'str')
        }
        url = self._client.format_url(url, **path_format_arguments)

        # Construct parameters
        query_parameters = {}

        # Construct headers
        header_parameters = {}
        header_parameters['Accept'] = 'application/json'
        if custom_headers:
            header_parameters.update(custom_headers)

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

        if response.status_code not in [200]:
            raise HttpOperationError(self._deserialize, response)

        deserialized = None

        if response.status_code == 200:
            deserialized = self._deserialize('iso-8601', response)

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

        return deserialized
    retrieve_last_transitioned_on.metadata = {'url': '/AlarmEvents/{id}/LastTransitionedOn'}

    def retrieve_message(
            self, id, custom_headers=None, raw=False, **operation_config):
        """Returns the Message property for the AlarmEvent with the Id provided.

        :param id: Id of the AlarmEvent whose Message property is to be
         returned.  Must be double URL encoded.
        :type 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>`.
        :return: str or ClientRawResponse if raw=true
        :rtype: str or ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`HttpOperationError<msrest.exceptions.HttpOperationError>`
        """
        # Construct URL
        url = self.retrieve_message.metadata['url']
        path_format_arguments = {
            'id': self._serialize.url("id", id, 'str')
        }
        url = self._client.format_url(url, **path_format_arguments)

        # Construct parameters
        query_parameters = {}

        # Construct headers
        header_parameters = {}
        header_parameters['Accept'] = 'application/json'
        if custom_headers:
            header_parameters.update(custom_headers)

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

        if response.status_code not in [200]:
            raise HttpOperationError(self._deserialize, response)

        deserialized = None

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

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

        return deserialized
    retrieve_message.metadata = {'url': '/AlarmEvents/{id}/Message'}

    def retrieve_priority(
            self, id, custom_headers=None, raw=False, **operation_config):
        """Returns the Priority property for the AlarmEvent with the Id provided.

        :param id: Id of the AlarmEvent whose Priority property is to be
         returned.  Must be double URL encoded.
        :type 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>`.
        :return: int or ClientRawResponse if raw=true
        :rtype: int or ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`HttpOperationError<msrest.exceptions.HttpOperationError>`
        """
        # Construct URL
        url = self.retrieve_priority.metadata['url']
        path_format_arguments = {
            'id': self._serialize.url("id", id, 'str')
        }
        url = self._client.format_url(url, **path_format_arguments)

        # Construct parameters
        query_parameters = {}

        # Construct headers
        header_parameters = {}
        header_parameters['Accept'] = 'application/json'
        if custom_headers:
            header_parameters.update(custom_headers)

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

        if response.status_code not in [200]:
            raise HttpOperationError(self._deserialize, response)

        deserialized = None

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

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

        return deserialized
    retrieve_priority.metadata = {'url': '/AlarmEvents/{id}/Priority'}

    def retrieve_state(
            self, id, custom_headers=None, raw=False, **operation_config):
        """Returns the State property for the AlarmEvent with the Id provided.

        :param id: Id of the AlarmEvent whose State property is to be
         returned.  Must be double URL encoded.
        :type 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>`.
        :return: enum or ClientRawResponse if raw=true
        :rtype: str or ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`HttpOperationError<msrest.exceptions.HttpOperationError>`
        """
        # Construct URL
        url = self.retrieve_state.metadata['url']
        path_format_arguments = {
            'id': self._serialize.url("id", id, 'str')
        }
        url = self._client.format_url(url, **path_format_arguments)

        # Construct parameters
        query_parameters = {}

        # Construct headers
        header_parameters = {}
        header_parameters['Accept'] = 'application/json'
        if custom_headers:
            header_parameters.update(custom_headers)

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

        if response.status_code not in [200]:
            raise HttpOperationError(self._deserialize, response)

        deserialized = None

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

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

        return deserialized
    retrieve_state.metadata = {'url': '/AlarmEvents/{id}/State'}

    def retrieve_type(
            self, id, custom_headers=None, raw=False, **operation_config):
        """Returns the Type property for the AlarmEvent with the Id provided.

        :param id: Id of the AlarmEvent whose Type property is to be returned.
         Must be double URL encoded.
        :type 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>`.
        :return: str or ClientRawResponse if raw=true
        :rtype: str or ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`HttpOperationError<msrest.exceptions.HttpOperationError>`
        """
        # Construct URL
        url = self.retrieve_type.metadata['url']
        path_format_arguments = {
            'id': self._serialize.url("id", id, 'str')
        }
        url = self._client.format_url(url, **path_format_arguments)

        # Construct parameters
        query_parameters = {}

        # Construct headers
        header_parameters = {}
        header_parameters['Accept'] = 'application/json'
        if custom_headers:
            header_parameters.update(custom_headers)

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

        if response.status_code not in [200]:
            raise HttpOperationError(self._deserialize, response)

        deserialized = None

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

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

        return deserialized
    retrieve_type.metadata = {'url': '/AlarmEvents/{id}/Type'}

    def acknowledge(
            self, id, custom_headers=None, raw=False, **operation_config):
        """Executes an Acknowledge operation on the AlarmEvent with the Id
        provided.

        :param id: Id of the AlarmEvent to acknowledge.  Must be double URL
         encoded.
        :type 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>`.
        :return: object or ClientRawResponse if raw=true
        :rtype: object or ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`HttpOperationError<msrest.exceptions.HttpOperationError>`
        """
        # Construct URL
        url = self.acknowledge.metadata['url']
        path_format_arguments = {
            'id': self._serialize.url("id", id, 'str')
        }
        url = self._client.format_url(url, **path_format_arguments)

        # Construct parameters
        query_parameters = {}

        # Construct headers
        header_parameters = {}
        header_parameters['Accept'] = 'application/json'
        if custom_headers:
            header_parameters.update(custom_headers)

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

        if response.status_code not in [204]:
            raise HttpOperationError(self._deserialize, response)

        deserialized = None

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

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

        return deserialized
    acknowledge.metadata = {'url': '/AlarmEvents/{id}/Acknowledge'}
