# pylint: disable=too-many-lines
# 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.
# --------------------------------------------------------------------------
import sys
from typing import Any, Callable, Dict, Optional, TypeVar, Union

from azure.core.exceptions import (
    ClientAuthenticationError,
    HttpResponseError,
    ResourceExistsError,
    ResourceNotFoundError,
    ResourceNotModifiedError,
    map_error,
)
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import HttpResponse
from azure.core.rest import HttpRequest
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict

from .. import models as _models
from .._serialization import Serializer
from .._vendor import _convert_request

if sys.version_info >= (3, 8):
    from typing import Literal  # pylint: disable=no-name-in-module, ungrouped-imports
else:
    from typing_extensions import Literal  # type: ignore  # pylint: disable=ungrouped-imports
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]

_SERIALIZER = Serializer()
_SERIALIZER.client_side_validation = False


def build_put_no_model_as_string_no_required_two_value_no_default_request(  # pylint: disable=name-too-long
    *, input: Optional[Union[str, _models.NoModelAsStringNoRequiredTwoValueNoDefaultOpEnum]] = None, **kwargs: Any
) -> HttpRequest:
    _params = case_insensitive_dict(kwargs.pop("params", {}) or {})

    # Construct URL
    _url = kwargs.pop("template_url", "/constants/putNoModelAsStringNoRequiredTwoValueNoDefault")

    # Construct parameters
    if input is not None:
        _params["input"] = _SERIALIZER.query("input", input, "str")

    return HttpRequest(method="PUT", url=_url, params=_params, **kwargs)


def build_put_no_model_as_string_no_required_two_value_default_request(  # pylint: disable=name-too-long
    *, input: Union[str, _models.NoModelAsStringNoRequiredTwoValueDefaultOpEnum] = "value1", **kwargs: Any
) -> HttpRequest:
    _params = case_insensitive_dict(kwargs.pop("params", {}) or {})

    # Construct URL
    _url = kwargs.pop("template_url", "/constants/putNoModelAsStringNoRequiredTwoValueDefault")

    # Construct parameters
    if input is not None:
        _params["input"] = _SERIALIZER.query("input", input, "str")

    return HttpRequest(method="PUT", url=_url, params=_params, **kwargs)


def build_put_no_model_as_string_no_required_one_value_no_default_request(  # pylint: disable=name-too-long
    *, input: Literal["value1"] = "value1", **kwargs: Any
) -> HttpRequest:
    _params = case_insensitive_dict(kwargs.pop("params", {}) or {})

    # Construct URL
    _url = kwargs.pop("template_url", "/constants/putNoModelAsStringNoRequiredOneValueNoDefault")

    # Construct parameters
    if input is not None:
        _params["input"] = _SERIALIZER.query("input", input, "str")

    return HttpRequest(method="PUT", url=_url, params=_params, **kwargs)


def build_put_no_model_as_string_no_required_one_value_default_request(  # pylint: disable=name-too-long
    *, input: Literal["value1"] = "value1", **kwargs: Any
) -> HttpRequest:
    _params = case_insensitive_dict(kwargs.pop("params", {}) or {})

    # Construct URL
    _url = kwargs.pop("template_url", "/constants/putNoModelAsStringNoRequiredOneValueDefault")

    # Construct parameters
    if input is not None:
        _params["input"] = _SERIALIZER.query("input", input, "str")

    return HttpRequest(method="PUT", url=_url, params=_params, **kwargs)


def build_put_no_model_as_string_required_two_value_no_default_request(  # pylint: disable=name-too-long
    *, input: Union[str, _models.NoModelAsStringRequiredTwoValueNoDefaultOpEnum], **kwargs: Any
) -> HttpRequest:
    _params = case_insensitive_dict(kwargs.pop("params", {}) or {})

    # Construct URL
    _url = kwargs.pop("template_url", "/constants/putNoModelAsStringRequiredTwoValueNoDefault")

    # Construct parameters
    _params["input"] = _SERIALIZER.query("input", input, "str")

    return HttpRequest(method="PUT", url=_url, params=_params, **kwargs)


def build_put_no_model_as_string_required_two_value_default_request(  # pylint: disable=name-too-long
    *, input: Union[str, _models.NoModelAsStringRequiredTwoValueDefaultOpEnum] = "value1", **kwargs: Any
) -> HttpRequest:
    _params = case_insensitive_dict(kwargs.pop("params", {}) or {})

    # Construct URL
    _url = kwargs.pop("template_url", "/constants/putNoModelAsStringRequiredTwoValueDefault")

    # Construct parameters
    _params["input"] = _SERIALIZER.query("input", input, "str")

    return HttpRequest(method="PUT", url=_url, params=_params, **kwargs)


