    {-
       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.1
       OpenAPI Petstore API version: 1.0.0
       Generated by OpenAPI Generator (https://openapi-generator.tech)
    -}

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

    {-# 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.User 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

    -- ** User

    -- *** createUser

    -- | @POST \/user@
    --
    -- Create user
    --
    -- This can only be done by the logged in user.
    --
    createUser
      :: (Consumes CreateUser contentType, MimeRender contentType User)
      => ContentType contentType -- ^ request content-type ('MimeType')
      -> User -- ^ "body" -  Created user object
      -> OpenAPIPetstoreRequest CreateUser contentType NoContent MimeNoContent
    createUser :: ContentType contentType
    -> User
    -> OpenAPIPetstoreRequest
         CreateUser contentType NoContent MimeNoContent
    createUser ContentType contentType
    _ User
    body =
      Method
    -> [ByteString]
    -> OpenAPIPetstoreRequest
         CreateUser contentType NoContent MimeNoContent
    forall req contentType res accept.
    Method
    -> [ByteString]
    -> OpenAPIPetstoreRequest req contentType res accept
    _mkRequest Method
    "POST" [ByteString
    "/user"]
        OpenAPIPetstoreRequest
      CreateUser contentType NoContent MimeNoContent
    -> User
    -> OpenAPIPetstoreRequest
         CreateUser contentType NoContent MimeNoContent
    forall req param contentType res accept.
    (HasBodyParam req param, Consumes req contentType,
     MimeRender contentType param) =>
    OpenAPIPetstoreRequest req contentType res accept
    -> param -> OpenAPIPetstoreRequest req contentType res accept
    `setBodyParam` User
    body

    data CreateUser

    -- | /Body Param/ "body" - Created user object
    instance HasBodyParam CreateUser User

    -- | @*/*@
    instance MimeType mtype => Consumes CreateUser mtype

    instance Produces CreateUser MimeNoContent

    -- *** createUsersWithArrayInput

    -- | @POST \/user\/createWithArray@
    --
    -- Creates list of users with given input array
    --
    createUsersWithArrayInput
      :: (Consumes CreateUsersWithArrayInput contentType, MimeRender contentType Body)
      => ContentType contentType -- ^ request content-type ('MimeType')
      -> Body -- ^ "body" -  List of user object
      -> OpenAPIPetstoreRequest CreateUsersWithArrayInput contentType NoContent MimeNoContent
    createUsersWithArrayInput :: ContentType contentType
    -> Body
    -> OpenAPIPetstoreRequest
         CreateUsersWithArrayInput contentType NoContent MimeNoContent
    createUsersWithArrayInput ContentType contentType
    _ Body
    body =
      Method
    -> [ByteString]
    -> OpenAPIPetstoreRequest
         CreateUsersWithArrayInput contentType NoContent MimeNoContent
    forall req contentType res accept.
    Method
    -> [ByteString]
    -> OpenAPIPetstoreRequest req contentType res accept
    _mkRequest Method
    "POST" [ByteString
    "/user/createWithArray"]
        OpenAPIPetstoreRequest
      CreateUsersWithArrayInput contentType NoContent MimeNoContent
    -> Body
    -> OpenAPIPetstoreRequest
         CreateUsersWithArrayInput contentType NoContent MimeNoContent
    forall req param contentType res accept.
    (HasBodyParam req param, Consumes req contentType,
     MimeRender contentType param) =>
    OpenAPIPetstoreRequest req contentType res accept
    -> param -> OpenAPIPetstoreRequest req contentType res accept
    `setBodyParam` Body
    body

    data CreateUsersWithArrayInput

    -- | /Body Param/ "body" - List of user object
    instance HasBodyParam CreateUsersWithArrayInput Body

    -- | @*/*@
    instance MimeType mtype => Consumes CreateUsersWithArrayInput mtype

    instance Produces CreateUsersWithArrayInput MimeNoContent

    -- *** createUsersWithListInput

    -- | @POST \/user\/createWithList@
    --
    -- Creates list of users with given input array
    --
    createUsersWithListInput
      :: (Consumes CreateUsersWithListInput contentType, MimeRender contentType Body)
      => ContentType contentType -- ^ request content-type ('MimeType')
      -> Body -- ^ "body" -  List of user object
      -> OpenAPIPetstoreRequest CreateUsersWithListInput contentType NoContent MimeNoContent
    createUsersWithListInput :: ContentType contentType
    -> Body
    -> OpenAPIPetstoreRequest
         CreateUsersWithListInput contentType NoContent MimeNoContent
    createUsersWithListInput ContentType contentType
    _ Body
    body =
      Method
    -> [ByteString]
    -> OpenAPIPetstoreRequest
         CreateUsersWithListInput contentType NoContent MimeNoContent
    forall req contentType res accept.
    Method
    -> [ByteString]
    -> OpenAPIPetstoreRequest req contentType res accept
    _mkRequest Method
    "POST" [ByteString
    "/user/createWithList"]
        OpenAPIPetstoreRequest
      CreateUsersWithListInput contentType NoContent MimeNoContent
    -> Body
    -> OpenAPIPetstoreRequest
         CreateUsersWithListInput contentType NoContent MimeNoContent
    forall req param contentType res accept.
    (HasBodyParam req param, Consumes req contentType,
     MimeRender contentType param) =>
    OpenAPIPetstoreRequest req contentType res accept
    -> param -> OpenAPIPetstoreRequest req contentType res accept
    `setBodyParam` Body
    body

    data CreateUsersWithListInput

    -- | /Body Param/ "body" - List of user object
    instance HasBodyParam CreateUsersWithListInput Body

    -- | @*/*@
    instance MimeType mtype => Consumes CreateUsersWithListInput mtype

    instance Produces CreateUsersWithListInput MimeNoContent

    -- *** deleteUser

    -- | @DELETE \/user\/{username}@
    --
    -- Delete user
    --
    -- This can only be done by the logged in user.
    --
    deleteUser
      :: Username -- ^ "username" -  The name that needs to be deleted
      -> OpenAPIPetstoreRequest DeleteUser MimeNoContent NoContent MimeNoContent
    deleteUser :: Username
    -> OpenAPIPetstoreRequest
         DeleteUser MimeNoContent NoContent MimeNoContent
    deleteUser (Username Text
    username) =
      Method
    -> [ByteString]
    -> OpenAPIPetstoreRequest
         DeleteUser MimeNoContent NoContent MimeNoContent
    forall req contentType res accept.
    Method
    -> [ByteString]
    -> OpenAPIPetstoreRequest req contentType res accept
    _mkRequest Method
    "DELETE" [ByteString
    "/user/",Text -> ByteString
    forall a. ToHttpApiData a => a -> ByteString
    toPath Text
    username]

    data DeleteUser
    instance Produces DeleteUser MimeNoContent

    -- *** getUserByName

    -- | @GET \/user\/{username}@
    --
    -- Get user by user name
    --
    getUserByName
      :: Accept accept -- ^ request accept ('MimeType')
      -> Username -- ^ "username" -  The name that needs to be fetched. Use user1 for testing.
      -> OpenAPIPetstoreRequest GetUserByName MimeNoContent User accept
    getUserByName :: Accept accept
    -> Username
    -> OpenAPIPetstoreRequest GetUserByName MimeNoContent User accept
    getUserByName  Accept accept
    _ (Username Text
    username) =
      Method
    -> [ByteString]
    -> OpenAPIPetstoreRequest GetUserByName MimeNoContent User accept
    forall req contentType res accept.
    Method
    -> [ByteString]
    -> OpenAPIPetstoreRequest req contentType res accept
    _mkRequest Method
    "GET" [ByteString
    "/user/",Text -> ByteString
    forall a. ToHttpApiData a => a -> ByteString
    toPath Text
    username]

    data GetUserByName
    -- | @application/xml@
    instance Produces GetUserByName MimeXML
    -- | @application/json@
    instance Produces GetUserByName MimeJSON

    -- *** loginUser

    -- | @GET \/user\/login@
    --
    -- Logs user into the system
    --
    loginUser
      :: Accept accept -- ^ request accept ('MimeType')
      -> Username -- ^ "username" -  The user name for login
      -> Password -- ^ "password" -  The password for login in clear text
      -> OpenAPIPetstoreRequest LoginUser MimeNoContent Text accept
    loginUser :: Accept accept
    -> Username
    -> Password
    -> OpenAPIPetstoreRequest LoginUser MimeNoContent Text accept
    loginUser  Accept accept
    _ (Username Text
    username) (Password Text
    password) =
      Method
    -> [ByteString]
    -> OpenAPIPetstoreRequest LoginUser MimeNoContent Text accept
    forall req contentType res accept.
    Method
    -> [ByteString]
    -> OpenAPIPetstoreRequest req contentType res accept
    _mkRequest Method
    "GET" [ByteString
    "/user/login"]
        OpenAPIPetstoreRequest LoginUser MimeNoContent Text accept
    -> [QueryItem]
    -> OpenAPIPetstoreRequest LoginUser MimeNoContent Text accept
    forall req contentType res accept.
    OpenAPIPetstoreRequest req contentType res accept
    -> [QueryItem] -> OpenAPIPetstoreRequest req contentType res accept
    `addQuery` (Method, Maybe Text) -> [QueryItem]
    forall a. ToHttpApiData a => (Method, Maybe a) -> [QueryItem]
    toQuery (Method
    "username", Text -> Maybe Text
    forall a. a -> Maybe a
    Just Text
    username)
        OpenAPIPetstoreRequest LoginUser MimeNoContent Text accept
    -> [QueryItem]
    -> OpenAPIPetstoreRequest LoginUser MimeNoContent Text accept
    forall req contentType res accept.
    OpenAPIPetstoreRequest req contentType res accept
    -> [QueryItem] -> OpenAPIPetstoreRequest req contentType res accept
    `addQuery` (Method, Maybe Text) -> [QueryItem]
    forall a. ToHttpApiData a => (Method, Maybe a) -> [QueryItem]
    toQuery (Method
    "password", Text -> Maybe Text
    forall a. a -> Maybe a
    Just Text
    password)

    data LoginUser
    -- | @application/xml@
    instance Produces LoginUser MimeXML
    -- | @application/json@
    instance Produces LoginUser MimeJSON

    -- *** logoutUser

    -- | @GET \/user\/logout@
    --
    -- Logs out current logged in user session
    --
    logoutUser
      :: OpenAPIPetstoreRequest LogoutUser MimeNoContent NoContent MimeNoContent
    logoutUser :: OpenAPIPetstoreRequest
      LogoutUser MimeNoContent NoContent MimeNoContent
    logoutUser =
      Method
    -> [ByteString]
    -> OpenAPIPetstoreRequest
         LogoutUser MimeNoContent NoContent MimeNoContent
    forall req contentType res accept.
    Method
    -> [ByteString]
    -> OpenAPIPetstoreRequest req contentType res accept
    _mkRequest Method
    "GET" [ByteString
    "/user/logout"]

    data LogoutUser
    instance Produces LogoutUser MimeNoContent

    -- *** updateUser

    -- | @PUT \/user\/{username}@
    --
    -- Updated user
    --
    -- This can only be done by the logged in user.
    --
    updateUser
      :: (Consumes UpdateUser contentType, MimeRender contentType User)
      => ContentType contentType -- ^ request content-type ('MimeType')
      -> User -- ^ "body" -  Updated user object
      -> Username -- ^ "username" -  name that need to be deleted
      -> OpenAPIPetstoreRequest UpdateUser contentType NoContent MimeNoContent
    updateUser :: ContentType contentType
    -> User
    -> Username
    -> OpenAPIPetstoreRequest
         UpdateUser contentType NoContent MimeNoContent
    updateUser ContentType contentType
    _ User
    body (Username Text
    username) =
      Method
    -> [ByteString]
    -> OpenAPIPetstoreRequest
         UpdateUser contentType NoContent MimeNoContent
    forall req contentType res accept.
    Method
    -> [ByteString]
    -> OpenAPIPetstoreRequest req contentType res accept
    _mkRequest Method
    "PUT" [ByteString
    "/user/",Text -> ByteString
    forall a. ToHttpApiData a => a -> ByteString
    toPath Text
    username]
        OpenAPIPetstoreRequest
      UpdateUser contentType NoContent MimeNoContent
    -> User
    -> OpenAPIPetstoreRequest
         UpdateUser contentType NoContent MimeNoContent
    forall req param contentType res accept.
    (HasBodyParam req param, Consumes req contentType,
     MimeRender contentType param) =>
    OpenAPIPetstoreRequest req contentType res accept
    -> param -> OpenAPIPetstoreRequest req contentType res accept
    `setBodyParam` User
    body

    data UpdateUser

    -- | /Body Param/ "body" - Updated user object
    instance HasBodyParam UpdateUser User

    -- | @*/*@
    instance MimeType mtype => Consumes UpdateUser mtype

    instance Produces UpdateUser MimeNoContent