forked from loafle/openapi-generator-original
[haskell-http-client] resolve oas 2.0 regressions (#198)
* [haskell-http-client] fix codegen issues * ensure datatypeWithEnum is set on codegenParameter when is enum * [haskell-http-client] fix isAlias + arrayModelType missing "datatype" * [haskell-http-client] param.isListContainer is sometimes false for list types * [haskell-http-client] gen MimeNoContent instances automatically * [haskell-http-client] fix example-app and integration tests * [haskell-http-client] update docs
This commit is contained in:
committed by
William Cheng
parent
019b0dca1c
commit
db02cc2ac9
@@ -3,7 +3,7 @@
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
|
||||
OpenAPI spec version: 2.0
|
||||
OpenAPI Version: 3.0.1
|
||||
Swagger Petstore API version: 1.0.0
|
||||
Contact: apiteam@swagger.io
|
||||
Generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
|
||||
OpenAPI spec version: 2.0
|
||||
OpenAPI Version: 3.0.1
|
||||
Swagger Petstore API version: 1.0.0
|
||||
Contact: apiteam@swagger.io
|
||||
Generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
|
||||
OpenAPI spec version: 2.0
|
||||
OpenAPI Version: 3.0.1
|
||||
Swagger Petstore API version: 1.0.0
|
||||
Contact: apiteam@swagger.io
|
||||
Generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
@@ -68,15 +68,15 @@ import qualified Prelude as P
|
||||
--
|
||||
testSpecialTags
|
||||
:: (Consumes TestSpecialTags MimeJSON, MimeRender MimeJSON Client)
|
||||
=> Client -- ^ "body" - client model
|
||||
=> Client -- ^ "client" - client model
|
||||
-> SwaggerPetstoreRequest TestSpecialTags MimeJSON Client MimeJSON
|
||||
testSpecialTags body =
|
||||
testSpecialTags client =
|
||||
_mkRequest "PATCH" ["/another-fake/dummy"]
|
||||
`setBodyParam` body
|
||||
`setBodyParam` client
|
||||
|
||||
data TestSpecialTags
|
||||
|
||||
-- | /Body Param/ "body" - client model
|
||||
-- | /Body Param/ "Client" - client model
|
||||
instance HasBodyParam TestSpecialTags Client
|
||||
|
||||
-- | @application/json@
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
|
||||
OpenAPI spec version: 2.0
|
||||
OpenAPI Version: 3.0.1
|
||||
Swagger Petstore API version: 1.0.0
|
||||
Contact: apiteam@swagger.io
|
||||
Generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
@@ -74,8 +74,12 @@ fakeOuterBooleanSerialize _ _ =
|
||||
|
||||
data FakeOuterBooleanSerialize
|
||||
|
||||
-- | /Body Param/ "body" - Input boolean as post body
|
||||
instance HasBodyParam FakeOuterBooleanSerialize OuterBoolean
|
||||
-- | /Body Param/ "boolean_post_body" - Input boolean as post body
|
||||
instance HasBodyParam FakeOuterBooleanSerialize BooleanPostBody
|
||||
|
||||
-- | @*/*@
|
||||
instance MimeType mtype => Produces FakeOuterBooleanSerialize mtype
|
||||
|
||||
|
||||
-- *** fakeOuterCompositeSerialize
|
||||
|
||||
@@ -93,9 +97,13 @@ fakeOuterCompositeSerialize _ _ =
|
||||
|
||||
data FakeOuterCompositeSerialize
|
||||
|
||||
-- | /Body Param/ "body" - Input composite as post body
|
||||
-- | /Body Param/ "OuterComposite" - Input composite as post body
|
||||
instance HasBodyParam FakeOuterCompositeSerialize OuterComposite
|
||||
|
||||
-- | @*/*@
|
||||
instance MimeType mtype => Produces FakeOuterCompositeSerialize mtype
|
||||
|
||||
|
||||
-- *** fakeOuterNumberSerialize
|
||||
|
||||
-- | @POST \/fake\/outer\/number@
|
||||
@@ -113,7 +121,11 @@ fakeOuterNumberSerialize _ _ =
|
||||
data FakeOuterNumberSerialize
|
||||
|
||||
-- | /Body Param/ "body" - Input number as post body
|
||||
instance HasBodyParam FakeOuterNumberSerialize OuterNumber
|
||||
instance HasBodyParam FakeOuterNumberSerialize Body
|
||||
|
||||
-- | @*/*@
|
||||
instance MimeType mtype => Produces FakeOuterNumberSerialize mtype
|
||||
|
||||
|
||||
-- *** fakeOuterStringSerialize
|
||||
|
||||
@@ -132,7 +144,34 @@ fakeOuterStringSerialize _ _ =
|
||||
data FakeOuterStringSerialize
|
||||
|
||||
-- | /Body Param/ "body" - Input string as post body
|
||||
instance HasBodyParam FakeOuterStringSerialize OuterString
|
||||
instance HasBodyParam FakeOuterStringSerialize BodyText
|
||||
|
||||
-- | @*/*@
|
||||
instance MimeType mtype => Produces FakeOuterStringSerialize mtype
|
||||
|
||||
|
||||
-- *** testBodyWithQueryParams
|
||||
|
||||
-- | @PUT \/fake\/body-with-query-params@
|
||||
--
|
||||
testBodyWithQueryParams
|
||||
:: (Consumes TestBodyWithQueryParams MimeJSON, MimeRender MimeJSON User)
|
||||
=> User -- ^ "user"
|
||||
-> Query -- ^ "query"
|
||||
-> SwaggerPetstoreRequest TestBodyWithQueryParams MimeJSON NoContent MimeNoContent
|
||||
testBodyWithQueryParams user (Query query) =
|
||||
_mkRequest "PUT" ["/fake/body-with-query-params"]
|
||||
`setBodyParam` user
|
||||
`setQuery` toQuery ("query", Just query)
|
||||
|
||||
data TestBodyWithQueryParams
|
||||
instance HasBodyParam TestBodyWithQueryParams User
|
||||
|
||||
-- | @application/json@
|
||||
instance Consumes TestBodyWithQueryParams MimeJSON
|
||||
|
||||
instance Produces TestBodyWithQueryParams MimeNoContent
|
||||
|
||||
|
||||
-- *** testClientModel
|
||||
|
||||
@@ -144,15 +183,15 @@ instance HasBodyParam FakeOuterStringSerialize OuterString
|
||||
--
|
||||
testClientModel
|
||||
:: (Consumes TestClientModel MimeJSON, MimeRender MimeJSON Client)
|
||||
=> Client -- ^ "body" - client model
|
||||
=> Client -- ^ "client" - client model
|
||||
-> SwaggerPetstoreRequest TestClientModel MimeJSON Client MimeJSON
|
||||
testClientModel body =
|
||||
testClientModel client =
|
||||
_mkRequest "PATCH" ["/fake"]
|
||||
`setBodyParam` body
|
||||
`setBodyParam` client
|
||||
|
||||
data TestClientModel
|
||||
|
||||
-- | /Body Param/ "body" - client model
|
||||
-- | /Body Param/ "Client" - client model
|
||||
instance HasBodyParam TestClientModel Client
|
||||
|
||||
-- | @application/json@
|
||||
@@ -172,18 +211,14 @@ instance Produces TestClientModel MimeJSON
|
||||
--
|
||||
-- AuthMethod: 'AuthBasicHttpBasicTest'
|
||||
--
|
||||
-- Note: Has 'Produces' instances, but no response schema
|
||||
--
|
||||
testEndpointParameters
|
||||
:: (Consumes TestEndpointParameters contentType)
|
||||
=> ContentType contentType -- ^ request content-type ('MimeType')
|
||||
-> Accept accept -- ^ request accept ('MimeType')
|
||||
-> Number -- ^ "number" - None
|
||||
:: (Consumes TestEndpointParameters MimeFormUrlEncoded)
|
||||
=> Number -- ^ "number" - None
|
||||
-> ParamDouble -- ^ "double" - None
|
||||
-> PatternWithoutDelimiter -- ^ "patternWithoutDelimiter" - None
|
||||
-> Byte -- ^ "byte" - None
|
||||
-> SwaggerPetstoreRequest TestEndpointParameters contentType res accept
|
||||
testEndpointParameters _ _ (Number number) (ParamDouble double) (PatternWithoutDelimiter patternWithoutDelimiter) (Byte byte) =
|
||||
-> SwaggerPetstoreRequest TestEndpointParameters MimeFormUrlEncoded NoContent MimeNoContent
|
||||
testEndpointParameters (Number number) (ParamDouble double) (PatternWithoutDelimiter patternWithoutDelimiter) (Byte byte) =
|
||||
_mkRequest "POST" ["/fake"]
|
||||
`_hasAuthType` (P.Proxy :: P.Proxy AuthBasicHttpBasicTest)
|
||||
`addForm` toForm ("number", number)
|
||||
@@ -221,7 +256,7 @@ instance HasOptionalParam TestEndpointParameters ParamString where
|
||||
-- | /Optional Param/ "binary" - None
|
||||
instance HasOptionalParam TestEndpointParameters ParamBinary where
|
||||
applyOptionalParam req (ParamBinary xs) =
|
||||
req `addForm` toForm ("binary", xs)
|
||||
req `_addMultiFormPart` NH.partFileSource "binary" xs
|
||||
|
||||
-- | /Optional Param/ "date" - None
|
||||
instance HasOptionalParam TestEndpointParameters ParamDate where
|
||||
@@ -243,15 +278,10 @@ instance HasOptionalParam TestEndpointParameters Callback where
|
||||
applyOptionalParam req (Callback xs) =
|
||||
req `addForm` toForm ("callback", xs)
|
||||
|
||||
-- | @application/xml; charset=utf-8@
|
||||
instance Consumes TestEndpointParameters MimeXmlCharsetutf8
|
||||
-- | @application/json; charset=utf-8@
|
||||
instance Consumes TestEndpointParameters MimeJsonCharsetutf8
|
||||
-- | @application/x-www-form-urlencoded@
|
||||
instance Consumes TestEndpointParameters MimeFormUrlEncoded
|
||||
|
||||
-- | @application/xml; charset=utf-8@
|
||||
instance Produces TestEndpointParameters MimeXmlCharsetutf8
|
||||
-- | @application/json; charset=utf-8@
|
||||
instance Produces TestEndpointParameters MimeJsonCharsetutf8
|
||||
instance Produces TestEndpointParameters MimeNoContent
|
||||
|
||||
|
||||
-- *** testEnumParameters
|
||||
@@ -262,14 +292,10 @@ instance Produces TestEndpointParameters MimeJsonCharsetutf8
|
||||
--
|
||||
-- To test enum parameters
|
||||
--
|
||||
-- Note: Has 'Produces' instances, but no response schema
|
||||
--
|
||||
testEnumParameters
|
||||
:: (Consumes TestEnumParameters contentType)
|
||||
=> ContentType contentType -- ^ request content-type ('MimeType')
|
||||
-> Accept accept -- ^ request accept ('MimeType')
|
||||
-> SwaggerPetstoreRequest TestEnumParameters contentType res accept
|
||||
testEnumParameters _ _ =
|
||||
:: (Consumes TestEnumParameters MimeFormUrlEncoded)
|
||||
=> SwaggerPetstoreRequest TestEnumParameters MimeFormUrlEncoded NoContent MimeNoContent
|
||||
testEnumParameters =
|
||||
_mkRequest "GET" ["/fake"]
|
||||
|
||||
data TestEnumParameters
|
||||
@@ -312,13 +338,12 @@ instance HasOptionalParam TestEnumParameters EnumQueryInteger where
|
||||
-- | /Optional Param/ "enum_query_double" - Query parameter enum test (double)
|
||||
instance HasOptionalParam TestEnumParameters EnumQueryDouble where
|
||||
applyOptionalParam req (EnumQueryDouble xs) =
|
||||
req `addForm` toForm ("enum_query_double", xs)
|
||||
req `setQuery` toQuery ("enum_query_double", Just xs)
|
||||
|
||||
-- | @*/*@
|
||||
instance MimeType mtype => Consumes TestEnumParameters mtype
|
||||
-- | @application/x-www-form-urlencoded@
|
||||
instance Consumes TestEnumParameters MimeFormUrlEncoded
|
||||
|
||||
-- | @*/*@
|
||||
instance MimeType mtype => Produces TestEnumParameters mtype
|
||||
instance Produces TestEnumParameters MimeNoContent
|
||||
|
||||
|
||||
-- *** testInlineAdditionalProperties
|
||||
@@ -327,24 +352,24 @@ instance MimeType mtype => Produces TestEnumParameters mtype
|
||||
--
|
||||
-- test inline additionalProperties
|
||||
--
|
||||
--
|
||||
--
|
||||
testInlineAdditionalProperties
|
||||
:: (Consumes TestInlineAdditionalProperties MimeJSON, MimeRender MimeJSON A.Value)
|
||||
=> A.Value -- ^ "param" - request body
|
||||
:: (Consumes TestInlineAdditionalProperties MimeJSON, MimeRender MimeJSON RequestBody)
|
||||
=> RequestBody -- ^ "requestBody" - request body
|
||||
-> SwaggerPetstoreRequest TestInlineAdditionalProperties MimeJSON NoContent MimeNoContent
|
||||
testInlineAdditionalProperties param =
|
||||
testInlineAdditionalProperties requestBody =
|
||||
_mkRequest "POST" ["/fake/inline-additionalProperties"]
|
||||
`setBodyParam` param
|
||||
`setBodyParam` requestBody
|
||||
|
||||
data TestInlineAdditionalProperties
|
||||
|
||||
-- | /Body Param/ "param" - request body
|
||||
instance HasBodyParam TestInlineAdditionalProperties A.Value
|
||||
-- | /Body Param/ "request_body" - request body
|
||||
instance HasBodyParam TestInlineAdditionalProperties RequestBody
|
||||
|
||||
-- | @application/json@
|
||||
instance Consumes TestInlineAdditionalProperties MimeJSON
|
||||
|
||||
instance Produces TestInlineAdditionalProperties MimeNoContent
|
||||
|
||||
|
||||
-- *** testJsonFormData
|
||||
|
||||
@@ -352,13 +377,11 @@ instance Consumes TestInlineAdditionalProperties MimeJSON
|
||||
--
|
||||
-- test json serialization of form data
|
||||
--
|
||||
--
|
||||
--
|
||||
testJsonFormData
|
||||
:: (Consumes TestJsonFormData MimeJSON)
|
||||
:: (Consumes TestJsonFormData MimeFormUrlEncoded)
|
||||
=> Param -- ^ "param" - field1
|
||||
-> Param2 -- ^ "param2" - field2
|
||||
-> SwaggerPetstoreRequest TestJsonFormData MimeJSON NoContent MimeNoContent
|
||||
-> SwaggerPetstoreRequest TestJsonFormData MimeFormUrlEncoded NoContent MimeNoContent
|
||||
testJsonFormData (Param param) (Param2 param2) =
|
||||
_mkRequest "GET" ["/fake/jsonFormData"]
|
||||
`addForm` toForm ("param", param)
|
||||
@@ -366,6 +389,8 @@ testJsonFormData (Param param) (Param2 param2) =
|
||||
|
||||
data TestJsonFormData
|
||||
|
||||
-- | @application/json@
|
||||
instance Consumes TestJsonFormData MimeJSON
|
||||
-- | @application/x-www-form-urlencoded@
|
||||
instance Consumes TestJsonFormData MimeFormUrlEncoded
|
||||
|
||||
instance Produces TestJsonFormData MimeNoContent
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
|
||||
OpenAPI spec version: 2.0
|
||||
OpenAPI Version: 3.0.1
|
||||
Swagger Petstore API version: 1.0.0
|
||||
Contact: apiteam@swagger.io
|
||||
Generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
@@ -64,20 +64,22 @@ import qualified Prelude as P
|
||||
--
|
||||
-- To test class name in snake case
|
||||
--
|
||||
-- To test class name in snake case
|
||||
--
|
||||
-- AuthMethod: 'AuthApiKeyApiKeyQuery'
|
||||
--
|
||||
testClassname
|
||||
:: (Consumes TestClassname MimeJSON, MimeRender MimeJSON Client)
|
||||
=> Client -- ^ "body" - client model
|
||||
=> Client -- ^ "client" - client model
|
||||
-> SwaggerPetstoreRequest TestClassname MimeJSON Client MimeJSON
|
||||
testClassname body =
|
||||
testClassname client =
|
||||
_mkRequest "PATCH" ["/fake_classname_test"]
|
||||
`_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyApiKeyQuery)
|
||||
`setBodyParam` body
|
||||
`setBodyParam` client
|
||||
|
||||
data TestClassname
|
||||
|
||||
-- | /Body Param/ "body" - client model
|
||||
-- | /Body Param/ "Client" - client model
|
||||
instance HasBodyParam TestClassname Client
|
||||
|
||||
-- | @application/json@
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
|
||||
OpenAPI spec version: 2.0
|
||||
OpenAPI Version: 3.0.1
|
||||
Swagger Petstore API version: 1.0.0
|
||||
Contact: apiteam@swagger.io
|
||||
Generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
@@ -64,26 +64,21 @@ import qualified Prelude as P
|
||||
--
|
||||
-- Add a new pet to the store
|
||||
--
|
||||
--
|
||||
--
|
||||
-- AuthMethod: 'AuthOAuthPetstoreAuth'
|
||||
--
|
||||
-- Note: Has 'Produces' instances, but no response schema
|
||||
--
|
||||
addPet
|
||||
:: (Consumes AddPet contentType, MimeRender contentType Pet)
|
||||
=> ContentType contentType -- ^ request content-type ('MimeType')
|
||||
-> Accept accept -- ^ request accept ('MimeType')
|
||||
-> Pet -- ^ "body" - Pet object that needs to be added to the store
|
||||
-> SwaggerPetstoreRequest AddPet contentType res accept
|
||||
addPet _ _ body =
|
||||
-> Pet -- ^ "pet" - Pet object that needs to be added to the store
|
||||
-> SwaggerPetstoreRequest AddPet contentType NoContent MimeNoContent
|
||||
addPet _ pet =
|
||||
_mkRequest "POST" ["/pet"]
|
||||
`_hasAuthType` (P.Proxy :: P.Proxy AuthOAuthPetstoreAuth)
|
||||
`setBodyParam` body
|
||||
`setBodyParam` pet
|
||||
|
||||
data AddPet
|
||||
|
||||
-- | /Body Param/ "body" - Pet object that needs to be added to the store
|
||||
-- | /Body Param/ "Pet" - Pet object that needs to be added to the store
|
||||
instance HasBodyParam AddPet Pet
|
||||
|
||||
-- | @application/json@
|
||||
@@ -91,10 +86,7 @@ instance Consumes AddPet MimeJSON
|
||||
-- | @application/xml@
|
||||
instance Consumes AddPet MimeXML
|
||||
|
||||
-- | @application/xml@
|
||||
instance Produces AddPet MimeXML
|
||||
-- | @application/json@
|
||||
instance Produces AddPet MimeJSON
|
||||
instance Produces AddPet MimeNoContent
|
||||
|
||||
|
||||
-- *** deletePet
|
||||
@@ -103,17 +95,12 @@ instance Produces AddPet MimeJSON
|
||||
--
|
||||
-- Deletes a pet
|
||||
--
|
||||
--
|
||||
--
|
||||
-- AuthMethod: 'AuthOAuthPetstoreAuth'
|
||||
--
|
||||
-- Note: Has 'Produces' instances, but no response schema
|
||||
--
|
||||
deletePet
|
||||
:: Accept accept -- ^ request accept ('MimeType')
|
||||
-> PetId -- ^ "petId" - Pet id to delete
|
||||
-> SwaggerPetstoreRequest DeletePet MimeNoContent res accept
|
||||
deletePet _ (PetId petId) =
|
||||
:: PetId -- ^ "petId" - Pet id to delete
|
||||
-> SwaggerPetstoreRequest DeletePet MimeNoContent NoContent MimeNoContent
|
||||
deletePet (PetId petId) =
|
||||
_mkRequest "DELETE" ["/pet/",toPath petId]
|
||||
`_hasAuthType` (P.Proxy :: P.Proxy AuthOAuthPetstoreAuth)
|
||||
|
||||
@@ -121,10 +108,8 @@ data DeletePet
|
||||
instance HasOptionalParam DeletePet ApiKey where
|
||||
applyOptionalParam req (ApiKey xs) =
|
||||
req `setHeader` toHeader ("api_key", xs)
|
||||
-- | @application/xml@
|
||||
instance Produces DeletePet MimeXML
|
||||
-- | @application/json@
|
||||
instance Produces DeletePet MimeJSON
|
||||
|
||||
instance Produces DeletePet MimeNoContent
|
||||
|
||||
|
||||
-- *** findPetsByStatus
|
||||
@@ -147,6 +132,7 @@ findPetsByStatus _ (Status status) =
|
||||
`setQuery` toQueryColl CommaSeparated ("status", Just status)
|
||||
|
||||
data FindPetsByStatus
|
||||
|
||||
-- | @application/xml@
|
||||
instance Produces FindPetsByStatus MimeXML
|
||||
-- | @application/json@
|
||||
@@ -175,6 +161,7 @@ findPetsByTags _ (Tags tags) =
|
||||
{-# DEPRECATED findPetsByTags "" #-}
|
||||
|
||||
data FindPetsByTags
|
||||
|
||||
-- | @application/xml@
|
||||
instance Produces FindPetsByTags MimeXML
|
||||
-- | @application/json@
|
||||
@@ -200,6 +187,7 @@ getPetById _ (PetId petId) =
|
||||
`_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyApiKey)
|
||||
|
||||
data GetPetById
|
||||
|
||||
-- | @application/xml@
|
||||
instance Produces GetPetById MimeXML
|
||||
-- | @application/json@
|
||||
@@ -212,26 +200,21 @@ instance Produces GetPetById MimeJSON
|
||||
--
|
||||
-- Update an existing pet
|
||||
--
|
||||
--
|
||||
--
|
||||
-- AuthMethod: 'AuthOAuthPetstoreAuth'
|
||||
--
|
||||
-- Note: Has 'Produces' instances, but no response schema
|
||||
--
|
||||
updatePet
|
||||
:: (Consumes UpdatePet contentType, MimeRender contentType Pet)
|
||||
=> ContentType contentType -- ^ request content-type ('MimeType')
|
||||
-> Accept accept -- ^ request accept ('MimeType')
|
||||
-> Pet -- ^ "body" - Pet object that needs to be added to the store
|
||||
-> SwaggerPetstoreRequest UpdatePet contentType res accept
|
||||
updatePet _ _ body =
|
||||
-> Pet -- ^ "pet" - Pet object that needs to be added to the store
|
||||
-> SwaggerPetstoreRequest UpdatePet contentType NoContent MimeNoContent
|
||||
updatePet _ pet =
|
||||
_mkRequest "PUT" ["/pet"]
|
||||
`_hasAuthType` (P.Proxy :: P.Proxy AuthOAuthPetstoreAuth)
|
||||
`setBodyParam` body
|
||||
`setBodyParam` pet
|
||||
|
||||
data UpdatePet
|
||||
|
||||
-- | /Body Param/ "body" - Pet object that needs to be added to the store
|
||||
-- | /Body Param/ "Pet" - Pet object that needs to be added to the store
|
||||
instance HasBodyParam UpdatePet Pet
|
||||
|
||||
-- | @application/json@
|
||||
@@ -239,10 +222,7 @@ instance Consumes UpdatePet MimeJSON
|
||||
-- | @application/xml@
|
||||
instance Consumes UpdatePet MimeXML
|
||||
|
||||
-- | @application/xml@
|
||||
instance Produces UpdatePet MimeXML
|
||||
-- | @application/json@
|
||||
instance Produces UpdatePet MimeJSON
|
||||
instance Produces UpdatePet MimeNoContent
|
||||
|
||||
|
||||
-- *** updatePetWithForm
|
||||
@@ -251,18 +231,13 @@ instance Produces UpdatePet MimeJSON
|
||||
--
|
||||
-- Updates a pet in the store with form data
|
||||
--
|
||||
--
|
||||
--
|
||||
-- AuthMethod: 'AuthOAuthPetstoreAuth'
|
||||
--
|
||||
-- Note: Has 'Produces' instances, but no response schema
|
||||
--
|
||||
updatePetWithForm
|
||||
:: (Consumes UpdatePetWithForm MimeFormUrlEncoded)
|
||||
=> Accept accept -- ^ request accept ('MimeType')
|
||||
-> PetId -- ^ "petId" - ID of pet that needs to be updated
|
||||
-> SwaggerPetstoreRequest UpdatePetWithForm MimeFormUrlEncoded res accept
|
||||
updatePetWithForm _ (PetId petId) =
|
||||
=> PetId -- ^ "petId" - ID of pet that needs to be updated
|
||||
-> SwaggerPetstoreRequest UpdatePetWithForm MimeFormUrlEncoded NoContent MimeNoContent
|
||||
updatePetWithForm (PetId petId) =
|
||||
_mkRequest "POST" ["/pet/",toPath petId]
|
||||
`_hasAuthType` (P.Proxy :: P.Proxy AuthOAuthPetstoreAuth)
|
||||
|
||||
@@ -281,10 +256,7 @@ instance HasOptionalParam UpdatePetWithForm StatusText where
|
||||
-- | @application/x-www-form-urlencoded@
|
||||
instance Consumes UpdatePetWithForm MimeFormUrlEncoded
|
||||
|
||||
-- | @application/xml@
|
||||
instance Produces UpdatePetWithForm MimeXML
|
||||
-- | @application/json@
|
||||
instance Produces UpdatePetWithForm MimeJSON
|
||||
instance Produces UpdatePetWithForm MimeNoContent
|
||||
|
||||
|
||||
-- *** uploadFile
|
||||
@@ -293,8 +265,6 @@ instance Produces UpdatePetWithForm MimeJSON
|
||||
--
|
||||
-- uploads an image
|
||||
--
|
||||
--
|
||||
--
|
||||
-- AuthMethod: 'AuthOAuthPetstoreAuth'
|
||||
--
|
||||
uploadFile
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
|
||||
OpenAPI spec version: 2.0
|
||||
OpenAPI Version: 3.0.1
|
||||
Swagger Petstore API version: 1.0.0
|
||||
Contact: apiteam@swagger.io
|
||||
Generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
@@ -66,20 +66,15 @@ import qualified Prelude as P
|
||||
--
|
||||
-- For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||
--
|
||||
-- Note: Has 'Produces' instances, but no response schema
|
||||
--
|
||||
deleteOrder
|
||||
:: Accept accept -- ^ request accept ('MimeType')
|
||||
-> OrderIdText -- ^ "orderId" - ID of the order that needs to be deleted
|
||||
-> SwaggerPetstoreRequest DeleteOrder MimeNoContent res accept
|
||||
deleteOrder _ (OrderIdText orderId) =
|
||||
:: OrderIdText -- ^ "orderId" - ID of the order that needs to be deleted
|
||||
-> SwaggerPetstoreRequest DeleteOrder MimeNoContent NoContent MimeNoContent
|
||||
deleteOrder (OrderIdText orderId) =
|
||||
_mkRequest "DELETE" ["/store/order/",toPath orderId]
|
||||
|
||||
data DeleteOrder
|
||||
-- | @application/xml@
|
||||
instance Produces DeleteOrder MimeXML
|
||||
-- | @application/json@
|
||||
instance Produces DeleteOrder MimeJSON
|
||||
|
||||
instance Produces DeleteOrder MimeNoContent
|
||||
|
||||
|
||||
-- *** getInventory
|
||||
@@ -99,6 +94,7 @@ getInventory =
|
||||
`_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyApiKey)
|
||||
|
||||
data GetInventory
|
||||
|
||||
-- | @application/json@
|
||||
instance Produces GetInventory MimeJSON
|
||||
|
||||
@@ -119,6 +115,7 @@ getOrderById _ (OrderId orderId) =
|
||||
_mkRequest "GET" ["/store/order/",toPath orderId]
|
||||
|
||||
data GetOrderById
|
||||
|
||||
-- | @application/xml@
|
||||
instance Produces GetOrderById MimeXML
|
||||
-- | @application/json@
|
||||
@@ -131,22 +128,21 @@ instance Produces GetOrderById MimeJSON
|
||||
--
|
||||
-- Place an order for a pet
|
||||
--
|
||||
--
|
||||
--
|
||||
placeOrder
|
||||
:: (Consumes PlaceOrder contentType, MimeRender contentType Order)
|
||||
=> ContentType contentType -- ^ request content-type ('MimeType')
|
||||
-> Accept accept -- ^ request accept ('MimeType')
|
||||
-> Order -- ^ "body" - order placed for purchasing the pet
|
||||
-> Order -- ^ "order" - order placed for purchasing the pet
|
||||
-> SwaggerPetstoreRequest PlaceOrder contentType Order accept
|
||||
placeOrder _ _ body =
|
||||
placeOrder _ _ order =
|
||||
_mkRequest "POST" ["/store/order"]
|
||||
`setBodyParam` body
|
||||
`setBodyParam` order
|
||||
|
||||
data PlaceOrder
|
||||
|
||||
-- | /Body Param/ "body" - order placed for purchasing the pet
|
||||
-- | /Body Param/ "Order" - order placed for purchasing the pet
|
||||
instance HasBodyParam PlaceOrder Order
|
||||
|
||||
-- | @application/xml@
|
||||
instance Produces PlaceOrder MimeXML
|
||||
-- | @application/json@
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
|
||||
OpenAPI spec version: 2.0
|
||||
OpenAPI Version: 3.0.1
|
||||
Swagger Petstore API version: 1.0.0
|
||||
Contact: apiteam@swagger.io
|
||||
Generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
@@ -66,26 +66,21 @@ import qualified Prelude as P
|
||||
--
|
||||
-- This can only be done by the logged in user.
|
||||
--
|
||||
-- Note: Has 'Produces' instances, but no response schema
|
||||
--
|
||||
createUser
|
||||
:: (Consumes CreateUser contentType, MimeRender contentType User)
|
||||
=> ContentType contentType -- ^ request content-type ('MimeType')
|
||||
-> Accept accept -- ^ request accept ('MimeType')
|
||||
-> User -- ^ "body" - Created user object
|
||||
-> SwaggerPetstoreRequest CreateUser contentType res accept
|
||||
createUser _ _ body =
|
||||
-> User -- ^ "user" - Created user object
|
||||
-> SwaggerPetstoreRequest CreateUser contentType NoContent MimeNoContent
|
||||
createUser _ user =
|
||||
_mkRequest "POST" ["/user"]
|
||||
`setBodyParam` body
|
||||
`setBodyParam` user
|
||||
|
||||
data CreateUser
|
||||
|
||||
-- | /Body Param/ "body" - Created user object
|
||||
-- | /Body Param/ "User" - Created user object
|
||||
instance HasBodyParam CreateUser User
|
||||
-- | @application/xml@
|
||||
instance Produces CreateUser MimeXML
|
||||
-- | @application/json@
|
||||
instance Produces CreateUser MimeJSON
|
||||
|
||||
instance Produces CreateUser MimeNoContent
|
||||
|
||||
|
||||
-- *** createUsersWithArrayInput
|
||||
@@ -94,28 +89,21 @@ instance Produces CreateUser MimeJSON
|
||||
--
|
||||
-- Creates list of users with given input array
|
||||
--
|
||||
--
|
||||
--
|
||||
-- Note: Has 'Produces' instances, but no response schema
|
||||
--
|
||||
createUsersWithArrayInput
|
||||
:: (Consumes CreateUsersWithArrayInput contentType, MimeRender contentType Body)
|
||||
:: (Consumes CreateUsersWithArrayInput contentType, MimeRender contentType User2)
|
||||
=> ContentType contentType -- ^ request content-type ('MimeType')
|
||||
-> Accept accept -- ^ request accept ('MimeType')
|
||||
-> Body -- ^ "body" - List of user object
|
||||
-> SwaggerPetstoreRequest CreateUsersWithArrayInput contentType res accept
|
||||
createUsersWithArrayInput _ _ body =
|
||||
-> User2 -- ^ "user" - List of user object
|
||||
-> SwaggerPetstoreRequest CreateUsersWithArrayInput contentType NoContent MimeNoContent
|
||||
createUsersWithArrayInput _ user =
|
||||
_mkRequest "POST" ["/user/createWithArray"]
|
||||
`setBodyParam` body
|
||||
`setBodyParam` user
|
||||
|
||||
data CreateUsersWithArrayInput
|
||||
|
||||
-- | /Body Param/ "body" - List of user object
|
||||
instance HasBodyParam CreateUsersWithArrayInput Body
|
||||
-- | @application/xml@
|
||||
instance Produces CreateUsersWithArrayInput MimeXML
|
||||
-- | @application/json@
|
||||
instance Produces CreateUsersWithArrayInput MimeJSON
|
||||
-- | /Body Param/ "User" - List of user object
|
||||
instance HasBodyParam CreateUsersWithArrayInput User2
|
||||
|
||||
instance Produces CreateUsersWithArrayInput MimeNoContent
|
||||
|
||||
|
||||
-- *** createUsersWithListInput
|
||||
@@ -124,28 +112,21 @@ instance Produces CreateUsersWithArrayInput MimeJSON
|
||||
--
|
||||
-- Creates list of users with given input array
|
||||
--
|
||||
--
|
||||
--
|
||||
-- Note: Has 'Produces' instances, but no response schema
|
||||
--
|
||||
createUsersWithListInput
|
||||
:: (Consumes CreateUsersWithListInput contentType, MimeRender contentType Body)
|
||||
:: (Consumes CreateUsersWithListInput contentType, MimeRender contentType User2)
|
||||
=> ContentType contentType -- ^ request content-type ('MimeType')
|
||||
-> Accept accept -- ^ request accept ('MimeType')
|
||||
-> Body -- ^ "body" - List of user object
|
||||
-> SwaggerPetstoreRequest CreateUsersWithListInput contentType res accept
|
||||
createUsersWithListInput _ _ body =
|
||||
-> User2 -- ^ "user" - List of user object
|
||||
-> SwaggerPetstoreRequest CreateUsersWithListInput contentType NoContent MimeNoContent
|
||||
createUsersWithListInput _ user =
|
||||
_mkRequest "POST" ["/user/createWithList"]
|
||||
`setBodyParam` body
|
||||
`setBodyParam` user
|
||||
|
||||
data CreateUsersWithListInput
|
||||
|
||||
-- | /Body Param/ "body" - List of user object
|
||||
instance HasBodyParam CreateUsersWithListInput Body
|
||||
-- | @application/xml@
|
||||
instance Produces CreateUsersWithListInput MimeXML
|
||||
-- | @application/json@
|
||||
instance Produces CreateUsersWithListInput MimeJSON
|
||||
-- | /Body Param/ "User" - List of user object
|
||||
instance HasBodyParam CreateUsersWithListInput User2
|
||||
|
||||
instance Produces CreateUsersWithListInput MimeNoContent
|
||||
|
||||
|
||||
-- *** deleteUser
|
||||
@@ -156,20 +137,15 @@ instance Produces CreateUsersWithListInput MimeJSON
|
||||
--
|
||||
-- This can only be done by the logged in user.
|
||||
--
|
||||
-- Note: Has 'Produces' instances, but no response schema
|
||||
--
|
||||
deleteUser
|
||||
:: Accept accept -- ^ request accept ('MimeType')
|
||||
-> Username -- ^ "username" - The name that needs to be deleted
|
||||
-> SwaggerPetstoreRequest DeleteUser MimeNoContent res accept
|
||||
deleteUser _ (Username username) =
|
||||
:: Username -- ^ "username" - The name that needs to be deleted
|
||||
-> SwaggerPetstoreRequest DeleteUser MimeNoContent NoContent MimeNoContent
|
||||
deleteUser (Username username) =
|
||||
_mkRequest "DELETE" ["/user/",toPath username]
|
||||
|
||||
data DeleteUser
|
||||
-- | @application/xml@
|
||||
instance Produces DeleteUser MimeXML
|
||||
-- | @application/json@
|
||||
instance Produces DeleteUser MimeJSON
|
||||
|
||||
instance Produces DeleteUser MimeNoContent
|
||||
|
||||
|
||||
-- *** getUserByName
|
||||
@@ -178,16 +154,15 @@ instance Produces DeleteUser MimeJSON
|
||||
--
|
||||
-- Get user by user name
|
||||
--
|
||||
--
|
||||
--
|
||||
getUserByName
|
||||
:: Accept accept -- ^ request accept ('MimeType')
|
||||
-> Username -- ^ "username" - The name that needs to be fetched. Use user1 for testing.
|
||||
-> Username -- ^ "username" - The name that needs to be fetched. Use user1 for testing.
|
||||
-> SwaggerPetstoreRequest GetUserByName MimeNoContent User accept
|
||||
getUserByName _ (Username username) =
|
||||
_mkRequest "GET" ["/user/",toPath username]
|
||||
|
||||
data GetUserByName
|
||||
|
||||
-- | @application/xml@
|
||||
instance Produces GetUserByName MimeXML
|
||||
-- | @application/json@
|
||||
@@ -200,8 +175,6 @@ instance Produces GetUserByName MimeJSON
|
||||
--
|
||||
-- Logs user into the system
|
||||
--
|
||||
--
|
||||
--
|
||||
loginUser
|
||||
:: Accept accept -- ^ request accept ('MimeType')
|
||||
-> Username -- ^ "username" - The user name for login
|
||||
@@ -213,6 +186,7 @@ loginUser _ (Username username) (Password password) =
|
||||
`setQuery` toQuery ("password", Just password)
|
||||
|
||||
data LoginUser
|
||||
|
||||
-- | @application/xml@
|
||||
instance Produces LoginUser MimeXML
|
||||
-- | @application/json@
|
||||
@@ -225,21 +199,14 @@ instance Produces LoginUser MimeJSON
|
||||
--
|
||||
-- Logs out current logged in user session
|
||||
--
|
||||
--
|
||||
--
|
||||
-- Note: Has 'Produces' instances, but no response schema
|
||||
--
|
||||
logoutUser
|
||||
:: Accept accept -- ^ request accept ('MimeType')
|
||||
-> SwaggerPetstoreRequest LogoutUser MimeNoContent res accept
|
||||
logoutUser _ =
|
||||
:: SwaggerPetstoreRequest LogoutUser MimeNoContent NoContent MimeNoContent
|
||||
logoutUser =
|
||||
_mkRequest "GET" ["/user/logout"]
|
||||
|
||||
data LogoutUser
|
||||
-- | @application/xml@
|
||||
instance Produces LogoutUser MimeXML
|
||||
-- | @application/json@
|
||||
instance Produces LogoutUser MimeJSON
|
||||
|
||||
instance Produces LogoutUser MimeNoContent
|
||||
|
||||
|
||||
-- *** updateUser
|
||||
@@ -250,25 +217,20 @@ instance Produces LogoutUser MimeJSON
|
||||
--
|
||||
-- This can only be done by the logged in user.
|
||||
--
|
||||
-- Note: Has 'Produces' instances, but no response schema
|
||||
--
|
||||
updateUser
|
||||
:: (Consumes UpdateUser contentType, MimeRender contentType User)
|
||||
=> ContentType contentType -- ^ request content-type ('MimeType')
|
||||
-> Accept accept -- ^ request accept ('MimeType')
|
||||
-> User -- ^ "user" - Updated user object
|
||||
-> Username -- ^ "username" - name that need to be deleted
|
||||
-> User -- ^ "body" - Updated user object
|
||||
-> SwaggerPetstoreRequest UpdateUser contentType res accept
|
||||
updateUser _ _ (Username username) body =
|
||||
-> SwaggerPetstoreRequest UpdateUser contentType NoContent MimeNoContent
|
||||
updateUser _ user (Username username) =
|
||||
_mkRequest "PUT" ["/user/",toPath username]
|
||||
`setBodyParam` body
|
||||
`setBodyParam` user
|
||||
|
||||
data UpdateUser
|
||||
|
||||
-- | /Body Param/ "body" - Updated user object
|
||||
-- | /Body Param/ "User" - Updated user object
|
||||
instance HasBodyParam UpdateUser User
|
||||
-- | @application/xml@
|
||||
instance Produces UpdateUser MimeXML
|
||||
-- | @application/json@
|
||||
instance Produces UpdateUser MimeJSON
|
||||
|
||||
instance Produces UpdateUser MimeNoContent
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
|
||||
OpenAPI spec version: 2.0
|
||||
OpenAPI Version: 3.0.1
|
||||
Swagger Petstore API version: 1.0.0
|
||||
Contact: apiteam@swagger.io
|
||||
Generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
|
||||
OpenAPI spec version: 2.0
|
||||
OpenAPI Version: 3.0.1
|
||||
Swagger Petstore API version: 1.0.0
|
||||
Contact: apiteam@swagger.io
|
||||
Generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
|
||||
OpenAPI spec version: 2.0
|
||||
OpenAPI Version: 3.0.1
|
||||
Swagger Petstore API version: 1.0.0
|
||||
Contact: apiteam@swagger.io
|
||||
Generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
|
||||
OpenAPI spec version: 2.0
|
||||
OpenAPI Version: 3.0.1
|
||||
Swagger Petstore API version: 1.0.0
|
||||
Contact: apiteam@swagger.io
|
||||
Generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
@@ -202,27 +202,3 @@ instance MimeUnrender MimeOctetStream String where mimeUnrender _ = P.Right . BC
|
||||
instance MimeUnrender MimeNoContent NoContent where mimeUnrender _ = P.Right . P.const NoContent
|
||||
|
||||
|
||||
-- * Custom Mime Types
|
||||
|
||||
-- ** MimeJsonCharsetutf8
|
||||
|
||||
data MimeJsonCharsetutf8 = MimeJsonCharsetutf8 deriving (P.Typeable)
|
||||
|
||||
-- | @application/json; charset=utf-8@
|
||||
instance MimeType MimeJsonCharsetutf8 where
|
||||
mimeType _ = Just $ P.fromString "application/json; charset=utf-8"
|
||||
instance A.ToJSON a => MimeRender MimeJsonCharsetutf8 a where mimeRender _ = A.encode
|
||||
instance A.FromJSON a => MimeUnrender MimeJsonCharsetutf8 a where mimeUnrender _ = A.eitherDecode
|
||||
-- instance MimeRender MimeJsonCharsetutf8 T.Text where mimeRender _ = undefined
|
||||
-- instance MimeUnrender MimeJsonCharsetutf8 T.Text where mimeUnrender _ = undefined
|
||||
|
||||
-- ** MimeXmlCharsetutf8
|
||||
|
||||
data MimeXmlCharsetutf8 = MimeXmlCharsetutf8 deriving (P.Typeable)
|
||||
|
||||
-- | @application/xml; charset=utf-8@
|
||||
instance MimeType MimeXmlCharsetutf8 where
|
||||
mimeType _ = Just $ P.fromString "application/xml; charset=utf-8"
|
||||
-- instance MimeRender MimeXmlCharsetutf8 T.Text where mimeRender _ = undefined
|
||||
-- instance MimeUnrender MimeXmlCharsetutf8 T.Text where mimeUnrender _ = undefined
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
|
||||
OpenAPI spec version: 2.0
|
||||
OpenAPI Version: 3.0.1
|
||||
Swagger Petstore API version: 1.0.0
|
||||
Contact: apiteam@swagger.io
|
||||
Generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
@@ -74,7 +74,13 @@ newtype AdditionalMetadata = AdditionalMetadata { unAdditionalMetadata :: Text }
|
||||
newtype ApiKey = ApiKey { unApiKey :: Text } deriving (P.Eq, P.Show)
|
||||
|
||||
-- ** Body
|
||||
newtype Body = Body { unBody :: [User] } deriving (P.Eq, P.Show, A.ToJSON)
|
||||
newtype Body = Body { unBody :: Double } deriving (P.Eq, P.Show, A.ToJSON)
|
||||
|
||||
-- ** BodyText
|
||||
newtype BodyText = BodyText { unBodyText :: Text } deriving (P.Eq, P.Show, A.ToJSON)
|
||||
|
||||
-- ** BooleanPostBody
|
||||
newtype BooleanPostBody = BooleanPostBody { unBooleanPostBody :: Bool } deriving (P.Eq, P.Show, A.ToJSON)
|
||||
|
||||
-- ** Byte
|
||||
newtype Byte = Byte { unByte :: ByteArray } deriving (P.Eq, P.Show)
|
||||
@@ -86,13 +92,13 @@ newtype Callback = Callback { unCallback :: Text } deriving (P.Eq, P.Show)
|
||||
newtype EnumFormString = EnumFormString { unEnumFormString :: E'EnumFormString } deriving (P.Eq, P.Show)
|
||||
|
||||
-- ** EnumFormStringArray
|
||||
newtype EnumFormStringArray = EnumFormStringArray { unEnumFormStringArray :: [E'Inner2] } deriving (P.Eq, P.Show)
|
||||
newtype EnumFormStringArray = EnumFormStringArray { unEnumFormStringArray :: [E'EnumFormStringArray] } deriving (P.Eq, P.Show)
|
||||
|
||||
-- ** EnumHeaderString
|
||||
newtype EnumHeaderString = EnumHeaderString { unEnumHeaderString :: E'EnumFormString } deriving (P.Eq, P.Show)
|
||||
|
||||
-- ** EnumHeaderStringArray
|
||||
newtype EnumHeaderStringArray = EnumHeaderStringArray { unEnumHeaderStringArray :: [E'Inner2] } deriving (P.Eq, P.Show)
|
||||
newtype EnumHeaderStringArray = EnumHeaderStringArray { unEnumHeaderStringArray :: [E'EnumFormStringArray] } deriving (P.Eq, P.Show)
|
||||
|
||||
-- ** EnumQueryDouble
|
||||
newtype EnumQueryDouble = EnumQueryDouble { unEnumQueryDouble :: E'EnumNumber } deriving (P.Eq, P.Show)
|
||||
@@ -104,7 +110,7 @@ newtype EnumQueryInteger = EnumQueryInteger { unEnumQueryInteger :: E'EnumQueryI
|
||||
newtype EnumQueryString = EnumQueryString { unEnumQueryString :: E'EnumFormString } deriving (P.Eq, P.Show)
|
||||
|
||||
-- ** EnumQueryStringArray
|
||||
newtype EnumQueryStringArray = EnumQueryStringArray { unEnumQueryStringArray :: [E'Inner2] } deriving (P.Eq, P.Show)
|
||||
newtype EnumQueryStringArray = EnumQueryStringArray { unEnumQueryStringArray :: [E'EnumFormStringArray] } deriving (P.Eq, P.Show)
|
||||
|
||||
-- ** File
|
||||
newtype File = File { unFile :: FilePath } deriving (P.Eq, P.Show)
|
||||
@@ -134,7 +140,7 @@ newtype Param = Param { unParam :: Text } deriving (P.Eq, P.Show)
|
||||
newtype Param2 = Param2 { unParam2 :: Text } deriving (P.Eq, P.Show)
|
||||
|
||||
-- ** ParamBinary
|
||||
newtype ParamBinary = ParamBinary { unParamBinary :: Binary } deriving (P.Eq, P.Show)
|
||||
newtype ParamBinary = ParamBinary { unParamBinary :: FilePath } deriving (P.Eq, P.Show)
|
||||
|
||||
-- ** ParamDate
|
||||
newtype ParamDate = ParamDate { unParamDate :: Date } deriving (P.Eq, P.Show)
|
||||
@@ -163,6 +169,12 @@ newtype PatternWithoutDelimiter = PatternWithoutDelimiter { unPatternWithoutDeli
|
||||
-- ** PetId
|
||||
newtype PetId = PetId { unPetId :: Integer } deriving (P.Eq, P.Show)
|
||||
|
||||
-- ** Query
|
||||
newtype Query = Query { unQuery :: Text } deriving (P.Eq, P.Show)
|
||||
|
||||
-- ** RequestBody
|
||||
newtype RequestBody = RequestBody { unRequestBody :: Text } deriving (P.Eq, P.Show, A.ToJSON)
|
||||
|
||||
-- ** Status
|
||||
newtype Status = Status { unStatus :: [E'Status2] } deriving (P.Eq, P.Show)
|
||||
|
||||
@@ -172,6 +184,9 @@ newtype StatusText = StatusText { unStatusText :: Text } deriving (P.Eq, P.Show)
|
||||
-- ** Tags
|
||||
newtype Tags = Tags { unTags :: [Text] } deriving (P.Eq, P.Show)
|
||||
|
||||
-- ** User2
|
||||
newtype User2 = User2 { unUser2 :: [User] } deriving (P.Eq, P.Show, A.ToJSON)
|
||||
|
||||
-- ** Username
|
||||
newtype Username = Username { unUsername :: Text } deriving (P.Eq, P.Show)
|
||||
|
||||
@@ -245,31 +260,10 @@ mkAnimal animalClassName =
|
||||
|
||||
-- ** AnimalFarm
|
||||
-- | AnimalFarm
|
||||
data AnimalFarm = AnimalFarm
|
||||
{
|
||||
} deriving (P.Show, P.Eq, P.Typeable)
|
||||
newtype AnimalFarm = AnimalFarm
|
||||
{ unAnimalFarm :: [Animal]
|
||||
} deriving (P.Eq, P.Show, P.Typeable, A.ToJSON, A.FromJSON)
|
||||
|
||||
-- | FromJSON AnimalFarm
|
||||
instance A.FromJSON AnimalFarm where
|
||||
parseJSON = A.withObject "AnimalFarm" $ \o ->
|
||||
pure AnimalFarm
|
||||
|
||||
|
||||
-- | ToJSON AnimalFarm
|
||||
instance A.ToJSON AnimalFarm where
|
||||
toJSON AnimalFarm =
|
||||
_omitNulls
|
||||
[
|
||||
]
|
||||
|
||||
|
||||
-- | Construct a value of type 'AnimalFarm' (by applying it's required fields, if any)
|
||||
mkAnimalFarm
|
||||
:: AnimalFarm
|
||||
mkAnimalFarm =
|
||||
AnimalFarm
|
||||
{
|
||||
}
|
||||
|
||||
-- ** ApiResponse
|
||||
-- | ApiResponse
|
||||
@@ -447,6 +441,43 @@ mkCapitalization =
|
||||
, capitalizationAttName = Nothing
|
||||
}
|
||||
|
||||
-- ** Cat
|
||||
-- | Cat
|
||||
data Cat = Cat
|
||||
{ catClassName :: !(Text) -- ^ /Required/ "className"
|
||||
, catColor :: !(Maybe Text) -- ^ "color"
|
||||
, catDeclawed :: !(Maybe Bool) -- ^ "declawed"
|
||||
} deriving (P.Show, P.Eq, P.Typeable)
|
||||
|
||||
-- | FromJSON Cat
|
||||
instance A.FromJSON Cat where
|
||||
parseJSON = A.withObject "Cat" $ \o ->
|
||||
Cat
|
||||
<$> (o .: "className")
|
||||
<*> (o .:? "color")
|
||||
<*> (o .:? "declawed")
|
||||
|
||||
-- | ToJSON Cat
|
||||
instance A.ToJSON Cat where
|
||||
toJSON Cat {..} =
|
||||
_omitNulls
|
||||
[ "className" .= catClassName
|
||||
, "color" .= catColor
|
||||
, "declawed" .= catDeclawed
|
||||
]
|
||||
|
||||
|
||||
-- | Construct a value of type 'Cat' (by applying it's required fields, if any)
|
||||
mkCat
|
||||
:: Text -- ^ 'catClassName'
|
||||
-> Cat
|
||||
mkCat catClassName =
|
||||
Cat
|
||||
{ catClassName
|
||||
, catColor = Nothing
|
||||
, catDeclawed = Nothing
|
||||
}
|
||||
|
||||
-- ** Category
|
||||
-- | Category
|
||||
data Category = Category
|
||||
@@ -536,6 +567,43 @@ mkClient =
|
||||
{ clientClient = Nothing
|
||||
}
|
||||
|
||||
-- ** Dog
|
||||
-- | Dog
|
||||
data Dog = Dog
|
||||
{ dogClassName :: !(Text) -- ^ /Required/ "className"
|
||||
, dogColor :: !(Maybe Text) -- ^ "color"
|
||||
, dogBreed :: !(Maybe Text) -- ^ "breed"
|
||||
} deriving (P.Show, P.Eq, P.Typeable)
|
||||
|
||||
-- | FromJSON Dog
|
||||
instance A.FromJSON Dog where
|
||||
parseJSON = A.withObject "Dog" $ \o ->
|
||||
Dog
|
||||
<$> (o .: "className")
|
||||
<*> (o .:? "color")
|
||||
<*> (o .:? "breed")
|
||||
|
||||
-- | ToJSON Dog
|
||||
instance A.ToJSON Dog where
|
||||
toJSON Dog {..} =
|
||||
_omitNulls
|
||||
[ "className" .= dogClassName
|
||||
, "color" .= dogColor
|
||||
, "breed" .= dogBreed
|
||||
]
|
||||
|
||||
|
||||
-- | Construct a value of type 'Dog' (by applying it's required fields, if any)
|
||||
mkDog
|
||||
:: Text -- ^ 'dogClassName'
|
||||
-> Dog
|
||||
mkDog dogClassName =
|
||||
Dog
|
||||
{ dogClassName
|
||||
, dogColor = Nothing
|
||||
, dogBreed = Nothing
|
||||
}
|
||||
|
||||
-- ** EnumArrays
|
||||
-- | EnumArrays
|
||||
data EnumArrays = EnumArrays
|
||||
@@ -572,6 +640,7 @@ mkEnumArrays =
|
||||
-- | EnumTest
|
||||
data EnumTest = EnumTest
|
||||
{ enumTestEnumString :: !(Maybe E'EnumString) -- ^ "enum_string"
|
||||
, enumTestEnumStringRequired :: !(E'EnumString) -- ^ /Required/ "enum_string_required"
|
||||
, enumTestEnumInteger :: !(Maybe E'EnumInteger) -- ^ "enum_integer"
|
||||
, enumTestEnumNumber :: !(Maybe E'EnumNumber) -- ^ "enum_number"
|
||||
, enumTestOuterEnum :: !(Maybe OuterEnum) -- ^ "outerEnum"
|
||||
@@ -582,6 +651,7 @@ instance A.FromJSON EnumTest where
|
||||
parseJSON = A.withObject "EnumTest" $ \o ->
|
||||
EnumTest
|
||||
<$> (o .:? "enum_string")
|
||||
<*> (o .: "enum_string_required")
|
||||
<*> (o .:? "enum_integer")
|
||||
<*> (o .:? "enum_number")
|
||||
<*> (o .:? "outerEnum")
|
||||
@@ -591,6 +661,7 @@ instance A.ToJSON EnumTest where
|
||||
toJSON EnumTest {..} =
|
||||
_omitNulls
|
||||
[ "enum_string" .= enumTestEnumString
|
||||
, "enum_string_required" .= enumTestEnumStringRequired
|
||||
, "enum_integer" .= enumTestEnumInteger
|
||||
, "enum_number" .= enumTestEnumNumber
|
||||
, "outerEnum" .= enumTestOuterEnum
|
||||
@@ -599,10 +670,12 @@ instance A.ToJSON EnumTest where
|
||||
|
||||
-- | Construct a value of type 'EnumTest' (by applying it's required fields, if any)
|
||||
mkEnumTest
|
||||
:: EnumTest
|
||||
mkEnumTest =
|
||||
:: E'EnumString -- ^ 'enumTestEnumStringRequired'
|
||||
-> EnumTest
|
||||
mkEnumTest enumTestEnumStringRequired =
|
||||
EnumTest
|
||||
{ enumTestEnumString = Nothing
|
||||
, enumTestEnumStringRequired
|
||||
, enumTestEnumInteger = Nothing
|
||||
, enumTestEnumNumber = Nothing
|
||||
, enumTestOuterEnum = Nothing
|
||||
@@ -619,7 +692,7 @@ data FormatTest = FormatTest
|
||||
, formatTestDouble :: !(Maybe Double) -- ^ "double"
|
||||
, formatTestString :: !(Maybe Text) -- ^ "string"
|
||||
, formatTestByte :: !(ByteArray) -- ^ /Required/ "byte"
|
||||
, formatTestBinary :: !(Maybe Binary) -- ^ "binary"
|
||||
, formatTestBinary :: !(Maybe FilePath) -- ^ "binary"
|
||||
, formatTestDate :: !(Date) -- ^ /Required/ "date"
|
||||
, formatTestDateTime :: !(Maybe DateTime) -- ^ "dateTime"
|
||||
, formatTestUuid :: !(Maybe Text) -- ^ "uuid"
|
||||
@@ -1000,7 +1073,7 @@ mkOrder =
|
||||
-- | OuterBoolean
|
||||
newtype OuterBoolean = OuterBoolean
|
||||
{ unOuterBoolean :: Bool
|
||||
} deriving (P.Eq, P.Show, P.Typeable, A.ToJSON, A.FromJSON, WH.ToHttpApiData, WH.FromHttpApiData)
|
||||
} deriving (P.Eq, P.Show, P.Typeable, A.ToJSON, A.FromJSON)
|
||||
|
||||
|
||||
-- ** OuterComposite
|
||||
@@ -1043,14 +1116,14 @@ mkOuterComposite =
|
||||
-- | OuterNumber
|
||||
newtype OuterNumber = OuterNumber
|
||||
{ unOuterNumber :: Double
|
||||
} deriving (P.Eq, P.Show, P.Typeable, A.ToJSON, A.FromJSON, WH.ToHttpApiData, WH.FromHttpApiData)
|
||||
} deriving (P.Eq, P.Show, P.Typeable, A.ToJSON, A.FromJSON)
|
||||
|
||||
|
||||
-- ** OuterString
|
||||
-- | OuterString
|
||||
newtype OuterString = OuterString
|
||||
{ unOuterString :: Text
|
||||
} deriving (P.Eq, P.Show, P.Typeable, A.ToJSON, A.FromJSON, WH.ToHttpApiData, WH.FromHttpApiData)
|
||||
} deriving (P.Eq, P.Show, P.Typeable, A.ToJSON, A.FromJSON)
|
||||
|
||||
|
||||
-- ** Pet
|
||||
@@ -1251,80 +1324,6 @@ mkUser =
|
||||
, userUserStatus = Nothing
|
||||
}
|
||||
|
||||
-- ** Cat
|
||||
-- | Cat
|
||||
data Cat = Cat
|
||||
{ catClassName :: !(Text) -- ^ /Required/ "className"
|
||||
, catColor :: !(Maybe Text) -- ^ "color"
|
||||
, catDeclawed :: !(Maybe Bool) -- ^ "declawed"
|
||||
} deriving (P.Show, P.Eq, P.Typeable)
|
||||
|
||||
-- | FromJSON Cat
|
||||
instance A.FromJSON Cat where
|
||||
parseJSON = A.withObject "Cat" $ \o ->
|
||||
Cat
|
||||
<$> (o .: "className")
|
||||
<*> (o .:? "color")
|
||||
<*> (o .:? "declawed")
|
||||
|
||||
-- | ToJSON Cat
|
||||
instance A.ToJSON Cat where
|
||||
toJSON Cat {..} =
|
||||
_omitNulls
|
||||
[ "className" .= catClassName
|
||||
, "color" .= catColor
|
||||
, "declawed" .= catDeclawed
|
||||
]
|
||||
|
||||
|
||||
-- | Construct a value of type 'Cat' (by applying it's required fields, if any)
|
||||
mkCat
|
||||
:: Text -- ^ 'catClassName'
|
||||
-> Cat
|
||||
mkCat catClassName =
|
||||
Cat
|
||||
{ catClassName
|
||||
, catColor = Nothing
|
||||
, catDeclawed = Nothing
|
||||
}
|
||||
|
||||
-- ** Dog
|
||||
-- | Dog
|
||||
data Dog = Dog
|
||||
{ dogClassName :: !(Text) -- ^ /Required/ "className"
|
||||
, dogColor :: !(Maybe Text) -- ^ "color"
|
||||
, dogBreed :: !(Maybe Text) -- ^ "breed"
|
||||
} deriving (P.Show, P.Eq, P.Typeable)
|
||||
|
||||
-- | FromJSON Dog
|
||||
instance A.FromJSON Dog where
|
||||
parseJSON = A.withObject "Dog" $ \o ->
|
||||
Dog
|
||||
<$> (o .: "className")
|
||||
<*> (o .:? "color")
|
||||
<*> (o .:? "breed")
|
||||
|
||||
-- | ToJSON Dog
|
||||
instance A.ToJSON Dog where
|
||||
toJSON Dog {..} =
|
||||
_omitNulls
|
||||
[ "className" .= dogClassName
|
||||
, "color" .= dogColor
|
||||
, "breed" .= dogBreed
|
||||
]
|
||||
|
||||
|
||||
-- | Construct a value of type 'Dog' (by applying it's required fields, if any)
|
||||
mkDog
|
||||
:: Text -- ^ 'dogClassName'
|
||||
-> Dog
|
||||
mkDog dogClassName =
|
||||
Dog
|
||||
{ dogClassName
|
||||
, dogColor = Nothing
|
||||
, dogBreed = Nothing
|
||||
}
|
||||
|
||||
|
||||
-- * Enums
|
||||
|
||||
@@ -1359,7 +1358,8 @@ toE'ArrayEnum = \case
|
||||
|
||||
-- ** E'EnumFormString
|
||||
|
||||
-- | Enum of 'Text'
|
||||
-- | Enum of 'Text' .
|
||||
-- Form parameter enum test (string)
|
||||
data E'EnumFormString
|
||||
= E'EnumFormString'_abc -- ^ @"_abc"@
|
||||
| E'EnumFormString'_efg -- ^ @"-efg"@
|
||||
@@ -1388,6 +1388,34 @@ toE'EnumFormString = \case
|
||||
s -> P.Left $ "toE'EnumFormString: enum parse failure: " P.++ P.show s
|
||||
|
||||
|
||||
-- ** E'EnumFormStringArray
|
||||
|
||||
-- | Enum of 'Text'
|
||||
data E'EnumFormStringArray
|
||||
= E'EnumFormStringArray'GreaterThan -- ^ @">"@
|
||||
| E'EnumFormStringArray'Dollar -- ^ @"$"@
|
||||
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
|
||||
|
||||
-- | unwrap 'E'EnumFormStringArray' enum
|
||||
fromE'EnumFormStringArray :: E'EnumFormStringArray -> Text
|
||||
fromE'EnumFormStringArray = \case
|
||||
E'EnumFormStringArray'GreaterThan -> ">"
|
||||
E'EnumFormStringArray'Dollar -> "$"
|
||||
|
||||
-- | parse 'E'EnumFormStringArray' enum
|
||||
toE'EnumFormStringArray :: Text -> P.Either String E'EnumFormStringArray
|
||||
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
|
||||
|
||||
|
||||
-- ** E'EnumInteger
|
||||
|
||||
-- | Enum of 'Int'
|
||||
@@ -1531,34 +1559,6 @@ toE'Inner = \case
|
||||
s -> P.Left $ "toE'Inner: enum parse failure: " P.++ P.show s
|
||||
|
||||
|
||||
-- ** E'Inner2
|
||||
|
||||
-- | Enum of 'Text'
|
||||
data E'Inner2
|
||||
= E'Inner2'GreaterThan -- ^ @">"@
|
||||
| E'Inner2'Dollar -- ^ @"$"@
|
||||
deriving (P.Show, P.Eq, P.Typeable, P.Ord, P.Bounded, P.Enum)
|
||||
|
||||
instance A.ToJSON E'Inner2 where toJSON = A.toJSON . fromE'Inner2
|
||||
instance A.FromJSON E'Inner2 where parseJSON o = P.either P.fail (pure . P.id) . toE'Inner2 =<< A.parseJSON o
|
||||
instance WH.ToHttpApiData E'Inner2 where toQueryParam = WH.toQueryParam . fromE'Inner2
|
||||
instance WH.FromHttpApiData E'Inner2 where parseQueryParam o = WH.parseQueryParam o >>= P.left T.pack . toE'Inner2
|
||||
instance MimeRender MimeMultipartFormData E'Inner2 where mimeRender _ = mimeRenderDefaultMultipartFormData
|
||||
|
||||
-- | unwrap 'E'Inner2' enum
|
||||
fromE'Inner2 :: E'Inner2 -> Text
|
||||
fromE'Inner2 = \case
|
||||
E'Inner2'GreaterThan -> ">"
|
||||
E'Inner2'Dollar -> "$"
|
||||
|
||||
-- | parse 'E'Inner2' enum
|
||||
toE'Inner2 :: Text -> P.Either String E'Inner2
|
||||
toE'Inner2 = \case
|
||||
">" -> P.Right E'Inner2'GreaterThan
|
||||
"$" -> P.Right E'Inner2'Dollar
|
||||
s -> P.Left $ "toE'Inner2: enum parse failure: " P.++ P.show s
|
||||
|
||||
|
||||
-- ** E'JustSymbol
|
||||
|
||||
-- | Enum of 'Text'
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
|
||||
OpenAPI spec version: 2.0
|
||||
OpenAPI Version: 3.0.1
|
||||
Swagger Petstore API version: 1.0.0
|
||||
Contact: apiteam@swagger.io
|
||||
Generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
@@ -159,6 +159,25 @@ capitalizationAttNameL f Capitalization{..} = (\capitalizationAttName -> Capital
|
||||
|
||||
|
||||
|
||||
-- * Cat
|
||||
|
||||
-- | 'catClassName' Lens
|
||||
catClassNameL :: Lens_' Cat (Text)
|
||||
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
|
||||
{-# INLINE catColorL #-}
|
||||
|
||||
-- | 'catDeclawed' Lens
|
||||
catDeclawedL :: Lens_' Cat (Maybe Bool)
|
||||
catDeclawedL f Cat{..} = (\catDeclawed -> Cat { catDeclawed, ..} ) <$> f catDeclawed
|
||||
{-# INLINE catDeclawedL #-}
|
||||
|
||||
|
||||
|
||||
-- * Category
|
||||
|
||||
-- | 'categoryId' Lens
|
||||
@@ -191,6 +210,25 @@ clientClientL f Client{..} = (\clientClient -> Client { clientClient, ..} ) <$>
|
||||
|
||||
|
||||
|
||||
-- * Dog
|
||||
|
||||
-- | 'dogClassName' Lens
|
||||
dogClassNameL :: Lens_' Dog (Text)
|
||||
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
|
||||
{-# INLINE dogColorL #-}
|
||||
|
||||
-- | 'dogBreed' Lens
|
||||
dogBreedL :: Lens_' Dog (Maybe Text)
|
||||
dogBreedL f Dog{..} = (\dogBreed -> Dog { dogBreed, ..} ) <$> f dogBreed
|
||||
{-# INLINE dogBreedL #-}
|
||||
|
||||
|
||||
|
||||
-- * EnumArrays
|
||||
|
||||
-- | 'enumArraysJustSymbol' Lens
|
||||
@@ -216,6 +254,11 @@ enumTestEnumStringL :: Lens_' EnumTest (Maybe E'EnumString)
|
||||
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
|
||||
{-# INLINE enumTestEnumStringRequiredL #-}
|
||||
|
||||
-- | 'enumTestEnumInteger' Lens
|
||||
enumTestEnumIntegerL :: Lens_' EnumTest (Maybe E'EnumInteger)
|
||||
enumTestEnumIntegerL f EnumTest{..} = (\enumTestEnumInteger -> EnumTest { enumTestEnumInteger, ..} ) <$> f enumTestEnumInteger
|
||||
@@ -276,7 +319,7 @@ formatTestByteL f FormatTest{..} = (\formatTestByte -> FormatTest { formatTestBy
|
||||
{-# INLINE formatTestByteL #-}
|
||||
|
||||
-- | 'formatTestBinary' Lens
|
||||
formatTestBinaryL :: Lens_' FormatTest (Maybe Binary)
|
||||
formatTestBinaryL :: Lens_' FormatTest (Maybe FilePath)
|
||||
formatTestBinaryL f FormatTest{..} = (\formatTestBinary -> FormatTest { formatTestBinary, ..} ) <$> f formatTestBinary
|
||||
{-# INLINE formatTestBinaryL #-}
|
||||
|
||||
@@ -597,41 +640,3 @@ userUserStatusL f User{..} = (\userUserStatus -> User { userUserStatus, ..} ) <$
|
||||
{-# INLINE userUserStatusL #-}
|
||||
|
||||
|
||||
|
||||
-- * Cat
|
||||
|
||||
-- | 'catClassName' Lens
|
||||
catClassNameL :: Lens_' Cat (Text)
|
||||
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
|
||||
{-# INLINE catColorL #-}
|
||||
|
||||
-- | 'catDeclawed' Lens
|
||||
catDeclawedL :: Lens_' Cat (Maybe Bool)
|
||||
catDeclawedL f Cat{..} = (\catDeclawed -> Cat { catDeclawed, ..} ) <$> f catDeclawed
|
||||
{-# INLINE catDeclawedL #-}
|
||||
|
||||
|
||||
|
||||
-- * Dog
|
||||
|
||||
-- | 'dogClassName' Lens
|
||||
dogClassNameL :: Lens_' Dog (Text)
|
||||
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
|
||||
{-# INLINE dogColorL #-}
|
||||
|
||||
-- | 'dogBreed' Lens
|
||||
dogBreedL :: Lens_' Dog (Maybe Text)
|
||||
dogBreedL f Dog{..} = (\dogBreed -> Dog { dogBreed, ..} ) <$> f dogBreed
|
||||
{-# INLINE dogBreedL #-}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user