Safe Haskell | None |
---|---|
Language | Haskell2010 |
SwaggerPetstore.API
Contents
Description
- addPet :: (Consumes AddPet contentType, MimeRender contentType Pet) => contentType -> Pet -> SwaggerPetstoreRequest AddPet contentType res
- data AddPet
- deletePet :: Integer -> SwaggerPetstoreRequest DeletePet MimeNoContent res
- data DeletePet
- findPetsByStatus :: [Text] -> SwaggerPetstoreRequest FindPetsByStatus MimeNoContent [Pet]
- data FindPetsByStatus
- findPetsByTags :: [Text] -> SwaggerPetstoreRequest FindPetsByTags MimeNoContent [Pet]
- data FindPetsByTags
- getPetById :: Integer -> SwaggerPetstoreRequest GetPetById MimeNoContent Pet
- data GetPetById
- updatePet :: (Consumes UpdatePet contentType, MimeRender contentType Pet) => contentType -> Pet -> SwaggerPetstoreRequest UpdatePet contentType res
- data UpdatePet
- updatePetWithForm :: Consumes UpdatePetWithForm contentType => contentType -> Integer -> SwaggerPetstoreRequest UpdatePetWithForm contentType res
- data UpdatePetWithForm
- uploadFile :: Consumes UploadFile contentType => contentType -> Integer -> SwaggerPetstoreRequest UploadFile contentType ApiResponse
- data UploadFile
- deleteOrder :: Text -> SwaggerPetstoreRequest DeleteOrder MimeNoContent res
- data DeleteOrder
- getInventory :: SwaggerPetstoreRequest GetInventory MimeNoContent (Map String Int)
- data GetInventory
- getOrderById :: Integer -> SwaggerPetstoreRequest GetOrderById MimeNoContent Order
- data GetOrderById
- placeOrder :: (Consumes PlaceOrder contentType, MimeRender contentType Order) => contentType -> Order -> SwaggerPetstoreRequest PlaceOrder contentType Order
- data PlaceOrder
- createUser :: (Consumes CreateUser contentType, MimeRender contentType User) => contentType -> User -> SwaggerPetstoreRequest CreateUser contentType res
- data CreateUser
- createUsersWithArrayInput :: (Consumes CreateUsersWithArrayInput contentType, MimeRender contentType [User]) => contentType -> [User] -> SwaggerPetstoreRequest CreateUsersWithArrayInput contentType res
- data CreateUsersWithArrayInput
- createUsersWithListInput :: (Consumes CreateUsersWithListInput contentType, MimeRender contentType [User]) => contentType -> [User] -> SwaggerPetstoreRequest CreateUsersWithListInput contentType res
- data CreateUsersWithListInput
- deleteUser :: Text -> SwaggerPetstoreRequest DeleteUser MimeNoContent res
- data DeleteUser
- getUserByName :: Text -> SwaggerPetstoreRequest GetUserByName MimeNoContent User
- data GetUserByName
- loginUser :: Text -> Text -> SwaggerPetstoreRequest LoginUser MimeNoContent Text
- data LoginUser
- logoutUser :: SwaggerPetstoreRequest LogoutUser MimeNoContent res
- data LogoutUser
- updateUser :: (Consumes UpdateUser contentType, MimeRender contentType User) => contentType -> Text -> User -> SwaggerPetstoreRequest UpdateUser contentType res
- data UpdateUser
- class HasBodyParam req param where
- class HasOptionalParam req param where
- newtype ApiUnderscorekey = ApiUnderscorekey {}
- newtype Name = Name {}
- newtype Status = Status {}
- newtype AdditionalMetadata = AdditionalMetadata {}
- newtype File = File {}
- data SwaggerPetstoreRequest req contentType res = SwaggerPetstoreRequest {}
- data Params = Params {}
- data ParamBody
- _mkRequest :: Method -> [ByteString] -> SwaggerPetstoreRequest req contentType res
- _mkParams :: Params
- setHeader :: SwaggerPetstoreRequest req contentType res -> [Header] -> SwaggerPetstoreRequest req contentType res
- removeHeader :: SwaggerPetstoreRequest req contentType res -> [HeaderName] -> SwaggerPetstoreRequest req contentType res
- _setContentTypeHeader :: forall req contentType res. MimeType contentType => SwaggerPetstoreRequest req contentType res -> SwaggerPetstoreRequest req contentType res
- _setAcceptHeader :: forall req contentType res accept. MimeType accept => SwaggerPetstoreRequest req contentType res -> accept -> SwaggerPetstoreRequest req contentType res
- _setQuery :: SwaggerPetstoreRequest req contentType res -> [QueryItem] -> SwaggerPetstoreRequest req contentType res
- _addForm :: SwaggerPetstoreRequest req contentType res -> Form -> SwaggerPetstoreRequest req contentType res
- _addMultiFormPart :: SwaggerPetstoreRequest req contentType res -> Part -> SwaggerPetstoreRequest req contentType res
- _setBodyBS :: SwaggerPetstoreRequest req contentType res -> ByteString -> SwaggerPetstoreRequest req contentType res
- _setBodyLBS :: SwaggerPetstoreRequest req contentType res -> ByteString -> SwaggerPetstoreRequest req contentType res
- toPath :: ToHttpApiData a => a -> ByteString
- toHeader :: ToHttpApiData a => (HeaderName, a) -> [Header]
- toForm :: ToHttpApiData v => (ByteString, v) -> Form
- toQuery :: ToHttpApiData a => (ByteString, Maybe a) -> [QueryItem]
- data CollectionFormat
- toHeaderColl :: ToHttpApiData a => CollectionFormat -> (HeaderName, [a]) -> [Header]
- toFormColl :: ToHttpApiData v => CollectionFormat -> (ByteString, [v]) -> Form
- toQueryColl :: ToHttpApiData a => CollectionFormat -> (ByteString, Maybe [a]) -> Query
- _toColl :: Traversable f => CollectionFormat -> (f a -> [(b, ByteString)]) -> f [a] -> [(b, ByteString)]
- _toCollA :: (Traversable f, Traversable t, Alternative t) => CollectionFormat -> (f (t a) -> [(b, t ByteString)]) -> f (t [a]) -> [(b, t ByteString)]
- _toCollA' :: (Monoid c, Traversable f, Traversable t, Alternative t) => CollectionFormat -> (f (t a) -> [(b, t c)]) -> (Char -> c) -> f (t [a]) -> [(b, t c)]
Operations
Pet
addPet
Arguments
:: (Consumes AddPet contentType, MimeRender contentType Pet) | |
=> contentType | request content-type ( |
-> Pet | "body" - Pet object that needs to be added to the store |
-> SwaggerPetstoreRequest AddPet contentType res |
POST /pet
Add a new pet to the store
AuthMethod: petstore_auth
Note: Has Produces
instances, but no response schema
Instances
deletePet
Arguments
:: Integer | "petId" - Pet id to delete |
-> SwaggerPetstoreRequest DeletePet MimeNoContent res |
DELETE /pet/{petId}
Deletes a pet
AuthMethod: petstore_auth
Note: Has Produces
instances, but no response schema
findPetsByStatus
Arguments
:: [Text] | "status" - Status values that need to be considered for filter |
-> SwaggerPetstoreRequest FindPetsByStatus MimeNoContent [Pet] |
GET /pet/findByStatus
Finds Pets by status
Multiple status values can be provided with comma separated strings
AuthMethod: petstore_auth
data FindPetsByStatus Source #
Instances
Produces FindPetsByStatus MimeXML Source # | application/xml |
Produces FindPetsByStatus MimeJSON Source # | application/json |
findPetsByTags
Arguments
:: [Text] | "tags" - Tags to filter by |
-> SwaggerPetstoreRequest FindPetsByTags MimeNoContent [Pet] |
Deprecated:
GET /pet/findByTags
Finds Pets by tags
Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
AuthMethod: petstore_auth
data FindPetsByTags Source #
Instances
Produces FindPetsByTags MimeXML Source # | application/xml |
Produces FindPetsByTags MimeJSON Source # | application/json |
getPetById
Arguments
:: Integer | "petId" - ID of pet to return |
-> SwaggerPetstoreRequest GetPetById MimeNoContent Pet |
GET /pet/{petId}
Find pet by ID
Returns a single pet
AuthMethod: api_key
data GetPetById Source #
Instances
Produces GetPetById MimeXML Source # | application/xml |
Produces GetPetById MimeJSON Source # | application/json |
updatePet
Arguments
:: (Consumes UpdatePet contentType, MimeRender contentType Pet) | |
=> contentType | request content-type ( |
-> Pet | "body" - Pet object that needs to be added to the store |
-> SwaggerPetstoreRequest UpdatePet contentType res |
PUT /pet
Update an existing pet
AuthMethod: petstore_auth
Note: Has Produces
instances, but no response schema
Instances
Produces UpdatePet MimeXML Source # | application/xml |
Produces UpdatePet MimeJSON Source # | application/json |
Consumes UpdatePet MimeXML Source # | application/xml |
Consumes UpdatePet MimeJSON Source # | application/json |
HasBodyParam UpdatePet Pet Source # | Body Param "body" - Pet object that needs to be added to the store |
updatePetWithForm
Arguments
:: Consumes UpdatePetWithForm contentType | |
=> contentType | request content-type ( |
-> Integer | "petId" - ID of pet that needs to be updated |
-> SwaggerPetstoreRequest UpdatePetWithForm contentType res |
POST /pet/{petId}
Updates a pet in the store with form data
AuthMethod: petstore_auth
Note: Has Produces
instances, but no response schema
data UpdatePetWithForm Source #
Instances
Produces UpdatePetWithForm MimeXML Source # | application/xml |
Produces UpdatePetWithForm MimeJSON Source # | application/json |
Consumes UpdatePetWithForm MimeFormUrlEncoded Source # | application/x-www-form-urlencoded |
HasOptionalParam UpdatePetWithForm Status Source # | Optional Param "status" - Updated status of the pet |
HasOptionalParam UpdatePetWithForm Name Source # | Optional Param "name" - Updated name of the pet |
uploadFile
Arguments
:: Consumes UploadFile contentType | |
=> contentType | request content-type ( |
-> Integer | "petId" - ID of pet to update |
-> SwaggerPetstoreRequest UploadFile contentType ApiResponse |
POST /pet/{petId}/uploadImage
uploads an image
AuthMethod: petstore_auth
data UploadFile Source #
Instances
Produces UploadFile MimeJSON Source # | application/json |
Consumes UploadFile MimeMultipartFormData Source # | multipart/form-data |
HasOptionalParam UploadFile File Source # | Optional Param "file" - file to upload |
HasOptionalParam UploadFile AdditionalMetadata Source # | Optional Param "additionalMetadata" - Additional data to pass to server |
Store
deleteOrder
Arguments
:: Text | "orderId" - ID of the order that needs to be deleted |
-> SwaggerPetstoreRequest DeleteOrder MimeNoContent res |
DELETE /store/order/{orderId}
Delete purchase order by ID
For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
Note: Has Produces
instances, but no response schema
data DeleteOrder Source #
Instances
Produces DeleteOrder MimeXML Source # | application/xml |
Produces DeleteOrder MimeJSON Source # | application/json |
getInventory
getInventory :: SwaggerPetstoreRequest GetInventory MimeNoContent (Map String Int) Source #
GET /store/inventory
Returns pet inventories by status
Returns a map of status codes to quantities
AuthMethod: api_key
data GetInventory Source #
Instances
Produces GetInventory MimeJSON Source # | application/json |
getOrderById
Arguments
:: Integer | "orderId" - ID of pet that needs to be fetched |
-> SwaggerPetstoreRequest GetOrderById MimeNoContent Order |
GET /store/order/{orderId}
Find purchase order by ID
For valid response try integer IDs with value 5 or 10. Other values will generated exceptions
data GetOrderById Source #
Instances
Produces GetOrderById MimeXML Source # | application/xml |
Produces GetOrderById MimeJSON Source # | application/json |
placeOrder
Arguments
:: (Consumes PlaceOrder contentType, MimeRender contentType Order) | |
=> contentType | request content-type ( |
-> Order | "body" - order placed for purchasing the pet |
-> SwaggerPetstoreRequest PlaceOrder contentType Order |
POST /store/order
Place an order for a pet
data PlaceOrder Source #
Instances
Produces PlaceOrder MimeXML Source # | application/xml |
Produces PlaceOrder MimeJSON Source # | application/json |
HasBodyParam PlaceOrder Order Source # | Body Param "body" - order placed for purchasing the pet |
User
createUser
Arguments
:: (Consumes CreateUser contentType, MimeRender contentType User) | |
=> contentType | request content-type ( |
-> User | "body" - Created user object |
-> SwaggerPetstoreRequest CreateUser contentType res |
POST /user
Create user
This can only be done by the logged in user.
Note: Has Produces
instances, but no response schema
data CreateUser Source #
Instances
Produces CreateUser MimeXML Source # | application/xml |
Produces CreateUser MimeJSON Source # | application/json |
HasBodyParam CreateUser User Source # | Body Param "body" - Created user object |
createUsersWithArrayInput
createUsersWithArrayInput Source #
Arguments
:: (Consumes CreateUsersWithArrayInput contentType, MimeRender contentType [User]) | |
=> contentType | request content-type ( |
-> [User] | "body" - List of user object |
-> SwaggerPetstoreRequest CreateUsersWithArrayInput contentType res |
POST /user/createWithArray
Creates list of users with given input array
Note: Has Produces
instances, but no response schema
data CreateUsersWithArrayInput Source #
Instances
Produces CreateUsersWithArrayInput MimeXML Source # | application/xml |
Produces CreateUsersWithArrayInput MimeJSON Source # | application/json |
HasBodyParam CreateUsersWithArrayInput [User] Source # | Body Param "body" - List of user object |
createUsersWithListInput
createUsersWithListInput Source #
Arguments
:: (Consumes CreateUsersWithListInput contentType, MimeRender contentType [User]) | |
=> contentType | request content-type ( |
-> [User] | "body" - List of user object |
-> SwaggerPetstoreRequest CreateUsersWithListInput contentType res |
POST /user/createWithList
Creates list of users with given input array
Note: Has Produces
instances, but no response schema
data CreateUsersWithListInput Source #
Instances
Produces CreateUsersWithListInput MimeXML Source # | application/xml |
Produces CreateUsersWithListInput MimeJSON Source # | application/json |
HasBodyParam CreateUsersWithListInput [User] Source # | Body Param "body" - List of user object |
deleteUser
Arguments
:: Text | "username" - The name that needs to be deleted |
-> SwaggerPetstoreRequest DeleteUser MimeNoContent res |
DELETE /user/{username}
Delete user
This can only be done by the logged in user.
Note: Has Produces
instances, but no response schema
data DeleteUser Source #
Instances
Produces DeleteUser MimeXML Source # | application/xml |
Produces DeleteUser MimeJSON Source # | application/json |
getUserByName
Arguments
:: Text | "username" - The name that needs to be fetched. Use user1 for testing. |
-> SwaggerPetstoreRequest GetUserByName MimeNoContent User |
GET /user/{username}
Get user by user name
data GetUserByName Source #
Instances
Produces GetUserByName MimeXML Source # | application/xml |
Produces GetUserByName MimeJSON Source # | application/json |
loginUser
Arguments
:: Text | "username" - The user name for login |
-> Text | "password" - The password for login in clear text |
-> SwaggerPetstoreRequest LoginUser MimeNoContent Text |
GET /user/login
Logs user into the system
logoutUser
logoutUser :: SwaggerPetstoreRequest LogoutUser MimeNoContent res Source #
GET /user/logout
Logs out current logged in user session
Note: Has Produces
instances, but no response schema
data LogoutUser Source #
Instances
Produces LogoutUser MimeXML Source # | application/xml |
Produces LogoutUser MimeJSON Source # | application/json |
updateUser
Arguments
:: (Consumes UpdateUser contentType, MimeRender contentType User) | |
=> contentType | request content-type ( |
-> Text | "username" - name that need to be deleted |
-> User | "body" - Updated user object |
-> SwaggerPetstoreRequest UpdateUser contentType res |
PUT /user/{username}
Updated user
This can only be done by the logged in user.
Note: Has Produces
instances, but no response schema
data UpdateUser Source #
Instances
Produces UpdateUser MimeXML Source # | application/xml |
Produces UpdateUser MimeJSON Source # | application/json |
HasBodyParam UpdateUser User Source # | Body Param "body" - Updated user object |
HasBodyParam
class HasBodyParam req param where Source #
Designates the body parameter of a request
Methods
setBodyParam :: forall contentType res. (Consumes req contentType, MimeRender contentType param) => SwaggerPetstoreRequest req contentType res -> param -> SwaggerPetstoreRequest req contentType res Source #
Instances
HasBodyParam UpdateUser User Source # | Body Param "body" - Updated user object |
HasBodyParam CreateUser User Source # | Body Param "body" - Created user object |
HasBodyParam PlaceOrder Order Source # | Body Param "body" - order placed for purchasing the pet |
HasBodyParam UpdatePet Pet Source # | Body Param "body" - Pet object that needs to be added to the store |
HasBodyParam AddPet Pet Source # | Body Param "body" - Pet object that needs to be added to the store |
HasBodyParam CreateUsersWithListInput [User] Source # | Body Param "body" - List of user object |
HasBodyParam CreateUsersWithArrayInput [User] Source # | Body Param "body" - List of user object |
HasOptionalParam
class HasOptionalParam req param where Source #
Designates the optional parameters of a request
Minimal complete definition
Methods
applyOptionalParam :: SwaggerPetstoreRequest req contentType res -> param -> SwaggerPetstoreRequest req contentType res Source #
Apply an optional parameter to a request
(-&-) :: SwaggerPetstoreRequest req contentType res -> param -> SwaggerPetstoreRequest req contentType res infixl 2 Source #
infix operator / alias for addOptionalParam
Instances
HasOptionalParam UploadFile File Source # | Optional Param "file" - file to upload |
HasOptionalParam UploadFile AdditionalMetadata Source # | Optional Param "additionalMetadata" - Additional data to pass to server |
HasOptionalParam UpdatePetWithForm Status Source # | Optional Param "status" - Updated status of the pet |
HasOptionalParam UpdatePetWithForm Name Source # | Optional Param "name" - Updated name of the pet |
HasOptionalParam DeletePet ApiUnderscorekey Source # | |
Optional Request Parameter Types
newtype ApiUnderscorekey Source #
Constructors
ApiUnderscorekey | |
Fields |
newtype AdditionalMetadata Source #
Constructors
AdditionalMetadata | |
Fields |
Instances
Eq AdditionalMetadata Source # | |
Show AdditionalMetadata Source # | |
HasOptionalParam UploadFile AdditionalMetadata Source # | Optional Param "additionalMetadata" - Additional data to pass to server |
SwaggerPetstoreRequest
data SwaggerPetstoreRequest req contentType res Source #
Represents a request. The "req" type variable is the request type. The "res" type variable is the response type.
Constructors
SwaggerPetstoreRequest | |
Instances
Show (SwaggerPetstoreRequest req contentType res) Source # | |
Request Params
Constructors
Params | |
Fields |
Request Body
SwaggerPetstoreRequest Utils
Arguments
:: Method | Method |
-> [ByteString] | Endpoint |
-> SwaggerPetstoreRequest req contentType res | req: Request Type, res: Response Type |
setHeader :: SwaggerPetstoreRequest req contentType res -> [Header] -> SwaggerPetstoreRequest req contentType res Source #
removeHeader :: SwaggerPetstoreRequest req contentType res -> [HeaderName] -> SwaggerPetstoreRequest req contentType res Source #
_setContentTypeHeader :: forall req contentType res. MimeType contentType => SwaggerPetstoreRequest req contentType res -> SwaggerPetstoreRequest req contentType res Source #
_setAcceptHeader :: forall req contentType res accept. MimeType accept => SwaggerPetstoreRequest req contentType res -> accept -> SwaggerPetstoreRequest req contentType res Source #
_setQuery :: SwaggerPetstoreRequest req contentType res -> [QueryItem] -> SwaggerPetstoreRequest req contentType res Source #
_addForm :: SwaggerPetstoreRequest req contentType res -> Form -> SwaggerPetstoreRequest req contentType res Source #
_addMultiFormPart :: SwaggerPetstoreRequest req contentType res -> Part -> SwaggerPetstoreRequest req contentType res Source #
_setBodyBS :: SwaggerPetstoreRequest req contentType res -> ByteString -> SwaggerPetstoreRequest req contentType res Source #
_setBodyLBS :: SwaggerPetstoreRequest req contentType res -> ByteString -> SwaggerPetstoreRequest req contentType res Source #
Params Utils
toPath :: ToHttpApiData a => a -> ByteString Source #
toHeader :: ToHttpApiData a => (HeaderName, a) -> [Header] Source #
toForm :: ToHttpApiData v => (ByteString, v) -> Form Source #
toQuery :: ToHttpApiData a => (ByteString, Maybe a) -> [QueryItem] Source #
Swagger CollectionFormat
Utils
data CollectionFormat Source #
Determines the format of the array if type array is used.
Constructors
CommaSeparated | CSV format for multiple parameters. |
SpaceSeparated | Also called SSV |
TabSeparated | Also called TSV |
PipeSeparated | `value1|value2|value2` |
MultiParamArray | Using multiple GET parameters, e.g. `foo=bar&foo=baz`. This is valid only for parameters in "query" ( |
toHeaderColl :: ToHttpApiData a => CollectionFormat -> (HeaderName, [a]) -> [Header] Source #
toFormColl :: ToHttpApiData v => CollectionFormat -> (ByteString, [v]) -> Form Source #
toQueryColl :: ToHttpApiData a => CollectionFormat -> (ByteString, Maybe [a]) -> Query Source #
_toColl :: Traversable f => CollectionFormat -> (f a -> [(b, ByteString)]) -> f [a] -> [(b, ByteString)] Source #
_toCollA :: (Traversable f, Traversable t, Alternative t) => CollectionFormat -> (f (t a) -> [(b, t ByteString)]) -> f (t [a]) -> [(b, t ByteString)] Source #
_toCollA' :: (Monoid c, Traversable f, Traversable t, Alternative t) => CollectionFormat -> (f (t a) -> [(b, t c)]) -> (Char -> c) -> f (t [a]) -> [(b, t c)] Source #