{-# 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
createUser
:: (Consumes CreateUser contentType, MimeRender contentType User)
=> ContentType contentType
-> User
-> OpenAPIPetstoreRequest CreateUser contentType NoContent MimeNoContent
createUser _ body =
_mkRequest "POST" ["/user"]
`setBodyParam` body
data CreateUser
instance HasBodyParam CreateUser User
instance MimeType mtype => Consumes CreateUser mtype
instance Produces CreateUser MimeNoContent
createUsersWithArrayInput
:: (Consumes CreateUsersWithArrayInput contentType, MimeRender contentType Body)
=> ContentType contentType
-> Body
-> OpenAPIPetstoreRequest CreateUsersWithArrayInput contentType NoContent MimeNoContent
createUsersWithArrayInput _ body =
_mkRequest "POST" ["/user/createWithArray"]
`setBodyParam` body
data CreateUsersWithArrayInput
instance HasBodyParam CreateUsersWithArrayInput Body
instance MimeType mtype => Consumes CreateUsersWithArrayInput mtype
instance Produces CreateUsersWithArrayInput MimeNoContent
createUsersWithListInput
:: (Consumes CreateUsersWithListInput contentType, MimeRender contentType Body)
=> ContentType contentType
-> Body
-> OpenAPIPetstoreRequest CreateUsersWithListInput contentType NoContent MimeNoContent
createUsersWithListInput _ body =
_mkRequest "POST" ["/user/createWithList"]
`setBodyParam` body
data CreateUsersWithListInput
instance HasBodyParam CreateUsersWithListInput Body
instance MimeType mtype => Consumes CreateUsersWithListInput mtype
instance Produces CreateUsersWithListInput MimeNoContent
deleteUser
:: Username
-> OpenAPIPetstoreRequest DeleteUser MimeNoContent NoContent MimeNoContent
deleteUser (Username username) =
_mkRequest "DELETE" ["/user/",toPath username]
data DeleteUser
instance Produces DeleteUser MimeNoContent
getUserByName
:: Accept accept
-> Username
-> OpenAPIPetstoreRequest GetUserByName MimeNoContent User accept
getUserByName _ (Username username) =
_mkRequest "GET" ["/user/",toPath username]
data GetUserByName
instance Produces GetUserByName MimeXML
instance Produces GetUserByName MimeJSON
loginUser
:: Accept accept
-> Username
-> Password
-> OpenAPIPetstoreRequest LoginUser MimeNoContent Text accept
loginUser _ (Username username) (Password password) =
_mkRequest "GET" ["/user/login"]
`setQuery` toQuery ("username", Just username)
`setQuery` toQuery ("password", Just password)
data LoginUser
instance Produces LoginUser MimeXML
instance Produces LoginUser MimeJSON
logoutUser
:: OpenAPIPetstoreRequest LogoutUser MimeNoContent NoContent MimeNoContent
logoutUser =
_mkRequest "GET" ["/user/logout"]
data LogoutUser
instance Produces LogoutUser MimeNoContent
updateUser
:: (Consumes UpdateUser contentType, MimeRender contentType User)
=> ContentType contentType
-> User
-> Username
-> OpenAPIPetstoreRequest UpdateUser contentType NoContent MimeNoContent
updateUser _ body (Username username) =
_mkRequest "PUT" ["/user/",toPath username]
`setBodyParam` body
data UpdateUser
instance HasBodyParam UpdateUser User
instance MimeType mtype => Consumes UpdateUser mtype
instance Produces UpdateUser MimeNoContent