def build_put_no_model_as_string_required_one_value_no_default_request(  # pylint: disable=name-too-long
    **kwargs: Any,
) -> HttpRequest:
    _params = case_insensitive_dict(kwargs.pop("params", {}) or {})

    input: Literal["value1"] = kwargs.pop("input", _params.pop("input", "value1"))
    # Construct URL
    _url = kwargs.pop("template_url", "/constants/putNoModelAsStringRequiredOneValueNoDefault")

    # Construct parameters
    _params["input"] = _SERIALIZER.query("input", input, "str")

    return HttpRequest(method="PUT", url=_url, params=_params, **kwargs)


def build_put_no_model_as_string_required_one_value_default_request(  # pylint: disable=name-too-long
    **kwargs: Any,
) -> HttpRequest:
    _params = case_insensitive_dict(kwargs.pop("params", {}) or {})

    input: Literal["value1"] = kwargs.pop("input", _params.pop("input", "value1"))
    # Construct URL
    _url = kwargs.pop("template_url", "/constants/putNoModelAsStringRequiredOneValueDefault")

    # Construct parameters
    _params["input"] = _SERIALIZER.query("input", input, "str")

    return HttpRequest(method="PUT", url=_url, params=_params, **kwargs)


def build_put_model_as_string_no_required_two_value_no_default_request(  # pylint: disable=name-too-long
    *, input: Optional[Union[str, _models.ModelAsStringNoRequiredTwoValueNoDefaultOpEnum]] = None, **kwargs: Any
) -> HttpRequest:
    _params = case_insensitive_dict(kwargs.pop("params", {}) or {})

    # Construct URL
    _url = kwargs.pop("template_url", "/constants/putModelAsStringNoRequiredTwoValueNoDefault")

    # Construct parameters
    if input is not None:
        _params["input"] = _SERIALIZER.query("input", input, "str")

    return HttpRequest(method="PUT", url=_url, params=_params, **kwargs)


def build_put_model_as_string_no_required_two_value_default_request(  # pylint: disable=name-too-long
    *, input: Union[str, _models.ModelAsStringNoRequiredTwoValueDefaultOpEnum] = "value1", **kwargs: Any
) -> HttpRequest:
    _params = case_insensitive_dict(kwargs.pop("params", {}) or {})

    # Construct URL
    _url = kwargs.pop("template_url", "/constants/putModelAsStringNoRequiredTwoValueDefault")

    # Construct parameters
    if input is not None:
        _params["input"] = _SERIALIZER.query("input", input, "str")

    return HttpRequest(method="PUT", url=_url, params=_params, **kwargs)


def build_put_model_as_string_no_required_one_value_no_default_request(  # pylint: disable=name-too-long
    *, input: Optional[Union[str, _models.ModelAsStringNoRequiredOneValueNoDefaultOpEnum]] = None, **kwargs: Any
) -> HttpRequest:
    _params = case_insensitive_dict(kwargs.pop("params", {}) or {})

    # Construct URL
    _url = kwargs.pop("template_url", "/constants/putModelAsStringNoRequiredOneValueNoDefault")

    # Construct parameters
    if input is not None:
        _params["input"] = _SERIALIZER.query("input", input, "str")

    return HttpRequest(method="PUT", url=_url, params=_params, **kwargs)


def build_put_model_as_string_no_required_one_value_default_request(  # pylint: disable=name-too-long
    *, input: Union[str, _models.ModelAsStringNoRequiredOneValueDefaultOpEnum] = "value1", **kwargs: Any
) -> HttpRequest:
    _params = case_insensitive_dict(kwargs.pop("params", {}) or {})

    # Construct URL
    _url = kwargs.pop("template_url", "/constants/putModelAsStringNoRequiredOneValueDefault")

    # Construct parameters
    if input is not None:
        _params["input"] = _SERIALIZER.query("input", input, "str")

    return HttpRequest(method="PUT", url=_url, params=_params, **kwargs)


