text: # 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 UsersOperations(object):
      """UsersOperations 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: ~users.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_created_objects(
          self,
          user_id,  # type: str
          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.CollectionOfDirectoryObject"]
          """Get createdObjects from users.
  
          Get createdObjects from users.
  
          :param user_id: key: id of user.
          :type user_id: str
          :param orderby: Order items by property values.
          :type orderby: list[str or ~users.models.Enum64]
          :param select: Select properties to be returned.
          :type select: list[str or ~users.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 CollectionOfDirectoryObject or the result of cls(response)
          :rtype: ~azure.core.paging.ItemPaged[~users.models.CollectionOfDirectoryObject]
          :raises: ~azure.core.exceptions.HttpResponseError
          """
          cls = kwargs.pop('cls', None)  # type: ClsType["models.CollectionOfDirectoryObject"]
          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_created_objects.metadata['url']  # type: ignore
                  path_format_arguments = {
                      'user-id': self._serialize.url("user_id", user_id, 'str'),
                  }
                  url = self._client.format_url(url, **path_format_arguments)
                  # 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('CollectionOfDirectoryObject', 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_created_objects.metadata = {'url': '/users/{user-id}/createdObjects'}  # type: ignore
  
      def list_ref_created_objects(
          self,
          user_id,  # type: str
          orderby=None,  # type: Optional[List[Union[str, "models.Enum66"]]]
          **kwargs  # type: Any
      ):
          # type: (...) -> Iterable["models.CollectionOfLinksOfDirectoryObject"]
          """Get ref of createdObjects from users.
  
          Get ref of createdObjects from users.
  
          :param user_id: key: id of user.
          :type user_id: str
          :param orderby: Order items by property values.
          :type orderby: list[str or ~users.models.Enum66]
          :keyword callable cls: A custom type or function that will be passed the direct response
          :return: An iterator like instance of either CollectionOfLinksOfDirectoryObject or the result of cls(response)
          :rtype: ~azure.core.paging.ItemPaged[~users.models.CollectionOfLinksOfDirectoryObject]
          :raises: ~azure.core.exceptions.HttpResponseError
          """
          cls = kwargs.pop('cls', None)  # type: ClsType["models.CollectionOfLinksOfDirectoryObject"]
          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_ref_created_objects.metadata['url']  # type: ignore
                  path_format_arguments = {
                      'user-id': self._serialize.url("user_id", user_id, 'str'),
                  }
                  url = self._client.format_url(url, **path_format_arguments)
                  # 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=',')
  
                  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('CollectionOfLinksOfDirectoryObject', 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_ref_created_objects.metadata = {'url': '/users/{user-id}/createdObjects/$ref'}  # type: ignore
  
      def create_ref_created_objects(
          self,
          user_id,  # type: str
          body,  # type: Dict[str, object]
          **kwargs  # type: Any
      ):
          # type: (...) -> Dict[str, object]
          """Create new navigation property ref to createdObjects for users.
  
          Create new navigation property ref to createdObjects for users.
  
          :param user_id: key: id of user.
          :type user_id: str
          :param body: New navigation property ref value.
          :type body: dict[str, object]
          :keyword callable cls: A custom type or function that will be passed the direct response
          :return: dict mapping str to object, or the result of cls(response)
          :rtype: dict[str, object]
          :raises: ~azure.core.exceptions.HttpResponseError
          """
          cls = kwargs.pop('cls', None)  # type: ClsType[Dict[str, object]]
          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_ref_created_objects.metadata['url']  # type: ignore
          path_format_arguments = {
              'user-id': self._serialize.url("user_id", user_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, '{object}')
          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('{object}', pipeline_response)
  
          if cls:
              return cls(pipeline_response, deserialized, {})
  
          return deserialized
      create_ref_created_objects.metadata = {'url': '/users/{user-id}/createdObjects/$ref'}  # type: ignore
  
      def list_direct_reports(
          self,
          user_id,  # type: str
          orderby=None,  # type: Optional[List[Union[str, "models.Enum67"]]]
          select=None,  # type: Optional[List[Union[str, "models.Enum68"]]]
          expand=None,  # type: Optional[List[str]]
          **kwargs  # type: Any
      ):
          # type: (...) -> Iterable["models.CollectionOfDirectoryObject0"]
          """Get directReports from users.
  
          Get directReports from users.
  
          :param user_id: key: id of user.
          :type user_id: str
          :param orderby: Order items by property values.
          :type orderby: list[str or ~users.models.Enum67]
          :param select: Select properties to be returned.
          :type select: list[str or ~users.models.Enum68]
          :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 CollectionOfDirectoryObject0 or the result of cls(response)
          :rtype: ~azure.core.paging.ItemPaged[~users.models.CollectionOfDirectoryObject0]
          :raises: ~azure.core.exceptions.HttpResponseError
          """
          cls = kwargs.pop('cls', None)  # type: ClsType["models.CollectionOfDirectoryObject0"]
          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_direct_reports.metadata['url']  # type: ignore
                  path_format_arguments = {
                      'user-id': self._serialize.url("user_id", user_id, 'str'),
                  }
                  url = self._client.format_url(url, **path_format_arguments)
                  # 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('CollectionOfDirectoryObject0', 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_direct_reports.metadata = {'url': '/users/{user-id}/directReports'}  # type: ignore
  
      def list_ref_direct_reports(
          self,
          user_id,  # type: str
          orderby=None,  # type: Optional[List[Union[str, "models.Enum69"]]]
          **kwargs  # type: Any
      ):
          # type: (...) -> Iterable["models.CollectionOfLinksOfDirectoryObject0"]
          """Get ref of directReports from users.
  
          Get ref of directReports from users.
  
          :param user_id: key: id of user.
          :type user_id: str
          :param orderby: Order items by property values.
          :type orderby: list[str or ~users.models.Enum69]
          :keyword callable cls: A custom type or function that will be passed the direct response
          :return: An iterator like instance of either CollectionOfLinksOfDirectoryObject0 or the result of cls(response)
          :rtype: ~azure.core.paging.ItemPaged[~users.models.CollectionOfLinksOfDirectoryObject0]
          :raises: ~azure.core.exceptions.HttpResponseError
          """
          cls = kwargs.pop('cls', None)  # type: ClsType["models.CollectionOfLinksOfDirectoryObject0"]
          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_ref_direct_reports.metadata['url']  # type: ignore
                  path_format_arguments = {
                      'user-id': self._serialize.url("user_id", user_id, 'str'),
                  }
                  url = self._client.format_url(url, **path_format_arguments)
                  # 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=',')
  
                  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('CollectionOfLinksOfDirectoryObject0', 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_ref_direct_reports.metadata = {'url': '/users/{user-id}/directReports/$ref'}  # type: ignore
  
      def create_ref_direct_reports(
          self,
          user_id,  # type: str
          body,  # type: Dict[str, object]
          **kwargs  # type: Any
      ):
          # type: (...) -> Dict[str, object]
          """Create new navigation property ref to directReports for users.
  
          Create new navigation property ref to directReports for users.
  
          :param user_id: key: id of user.
          :type user_id: str
          :param body: New navigation property ref value.
          :type body: dict[str, object]
          :keyword callable cls: A custom type or function that will be passed the direct response
          :return: dict mapping str to object, or the result of cls(response)
          :rtype: dict[str, object]
          :raises: ~azure.core.exceptions.HttpResponseError
          """
          cls = kwargs.pop('cls', None)  # type: ClsType[Dict[str, object]]
          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_ref_direct_reports.metadata['url']  # type: ignore
          path_format_arguments = {
              'user-id': self._serialize.url("user_id", user_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, '{object}')
          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('{object}', pipeline_response)
  
          if cls:
              return cls(pipeline_response, deserialized, {})
  
          return deserialized
      create_ref_direct_reports.metadata = {'url': '/users/{user-id}/directReports/$ref'}  # type: ignore
  
      def list_extensions(
          self,
          user_id,  # type: str
          orderby=None,  # type: Optional[List[Union[str, "models.Enum70"]]]
          select=None,  # type: Optional[List[str]]
          expand=None,  # type: Optional[List[str]]
          **kwargs  # type: Any
      ):
          # type: (...) -> Iterable["models.CollectionOfExtension"]
          """Get extensions from users.
  
          Get extensions from users.
  
          :param user_id: key: id of user.
          :type user_id: str
          :param orderby: Order items by property values.
          :type orderby: list[str or ~users.models.Enum70]
          :param select: Select properties to be returned.
          :type select: list[str]
          :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 CollectionOfExtension or the result of cls(response)
          :rtype: ~azure.core.paging.ItemPaged[~users.models.CollectionOfExtension]
          :raises: ~azure.core.exceptions.HttpResponseError
          """
          cls = kwargs.pop('cls', None)  # type: ClsType["models.CollectionOfExtension"]
          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_extensions.metadata['url']  # type: ignore
                  path_format_arguments = {
                      'user-id': self._serialize.url("user_id", user_id, 'str'),
                  }
                  url = self._client.format_url(url, **path_format_arguments)
                  # 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('CollectionOfExtension', 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_extensions.metadata = {'url': '/users/{user-id}/extensions'}  # type: ignore
  
      def create_extensions(
          self,
          user_id,  # type: str
          body,  # type: "models.MicrosoftGraphExtension"
          **kwargs  # type: Any
      ):
          # type: (...) -> "models.MicrosoftGraphExtension"
          """Create new navigation property to extensions for users.
  
          Create new navigation property to extensions for users.
  
          :param user_id: key: id of user.
          :type user_id: str
          :param body: New navigation property.
          :type body: ~users.models.MicrosoftGraphExtension
          :keyword callable cls: A custom type or function that will be passed the direct response
          :return: MicrosoftGraphExtension, or the result of cls(response)
          :rtype: ~users.models.MicrosoftGraphExtension
          :raises: ~azure.core.exceptions.HttpResponseError
          """
          cls = kwargs.pop('cls', None)  # type: ClsType["models.MicrosoftGraphExtension"]
          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_extensions.metadata['url']  # type: ignore
          path_format_arguments = {
              'user-id': self._serialize.url("user_id", user_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, 'MicrosoftGraphExtension')
          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('MicrosoftGraphExtension', pipeline_response)
  
          if cls:
              return cls(pipeline_response, deserialized, {})
  
          return deserialized
      create_extensions.metadata = {'url': '/users/{user-id}/extensions'}  # type: ignore
  
      def get_extensions(
          self,
          user_id,  # type: str
          extension_id,  # type: str
          select=None,  # type: Optional[List[str]]
          expand=None,  # type: Optional[List[str]]
          **kwargs  # type: Any
      ):
          # type: (...) -> "models.MicrosoftGraphExtension"
          """Get extensions from users.
  
          Get extensions from users.
  
          :param user_id: key: id of user.
          :type user_id: str
          :param extension_id: key: id of extension.
          :type extension_id: str
          :param select: Select properties to be returned.
          :type select: list[str]
          :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: MicrosoftGraphExtension, or the result of cls(response)
          :rtype: ~users.models.MicrosoftGraphExtension
          :raises: ~azure.core.exceptions.HttpResponseError
          """
          cls = kwargs.pop('cls', None)  # type: ClsType["models.MicrosoftGraphExtension"]
          error_map = {
              401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
          }
          error_map.update(kwargs.pop('error_map', {}))
          accept = "application/json"
  
          # Construct URL
          url = self.get_extensions.metadata['url']  # type: ignore
          path_format_arguments = {
              'user-id': self._serialize.url("user_id", user_id, 'str'),
              'extension-id': self._serialize.url("extension_id", extension_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('MicrosoftGraphExtension', pipeline_response)
  
          if cls:
              return cls(pipeline_response, deserialized, {})
  
          return deserialized
      get_extensions.metadata = {'url': '/users/{user-id}/extensions/{extension-id}'}  # type: ignore
  
      def update_extensions(
          self,
          user_id,  # type: str
          extension_id,  # type: str
          body,  # type: "models.MicrosoftGraphExtension"
          **kwargs  # type: Any
      ):
          # type: (...) -> None
          """Update the navigation property extensions in users.
  
          Update the navigation property extensions in users.
  
          :param user_id: key: id of user.
          :type user_id: str
          :param extension_id: key: id of extension.
          :type extension_id: str
          :param body: New navigation property values.
          :type body: ~users.models.MicrosoftGraphExtension
          :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_extensions.metadata['url']  # type: ignore
          path_format_arguments = {
              'user-id': self._serialize.url("user_id", user_id, 'str'),
              'extension-id': self._serialize.url("extension_id", extension_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, 'MicrosoftGraphExtension')
          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_extensions.metadata = {'url': '/users/{user-id}/extensions/{extension-id}'}  # type: ignore
  
      def delete_extensions(
          self,
          user_id,  # type: str
          extension_id,  # type: str
          if_match=None,  # type: Optional[str]
          **kwargs  # type: Any
      ):
          # type: (...) -> None
          """Delete navigation property extensions for users.
  
          Delete navigation property extensions for users.
  
          :param user_id: key: id of user.
          :type user_id: str
          :param extension_id: key: id of extension.
          :type extension_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_extensions.metadata['url']  # type: ignore
          path_format_arguments = {
              'user-id': self._serialize.url("user_id", user_id, 'str'),
              'extension-id': self._serialize.url("extension_id", extension_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_extensions.metadata = {'url': '/users/{user-id}/extensions/{extension-id}'}  # type: ignore
  
      def list_license_details(
          self,
          user_id,  # type: str
          orderby=None,  # type: Optional[List[Union[str, "models.Enum71"]]]
          select=None,  # type: Optional[List[Union[str, "models.Enum72"]]]
          expand=None,  # type: Optional[List[str]]
          **kwargs  # type: Any
      ):
          # type: (...) -> Iterable["models.CollectionOfLicenseDetails"]
          """Get licenseDetails from users.
  
          Get licenseDetails from users.
  
          :param user_id: key: id of user.
          :type user_id: str
          :param orderby: Order items by property values.
          :type orderby: list[str or ~users.models.Enum71]
          :param select: Select properties to be returned.
          :type select: list[str or ~users.models.Enum72]
          :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 CollectionOfLicenseDetails or the result of cls(response)
          :rtype: ~azure.core.paging.ItemPaged[~users.models.CollectionOfLicenseDetails]
          :raises: ~azure.core.exceptions.HttpResponseError
          """
          cls = kwargs.pop('cls', None)  # type: ClsType["models.CollectionOfLicenseDetails"]
          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_license_details.metadata['url']  # type: ignore
                  path_format_arguments = {
                      'user-id': self._serialize.url("user_id", user_id, 'str'),
                  }
                  url = self._client.format_url(url, **path_format_arguments)
                  # 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('CollectionOfLicenseDetails', 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_license_details.metadata = {'url': '/users/{user-id}/licenseDetails'}  # type: ignore
  
      def create_license_details(
          self,
          user_id,  # type: str
          body,  # type: "models.MicrosoftGraphLicenseDetails"
          **kwargs  # type: Any
      ):
          # type: (...) -> "models.MicrosoftGraphLicenseDetails"
          """Create new navigation property to licenseDetails for users.
  
          Create new navigation property to licenseDetails for users.
  
          :param user_id: key: id of user.
          :type user_id: str
          :param body: New navigation property.
          :type body: ~users.models.MicrosoftGraphLicenseDetails
          :keyword callable cls: A custom type or function that will be passed the direct response
          :return: MicrosoftGraphLicenseDetails, or the result of cls(response)
          :rtype: ~users.models.MicrosoftGraphLicenseDetails
          :raises: ~azure.core.exceptions.HttpResponseError
          """
          cls = kwargs.pop('cls', None)  # type: ClsType["models.MicrosoftGraphLicenseDetails"]
          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_license_details.metadata['url']  # type: ignore
          path_format_arguments = {
              'user-id': self._serialize.url("user_id", user_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, 'MicrosoftGraphLicenseDetails')
          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('MicrosoftGraphLicenseDetails', pipeline_response)
  
          if cls:
              return cls(pipeline_response, deserialized, {})
  
          return deserialized
      create_license_details.metadata = {'url': '/users/{user-id}/licenseDetails'}  # type: ignore
  
      def get_license_details(
          self,
          user_id,  # type: str
          license_details_id,  # type: str
          select=None,  # type: Optional[List[Union[str, "models.Enum73"]]]
          expand=None,  # type: Optional[List[str]]
          **kwargs  # type: Any
      ):
          # type: (...) -> "models.MicrosoftGraphLicenseDetails"
          """Get licenseDetails from users.
  
          Get licenseDetails from users.
  
          :param user_id: key: id of user.
          :type user_id: str
          :param license_details_id: key: id of licenseDetails.
          :type license_details_id: str
          :param select: Select properties to be returned.
          :type select: list[str or ~users.models.Enum73]
          :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: MicrosoftGraphLicenseDetails, or the result of cls(response)
          :rtype: ~users.models.MicrosoftGraphLicenseDetails
          :raises: ~azure.core.exceptions.HttpResponseError
          """
          cls = kwargs.pop('cls', None)  # type: ClsType["models.MicrosoftGraphLicenseDetails"]
          error_map = {
              401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
          }
          error_map.update(kwargs.pop('error_map', {}))
          accept = "application/json"
  
          # Construct URL
          url = self.get_license_details.metadata['url']  # type: ignore
          path_format_arguments = {
              'user-id': self._serialize.url("user_id", user_id, 'str'),
              'licenseDetails-id': self._serialize.url("license_details_id", license_details_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('MicrosoftGraphLicenseDetails', pipeline_response)
  
          if cls:
              return cls(pipeline_response, deserialized, {})
  
          return deserialized
      get_license_details.metadata = {'url': '/users/{user-id}/licenseDetails/{licenseDetails-id}'}  # type: ignore
  
      def update_license_details(
          self,
          user_id,  # type: str
          license_details_id,  # type: str
          body,  # type: "models.MicrosoftGraphLicenseDetails"
          **kwargs  # type: Any
      ):
          # type: (...) -> None
          """Update the navigation property licenseDetails in users.
  
          Update the navigation property licenseDetails in users.
  
          :param user_id: key: id of user.
          :type user_id: str
          :param license_details_id: key: id of licenseDetails.
          :type license_details_id: str
          :param body: New navigation property values.
          :type body: ~users.models.MicrosoftGraphLicenseDetails
          :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_license_details.metadata['url']  # type: ignore
          path_format_arguments = {
              'user-id': self._serialize.url("user_id", user_id, 'str'),
              'licenseDetails-id': self._serialize.url("license_details_id", license_details_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, 'MicrosoftGraphLicenseDetails')
          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_license_details.metadata = {'url': '/users/{user-id}/licenseDetails/{licenseDetails-id}'}  # type: ignore
  
      def delete_license_details(
          self,
          user_id,  # type: str
          license_details_id,  # type: str
          if_match=None,  # type: Optional[str]
          **kwargs  # type: Any
      ):
          # type: (...) -> None
          """Delete navigation property licenseDetails for users.
  
          Delete navigation property licenseDetails for users.
  
          :param user_id: key: id of user.
          :type user_id: str
          :param license_details_id: key: id of licenseDetails.
          :type license_details_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_license_details.metadata['url']  # type: ignore
          path_format_arguments = {
              'user-id': self._serialize.url("user_id", user_id, 'str'),
              'licenseDetails-id': self._serialize.url("license_details_id", license_details_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_license_details.metadata = {'url': '/users/{user-id}/licenseDetails/{licenseDetails-id}'}  # type: ignore
  
      def get_manager(
          self,
          user_id,  # type: str
          select=None,  # type: Optional[List[Union[str, "models.Enum74"]]]
          expand=None,  # type: Optional[List[str]]
          **kwargs  # type: Any
      ):
          # type: (...) -> "models.MicrosoftGraphDirectoryObject"
          """Get manager from users.
  
          Get manager from users.
  
          :param user_id: key: id of user.
          :type user_id: str
          :param select: Select properties to be returned.
          :type select: list[str or ~users.models.Enum74]
          :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: MicrosoftGraphDirectoryObject, or the result of cls(response)
          :rtype: ~users.models.MicrosoftGraphDirectoryObject
          :raises: ~azure.core.exceptions.HttpResponseError
          """
          cls = kwargs.pop('cls', None)  # type: ClsType["models.MicrosoftGraphDirectoryObject"]
          error_map = {
              401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
          }
          error_map.update(kwargs.pop('error_map', {}))
          accept = "application/json"
  
          # Construct URL
          url = self.get_manager.metadata['url']  # type: ignore
          path_format_arguments = {
              'user-id': self._serialize.url("user_id", user_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('MicrosoftGraphDirectoryObject', pipeline_response)
  
          if cls:
              return cls(pipeline_response, deserialized, {})
  
          return deserialized
      get_manager.metadata = {'url': '/users/{user-id}/manager'}  # type: ignore
  
      def get_ref_manager(
          self,
          user_id,  # type: str
          **kwargs  # type: Any
      ):
          # type: (...) -> str
          """Get ref of manager from users.
  
          Get ref of manager from users.
  
          :param user_id: key: id of user.
          :type user_id: str
          :keyword callable cls: A custom type or function that will be passed the direct response
          :return: str, or the result of cls(response)
          :rtype: str
          :raises: ~azure.core.exceptions.HttpResponseError
          """
          cls = kwargs.pop('cls', None)  # type: ClsType[str]
          error_map = {
              401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
          }
          error_map.update(kwargs.pop('error_map', {}))
          accept = "application/json"
  
          # Construct URL
          url = self.get_ref_manager.metadata['url']  # type: ignore
          path_format_arguments = {
              'user-id': self._serialize.url("user_id", user_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['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('str', pipeline_response)
  
          if cls:
              return cls(pipeline_response, deserialized, {})
  
          return deserialized
      get_ref_manager.metadata = {'url': '/users/{user-id}/manager/$ref'}  # type: ignore
  
      def set_ref_manager(
          self,
          user_id,  # type: str
          body,  # type: Dict[str, object]
          **kwargs  # type: Any
      ):
          # type: (...) -> None
          """Update the ref of navigation property manager in users.
  
          Update the ref of navigation property manager in users.
  
          :param user_id: key: id of user.
          :type user_id: str
          :param body: New navigation property ref values.
          :type body: dict[str, object]
          :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.set_ref_manager.metadata['url']  # type: ignore
          path_format_arguments = {
              'user-id': self._serialize.url("user_id", user_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, '{object}')
          body_content_kwargs['content'] = body_content
          request = self._client.put(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, {})
  
      set_ref_manager.metadata = {'url': '/users/{user-id}/manager/$ref'}  # type: ignore
  
      def delete_ref_manager(
          self,
          user_id,  # type: str
          if_match=None,  # type: Optional[str]
          **kwargs  # type: Any
      ):
          # type: (...) -> None
          """Delete ref of navigation property manager for users.
  
          Delete ref of navigation property manager for users.
  
          :param user_id: key: id of user.
          :type user_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_ref_manager.metadata['url']  # type: ignore
          path_format_arguments = {
              'user-id': self._serialize.url("user_id", user_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_ref_manager.metadata = {'url': '/users/{user-id}/manager/$ref'}  # type: ignore
  
      def list_member_of(
          self,
          user_id,  # type: str
          orderby=None,  # type: Optional[List[Union[str, "models.Enum75"]]]
          select=None,  # type: Optional[List[Union[str, "models.Enum76"]]]
          expand=None,  # type: Optional[List[str]]
          **kwargs  # type: Any
      ):
          # type: (...) -> Iterable["models.CollectionOfDirectoryObject1"]
          """Get memberOf from users.
  
          Get memberOf from users.
  
          :param user_id: key: id of user.
          :type user_id: str
          :param orderby: Order items by property values.
          :type orderby: list[str or ~users.models.Enum75]
          :param select: Select properties to be returned.
          :type select: list[str or ~users.models.Enum76]
          :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 CollectionOfDirectoryObject1 or the result of cls(response)
          :rtype: ~azure.core.paging.ItemPaged[~users.models.CollectionOfDirectoryObject1]
          :raises: ~azure.core.exceptions.HttpResponseError
          """
          cls = kwargs.pop('cls', None)  # type: ClsType["models.CollectionOfDirectoryObject1"]
          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_member_of.metadata['url']  # type: ignore
                  path_format_arguments = {
                      'user-id': self._serialize.url("user_id", user_id, 'str'),
                  }
                  url = self._client.format_url(url, **path_format_arguments)
                  # 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('CollectionOfDirectoryObject1', 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_member_of.metadata = {'url': '/users/{user-id}/memberOf'}  # type: ignore
  
      def list_ref_member_of(
          self,
          user_id,  # type: str
          orderby=None,  # type: Optional[List[Union[str, "models.Enum77"]]]
          **kwargs  # type: Any
      ):
          # type: (...) -> Iterable["models.CollectionOfLinksOfDirectoryObject1"]
          """Get ref of memberOf from users.
  
          Get ref of memberOf from users.
  
          :param user_id: key: id of user.
          :type user_id: str
          :param orderby: Order items by property values.
          :type orderby: list[str or ~users.models.Enum77]
          :keyword callable cls: A custom type or function that will be passed the direct response
          :return: An iterator like instance of either CollectionOfLinksOfDirectoryObject1 or the result of cls(response)
          :rtype: ~azure.core.paging.ItemPaged[~users.models.CollectionOfLinksOfDirectoryObject1]
          :raises: ~azure.core.exceptions.HttpResponseError
          """
          cls = kwargs.pop('cls', None)  # type: ClsType["models.CollectionOfLinksOfDirectoryObject1"]
          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_ref_member_of.metadata['url']  # type: ignore
                  path_format_arguments = {
                      'user-id': self._serialize.url("user_id", user_id, 'str'),
                  }
                  url = self._client.format_url(url, **path_format_arguments)
                  # 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=',')
  
                  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('CollectionOfLinksOfDirectoryObject1', 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_ref_member_of.metadata = {'url': '/users/{user-id}/memberOf/$ref'}  # type: ignore
  
      def create_ref_member_of(
          self,
          user_id,  # type: str
          body,  # type: Dict[str, object]
          **kwargs  # type: Any
      ):
          # type: (...) -> Dict[str, object]
          """Create new navigation property ref to memberOf for users.
  
          Create new navigation property ref to memberOf for users.
  
          :param user_id: key: id of user.
          :type user_id: str
          :param body: New navigation property ref value.
          :type body: dict[str, object]
          :keyword callable cls: A custom type or function that will be passed the direct response
          :return: dict mapping str to object, or the result of cls(response)
          :rtype: dict[str, object]
          :raises: ~azure.core.exceptions.HttpResponseError
          """
          cls = kwargs.pop('cls', None)  # type: ClsType[Dict[str, object]]
          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_ref_member_of.metadata['url']  # type: ignore
          path_format_arguments = {
              'user-id': self._serialize.url("user_id", user_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, '{object}')
          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('{object}', pipeline_response)
  
          if cls:
              return cls(pipeline_response, deserialized, {})
  
          return deserialized
      create_ref_member_of.metadata = {'url': '/users/{user-id}/memberOf/$ref'}  # type: ignore
  
      def list_oauth2_permission_grants(
          self,
          user_id,  # type: str
          orderby=None,  # type: Optional[List[Union[str, "models.Enum78"]]]
          select=None,  # type: Optional[List[Union[str, "models.Enum79"]]]
          expand=None,  # type: Optional[List[str]]
          **kwargs  # type: Any
      ):
          # type: (...) -> Iterable["models.CollectionOfOAuth2PermissionGrant"]
          """Get oauth2PermissionGrants from users.
  
          Get oauth2PermissionGrants from users.
  
          :param user_id: key: id of user.
          :type user_id: str
          :param orderby: Order items by property values.
          :type orderby: list[str or ~users.models.Enum78]
          :param select: Select properties to be returned.
          :type select: list[str or ~users.models.Enum79]
          :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 CollectionOfOAuth2PermissionGrant or the result of cls(response)
          :rtype: ~azure.core.paging.ItemPaged[~users.models.CollectionOfOAuth2PermissionGrant]
          :raises: ~azure.core.exceptions.HttpResponseError
          """
          cls = kwargs.pop('cls', None)  # type: ClsType["models.CollectionOfOAuth2PermissionGrant"]
          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_oauth2_permission_grants.metadata['url']  # type: ignore
                  path_format_arguments = {
                      'user-id': self._serialize.url("user_id", user_id, 'str'),
                  }
                  url = self._client.format_url(url, **path_format_arguments)
                  # 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('CollectionOfOAuth2PermissionGrant', 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_oauth2_permission_grants.metadata = {'url': '/users/{user-id}/oauth2PermissionGrants'}  # type: ignore
  
      def list_ref_oauth2_permission_grants(
          self,
          user_id,  # type: str
          orderby=None,  # type: Optional[List[Union[str, "models.Enum80"]]]
          **kwargs  # type: Any
      ):
          # type: (...) -> Iterable["models.CollectionOfLinksOfOAuth2PermissionGrant"]
          """Get ref of oauth2PermissionGrants from users.
  
          Get ref of oauth2PermissionGrants from users.
  
          :param user_id: key: id of user.
          :type user_id: str
          :param orderby: Order items by property values.
          :type orderby: list[str or ~users.models.Enum80]
          :keyword callable cls: A custom type or function that will be passed the direct response
          :return: An iterator like instance of either CollectionOfLinksOfOAuth2PermissionGrant or the result of cls(response)
          :rtype: ~azure.core.paging.ItemPaged[~users.models.CollectionOfLinksOfOAuth2PermissionGrant]
          :raises: ~azure.core.exceptions.HttpResponseError
          """
          cls = kwargs.pop('cls', None)  # type: ClsType["models.CollectionOfLinksOfOAuth2PermissionGrant"]
          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_ref_oauth2_permission_grants.metadata['url']  # type: ignore
                  path_format_arguments = {
                      'user-id': self._serialize.url("user_id", user_id, 'str'),
                  }
                  url = self._client.format_url(url, **path_format_arguments)
                  # 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=',')
  
                  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('CollectionOfLinksOfOAuth2PermissionGrant', 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_ref_oauth2_permission_grants.metadata = {'url': '/users/{user-id}/oauth2PermissionGrants/$ref'}  # type: ignore
  
      def create_ref_oauth2_permission_grants(
          self,
          user_id,  # type: str
          body,  # type: Dict[str, object]
          **kwargs  # type: Any
      ):
          # type: (...) -> Dict[str, object]
          """Create new navigation property ref to oauth2PermissionGrants for users.
  
          Create new navigation property ref to oauth2PermissionGrants for users.
  
          :param user_id: key: id of user.
          :type user_id: str
          :param body: New navigation property ref value.
          :type body: dict[str, object]
          :keyword callable cls: A custom type or function that will be passed the direct response
          :return: dict mapping str to object, or the result of cls(response)
          :rtype: dict[str, object]
          :raises: ~azure.core.exceptions.HttpResponseError
          """
          cls = kwargs.pop('cls', None)  # type: ClsType[Dict[str, object]]
          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_ref_oauth2_permission_grants.metadata['url']  # type: ignore
          path_format_arguments = {
              'user-id': self._serialize.url("user_id", user_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, '{object}')
          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('{object}', pipeline_response)
  
          if cls:
              return cls(pipeline_response, deserialized, {})
  
          return deserialized
      create_ref_oauth2_permission_grants.metadata = {'url': '/users/{user-id}/oauth2PermissionGrants/$ref'}  # type: ignore
  
      def get_outlook(
          self,
          user_id,  # type: str
          select=None,  # type: Optional[List[Union[str, "models.Enum81"]]]
          expand=None,  # type: Optional[List[Union[str, "models.Enum82"]]]
          **kwargs  # type: Any
      ):
          # type: (...) -> "models.MicrosoftGraphOutlookUser"
          """Get outlook from users.
  
          Get outlook from users.
  
          :param user_id: key: id of user.
          :type user_id: str
          :param select: Select properties to be returned.
          :type select: list[str or ~users.models.Enum81]
          :param expand: Expand related entities.
          :type expand: list[str or ~users.models.Enum82]
          :keyword callable cls: A custom type or function that will be passed the direct response
          :return: MicrosoftGraphOutlookUser, or the result of cls(response)
          :rtype: ~users.models.MicrosoftGraphOutlookUser
          :raises: ~azure.core.exceptions.HttpResponseError
          """
          cls = kwargs.pop('cls', None)  # type: ClsType["models.MicrosoftGraphOutlookUser"]
          error_map = {
              401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
          }
          error_map.update(kwargs.pop('error_map', {}))
          accept = "application/json"
  
          # Construct URL
          url = self.get_outlook.metadata['url']  # type: ignore
          path_format_arguments = {
              'user-id': self._serialize.url("user_id", user_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('MicrosoftGraphOutlookUser', pipeline_response)
  
          if cls:
              return cls(pipeline_response, deserialized, {})
  
          return deserialized
      get_outlook.metadata = {'url': '/users/{user-id}/outlook'}  # type: ignore
  
      def update_outlook(
          self,
          user_id,  # type: str
          body,  # type: "models.MicrosoftGraphOutlookUser"
          **kwargs  # type: Any
      ):
          # type: (...) -> None
          """Update the navigation property outlook in users.
  
          Update the navigation property outlook in users.
  
          :param user_id: key: id of user.
          :type user_id: str
          :param body: New navigation property values.
          :type body: ~users.models.MicrosoftGraphOutlookUser
          :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_outlook.metadata['url']  # type: ignore
          path_format_arguments = {
              'user-id': self._serialize.url("user_id", user_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, 'MicrosoftGraphOutlookUser')
          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_outlook.metadata = {'url': '/users/{user-id}/outlook'}  # type: ignore
  
      def delete_outlook(
          self,
          user_id,  # type: str
          if_match=None,  # type: Optional[str]
          **kwargs  # type: Any
      ):
          # type: (...) -> None
          """Delete navigation property outlook for users.
  
          Delete navigation property outlook for users.
  
          :param user_id: key: id of user.
          :type user_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_outlook.metadata['url']  # type: ignore
          path_format_arguments = {
              'user-id': self._serialize.url("user_id", user_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_outlook.metadata = {'url': '/users/{user-id}/outlook'}  # type: ignore
  
      def list_owned_devices(
          self,
          user_id,  # type: str
          orderby=None,  # type: Optional[List[Union[str, "models.Enum86"]]]
          select=None,  # type: Optional[List[Union[str, "models.Enum87"]]]
          expand=None,  # type: Optional[List[str]]
          **kwargs  # type: Any
      ):
          # type: (...) -> Iterable["models.CollectionOfDirectoryObject2"]
          """Get ownedDevices from users.
  
          Get ownedDevices from users.
  
          :param user_id: key: id of user.
          :type user_id: str
          :param orderby: Order items by property values.
          :type orderby: list[str or ~users.models.Enum86]
          :param select: Select properties to be returned.
          :type select: list[str or ~users.models.Enum87]
          :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 CollectionOfDirectoryObject2 or the result of cls(response)
          :rtype: ~azure.core.paging.ItemPaged[~users.models.CollectionOfDirectoryObject2]
          :raises: ~azure.core.exceptions.HttpResponseError
          """
          cls = kwargs.pop('cls', None)  # type: ClsType["models.CollectionOfDirectoryObject2"]
          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_owned_devices.metadata['url']  # type: ignore
                  path_format_arguments = {
                      'user-id': self._serialize.url("user_id", user_id, 'str'),
                  }
                  url = self._client.format_url(url, **path_format_arguments)
                  # 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('CollectionOfDirectoryObject2', 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_owned_devices.metadata = {'url': '/users/{user-id}/ownedDevices'}  # type: ignore
  
      def list_ref_owned_devices(
          self,
          user_id,  # type: str
          orderby=None,  # type: Optional[List[Union[str, "models.Enum88"]]]
          **kwargs  # type: Any
      ):
          # type: (...) -> Iterable["models.CollectionOfLinksOfDirectoryObject2"]
          """Get ref of ownedDevices from users.
  
          Get ref of ownedDevices from users.
  
          :param user_id: key: id of user.
          :type user_id: str
          :param orderby: Order items by property values.
          :type orderby: list[str or ~users.models.Enum88]
          :keyword callable cls: A custom type or function that will be passed the direct response
          :return: An iterator like instance of either CollectionOfLinksOfDirectoryObject2 or the result of cls(response)
          :rtype: ~azure.core.paging.ItemPaged[~users.models.CollectionOfLinksOfDirectoryObject2]
          :raises: ~azure.core.exceptions.HttpResponseError
          """
          cls = kwargs.pop('cls', None)  # type: ClsType["models.CollectionOfLinksOfDirectoryObject2"]
          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_ref_owned_devices.metadata['url']  # type: ignore
                  path_format_arguments = {
                      'user-id': self._serialize.url("user_id", user_id, 'str'),
                  }
                  url = self._client.format_url(url, **path_format_arguments)
                  # 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=',')
  
                  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('CollectionOfLinksOfDirectoryObject2', 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_ref_owned_devices.metadata = {'url': '/users/{user-id}/ownedDevices/$ref'}  # type: ignore
  
      def create_ref_owned_devices(
          self,
          user_id,  # type: str
          body,  # type: Dict[str, object]
          **kwargs  # type: Any
      ):
          # type: (...) -> Dict[str, object]
          """Create new navigation property ref to ownedDevices for users.
  
          Create new navigation property ref to ownedDevices for users.
  
          :param user_id: key: id of user.
          :type user_id: str
          :param body: New navigation property ref value.
          :type body: dict[str, object]
          :keyword callable cls: A custom type or function that will be passed the direct response
          :return: dict mapping str to object, or the result of cls(response)
          :rtype: dict[str, object]
          :raises: ~azure.core.exceptions.HttpResponseError
          """
          cls = kwargs.pop('cls', None)  # type: ClsType[Dict[str, object]]
          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_ref_owned_devices.metadata['url']  # type: ignore
          path_format_arguments = {
              'user-id': self._serialize.url("user_id", user_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, '{object}')
          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('{object}', pipeline_response)
  
          if cls:
              return cls(pipeline_response, deserialized, {})
  
          return deserialized
      create_ref_owned_devices.metadata = {'url': '/users/{user-id}/ownedDevices/$ref'}  # type: ignore
  
      def list_owned_objects(
          self,
          user_id,  # type: str
          orderby=None,  # type: Optional[List[Union[str, "models.Enum89"]]]
          select=None,  # type: Optional[List[Union[str, "models.Enum90"]]]
          expand=None,  # type: Optional[List[str]]
          **kwargs  # type: Any
      ):
          # type: (...) -> Iterable["models.CollectionOfDirectoryObject3"]
          """Get ownedObjects from users.
  
          Get ownedObjects from users.
  
          :param user_id: key: id of user.
          :type user_id: str
          :param orderby: Order items by property values.
          :type orderby: list[str or ~users.models.Enum89]
          :param select: Select properties to be returned.
          :type select: list[str or ~users.models.Enum90]
          :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 CollectionOfDirectoryObject3 or the result of cls(response)
          :rtype: ~azure.core.paging.ItemPaged[~users.models.CollectionOfDirectoryObject3]
          :raises: ~azure.core.exceptions.HttpResponseError
          """
          cls = kwargs.pop('cls', None)  # type: ClsType["models.CollectionOfDirectoryObject3"]
          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_owned_objects.metadata['url']  # type: ignore
                  path_format_arguments = {
                      'user-id': self._serialize.url("user_id", user_id, 'str'),
                  }
                  url = self._client.format_url(url, **path_format_arguments)
                  # 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('CollectionOfDirectoryObject3', 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_owned_objects.metadata = {'url': '/users/{user-id}/ownedObjects'}  # type: ignore
  
      def list_ref_owned_objects(
          self,
          user_id,  # type: str
          orderby=None,  # type: Optional[List[Union[str, "models.Enum91"]]]
          **kwargs  # type: Any
      ):
          # type: (...) -> Iterable["models.CollectionOfLinksOfDirectoryObject3"]
          """Get ref of ownedObjects from users.
  
          Get ref of ownedObjects from users.
  
          :param user_id: key: id of user.
          :type user_id: str
          :param orderby: Order items by property values.
          :type orderby: list[str or ~users.models.Enum91]
          :keyword callable cls: A custom type or function that will be passed the direct response
          :return: An iterator like instance of either CollectionOfLinksOfDirectoryObject3 or the result of cls(response)
          :rtype: ~azure.core.paging.ItemPaged[~users.models.CollectionOfLinksOfDirectoryObject3]
          :raises: ~azure.core.exceptions.HttpResponseError
          """
          cls = kwargs.pop('cls', None)  # type: ClsType["models.CollectionOfLinksOfDirectoryObject3"]
          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_ref_owned_objects.metadata['url']  # type: ignore
                  path_format_arguments = {
                      'user-id': self._serialize.url("user_id", user_id, 'str'),
                  }
                  url = self._client.format_url(url, **path_format_arguments)
                  # 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=',')
  
                  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('CollectionOfLinksOfDirectoryObject3', 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_ref_owned_objects.metadata = {'url': '/users/{user-id}/ownedObjects/$ref'}  # type: ignore
  
      def create_ref_owned_objects(
          self,
          user_id,  # type: str
          body,  # type: Dict[str, object]
          **kwargs  # type: Any
      ):
          # type: (...) -> Dict[str, object]
          """Create new navigation property ref to ownedObjects for users.
  
          Create new navigation property ref to ownedObjects for users.
  
          :param user_id: key: id of user.
          :type user_id: str
          :param body: New navigation property ref value.
          :type body: dict[str, object]
          :keyword callable cls: A custom type or function that will be passed the direct response
          :return: dict mapping str to object, or the result of cls(response)
          :rtype: dict[str, object]
          :raises: ~azure.core.exceptions.HttpResponseError
          """
          cls = kwargs.pop('cls', None)  # type: ClsType[Dict[str, object]]
          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_ref_owned_objects.metadata['url']  # type: ignore
          path_format_arguments = {
              'user-id': self._serialize.url("user_id", user_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, '{object}')
          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('{object}', pipeline_response)
  
          if cls:
              return cls(pipeline_response, deserialized, {})
  
          return deserialized
      create_ref_owned_objects.metadata = {'url': '/users/{user-id}/ownedObjects/$ref'}  # type: ignore
  
      def get_photo(
          self,
          user_id,  # type: str
          select=None,  # type: Optional[List[Union[str, "models.Enum92"]]]
          expand=None,  # type: Optional[List[str]]
          **kwargs  # type: Any
      ):
          # type: (...) -> "models.MicrosoftGraphProfilePhoto"
          """Get photo from users.
  
          Get photo from users.
  
          :param user_id: key: id of user.
          :type user_id: str
          :param select: Select properties to be returned.
          :type select: list[str or ~users.models.Enum92]
          :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: MicrosoftGraphProfilePhoto, or the result of cls(response)
          :rtype: ~users.models.MicrosoftGraphProfilePhoto
          :raises: ~azure.core.exceptions.HttpResponseError
          """
          cls = kwargs.pop('cls', None)  # type: ClsType["models.MicrosoftGraphProfilePhoto"]
          error_map = {
              401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
          }
          error_map.update(kwargs.pop('error_map', {}))
          accept = "application/json"
  
          # Construct URL
          url = self.get_photo.metadata['url']  # type: ignore
          path_format_arguments = {
              'user-id': self._serialize.url("user_id", user_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('MicrosoftGraphProfilePhoto', pipeline_response)
  
          if cls:
              return cls(pipeline_response, deserialized, {})
  
          return deserialized
      get_photo.metadata = {'url': '/users/{user-id}/photo'}  # type: ignore
  
      def update_photo(
          self,
          user_id,  # type: str
          body,  # type: "models.MicrosoftGraphProfilePhoto"
          **kwargs  # type: Any
      ):
          # type: (...) -> None
          """Update the navigation property photo in users.
  
          Update the navigation property photo in users.
  
          :param user_id: key: id of user.
          :type user_id: str
          :param body: New navigation property values.
          :type body: ~users.models.MicrosoftGraphProfilePhoto
          :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_photo.metadata['url']  # type: ignore
          path_format_arguments = {
              'user-id': self._serialize.url("user_id", user_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, 'MicrosoftGraphProfilePhoto')
          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_photo.metadata = {'url': '/users/{user-id}/photo'}  # type: ignore
  
      def delete_photo(
          self,
          user_id,  # type: str
          if_match=None,  # type: Optional[str]
          **kwargs  # type: Any
      ):
          # type: (...) -> None
          """Delete navigation property photo for users.
  
          Delete navigation property photo for users.
  
          :param user_id: key: id of user.
          :type user_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_photo.metadata['url']  # type: ignore
          path_format_arguments = {
              'user-id': self._serialize.url("user_id", user_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_photo.metadata = {'url': '/users/{user-id}/photo'}  # type: ignore
  
      def list_photos(
          self,
          user_id,  # type: str
          orderby=None,  # type: Optional[List[Union[str, "models.Enum93"]]]
          select=None,  # type: Optional[List[Union[str, "models.Enum94"]]]
          expand=None,  # type: Optional[List[str]]
          **kwargs  # type: Any
      ):
          # type: (...) -> Iterable["models.CollectionOfProfilePhoto"]
          """Get photos from users.
  
          Get photos from users.
  
          :param user_id: key: id of user.
          :type user_id: str
          :param orderby: Order items by property values.
          :type orderby: list[str or ~users.models.Enum93]
          :param select: Select properties to be returned.
          :type select: list[str or ~users.models.Enum94]
          :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 CollectionOfProfilePhoto or the result of cls(response)
          :rtype: ~azure.core.paging.ItemPaged[~users.models.CollectionOfProfilePhoto]
          :raises: ~azure.core.exceptions.HttpResponseError
          """
          cls = kwargs.pop('cls', None)  # type: ClsType["models.CollectionOfProfilePhoto"]
          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_photos.metadata['url']  # type: ignore
                  path_format_arguments = {
                      'user-id': self._serialize.url("user_id", user_id, 'str'),
                  }
                  url = self._client.format_url(url, **path_format_arguments)
                  # 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('CollectionOfProfilePhoto', 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_photos.metadata = {'url': '/users/{user-id}/photos'}  # type: ignore
  
      def create_photos(
          self,
          user_id,  # type: str
          body,  # type: "models.MicrosoftGraphProfilePhoto"
          **kwargs  # type: Any
      ):
          # type: (...) -> "models.MicrosoftGraphProfilePhoto"
          """Create new navigation property to photos for users.
  
          Create new navigation property to photos for users.
  
          :param user_id: key: id of user.
          :type user_id: str
          :param body: New navigation property.
          :type body: ~users.models.MicrosoftGraphProfilePhoto
          :keyword callable cls: A custom type or function that will be passed the direct response
          :return: MicrosoftGraphProfilePhoto, or the result of cls(response)
          :rtype: ~users.models.MicrosoftGraphProfilePhoto
          :raises: ~azure.core.exceptions.HttpResponseError
          """
          cls = kwargs.pop('cls', None)  # type: ClsType["models.MicrosoftGraphProfilePhoto"]
          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_photos.metadata['url']  # type: ignore
          path_format_arguments = {
              'user-id': self._serialize.url("user_id", user_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, 'MicrosoftGraphProfilePhoto')
          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('MicrosoftGraphProfilePhoto', pipeline_response)
  
          if cls:
              return cls(pipeline_response, deserialized, {})
  
          return deserialized
      create_photos.metadata = {'url': '/users/{user-id}/photos'}  # type: ignore
  
      def get_photos(
          self,
          user_id,  # type: str
          profile_photo_id,  # type: str
          select=None,  # type: Optional[List[Union[str, "models.Enum95"]]]
          expand=None,  # type: Optional[List[str]]
          **kwargs  # type: Any
      ):
          # type: (...) -> "models.MicrosoftGraphProfilePhoto"
          """Get photos from users.
  
          Get photos from users.
  
          :param user_id: key: id of user.
          :type user_id: str
          :param profile_photo_id: key: id of profilePhoto.
          :type profile_photo_id: str
          :param select: Select properties to be returned.
          :type select: list[str or ~users.models.Enum95]
          :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: MicrosoftGraphProfilePhoto, or the result of cls(response)
          :rtype: ~users.models.MicrosoftGraphProfilePhoto
          :raises: ~azure.core.exceptions.HttpResponseError
          """
          cls = kwargs.pop('cls', None)  # type: ClsType["models.MicrosoftGraphProfilePhoto"]
          error_map = {
              401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
          }
          error_map.update(kwargs.pop('error_map', {}))
          accept = "application/json"
  
          # Construct URL
          url = self.get_photos.metadata['url']  # type: ignore
          path_format_arguments = {
              'user-id': self._serialize.url("user_id", user_id, 'str'),
              'profilePhoto-id': self._serialize.url("profile_photo_id", profile_photo_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('MicrosoftGraphProfilePhoto', pipeline_response)
  
          if cls:
              return cls(pipeline_response, deserialized, {})
  
          return deserialized
      get_photos.metadata = {'url': '/users/{user-id}/photos/{profilePhoto-id}'}  # type: ignore
  
      def update_photos(
          self,
          user_id,  # type: str
          profile_photo_id,  # type: str
          body,  # type: "models.MicrosoftGraphProfilePhoto"
          **kwargs  # type: Any
      ):
          # type: (...) -> None
          """Update the navigation property photos in users.
  
          Update the navigation property photos in users.
  
          :param user_id: key: id of user.
          :type user_id: str
          :param profile_photo_id: key: id of profilePhoto.
          :type profile_photo_id: str
          :param body: New navigation property values.
          :type body: ~users.models.MicrosoftGraphProfilePhoto
          :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_photos.metadata['url']  # type: ignore
          path_format_arguments = {
              'user-id': self._serialize.url("user_id", user_id, 'str'),
              'profilePhoto-id': self._serialize.url("profile_photo_id", profile_photo_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, 'MicrosoftGraphProfilePhoto')
          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_photos.metadata = {'url': '/users/{user-id}/photos/{profilePhoto-id}'}  # type: ignore
  
      def delete_photos(
          self,
          user_id,  # type: str
          profile_photo_id,  # type: str
          if_match=None,  # type: Optional[str]
          **kwargs  # type: Any
      ):
          # type: (...) -> None
          """Delete navigation property photos for users.
  
          Delete navigation property photos for users.
  
          :param user_id: key: id of user.
          :type user_id: str
          :param profile_photo_id: key: id of profilePhoto.
          :type profile_photo_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_photos.metadata['url']  # type: ignore
          path_format_arguments = {
              'user-id': self._serialize.url("user_id", user_id, 'str'),
              'profilePhoto-id': self._serialize.url("profile_photo_id", profile_photo_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_photos.metadata = {'url': '/users/{user-id}/photos/{profilePhoto-id}'}  # type: ignore
  
      def list_registered_devices(
          self,
          user_id,  # type: str
          orderby=None,  # type: Optional[List[Union[str, "models.Enum96"]]]
          select=None,  # type: Optional[List[Union[str, "models.Enum97"]]]
          expand=None,  # type: Optional[List[str]]
          **kwargs  # type: Any
      ):
          # type: (...) -> Iterable["models.CollectionOfDirectoryObject4"]
          """Get registeredDevices from users.
  
          Get registeredDevices from users.
  
          :param user_id: key: id of user.
          :type user_id: str
          :param orderby: Order items by property values.
          :type orderby: list[str or ~users.models.Enum96]
          :param select: Select properties to be returned.
          :type select: list[str or ~users.models.Enum97]
          :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 CollectionOfDirectoryObject4 or the result of cls(response)
          :rtype: ~azure.core.paging.ItemPaged[~users.models.CollectionOfDirectoryObject4]
          :raises: ~azure.core.exceptions.HttpResponseError
          """
          cls = kwargs.pop('cls', None)  # type: ClsType["models.CollectionOfDirectoryObject4"]
          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_registered_devices.metadata['url']  # type: ignore
                  path_format_arguments = {
                      'user-id': self._serialize.url("user_id", user_id, 'str'),
                  }
                  url = self._client.format_url(url, **path_format_arguments)
                  # 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('CollectionOfDirectoryObject4', 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_registered_devices.metadata = {'url': '/users/{user-id}/registeredDevices'}  # type: ignore
  
      def list_ref_registered_devices(
          self,
          user_id,  # type: str
          orderby=None,  # type: Optional[List[Union[str, "models.Enum98"]]]
          **kwargs  # type: Any
      ):
          # type: (...) -> Iterable["models.CollectionOfLinksOfDirectoryObject4"]
          """Get ref of registeredDevices from users.
  
          Get ref of registeredDevices from users.
  
          :param user_id: key: id of user.
          :type user_id: str
          :param orderby: Order items by property values.
          :type orderby: list[str or ~users.models.Enum98]
          :keyword callable cls: A custom type or function that will be passed the direct response
          :return: An iterator like instance of either CollectionOfLinksOfDirectoryObject4 or the result of cls(response)
          :rtype: ~azure.core.paging.ItemPaged[~users.models.CollectionOfLinksOfDirectoryObject4]
          :raises: ~azure.core.exceptions.HttpResponseError
          """
          cls = kwargs.pop('cls', None)  # type: ClsType["models.CollectionOfLinksOfDirectoryObject4"]
          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_ref_registered_devices.metadata['url']  # type: ignore
                  path_format_arguments = {
                      'user-id': self._serialize.url("user_id", user_id, 'str'),
                  }
                  url = self._client.format_url(url, **path_format_arguments)
                  # 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=',')
  
                  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('CollectionOfLinksOfDirectoryObject4', 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_ref_registered_devices.metadata = {'url': '/users/{user-id}/registeredDevices/$ref'}  # type: ignore
  
      def create_ref_registered_devices(
          self,
          user_id,  # type: str
          body,  # type: Dict[str, object]
          **kwargs  # type: Any
      ):
          # type: (...) -> Dict[str, object]
          """Create new navigation property ref to registeredDevices for users.
  
          Create new navigation property ref to registeredDevices for users.
  
          :param user_id: key: id of user.
          :type user_id: str
          :param body: New navigation property ref value.
          :type body: dict[str, object]
          :keyword callable cls: A custom type or function that will be passed the direct response
          :return: dict mapping str to object, or the result of cls(response)
          :rtype: dict[str, object]
          :raises: ~azure.core.exceptions.HttpResponseError
          """
          cls = kwargs.pop('cls', None)  # type: ClsType[Dict[str, object]]
          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_ref_registered_devices.metadata['url']  # type: ignore
          path_format_arguments = {
              'user-id': self._serialize.url("user_id", user_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, '{object}')
          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('{object}', pipeline_response)
  
          if cls:
              return cls(pipeline_response, deserialized, {})
  
          return deserialized
      create_ref_registered_devices.metadata = {'url': '/users/{user-id}/registeredDevices/$ref'}  # type: ignore
  
      def get_settings(
          self,
          user_id,  # type: str
          select=None,  # type: Optional[List[Union[str, "models.Enum99"]]]
          expand=None,  # type: Optional[List[Union[str, "models.Enum100"]]]
          **kwargs  # type: Any
      ):
          # type: (...) -> "models.MicrosoftGraphUserSettings"
          """Get settings from users.
  
          Get settings from users.
  
          :param user_id: key: id of user.
          :type user_id: str
          :param select: Select properties to be returned.
          :type select: list[str or ~users.models.Enum99]
          :param expand: Expand related entities.
          :type expand: list[str or ~users.models.Enum100]
          :keyword callable cls: A custom type or function that will be passed the direct response
          :return: MicrosoftGraphUserSettings, or the result of cls(response)
          :rtype: ~users.models.MicrosoftGraphUserSettings
          :raises: ~azure.core.exceptions.HttpResponseError
          """
          cls = kwargs.pop('cls', None)  # type: ClsType["models.MicrosoftGraphUserSettings"]
          error_map = {
              401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
          }
          error_map.update(kwargs.pop('error_map', {}))
          accept = "application/json"
  
          # Construct URL
          url = self.get_settings.metadata['url']  # type: ignore
          path_format_arguments = {
              'user-id': self._serialize.url("user_id", user_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('MicrosoftGraphUserSettings', pipeline_response)
  
          if cls:
              return cls(pipeline_response, deserialized, {})
  
          return deserialized
      get_settings.metadata = {'url': '/users/{user-id}/settings'}  # type: ignore
  
      def update_settings(
          self,
          user_id,  # type: str
          body,  # type: "models.MicrosoftGraphUserSettings"
          **kwargs  # type: Any
      ):
          # type: (...) -> None
          """Update the navigation property settings in users.
  
          Update the navigation property settings in users.
  
          :param user_id: key: id of user.
          :type user_id: str
          :param body: New navigation property values.
          :type body: ~users.models.MicrosoftGraphUserSettings
          :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_settings.metadata['url']  # type: ignore
          path_format_arguments = {
              'user-id': self._serialize.url("user_id", user_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, 'MicrosoftGraphUserSettings')
          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_settings.metadata = {'url': '/users/{user-id}/settings'}  # type: ignore
  
      def delete_settings(
          self,
          user_id,  # type: str
          if_match=None,  # type: Optional[str]
          **kwargs  # type: Any
      ):
          # type: (...) -> None
          """Delete navigation property settings for users.
  
          Delete navigation property settings for users.
  
          :param user_id: key: id of user.
          :type user_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_settings.metadata['url']  # type: ignore
          path_format_arguments = {
              'user-id': self._serialize.url("user_id", user_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_settings.metadata = {'url': '/users/{user-id}/settings'}  # type: ignore
  
      def list_transitive_member_of(
          self,
          user_id,  # type: str
          orderby=None,  # type: Optional[List[Union[str, "models.Enum102"]]]
          select=None,  # type: Optional[List[Union[str, "models.Enum103"]]]
          expand=None,  # type: Optional[List[str]]
          **kwargs  # type: Any
      ):
          # type: (...) -> Iterable["models.CollectionOfDirectoryObject5"]
          """Get transitiveMemberOf from users.
  
          Get transitiveMemberOf from users.
  
          :param user_id: key: id of user.
          :type user_id: str
          :param orderby: Order items by property values.
          :type orderby: list[str or ~users.models.Enum102]
          :param select: Select properties to be returned.
          :type select: list[str or ~users.models.Enum103]
          :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 CollectionOfDirectoryObject5 or the result of cls(response)
          :rtype: ~azure.core.paging.ItemPaged[~users.models.CollectionOfDirectoryObject5]
          :raises: ~azure.core.exceptions.HttpResponseError
          """
          cls = kwargs.pop('cls', None)  # type: ClsType["models.CollectionOfDirectoryObject5"]
          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_transitive_member_of.metadata['url']  # type: ignore
                  path_format_arguments = {
                      'user-id': self._serialize.url("user_id", user_id, 'str'),
                  }
                  url = self._client.format_url(url, **path_format_arguments)
                  # 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('CollectionOfDirectoryObject5', 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_transitive_member_of.metadata = {'url': '/users/{user-id}/transitiveMemberOf'}  # type: ignore
  
      def list_ref_transitive_member_of(
          self,
          user_id,  # type: str
          orderby=None,  # type: Optional[List[Union[str, "models.Enum104"]]]
          **kwargs  # type: Any
      ):
          # type: (...) -> Iterable["models.CollectionOfLinksOfDirectoryObject5"]
          """Get ref of transitiveMemberOf from users.
  
          Get ref of transitiveMemberOf from users.
  
          :param user_id: key: id of user.
          :type user_id: str
          :param orderby: Order items by property values.
          :type orderby: list[str or ~users.models.Enum104]
          :keyword callable cls: A custom type or function that will be passed the direct response
          :return: An iterator like instance of either CollectionOfLinksOfDirectoryObject5 or the result of cls(response)
          :rtype: ~azure.core.paging.ItemPaged[~users.models.CollectionOfLinksOfDirectoryObject5]
          :raises: ~azure.core.exceptions.HttpResponseError
          """
          cls = kwargs.pop('cls', None)  # type: ClsType["models.CollectionOfLinksOfDirectoryObject5"]
          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_ref_transitive_member_of.metadata['url']  # type: ignore
                  path_format_arguments = {
                      'user-id': self._serialize.url("user_id", user_id, 'str'),
                  }
                  url = self._client.format_url(url, **path_format_arguments)
                  # 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=',')
  
                  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('CollectionOfLinksOfDirectoryObject5', 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_ref_transitive_member_of.metadata = {'url': '/users/{user-id}/transitiveMemberOf/$ref'}  # type: ignore
  
      def create_ref_transitive_member_of(
          self,
          user_id,  # type: str
          body,  # type: Dict[str, object]
          **kwargs  # type: Any
      ):
          # type: (...) -> Dict[str, object]
          """Create new navigation property ref to transitiveMemberOf for users.
  
          Create new navigation property ref to transitiveMemberOf for users.
  
          :param user_id: key: id of user.
          :type user_id: str
          :param body: New navigation property ref value.
          :type body: dict[str, object]
          :keyword callable cls: A custom type or function that will be passed the direct response
          :return: dict mapping str to object, or the result of cls(response)
          :rtype: dict[str, object]
          :raises: ~azure.core.exceptions.HttpResponseError
          """
          cls = kwargs.pop('cls', None)  # type: ClsType[Dict[str, object]]
          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_ref_transitive_member_of.metadata['url']  # type: ignore
          path_format_arguments = {
              'user-id': self._serialize.url("user_id", user_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, '{object}')
          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('{object}', pipeline_response)
  
          if cls:
              return cls(pipeline_response, deserialized, {})
  
          return deserialized
      create_ref_transitive_member_of.metadata = {'url': '/users/{user-id}/transitiveMemberOf/$ref'}  # type: ignore
  