    {-
       OpenAPI Petstore

       This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\

       OpenAPI Version: 3.0.0
       OpenAPI Petstore API version: 1.0.0
       Generated by OpenAPI Generator (https://openapi-generator.tech)
    -}

    {-|
    Module : OpenAPIPetstore.API.Fake
    -}

    {-# LANGUAGE FlexibleContexts #-}
    {-# LANGUAGE FlexibleInstances #-}
    {-# LANGUAGE MonoLocalBinds #-}
    {-# LANGUAGE MultiParamTypeClasses #-}
    {-# LANGUAGE OverloadedStrings #-}
    {-# OPTIONS_GHC -fno-warn-name-shadowing -fno-warn-unused-binds -fno-warn-unused-imports #-}

    module OpenAPIPetstore.API.Fake where

    import OpenAPIPetstore.Core
    import OpenAPIPetstore.MimeTypes
    import OpenAPIPetstore.Model as M

    import qualified Data.Aeson as A
    import qualified Data.ByteString as B
    import qualified Data.ByteString.Lazy as BL
    import qualified Data.Data as P (Typeable, TypeRep, typeOf, typeRep)
    import qualified Data.Foldable as P
    import qualified Data.Map as Map
    import qualified Data.Maybe as P
    import qualified Data.Proxy as P (Proxy(..))
    import qualified Data.Set as Set
    import qualified Data.String as P
    import qualified Data.Text as T
    import qualified Data.Text.Encoding as T
    import qualified Data.Text.Lazy as TL
    import qualified Data.Text.Lazy.Encoding as TL
    import qualified Data.Time as TI
    import qualified Network.HTTP.Client.MultipartFormData as NH
    import qualified Network.HTTP.Media as ME
    import qualified Network.HTTP.Types as NH
    import qualified Web.FormUrlEncoded as WH
    import qualified Web.HttpApiData as WH

    import Data.Text (Text)
    import GHC.Base ((<|>))

    import Prelude ((==),(/=),($), (.),(<$>),(<*>),(>>=),Maybe(..),Bool(..),Char,Double,FilePath,Float,Int,Integer,String,fmap,undefined,mempty,maybe,pure,Monad,Applicative,Functor)
    import qualified Prelude as P

    -- * Operations

    -- ** Fake

    -- *** fakeOuterBooleanSerialize

    -- | @POST \/fake\/outer\/boolean@
    --
    -- Test serialization of outer boolean types
    --
    fakeOuterBooleanSerialize
      :: (Consumes FakeOuterBooleanSerialize MimeJSON)
      => Accept accept -- ^ request accept ('MimeType')
      -> OpenAPIPetstoreRequest FakeOuterBooleanSerialize MimeJSON Bool accept
    fakeOuterBooleanSerialize  _ =
      _mkRequest "POST" ["/fake/outer/boolean"]

    data FakeOuterBooleanSerialize

    -- | /Body Param/ "body" - Input boolean as post body
    instance HasBodyParam FakeOuterBooleanSerialize BodyBool

    -- | @application/json@
    instance Consumes FakeOuterBooleanSerialize MimeJSON

    -- | @*/*@
    instance MimeType mtype => Produces FakeOuterBooleanSerialize mtype

    -- *** fakeOuterCompositeSerialize

    -- | @POST \/fake\/outer\/composite@
    --
    -- Test serialization of object with outer number type
    --
    fakeOuterCompositeSerialize
      :: (Consumes FakeOuterCompositeSerialize MimeJSON)
      => Accept accept -- ^ request accept ('MimeType')
      -> OpenAPIPetstoreRequest FakeOuterCompositeSerialize MimeJSON OuterComposite accept
    fakeOuterCompositeSerialize  _ =
      _mkRequest "POST" ["/fake/outer/composite"]

    data FakeOuterCompositeSerialize

    -- | /Body Param/ "OuterComposite" - Input composite as post body
    instance HasBodyParam FakeOuterCompositeSerialize OuterComposite

    -- | @application/json@
    instance Consumes FakeOuterCompositeSerialize MimeJSON

    -- | @*/*@
    instance MimeType mtype => Produces FakeOuterCompositeSerialize mtype

    -- *** fakeOuterNumberSerialize

    -- | @POST \/fake\/outer\/number@
    --
    -- Test serialization of outer number types
    --
    fakeOuterNumberSerialize
      :: (Consumes FakeOuterNumberSerialize MimeJSON)
      => Accept accept -- ^ request accept ('MimeType')
      -> OpenAPIPetstoreRequest FakeOuterNumberSerialize MimeJSON Double accept
    fakeOuterNumberSerialize  _ =
      _mkRequest "POST" ["/fake/outer/number"]

    data FakeOuterNumberSerialize

    -- | /Body Param/ "body" - Input number as post body
    instance HasBodyParam FakeOuterNumberSerialize Body

    -- | @application/json@
    instance Consumes FakeOuterNumberSerialize MimeJSON

    -- | @*/*@
    instance MimeType mtype => Produces FakeOuterNumberSerialize mtype

    -- *** fakeOuterStringSerialize

    -- | @POST \/fake\/outer\/string@
    --
    -- Test serialization of outer string types
    --
    fakeOuterStringSerialize
      :: (Consumes FakeOuterStringSerialize MimeJSON)
      => Accept accept -- ^ request accept ('MimeType')
      -> OpenAPIPetstoreRequest FakeOuterStringSerialize MimeJSON Text accept
    fakeOuterStringSerialize  _ =
      _mkRequest "POST" ["/fake/outer/string"]

    data FakeOuterStringSerialize

    -- | /Body Param/ "body" - Input string as post body
    instance HasBodyParam FakeOuterStringSerialize BodyText

    -- | @application/json@
    instance Consumes FakeOuterStringSerialize MimeJSON

    -- | @*/*@
    instance MimeType mtype => Produces FakeOuterStringSerialize mtype

    -- *** testClientModel

    -- | @PATCH \/fake@
    --
    -- To test \"client\" model
    --
    -- To test \"client\" model
    --
    testClientModel
      :: (Consumes TestClientModel MimeJSON, MimeRender MimeJSON Client)
      => Client -- ^ "client" -  client model
      -> OpenAPIPetstoreRequest TestClientModel MimeJSON Client MimeJSON
    testClientModel client =
      _mkRequest "PATCH" ["/fake"]
        `setBodyParam` client

    data TestClientModel

    -- | /Body Param/ "Client" - client model
    instance HasBodyParam TestClientModel Client

    -- | @application/json@
    instance Consumes TestClientModel MimeJSON

    -- | @application/json@
    instance Produces TestClientModel MimeJSON

    -- *** testEndpointParameters

    -- | @POST \/fake@
    --
    -- Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
    --
    -- Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
    --
    -- AuthMethod: 'AuthBasicHttpBasicTest'
    --
    testEndpointParameters
      :: (Consumes TestEndpointParameters MimeFormUrlEncoded)
      => Number -- ^ "number" -  None
      -> ParamDouble -- ^ "double" -  None
      -> PatternWithoutDelimiter -- ^ "patternWithoutDelimiter" -  None
      -> Byte -- ^ "byte" -  None
      -> OpenAPIPetstoreRequest TestEndpointParameters MimeFormUrlEncoded NoContent MimeNoContent
    testEndpointParameters (Number number) (ParamDouble double) (PatternWithoutDelimiter patternWithoutDelimiter) (Byte byte) =
      _mkRequest "POST" ["/fake"]
        `_hasAuthType` (P.Proxy :: P.Proxy AuthBasicHttpBasicTest)
        `addForm` toForm ("number", number)
        `addForm` toForm ("double", double)
        `addForm` toForm ("pattern_without_delimiter", patternWithoutDelimiter)
        `addForm` toForm ("byte", byte)

    data TestEndpointParameters

    -- | /Optional Param/ "integer" - None
    instance HasOptionalParam TestEndpointParameters ParamInteger where
      applyOptionalParam req (ParamInteger xs) =
        req `addForm` toForm ("integer", xs)

    -- | /Optional Param/ "int32" - None
    instance HasOptionalParam TestEndpointParameters Int32 where
      applyOptionalParam req (Int32 xs) =
        req `addForm` toForm ("int32", xs)

    -- | /Optional Param/ "int64" - None
    instance HasOptionalParam TestEndpointParameters Int64 where
      applyOptionalParam req (Int64 xs) =
        req `addForm` toForm ("int64", xs)

    -- | /Optional Param/ "float" - None
    instance HasOptionalParam TestEndpointParameters ParamFloat where
      applyOptionalParam req (ParamFloat xs) =
        req `addForm` toForm ("float", xs)

    -- | /Optional Param/ "string" - None
    instance HasOptionalParam TestEndpointParameters ParamString where
      applyOptionalParam req (ParamString xs) =
        req `addForm` toForm ("string", xs)

    -- | /Optional Param/ "binary" - None
    instance HasOptionalParam TestEndpointParameters ParamBinary where
      applyOptionalParam req (ParamBinary xs) =
        req `_addMultiFormPart` NH.partFileSource "binary" xs

    -- | /Optional Param/ "date" - None
    instance HasOptionalParam TestEndpointParameters ParamDate where
      applyOptionalParam req (ParamDate xs) =
        req `addForm` toForm ("date", xs)

    -- | /Optional Param/ "dateTime" - None
    instance HasOptionalParam TestEndpointParameters ParamDateTime where
      applyOptionalParam req (ParamDateTime xs) =
        req `addForm` toForm ("dateTime", xs)

    -- | /Optional Param/ "password" - None
    instance HasOptionalParam TestEndpointParameters Password where
      applyOptionalParam req (Password xs) =
        req `addForm` toForm ("password", xs)

    -- | /Optional Param/ "callback" - None
    instance HasOptionalParam TestEndpointParameters Callback where
      applyOptionalParam req (Callback xs) =
        req `addForm` toForm ("callback", xs)

    -- | @application/x-www-form-urlencoded@
    instance Consumes TestEndpointParameters MimeFormUrlEncoded

    instance Produces TestEndpointParameters MimeNoContent

    -- *** testEnumParameters

    -- | @GET \/fake@
    --
    -- To test enum parameters
    --
    -- To test enum parameters
    --
    testEnumParameters
      :: (Consumes TestEnumParameters MimeFormUrlEncoded)
      => OpenAPIPetstoreRequest TestEnumParameters MimeFormUrlEncoded NoContent MimeNoContent
    testEnumParameters =
      _mkRequest "GET" ["/fake"]

    data TestEnumParameters

    -- | /Optional Param/ "enum_form_string_array" - Form parameter enum test (string array)
    instance HasOptionalParam TestEnumParameters EnumFormStringArray where
      applyOptionalParam req (EnumFormStringArray xs) =
        req `addForm` toFormColl CommaSeparated ("enum_form_string_array", xs)

    -- | /Optional Param/ "enum_form_string" - Form parameter enum test (string)
    instance HasOptionalParam TestEnumParameters EnumFormString where
      applyOptionalParam req (EnumFormString xs) =
        req `addForm` toForm ("enum_form_string", xs)

    -- | /Optional Param/ "enum_header_string_array" - Header parameter enum test (string array)
    instance HasOptionalParam TestEnumParameters EnumHeaderStringArray where
      applyOptionalParam req (EnumHeaderStringArray xs) =
        req `setHeader` toHeaderColl CommaSeparated ("enum_header_string_array", xs)

    -- | /Optional Param/ "enum_header_string" - Header parameter enum test (string)
    instance HasOptionalParam TestEnumParameters EnumHeaderString where
      applyOptionalParam req (EnumHeaderString xs) =
        req `setHeader` toHeader ("enum_header_string", xs)

    -- | /Optional Param/ "enum_query_string_array" - Query parameter enum test (string array)
    instance HasOptionalParam TestEnumParameters EnumQueryStringArray where
      applyOptionalParam req (EnumQueryStringArray xs) =
        req `setQuery` toQueryColl MultiParamArray ("enum_query_string_array", Just xs)

    -- | /Optional Param/ "enum_query_string" - Query parameter enum test (string)
    instance HasOptionalParam TestEnumParameters EnumQueryString where
      applyOptionalParam req (EnumQueryString xs) =
        req `setQuery` toQuery ("enum_query_string", Just xs)

    -- | /Optional Param/ "enum_query_integer" - Query parameter enum test (double)
    instance HasOptionalParam TestEnumParameters EnumQueryInteger where
      applyOptionalParam req (EnumQueryInteger xs) =
        req `setQuery` toQuery ("enum_query_integer", Just xs)

    -- | /Optional Param/ "enum_query_double" - Query parameter enum test (double)
    instance HasOptionalParam TestEnumParameters EnumQueryDouble where
      applyOptionalParam req (EnumQueryDouble xs) =
        req `setQuery` toQuery ("enum_query_double", Just xs)

    -- | @application/x-www-form-urlencoded@
    instance Consumes TestEnumParameters MimeFormUrlEncoded

    instance Produces TestEnumParameters MimeNoContent

    -- *** testInlineAdditionalProperties

    -- | @POST \/fake\/inline-additionalProperties@
    --
    -- test inline additionalProperties
    --
    testInlineAdditionalProperties
      :: (Consumes TestInlineAdditionalProperties MimeJSON, MimeRender MimeJSON RequestBody)
      => RequestBody -- ^ "requestBody" -  request body
      -> OpenAPIPetstoreRequest TestInlineAdditionalProperties MimeJSON NoContent MimeNoContent
    testInlineAdditionalProperties requestBody =
      _mkRequest "POST" ["/fake/inline-additionalProperties"]
        `setBodyParam` requestBody

    data TestInlineAdditionalProperties

    -- | /Body Param/ "request_body" - request body
    instance HasBodyParam TestInlineAdditionalProperties RequestBody

    -- | @application/json@
    instance Consumes TestInlineAdditionalProperties MimeJSON

    instance Produces TestInlineAdditionalProperties MimeNoContent

    -- *** testJsonFormData

    -- | @GET \/fake\/jsonFormData@
    --
    -- test json serialization of form data
    --
    testJsonFormData
      :: (Consumes TestJsonFormData MimeFormUrlEncoded)
      => Param -- ^ "param" -  field1
      -> Param2 -- ^ "param2" -  field2
      -> OpenAPIPetstoreRequest TestJsonFormData MimeFormUrlEncoded NoContent MimeNoContent
    testJsonFormData (Param param) (Param2 param2) =
      _mkRequest "GET" ["/fake/jsonFormData"]
        `addForm` toForm ("param", param)
        `addForm` toForm ("param2", param2)

    data TestJsonFormData

    -- | @application/x-www-form-urlencoded@
    instance Consumes TestJsonFormData MimeFormUrlEncoded

    instance Produces TestJsonFormData MimeNoContent