def build_put_model_as_string_required_two_value_no_default_request(  # pylint: disable=name-too-long
    *, input: Union[str, _models.ModelAsStringRequiredTwoValueNoDefaultOpEnum], **kwargs: Any
) -> HttpRequest:
    _params = case_insensitive_dict(kwargs.pop("params", {}) or {})

    # Construct URL
    _url = kwargs.pop("template_url", "/constants/putModelAsStringRequiredTwoValueNoDefault")

    # Construct parameters
    _params["input"] = _SERIALIZER.query("input", input, "str")

    return HttpRequest(method="PUT", url=_url, params=_params, **kwargs)


def build_put_model_as_string_required_two_value_default_request(  # pylint: disable=name-too-long
    *, input: Union[str, _models.ModelAsStringRequiredTwoValueDefaultOpEnum] = "value1", **kwargs: Any
) -> HttpRequest:
    _params = case_insensitive_dict(kwargs.pop("params", {}) or {})

    # Construct URL
    _url = kwargs.pop("template_url", "/constants/putModelAsStringRequiredTwoValueDefault")

    # Construct parameters
    _params["input"] = _SERIALIZER.query("input", input, "str")

    return HttpRequest(method="PUT", url=_url, params=_params, **kwargs)


def build_put_model_as_string_required_one_value_no_default_request(  # pylint: disable=name-too-long
    *, input: Union[str, _models.ModelAsStringRequiredOneValueNoDefaultOpEnum], **kwargs: Any
) -> HttpRequest:
    _params = case_insensitive_dict(kwargs.pop("params", {}) or {})

    # Construct URL
    _url = kwargs.pop("template_url", "/constants/putModelAsStringRequiredOneValueNoDefault")

    # Construct parameters
    _params["input"] = _SERIALIZER.query("input", input, "str")

    return HttpRequest(method="PUT", url=_url, params=_params, **kwargs)


def build_put_model_as_string_required_one_value_default_request(  # pylint: disable=name-too-long
    *, input: Union[str, _models.ModelAsStringRequiredOneValueDefaultOpEnum] = "value1", **kwargs: Any
) -> HttpRequest:
    _params = case_insensitive_dict(kwargs.pop("params", {}) or {})

    # Construct URL
    _url = kwargs.pop("template_url", "/constants/putModelAsStringRequiredOneValueDefault")

    # Construct parameters
    _params["input"] = _SERIALIZER.query("input", input, "str")

    return HttpRequest(method="PUT", url=_url, params=_params, **kwargs)


def build_put_client_constants_request(**kwargs: Any) -> HttpRequest:
    _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
    _params = case_insensitive_dict(kwargs.pop("params", {}) or {})

    header_constant: Literal[True] = kwargs.pop("header_constant", _headers.pop("header-constant", True))
    query_constant: Literal[100] = kwargs.pop("query_constant", _params.pop("query-constant", 100))
    path_constant: Literal["path"] = kwargs.pop("path_constant", "path")
    # Construct URL
    _url = kwargs.pop("template_url", "/constants/clientConstants/{path-constant}")
    path_format_arguments = {
        "path-constant": _SERIALIZER.url("path_constant", path_constant, "str"),
    }

    _url: str = _url.format(**path_format_arguments)  # type: ignore

    # Construct parameters
    _params["query-constant"] = _SERIALIZER.query("query_constant", query_constant, "int")

    # Construct headers
    _headers["header-constant"] = _SERIALIZER.header("header_constant", header_constant, "bool")

    return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs)


