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
  
  from azure.core.rest import HttpRequest
  from msrest import Serializer
  
  if TYPE_CHECKING:
      # pylint: disable=unused-import,ungrouped-imports
      from typing import Any, IO, Optional, Union
  
  _SERIALIZER = Serializer()
  
  # fmt: off
  
  def build_analyze_body_request(
      **kwargs  # type: Any
  ):
      # type: (...) -> HttpRequest
      """Analyze body, that could be different media types.
  
      See https://aka.ms/azsdk/python/protocol/quickstart for how to incorporate this request builder
      into your code flow.
  
      :keyword json: Pass in a JSON-serializable object (usually a dictionary). See the template in
       our example to find the input shape. Input parameter.
      :paramtype json: any
      :keyword content: Pass in binary content you want in the body of the request (typically bytes,
       a byte iterator, or stream input). Input parameter.
      :paramtype content: any
      :keyword str content_type: Media type of the body sent to the API. Default value is
       "application/json". Allowed values are: "application/pdf", "image/jpeg", "image/png",
       "image/tiff", "application/json."
      :return: Returns an :class:`~azure.core.rest.HttpRequest` that you will pass to the client's
       `send_request` method. See https://aka.ms/azsdk/python/protocol/quickstart for how to
       incorporate this response into your code flow.
      :rtype: ~azure.core.rest.HttpRequest
  
      Example:
          .. code-block:: python
  
              # JSON input template you can fill out and use as your body input.
              json = {
                  "source": "str"  # Optional. File source path.
              }
      """
  
      content_type = kwargs.pop('content_type', None)  # type: Optional[str]
  
      accept = "application/json"
      # Construct URL
      url = kwargs.pop("template_url", '/mediatypes/analyze')
  
      # Construct headers
      header_parameters = kwargs.pop("headers", {})  # type: Dict[str, Any]
      if content_type is not None:
          header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
      header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
  
      return HttpRequest(
          method="POST",
          url=url,
          headers=header_parameters,
          **kwargs
      )
  
  
  def build_analyze_body_no_accept_header_request(
      **kwargs  # type: Any
  ):
      # type: (...) -> HttpRequest
      """Analyze body, that could be different media types. Adds to AnalyzeBody by not having an accept
      type.
  
      See https://aka.ms/azsdk/python/protocol/quickstart for how to incorporate this request builder
      into your code flow.
  
      :keyword json: Pass in a JSON-serializable object (usually a dictionary). See the template in
       our example to find the input shape. Input parameter.
      :paramtype json: any
      :keyword content: Pass in binary content you want in the body of the request (typically bytes,
       a byte iterator, or stream input). Input parameter.
      :paramtype content: any
      :keyword str content_type: Media type of the body sent to the API. Default value is
       "application/json". Allowed values are: "application/pdf", "image/jpeg", "image/png",
       "image/tiff", "application/json."
      :return: Returns an :class:`~azure.core.rest.HttpRequest` that you will pass to the client's
       `send_request` method. See https://aka.ms/azsdk/python/protocol/quickstart for how to
       incorporate this response into your code flow.
      :rtype: ~azure.core.rest.HttpRequest
  
      Example:
          .. code-block:: python
  
              # JSON input template you can fill out and use as your body input.
              json = {
                  "source": "str"  # Optional. File source path.
              }
      """
  
      content_type = kwargs.pop('content_type', None)  # type: Optional[str]
  
      # Construct URL
      url = kwargs.pop("template_url", '/mediatypes/analyzeNoAccept')
  
      # Construct headers
      header_parameters = kwargs.pop("headers", {})  # type: Dict[str, Any]
      if content_type is not None:
          header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
  
      return HttpRequest(
          method="POST",
          url=url,
          headers=header_parameters,
          **kwargs
      )
  
  
  def build_content_type_with_encoding_request(
      **kwargs  # type: Any
  ):
      # type: (...) -> HttpRequest
      """Pass in contentType 'text/plain; encoding=UTF-8' to pass test. Value for input does not matter.
  
      See https://aka.ms/azsdk/python/protocol/quickstart for how to incorporate this request builder
      into your code flow.
  
      :keyword content: Pass in binary content you want in the body of the request (typically bytes,
       a byte iterator, or stream input). Input parameter.
      :paramtype content: any
      :return: Returns an :class:`~azure.core.rest.HttpRequest` that you will pass to the client's
       `send_request` method. See https://aka.ms/azsdk/python/protocol/quickstart for how to
       incorporate this response into your code flow.
      :rtype: ~azure.core.rest.HttpRequest
      """
  
      content_type = kwargs.pop('content_type', None)  # type: Optional[str]
  
      accept = "application/json"
      # Construct URL
      url = kwargs.pop("template_url", '/mediatypes/contentTypeWithEncoding')
  
      # Construct headers
      header_parameters = kwargs.pop("headers", {})  # type: Dict[str, Any]
      if content_type is not None:
          header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str')
      header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str')
  
      return HttpRequest(
          method="POST",
          url=url,
          headers=header_parameters,
          **kwargs
      )
  