diff --git a/modules/openapi-generator/src/main/resources/haskell-http-client/README.mustache b/modules/openapi-generator/src/main/resources/haskell-http-client/README.mustache index 15e882371c..12c72122e8 100644 --- a/modules/openapi-generator/src/main/resources/haskell-http-client/README.mustache +++ b/modules/openapi-generator/src/main/resources/haskell-http-client/README.mustache @@ -101,7 +101,7 @@ An example of the generated haddock documentation targeting the server http://pe An example application using the auto-generated haskell-http-client bindings for the server http://petstore.swagger.io/ can be found [here][3] -[3]: https://github.com/openapitools/openapi-generator/master/samples/client/petstore/haskell-http-client/example-app +[3]: https://github.com/openapitools/openapi-generator/tree/master/samples/client/petstore/haskell-http-client/example-app This library is intended to be imported qualified. diff --git a/modules/openapi-generator/src/main/resources/haskell-http-client/haskell-http-client.cabal.mustache b/modules/openapi-generator/src/main/resources/haskell-http-client/haskell-http-client.cabal.mustache index 915fdad194..18a9417266 100644 --- a/modules/openapi-generator/src/main/resources/haskell-http-client/haskell-http-client.cabal.mustache +++ b/modules/openapi-generator/src/main/resources/haskell-http-client/haskell-http-client.cabal.mustache @@ -51,7 +51,7 @@ library , iso8601-time >=0.1.3 && <0.2.0 , microlens >= 0.4.3 && <0.5 , mtl >=2.2.1 - , network >=2.6.2 && <2.7 + , network >=2.6.2 && <2.8 , random >=1.1 , safe-exceptions <0.2 , text >=0.11 && <1.3 diff --git a/modules/openapi-generator/src/main/resources/haskell-http-client/stack.mustache b/modules/openapi-generator/src/main/resources/haskell-http-client/stack.mustache index f27e13a320..f396d4a2a8 100644 --- a/modules/openapi-generator/src/main/resources/haskell-http-client/stack.mustache +++ b/modules/openapi-generator/src/main/resources/haskell-http-client/stack.mustache @@ -1,4 +1,4 @@ -resolver: lts-10.0 +resolver: lts-10.10 build: haddock-arguments: haddock-args: diff --git a/samples/client/petstore/haskell-http-client/README.md b/samples/client/petstore/haskell-http-client/README.md index 516e16023c..1965ce7d5c 100644 --- a/samples/client/petstore/haskell-http-client/README.md +++ b/samples/client/petstore/haskell-http-client/README.md @@ -101,7 +101,7 @@ An example of the generated haddock documentation targeting the server http://pe An example application using the auto-generated haskell-http-client bindings for the server http://petstore.swagger.io/ can be found [here][3] -[3]: https://github.com/openapitools/openapi-generator/master/samples/client/petstore/haskell-http-client/example-app +[3]: https://github.com/openapitools/openapi-generator/tree/master/samples/client/petstore/haskell-http-client/example-app This library is intended to be imported qualified. diff --git a/samples/client/petstore/haskell-http-client/docs/OpenAPIPetstore-Client.html b/samples/client/petstore/haskell-http-client/docs/OpenAPIPetstore-Client.html index d0fbf7ca30..fad5ac4101 100644 --- a/samples/client/petstore/haskell-http-client/docs/OpenAPIPetstore-Client.html +++ b/samples/client/petstore/haskell-http-client/docs/OpenAPIPetstore-Client.html @@ -1,4 +1,4 @@ OpenAPIPetstore.Client

openapi-petstore-0.1.0.0: Auto-generated openapi-petstore API Client

Safe HaskellNone
LanguageHaskell2010

OpenAPIPetstore.Client

Contents

Description

 

Synopsis

Dispatch

Lbs

dispatchLbs Source #

Arguments

:: (Produces req accept, MimeType contentType) 
=> Manager

http-client Connection manager

-> OpenAPIPetstoreConfig

config

-> OpenAPIPetstoreRequest req contentType res accept

request

-> IO (Response ByteString)

response

send a request returning the raw http response

Mime

data MimeResult res Source #

pair of decoded http body and http response

Constructors

MimeResult 

Fields

Instances

Functor MimeResult Source # 

Methods

fmap :: (a -> b) -> MimeResult a -> MimeResult b #

(<$) :: a -> MimeResult b -> MimeResult a #

Foldable MimeResult Source # 

Methods

fold :: Monoid m => MimeResult m -> m #

foldMap :: Monoid m => (a -> m) -> MimeResult a -> m #

foldr :: (a -> b -> b) -> b -> MimeResult a -> b #

foldr' :: (a -> b -> b) -> b -> MimeResult a -> b #

foldl :: (b -> a -> b) -> b -> MimeResult a -> b #

foldl' :: (b -> a -> b) -> b -> MimeResult a -> b #

foldr1 :: (a -> a -> a) -> MimeResult a -> a #

foldl1 :: (a -> a -> a) -> MimeResult a -> a #

toList :: MimeResult a -> [a] #

null :: MimeResult a -> Bool #

length :: MimeResult a -> Int #

elem :: Eq a => a -> MimeResult a -> Bool #

maximum :: Ord a => MimeResult a -> a #

minimum :: Ord a => MimeResult a -> a #

sum :: Num a => MimeResult a -> a #

product :: Num a => MimeResult a -> a #

Traversable MimeResult Source # 

Methods

traverse :: Applicative f => (a -> f b) -> MimeResult a -> f (MimeResult b) #

sequenceA :: Applicative f => MimeResult (f a) -> f (MimeResult a) #

mapM :: Monad m => (a -> m b) -> MimeResult a -> m (MimeResult b) #

sequence :: Monad m => MimeResult (m a) -> m (MimeResult a) #

Show res => Show (MimeResult res) Source # 

Methods

showsPrec :: Int -> MimeResult res -> ShowS #

show :: MimeResult res -> String #

showList :: [MimeResult res] -> ShowS #

data MimeError Source #

pair of unrender/parser error and http response

Constructors

MimeError 

Fields

dispatchMime Source #

Arguments

:: (Produces req accept, MimeUnrender accept res, MimeType contentType) 
=> Manager

http-client Connection manager

-> OpenAPIPetstoreConfig

config

-> OpenAPIPetstoreRequest req contentType res accept

request

-> IO (MimeResult res)

response

send a request returning the MimeResult

dispatchMime' Source #

Arguments

:: (Produces req accept, MimeUnrender accept res, MimeType contentType) 
=> Manager

http-client Connection manager

-> OpenAPIPetstoreConfig

config

-> OpenAPIPetstoreRequest req contentType res accept

request

-> IO (Either MimeError res)

response

like dispatchMime, but only returns the decoded http body

Unsafe

dispatchLbsUnsafe Source #

Arguments

:: (MimeType accept, MimeType contentType) 
=> Manager

http-client Connection manager

-> OpenAPIPetstoreConfig

config

-> OpenAPIPetstoreRequest req contentType res accept

request

-> IO (Response ByteString)

response

like dispatchReqLbs, but does not validate the operation is a Producer of the "accept" MimeType. (Useful if the server's response is undocumented)

dispatchInitUnsafe Source #

Arguments

:: Manager

http-client Connection manager

-> OpenAPIPetstoreConfig

config

-> InitRequest req contentType res accept

init request

-> IO (Response ByteString)

response

dispatch an InitRequest

InitRequest

newtype InitRequest req contentType res accept Source #

wraps an http-client Request with request/response type parameters

Constructors

InitRequest 

Instances

Show (InitRequest req contentType res accept) Source # 

Methods

showsPrec :: Int -> InitRequest req contentType res accept -> ShowS #

show :: InitRequest req contentType res accept -> String #

showList :: [InitRequest req contentType res accept] -> ShowS #

_toInitRequest Source #

Arguments

:: (MimeType accept, MimeType contentType) 
=> OpenAPIPetstoreConfig

config

-> OpenAPIPetstoreRequest req contentType res accept

request

-> IO (InitRequest req contentType res accept)

initialized request

Build an http-client Request record from the supplied config and request

modifyInitRequest :: InitRequest req contentType res accept -> (Request -> Request) -> InitRequest req contentType res accept Source #

modify the underlying Request

modifyInitRequestM :: Monad m => InitRequest req contentType res accept -> (Request -> m Request) -> m (InitRequest req contentType res accept) Source #

modify the underlying Request (monadic)

Logging

runConfigLog :: MonadIO m => OpenAPIPetstoreConfig -> LogExec m Source #

Run a block using the configured logger instance

runConfigLogWithExceptions :: (MonadCatch m, MonadIO m) => Text -> OpenAPIPetstoreConfig -> LogExec m Source #

Run a block using the configured logger instance (logs exceptions)

\ No newline at end of file +

openapi-petstore-0.1.0.0: Auto-generated openapi-petstore API Client

Safe HaskellNone
LanguageHaskell2010

OpenAPIPetstore.Client

Contents

Description

 

Synopsis

Dispatch

Lbs

dispatchLbs Source #

Arguments

:: (Produces req accept, MimeType contentType) 
=> Manager

http-client Connection manager

-> OpenAPIPetstoreConfig

config

-> OpenAPIPetstoreRequest req contentType res accept

request

-> IO (Response ByteString)

response

send a request returning the raw http response

Mime

data MimeResult res Source #

pair of decoded http body and http response

Constructors

MimeResult 

Fields

Instances

Functor MimeResult Source # 

Methods

fmap :: (a -> b) -> MimeResult a -> MimeResult b #

(<$) :: a -> MimeResult b -> MimeResult a #

Foldable MimeResult Source # 

Methods

fold :: Monoid m => MimeResult m -> m #

foldMap :: Monoid m => (a -> m) -> MimeResult a -> m #

foldr :: (a -> b -> b) -> b -> MimeResult a -> b #

foldr' :: (a -> b -> b) -> b -> MimeResult a -> b #

foldl :: (b -> a -> b) -> b -> MimeResult a -> b #

foldl' :: (b -> a -> b) -> b -> MimeResult a -> b #

foldr1 :: (a -> a -> a) -> MimeResult a -> a #

foldl1 :: (a -> a -> a) -> MimeResult a -> a #

toList :: MimeResult a -> [a] #

null :: MimeResult a -> Bool #

length :: MimeResult a -> Int #

elem :: Eq a => a -> MimeResult a -> Bool #

maximum :: Ord a => MimeResult a -> a #

minimum :: Ord a => MimeResult a -> a #

sum :: Num a => MimeResult a -> a #

product :: Num a => MimeResult a -> a #

Traversable MimeResult Source # 

Methods

traverse :: Applicative f => (a -> f b) -> MimeResult a -> f (MimeResult b) #

sequenceA :: Applicative f => MimeResult (f a) -> f (MimeResult a) #

mapM :: Monad m => (a -> m b) -> MimeResult a -> m (MimeResult b) #

sequence :: Monad m => MimeResult (m a) -> m (MimeResult a) #

Show res => Show (MimeResult res) Source # 

Methods

showsPrec :: Int -> MimeResult res -> ShowS #

show :: MimeResult res -> String #

showList :: [MimeResult res] -> ShowS #

data MimeError Source #

pair of unrender/parser error and http response

Constructors

MimeError 

Fields

dispatchMime Source #

Arguments

:: (Produces req accept, MimeUnrender accept res, MimeType contentType) 
=> Manager

http-client Connection manager

-> OpenAPIPetstoreConfig

config

-> OpenAPIPetstoreRequest req contentType res accept

request

-> IO (MimeResult res)

response

send a request returning the MimeResult

dispatchMime' Source #

Arguments

:: (Produces req accept, MimeUnrender accept res, MimeType contentType) 
=> Manager

http-client Connection manager

-> OpenAPIPetstoreConfig

config

-> OpenAPIPetstoreRequest req contentType res accept

request

-> IO (Either MimeError res)

response

like dispatchMime, but only returns the decoded http body

Unsafe

dispatchLbsUnsafe Source #

Arguments

:: (MimeType accept, MimeType contentType) 
=> Manager

http-client Connection manager

-> OpenAPIPetstoreConfig

config

-> OpenAPIPetstoreRequest req contentType res accept

request

-> IO (Response ByteString)

response

like dispatchReqLbs, but does not validate the operation is a Producer of the "accept" MimeType. (Useful if the server's response is undocumented)

dispatchInitUnsafe Source #

Arguments

:: Manager

http-client Connection manager

-> OpenAPIPetstoreConfig

config

-> InitRequest req contentType res accept

init request

-> IO (Response ByteString)

response

dispatch an InitRequest

InitRequest

newtype InitRequest req contentType res accept Source #

wraps an http-client Request with request/response type parameters

Constructors

InitRequest 

Instances

Show (InitRequest req contentType res accept) Source # 

Methods

showsPrec :: Int -> InitRequest req contentType res accept -> ShowS #

show :: InitRequest req contentType res accept -> String #

showList :: [InitRequest req contentType res accept] -> ShowS #

_toInitRequest Source #

Arguments

:: (MimeType accept, MimeType contentType) 
=> OpenAPIPetstoreConfig

config

-> OpenAPIPetstoreRequest req contentType res accept

request

-> IO (InitRequest req contentType res accept)

initialized request

Build an http-client Request record from the supplied config and request

modifyInitRequest :: InitRequest req contentType res accept -> (Request -> Request) -> InitRequest req contentType res accept Source #

modify the underlying Request

modifyInitRequestM :: Monad m => InitRequest req contentType res accept -> (Request -> m Request) -> m (InitRequest req contentType res accept) Source #

modify the underlying Request (monadic)

Logging

runConfigLog :: MonadIO m => OpenAPIPetstoreConfig -> LogExec m Source #

Run a block using the configured logger instance

runConfigLogWithExceptions :: (MonadCatch m, MonadIO m) => Text -> OpenAPIPetstoreConfig -> LogExec m Source #

Run a block using the configured logger instance (logs exceptions)

\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/OpenAPIPetstore-Core.html b/samples/client/petstore/haskell-http-client/docs/OpenAPIPetstore-Core.html index a4e0e80be4..0b6224101d 100644 --- a/samples/client/petstore/haskell-http-client/docs/OpenAPIPetstore-Core.html +++ b/samples/client/petstore/haskell-http-client/docs/OpenAPIPetstore-Core.html @@ -1,4 +1,4 @@ OpenAPIPetstore.Core

openapi-petstore-0.1.0.0: Auto-generated openapi-petstore API Client

Safe HaskellNone
LanguageHaskell2010

OpenAPIPetstore.Core

Contents

Description

 

Synopsis

OpenAPIPetstoreConfig

data OpenAPIPetstoreConfig Source #

Constructors

OpenAPIPetstoreConfig 

Fields

newConfig :: IO OpenAPIPetstoreConfig Source #

constructs a default OpenAPIPetstoreConfig

configHost:

http://petstore.swagger.io:80/v2

configUserAgent:

"openapi-petstore/0.1.0.0"

addAuthMethod :: AuthMethod auth => OpenAPIPetstoreConfig -> auth -> OpenAPIPetstoreConfig Source #

updates config use AuthMethod on matching requests

withStdoutLogging :: OpenAPIPetstoreConfig -> IO OpenAPIPetstoreConfig Source #

updates the config to use stdout logging

withStderrLogging :: OpenAPIPetstoreConfig -> IO OpenAPIPetstoreConfig Source #

updates the config to use stderr logging

withNoLogging :: OpenAPIPetstoreConfig -> OpenAPIPetstoreConfig Source #

updates the config to disable logging

OpenAPIPetstoreRequest

data OpenAPIPetstoreRequest req contentType res accept Source #

Represents a request.

Type Variables:

  • req - request operation
  • contentType - MimeType associated with request body
  • res - response model
  • accept - MimeType associated with response body

Constructors

OpenAPIPetstoreRequest 

Fields

Instances

Show (OpenAPIPetstoreRequest req contentType res accept) Source # 

Methods

showsPrec :: Int -> OpenAPIPetstoreRequest req contentType res accept -> ShowS #

show :: OpenAPIPetstoreRequest req contentType res accept -> String #

showList :: [OpenAPIPetstoreRequest req contentType res accept] -> ShowS #

rMethodL :: Lens_' (OpenAPIPetstoreRequest req contentType res accept) Method Source #

rMethod Lens

rUrlPathL :: Lens_' (OpenAPIPetstoreRequest req contentType res accept) [ByteString] Source #

rParamsL :: Lens_' (OpenAPIPetstoreRequest req contentType res accept) Params Source #

rParams Lens

rAuthTypesL :: Lens_' (OpenAPIPetstoreRequest req contentType res accept) [TypeRep] Source #

rParams Lens

HasBodyParam

class HasBodyParam req param where Source #

Designates the body parameter of a request

Methods

setBodyParam :: forall contentType res accept. (Consumes req contentType, MimeRender contentType param) => OpenAPIPetstoreRequest req contentType res accept -> param -> OpenAPIPetstoreRequest req contentType res accept Source #

Instances

HasBodyParam UpdateUser User Source #

Body Param User - Updated user object

Methods

setBodyParam :: (Consumes UpdateUser contentType, MimeRender contentType User) => OpenAPIPetstoreRequest UpdateUser contentType res accept -> User -> OpenAPIPetstoreRequest UpdateUser contentType res accept Source #

HasBodyParam CreateUsersWithListInput User2 Source #

Body Param User - List of user object

HasBodyParam CreateUsersWithArrayInput User2 Source #

Body Param User - List of user object

HasBodyParam CreateUser User Source #

Body Param User - Created user object

Methods

setBodyParam :: (Consumes CreateUser contentType, MimeRender contentType User) => OpenAPIPetstoreRequest CreateUser contentType res accept -> User -> OpenAPIPetstoreRequest CreateUser contentType res accept Source #

HasBodyParam PlaceOrder Order Source #

Body Param Order - order placed for purchasing the pet

Methods

setBodyParam :: (Consumes PlaceOrder contentType, MimeRender contentType Order) => OpenAPIPetstoreRequest PlaceOrder contentType res accept -> Order -> OpenAPIPetstoreRequest PlaceOrder contentType res accept Source #

HasBodyParam UpdatePet Pet Source #

Body Param Pet - Pet object that needs to be added to the store

Methods

setBodyParam :: (Consumes UpdatePet contentType, MimeRender contentType Pet) => OpenAPIPetstoreRequest UpdatePet contentType res accept -> Pet -> OpenAPIPetstoreRequest UpdatePet contentType res accept Source #

HasBodyParam AddPet Pet Source #

Body Param Pet - Pet object that needs to be added to the store

Methods

setBodyParam :: (Consumes AddPet contentType, MimeRender contentType Pet) => OpenAPIPetstoreRequest AddPet contentType res accept -> Pet -> OpenAPIPetstoreRequest AddPet contentType res accept Source #

HasBodyParam TestClassname Client Source #

Body Param Client - client model

Methods

setBodyParam :: (Consumes TestClassname contentType, MimeRender contentType Client) => OpenAPIPetstoreRequest TestClassname contentType res accept -> Client -> OpenAPIPetstoreRequest TestClassname contentType res accept Source #

HasBodyParam TestInlineAdditionalProperties RequestBody Source #

Body Param "request_body" - request body

HasBodyParam TestClientModel Client Source #

Body Param Client - client model

Methods

setBodyParam :: (Consumes TestClientModel contentType, MimeRender contentType Client) => OpenAPIPetstoreRequest TestClientModel contentType res accept -> Client -> OpenAPIPetstoreRequest TestClientModel contentType res accept Source #

HasBodyParam FakeOuterStringSerialize BodyText Source #

Body Param "body" - Input string as post body

HasBodyParam FakeOuterNumberSerialize Body Source #

Body Param "body" - Input number as post body

HasBodyParam FakeOuterCompositeSerialize OuterComposite Source #

Body Param OuterComposite - Input composite as post body

HasBodyParam FakeOuterBooleanSerialize BodyBool Source #

Body Param "body" - Input boolean as post body

HasBodyParam TestSpecialTags Client Source #

Body Param Client - client model

Methods

setBodyParam :: (Consumes TestSpecialTags contentType, MimeRender contentType Client) => OpenAPIPetstoreRequest TestSpecialTags contentType res accept -> Client -> OpenAPIPetstoreRequest TestSpecialTags contentType res accept Source #

HasOptionalParam

class HasOptionalParam req param where Source #

Designates the optional parameters of a request

Minimal complete definition

applyOptionalParam | (-&-)

Methods

applyOptionalParam :: OpenAPIPetstoreRequest req contentType res accept -> param -> OpenAPIPetstoreRequest req contentType res accept Source #

Apply an optional parameter to a request

(-&-) :: OpenAPIPetstoreRequest req contentType res accept -> param -> OpenAPIPetstoreRequest req contentType res accept infixl 2 Source #

infix operator / alias for addOptionalParam

Instances

HasOptionalParam UploadFile File Source #

Optional Param "file" - file to upload

Methods

applyOptionalParam :: OpenAPIPetstoreRequest UploadFile contentType res accept -> File -> OpenAPIPetstoreRequest UploadFile contentType res accept Source #

(-&-) :: OpenAPIPetstoreRequest UploadFile contentType res accept -> File -> OpenAPIPetstoreRequest UploadFile contentType res accept Source #

HasOptionalParam UploadFile AdditionalMetadata Source #

Optional Param "additionalMetadata" - Additional data to pass to server

HasOptionalParam UpdatePetWithForm StatusText Source #

Optional Param "status" - Updated status of the pet

HasOptionalParam UpdatePetWithForm Name2 Source #

Optional Param "name" - Updated name of the pet

HasOptionalParam DeletePet ApiKey Source # 

Methods

applyOptionalParam :: OpenAPIPetstoreRequest DeletePet contentType res accept -> ApiKey -> OpenAPIPetstoreRequest DeletePet contentType res accept Source #

(-&-) :: OpenAPIPetstoreRequest DeletePet contentType res accept -> ApiKey -> OpenAPIPetstoreRequest DeletePet contentType res accept Source #

HasOptionalParam TestEnumParameters EnumQueryStringArray Source #

Optional Param "enum_query_string_array" - Query parameter enum test (string array)

HasOptionalParam TestEnumParameters EnumQueryString Source #

Optional Param "enum_query_string" - Query parameter enum test (string)

HasOptionalParam TestEnumParameters EnumQueryInteger Source #

Optional Param "enum_query_integer" - Query parameter enum test (double)

HasOptionalParam TestEnumParameters EnumQueryDouble Source #

Optional Param "enum_query_double" - Query parameter enum test (double)

HasOptionalParam TestEnumParameters EnumHeaderStringArray Source #

Optional Param "enum_header_string_array" - Header parameter enum test (string array)

HasOptionalParam TestEnumParameters EnumHeaderString Source #

Optional Param "enum_header_string" - Header parameter enum test (string)

HasOptionalParam TestEnumParameters EnumFormStringArray Source #

Optional Param "enum_form_string_array" - Form parameter enum test (string array)

HasOptionalParam TestEnumParameters EnumFormString Source #

Optional Param "enum_form_string" - Form parameter enum test (string)

HasOptionalParam TestEndpointParameters Password Source #

Optional Param "password" - None

HasOptionalParam TestEndpointParameters ParamString Source #

Optional Param "string" - None

HasOptionalParam TestEndpointParameters ParamInteger Source #

Optional Param "integer" - None

HasOptionalParam TestEndpointParameters ParamFloat Source #

Optional Param "float" - None

HasOptionalParam TestEndpointParameters ParamDateTime Source #

Optional Param "dateTime" - None

HasOptionalParam TestEndpointParameters ParamDate Source #

Optional Param "date" - None

HasOptionalParam TestEndpointParameters ParamBinary Source #

Optional Param "binary" - None

HasOptionalParam TestEndpointParameters Int64 Source #

Optional Param "int64" - None

HasOptionalParam TestEndpointParameters Int32 Source #

Optional Param "int32" - None

HasOptionalParam TestEndpointParameters Callback Source #

Optional Param "callback" - None

data Params Source #

Request Params

Instances

OpenAPIPetstoreRequest Utils

_mkRequest Source #

Arguments

:: Method

Method

-> [ByteString]

Endpoint

-> OpenAPIPetstoreRequest req contentType res accept

req: Request Type, res: Response Type

setHeader :: OpenAPIPetstoreRequest req contentType res accept -> [Header] -> OpenAPIPetstoreRequest req contentType res accept Source #

removeHeader :: OpenAPIPetstoreRequest req contentType res accept -> [HeaderName] -> OpenAPIPetstoreRequest req contentType res accept Source #

_setContentTypeHeader :: forall req contentType res accept. MimeType contentType => OpenAPIPetstoreRequest req contentType res accept -> OpenAPIPetstoreRequest req contentType res accept Source #

_setAcceptHeader :: forall req contentType res accept. MimeType accept => OpenAPIPetstoreRequest req contentType res accept -> OpenAPIPetstoreRequest req contentType res accept Source #

setQuery :: OpenAPIPetstoreRequest req contentType res accept -> [QueryItem] -> OpenAPIPetstoreRequest req contentType res accept Source #

addForm :: OpenAPIPetstoreRequest req contentType res accept -> Form -> OpenAPIPetstoreRequest req contentType res accept Source #

_addMultiFormPart :: OpenAPIPetstoreRequest req contentType res accept -> Part -> OpenAPIPetstoreRequest req contentType res accept Source #

_setBodyBS :: OpenAPIPetstoreRequest req contentType res accept -> ByteString -> OpenAPIPetstoreRequest req contentType res accept Source #

_setBodyLBS :: OpenAPIPetstoreRequest req contentType res accept -> ByteString -> OpenAPIPetstoreRequest req contentType res accept Source #

_hasAuthType :: AuthMethod authMethod => OpenAPIPetstoreRequest req contentType res accept -> Proxy authMethod -> OpenAPIPetstoreRequest req contentType res accept Source #

Params Utils

OpenAPI 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" (Query) or "formData" (Form)

_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 #

AuthMethods

class Typeable a => AuthMethod a where Source #

Provides a method to apply auth methods to requests

Minimal complete definition

applyAuthMethod

Methods

applyAuthMethod :: OpenAPIPetstoreConfig -> a -> OpenAPIPetstoreRequest req contentType res accept -> IO (OpenAPIPetstoreRequest req contentType res accept) Source #

data AnyAuthMethod Source #

An existential wrapper for any AuthMethod

Constructors

AuthMethod a => AnyAuthMethod a 

Instances

AuthMethod AnyAuthMethod Source # 

Methods

applyAuthMethod :: OpenAPIPetstoreConfig -> AnyAuthMethod -> OpenAPIPetstoreRequest req contentType res accept -> IO (OpenAPIPetstoreRequest req contentType res accept) Source #

_applyAuthMethods :: OpenAPIPetstoreRequest req contentType res accept -> OpenAPIPetstoreConfig -> IO (OpenAPIPetstoreRequest req contentType res accept) Source #

apply all matching AuthMethods in config to request

Utils

_omitNulls :: [(Text, Value)] -> Value Source #

Removes Null fields. (OpenAPI-Specification 2.0 does not allow Null in JSON)

_toFormItem :: (ToHttpApiData a, Functor f) => t -> f a -> f (t, [Text]) Source #

Encodes fields using WH.toQueryParam

_emptyToNothing :: Maybe String -> Maybe String Source #

Collapse (Just "") to Nothing

_memptyToNothing :: (Monoid a, Eq a) => Maybe a -> Maybe a Source #

Collapse (Just mempty) to Nothing

DateTime Formatting

newtype DateTime Source #

Constructors

DateTime 

Fields

Instances

Eq DateTime Source # 
Data DateTime Source # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> DateTime -> c DateTime #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c DateTime #

toConstr :: DateTime -> Constr #

dataTypeOf :: DateTime -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c DateTime) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c DateTime) #

gmapT :: (forall b. Data b => b -> b) -> DateTime -> DateTime #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> DateTime -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> DateTime -> r #

gmapQ :: (forall d. Data d => d -> u) -> DateTime -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> DateTime -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> DateTime -> m DateTime #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> DateTime -> m DateTime #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> DateTime -> m DateTime #

Ord DateTime Source # 
Show DateTime Source # 
ToJSON DateTime Source # 
FromJSON DateTime Source # 
NFData DateTime Source # 

Methods

rnf :: DateTime -> () #

ToHttpApiData DateTime Source # 
FromHttpApiData DateTime Source # 
FormatTime DateTime Source # 
ParseTime DateTime Source # 
MimeRender MimeMultipartFormData DateTime Source # 

_readDateTime :: (ParseTime t, Monad m, Alternative m) => String -> m t Source #

_parseISO8601

_showDateTime :: (t ~ UTCTime, FormatTime t) => t -> String Source #

TI.formatISO8601Millis

_parseISO8601 :: (ParseTime t, Monad m, Alternative m) => String -> m t Source #

parse an ISO8601 date-time string

Date Formatting

newtype Date Source #

Constructors

Date 

Fields

Instances

Enum Date Source # 

Methods

succ :: Date -> Date #

pred :: Date -> Date #

toEnum :: Int -> Date #

fromEnum :: Date -> Int #

enumFrom :: Date -> [Date] #

enumFromThen :: Date -> Date -> [Date] #

enumFromTo :: Date -> Date -> [Date] #

enumFromThenTo :: Date -> Date -> Date -> [Date] #

Eq Date Source # 

Methods

(==) :: Date -> Date -> Bool #

(/=) :: Date -> Date -> Bool #

Data Date Source # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Date -> c Date #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Date #

toConstr :: Date -> Constr #

dataTypeOf :: Date -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c Date) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Date) #

gmapT :: (forall b. Data b => b -> b) -> Date -> Date #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Date -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Date -> r #

gmapQ :: (forall d. Data d => d -> u) -> Date -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Date -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Date -> m Date #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Date -> m Date #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Date -> m Date #

Ord Date Source # 

Methods

compare :: Date -> Date -> Ordering #

(<) :: Date -> Date -> Bool #

(<=) :: Date -> Date -> Bool #

(>) :: Date -> Date -> Bool #

(>=) :: Date -> Date -> Bool #

max :: Date -> Date -> Date #

min :: Date -> Date -> Date #

Show Date Source # 

Methods

showsPrec :: Int -> Date -> ShowS #

show :: Date -> String #

showList :: [Date] -> ShowS #

Ix Date Source # 

Methods

range :: (Date, Date) -> [Date] #

index :: (Date, Date) -> Date -> Int #

unsafeIndex :: (Date, Date) -> Date -> Int

inRange :: (Date, Date) -> Date -> Bool #

rangeSize :: (Date, Date) -> Int #

unsafeRangeSize :: (Date, Date) -> Int

ToJSON Date Source # 
FromJSON Date Source # 
NFData Date Source # 

Methods

rnf :: Date -> () #

ToHttpApiData Date Source # 
FromHttpApiData Date Source # 
FormatTime Date Source # 
ParseTime Date Source # 

Methods

buildTime :: TimeLocale -> [(Char, String)] -> Maybe Date #

MimeRender MimeMultipartFormData Date Source # 

_readDate :: (ParseTime t, Monad m) => String -> m t Source #

TI.parseTimeM True TI.defaultTimeLocale "%Y-%m-%d"

_showDate :: FormatTime t => t -> String Source #

TI.formatTime TI.defaultTimeLocale "%Y-%m-%d"

Byte/Binary Formatting

newtype ByteArray Source #

base64 encoded characters

Constructors

ByteArray 

Instances

Eq ByteArray Source # 
Data ByteArray Source # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ByteArray -> c ByteArray #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c ByteArray #

toConstr :: ByteArray -> Constr #

dataTypeOf :: ByteArray -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c ByteArray) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ByteArray) #

gmapT :: (forall b. Data b => b -> b) -> ByteArray -> ByteArray #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ByteArray -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ByteArray -> r #

gmapQ :: (forall d. Data d => d -> u) -> ByteArray -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> ByteArray -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> ByteArray -> m ByteArray #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ByteArray -> m ByteArray #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ByteArray -> m ByteArray #

Ord ByteArray Source # 
Show ByteArray Source # 
ToJSON ByteArray Source # 
FromJSON ByteArray Source # 
NFData ByteArray Source # 

Methods

rnf :: ByteArray -> () #

ToHttpApiData ByteArray Source # 
FromHttpApiData ByteArray Source # 
MimeRender MimeMultipartFormData ByteArray Source # 

_readByteArray :: Monad m => Text -> m ByteArray Source #

read base64 encoded characters

_showByteArray :: ByteArray -> Text Source #

show base64 encoded characters

newtype Binary Source #

any sequence of octets

Constructors

Binary 

Fields

Instances

Eq Binary Source # 

Methods

(==) :: Binary -> Binary -> Bool #

(/=) :: Binary -> Binary -> Bool #

Data Binary Source # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Binary -> c Binary #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Binary #

toConstr :: Binary -> Constr #

dataTypeOf :: Binary -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c Binary) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Binary) #

gmapT :: (forall b. Data b => b -> b) -> Binary -> Binary #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Binary -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Binary -> r #

gmapQ :: (forall d. Data d => d -> u) -> Binary -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Binary -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Binary -> m Binary #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Binary -> m Binary #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Binary -> m Binary #

Ord Binary Source # 
Show Binary Source # 
ToJSON Binary Source # 
FromJSON Binary Source # 
NFData Binary Source # 

Methods

rnf :: Binary -> () #

ToHttpApiData Binary Source # 
FromHttpApiData Binary Source # 
MimeRender MimeMultipartFormData Binary Source # 

Lens Type Aliases

type Lens_' s a = Lens_ s s a a Source #

type Lens_ s t a b = forall (f :: * -> *). Functor f => (a -> f b) -> s -> f t Source #

\ No newline at end of file +

openapi-petstore-0.1.0.0: Auto-generated openapi-petstore API Client

Safe HaskellNone
LanguageHaskell2010

OpenAPIPetstore.Core

Contents

Description

 

Synopsis

OpenAPIPetstoreConfig

data OpenAPIPetstoreConfig Source #

Constructors

OpenAPIPetstoreConfig 

Fields

newConfig :: IO OpenAPIPetstoreConfig Source #

constructs a default OpenAPIPetstoreConfig

configHost:

http://petstore.swagger.io:80/v2

configUserAgent:

"openapi-petstore/0.1.0.0"

addAuthMethod :: AuthMethod auth => OpenAPIPetstoreConfig -> auth -> OpenAPIPetstoreConfig Source #

updates config use AuthMethod on matching requests

withStdoutLogging :: OpenAPIPetstoreConfig -> IO OpenAPIPetstoreConfig Source #

updates the config to use stdout logging

withStderrLogging :: OpenAPIPetstoreConfig -> IO OpenAPIPetstoreConfig Source #

updates the config to use stderr logging

withNoLogging :: OpenAPIPetstoreConfig -> OpenAPIPetstoreConfig Source #

updates the config to disable logging

OpenAPIPetstoreRequest

data OpenAPIPetstoreRequest req contentType res accept Source #

Represents a request.

Type Variables:

  • req - request operation
  • contentType - MimeType associated with request body
  • res - response model
  • accept - MimeType associated with response body

Constructors

OpenAPIPetstoreRequest 

Fields

Instances

Show (OpenAPIPetstoreRequest req contentType res accept) Source # 

Methods

showsPrec :: Int -> OpenAPIPetstoreRequest req contentType res accept -> ShowS #

show :: OpenAPIPetstoreRequest req contentType res accept -> String #

showList :: [OpenAPIPetstoreRequest req contentType res accept] -> ShowS #

rMethodL :: Lens_' (OpenAPIPetstoreRequest req contentType res accept) Method Source #

rMethod Lens

rUrlPathL :: Lens_' (OpenAPIPetstoreRequest req contentType res accept) [ByteString] Source #

rParamsL :: Lens_' (OpenAPIPetstoreRequest req contentType res accept) Params Source #

rParams Lens

rAuthTypesL :: Lens_' (OpenAPIPetstoreRequest req contentType res accept) [TypeRep] Source #

rParams Lens

HasBodyParam

class HasBodyParam req param where Source #

Designates the body parameter of a request

Methods

setBodyParam :: forall contentType res accept. (Consumes req contentType, MimeRender contentType param) => OpenAPIPetstoreRequest req contentType res accept -> param -> OpenAPIPetstoreRequest req contentType res accept Source #

Instances

HasBodyParam UpdateUser User Source #

Body Param User - Updated user object

Methods

setBodyParam :: (Consumes UpdateUser contentType, MimeRender contentType User) => OpenAPIPetstoreRequest UpdateUser contentType res accept -> User -> OpenAPIPetstoreRequest UpdateUser contentType res accept Source #

HasBodyParam CreateUsersWithListInput User2 Source #

Body Param User - List of user object

HasBodyParam CreateUsersWithArrayInput User2 Source #

Body Param User - List of user object

HasBodyParam CreateUser User Source #

Body Param User - Created user object

Methods

setBodyParam :: (Consumes CreateUser contentType, MimeRender contentType User) => OpenAPIPetstoreRequest CreateUser contentType res accept -> User -> OpenAPIPetstoreRequest CreateUser contentType res accept Source #

HasBodyParam PlaceOrder Order Source #

Body Param Order - order placed for purchasing the pet

Methods

setBodyParam :: (Consumes PlaceOrder contentType, MimeRender contentType Order) => OpenAPIPetstoreRequest PlaceOrder contentType res accept -> Order -> OpenAPIPetstoreRequest PlaceOrder contentType res accept Source #

HasBodyParam UpdatePet Pet Source #

Body Param Pet - Pet object that needs to be added to the store

Methods

setBodyParam :: (Consumes UpdatePet contentType, MimeRender contentType Pet) => OpenAPIPetstoreRequest UpdatePet contentType res accept -> Pet -> OpenAPIPetstoreRequest UpdatePet contentType res accept Source #

HasBodyParam AddPet Pet Source #

Body Param Pet - Pet object that needs to be added to the store

Methods

setBodyParam :: (Consumes AddPet contentType, MimeRender contentType Pet) => OpenAPIPetstoreRequest AddPet contentType res accept -> Pet -> OpenAPIPetstoreRequest AddPet contentType res accept Source #

HasBodyParam TestClassname Client Source #

Body Param Client - client model

Methods

setBodyParam :: (Consumes TestClassname contentType, MimeRender contentType Client) => OpenAPIPetstoreRequest TestClassname contentType res accept -> Client -> OpenAPIPetstoreRequest TestClassname contentType res accept Source #

HasBodyParam TestInlineAdditionalProperties RequestBody Source #

Body Param "request_body" - request body

HasBodyParam TestClientModel Client Source #

Body Param Client - client model

Methods

setBodyParam :: (Consumes TestClientModel contentType, MimeRender contentType Client) => OpenAPIPetstoreRequest TestClientModel contentType res accept -> Client -> OpenAPIPetstoreRequest TestClientModel contentType res accept Source #

HasBodyParam FakeOuterStringSerialize BodyText Source #

Body Param "body" - Input string as post body

HasBodyParam FakeOuterNumberSerialize Body Source #

Body Param "body" - Input number as post body

HasBodyParam FakeOuterCompositeSerialize OuterComposite Source #

Body Param OuterComposite - Input composite as post body

HasBodyParam FakeOuterBooleanSerialize BodyBool Source #

Body Param "body" - Input boolean as post body

HasBodyParam TestSpecialTags Client Source #

Body Param Client - client model

Methods

setBodyParam :: (Consumes TestSpecialTags contentType, MimeRender contentType Client) => OpenAPIPetstoreRequest TestSpecialTags contentType res accept -> Client -> OpenAPIPetstoreRequest TestSpecialTags contentType res accept Source #

HasOptionalParam

class HasOptionalParam req param where Source #

Designates the optional parameters of a request

Minimal complete definition

applyOptionalParam | (-&-)

Methods

applyOptionalParam :: OpenAPIPetstoreRequest req contentType res accept -> param -> OpenAPIPetstoreRequest req contentType res accept Source #

Apply an optional parameter to a request

(-&-) :: OpenAPIPetstoreRequest req contentType res accept -> param -> OpenAPIPetstoreRequest req contentType res accept infixl 2 Source #

infix operator / alias for addOptionalParam

Instances

HasOptionalParam UploadFile File Source #

Optional Param "file" - file to upload

Methods

applyOptionalParam :: OpenAPIPetstoreRequest UploadFile contentType res accept -> File -> OpenAPIPetstoreRequest UploadFile contentType res accept Source #

(-&-) :: OpenAPIPetstoreRequest UploadFile contentType res accept -> File -> OpenAPIPetstoreRequest UploadFile contentType res accept Source #

HasOptionalParam UploadFile AdditionalMetadata Source #

Optional Param "additionalMetadata" - Additional data to pass to server

HasOptionalParam UpdatePetWithForm StatusText Source #

Optional Param "status" - Updated status of the pet

HasOptionalParam UpdatePetWithForm Name2 Source #

Optional Param "name" - Updated name of the pet

HasOptionalParam DeletePet ApiKey Source # 

Methods

applyOptionalParam :: OpenAPIPetstoreRequest DeletePet contentType res accept -> ApiKey -> OpenAPIPetstoreRequest DeletePet contentType res accept Source #

(-&-) :: OpenAPIPetstoreRequest DeletePet contentType res accept -> ApiKey -> OpenAPIPetstoreRequest DeletePet contentType res accept Source #

HasOptionalParam TestEnumParameters EnumQueryStringArray Source #

Optional Param "enum_query_string_array" - Query parameter enum test (string array)

HasOptionalParam TestEnumParameters EnumQueryString Source #

Optional Param "enum_query_string" - Query parameter enum test (string)

HasOptionalParam TestEnumParameters EnumQueryInteger Source #

Optional Param "enum_query_integer" - Query parameter enum test (double)

HasOptionalParam TestEnumParameters EnumQueryDouble Source #

Optional Param "enum_query_double" - Query parameter enum test (double)

HasOptionalParam TestEnumParameters EnumHeaderStringArray Source #

Optional Param "enum_header_string_array" - Header parameter enum test (string array)

HasOptionalParam TestEnumParameters EnumHeaderString Source #

Optional Param "enum_header_string" - Header parameter enum test (string)

HasOptionalParam TestEnumParameters EnumFormStringArray Source #

Optional Param "enum_form_string_array" - Form parameter enum test (string array)

HasOptionalParam TestEnumParameters EnumFormString Source #

Optional Param "enum_form_string" - Form parameter enum test (string)

HasOptionalParam TestEndpointParameters Password Source #

Optional Param "password" - None

HasOptionalParam TestEndpointParameters ParamString Source #

Optional Param "string" - None

HasOptionalParam TestEndpointParameters ParamInteger Source #

Optional Param "integer" - None

HasOptionalParam TestEndpointParameters ParamFloat Source #

Optional Param "float" - None

HasOptionalParam TestEndpointParameters ParamDateTime Source #

Optional Param "dateTime" - None

HasOptionalParam TestEndpointParameters ParamDate Source #

Optional Param "date" - None

HasOptionalParam TestEndpointParameters ParamBinary Source #

Optional Param "binary" - None

HasOptionalParam TestEndpointParameters Int64 Source #

Optional Param "int64" - None

HasOptionalParam TestEndpointParameters Int32 Source #

Optional Param "int32" - None

HasOptionalParam TestEndpointParameters Callback Source #

Optional Param "callback" - None

data Params Source #

Request Params

Instances

OpenAPIPetstoreRequest Utils

_mkRequest Source #

Arguments

:: Method

Method

-> [ByteString]

Endpoint

-> OpenAPIPetstoreRequest req contentType res accept

req: Request Type, res: Response Type

setHeader :: OpenAPIPetstoreRequest req contentType res accept -> [Header] -> OpenAPIPetstoreRequest req contentType res accept Source #

removeHeader :: OpenAPIPetstoreRequest req contentType res accept -> [HeaderName] -> OpenAPIPetstoreRequest req contentType res accept Source #

_setContentTypeHeader :: forall req contentType res accept. MimeType contentType => OpenAPIPetstoreRequest req contentType res accept -> OpenAPIPetstoreRequest req contentType res accept Source #

_setAcceptHeader :: forall req contentType res accept. MimeType accept => OpenAPIPetstoreRequest req contentType res accept -> OpenAPIPetstoreRequest req contentType res accept Source #

setQuery :: OpenAPIPetstoreRequest req contentType res accept -> [QueryItem] -> OpenAPIPetstoreRequest req contentType res accept Source #

addForm :: OpenAPIPetstoreRequest req contentType res accept -> Form -> OpenAPIPetstoreRequest req contentType res accept Source #

_addMultiFormPart :: OpenAPIPetstoreRequest req contentType res accept -> Part -> OpenAPIPetstoreRequest req contentType res accept Source #

_setBodyBS :: OpenAPIPetstoreRequest req contentType res accept -> ByteString -> OpenAPIPetstoreRequest req contentType res accept Source #

_setBodyLBS :: OpenAPIPetstoreRequest req contentType res accept -> ByteString -> OpenAPIPetstoreRequest req contentType res accept Source #

_hasAuthType :: AuthMethod authMethod => OpenAPIPetstoreRequest req contentType res accept -> Proxy authMethod -> OpenAPIPetstoreRequest req contentType res accept Source #

Params Utils

OpenAPI 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" (Query) or "formData" (Form)

_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 #

AuthMethods

class Typeable a => AuthMethod a where Source #

Provides a method to apply auth methods to requests

Minimal complete definition

applyAuthMethod

Methods

applyAuthMethod :: OpenAPIPetstoreConfig -> a -> OpenAPIPetstoreRequest req contentType res accept -> IO (OpenAPIPetstoreRequest req contentType res accept) Source #

data AnyAuthMethod Source #

An existential wrapper for any AuthMethod

Constructors

AuthMethod a => AnyAuthMethod a 

Instances

AuthMethod AnyAuthMethod Source # 

Methods

applyAuthMethod :: OpenAPIPetstoreConfig -> AnyAuthMethod -> OpenAPIPetstoreRequest req contentType res accept -> IO (OpenAPIPetstoreRequest req contentType res accept) Source #

_applyAuthMethods :: OpenAPIPetstoreRequest req contentType res accept -> OpenAPIPetstoreConfig -> IO (OpenAPIPetstoreRequest req contentType res accept) Source #

apply all matching AuthMethods in config to request

Utils

_omitNulls :: [(Text, Value)] -> Value Source #

Removes Null fields. (OpenAPI-Specification 2.0 does not allow Null in JSON)

_toFormItem :: (ToHttpApiData a, Functor f) => t -> f a -> f (t, [Text]) Source #

Encodes fields using WH.toQueryParam

_emptyToNothing :: Maybe String -> Maybe String Source #

Collapse (Just "") to Nothing

_memptyToNothing :: (Monoid a, Eq a) => Maybe a -> Maybe a Source #

Collapse (Just mempty) to Nothing

DateTime Formatting

newtype DateTime Source #

Constructors

DateTime 

Fields

Instances

Eq DateTime Source # 
Data DateTime Source # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> DateTime -> c DateTime #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c DateTime #

toConstr :: DateTime -> Constr #

dataTypeOf :: DateTime -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c DateTime) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c DateTime) #

gmapT :: (forall b. Data b => b -> b) -> DateTime -> DateTime #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> DateTime -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> DateTime -> r #

gmapQ :: (forall d. Data d => d -> u) -> DateTime -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> DateTime -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> DateTime -> m DateTime #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> DateTime -> m DateTime #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> DateTime -> m DateTime #

Ord DateTime Source # 
Show DateTime Source # 
ToJSON DateTime Source # 
FromJSON DateTime Source # 
NFData DateTime Source # 

Methods

rnf :: DateTime -> () #

ToHttpApiData DateTime Source # 
FromHttpApiData DateTime Source # 
FormatTime DateTime Source # 
ParseTime DateTime Source # 
MimeRender MimeMultipartFormData DateTime Source # 

_readDateTime :: (ParseTime t, Monad m, Alternative m) => String -> m t Source #

_parseISO8601

_showDateTime :: (t ~ UTCTime, FormatTime t) => t -> String Source #

TI.formatISO8601Millis

_parseISO8601 :: (ParseTime t, Monad m, Alternative m) => String -> m t Source #

parse an ISO8601 date-time string

Date Formatting

newtype Date Source #

Constructors

Date 

Fields

Instances

Enum Date Source # 

Methods

succ :: Date -> Date #

pred :: Date -> Date #

toEnum :: Int -> Date #

fromEnum :: Date -> Int #

enumFrom :: Date -> [Date] #

enumFromThen :: Date -> Date -> [Date] #

enumFromTo :: Date -> Date -> [Date] #

enumFromThenTo :: Date -> Date -> Date -> [Date] #

Eq Date Source # 

Methods

(==) :: Date -> Date -> Bool #

(/=) :: Date -> Date -> Bool #

Data Date Source # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Date -> c Date #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Date #

toConstr :: Date -> Constr #

dataTypeOf :: Date -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c Date) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Date) #

gmapT :: (forall b. Data b => b -> b) -> Date -> Date #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Date -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Date -> r #

gmapQ :: (forall d. Data d => d -> u) -> Date -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Date -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Date -> m Date #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Date -> m Date #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Date -> m Date #

Ord Date Source # 

Methods

compare :: Date -> Date -> Ordering #

(<) :: Date -> Date -> Bool #

(<=) :: Date -> Date -> Bool #

(>) :: Date -> Date -> Bool #

(>=) :: Date -> Date -> Bool #

max :: Date -> Date -> Date #

min :: Date -> Date -> Date #

Show Date Source # 

Methods

showsPrec :: Int -> Date -> ShowS #

show :: Date -> String #

showList :: [Date] -> ShowS #

Ix Date Source # 

Methods

range :: (Date, Date) -> [Date] #

index :: (Date, Date) -> Date -> Int #

unsafeIndex :: (Date, Date) -> Date -> Int

inRange :: (Date, Date) -> Date -> Bool #

rangeSize :: (Date, Date) -> Int #

unsafeRangeSize :: (Date, Date) -> Int

ToJSON Date Source # 
FromJSON Date Source # 
NFData Date Source # 

Methods

rnf :: Date -> () #

ToHttpApiData Date Source # 
FromHttpApiData Date Source # 
FormatTime Date Source # 
ParseTime Date Source # 

Methods

buildTime :: TimeLocale -> [(Char, String)] -> Maybe Date #

MimeRender MimeMultipartFormData Date Source # 

_readDate :: (ParseTime t, Monad m) => String -> m t Source #

TI.parseTimeM True TI.defaultTimeLocale "%Y-%m-%d"

_showDate :: FormatTime t => t -> String Source #

TI.formatTime TI.defaultTimeLocale "%Y-%m-%d"

Byte/Binary Formatting

newtype ByteArray Source #

base64 encoded characters

Constructors

ByteArray 

Instances

Eq ByteArray Source # 
Data ByteArray Source # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ByteArray -> c ByteArray #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c ByteArray #

toConstr :: ByteArray -> Constr #

dataTypeOf :: ByteArray -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c ByteArray) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ByteArray) #

gmapT :: (forall b. Data b => b -> b) -> ByteArray -> ByteArray #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ByteArray -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ByteArray -> r #

gmapQ :: (forall d. Data d => d -> u) -> ByteArray -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> ByteArray -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> ByteArray -> m ByteArray #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ByteArray -> m ByteArray #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ByteArray -> m ByteArray #

Ord ByteArray Source # 
Show ByteArray Source # 
ToJSON ByteArray Source # 
FromJSON ByteArray Source # 
NFData ByteArray Source # 

Methods

rnf :: ByteArray -> () #

ToHttpApiData ByteArray Source # 
FromHttpApiData ByteArray Source # 
MimeRender MimeMultipartFormData ByteArray Source # 

_readByteArray :: Monad m => Text -> m ByteArray Source #

read base64 encoded characters

_showByteArray :: ByteArray -> Text Source #

show base64 encoded characters

newtype Binary Source #

any sequence of octets

Constructors

Binary 

Fields

Instances

Eq Binary Source # 

Methods

(==) :: Binary -> Binary -> Bool #

(/=) :: Binary -> Binary -> Bool #

Data Binary Source # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Binary -> c Binary #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Binary #

toConstr :: Binary -> Constr #

dataTypeOf :: Binary -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c Binary) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Binary) #

gmapT :: (forall b. Data b => b -> b) -> Binary -> Binary #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Binary -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Binary -> r #

gmapQ :: (forall d. Data d => d -> u) -> Binary -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Binary -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Binary -> m Binary #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Binary -> m Binary #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Binary -> m Binary #

Ord Binary Source # 
Show Binary Source # 
ToJSON Binary Source # 
FromJSON Binary Source # 
NFData Binary Source # 

Methods

rnf :: Binary -> () #

ToHttpApiData Binary Source # 
FromHttpApiData Binary Source # 
MimeRender MimeMultipartFormData Binary Source # 

Lens Type Aliases

type Lens_' s a = Lens_ s s a a Source #

type Lens_ s t a b = forall (f :: * -> *). Functor f => (a -> f b) -> s -> f t Source #

\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/OpenAPIPetstore-Logging.html b/samples/client/petstore/haskell-http-client/docs/OpenAPIPetstore-Logging.html index fcdba37542..262881c1c6 100644 --- a/samples/client/petstore/haskell-http-client/docs/OpenAPIPetstore-Logging.html +++ b/samples/client/petstore/haskell-http-client/docs/OpenAPIPetstore-Logging.html @@ -1,4 +1,4 @@ OpenAPIPetstore.Logging

openapi-petstore-0.1.0.0: Auto-generated openapi-petstore API Client

Safe HaskellNone
LanguageHaskell2010

OpenAPIPetstore.Logging

Contents

Description

Katip Logging functions

Synopsis

Type Aliases (for compatibility)

type LogExecWithContext = forall m. MonadIO m => LogContext -> LogExec m Source #

Runs a Katip logging block with the Log environment

type LogExec m = forall a. KatipT m a -> m a Source #

A Katip logging block

type LogContext = LogEnv Source #

A Katip Log environment

type LogLevel = Severity Source #

A Katip Log severity

default logger

initLogContext :: IO LogContext Source #

the default log environment

runDefaultLogExecWithContext :: LogExecWithContext Source #

Runs a Katip logging block with the Log environment

stdout logger

stdoutLoggingExec :: LogExecWithContext Source #

Runs a Katip logging block with the Log environment

stdoutLoggingContext :: LogContext -> IO LogContext Source #

A Katip Log environment which targets stdout

stderr logger

stderrLoggingExec :: LogExecWithContext Source #

Runs a Katip logging block with the Log environment

stderrLoggingContext :: LogContext -> IO LogContext Source #

A Katip Log environment which targets stderr

Null logger

runNullLogExec :: LogExecWithContext Source #

Disables Katip logging

Log Msg

_log :: (Applicative m, Katip m) => Text -> LogLevel -> Text -> m () Source #

Log a katip message

Log Exceptions

logExceptions :: (Katip m, MonadCatch m, Applicative m) => Text -> m a -> m a Source #

re-throws exceptions after logging them

Log Level

\ No newline at end of file +

openapi-petstore-0.1.0.0: Auto-generated openapi-petstore API Client

Safe HaskellNone
LanguageHaskell2010

OpenAPIPetstore.Logging

Contents

Description

Katip Logging functions

Synopsis

Type Aliases (for compatibility)

type LogExecWithContext = forall m. MonadIO m => LogContext -> LogExec m Source #

Runs a Katip logging block with the Log environment

type LogExec m = forall a. KatipT m a -> m a Source #

A Katip logging block

type LogContext = LogEnv Source #

A Katip Log environment

type LogLevel = Severity Source #

A Katip Log severity

default logger

initLogContext :: IO LogContext Source #

the default log environment

runDefaultLogExecWithContext :: LogExecWithContext Source #

Runs a Katip logging block with the Log environment

stdout logger

stdoutLoggingExec :: LogExecWithContext Source #

Runs a Katip logging block with the Log environment

stdoutLoggingContext :: LogContext -> IO LogContext Source #

A Katip Log environment which targets stdout

stderr logger

stderrLoggingExec :: LogExecWithContext Source #

Runs a Katip logging block with the Log environment

stderrLoggingContext :: LogContext -> IO LogContext Source #

A Katip Log environment which targets stderr

Null logger

runNullLogExec :: LogExecWithContext Source #

Disables Katip logging

Log Msg

_log :: (Applicative m, Katip m) => Text -> LogLevel -> Text -> m () Source #

Log a katip message

Log Exceptions

logExceptions :: (Katip m, MonadCatch m, Applicative m) => Text -> m a -> m a Source #

re-throws exceptions after logging them

Log Level

\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/OpenAPIPetstore-MimeTypes.html b/samples/client/petstore/haskell-http-client/docs/OpenAPIPetstore-MimeTypes.html index c4918b19e2..7d74e989a7 100644 --- a/samples/client/petstore/haskell-http-client/docs/OpenAPIPetstore-MimeTypes.html +++ b/samples/client/petstore/haskell-http-client/docs/OpenAPIPetstore-MimeTypes.html @@ -1,4 +1,4 @@ OpenAPIPetstore.MimeTypes

openapi-petstore-0.1.0.0: Auto-generated openapi-petstore API Client

Safe HaskellNone
LanguageHaskell2010

OpenAPIPetstore.MimeTypes

Contents

Description

 

Synopsis

ContentType MimeType

data ContentType a Source #

Constructors

MimeType a => ContentType 

Fields

Accept MimeType

data Accept a Source #

Constructors

MimeType a => Accept 

Fields

Consumes Class

class MimeType mtype => Consumes req mtype Source #

Produces Class

class MimeType mtype => Produces req mtype Source #

Instances

Produces UpdateUser MimeNoContent Source # 
Produces LogoutUser MimeNoContent Source # 
Produces LoginUser MimeXML Source #
application/xml
Produces LoginUser MimeJSON Source #
application/json
Produces GetUserByName MimeXML Source #
application/xml
Produces GetUserByName MimeJSON Source #
application/json
Produces DeleteUser MimeNoContent Source # 
Produces CreateUsersWithListInput MimeNoContent Source # 
Produces CreateUsersWithArrayInput MimeNoContent Source # 
Produces CreateUser MimeNoContent Source # 
Produces PlaceOrder MimeXML Source #
application/xml
Produces PlaceOrder MimeJSON Source #
application/json
Produces GetOrderById MimeXML Source #
application/xml
Produces GetOrderById MimeJSON Source #
application/json
Produces GetInventory MimeJSON Source #
application/json
Produces DeleteOrder MimeNoContent Source # 
Produces UploadFile MimeJSON Source #
application/json
Produces UpdatePetWithForm MimeNoContent Source # 
Produces UpdatePet MimeNoContent Source # 
Produces GetPetById MimeXML Source #
application/xml
Produces GetPetById MimeJSON Source #
application/json
Produces FindPetsByTags MimeXML Source #
application/xml
Produces FindPetsByTags MimeJSON Source #
application/json
Produces FindPetsByStatus MimeXML Source #
application/xml
Produces FindPetsByStatus MimeJSON Source #
application/json
Produces DeletePet MimeNoContent Source # 
Produces AddPet MimeNoContent Source # 
Produces TestClassname MimeJSON Source #
application/json
Produces TestJsonFormData MimeNoContent Source # 
Produces TestInlineAdditionalProperties MimeNoContent Source # 
Produces TestEnumParameters MimeNoContent Source # 
Produces TestEndpointParameters MimeNoContent Source # 
Produces TestClientModel MimeJSON Source #
application/json
MimeType mtype => Produces FakeOuterStringSerialize mtype Source #
*/*
MimeType mtype => Produces FakeOuterNumberSerialize mtype Source #
*/*
MimeType mtype => Produces FakeOuterCompositeSerialize mtype Source #
*/*
MimeType mtype => Produces FakeOuterBooleanSerialize mtype Source #
*/*
Produces TestSpecialTags MimeJSON Source #
application/json

Default Mime Types

data MimeJSON Source #

Constructors

MimeJSON 

Instances

MimeType MimeJSON Source #
application/json; charset=utf-8
FromJSON a => MimeUnrender MimeJSON a Source #
A.eitherDecode
ToJSON a => MimeRender MimeJSON a Source #

encode

Produces LoginUser MimeJSON Source #
application/json
Produces GetUserByName MimeJSON Source #
application/json
Produces PlaceOrder MimeJSON Source #
application/json
Produces GetOrderById MimeJSON Source #
application/json
Produces GetInventory MimeJSON Source #
application/json
Produces UploadFile MimeJSON Source #
application/json
Produces GetPetById MimeJSON Source #
application/json
Produces FindPetsByTags MimeJSON Source #
application/json
Produces FindPetsByStatus MimeJSON Source #
application/json
Produces TestClassname MimeJSON Source #
application/json
Produces TestClientModel MimeJSON Source #
application/json
Produces TestSpecialTags MimeJSON Source #
application/json
Consumes UpdateUser MimeJSON Source #
application/json
Consumes CreateUsersWithListInput MimeJSON Source #
application/json
Consumes CreateUsersWithArrayInput MimeJSON Source #
application/json
Consumes CreateUser MimeJSON Source #
application/json
Consumes PlaceOrder MimeJSON Source #
application/json
Consumes UpdatePet MimeJSON Source #
application/json
Consumes AddPet MimeJSON Source #
application/json
Consumes TestClassname MimeJSON Source #
application/json
Consumes TestInlineAdditionalProperties MimeJSON Source #
application/json
Consumes TestClientModel MimeJSON Source #
application/json
Consumes FakeOuterStringSerialize MimeJSON Source #
application/json
Consumes FakeOuterNumberSerialize MimeJSON Source #
application/json
Consumes FakeOuterCompositeSerialize MimeJSON Source #
application/json
Consumes FakeOuterBooleanSerialize MimeJSON Source #
application/json
Consumes TestSpecialTags MimeJSON Source #
application/json

data MimePlainText Source #

Constructors

MimePlainText 

Instances

MimeType MimePlainText Source #
text/plain; charset=utf-8
MimeUnrender MimePlainText ByteString Source #
P.Right . P.id
MimeUnrender MimePlainText String Source #
P.Right . BCL.unpack
MimeUnrender MimePlainText Text Source #
P.left P.show . TL.decodeUtf8'
MimeRender MimePlainText ByteString Source #
P.id
MimeRender MimePlainText String Source #
BCL.pack
MimeRender MimePlainText Text Source #
BL.fromStrict . T.encodeUtf8

data MimeMultipartFormData Source #

Constructors

MimeMultipartFormData 

Instances

MimeType MimeMultipartFormData Source #
multipart/form-data
MimeRender MimeMultipartFormData Bool Source # 
MimeRender MimeMultipartFormData Char Source # 
MimeRender MimeMultipartFormData Double Source # 
MimeRender MimeMultipartFormData Float Source # 
MimeRender MimeMultipartFormData Int Source # 
MimeRender MimeMultipartFormData Integer Source # 
MimeRender MimeMultipartFormData ByteString Source # 
MimeRender MimeMultipartFormData String Source # 
MimeRender MimeMultipartFormData Text Source # 
MimeRender MimeMultipartFormData Binary Source # 
MimeRender MimeMultipartFormData ByteArray Source # 
MimeRender MimeMultipartFormData Date Source # 
MimeRender MimeMultipartFormData DateTime Source # 
MimeRender MimeMultipartFormData OuterEnum Source # 
MimeRender MimeMultipartFormData EnumClass Source # 
MimeRender MimeMultipartFormData E'Status2 Source # 
MimeRender MimeMultipartFormData E'Status Source # 
MimeRender MimeMultipartFormData E'JustSymbol Source # 
MimeRender MimeMultipartFormData E'Inner Source # 
MimeRender MimeMultipartFormData E'EnumString Source # 
MimeRender MimeMultipartFormData E'EnumQueryInteger Source # 
MimeRender MimeMultipartFormData E'EnumNumber Source # 
MimeRender MimeMultipartFormData E'EnumInteger Source # 
MimeRender MimeMultipartFormData E'EnumFormStringArray Source # 
MimeRender MimeMultipartFormData E'EnumFormString Source # 
MimeRender MimeMultipartFormData E'ArrayEnum Source # 
Consumes UploadFile MimeMultipartFormData Source #
multipart/form-data

data MimeOctetStream Source #

Constructors

MimeOctetStream 

Instances

MimeType MimeOctetStream Source #
application/octet-stream
MimeUnrender MimeOctetStream ByteString Source #
P.Right . P.id
MimeUnrender MimeOctetStream String Source #
P.Right . BCL.unpack
MimeUnrender MimeOctetStream Text Source #
P.left P.show . T.decodeUtf8' . BL.toStrict
MimeRender MimeOctetStream ByteString Source #
P.id
MimeRender MimeOctetStream String Source #
BCL.pack
MimeRender MimeOctetStream Text Source #
BL.fromStrict . T.encodeUtf8

data MimeNoContent Source #

Constructors

MimeNoContent 

MimeType Class

class Typeable mtype => MimeType mtype where Source #

Minimal complete definition

mimeType | mimeTypes

Instances

MimeType MimeAny Source #
"*/*"
MimeType MimeNoContent Source # 
MimeType MimeOctetStream Source #
application/octet-stream
MimeType MimeMultipartFormData Source #
multipart/form-data
MimeType MimeFormUrlEncoded Source #
application/x-www-form-urlencoded
MimeType MimePlainText Source #
text/plain; charset=utf-8
MimeType MimeXML Source #
application/xml; charset=utf-8
MimeType MimeJSON Source #
application/json; charset=utf-8

MimeRender Class

class MimeType mtype => MimeRender mtype x where Source #

Minimal complete definition

mimeRender

Methods

mimeRender :: Proxy mtype -> x -> ByteString Source #

mimeRender' :: mtype -> x -> ByteString Source #

Instances

MimeRender MimeNoContent NoContent Source #
P.Right . P.const NoContent
MimeRender MimeOctetStream ByteString Source #
P.id
MimeRender MimeOctetStream String Source #
BCL.pack
MimeRender MimeOctetStream Text Source #
BL.fromStrict . T.encodeUtf8
MimeRender MimeMultipartFormData Bool Source # 
MimeRender MimeMultipartFormData Char Source # 
MimeRender MimeMultipartFormData Double Source # 
MimeRender MimeMultipartFormData Float Source # 
MimeRender MimeMultipartFormData Int Source # 
MimeRender MimeMultipartFormData Integer Source # 
MimeRender MimeMultipartFormData ByteString Source # 
MimeRender MimeMultipartFormData String Source # 
MimeRender MimeMultipartFormData Text Source # 
MimeRender MimeMultipartFormData Binary Source # 
MimeRender MimeMultipartFormData ByteArray Source # 
MimeRender MimeMultipartFormData Date Source # 
MimeRender MimeMultipartFormData DateTime Source # 
MimeRender MimeMultipartFormData OuterEnum Source # 
MimeRender MimeMultipartFormData EnumClass Source # 
MimeRender MimeMultipartFormData E'Status2 Source # 
MimeRender MimeMultipartFormData E'Status Source # 
MimeRender MimeMultipartFormData E'JustSymbol Source # 
MimeRender MimeMultipartFormData E'Inner Source # 
MimeRender MimeMultipartFormData E'EnumString Source # 
MimeRender MimeMultipartFormData E'EnumQueryInteger Source # 
MimeRender MimeMultipartFormData E'EnumNumber Source # 
MimeRender MimeMultipartFormData E'EnumInteger Source # 
MimeRender MimeMultipartFormData E'EnumFormStringArray Source # 
MimeRender MimeMultipartFormData E'EnumFormString Source # 
MimeRender MimeMultipartFormData E'ArrayEnum Source # 
ToForm a => MimeRender MimeFormUrlEncoded a Source #
WH.urlEncodeAsForm
MimeRender MimePlainText ByteString Source #
P.id
MimeRender MimePlainText String Source #
BCL.pack
MimeRender MimePlainText Text Source #
BL.fromStrict . T.encodeUtf8
ToJSON a => MimeRender MimeJSON a Source #

encode

MimeUnrender Class

class MimeType mtype => MimeUnrender mtype o where Source #

Minimal complete definition

mimeUnrender

Instances

MimeUnrender MimeNoContent NoContent Source #
P.Right . P.const NoContent
MimeUnrender MimeOctetStream ByteString Source #
P.Right . P.id
MimeUnrender MimeOctetStream String Source #
P.Right . BCL.unpack
MimeUnrender MimeOctetStream Text Source #
P.left P.show . T.decodeUtf8' . BL.toStrict
FromForm a => MimeUnrender MimeFormUrlEncoded a Source #
P.left T.unpack . WH.urlDecodeAsForm
MimeUnrender MimePlainText ByteString Source #
P.Right . P.id
MimeUnrender MimePlainText String Source #
P.Right . BCL.unpack
MimeUnrender MimePlainText Text Source #
P.left P.show . TL.decodeUtf8'
FromJSON a => MimeUnrender MimeJSON a Source #
A.eitherDecode
\ No newline at end of file +

openapi-petstore-0.1.0.0: Auto-generated openapi-petstore API Client

Safe HaskellNone
LanguageHaskell2010

OpenAPIPetstore.MimeTypes

Contents

Description

 

Synopsis

ContentType MimeType

data ContentType a Source #

Constructors

MimeType a => ContentType 

Fields

Accept MimeType

data Accept a Source #

Constructors

MimeType a => Accept 

Fields

Consumes Class

class MimeType mtype => Consumes req mtype Source #

Produces Class

class MimeType mtype => Produces req mtype Source #

Instances

Produces UpdateUser MimeNoContent Source # 
Produces LogoutUser MimeNoContent Source # 
Produces LoginUser MimeXML Source #
application/xml
Produces LoginUser MimeJSON Source #
application/json
Produces GetUserByName MimeXML Source #
application/xml
Produces GetUserByName MimeJSON Source #
application/json
Produces DeleteUser MimeNoContent Source # 
Produces CreateUsersWithListInput MimeNoContent Source # 
Produces CreateUsersWithArrayInput MimeNoContent Source # 
Produces CreateUser MimeNoContent Source # 
Produces PlaceOrder MimeXML Source #
application/xml
Produces PlaceOrder MimeJSON Source #
application/json
Produces GetOrderById MimeXML Source #
application/xml
Produces GetOrderById MimeJSON Source #
application/json
Produces GetInventory MimeJSON Source #
application/json
Produces DeleteOrder MimeNoContent Source # 
Produces UploadFile MimeJSON Source #
application/json
Produces UpdatePetWithForm MimeNoContent Source # 
Produces UpdatePet MimeNoContent Source # 
Produces GetPetById MimeXML Source #
application/xml
Produces GetPetById MimeJSON Source #
application/json
Produces FindPetsByTags MimeXML Source #
application/xml
Produces FindPetsByTags MimeJSON Source #
application/json
Produces FindPetsByStatus MimeXML Source #
application/xml
Produces FindPetsByStatus MimeJSON Source #
application/json
Produces DeletePet MimeNoContent Source # 
Produces AddPet MimeNoContent Source # 
Produces TestClassname MimeJSON Source #
application/json
Produces TestJsonFormData MimeNoContent Source # 
Produces TestInlineAdditionalProperties MimeNoContent Source # 
Produces TestEnumParameters MimeNoContent Source # 
Produces TestEndpointParameters MimeNoContent Source # 
Produces TestClientModel MimeJSON Source #
application/json
MimeType mtype => Produces FakeOuterStringSerialize mtype Source #
*/*
MimeType mtype => Produces FakeOuterNumberSerialize mtype Source #
*/*
MimeType mtype => Produces FakeOuterCompositeSerialize mtype Source #
*/*
MimeType mtype => Produces FakeOuterBooleanSerialize mtype Source #
*/*
Produces TestSpecialTags MimeJSON Source #
application/json

Default Mime Types

data MimeJSON Source #

Constructors

MimeJSON 

Instances

MimeType MimeJSON Source #
application/json; charset=utf-8
FromJSON a => MimeUnrender MimeJSON a Source #
A.eitherDecode
ToJSON a => MimeRender MimeJSON a Source #

encode

Produces LoginUser MimeJSON Source #
application/json
Produces GetUserByName MimeJSON Source #
application/json
Produces PlaceOrder MimeJSON Source #
application/json
Produces GetOrderById MimeJSON Source #
application/json
Produces GetInventory MimeJSON Source #
application/json
Produces UploadFile MimeJSON Source #
application/json
Produces GetPetById MimeJSON Source #
application/json
Produces FindPetsByTags MimeJSON Source #
application/json
Produces FindPetsByStatus MimeJSON Source #
application/json
Produces TestClassname MimeJSON Source #
application/json
Produces TestClientModel MimeJSON Source #
application/json
Produces TestSpecialTags MimeJSON Source #
application/json
Consumes UpdateUser MimeJSON Source #
application/json
Consumes CreateUsersWithListInput MimeJSON Source #
application/json
Consumes CreateUsersWithArrayInput MimeJSON Source #
application/json
Consumes CreateUser MimeJSON Source #
application/json
Consumes PlaceOrder MimeJSON Source #
application/json
Consumes UpdatePet MimeJSON Source #
application/json
Consumes AddPet MimeJSON Source #
application/json
Consumes TestClassname MimeJSON Source #
application/json
Consumes TestInlineAdditionalProperties MimeJSON Source #
application/json
Consumes TestClientModel MimeJSON Source #
application/json
Consumes FakeOuterStringSerialize MimeJSON Source #
application/json
Consumes FakeOuterNumberSerialize MimeJSON Source #
application/json
Consumes FakeOuterCompositeSerialize MimeJSON Source #
application/json
Consumes FakeOuterBooleanSerialize MimeJSON Source #
application/json
Consumes TestSpecialTags MimeJSON Source #
application/json

data MimePlainText Source #

Constructors

MimePlainText 

Instances

MimeType MimePlainText Source #
text/plain; charset=utf-8
MimeUnrender MimePlainText ByteString Source #
P.Right . P.id
MimeUnrender MimePlainText String Source #
P.Right . BCL.unpack
MimeUnrender MimePlainText Text Source #
P.left P.show . TL.decodeUtf8'
MimeRender MimePlainText ByteString Source #
P.id
MimeRender MimePlainText String Source #
BCL.pack
MimeRender MimePlainText Text Source #
BL.fromStrict . T.encodeUtf8

data MimeMultipartFormData Source #

Constructors

MimeMultipartFormData 

Instances

MimeType MimeMultipartFormData Source #
multipart/form-data
MimeRender MimeMultipartFormData Bool Source # 
MimeRender MimeMultipartFormData Char Source # 
MimeRender MimeMultipartFormData Double Source # 
MimeRender MimeMultipartFormData Float Source # 
MimeRender MimeMultipartFormData Int Source # 
MimeRender MimeMultipartFormData Integer Source # 
MimeRender MimeMultipartFormData ByteString Source # 
MimeRender MimeMultipartFormData String Source # 
MimeRender MimeMultipartFormData Text Source # 
MimeRender MimeMultipartFormData Binary Source # 
MimeRender MimeMultipartFormData ByteArray Source # 
MimeRender MimeMultipartFormData Date Source # 
MimeRender MimeMultipartFormData DateTime Source # 
MimeRender MimeMultipartFormData OuterEnum Source # 
MimeRender MimeMultipartFormData EnumClass Source # 
MimeRender MimeMultipartFormData E'Status2 Source # 
MimeRender MimeMultipartFormData E'Status Source # 
MimeRender MimeMultipartFormData E'JustSymbol Source # 
MimeRender MimeMultipartFormData E'Inner Source # 
MimeRender MimeMultipartFormData E'EnumString Source # 
MimeRender MimeMultipartFormData E'EnumQueryInteger Source # 
MimeRender MimeMultipartFormData E'EnumNumber Source # 
MimeRender MimeMultipartFormData E'EnumInteger Source # 
MimeRender MimeMultipartFormData E'EnumFormStringArray Source # 
MimeRender MimeMultipartFormData E'EnumFormString Source # 
MimeRender MimeMultipartFormData E'ArrayEnum Source # 
Consumes UploadFile MimeMultipartFormData Source #
multipart/form-data

data MimeOctetStream Source #

Constructors

MimeOctetStream 

Instances

MimeType MimeOctetStream Source #
application/octet-stream
MimeUnrender MimeOctetStream ByteString Source #
P.Right . P.id
MimeUnrender MimeOctetStream String Source #
P.Right . BCL.unpack
MimeUnrender MimeOctetStream Text Source #
P.left P.show . T.decodeUtf8' . BL.toStrict
MimeRender MimeOctetStream ByteString Source #
P.id
MimeRender MimeOctetStream String Source #
BCL.pack
MimeRender MimeOctetStream Text Source #
BL.fromStrict . T.encodeUtf8

data MimeNoContent Source #

Constructors

MimeNoContent 

MimeType Class

class Typeable mtype => MimeType mtype where Source #

Minimal complete definition

mimeType | mimeTypes

Instances

MimeType MimeAny Source #
"*/*"
MimeType MimeNoContent Source # 
MimeType MimeOctetStream Source #
application/octet-stream
MimeType MimeMultipartFormData Source #
multipart/form-data
MimeType MimeFormUrlEncoded Source #
application/x-www-form-urlencoded
MimeType MimePlainText Source #
text/plain; charset=utf-8
MimeType MimeXML Source #
application/xml; charset=utf-8
MimeType MimeJSON Source #
application/json; charset=utf-8

MimeRender Class

class MimeType mtype => MimeRender mtype x where Source #

Minimal complete definition

mimeRender

Methods

mimeRender :: Proxy mtype -> x -> ByteString Source #

mimeRender' :: mtype -> x -> ByteString Source #

Instances

MimeRender MimeNoContent NoContent Source #
P.Right . P.const NoContent
MimeRender MimeOctetStream ByteString Source #
P.id
MimeRender MimeOctetStream String Source #
BCL.pack
MimeRender MimeOctetStream Text Source #
BL.fromStrict . T.encodeUtf8
MimeRender MimeMultipartFormData Bool Source # 
MimeRender MimeMultipartFormData Char Source # 
MimeRender MimeMultipartFormData Double Source # 
MimeRender MimeMultipartFormData Float Source # 
MimeRender MimeMultipartFormData Int Source # 
MimeRender MimeMultipartFormData Integer Source # 
MimeRender MimeMultipartFormData ByteString Source # 
MimeRender MimeMultipartFormData String Source # 
MimeRender MimeMultipartFormData Text Source # 
MimeRender MimeMultipartFormData Binary Source # 
MimeRender MimeMultipartFormData ByteArray Source # 
MimeRender MimeMultipartFormData Date Source # 
MimeRender MimeMultipartFormData DateTime Source # 
MimeRender MimeMultipartFormData OuterEnum Source # 
MimeRender MimeMultipartFormData EnumClass Source # 
MimeRender MimeMultipartFormData E'Status2 Source # 
MimeRender MimeMultipartFormData E'Status Source # 
MimeRender MimeMultipartFormData E'JustSymbol Source # 
MimeRender MimeMultipartFormData E'Inner Source # 
MimeRender MimeMultipartFormData E'EnumString Source # 
MimeRender MimeMultipartFormData E'EnumQueryInteger Source # 
MimeRender MimeMultipartFormData E'EnumNumber Source # 
MimeRender MimeMultipartFormData E'EnumInteger Source # 
MimeRender MimeMultipartFormData E'EnumFormStringArray Source # 
MimeRender MimeMultipartFormData E'EnumFormString Source # 
MimeRender MimeMultipartFormData E'ArrayEnum Source # 
ToForm a => MimeRender MimeFormUrlEncoded a Source #
WH.urlEncodeAsForm
MimeRender MimePlainText ByteString Source #
P.id
MimeRender MimePlainText String Source #
BCL.pack
MimeRender MimePlainText Text Source #
BL.fromStrict . T.encodeUtf8
ToJSON a => MimeRender MimeJSON a Source #

encode

MimeUnrender Class

class MimeType mtype => MimeUnrender mtype o where Source #

Minimal complete definition

mimeUnrender

Instances

MimeUnrender MimeNoContent NoContent Source #
P.Right . P.const NoContent
MimeUnrender MimeOctetStream ByteString Source #
P.Right . P.id
MimeUnrender MimeOctetStream String Source #
P.Right . BCL.unpack
MimeUnrender MimeOctetStream Text Source #
P.left P.show . T.decodeUtf8' . BL.toStrict
FromForm a => MimeUnrender MimeFormUrlEncoded a Source #
P.left T.unpack . WH.urlDecodeAsForm
MimeUnrender MimePlainText ByteString Source #
P.Right . P.id
MimeUnrender MimePlainText String Source #
P.Right . BCL.unpack
MimeUnrender MimePlainText Text Source #
P.left P.show . TL.decodeUtf8'
FromJSON a => MimeUnrender MimeJSON a Source #
A.eitherDecode
\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/OpenAPIPetstore-Model.html b/samples/client/petstore/haskell-http-client/docs/OpenAPIPetstore-Model.html index 7bb3dd605f..09275b3466 100644 --- a/samples/client/petstore/haskell-http-client/docs/OpenAPIPetstore-Model.html +++ b/samples/client/petstore/haskell-http-client/docs/OpenAPIPetstore-Model.html @@ -1,11 +1,11 @@ OpenAPIPetstore.Model

openapi-petstore-0.1.0.0: Auto-generated openapi-petstore API Client

Safe HaskellNone
LanguageHaskell2010

OpenAPIPetstore.Model

Contents

Description

 

Synopsis

Parameter newtypes

AdditionalMetadata

ApiKey

newtype ApiKey Source #

Constructors

ApiKey 

Fields

Instances

Body

newtype Body Source #

Constructors

Body 

Fields

Instances

Eq Body Source # 

Methods

(==) :: Body -> Body -> Bool #

(/=) :: Body -> Body -> Bool #

Show Body Source # 

Methods

showsPrec :: Int -> Body -> ShowS #

show :: Body -> String #

showList :: [Body] -> ShowS #

ToJSON Body Source # 
HasBodyParam FakeOuterNumberSerialize Body Source #

Body Param "body" - Input number as post body

BodyBool

BodyText

Byte

newtype Byte Source #

Constructors

Byte 

Fields

Instances

Eq Byte Source # 

Methods

(==) :: Byte -> Byte -> Bool #

(/=) :: Byte -> Byte -> Bool #

Show Byte Source # 

Methods

showsPrec :: Int -> Byte -> ShowS #

show :: Byte -> String #

showList :: [Byte] -> ShowS #

Callback

EnumFormString

EnumFormStringArray

EnumHeaderString

EnumHeaderStringArray

EnumQueryDouble

EnumQueryInteger

EnumQueryString

EnumQueryStringArray

File

newtype File Source #

Constructors

File 

Fields

Instances

Eq File Source # 

Methods

(==) :: File -> File -> Bool #

(/=) :: File -> File -> Bool #

Show File Source # 

Methods

showsPrec :: Int -> File -> ShowS #

show :: File -> String #

showList :: [File] -> ShowS #

HasOptionalParam UploadFile File Source #

Optional Param "file" - file to upload

Methods

applyOptionalParam :: OpenAPIPetstoreRequest UploadFile contentType res accept -> File -> OpenAPIPetstoreRequest UploadFile contentType res accept Source #

(-&-) :: OpenAPIPetstoreRequest UploadFile contentType res accept -> File -> OpenAPIPetstoreRequest UploadFile contentType res accept Source #

Int32

newtype Int32 Source #

Constructors

Int32 

Fields

Int64

newtype Int64 Source #

Constructors

Int64 

Fields

Name2

newtype Name2 Source #

Constructors

Name2 

Fields

Instances

Eq Name2 Source # 

Methods

(==) :: Name2 -> Name2 -> Bool #

(/=) :: Name2 -> Name2 -> Bool #

Show Name2 Source # 

Methods

showsPrec :: Int -> Name2 -> ShowS #

show :: Name2 -> String #

showList :: [Name2] -> ShowS #

HasOptionalParam UpdatePetWithForm Name2 Source #

Optional Param "name" - Updated name of the pet

Number

newtype Number Source #

Constructors

Number 

Fields

Instances

OrderId

newtype OrderId Source #

Constructors

OrderId 

Fields

OrderIdText

Param

newtype Param Source #

Constructors

Param 

Fields

Instances

Eq Param Source # 

Methods

(==) :: Param -> Param -> Bool #

(/=) :: Param -> Param -> Bool #

Show Param Source # 

Methods

showsPrec :: Int -> Param -> ShowS #

show :: Param -> String #

showList :: [Param] -> ShowS #

Param2

newtype Param2 Source #

Constructors

Param2 

Fields

Instances

ParamBinary

ParamDate

ParamDateTime

ParamDouble

ParamFloat

ParamInteger

ParamString

Password

PatternWithoutDelimiter

PetId

newtype PetId Source #

Constructors

PetId 

Fields

Instances

Eq PetId Source # 

Methods

(==) :: PetId -> PetId -> Bool #

(/=) :: PetId -> PetId -> Bool #

Show PetId Source # 

Methods

showsPrec :: Int -> PetId -> ShowS #

show :: PetId -> String #

showList :: [PetId] -> ShowS #

RequestBody

Status

newtype Status Source #

Constructors

Status 

Fields

Instances

StatusText

Tags

newtype Tags Source #

Constructors

Tags 

Fields

Instances

Eq Tags Source # 

Methods

(==) :: Tags -> Tags -> Bool #

(/=) :: Tags -> Tags -> Bool #

Show Tags Source # 

Methods

showsPrec :: Int -> Tags -> ShowS #

show :: Tags -> String #

showList :: [Tags] -> ShowS #

User2

newtype User2 Source #

Constructors

User2 

Fields

Username

newtype Username Source #

Constructors

Username 

Fields

Models

AdditionalPropertiesClass

mkAdditionalPropertiesClass :: AdditionalPropertiesClass Source #

Construct a value of type AdditionalPropertiesClass (by applying it's required fields, if any)

Animal

data Animal Source #

Animal

Constructors

Animal 

Fields

mkAnimal Source #

Arguments

:: Text

animalClassName

-> Animal 

Construct a value of type Animal (by applying it's required fields, if any)

AnimalFarm

mkAnimalFarm :: AnimalFarm Source #

Construct a value of type AnimalFarm (by applying it's required fields, if any)

ApiResponse

mkApiResponse :: ApiResponse Source #

Construct a value of type ApiResponse (by applying it's required fields, if any)

ArrayOfArrayOfNumberOnly

mkArrayOfArrayOfNumberOnly :: ArrayOfArrayOfNumberOnly Source #

Construct a value of type ArrayOfArrayOfNumberOnly (by applying it's required fields, if any)

ArrayOfNumberOnly

mkArrayOfNumberOnly :: ArrayOfNumberOnly Source #

Construct a value of type ArrayOfNumberOnly (by applying it's required fields, if any)

ArrayTest

mkArrayTest :: ArrayTest Source #

Construct a value of type ArrayTest (by applying it's required fields, if any)

Capitalization

mkCapitalization :: Capitalization Source #

Construct a value of type Capitalization (by applying it's required fields, if any)

Cat

data Cat Source #

Cat

Constructors

Cat 

Fields

Instances

Eq Cat Source # 

Methods

(==) :: Cat -> Cat -> Bool #

(/=) :: Cat -> Cat -> Bool #

Show Cat Source # 

Methods

showsPrec :: Int -> Cat -> ShowS #

show :: Cat -> String #

showList :: [Cat] -> ShowS #

ToJSON Cat Source #

ToJSON Cat

FromJSON Cat Source #

FromJSON Cat

mkCat Source #

Arguments

:: Text

catClassName

-> Cat 

Construct a value of type Cat (by applying it's required fields, if any)

Category

mkCategory :: Category Source #

Construct a value of type Category (by applying it's required fields, if any)

ClassModel

data ClassModel Source #

ClassModel - Model for testing model with "_class" property

Constructors

ClassModel 

Fields

mkClassModel :: ClassModel Source #

Construct a value of type ClassModel (by applying it's required fields, if any)

Client

data Client Source #

Client

Constructors

Client 

Fields

Instances

Eq Client Source # 

Methods

(==) :: Client -> Client -> Bool #

(/=) :: Client -> Client -> Bool #

Show Client Source # 
ToJSON Client Source #

ToJSON Client

FromJSON Client Source #

FromJSON Client

HasBodyParam TestClassname Client Source #

Body Param Client - client model

Methods

setBodyParam :: (Consumes TestClassname contentType, MimeRender contentType Client) => OpenAPIPetstoreRequest TestClassname contentType res accept -> Client -> OpenAPIPetstoreRequest TestClassname contentType res accept Source #

HasBodyParam TestClientModel Client Source #

Body Param Client - client model

Methods

setBodyParam :: (Consumes TestClientModel contentType, MimeRender contentType Client) => OpenAPIPetstoreRequest TestClientModel contentType res accept -> Client -> OpenAPIPetstoreRequest TestClientModel contentType res accept Source #

HasBodyParam TestSpecialTags Client Source #

Body Param Client - client model

Methods

setBodyParam :: (Consumes TestSpecialTags contentType, MimeRender contentType Client) => OpenAPIPetstoreRequest TestSpecialTags contentType res accept -> Client -> OpenAPIPetstoreRequest TestSpecialTags contentType res accept Source #

mkClient :: Client Source #

Construct a value of type Client (by applying it's required fields, if any)

Dog

data Dog Source #

Dog

Constructors

Dog 

Fields

Instances

Eq Dog Source # 

Methods

(==) :: Dog -> Dog -> Bool #

(/=) :: Dog -> Dog -> Bool #

Show Dog Source # 

Methods

showsPrec :: Int -> Dog -> ShowS #

show :: Dog -> String #

showList :: [Dog] -> ShowS #

ToJSON Dog Source #

ToJSON Dog

FromJSON Dog Source #

FromJSON Dog

mkDog Source #

Arguments

:: Text

dogClassName

-> Dog 

Construct a value of type Dog (by applying it's required fields, if any)

EnumArrays

mkEnumArrays :: EnumArrays Source #

Construct a value of type EnumArrays (by applying it's required fields, if any)

EnumTest

mkEnumTest Source #

Construct a value of type EnumTest (by applying it's required fields, if any)

FormatTest

mkFormatTest Source #

Construct a value of type FormatTest (by applying it's required fields, if any)

HasOnlyReadOnly

mkHasOnlyReadOnly :: HasOnlyReadOnly Source #

Construct a value of type HasOnlyReadOnly (by applying it's required fields, if any)

MapTest

data MapTest Source #

MapTest

Constructors

MapTest 

Fields

mkMapTest :: MapTest Source #

Construct a value of type MapTest (by applying it's required fields, if any)

MixedPropertiesAndAdditionalPropertiesClass

data MixedPropertiesAndAdditionalPropertiesClass Source #

MixedPropertiesAndAdditionalPropertiesClass

Model200Response

mkModel200Response :: Model200Response Source #

Construct a value of type Model200Response (by applying it's required fields, if any)

ModelList

mkModelList :: ModelList Source #

Construct a value of type ModelList (by applying it's required fields, if any)

ModelReturn

mkModelReturn :: ModelReturn Source #

Construct a value of type ModelReturn (by applying it's required fields, if any)

Name

data Name Source #

Name - Model for testing model name same as property name

Constructors

Name 

Fields

Instances

mkName Source #

Arguments

:: Int

nameName

-> Name 

Construct a value of type Name (by applying it's required fields, if any)

NumberOnly

mkNumberOnly :: NumberOnly Source #

Construct a value of type NumberOnly (by applying it's required fields, if any)

Order

data Order Source #

Order

Constructors

Order 

Fields

Instances

Eq Order Source # 

Methods

(==) :: Order -> Order -> Bool #

(/=) :: Order -> Order -> Bool #

Show Order Source # 

Methods

showsPrec :: Int -> Order -> ShowS #

show :: Order -> String #

showList :: [Order] -> ShowS #

ToJSON Order Source #

ToJSON Order

FromJSON Order Source #

FromJSON Order

HasBodyParam PlaceOrder Order Source #

Body Param Order - order placed for purchasing the pet

Methods

setBodyParam :: (Consumes PlaceOrder contentType, MimeRender contentType Order) => OpenAPIPetstoreRequest PlaceOrder contentType res accept -> Order -> OpenAPIPetstoreRequest PlaceOrder contentType res accept Source #

mkOrder :: Order Source #

Construct a value of type Order (by applying it's required fields, if any)

OuterComposite

mkOuterComposite :: OuterComposite Source #

Construct a value of type OuterComposite (by applying it's required fields, if any)

Pet

data Pet Source #

Pet

Constructors

Pet 

Fields

Instances

Eq Pet Source # 

Methods

(==) :: Pet -> Pet -> Bool #

(/=) :: Pet -> Pet -> Bool #

Show Pet Source # 

Methods

showsPrec :: Int -> Pet -> ShowS #

show :: Pet -> String #

showList :: [Pet] -> ShowS #

ToJSON Pet Source #

ToJSON Pet

FromJSON Pet Source #

FromJSON Pet

HasBodyParam UpdatePet Pet Source #

Body Param Pet - Pet object that needs to be added to the store

Methods

setBodyParam :: (Consumes UpdatePet contentType, MimeRender contentType Pet) => OpenAPIPetstoreRequest UpdatePet contentType res accept -> Pet -> OpenAPIPetstoreRequest UpdatePet contentType res accept Source #

HasBodyParam AddPet Pet Source #

Body Param Pet - Pet object that needs to be added to the store

Methods

setBodyParam :: (Consumes AddPet contentType, MimeRender contentType Pet) => OpenAPIPetstoreRequest AddPet contentType res accept -> Pet -> OpenAPIPetstoreRequest AddPet contentType res accept Source #

mkPet Source #

Arguments

:: Text

petName

-> [Text]

petPhotoUrls

-> Pet 

Construct a value of type Pet (by applying it's required fields, if any)

ReadOnlyFirst

mkReadOnlyFirst :: ReadOnlyFirst Source #

Construct a value of type ReadOnlyFirst (by applying it's required fields, if any)

SpecialModelName

mkSpecialModelName :: SpecialModelName Source #

Construct a value of type SpecialModelName (by applying it's required fields, if any)

Tag

data Tag Source #

Tag

Constructors

Tag 

Fields

Instances

Eq Tag Source # 

Methods

(==) :: Tag -> Tag -> Bool #

(/=) :: Tag -> Tag -> Bool #

Show Tag Source # 

Methods

showsPrec :: Int -> Tag -> ShowS #

show :: Tag -> String #

showList :: [Tag] -> ShowS #

ToJSON Tag Source #

ToJSON Tag

FromJSON Tag Source #

FromJSON Tag

mkTag :: Tag Source #

Construct a value of type Tag (by applying it's required fields, if any)

User

data User Source #

User

Constructors

User 

Fields

Instances

Eq User Source # 

Methods

(==) :: User -> User -> Bool #

(/=) :: User -> User -> Bool #

Show User Source # 

Methods

showsPrec :: Int -> User -> ShowS #

show :: User -> String #

showList :: [User] -> ShowS #

ToJSON User Source #

ToJSON User

FromJSON User Source #

FromJSON User

HasBodyParam UpdateUser User Source #

Body Param User - Updated user object

Methods

setBodyParam :: (Consumes UpdateUser contentType, MimeRender contentType User) => OpenAPIPetstoreRequest UpdateUser contentType res accept -> User -> OpenAPIPetstoreRequest UpdateUser contentType res accept Source #

HasBodyParam CreateUser User Source #

Body Param User - Created user object

Methods

setBodyParam :: (Consumes CreateUser contentType, MimeRender contentType User) => OpenAPIPetstoreRequest CreateUser contentType res accept -> User -> OpenAPIPetstoreRequest CreateUser contentType res accept Source #

mkUser :: User Source #

Construct a value of type User (by applying it's required fields, if any)

Enums

E'ArrayEnum

data E'ArrayEnum Source #

Enum of Text

Constructors

E'ArrayEnum'Fish
"fish"
E'ArrayEnum'Crab
"crab"

Instances

Bounded E'ArrayEnum Source # 
Enum E'ArrayEnum Source # 
Eq E'ArrayEnum Source # 
Ord E'ArrayEnum Source # 
Show E'ArrayEnum Source # 
ToJSON E'ArrayEnum Source # 
FromJSON E'ArrayEnum Source # 
ToHttpApiData E'ArrayEnum Source # 
FromHttpApiData E'ArrayEnum Source # 
MimeRender MimeMultipartFormData E'ArrayEnum Source # 

E'EnumFormString

data E'EnumFormString Source #

Enum of Text . - Form parameter enum test (string)

Instances

Bounded E'EnumFormString Source # 
Enum E'EnumFormString Source # 
Eq E'EnumFormString Source # 
Ord E'EnumFormString Source # 
Show E'EnumFormString Source # 
ToJSON E'EnumFormString Source # 
FromJSON E'EnumFormString Source # 
ToHttpApiData E'EnumFormString Source # 
FromHttpApiData E'EnumFormString Source # 
MimeRender MimeMultipartFormData E'EnumFormString Source # 

E'EnumFormStringArray

data E'EnumFormStringArray Source #

Enum of Text

Instances

Bounded E'EnumFormStringArray Source # 
Enum E'EnumFormStringArray Source # 
Eq E'EnumFormStringArray Source # 
Ord E'EnumFormStringArray Source # 
Show E'EnumFormStringArray Source # 
ToJSON E'EnumFormStringArray Source # 
FromJSON E'EnumFormStringArray Source # 
ToHttpApiData E'EnumFormStringArray Source # 
FromHttpApiData E'EnumFormStringArray Source # 
MimeRender MimeMultipartFormData E'EnumFormStringArray Source # 

E'EnumInteger

data E'EnumInteger Source #

Enum of Int

Instances

Bounded E'EnumInteger Source # 
Enum E'EnumInteger Source # 
Eq E'EnumInteger Source # 
Ord E'EnumInteger Source # 
Show E'EnumInteger Source # 
ToJSON E'EnumInteger Source # 
FromJSON E'EnumInteger Source # 
ToHttpApiData E'EnumInteger Source # 
FromHttpApiData E'EnumInteger Source # 
MimeRender MimeMultipartFormData E'EnumInteger Source # 

E'EnumNumber

data E'EnumNumber Source #

Enum of Double

Instances

Bounded E'EnumNumber Source # 
Enum E'EnumNumber Source # 
Eq E'EnumNumber Source # 
Ord E'EnumNumber Source # 
Show E'EnumNumber Source # 
ToJSON E'EnumNumber Source # 
FromJSON E'EnumNumber Source # 
ToHttpApiData E'EnumNumber Source # 
FromHttpApiData E'EnumNumber Source # 
MimeRender MimeMultipartFormData E'EnumNumber Source # 

E'EnumQueryInteger

data E'EnumQueryInteger Source #

Enum of Int

Instances

Bounded E'EnumQueryInteger Source # 
Enum E'EnumQueryInteger Source # 
Eq E'EnumQueryInteger Source # 
Ord E'EnumQueryInteger Source # 
Show E'EnumQueryInteger Source # 
ToJSON E'EnumQueryInteger Source # 
FromJSON E'EnumQueryInteger Source # 
ToHttpApiData E'EnumQueryInteger Source # 
FromHttpApiData E'EnumQueryInteger Source # 
MimeRender MimeMultipartFormData E'EnumQueryInteger Source # 

E'EnumString

data E'EnumString Source #

Enum of Text

Instances

Bounded E'EnumString Source # 
Enum E'EnumString Source # 
Eq E'EnumString Source # 
Ord E'EnumString Source # 
Show E'EnumString Source # 
ToJSON E'EnumString Source # 
FromJSON E'EnumString Source # 
ToHttpApiData E'EnumString Source # 
FromHttpApiData E'EnumString Source # 
MimeRender MimeMultipartFormData E'EnumString Source # 

E'Inner

data E'Inner Source #

Enum of Text

Instances

Bounded E'Inner Source # 
Enum E'Inner Source # 
Eq E'Inner Source # 

Methods

(==) :: E'Inner -> E'Inner -> Bool #

(/=) :: E'Inner -> E'Inner -> Bool #

Ord E'Inner Source # 
Show E'Inner Source # 
ToJSON E'Inner Source # 
FromJSON E'Inner Source # 
ToHttpApiData E'Inner Source # 
FromHttpApiData E'Inner Source # 
MimeRender MimeMultipartFormData E'Inner Source # 

E'JustSymbol

data E'JustSymbol Source #

Enum of Text

Instances

Bounded E'JustSymbol Source # 
Enum E'JustSymbol Source # 
Eq E'JustSymbol Source # 
Ord E'JustSymbol Source # 
Show E'JustSymbol Source # 
ToJSON E'JustSymbol Source # 
FromJSON E'JustSymbol Source # 
ToHttpApiData E'JustSymbol Source # 
FromHttpApiData E'JustSymbol Source # 
MimeRender MimeMultipartFormData E'JustSymbol Source # 

E'Status

data E'Status Source #

Enum of Text . - Order Status

Constructors

E'Status'Placed
"placed"
E'Status'Approved
"approved"
E'Status'Delivered
"delivered"

Instances

Bounded E'Status Source # 
Enum E'Status Source # 
Eq E'Status Source # 
Ord E'Status Source # 
Show E'Status Source # 
ToJSON E'Status Source # 
FromJSON E'Status Source # 
ToHttpApiData E'Status Source # 
FromHttpApiData E'Status Source # 
MimeRender MimeMultipartFormData E'Status Source # 

E'Status2

data E'Status2 Source #

Enum of Text . - pet status in the store

Constructors

E'Status2'Available
"available"
E'Status2'Pending
"pending"
E'Status2'Sold
"sold"

Instances

Bounded E'Status2 Source # 
Enum E'Status2 Source # 
Eq E'Status2 Source # 
Ord E'Status2 Source # 
Show E'Status2 Source # 
ToJSON E'Status2 Source # 
FromJSON E'Status2 Source # 
ToHttpApiData E'Status2 Source # 
FromHttpApiData E'Status2 Source # 
MimeRender MimeMultipartFormData E'Status2 Source # 

EnumClass

data EnumClass Source #

Enum of Text

Constructors

EnumClass'_abc
"_abc"
EnumClass'_efg
"-efg"
EnumClass'_xyz
"(xyz)"

Instances

Bounded EnumClass Source # 
Enum EnumClass Source # 
Eq EnumClass Source # 
Ord EnumClass Source # 
Show EnumClass Source # 
ToJSON EnumClass Source # 
FromJSON EnumClass Source # 
ToHttpApiData EnumClass Source # 
FromHttpApiData EnumClass Source # 
MimeRender MimeMultipartFormData EnumClass Source # 

OuterEnum

data OuterEnum Source #

Enum of Text

Constructors

OuterEnum'Placed
"placed"
OuterEnum'Approved
"approved"
OuterEnum'Delivered
"delivered"

Instances

Bounded OuterEnum Source # 
Enum OuterEnum Source # 
Eq OuterEnum Source # 
Ord OuterEnum Source # 
Show OuterEnum Source # 
ToJSON OuterEnum Source # 
FromJSON OuterEnum Source # 
ToHttpApiData OuterEnum Source # 
FromHttpApiData OuterEnum Source # 
MimeRender MimeMultipartFormData OuterEnum Source # 

Auth Methods

AuthApiKeyApiKey

AuthApiKeyApiKeyQuery

AuthBasicHttpBasicTest

AuthOAuthPetstoreAuth

\ No newline at end of file +

openapi-petstore-0.1.0.0: Auto-generated openapi-petstore API Client

Safe HaskellNone
LanguageHaskell2010

OpenAPIPetstore.Model

Contents

Description

 

Synopsis

Parameter newtypes

AdditionalMetadata

ApiKey

newtype ApiKey Source #

Constructors

ApiKey 

Fields

Instances

Body

newtype Body Source #

Constructors

Body 

Fields

Instances

Eq Body Source # 

Methods

(==) :: Body -> Body -> Bool #

(/=) :: Body -> Body -> Bool #

Show Body Source # 

Methods

showsPrec :: Int -> Body -> ShowS #

show :: Body -> String #

showList :: [Body] -> ShowS #

ToJSON Body Source # 
HasBodyParam FakeOuterNumberSerialize Body Source #

Body Param "body" - Input number as post body

BodyBool

BodyText

Byte

newtype Byte Source #

Constructors

Byte 

Fields

Instances

Eq Byte Source # 

Methods

(==) :: Byte -> Byte -> Bool #

(/=) :: Byte -> Byte -> Bool #

Show Byte Source # 

Methods

showsPrec :: Int -> Byte -> ShowS #

show :: Byte -> String #

showList :: [Byte] -> ShowS #

Callback

EnumFormString

EnumFormStringArray

EnumHeaderString

EnumHeaderStringArray

EnumQueryDouble

EnumQueryInteger

EnumQueryString

EnumQueryStringArray

File

newtype File Source #

Constructors

File 

Fields

Instances

Eq File Source # 

Methods

(==) :: File -> File -> Bool #

(/=) :: File -> File -> Bool #

Show File Source # 

Methods

showsPrec :: Int -> File -> ShowS #

show :: File -> String #

showList :: [File] -> ShowS #

HasOptionalParam UploadFile File Source #

Optional Param "file" - file to upload

Methods

applyOptionalParam :: OpenAPIPetstoreRequest UploadFile contentType res accept -> File -> OpenAPIPetstoreRequest UploadFile contentType res accept Source #

(-&-) :: OpenAPIPetstoreRequest UploadFile contentType res accept -> File -> OpenAPIPetstoreRequest UploadFile contentType res accept Source #

Int32

newtype Int32 Source #

Constructors

Int32 

Fields

Int64

newtype Int64 Source #

Constructors

Int64 

Fields

Name2

newtype Name2 Source #

Constructors

Name2 

Fields

Instances

Eq Name2 Source # 

Methods

(==) :: Name2 -> Name2 -> Bool #

(/=) :: Name2 -> Name2 -> Bool #

Show Name2 Source # 

Methods

showsPrec :: Int -> Name2 -> ShowS #

show :: Name2 -> String #

showList :: [Name2] -> ShowS #

HasOptionalParam UpdatePetWithForm Name2 Source #

Optional Param "name" - Updated name of the pet

Number

newtype Number Source #

Constructors

Number 

Fields

Instances

OrderId

newtype OrderId Source #

Constructors

OrderId 

Fields

OrderIdText

Param

newtype Param Source #

Constructors

Param 

Fields

Instances

Eq Param Source # 

Methods

(==) :: Param -> Param -> Bool #

(/=) :: Param -> Param -> Bool #

Show Param Source # 

Methods

showsPrec :: Int -> Param -> ShowS #

show :: Param -> String #

showList :: [Param] -> ShowS #

Param2

newtype Param2 Source #

Constructors

Param2 

Fields

Instances

ParamBinary

ParamDate

ParamDateTime

ParamDouble

ParamFloat

ParamInteger

ParamString

Password

PatternWithoutDelimiter

PetId

newtype PetId Source #

Constructors

PetId 

Fields

Instances

Eq PetId Source # 

Methods

(==) :: PetId -> PetId -> Bool #

(/=) :: PetId -> PetId -> Bool #

Show PetId Source # 

Methods

showsPrec :: Int -> PetId -> ShowS #

show :: PetId -> String #

showList :: [PetId] -> ShowS #

RequestBody

Status

newtype Status Source #

Constructors

Status 

Fields

Instances

StatusText

Tags

newtype Tags Source #

Constructors

Tags 

Fields

Instances

Eq Tags Source # 

Methods

(==) :: Tags -> Tags -> Bool #

(/=) :: Tags -> Tags -> Bool #

Show Tags Source # 

Methods

showsPrec :: Int -> Tags -> ShowS #

show :: Tags -> String #

showList :: [Tags] -> ShowS #

User2

newtype User2 Source #

Constructors

User2 

Fields

Username

newtype Username Source #

Constructors

Username 

Fields

Models

AdditionalPropertiesClass

mkAdditionalPropertiesClass :: AdditionalPropertiesClass Source #

Construct a value of type AdditionalPropertiesClass (by applying it's required fields, if any)

Animal

data Animal Source #

Animal

Constructors

Animal 

Fields

mkAnimal Source #

Arguments

:: Text

animalClassName

-> Animal 

Construct a value of type Animal (by applying it's required fields, if any)

AnimalFarm

mkAnimalFarm :: AnimalFarm Source #

Construct a value of type AnimalFarm (by applying it's required fields, if any)

ApiResponse

mkApiResponse :: ApiResponse Source #

Construct a value of type ApiResponse (by applying it's required fields, if any)

ArrayOfArrayOfNumberOnly

mkArrayOfArrayOfNumberOnly :: ArrayOfArrayOfNumberOnly Source #

Construct a value of type ArrayOfArrayOfNumberOnly (by applying it's required fields, if any)

ArrayOfNumberOnly

mkArrayOfNumberOnly :: ArrayOfNumberOnly Source #

Construct a value of type ArrayOfNumberOnly (by applying it's required fields, if any)

ArrayTest

mkArrayTest :: ArrayTest Source #

Construct a value of type ArrayTest (by applying it's required fields, if any)

Capitalization

mkCapitalization :: Capitalization Source #

Construct a value of type Capitalization (by applying it's required fields, if any)

Cat

data Cat Source #

Cat

Constructors

Cat 

Fields

Instances

Eq Cat Source # 

Methods

(==) :: Cat -> Cat -> Bool #

(/=) :: Cat -> Cat -> Bool #

Show Cat Source # 

Methods

showsPrec :: Int -> Cat -> ShowS #

show :: Cat -> String #

showList :: [Cat] -> ShowS #

ToJSON Cat Source #

ToJSON Cat

FromJSON Cat Source #

FromJSON Cat

mkCat Source #

Arguments

:: Text

catClassName

-> Cat 

Construct a value of type Cat (by applying it's required fields, if any)

Category

mkCategory :: Category Source #

Construct a value of type Category (by applying it's required fields, if any)

ClassModel

data ClassModel Source #

ClassModel + Model for testing model with "_class" property

Constructors

ClassModel 

Fields

mkClassModel :: ClassModel Source #

Construct a value of type ClassModel (by applying it's required fields, if any)

Client

data Client Source #

Client

Constructors

Client 

Fields

Instances

Eq Client Source # 

Methods

(==) :: Client -> Client -> Bool #

(/=) :: Client -> Client -> Bool #

Show Client Source # 
ToJSON Client Source #

ToJSON Client

FromJSON Client Source #

FromJSON Client

HasBodyParam TestClassname Client Source #

Body Param Client - client model

Methods

setBodyParam :: (Consumes TestClassname contentType, MimeRender contentType Client) => OpenAPIPetstoreRequest TestClassname contentType res accept -> Client -> OpenAPIPetstoreRequest TestClassname contentType res accept Source #

HasBodyParam TestClientModel Client Source #

Body Param Client - client model

Methods

setBodyParam :: (Consumes TestClientModel contentType, MimeRender contentType Client) => OpenAPIPetstoreRequest TestClientModel contentType res accept -> Client -> OpenAPIPetstoreRequest TestClientModel contentType res accept Source #

HasBodyParam TestSpecialTags Client Source #

Body Param Client - client model

Methods

setBodyParam :: (Consumes TestSpecialTags contentType, MimeRender contentType Client) => OpenAPIPetstoreRequest TestSpecialTags contentType res accept -> Client -> OpenAPIPetstoreRequest TestSpecialTags contentType res accept Source #

mkClient :: Client Source #

Construct a value of type Client (by applying it's required fields, if any)

Dog

data Dog Source #

Dog

Constructors

Dog 

Fields

Instances

Eq Dog Source # 

Methods

(==) :: Dog -> Dog -> Bool #

(/=) :: Dog -> Dog -> Bool #

Show Dog Source # 

Methods

showsPrec :: Int -> Dog -> ShowS #

show :: Dog -> String #

showList :: [Dog] -> ShowS #

ToJSON Dog Source #

ToJSON Dog

FromJSON Dog Source #

FromJSON Dog

mkDog Source #

Arguments

:: Text

dogClassName

-> Dog 

Construct a value of type Dog (by applying it's required fields, if any)

EnumArrays

mkEnumArrays :: EnumArrays Source #

Construct a value of type EnumArrays (by applying it's required fields, if any)

EnumTest

mkEnumTest Source #

Construct a value of type EnumTest (by applying it's required fields, if any)

FormatTest

mkFormatTest Source #

Construct a value of type FormatTest (by applying it's required fields, if any)

HasOnlyReadOnly

mkHasOnlyReadOnly :: HasOnlyReadOnly Source #

Construct a value of type HasOnlyReadOnly (by applying it's required fields, if any)

MapTest

data MapTest Source #

MapTest

Constructors

MapTest 

Fields

mkMapTest :: MapTest Source #

Construct a value of type MapTest (by applying it's required fields, if any)

MixedPropertiesAndAdditionalPropertiesClass

data MixedPropertiesAndAdditionalPropertiesClass Source #

MixedPropertiesAndAdditionalPropertiesClass

Model200Response

mkModel200Response :: Model200Response Source #

Construct a value of type Model200Response (by applying it's required fields, if any)

ModelList

mkModelList :: ModelList Source #

Construct a value of type ModelList (by applying it's required fields, if any)

ModelReturn

mkModelReturn :: ModelReturn Source #

Construct a value of type ModelReturn (by applying it's required fields, if any)

Name

data Name Source #

Name + Model for testing model name same as property name

Constructors

Name 

Fields

Instances

mkName Source #

Arguments

:: Int

nameName

-> Name 

Construct a value of type Name (by applying it's required fields, if any)

NumberOnly

mkNumberOnly :: NumberOnly Source #

Construct a value of type NumberOnly (by applying it's required fields, if any)

Order

data Order Source #

Order

Constructors

Order 

Fields

Instances

Eq Order Source # 

Methods

(==) :: Order -> Order -> Bool #

(/=) :: Order -> Order -> Bool #

Show Order Source # 

Methods

showsPrec :: Int -> Order -> ShowS #

show :: Order -> String #

showList :: [Order] -> ShowS #

ToJSON Order Source #

ToJSON Order

FromJSON Order Source #

FromJSON Order

HasBodyParam PlaceOrder Order Source #

Body Param Order - order placed for purchasing the pet

Methods

setBodyParam :: (Consumes PlaceOrder contentType, MimeRender contentType Order) => OpenAPIPetstoreRequest PlaceOrder contentType res accept -> Order -> OpenAPIPetstoreRequest PlaceOrder contentType res accept Source #

mkOrder :: Order Source #

Construct a value of type Order (by applying it's required fields, if any)

OuterComposite

mkOuterComposite :: OuterComposite Source #

Construct a value of type OuterComposite (by applying it's required fields, if any)

Pet

data Pet Source #

Pet

Constructors

Pet 

Fields

Instances

Eq Pet Source # 

Methods

(==) :: Pet -> Pet -> Bool #

(/=) :: Pet -> Pet -> Bool #

Show Pet Source # 

Methods

showsPrec :: Int -> Pet -> ShowS #

show :: Pet -> String #

showList :: [Pet] -> ShowS #

ToJSON Pet Source #

ToJSON Pet

FromJSON Pet Source #

FromJSON Pet

HasBodyParam UpdatePet Pet Source #

Body Param Pet - Pet object that needs to be added to the store

Methods

setBodyParam :: (Consumes UpdatePet contentType, MimeRender contentType Pet) => OpenAPIPetstoreRequest UpdatePet contentType res accept -> Pet -> OpenAPIPetstoreRequest UpdatePet contentType res accept Source #

HasBodyParam AddPet Pet Source #

Body Param Pet - Pet object that needs to be added to the store

Methods

setBodyParam :: (Consumes AddPet contentType, MimeRender contentType Pet) => OpenAPIPetstoreRequest AddPet contentType res accept -> Pet -> OpenAPIPetstoreRequest AddPet contentType res accept Source #

mkPet Source #

Arguments

:: Text

petName

-> [Text]

petPhotoUrls

-> Pet 

Construct a value of type Pet (by applying it's required fields, if any)

ReadOnlyFirst

mkReadOnlyFirst :: ReadOnlyFirst Source #

Construct a value of type ReadOnlyFirst (by applying it's required fields, if any)

SpecialModelName

mkSpecialModelName :: SpecialModelName Source #

Construct a value of type SpecialModelName (by applying it's required fields, if any)

Tag

data Tag Source #

Tag

Constructors

Tag 

Fields

Instances

Eq Tag Source # 

Methods

(==) :: Tag -> Tag -> Bool #

(/=) :: Tag -> Tag -> Bool #

Show Tag Source # 

Methods

showsPrec :: Int -> Tag -> ShowS #

show :: Tag -> String #

showList :: [Tag] -> ShowS #

ToJSON Tag Source #

ToJSON Tag

FromJSON Tag Source #

FromJSON Tag

mkTag :: Tag Source #

Construct a value of type Tag (by applying it's required fields, if any)

User

data User Source #

User

Constructors

User 

Fields

Instances

Eq User Source # 

Methods

(==) :: User -> User -> Bool #

(/=) :: User -> User -> Bool #

Show User Source # 

Methods

showsPrec :: Int -> User -> ShowS #

show :: User -> String #

showList :: [User] -> ShowS #

ToJSON User Source #

ToJSON User

FromJSON User Source #

FromJSON User

HasBodyParam UpdateUser User Source #

Body Param User - Updated user object

Methods

setBodyParam :: (Consumes UpdateUser contentType, MimeRender contentType User) => OpenAPIPetstoreRequest UpdateUser contentType res accept -> User -> OpenAPIPetstoreRequest UpdateUser contentType res accept Source #

HasBodyParam CreateUser User Source #

Body Param User - Created user object

Methods

setBodyParam :: (Consumes CreateUser contentType, MimeRender contentType User) => OpenAPIPetstoreRequest CreateUser contentType res accept -> User -> OpenAPIPetstoreRequest CreateUser contentType res accept Source #

mkUser :: User Source #

Construct a value of type User (by applying it's required fields, if any)

Enums

E'ArrayEnum

data E'ArrayEnum Source #

Enum of Text

Constructors

E'ArrayEnum'Fish
"fish"
E'ArrayEnum'Crab
"crab"

Instances

Bounded E'ArrayEnum Source # 
Enum E'ArrayEnum Source # 
Eq E'ArrayEnum Source # 
Ord E'ArrayEnum Source # 
Show E'ArrayEnum Source # 
ToJSON E'ArrayEnum Source # 
FromJSON E'ArrayEnum Source # 
ToHttpApiData E'ArrayEnum Source # 
FromHttpApiData E'ArrayEnum Source # 
MimeRender MimeMultipartFormData E'ArrayEnum Source # 

E'EnumFormString

data E'EnumFormString Source #

Enum of Text . + Form parameter enum test (string)

Instances

Bounded E'EnumFormString Source # 
Enum E'EnumFormString Source # 
Eq E'EnumFormString Source # 
Ord E'EnumFormString Source # 
Show E'EnumFormString Source # 
ToJSON E'EnumFormString Source # 
FromJSON E'EnumFormString Source # 
ToHttpApiData E'EnumFormString Source # 
FromHttpApiData E'EnumFormString Source # 
MimeRender MimeMultipartFormData E'EnumFormString Source # 

E'EnumFormStringArray

data E'EnumFormStringArray Source #

Enum of Text

Instances

Bounded E'EnumFormStringArray Source # 
Enum E'EnumFormStringArray Source # 
Eq E'EnumFormStringArray Source # 
Ord E'EnumFormStringArray Source # 
Show E'EnumFormStringArray Source # 
ToJSON E'EnumFormStringArray Source # 
FromJSON E'EnumFormStringArray Source # 
ToHttpApiData E'EnumFormStringArray Source # 
FromHttpApiData E'EnumFormStringArray Source # 
MimeRender MimeMultipartFormData E'EnumFormStringArray Source # 

E'EnumInteger

data E'EnumInteger Source #

Enum of Int

Instances

Bounded E'EnumInteger Source # 
Enum E'EnumInteger Source # 
Eq E'EnumInteger Source # 
Ord E'EnumInteger Source # 
Show E'EnumInteger Source # 
ToJSON E'EnumInteger Source # 
FromJSON E'EnumInteger Source # 
ToHttpApiData E'EnumInteger Source # 
FromHttpApiData E'EnumInteger Source # 
MimeRender MimeMultipartFormData E'EnumInteger Source # 

E'EnumNumber

data E'EnumNumber Source #

Enum of Double

Instances

Bounded E'EnumNumber Source # 
Enum E'EnumNumber Source # 
Eq E'EnumNumber Source # 
Ord E'EnumNumber Source # 
Show E'EnumNumber Source # 
ToJSON E'EnumNumber Source # 
FromJSON E'EnumNumber Source # 
ToHttpApiData E'EnumNumber Source # 
FromHttpApiData E'EnumNumber Source # 
MimeRender MimeMultipartFormData E'EnumNumber Source # 

E'EnumQueryInteger

data E'EnumQueryInteger Source #

Enum of Int

Instances

Bounded E'EnumQueryInteger Source # 
Enum E'EnumQueryInteger Source # 
Eq E'EnumQueryInteger Source # 
Ord E'EnumQueryInteger Source # 
Show E'EnumQueryInteger Source # 
ToJSON E'EnumQueryInteger Source # 
FromJSON E'EnumQueryInteger Source # 
ToHttpApiData E'EnumQueryInteger Source # 
FromHttpApiData E'EnumQueryInteger Source # 
MimeRender MimeMultipartFormData E'EnumQueryInteger Source # 

E'EnumString

data E'EnumString Source #

Enum of Text

Instances

Bounded E'EnumString Source # 
Enum E'EnumString Source # 
Eq E'EnumString Source # 
Ord E'EnumString Source # 
Show E'EnumString Source # 
ToJSON E'EnumString Source # 
FromJSON E'EnumString Source # 
ToHttpApiData E'EnumString Source # 
FromHttpApiData E'EnumString Source # 
MimeRender MimeMultipartFormData E'EnumString Source # 

E'Inner

data E'Inner Source #

Enum of Text

Instances

Bounded E'Inner Source # 
Enum E'Inner Source # 
Eq E'Inner Source # 

Methods

(==) :: E'Inner -> E'Inner -> Bool #

(/=) :: E'Inner -> E'Inner -> Bool #

Ord E'Inner Source # 
Show E'Inner Source # 
ToJSON E'Inner Source # 
FromJSON E'Inner Source # 
ToHttpApiData E'Inner Source # 
FromHttpApiData E'Inner Source # 
MimeRender MimeMultipartFormData E'Inner Source # 

E'JustSymbol

data E'JustSymbol Source #

Enum of Text

Instances

Bounded E'JustSymbol Source # 
Enum E'JustSymbol Source # 
Eq E'JustSymbol Source # 
Ord E'JustSymbol Source # 
Show E'JustSymbol Source # 
ToJSON E'JustSymbol Source # 
FromJSON E'JustSymbol Source # 
ToHttpApiData E'JustSymbol Source # 
FromHttpApiData E'JustSymbol Source # 
MimeRender MimeMultipartFormData E'JustSymbol Source # 

E'Status

data E'Status Source #

Enum of Text . + Order Status

Constructors

E'Status'Placed
"placed"
E'Status'Approved
"approved"
E'Status'Delivered
"delivered"

Instances

Bounded E'Status Source # 
Enum E'Status Source # 
Eq E'Status Source # 
Ord E'Status Source # 
Show E'Status Source # 
ToJSON E'Status Source # 
FromJSON E'Status Source # 
ToHttpApiData E'Status Source # 
FromHttpApiData E'Status Source # 
MimeRender MimeMultipartFormData E'Status Source # 

E'Status2

data E'Status2 Source #

Enum of Text . + pet status in the store

Constructors

E'Status2'Available
"available"
E'Status2'Pending
"pending"
E'Status2'Sold
"sold"

Instances

Bounded E'Status2 Source # 
Enum E'Status2 Source # 
Eq E'Status2 Source # 
Ord E'Status2 Source # 
Show E'Status2 Source # 
ToJSON E'Status2 Source # 
FromJSON E'Status2 Source # 
ToHttpApiData E'Status2 Source # 
FromHttpApiData E'Status2 Source # 
MimeRender MimeMultipartFormData E'Status2 Source # 

EnumClass

data EnumClass Source #

Enum of Text

Constructors

EnumClass'_abc
"_abc"
EnumClass'_efg
"-efg"
EnumClass'_xyz
"(xyz)"

Instances

Bounded EnumClass Source # 
Enum EnumClass Source # 
Eq EnumClass Source # 
Ord EnumClass Source # 
Show EnumClass Source # 
ToJSON EnumClass Source # 
FromJSON EnumClass Source # 
ToHttpApiData EnumClass Source # 
FromHttpApiData EnumClass Source # 
MimeRender MimeMultipartFormData EnumClass Source # 

OuterEnum

data OuterEnum Source #

Enum of Text

Constructors

OuterEnum'Placed
"placed"
OuterEnum'Approved
"approved"
OuterEnum'Delivered
"delivered"

Instances

Bounded OuterEnum Source # 
Enum OuterEnum Source # 
Eq OuterEnum Source # 
Ord OuterEnum Source # 
Show OuterEnum Source # 
ToJSON OuterEnum Source # 
FromJSON OuterEnum Source # 
ToHttpApiData OuterEnum Source # 
FromHttpApiData OuterEnum Source # 
MimeRender MimeMultipartFormData OuterEnum Source # 

Auth Methods

AuthApiKeyApiKey

AuthApiKeyApiKeyQuery

AuthBasicHttpBasicTest

AuthOAuthPetstoreAuth

\ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.API.AnotherFake.html b/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.API.AnotherFake.html index f8cc093fad..59dbdad226 100644 --- a/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.API.AnotherFake.html +++ b/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.API.AnotherFake.html @@ -69,9 +69,9 @@ Module : OpenAPIPetstore.API.AnotherFake :: (Consumes TestSpecialTags MimeJSON, MimeRender MimeJSON Client) => Client -- ^ "client" - client model -> OpenAPIPetstoreRequest TestSpecialTags MimeJSON Client MimeJSON -testSpecialTags client = +testSpecialTags client = _mkRequest "PATCH" ["/another-fake/dummy"] - `setBodyParam` client + `setBodyParam` client data TestSpecialTags diff --git a/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.API.Fake.html b/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.API.Fake.html index 807144eff5..dbc7101da1 100644 --- a/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.API.Fake.html +++ b/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.API.Fake.html @@ -65,8 +65,8 @@ Module : OpenAPIPetstore.API.Fake -- fakeOuterBooleanSerialize :: (Consumes FakeOuterBooleanSerialize MimeJSON) - => Accept accept -- ^ request accept ('MimeType') - -> OpenAPIPetstoreRequest FakeOuterBooleanSerialize MimeJSON Bool accept + => Accept accept -- ^ request accept ('MimeType') + -> OpenAPIPetstoreRequest FakeOuterBooleanSerialize MimeJSON Bool accept fakeOuterBooleanSerialize _ = _mkRequest "POST" ["/fake/outer/boolean"] @@ -79,7 +79,7 @@ Module : OpenAPIPetstore.API.Fake instance Consumes FakeOuterBooleanSerialize MimeJSON -- | @*/*@ -instance MimeType mtype => Produces FakeOuterBooleanSerialize mtype +instance MimeType mtype => Produces FakeOuterBooleanSerialize mtype -- *** fakeOuterCompositeSerialize @@ -90,8 +90,8 @@ Module : OpenAPIPetstore.API.Fake -- fakeOuterCompositeSerialize :: (Consumes FakeOuterCompositeSerialize MimeJSON) - => Accept accept -- ^ request accept ('MimeType') - -> OpenAPIPetstoreRequest FakeOuterCompositeSerialize MimeJSON OuterComposite accept + => Accept accept -- ^ request accept ('MimeType') + -> OpenAPIPetstoreRequest FakeOuterCompositeSerialize MimeJSON OuterComposite accept fakeOuterCompositeSerialize _ = _mkRequest "POST" ["/fake/outer/composite"] @@ -104,7 +104,7 @@ Module : OpenAPIPetstore.API.Fake instance Consumes FakeOuterCompositeSerialize MimeJSON -- | @*/*@ -instance MimeType mtype => Produces FakeOuterCompositeSerialize mtype +instance MimeType mtype => Produces FakeOuterCompositeSerialize mtype -- *** fakeOuterNumberSerialize @@ -115,8 +115,8 @@ Module : OpenAPIPetstore.API.Fake -- fakeOuterNumberSerialize :: (Consumes FakeOuterNumberSerialize MimeJSON) - => Accept accept -- ^ request accept ('MimeType') - -> OpenAPIPetstoreRequest FakeOuterNumberSerialize MimeJSON Double accept + => Accept accept -- ^ request accept ('MimeType') + -> OpenAPIPetstoreRequest FakeOuterNumberSerialize MimeJSON Double accept fakeOuterNumberSerialize _ = _mkRequest "POST" ["/fake/outer/number"] @@ -129,7 +129,7 @@ Module : OpenAPIPetstore.API.Fake instance Consumes FakeOuterNumberSerialize MimeJSON -- | @*/*@ -instance MimeType mtype => Produces FakeOuterNumberSerialize mtype +instance MimeType mtype => Produces FakeOuterNumberSerialize mtype -- *** fakeOuterStringSerialize @@ -140,8 +140,8 @@ Module : OpenAPIPetstore.API.Fake -- fakeOuterStringSerialize :: (Consumes FakeOuterStringSerialize MimeJSON) - => Accept accept -- ^ request accept ('MimeType') - -> OpenAPIPetstoreRequest FakeOuterStringSerialize MimeJSON Text accept + => Accept accept -- ^ request accept ('MimeType') + -> OpenAPIPetstoreRequest FakeOuterStringSerialize MimeJSON Text accept fakeOuterStringSerialize _ = _mkRequest "POST" ["/fake/outer/string"] @@ -154,7 +154,7 @@ Module : OpenAPIPetstore.API.Fake instance Consumes FakeOuterStringSerialize MimeJSON -- | @*/*@ -instance MimeType mtype => Produces FakeOuterStringSerialize mtype +instance MimeType mtype => Produces FakeOuterStringSerialize mtype -- *** testClientModel @@ -169,9 +169,9 @@ Module : OpenAPIPetstore.API.Fake :: (Consumes TestClientModel MimeJSON, MimeRender MimeJSON Client) => Client -- ^ "client" - client model -> OpenAPIPetstoreRequest TestClientModel MimeJSON Client MimeJSON -testClientModel client = +testClientModel client = _mkRequest "PATCH" ["/fake"] - `setBodyParam` client + `setBodyParam` client data TestClientModel @@ -202,65 +202,65 @@ Module : OpenAPIPetstore.API.Fake -> PatternWithoutDelimiter -- ^ "patternWithoutDelimiter" - None -> Byte -- ^ "byte" - None -> OpenAPIPetstoreRequest TestEndpointParameters MimeFormUrlEncoded NoContent MimeNoContent -testEndpointParameters (Number number) (ParamDouble double) (PatternWithoutDelimiter patternWithoutDelimiter) (Byte byte) = +testEndpointParameters (Number number) (ParamDouble double) (PatternWithoutDelimiter patternWithoutDelimiter) (Byte byte) = _mkRequest "POST" ["/fake"] `_hasAuthType` (P.Proxy :: P.Proxy AuthBasicHttpBasicTest) - `addForm` toForm ("number", number) - `addForm` toForm ("double", double) - `addForm` toForm ("pattern_without_delimiter", patternWithoutDelimiter) - `addForm` toForm ("byte", byte) + `addForm` toForm ("number", number) + `addForm` toForm ("double", double) + `addForm` toForm ("pattern_without_delimiter", patternWithoutDelimiter) + `addForm` toForm ("byte", byte) data TestEndpointParameters -- | /Optional Param/ "integer" - None instance HasOptionalParam TestEndpointParameters ParamInteger where - applyOptionalParam req (ParamInteger xs) = - req `addForm` toForm ("integer", xs) + applyOptionalParam req (ParamInteger xs) = + req `addForm` toForm ("integer", xs) -- | /Optional Param/ "int32" - None instance HasOptionalParam TestEndpointParameters Int32 where - applyOptionalParam req (Int32 xs) = - req `addForm` toForm ("int32", xs) + applyOptionalParam req (Int32 xs) = + req `addForm` toForm ("int32", xs) -- | /Optional Param/ "int64" - None instance HasOptionalParam TestEndpointParameters Int64 where - applyOptionalParam req (Int64 xs) = - req `addForm` toForm ("int64", xs) + applyOptionalParam req (Int64 xs) = + req `addForm` toForm ("int64", xs) -- | /Optional Param/ "float" - None instance HasOptionalParam TestEndpointParameters ParamFloat where - applyOptionalParam req (ParamFloat xs) = - req `addForm` toForm ("float", xs) + applyOptionalParam req (ParamFloat xs) = + req `addForm` toForm ("float", xs) -- | /Optional Param/ "string" - None instance HasOptionalParam TestEndpointParameters ParamString where - applyOptionalParam req (ParamString xs) = - req `addForm` toForm ("string", xs) + applyOptionalParam req (ParamString xs) = + req `addForm` toForm ("string", xs) -- | /Optional Param/ "binary" - None instance HasOptionalParam TestEndpointParameters ParamBinary where - applyOptionalParam req (ParamBinary xs) = - req `_addMultiFormPart` NH.partFileSource "binary" xs + applyOptionalParam req (ParamBinary xs) = + req `_addMultiFormPart` NH.partFileSource "binary" xs -- | /Optional Param/ "date" - None instance HasOptionalParam TestEndpointParameters ParamDate where - applyOptionalParam req (ParamDate xs) = - req `addForm` toForm ("date", xs) + applyOptionalParam req (ParamDate xs) = + req `addForm` toForm ("date", xs) -- | /Optional Param/ "dateTime" - None instance HasOptionalParam TestEndpointParameters ParamDateTime where - applyOptionalParam req (ParamDateTime xs) = - req `addForm` toForm ("dateTime", xs) + applyOptionalParam req (ParamDateTime xs) = + req `addForm` toForm ("dateTime", xs) -- | /Optional Param/ "password" - None instance HasOptionalParam TestEndpointParameters Password where - applyOptionalParam req (Password xs) = - req `addForm` toForm ("password", xs) + applyOptionalParam req (Password xs) = + req `addForm` toForm ("password", xs) -- | /Optional Param/ "callback" - None instance HasOptionalParam TestEndpointParameters Callback where - applyOptionalParam req (Callback xs) = - req `addForm` toForm ("callback", xs) + applyOptionalParam req (Callback xs) = + req `addForm` toForm ("callback", xs) -- | @application/x-www-form-urlencoded@ instance Consumes TestEndpointParameters MimeFormUrlEncoded @@ -286,43 +286,43 @@ Module : OpenAPIPetstore.API.Fake -- | /Optional Param/ "enum_form_string_array" - Form parameter enum test (string array) instance HasOptionalParam TestEnumParameters EnumFormStringArray where - applyOptionalParam req (EnumFormStringArray xs) = - req `addForm` toFormColl CommaSeparated ("enum_form_string_array", xs) + applyOptionalParam req (EnumFormStringArray xs) = + req `addForm` toFormColl CommaSeparated ("enum_form_string_array", xs) -- | /Optional Param/ "enum_form_string" - Form parameter enum test (string) instance HasOptionalParam TestEnumParameters EnumFormString where - applyOptionalParam req (EnumFormString xs) = - req `addForm` toForm ("enum_form_string", xs) + applyOptionalParam req (EnumFormString xs) = + req `addForm` toForm ("enum_form_string", xs) -- | /Optional Param/ "enum_header_string_array" - Header parameter enum test (string array) instance HasOptionalParam TestEnumParameters EnumHeaderStringArray where - applyOptionalParam req (EnumHeaderStringArray xs) = - req `setHeader` toHeaderColl CommaSeparated ("enum_header_string_array", xs) + applyOptionalParam req (EnumHeaderStringArray xs) = + req `setHeader` toHeaderColl CommaSeparated ("enum_header_string_array", xs) -- | /Optional Param/ "enum_header_string" - Header parameter enum test (string) instance HasOptionalParam TestEnumParameters EnumHeaderString where - applyOptionalParam req (EnumHeaderString xs) = - req `setHeader` toHeader ("enum_header_string", xs) + applyOptionalParam req (EnumHeaderString xs) = + req `setHeader` toHeader ("enum_header_string", xs) -- | /Optional Param/ "enum_query_string_array" - Query parameter enum test (string array) instance HasOptionalParam TestEnumParameters EnumQueryStringArray where - applyOptionalParam req (EnumQueryStringArray xs) = - req `setQuery` toQueryColl MultiParamArray ("enum_query_string_array", Just xs) + applyOptionalParam req (EnumQueryStringArray xs) = + req `setQuery` toQueryColl MultiParamArray ("enum_query_string_array", Just xs) -- | /Optional Param/ "enum_query_string" - Query parameter enum test (string) instance HasOptionalParam TestEnumParameters EnumQueryString where - applyOptionalParam req (EnumQueryString xs) = - req `setQuery` toQuery ("enum_query_string", Just xs) + applyOptionalParam req (EnumQueryString xs) = + req `setQuery` toQuery ("enum_query_string", Just xs) -- | /Optional Param/ "enum_query_integer" - Query parameter enum test (double) instance HasOptionalParam TestEnumParameters EnumQueryInteger where - applyOptionalParam req (EnumQueryInteger xs) = - req `setQuery` toQuery ("enum_query_integer", Just xs) + applyOptionalParam req (EnumQueryInteger xs) = + req `setQuery` toQuery ("enum_query_integer", Just xs) -- | /Optional Param/ "enum_query_double" - Query parameter enum test (double) instance HasOptionalParam TestEnumParameters EnumQueryDouble where - applyOptionalParam req (EnumQueryDouble xs) = - req `setQuery` toQuery ("enum_query_double", Just xs) + applyOptionalParam req (EnumQueryDouble xs) = + req `setQuery` toQuery ("enum_query_double", Just xs) -- | @application/x-www-form-urlencoded@ instance Consumes TestEnumParameters MimeFormUrlEncoded @@ -340,9 +340,9 @@ Module : OpenAPIPetstore.API.Fake :: (Consumes TestInlineAdditionalProperties MimeJSON, MimeRender MimeJSON RequestBody) => RequestBody -- ^ "requestBody" - request body -> OpenAPIPetstoreRequest TestInlineAdditionalProperties MimeJSON NoContent MimeNoContent -testInlineAdditionalProperties requestBody = +testInlineAdditionalProperties requestBody = _mkRequest "POST" ["/fake/inline-additionalProperties"] - `setBodyParam` requestBody + `setBodyParam` requestBody data TestInlineAdditionalProperties @@ -366,10 +366,10 @@ Module : OpenAPIPetstore.API.Fake => Param -- ^ "param" - field1 -> Param2 -- ^ "param2" - field2 -> OpenAPIPetstoreRequest TestJsonFormData MimeFormUrlEncoded NoContent MimeNoContent -testJsonFormData (Param param) (Param2 param2) = +testJsonFormData (Param param) (Param2 param2) = _mkRequest "GET" ["/fake/jsonFormData"] - `addForm` toForm ("param", param) - `addForm` toForm ("param2", param2) + `addForm` toForm ("param", param) + `addForm` toForm ("param2", param2) data TestJsonFormData diff --git a/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.API.FakeClassnameTags123.html b/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.API.FakeClassnameTags123.html index 89057a0714..2150e48869 100644 --- a/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.API.FakeClassnameTags123.html +++ b/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.API.FakeClassnameTags123.html @@ -71,10 +71,10 @@ Module : OpenAPIPetstore.API.FakeClassnameTags123 :: (Consumes TestClassname MimeJSON, MimeRender MimeJSON Client) => Client -- ^ "client" - client model -> OpenAPIPetstoreRequest TestClassname MimeJSON Client MimeJSON -testClassname client = +testClassname client = _mkRequest "PATCH" ["/fake_classname_test"] `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyApiKeyQuery) - `setBodyParam` client + `setBodyParam` client data TestClassname diff --git a/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.API.Pet.html b/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.API.Pet.html index 2e88f2c7fe..670f1f3513 100644 --- a/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.API.Pet.html +++ b/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.API.Pet.html @@ -66,14 +66,14 @@ Module : OpenAPIPetstore.API.Pet -- AuthMethod: 'AuthOAuthPetstoreAuth' -- addPet - :: (Consumes AddPet contentType, MimeRender contentType Pet) - => ContentType contentType -- ^ request content-type ('MimeType') + :: (Consumes AddPet contentType, MimeRender contentType Pet) + => ContentType contentType -- ^ request content-type ('MimeType') -> Pet -- ^ "pet" - Pet object that needs to be added to the store - -> OpenAPIPetstoreRequest AddPet contentType NoContent MimeNoContent -addPet _ pet = + -> OpenAPIPetstoreRequest AddPet contentType NoContent MimeNoContent +addPet _ pet = _mkRequest "POST" ["/pet"] `_hasAuthType` (P.Proxy :: P.Proxy AuthOAuthPetstoreAuth) - `setBodyParam` pet + `setBodyParam` pet data AddPet @@ -99,14 +99,14 @@ Module : OpenAPIPetstore.API.Pet deletePet :: PetId -- ^ "petId" - Pet id to delete -> OpenAPIPetstoreRequest DeletePet MimeNoContent NoContent MimeNoContent -deletePet (PetId petId) = - _mkRequest "DELETE" ["/pet/",toPath petId] +deletePet (PetId petId) = + _mkRequest "DELETE" ["/pet/",toPath petId] `_hasAuthType` (P.Proxy :: P.Proxy AuthOAuthPetstoreAuth) data DeletePet instance HasOptionalParam DeletePet ApiKey where - applyOptionalParam req (ApiKey xs) = - req `setHeader` toHeader ("api_key", xs) + applyOptionalParam req (ApiKey xs) = + req `setHeader` toHeader ("api_key", xs) instance Produces DeletePet MimeNoContent @@ -122,13 +122,13 @@ Module : OpenAPIPetstore.API.Pet -- AuthMethod: 'AuthOAuthPetstoreAuth' -- findPetsByStatus - :: Accept accept -- ^ request accept ('MimeType') + :: Accept accept -- ^ request accept ('MimeType') -> Status -- ^ "status" - Status values that need to be considered for filter - -> OpenAPIPetstoreRequest FindPetsByStatus MimeNoContent [Pet] accept -findPetsByStatus _ (Status status) = + -> OpenAPIPetstoreRequest FindPetsByStatus MimeNoContent [Pet] accept +findPetsByStatus _ (Status status) = _mkRequest "GET" ["/pet/findByStatus"] `_hasAuthType` (P.Proxy :: P.Proxy AuthOAuthPetstoreAuth) - `setQuery` toQueryColl CommaSeparated ("status", Just status) + `setQuery` toQueryColl CommaSeparated ("status", Just status) data FindPetsByStatus @@ -149,13 +149,13 @@ Module : OpenAPIPetstore.API.Pet -- AuthMethod: 'AuthOAuthPetstoreAuth' -- findPetsByTags - :: Accept accept -- ^ request accept ('MimeType') + :: Accept accept -- ^ request accept ('MimeType') -> Tags -- ^ "tags" - Tags to filter by - -> OpenAPIPetstoreRequest FindPetsByTags MimeNoContent [Pet] accept -findPetsByTags _ (Tags tags) = + -> OpenAPIPetstoreRequest FindPetsByTags MimeNoContent [Pet] accept +findPetsByTags _ (Tags tags) = _mkRequest "GET" ["/pet/findByTags"] `_hasAuthType` (P.Proxy :: P.Proxy AuthOAuthPetstoreAuth) - `setQuery` toQueryColl CommaSeparated ("tags", Just tags) + `setQuery` toQueryColl CommaSeparated ("tags", Just tags) {-# DEPRECATED findPetsByTags "" #-} @@ -178,11 +178,11 @@ Module : OpenAPIPetstore.API.Pet -- AuthMethod: 'AuthApiKeyApiKey' -- getPetById - :: Accept accept -- ^ request accept ('MimeType') + :: Accept accept -- ^ request accept ('MimeType') -> PetId -- ^ "petId" - ID of pet to return - -> OpenAPIPetstoreRequest GetPetById MimeNoContent Pet accept -getPetById _ (PetId petId) = - _mkRequest "GET" ["/pet/",toPath petId] + -> OpenAPIPetstoreRequest GetPetById MimeNoContent Pet accept +getPetById _ (PetId petId) = + _mkRequest "GET" ["/pet/",toPath petId] `_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyApiKey) data GetPetById @@ -202,14 +202,14 @@ Module : OpenAPIPetstore.API.Pet -- AuthMethod: 'AuthOAuthPetstoreAuth' -- updatePet - :: (Consumes UpdatePet contentType, MimeRender contentType Pet) - => ContentType contentType -- ^ request content-type ('MimeType') + :: (Consumes UpdatePet contentType, MimeRender contentType Pet) + => ContentType contentType -- ^ request content-type ('MimeType') -> Pet -- ^ "pet" - Pet object that needs to be added to the store - -> OpenAPIPetstoreRequest UpdatePet contentType NoContent MimeNoContent -updatePet _ pet = + -> OpenAPIPetstoreRequest UpdatePet contentType NoContent MimeNoContent +updatePet _ pet = _mkRequest "PUT" ["/pet"] `_hasAuthType` (P.Proxy :: P.Proxy AuthOAuthPetstoreAuth) - `setBodyParam` pet + `setBodyParam` pet data UpdatePet @@ -236,21 +236,21 @@ Module : OpenAPIPetstore.API.Pet :: (Consumes UpdatePetWithForm MimeFormUrlEncoded) => PetId -- ^ "petId" - ID of pet that needs to be updated -> OpenAPIPetstoreRequest UpdatePetWithForm MimeFormUrlEncoded NoContent MimeNoContent -updatePetWithForm (PetId petId) = - _mkRequest "POST" ["/pet/",toPath petId] +updatePetWithForm (PetId petId) = + _mkRequest "POST" ["/pet/",toPath petId] `_hasAuthType` (P.Proxy :: P.Proxy AuthOAuthPetstoreAuth) data UpdatePetWithForm -- | /Optional Param/ "name" - Updated name of the pet instance HasOptionalParam UpdatePetWithForm Name2 where - applyOptionalParam req (Name2 xs) = - req `addForm` toForm ("name", xs) + applyOptionalParam req (Name2 xs) = + req `addForm` toForm ("name", xs) -- | /Optional Param/ "status" - Updated status of the pet instance HasOptionalParam UpdatePetWithForm StatusText where - applyOptionalParam req (StatusText xs) = - req `addForm` toForm ("status", xs) + applyOptionalParam req (StatusText xs) = + req `addForm` toForm ("status", xs) -- | @application/x-www-form-urlencoded@ instance Consumes UpdatePetWithForm MimeFormUrlEncoded @@ -270,21 +270,21 @@ Module : OpenAPIPetstore.API.Pet :: (Consumes UploadFile MimeMultipartFormData) => PetId -- ^ "petId" - ID of pet to update -> OpenAPIPetstoreRequest UploadFile MimeMultipartFormData ApiResponse MimeJSON -uploadFile (PetId petId) = - _mkRequest "POST" ["/pet/",toPath petId,"/uploadImage"] +uploadFile (PetId petId) = + _mkRequest "POST" ["/pet/",toPath petId,"/uploadImage"] `_hasAuthType` (P.Proxy :: P.Proxy AuthOAuthPetstoreAuth) data UploadFile -- | /Optional Param/ "additionalMetadata" - Additional data to pass to server instance HasOptionalParam UploadFile AdditionalMetadata where - applyOptionalParam req (AdditionalMetadata xs) = - req `_addMultiFormPart` NH.partLBS "additionalMetadata" (mimeRender' MimeMultipartFormData xs) + applyOptionalParam req (AdditionalMetadata xs) = + req `_addMultiFormPart` NH.partLBS "additionalMetadata" (mimeRender' MimeMultipartFormData xs) -- | /Optional Param/ "file" - file to upload instance HasOptionalParam UploadFile File where - applyOptionalParam req (File xs) = - req `_addMultiFormPart` NH.partFileSource "file" xs + applyOptionalParam req (File xs) = + req `_addMultiFormPart` NH.partFileSource "file" xs -- | @multipart/form-data@ instance Consumes UploadFile MimeMultipartFormData diff --git a/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.API.Store.html b/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.API.Store.html index 4cc5c98f92..e512ad3936 100644 --- a/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.API.Store.html +++ b/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.API.Store.html @@ -68,8 +68,8 @@ Module : OpenAPIPetstore.API.Store deleteOrder :: OrderIdText -- ^ "orderId" - ID of the order that needs to be deleted -> OpenAPIPetstoreRequest DeleteOrder MimeNoContent NoContent MimeNoContent -deleteOrder (OrderIdText orderId) = - _mkRequest "DELETE" ["/store/order/",toPath orderId] +deleteOrder (OrderIdText orderId) = + _mkRequest "DELETE" ["/store/order/",toPath orderId] data DeleteOrder @@ -107,11 +107,11 @@ Module : OpenAPIPetstore.API.Store -- For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions -- getOrderById - :: Accept accept -- ^ request accept ('MimeType') + :: Accept accept -- ^ request accept ('MimeType') -> OrderId -- ^ "orderId" - ID of pet that needs to be fetched - -> OpenAPIPetstoreRequest GetOrderById MimeNoContent Order accept -getOrderById _ (OrderId orderId) = - _mkRequest "GET" ["/store/order/",toPath orderId] + -> OpenAPIPetstoreRequest GetOrderById MimeNoContent Order accept +getOrderById _ (OrderId orderId) = + _mkRequest "GET" ["/store/order/",toPath orderId] data GetOrderById @@ -129,12 +129,12 @@ Module : OpenAPIPetstore.API.Store -- placeOrder :: (Consumes PlaceOrder MimeJSON, MimeRender MimeJSON Order) - => Accept accept -- ^ request accept ('MimeType') + => Accept accept -- ^ request accept ('MimeType') -> Order -- ^ "order" - order placed for purchasing the pet - -> OpenAPIPetstoreRequest PlaceOrder MimeJSON Order accept -placeOrder _ order = + -> OpenAPIPetstoreRequest PlaceOrder MimeJSON Order accept +placeOrder _ order = _mkRequest "POST" ["/store/order"] - `setBodyParam` order + `setBodyParam` order data PlaceOrder diff --git a/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.API.User.html b/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.API.User.html index 8bab6ebfda..08075461c9 100644 --- a/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.API.User.html +++ b/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.API.User.html @@ -69,9 +69,9 @@ Module : OpenAPIPetstore.API.User :: (Consumes CreateUser MimeJSON, MimeRender MimeJSON User) => User -- ^ "user" - Created user object -> OpenAPIPetstoreRequest CreateUser MimeJSON NoContent MimeNoContent -createUser user = +createUser user = _mkRequest "POST" ["/user"] - `setBodyParam` user + `setBodyParam` user data CreateUser @@ -94,9 +94,9 @@ Module : OpenAPIPetstore.API.User :: (Consumes CreateUsersWithArrayInput MimeJSON, MimeRender MimeJSON User2) => User2 -- ^ "user" - List of user object -> OpenAPIPetstoreRequest CreateUsersWithArrayInput MimeJSON NoContent MimeNoContent -createUsersWithArrayInput user = +createUsersWithArrayInput user = _mkRequest "POST" ["/user/createWithArray"] - `setBodyParam` user + `setBodyParam` user data CreateUsersWithArrayInput @@ -119,9 +119,9 @@ Module : OpenAPIPetstore.API.User :: (Consumes CreateUsersWithListInput MimeJSON, MimeRender MimeJSON User2) => User2 -- ^ "user" - List of user object -> OpenAPIPetstoreRequest CreateUsersWithListInput MimeJSON NoContent MimeNoContent -createUsersWithListInput user = +createUsersWithListInput user = _mkRequest "POST" ["/user/createWithList"] - `setBodyParam` user + `setBodyParam` user data CreateUsersWithListInput @@ -145,8 +145,8 @@ Module : OpenAPIPetstore.API.User deleteUser :: Username -- ^ "username" - The name that needs to be deleted -> OpenAPIPetstoreRequest DeleteUser MimeNoContent NoContent MimeNoContent -deleteUser (Username username) = - _mkRequest "DELETE" ["/user/",toPath username] +deleteUser (Username username) = + _mkRequest "DELETE" ["/user/",toPath username] data DeleteUser @@ -160,11 +160,11 @@ Module : OpenAPIPetstore.API.User -- Get user by user name -- getUserByName - :: Accept accept -- ^ request accept ('MimeType') + :: Accept accept -- ^ request accept ('MimeType') -> Username -- ^ "username" - The name that needs to be fetched. Use user1 for testing. - -> OpenAPIPetstoreRequest GetUserByName MimeNoContent User accept -getUserByName _ (Username username) = - _mkRequest "GET" ["/user/",toPath username] + -> OpenAPIPetstoreRequest GetUserByName MimeNoContent User accept +getUserByName _ (Username username) = + _mkRequest "GET" ["/user/",toPath username] data GetUserByName @@ -181,14 +181,14 @@ Module : OpenAPIPetstore.API.User -- Logs user into the system -- loginUser - :: Accept accept -- ^ request accept ('MimeType') + :: 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 _ (Username username) (Password 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) + `setQuery` toQuery ("username", Just username) + `setQuery` toQuery ("password", Just password) data LoginUser @@ -227,9 +227,9 @@ Module : OpenAPIPetstore.API.User => User -- ^ "user" - Updated user object -> Username -- ^ "username" - name that need to be deleted -> OpenAPIPetstoreRequest UpdateUser MimeJSON NoContent MimeNoContent -updateUser user (Username username) = - _mkRequest "PUT" ["/user/",toPath username] - `setBodyParam` user +updateUser user (Username username) = + _mkRequest "PUT" ["/user/",toPath username] + `setBodyParam` user data UpdateUser diff --git a/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.Client.html b/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.Client.html index 2591242c2e..793beaf203 100644 --- a/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.Client.html +++ b/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.Client.html @@ -55,20 +55,20 @@ Module : OpenAPIPetstore.Client -- | send a request returning the raw http response dispatchLbs - :: (Produces req accept, MimeType contentType) + :: (Produces req accept, MimeType contentType) => NH.Manager -- ^ http-client Connection manager -> OpenAPIPetstoreConfig -- ^ config - -> OpenAPIPetstoreRequest req contentType res accept -- ^ request + -> OpenAPIPetstoreRequest req contentType res accept -- ^ request -> IO (NH.Response BCL.ByteString) -- ^ response -dispatchLbs manager config request = do - initReq <- _toInitRequest config request - dispatchInitUnsafe manager config initReq +dispatchLbs manager config request = do + initReq <- _toInitRequest config request + dispatchInitUnsafe manager config initReq -- ** Mime -- | pair of decoded http body and http response -data MimeResult res = - MimeResult { mimeResult :: Either MimeError res -- ^ decoded http body +data MimeResult res = + MimeResult { mimeResult :: Either MimeError res -- ^ decoded http body , mimeResultResponse :: NH.Response BCL.ByteString -- ^ http response } deriving (Show, Functor, Foldable, Traversable) @@ -82,137 +82,137 @@ Module : OpenAPIPetstore.Client -- | send a request returning the 'MimeResult' dispatchMime - :: forall req contentType res accept. (Produces req accept, MimeUnrender accept res, MimeType contentType) + :: forall req contentType res accept. (Produces req accept, MimeUnrender accept res, MimeType contentType) => NH.Manager -- ^ http-client Connection manager -> OpenAPIPetstoreConfig -- ^ config - -> OpenAPIPetstoreRequest req contentType res accept -- ^ request - -> IO (MimeResult res) -- ^ response -dispatchMime manager config request = do - httpResponse <- dispatchLbs manager config request - let statusCode = NH.statusCode . NH.responseStatus $ httpResponse - parsedResult <- - runConfigLogWithExceptions "Client" config $ - do if (statusCode >= 400 && statusCode < 600) + -> OpenAPIPetstoreRequest req contentType res accept -- ^ request + -> IO (MimeResult res) -- ^ response +dispatchMime manager config request = do + httpResponse <- dispatchLbs manager config request + let statusCode = NH.statusCode . NH.responseStatus $ httpResponse + parsedResult <- + runConfigLogWithExceptions "Client" config $ + do if (statusCode >= 400 && statusCode < 600) then do - let s = "error statusCode: " ++ show statusCode - _log "Client" levelError (T.pack s) - pure (Left (MimeError s httpResponse)) - else case mimeUnrender (P.Proxy :: P.Proxy accept) (NH.responseBody httpResponse) of - Left s -> do - _log "Client" levelError (T.pack s) - pure (Left (MimeError s httpResponse)) - Right r -> pure (Right r) - return (MimeResult parsedResult httpResponse) + let s = "error statusCode: " ++ show statusCode + _log "Client" levelError (T.pack s) + pure (Left (MimeError s httpResponse)) + else case mimeUnrender (P.Proxy :: P.Proxy accept) (NH.responseBody httpResponse) of + Left s -> do + _log "Client" levelError (T.pack s) + pure (Left (MimeError s httpResponse)) + Right r -> pure (Right r) + return (MimeResult parsedResult httpResponse) -- | like 'dispatchMime', but only returns the decoded http body dispatchMime' - :: (Produces req accept, MimeUnrender accept res, MimeType contentType) + :: (Produces req accept, MimeUnrender accept res, MimeType contentType) => NH.Manager -- ^ http-client Connection manager -> OpenAPIPetstoreConfig -- ^ config - -> OpenAPIPetstoreRequest req contentType res accept -- ^ request - -> IO (Either MimeError res) -- ^ response -dispatchMime' manager config request = do - MimeResult parsedResult _ <- dispatchMime manager config request - return parsedResult + -> OpenAPIPetstoreRequest req contentType res accept -- ^ request + -> IO (Either MimeError res) -- ^ response +dispatchMime' manager config request = do + MimeResult parsedResult _ <- dispatchMime manager config request + return parsedResult -- ** Unsafe -- | like 'dispatchReqLbs', but does not validate the operation is a 'Producer' of the "accept" 'MimeType'. (Useful if the server's response is undocumented) dispatchLbsUnsafe - :: (MimeType accept, MimeType contentType) + :: (MimeType accept, MimeType contentType) => NH.Manager -- ^ http-client Connection manager -> OpenAPIPetstoreConfig -- ^ config - -> OpenAPIPetstoreRequest req contentType res accept -- ^ request + -> OpenAPIPetstoreRequest req contentType res accept -- ^ request -> IO (NH.Response BCL.ByteString) -- ^ response -dispatchLbsUnsafe manager config request = do - initReq <- _toInitRequest config request - dispatchInitUnsafe manager config initReq +dispatchLbsUnsafe manager config request = do + initReq <- _toInitRequest config request + dispatchInitUnsafe manager config initReq -- | dispatch an InitRequest dispatchInitUnsafe :: NH.Manager -- ^ http-client Connection manager -> OpenAPIPetstoreConfig -- ^ config - -> InitRequest req contentType res accept -- ^ init request + -> InitRequest req contentType res accept -- ^ init request -> IO (NH.Response BCL.ByteString) -- ^ response -dispatchInitUnsafe manager config (InitRequest req) = do - runConfigLogWithExceptions src config $ - do _log src levelInfo requestLogMsg - _log src levelDebug requestDbgLogMsg - res <- P.liftIO $ NH.httpLbs req manager - _log src levelInfo (responseLogMsg res) - _log src levelDebug ((T.pack . show) res) - return res +dispatchInitUnsafe manager config (InitRequest req) = do + runConfigLogWithExceptions src config $ + do _log src levelInfo requestLogMsg + _log src levelDebug requestDbgLogMsg + res <- P.liftIO $ NH.httpLbs req manager + _log src levelInfo (responseLogMsg res) + _log src levelDebug ((T.pack . show) res) + return res where - src = "Client" - endpoint = + src = "Client" + endpoint = T.pack $ BC.unpack $ - NH.method req <> " " <> NH.host req <> NH.path req <> NH.queryString req - requestLogMsg = "REQ:" <> endpoint - requestDbgLogMsg = - "Headers=" <> (T.pack . show) (NH.requestHeaders req) <> " Body=" <> - (case NH.requestBody req of - NH.RequestBodyLBS xs -> T.decodeUtf8 (BL.toStrict xs) + NH.method req <> " " <> NH.host req <> NH.path req <> NH.queryString req + requestLogMsg = "REQ:" <> endpoint + requestDbgLogMsg = + "Headers=" <> (T.pack . show) (NH.requestHeaders req) <> " Body=" <> + (case NH.requestBody req of + NH.RequestBodyLBS xs -> T.decodeUtf8 (BL.toStrict xs) _ -> "<RequestBody>") - responseStatusCode = (T.pack . show) . NH.statusCode . NH.responseStatus - responseLogMsg res = - "RES:statusCode=" <> responseStatusCode res <> " (" <> endpoint <> ")" + responseStatusCode = (T.pack . show) . NH.statusCode . NH.responseStatus + responseLogMsg res = + "RES:statusCode=" <> responseStatusCode res <> " (" <> endpoint <> ")" -- * InitRequest -- | wraps an http-client 'Request' with request/response type parameters -newtype InitRequest req contentType res accept = InitRequest +newtype InitRequest req contentType res accept = InitRequest { unInitRequest :: NH.Request } deriving (Show) -- | Build an http-client 'Request' record from the supplied config and request _toInitRequest - :: (MimeType accept, MimeType contentType) + :: (MimeType accept, MimeType contentType) => OpenAPIPetstoreConfig -- ^ config - -> OpenAPIPetstoreRequest req contentType res accept -- ^ request - -> IO (InitRequest req contentType res accept) -- ^ initialized request -_toInitRequest config req0 = - runConfigLogWithExceptions "Client" config $ do - parsedReq <- P.liftIO $ NH.parseRequest $ BCL.unpack $ BCL.append (configHost config) (BCL.concat (rUrlPath req0)) - req1 <- P.liftIO $ _applyAuthMethods req0 config + -> OpenAPIPetstoreRequest req contentType res accept -- ^ request + -> IO (InitRequest req contentType res accept) -- ^ initialized request +_toInitRequest config req0 = + runConfigLogWithExceptions "Client" config $ do + parsedReq <- P.liftIO $ NH.parseRequest $ BCL.unpack $ BCL.append (configHost config) (BCL.concat (rUrlPath req0)) + req1 <- P.liftIO $ _applyAuthMethods req0 config P.when - (configValidateAuthMethods config && (not . null . rAuthTypes) req1) - (E.throw $ AuthMethodException $ "AuthMethod not configured: " <> (show . head . rAuthTypes) req1) - let req2 = req1 & _setContentTypeHeader & _setAcceptHeader - reqHeaders = ("User-Agent", WH.toHeader (configUserAgent config)) : paramsHeaders (rParams req2) - reqQuery = NH.renderQuery True (paramsQuery (rParams req2)) - pReq = parsedReq { NH.method = (rMethod req2) - , NH.requestHeaders = reqHeaders - , NH.queryString = reqQuery + (configValidateAuthMethods config && (not . null . rAuthTypes) req1) + (E.throw $ AuthMethodException $ "AuthMethod not configured: " <> (show . head . rAuthTypes) req1) + let req2 = req1 & _setContentTypeHeader & _setAcceptHeader + reqHeaders = ("User-Agent", WH.toHeader (configUserAgent config)) : paramsHeaders (rParams req2) + reqQuery = NH.renderQuery True (paramsQuery (rParams req2)) + pReq = parsedReq { NH.method = (rMethod req2) + , NH.requestHeaders = reqHeaders + , NH.queryString = reqQuery } - outReq <- case paramsBody (rParams req2) of - ParamBodyNone -> pure (pReq { NH.requestBody = mempty }) - ParamBodyB bs -> pure (pReq { NH.requestBody = NH.RequestBodyBS bs }) - ParamBodyBL bl -> pure (pReq { NH.requestBody = NH.RequestBodyLBS bl }) - ParamBodyFormUrlEncoded form -> pure (pReq { NH.requestBody = NH.RequestBodyLBS (WH.urlEncodeForm form) }) - ParamBodyMultipartFormData parts -> NH.formDataBody parts pReq + outReq <- case paramsBody (rParams req2) of + ParamBodyNone -> pure (pReq { NH.requestBody = mempty }) + ParamBodyB bs -> pure (pReq { NH.requestBody = NH.RequestBodyBS bs }) + ParamBodyBL bl -> pure (pReq { NH.requestBody = NH.RequestBodyLBS bl }) + ParamBodyFormUrlEncoded form -> pure (pReq { NH.requestBody = NH.RequestBodyLBS (WH.urlEncodeForm form) }) + ParamBodyMultipartFormData parts -> NH.formDataBody parts pReq - pure (InitRequest outReq) + pure (InitRequest outReq) -- | modify the underlying Request -modifyInitRequest :: InitRequest req contentType res accept -> (NH.Request -> NH.Request) -> InitRequest req contentType res accept -modifyInitRequest (InitRequest req) f = InitRequest (f req) +modifyInitRequest :: InitRequest req contentType res accept -> (NH.Request -> NH.Request) -> InitRequest req contentType res accept +modifyInitRequest (InitRequest req) f = InitRequest (f req) -- | modify the underlying Request (monadic) -modifyInitRequestM :: Monad m => InitRequest req contentType res accept -> (NH.Request -> m NH.Request) -> m (InitRequest req contentType res accept) -modifyInitRequestM (InitRequest req) f = fmap InitRequest (f req) +modifyInitRequestM :: Monad m => InitRequest req contentType res accept -> (NH.Request -> m NH.Request) -> m (InitRequest req contentType res accept) +modifyInitRequestM (InitRequest req) f = fmap InitRequest (f req) -- ** Logging -- | Run a block using the configured logger instance runConfigLog - :: P.MonadIO m - => OpenAPIPetstoreConfig -> LogExec m -runConfigLog config = configLogExecWithContext config (configLogContext config) + :: P.MonadIO m + => OpenAPIPetstoreConfig -> LogExec m +runConfigLog config = configLogExecWithContext config (configLogContext config) -- | Run a block using the configured logger instance (logs exceptions) runConfigLogWithExceptions - :: (E.MonadCatch m, P.MonadIO m) - => T.Text -> OpenAPIPetstoreConfig -> LogExec m -runConfigLogWithExceptions src config = runConfigLog config . logExceptions src + :: (E.MonadCatch m, P.MonadIO m) + => T.Text -> OpenAPIPetstoreConfig -> LogExec m +runConfigLogWithExceptions src config = runConfigLog config . logExceptions src \ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.Core.html b/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.Core.html index e74c90bc4c..44c8b7141b 100644 --- a/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.Core.html +++ b/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.Core.html @@ -81,11 +81,11 @@ Module : OpenAPIPetstore.Core -- | display the config instance P.Show OpenAPIPetstoreConfig where - show c = + show c = T.printf "{ configHost = %v, configUserAgent = %v, ..}" - (show (configHost c)) - (show (configUserAgent c)) + (show (configHost c)) + (show (configUserAgent c)) -- | constructs a default OpenAPIPetstoreConfig -- @@ -99,36 +99,36 @@ Module : OpenAPIPetstore.Core -- newConfig :: IO OpenAPIPetstoreConfig newConfig = do - logCxt <- initLogContext + logCxt <- initLogContext return $ OpenAPIPetstoreConfig { configHost = "http://petstore.swagger.io:80/v2" , configUserAgent = "openapi-petstore/0.1.0.0" , configLogExecWithContext = runDefaultLogExecWithContext - , configLogContext = logCxt + , configLogContext = logCxt , configAuthMethods = [] , configValidateAuthMethods = True } -- | updates config use AuthMethod on matching requests -addAuthMethod :: AuthMethod auth => OpenAPIPetstoreConfig -> auth -> OpenAPIPetstoreConfig -addAuthMethod config@OpenAPIPetstoreConfig {configAuthMethods = as} a = - config { configAuthMethods = AnyAuthMethod a : as} +addAuthMethod :: AuthMethod auth => OpenAPIPetstoreConfig -> auth -> OpenAPIPetstoreConfig +addAuthMethod config@OpenAPIPetstoreConfig {configAuthMethods = as} a = + config { configAuthMethods = AnyAuthMethod a : as} -- | updates the config to use stdout logging withStdoutLogging :: OpenAPIPetstoreConfig -> IO OpenAPIPetstoreConfig -withStdoutLogging p = do - logCxt <- stdoutLoggingContext (configLogContext p) - return $ p { configLogExecWithContext = stdoutLoggingExec, configLogContext = logCxt } +withStdoutLogging p = do + logCxt <- stdoutLoggingContext (configLogContext p) + return $ p { configLogExecWithContext = stdoutLoggingExec, configLogContext = logCxt } -- | updates the config to use stderr logging withStderrLogging :: OpenAPIPetstoreConfig -> IO OpenAPIPetstoreConfig -withStderrLogging p = do - logCxt <- stderrLoggingContext (configLogContext p) - return $ p { configLogExecWithContext = stderrLoggingExec, configLogContext = logCxt } +withStderrLogging p = do + logCxt <- stderrLoggingContext (configLogContext p) + return $ p { configLogExecWithContext = stderrLoggingExec, configLogContext = logCxt } -- | updates the config to disable logging withNoLogging :: OpenAPIPetstoreConfig -> OpenAPIPetstoreConfig -withNoLogging p = p { configLogExecWithContext = runNullLogExec} +withNoLogging p = p { configLogExecWithContext = runNullLogExec} -- * OpenAPIPetstoreRequest @@ -140,7 +140,7 @@ Module : OpenAPIPetstore.Core -- * contentType - 'MimeType' associated with request body -- * res - response model -- * accept - 'MimeType' associated with response body -data OpenAPIPetstoreRequest req contentType res accept = OpenAPIPetstoreRequest +data OpenAPIPetstoreRequest req contentType res accept = OpenAPIPetstoreRequest { rMethod :: NH.Method -- ^ Method of OpenAPIPetstoreRequest , rUrlPath :: [BCL.ByteString] -- ^ Endpoint of OpenAPIPetstoreRequest , rParams :: Params -- ^ params of OpenAPIPetstoreRequest @@ -149,47 +149,47 @@ Module : OpenAPIPetstore.Core deriving (P.Show) -- | 'rMethod' Lens -rMethodL :: Lens_' (OpenAPIPetstoreRequest req contentType res accept) NH.Method -rMethodL f OpenAPIPetstoreRequest{..} = (\rMethod -> OpenAPIPetstoreRequest { rMethod, ..} ) <$> f rMethod +rMethodL :: Lens_' (OpenAPIPetstoreRequest req contentType res accept) NH.Method +rMethodL f OpenAPIPetstoreRequest{..} = (\rMethod -> OpenAPIPetstoreRequest { rMethod, ..} ) <$> f rMethod {-# INLINE rMethodL #-} -- | 'rUrlPath' Lens -rUrlPathL :: Lens_' (OpenAPIPetstoreRequest req contentType res accept) [BCL.ByteString] -rUrlPathL f OpenAPIPetstoreRequest{..} = (\rUrlPath -> OpenAPIPetstoreRequest { rUrlPath, ..} ) <$> f rUrlPath +rUrlPathL :: Lens_' (OpenAPIPetstoreRequest req contentType res accept) [BCL.ByteString] +rUrlPathL f OpenAPIPetstoreRequest{..} = (\rUrlPath -> OpenAPIPetstoreRequest { rUrlPath, ..} ) <$> f rUrlPath {-# INLINE rUrlPathL #-} -- | 'rParams' Lens -rParamsL :: Lens_' (OpenAPIPetstoreRequest req contentType res accept) Params -rParamsL f OpenAPIPetstoreRequest{..} = (\rParams -> OpenAPIPetstoreRequest { rParams, ..} ) <$> f rParams +rParamsL :: Lens_' (OpenAPIPetstoreRequest req contentType res accept) Params +rParamsL f OpenAPIPetstoreRequest{..} = (\rParams -> OpenAPIPetstoreRequest { rParams, ..} ) <$> f rParams {-# INLINE rParamsL #-} -- | 'rParams' Lens -rAuthTypesL :: Lens_' (OpenAPIPetstoreRequest req contentType res accept) [P.TypeRep] -rAuthTypesL f OpenAPIPetstoreRequest{..} = (\rAuthTypes -> OpenAPIPetstoreRequest { rAuthTypes, ..} ) <$> f rAuthTypes +rAuthTypesL :: Lens_' (OpenAPIPetstoreRequest req contentType res accept) [P.TypeRep] +rAuthTypesL f OpenAPIPetstoreRequest{..} = (\rAuthTypes -> OpenAPIPetstoreRequest { rAuthTypes, ..} ) <$> f rAuthTypes {-# INLINE rAuthTypesL #-} -- * HasBodyParam -- | Designates the body parameter of a request -class HasBodyParam req param where - setBodyParam :: forall contentType res accept. (Consumes req contentType, MimeRender contentType param) => OpenAPIPetstoreRequest req contentType res accept -> param -> OpenAPIPetstoreRequest req contentType res accept - setBodyParam req xs = - req `_setBodyLBS` mimeRender (P.Proxy :: P.Proxy contentType) xs & _setContentTypeHeader +class HasBodyParam req param where + setBodyParam :: forall contentType res accept. (Consumes req contentType, MimeRender contentType param) => OpenAPIPetstoreRequest req contentType res accept -> param -> OpenAPIPetstoreRequest req contentType res accept + setBodyParam req xs = + req `_setBodyLBS` mimeRender (P.Proxy :: P.Proxy contentType) xs & _setContentTypeHeader -- * HasOptionalParam -- | Designates the optional parameters of a request -class HasOptionalParam req param where +class HasOptionalParam req param where {-# MINIMAL applyOptionalParam | (-&-) #-} -- | Apply an optional parameter to a request - applyOptionalParam :: OpenAPIPetstoreRequest req contentType res accept -> param -> OpenAPIPetstoreRequest req contentType res accept - applyOptionalParam = (-&-) + applyOptionalParam :: OpenAPIPetstoreRequest req contentType res accept -> param -> OpenAPIPetstoreRequest req contentType res accept + applyOptionalParam = (-&-) {-# INLINE applyOptionalParam #-} -- | infix operator \/ alias for 'addOptionalParam' - (-&-) :: OpenAPIPetstoreRequest req contentType res accept -> param -> OpenAPIPetstoreRequest req contentType res accept - (-&-) = applyOptionalParam + (-&-) :: OpenAPIPetstoreRequest req contentType res accept -> param -> OpenAPIPetstoreRequest req contentType res accept + (-&-) = applyOptionalParam {-# INLINE (-&-) #-} infixl 2 -&- @@ -204,17 +204,17 @@ Module : OpenAPIPetstore.Core -- | 'paramsQuery' Lens paramsQueryL :: Lens_' Params NH.Query -paramsQueryL f Params{..} = (\paramsQuery -> Params { paramsQuery, ..} ) <$> f paramsQuery +paramsQueryL f Params{..} = (\paramsQuery -> Params { paramsQuery, ..} ) <$> f paramsQuery {-# INLINE paramsQueryL #-} -- | 'paramsHeaders' Lens paramsHeadersL :: Lens_' Params NH.RequestHeaders -paramsHeadersL f Params{..} = (\paramsHeaders -> Params { paramsHeaders, ..} ) <$> f paramsHeaders +paramsHeadersL f Params{..} = (\paramsHeaders -> Params { paramsHeaders, ..} ) <$> f paramsHeaders {-# INLINE paramsHeadersL #-} -- | 'paramsBody' Lens paramsBodyL :: Lens_' Params ParamBody -paramsBodyL f Params{..} = (\paramsBody -> Params { paramsBody, ..} ) <$> f paramsBody +paramsBodyL f Params{..} = (\paramsBody -> Params { paramsBody, ..} ) <$> f paramsBody {-# INLINE paramsBodyL #-} -- | Request Body @@ -230,90 +230,90 @@ Module : OpenAPIPetstore.Core _mkRequest :: NH.Method -- ^ Method -> [BCL.ByteString] -- ^ Endpoint - -> OpenAPIPetstoreRequest req contentType res accept -- ^ req: Request Type, res: Response Type -_mkRequest m u = OpenAPIPetstoreRequest m u _mkParams [] + -> OpenAPIPetstoreRequest req contentType res accept -- ^ req: Request Type, res: Response Type +_mkRequest m u = OpenAPIPetstoreRequest m u _mkParams [] _mkParams :: Params _mkParams = Params [] [] ParamBodyNone -setHeader :: OpenAPIPetstoreRequest req contentType res accept -> [NH.Header] -> OpenAPIPetstoreRequest req contentType res accept -setHeader req header = - req `removeHeader` P.fmap P.fst header & - L.over (rParamsL . paramsHeadersL) (header P.++) +setHeader :: OpenAPIPetstoreRequest req contentType res accept -> [NH.Header] -> OpenAPIPetstoreRequest req contentType res accept +setHeader req header = + req `removeHeader` P.fmap P.fst header & + L.over (rParamsL . paramsHeadersL) (header P.++) -removeHeader :: OpenAPIPetstoreRequest req contentType res accept -> [NH.HeaderName] -> OpenAPIPetstoreRequest req contentType res accept -removeHeader req header = - req & +removeHeader :: OpenAPIPetstoreRequest req contentType res accept -> [NH.HeaderName] -> OpenAPIPetstoreRequest req contentType res accept +removeHeader req header = + req & L.over (rParamsL . paramsHeadersL) - (P.filter (\h -> cifst h `P.notElem` P.fmap CI.mk header)) + (P.filter (\h -> cifst h `P.notElem` P.fmap CI.mk header)) where - cifst = CI.mk . P.fst + cifst = CI.mk . P.fst -_setContentTypeHeader :: forall req contentType res accept. MimeType contentType => OpenAPIPetstoreRequest req contentType res accept -> OpenAPIPetstoreRequest req contentType res accept -_setContentTypeHeader req = - case mimeType (P.Proxy :: P.Proxy contentType) of - Just m -> req `setHeader` [("content-type", BC.pack $ P.show m)] - Nothing -> req `removeHeader` ["content-type"] +_setContentTypeHeader :: forall req contentType res accept. MimeType contentType => OpenAPIPetstoreRequest req contentType res accept -> OpenAPIPetstoreRequest req contentType res accept +_setContentTypeHeader req = + case mimeType (P.Proxy :: P.Proxy contentType) of + Just m -> req `setHeader` [("content-type", BC.pack $ P.show m)] + Nothing -> req `removeHeader` ["content-type"] -_setAcceptHeader :: forall req contentType res accept. MimeType accept => OpenAPIPetstoreRequest req contentType res accept -> OpenAPIPetstoreRequest req contentType res accept -_setAcceptHeader req = - case mimeType (P.Proxy :: P.Proxy accept) of - Just m -> req `setHeader` [("accept", BC.pack $ P.show m)] - Nothing -> req `removeHeader` ["accept"] +_setAcceptHeader :: forall req contentType res accept. MimeType accept => OpenAPIPetstoreRequest req contentType res accept -> OpenAPIPetstoreRequest req contentType res accept +_setAcceptHeader req = + case mimeType (P.Proxy :: P.Proxy accept) of + Just m -> req `setHeader` [("accept", BC.pack $ P.show m)] + Nothing -> req `removeHeader` ["accept"] -setQuery :: OpenAPIPetstoreRequest req contentType res accept -> [NH.QueryItem] -> OpenAPIPetstoreRequest req contentType res accept -setQuery req query = - req & +setQuery :: OpenAPIPetstoreRequest req contentType res accept -> [NH.QueryItem] -> OpenAPIPetstoreRequest req contentType res accept +setQuery req query = + req & L.over (rParamsL . paramsQueryL) - ((query P.++) . P.filter (\q -> cifst q `P.notElem` P.fmap cifst query)) + ((query P.++) . P.filter (\q -> cifst q `P.notElem` P.fmap cifst query)) where - cifst = CI.mk . P.fst + cifst = CI.mk . P.fst -addForm :: OpenAPIPetstoreRequest req contentType res accept -> WH.Form -> OpenAPIPetstoreRequest req contentType res accept -addForm req newform = - let form = case paramsBody (rParams req) of - ParamBodyFormUrlEncoded _form -> _form +addForm :: OpenAPIPetstoreRequest req contentType res accept -> WH.Form -> OpenAPIPetstoreRequest req contentType res accept +addForm req newform = + let form = case paramsBody (rParams req) of + ParamBodyFormUrlEncoded _form -> _form _ -> mempty - in req & L.set (rParamsL . paramsBodyL) (ParamBodyFormUrlEncoded (newform <> form)) + in req & L.set (rParamsL . paramsBodyL) (ParamBodyFormUrlEncoded (newform <> form)) -_addMultiFormPart :: OpenAPIPetstoreRequest req contentType res accept -> NH.Part -> OpenAPIPetstoreRequest req contentType res accept -_addMultiFormPart req newpart = - let parts = case paramsBody (rParams req) of - ParamBodyMultipartFormData _parts -> _parts +_addMultiFormPart :: OpenAPIPetstoreRequest req contentType res accept -> NH.Part -> OpenAPIPetstoreRequest req contentType res accept +_addMultiFormPart req newpart = + let parts = case paramsBody (rParams req) of + ParamBodyMultipartFormData _parts -> _parts _ -> [] - in req & L.set (rParamsL . paramsBodyL) (ParamBodyMultipartFormData (newpart : parts)) + in req & L.set (rParamsL . paramsBodyL) (ParamBodyMultipartFormData (newpart : parts)) -_setBodyBS :: OpenAPIPetstoreRequest req contentType res accept -> B.ByteString -> OpenAPIPetstoreRequest req contentType res accept -_setBodyBS req body = - req & L.set (rParamsL . paramsBodyL) (ParamBodyB body) +_setBodyBS :: OpenAPIPetstoreRequest req contentType res accept -> B.ByteString -> OpenAPIPetstoreRequest req contentType res accept +_setBodyBS req body = + req & L.set (rParamsL . paramsBodyL) (ParamBodyB body) -_setBodyLBS :: OpenAPIPetstoreRequest req contentType res accept -> BL.ByteString -> OpenAPIPetstoreRequest req contentType res accept -_setBodyLBS req body = - req & L.set (rParamsL . paramsBodyL) (ParamBodyBL body) +_setBodyLBS :: OpenAPIPetstoreRequest req contentType res accept -> BL.ByteString -> OpenAPIPetstoreRequest req contentType res accept +_setBodyLBS req body = + req & L.set (rParamsL . paramsBodyL) (ParamBodyBL body) -_hasAuthType :: AuthMethod authMethod => OpenAPIPetstoreRequest req contentType res accept -> P.Proxy authMethod -> OpenAPIPetstoreRequest req contentType res accept -_hasAuthType req proxy = - req & L.over rAuthTypesL (P.typeRep proxy :) +_hasAuthType :: AuthMethod authMethod => OpenAPIPetstoreRequest req contentType res accept -> P.Proxy authMethod -> OpenAPIPetstoreRequest req contentType res accept +_hasAuthType req proxy = + req & L.over rAuthTypesL (P.typeRep proxy :) -- ** Params Utils toPath - :: WH.ToHttpApiData a - => a -> BCL.ByteString + :: WH.ToHttpApiData a + => a -> BCL.ByteString toPath = BB.toLazyByteString . WH.toEncodedUrlPiece -toHeader :: WH.ToHttpApiData a => (NH.HeaderName, a) -> [NH.Header] -toHeader x = [fmap WH.toHeader x] +toHeader :: WH.ToHttpApiData a => (NH.HeaderName, a) -> [NH.Header] +toHeader x = [fmap WH.toHeader x] -toForm :: WH.ToHttpApiData v => (BC.ByteString, v) -> WH.Form -toForm (k,v) = WH.toForm [(BC.unpack k,v)] +toForm :: WH.ToHttpApiData v => (BC.ByteString, v) -> WH.Form +toForm (k,v) = WH.toForm [(BC.unpack k,v)] -toQuery :: WH.ToHttpApiData a => (BC.ByteString, Maybe a) -> [NH.QueryItem] -toQuery x = [(fmap . fmap) toQueryParam x] - where toQueryParam = T.encodeUtf8 . WH.toQueryParam +toQuery :: WH.ToHttpApiData a => (BC.ByteString, Maybe a) -> [NH.QueryItem] +toQuery x = [(fmap . fmap) toQueryParam x] + where toQueryParam = T.encodeUtf8 . WH.toQueryParam -- *** OpenAPI `CollectionFormat` Utils @@ -325,38 +325,38 @@ Module : OpenAPIPetstore.Core | PipeSeparated -- ^ `value1|value2|value2` | MultiParamArray -- ^ Using multiple GET parameters, e.g. `foo=bar&foo=baz`. This is valid only for parameters in "query" ('NH.Query') or "formData" ('WH.Form') -toHeaderColl :: WH.ToHttpApiData a => CollectionFormat -> (NH.HeaderName, [a]) -> [NH.Header] -toHeaderColl c xs = _toColl c toHeader xs +toHeaderColl :: WH.ToHttpApiData a => CollectionFormat -> (NH.HeaderName, [a]) -> [NH.Header] +toHeaderColl c xs = _toColl c toHeader xs -toFormColl :: WH.ToHttpApiData v => CollectionFormat -> (BC.ByteString, [v]) -> WH.Form -toFormColl c xs = WH.toForm $ fmap unpack $ _toColl c toHeader $ pack xs +toFormColl :: WH.ToHttpApiData v => CollectionFormat -> (BC.ByteString, [v]) -> WH.Form +toFormColl c xs = WH.toForm $ fmap unpack $ _toColl c toHeader $ pack xs where - pack (k,v) = (CI.mk k, v) - unpack (k,v) = (BC.unpack (CI.original k), BC.unpack v) + pack (k,v) = (CI.mk k, v) + unpack (k,v) = (BC.unpack (CI.original k), BC.unpack v) -toQueryColl :: WH.ToHttpApiData a => CollectionFormat -> (BC.ByteString, Maybe [a]) -> NH.Query -toQueryColl c xs = _toCollA c toQuery xs +toQueryColl :: WH.ToHttpApiData a => CollectionFormat -> (BC.ByteString, Maybe [a]) -> NH.Query +toQueryColl c xs = _toCollA c toQuery xs -_toColl :: P.Traversable f => CollectionFormat -> (f a -> [(b, BC.ByteString)]) -> f [a] -> [(b, BC.ByteString)] -_toColl c encode xs = fmap (fmap P.fromJust) (_toCollA' c fencode BC.singleton (fmap Just xs)) - where fencode = fmap (fmap Just) . encode . fmap P.fromJust +_toColl :: P.Traversable f => CollectionFormat -> (f a -> [(b, BC.ByteString)]) -> f [a] -> [(b, BC.ByteString)] +_toColl c encode xs = fmap (fmap P.fromJust) (_toCollA' c fencode BC.singleton (fmap Just xs)) + where fencode = fmap (fmap Just) . encode . fmap P.fromJust {-# INLINE fencode #-} -_toCollA :: (P.Traversable f, P.Traversable t, P.Alternative t) => CollectionFormat -> (f (t a) -> [(b, t BC.ByteString)]) -> f (t [a]) -> [(b, t BC.ByteString)] -_toCollA c encode xs = _toCollA' c encode BC.singleton xs +_toCollA :: (P.Traversable f, P.Traversable t, P.Alternative t) => CollectionFormat -> (f (t a) -> [(b, t BC.ByteString)]) -> f (t [a]) -> [(b, t BC.ByteString)] +_toCollA c encode xs = _toCollA' c encode BC.singleton xs -_toCollA' :: (P.Monoid c, P.Traversable f, P.Traversable t, P.Alternative t) => CollectionFormat -> (f (t a) -> [(b, t c)]) -> (Char -> c) -> f (t [a]) -> [(b, t c)] -_toCollA' c encode one xs = case c of - CommaSeparated -> go (one ',') - SpaceSeparated -> go (one ' ') - TabSeparated -> go (one '\t') - PipeSeparated -> go (one '|') - MultiParamArray -> expandList +_toCollA' :: (P.Monoid c, P.Traversable f, P.Traversable t, P.Alternative t) => CollectionFormat -> (f (t a) -> [(b, t c)]) -> (Char -> c) -> f (t [a]) -> [(b, t c)] +_toCollA' c encode one xs = case c of + CommaSeparated -> go (one ',') + SpaceSeparated -> go (one ' ') + TabSeparated -> go (one '\t') + PipeSeparated -> go (one '|') + MultiParamArray -> expandList where - go sep = - [P.foldl1 (\(sk, sv) (_, v) -> (sk, (combine sep <$> sv <*> v) <|> sv <|> v)) expandList] - combine sep x y = x <> sep <> y - expandList = (P.concatMap encode . (P.traverse . P.traverse) P.toList) xs + go sep = + [P.foldl1 (\(sk, sv) (_, v) -> (sk, (combine sep <$> sv <*> v) <|> sv <|> v)) expandList] + combine sep x y = x <> sep <> y + expandList = (P.concatMap encode . (P.traverse . P.traverse) P.toList) xs {-# INLINE go #-} {-# INLINE expandList #-} {-# INLINE combine #-} @@ -364,18 +364,18 @@ Module : OpenAPIPetstore.Core -- * AuthMethods -- | Provides a method to apply auth methods to requests -class P.Typeable a => - AuthMethod a where +class P.Typeable a => + AuthMethod a where applyAuthMethod :: OpenAPIPetstoreConfig - -> a - -> OpenAPIPetstoreRequest req contentType res accept - -> IO (OpenAPIPetstoreRequest req contentType res accept) + -> a + -> OpenAPIPetstoreRequest req contentType res accept + -> IO (OpenAPIPetstoreRequest req contentType res accept) -- | An existential wrapper for any AuthMethod -data AnyAuthMethod = forall a. AuthMethod a => AnyAuthMethod a deriving (P.Typeable) +data AnyAuthMethod = forall a. AuthMethod a => AnyAuthMethod a deriving (P.Typeable) -instance AuthMethod AnyAuthMethod where applyAuthMethod config (AnyAuthMethod a) req = applyAuthMethod config a req +instance AuthMethod AnyAuthMethod where applyAuthMethod config (AnyAuthMethod a) req = applyAuthMethod config a req -- | indicates exceptions related to AuthMethods data AuthMethodException = AuthMethodException String deriving (P.Show, P.Typeable) @@ -384,37 +384,37 @@ Module : OpenAPIPetstore.Core -- | apply all matching AuthMethods in config to request _applyAuthMethods - :: OpenAPIPetstoreRequest req contentType res accept + :: OpenAPIPetstoreRequest req contentType res accept -> OpenAPIPetstoreConfig - -> IO (OpenAPIPetstoreRequest req contentType res accept) -_applyAuthMethods req config@(OpenAPIPetstoreConfig {configAuthMethods = as}) = - foldlM go req as + -> IO (OpenAPIPetstoreRequest req contentType res accept) +_applyAuthMethods req config@(OpenAPIPetstoreConfig {configAuthMethods = as}) = + foldlM go req as where - go r (AnyAuthMethod a) = applyAuthMethod config a r + go r (AnyAuthMethod a) = applyAuthMethod config a r -- * Utils -- | Removes Null fields. (OpenAPI-Specification 2.0 does not allow Null in JSON) _omitNulls :: [(Text, A.Value)] -> A.Value -_omitNulls = A.object . P.filter notNull +_omitNulls = A.object . P.filter notNull where - notNull (_, A.Null) = False + notNull (_, A.Null) = False notNull _ = True -- | Encodes fields using WH.toQueryParam -_toFormItem :: (WH.ToHttpApiData a, Functor f) => t -> f a -> f (t, [Text]) -_toFormItem name x = (name,) . (:[]) . WH.toQueryParam <$> x +_toFormItem :: (WH.ToHttpApiData a, Functor f) => t -> f a -> f (t, [Text]) +_toFormItem name x = (name,) . (:[]) . WH.toQueryParam <$> x -- | Collapse (Just "") to Nothing _emptyToNothing :: Maybe String -> Maybe String _emptyToNothing (Just "") = Nothing -_emptyToNothing x = x +_emptyToNothing x = x {-# INLINE _emptyToNothing #-} -- | Collapse (Just mempty) to Nothing -_memptyToNothing :: (P.Monoid a, P.Eq a) => Maybe a -> Maybe a -_memptyToNothing (Just x) | x P.== P.mempty = Nothing -_memptyToNothing x = x +_memptyToNothing :: (P.Monoid a, P.Eq a) => Maybe a -> Maybe a +_memptyToNothing (Just x) | x P.== P.mempty = Nothing +_memptyToNothing x = x {-# INLINE _memptyToNothing #-} -- * DateTime Formatting @@ -424,33 +424,33 @@ Module : OpenAPIPetstore.Core instance A.FromJSON DateTime where parseJSON = A.withText "DateTime" (_readDateTime . T.unpack) instance A.ToJSON DateTime where - toJSON (DateTime t) = A.toJSON (_showDateTime t) + toJSON (DateTime t) = A.toJSON (_showDateTime t) instance WH.FromHttpApiData DateTime where - parseUrlPiece = P.left T.pack . _readDateTime . T.unpack + parseUrlPiece = P.left T.pack . _readDateTime . T.unpack instance WH.ToHttpApiData DateTime where - toUrlPiece (DateTime t) = T.pack (_showDateTime t) + toUrlPiece (DateTime t) = T.pack (_showDateTime t) instance P.Show DateTime where - show (DateTime t) = _showDateTime t + show (DateTime t) = _showDateTime t instance MimeRender MimeMultipartFormData DateTime where - mimeRender _ = mimeRenderDefaultMultipartFormData + mimeRender _ = mimeRenderDefaultMultipartFormData -- | @_parseISO8601@ -_readDateTime :: (TI.ParseTime t, Monad m, Alternative m) => String -> m t +_readDateTime :: (TI.ParseTime t, Monad m, Alternative m) => String -> m t _readDateTime = _parseISO8601 {-# INLINE _readDateTime #-} -- | @TI.formatISO8601Millis@ -_showDateTime :: (t ~ TI.UTCTime, TI.FormatTime t) => t -> String +_showDateTime :: (t ~ TI.UTCTime, TI.FormatTime t) => t -> String _showDateTime = TI.formatISO8601Millis {-# INLINE _showDateTime #-} -- | parse an ISO8601 date-time string -_parseISO8601 :: (TI.ParseTime t, Monad m, Alternative m) => String -> m t -_parseISO8601 t = +_parseISO8601 :: (TI.ParseTime t, Monad m, Alternative m) => String -> m t +_parseISO8601 t = P.asum $ - P.flip (TI.parseTimeM True TI.defaultTimeLocale) t <$> + P.flip (TI.parseTimeM True TI.defaultTimeLocale) t <$> ["%FT%T%QZ", "%FT%T%Q%z", "%FT%T%Q%Z"] {-# INLINE _parseISO8601 #-} @@ -461,24 +461,24 @@ Module : OpenAPIPetstore.Core instance A.FromJSON Date where parseJSON = A.withText "Date" (_readDate . T.unpack) instance A.ToJSON Date where - toJSON (Date t) = A.toJSON (_showDate t) + toJSON (Date t) = A.toJSON (_showDate t) instance WH.FromHttpApiData Date where - parseUrlPiece = P.left T.pack . _readDate . T.unpack + parseUrlPiece = P.left T.pack . _readDate . T.unpack instance WH.ToHttpApiData Date where - toUrlPiece (Date t) = T.pack (_showDate t) + toUrlPiece (Date t) = T.pack (_showDate t) instance P.Show Date where - show (Date t) = _showDate t + show (Date t) = _showDate t instance MimeRender MimeMultipartFormData Date where - mimeRender _ = mimeRenderDefaultMultipartFormData + mimeRender _ = mimeRenderDefaultMultipartFormData -- | @TI.parseTimeM True TI.defaultTimeLocale "%Y-%m-%d"@ -_readDate :: (TI.ParseTime t, Monad m) => String -> m t +_readDate :: (TI.ParseTime t, Monad m) => String -> m t _readDate = TI.parseTimeM True TI.defaultTimeLocale "%Y-%m-%d" {-# INLINE _readDate #-} -- | @TI.formatTime TI.defaultTimeLocale "%Y-%m-%d"@ -_showDate :: TI.FormatTime t => t -> String +_showDate :: TI.FormatTime t => t -> String _showDate = TI.formatTime TI.defaultTimeLocale "%Y-%m-%d" {-# INLINE _showDate #-} @@ -495,16 +495,16 @@ Module : OpenAPIPetstore.Core instance A.ToJSON ByteArray where toJSON = A.toJSON . _showByteArray instance WH.FromHttpApiData ByteArray where - parseUrlPiece = P.left T.pack . _readByteArray + parseUrlPiece = P.left T.pack . _readByteArray instance WH.ToHttpApiData ByteArray where - toUrlPiece = _showByteArray + toUrlPiece = _showByteArray instance P.Show ByteArray where show = T.unpack . _showByteArray instance MimeRender MimeMultipartFormData ByteArray where - mimeRender _ = mimeRenderDefaultMultipartFormData + mimeRender _ = mimeRenderDefaultMultipartFormData -- | read base64 encoded characters -_readByteArray :: Monad m => Text -> m ByteArray +_readByteArray :: Monad m => Text -> m ByteArray _readByteArray = P.either P.fail (pure . ByteArray) . BL64.decode . BL.fromStrict . T.encodeUtf8 {-# INLINE _readByteArray #-} @@ -522,15 +522,15 @@ Module : OpenAPIPetstore.Core instance A.ToJSON Binary where toJSON = A.toJSON . _showBinaryBase64 instance WH.FromHttpApiData Binary where - parseUrlPiece = P.left T.pack . _readBinaryBase64 + parseUrlPiece = P.left T.pack . _readBinaryBase64 instance WH.ToHttpApiData Binary where - toUrlPiece = _showBinaryBase64 + toUrlPiece = _showBinaryBase64 instance P.Show Binary where show = T.unpack . _showBinaryBase64 instance MimeRender MimeMultipartFormData Binary where - mimeRender _ = unBinary + mimeRender _ = unBinary -_readBinaryBase64 :: Monad m => Text -> m Binary +_readBinaryBase64 :: Monad m => Text -> m Binary _readBinaryBase64 = P.either P.fail (pure . Binary) . BL64.decode . BL.fromStrict . T.encodeUtf8 {-# INLINE _readBinaryBase64 #-} @@ -540,6 +540,6 @@ Module : OpenAPIPetstore.Core -- * Lens Type Aliases -type Lens_' s a = Lens_ s s a a -type Lens_ s t a b = forall (f :: * -> *). Functor f => (a -> f b) -> s -> f t +type Lens_' s a = Lens_ s s a a +type Lens_ s t a b = forall (f :: * -> *). Functor f => (a -> f b) -> s -> f t \ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.Logging.html b/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.Logging.html index 96524949f8..97e19440ce 100644 --- a/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.Logging.html +++ b/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.Logging.html @@ -34,11 +34,11 @@ Katip Logging functions -- * Type Aliases (for compatibility) -- | Runs a Katip logging block with the Log environment -type LogExecWithContext = forall m. P.MonadIO m => - LogContext -> LogExec m +type LogExecWithContext = forall m. P.MonadIO m => + LogContext -> LogExec m -- | A Katip logging block -type LogExec m = forall a. LG.KatipT m a -> m a +type LogExec m = forall a. LG.KatipT m a -> m a -- | A Katip Log environment type LogContext = LG.LogEnv @@ -64,9 +64,9 @@ Katip Logging functions -- | A Katip Log environment which targets stdout stdoutLoggingContext :: LogContext -> IO LogContext -stdoutLoggingContext cxt = do - handleScribe <- LG.mkHandleScribe LG.ColorIfTerminal IO.stdout LG.InfoS LG.V2 - LG.registerScribe "stdout" handleScribe LG.defaultScribeSettings cxt +stdoutLoggingContext cxt = do + handleScribe <- LG.mkHandleScribe LG.ColorIfTerminal IO.stdout LG.InfoS LG.V2 + LG.registerScribe "stdout" handleScribe LG.defaultScribeSettings cxt -- * stderr logger @@ -76,34 +76,34 @@ Katip Logging functions -- | A Katip Log environment which targets stderr stderrLoggingContext :: LogContext -> IO LogContext -stderrLoggingContext cxt = do - handleScribe <- LG.mkHandleScribe LG.ColorIfTerminal IO.stderr LG.InfoS LG.V2 - LG.registerScribe "stderr" handleScribe LG.defaultScribeSettings cxt +stderrLoggingContext cxt = do + handleScribe <- LG.mkHandleScribe LG.ColorIfTerminal IO.stderr LG.InfoS LG.V2 + LG.registerScribe "stderr" handleScribe LG.defaultScribeSettings cxt -- * Null logger -- | Disables Katip logging runNullLogExec :: LogExecWithContext -runNullLogExec le (LG.KatipT f) = P.runReaderT f (L.set LG.logEnvScribes mempty le) +runNullLogExec le (LG.KatipT f) = P.runReaderT f (L.set LG.logEnvScribes mempty le) -- * Log Msg -- | Log a katip message -_log :: (Applicative m, LG.Katip m) => Text -> LogLevel -> Text -> m () -_log src level msg = do - LG.logMsg (fromString $ T.unpack src) level (LG.logStr msg) +_log :: (Applicative m, LG.Katip m) => Text -> LogLevel -> Text -> m () +_log src level msg = do + LG.logMsg (fromString $ T.unpack src) level (LG.logStr msg) -- * Log Exceptions -- | re-throws exceptions after logging them logExceptions - :: (LG.Katip m, E.MonadCatch m, Applicative m) - => Text -> m a -> m a -logExceptions src = + :: (LG.Katip m, E.MonadCatch m, Applicative m) + => Text -> m a -> m a +logExceptions src = E.handle - (\(e :: E.SomeException) -> do - _log src LG.ErrorS ((T.pack . show) e) - E.throw e) + (\(e :: E.SomeException) -> do + _log src LG.ErrorS ((T.pack . show) e) + E.throw e) -- * Log Level diff --git a/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.MimeTypes.html b/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.MimeTypes.html index f9d9530f94..47b18a52ac 100644 --- a/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.MimeTypes.html +++ b/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.MimeTypes.html @@ -44,19 +44,19 @@ Module : OpenAPIPetstore.MimeTypes -- * ContentType MimeType -data ContentType a = MimeType a => ContentType { unContentType :: a } +data ContentType a = MimeType a => ContentType { unContentType :: a } -- * Accept MimeType -data Accept a = MimeType a => Accept { unAccept :: a } +data Accept a = MimeType a => Accept { unAccept :: a } -- * Consumes Class -class MimeType mtype => Consumes req mtype where +class MimeType mtype => Consumes req mtype where -- * Produces Class -class MimeType mtype => Produces req mtype where +class MimeType mtype => Produces req mtype where -- * Default Mime Types @@ -76,129 +76,129 @@ Module : OpenAPIPetstore.MimeTypes -- * MimeType Class -class P.Typeable mtype => MimeType mtype where +class P.Typeable mtype => MimeType mtype where {-# MINIMAL mimeType | mimeTypes #-} - mimeTypes :: P.Proxy mtype -> [ME.MediaType] - mimeTypes p = - case mimeType p of - Just x -> [x] + mimeTypes :: P.Proxy mtype -> [ME.MediaType] + mimeTypes p = + case mimeType p of + Just x -> [x] Nothing -> [] - mimeType :: P.Proxy mtype -> Maybe ME.MediaType - mimeType p = - case mimeTypes p of + mimeType :: P.Proxy mtype -> Maybe ME.MediaType + mimeType p = + case mimeTypes p of [] -> Nothing - (x:_) -> Just x + (x:_) -> Just x - mimeType' :: mtype -> Maybe ME.MediaType - mimeType' _ = mimeType (P.Proxy :: P.Proxy mtype) - mimeTypes' :: mtype -> [ME.MediaType] - mimeTypes' _ = mimeTypes (P.Proxy :: P.Proxy mtype) + mimeType' :: mtype -> Maybe ME.MediaType + mimeType' _ = mimeType (P.Proxy :: P.Proxy mtype) + mimeTypes' :: mtype -> [ME.MediaType] + mimeTypes' _ = mimeTypes (P.Proxy :: P.Proxy mtype) -- Default MimeType Instances -- | @application/json; charset=utf-8@ instance MimeType MimeJSON where - mimeType _ = Just $ P.fromString "application/json" + mimeType _ = Just $ P.fromString "application/json" -- | @application/xml; charset=utf-8@ instance MimeType MimeXML where - mimeType _ = Just $ P.fromString "application/xml" + mimeType _ = Just $ P.fromString "application/xml" -- | @application/x-www-form-urlencoded@ instance MimeType MimeFormUrlEncoded where - mimeType _ = Just $ P.fromString "application/x-www-form-urlencoded" + mimeType _ = Just $ P.fromString "application/x-www-form-urlencoded" -- | @multipart/form-data@ instance MimeType MimeMultipartFormData where - mimeType _ = Just $ P.fromString "multipart/form-data" + mimeType _ = Just $ P.fromString "multipart/form-data" -- | @text/plain; charset=utf-8@ instance MimeType MimePlainText where - mimeType _ = Just $ P.fromString "text/plain" + mimeType _ = Just $ P.fromString "text/plain" -- | @application/octet-stream@ instance MimeType MimeOctetStream where - mimeType _ = Just $ P.fromString "application/octet-stream" + mimeType _ = Just $ P.fromString "application/octet-stream" -- | @"*/*"@ instance MimeType MimeAny where - mimeType _ = Just $ P.fromString "*/*" + mimeType _ = Just $ P.fromString "*/*" instance MimeType MimeNoContent where - mimeType _ = Nothing + mimeType _ = Nothing -- * MimeRender Class -class MimeType mtype => MimeRender mtype x where - mimeRender :: P.Proxy mtype -> x -> BL.ByteString - mimeRender' :: mtype -> x -> BL.ByteString - mimeRender' _ x = mimeRender (P.Proxy :: P.Proxy mtype) x +class MimeType mtype => MimeRender mtype x where + mimeRender :: P.Proxy mtype -> x -> BL.ByteString + mimeRender' :: mtype -> x -> BL.ByteString + mimeRender' _ x = mimeRender (P.Proxy :: P.Proxy mtype) x -mimeRenderDefaultMultipartFormData :: WH.ToHttpApiData a => a -> BL.ByteString +mimeRenderDefaultMultipartFormData :: WH.ToHttpApiData a => a -> BL.ByteString mimeRenderDefaultMultipartFormData = BL.fromStrict . T.encodeUtf8 . WH.toQueryParam -- Default MimeRender Instances -- | `A.encode` -instance A.ToJSON a => MimeRender MimeJSON a where mimeRender _ = A.encode +instance A.ToJSON a => MimeRender MimeJSON a where mimeRender _ = A.encode -- | @WH.urlEncodeAsForm@ -instance WH.ToForm a => MimeRender MimeFormUrlEncoded a where mimeRender _ = WH.urlEncodeAsForm +instance WH.ToForm a => MimeRender MimeFormUrlEncoded a where mimeRender _ = WH.urlEncodeAsForm -- | @P.id@ -instance MimeRender MimePlainText BL.ByteString where mimeRender _ = P.id +instance MimeRender MimePlainText BL.ByteString where mimeRender _ = P.id -- | @BL.fromStrict . T.encodeUtf8@ -instance MimeRender MimePlainText T.Text where mimeRender _ = BL.fromStrict . T.encodeUtf8 +instance MimeRender MimePlainText T.Text where mimeRender _ = BL.fromStrict . T.encodeUtf8 -- | @BCL.pack@ -instance MimeRender MimePlainText String where mimeRender _ = BCL.pack +instance MimeRender MimePlainText String where mimeRender _ = BCL.pack -- | @P.id@ -instance MimeRender MimeOctetStream BL.ByteString where mimeRender _ = P.id +instance MimeRender MimeOctetStream BL.ByteString where mimeRender _ = P.id -- | @BL.fromStrict . T.encodeUtf8@ -instance MimeRender MimeOctetStream T.Text where mimeRender _ = BL.fromStrict . T.encodeUtf8 +instance MimeRender MimeOctetStream T.Text where mimeRender _ = BL.fromStrict . T.encodeUtf8 -- | @BCL.pack@ -instance MimeRender MimeOctetStream String where mimeRender _ = BCL.pack +instance MimeRender MimeOctetStream String where mimeRender _ = BCL.pack -instance MimeRender MimeMultipartFormData BL.ByteString where mimeRender _ = P.id +instance MimeRender MimeMultipartFormData BL.ByteString where mimeRender _ = P.id -instance MimeRender MimeMultipartFormData Bool where mimeRender _ = mimeRenderDefaultMultipartFormData -instance MimeRender MimeMultipartFormData Char where mimeRender _ = mimeRenderDefaultMultipartFormData -instance MimeRender MimeMultipartFormData Double where mimeRender _ = mimeRenderDefaultMultipartFormData -instance MimeRender MimeMultipartFormData Float where mimeRender _ = mimeRenderDefaultMultipartFormData -instance MimeRender MimeMultipartFormData Int where mimeRender _ = mimeRenderDefaultMultipartFormData -instance MimeRender MimeMultipartFormData Integer where mimeRender _ = mimeRenderDefaultMultipartFormData -instance MimeRender MimeMultipartFormData String where mimeRender _ = mimeRenderDefaultMultipartFormData -instance MimeRender MimeMultipartFormData T.Text where mimeRender _ = mimeRenderDefaultMultipartFormData +instance MimeRender MimeMultipartFormData Bool where mimeRender _ = mimeRenderDefaultMultipartFormData +instance MimeRender MimeMultipartFormData Char where mimeRender _ = mimeRenderDefaultMultipartFormData +instance MimeRender MimeMultipartFormData Double where mimeRender _ = mimeRenderDefaultMultipartFormData +instance MimeRender MimeMultipartFormData Float where mimeRender _ = mimeRenderDefaultMultipartFormData +instance MimeRender MimeMultipartFormData Int where mimeRender _ = mimeRenderDefaultMultipartFormData +instance MimeRender MimeMultipartFormData Integer where mimeRender _ = mimeRenderDefaultMultipartFormData +instance MimeRender MimeMultipartFormData String where mimeRender _ = mimeRenderDefaultMultipartFormData +instance MimeRender MimeMultipartFormData T.Text where mimeRender _ = mimeRenderDefaultMultipartFormData -- | @P.Right . P.const NoContent@ -instance MimeRender MimeNoContent NoContent where mimeRender _ = P.const BCL.empty +instance MimeRender MimeNoContent NoContent where mimeRender _ = P.const BCL.empty -- * MimeUnrender Class -class MimeType mtype => MimeUnrender mtype o where - mimeUnrender :: P.Proxy mtype -> BL.ByteString -> P.Either String o - mimeUnrender' :: mtype -> BL.ByteString -> P.Either String o - mimeUnrender' _ x = mimeUnrender (P.Proxy :: P.Proxy mtype) x +class MimeType mtype => MimeUnrender mtype o where + mimeUnrender :: P.Proxy mtype -> BL.ByteString -> P.Either String o + mimeUnrender' :: mtype -> BL.ByteString -> P.Either String o + mimeUnrender' _ x = mimeUnrender (P.Proxy :: P.Proxy mtype) x -- Default MimeUnrender Instances -- | @A.eitherDecode@ -instance A.FromJSON a => MimeUnrender MimeJSON a where mimeUnrender _ = A.eitherDecode +instance A.FromJSON a => MimeUnrender MimeJSON a where mimeUnrender _ = A.eitherDecode -- | @P.left T.unpack . WH.urlDecodeAsForm@ -instance WH.FromForm a => MimeUnrender MimeFormUrlEncoded a where mimeUnrender _ = P.left T.unpack . WH.urlDecodeAsForm +instance WH.FromForm a => MimeUnrender MimeFormUrlEncoded a where mimeUnrender _ = P.left T.unpack . WH.urlDecodeAsForm -- | @P.Right . P.id@ -instance MimeUnrender MimePlainText BL.ByteString where mimeUnrender _ = P.Right . P.id +instance MimeUnrender MimePlainText BL.ByteString where mimeUnrender _ = P.Right . P.id -- | @P.left P.show . TL.decodeUtf8'@ -instance MimeUnrender MimePlainText T.Text where mimeUnrender _ = P.left P.show . T.decodeUtf8' . BL.toStrict +instance MimeUnrender MimePlainText T.Text where mimeUnrender _ = P.left P.show . T.decodeUtf8' . BL.toStrict -- | @P.Right . BCL.unpack@ -instance MimeUnrender MimePlainText String where mimeUnrender _ = P.Right . BCL.unpack +instance MimeUnrender MimePlainText String where mimeUnrender _ = P.Right . BCL.unpack -- | @P.Right . P.id@ -instance MimeUnrender MimeOctetStream BL.ByteString where mimeUnrender _ = P.Right . P.id +instance MimeUnrender MimeOctetStream BL.ByteString where mimeUnrender _ = P.Right . P.id -- | @P.left P.show . T.decodeUtf8' . BL.toStrict@ -instance MimeUnrender MimeOctetStream T.Text where mimeUnrender _ = P.left P.show . T.decodeUtf8' . BL.toStrict +instance MimeUnrender MimeOctetStream T.Text where mimeUnrender _ = P.left P.show . T.decodeUtf8' . BL.toStrict -- | @P.Right . BCL.unpack@ -instance MimeUnrender MimeOctetStream String where mimeUnrender _ = P.Right . BCL.unpack +instance MimeUnrender MimeOctetStream String where mimeUnrender _ = P.Right . BCL.unpack -- | @P.Right . P.const NoContent@ -instance MimeUnrender MimeNoContent NoContent where mimeUnrender _ = P.Right . P.const NoContent +instance MimeUnrender MimeNoContent NoContent where mimeUnrender _ = P.Right . P.const NoContent \ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.Model.html b/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.Model.html index 95e776370f..e0de833281 100644 --- a/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.Model.html +++ b/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.Model.html @@ -198,17 +198,17 @@ Module : OpenAPIPetstore.Model -- | FromJSON AdditionalPropertiesClass instance A.FromJSON AdditionalPropertiesClass where - parseJSON = A.withObject "AdditionalPropertiesClass" $ \o -> + parseJSON = A.withObject "AdditionalPropertiesClass" $ \o -> AdditionalPropertiesClass - <$> (o .:? "map_property") - <*> (o .:? "map_of_map_property") + <$> (o .:? "map_property") + <*> (o .:? "map_of_map_property") -- | ToJSON AdditionalPropertiesClass instance A.ToJSON AdditionalPropertiesClass where toJSON AdditionalPropertiesClass {..} = _omitNulls - [ "map_property" .= additionalPropertiesClassMapProperty - , "map_of_map_property" .= additionalPropertiesClassMapOfMapProperty + [ "map_property" .= additionalPropertiesClassMapProperty + , "map_of_map_property" .= additionalPropertiesClassMapOfMapProperty ] @@ -230,17 +230,17 @@ Module : OpenAPIPetstore.Model -- | FromJSON Animal instance A.FromJSON Animal where - parseJSON = A.withObject "Animal" $ \o -> + parseJSON = A.withObject "Animal" $ \o -> Animal - <$> (o .: "className") - <*> (o .:? "color") + <$> (o .: "className") + <*> (o .:? "color") -- | ToJSON Animal instance A.ToJSON Animal where toJSON Animal {..} = _omitNulls - [ "className" .= animalClassName - , "color" .= animalColor + [ "className" .= animalClassName + , "color" .= animalColor ] @@ -248,9 +248,9 @@ Module : OpenAPIPetstore.Model mkAnimal :: Text -- ^ 'animalClassName' -> Animal -mkAnimal animalClassName = +mkAnimal animalClassName = Animal - { animalClassName + { animalClassName , animalColor = Nothing } @@ -262,7 +262,7 @@ Module : OpenAPIPetstore.Model -- | FromJSON AnimalFarm instance A.FromJSON AnimalFarm where - parseJSON = A.withObject "AnimalFarm" $ \o -> + parseJSON = A.withObject "AnimalFarm" $ \o -> pure AnimalFarm @@ -292,19 +292,19 @@ Module : OpenAPIPetstore.Model -- | FromJSON ApiResponse instance A.FromJSON ApiResponse where - parseJSON = A.withObject "ApiResponse" $ \o -> + parseJSON = A.withObject "ApiResponse" $ \o -> ApiResponse - <$> (o .:? "code") - <*> (o .:? "type") - <*> (o .:? "message") + <$> (o .:? "code") + <*> (o .:? "type") + <*> (o .:? "message") -- | ToJSON ApiResponse instance A.ToJSON ApiResponse where toJSON ApiResponse {..} = _omitNulls - [ "code" .= apiResponseCode - , "type" .= apiResponseType - , "message" .= apiResponseMessage + [ "code" .= apiResponseCode + , "type" .= apiResponseType + , "message" .= apiResponseMessage ] @@ -326,15 +326,15 @@ Module : OpenAPIPetstore.Model -- | FromJSON ArrayOfArrayOfNumberOnly instance A.FromJSON ArrayOfArrayOfNumberOnly where - parseJSON = A.withObject "ArrayOfArrayOfNumberOnly" $ \o -> + parseJSON = A.withObject "ArrayOfArrayOfNumberOnly" $ \o -> ArrayOfArrayOfNumberOnly - <$> (o .:? "ArrayArrayNumber") + <$> (o .:? "ArrayArrayNumber") -- | ToJSON ArrayOfArrayOfNumberOnly instance A.ToJSON ArrayOfArrayOfNumberOnly where toJSON ArrayOfArrayOfNumberOnly {..} = _omitNulls - [ "ArrayArrayNumber" .= arrayOfArrayOfNumberOnlyArrayArrayNumber + [ "ArrayArrayNumber" .= arrayOfArrayOfNumberOnlyArrayArrayNumber ] @@ -354,15 +354,15 @@ Module : OpenAPIPetstore.Model -- | FromJSON ArrayOfNumberOnly instance A.FromJSON ArrayOfNumberOnly where - parseJSON = A.withObject "ArrayOfNumberOnly" $ \o -> + parseJSON = A.withObject "ArrayOfNumberOnly" $ \o -> ArrayOfNumberOnly - <$> (o .:? "ArrayNumber") + <$> (o .:? "ArrayNumber") -- | ToJSON ArrayOfNumberOnly instance A.ToJSON ArrayOfNumberOnly where toJSON ArrayOfNumberOnly {..} = _omitNulls - [ "ArrayNumber" .= arrayOfNumberOnlyArrayNumber + [ "ArrayNumber" .= arrayOfNumberOnlyArrayNumber ] @@ -384,19 +384,19 @@ Module : OpenAPIPetstore.Model -- | FromJSON ArrayTest instance A.FromJSON ArrayTest where - parseJSON = A.withObject "ArrayTest" $ \o -> + parseJSON = A.withObject "ArrayTest" $ \o -> ArrayTest - <$> (o .:? "array_of_string") - <*> (o .:? "array_array_of_integer") - <*> (o .:? "array_array_of_model") + <$> (o .:? "array_of_string") + <*> (o .:? "array_array_of_integer") + <*> (o .:? "array_array_of_model") -- | ToJSON ArrayTest instance A.ToJSON ArrayTest where toJSON ArrayTest {..} = _omitNulls - [ "array_of_string" .= arrayTestArrayOfString - , "array_array_of_integer" .= arrayTestArrayArrayOfInteger - , "array_array_of_model" .= arrayTestArrayArrayOfModel + [ "array_of_string" .= arrayTestArrayOfString + , "array_array_of_integer" .= arrayTestArrayArrayOfInteger + , "array_array_of_model" .= arrayTestArrayArrayOfModel ] @@ -423,25 +423,25 @@ Module : OpenAPIPetstore.Model -- | FromJSON Capitalization instance A.FromJSON Capitalization where - parseJSON = A.withObject "Capitalization" $ \o -> + parseJSON = A.withObject "Capitalization" $ \o -> Capitalization - <$> (o .:? "smallCamel") - <*> (o .:? "CapitalCamel") - <*> (o .:? "small_Snake") - <*> (o .:? "Capital_Snake") - <*> (o .:? "SCA_ETH_Flow_Points") - <*> (o .:? "ATT_NAME") + <$> (o .:? "smallCamel") + <*> (o .:? "CapitalCamel") + <*> (o .:? "small_Snake") + <*> (o .:? "Capital_Snake") + <*> (o .:? "SCA_ETH_Flow_Points") + <*> (o .:? "ATT_NAME") -- | ToJSON Capitalization instance A.ToJSON Capitalization where toJSON Capitalization {..} = _omitNulls - [ "smallCamel" .= capitalizationSmallCamel - , "CapitalCamel" .= capitalizationCapitalCamel - , "small_Snake" .= capitalizationSmallSnake - , "Capital_Snake" .= capitalizationCapitalSnake - , "SCA_ETH_Flow_Points" .= capitalizationScaEthFlowPoints - , "ATT_NAME" .= capitalizationAttName + [ "smallCamel" .= capitalizationSmallCamel + , "CapitalCamel" .= capitalizationCapitalCamel + , "small_Snake" .= capitalizationSmallSnake + , "Capital_Snake" .= capitalizationCapitalSnake + , "SCA_ETH_Flow_Points" .= capitalizationScaEthFlowPoints + , "ATT_NAME" .= capitalizationAttName ] @@ -468,19 +468,19 @@ Module : OpenAPIPetstore.Model -- | FromJSON Cat instance A.FromJSON Cat where - parseJSON = A.withObject "Cat" $ \o -> + parseJSON = A.withObject "Cat" $ \o -> Cat - <$> (o .: "className") - <*> (o .:? "color") - <*> (o .:? "declawed") + <$> (o .: "className") + <*> (o .:? "color") + <*> (o .:? "declawed") -- | ToJSON Cat instance A.ToJSON Cat where toJSON Cat {..} = _omitNulls - [ "className" .= catClassName - , "color" .= catColor - , "declawed" .= catDeclawed + [ "className" .= catClassName + , "color" .= catColor + , "declawed" .= catDeclawed ] @@ -488,9 +488,9 @@ Module : OpenAPIPetstore.Model mkCat :: Text -- ^ 'catClassName' -> Cat -mkCat catClassName = +mkCat catClassName = Cat - { catClassName + { catClassName , catColor = Nothing , catDeclawed = Nothing } @@ -504,17 +504,17 @@ Module : OpenAPIPetstore.Model -- | FromJSON Category instance A.FromJSON Category where - parseJSON = A.withObject "Category" $ \o -> + parseJSON = A.withObject "Category" $ \o -> Category - <$> (o .:? "id") - <*> (o .:? "name") + <$> (o .:? "id") + <*> (o .:? "name") -- | ToJSON Category instance A.ToJSON Category where toJSON Category {..} = _omitNulls - [ "id" .= categoryId - , "name" .= categoryName + [ "id" .= categoryId + , "name" .= categoryName ] @@ -536,15 +536,15 @@ Module : OpenAPIPetstore.Model -- | FromJSON ClassModel instance A.FromJSON ClassModel where - parseJSON = A.withObject "ClassModel" $ \o -> + parseJSON = A.withObject "ClassModel" $ \o -> ClassModel - <$> (o .:? "_class") + <$> (o .:? "_class") -- | ToJSON ClassModel instance A.ToJSON ClassModel where toJSON ClassModel {..} = _omitNulls - [ "_class" .= classModelClass + [ "_class" .= classModelClass ] @@ -564,15 +564,15 @@ Module : OpenAPIPetstore.Model -- | FromJSON Client instance A.FromJSON Client where - parseJSON = A.withObject "Client" $ \o -> + parseJSON = A.withObject "Client" $ \o -> Client - <$> (o .:? "client") + <$> (o .:? "client") -- | ToJSON Client instance A.ToJSON Client where toJSON Client {..} = _omitNulls - [ "client" .= clientClient + [ "client" .= clientClient ] @@ -594,19 +594,19 @@ Module : OpenAPIPetstore.Model -- | FromJSON Dog instance A.FromJSON Dog where - parseJSON = A.withObject "Dog" $ \o -> + parseJSON = A.withObject "Dog" $ \o -> Dog - <$> (o .: "className") - <*> (o .:? "color") - <*> (o .:? "breed") + <$> (o .: "className") + <*> (o .:? "color") + <*> (o .:? "breed") -- | ToJSON Dog instance A.ToJSON Dog where toJSON Dog {..} = _omitNulls - [ "className" .= dogClassName - , "color" .= dogColor - , "breed" .= dogBreed + [ "className" .= dogClassName + , "color" .= dogColor + , "breed" .= dogBreed ] @@ -614,9 +614,9 @@ Module : OpenAPIPetstore.Model mkDog :: Text -- ^ 'dogClassName' -> Dog -mkDog dogClassName = +mkDog dogClassName = Dog - { dogClassName + { dogClassName , dogColor = Nothing , dogBreed = Nothing } @@ -630,17 +630,17 @@ Module : OpenAPIPetstore.Model -- | FromJSON EnumArrays instance A.FromJSON EnumArrays where - parseJSON = A.withObject "EnumArrays" $ \o -> + parseJSON = A.withObject "EnumArrays" $ \o -> EnumArrays - <$> (o .:? "just_symbol") - <*> (o .:? "array_enum") + <$> (o .:? "just_symbol") + <*> (o .:? "array_enum") -- | ToJSON EnumArrays instance A.ToJSON EnumArrays where toJSON EnumArrays {..} = _omitNulls - [ "just_symbol" .= enumArraysJustSymbol - , "array_enum" .= enumArraysArrayEnum + [ "just_symbol" .= enumArraysJustSymbol + , "array_enum" .= enumArraysArrayEnum ] @@ -665,23 +665,23 @@ Module : OpenAPIPetstore.Model -- | FromJSON EnumTest instance A.FromJSON EnumTest where - parseJSON = A.withObject "EnumTest" $ \o -> + parseJSON = A.withObject "EnumTest" $ \o -> EnumTest - <$> (o .:? "enum_string") - <*> (o .: "enum_string_required") - <*> (o .:? "enum_integer") - <*> (o .:? "enum_number") - <*> (o .:? "outerEnum") + <$> (o .:? "enum_string") + <*> (o .: "enum_string_required") + <*> (o .:? "enum_integer") + <*> (o .:? "enum_number") + <*> (o .:? "outerEnum") -- | ToJSON EnumTest instance A.ToJSON EnumTest where toJSON EnumTest {..} = _omitNulls - [ "enum_string" .= enumTestEnumString - , "enum_string_required" .= enumTestEnumStringRequired - , "enum_integer" .= enumTestEnumInteger - , "enum_number" .= enumTestEnumNumber - , "outerEnum" .= enumTestOuterEnum + [ "enum_string" .= enumTestEnumString + , "enum_string_required" .= enumTestEnumStringRequired + , "enum_integer" .= enumTestEnumInteger + , "enum_number" .= enumTestEnumNumber + , "outerEnum" .= enumTestOuterEnum ] @@ -689,10 +689,10 @@ Module : OpenAPIPetstore.Model mkEnumTest :: E'EnumString -- ^ 'enumTestEnumStringRequired' -> EnumTest -mkEnumTest enumTestEnumStringRequired = +mkEnumTest enumTestEnumStringRequired = EnumTest { enumTestEnumString = Nothing - , enumTestEnumStringRequired + , enumTestEnumStringRequired , enumTestEnumInteger = Nothing , enumTestEnumNumber = Nothing , enumTestOuterEnum = Nothing @@ -718,39 +718,39 @@ Module : OpenAPIPetstore.Model -- | FromJSON FormatTest instance A.FromJSON FormatTest where - parseJSON = A.withObject "FormatTest" $ \o -> + parseJSON = A.withObject "FormatTest" $ \o -> FormatTest - <$> (o .:? "integer") - <*> (o .:? "int32") - <*> (o .:? "int64") - <*> (o .: "number") - <*> (o .:? "float") - <*> (o .:? "double") - <*> (o .:? "string") - <*> (o .: "byte") - <*> (o .:? "binary") - <*> (o .: "date") - <*> (o .:? "dateTime") - <*> (o .:? "uuid") - <*> (o .: "password") + <$> (o .:? "integer") + <*> (o .:? "int32") + <*> (o .:? "int64") + <*> (o .: "number") + <*> (o .:? "float") + <*> (o .:? "double") + <*> (o .:? "string") + <*> (o .: "byte") + <*> (o .:? "binary") + <*> (o .: "date") + <*> (o .:? "dateTime") + <*> (o .:? "uuid") + <*> (o .: "password") -- | ToJSON FormatTest instance A.ToJSON FormatTest where toJSON FormatTest {..} = _omitNulls - [ "integer" .= formatTestInteger - , "int32" .= formatTestInt32 - , "int64" .= formatTestInt64 - , "number" .= formatTestNumber - , "float" .= formatTestFloat - , "double" .= formatTestDouble - , "string" .= formatTestString - , "byte" .= formatTestByte - , "binary" .= formatTestBinary - , "date" .= formatTestDate - , "dateTime" .= formatTestDateTime - , "uuid" .= formatTestUuid - , "password" .= formatTestPassword + [ "integer" .= formatTestInteger + , "int32" .= formatTestInt32 + , "int64" .= formatTestInt64 + , "number" .= formatTestNumber + , "float" .= formatTestFloat + , "double" .= formatTestDouble + , "string" .= formatTestString + , "byte" .= formatTestByte + , "binary" .= formatTestBinary + , "date" .= formatTestDate + , "dateTime" .= formatTestDateTime + , "uuid" .= formatTestUuid + , "password" .= formatTestPassword ] @@ -761,21 +761,21 @@ Module : OpenAPIPetstore.Model -> Date -- ^ 'formatTestDate' -> Text -- ^ 'formatTestPassword' -> FormatTest -mkFormatTest formatTestNumber formatTestByte formatTestDate formatTestPassword = +mkFormatTest formatTestNumber formatTestByte formatTestDate formatTestPassword = FormatTest { formatTestInteger = Nothing , formatTestInt32 = Nothing , formatTestInt64 = Nothing - , formatTestNumber + , formatTestNumber , formatTestFloat = Nothing , formatTestDouble = Nothing , formatTestString = Nothing - , formatTestByte + , formatTestByte , formatTestBinary = Nothing - , formatTestDate + , formatTestDate , formatTestDateTime = Nothing , formatTestUuid = Nothing - , formatTestPassword + , formatTestPassword } -- ** HasOnlyReadOnly @@ -787,17 +787,17 @@ Module : OpenAPIPetstore.Model -- | FromJSON HasOnlyReadOnly instance A.FromJSON HasOnlyReadOnly where - parseJSON = A.withObject "HasOnlyReadOnly" $ \o -> + parseJSON = A.withObject "HasOnlyReadOnly" $ \o -> HasOnlyReadOnly - <$> (o .:? "bar") - <*> (o .:? "foo") + <$> (o .:? "bar") + <*> (o .:? "foo") -- | ToJSON HasOnlyReadOnly instance A.ToJSON HasOnlyReadOnly where toJSON HasOnlyReadOnly {..} = _omitNulls - [ "bar" .= hasOnlyReadOnlyBar - , "foo" .= hasOnlyReadOnlyFoo + [ "bar" .= hasOnlyReadOnlyBar + , "foo" .= hasOnlyReadOnlyFoo ] @@ -819,17 +819,17 @@ Module : OpenAPIPetstore.Model -- | FromJSON MapTest instance A.FromJSON MapTest where - parseJSON = A.withObject "MapTest" $ \o -> + parseJSON = A.withObject "MapTest" $ \o -> MapTest - <$> (o .:? "map_map_of_string") - <*> (o .:? "map_of_enum_string") + <$> (o .:? "map_map_of_string") + <*> (o .:? "map_of_enum_string") -- | ToJSON MapTest instance A.ToJSON MapTest where toJSON MapTest {..} = _omitNulls - [ "map_map_of_string" .= mapTestMapMapOfString - , "map_of_enum_string" .= mapTestMapOfEnumString + [ "map_map_of_string" .= mapTestMapMapOfString + , "map_of_enum_string" .= mapTestMapOfEnumString ] @@ -852,19 +852,19 @@ Module : OpenAPIPetstore.Model -- | FromJSON MixedPropertiesAndAdditionalPropertiesClass instance A.FromJSON MixedPropertiesAndAdditionalPropertiesClass where - parseJSON = A.withObject "MixedPropertiesAndAdditionalPropertiesClass" $ \o -> + parseJSON = A.withObject "MixedPropertiesAndAdditionalPropertiesClass" $ \o -> MixedPropertiesAndAdditionalPropertiesClass - <$> (o .:? "uuid") - <*> (o .:? "dateTime") - <*> (o .:? "map") + <$> (o .:? "uuid") + <*> (o .:? "dateTime") + <*> (o .:? "map") -- | ToJSON MixedPropertiesAndAdditionalPropertiesClass instance A.ToJSON MixedPropertiesAndAdditionalPropertiesClass where toJSON MixedPropertiesAndAdditionalPropertiesClass {..} = _omitNulls - [ "uuid" .= mixedPropertiesAndAdditionalPropertiesClassUuid - , "dateTime" .= mixedPropertiesAndAdditionalPropertiesClassDateTime - , "map" .= mixedPropertiesAndAdditionalPropertiesClassMap + [ "uuid" .= mixedPropertiesAndAdditionalPropertiesClassUuid + , "dateTime" .= mixedPropertiesAndAdditionalPropertiesClassDateTime + , "map" .= mixedPropertiesAndAdditionalPropertiesClassMap ] @@ -888,17 +888,17 @@ Module : OpenAPIPetstore.Model -- | FromJSON Model200Response instance A.FromJSON Model200Response where - parseJSON = A.withObject "Model200Response" $ \o -> + parseJSON = A.withObject "Model200Response" $ \o -> Model200Response - <$> (o .:? "name") - <*> (o .:? "class") + <$> (o .:? "name") + <*> (o .:? "class") -- | ToJSON Model200Response instance A.ToJSON Model200Response where toJSON Model200Response {..} = _omitNulls - [ "name" .= model200ResponseName - , "class" .= model200ResponseClass + [ "name" .= model200ResponseName + , "class" .= model200ResponseClass ] @@ -919,15 +919,15 @@ Module : OpenAPIPetstore.Model -- | FromJSON ModelList instance A.FromJSON ModelList where - parseJSON = A.withObject "ModelList" $ \o -> + parseJSON = A.withObject "ModelList" $ \o -> ModelList - <$> (o .:? "123-list") + <$> (o .:? "123-list") -- | ToJSON ModelList instance A.ToJSON ModelList where toJSON ModelList {..} = _omitNulls - [ "123-list" .= modelList123list + [ "123-list" .= modelList123list ] @@ -948,15 +948,15 @@ Module : OpenAPIPetstore.Model -- | FromJSON ModelReturn instance A.FromJSON ModelReturn where - parseJSON = A.withObject "ModelReturn" $ \o -> + parseJSON = A.withObject "ModelReturn" $ \o -> ModelReturn - <$> (o .:? "return") + <$> (o .:? "return") -- | ToJSON ModelReturn instance A.ToJSON ModelReturn where toJSON ModelReturn {..} = _omitNulls - [ "return" .= modelReturnReturn + [ "return" .= modelReturnReturn ] @@ -980,21 +980,21 @@ Module : OpenAPIPetstore.Model -- | FromJSON Name instance A.FromJSON Name where - parseJSON = A.withObject "Name" $ \o -> + parseJSON = A.withObject "Name" $ \o -> Name - <$> (o .: "name") - <*> (o .:? "snake_case") - <*> (o .:? "property") - <*> (o .:? "123Number") + <$> (o .: "name") + <*> (o .:? "snake_case") + <*> (o .:? "property") + <*> (o .:? "123Number") -- | ToJSON Name instance A.ToJSON Name where toJSON Name {..} = _omitNulls - [ "name" .= nameName - , "snake_case" .= nameSnakeCase - , "property" .= nameProperty - , "123Number" .= name123number + [ "name" .= nameName + , "snake_case" .= nameSnakeCase + , "property" .= nameProperty + , "123Number" .= name123number ] @@ -1002,9 +1002,9 @@ Module : OpenAPIPetstore.Model mkName :: Int -- ^ 'nameName' -> Name -mkName nameName = +mkName nameName = Name - { nameName + { nameName , nameSnakeCase = Nothing , nameProperty = Nothing , name123number = Nothing @@ -1018,15 +1018,15 @@ Module : OpenAPIPetstore.Model -- | FromJSON NumberOnly instance A.FromJSON NumberOnly where - parseJSON = A.withObject "NumberOnly" $ \o -> + parseJSON = A.withObject "NumberOnly" $ \o -> NumberOnly - <$> (o .:? "JustNumber") + <$> (o .:? "JustNumber") -- | ToJSON NumberOnly instance A.ToJSON NumberOnly where toJSON NumberOnly {..} = _omitNulls - [ "JustNumber" .= numberOnlyJustNumber + [ "JustNumber" .= numberOnlyJustNumber ] @@ -1051,25 +1051,25 @@ Module : OpenAPIPetstore.Model -- | FromJSON Order instance A.FromJSON Order where - parseJSON = A.withObject "Order" $ \o -> + parseJSON = A.withObject "Order" $ \o -> Order - <$> (o .:? "id") - <*> (o .:? "petId") - <*> (o .:? "quantity") - <*> (o .:? "shipDate") - <*> (o .:? "status") - <*> (o .:? "complete") + <$> (o .:? "id") + <*> (o .:? "petId") + <*> (o .:? "quantity") + <*> (o .:? "shipDate") + <*> (o .:? "status") + <*> (o .:? "complete") -- | ToJSON Order instance A.ToJSON Order where toJSON Order {..} = _omitNulls - [ "id" .= orderId - , "petId" .= orderPetId - , "quantity" .= orderQuantity - , "shipDate" .= orderShipDate - , "status" .= orderStatus - , "complete" .= orderComplete + [ "id" .= orderId + , "petId" .= orderPetId + , "quantity" .= orderQuantity + , "shipDate" .= orderShipDate + , "status" .= orderStatus + , "complete" .= orderComplete ] @@ -1096,19 +1096,19 @@ Module : OpenAPIPetstore.Model -- | FromJSON OuterComposite instance A.FromJSON OuterComposite where - parseJSON = A.withObject "OuterComposite" $ \o -> + parseJSON = A.withObject "OuterComposite" $ \o -> OuterComposite - <$> (o .:? "my_number") - <*> (o .:? "my_string") - <*> (o .:? "my_boolean") + <$> (o .:? "my_number") + <*> (o .:? "my_string") + <*> (o .:? "my_boolean") -- | ToJSON OuterComposite instance A.ToJSON OuterComposite where toJSON OuterComposite {..} = _omitNulls - [ "my_number" .= outerCompositeMyNumber - , "my_string" .= outerCompositeMyString - , "my_boolean" .= outerCompositeMyBoolean + [ "my_number" .= outerCompositeMyNumber + , "my_string" .= outerCompositeMyString + , "my_boolean" .= outerCompositeMyBoolean ] @@ -1135,25 +1135,25 @@ Module : OpenAPIPetstore.Model -- | FromJSON Pet instance A.FromJSON Pet where - parseJSON = A.withObject "Pet" $ \o -> + parseJSON = A.withObject "Pet" $ \o -> Pet - <$> (o .:? "id") - <*> (o .:? "category") - <*> (o .: "name") - <*> (o .: "photoUrls") - <*> (o .:? "tags") - <*> (o .:? "status") + <$> (o .:? "id") + <*> (o .:? "category") + <*> (o .: "name") + <*> (o .: "photoUrls") + <*> (o .:? "tags") + <*> (o .:? "status") -- | ToJSON Pet instance A.ToJSON Pet where toJSON Pet {..} = _omitNulls - [ "id" .= petId - , "category" .= petCategory - , "name" .= petName - , "photoUrls" .= petPhotoUrls - , "tags" .= petTags - , "status" .= petStatus + [ "id" .= petId + , "category" .= petCategory + , "name" .= petName + , "photoUrls" .= petPhotoUrls + , "tags" .= petTags + , "status" .= petStatus ] @@ -1162,12 +1162,12 @@ Module : OpenAPIPetstore.Model :: Text -- ^ 'petName' -> [Text] -- ^ 'petPhotoUrls' -> Pet -mkPet petName petPhotoUrls = +mkPet petName petPhotoUrls = Pet { petId = Nothing , petCategory = Nothing - , petName - , petPhotoUrls + , petName + , petPhotoUrls , petTags = Nothing , petStatus = Nothing } @@ -1181,17 +1181,17 @@ Module : OpenAPIPetstore.Model -- | FromJSON ReadOnlyFirst instance A.FromJSON ReadOnlyFirst where - parseJSON = A.withObject "ReadOnlyFirst" $ \o -> + parseJSON = A.withObject "ReadOnlyFirst" $ \o -> ReadOnlyFirst - <$> (o .:? "bar") - <*> (o .:? "baz") + <$> (o .:? "bar") + <*> (o .:? "baz") -- | ToJSON ReadOnlyFirst instance A.ToJSON ReadOnlyFirst where toJSON ReadOnlyFirst {..} = _omitNulls - [ "bar" .= readOnlyFirstBar - , "baz" .= readOnlyFirstBaz + [ "bar" .= readOnlyFirstBar + , "baz" .= readOnlyFirstBaz ] @@ -1212,15 +1212,15 @@ Module : OpenAPIPetstore.Model -- | FromJSON SpecialModelName instance A.FromJSON SpecialModelName where - parseJSON = A.withObject "SpecialModelName" $ \o -> + parseJSON = A.withObject "SpecialModelName" $ \o -> SpecialModelName - <$> (o .:? "$special[property.name]") + <$> (o .:? "$special[property.name]") -- | ToJSON SpecialModelName instance A.ToJSON SpecialModelName where toJSON SpecialModelName {..} = _omitNulls - [ "$special[property.name]" .= specialModelNameSpecialPropertyName + [ "$special[property.name]" .= specialModelNameSpecialPropertyName ] @@ -1241,17 +1241,17 @@ Module : OpenAPIPetstore.Model -- | FromJSON Tag instance A.FromJSON Tag where - parseJSON = A.withObject "Tag" $ \o -> + parseJSON = A.withObject "Tag" $ \o -> Tag - <$> (o .:? "id") - <*> (o .:? "name") + <$> (o .:? "id") + <*> (o .:? "name") -- | ToJSON Tag instance A.ToJSON Tag where toJSON Tag {..} = _omitNulls - [ "id" .= tagId - , "name" .= tagName + [ "id" .= tagId + , "name" .= tagName ] @@ -1279,29 +1279,29 @@ Module : OpenAPIPetstore.Model -- | FromJSON User instance A.FromJSON User where - parseJSON = A.withObject "User" $ \o -> + parseJSON = A.withObject "User" $ \o -> User - <$> (o .:? "id") - <*> (o .:? "username") - <*> (o .:? "firstName") - <*> (o .:? "lastName") - <*> (o .:? "email") - <*> (o .:? "password") - <*> (o .:? "phone") - <*> (o .:? "userStatus") + <$> (o .:? "id") + <*> (o .:? "username") + <*> (o .:? "firstName") + <*> (o .:? "lastName") + <*> (o .:? "email") + <*> (o .:? "password") + <*> (o .:? "phone") + <*> (o .:? "userStatus") -- | ToJSON User instance A.ToJSON User where toJSON User {..} = _omitNulls - [ "id" .= userId - , "username" .= userUsername - , "firstName" .= userFirstName - , "lastName" .= userLastName - , "email" .= userEmail - , "password" .= userPassword - , "phone" .= userPhone - , "userStatus" .= userUserStatus + [ "id" .= userId + , "username" .= userUsername + , "firstName" .= userFirstName + , "lastName" .= userLastName + , "email" .= userEmail + , "password" .= userPassword + , "phone" .= userPhone + , "userStatus" .= userUserStatus ] @@ -1333,10 +1333,10 @@ Module : OpenAPIPetstore.Model deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) instance A.ToJSON E'ArrayEnum where toJSON = A.toJSON . fromE'ArrayEnum -instance A.FromJSON E'ArrayEnum where parseJSON o = P.either P.fail (pure . P.id) . toE'ArrayEnum =<< A.parseJSON o -instance WH.ToHttpApiData E'ArrayEnum where toQueryParam = WH.toQueryParam . fromE'ArrayEnum -instance WH.FromHttpApiData E'ArrayEnum where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'ArrayEnum -instance MimeRender MimeMultipartFormData E'ArrayEnum where mimeRender _ = mimeRenderDefaultMultipartFormData +instance A.FromJSON E'ArrayEnum where parseJSON o = P.either P.fail (pure . P.id) . toE'ArrayEnum =<< A.parseJSON o +instance WH.ToHttpApiData E'ArrayEnum where toQueryParam = WH.toQueryParam . fromE'ArrayEnum +instance WH.FromHttpApiData E'ArrayEnum where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'ArrayEnum +instance MimeRender MimeMultipartFormData E'ArrayEnum where mimeRender _ = mimeRenderDefaultMultipartFormData -- | unwrap 'E'ArrayEnum' enum fromE'ArrayEnum :: E'ArrayEnum -> Text @@ -1349,7 +1349,7 @@ Module : OpenAPIPetstore.Model toE'ArrayEnum = \case "fish" -> P.Right E'ArrayEnum'Fish "crab" -> P.Right E'ArrayEnum'Crab - s -> P.Left $ "toE'ArrayEnum: enum parse failure: " P.++ P.show s + s -> P.Left $ "toE'ArrayEnum: enum parse failure: " P.++ P.show s -- ** E'EnumFormString @@ -1363,10 +1363,10 @@ Module : OpenAPIPetstore.Model deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) instance A.ToJSON E'EnumFormString where toJSON = A.toJSON . fromE'EnumFormString -instance A.FromJSON E'EnumFormString where parseJSON o = P.either P.fail (pure . P.id) . toE'EnumFormString =<< A.parseJSON o -instance WH.ToHttpApiData E'EnumFormString where toQueryParam = WH.toQueryParam . fromE'EnumFormString -instance WH.FromHttpApiData E'EnumFormString where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'EnumFormString -instance MimeRender MimeMultipartFormData E'EnumFormString where mimeRender _ = mimeRenderDefaultMultipartFormData +instance A.FromJSON E'EnumFormString where parseJSON o = P.either P.fail (pure . P.id) . toE'EnumFormString =<< A.parseJSON o +instance WH.ToHttpApiData E'EnumFormString where toQueryParam = WH.toQueryParam . fromE'EnumFormString +instance WH.FromHttpApiData E'EnumFormString where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'EnumFormString +instance MimeRender MimeMultipartFormData E'EnumFormString where mimeRender _ = mimeRenderDefaultMultipartFormData -- | unwrap 'E'EnumFormString' enum fromE'EnumFormString :: E'EnumFormString -> Text @@ -1381,7 +1381,7 @@ Module : OpenAPIPetstore.Model "_abc" -> P.Right E'EnumFormString'_abc "-efg" -> P.Right E'EnumFormString'_efg "(xyz)" -> P.Right E'EnumFormString'_xyz - s -> P.Left $ "toE'EnumFormString: enum parse failure: " P.++ P.show s + s -> P.Left $ "toE'EnumFormString: enum parse failure: " P.++ P.show s -- ** E'EnumFormStringArray @@ -1393,10 +1393,10 @@ Module : OpenAPIPetstore.Model deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) instance A.ToJSON E'EnumFormStringArray where toJSON = A.toJSON . fromE'EnumFormStringArray -instance A.FromJSON E'EnumFormStringArray where parseJSON o = P.either P.fail (pure . P.id) . toE'EnumFormStringArray =<< A.parseJSON o -instance WH.ToHttpApiData E'EnumFormStringArray where toQueryParam = WH.toQueryParam . fromE'EnumFormStringArray -instance WH.FromHttpApiData E'EnumFormStringArray where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'EnumFormStringArray -instance MimeRender MimeMultipartFormData E'EnumFormStringArray where mimeRender _ = mimeRenderDefaultMultipartFormData +instance A.FromJSON E'EnumFormStringArray where parseJSON o = P.either P.fail (pure . P.id) . toE'EnumFormStringArray =<< A.parseJSON o +instance WH.ToHttpApiData E'EnumFormStringArray where toQueryParam = WH.toQueryParam . fromE'EnumFormStringArray +instance WH.FromHttpApiData E'EnumFormStringArray where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'EnumFormStringArray +instance MimeRender MimeMultipartFormData E'EnumFormStringArray where mimeRender _ = mimeRenderDefaultMultipartFormData -- | unwrap 'E'EnumFormStringArray' enum fromE'EnumFormStringArray :: E'EnumFormStringArray -> Text @@ -1409,7 +1409,7 @@ Module : OpenAPIPetstore.Model toE'EnumFormStringArray = \case ">" -> P.Right E'EnumFormStringArray'GreaterThan "$" -> P.Right E'EnumFormStringArray'Dollar - s -> P.Left $ "toE'EnumFormStringArray: enum parse failure: " P.++ P.show s + s -> P.Left $ "toE'EnumFormStringArray: enum parse failure: " P.++ P.show s -- ** E'EnumInteger @@ -1421,10 +1421,10 @@ Module : OpenAPIPetstore.Model deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) instance A.ToJSON E'EnumInteger where toJSON = A.toJSON . fromE'EnumInteger -instance A.FromJSON E'EnumInteger where parseJSON o = P.either P.fail (pure . P.id) . toE'EnumInteger =<< A.parseJSON o -instance WH.ToHttpApiData E'EnumInteger where toQueryParam = WH.toQueryParam . fromE'EnumInteger -instance WH.FromHttpApiData E'EnumInteger where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'EnumInteger -instance MimeRender MimeMultipartFormData E'EnumInteger where mimeRender _ = mimeRenderDefaultMultipartFormData +instance A.FromJSON E'EnumInteger where parseJSON o = P.either P.fail (pure . P.id) . toE'EnumInteger =<< A.parseJSON o +instance WH.ToHttpApiData E'EnumInteger where toQueryParam = WH.toQueryParam . fromE'EnumInteger +instance WH.FromHttpApiData E'EnumInteger where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'EnumInteger +instance MimeRender MimeMultipartFormData E'EnumInteger where mimeRender _ = mimeRenderDefaultMultipartFormData -- | unwrap 'E'EnumInteger' enum fromE'EnumInteger :: E'EnumInteger -> Int @@ -1437,7 +1437,7 @@ Module : OpenAPIPetstore.Model toE'EnumInteger = \case 1 -> P.Right E'EnumInteger'Num1 -1 -> P.Right E'EnumInteger'NumMinus_1 - s -> P.Left $ "toE'EnumInteger: enum parse failure: " P.++ P.show s + s -> P.Left $ "toE'EnumInteger: enum parse failure: " P.++ P.show s -- ** E'EnumNumber @@ -1449,10 +1449,10 @@ Module : OpenAPIPetstore.Model deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) instance A.ToJSON E'EnumNumber where toJSON = A.toJSON . fromE'EnumNumber -instance A.FromJSON E'EnumNumber where parseJSON o = P.either P.fail (pure . P.id) . toE'EnumNumber =<< A.parseJSON o -instance WH.ToHttpApiData E'EnumNumber where toQueryParam = WH.toQueryParam . fromE'EnumNumber -instance WH.FromHttpApiData E'EnumNumber where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'EnumNumber -instance MimeRender MimeMultipartFormData E'EnumNumber where mimeRender _ = mimeRenderDefaultMultipartFormData +instance A.FromJSON E'EnumNumber where parseJSON o = P.either P.fail (pure . P.id) . toE'EnumNumber =<< A.parseJSON o +instance WH.ToHttpApiData E'EnumNumber where toQueryParam = WH.toQueryParam . fromE'EnumNumber +instance WH.FromHttpApiData E'EnumNumber where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'EnumNumber +instance MimeRender MimeMultipartFormData E'EnumNumber where mimeRender _ = mimeRenderDefaultMultipartFormData -- | unwrap 'E'EnumNumber' enum fromE'EnumNumber :: E'EnumNumber -> Double @@ -1465,7 +1465,7 @@ Module : OpenAPIPetstore.Model toE'EnumNumber = \case 1.1 -> P.Right E'EnumNumber'Num1_Dot_1 -1.2 -> P.Right E'EnumNumber'NumMinus_1_Dot_2 - s -> P.Left $ "toE'EnumNumber: enum parse failure: " P.++ P.show s + s -> P.Left $ "toE'EnumNumber: enum parse failure: " P.++ P.show s -- ** E'EnumQueryInteger @@ -1477,10 +1477,10 @@ Module : OpenAPIPetstore.Model deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) instance A.ToJSON E'EnumQueryInteger where toJSON = A.toJSON . fromE'EnumQueryInteger -instance A.FromJSON E'EnumQueryInteger where parseJSON o = P.either P.fail (pure . P.id) . toE'EnumQueryInteger =<< A.parseJSON o -instance WH.ToHttpApiData E'EnumQueryInteger where toQueryParam = WH.toQueryParam . fromE'EnumQueryInteger -instance WH.FromHttpApiData E'EnumQueryInteger where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'EnumQueryInteger -instance MimeRender MimeMultipartFormData E'EnumQueryInteger where mimeRender _ = mimeRenderDefaultMultipartFormData +instance A.FromJSON E'EnumQueryInteger where parseJSON o = P.either P.fail (pure . P.id) . toE'EnumQueryInteger =<< A.parseJSON o +instance WH.ToHttpApiData E'EnumQueryInteger where toQueryParam = WH.toQueryParam . fromE'EnumQueryInteger +instance WH.FromHttpApiData E'EnumQueryInteger where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'EnumQueryInteger +instance MimeRender MimeMultipartFormData E'EnumQueryInteger where mimeRender _ = mimeRenderDefaultMultipartFormData -- | unwrap 'E'EnumQueryInteger' enum fromE'EnumQueryInteger :: E'EnumQueryInteger -> Int @@ -1493,7 +1493,7 @@ Module : OpenAPIPetstore.Model toE'EnumQueryInteger = \case 1 -> P.Right E'EnumQueryInteger'Num1 -2 -> P.Right E'EnumQueryInteger'NumMinus_2 - s -> P.Left $ "toE'EnumQueryInteger: enum parse failure: " P.++ P.show s + s -> P.Left $ "toE'EnumQueryInteger: enum parse failure: " P.++ P.show s -- ** E'EnumString @@ -1506,10 +1506,10 @@ Module : OpenAPIPetstore.Model deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) instance A.ToJSON E'EnumString where toJSON = A.toJSON . fromE'EnumString -instance A.FromJSON E'EnumString where parseJSON o = P.either P.fail (pure . P.id) . toE'EnumString =<< A.parseJSON o -instance WH.ToHttpApiData E'EnumString where toQueryParam = WH.toQueryParam . fromE'EnumString -instance WH.FromHttpApiData E'EnumString where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'EnumString -instance MimeRender MimeMultipartFormData E'EnumString where mimeRender _ = mimeRenderDefaultMultipartFormData +instance A.FromJSON E'EnumString where parseJSON o = P.either P.fail (pure . P.id) . toE'EnumString =<< A.parseJSON o +instance WH.ToHttpApiData E'EnumString where toQueryParam = WH.toQueryParam . fromE'EnumString +instance WH.FromHttpApiData E'EnumString where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'EnumString +instance MimeRender MimeMultipartFormData E'EnumString where mimeRender _ = mimeRenderDefaultMultipartFormData -- | unwrap 'E'EnumString' enum fromE'EnumString :: E'EnumString -> Text @@ -1524,7 +1524,7 @@ Module : OpenAPIPetstore.Model "UPPER" -> P.Right E'EnumString'UPPER "lower" -> P.Right E'EnumString'Lower "" -> P.Right E'EnumString'Empty - s -> P.Left $ "toE'EnumString: enum parse failure: " P.++ P.show s + s -> P.Left $ "toE'EnumString: enum parse failure: " P.++ P.show s -- ** E'Inner @@ -1536,10 +1536,10 @@ Module : OpenAPIPetstore.Model deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) instance A.ToJSON E'Inner where toJSON = A.toJSON . fromE'Inner -instance A.FromJSON E'Inner where parseJSON o = P.either P.fail (pure . P.id) . toE'Inner =<< A.parseJSON o -instance WH.ToHttpApiData E'Inner where toQueryParam = WH.toQueryParam . fromE'Inner -instance WH.FromHttpApiData E'Inner where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'Inner -instance MimeRender MimeMultipartFormData E'Inner where mimeRender _ = mimeRenderDefaultMultipartFormData +instance A.FromJSON E'Inner where parseJSON o = P.either P.fail (pure . P.id) . toE'Inner =<< A.parseJSON o +instance WH.ToHttpApiData E'Inner where toQueryParam = WH.toQueryParam . fromE'Inner +instance WH.FromHttpApiData E'Inner where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'Inner +instance MimeRender MimeMultipartFormData E'Inner where mimeRender _ = mimeRenderDefaultMultipartFormData -- | unwrap 'E'Inner' enum fromE'Inner :: E'Inner -> Text @@ -1552,7 +1552,7 @@ Module : OpenAPIPetstore.Model toE'Inner = \case "UPPER" -> P.Right E'Inner'UPPER "lower" -> P.Right E'Inner'Lower - s -> P.Left $ "toE'Inner: enum parse failure: " P.++ P.show s + s -> P.Left $ "toE'Inner: enum parse failure: " P.++ P.show s -- ** E'JustSymbol @@ -1564,10 +1564,10 @@ Module : OpenAPIPetstore.Model deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) instance A.ToJSON E'JustSymbol where toJSON = A.toJSON . fromE'JustSymbol -instance A.FromJSON E'JustSymbol where parseJSON o = P.either P.fail (pure . P.id) . toE'JustSymbol =<< A.parseJSON o -instance WH.ToHttpApiData E'JustSymbol where toQueryParam = WH.toQueryParam . fromE'JustSymbol -instance WH.FromHttpApiData E'JustSymbol where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'JustSymbol -instance MimeRender MimeMultipartFormData E'JustSymbol where mimeRender _ = mimeRenderDefaultMultipartFormData +instance A.FromJSON E'JustSymbol where parseJSON o = P.either P.fail (pure . P.id) . toE'JustSymbol =<< A.parseJSON o +instance WH.ToHttpApiData E'JustSymbol where toQueryParam = WH.toQueryParam . fromE'JustSymbol +instance WH.FromHttpApiData E'JustSymbol where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'JustSymbol +instance MimeRender MimeMultipartFormData E'JustSymbol where mimeRender _ = mimeRenderDefaultMultipartFormData -- | unwrap 'E'JustSymbol' enum fromE'JustSymbol :: E'JustSymbol -> Text @@ -1580,7 +1580,7 @@ Module : OpenAPIPetstore.Model toE'JustSymbol = \case ">=" -> P.Right E'JustSymbol'Greater_Than_Or_Equal_To "$" -> P.Right E'JustSymbol'Dollar - s -> P.Left $ "toE'JustSymbol: enum parse failure: " P.++ P.show s + s -> P.Left $ "toE'JustSymbol: enum parse failure: " P.++ P.show s -- ** E'Status @@ -1594,10 +1594,10 @@ Module : OpenAPIPetstore.Model deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) instance A.ToJSON E'Status where toJSON = A.toJSON . fromE'Status -instance A.FromJSON E'Status where parseJSON o = P.either P.fail (pure . P.id) . toE'Status =<< A.parseJSON o -instance WH.ToHttpApiData E'Status where toQueryParam = WH.toQueryParam . fromE'Status -instance WH.FromHttpApiData E'Status where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'Status -instance MimeRender MimeMultipartFormData E'Status where mimeRender _ = mimeRenderDefaultMultipartFormData +instance A.FromJSON E'Status where parseJSON o = P.either P.fail (pure . P.id) . toE'Status =<< A.parseJSON o +instance WH.ToHttpApiData E'Status where toQueryParam = WH.toQueryParam . fromE'Status +instance WH.FromHttpApiData E'Status where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'Status +instance MimeRender MimeMultipartFormData E'Status where mimeRender _ = mimeRenderDefaultMultipartFormData -- | unwrap 'E'Status' enum fromE'Status :: E'Status -> Text @@ -1612,7 +1612,7 @@ Module : OpenAPIPetstore.Model "placed" -> P.Right E'Status'Placed "approved" -> P.Right E'Status'Approved "delivered" -> P.Right E'Status'Delivered - s -> P.Left $ "toE'Status: enum parse failure: " P.++ P.show s + s -> P.Left $ "toE'Status: enum parse failure: " P.++ P.show s -- ** E'Status2 @@ -1626,10 +1626,10 @@ Module : OpenAPIPetstore.Model deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) instance A.ToJSON E'Status2 where toJSON = A.toJSON . fromE'Status2 -instance A.FromJSON E'Status2 where parseJSON o = P.either P.fail (pure . P.id) . toE'Status2 =<< A.parseJSON o -instance WH.ToHttpApiData E'Status2 where toQueryParam = WH.toQueryParam . fromE'Status2 -instance WH.FromHttpApiData E'Status2 where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'Status2 -instance MimeRender MimeMultipartFormData E'Status2 where mimeRender _ = mimeRenderDefaultMultipartFormData +instance A.FromJSON E'Status2 where parseJSON o = P.either P.fail (pure . P.id) . toE'Status2 =<< A.parseJSON o +instance WH.ToHttpApiData E'Status2 where toQueryParam = WH.toQueryParam . fromE'Status2 +instance WH.FromHttpApiData E'Status2 where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'Status2 +instance MimeRender MimeMultipartFormData E'Status2 where mimeRender _ = mimeRenderDefaultMultipartFormData -- | unwrap 'E'Status2' enum fromE'Status2 :: E'Status2 -> Text @@ -1644,7 +1644,7 @@ Module : OpenAPIPetstore.Model "available" -> P.Right E'Status2'Available "pending" -> P.Right E'Status2'Pending "sold" -> P.Right E'Status2'Sold - s -> P.Left $ "toE'Status2: enum parse failure: " P.++ P.show s + s -> P.Left $ "toE'Status2: enum parse failure: " P.++ P.show s -- ** EnumClass @@ -1657,10 +1657,10 @@ Module : OpenAPIPetstore.Model deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) instance A.ToJSON EnumClass where toJSON = A.toJSON . fromEnumClass -instance A.FromJSON EnumClass where parseJSON o = P.either P.fail (pure . P.id) . toEnumClass =<< A.parseJSON o -instance WH.ToHttpApiData EnumClass where toQueryParam = WH.toQueryParam . fromEnumClass -instance WH.FromHttpApiData EnumClass where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toEnumClass -instance MimeRender MimeMultipartFormData EnumClass where mimeRender _ = mimeRenderDefaultMultipartFormData +instance A.FromJSON EnumClass where parseJSON o = P.either P.fail (pure . P.id) . toEnumClass =<< A.parseJSON o +instance WH.ToHttpApiData EnumClass where toQueryParam = WH.toQueryParam . fromEnumClass +instance WH.FromHttpApiData EnumClass where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toEnumClass +instance MimeRender MimeMultipartFormData EnumClass where mimeRender _ = mimeRenderDefaultMultipartFormData -- | unwrap 'EnumClass' enum fromEnumClass :: EnumClass -> Text @@ -1675,7 +1675,7 @@ Module : OpenAPIPetstore.Model "_abc" -> P.Right EnumClass'_abc "-efg" -> P.Right EnumClass'_efg "(xyz)" -> P.Right EnumClass'_xyz - s -> P.Left $ "toEnumClass: enum parse failure: " P.++ P.show s + s -> P.Left $ "toEnumClass: enum parse failure: " P.++ P.show s -- ** OuterEnum @@ -1688,10 +1688,10 @@ Module : OpenAPIPetstore.Model deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum) instance A.ToJSON OuterEnum where toJSON = A.toJSON . fromOuterEnum -instance A.FromJSON OuterEnum where parseJSON o = P.either P.fail (pure . P.id) . toOuterEnum =<< A.parseJSON o -instance WH.ToHttpApiData OuterEnum where toQueryParam = WH.toQueryParam . fromOuterEnum -instance WH.FromHttpApiData OuterEnum where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toOuterEnum -instance MimeRender MimeMultipartFormData OuterEnum where mimeRender _ = mimeRenderDefaultMultipartFormData +instance A.FromJSON OuterEnum where parseJSON o = P.either P.fail (pure . P.id) . toOuterEnum =<< A.parseJSON o +instance WH.ToHttpApiData OuterEnum where toQueryParam = WH.toQueryParam . fromOuterEnum +instance WH.FromHttpApiData OuterEnum where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toOuterEnum +instance MimeRender MimeMultipartFormData OuterEnum where mimeRender _ = mimeRenderDefaultMultipartFormData -- | unwrap 'OuterEnum' enum fromOuterEnum :: OuterEnum -> Text @@ -1706,7 +1706,7 @@ Module : OpenAPIPetstore.Model "placed" -> P.Right OuterEnum'Placed "approved" -> P.Right OuterEnum'Approved "delivered" -> P.Right OuterEnum'Delivered - s -> P.Left $ "toOuterEnum: enum parse failure: " P.++ P.show s + s -> P.Left $ "toOuterEnum: enum parse failure: " P.++ P.show s -- * Auth Methods @@ -1717,12 +1717,12 @@ Module : OpenAPIPetstore.Model deriving (P.Eq, P.Show, P.Typeable) instance AuthMethod AuthApiKeyApiKey where - applyAuthMethod _ a@(AuthApiKeyApiKey secret) req = + applyAuthMethod _ a@(AuthApiKeyApiKey secret) req = P.pure $ - if (P.typeOf a `P.elem` rAuthTypes req) - then req `setHeader` toHeader ("api_key", secret) - & L.over rAuthTypesL (P.filter (/= P.typeOf a)) - else req + if (P.typeOf a `P.elem` rAuthTypes req) + then req `setHeader` toHeader ("api_key", secret) + & L.over rAuthTypesL (P.filter (/= P.typeOf a)) + else req -- ** AuthApiKeyApiKeyQuery data AuthApiKeyApiKeyQuery = @@ -1730,12 +1730,12 @@ Module : OpenAPIPetstore.Model deriving (P.Eq, P.Show, P.Typeable) instance AuthMethod AuthApiKeyApiKeyQuery where - applyAuthMethod _ a@(AuthApiKeyApiKeyQuery secret) req = + applyAuthMethod _ a@(AuthApiKeyApiKeyQuery secret) req = P.pure $ - if (P.typeOf a `P.elem` rAuthTypes req) - then req `setQuery` toQuery ("api_key_query", Just secret) - & L.over rAuthTypesL (P.filter (/= P.typeOf a)) - else req + if (P.typeOf a `P.elem` rAuthTypes req) + then req `setQuery` toQuery ("api_key_query", Just secret) + & L.over rAuthTypesL (P.filter (/= P.typeOf a)) + else req -- ** AuthBasicHttpBasicTest data AuthBasicHttpBasicTest = @@ -1743,13 +1743,13 @@ Module : OpenAPIPetstore.Model deriving (P.Eq, P.Show, P.Typeable) instance AuthMethod AuthBasicHttpBasicTest where - applyAuthMethod _ a@(AuthBasicHttpBasicTest user pw) req = + applyAuthMethod _ a@(AuthBasicHttpBasicTest user pw) req = P.pure $ - if (P.typeOf a `P.elem` rAuthTypes req) - then req `setHeader` toHeader ("Authorization", T.decodeUtf8 cred) - & L.over rAuthTypesL (P.filter (/= P.typeOf a)) - else req - where cred = BC.append "Basic " (B64.encode $ BC.concat [ user, ":", pw ]) + if (P.typeOf a `P.elem` rAuthTypes req) + then req `setHeader` toHeader ("Authorization", T.decodeUtf8 cred) + & L.over rAuthTypesL (P.filter (/= P.typeOf a)) + else req + where cred = BC.append "Basic " (B64.encode $ BC.concat [ user, ":", pw ]) -- ** AuthOAuthPetstoreAuth data AuthOAuthPetstoreAuth = @@ -1757,11 +1757,11 @@ Module : OpenAPIPetstore.Model deriving (P.Eq, P.Show, P.Typeable) instance AuthMethod AuthOAuthPetstoreAuth where - applyAuthMethod _ a@(AuthOAuthPetstoreAuth secret) req = + applyAuthMethod _ a@(AuthOAuthPetstoreAuth secret) req = P.pure $ - if (P.typeOf a `P.elem` rAuthTypes req) - then req `setHeader` toHeader ("Authorization", "Bearer " <> secret) - & L.over rAuthTypesL (P.filter (/= P.typeOf a)) - else req + if (P.typeOf a `P.elem` rAuthTypes req) + then req `setHeader` toHeader ("Authorization", "Bearer " <> secret) + & L.over rAuthTypesL (P.filter (/= P.typeOf a)) + else req \ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.ModelLens.html b/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.ModelLens.html index 9bc19b1aaf..20160586f3 100644 --- a/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.ModelLens.html +++ b/samples/client/petstore/haskell-http-client/docs/src/OpenAPIPetstore.ModelLens.html @@ -40,12 +40,12 @@ Module : OpenAPIPetstore.Lens -- | 'additionalPropertiesClassMapProperty' Lens additionalPropertiesClassMapPropertyL :: Lens_' AdditionalPropertiesClass (Maybe (Map.Map String Text)) -additionalPropertiesClassMapPropertyL f AdditionalPropertiesClass{..} = (\additionalPropertiesClassMapProperty -> AdditionalPropertiesClass { additionalPropertiesClassMapProperty, ..} ) <$> f additionalPropertiesClassMapProperty +additionalPropertiesClassMapPropertyL f AdditionalPropertiesClass{..} = (\additionalPropertiesClassMapProperty -> AdditionalPropertiesClass { additionalPropertiesClassMapProperty, ..} ) <$> f additionalPropertiesClassMapProperty {-# INLINE additionalPropertiesClassMapPropertyL #-} -- | 'additionalPropertiesClassMapOfMapProperty' Lens additionalPropertiesClassMapOfMapPropertyL :: Lens_' AdditionalPropertiesClass (Maybe (Map.Map String (Map.Map String Text))) -additionalPropertiesClassMapOfMapPropertyL f AdditionalPropertiesClass{..} = (\additionalPropertiesClassMapOfMapProperty -> AdditionalPropertiesClass { additionalPropertiesClassMapOfMapProperty, ..} ) <$> f additionalPropertiesClassMapOfMapProperty +additionalPropertiesClassMapOfMapPropertyL f AdditionalPropertiesClass{..} = (\additionalPropertiesClassMapOfMapProperty -> AdditionalPropertiesClass { additionalPropertiesClassMapOfMapProperty, ..} ) <$> f additionalPropertiesClassMapOfMapProperty {-# INLINE additionalPropertiesClassMapOfMapPropertyL #-} @@ -54,12 +54,12 @@ Module : OpenAPIPetstore.Lens -- | 'animalClassName' Lens animalClassNameL :: Lens_' Animal (Text) -animalClassNameL f Animal{..} = (\animalClassName -> Animal { animalClassName, ..} ) <$> f animalClassName +animalClassNameL f Animal{..} = (\animalClassName -> Animal { animalClassName, ..} ) <$> f animalClassName {-# INLINE animalClassNameL #-} -- | 'animalColor' Lens animalColorL :: Lens_' Animal (Maybe Text) -animalColorL f Animal{..} = (\animalColor -> Animal { animalColor, ..} ) <$> f animalColor +animalColorL f Animal{..} = (\animalColor -> Animal { animalColor, ..} ) <$> f animalColor {-# INLINE animalColorL #-} @@ -72,17 +72,17 @@ Module : OpenAPIPetstore.Lens -- | 'apiResponseCode' Lens apiResponseCodeL :: Lens_' ApiResponse (Maybe Int) -apiResponseCodeL f ApiResponse{..} = (\apiResponseCode -> ApiResponse { apiResponseCode, ..} ) <$> f apiResponseCode +apiResponseCodeL f ApiResponse{..} = (\apiResponseCode -> ApiResponse { apiResponseCode, ..} ) <$> f apiResponseCode {-# INLINE apiResponseCodeL #-} -- | 'apiResponseType' Lens apiResponseTypeL :: Lens_' ApiResponse (Maybe Text) -apiResponseTypeL f ApiResponse{..} = (\apiResponseType -> ApiResponse { apiResponseType, ..} ) <$> f apiResponseType +apiResponseTypeL f ApiResponse{..} = (\apiResponseType -> ApiResponse { apiResponseType, ..} ) <$> f apiResponseType {-# INLINE apiResponseTypeL #-} -- | 'apiResponseMessage' Lens apiResponseMessageL :: Lens_' ApiResponse (Maybe Text) -apiResponseMessageL f ApiResponse{..} = (\apiResponseMessage -> ApiResponse { apiResponseMessage, ..} ) <$> f apiResponseMessage +apiResponseMessageL f ApiResponse{..} = (\apiResponseMessage -> ApiResponse { apiResponseMessage, ..} ) <$> f apiResponseMessage {-# INLINE apiResponseMessageL #-} @@ -91,7 +91,7 @@ Module : OpenAPIPetstore.Lens -- | 'arrayOfArrayOfNumberOnlyArrayArrayNumber' Lens arrayOfArrayOfNumberOnlyArrayArrayNumberL :: Lens_' ArrayOfArrayOfNumberOnly (Maybe [[Double]]) -arrayOfArrayOfNumberOnlyArrayArrayNumberL f ArrayOfArrayOfNumberOnly{..} = (\arrayOfArrayOfNumberOnlyArrayArrayNumber -> ArrayOfArrayOfNumberOnly { arrayOfArrayOfNumberOnlyArrayArrayNumber, ..} ) <$> f arrayOfArrayOfNumberOnlyArrayArrayNumber +arrayOfArrayOfNumberOnlyArrayArrayNumberL f ArrayOfArrayOfNumberOnly{..} = (\arrayOfArrayOfNumberOnlyArrayArrayNumber -> ArrayOfArrayOfNumberOnly { arrayOfArrayOfNumberOnlyArrayArrayNumber, ..} ) <$> f arrayOfArrayOfNumberOnlyArrayArrayNumber {-# INLINE arrayOfArrayOfNumberOnlyArrayArrayNumberL #-} @@ -100,7 +100,7 @@ Module : OpenAPIPetstore.Lens -- | 'arrayOfNumberOnlyArrayNumber' Lens arrayOfNumberOnlyArrayNumberL :: Lens_' ArrayOfNumberOnly (Maybe [Double]) -arrayOfNumberOnlyArrayNumberL f ArrayOfNumberOnly{..} = (\arrayOfNumberOnlyArrayNumber -> ArrayOfNumberOnly { arrayOfNumberOnlyArrayNumber, ..} ) <$> f arrayOfNumberOnlyArrayNumber +arrayOfNumberOnlyArrayNumberL f ArrayOfNumberOnly{..} = (\arrayOfNumberOnlyArrayNumber -> ArrayOfNumberOnly { arrayOfNumberOnlyArrayNumber, ..} ) <$> f arrayOfNumberOnlyArrayNumber {-# INLINE arrayOfNumberOnlyArrayNumberL #-} @@ -109,17 +109,17 @@ Module : OpenAPIPetstore.Lens -- | 'arrayTestArrayOfString' Lens arrayTestArrayOfStringL :: Lens_' ArrayTest (Maybe [Text]) -arrayTestArrayOfStringL f ArrayTest{..} = (\arrayTestArrayOfString -> ArrayTest { arrayTestArrayOfString, ..} ) <$> f arrayTestArrayOfString +arrayTestArrayOfStringL f ArrayTest{..} = (\arrayTestArrayOfString -> ArrayTest { arrayTestArrayOfString, ..} ) <$> f arrayTestArrayOfString {-# INLINE arrayTestArrayOfStringL #-} -- | 'arrayTestArrayArrayOfInteger' Lens arrayTestArrayArrayOfIntegerL :: Lens_' ArrayTest (Maybe [[Integer]]) -arrayTestArrayArrayOfIntegerL f ArrayTest{..} = (\arrayTestArrayArrayOfInteger -> ArrayTest { arrayTestArrayArrayOfInteger, ..} ) <$> f arrayTestArrayArrayOfInteger +arrayTestArrayArrayOfIntegerL f ArrayTest{..} = (\arrayTestArrayArrayOfInteger -> ArrayTest { arrayTestArrayArrayOfInteger, ..} ) <$> f arrayTestArrayArrayOfInteger {-# INLINE arrayTestArrayArrayOfIntegerL #-} -- | 'arrayTestArrayArrayOfModel' Lens arrayTestArrayArrayOfModelL :: Lens_' ArrayTest (Maybe [[ReadOnlyFirst]]) -arrayTestArrayArrayOfModelL f ArrayTest{..} = (\arrayTestArrayArrayOfModel -> ArrayTest { arrayTestArrayArrayOfModel, ..} ) <$> f arrayTestArrayArrayOfModel +arrayTestArrayArrayOfModelL f ArrayTest{..} = (\arrayTestArrayArrayOfModel -> ArrayTest { arrayTestArrayArrayOfModel, ..} ) <$> f arrayTestArrayArrayOfModel {-# INLINE arrayTestArrayArrayOfModelL #-} @@ -128,32 +128,32 @@ Module : OpenAPIPetstore.Lens -- | 'capitalizationSmallCamel' Lens capitalizationSmallCamelL :: Lens_' Capitalization (Maybe Text) -capitalizationSmallCamelL f Capitalization{..} = (\capitalizationSmallCamel -> Capitalization { capitalizationSmallCamel, ..} ) <$> f capitalizationSmallCamel +capitalizationSmallCamelL f Capitalization{..} = (\capitalizationSmallCamel -> Capitalization { capitalizationSmallCamel, ..} ) <$> f capitalizationSmallCamel {-# INLINE capitalizationSmallCamelL #-} -- | 'capitalizationCapitalCamel' Lens capitalizationCapitalCamelL :: Lens_' Capitalization (Maybe Text) -capitalizationCapitalCamelL f Capitalization{..} = (\capitalizationCapitalCamel -> Capitalization { capitalizationCapitalCamel, ..} ) <$> f capitalizationCapitalCamel +capitalizationCapitalCamelL f Capitalization{..} = (\capitalizationCapitalCamel -> Capitalization { capitalizationCapitalCamel, ..} ) <$> f capitalizationCapitalCamel {-# INLINE capitalizationCapitalCamelL #-} -- | 'capitalizationSmallSnake' Lens capitalizationSmallSnakeL :: Lens_' Capitalization (Maybe Text) -capitalizationSmallSnakeL f Capitalization{..} = (\capitalizationSmallSnake -> Capitalization { capitalizationSmallSnake, ..} ) <$> f capitalizationSmallSnake +capitalizationSmallSnakeL f Capitalization{..} = (\capitalizationSmallSnake -> Capitalization { capitalizationSmallSnake, ..} ) <$> f capitalizationSmallSnake {-# INLINE capitalizationSmallSnakeL #-} -- | 'capitalizationCapitalSnake' Lens capitalizationCapitalSnakeL :: Lens_' Capitalization (Maybe Text) -capitalizationCapitalSnakeL f Capitalization{..} = (\capitalizationCapitalSnake -> Capitalization { capitalizationCapitalSnake, ..} ) <$> f capitalizationCapitalSnake +capitalizationCapitalSnakeL f Capitalization{..} = (\capitalizationCapitalSnake -> Capitalization { capitalizationCapitalSnake, ..} ) <$> f capitalizationCapitalSnake {-# INLINE capitalizationCapitalSnakeL #-} -- | 'capitalizationScaEthFlowPoints' Lens capitalizationScaEthFlowPointsL :: Lens_' Capitalization (Maybe Text) -capitalizationScaEthFlowPointsL f Capitalization{..} = (\capitalizationScaEthFlowPoints -> Capitalization { capitalizationScaEthFlowPoints, ..} ) <$> f capitalizationScaEthFlowPoints +capitalizationScaEthFlowPointsL f Capitalization{..} = (\capitalizationScaEthFlowPoints -> Capitalization { capitalizationScaEthFlowPoints, ..} ) <$> f capitalizationScaEthFlowPoints {-# INLINE capitalizationScaEthFlowPointsL #-} -- | 'capitalizationAttName' Lens capitalizationAttNameL :: Lens_' Capitalization (Maybe Text) -capitalizationAttNameL f Capitalization{..} = (\capitalizationAttName -> Capitalization { capitalizationAttName, ..} ) <$> f capitalizationAttName +capitalizationAttNameL f Capitalization{..} = (\capitalizationAttName -> Capitalization { capitalizationAttName, ..} ) <$> f capitalizationAttName {-# INLINE capitalizationAttNameL #-} @@ -162,17 +162,17 @@ Module : OpenAPIPetstore.Lens -- | 'catClassName' Lens catClassNameL :: Lens_' Cat (Text) -catClassNameL f Cat{..} = (\catClassName -> Cat { catClassName, ..} ) <$> f catClassName +catClassNameL f Cat{..} = (\catClassName -> Cat { catClassName, ..} ) <$> f catClassName {-# INLINE catClassNameL #-} -- | 'catColor' Lens catColorL :: Lens_' Cat (Maybe Text) -catColorL f Cat{..} = (\catColor -> Cat { catColor, ..} ) <$> f catColor +catColorL f Cat{..} = (\catColor -> Cat { catColor, ..} ) <$> f catColor {-# INLINE catColorL #-} -- | 'catDeclawed' Lens catDeclawedL :: Lens_' Cat (Maybe Bool) -catDeclawedL f Cat{..} = (\catDeclawed -> Cat { catDeclawed, ..} ) <$> f catDeclawed +catDeclawedL f Cat{..} = (\catDeclawed -> Cat { catDeclawed, ..} ) <$> f catDeclawed {-# INLINE catDeclawedL #-} @@ -181,12 +181,12 @@ Module : OpenAPIPetstore.Lens -- | 'categoryId' Lens categoryIdL :: Lens_' Category (Maybe Integer) -categoryIdL f Category{..} = (\categoryId -> Category { categoryId, ..} ) <$> f categoryId +categoryIdL f Category{..} = (\categoryId -> Category { categoryId, ..} ) <$> f categoryId {-# INLINE categoryIdL #-} -- | 'categoryName' Lens categoryNameL :: Lens_' Category (Maybe Text) -categoryNameL f Category{..} = (\categoryName -> Category { categoryName, ..} ) <$> f categoryName +categoryNameL f Category{..} = (\categoryName -> Category { categoryName, ..} ) <$> f categoryName {-# INLINE categoryNameL #-} @@ -195,7 +195,7 @@ Module : OpenAPIPetstore.Lens -- | 'classModelClass' Lens classModelClassL :: Lens_' ClassModel (Maybe Text) -classModelClassL f ClassModel{..} = (\classModelClass -> ClassModel { classModelClass, ..} ) <$> f classModelClass +classModelClassL f ClassModel{..} = (\classModelClass -> ClassModel { classModelClass, ..} ) <$> f classModelClass {-# INLINE classModelClassL #-} @@ -204,7 +204,7 @@ Module : OpenAPIPetstore.Lens -- | 'clientClient' Lens clientClientL :: Lens_' Client (Maybe Text) -clientClientL f Client{..} = (\clientClient -> Client { clientClient, ..} ) <$> f clientClient +clientClientL f Client{..} = (\clientClient -> Client { clientClient, ..} ) <$> f clientClient {-# INLINE clientClientL #-} @@ -213,17 +213,17 @@ Module : OpenAPIPetstore.Lens -- | 'dogClassName' Lens dogClassNameL :: Lens_' Dog (Text) -dogClassNameL f Dog{..} = (\dogClassName -> Dog { dogClassName, ..} ) <$> f dogClassName +dogClassNameL f Dog{..} = (\dogClassName -> Dog { dogClassName, ..} ) <$> f dogClassName {-# INLINE dogClassNameL #-} -- | 'dogColor' Lens dogColorL :: Lens_' Dog (Maybe Text) -dogColorL f Dog{..} = (\dogColor -> Dog { dogColor, ..} ) <$> f dogColor +dogColorL f Dog{..} = (\dogColor -> Dog { dogColor, ..} ) <$> f dogColor {-# INLINE dogColorL #-} -- | 'dogBreed' Lens dogBreedL :: Lens_' Dog (Maybe Text) -dogBreedL f Dog{..} = (\dogBreed -> Dog { dogBreed, ..} ) <$> f dogBreed +dogBreedL f Dog{..} = (\dogBreed -> Dog { dogBreed, ..} ) <$> f dogBreed {-# INLINE dogBreedL #-} @@ -232,12 +232,12 @@ Module : OpenAPIPetstore.Lens -- | 'enumArraysJustSymbol' Lens enumArraysJustSymbolL :: Lens_' EnumArrays (Maybe E'JustSymbol) -enumArraysJustSymbolL f EnumArrays{..} = (\enumArraysJustSymbol -> EnumArrays { enumArraysJustSymbol, ..} ) <$> f enumArraysJustSymbol +enumArraysJustSymbolL f EnumArrays{..} = (\enumArraysJustSymbol -> EnumArrays { enumArraysJustSymbol, ..} ) <$> f enumArraysJustSymbol {-# INLINE enumArraysJustSymbolL #-} -- | 'enumArraysArrayEnum' Lens enumArraysArrayEnumL :: Lens_' EnumArrays (Maybe [E'ArrayEnum]) -enumArraysArrayEnumL f EnumArrays{..} = (\enumArraysArrayEnum -> EnumArrays { enumArraysArrayEnum, ..} ) <$> f enumArraysArrayEnum +enumArraysArrayEnumL f EnumArrays{..} = (\enumArraysArrayEnum -> EnumArrays { enumArraysArrayEnum, ..} ) <$> f enumArraysArrayEnum {-# INLINE enumArraysArrayEnumL #-} @@ -250,27 +250,27 @@ Module : OpenAPIPetstore.Lens -- | 'enumTestEnumString' Lens enumTestEnumStringL :: Lens_' EnumTest (Maybe E'EnumString) -enumTestEnumStringL f EnumTest{..} = (\enumTestEnumString -> EnumTest { enumTestEnumString, ..} ) <$> f enumTestEnumString +enumTestEnumStringL f EnumTest{..} = (\enumTestEnumString -> EnumTest { enumTestEnumString, ..} ) <$> f enumTestEnumString {-# INLINE enumTestEnumStringL #-} -- | 'enumTestEnumStringRequired' Lens enumTestEnumStringRequiredL :: Lens_' EnumTest (E'EnumString) -enumTestEnumStringRequiredL f EnumTest{..} = (\enumTestEnumStringRequired -> EnumTest { enumTestEnumStringRequired, ..} ) <$> f enumTestEnumStringRequired +enumTestEnumStringRequiredL f EnumTest{..} = (\enumTestEnumStringRequired -> EnumTest { enumTestEnumStringRequired, ..} ) <$> f enumTestEnumStringRequired {-# INLINE enumTestEnumStringRequiredL #-} -- | 'enumTestEnumInteger' Lens enumTestEnumIntegerL :: Lens_' EnumTest (Maybe E'EnumInteger) -enumTestEnumIntegerL f EnumTest{..} = (\enumTestEnumInteger -> EnumTest { enumTestEnumInteger, ..} ) <$> f enumTestEnumInteger +enumTestEnumIntegerL f EnumTest{..} = (\enumTestEnumInteger -> EnumTest { enumTestEnumInteger, ..} ) <$> f enumTestEnumInteger {-# INLINE enumTestEnumIntegerL #-} -- | 'enumTestEnumNumber' Lens enumTestEnumNumberL :: Lens_' EnumTest (Maybe E'EnumNumber) -enumTestEnumNumberL f EnumTest{..} = (\enumTestEnumNumber -> EnumTest { enumTestEnumNumber, ..} ) <$> f enumTestEnumNumber +enumTestEnumNumberL f EnumTest{..} = (\enumTestEnumNumber -> EnumTest { enumTestEnumNumber, ..} ) <$> f enumTestEnumNumber {-# INLINE enumTestEnumNumberL #-} -- | 'enumTestOuterEnum' Lens enumTestOuterEnumL :: Lens_' EnumTest (Maybe OuterEnum) -enumTestOuterEnumL f EnumTest{..} = (\enumTestOuterEnum -> EnumTest { enumTestOuterEnum, ..} ) <$> f enumTestOuterEnum +enumTestOuterEnumL f EnumTest{..} = (\enumTestOuterEnum -> EnumTest { enumTestOuterEnum, ..} ) <$> f enumTestOuterEnum {-# INLINE enumTestOuterEnumL #-} @@ -279,67 +279,67 @@ Module : OpenAPIPetstore.Lens -- | 'formatTestInteger' Lens formatTestIntegerL :: Lens_' FormatTest (Maybe Int) -formatTestIntegerL f FormatTest{..} = (\formatTestInteger -> FormatTest { formatTestInteger, ..} ) <$> f formatTestInteger +formatTestIntegerL f FormatTest{..} = (\formatTestInteger -> FormatTest { formatTestInteger, ..} ) <$> f formatTestInteger {-# INLINE formatTestIntegerL #-} -- | 'formatTestInt32' Lens formatTestInt32L :: Lens_' FormatTest (Maybe Int) -formatTestInt32L f FormatTest{..} = (\formatTestInt32 -> FormatTest { formatTestInt32, ..} ) <$> f formatTestInt32 +formatTestInt32L f FormatTest{..} = (\formatTestInt32 -> FormatTest { formatTestInt32, ..} ) <$> f formatTestInt32 {-# INLINE formatTestInt32L #-} -- | 'formatTestInt64' Lens formatTestInt64L :: Lens_' FormatTest (Maybe Integer) -formatTestInt64L f FormatTest{..} = (\formatTestInt64 -> FormatTest { formatTestInt64, ..} ) <$> f formatTestInt64 +formatTestInt64L f FormatTest{..} = (\formatTestInt64 -> FormatTest { formatTestInt64, ..} ) <$> f formatTestInt64 {-# INLINE formatTestInt64L #-} -- | 'formatTestNumber' Lens formatTestNumberL :: Lens_' FormatTest (Double) -formatTestNumberL f FormatTest{..} = (\formatTestNumber -> FormatTest { formatTestNumber, ..} ) <$> f formatTestNumber +formatTestNumberL f FormatTest{..} = (\formatTestNumber -> FormatTest { formatTestNumber, ..} ) <$> f formatTestNumber {-# INLINE formatTestNumberL #-} -- | 'formatTestFloat' Lens formatTestFloatL :: Lens_' FormatTest (Maybe Float) -formatTestFloatL f FormatTest{..} = (\formatTestFloat -> FormatTest { formatTestFloat, ..} ) <$> f formatTestFloat +formatTestFloatL f FormatTest{..} = (\formatTestFloat -> FormatTest { formatTestFloat, ..} ) <$> f formatTestFloat {-# INLINE formatTestFloatL #-} -- | 'formatTestDouble' Lens formatTestDoubleL :: Lens_' FormatTest (Maybe Double) -formatTestDoubleL f FormatTest{..} = (\formatTestDouble -> FormatTest { formatTestDouble, ..} ) <$> f formatTestDouble +formatTestDoubleL f FormatTest{..} = (\formatTestDouble -> FormatTest { formatTestDouble, ..} ) <$> f formatTestDouble {-# INLINE formatTestDoubleL #-} -- | 'formatTestString' Lens formatTestStringL :: Lens_' FormatTest (Maybe Text) -formatTestStringL f FormatTest{..} = (\formatTestString -> FormatTest { formatTestString, ..} ) <$> f formatTestString +formatTestStringL f FormatTest{..} = (\formatTestString -> FormatTest { formatTestString, ..} ) <$> f formatTestString {-# INLINE formatTestStringL #-} -- | 'formatTestByte' Lens formatTestByteL :: Lens_' FormatTest (ByteArray) -formatTestByteL f FormatTest{..} = (\formatTestByte -> FormatTest { formatTestByte, ..} ) <$> f formatTestByte +formatTestByteL f FormatTest{..} = (\formatTestByte -> FormatTest { formatTestByte, ..} ) <$> f formatTestByte {-# INLINE formatTestByteL #-} -- | 'formatTestBinary' Lens formatTestBinaryL :: Lens_' FormatTest (Maybe FilePath) -formatTestBinaryL f FormatTest{..} = (\formatTestBinary -> FormatTest { formatTestBinary, ..} ) <$> f formatTestBinary +formatTestBinaryL f FormatTest{..} = (\formatTestBinary -> FormatTest { formatTestBinary, ..} ) <$> f formatTestBinary {-# INLINE formatTestBinaryL #-} -- | 'formatTestDate' Lens formatTestDateL :: Lens_' FormatTest (Date) -formatTestDateL f FormatTest{..} = (\formatTestDate -> FormatTest { formatTestDate, ..} ) <$> f formatTestDate +formatTestDateL f FormatTest{..} = (\formatTestDate -> FormatTest { formatTestDate, ..} ) <$> f formatTestDate {-# INLINE formatTestDateL #-} -- | 'formatTestDateTime' Lens formatTestDateTimeL :: Lens_' FormatTest (Maybe DateTime) -formatTestDateTimeL f FormatTest{..} = (\formatTestDateTime -> FormatTest { formatTestDateTime, ..} ) <$> f formatTestDateTime +formatTestDateTimeL f FormatTest{..} = (\formatTestDateTime -> FormatTest { formatTestDateTime, ..} ) <$> f formatTestDateTime {-# INLINE formatTestDateTimeL #-} -- | 'formatTestUuid' Lens formatTestUuidL :: Lens_' FormatTest (Maybe Text) -formatTestUuidL f FormatTest{..} = (\formatTestUuid -> FormatTest { formatTestUuid, ..} ) <$> f formatTestUuid +formatTestUuidL f FormatTest{..} = (\formatTestUuid -> FormatTest { formatTestUuid, ..} ) <$> f formatTestUuid {-# INLINE formatTestUuidL #-} -- | 'formatTestPassword' Lens formatTestPasswordL :: Lens_' FormatTest (Text) -formatTestPasswordL f FormatTest{..} = (\formatTestPassword -> FormatTest { formatTestPassword, ..} ) <$> f formatTestPassword +formatTestPasswordL f FormatTest{..} = (\formatTestPassword -> FormatTest { formatTestPassword, ..} ) <$> f formatTestPassword {-# INLINE formatTestPasswordL #-} @@ -348,12 +348,12 @@ Module : OpenAPIPetstore.Lens -- | 'hasOnlyReadOnlyBar' Lens hasOnlyReadOnlyBarL :: Lens_' HasOnlyReadOnly (Maybe Text) -hasOnlyReadOnlyBarL f HasOnlyReadOnly{..} = (\hasOnlyReadOnlyBar -> HasOnlyReadOnly { hasOnlyReadOnlyBar, ..} ) <$> f hasOnlyReadOnlyBar +hasOnlyReadOnlyBarL f HasOnlyReadOnly{..} = (\hasOnlyReadOnlyBar -> HasOnlyReadOnly { hasOnlyReadOnlyBar, ..} ) <$> f hasOnlyReadOnlyBar {-# INLINE hasOnlyReadOnlyBarL #-} -- | 'hasOnlyReadOnlyFoo' Lens hasOnlyReadOnlyFooL :: Lens_' HasOnlyReadOnly (Maybe Text) -hasOnlyReadOnlyFooL f HasOnlyReadOnly{..} = (\hasOnlyReadOnlyFoo -> HasOnlyReadOnly { hasOnlyReadOnlyFoo, ..} ) <$> f hasOnlyReadOnlyFoo +hasOnlyReadOnlyFooL f HasOnlyReadOnly{..} = (\hasOnlyReadOnlyFoo -> HasOnlyReadOnly { hasOnlyReadOnlyFoo, ..} ) <$> f hasOnlyReadOnlyFoo {-# INLINE hasOnlyReadOnlyFooL #-} @@ -362,12 +362,12 @@ Module : OpenAPIPetstore.Lens -- | 'mapTestMapMapOfString' Lens mapTestMapMapOfStringL :: Lens_' MapTest (Maybe (Map.Map String (Map.Map String Text))) -mapTestMapMapOfStringL f MapTest{..} = (\mapTestMapMapOfString -> MapTest { mapTestMapMapOfString, ..} ) <$> f mapTestMapMapOfString +mapTestMapMapOfStringL f MapTest{..} = (\mapTestMapMapOfString -> MapTest { mapTestMapMapOfString, ..} ) <$> f mapTestMapMapOfString {-# INLINE mapTestMapMapOfStringL #-} -- | 'mapTestMapOfEnumString' Lens mapTestMapOfEnumStringL :: Lens_' MapTest (Maybe (Map.Map String E'Inner)) -mapTestMapOfEnumStringL f MapTest{..} = (\mapTestMapOfEnumString -> MapTest { mapTestMapOfEnumString, ..} ) <$> f mapTestMapOfEnumString +mapTestMapOfEnumStringL f MapTest{..} = (\mapTestMapOfEnumString -> MapTest { mapTestMapOfEnumString, ..} ) <$> f mapTestMapOfEnumString {-# INLINE mapTestMapOfEnumStringL #-} @@ -376,17 +376,17 @@ Module : OpenAPIPetstore.Lens -- | 'mixedPropertiesAndAdditionalPropertiesClassUuid' Lens mixedPropertiesAndAdditionalPropertiesClassUuidL :: Lens_' MixedPropertiesAndAdditionalPropertiesClass (Maybe Text) -mixedPropertiesAndAdditionalPropertiesClassUuidL f MixedPropertiesAndAdditionalPropertiesClass{..} = (\mixedPropertiesAndAdditionalPropertiesClassUuid -> MixedPropertiesAndAdditionalPropertiesClass { mixedPropertiesAndAdditionalPropertiesClassUuid, ..} ) <$> f mixedPropertiesAndAdditionalPropertiesClassUuid +mixedPropertiesAndAdditionalPropertiesClassUuidL f MixedPropertiesAndAdditionalPropertiesClass{..} = (\mixedPropertiesAndAdditionalPropertiesClassUuid -> MixedPropertiesAndAdditionalPropertiesClass { mixedPropertiesAndAdditionalPropertiesClassUuid, ..} ) <$> f mixedPropertiesAndAdditionalPropertiesClassUuid {-# INLINE mixedPropertiesAndAdditionalPropertiesClassUuidL #-} -- | 'mixedPropertiesAndAdditionalPropertiesClassDateTime' Lens mixedPropertiesAndAdditionalPropertiesClassDateTimeL :: Lens_' MixedPropertiesAndAdditionalPropertiesClass (Maybe DateTime) -mixedPropertiesAndAdditionalPropertiesClassDateTimeL f MixedPropertiesAndAdditionalPropertiesClass{..} = (\mixedPropertiesAndAdditionalPropertiesClassDateTime -> MixedPropertiesAndAdditionalPropertiesClass { mixedPropertiesAndAdditionalPropertiesClassDateTime, ..} ) <$> f mixedPropertiesAndAdditionalPropertiesClassDateTime +mixedPropertiesAndAdditionalPropertiesClassDateTimeL f MixedPropertiesAndAdditionalPropertiesClass{..} = (\mixedPropertiesAndAdditionalPropertiesClassDateTime -> MixedPropertiesAndAdditionalPropertiesClass { mixedPropertiesAndAdditionalPropertiesClassDateTime, ..} ) <$> f mixedPropertiesAndAdditionalPropertiesClassDateTime {-# INLINE mixedPropertiesAndAdditionalPropertiesClassDateTimeL #-} -- | 'mixedPropertiesAndAdditionalPropertiesClassMap' Lens mixedPropertiesAndAdditionalPropertiesClassMapL :: Lens_' MixedPropertiesAndAdditionalPropertiesClass (Maybe (Map.Map String Animal)) -mixedPropertiesAndAdditionalPropertiesClassMapL f MixedPropertiesAndAdditionalPropertiesClass{..} = (\mixedPropertiesAndAdditionalPropertiesClassMap -> MixedPropertiesAndAdditionalPropertiesClass { mixedPropertiesAndAdditionalPropertiesClassMap, ..} ) <$> f mixedPropertiesAndAdditionalPropertiesClassMap +mixedPropertiesAndAdditionalPropertiesClassMapL f MixedPropertiesAndAdditionalPropertiesClass{..} = (\mixedPropertiesAndAdditionalPropertiesClassMap -> MixedPropertiesAndAdditionalPropertiesClass { mixedPropertiesAndAdditionalPropertiesClassMap, ..} ) <$> f mixedPropertiesAndAdditionalPropertiesClassMap {-# INLINE mixedPropertiesAndAdditionalPropertiesClassMapL #-} @@ -395,12 +395,12 @@ Module : OpenAPIPetstore.Lens -- | 'model200ResponseName' Lens model200ResponseNameL :: Lens_' Model200Response (Maybe Int) -model200ResponseNameL f Model200Response{..} = (\model200ResponseName -> Model200Response { model200ResponseName, ..} ) <$> f model200ResponseName +model200ResponseNameL f Model200Response{..} = (\model200ResponseName -> Model200Response { model200ResponseName, ..} ) <$> f model200ResponseName {-# INLINE model200ResponseNameL #-} -- | 'model200ResponseClass' Lens model200ResponseClassL :: Lens_' Model200Response (Maybe Text) -model200ResponseClassL f Model200Response{..} = (\model200ResponseClass -> Model200Response { model200ResponseClass, ..} ) <$> f model200ResponseClass +model200ResponseClassL f Model200Response{..} = (\model200ResponseClass -> Model200Response { model200ResponseClass, ..} ) <$> f model200ResponseClass {-# INLINE model200ResponseClassL #-} @@ -409,7 +409,7 @@ Module : OpenAPIPetstore.Lens -- | 'modelList123list' Lens modelList123listL :: Lens_' ModelList (Maybe Text) -modelList123listL f ModelList{..} = (\modelList123list -> ModelList { modelList123list, ..} ) <$> f modelList123list +modelList123listL f ModelList{..} = (\modelList123list -> ModelList { modelList123list, ..} ) <$> f modelList123list {-# INLINE modelList123listL #-} @@ -418,7 +418,7 @@ Module : OpenAPIPetstore.Lens -- | 'modelReturnReturn' Lens modelReturnReturnL :: Lens_' ModelReturn (Maybe Int) -modelReturnReturnL f ModelReturn{..} = (\modelReturnReturn -> ModelReturn { modelReturnReturn, ..} ) <$> f modelReturnReturn +modelReturnReturnL f ModelReturn{..} = (\modelReturnReturn -> ModelReturn { modelReturnReturn, ..} ) <$> f modelReturnReturn {-# INLINE modelReturnReturnL #-} @@ -427,22 +427,22 @@ Module : OpenAPIPetstore.Lens -- | 'nameName' Lens nameNameL :: Lens_' Name (Int) -nameNameL f Name{..} = (\nameName -> Name { nameName, ..} ) <$> f nameName +nameNameL f Name{..} = (\nameName -> Name { nameName, ..} ) <$> f nameName {-# INLINE nameNameL #-} -- | 'nameSnakeCase' Lens nameSnakeCaseL :: Lens_' Name (Maybe Int) -nameSnakeCaseL f Name{..} = (\nameSnakeCase -> Name { nameSnakeCase, ..} ) <$> f nameSnakeCase +nameSnakeCaseL f Name{..} = (\nameSnakeCase -> Name { nameSnakeCase, ..} ) <$> f nameSnakeCase {-# INLINE nameSnakeCaseL #-} -- | 'nameProperty' Lens namePropertyL :: Lens_' Name (Maybe Text) -namePropertyL f Name{..} = (\nameProperty -> Name { nameProperty, ..} ) <$> f nameProperty +namePropertyL f Name{..} = (\nameProperty -> Name { nameProperty, ..} ) <$> f nameProperty {-# INLINE namePropertyL #-} -- | 'name123number' Lens name123numberL :: Lens_' Name (Maybe Int) -name123numberL f Name{..} = (\name123number -> Name { name123number, ..} ) <$> f name123number +name123numberL f Name{..} = (\name123number -> Name { name123number, ..} ) <$> f name123number {-# INLINE name123numberL #-} @@ -451,7 +451,7 @@ Module : OpenAPIPetstore.Lens -- | 'numberOnlyJustNumber' Lens numberOnlyJustNumberL :: Lens_' NumberOnly (Maybe Double) -numberOnlyJustNumberL f NumberOnly{..} = (\numberOnlyJustNumber -> NumberOnly { numberOnlyJustNumber, ..} ) <$> f numberOnlyJustNumber +numberOnlyJustNumberL f NumberOnly{..} = (\numberOnlyJustNumber -> NumberOnly { numberOnlyJustNumber, ..} ) <$> f numberOnlyJustNumber {-# INLINE numberOnlyJustNumberL #-} @@ -460,32 +460,32 @@ Module : OpenAPIPetstore.Lens -- | 'orderId' Lens orderIdL :: Lens_' Order (Maybe Integer) -orderIdL f Order{..} = (\orderId -> Order { orderId, ..} ) <$> f orderId +orderIdL f Order{..} = (\orderId -> Order { orderId, ..} ) <$> f orderId {-# INLINE orderIdL #-} -- | 'orderPetId' Lens orderPetIdL :: Lens_' Order (Maybe Integer) -orderPetIdL f Order{..} = (\orderPetId -> Order { orderPetId, ..} ) <$> f orderPetId +orderPetIdL f Order{..} = (\orderPetId -> Order { orderPetId, ..} ) <$> f orderPetId {-# INLINE orderPetIdL #-} -- | 'orderQuantity' Lens orderQuantityL :: Lens_' Order (Maybe Int) -orderQuantityL f Order{..} = (\orderQuantity -> Order { orderQuantity, ..} ) <$> f orderQuantity +orderQuantityL f Order{..} = (\orderQuantity -> Order { orderQuantity, ..} ) <$> f orderQuantity {-# INLINE orderQuantityL #-} -- | 'orderShipDate' Lens orderShipDateL :: Lens_' Order (Maybe DateTime) -orderShipDateL f Order{..} = (\orderShipDate -> Order { orderShipDate, ..} ) <$> f orderShipDate +orderShipDateL f Order{..} = (\orderShipDate -> Order { orderShipDate, ..} ) <$> f orderShipDate {-# INLINE orderShipDateL #-} -- | 'orderStatus' Lens orderStatusL :: Lens_' Order (Maybe E'Status) -orderStatusL f Order{..} = (\orderStatus -> Order { orderStatus, ..} ) <$> f orderStatus +orderStatusL f Order{..} = (\orderStatus -> Order { orderStatus, ..} ) <$> f orderStatus {-# INLINE orderStatusL #-} -- | 'orderComplete' Lens orderCompleteL :: Lens_' Order (Maybe Bool) -orderCompleteL f Order{..} = (\orderComplete -> Order { orderComplete, ..} ) <$> f orderComplete +orderCompleteL f Order{..} = (\orderComplete -> Order { orderComplete, ..} ) <$> f orderComplete {-# INLINE orderCompleteL #-} @@ -494,17 +494,17 @@ Module : OpenAPIPetstore.Lens -- | 'outerCompositeMyNumber' Lens outerCompositeMyNumberL :: Lens_' OuterComposite (Maybe Double) -outerCompositeMyNumberL f OuterComposite{..} = (\outerCompositeMyNumber -> OuterComposite { outerCompositeMyNumber, ..} ) <$> f outerCompositeMyNumber +outerCompositeMyNumberL f OuterComposite{..} = (\outerCompositeMyNumber -> OuterComposite { outerCompositeMyNumber, ..} ) <$> f outerCompositeMyNumber {-# INLINE outerCompositeMyNumberL #-} -- | 'outerCompositeMyString' Lens outerCompositeMyStringL :: Lens_' OuterComposite (Maybe Text) -outerCompositeMyStringL f OuterComposite{..} = (\outerCompositeMyString -> OuterComposite { outerCompositeMyString, ..} ) <$> f outerCompositeMyString +outerCompositeMyStringL f OuterComposite{..} = (\outerCompositeMyString -> OuterComposite { outerCompositeMyString, ..} ) <$> f outerCompositeMyString {-# INLINE outerCompositeMyStringL #-} -- | 'outerCompositeMyBoolean' Lens outerCompositeMyBooleanL :: Lens_' OuterComposite (Maybe Bool) -outerCompositeMyBooleanL f OuterComposite{..} = (\outerCompositeMyBoolean -> OuterComposite { outerCompositeMyBoolean, ..} ) <$> f outerCompositeMyBoolean +outerCompositeMyBooleanL f OuterComposite{..} = (\outerCompositeMyBoolean -> OuterComposite { outerCompositeMyBoolean, ..} ) <$> f outerCompositeMyBoolean {-# INLINE outerCompositeMyBooleanL #-} @@ -517,32 +517,32 @@ Module : OpenAPIPetstore.Lens -- | 'petId' Lens petIdL :: Lens_' Pet (Maybe Integer) -petIdL f Pet{..} = (\petId -> Pet { petId, ..} ) <$> f petId +petIdL f Pet{..} = (\petId -> Pet { petId, ..} ) <$> f petId {-# INLINE petIdL #-} -- | 'petCategory' Lens petCategoryL :: Lens_' Pet (Maybe Category) -petCategoryL f Pet{..} = (\petCategory -> Pet { petCategory, ..} ) <$> f petCategory +petCategoryL f Pet{..} = (\petCategory -> Pet { petCategory, ..} ) <$> f petCategory {-# INLINE petCategoryL #-} -- | 'petName' Lens petNameL :: Lens_' Pet (Text) -petNameL f Pet{..} = (\petName -> Pet { petName, ..} ) <$> f petName +petNameL f Pet{..} = (\petName -> Pet { petName, ..} ) <$> f petName {-# INLINE petNameL #-} -- | 'petPhotoUrls' Lens petPhotoUrlsL :: Lens_' Pet ([Text]) -petPhotoUrlsL f Pet{..} = (\petPhotoUrls -> Pet { petPhotoUrls, ..} ) <$> f petPhotoUrls +petPhotoUrlsL f Pet{..} = (\petPhotoUrls -> Pet { petPhotoUrls, ..} ) <$> f petPhotoUrls {-# INLINE petPhotoUrlsL #-} -- | 'petTags' Lens petTagsL :: Lens_' Pet (Maybe [Tag]) -petTagsL f Pet{..} = (\petTags -> Pet { petTags, ..} ) <$> f petTags +petTagsL f Pet{..} = (\petTags -> Pet { petTags, ..} ) <$> f petTags {-# INLINE petTagsL #-} -- | 'petStatus' Lens petStatusL :: Lens_' Pet (Maybe E'Status2) -petStatusL f Pet{..} = (\petStatus -> Pet { petStatus, ..} ) <$> f petStatus +petStatusL f Pet{..} = (\petStatus -> Pet { petStatus, ..} ) <$> f petStatus {-# INLINE petStatusL #-} @@ -551,12 +551,12 @@ Module : OpenAPIPetstore.Lens -- | 'readOnlyFirstBar' Lens readOnlyFirstBarL :: Lens_' ReadOnlyFirst (Maybe Text) -readOnlyFirstBarL f ReadOnlyFirst{..} = (\readOnlyFirstBar -> ReadOnlyFirst { readOnlyFirstBar, ..} ) <$> f readOnlyFirstBar +readOnlyFirstBarL f ReadOnlyFirst{..} = (\readOnlyFirstBar -> ReadOnlyFirst { readOnlyFirstBar, ..} ) <$> f readOnlyFirstBar {-# INLINE readOnlyFirstBarL #-} -- | 'readOnlyFirstBaz' Lens readOnlyFirstBazL :: Lens_' ReadOnlyFirst (Maybe Text) -readOnlyFirstBazL f ReadOnlyFirst{..} = (\readOnlyFirstBaz -> ReadOnlyFirst { readOnlyFirstBaz, ..} ) <$> f readOnlyFirstBaz +readOnlyFirstBazL f ReadOnlyFirst{..} = (\readOnlyFirstBaz -> ReadOnlyFirst { readOnlyFirstBaz, ..} ) <$> f readOnlyFirstBaz {-# INLINE readOnlyFirstBazL #-} @@ -565,7 +565,7 @@ Module : OpenAPIPetstore.Lens -- | 'specialModelNameSpecialPropertyName' Lens specialModelNameSpecialPropertyNameL :: Lens_' SpecialModelName (Maybe Integer) -specialModelNameSpecialPropertyNameL f SpecialModelName{..} = (\specialModelNameSpecialPropertyName -> SpecialModelName { specialModelNameSpecialPropertyName, ..} ) <$> f specialModelNameSpecialPropertyName +specialModelNameSpecialPropertyNameL f SpecialModelName{..} = (\specialModelNameSpecialPropertyName -> SpecialModelName { specialModelNameSpecialPropertyName, ..} ) <$> f specialModelNameSpecialPropertyName {-# INLINE specialModelNameSpecialPropertyNameL #-} @@ -574,12 +574,12 @@ Module : OpenAPIPetstore.Lens -- | 'tagId' Lens tagIdL :: Lens_' Tag (Maybe Integer) -tagIdL f Tag{..} = (\tagId -> Tag { tagId, ..} ) <$> f tagId +tagIdL f Tag{..} = (\tagId -> Tag { tagId, ..} ) <$> f tagId {-# INLINE tagIdL #-} -- | 'tagName' Lens tagNameL :: Lens_' Tag (Maybe Text) -tagNameL f Tag{..} = (\tagName -> Tag { tagName, ..} ) <$> f tagName +tagNameL f Tag{..} = (\tagName -> Tag { tagName, ..} ) <$> f tagName {-# INLINE tagNameL #-} @@ -588,42 +588,42 @@ Module : OpenAPIPetstore.Lens -- | 'userId' Lens userIdL :: Lens_' User (Maybe Integer) -userIdL f User{..} = (\userId -> User { userId, ..} ) <$> f userId +userIdL f User{..} = (\userId -> User { userId, ..} ) <$> f userId {-# INLINE userIdL #-} -- | 'userUsername' Lens userUsernameL :: Lens_' User (Maybe Text) -userUsernameL f User{..} = (\userUsername -> User { userUsername, ..} ) <$> f userUsername +userUsernameL f User{..} = (\userUsername -> User { userUsername, ..} ) <$> f userUsername {-# INLINE userUsernameL #-} -- | 'userFirstName' Lens userFirstNameL :: Lens_' User (Maybe Text) -userFirstNameL f User{..} = (\userFirstName -> User { userFirstName, ..} ) <$> f userFirstName +userFirstNameL f User{..} = (\userFirstName -> User { userFirstName, ..} ) <$> f userFirstName {-# INLINE userFirstNameL #-} -- | 'userLastName' Lens userLastNameL :: Lens_' User (Maybe Text) -userLastNameL f User{..} = (\userLastName -> User { userLastName, ..} ) <$> f userLastName +userLastNameL f User{..} = (\userLastName -> User { userLastName, ..} ) <$> f userLastName {-# INLINE userLastNameL #-} -- | 'userEmail' Lens userEmailL :: Lens_' User (Maybe Text) -userEmailL f User{..} = (\userEmail -> User { userEmail, ..} ) <$> f userEmail +userEmailL f User{..} = (\userEmail -> User { userEmail, ..} ) <$> f userEmail {-# INLINE userEmailL #-} -- | 'userPassword' Lens userPasswordL :: Lens_' User (Maybe Text) -userPasswordL f User{..} = (\userPassword -> User { userPassword, ..} ) <$> f userPassword +userPasswordL f User{..} = (\userPassword -> User { userPassword, ..} ) <$> f userPassword {-# INLINE userPasswordL #-} -- | 'userPhone' Lens userPhoneL :: Lens_' User (Maybe Text) -userPhoneL f User{..} = (\userPhone -> User { userPhone, ..} ) <$> f userPhone +userPhoneL f User{..} = (\userPhone -> User { userPhone, ..} ) <$> f userPhone {-# INLINE userPhoneL #-} -- | 'userUserStatus' Lens userUserStatusL :: Lens_' User (Maybe Int) -userUserStatusL f User{..} = (\userUserStatus -> User { userUserStatus, ..} ) <$> f userUserStatus +userUserStatusL f User{..} = (\userUserStatus -> User { userUserStatus, ..} ) <$> f userUserStatus {-# INLINE userUserStatusL #-} diff --git a/samples/client/petstore/haskell-http-client/docs/src/Paths_openapi_petstore.html b/samples/client/petstore/haskell-http-client/docs/src/Paths_openapi_petstore.html index 17cefea63c..5b0749b1a3 100644 --- a/samples/client/petstore/haskell-http-client/docs/src/Paths_openapi_petstore.html +++ b/samples/client/petstore/haskell-http-client/docs/src/Paths_openapi_petstore.html @@ -15,7 +15,7 @@ #if defined(VERSION_base) #if MIN_VERSION_base(4,0,0) -catchIO :: IO a -> (Exception.IOException -> IO a) -> IO a +catchIO :: IO a -> (Exception.IOException -> IO a) -> IO a #else catchIO :: IO a -> (Exception.Exception -> IO a) -> IO a #endif @@ -29,12 +29,12 @@ version = Version [0,1,0,0] [] bindir, libdir, dynlibdir, datadir, libexecdir, sysconfdir :: FilePath -bindir = "/home/jon/fs/git/openapi-generator/samples/client/petstore/haskell-http-client/.stack-work/install/x86_64-linux-nopie/lts-10.0/8.2.2/bin" -libdir = "/home/jon/fs/git/openapi-generator/samples/client/petstore/haskell-http-client/.stack-work/install/x86_64-linux-nopie/lts-10.0/8.2.2/lib/x86_64-linux-ghc-8.2.2/openapi-petstore-0.1.0.0-A0Rhl1azutBfYPPfGAe7W" -dynlibdir = "/home/jon/fs/git/openapi-generator/samples/client/petstore/haskell-http-client/.stack-work/install/x86_64-linux-nopie/lts-10.0/8.2.2/lib/x86_64-linux-ghc-8.2.2" -datadir = "/home/jon/fs/git/openapi-generator/samples/client/petstore/haskell-http-client/.stack-work/install/x86_64-linux-nopie/lts-10.0/8.2.2/share/x86_64-linux-ghc-8.2.2/openapi-petstore-0.1.0.0" -libexecdir = "/home/jon/fs/git/openapi-generator/samples/client/petstore/haskell-http-client/.stack-work/install/x86_64-linux-nopie/lts-10.0/8.2.2/libexec/x86_64-linux-ghc-8.2.2/openapi-petstore-0.1.0.0" -sysconfdir = "/home/jon/fs/git/openapi-generator/samples/client/petstore/haskell-http-client/.stack-work/install/x86_64-linux-nopie/lts-10.0/8.2.2/etc" +bindir = "/home/jon/fs/git/openapi-generator/samples/client/petstore/haskell-http-client/.stack-work/install/x86_64-linux/lts-10.10/8.2.2/bin" +libdir = "/home/jon/fs/git/openapi-generator/samples/client/petstore/haskell-http-client/.stack-work/install/x86_64-linux/lts-10.10/8.2.2/lib/x86_64-linux-ghc-8.2.2/openapi-petstore-0.1.0.0-GpIW9J2kwBx2KOt0PUmodG" +dynlibdir = "/home/jon/fs/git/openapi-generator/samples/client/petstore/haskell-http-client/.stack-work/install/x86_64-linux/lts-10.10/8.2.2/lib/x86_64-linux-ghc-8.2.2" +datadir = "/home/jon/fs/git/openapi-generator/samples/client/petstore/haskell-http-client/.stack-work/install/x86_64-linux/lts-10.10/8.2.2/share/x86_64-linux-ghc-8.2.2/openapi-petstore-0.1.0.0" +libexecdir = "/home/jon/fs/git/openapi-generator/samples/client/petstore/haskell-http-client/.stack-work/install/x86_64-linux/lts-10.10/8.2.2/libexec/x86_64-linux-ghc-8.2.2/openapi-petstore-0.1.0.0" +sysconfdir = "/home/jon/fs/git/openapi-generator/samples/client/petstore/haskell-http-client/.stack-work/install/x86_64-linux/lts-10.10/8.2.2/etc" getBinDir, getLibDir, getDynLibDir, getDataDir, getLibexecDir, getSysconfDir :: IO FilePath getBinDir = catchIO (getEnv "openapi_petstore_bindir") (\_ -> return bindir) @@ -45,7 +45,7 @@ getSysconfDir = catchIO (getEnv "openapi_petstore_sysconfdir") (\_ -> return sysconfdir) getDataFileName :: FilePath -> IO FilePath -getDataFileName name = do - dir <- getDataDir - return (dir ++ "/" ++ name) +getDataFileName name = do + dir <- getDataDir + return (dir ++ "/" ++ name) \ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/example-app/openapi-petstore-app.cabal b/samples/client/petstore/haskell-http-client/example-app/openapi-petstore-app.cabal index 7994f26e16..f7e9b1ca15 100644 --- a/samples/client/petstore/haskell-http-client/example-app/openapi-petstore-app.cabal +++ b/samples/client/petstore/haskell-http-client/example-app/openapi-petstore-app.cabal @@ -1,8 +1,8 @@ --- This file has been generated from package.yaml by hpack version 0.20.0. +-- This file has been generated from package.yaml by hpack version 0.28.2. -- -- see: https://github.com/sol/hpack -- --- hash: b084e6b4f90a1c0ac580f2eb3d0957a261f1db4e7309ffe2c667bc081812d93f +-- hash: 56ae3aaeafb9097357340f607e1eaf6de362bdf849f038e8495e41eedc747747 name: openapi-petstore-app version: 0.1.0.0 @@ -16,7 +16,6 @@ copyright: YEAR - AUTHOR license: UnspecifiedLicense build-type: Simple cabal-version: >= 1.10 - extra-source-files: README.md diff --git a/samples/client/petstore/haskell-http-client/openapi-petstore.cabal b/samples/client/petstore/haskell-http-client/openapi-petstore.cabal index 565ac1c999..456867d651 100644 --- a/samples/client/petstore/haskell-http-client/openapi-petstore.cabal +++ b/samples/client/petstore/haskell-http-client/openapi-petstore.cabal @@ -46,7 +46,7 @@ library , iso8601-time >=0.1.3 && <0.2.0 , microlens >= 0.4.3 && <0.5 , mtl >=2.2.1 - , network >=2.6.2 && <2.7 + , network >=2.6.2 && <2.8 , random >=1.1 , safe-exceptions <0.2 , text >=0.11 && <1.3 diff --git a/samples/client/petstore/haskell-http-client/stack.yaml b/samples/client/petstore/haskell-http-client/stack.yaml index f27e13a320..f396d4a2a8 100644 --- a/samples/client/petstore/haskell-http-client/stack.yaml +++ b/samples/client/petstore/haskell-http-client/stack.yaml @@ -1,4 +1,4 @@ -resolver: lts-10.0 +resolver: lts-10.10 build: haddock-arguments: haddock-args: diff --git a/samples/client/petstore/haskell-http-client/tests-integration/openapi-petstore-tests-integration.cabal b/samples/client/petstore/haskell-http-client/tests-integration/openapi-petstore-tests-integration.cabal index c12d175564..3ec14c0be7 100644 --- a/samples/client/petstore/haskell-http-client/tests-integration/openapi-petstore-tests-integration.cabal +++ b/samples/client/petstore/haskell-http-client/tests-integration/openapi-petstore-tests-integration.cabal @@ -1,8 +1,8 @@ --- This file has been generated from package.yaml by hpack version 0.20.0. +-- This file has been generated from package.yaml by hpack version 0.28.2. -- -- see: https://github.com/sol/hpack -- --- hash: db4f232d47abc55dfcc4a39baf3fe99e321edd086340fa500bfeee68ec48e412 +-- hash: 57ad4f3a6a440d73d378f5bad716416c24560afac10b43279041e1c7c4eaf6ca name: openapi-petstore-tests-integration version: 0.1.0.0 @@ -16,7 +16,6 @@ copyright: YEAR - AUTHOR license: UnspecifiedLicense build-type: Simple cabal-version: >= 1.10 - extra-source-files: README.md