{-# 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.Store 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
deleteOrder
:: OrderIdText
-> OpenAPIPetstoreRequest DeleteOrder MimeNoContent NoContent MimeNoContent
deleteOrder (OrderIdText orderId) =
_mkRequest "DELETE" ["/store/order/",toPath orderId]
data DeleteOrder
instance Produces DeleteOrder MimeNoContent
getInventory
:: OpenAPIPetstoreRequest GetInventory MimeNoContent ((Map.Map String Int)) MimeJSON
getInventory =
_mkRequest "GET" ["/store/inventory"]
`_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyApiKey)
data GetInventory
instance Produces GetInventory MimeJSON
getOrderById
:: Accept accept
-> OrderId
-> OpenAPIPetstoreRequest GetOrderById MimeNoContent Order accept
getOrderById _ (OrderId orderId) =
_mkRequest "GET" ["/store/order/",toPath orderId]
data GetOrderById
instance Produces GetOrderById MimeXML
instance Produces GetOrderById MimeJSON
placeOrder
:: (Consumes PlaceOrder contentType, MimeRender contentType Order)
=> ContentType contentType
-> Accept accept
-> Order
-> OpenAPIPetstoreRequest PlaceOrder contentType Order accept
placeOrder _ _ body =
_mkRequest "POST" ["/store/order"]
`setBodyParam` body
data PlaceOrder
instance HasBodyParam PlaceOrder Order
instance MimeType mtype => Consumes PlaceOrder mtype
instance Produces PlaceOrder MimeXML
instance Produces PlaceOrder MimeJSON