    {-
       Swagger Petstore

       This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\

       OpenAPI spec version: 2.0
       Swagger Petstore API version: 1.0.0
       Contact: apiteam@swagger.io
       Generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
    -}

    {-|
    Module : SwaggerPetstore.Model
    -}

    {-# LANGUAGE DeriveDataTypeable #-}
    {-# LANGUAGE DeriveFoldable #-}
    {-# LANGUAGE DeriveGeneric #-}
    {-# LANGUAGE DeriveTraversable #-}
    {-# LANGUAGE GeneralizedNewtypeDeriving #-}
    {-# LANGUAGE NamedFieldPuns #-}
    {-# LANGUAGE OverloadedStrings #-}
    {-# LANGUAGE RecordWildCards #-}
    {-# LANGUAGE TupleSections #-}
    {-# LANGUAGE TypeFamilies #-}
    {-# OPTIONS_GHC -fno-warn-unused-matches -fno-warn-unused-binds -fno-warn-unused-imports #-}

    module SwaggerPetstore.Model where

    import SwaggerPetstore.Core

    import Data.Aeson ((.:),(.:!),(.:?),(.=))

    import qualified Data.Aeson as A
    import qualified Data.ByteString as B
    import qualified Data.ByteString.Lazy as BL
    import qualified Data.Data as P (Data, Typeable)
    import qualified Data.Foldable as P
    import qualified Data.HashMap.Lazy as HM
    import qualified Data.Map as Map
    import qualified Data.Maybe as P
    import qualified Data.Set as Set
    import qualified Data.Text as T
    import qualified Data.Text.Encoding as T
    import qualified Data.Time as TI
    import qualified Web.FormUrlEncoded as WH
    import qualified Web.HttpApiData as WH

    import Control.Applicative ((<|>))
    import Control.Applicative (Alternative)
    import Data.Text (Text)
    import Prelude (($), (.),(<$>),(<*>),(>>=),Maybe(..),Bool(..),Char,Double,FilePath,Float,Int,Integer,String,fmap,undefined,mempty,maybe,pure,Monad,Applicative,Functor)

    import qualified Prelude as P

    -- * Models

    -- ** AdditionalPropertiesClass
    -- | AdditionalPropertiesClass
    data AdditionalPropertiesClass = AdditionalPropertiesClass
      { additionalPropertiesClassMapProperty :: !(Maybe (Map.Map String Text)) -- ^ "map_property"
      , additionalPropertiesClassMapOfMapProperty :: !(Maybe (Map.Map String (Map.Map String Text))) -- ^ "map_of_map_property"
      } deriving (P.Show, P.Eq, P.Typeable)

    -- | FromJSON AdditionalPropertiesClass
    instance A.FromJSON AdditionalPropertiesClass where
      parseJSON = A.withObject "AdditionalPropertiesClass" $ \o ->
        AdditionalPropertiesClass
          <$> (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
          ]

    -- | Construct a value of type 'AdditionalPropertiesClass' (by applying it's required fields, if any)
    mkAdditionalPropertiesClass
      :: AdditionalPropertiesClass
    mkAdditionalPropertiesClass =
      AdditionalPropertiesClass
      { additionalPropertiesClassMapProperty = Nothing
      , additionalPropertiesClassMapOfMapProperty = Nothing
      }

    -- ** Animal
    -- | Animal
    data Animal = Animal
      { animalClassName :: !(Text) -- ^ /Required/ "className"
      , animalColor :: !(Maybe Text) -- ^ "color"
      } deriving (P.Show, P.Eq, P.Typeable)

    -- | FromJSON Animal
    instance A.FromJSON Animal where
      parseJSON = A.withObject "Animal" $ \o ->
        Animal
          <$> (o .:  "className")
          <*> (o .:? "color")

    -- | ToJSON Animal
    instance A.ToJSON Animal where
      toJSON Animal {..} =
       _omitNulls
          [ "className" .= animalClassName
          , "color" .= animalColor
          ]

    -- | Construct a value of type 'Animal' (by applying it's required fields, if any)
    mkAnimal
      :: Text -- ^ 'animalClassName'
      -> Animal
    mkAnimal animalClassName =
      Animal
      { animalClassName
      , animalColor = Nothing
      }

    -- ** AnimalFarm
    -- | AnimalFarm
    data AnimalFarm = AnimalFarm
      {
      } deriving (P.Show, P.Eq, P.Typeable)

    -- | 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
    data ApiResponse = ApiResponse
      { apiResponseCode :: !(Maybe Int) -- ^ "code"
      , apiResponseType :: !(Maybe Text) -- ^ "type"
      , apiResponseMessage :: !(Maybe Text) -- ^ "message"
      } deriving (P.Show, P.Eq, P.Typeable)

    -- | FromJSON ApiResponse
    instance A.FromJSON ApiResponse where
      parseJSON = A.withObject "ApiResponse" $ \o ->
        ApiResponse
          <$> (o .:? "code")
          <*> (o .:? "type")
          <*> (o .:? "message")

    -- | ToJSON ApiResponse
    instance A.ToJSON ApiResponse where
      toJSON ApiResponse {..} =
       _omitNulls
          [ "code" .= apiResponseCode
          , "type" .= apiResponseType
          , "message" .= apiResponseMessage
          ]

    -- | Construct a value of type 'ApiResponse' (by applying it's required fields, if any)
    mkApiResponse
      :: ApiResponse
    mkApiResponse =
      ApiResponse
      { apiResponseCode = Nothing
      , apiResponseType = Nothing
      , apiResponseMessage = Nothing
      }

    -- ** ArrayOfArrayOfNumberOnly
    -- | ArrayOfArrayOfNumberOnly
    data ArrayOfArrayOfNumberOnly = ArrayOfArrayOfNumberOnly
      { arrayOfArrayOfNumberOnlyArrayArrayNumber :: !(Maybe [[Double]]) -- ^ "ArrayArrayNumber"
      } deriving (P.Show, P.Eq, P.Typeable)

    -- | FromJSON ArrayOfArrayOfNumberOnly
    instance A.FromJSON ArrayOfArrayOfNumberOnly where
      parseJSON = A.withObject "ArrayOfArrayOfNumberOnly" $ \o ->
        ArrayOfArrayOfNumberOnly
          <$> (o .:? "ArrayArrayNumber")

    -- | ToJSON ArrayOfArrayOfNumberOnly
    instance A.ToJSON ArrayOfArrayOfNumberOnly where
      toJSON ArrayOfArrayOfNumberOnly {..} =
       _omitNulls
          [ "ArrayArrayNumber" .= arrayOfArrayOfNumberOnlyArrayArrayNumber
          ]

    -- | Construct a value of type 'ArrayOfArrayOfNumberOnly' (by applying it's required fields, if any)
    mkArrayOfArrayOfNumberOnly
      :: ArrayOfArrayOfNumberOnly
    mkArrayOfArrayOfNumberOnly =
      ArrayOfArrayOfNumberOnly
      { arrayOfArrayOfNumberOnlyArrayArrayNumber = Nothing
      }

    -- ** ArrayOfNumberOnly
    -- | ArrayOfNumberOnly
    data ArrayOfNumberOnly = ArrayOfNumberOnly
      { arrayOfNumberOnlyArrayNumber :: !(Maybe [Double]) -- ^ "ArrayNumber"
      } deriving (P.Show, P.Eq, P.Typeable)

    -- | FromJSON ArrayOfNumberOnly
    instance A.FromJSON ArrayOfNumberOnly where
      parseJSON = A.withObject "ArrayOfNumberOnly" $ \o ->
        ArrayOfNumberOnly
          <$> (o .:? "ArrayNumber")

    -- | ToJSON ArrayOfNumberOnly
    instance A.ToJSON ArrayOfNumberOnly where
      toJSON ArrayOfNumberOnly {..} =
       _omitNulls
          [ "ArrayNumber" .= arrayOfNumberOnlyArrayNumber
          ]

    -- | Construct a value of type 'ArrayOfNumberOnly' (by applying it's required fields, if any)
    mkArrayOfNumberOnly
      :: ArrayOfNumberOnly
    mkArrayOfNumberOnly =
      ArrayOfNumberOnly
      { arrayOfNumberOnlyArrayNumber = Nothing
      }

    -- ** ArrayTest
    -- | ArrayTest
    data ArrayTest = ArrayTest
      { arrayTestArrayOfString :: !(Maybe [Text]) -- ^ "array_of_string"
      , arrayTestArrayArrayOfInteger :: !(Maybe [[Integer]]) -- ^ "array_array_of_integer"
      , arrayTestArrayArrayOfModel :: !(Maybe [[ReadOnlyFirst]]) -- ^ "array_array_of_model"
      } deriving (P.Show, P.Eq, P.Typeable)

    -- | FromJSON ArrayTest
    instance A.FromJSON ArrayTest where
      parseJSON = A.withObject "ArrayTest" $ \o ->
        ArrayTest
          <$> (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
          ]

    -- | Construct a value of type 'ArrayTest' (by applying it's required fields, if any)
    mkArrayTest
      :: ArrayTest
    mkArrayTest =
      ArrayTest
      { arrayTestArrayOfString = Nothing
      , arrayTestArrayArrayOfInteger = Nothing
      , arrayTestArrayArrayOfModel = Nothing
      }

    -- ** Capitalization
    -- | Capitalization
    data Capitalization = Capitalization
      { capitalizationSmallCamel :: !(Maybe Text) -- ^ "smallCamel"
      , capitalizationCapitalCamel :: !(Maybe Text) -- ^ "CapitalCamel"
      , capitalizationSmallSnake :: !(Maybe Text) -- ^ "small_Snake"
      , capitalizationCapitalSnake :: !(Maybe Text) -- ^ "Capital_Snake"
      , capitalizationScaEthFlowPoints :: !(Maybe Text) -- ^ "SCA_ETH_Flow_Points"
      , capitalizationAttName :: !(Maybe Text) -- ^ "ATT_NAME" - Name of the pet
      } deriving (P.Show, P.Eq, P.Typeable)

    -- | FromJSON Capitalization
    instance A.FromJSON Capitalization where
      parseJSON = A.withObject "Capitalization" $ \o ->
        Capitalization
          <$> (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
          ]

    -- | Construct a value of type 'Capitalization' (by applying it's required fields, if any)
    mkCapitalization
      :: Capitalization
    mkCapitalization =
      Capitalization
      { capitalizationSmallCamel = Nothing
      , capitalizationCapitalCamel = Nothing
      , capitalizationSmallSnake = Nothing
      , capitalizationCapitalSnake = Nothing
      , capitalizationScaEthFlowPoints = Nothing
      , capitalizationAttName = Nothing
      }

    -- ** Category
    -- | Category
    data Category = Category
      { categoryId :: !(Maybe Integer) -- ^ "id"
      , categoryName :: !(Maybe Text) -- ^ "name"
      } deriving (P.Show, P.Eq, P.Typeable)

    -- | FromJSON Category
    instance A.FromJSON Category where
      parseJSON = A.withObject "Category" $ \o ->
        Category
          <$> (o .:? "id")
          <*> (o .:? "name")

    -- | ToJSON Category
    instance A.ToJSON Category where
      toJSON Category {..} =
       _omitNulls
          [ "id" .= categoryId
          , "name" .= categoryName
          ]

    -- | Construct a value of type 'Category' (by applying it's required fields, if any)
    mkCategory
      :: Category
    mkCategory =
      Category
      { categoryId = Nothing
      , categoryName = Nothing
      }

    -- ** ClassModel
    -- | ClassModel
    -- Model for testing model with \"_class\" property
    data ClassModel = ClassModel
      { classModelClass :: !(Maybe Text) -- ^ "_class"
      } deriving (P.Show, P.Eq, P.Typeable)

    -- | FromJSON ClassModel
    instance A.FromJSON ClassModel where
      parseJSON = A.withObject "ClassModel" $ \o ->
        ClassModel
          <$> (o .:? "_class")

    -- | ToJSON ClassModel
    instance A.ToJSON ClassModel where
      toJSON ClassModel {..} =
       _omitNulls
          [ "_class" .= classModelClass
          ]

    -- | Construct a value of type 'ClassModel' (by applying it's required fields, if any)
    mkClassModel
      :: ClassModel
    mkClassModel =
      ClassModel
      { classModelClass = Nothing
      }

    -- ** Client
    -- | Client
    data Client = Client
      { clientClient :: !(Maybe Text) -- ^ "client"
      } deriving (P.Show, P.Eq, P.Typeable)

    -- | FromJSON Client
    instance A.FromJSON Client where
      parseJSON = A.withObject "Client" $ \o ->
        Client
          <$> (o .:? "client")

    -- | ToJSON Client
    instance A.ToJSON Client where
      toJSON Client {..} =
       _omitNulls
          [ "client" .= clientClient
          ]

    -- | Construct a value of type 'Client' (by applying it's required fields, if any)
    mkClient
      :: Client
    mkClient =
      Client
      { clientClient = Nothing
      }

    -- ** EnumArrays
    -- | EnumArrays
    data EnumArrays = EnumArrays
      { enumArraysJustSymbol :: !(Maybe Text) -- ^ "just_symbol"
      , enumArraysArrayEnum :: !(Maybe [Text]) -- ^ "array_enum"
      } deriving (P.Show, P.Eq, P.Typeable)

    -- | FromJSON EnumArrays
    instance A.FromJSON EnumArrays where
      parseJSON = A.withObject "EnumArrays" $ \o ->
        EnumArrays
          <$> (o .:? "just_symbol")
          <*> (o .:? "array_enum")

    -- | ToJSON EnumArrays
    instance A.ToJSON EnumArrays where
      toJSON EnumArrays {..} =
       _omitNulls
          [ "just_symbol" .= enumArraysJustSymbol
          , "array_enum" .= enumArraysArrayEnum
          ]

    -- | Construct a value of type 'EnumArrays' (by applying it's required fields, if any)
    mkEnumArrays
      :: EnumArrays
    mkEnumArrays =
      EnumArrays
      { enumArraysJustSymbol = Nothing
      , enumArraysArrayEnum = Nothing
      }

    -- ** EnumClass
    -- | EnumClass
    data EnumClass = EnumClass
      {
      } deriving (P.Show, P.Eq, P.Typeable)

    -- | FromJSON EnumClass
    instance A.FromJSON EnumClass where
      parseJSON = A.withObject "EnumClass" $ \o ->
        pure EnumClass

    -- | ToJSON EnumClass
    instance A.ToJSON EnumClass where
      toJSON EnumClass  =
       _omitNulls
          [
          ]

    -- | Construct a value of type 'EnumClass' (by applying it's required fields, if any)
    mkEnumClass
      :: EnumClass
    mkEnumClass =
      EnumClass
      {
      }

    -- ** EnumTest
    -- | EnumTest
    data EnumTest = EnumTest
      { enumTestEnumString :: !(Maybe Text) -- ^ "enum_string"
      , enumTestEnumInteger :: !(Maybe Int) -- ^ "enum_integer"
      , enumTestEnumNumber :: !(Maybe Double) -- ^ "enum_number"
      , enumTestOuterEnum :: !(Maybe OuterEnum) -- ^ "outerEnum"
      } deriving (P.Show, P.Eq, P.Typeable)

    -- | FromJSON EnumTest
    instance A.FromJSON EnumTest where
      parseJSON = A.withObject "EnumTest" $ \o ->
        EnumTest
          <$> (o .:? "enum_string")
          <*> (o .:? "enum_integer")
          <*> (o .:? "enum_number")
          <*> (o .:? "outerEnum")

    -- | ToJSON EnumTest
    instance A.ToJSON EnumTest where
      toJSON EnumTest {..} =
       _omitNulls
          [ "enum_string" .= enumTestEnumString
          , "enum_integer" .= enumTestEnumInteger
          , "enum_number" .= enumTestEnumNumber
          , "outerEnum" .= enumTestOuterEnum
          ]

    -- | Construct a value of type 'EnumTest' (by applying it's required fields, if any)
    mkEnumTest
      :: EnumTest
    mkEnumTest =
      EnumTest
      { enumTestEnumString = Nothing
      , enumTestEnumInteger = Nothing
      , enumTestEnumNumber = Nothing
      , enumTestOuterEnum = Nothing
      }

    -- ** FormatTest
    -- | FormatTest
    data FormatTest = FormatTest
      { formatTestInteger :: !(Maybe Int) -- ^ "integer"
      , formatTestInt32 :: !(Maybe Int) -- ^ "int32"
      , formatTestInt64 :: !(Maybe Integer) -- ^ "int64"
      , formatTestNumber :: !(Double) -- ^ /Required/ "number"
      , formatTestFloat :: !(Maybe Float) -- ^ "float"
      , formatTestDouble :: !(Maybe Double) -- ^ "double"
      , formatTestString :: !(Maybe Text) -- ^ "string"
      , formatTestByte :: !(ByteArray) -- ^ /Required/ "byte"
      , formatTestBinary :: !(Maybe Binary) -- ^ "binary"
      , formatTestDate :: !(Date) -- ^ /Required/ "date"
      , formatTestDateTime :: !(Maybe DateTime) -- ^ "dateTime"
      , formatTestUuid :: !(Maybe Text) -- ^ "uuid"
      , formatTestPassword :: !(Text) -- ^ /Required/ "password"
      } deriving (P.Show, P.Eq, P.Typeable)

    -- | FromJSON FormatTest
    instance A.FromJSON FormatTest where
      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")

    -- | 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
          ]

    -- | Construct a value of type 'FormatTest' (by applying it's required fields, if any)
    mkFormatTest
      :: Double -- ^ 'formatTestNumber'
      -> ByteArray -- ^ 'formatTestByte'
      -> Date -- ^ 'formatTestDate'
      -> Text -- ^ 'formatTestPassword'
      -> FormatTest
    mkFormatTest formatTestNumber formatTestByte formatTestDate formatTestPassword =
      FormatTest
      { formatTestInteger = Nothing
      , formatTestInt32 = Nothing
      , formatTestInt64 = Nothing
      , formatTestNumber
      , formatTestFloat = Nothing
      , formatTestDouble = Nothing
      , formatTestString = Nothing
      , formatTestByte
      , formatTestBinary = Nothing
      , formatTestDate
      , formatTestDateTime = Nothing
      , formatTestUuid = Nothing
      , formatTestPassword
      }

    -- ** HasOnlyReadOnly
    -- | HasOnlyReadOnly
    data HasOnlyReadOnly = HasOnlyReadOnly
      { hasOnlyReadOnlyBar :: !(Maybe Text) -- ^ "bar"
      , hasOnlyReadOnlyFoo :: !(Maybe Text) -- ^ "foo"
      } deriving (P.Show, P.Eq, P.Typeable)

    -- | FromJSON HasOnlyReadOnly
    instance A.FromJSON HasOnlyReadOnly where
      parseJSON = A.withObject "HasOnlyReadOnly" $ \o ->
        HasOnlyReadOnly
          <$> (o .:? "bar")
          <*> (o .:? "foo")

    -- | ToJSON HasOnlyReadOnly
    instance A.ToJSON HasOnlyReadOnly where
      toJSON HasOnlyReadOnly {..} =
       _omitNulls
          [ "bar" .= hasOnlyReadOnlyBar
          , "foo" .= hasOnlyReadOnlyFoo
          ]

    -- | Construct a value of type 'HasOnlyReadOnly' (by applying it's required fields, if any)
    mkHasOnlyReadOnly
      :: HasOnlyReadOnly
    mkHasOnlyReadOnly =
      HasOnlyReadOnly
      { hasOnlyReadOnlyBar = Nothing
      , hasOnlyReadOnlyFoo = Nothing
      }

    -- ** MapTest
    -- | MapTest
    data MapTest = MapTest
      { mapTestMapMapOfString :: !(Maybe (Map.Map String (Map.Map String Text))) -- ^ "map_map_of_string"
      , mapTestMapOfEnumString :: !(Maybe (Map.Map String Text)) -- ^ "map_of_enum_string"
      } deriving (P.Show, P.Eq, P.Typeable)

    -- | FromJSON MapTest
    instance A.FromJSON MapTest where
      parseJSON = A.withObject "MapTest" $ \o ->
        MapTest
          <$> (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
          ]

    -- | Construct a value of type 'MapTest' (by applying it's required fields, if any)
    mkMapTest
      :: MapTest
    mkMapTest =
      MapTest
      { mapTestMapMapOfString = Nothing
      , mapTestMapOfEnumString = Nothing
      }

    -- ** MixedPropertiesAndAdditionalPropertiesClass
    -- | MixedPropertiesAndAdditionalPropertiesClass
    data MixedPropertiesAndAdditionalPropertiesClass = MixedPropertiesAndAdditionalPropertiesClass
      { mixedPropertiesAndAdditionalPropertiesClassUuid :: !(Maybe Text) -- ^ "uuid"
      , mixedPropertiesAndAdditionalPropertiesClassDateTime :: !(Maybe DateTime) -- ^ "dateTime"
      , mixedPropertiesAndAdditionalPropertiesClassMap :: !(Maybe (Map.Map String Animal)) -- ^ "map"
      } deriving (P.Show, P.Eq, P.Typeable)

    -- | FromJSON MixedPropertiesAndAdditionalPropertiesClass
    instance A.FromJSON MixedPropertiesAndAdditionalPropertiesClass where
      parseJSON = A.withObject "MixedPropertiesAndAdditionalPropertiesClass" $ \o ->
        MixedPropertiesAndAdditionalPropertiesClass
          <$> (o .:? "uuid")
          <*> (o .:? "dateTime")
          <*> (o .:? "map")

    -- | ToJSON MixedPropertiesAndAdditionalPropertiesClass
    instance A.ToJSON MixedPropertiesAndAdditionalPropertiesClass where
      toJSON MixedPropertiesAndAdditionalPropertiesClass {..} =
       _omitNulls
          [ "uuid" .= mixedPropertiesAndAdditionalPropertiesClassUuid
          , "dateTime" .= mixedPropertiesAndAdditionalPropertiesClassDateTime
          , "map" .= mixedPropertiesAndAdditionalPropertiesClassMap
          ]

    -- | Construct a value of type 'MixedPropertiesAndAdditionalPropertiesClass' (by applying it's required fields, if any)
    mkMixedPropertiesAndAdditionalPropertiesClass
      :: MixedPropertiesAndAdditionalPropertiesClass
    mkMixedPropertiesAndAdditionalPropertiesClass =
      MixedPropertiesAndAdditionalPropertiesClass
      { mixedPropertiesAndAdditionalPropertiesClassUuid = Nothing
      , mixedPropertiesAndAdditionalPropertiesClassDateTime = Nothing
      , mixedPropertiesAndAdditionalPropertiesClassMap = Nothing
      }

    -- ** Model200Response
    -- | Model200Response
    -- Model for testing model name starting with number
    data Model200Response = Model200Response
      { model200ResponseName :: !(Maybe Int) -- ^ "name"
      , model200ResponseClass :: !(Maybe Text) -- ^ "class"
      } deriving (P.Show, P.Eq, P.Typeable)

    -- | FromJSON Model200Response
    instance A.FromJSON Model200Response where
      parseJSON = A.withObject "Model200Response" $ \o ->
        Model200Response
          <$> (o .:? "name")
          <*> (o .:? "class")

    -- | ToJSON Model200Response
    instance A.ToJSON Model200Response where
      toJSON Model200Response {..} =
       _omitNulls
          [ "name" .= model200ResponseName
          , "class" .= model200ResponseClass
          ]

    -- | Construct a value of type 'Model200Response' (by applying it's required fields, if any)
    mkModel200Response
      :: Model200Response
    mkModel200Response =
      Model200Response
      { model200ResponseName = Nothing
      , model200ResponseClass = Nothing
      }

    -- ** ModelList
    -- | ModelList
    data ModelList = ModelList
      { modelList123List :: !(Maybe Text) -- ^ "123-list"
      } deriving (P.Show, P.Eq, P.Typeable)

    -- | FromJSON ModelList
    instance A.FromJSON ModelList where
      parseJSON = A.withObject "ModelList" $ \o ->
        ModelList
          <$> (o .:? "123-list")

    -- | ToJSON ModelList
    instance A.ToJSON ModelList where
      toJSON ModelList {..} =
       _omitNulls
          [ "123-list" .= modelList123List
          ]

    -- | Construct a value of type 'ModelList' (by applying it's required fields, if any)
    mkModelList
      :: ModelList
    mkModelList =
      ModelList
      { modelList123List = Nothing
      }

    -- ** ModelReturn
    -- | ModelReturn
    -- Model for testing reserved words
    data ModelReturn = ModelReturn
      { modelReturnReturn :: !(Maybe Int) -- ^ "return"
      } deriving (P.Show, P.Eq, P.Typeable)

    -- | FromJSON ModelReturn
    instance A.FromJSON ModelReturn where
      parseJSON = A.withObject "ModelReturn" $ \o ->
        ModelReturn
          <$> (o .:? "return")

    -- | ToJSON ModelReturn
    instance A.ToJSON ModelReturn where
      toJSON ModelReturn {..} =
       _omitNulls
          [ "return" .= modelReturnReturn
          ]

    -- | Construct a value of type 'ModelReturn' (by applying it's required fields, if any)
    mkModelReturn
      :: ModelReturn
    mkModelReturn =
      ModelReturn
      { modelReturnReturn = Nothing
      }

    -- ** Name
    -- | Name
    -- Model for testing model name same as property name
    data Name = Name
      { nameName :: !(Int) -- ^ /Required/ "name"
      , nameSnakeCase :: !(Maybe Int) -- ^ "snake_case"
      , nameProperty :: !(Maybe Text) -- ^ "property"
      , name123Number :: !(Maybe Int) -- ^ "123Number"
      } deriving (P.Show, P.Eq, P.Typeable)

    -- | FromJSON Name
    instance A.FromJSON Name where
      parseJSON = A.withObject "Name" $ \o ->
        Name
          <$> (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
          ]

    -- | Construct a value of type 'Name' (by applying it's required fields, if any)
    mkName
      :: Int -- ^ 'nameName'
      -> Name
    mkName nameName =
      Name
      { nameName
      , nameSnakeCase = Nothing
      , nameProperty = Nothing
      , name123Number = Nothing
      }

    -- ** NumberOnly
    -- | NumberOnly
    data NumberOnly = NumberOnly
      { numberOnlyJustNumber :: !(Maybe Double) -- ^ "JustNumber"
      } deriving (P.Show, P.Eq, P.Typeable)

    -- | FromJSON NumberOnly
    instance A.FromJSON NumberOnly where
      parseJSON = A.withObject "NumberOnly" $ \o ->
        NumberOnly
          <$> (o .:? "JustNumber")

    -- | ToJSON NumberOnly
    instance A.ToJSON NumberOnly where
      toJSON NumberOnly {..} =
       _omitNulls
          [ "JustNumber" .= numberOnlyJustNumber
          ]

    -- | Construct a value of type 'NumberOnly' (by applying it's required fields, if any)
    mkNumberOnly
      :: NumberOnly
    mkNumberOnly =
      NumberOnly
      { numberOnlyJustNumber = Nothing
      }

    -- ** Order
    -- | Order
    data Order = Order
      { orderId :: !(Maybe Integer) -- ^ "id"
      , orderPetId :: !(Maybe Integer) -- ^ "petId"
      , orderQuantity :: !(Maybe Int) -- ^ "quantity"
      , orderShipDate :: !(Maybe DateTime) -- ^ "shipDate"
      , orderStatus :: !(Maybe Text) -- ^ "status" - Order Status
      , orderComplete :: !(Maybe Bool) -- ^ "complete"
      } deriving (P.Show, P.Eq, P.Typeable)

    -- | FromJSON Order
    instance A.FromJSON Order where
      parseJSON = A.withObject "Order" $ \o ->
        Order
          <$> (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
          ]

    -- | Construct a value of type 'Order' (by applying it's required fields, if any)
    mkOrder
      :: Order
    mkOrder =
      Order
      { orderId = Nothing
      , orderPetId = Nothing
      , orderQuantity = Nothing
      , orderShipDate = Nothing
      , orderStatus = Nothing
      , orderComplete = Nothing
      }

    -- ** OuterBoolean
    -- | OuterBoolean
    newtype OuterBoolean = OuterBoolean
      { unOuterBoolean :: Bool
      } deriving (P.Eq, P.Show, P.Typeable, A.ToJSON, A.FromJSON, WH.ToHttpApiData, WH.FromHttpApiData)

    -- ** OuterComposite
    -- | OuterComposite
    data OuterComposite = OuterComposite
      { outerCompositeMyNumber :: !(Maybe OuterNumber) -- ^ "my_number"
      , outerCompositeMyString :: !(Maybe OuterString) -- ^ "my_string"
      , outerCompositeMyBoolean :: !(Maybe OuterBoolean) -- ^ "my_boolean"
      } deriving (P.Show, P.Eq, P.Typeable)

    -- | FromJSON OuterComposite
    instance A.FromJSON OuterComposite where
      parseJSON = A.withObject "OuterComposite" $ \o ->
        OuterComposite
          <$> (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
          ]

    -- | Construct a value of type 'OuterComposite' (by applying it's required fields, if any)
    mkOuterComposite
      :: OuterComposite
    mkOuterComposite =
      OuterComposite
      { outerCompositeMyNumber = Nothing
      , outerCompositeMyString = Nothing
      , outerCompositeMyBoolean = Nothing
      }

    -- ** OuterEnum
    -- | OuterEnum
    data OuterEnum = OuterEnum
      {
      } deriving (P.Show, P.Eq, P.Typeable)

    -- | FromJSON OuterEnum
    instance A.FromJSON OuterEnum where
      parseJSON = A.withObject "OuterEnum" $ \o ->
        pure OuterEnum

    -- | ToJSON OuterEnum
    instance A.ToJSON OuterEnum where
      toJSON OuterEnum  =
       _omitNulls
          [
          ]

    -- | Construct a value of type 'OuterEnum' (by applying it's required fields, if any)
    mkOuterEnum
      :: OuterEnum
    mkOuterEnum =
      OuterEnum
      {
      }

    -- ** OuterNumber
    -- | OuterNumber
    newtype OuterNumber = OuterNumber
      { unOuterNumber :: Double
      } deriving (P.Eq, P.Show, P.Typeable, A.ToJSON, A.FromJSON, WH.ToHttpApiData, WH.FromHttpApiData)

    -- ** OuterString
    -- | OuterString
    newtype OuterString = OuterString
      { unOuterString :: Text
      } deriving (P.Eq, P.Show, P.Typeable, A.ToJSON, A.FromJSON, WH.ToHttpApiData, WH.FromHttpApiData)

    -- ** Pet
    -- | Pet
    data Pet = Pet
      { petId :: !(Maybe Integer) -- ^ "id"
      , petCategory :: !(Maybe Category) -- ^ "category"
      , petName :: !(Text) -- ^ /Required/ "name"
      , petPhotoUrls :: !([Text]) -- ^ /Required/ "photoUrls"
      , petTags :: !(Maybe [Tag]) -- ^ "tags"
      , petStatus :: !(Maybe Text) -- ^ "status" - pet status in the store
      } deriving (P.Show, P.Eq, P.Typeable)

    -- | FromJSON Pet
    instance A.FromJSON Pet where
      parseJSON = A.withObject "Pet" $ \o ->
        Pet
          <$> (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
          ]

    -- | Construct a value of type 'Pet' (by applying it's required fields, if any)
    mkPet
      :: Text -- ^ 'petName'
      -> [Text] -- ^ 'petPhotoUrls'
      -> Pet
    mkPet petName petPhotoUrls =
      Pet
      { petId = Nothing
      , petCategory = Nothing
      , petName
      , petPhotoUrls
      , petTags = Nothing
      , petStatus = Nothing
      }

    -- ** ReadOnlyFirst
    -- | ReadOnlyFirst
    data ReadOnlyFirst = ReadOnlyFirst
      { readOnlyFirstBar :: !(Maybe Text) -- ^ "bar"
      , readOnlyFirstBaz :: !(Maybe Text) -- ^ "baz"
      } deriving (P.Show, P.Eq, P.Typeable)

    -- | FromJSON ReadOnlyFirst
    instance A.FromJSON ReadOnlyFirst where
      parseJSON = A.withObject "ReadOnlyFirst" $ \o ->
        ReadOnlyFirst
          <$> (o .:? "bar")
          <*> (o .:? "baz")

    -- | ToJSON ReadOnlyFirst
    instance A.ToJSON ReadOnlyFirst where
      toJSON ReadOnlyFirst {..} =
       _omitNulls
          [ "bar" .= readOnlyFirstBar
          , "baz" .= readOnlyFirstBaz
          ]

    -- | Construct a value of type 'ReadOnlyFirst' (by applying it's required fields, if any)
    mkReadOnlyFirst
      :: ReadOnlyFirst
    mkReadOnlyFirst =
      ReadOnlyFirst
      { readOnlyFirstBar = Nothing
      , readOnlyFirstBaz = Nothing
      }

    -- ** SpecialModelName
    -- | SpecialModelName
    data SpecialModelName = SpecialModelName
      { specialModelNameSpecialPropertyName :: !(Maybe Integer) -- ^ "$special[property.name]"
      } deriving (P.Show, P.Eq, P.Typeable)

    -- | FromJSON SpecialModelName
    instance A.FromJSON SpecialModelName where
      parseJSON = A.withObject "SpecialModelName" $ \o ->
        SpecialModelName
          <$> (o .:? "$special[property.name]")

    -- | ToJSON SpecialModelName
    instance A.ToJSON SpecialModelName where
      toJSON SpecialModelName {..} =
       _omitNulls
          [ "$special[property.name]" .= specialModelNameSpecialPropertyName
          ]

    -- | Construct a value of type 'SpecialModelName' (by applying it's required fields, if any)
    mkSpecialModelName
      :: SpecialModelName
    mkSpecialModelName =
      SpecialModelName
      { specialModelNameSpecialPropertyName = Nothing
      }

    -- ** Tag
    -- | Tag
    data Tag = Tag
      { tagId :: !(Maybe Integer) -- ^ "id"
      , tagName :: !(Maybe Text) -- ^ "name"
      } deriving (P.Show, P.Eq, P.Typeable)

    -- | FromJSON Tag
    instance A.FromJSON Tag where
      parseJSON = A.withObject "Tag" $ \o ->
        Tag
          <$> (o .:? "id")
          <*> (o .:? "name")

    -- | ToJSON Tag
    instance A.ToJSON Tag where
      toJSON Tag {..} =
       _omitNulls
          [ "id" .= tagId
          , "name" .= tagName
          ]

    -- | Construct a value of type 'Tag' (by applying it's required fields, if any)
    mkTag
      :: Tag
    mkTag =
      Tag
      { tagId = Nothing
      , tagName = Nothing
      }

    -- ** User
    -- | User
    data User = User
      { userId :: !(Maybe Integer) -- ^ "id"
      , userUsername :: !(Maybe Text) -- ^ "username"
      , userFirstName :: !(Maybe Text) -- ^ "firstName"
      , userLastName :: !(Maybe Text) -- ^ "lastName"
      , userEmail :: !(Maybe Text) -- ^ "email"
      , userPassword :: !(Maybe Text) -- ^ "password"
      , userPhone :: !(Maybe Text) -- ^ "phone"
      , userUserStatus :: !(Maybe Int) -- ^ "userStatus" - User Status
      } deriving (P.Show, P.Eq, P.Typeable)

    -- | FromJSON User
    instance A.FromJSON User where
      parseJSON = A.withObject "User" $ \o ->
        User
          <$> (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
          ]

    -- | Construct a value of type 'User' (by applying it's required fields, if any)
    mkUser
      :: User
    mkUser =
      User
      { userId = Nothing
      , userUsername = Nothing
      , userFirstName = Nothing
      , userLastName = Nothing
      , userEmail = Nothing
      , userPassword = Nothing
      , userPhone = Nothing
      , 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
      }