    {-
       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.Pet
    -}

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

    -- ** Pet

    -- *** addPet

    -- | @POST \/pet@
    --
    -- Add a new pet to the store
    --
    -- AuthMethod: 'AuthOAuthPetstoreAuth'
    --
    addPet
      :: (Consumes AddPet contentType, MimeRender contentType Pet)
      => ContentType contentType -- ^ request content-type ('MimeType')
      -> Pet -- ^ "body" -  Pet object that needs to be added to the store
      -> OpenAPIPetstoreRequest AddPet contentType NoContent MimeNoContent
    addPet :: forall contentType.
    (Consumes AddPet contentType, MimeRender contentType Pet) =>
    ContentType contentType
    -> Pet
    -> OpenAPIPetstoreRequest
         AddPet contentType NoContent MimeNoContent
    addPet ContentType contentType
    _ Pet
    body =
      Method
    -> [ByteString]
    -> OpenAPIPetstoreRequest
         AddPet contentType NoContent MimeNoContent
    forall req contentType res accept.
    Method
    -> [ByteString]
    -> OpenAPIPetstoreRequest req contentType res accept
    _mkRequest Method
    "POST" [ByteString
    "/pet"]
        OpenAPIPetstoreRequest AddPet contentType NoContent MimeNoContent
    -> Proxy AuthOAuthPetstoreAuth
    -> OpenAPIPetstoreRequest
         AddPet contentType NoContent MimeNoContent
    forall authMethod req contentType res accept.
    AuthMethod authMethod =>
    OpenAPIPetstoreRequest req contentType res accept
    -> Proxy authMethod
    -> OpenAPIPetstoreRequest req contentType res accept
    `_hasAuthType` (Proxy AuthOAuthPetstoreAuth
    forall {k} (t :: k). Proxy t
    P.Proxy :: P.Proxy AuthOAuthPetstoreAuth)
        OpenAPIPetstoreRequest AddPet contentType NoContent MimeNoContent
    -> Pet
    -> OpenAPIPetstoreRequest
         AddPet 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
    forall contentType res accept.
    (Consumes AddPet contentType, MimeRender contentType Pet) =>
    OpenAPIPetstoreRequest AddPet contentType res accept
    -> Pet -> OpenAPIPetstoreRequest AddPet contentType res accept
    `setBodyParam` Pet
    body

    data AddPet

    -- | /Body Param/ "body" - Pet object that needs to be added to the store
    instance HasBodyParam AddPet Pet

    -- | @application/xml@
    instance Consumes AddPet MimeXML
    -- | @application/json@
    instance Consumes AddPet MimeJSON

    instance Produces AddPet MimeNoContent

    -- *** deletePet

    -- | @DELETE \/pet\/{petId}@
    --
    -- Deletes a pet
    --
    -- AuthMethod: 'AuthOAuthPetstoreAuth'
    --
    deletePet
      :: PetId -- ^ "petId" -  Pet id to delete
      -> OpenAPIPetstoreRequest DeletePet MimeNoContent NoContent MimeNoContent
    deletePet :: PetId
    -> OpenAPIPetstoreRequest
         DeletePet MimeNoContent NoContent MimeNoContent
    deletePet (PetId Integer
    petId) =
      Method
    -> [ByteString]
    -> OpenAPIPetstoreRequest
         DeletePet MimeNoContent NoContent MimeNoContent
    forall req contentType res accept.
    Method
    -> [ByteString]
    -> OpenAPIPetstoreRequest req contentType res accept
    _mkRequest Method
    "DELETE" [ByteString
    "/pet/",Integer -> ByteString
    forall a. ToHttpApiData a => a -> ByteString
    toPath Integer
    petId]
        OpenAPIPetstoreRequest
      DeletePet MimeNoContent NoContent MimeNoContent
    -> Proxy AuthOAuthPetstoreAuth
    -> OpenAPIPetstoreRequest
         DeletePet MimeNoContent NoContent MimeNoContent
    forall authMethod req contentType res accept.
    AuthMethod authMethod =>
    OpenAPIPetstoreRequest req contentType res accept
    -> Proxy authMethod
    -> OpenAPIPetstoreRequest req contentType res accept
    `_hasAuthType` (Proxy AuthOAuthPetstoreAuth
    forall {k} (t :: k). Proxy t
    P.Proxy :: P.Proxy AuthOAuthPetstoreAuth)

    data DeletePet
    instance HasOptionalParam DeletePet ApiKey where
      applyOptionalParam :: forall contentType res accept.
    OpenAPIPetstoreRequest DeletePet contentType res accept
    -> ApiKey
    -> OpenAPIPetstoreRequest DeletePet contentType res accept
    applyOptionalParam OpenAPIPetstoreRequest DeletePet contentType res accept
    req (ApiKey Text
    xs) =
        OpenAPIPetstoreRequest DeletePet contentType res accept
    req OpenAPIPetstoreRequest DeletePet contentType res accept
    -> [Header]
    -> OpenAPIPetstoreRequest DeletePet contentType res accept
    forall req contentType res accept.
    OpenAPIPetstoreRequest req contentType res accept
    -> [Header] -> OpenAPIPetstoreRequest req contentType res accept
    `addHeader` (HeaderName, Text) -> [Header]
    forall a. ToHttpApiData a => (HeaderName, a) -> [Header]
    toHeader (HeaderName
    "api_key", Text
    xs)
    instance Produces DeletePet MimeNoContent

    -- *** findPetsByStatus

    -- | @GET \/pet\/findByStatus@
    --
    -- Finds Pets by status
    --
    -- Multiple status values can be provided with comma separated strings
    --
    -- AuthMethod: 'AuthOAuthPetstoreAuth'
    --
    findPetsByStatus
      :: Accept accept -- ^ request accept ('MimeType')
      -> Status -- ^ "status" -  Status values that need to be considered for filter
      -> OpenAPIPetstoreRequest FindPetsByStatus MimeNoContent [Pet] accept
    findPetsByStatus :: forall accept.
    Accept accept
    -> Status
    -> OpenAPIPetstoreRequest
         FindPetsByStatus MimeNoContent [Pet] accept
    findPetsByStatus  Accept accept
    _ (Status [E'Status2]
    status) =
      Method
    -> [ByteString]
    -> OpenAPIPetstoreRequest
         FindPetsByStatus MimeNoContent [Pet] accept
    forall req contentType res accept.
    Method
    -> [ByteString]
    -> OpenAPIPetstoreRequest req contentType res accept
    _mkRequest Method
    "GET" [ByteString
    "/pet/findByStatus"]
        OpenAPIPetstoreRequest FindPetsByStatus MimeNoContent [Pet] accept
    -> Proxy AuthOAuthPetstoreAuth
    -> OpenAPIPetstoreRequest
         FindPetsByStatus MimeNoContent [Pet] accept
    forall authMethod req contentType res accept.
    AuthMethod authMethod =>
    OpenAPIPetstoreRequest req contentType res accept
    -> Proxy authMethod
    -> OpenAPIPetstoreRequest req contentType res accept
    `_hasAuthType` (Proxy AuthOAuthPetstoreAuth
    forall {k} (t :: k). Proxy t
    P.Proxy :: P.Proxy AuthOAuthPetstoreAuth)
        OpenAPIPetstoreRequest FindPetsByStatus MimeNoContent [Pet] accept
    -> [QueryItem]
    -> OpenAPIPetstoreRequest
         FindPetsByStatus MimeNoContent [Pet] accept
    forall req contentType res accept.
    OpenAPIPetstoreRequest req contentType res accept
    -> [QueryItem] -> OpenAPIPetstoreRequest req contentType res accept
    `addQuery` CollectionFormat -> (Method, Maybe [E'Status2]) -> [QueryItem]
    forall a.
    ToHttpApiData a =>
    CollectionFormat -> (Method, Maybe [a]) -> [QueryItem]
    toQueryColl CollectionFormat
    CommaSeparated (Method
    "status", [E'Status2] -> Maybe [E'Status2]
    forall a. a -> Maybe a
    Just [E'Status2]
    status)

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

    -- *** findPetsByTags

    -- | @GET \/pet\/findByTags@
    --
    -- Finds Pets by tags
    --
    -- Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
    --
    -- AuthMethod: 'AuthOAuthPetstoreAuth'
    --
    findPetsByTags
      :: Accept accept -- ^ request accept ('MimeType')
      -> Tags -- ^ "tags" -  Tags to filter by
      -> OpenAPIPetstoreRequest FindPetsByTags MimeNoContent [Pet] accept
    findPetsByTags :: forall accept.
    Accept accept
    -> Tags
    -> OpenAPIPetstoreRequest FindPetsByTags MimeNoContent [Pet] accept
    findPetsByTags  Accept accept
    _ (Tags [Text]
    tags) =
      Method
    -> [ByteString]
    -> OpenAPIPetstoreRequest FindPetsByTags MimeNoContent [Pet] accept
    forall req contentType res accept.
    Method
    -> [ByteString]
    -> OpenAPIPetstoreRequest req contentType res accept
    _mkRequest Method
    "GET" [ByteString
    "/pet/findByTags"]
        OpenAPIPetstoreRequest FindPetsByTags MimeNoContent [Pet] accept
    -> Proxy AuthOAuthPetstoreAuth
    -> OpenAPIPetstoreRequest FindPetsByTags MimeNoContent [Pet] accept
    forall authMethod req contentType res accept.
    AuthMethod authMethod =>
    OpenAPIPetstoreRequest req contentType res accept
    -> Proxy authMethod
    -> OpenAPIPetstoreRequest req contentType res accept
    `_hasAuthType` (Proxy AuthOAuthPetstoreAuth
    forall {k} (t :: k). Proxy t
    P.Proxy :: P.Proxy AuthOAuthPetstoreAuth)
        OpenAPIPetstoreRequest FindPetsByTags MimeNoContent [Pet] accept
    -> [QueryItem]
    -> OpenAPIPetstoreRequest FindPetsByTags MimeNoContent [Pet] accept
    forall req contentType res accept.
    OpenAPIPetstoreRequest req contentType res accept
    -> [QueryItem] -> OpenAPIPetstoreRequest req contentType res accept
    `addQuery` CollectionFormat -> (Method, Maybe [Text]) -> [QueryItem]
    forall a.
    ToHttpApiData a =>
    CollectionFormat -> (Method, Maybe [a]) -> [QueryItem]
    toQueryColl CollectionFormat
    CommaSeparated (Method
    "tags", [Text] -> Maybe [Text]
    forall a. a -> Maybe a
    Just [Text]
    tags)

    {-# DEPRECATED findPetsByTags "" #-}

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

    -- *** getPetById

    -- | @GET \/pet\/{petId}@
    --
    -- Find pet by ID
    --
    -- Returns a single pet
    --
    -- AuthMethod: 'AuthApiKeyApiKey'
    --
    getPetById
      :: Accept accept -- ^ request accept ('MimeType')
      -> PetId -- ^ "petId" -  ID of pet to return
      -> OpenAPIPetstoreRequest GetPetById MimeNoContent Pet accept
    getPetById :: forall accept.
    Accept accept
    -> PetId
    -> OpenAPIPetstoreRequest GetPetById MimeNoContent Pet accept
    getPetById  Accept accept
    _ (PetId Integer
    petId) =
      Method
    -> [ByteString]
    -> OpenAPIPetstoreRequest GetPetById MimeNoContent Pet accept
    forall req contentType res accept.
    Method
    -> [ByteString]
    -> OpenAPIPetstoreRequest req contentType res accept
    _mkRequest Method
    "GET" [ByteString
    "/pet/",Integer -> ByteString
    forall a. ToHttpApiData a => a -> ByteString
    toPath Integer
    petId]
        OpenAPIPetstoreRequest GetPetById MimeNoContent Pet accept
    -> Proxy AuthApiKeyApiKey
    -> OpenAPIPetstoreRequest GetPetById MimeNoContent Pet accept
    forall authMethod req contentType res accept.
    AuthMethod authMethod =>
    OpenAPIPetstoreRequest req contentType res accept
    -> Proxy authMethod
    -> OpenAPIPetstoreRequest req contentType res accept
    `_hasAuthType` (Proxy AuthApiKeyApiKey
    forall {k} (t :: k). Proxy t
    P.Proxy :: P.Proxy AuthApiKeyApiKey)

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

    -- *** updatePet

    -- | @PUT \/pet@
    --
    -- Update an existing pet
    --
    -- AuthMethod: 'AuthOAuthPetstoreAuth'
    --
    updatePet
      :: (Consumes UpdatePet contentType, MimeRender contentType Pet)
      => ContentType contentType -- ^ request content-type ('MimeType')
      -> Pet -- ^ "body" -  Pet object that needs to be added to the store
      -> OpenAPIPetstoreRequest UpdatePet contentType NoContent MimeNoContent
    updatePet :: forall contentType.
    (Consumes UpdatePet contentType, MimeRender contentType Pet) =>
    ContentType contentType
    -> Pet
    -> OpenAPIPetstoreRequest
         UpdatePet contentType NoContent MimeNoContent
    updatePet ContentType contentType
    _ Pet
    body =
      Method
    -> [ByteString]
    -> OpenAPIPetstoreRequest
         UpdatePet contentType NoContent MimeNoContent
    forall req contentType res accept.
    Method
    -> [ByteString]
    -> OpenAPIPetstoreRequest req contentType res accept
    _mkRequest Method
    "PUT" [ByteString
    "/pet"]
        OpenAPIPetstoreRequest
      UpdatePet contentType NoContent MimeNoContent
    -> Proxy AuthOAuthPetstoreAuth
    -> OpenAPIPetstoreRequest
         UpdatePet contentType NoContent MimeNoContent
    forall authMethod req contentType res accept.
    AuthMethod authMethod =>
    OpenAPIPetstoreRequest req contentType res accept
    -> Proxy authMethod
    -> OpenAPIPetstoreRequest req contentType res accept
    `_hasAuthType` (Proxy AuthOAuthPetstoreAuth
    forall {k} (t :: k). Proxy t
    P.Proxy :: P.Proxy AuthOAuthPetstoreAuth)
        OpenAPIPetstoreRequest
      UpdatePet contentType NoContent MimeNoContent
    -> Pet
    -> OpenAPIPetstoreRequest
         UpdatePet 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
    forall contentType res accept.
    (Consumes UpdatePet contentType, MimeRender contentType Pet) =>
    OpenAPIPetstoreRequest UpdatePet contentType res accept
    -> Pet -> OpenAPIPetstoreRequest UpdatePet contentType res accept
    `setBodyParam` Pet
    body

    data UpdatePet

    -- | /Body Param/ "body" - Pet object that needs to be added to the store
    instance HasBodyParam UpdatePet Pet

    -- | @application/xml@
    instance Consumes UpdatePet MimeXML
    -- | @application/json@
    instance Consumes UpdatePet MimeJSON

    instance Produces UpdatePet MimeNoContent

    -- *** updatePetWithForm

    -- | @POST \/pet\/{petId}@
    --
    -- Updates a pet in the store with form data
    --
    -- AuthMethod: 'AuthOAuthPetstoreAuth'
    --
    updatePetWithForm
      :: (Consumes UpdatePetWithForm MimeFormUrlEncoded)
      => PetId -- ^ "petId" -  ID of pet that needs to be updated
      -> OpenAPIPetstoreRequest UpdatePetWithForm MimeFormUrlEncoded NoContent MimeNoContent
    updatePetWithForm :: Consumes UpdatePetWithForm MimeFormUrlEncoded =>
    PetId
    -> OpenAPIPetstoreRequest
         UpdatePetWithForm MimeFormUrlEncoded NoContent MimeNoContent
    updatePetWithForm (PetId Integer
    petId) =
      Method
    -> [ByteString]
    -> OpenAPIPetstoreRequest
         UpdatePetWithForm MimeFormUrlEncoded NoContent MimeNoContent
    forall req contentType res accept.
    Method
    -> [ByteString]
    -> OpenAPIPetstoreRequest req contentType res accept
    _mkRequest Method
    "POST" [ByteString
    "/pet/",Integer -> ByteString
    forall a. ToHttpApiData a => a -> ByteString
    toPath Integer
    petId]
        OpenAPIPetstoreRequest
      UpdatePetWithForm MimeFormUrlEncoded NoContent MimeNoContent
    -> Proxy AuthOAuthPetstoreAuth
    -> OpenAPIPetstoreRequest
         UpdatePetWithForm MimeFormUrlEncoded NoContent MimeNoContent
    forall authMethod req contentType res accept.
    AuthMethod authMethod =>
    OpenAPIPetstoreRequest req contentType res accept
    -> Proxy authMethod
    -> OpenAPIPetstoreRequest req contentType res accept
    `_hasAuthType` (Proxy AuthOAuthPetstoreAuth
    forall {k} (t :: k). Proxy t
    P.Proxy :: P.Proxy AuthOAuthPetstoreAuth)

    data UpdatePetWithForm

    -- | /Optional Param/ "name" - Updated name of the pet
    instance HasOptionalParam UpdatePetWithForm Name2 where
      applyOptionalParam :: forall contentType res accept.
    OpenAPIPetstoreRequest UpdatePetWithForm contentType res accept
    -> Name2
    -> OpenAPIPetstoreRequest UpdatePetWithForm contentType res accept
    applyOptionalParam OpenAPIPetstoreRequest UpdatePetWithForm contentType res accept
    req (Name2 Text
    xs) =
        OpenAPIPetstoreRequest UpdatePetWithForm contentType res accept
    req OpenAPIPetstoreRequest UpdatePetWithForm contentType res accept
    -> Form
    -> OpenAPIPetstoreRequest UpdatePetWithForm contentType res accept
    forall req contentType res accept.
    OpenAPIPetstoreRequest req contentType res accept
    -> Form -> OpenAPIPetstoreRequest req contentType res accept
    `addForm` (Method, Text) -> Form
    forall v. ToHttpApiData v => (Method, v) -> Form
    toForm (Method
    "name", Text
    xs)

    -- | /Optional Param/ "status" - Updated status of the pet
    instance HasOptionalParam UpdatePetWithForm StatusText where
      applyOptionalParam :: forall contentType res accept.
    OpenAPIPetstoreRequest UpdatePetWithForm contentType res accept
    -> StatusText
    -> OpenAPIPetstoreRequest UpdatePetWithForm contentType res accept
    applyOptionalParam OpenAPIPetstoreRequest UpdatePetWithForm contentType res accept
    req (StatusText Text
    xs) =
        OpenAPIPetstoreRequest UpdatePetWithForm contentType res accept
    req OpenAPIPetstoreRequest UpdatePetWithForm contentType res accept
    -> Form
    -> OpenAPIPetstoreRequest UpdatePetWithForm contentType res accept
    forall req contentType res accept.
    OpenAPIPetstoreRequest req contentType res accept
    -> Form -> OpenAPIPetstoreRequest req contentType res accept
    `addForm` (Method, Text) -> Form
    forall v. ToHttpApiData v => (Method, v) -> Form
    toForm (Method
    "status", Text
    xs)

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

    instance Produces UpdatePetWithForm MimeNoContent

    -- *** uploadFile

    -- | @POST \/pet\/{petId}\/uploadImage@
    --
    -- uploads an image
    --
    -- AuthMethod: 'AuthOAuthPetstoreAuth'
    --
    uploadFile
      :: (Consumes UploadFile MimeMultipartFormData)
      => PetId -- ^ "petId" -  ID of pet to update
      -> OpenAPIPetstoreRequest UploadFile MimeMultipartFormData ApiResponse MimeJSON
    uploadFile :: Consumes UploadFile MimeMultipartFormData =>
    PetId
    -> OpenAPIPetstoreRequest
         UploadFile MimeMultipartFormData ApiResponse MimeJSON
    uploadFile (PetId Integer
    petId) =
      Method
    -> [ByteString]
    -> OpenAPIPetstoreRequest
         UploadFile MimeMultipartFormData ApiResponse MimeJSON
    forall req contentType res accept.
    Method
    -> [ByteString]
    -> OpenAPIPetstoreRequest req contentType res accept
    _mkRequest Method
    "POST" [ByteString
    "/pet/",Integer -> ByteString
    forall a. ToHttpApiData a => a -> ByteString
    toPath Integer
    petId,ByteString
    "/uploadImage"]
        OpenAPIPetstoreRequest
      UploadFile MimeMultipartFormData ApiResponse MimeJSON
    -> Proxy AuthOAuthPetstoreAuth
    -> OpenAPIPetstoreRequest
         UploadFile MimeMultipartFormData ApiResponse MimeJSON
    forall authMethod req contentType res accept.
    AuthMethod authMethod =>
    OpenAPIPetstoreRequest req contentType res accept
    -> Proxy authMethod
    -> OpenAPIPetstoreRequest req contentType res accept
    `_hasAuthType` (Proxy AuthOAuthPetstoreAuth
    forall {k} (t :: k). Proxy t
    P.Proxy :: P.Proxy AuthOAuthPetstoreAuth)

    data UploadFile

    -- | /Optional Param/ "additionalMetadata" - Additional data to pass to server
    instance HasOptionalParam UploadFile AdditionalMetadata where
      applyOptionalParam :: forall contentType res accept.
    OpenAPIPetstoreRequest UploadFile contentType res accept
    -> AdditionalMetadata
    -> OpenAPIPetstoreRequest UploadFile contentType res accept
    applyOptionalParam OpenAPIPetstoreRequest UploadFile contentType res accept
    req (AdditionalMetadata Text
    xs) =
        OpenAPIPetstoreRequest UploadFile contentType res accept
    req OpenAPIPetstoreRequest UploadFile contentType res accept
    -> Part -> OpenAPIPetstoreRequest UploadFile contentType res accept
    forall req contentType res accept.
    OpenAPIPetstoreRequest req contentType res accept
    -> Part -> OpenAPIPetstoreRequest req contentType res accept
    `_addMultiFormPart` Text -> ByteString -> Part
    forall (m :: * -> *).
    Applicative m =>
    Text -> ByteString -> PartM m
    NH.partLBS Text
    "additionalMetadata" (MimeMultipartFormData -> Text -> ByteString
    forall mtype x. MimeRender mtype x => mtype -> x -> ByteString
    mimeRender' MimeMultipartFormData
    MimeMultipartFormData Text
    xs)

    -- | /Optional Param/ "file" - file to upload
    instance HasOptionalParam UploadFile File2 where
      applyOptionalParam :: forall contentType res accept.
    OpenAPIPetstoreRequest UploadFile contentType res accept
    -> File2
    -> OpenAPIPetstoreRequest UploadFile contentType res accept
    applyOptionalParam OpenAPIPetstoreRequest UploadFile contentType res accept
    req (File2 FilePath
    xs) =
        OpenAPIPetstoreRequest UploadFile contentType res accept
    req OpenAPIPetstoreRequest UploadFile contentType res accept
    -> Part -> OpenAPIPetstoreRequest UploadFile contentType res accept
    forall req contentType res accept.
    OpenAPIPetstoreRequest req contentType res accept
    -> Part -> OpenAPIPetstoreRequest req contentType res accept
    `_addMultiFormPart` Text -> FilePath -> Part
    NH.partFileSource Text
    "file" FilePath
    xs

    -- | @multipart/form-data@
    instance Consumes UploadFile MimeMultipartFormData

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

    -- *** uploadFileWithRequiredFile

    -- | @POST \/fake\/{petId}\/uploadImageWithRequiredFile@
    --
    -- uploads an image (required)
    --
    -- AuthMethod: 'AuthOAuthPetstoreAuth'
    --
    uploadFileWithRequiredFile
      :: (Consumes UploadFileWithRequiredFile MimeMultipartFormData)
      => RequiredFile -- ^ "requiredFile" -  file to upload
      -> PetId -- ^ "petId" -  ID of pet to update
      -> OpenAPIPetstoreRequest UploadFileWithRequiredFile MimeMultipartFormData ApiResponse MimeJSON
    uploadFileWithRequiredFile :: Consumes UploadFileWithRequiredFile MimeMultipartFormData =>
    RequiredFile
    -> PetId
    -> OpenAPIPetstoreRequest
         UploadFileWithRequiredFile
         MimeMultipartFormData
         ApiResponse
         MimeJSON
    uploadFileWithRequiredFile (RequiredFile FilePath
    requiredFile) (PetId Integer
    petId) =
      Method
    -> [ByteString]
    -> OpenAPIPetstoreRequest
         UploadFileWithRequiredFile
         MimeMultipartFormData
         ApiResponse
         MimeJSON
    forall req contentType res accept.
    Method
    -> [ByteString]
    -> OpenAPIPetstoreRequest req contentType res accept
    _mkRequest Method
    "POST" [ByteString
    "/fake/",Integer -> ByteString
    forall a. ToHttpApiData a => a -> ByteString
    toPath Integer
    petId,ByteString
    "/uploadImageWithRequiredFile"]
        OpenAPIPetstoreRequest
      UploadFileWithRequiredFile
      MimeMultipartFormData
      ApiResponse
      MimeJSON
    -> Proxy AuthOAuthPetstoreAuth
    -> OpenAPIPetstoreRequest
         UploadFileWithRequiredFile
         MimeMultipartFormData
         ApiResponse
         MimeJSON
    forall authMethod req contentType res accept.
    AuthMethod authMethod =>
    OpenAPIPetstoreRequest req contentType res accept
    -> Proxy authMethod
    -> OpenAPIPetstoreRequest req contentType res accept
    `_hasAuthType` (Proxy AuthOAuthPetstoreAuth
    forall {k} (t :: k). Proxy t
    P.Proxy :: P.Proxy AuthOAuthPetstoreAuth)
        OpenAPIPetstoreRequest
      UploadFileWithRequiredFile
      MimeMultipartFormData
      ApiResponse
      MimeJSON
    -> Part
    -> OpenAPIPetstoreRequest
         UploadFileWithRequiredFile
         MimeMultipartFormData
         ApiResponse
         MimeJSON
    forall req contentType res accept.
    OpenAPIPetstoreRequest req contentType res accept
    -> Part -> OpenAPIPetstoreRequest req contentType res accept
    `_addMultiFormPart` Text -> FilePath -> Part
    NH.partFileSource Text
    "requiredFile" FilePath
    requiredFile

    data UploadFileWithRequiredFile

    -- | /Optional Param/ "additionalMetadata" - Additional data to pass to server
    instance HasOptionalParam UploadFileWithRequiredFile AdditionalMetadata where
      applyOptionalParam :: forall contentType res accept.
    OpenAPIPetstoreRequest
      UploadFileWithRequiredFile contentType res accept
    -> AdditionalMetadata
    -> OpenAPIPetstoreRequest
         UploadFileWithRequiredFile contentType res accept
    applyOptionalParam OpenAPIPetstoreRequest
      UploadFileWithRequiredFile contentType res accept
    req (AdditionalMetadata Text
    xs) =
        OpenAPIPetstoreRequest
      UploadFileWithRequiredFile contentType res accept
    req OpenAPIPetstoreRequest
      UploadFileWithRequiredFile contentType res accept
    -> Part
    -> OpenAPIPetstoreRequest
         UploadFileWithRequiredFile contentType res accept
    forall req contentType res accept.
    OpenAPIPetstoreRequest req contentType res accept
    -> Part -> OpenAPIPetstoreRequest req contentType res accept
    `_addMultiFormPart` Text -> ByteString -> Part
    forall (m :: * -> *).
    Applicative m =>
    Text -> ByteString -> PartM m
    NH.partLBS Text
    "additionalMetadata" (MimeMultipartFormData -> Text -> ByteString
    forall mtype x. MimeRender mtype x => mtype -> x -> ByteString
    mimeRender' MimeMultipartFormData
    MimeMultipartFormData Text
    xs)

    -- | @multipart/form-data@
    instance Consumes UploadFileWithRequiredFile MimeMultipartFormData

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