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

from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import HttpRequest, HttpResponse
from azure.mgmt.core.exceptions import ARMErrorFormat

from .. import models

if TYPE_CHECKING:
    # pylint: disable=unused-import,ungrouped-imports
    from typing import Any, Callable, Dict, Generic, Iterable, List, Optional, TypeVar, Union

    T = TypeVar('T')
    ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]

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

    You should not instantiate this class directly. Instead, you should create a Client instance that
    instantiates it for you and attaches it as an attribute.

    :ivar models: Alias to model classes used in this operation group.
    :type models: ~cloud_communications.models
    :param client: Client for service requests.
    :param config: Configuration of service client.
    :param serializer: An object model serializer.
    :param deserializer: An object model deserializer.
    """

    models = models

    def __init__(self, client, config, serializer, deserializer):
        self._client = client
        self._serialize = serializer
        self._deserialize = deserializer
        self._config = config

    def list_call_records(
        self,
        orderby=None,  # type: Optional[List[Union[str, "models.Get5ItemsItem"]]]
        select=None,  # type: Optional[List[Union[str, "models.Get6ItemsItem"]]]
        expand=None,  # type: Optional[List[Union[str, "models.Get7ItemsItem"]]]
        **kwargs  # type: Any
    ):
        # type: (...) -> Iterable["models.CollectionOfCallRecord"]
        """Get callRecords from communications.

        Get callRecords from communications.

        :param orderby: Order items by property values.
        :type orderby: list[str or ~cloud_communications.models.Get5ItemsItem]
        :param select: Select properties to be returned.
        :type select: list[str or ~cloud_communications.models.Get6ItemsItem]
        :param expand: Expand related entities.
        :type expand: list[str or ~cloud_communications.models.Get7ItemsItem]
        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: An iterator like instance of either CollectionOfCallRecord or the result of cls(response)
        :rtype: ~azure.core.paging.ItemPaged[~cloud_communications.models.CollectionOfCallRecord]
        :raises: ~azure.core.exceptions.HttpResponseError
        """
        cls = kwargs.pop('cls', None)  # type: ClsType["models.CollectionOfCallRecord"]
        error_map = {
            401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
        }
        error_map.update(kwargs.pop('error_map', {}))
        accept = "application/json"

        def prepare_request(next_link=None):
            # Construct headers
            header_parameters = {}  # type: Dict[str, Any]
            header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')

            if not next_link:
                # Construct URL
                url = self.list_call_records.metadata['url']  # type: ignore
                # Construct parameters
                query_parameters = {}  # type: Dict[str, Any]
                if self._config.top is not None:
                    query_parameters['$top'] = self._serialize.query("self._config.top", self._config.top, 'int', minimum=0)
                if self._config.skip is not None:
                    query_parameters['$skip'] = self._serialize.query("self._config.skip", self._config.skip, 'int', minimum=0)
                if self._config.search is not None:
                    query_parameters['$search'] = self._serialize.query("self._config.search", self._config.search, 'str')
                if self._config.filter is not None:
                    query_parameters['$filter'] = self._serialize.query("self._config.filter", self._config.filter, 'str')
                if self._config.count is not None:
                    query_parameters['$count'] = self._serialize.query("self._config.count", self._config.count, 'bool')
                if orderby is not None:
                    query_parameters['$orderby'] = self._serialize.query("orderby", orderby, '[str]', div=',')
                if select is not None:
                    query_parameters['$select'] = self._serialize.query("select", select, '[str]', div=',')
                if expand is not None:
                    query_parameters['$expand'] = self._serialize.query("expand", expand, '[str]', div=',')

                request = self._client.get(url, query_parameters, header_parameters)
            else:
                url = next_link
                query_parameters = {}  # type: Dict[str, Any]
                request = self._client.get(url, query_parameters, header_parameters)
            return request

        def extract_data(pipeline_response):
            deserialized = self._deserialize('CollectionOfCallRecord', pipeline_response)
            list_of_elem = deserialized.value
            if cls:
                list_of_elem = cls(list_of_elem)
            return deserialized.odata_next_link or None, iter(list_of_elem)

        def get_next(next_link=None):
            request = prepare_request(next_link)

            pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
            response = pipeline_response.http_response

            if response.status_code not in [200]:
                error = self._deserialize(models.OdataError, response)
                map_error(status_code=response.status_code, response=response, error_map=error_map)
                raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

            return pipeline_response

        return ItemPaged(
            get_next, extract_data
        )
    list_call_records.metadata = {'url': '/communications/callRecords'}  # type: ignore

    def create_call_records(
        self,
        body,  # type: "models.MicrosoftGraphCallRecordsCallRecord"
        **kwargs  # type: Any
    ):
        # type: (...) -> "models.MicrosoftGraphCallRecordsCallRecord"
        """Create new navigation property to callRecords for communications.

        Create new navigation property to callRecords for communications.

        :param body: New navigation property.
        :type body: ~cloud_communications.models.MicrosoftGraphCallRecordsCallRecord
        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: MicrosoftGraphCallRecordsCallRecord, or the result of cls(response)
        :rtype: ~cloud_communications.models.MicrosoftGraphCallRecordsCallRecord
        :raises: ~azure.core.exceptions.HttpResponseError
        """
        cls = kwargs.pop('cls', None)  # type: ClsType["models.MicrosoftGraphCallRecordsCallRecord"]
        error_map = {
            401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
        }
        error_map.update(kwargs.pop('error_map', {}))
        content_type = kwargs.pop("content_type", "application/json")
        accept = "application/json"

        # Construct URL
        url = self.create_call_records.metadata['url']  # type: ignore

        # Construct parameters
        query_parameters = {}  # type: Dict[str, Any]

        # Construct headers
        header_parameters = {}  # type: Dict[str, Any]
        header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
        header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')

        body_content_kwargs = {}  # type: Dict[str, Any]
        body_content = self._serialize.body(body, 'MicrosoftGraphCallRecordsCallRecord')
        body_content_kwargs['content'] = body_content
        request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
        pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
        response = pipeline_response.http_response

        if response.status_code not in [201]:
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            error = self._deserialize(models.OdataError, response)
            raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

        deserialized = self._deserialize('MicrosoftGraphCallRecordsCallRecord', pipeline_response)

        if cls:
            return cls(pipeline_response, deserialized, {})

        return deserialized
    create_call_records.metadata = {'url': '/communications/callRecords'}  # type: ignore

    def get_call_records(
        self,
        call_record_id,  # type: str
        select=None,  # type: Optional[List[Union[str, "models.Enum32"]]]
        expand=None,  # type: Optional[List[Union[str, "models.Get2ItemsItem"]]]
        **kwargs  # type: Any
    ):
        # type: (...) -> "models.MicrosoftGraphCallRecordsCallRecord"
        """Get callRecords from communications.

        Get callRecords from communications.

        :param call_record_id: key: id of callRecord.
        :type call_record_id: str
        :param select: Select properties to be returned.
        :type select: list[str or ~cloud_communications.models.Enum32]
        :param expand: Expand related entities.
        :type expand: list[str or ~cloud_communications.models.Get2ItemsItem]
        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: MicrosoftGraphCallRecordsCallRecord, or the result of cls(response)
        :rtype: ~cloud_communications.models.MicrosoftGraphCallRecordsCallRecord
        :raises: ~azure.core.exceptions.HttpResponseError
        """
        cls = kwargs.pop('cls', None)  # type: ClsType["models.MicrosoftGraphCallRecordsCallRecord"]
        error_map = {
            401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
        }
        error_map.update(kwargs.pop('error_map', {}))
        accept = "application/json"

        # Construct URL
        url = self.get_call_records.metadata['url']  # type: ignore
        path_format_arguments = {
            'callRecord-id': self._serialize.url("call_record_id", call_record_id, 'str'),
        }
        url = self._client.format_url(url, **path_format_arguments)

        # Construct parameters
        query_parameters = {}  # type: Dict[str, Any]
        if select is not None:
            query_parameters['$select'] = self._serialize.query("select", select, '[str]', div=',')
        if expand is not None:
            query_parameters['$expand'] = self._serialize.query("expand", expand, '[str]', div=',')

        # Construct headers
        header_parameters = {}  # type: Dict[str, Any]
        header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')

        request = self._client.get(url, query_parameters, header_parameters)
        pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
        response = pipeline_response.http_response

        if response.status_code not in [200]:
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            error = self._deserialize(models.OdataError, response)
            raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

        deserialized = self._deserialize('MicrosoftGraphCallRecordsCallRecord', pipeline_response)

        if cls:
            return cls(pipeline_response, deserialized, {})

        return deserialized
    get_call_records.metadata = {'url': '/communications/callRecords/{callRecord-id}'}  # type: ignore

    def update_call_records(
        self,
        call_record_id,  # type: str
        body,  # type: "models.MicrosoftGraphCallRecordsCallRecord"
        **kwargs  # type: Any
    ):
        # type: (...) -> None
        """Update the navigation property callRecords in communications.

        Update the navigation property callRecords in communications.

        :param call_record_id: key: id of callRecord.
        :type call_record_id: str
        :param body: New navigation property values.
        :type body: ~cloud_communications.models.MicrosoftGraphCallRecordsCallRecord
        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: None, or the result of cls(response)
        :rtype: None
        :raises: ~azure.core.exceptions.HttpResponseError
        """
        cls = kwargs.pop('cls', None)  # type: ClsType[None]
        error_map = {
            401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
        }
        error_map.update(kwargs.pop('error_map', {}))
        content_type = kwargs.pop("content_type", "application/json")
        accept = "application/json"

        # Construct URL
        url = self.update_call_records.metadata['url']  # type: ignore
        path_format_arguments = {
            'callRecord-id': self._serialize.url("call_record_id", call_record_id, 'str'),
        }
        url = self._client.format_url(url, **path_format_arguments)

        # Construct parameters
        query_parameters = {}  # type: Dict[str, Any]

        # Construct headers
        header_parameters = {}  # type: Dict[str, Any]
        header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
        header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')

        body_content_kwargs = {}  # type: Dict[str, Any]
        body_content = self._serialize.body(body, 'MicrosoftGraphCallRecordsCallRecord')
        body_content_kwargs['content'] = body_content
        request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs)
        pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
        response = pipeline_response.http_response

        if response.status_code not in [204]:
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            error = self._deserialize(models.OdataError, response)
            raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

        if cls:
            return cls(pipeline_response, None, {})

    update_call_records.metadata = {'url': '/communications/callRecords/{callRecord-id}'}  # type: ignore

    def delete_call_records(
        self,
        call_record_id,  # type: str
        if_match=None,  # type: Optional[str]
        **kwargs  # type: Any
    ):
        # type: (...) -> None
        """Delete navigation property callRecords for communications.

        Delete navigation property callRecords for communications.

        :param call_record_id: key: id of callRecord.
        :type call_record_id: str
        :param if_match: ETag.
        :type if_match: str
        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: None, or the result of cls(response)
        :rtype: None
        :raises: ~azure.core.exceptions.HttpResponseError
        """
        cls = kwargs.pop('cls', None)  # type: ClsType[None]
        error_map = {
            401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
        }
        error_map.update(kwargs.pop('error_map', {}))
        accept = "application/json"

        # Construct URL
        url = self.delete_call_records.metadata['url']  # type: ignore
        path_format_arguments = {
            'callRecord-id': self._serialize.url("call_record_id", call_record_id, 'str'),
        }
        url = self._client.format_url(url, **path_format_arguments)

        # Construct parameters
        query_parameters = {}  # type: Dict[str, Any]

        # Construct headers
        header_parameters = {}  # type: Dict[str, Any]
        if if_match is not None:
            header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str')
        header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')

        request = self._client.delete(url, query_parameters, header_parameters)
        pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
        response = pipeline_response.http_response

        if response.status_code not in [204]:
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            error = self._deserialize(models.OdataError, response)
            raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

        if cls:
            return cls(pipeline_response, None, {})

    delete_call_records.metadata = {'url': '/communications/callRecords/{callRecord-id}'}  # type: ignore

    def list_calls(
        self,
        orderby=None,  # type: Optional[List[Union[str, "models.Enum42"]]]
        select=None,  # type: Optional[List[Union[str, "models.Enum43"]]]
        expand=None,  # type: Optional[List[Union[str, "models.Enum44"]]]
        **kwargs  # type: Any
    ):
        # type: (...) -> Iterable["models.CollectionOfCall"]
        """Get calls from communications.

        Get calls from communications.

        :param orderby: Order items by property values.
        :type orderby: list[str or ~cloud_communications.models.Enum42]
        :param select: Select properties to be returned.
        :type select: list[str or ~cloud_communications.models.Enum43]
        :param expand: Expand related entities.
        :type expand: list[str or ~cloud_communications.models.Enum44]
        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: An iterator like instance of either CollectionOfCall or the result of cls(response)
        :rtype: ~azure.core.paging.ItemPaged[~cloud_communications.models.CollectionOfCall]
        :raises: ~azure.core.exceptions.HttpResponseError
        """
        cls = kwargs.pop('cls', None)  # type: ClsType["models.CollectionOfCall"]
        error_map = {
            401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
        }
        error_map.update(kwargs.pop('error_map', {}))
        accept = "application/json"

        def prepare_request(next_link=None):
            # Construct headers
            header_parameters = {}  # type: Dict[str, Any]
            header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')

            if not next_link:
                # Construct URL
                url = self.list_calls.metadata['url']  # type: ignore
                # Construct parameters
                query_parameters = {}  # type: Dict[str, Any]
                if self._config.top is not None:
                    query_parameters['$top'] = self._serialize.query("self._config.top", self._config.top, 'int', minimum=0)
                if self._config.skip is not None:
                    query_parameters['$skip'] = self._serialize.query("self._config.skip", self._config.skip, 'int', minimum=0)
                if self._config.search is not None:
                    query_parameters['$search'] = self._serialize.query("self._config.search", self._config.search, 'str')
                if self._config.filter is not None:
                    query_parameters['$filter'] = self._serialize.query("self._config.filter", self._config.filter, 'str')
                if self._config.count is not None:
                    query_parameters['$count'] = self._serialize.query("self._config.count", self._config.count, 'bool')
                if orderby is not None:
                    query_parameters['$orderby'] = self._serialize.query("orderby", orderby, '[str]', div=',')
                if select is not None:
                    query_parameters['$select'] = self._serialize.query("select", select, '[str]', div=',')
                if expand is not None:
                    query_parameters['$expand'] = self._serialize.query("expand", expand, '[str]', div=',')

                request = self._client.get(url, query_parameters, header_parameters)
            else:
                url = next_link
                query_parameters = {}  # type: Dict[str, Any]
                request = self._client.get(url, query_parameters, header_parameters)
            return request

        def extract_data(pipeline_response):
            deserialized = self._deserialize('CollectionOfCall', pipeline_response)
            list_of_elem = deserialized.value
            if cls:
                list_of_elem = cls(list_of_elem)
            return deserialized.odata_next_link or None, iter(list_of_elem)

        def get_next(next_link=None):
            request = prepare_request(next_link)

            pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
            response = pipeline_response.http_response

            if response.status_code not in [200]:
                error = self._deserialize(models.OdataError, response)
                map_error(status_code=response.status_code, response=response, error_map=error_map)
                raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

            return pipeline_response

        return ItemPaged(
            get_next, extract_data
        )
    list_calls.metadata = {'url': '/communications/calls'}  # type: ignore

    def create_calls(
        self,
        body,  # type: "models.MicrosoftGraphCall"
        **kwargs  # type: Any
    ):
        # type: (...) -> "models.MicrosoftGraphCall"
        """Create new navigation property to calls for communications.

        Create new navigation property to calls for communications.

        :param body: New navigation property.
        :type body: ~cloud_communications.models.MicrosoftGraphCall
        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: MicrosoftGraphCall, or the result of cls(response)
        :rtype: ~cloud_communications.models.MicrosoftGraphCall
        :raises: ~azure.core.exceptions.HttpResponseError
        """
        cls = kwargs.pop('cls', None)  # type: ClsType["models.MicrosoftGraphCall"]
        error_map = {
            401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
        }
        error_map.update(kwargs.pop('error_map', {}))
        content_type = kwargs.pop("content_type", "application/json")
        accept = "application/json"

        # Construct URL
        url = self.create_calls.metadata['url']  # type: ignore

        # Construct parameters
        query_parameters = {}  # type: Dict[str, Any]

        # Construct headers
        header_parameters = {}  # type: Dict[str, Any]
        header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
        header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')

        body_content_kwargs = {}  # type: Dict[str, Any]
        body_content = self._serialize.body(body, 'MicrosoftGraphCall')
        body_content_kwargs['content'] = body_content
        request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
        pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
        response = pipeline_response.http_response

        if response.status_code not in [201]:
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            error = self._deserialize(models.OdataError, response)
            raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

        deserialized = self._deserialize('MicrosoftGraphCall', pipeline_response)

        if cls:
            return cls(pipeline_response, deserialized, {})

        return deserialized
    create_calls.metadata = {'url': '/communications/calls'}  # type: ignore

    def get_calls(
        self,
        call_id,  # type: str
        select=None,  # type: Optional[List[Union[str, "models.Enum45"]]]
        expand=None,  # type: Optional[List[Union[str, "models.Enum46"]]]
        **kwargs  # type: Any
    ):
        # type: (...) -> "models.MicrosoftGraphCall"
        """Get calls from communications.

        Get calls from communications.

        :param call_id: key: id of call.
        :type call_id: str
        :param select: Select properties to be returned.
        :type select: list[str or ~cloud_communications.models.Enum45]
        :param expand: Expand related entities.
        :type expand: list[str or ~cloud_communications.models.Enum46]
        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: MicrosoftGraphCall, or the result of cls(response)
        :rtype: ~cloud_communications.models.MicrosoftGraphCall
        :raises: ~azure.core.exceptions.HttpResponseError
        """
        cls = kwargs.pop('cls', None)  # type: ClsType["models.MicrosoftGraphCall"]
        error_map = {
            401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
        }
        error_map.update(kwargs.pop('error_map', {}))
        accept = "application/json"

        # Construct URL
        url = self.get_calls.metadata['url']  # type: ignore
        path_format_arguments = {
            'call-id': self._serialize.url("call_id", call_id, 'str'),
        }
        url = self._client.format_url(url, **path_format_arguments)

        # Construct parameters
        query_parameters = {}  # type: Dict[str, Any]
        if select is not None:
            query_parameters['$select'] = self._serialize.query("select", select, '[str]', div=',')
        if expand is not None:
            query_parameters['$expand'] = self._serialize.query("expand", expand, '[str]', div=',')

        # Construct headers
        header_parameters = {}  # type: Dict[str, Any]
        header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')

        request = self._client.get(url, query_parameters, header_parameters)
        pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
        response = pipeline_response.http_response

        if response.status_code not in [200]:
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            error = self._deserialize(models.OdataError, response)
            raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

        deserialized = self._deserialize('MicrosoftGraphCall', pipeline_response)

        if cls:
            return cls(pipeline_response, deserialized, {})

        return deserialized
    get_calls.metadata = {'url': '/communications/calls/{call-id}'}  # type: ignore

    def update_calls(
        self,
        call_id,  # type: str
        body,  # type: "models.MicrosoftGraphCall"
        **kwargs  # type: Any
    ):
        # type: (...) -> None
        """Update the navigation property calls in communications.

        Update the navigation property calls in communications.

        :param call_id: key: id of call.
        :type call_id: str
        :param body: New navigation property values.
        :type body: ~cloud_communications.models.MicrosoftGraphCall
        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: None, or the result of cls(response)
        :rtype: None
        :raises: ~azure.core.exceptions.HttpResponseError
        """
        cls = kwargs.pop('cls', None)  # type: ClsType[None]
        error_map = {
            401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
        }
        error_map.update(kwargs.pop('error_map', {}))
        content_type = kwargs.pop("content_type", "application/json")
        accept = "application/json"

        # Construct URL
        url = self.update_calls.metadata['url']  # type: ignore
        path_format_arguments = {
            'call-id': self._serialize.url("call_id", call_id, 'str'),
        }
        url = self._client.format_url(url, **path_format_arguments)

        # Construct parameters
        query_parameters = {}  # type: Dict[str, Any]

        # Construct headers
        header_parameters = {}  # type: Dict[str, Any]
        header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
        header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')

        body_content_kwargs = {}  # type: Dict[str, Any]
        body_content = self._serialize.body(body, 'MicrosoftGraphCall')
        body_content_kwargs['content'] = body_content
        request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs)
        pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
        response = pipeline_response.http_response

        if response.status_code not in [204]:
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            error = self._deserialize(models.OdataError, response)
            raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

        if cls:
            return cls(pipeline_response, None, {})

    update_calls.metadata = {'url': '/communications/calls/{call-id}'}  # type: ignore

    def delete_calls(
        self,
        call_id,  # type: str
        if_match=None,  # type: Optional[str]
        **kwargs  # type: Any
    ):
        # type: (...) -> None
        """Delete navigation property calls for communications.

        Delete navigation property calls for communications.

        :param call_id: key: id of call.
        :type call_id: str
        :param if_match: ETag.
        :type if_match: str
        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: None, or the result of cls(response)
        :rtype: None
        :raises: ~azure.core.exceptions.HttpResponseError
        """
        cls = kwargs.pop('cls', None)  # type: ClsType[None]
        error_map = {
            401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
        }
        error_map.update(kwargs.pop('error_map', {}))
        accept = "application/json"

        # Construct URL
        url = self.delete_calls.metadata['url']  # type: ignore
        path_format_arguments = {
            'call-id': self._serialize.url("call_id", call_id, 'str'),
        }
        url = self._client.format_url(url, **path_format_arguments)

        # Construct parameters
        query_parameters = {}  # type: Dict[str, Any]

        # Construct headers
        header_parameters = {}  # type: Dict[str, Any]
        if if_match is not None:
            header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str')
        header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')

        request = self._client.delete(url, query_parameters, header_parameters)
        pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
        response = pipeline_response.http_response

        if response.status_code not in [204]:
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            error = self._deserialize(models.OdataError, response)
            raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

        if cls:
            return cls(pipeline_response, None, {})

    delete_calls.metadata = {'url': '/communications/calls/{call-id}'}  # type: ignore

    def get_presences_by_user_id(
        self,
        body,  # type: "models.Paths10WpgkzCommunicationsMicrosoftGraphGetpresencesbyuseridPostRequestbodyContentApplicationJsonSchema"
        **kwargs  # type: Any
    ):
        # type: (...) -> List["models.MicrosoftGraphPresence"]
        """Invoke action getPresencesByUserId.

        Invoke action getPresencesByUserId.

        :param body: Action parameters.
        :type body: ~cloud_communications.models.Paths10WpgkzCommunicationsMicrosoftGraphGetpresencesbyuseridPostRequestbodyContentApplicationJsonSchema
        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: list of MicrosoftGraphPresence, or the result of cls(response)
        :rtype: list[~cloud_communications.models.MicrosoftGraphPresence]
        :raises: ~azure.core.exceptions.HttpResponseError
        """
        cls = kwargs.pop('cls', None)  # type: ClsType[List["models.MicrosoftGraphPresence"]]
        error_map = {
            401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
        }
        error_map.update(kwargs.pop('error_map', {}))
        content_type = kwargs.pop("content_type", "application/json")
        accept = "application/json"

        # Construct URL
        url = self.get_presences_by_user_id.metadata['url']  # type: ignore

        # Construct parameters
        query_parameters = {}  # type: Dict[str, Any]

        # Construct headers
        header_parameters = {}  # type: Dict[str, Any]
        header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
        header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')

        body_content_kwargs = {}  # type: Dict[str, Any]
        body_content = self._serialize.body(body, 'Paths10WpgkzCommunicationsMicrosoftGraphGetpresencesbyuseridPostRequestbodyContentApplicationJsonSchema')
        body_content_kwargs['content'] = body_content
        request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
        pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
        response = pipeline_response.http_response

        if response.status_code not in [200]:
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            error = self._deserialize(models.OdataError, response)
            raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

        deserialized = self._deserialize('[MicrosoftGraphPresence]', pipeline_response)

        if cls:
            return cls(pipeline_response, deserialized, {})

        return deserialized
    get_presences_by_user_id.metadata = {'url': '/communications/microsoft.graph.getPresencesByUserId'}  # type: ignore

    def list_online_meetings(
        self,
        orderby=None,  # type: Optional[List[Union[str, "models.Enum61"]]]
        select=None,  # type: Optional[List[Union[str, "models.Enum62"]]]
        expand=None,  # type: Optional[List[str]]
        **kwargs  # type: Any
    ):
        # type: (...) -> Iterable["models.CollectionOfOnlineMeeting"]
        """Get onlineMeetings from communications.

        Get onlineMeetings from communications.

        :param orderby: Order items by property values.
        :type orderby: list[str or ~cloud_communications.models.Enum61]
        :param select: Select properties to be returned.
        :type select: list[str or ~cloud_communications.models.Enum62]
        :param expand: Expand related entities.
        :type expand: list[str]
        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: An iterator like instance of either CollectionOfOnlineMeeting or the result of cls(response)
        :rtype: ~azure.core.paging.ItemPaged[~cloud_communications.models.CollectionOfOnlineMeeting]
        :raises: ~azure.core.exceptions.HttpResponseError
        """
        cls = kwargs.pop('cls', None)  # type: ClsType["models.CollectionOfOnlineMeeting"]
        error_map = {
            401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
        }
        error_map.update(kwargs.pop('error_map', {}))
        accept = "application/json"

        def prepare_request(next_link=None):
            # Construct headers
            header_parameters = {}  # type: Dict[str, Any]
            header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')

            if not next_link:
                # Construct URL
                url = self.list_online_meetings.metadata['url']  # type: ignore
                # Construct parameters
                query_parameters = {}  # type: Dict[str, Any]
                if self._config.top is not None:
                    query_parameters['$top'] = self._serialize.query("self._config.top", self._config.top, 'int', minimum=0)
                if self._config.skip is not None:
                    query_parameters['$skip'] = self._serialize.query("self._config.skip", self._config.skip, 'int', minimum=0)
                if self._config.search is not None:
                    query_parameters['$search'] = self._serialize.query("self._config.search", self._config.search, 'str')
                if self._config.filter is not None:
                    query_parameters['$filter'] = self._serialize.query("self._config.filter", self._config.filter, 'str')
                if self._config.count is not None:
                    query_parameters['$count'] = self._serialize.query("self._config.count", self._config.count, 'bool')
                if orderby is not None:
                    query_parameters['$orderby'] = self._serialize.query("orderby", orderby, '[str]', div=',')
                if select is not None:
                    query_parameters['$select'] = self._serialize.query("select", select, '[str]', div=',')
                if expand is not None:
                    query_parameters['$expand'] = self._serialize.query("expand", expand, '[str]', div=',')

                request = self._client.get(url, query_parameters, header_parameters)
            else:
                url = next_link
                query_parameters = {}  # type: Dict[str, Any]
                request = self._client.get(url, query_parameters, header_parameters)
            return request

        def extract_data(pipeline_response):
            deserialized = self._deserialize('CollectionOfOnlineMeeting', pipeline_response)
            list_of_elem = deserialized.value
            if cls:
                list_of_elem = cls(list_of_elem)
            return deserialized.odata_next_link or None, iter(list_of_elem)

        def get_next(next_link=None):
            request = prepare_request(next_link)

            pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
            response = pipeline_response.http_response

            if response.status_code not in [200]:
                error = self._deserialize(models.OdataError, response)
                map_error(status_code=response.status_code, response=response, error_map=error_map)
                raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

            return pipeline_response

        return ItemPaged(
            get_next, extract_data
        )
    list_online_meetings.metadata = {'url': '/communications/onlineMeetings'}  # type: ignore

    def create_online_meetings(
        self,
        body,  # type: "models.MicrosoftGraphOnlineMeeting"
        **kwargs  # type: Any
    ):
        # type: (...) -> "models.MicrosoftGraphOnlineMeeting"
        """Create new navigation property to onlineMeetings for communications.

        Create new navigation property to onlineMeetings for communications.

        :param body: New navigation property.
        :type body: ~cloud_communications.models.MicrosoftGraphOnlineMeeting
        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: MicrosoftGraphOnlineMeeting, or the result of cls(response)
        :rtype: ~cloud_communications.models.MicrosoftGraphOnlineMeeting
        :raises: ~azure.core.exceptions.HttpResponseError
        """
        cls = kwargs.pop('cls', None)  # type: ClsType["models.MicrosoftGraphOnlineMeeting"]
        error_map = {
            401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
        }
        error_map.update(kwargs.pop('error_map', {}))
        content_type = kwargs.pop("content_type", "application/json")
        accept = "application/json"

        # Construct URL
        url = self.create_online_meetings.metadata['url']  # type: ignore

        # Construct parameters
        query_parameters = {}  # type: Dict[str, Any]

        # Construct headers
        header_parameters = {}  # type: Dict[str, Any]
        header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
        header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')

        body_content_kwargs = {}  # type: Dict[str, Any]
        body_content = self._serialize.body(body, 'MicrosoftGraphOnlineMeeting')
        body_content_kwargs['content'] = body_content
        request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
        pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
        response = pipeline_response.http_response

        if response.status_code not in [201]:
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            error = self._deserialize(models.OdataError, response)
            raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

        deserialized = self._deserialize('MicrosoftGraphOnlineMeeting', pipeline_response)

        if cls:
            return cls(pipeline_response, deserialized, {})

        return deserialized
    create_online_meetings.metadata = {'url': '/communications/onlineMeetings'}  # type: ignore

    def get_online_meetings(
        self,
        online_meeting_id,  # type: str
        select=None,  # type: Optional[List[Union[str, "models.Enum63"]]]
        expand=None,  # type: Optional[List[str]]
        **kwargs  # type: Any
    ):
        # type: (...) -> "models.MicrosoftGraphOnlineMeeting"
        """Get onlineMeetings from communications.

        Get onlineMeetings from communications.

        :param online_meeting_id: key: id of onlineMeeting.
        :type online_meeting_id: str
        :param select: Select properties to be returned.
        :type select: list[str or ~cloud_communications.models.Enum63]
        :param expand: Expand related entities.
        :type expand: list[str]
        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: MicrosoftGraphOnlineMeeting, or the result of cls(response)
        :rtype: ~cloud_communications.models.MicrosoftGraphOnlineMeeting
        :raises: ~azure.core.exceptions.HttpResponseError
        """
        cls = kwargs.pop('cls', None)  # type: ClsType["models.MicrosoftGraphOnlineMeeting"]
        error_map = {
            401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
        }
        error_map.update(kwargs.pop('error_map', {}))
        accept = "application/json"

        # Construct URL
        url = self.get_online_meetings.metadata['url']  # type: ignore
        path_format_arguments = {
            'onlineMeeting-id': self._serialize.url("online_meeting_id", online_meeting_id, 'str'),
        }
        url = self._client.format_url(url, **path_format_arguments)

        # Construct parameters
        query_parameters = {}  # type: Dict[str, Any]
        if select is not None:
            query_parameters['$select'] = self._serialize.query("select", select, '[str]', div=',')
        if expand is not None:
            query_parameters['$expand'] = self._serialize.query("expand", expand, '[str]', div=',')

        # Construct headers
        header_parameters = {}  # type: Dict[str, Any]
        header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')

        request = self._client.get(url, query_parameters, header_parameters)
        pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
        response = pipeline_response.http_response

        if response.status_code not in [200]:
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            error = self._deserialize(models.OdataError, response)
            raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

        deserialized = self._deserialize('MicrosoftGraphOnlineMeeting', pipeline_response)

        if cls:
            return cls(pipeline_response, deserialized, {})

        return deserialized
    get_online_meetings.metadata = {'url': '/communications/onlineMeetings/{onlineMeeting-id}'}  # type: ignore

    def update_online_meetings(
        self,
        online_meeting_id,  # type: str
        body,  # type: "models.MicrosoftGraphOnlineMeeting"
        **kwargs  # type: Any
    ):
        # type: (...) -> None
        """Update the navigation property onlineMeetings in communications.

        Update the navigation property onlineMeetings in communications.

        :param online_meeting_id: key: id of onlineMeeting.
        :type online_meeting_id: str
        :param body: New navigation property values.
        :type body: ~cloud_communications.models.MicrosoftGraphOnlineMeeting
        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: None, or the result of cls(response)
        :rtype: None
        :raises: ~azure.core.exceptions.HttpResponseError
        """
        cls = kwargs.pop('cls', None)  # type: ClsType[None]
        error_map = {
            401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
        }
        error_map.update(kwargs.pop('error_map', {}))
        content_type = kwargs.pop("content_type", "application/json")
        accept = "application/json"

        # Construct URL
        url = self.update_online_meetings.metadata['url']  # type: ignore
        path_format_arguments = {
            'onlineMeeting-id': self._serialize.url("online_meeting_id", online_meeting_id, 'str'),
        }
        url = self._client.format_url(url, **path_format_arguments)

        # Construct parameters
        query_parameters = {}  # type: Dict[str, Any]

        # Construct headers
        header_parameters = {}  # type: Dict[str, Any]
        header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
        header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')

        body_content_kwargs = {}  # type: Dict[str, Any]
        body_content = self._serialize.body(body, 'MicrosoftGraphOnlineMeeting')
        body_content_kwargs['content'] = body_content
        request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs)
        pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
        response = pipeline_response.http_response

        if response.status_code not in [204]:
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            error = self._deserialize(models.OdataError, response)
            raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

        if cls:
            return cls(pipeline_response, None, {})

    update_online_meetings.metadata = {'url': '/communications/onlineMeetings/{onlineMeeting-id}'}  # type: ignore

    def delete_online_meetings(
        self,
        online_meeting_id,  # type: str
        if_match=None,  # type: Optional[str]
        **kwargs  # type: Any
    ):
        # type: (...) -> None
        """Delete navigation property onlineMeetings for communications.

        Delete navigation property onlineMeetings for communications.

        :param online_meeting_id: key: id of onlineMeeting.
        :type online_meeting_id: str
        :param if_match: ETag.
        :type if_match: str
        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: None, or the result of cls(response)
        :rtype: None
        :raises: ~azure.core.exceptions.HttpResponseError
        """
        cls = kwargs.pop('cls', None)  # type: ClsType[None]
        error_map = {
            401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
        }
        error_map.update(kwargs.pop('error_map', {}))
        accept = "application/json"

        # Construct URL
        url = self.delete_online_meetings.metadata['url']  # type: ignore
        path_format_arguments = {
            'onlineMeeting-id': self._serialize.url("online_meeting_id", online_meeting_id, 'str'),
        }
        url = self._client.format_url(url, **path_format_arguments)

        # Construct parameters
        query_parameters = {}  # type: Dict[str, Any]

        # Construct headers
        header_parameters = {}  # type: Dict[str, Any]
        if if_match is not None:
            header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str')
        header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')

        request = self._client.delete(url, query_parameters, header_parameters)
        pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
        response = pipeline_response.http_response

        if response.status_code not in [204]:
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            error = self._deserialize(models.OdataError, response)
            raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

        if cls:
            return cls(pipeline_response, None, {})

    delete_online_meetings.metadata = {'url': '/communications/onlineMeetings/{onlineMeeting-id}'}  # type: ignore

    def list_presences(
        self,
        orderby=None,  # type: Optional[List[Union[str, "models.Enum64"]]]
        select=None,  # type: Optional[List[Union[str, "models.Enum65"]]]
        expand=None,  # type: Optional[List[str]]
        **kwargs  # type: Any
    ):
        # type: (...) -> Iterable["models.CollectionOfPresence"]
        """Get presences from communications.

        Get presences from communications.

        :param orderby: Order items by property values.
        :type orderby: list[str or ~cloud_communications.models.Enum64]
        :param select: Select properties to be returned.
        :type select: list[str or ~cloud_communications.models.Enum65]
        :param expand: Expand related entities.
        :type expand: list[str]
        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: An iterator like instance of either CollectionOfPresence or the result of cls(response)
        :rtype: ~azure.core.paging.ItemPaged[~cloud_communications.models.CollectionOfPresence]
        :raises: ~azure.core.exceptions.HttpResponseError
        """
        cls = kwargs.pop('cls', None)  # type: ClsType["models.CollectionOfPresence"]
        error_map = {
            401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
        }
        error_map.update(kwargs.pop('error_map', {}))
        accept = "application/json"

        def prepare_request(next_link=None):
            # Construct headers
            header_parameters = {}  # type: Dict[str, Any]
            header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')

            if not next_link:
                # Construct URL
                url = self.list_presences.metadata['url']  # type: ignore
                # Construct parameters
                query_parameters = {}  # type: Dict[str, Any]
                if self._config.top is not None:
                    query_parameters['$top'] = self._serialize.query("self._config.top", self._config.top, 'int', minimum=0)
                if self._config.skip is not None:
                    query_parameters['$skip'] = self._serialize.query("self._config.skip", self._config.skip, 'int', minimum=0)
                if self._config.search is not None:
                    query_parameters['$search'] = self._serialize.query("self._config.search", self._config.search, 'str')
                if self._config.filter is not None:
                    query_parameters['$filter'] = self._serialize.query("self._config.filter", self._config.filter, 'str')
                if self._config.count is not None:
                    query_parameters['$count'] = self._serialize.query("self._config.count", self._config.count, 'bool')
                if orderby is not None:
                    query_parameters['$orderby'] = self._serialize.query("orderby", orderby, '[str]', div=',')
                if select is not None:
                    query_parameters['$select'] = self._serialize.query("select", select, '[str]', div=',')
                if expand is not None:
                    query_parameters['$expand'] = self._serialize.query("expand", expand, '[str]', div=',')

                request = self._client.get(url, query_parameters, header_parameters)
            else:
                url = next_link
                query_parameters = {}  # type: Dict[str, Any]
                request = self._client.get(url, query_parameters, header_parameters)
            return request

        def extract_data(pipeline_response):
            deserialized = self._deserialize('CollectionOfPresence', pipeline_response)
            list_of_elem = deserialized.value
            if cls:
                list_of_elem = cls(list_of_elem)
            return deserialized.odata_next_link or None, iter(list_of_elem)

        def get_next(next_link=None):
            request = prepare_request(next_link)

            pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
            response = pipeline_response.http_response

            if response.status_code not in [200]:
                error = self._deserialize(models.OdataError, response)
                map_error(status_code=response.status_code, response=response, error_map=error_map)
                raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

            return pipeline_response

        return ItemPaged(
            get_next, extract_data
        )
    list_presences.metadata = {'url': '/communications/presences'}  # type: ignore

    def create_presences(
        self,
        body,  # type: "models.MicrosoftGraphPresence"
        **kwargs  # type: Any
    ):
        # type: (...) -> "models.MicrosoftGraphPresence"
        """Create new navigation property to presences for communications.

        Create new navigation property to presences for communications.

        :param body: New navigation property.
        :type body: ~cloud_communications.models.MicrosoftGraphPresence
        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: MicrosoftGraphPresence, or the result of cls(response)
        :rtype: ~cloud_communications.models.MicrosoftGraphPresence
        :raises: ~azure.core.exceptions.HttpResponseError
        """
        cls = kwargs.pop('cls', None)  # type: ClsType["models.MicrosoftGraphPresence"]
        error_map = {
            401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
        }
        error_map.update(kwargs.pop('error_map', {}))
        content_type = kwargs.pop("content_type", "application/json")
        accept = "application/json"

        # Construct URL
        url = self.create_presences.metadata['url']  # type: ignore

        # Construct parameters
        query_parameters = {}  # type: Dict[str, Any]

        # Construct headers
        header_parameters = {}  # type: Dict[str, Any]
        header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
        header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')

        body_content_kwargs = {}  # type: Dict[str, Any]
        body_content = self._serialize.body(body, 'MicrosoftGraphPresence')
        body_content_kwargs['content'] = body_content
        request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
        pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
        response = pipeline_response.http_response

        if response.status_code not in [201]:
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            error = self._deserialize(models.OdataError, response)
            raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

        deserialized = self._deserialize('MicrosoftGraphPresence', pipeline_response)

        if cls:
            return cls(pipeline_response, deserialized, {})

        return deserialized
    create_presences.metadata = {'url': '/communications/presences'}  # type: ignore

    def get_presences(
        self,
        presence_id,  # type: str
        select=None,  # type: Optional[List[Union[str, "models.Enum66"]]]
        expand=None,  # type: Optional[List[str]]
        **kwargs  # type: Any
    ):
        # type: (...) -> "models.MicrosoftGraphPresence"
        """Get presences from communications.

        Get presences from communications.

        :param presence_id: key: id of presence.
        :type presence_id: str
        :param select: Select properties to be returned.
        :type select: list[str or ~cloud_communications.models.Enum66]
        :param expand: Expand related entities.
        :type expand: list[str]
        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: MicrosoftGraphPresence, or the result of cls(response)
        :rtype: ~cloud_communications.models.MicrosoftGraphPresence
        :raises: ~azure.core.exceptions.HttpResponseError
        """
        cls = kwargs.pop('cls', None)  # type: ClsType["models.MicrosoftGraphPresence"]
        error_map = {
            401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
        }
        error_map.update(kwargs.pop('error_map', {}))
        accept = "application/json"

        # Construct URL
        url = self.get_presences.metadata['url']  # type: ignore
        path_format_arguments = {
            'presence-id': self._serialize.url("presence_id", presence_id, 'str'),
        }
        url = self._client.format_url(url, **path_format_arguments)

        # Construct parameters
        query_parameters = {}  # type: Dict[str, Any]
        if select is not None:
            query_parameters['$select'] = self._serialize.query("select", select, '[str]', div=',')
        if expand is not None:
            query_parameters['$expand'] = self._serialize.query("expand", expand, '[str]', div=',')

        # Construct headers
        header_parameters = {}  # type: Dict[str, Any]
        header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')

        request = self._client.get(url, query_parameters, header_parameters)
        pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
        response = pipeline_response.http_response

        if response.status_code not in [200]:
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            error = self._deserialize(models.OdataError, response)
            raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

        deserialized = self._deserialize('MicrosoftGraphPresence', pipeline_response)

        if cls:
            return cls(pipeline_response, deserialized, {})

        return deserialized
    get_presences.metadata = {'url': '/communications/presences/{presence-id}'}  # type: ignore

    def update_presences(
        self,
        presence_id,  # type: str
        body,  # type: "models.MicrosoftGraphPresence"
        **kwargs  # type: Any
    ):
        # type: (...) -> None
        """Update the navigation property presences in communications.

        Update the navigation property presences in communications.

        :param presence_id: key: id of presence.
        :type presence_id: str
        :param body: New navigation property values.
        :type body: ~cloud_communications.models.MicrosoftGraphPresence
        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: None, or the result of cls(response)
        :rtype: None
        :raises: ~azure.core.exceptions.HttpResponseError
        """
        cls = kwargs.pop('cls', None)  # type: ClsType[None]
        error_map = {
            401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
        }
        error_map.update(kwargs.pop('error_map', {}))
        content_type = kwargs.pop("content_type", "application/json")
        accept = "application/json"

        # Construct URL
        url = self.update_presences.metadata['url']  # type: ignore
        path_format_arguments = {
            'presence-id': self._serialize.url("presence_id", presence_id, 'str'),
        }
        url = self._client.format_url(url, **path_format_arguments)

        # Construct parameters
        query_parameters = {}  # type: Dict[str, Any]

        # Construct headers
        header_parameters = {}  # type: Dict[str, Any]
        header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
        header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')

        body_content_kwargs = {}  # type: Dict[str, Any]
        body_content = self._serialize.body(body, 'MicrosoftGraphPresence')
        body_content_kwargs['content'] = body_content
        request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs)
        pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
        response = pipeline_response.http_response

        if response.status_code not in [204]:
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            error = self._deserialize(models.OdataError, response)
            raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

        if cls:
            return cls(pipeline_response, None, {})

    update_presences.metadata = {'url': '/communications/presences/{presence-id}'}  # type: ignore

    def delete_presences(
        self,
        presence_id,  # type: str
        if_match=None,  # type: Optional[str]
        **kwargs  # type: Any
    ):
        # type: (...) -> None
        """Delete navigation property presences for communications.

        Delete navigation property presences for communications.

        :param presence_id: key: id of presence.
        :type presence_id: str
        :param if_match: ETag.
        :type if_match: str
        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: None, or the result of cls(response)
        :rtype: None
        :raises: ~azure.core.exceptions.HttpResponseError
        """
        cls = kwargs.pop('cls', None)  # type: ClsType[None]
        error_map = {
            401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
        }
        error_map.update(kwargs.pop('error_map', {}))
        accept = "application/json"

        # Construct URL
        url = self.delete_presences.metadata['url']  # type: ignore
        path_format_arguments = {
            'presence-id': self._serialize.url("presence_id", presence_id, 'str'),
        }
        url = self._client.format_url(url, **path_format_arguments)

        # Construct parameters
        query_parameters = {}  # type: Dict[str, Any]

        # Construct headers
        header_parameters = {}  # type: Dict[str, Any]
        if if_match is not None:
            header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str')
        header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')

        request = self._client.delete(url, query_parameters, header_parameters)
        pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
        response = pipeline_response.http_response

        if response.status_code not in [204]:
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            error = self._deserialize(models.OdataError, response)
            raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

        if cls:
            return cls(pipeline_response, None, {})

    delete_presences.metadata = {'url': '/communications/presences/{presence-id}'}  # type: ignore

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

from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import HttpRequest, HttpResponse
from azure.mgmt.core.exceptions import ARMErrorFormat

from .. import models

if TYPE_CHECKING:
    # pylint: disable=unused-import,ungrouped-imports
    from typing import Any, Callable, Dict, Generic, Iterable, List, Optional, TypeVar, Union

    T = TypeVar('T')
    ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]

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

    You should not instantiate this class directly. Instead, you should create a Client instance that
    instantiates it for you and attaches it as an attribute.

    :ivar models: Alias to model classes used in this operation group.
    :type models: ~cloud_communications.models
    :param client: Client for service requests.
    :param config: Configuration of service client.
    :param serializer: An object model serializer.
    :param deserializer: An object model deserializer.
    """

    models = models

    def __init__(self, client, config, serializer, deserializer):
        self._client = client
        self._serialize = serializer
        self._deserialize = deserializer
        self._config = config

    def list_call_records(
        self,
        orderby=None,  # type: Optional[List[Union[str, "models.Get5ItemsItem"]]]
        select=None,  # type: Optional[List[Union[str, "models.Get6ItemsItem"]]]
        expand=None,  # type: Optional[List[Union[str, "models.Get7ItemsItem"]]]
        **kwargs  # type: Any
    ):
        # type: (...) -> Iterable["models.CollectionOfCallRecord"]
        """Get callRecords from communications.

        Get callRecords from communications.

        :param orderby: Order items by property values.
        :type orderby: list[str or ~cloud_communications.models.Get5ItemsItem]
        :param select: Select properties to be returned.
        :type select: list[str or ~cloud_communications.models.Get6ItemsItem]
        :param expand: Expand related entities.
        :type expand: list[str or ~cloud_communications.models.Get7ItemsItem]
        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: An iterator like instance of either CollectionOfCallRecord or the result of cls(response)
        :rtype: ~azure.core.paging.ItemPaged[~cloud_communications.models.CollectionOfCallRecord]
        :raises: ~azure.core.exceptions.HttpResponseError
        """
        cls = kwargs.pop('cls', None)  # type: ClsType["models.CollectionOfCallRecord"]
        error_map = {
            401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
        }
        error_map.update(kwargs.pop('error_map', {}))
        accept = "application/json"

        def prepare_request(next_link=None):
            # Construct headers
            header_parameters = {}  # type: Dict[str, Any]
            header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')

            if not next_link:
                # Construct URL
                url = self.list_call_records.metadata['url']  # type: ignore
                # Construct parameters
                query_parameters = {}  # type: Dict[str, Any]
                if self._config.top is not None:
                    query_parameters['$top'] = self._serialize.query("self._config.top", self._config.top, 'int', minimum=0)
                if self._config.skip is not None:
                    query_parameters['$skip'] = self._serialize.query("self._config.skip", self._config.skip, 'int', minimum=0)
                if self._config.search is not None:
                    query_parameters['$search'] = self._serialize.query("self._config.search", self._config.search, 'str')
                if self._config.filter is not None:
                    query_parameters['$filter'] = self._serialize.query("self._config.filter", self._config.filter, 'str')
                if self._config.count is not None:
                    query_parameters['$count'] = self._serialize.query("self._config.count", self._config.count, 'bool')
                if orderby is not None:
                    query_parameters['$orderby'] = self._serialize.query("orderby", orderby, '[str]', div=',')
                if select is not None:
                    query_parameters['$select'] = self._serialize.query("select", select, '[str]', div=',')
                if expand is not None:
                    query_parameters['$expand'] = self._serialize.query("expand", expand, '[str]', div=',')

                request = self._client.get(url, query_parameters, header_parameters)
            else:
                url = next_link
                query_parameters = {}  # type: Dict[str, Any]
                request = self._client.get(url, query_parameters, header_parameters)
            return request

        def extract_data(pipeline_response):
            deserialized = self._deserialize('CollectionOfCallRecord', pipeline_response)
            list_of_elem = deserialized.value
            if cls:
                list_of_elem = cls(list_of_elem)
            return deserialized.odata_next_link or None, iter(list_of_elem)

        def get_next(next_link=None):
            request = prepare_request(next_link)

            pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
            response = pipeline_response.http_response

            if response.status_code not in [200]:
                error = self._deserialize(models.OdataError, response)
                map_error(status_code=response.status_code, response=response, error_map=error_map)
                raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

            return pipeline_response

        return ItemPaged(
            get_next, extract_data
        )
    list_call_records.metadata = {'url': '/communications/callRecords'}  # type: ignore

    def create_call_records(
        self,
        body,  # type: "models.MicrosoftGraphCallRecordsCallRecord"
        **kwargs  # type: Any
    ):
        # type: (...) -> "models.MicrosoftGraphCallRecordsCallRecord"
        """Create new navigation property to callRecords for communications.

        Create new navigation property to callRecords for communications.

        :param body: New navigation property.
        :type body: ~cloud_communications.models.MicrosoftGraphCallRecordsCallRecord
        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: MicrosoftGraphCallRecordsCallRecord, or the result of cls(response)
        :rtype: ~cloud_communications.models.MicrosoftGraphCallRecordsCallRecord
        :raises: ~azure.core.exceptions.HttpResponseError
        """
        cls = kwargs.pop('cls', None)  # type: ClsType["models.MicrosoftGraphCallRecordsCallRecord"]
        error_map = {
            401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
        }
        error_map.update(kwargs.pop('error_map', {}))
        content_type = kwargs.pop("content_type", "application/json")
        accept = "application/json"

        # Construct URL
        url = self.create_call_records.metadata['url']  # type: ignore

        # Construct parameters
        query_parameters = {}  # type: Dict[str, Any]

        # Construct headers
        header_parameters = {}  # type: Dict[str, Any]
        header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
        header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')

        body_content_kwargs = {}  # type: Dict[str, Any]
        body_content = self._serialize.body(body, 'MicrosoftGraphCallRecordsCallRecord')
        body_content_kwargs['content'] = body_content
        request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
        pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
        response = pipeline_response.http_response

        if response.status_code not in [201]:
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            error = self._deserialize(models.OdataError, response)
            raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

        deserialized = self._deserialize('MicrosoftGraphCallRecordsCallRecord', pipeline_response)

        if cls:
            return cls(pipeline_response, deserialized, {})

        return deserialized
    create_call_records.metadata = {'url': '/communications/callRecords'}  # type: ignore

    def get_call_records(
        self,
        call_record_id,  # type: str
        select=None,  # type: Optional[List[Union[str, "models.Enum32"]]]
        expand=None,  # type: Optional[List[Union[str, "models.Get2ItemsItem"]]]
        **kwargs  # type: Any
    ):
        # type: (...) -> "models.MicrosoftGraphCallRecordsCallRecord"
        """Get callRecords from communications.

        Get callRecords from communications.

        :param call_record_id: key: id of callRecord.
        :type call_record_id: str
        :param select: Select properties to be returned.
        :type select: list[str or ~cloud_communications.models.Enum32]
        :param expand: Expand related entities.
        :type expand: list[str or ~cloud_communications.models.Get2ItemsItem]
        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: MicrosoftGraphCallRecordsCallRecord, or the result of cls(response)
        :rtype: ~cloud_communications.models.MicrosoftGraphCallRecordsCallRecord
        :raises: ~azure.core.exceptions.HttpResponseError
        """
        cls = kwargs.pop('cls', None)  # type: ClsType["models.MicrosoftGraphCallRecordsCallRecord"]
        error_map = {
            401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
        }
        error_map.update(kwargs.pop('error_map', {}))
        accept = "application/json"

        # Construct URL
        url = self.get_call_records.metadata['url']  # type: ignore
        path_format_arguments = {
            'callRecord-id': self._serialize.url("call_record_id", call_record_id, 'str'),
        }
        url = self._client.format_url(url, **path_format_arguments)

        # Construct parameters
        query_parameters = {}  # type: Dict[str, Any]
        if select is not None:
            query_parameters['$select'] = self._serialize.query("select", select, '[str]', div=',')
        if expand is not None:
            query_parameters['$expand'] = self._serialize.query("expand", expand, '[str]', div=',')

        # Construct headers
        header_parameters = {}  # type: Dict[str, Any]
        header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')

        request = self._client.get(url, query_parameters, header_parameters)
        pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
        response = pipeline_response.http_response

        if response.status_code not in [200]:
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            error = self._deserialize(models.OdataError, response)
            raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

        deserialized = self._deserialize('MicrosoftGraphCallRecordsCallRecord', pipeline_response)

        if cls:
            return cls(pipeline_response, deserialized, {})

        return deserialized
    get_call_records.metadata = {'url': '/communications/callRecords/{callRecord-id}'}  # type: ignore

    def update_call_records(
        self,
        call_record_id,  # type: str
        body,  # type: "models.MicrosoftGraphCallRecordsCallRecord"
        **kwargs  # type: Any
    ):
        # type: (...) -> None
        """Update the navigation property callRecords in communications.

        Update the navigation property callRecords in communications.

        :param call_record_id: key: id of callRecord.
        :type call_record_id: str
        :param body: New navigation property values.
        :type body: ~cloud_communications.models.MicrosoftGraphCallRecordsCallRecord
        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: None, or the result of cls(response)
        :rtype: None
        :raises: ~azure.core.exceptions.HttpResponseError
        """
        cls = kwargs.pop('cls', None)  # type: ClsType[None]
        error_map = {
            401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
        }
        error_map.update(kwargs.pop('error_map', {}))
        content_type = kwargs.pop("content_type", "application/json")
        accept = "application/json"

        # Construct URL
        url = self.update_call_records.metadata['url']  # type: ignore
        path_format_arguments = {
            'callRecord-id': self._serialize.url("call_record_id", call_record_id, 'str'),
        }
        url = self._client.format_url(url, **path_format_arguments)

        # Construct parameters
        query_parameters = {}  # type: Dict[str, Any]

        # Construct headers
        header_parameters = {}  # type: Dict[str, Any]
        header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
        header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')

        body_content_kwargs = {}  # type: Dict[str, Any]
        body_content = self._serialize.body(body, 'MicrosoftGraphCallRecordsCallRecord')
        body_content_kwargs['content'] = body_content
        request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs)
        pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
        response = pipeline_response.http_response

        if response.status_code not in [204]:
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            error = self._deserialize(models.OdataError, response)
            raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

        if cls:
            return cls(pipeline_response, None, {})

    update_call_records.metadata = {'url': '/communications/callRecords/{callRecord-id}'}  # type: ignore

    def delete_call_records(
        self,
        call_record_id,  # type: str
        if_match=None,  # type: Optional[str]
        **kwargs  # type: Any
    ):
        # type: (...) -> None
        """Delete navigation property callRecords for communications.

        Delete navigation property callRecords for communications.

        :param call_record_id: key: id of callRecord.
        :type call_record_id: str
        :param if_match: ETag.
        :type if_match: str
        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: None, or the result of cls(response)
        :rtype: None
        :raises: ~azure.core.exceptions.HttpResponseError
        """
        cls = kwargs.pop('cls', None)  # type: ClsType[None]
        error_map = {
            401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
        }
        error_map.update(kwargs.pop('error_map', {}))
        accept = "application/json"

        # Construct URL
        url = self.delete_call_records.metadata['url']  # type: ignore
        path_format_arguments = {
            'callRecord-id': self._serialize.url("call_record_id", call_record_id, 'str'),
        }
        url = self._client.format_url(url, **path_format_arguments)

        # Construct parameters
        query_parameters = {}  # type: Dict[str, Any]

        # Construct headers
        header_parameters = {}  # type: Dict[str, Any]
        if if_match is not None:
            header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str')
        header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')

        request = self._client.delete(url, query_parameters, header_parameters)
        pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
        response = pipeline_response.http_response

        if response.status_code not in [204]:
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            error = self._deserialize(models.OdataError, response)
            raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

        if cls:
            return cls(pipeline_response, None, {})

    delete_call_records.metadata = {'url': '/communications/callRecords/{callRecord-id}'}  # type: ignore

    def list_calls(
        self,
        orderby=None,  # type: Optional[List[Union[str, "models.Enum42"]]]
        select=None,  # type: Optional[List[Union[str, "models.Enum43"]]]
        expand=None,  # type: Optional[List[Union[str, "models.Enum44"]]]
        **kwargs  # type: Any
    ):
        # type: (...) -> Iterable["models.CollectionOfCall"]
        """Get calls from communications.

        Get calls from communications.

        :param orderby: Order items by property values.
        :type orderby: list[str or ~cloud_communications.models.Enum42]
        :param select: Select properties to be returned.
        :type select: list[str or ~cloud_communications.models.Enum43]
        :param expand: Expand related entities.
        :type expand: list[str or ~cloud_communications.models.Enum44]
        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: An iterator like instance of either CollectionOfCall or the result of cls(response)
        :rtype: ~azure.core.paging.ItemPaged[~cloud_communications.models.CollectionOfCall]
        :raises: ~azure.core.exceptions.HttpResponseError
        """
        cls = kwargs.pop('cls', None)  # type: ClsType["models.CollectionOfCall"]
        error_map = {
            401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
        }
        error_map.update(kwargs.pop('error_map', {}))
        accept = "application/json"

        def prepare_request(next_link=None):
            # Construct headers
            header_parameters = {}  # type: Dict[str, Any]
            header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')

            if not next_link:
                # Construct URL
                url = self.list_calls.metadata['url']  # type: ignore
                # Construct parameters
                query_parameters = {}  # type: Dict[str, Any]
                if self._config.top is not None:
                    query_parameters['$top'] = self._serialize.query("self._config.top", self._config.top, 'int', minimum=0)
                if self._config.skip is not None:
                    query_parameters['$skip'] = self._serialize.query("self._config.skip", self._config.skip, 'int', minimum=0)
                if self._config.search is not None:
                    query_parameters['$search'] = self._serialize.query("self._config.search", self._config.search, 'str')
                if self._config.filter is not None:
                    query_parameters['$filter'] = self._serialize.query("self._config.filter", self._config.filter, 'str')
                if self._config.count is not None:
                    query_parameters['$count'] = self._serialize.query("self._config.count", self._config.count, 'bool')
                if orderby is not None:
                    query_parameters['$orderby'] = self._serialize.query("orderby", orderby, '[str]', div=',')
                if select is not None:
                    query_parameters['$select'] = self._serialize.query("select", select, '[str]', div=',')
                if expand is not None:
                    query_parameters['$expand'] = self._serialize.query("expand", expand, '[str]', div=',')

                request = self._client.get(url, query_parameters, header_parameters)
            else:
                url = next_link
                query_parameters = {}  # type: Dict[str, Any]
                request = self._client.get(url, query_parameters, header_parameters)
            return request

        def extract_data(pipeline_response):
            deserialized = self._deserialize('CollectionOfCall', pipeline_response)
            list_of_elem = deserialized.value
            if cls:
                list_of_elem = cls(list_of_elem)
            return deserialized.odata_next_link or None, iter(list_of_elem)

        def get_next(next_link=None):
            request = prepare_request(next_link)

            pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
            response = pipeline_response.http_response

            if response.status_code not in [200]:
                error = self._deserialize(models.OdataError, response)
                map_error(status_code=response.status_code, response=response, error_map=error_map)
                raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

            return pipeline_response

        return ItemPaged(
            get_next, extract_data
        )
    list_calls.metadata = {'url': '/communications/calls'}  # type: ignore

    def create_calls(
        self,
        body,  # type: "models.MicrosoftGraphCall"
        **kwargs  # type: Any
    ):
        # type: (...) -> "models.MicrosoftGraphCall"
        """Create new navigation property to calls for communications.

        Create new navigation property to calls for communications.

        :param body: New navigation property.
        :type body: ~cloud_communications.models.MicrosoftGraphCall
        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: MicrosoftGraphCall, or the result of cls(response)
        :rtype: ~cloud_communications.models.MicrosoftGraphCall
        :raises: ~azure.core.exceptions.HttpResponseError
        """
        cls = kwargs.pop('cls', None)  # type: ClsType["models.MicrosoftGraphCall"]
        error_map = {
            401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
        }
        error_map.update(kwargs.pop('error_map', {}))
        content_type = kwargs.pop("content_type", "application/json")
        accept = "application/json"

        # Construct URL
        url = self.create_calls.metadata['url']  # type: ignore

        # Construct parameters
        query_parameters = {}  # type: Dict[str, Any]

        # Construct headers
        header_parameters = {}  # type: Dict[str, Any]
        header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
        header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')

        body_content_kwargs = {}  # type: Dict[str, Any]
        body_content = self._serialize.body(body, 'MicrosoftGraphCall')
        body_content_kwargs['content'] = body_content
        request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
        pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
        response = pipeline_response.http_response

        if response.status_code not in [201]:
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            error = self._deserialize(models.OdataError, response)
            raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

        deserialized = self._deserialize('MicrosoftGraphCall', pipeline_response)

        if cls:
            return cls(pipeline_response, deserialized, {})

        return deserialized
    create_calls.metadata = {'url': '/communications/calls'}  # type: ignore

    def get_calls(
        self,
        call_id,  # type: str
        select=None,  # type: Optional[List[Union[str, "models.Enum45"]]]
        expand=None,  # type: Optional[List[Union[str, "models.Enum46"]]]
        **kwargs  # type: Any
    ):
        # type: (...) -> "models.MicrosoftGraphCall"
        """Get calls from communications.

        Get calls from communications.

        :param call_id: key: id of call.
        :type call_id: str
        :param select: Select properties to be returned.
        :type select: list[str or ~cloud_communications.models.Enum45]
        :param expand: Expand related entities.
        :type expand: list[str or ~cloud_communications.models.Enum46]
        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: MicrosoftGraphCall, or the result of cls(response)
        :rtype: ~cloud_communications.models.MicrosoftGraphCall
        :raises: ~azure.core.exceptions.HttpResponseError
        """
        cls = kwargs.pop('cls', None)  # type: ClsType["models.MicrosoftGraphCall"]
        error_map = {
            401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
        }
        error_map.update(kwargs.pop('error_map', {}))
        accept = "application/json"

        # Construct URL
        url = self.get_calls.metadata['url']  # type: ignore
        path_format_arguments = {
            'call-id': self._serialize.url("call_id", call_id, 'str'),
        }
        url = self._client.format_url(url, **path_format_arguments)

        # Construct parameters
        query_parameters = {}  # type: Dict[str, Any]
        if select is not None:
            query_parameters['$select'] = self._serialize.query("select", select, '[str]', div=',')
        if expand is not None:
            query_parameters['$expand'] = self._serialize.query("expand", expand, '[str]', div=',')

        # Construct headers
        header_parameters = {}  # type: Dict[str, Any]
        header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')

        request = self._client.get(url, query_parameters, header_parameters)
        pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
        response = pipeline_response.http_response

        if response.status_code not in [200]:
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            error = self._deserialize(models.OdataError, response)
            raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

        deserialized = self._deserialize('MicrosoftGraphCall', pipeline_response)

        if cls:
            return cls(pipeline_response, deserialized, {})

        return deserialized
    get_calls.metadata = {'url': '/communications/calls/{call-id}'}  # type: ignore

    def update_calls(
        self,
        call_id,  # type: str
        body,  # type: "models.MicrosoftGraphCall"
        **kwargs  # type: Any
    ):
        # type: (...) -> None
        """Update the navigation property calls in communications.

        Update the navigation property calls in communications.

        :param call_id: key: id of call.
        :type call_id: str
        :param body: New navigation property values.
        :type body: ~cloud_communications.models.MicrosoftGraphCall
        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: None, or the result of cls(response)
        :rtype: None
        :raises: ~azure.core.exceptions.HttpResponseError
        """
        cls = kwargs.pop('cls', None)  # type: ClsType[None]
        error_map = {
            401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
        }
        error_map.update(kwargs.pop('error_map', {}))
        content_type = kwargs.pop("content_type", "application/json")
        accept = "application/json"

        # Construct URL
        url = self.update_calls.metadata['url']  # type: ignore
        path_format_arguments = {
            'call-id': self._serialize.url("call_id", call_id, 'str'),
        }
        url = self._client.format_url(url, **path_format_arguments)

        # Construct parameters
        query_parameters = {}  # type: Dict[str, Any]

        # Construct headers
        header_parameters = {}  # type: Dict[str, Any]
        header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
        header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')

        body_content_kwargs = {}  # type: Dict[str, Any]
        body_content = self._serialize.body(body, 'MicrosoftGraphCall')
        body_content_kwargs['content'] = body_content
        request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs)
        pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
        response = pipeline_response.http_response

        if response.status_code not in [204]:
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            error = self._deserialize(models.OdataError, response)
            raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

        if cls:
            return cls(pipeline_response, None, {})

    update_calls.metadata = {'url': '/communications/calls/{call-id}'}  # type: ignore

    def delete_calls(
        self,
        call_id,  # type: str
        if_match=None,  # type: Optional[str]
        **kwargs  # type: Any
    ):
        # type: (...) -> None
        """Delete navigation property calls for communications.

        Delete navigation property calls for communications.

        :param call_id: key: id of call.
        :type call_id: str
        :param if_match: ETag.
        :type if_match: str
        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: None, or the result of cls(response)
        :rtype: None
        :raises: ~azure.core.exceptions.HttpResponseError
        """
        cls = kwargs.pop('cls', None)  # type: ClsType[None]
        error_map = {
            401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
        }
        error_map.update(kwargs.pop('error_map', {}))
        accept = "application/json"

        # Construct URL
        url = self.delete_calls.metadata['url']  # type: ignore
        path_format_arguments = {
            'call-id': self._serialize.url("call_id", call_id, 'str'),
        }
        url = self._client.format_url(url, **path_format_arguments)

        # Construct parameters
        query_parameters = {}  # type: Dict[str, Any]

        # Construct headers
        header_parameters = {}  # type: Dict[str, Any]
        if if_match is not None:
            header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str')
        header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')

        request = self._client.delete(url, query_parameters, header_parameters)
        pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
        response = pipeline_response.http_response

        if response.status_code not in [204]:
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            error = self._deserialize(models.OdataError, response)
            raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

        if cls:
            return cls(pipeline_response, None, {})

    delete_calls.metadata = {'url': '/communications/calls/{call-id}'}  # type: ignore

    def get_presences_by_user_id(
        self,
        body,  # type: "models.Paths10WpgkzCommunicationsMicrosoftGraphGetpresencesbyuseridPostRequestbodyContentApplicationJsonSchema"
        **kwargs  # type: Any
    ):
        # type: (...) -> List["models.MicrosoftGraphPresence"]
        """Invoke action getPresencesByUserId.

        Invoke action getPresencesByUserId.

        :param body: Action parameters.
        :type body: ~cloud_communications.models.Paths10WpgkzCommunicationsMicrosoftGraphGetpresencesbyuseridPostRequestbodyContentApplicationJsonSchema
        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: list of MicrosoftGraphPresence, or the result of cls(response)
        :rtype: list[~cloud_communications.models.MicrosoftGraphPresence]
        :raises: ~azure.core.exceptions.HttpResponseError
        """
        cls = kwargs.pop('cls', None)  # type: ClsType[List["models.MicrosoftGraphPresence"]]
        error_map = {
            401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
        }
        error_map.update(kwargs.pop('error_map', {}))
        content_type = kwargs.pop("content_type", "application/json")
        accept = "application/json"

        # Construct URL
        url = self.get_presences_by_user_id.metadata['url']  # type: ignore

        # Construct parameters
        query_parameters = {}  # type: Dict[str, Any]

        # Construct headers
        header_parameters = {}  # type: Dict[str, Any]
        header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
        header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')

        body_content_kwargs = {}  # type: Dict[str, Any]
        body_content = self._serialize.body(body, 'Paths10WpgkzCommunicationsMicrosoftGraphGetpresencesbyuseridPostRequestbodyContentApplicationJsonSchema')
        body_content_kwargs['content'] = body_content
        request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
        pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
        response = pipeline_response.http_response

        if response.status_code not in [200]:
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            error = self._deserialize(models.OdataError, response)
            raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

        deserialized = self._deserialize('[MicrosoftGraphPresence]', pipeline_response)

        if cls:
            return cls(pipeline_response, deserialized, {})

        return deserialized
    get_presences_by_user_id.metadata = {'url': '/communications/microsoft.graph.getPresencesByUserId'}  # type: ignore

    def list_online_meetings(
        self,
        orderby=None,  # type: Optional[List[Union[str, "models.Enum61"]]]
        select=None,  # type: Optional[List[Union[str, "models.Enum62"]]]
        expand=None,  # type: Optional[List[str]]
        **kwargs  # type: Any
    ):
        # type: (...) -> Iterable["models.CollectionOfOnlineMeeting"]
        """Get onlineMeetings from communications.

        Get onlineMeetings from communications.

        :param orderby: Order items by property values.
        :type orderby: list[str or ~cloud_communications.models.Enum61]
        :param select: Select properties to be returned.
        :type select: list[str or ~cloud_communications.models.Enum62]
        :param expand: Expand related entities.
        :type expand: list[str]
        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: An iterator like instance of either CollectionOfOnlineMeeting or the result of cls(response)
        :rtype: ~azure.core.paging.ItemPaged[~cloud_communications.models.CollectionOfOnlineMeeting]
        :raises: ~azure.core.exceptions.HttpResponseError
        """
        cls = kwargs.pop('cls', None)  # type: ClsType["models.CollectionOfOnlineMeeting"]
        error_map = {
            401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
        }
        error_map.update(kwargs.pop('error_map', {}))
        accept = "application/json"

        def prepare_request(next_link=None):
            # Construct headers
            header_parameters = {}  # type: Dict[str, Any]
            header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')

            if not next_link:
                # Construct URL
                url = self.list_online_meetings.metadata['url']  # type: ignore
                # Construct parameters
                query_parameters = {}  # type: Dict[str, Any]
                if self._config.top is not None:
                    query_parameters['$top'] = self._serialize.query("self._config.top", self._config.top, 'int', minimum=0)
                if self._config.skip is not None:
                    query_parameters['$skip'] = self._serialize.query("self._config.skip", self._config.skip, 'int', minimum=0)
                if self._config.search is not None:
                    query_parameters['$search'] = self._serialize.query("self._config.search", self._config.search, 'str')
                if self._config.filter is not None:
                    query_parameters['$filter'] = self._serialize.query("self._config.filter", self._config.filter, 'str')
                if self._config.count is not None:
                    query_parameters['$count'] = self._serialize.query("self._config.count", self._config.count, 'bool')
                if orderby is not None:
                    query_parameters['$orderby'] = self._serialize.query("orderby", orderby, '[str]', div=',')
                if select is not None:
                    query_parameters['$select'] = self._serialize.query("select", select, '[str]', div=',')
                if expand is not None:
                    query_parameters['$expand'] = self._serialize.query("expand", expand, '[str]', div=',')

                request = self._client.get(url, query_parameters, header_parameters)
            else:
                url = next_link
                query_parameters = {}  # type: Dict[str, Any]
                request = self._client.get(url, query_parameters, header_parameters)
            return request

        def extract_data(pipeline_response):
            deserialized = self._deserialize('CollectionOfOnlineMeeting', pipeline_response)
            list_of_elem = deserialized.value
            if cls:
                list_of_elem = cls(list_of_elem)
            return deserialized.odata_next_link or None, iter(list_of_elem)

        def get_next(next_link=None):
            request = prepare_request(next_link)

            pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
            response = pipeline_response.http_response

            if response.status_code not in [200]:
                error = self._deserialize(models.OdataError, response)
                map_error(status_code=response.status_code, response=response, error_map=error_map)
                raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

            return pipeline_response

        return ItemPaged(
            get_next, extract_data
        )
    list_online_meetings.metadata = {'url': '/communications/onlineMeetings'}  # type: ignore

    def create_online_meetings(
        self,
        body,  # type: "models.MicrosoftGraphOnlineMeeting"
        **kwargs  # type: Any
    ):
        # type: (...) -> "models.MicrosoftGraphOnlineMeeting"
        """Create new navigation property to onlineMeetings for communications.

        Create new navigation property to onlineMeetings for communications.

        :param body: New navigation property.
        :type body: ~cloud_communications.models.MicrosoftGraphOnlineMeeting
        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: MicrosoftGraphOnlineMeeting, or the result of cls(response)
        :rtype: ~cloud_communications.models.MicrosoftGraphOnlineMeeting
        :raises: ~azure.core.exceptions.HttpResponseError
        """
        cls = kwargs.pop('cls', None)  # type: ClsType["models.MicrosoftGraphOnlineMeeting"]
        error_map = {
            401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
        }
        error_map.update(kwargs.pop('error_map', {}))
        content_type = kwargs.pop("content_type", "application/json")
        accept = "application/json"

        # Construct URL
        url = self.create_online_meetings.metadata['url']  # type: ignore

        # Construct parameters
        query_parameters = {}  # type: Dict[str, Any]

        # Construct headers
        header_parameters = {}  # type: Dict[str, Any]
        header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
        header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')

        body_content_kwargs = {}  # type: Dict[str, Any]
        body_content = self._serialize.body(body, 'MicrosoftGraphOnlineMeeting')
        body_content_kwargs['content'] = body_content
        request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
        pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
        response = pipeline_response.http_response

        if response.status_code not in [201]:
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            error = self._deserialize(models.OdataError, response)
            raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

        deserialized = self._deserialize('MicrosoftGraphOnlineMeeting', pipeline_response)

        if cls:
            return cls(pipeline_response, deserialized, {})

        return deserialized
    create_online_meetings.metadata = {'url': '/communications/onlineMeetings'}  # type: ignore

    def get_online_meetings(
        self,
        online_meeting_id,  # type: str
        select=None,  # type: Optional[List[Union[str, "models.Enum63"]]]
        expand=None,  # type: Optional[List[str]]
        **kwargs  # type: Any
    ):
        # type: (...) -> "models.MicrosoftGraphOnlineMeeting"
        """Get onlineMeetings from communications.

        Get onlineMeetings from communications.

        :param online_meeting_id: key: id of onlineMeeting.
        :type online_meeting_id: str
        :param select: Select properties to be returned.
        :type select: list[str or ~cloud_communications.models.Enum63]
        :param expand: Expand related entities.
        :type expand: list[str]
        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: MicrosoftGraphOnlineMeeting, or the result of cls(response)
        :rtype: ~cloud_communications.models.MicrosoftGraphOnlineMeeting
        :raises: ~azure.core.exceptions.HttpResponseError
        """
        cls = kwargs.pop('cls', None)  # type: ClsType["models.MicrosoftGraphOnlineMeeting"]
        error_map = {
            401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
        }
        error_map.update(kwargs.pop('error_map', {}))
        accept = "application/json"

        # Construct URL
        url = self.get_online_meetings.metadata['url']  # type: ignore
        path_format_arguments = {
            'onlineMeeting-id': self._serialize.url("online_meeting_id", online_meeting_id, 'str'),
        }
        url = self._client.format_url(url, **path_format_arguments)

        # Construct parameters
        query_parameters = {}  # type: Dict[str, Any]
        if select is not None:
            query_parameters['$select'] = self._serialize.query("select", select, '[str]', div=',')
        if expand is not None:
            query_parameters['$expand'] = self._serialize.query("expand", expand, '[str]', div=',')

        # Construct headers
        header_parameters = {}  # type: Dict[str, Any]
        header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')

        request = self._client.get(url, query_parameters, header_parameters)
        pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
        response = pipeline_response.http_response

        if response.status_code not in [200]:
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            error = self._deserialize(models.OdataError, response)
            raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

        deserialized = self._deserialize('MicrosoftGraphOnlineMeeting', pipeline_response)

        if cls:
            return cls(pipeline_response, deserialized, {})

        return deserialized
    get_online_meetings.metadata = {'url': '/communications/onlineMeetings/{onlineMeeting-id}'}  # type: ignore

    def update_online_meetings(
        self,
        online_meeting_id,  # type: str
        body,  # type: "models.MicrosoftGraphOnlineMeeting"
        **kwargs  # type: Any
    ):
        # type: (...) -> None
        """Update the navigation property onlineMeetings in communications.

        Update the navigation property onlineMeetings in communications.

        :param online_meeting_id: key: id of onlineMeeting.
        :type online_meeting_id: str
        :param body: New navigation property values.
        :type body: ~cloud_communications.models.MicrosoftGraphOnlineMeeting
        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: None, or the result of cls(response)
        :rtype: None
        :raises: ~azure.core.exceptions.HttpResponseError
        """
        cls = kwargs.pop('cls', None)  # type: ClsType[None]
        error_map = {
            401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
        }
        error_map.update(kwargs.pop('error_map', {}))
        content_type = kwargs.pop("content_type", "application/json")
        accept = "application/json"

        # Construct URL
        url = self.update_online_meetings.metadata['url']  # type: ignore
        path_format_arguments = {
            'onlineMeeting-id': self._serialize.url("online_meeting_id", online_meeting_id, 'str'),
        }
        url = self._client.format_url(url, **path_format_arguments)

        # Construct parameters
        query_parameters = {}  # type: Dict[str, Any]

        # Construct headers
        header_parameters = {}  # type: Dict[str, Any]
        header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
        header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')

        body_content_kwargs = {}  # type: Dict[str, Any]
        body_content = self._serialize.body(body, 'MicrosoftGraphOnlineMeeting')
        body_content_kwargs['content'] = body_content
        request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs)
        pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
        response = pipeline_response.http_response

        if response.status_code not in [204]:
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            error = self._deserialize(models.OdataError, response)
            raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

        if cls:
            return cls(pipeline_response, None, {})

    update_online_meetings.metadata = {'url': '/communications/onlineMeetings/{onlineMeeting-id}'}  # type: ignore

    def delete_online_meetings(
        self,
        online_meeting_id,  # type: str
        if_match=None,  # type: Optional[str]
        **kwargs  # type: Any
    ):
        # type: (...) -> None
        """Delete navigation property onlineMeetings for communications.

        Delete navigation property onlineMeetings for communications.

        :param online_meeting_id: key: id of onlineMeeting.
        :type online_meeting_id: str
        :param if_match: ETag.
        :type if_match: str
        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: None, or the result of cls(response)
        :rtype: None
        :raises: ~azure.core.exceptions.HttpResponseError
        """
        cls = kwargs.pop('cls', None)  # type: ClsType[None]
        error_map = {
            401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
        }
        error_map.update(kwargs.pop('error_map', {}))
        accept = "application/json"

        # Construct URL
        url = self.delete_online_meetings.metadata['url']  # type: ignore
        path_format_arguments = {
            'onlineMeeting-id': self._serialize.url("online_meeting_id", online_meeting_id, 'str'),
        }
        url = self._client.format_url(url, **path_format_arguments)

        # Construct parameters
        query_parameters = {}  # type: Dict[str, Any]

        # Construct headers
        header_parameters = {}  # type: Dict[str, Any]
        if if_match is not None:
            header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str')
        header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')

        request = self._client.delete(url, query_parameters, header_parameters)
        pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
        response = pipeline_response.http_response

        if response.status_code not in [204]:
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            error = self._deserialize(models.OdataError, response)
            raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

        if cls:
            return cls(pipeline_response, None, {})

    delete_online_meetings.metadata = {'url': '/communications/onlineMeetings/{onlineMeeting-id}'}  # type: ignore

    def list_presences(
        self,
        orderby=None,  # type: Optional[List[Union[str, "models.Enum64"]]]
        select=None,  # type: Optional[List[Union[str, "models.Enum65"]]]
        expand=None,  # type: Optional[List[str]]
        **kwargs  # type: Any
    ):
        # type: (...) -> Iterable["models.CollectionOfPresence"]
        """Get presences from communications.

        Get presences from communications.

        :param orderby: Order items by property values.
        :type orderby: list[str or ~cloud_communications.models.Enum64]
        :param select: Select properties to be returned.
        :type select: list[str or ~cloud_communications.models.Enum65]
        :param expand: Expand related entities.
        :type expand: list[str]
        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: An iterator like instance of either CollectionOfPresence or the result of cls(response)
        :rtype: ~azure.core.paging.ItemPaged[~cloud_communications.models.CollectionOfPresence]
        :raises: ~azure.core.exceptions.HttpResponseError
        """
        cls = kwargs.pop('cls', None)  # type: ClsType["models.CollectionOfPresence"]
        error_map = {
            401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
        }
        error_map.update(kwargs.pop('error_map', {}))
        accept = "application/json"

        def prepare_request(next_link=None):
            # Construct headers
            header_parameters = {}  # type: Dict[str, Any]
            header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')

            if not next_link:
                # Construct URL
                url = self.list_presences.metadata['url']  # type: ignore
                # Construct parameters
                query_parameters = {}  # type: Dict[str, Any]
                if self._config.top is not None:
                    query_parameters['$top'] = self._serialize.query("self._config.top", self._config.top, 'int', minimum=0)
                if self._config.skip is not None:
                    query_parameters['$skip'] = self._serialize.query("self._config.skip", self._config.skip, 'int', minimum=0)
                if self._config.search is not None:
                    query_parameters['$search'] = self._serialize.query("self._config.search", self._config.search, 'str')
                if self._config.filter is not None:
                    query_parameters['$filter'] = self._serialize.query("self._config.filter", self._config.filter, 'str')
                if self._config.count is not None:
                    query_parameters['$count'] = self._serialize.query("self._config.count", self._config.count, 'bool')
                if orderby is not None:
                    query_parameters['$orderby'] = self._serialize.query("orderby", orderby, '[str]', div=',')
                if select is not None:
                    query_parameters['$select'] = self._serialize.query("select", select, '[str]', div=',')
                if expand is not None:
                    query_parameters['$expand'] = self._serialize.query("expand", expand, '[str]', div=',')

                request = self._client.get(url, query_parameters, header_parameters)
            else:
                url = next_link
                query_parameters = {}  # type: Dict[str, Any]
                request = self._client.get(url, query_parameters, header_parameters)
            return request

        def extract_data(pipeline_response):
            deserialized = self._deserialize('CollectionOfPresence', pipeline_response)
            list_of_elem = deserialized.value
            if cls:
                list_of_elem = cls(list_of_elem)
            return deserialized.odata_next_link or None, iter(list_of_elem)

        def get_next(next_link=None):
            request = prepare_request(next_link)

            pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
            response = pipeline_response.http_response

            if response.status_code not in [200]:
                error = self._deserialize(models.OdataError, response)
                map_error(status_code=response.status_code, response=response, error_map=error_map)
                raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

            return pipeline_response

        return ItemPaged(
            get_next, extract_data
        )
    list_presences.metadata = {'url': '/communications/presences'}  # type: ignore

    def create_presences(
        self,
        body,  # type: "models.MicrosoftGraphPresence"
        **kwargs  # type: Any
    ):
        # type: (...) -> "models.MicrosoftGraphPresence"
        """Create new navigation property to presences for communications.

        Create new navigation property to presences for communications.

        :param body: New navigation property.
        :type body: ~cloud_communications.models.MicrosoftGraphPresence
        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: MicrosoftGraphPresence, or the result of cls(response)
        :rtype: ~cloud_communications.models.MicrosoftGraphPresence
        :raises: ~azure.core.exceptions.HttpResponseError
        """
        cls = kwargs.pop('cls', None)  # type: ClsType["models.MicrosoftGraphPresence"]
        error_map = {
            401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
        }
        error_map.update(kwargs.pop('error_map', {}))
        content_type = kwargs.pop("content_type", "application/json")
        accept = "application/json"

        # Construct URL
        url = self.create_presences.metadata['url']  # type: ignore

        # Construct parameters
        query_parameters = {}  # type: Dict[str, Any]

        # Construct headers
        header_parameters = {}  # type: Dict[str, Any]
        header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
        header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')

        body_content_kwargs = {}  # type: Dict[str, Any]
        body_content = self._serialize.body(body, 'MicrosoftGraphPresence')
        body_content_kwargs['content'] = body_content
        request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
        pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
        response = pipeline_response.http_response

        if response.status_code not in [201]:
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            error = self._deserialize(models.OdataError, response)
            raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

        deserialized = self._deserialize('MicrosoftGraphPresence', pipeline_response)

        if cls:
            return cls(pipeline_response, deserialized, {})

        return deserialized
    create_presences.metadata = {'url': '/communications/presences'}  # type: ignore

    def get_presences(
        self,
        presence_id,  # type: str
        select=None,  # type: Optional[List[Union[str, "models.Enum66"]]]
        expand=None,  # type: Optional[List[str]]
        **kwargs  # type: Any
    ):
        # type: (...) -> "models.MicrosoftGraphPresence"
        """Get presences from communications.

        Get presences from communications.

        :param presence_id: key: id of presence.
        :type presence_id: str
        :param select: Select properties to be returned.
        :type select: list[str or ~cloud_communications.models.Enum66]
        :param expand: Expand related entities.
        :type expand: list[str]
        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: MicrosoftGraphPresence, or the result of cls(response)
        :rtype: ~cloud_communications.models.MicrosoftGraphPresence
        :raises: ~azure.core.exceptions.HttpResponseError
        """
        cls = kwargs.pop('cls', None)  # type: ClsType["models.MicrosoftGraphPresence"]
        error_map = {
            401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
        }
        error_map.update(kwargs.pop('error_map', {}))
        accept = "application/json"

        # Construct URL
        url = self.get_presences.metadata['url']  # type: ignore
        path_format_arguments = {
            'presence-id': self._serialize.url("presence_id", presence_id, 'str'),
        }
        url = self._client.format_url(url, **path_format_arguments)

        # Construct parameters
        query_parameters = {}  # type: Dict[str, Any]
        if select is not None:
            query_parameters['$select'] = self._serialize.query("select", select, '[str]', div=',')
        if expand is not None:
            query_parameters['$expand'] = self._serialize.query("expand", expand, '[str]', div=',')

        # Construct headers
        header_parameters = {}  # type: Dict[str, Any]
        header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')

        request = self._client.get(url, query_parameters, header_parameters)
        pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
        response = pipeline_response.http_response

        if response.status_code not in [200]:
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            error = self._deserialize(models.OdataError, response)
            raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

        deserialized = self._deserialize('MicrosoftGraphPresence', pipeline_response)

        if cls:
            return cls(pipeline_response, deserialized, {})

        return deserialized
    get_presences.metadata = {'url': '/communications/presences/{presence-id}'}  # type: ignore

    def update_presences(
        self,
        presence_id,  # type: str
        body,  # type: "models.MicrosoftGraphPresence"
        **kwargs  # type: Any
    ):
        # type: (...) -> None
        """Update the navigation property presences in communications.

        Update the navigation property presences in communications.

        :param presence_id: key: id of presence.
        :type presence_id: str
        :param body: New navigation property values.
        :type body: ~cloud_communications.models.MicrosoftGraphPresence
        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: None, or the result of cls(response)
        :rtype: None
        :raises: ~azure.core.exceptions.HttpResponseError
        """
        cls = kwargs.pop('cls', None)  # type: ClsType[None]
        error_map = {
            401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
        }
        error_map.update(kwargs.pop('error_map', {}))
        content_type = kwargs.pop("content_type", "application/json")
        accept = "application/json"

        # Construct URL
        url = self.update_presences.metadata['url']  # type: ignore
        path_format_arguments = {
            'presence-id': self._serialize.url("presence_id", presence_id, 'str'),
        }
        url = self._client.format_url(url, **path_format_arguments)

        # Construct parameters
        query_parameters = {}  # type: Dict[str, Any]

        # Construct headers
        header_parameters = {}  # type: Dict[str, Any]
        header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
        header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')

        body_content_kwargs = {}  # type: Dict[str, Any]
        body_content = self._serialize.body(body, 'MicrosoftGraphPresence')
        body_content_kwargs['content'] = body_content
        request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs)
        pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
        response = pipeline_response.http_response

        if response.status_code not in [204]:
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            error = self._deserialize(models.OdataError, response)
            raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

        if cls:
            return cls(pipeline_response, None, {})

    update_presences.metadata = {'url': '/communications/presences/{presence-id}'}  # type: ignore

    def delete_presences(
        self,
        presence_id,  # type: str
        if_match=None,  # type: Optional[str]
        **kwargs  # type: Any
    ):
        # type: (...) -> None
        """Delete navigation property presences for communications.

        Delete navigation property presences for communications.

        :param presence_id: key: id of presence.
        :type presence_id: str
        :param if_match: ETag.
        :type if_match: str
        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: None, or the result of cls(response)
        :rtype: None
        :raises: ~azure.core.exceptions.HttpResponseError
        """
        cls = kwargs.pop('cls', None)  # type: ClsType[None]
        error_map = {
            401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
        }
        error_map.update(kwargs.pop('error_map', {}))
        accept = "application/json"

        # Construct URL
        url = self.delete_presences.metadata['url']  # type: ignore
        path_format_arguments = {
            'presence-id': self._serialize.url("presence_id", presence_id, 'str'),
        }
        url = self._client.format_url(url, **path_format_arguments)

        # Construct parameters
        query_parameters = {}  # type: Dict[str, Any]

        # Construct headers
        header_parameters = {}  # type: Dict[str, Any]
        if if_match is not None:
            header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str')
        header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')

        request = self._client.delete(url, query_parameters, header_parameters)
        pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
        response = pipeline_response.http_response

        if response.status_code not in [204]:
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            error = self._deserialize(models.OdataError, response)
            raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

        if cls:
            return cls(pipeline_response, None, {})

    delete_presences.metadata = {'url': '/communications/presences/{presence-id}'}  # type: ignore

# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- # pylint: disable=unused-import,ungrouped-imports CommunicationsOperations operations.      You should not instantiate this class directly. Instead, you should create a Client instance that     instantiates it for you and attaches it as an attribute.      :ivar models: Alias to model classes used in this operation group.     :type models: ~cloud_communications.models     :param client: Client for service requests.     :param config: Configuration of service client.     :param serializer: An object model serializer.     :param deserializer: An object model deserializer. # type: Optional[List[Union[str, "models.Get5ItemsItem"]]] # type: Optional[List[Union[str, "models.Get6ItemsItem"]]] # type: Optional[List[Union[str, "models.Get7ItemsItem"]]] # type: Any # type: (...) -> Iterable["models.CollectionOfCallRecord"] Get callRecords from communications.          Get callRecords from communications.          :param orderby: Order items by property values.         :type orderby: list[str or ~cloud_communications.models.Get5ItemsItem]         :param select: Select properties to be returned.         :type select: list[str or ~cloud_communications.models.Get6ItemsItem]         :param expand: Expand related entities.         :type expand: list[str or ~cloud_communications.models.Get7ItemsItem]         :keyword callable cls: A custom type or function that will be passed the direct response         :return: An iterator like instance of either CollectionOfCallRecord or the result of cls(response)         :rtype: ~azure.core.paging.ItemPaged[~cloud_communications.models.CollectionOfCallRecord]         :raises: ~azure.core.exceptions.HttpResponseError # type: ClsType["models.CollectionOfCallRecord"] # Construct headers # type: Dict[str, Any] # Construct URL # type: ignore # Construct parameters # type: Dict[str, Any] # type: Dict[str, Any] # type: ignore # type: "models.MicrosoftGraphCallRecordsCallRecord" # type: Any # type: (...) -> "models.MicrosoftGraphCallRecordsCallRecord" Create new navigation property to callRecords for communications.          Create new navigation property to callRecords for communications.          :param body: New navigation property.         :type body: ~cloud_communications.models.MicrosoftGraphCallRecordsCallRecord         :keyword callable cls: A custom type or function that will be passed the direct response         :return: MicrosoftGraphCallRecordsCallRecord, or the result of cls(response)         :rtype: ~cloud_communications.models.MicrosoftGraphCallRecordsCallRecord         :raises: ~azure.core.exceptions.HttpResponseError # type: ClsType["models.MicrosoftGraphCallRecordsCallRecord"] # Construct URL # type: ignore # Construct parameters # type: Dict[str, Any] # Construct headers # type: Dict[str, Any] # type: Dict[str, Any] # type: ignore # type: str # type: Optional[List[Union[str, "models.Enum32"]]] # type: Optional[List[Union[str, "models.Get2ItemsItem"]]] # type: Any # type: (...) -> "models.MicrosoftGraphCallRecordsCallRecord" Get callRecords from communications.          Get callRecords from communications.          :param call_record_id: key: id of callRecord.         :type call_record_id: str         :param select: Select properties to be returned.         :type select: list[str or ~cloud_communications.models.Enum32]         :param expand: Expand related entities.         :type expand: list[str or ~cloud_communications.models.Get2ItemsItem]         :keyword callable cls: A custom type or function that will be passed the direct response         :return: MicrosoftGraphCallRecordsCallRecord, or the result of cls(response)         :rtype: ~cloud_communications.models.MicrosoftGraphCallRecordsCallRecord         :raises: ~azure.core.exceptions.HttpResponseError # type: ClsType["models.MicrosoftGraphCallRecordsCallRecord"] # Construct URL # type: ignore # Construct parameters # type: Dict[str, Any] # Construct headers # type: Dict[str, Any] # type: ignore # type: str # type: "models.MicrosoftGraphCallRecordsCallRecord" # type: Any # type: (...) -> None Update the navigation property callRecords in communications.          Update the navigation property callRecords in communications.          :param call_record_id: key: id of callRecord.         :type call_record_id: str         :param body: New navigation property values.         :type body: ~cloud_communications.models.MicrosoftGraphCallRecordsCallRecord         :keyword callable cls: A custom type or function that will be passed the direct response         :return: None, or the result of cls(response)         :rtype: None         :raises: ~azure.core.exceptions.HttpResponseError # type: ClsType[None] # Construct URL # type: ignore # Construct parameters # type: Dict[str, Any] # Construct headers # type: Dict[str, Any] # type: Dict[str, Any] # type: ignore # type: str # type: Optional[str] # type: Any # type: (...) -> None Delete navigation property callRecords for communications.          Delete navigation property callRecords for communications.          :param call_record_id: key: id of callRecord.         :type call_record_id: str         :param if_match: ETag.         :type if_match: str         :keyword callable cls: A custom type or function that will be passed the direct response         :return: None, or the result of cls(response)         :rtype: None         :raises: ~azure.core.exceptions.HttpResponseError # type: ClsType[None] # Construct URL # type: ignore # Construct parameters # type: Dict[str, Any] # Construct headers # type: Dict[str, Any] # type: ignore # type: Optional[List[Union[str, "models.Enum42"]]] # type: Optional[List[Union[str, "models.Enum43"]]] # type: Optional[List[Union[str, "models.Enum44"]]] # type: Any # type: (...) -> Iterable["models.CollectionOfCall"] Get calls from communications.          Get calls from communications.          :param orderby: Order items by property values.         :type orderby: list[str or ~cloud_communications.models.Enum42]         :param select: Select properties to be returned.         :type select: list[str or ~cloud_communications.models.Enum43]         :param expand: Expand related entities.         :type expand: list[str or ~cloud_communications.models.Enum44]         :keyword callable cls: A custom type or function that will be passed the direct response         :return: An iterator like instance of either CollectionOfCall or the result of cls(response)         :rtype: ~azure.core.paging.ItemPaged[~cloud_communications.models.CollectionOfCall]         :raises: ~azure.core.exceptions.HttpResponseError # type: ClsType["models.CollectionOfCall"] # Construct headers # type: Dict[str, Any] # Construct URL # type: ignore # Construct parameters # type: Dict[str, Any] # type: Dict[str, Any] # type: ignore # type: "models.MicrosoftGraphCall" # type: Any # type: (...) -> "models.MicrosoftGraphCall" Create new navigation property to calls for communications.          Create new navigation property to calls for communications.          :param body: New navigation property.         :type body: ~cloud_communications.models.MicrosoftGraphCall         :keyword callable cls: A custom type or function that will be passed the direct response         :return: MicrosoftGraphCall, or the result of cls(response)         :rtype: ~cloud_communications.models.MicrosoftGraphCall         :raises: ~azure.core.exceptions.HttpResponseError # type: ClsType["models.MicrosoftGraphCall"] # Construct URL # type: ignore # Construct parameters # type: Dict[str, Any] # Construct headers # type: Dict[str, Any] # type: Dict[str, Any] # type: ignore # type: str # type: Optional[List[Union[str, "models.Enum45"]]] # type: Optional[List[Union[str, "models.Enum46"]]] # type: Any # type: (...) -> "models.MicrosoftGraphCall" Get calls from communications.          Get calls from communications.          :param call_id: key: id of call.         :type call_id: str         :param select: Select properties to be returned.         :type select: list[str or ~cloud_communications.models.Enum45]         :param expand: Expand related entities.         :type expand: list[str or ~cloud_communications.models.Enum46]         :keyword callable cls: A custom type or function that will be passed the direct response         :return: MicrosoftGraphCall, or the result of cls(response)         :rtype: ~cloud_communications.models.MicrosoftGraphCall         :raises: ~azure.core.exceptions.HttpResponseError # type: ClsType["models.MicrosoftGraphCall"] # Construct URL # type: ignore # Construct parameters # type: Dict[str, Any] # Construct headers # type: Dict[str, Any] # type: ignore # type: str # type: "models.MicrosoftGraphCall" # type: Any # type: (...) -> None Update the navigation property calls in communications.          Update the navigation property calls in communications.          :param call_id: key: id of call.         :type call_id: str         :param body: New navigation property values.         :type body: ~cloud_communications.models.MicrosoftGraphCall         :keyword callable cls: A custom type or function that will be passed the direct response         :return: None, or the result of cls(response)         :rtype: None         :raises: ~azure.core.exceptions.HttpResponseError # type: ClsType[None] # Construct URL # type: ignore # Construct parameters # type: Dict[str, Any] # Construct headers # type: Dict[str, Any] # type: Dict[str, Any] # type: ignore # type: str # type: Optional[str] # type: Any # type: (...) -> None Delete navigation property calls for communications.          Delete navigation property calls for communications.          :param call_id: key: id of call.         :type call_id: str         :param if_match: ETag.         :type if_match: str         :keyword callable cls: A custom type or function that will be passed the direct response         :return: None, or the result of cls(response)         :rtype: None         :raises: ~azure.core.exceptions.HttpResponseError # type: ClsType[None] # Construct URL # type: ignore # Construct parameters # type: Dict[str, Any] # Construct headers # type: Dict[str, Any] # type: ignore # type: "models.Paths10WpgkzCommunicationsMicrosoftGraphGetpresencesbyuseridPostRequestbodyContentApplicationJsonSchema" # type: Any # type: (...) -> List["models.MicrosoftGraphPresence"] Invoke action getPresencesByUserId.          Invoke action getPresencesByUserId.          :param body: Action parameters.         :type body: ~cloud_communications.models.Paths10WpgkzCommunicationsMicrosoftGraphGetpresencesbyuseridPostRequestbodyContentApplicationJsonSchema         :keyword callable cls: A custom type or function that will be passed the direct response         :return: list of MicrosoftGraphPresence, or the result of cls(response)         :rtype: list[~cloud_communications.models.MicrosoftGraphPresence]         :raises: ~azure.core.exceptions.HttpResponseError # type: ClsType[List["models.MicrosoftGraphPresence"]] # Construct URL # type: ignore # Construct parameters # type: Dict[str, Any] # Construct headers # type: Dict[str, Any] # type: Dict[str, Any] # type: ignore # type: Optional[List[Union[str, "models.Enum61"]]] # type: Optional[List[Union[str, "models.Enum62"]]] # type: Optional[List[str]] # type: Any # type: (...) -> Iterable["models.CollectionOfOnlineMeeting"] Get onlineMeetings from communications.          Get onlineMeetings from communications.          :param orderby: Order items by property values.         :type orderby: list[str or ~cloud_communications.models.Enum61]         :param select: Select properties to be returned.         :type select: list[str or ~cloud_communications.models.Enum62]         :param expand: Expand related entities.         :type expand: list[str]         :keyword callable cls: A custom type or function that will be passed the direct response         :return: An iterator like instance of either CollectionOfOnlineMeeting or the result of cls(response)         :rtype: ~azure.core.paging.ItemPaged[~cloud_communications.models.CollectionOfOnlineMeeting]         :raises: ~azure.core.exceptions.HttpResponseError # type: ClsType["models.CollectionOfOnlineMeeting"] # Construct headers # type: Dict[str, Any] # Construct URL # type: ignore # Construct parameters # type: Dict[str, Any] # type: Dict[str, Any] # type: ignore # type: "models.MicrosoftGraphOnlineMeeting" # type: Any # type: (...) -> "models.MicrosoftGraphOnlineMeeting" Create new navigation property to onlineMeetings for communications.          Create new navigation property to onlineMeetings for communications.          :param body: New navigation property.         :type body: ~cloud_communications.models.MicrosoftGraphOnlineMeeting         :keyword callable cls: A custom type or function that will be passed the direct response         :return: MicrosoftGraphOnlineMeeting, or the result of cls(response)         :rtype: ~cloud_communications.models.MicrosoftGraphOnlineMeeting         :raises: ~azure.core.exceptions.HttpResponseError # type: ClsType["models.MicrosoftGraphOnlineMeeting"] # Construct URL # type: ignore # Construct parameters # type: Dict[str, Any] # Construct headers # type: Dict[str, Any] # type: Dict[str, Any] # type: ignore # type: str # type: Optional[List[Union[str, "models.Enum63"]]] # type: Optional[List[str]] # type: Any # type: (...) -> "models.MicrosoftGraphOnlineMeeting" Get onlineMeetings from communications.          Get onlineMeetings from communications.          :param online_meeting_id: key: id of onlineMeeting.         :type online_meeting_id: str         :param select: Select properties to be returned.         :type select: list[str or ~cloud_communications.models.Enum63]         :param expand: Expand related entities.         :type expand: list[str]         :keyword callable cls: A custom type or function that will be passed the direct response         :return: MicrosoftGraphOnlineMeeting, or the result of cls(response)         :rtype: ~cloud_communications.models.MicrosoftGraphOnlineMeeting         :raises: ~azure.core.exceptions.HttpResponseError # type: ClsType["models.MicrosoftGraphOnlineMeeting"] # Construct URL # type: ignore # Construct parameters # type: Dict[str, Any] # Construct headers # type: Dict[str, Any] # type: ignore # type: str # type: "models.MicrosoftGraphOnlineMeeting" # type: Any # type: (...) -> None Update the navigation property onlineMeetings in communications.          Update the navigation property onlineMeetings in communications.          :param online_meeting_id: key: id of onlineMeeting.         :type online_meeting_id: str         :param body: New navigation property values.         :type body: ~cloud_communications.models.MicrosoftGraphOnlineMeeting         :keyword callable cls: A custom type or function that will be passed the direct response         :return: None, or the result of cls(response)         :rtype: None         :raises: ~azure.core.exceptions.HttpResponseError # type: ClsType[None] # Construct URL # type: ignore # Construct parameters # type: Dict[str, Any] # Construct headers # type: Dict[str, Any] # type: Dict[str, Any] # type: ignore # type: str # type: Optional[str] # type: Any # type: (...) -> None Delete navigation property onlineMeetings for communications.          Delete navigation property onlineMeetings for communications.          :param online_meeting_id: key: id of onlineMeeting.         :type online_meeting_id: str         :param if_match: ETag.         :type if_match: str         :keyword callable cls: A custom type or function that will be passed the direct response         :return: None, or the result of cls(response)         :rtype: None         :raises: ~azure.core.exceptions.HttpResponseError # type: ClsType[None] # Construct URL # type: ignore # Construct parameters # type: Dict[str, Any] # Construct headers # type: Dict[str, Any] # type: ignore # type: Optional[List[Union[str, "models.Enum64"]]] # type: Optional[List[Union[str, "models.Enum65"]]] # type: Optional[List[str]] # type: Any # type: (...) -> Iterable["models.CollectionOfPresence"] Get presences from communications.          Get presences from communications.          :param orderby: Order items by property values.         :type orderby: list[str or ~cloud_communications.models.Enum64]         :param select: Select properties to be returned.         :type select: list[str or ~cloud_communications.models.Enum65]         :param expand: Expand related entities.         :type expand: list[str]         :keyword callable cls: A custom type or function that will be passed the direct response         :return: An iterator like instance of either CollectionOfPresence or the result of cls(response)         :rtype: ~azure.core.paging.ItemPaged[~cloud_communications.models.CollectionOfPresence]         :raises: ~azure.core.exceptions.HttpResponseError # type: ClsType["models.CollectionOfPresence"] # Construct headers # type: Dict[str, Any] # Construct URL # type: ignore # Construct parameters # type: Dict[str, Any] # type: Dict[str, Any] # type: ignore # type: "models.MicrosoftGraphPresence" # type: Any # type: (...) -> "models.MicrosoftGraphPresence" Create new navigation property to presences for communications.          Create new navigation property to presences for communications.          :param body: New navigation property.         :type body: ~cloud_communications.models.MicrosoftGraphPresence         :keyword callable cls: A custom type or function that will be passed the direct response         :return: MicrosoftGraphPresence, or the result of cls(response)         :rtype: ~cloud_communications.models.MicrosoftGraphPresence         :raises: ~azure.core.exceptions.HttpResponseError # type: ClsType["models.MicrosoftGraphPresence"] # Construct URL # type: ignore # Construct parameters # type: Dict[str, Any] # Construct headers # type: Dict[str, Any] # type: Dict[str, Any] # type: ignore # type: str # type: Optional[List[Union[str, "models.Enum66"]]] # type: Optional[List[str]] # type: Any # type: (...) -> "models.MicrosoftGraphPresence" Get presences from communications.          Get presences from communications.          :param presence_id: key: id of presence.         :type presence_id: str         :param select: Select properties to be returned.         :type select: list[str or ~cloud_communications.models.Enum66]         :param expand: Expand related entities.         :type expand: list[str]         :keyword callable cls: A custom type or function that will be passed the direct response         :return: MicrosoftGraphPresence, or the result of cls(response)         :rtype: ~cloud_communications.models.MicrosoftGraphPresence         :raises: ~azure.core.exceptions.HttpResponseError # type: ClsType["models.MicrosoftGraphPresence"] # Construct URL # type: ignore # Construct parameters # type: Dict[str, Any] # Construct headers # type: Dict[str, Any] # type: ignore # type: str # type: "models.MicrosoftGraphPresence" # type: Any # type: (...) -> None Update the navigation property presences in communications.          Update the navigation property presences in communications.          :param presence_id: key: id of presence.         :type presence_id: str         :param body: New navigation property values.         :type body: ~cloud_communications.models.MicrosoftGraphPresence         :keyword callable cls: A custom type or function that will be passed the direct response         :return: None, or the result of cls(response)         :rtype: None         :raises: ~azure.core.exceptions.HttpResponseError # type: ClsType[None] # Construct URL # type: ignore # Construct parameters # type: Dict[str, Any] # Construct headers # type: Dict[str, Any] # type: Dict[str, Any] # type: ignore # type: str # type: Optional[str] # type: Any # type: (...) -> None Delete navigation property presences for communications.          Delete navigation property presences for communications.          :param presence_id: key: id of presence.         :type presence_id: str         :param if_match: ETag.         :type if_match: str         :keyword callable cls: A custom type or function that will be passed the direct response         :return: None, or the result of cls(response)         :rtype: None         :raises: ~azure.core.exceptions.HttpResponseError # type: ClsType[None] # Construct URL # type: ignore # Construct parameters # type: Dict[str, Any] # Construct headers # type: Dict[str, Any] # type: ignore