class ContantsOperations:
    """
    .. warning::
        **DO NOT** instantiate this class directly.

        Instead, you should access the following operations through
        :class:`~constants.AutoRestSwaggerConstantService`'s
        :attr:`contants` attribute.
    """

    models = _models

    def __init__(self, *args, **kwargs):
        input_args = list(args)
        self._client = input_args.pop(0) if input_args else kwargs.pop("client")
        self._config = input_args.pop(0) if input_args else kwargs.pop("config")
        self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
        self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")

    @distributed_trace
    def put_no_model_as_string_no_required_two_value_no_default(  # pylint: disable=inconsistent-return-statements,name-too-long
        self,
        input: Optional[Union[str, _models.NoModelAsStringNoRequiredTwoValueNoDefaultOpEnum]] = None,
        **kwargs: Any,
    ) -> None:
        """Puts constants to the testserver.

        Puts constants to the testserver.

        :param input: Known values are: "value1" and "value2". Default value is None.
        :type input: str or ~constants.models.NoModelAsStringNoRequiredTwoValueNoDefaultOpEnum
        :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:
        """
        error_map = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

        _headers = kwargs.pop("headers", {}) or {}
        _params = kwargs.pop("params", {}) or {}

        cls: ClsType[None] = kwargs.pop("cls", None)

        request = build_put_no_model_as_string_no_required_two_value_no_default_request(
            input=input,
            template_url=self.put_no_model_as_string_no_required_two_value_no_default.metadata["url"],
            headers=_headers,
            params=_params,
        )
        request = _convert_request(request)
        request.url = self._client.format_url(request.url)

        _stream = False
        pipeline_response: PipelineResponse = self._client._pipeline.run(  # pylint: disable=protected-access
            request, stream=_stream, **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)
            raise HttpResponseError(response=response)

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

    put_no_model_as_string_no_required_two_value_no_default.metadata = {
        "url": "/constants/putNoModelAsStringNoRequiredTwoValueNoDefault"
    }

    @distributed_trace
    def put_no_model_as_string_no_required_two_value_default(  # pylint: disable=inconsistent-return-statements,name-too-long
        self, input: Union[str, _models.NoModelAsStringNoRequiredTwoValueDefaultOpEnum] = "value1", **kwargs: Any
    ) -> None:
        """Puts constants to the testserver.

        Puts constants to the testserver.

        :param input: Known values are: "value1" and "value2". Default value is "value1".
        :type input: str or ~constants.models.NoModelAsStringNoRequiredTwoValueDefaultOpEnum
        :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:
        """
        error_map = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

        _headers = kwargs.pop("headers", {}) or {}
        _params = kwargs.pop("params", {}) or {}

        cls: ClsType[None] = kwargs.pop("cls", None)

        request = build_put_no_model_as_string_no_required_two_value_default_request(
            input=input,
            template_url=self.put_no_model_as_string_no_required_two_value_default.metadata["url"],
            headers=_headers,
            params=_params,
        )
        request = _convert_request(request)
        request.url = self._client.format_url(request.url)

        _stream = False
        pipeline_response: PipelineResponse = self._client._pipeline.run(  # pylint: disable=protected-access
            request, stream=_stream, **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)
            raise HttpResponseError(response=response)

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

    put_no_model_as_string_no_required_two_value_default.metadata = {
        "url": "/constants/putNoModelAsStringNoRequiredTwoValueDefault"
    }

    @distributed_trace
    def put_no_model_as_string_no_required_one_value_no_default(  # pylint: disable=inconsistent-return-statements,name-too-long
        self, input: Literal["value1"] = "value1", **kwargs: Any
    ) -> None:
        """Puts constants to the testserver.

        Puts constants to the testserver.

        :param input: Known values are "value1" and None. Default value is "value1".
        :type input: 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:
        """
        error_map = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

        _headers = kwargs.pop("headers", {}) or {}
        _params = kwargs.pop("params", {}) or {}

        cls: ClsType[None] = kwargs.pop("cls", None)

        request = build_put_no_model_as_string_no_required_one_value_no_default_request(
            input=input,
            template_url=self.put_no_model_as_string_no_required_one_value_no_default.metadata["url"],
            headers=_headers,
            params=_params,
        )
        request = _convert_request(request)
        request.url = self._client.format_url(request.url)

        _stream = False
        pipeline_response: PipelineResponse = self._client._pipeline.run(  # pylint: disable=protected-access
            request, stream=_stream, **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)
            raise HttpResponseError(response=response)

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

    put_no_model_as_string_no_required_one_value_no_default.metadata = {
        "url": "/constants/putNoModelAsStringNoRequiredOneValueNoDefault"
    }

    @distributed_trace
    def put_no_model_as_string_no_required_one_value_default(  # pylint: disable=inconsistent-return-statements,name-too-long
        self, input: Literal["value1"] = "value1", **kwargs: Any
    ) -> None:
        """Puts constants to the testserver.

        Puts constants to the testserver.

        :param input: Known values are "value1" and None. Default value is "value1".
        :type input: 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:
        """
        error_map = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

        _headers = kwargs.pop("headers", {}) or {}
        _params = kwargs.pop("params", {}) or {}

        cls: ClsType[None] = kwargs.pop("cls", None)

        request = build_put_no_model_as_string_no_required_one_value_default_request(
            input=input,
            template_url=self.put_no_model_as_string_no_required_one_value_default.metadata["url"],
            headers=_headers,
            params=_params,
        )
        request = _convert_request(request)
        request.url = self._client.format_url(request.url)

        _stream = False
        pipeline_response: PipelineResponse = self._client._pipeline.run(  # pylint: disable=protected-access
            request, stream=_stream, **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)
            raise HttpResponseError(response=response)

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

    put_no_model_as_string_no_required_one_value_default.metadata = {
        "url": "/constants/putNoModelAsStringNoRequiredOneValueDefault"
    }

    @distributed_trace
    def put_no_model_as_string_required_two_value_no_default(  # pylint: disable=inconsistent-return-statements,name-too-long
        self, input: Union[str, _models.NoModelAsStringRequiredTwoValueNoDefaultOpEnum], **kwargs: Any
    ) -> None:
        """Puts constants to the testserver.

        Puts constants to the testserver.

        :param input: Known values are: "value1" and "value2". Required.
        :type input: str or ~constants.models.NoModelAsStringRequiredTwoValueNoDefaultOpEnum
        :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:
        """
        error_map = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

        _headers = kwargs.pop("headers", {}) or {}
        _params = kwargs.pop("params", {}) or {}

        cls: ClsType[None] = kwargs.pop("cls", None)

        request = build_put_no_model_as_string_required_two_value_no_default_request(
            input=input,
            template_url=self.put_no_model_as_string_required_two_value_no_default.metadata["url"],
            headers=_headers,
            params=_params,
        )
        request = _convert_request(request)
        request.url = self._client.format_url(request.url)

        _stream = False
        pipeline_response: PipelineResponse = self._client._pipeline.run(  # pylint: disable=protected-access
            request, stream=_stream, **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)
            raise HttpResponseError(response=response)

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

    put_no_model_as_string_required_two_value_no_default.metadata = {
        "url": "/constants/putNoModelAsStringRequiredTwoValueNoDefault"
    }

    @distributed_trace
    def put_no_model_as_string_required_two_value_default(  # pylint: disable=inconsistent-return-statements,name-too-long
        self, input: Union[str, _models.NoModelAsStringRequiredTwoValueDefaultOpEnum] = "value1", **kwargs: Any
    ) -> None:
        """Puts constants to the testserver.

        Puts constants to the testserver.

        :param input: Known values are: "value1" and "value2". Default value is "value1".
        :type input: str or ~constants.models.NoModelAsStringRequiredTwoValueDefaultOpEnum
        :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:
        """
        error_map = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

        _headers = kwargs.pop("headers", {}) or {}
        _params = kwargs.pop("params", {}) or {}

        cls: ClsType[None] = kwargs.pop("cls", None)

        request = build_put_no_model_as_string_required_two_value_default_request(
            input=input,
            template_url=self.put_no_model_as_string_required_two_value_default.metadata["url"],
            headers=_headers,
            params=_params,
        )
        request = _convert_request(request)
        request.url = self._client.format_url(request.url)

        _stream = False
        pipeline_response: PipelineResponse = self._client._pipeline.run(  # pylint: disable=protected-access
            request, stream=_stream, **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)
            raise HttpResponseError(response=response)

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

    put_no_model_as_string_required_two_value_default.metadata = {
        "url": "/constants/putNoModelAsStringRequiredTwoValueDefault"
    }

    @distributed_trace
    def put_no_model_as_string_required_one_value_no_default(  # pylint: disable=inconsistent-return-statements,name-too-long
        self, **kwargs: Any
    ) -> None:
        """Puts constants to the testserver.

        Puts constants to the testserver.

        :keyword input: Default value is "value1". Note that overriding this default value may result
         in unsupported behavior.
        :paramtype input: 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:
        """
        error_map = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

        _headers = kwargs.pop("headers", {}) or {}
        _params = case_insensitive_dict(kwargs.pop("params", {}) or {})

        input: Literal["value1"] = kwargs.pop("input", _params.pop("input", "value1"))
        cls: ClsType[None] = kwargs.pop("cls", None)

        request = build_put_no_model_as_string_required_one_value_no_default_request(
            input=input,
            template_url=self.put_no_model_as_string_required_one_value_no_default.metadata["url"],
            headers=_headers,
            params=_params,
        )
        request = _convert_request(request)
        request.url = self._client.format_url(request.url)

        _stream = False
        pipeline_response: PipelineResponse = self._client._pipeline.run(  # pylint: disable=protected-access
            request, stream=_stream, **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)
            raise HttpResponseError(response=response)

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

    put_no_model_as_string_required_one_value_no_default.metadata = {
        "url": "/constants/putNoModelAsStringRequiredOneValueNoDefault"
    }

    @distributed_trace
    def put_no_model_as_string_required_one_value_default(  # pylint: disable=inconsistent-return-statements,name-too-long
        self, **kwargs: Any
    ) -> None:
        """Puts constants to the testserver.

        Puts constants to the testserver.

        :keyword input: Default value is "value1". Note that overriding this default value may result
         in unsupported behavior.
        :paramtype input: 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:
        """
        error_map = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

        _headers = kwargs.pop("headers", {}) or {}
        _params = case_insensitive_dict(kwargs.pop("params", {}) or {})

        input: Literal["value1"] = kwargs.pop("input", _params.pop("input", "value1"))
        cls: ClsType[None] = kwargs.pop("cls", None)

        request = build_put_no_model_as_string_required_one_value_default_request(
            input=input,
            template_url=self.put_no_model_as_string_required_one_value_default.metadata["url"],
            headers=_headers,
            params=_params,
        )
        request = _convert_request(request)
        request.url = self._client.format_url(request.url)

        _stream = False
        pipeline_response: PipelineResponse = self._client._pipeline.run(  # pylint: disable=protected-access
            request, stream=_stream, **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)
            raise HttpResponseError(response=response)

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

    put_no_model_as_string_required_one_value_default.metadata = {
        "url": "/constants/putNoModelAsStringRequiredOneValueDefault"
    }

    @distributed_trace
    def put_model_as_string_no_required_two_value_no_default(  # pylint: disable=inconsistent-return-statements,name-too-long
        self, input: Optional[Union[str, _models.ModelAsStringNoRequiredTwoValueNoDefaultOpEnum]] = None, **kwargs: Any
    ) -> None:
        """Puts constants to the testserver.

        Puts constants to the testserver.

        :param input: Known values are: "value1" and "value2". Default value is None.
        :type input: str or ~constants.models.ModelAsStringNoRequiredTwoValueNoDefaultOpEnum
        :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:
        """
        error_map = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

        _headers = kwargs.pop("headers", {}) or {}
        _params = kwargs.pop("params", {}) or {}

        cls: ClsType[None] = kwargs.pop("cls", None)

        request = build_put_model_as_string_no_required_two_value_no_default_request(
            input=input,
            template_url=self.put_model_as_string_no_required_two_value_no_default.metadata["url"],
            headers=_headers,
            params=_params,
        )
        request = _convert_request(request)
        request.url = self._client.format_url(request.url)

        _stream = False
        pipeline_response: PipelineResponse = self._client._pipeline.run(  # pylint: disable=protected-access
            request, stream=_stream, **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)
            raise HttpResponseError(response=response)

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

    put_model_as_string_no_required_two_value_no_default.metadata = {
        "url": "/constants/putModelAsStringNoRequiredTwoValueNoDefault"
    }

    @distributed_trace
    def put_model_as_string_no_required_two_value_default(  # pylint: disable=inconsistent-return-statements,name-too-long
        self, input: Union[str, _models.ModelAsStringNoRequiredTwoValueDefaultOpEnum] = "value1", **kwargs: Any
    ) -> None:
        """Puts constants to the testserver.

        Puts constants to the testserver.

        :param input: Known values are: "value1" and "value2". Default value is "value1".
        :type input: str or ~constants.models.ModelAsStringNoRequiredTwoValueDefaultOpEnum
        :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:
        """
        error_map = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

        _headers = kwargs.pop("headers", {}) or {}
        _params = kwargs.pop("params", {}) or {}

        cls: ClsType[None] = kwargs.pop("cls", None)

        request = build_put_model_as_string_no_required_two_value_default_request(
            input=input,
            template_url=self.put_model_as_string_no_required_two_value_default.metadata["url"],
            headers=_headers,
            params=_params,
        )
        request = _convert_request(request)
        request.url = self._client.format_url(request.url)

        _stream = False
        pipeline_response: PipelineResponse = self._client._pipeline.run(  # pylint: disable=protected-access
            request, stream=_stream, **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)
            raise HttpResponseError(response=response)

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

    put_model_as_string_no_required_two_value_default.metadata = {
        "url": "/constants/putModelAsStringNoRequiredTwoValueDefault"
    }

    @distributed_trace
    def put_model_as_string_no_required_one_value_no_default(  # pylint: disable=inconsistent-return-statements,name-too-long
        self, input: Optional[Union[str, _models.ModelAsStringNoRequiredOneValueNoDefaultOpEnum]] = None, **kwargs: Any
    ) -> None:
        """Puts constants to the testserver.

        Puts constants to the testserver.

        :param input: "value1" Default value is None.
        :type input: str or ~constants.models.ModelAsStringNoRequiredOneValueNoDefaultOpEnum
        :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:
        """
        error_map = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

        _headers = kwargs.pop("headers", {}) or {}
        _params = kwargs.pop("params", {}) or {}

        cls: ClsType[None] = kwargs.pop("cls", None)

        request = build_put_model_as_string_no_required_one_value_no_default_request(
            input=input,
            template_url=self.put_model_as_string_no_required_one_value_no_default.metadata["url"],
            headers=_headers,
            params=_params,
        )
        request = _convert_request(request)
        request.url = self._client.format_url(request.url)

        _stream = False
        pipeline_response: PipelineResponse = self._client._pipeline.run(  # pylint: disable=protected-access
            request, stream=_stream, **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)
            raise HttpResponseError(response=response)

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

    put_model_as_string_no_required_one_value_no_default.metadata = {
        "url": "/constants/putModelAsStringNoRequiredOneValueNoDefault"
    }

    @distributed_trace
    def put_model_as_string_no_required_one_value_default(  # pylint: disable=inconsistent-return-statements,name-too-long
        self, input: Union[str, _models.ModelAsStringNoRequiredOneValueDefaultOpEnum] = "value1", **kwargs: Any
    ) -> None:
        """Puts constants to the testserver.

        Puts constants to the testserver.

        :param input: "value1" Default value is "value1".
        :type input: str or ~constants.models.ModelAsStringNoRequiredOneValueDefaultOpEnum
        :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:
        """
        error_map = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

        _headers = kwargs.pop("headers", {}) or {}
        _params = kwargs.pop("params", {}) or {}

        cls: ClsType[None] = kwargs.pop("cls", None)

        request = build_put_model_as_string_no_required_one_value_default_request(
            input=input,
            template_url=self.put_model_as_string_no_required_one_value_default.metadata["url"],
            headers=_headers,
            params=_params,
        )
        request = _convert_request(request)
        request.url = self._client.format_url(request.url)

        _stream = False
        pipeline_response: PipelineResponse = self._client._pipeline.run(  # pylint: disable=protected-access
            request, stream=_stream, **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)
            raise HttpResponseError(response=response)

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

    put_model_as_string_no_required_one_value_default.metadata = {
        "url": "/constants/putModelAsStringNoRequiredOneValueDefault"
    }

    @distributed_trace
    def put_model_as_string_required_two_value_no_default(  # pylint: disable=inconsistent-return-statements,name-too-long
        self, input: Union[str, _models.ModelAsStringRequiredTwoValueNoDefaultOpEnum], **kwargs: Any
    ) -> None:
        """Puts constants to the testserver.

        Puts constants to the testserver.

        :param input: Known values are: "value1" and "value2". Required.
        :type input: str or ~constants.models.ModelAsStringRequiredTwoValueNoDefaultOpEnum
        :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:
        """
        error_map = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

        _headers = kwargs.pop("headers", {}) or {}
        _params = kwargs.pop("params", {}) or {}

        cls: ClsType[None] = kwargs.pop("cls", None)

        request = build_put_model_as_string_required_two_value_no_default_request(
            input=input,
            template_url=self.put_model_as_string_required_two_value_no_default.metadata["url"],
            headers=_headers,
            params=_params,
        )
        request = _convert_request(request)
        request.url = self._client.format_url(request.url)

        _stream = False
        pipeline_response: PipelineResponse = self._client._pipeline.run(  # pylint: disable=protected-access
            request, stream=_stream, **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)
            raise HttpResponseError(response=response)

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

    put_model_as_string_required_two_value_no_default.metadata = {
        "url": "/constants/putModelAsStringRequiredTwoValueNoDefault"
    }

    @distributed_trace
    def put_model_as_string_required_two_value_default(  # pylint: disable=inconsistent-return-statements,name-too-long
        self, input: Union[str, _models.ModelAsStringRequiredTwoValueDefaultOpEnum] = "value1", **kwargs: Any
    ) -> None:
        """Puts constants to the testserver.

        Puts constants to the testserver.

        :param input: Known values are: "value1" and "value2". Default value is "value1".
        :type input: str or ~constants.models.ModelAsStringRequiredTwoValueDefaultOpEnum
        :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:
        """
        error_map = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

        _headers = kwargs.pop("headers", {}) or {}
        _params = kwargs.pop("params", {}) or {}

        cls: ClsType[None] = kwargs.pop("cls", None)

        request = build_put_model_as_string_required_two_value_default_request(
            input=input,
            template_url=self.put_model_as_string_required_two_value_default.metadata["url"],
            headers=_headers,
            params=_params,
        )
        request = _convert_request(request)
        request.url = self._client.format_url(request.url)

        _stream = False
        pipeline_response: PipelineResponse = self._client._pipeline.run(  # pylint: disable=protected-access
            request, stream=_stream, **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)
            raise HttpResponseError(response=response)

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

    put_model_as_string_required_two_value_default.metadata = {
        "url": "/constants/putModelAsStringRequiredTwoValueDefault"
    }

    @distributed_trace
    def put_model_as_string_required_one_value_no_default(  # pylint: disable=inconsistent-return-statements,name-too-long
        self, input: Union[str, _models.ModelAsStringRequiredOneValueNoDefaultOpEnum], **kwargs: Any
    ) -> None:
        """Puts constants to the testserver.

        Puts constants to the testserver.

        :param input: "value1" Required.
        :type input: str or ~constants.models.ModelAsStringRequiredOneValueNoDefaultOpEnum
        :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:
        """
        error_map = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

        _headers = kwargs.pop("headers", {}) or {}
        _params = kwargs.pop("params", {}) or {}

        cls: ClsType[None] = kwargs.pop("cls", None)

        request = build_put_model_as_string_required_one_value_no_default_request(
            input=input,
            template_url=self.put_model_as_string_required_one_value_no_default.metadata["url"],
            headers=_headers,
            params=_params,
        )
        request = _convert_request(request)
        request.url = self._client.format_url(request.url)

        _stream = False
        pipeline_response: PipelineResponse = self._client._pipeline.run(  # pylint: disable=protected-access
            request, stream=_stream, **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)
            raise HttpResponseError(response=response)

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

    put_model_as_string_required_one_value_no_default.metadata = {
        "url": "/constants/putModelAsStringRequiredOneValueNoDefault"
    }

    @distributed_trace
    def put_model_as_string_required_one_value_default(  # pylint: disable=inconsistent-return-statements,name-too-long
        self, input: Union[str, _models.ModelAsStringRequiredOneValueDefaultOpEnum] = "value1", **kwargs: Any
    ) -> None:
        """Puts constants to the testserver.

        Puts constants to the testserver.

        :param input: "value1" Default value is "value1".
        :type input: str or ~constants.models.ModelAsStringRequiredOneValueDefaultOpEnum
        :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:
        """
        error_map = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

        _headers = kwargs.pop("headers", {}) or {}
        _params = kwargs.pop("params", {}) or {}

        cls: ClsType[None] = kwargs.pop("cls", None)

        request = build_put_model_as_string_required_one_value_default_request(
            input=input,
            template_url=self.put_model_as_string_required_one_value_default.metadata["url"],
            headers=_headers,
            params=_params,
        )
        request = _convert_request(request)
        request.url = self._client.format_url(request.url)

        _stream = False
        pipeline_response: PipelineResponse = self._client._pipeline.run(  # pylint: disable=protected-access
            request, stream=_stream, **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)
            raise HttpResponseError(response=response)

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

    put_model_as_string_required_one_value_default.metadata = {
        "url": "/constants/putModelAsStringRequiredOneValueDefault"
    }

    @distributed_trace
    def put_client_constants(self, **kwargs: Any) -> None:  # pylint: disable=inconsistent-return-statements
        """Pass constants from the client to this function. Will pass in constant path, query, and header
        parameters.

        :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:
        """
        error_map = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

        _headers = kwargs.pop("headers", {}) or {}
        _params = kwargs.pop("params", {}) or {}

        cls: ClsType[None] = kwargs.pop("cls", None)

        request = build_put_client_constants_request(
            header_constant=self._config.header_constant,
            query_constant=self._config.query_constant,
            path_constant=self._config.path_constant,
            template_url=self.put_client_constants.metadata["url"],
            headers=_headers,
            params=_params,
        )
        request = _convert_request(request)
        request.url = self._client.format_url(request.url)

        _stream = False
        pipeline_response: PipelineResponse = self._client._pipeline.run(  # pylint: disable=protected-access
            request, stream=_stream, **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)
            raise HttpResponseError(response=response)

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

    put_client_constants.metadata = {"url": "/constants/clientConstants/{path-constant}"}
