-- CHANGE WITH CAUTION: This is a generated code file generated by https://github.com/Haskell-OpenAPI-Code-Generator/Haskell-OpenAPI-Client-Code-Generator.

{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE MultiWayIf #-}

-- | Contains the types generated from the schema Dog
module OpenAPI.Types.Dog where

import qualified Prelude as GHC.Integer.Type
import qualified Prelude as GHC.Maybe
import qualified Control.Monad.Fail
import qualified Data.Aeson
import qualified Data.Aeson as Data.Aeson.Encoding.Internal
import qualified Data.Aeson as Data.Aeson.Types
import qualified Data.Aeson as Data.Aeson.Types.FromJSON
import qualified Data.Aeson as Data.Aeson.Types.ToJSON
import qualified Data.Aeson as Data.Aeson.Types.Internal
import qualified Data.ByteString
import qualified Data.ByteString as Data.ByteString.Internal
import qualified Data.Foldable
import qualified Data.Functor
import qualified Data.Maybe
import qualified Data.Scientific
import qualified Data.Text
import qualified Data.Text as Data.Text.Internal
import qualified Data.Time.Calendar as Data.Time.Calendar.Days
import qualified Data.Time.LocalTime as Data.Time.LocalTime.Internal.ZonedTime
import qualified GHC.Base
import qualified GHC.Classes
import qualified GHC.Int
import qualified GHC.Show
import qualified GHC.Types
import qualified OpenAPI.Common
import OpenAPI.TypeAlias

-- | Defines the object schema located at @components.schemas.Dog@ in the specification.
-- 
-- 
data Dog = Dog {
  -- | bark
  dogBark :: (GHC.Maybe.Maybe GHC.Types.Bool)
  -- | binary
  , dogBinary :: (GHC.Maybe.Maybe OpenAPI.Common.JsonByteString)
  -- | breed
  , dogBreed :: (GHC.Maybe.Maybe DogBreed)
  -- | byte
  , dogByte :: (GHC.Maybe.Maybe OpenAPI.Common.JsonByteString)
  -- | double
  , dogDouble :: (GHC.Maybe.Maybe GHC.Types.Double)
  -- | father
  , dogFather :: (GHC.Maybe.Maybe Data.Aeson.Types.Internal.Object)
  -- | float
  -- 
  -- Constraints:
  -- 
  -- * Must be a multiple of 1.0e-2
  , dogFloat :: (GHC.Maybe.Maybe GHC.Types.Float)
  -- | int32
  , dogInt32 :: (GHC.Maybe.Maybe GHC.Int.Int32)
  -- | int64
  -- 
  -- Constraints:
  -- 
  -- * Must be a multiple of 4.0
  , dogInt64 :: (GHC.Maybe.Maybe GHC.Int.Int64)
  -- | integer
  , dogInteger :: (GHC.Maybe.Maybe GHC.Types.Int)
  -- | number
  , dogNumber :: (GHC.Maybe.Maybe GHC.Types.Double)
  -- | pet_type
  , dogPet_type :: (GHC.Maybe.Maybe Data.Aeson.Types.Internal.Object)
  -- | secondFather
  , dogSecondFather :: (GHC.Maybe.Maybe Data.Aeson.Types.Internal.Object)
  -- | str
  -- 
  -- Constraints:
  -- 
  -- * Maximum length of 244
  -- * Minimum length of 100
  , dogStr :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
  -- | strDate
  , dogStrDate :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
  -- | strDateTime
  , dogStrDateTime :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
  -- | tags
  , dogTags :: (GHC.Maybe.Maybe [Data.Text.Internal.Text])
  } deriving (GHC.Show.Show
  , GHC.Classes.Eq)
instance Data.Aeson.Types.ToJSON.ToJSON Dog
    where {toJSON obj = Data.Aeson.Types.Internal.object (Data.Foldable.concat (Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("bark" Data.Aeson.Types.ToJSON..=)) (dogBark obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("binary" Data.Aeson.Types.ToJSON..=)) (dogBinary obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("breed" Data.Aeson.Types.ToJSON..=)) (dogBreed obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("byte" Data.Aeson.Types.ToJSON..=)) (dogByte obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("double" Data.Aeson.Types.ToJSON..=)) (dogDouble obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("father" Data.Aeson.Types.ToJSON..=)) (dogFather obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("float" Data.Aeson.Types.ToJSON..=)) (dogFloat obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("int32" Data.Aeson.Types.ToJSON..=)) (dogInt32 obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("int64" Data.Aeson.Types.ToJSON..=)) (dogInt64 obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("integer" Data.Aeson.Types.ToJSON..=)) (dogInteger obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("number" Data.Aeson.Types.ToJSON..=)) (dogNumber obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("pet_type" Data.Aeson.Types.ToJSON..=)) (dogPet_type obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("secondFather" Data.Aeson.Types.ToJSON..=)) (dogSecondFather obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("str" Data.Aeson.Types.ToJSON..=)) (dogStr obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("strDate" Data.Aeson.Types.ToJSON..=)) (dogStrDate obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("strDateTime" Data.Aeson.Types.ToJSON..=)) (dogStrDateTime obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("tags" Data.Aeson.Types.ToJSON..=)) (dogTags obj) : GHC.Base.mempty));
           toEncoding obj = Data.Aeson.Encoding.Internal.pairs (GHC.Base.mconcat (Data.Foldable.concat (Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("bark" Data.Aeson.Types.ToJSON..=)) (dogBark obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("binary" Data.Aeson.Types.ToJSON..=)) (dogBinary obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("breed" Data.Aeson.Types.ToJSON..=)) (dogBreed obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("byte" Data.Aeson.Types.ToJSON..=)) (dogByte obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("double" Data.Aeson.Types.ToJSON..=)) (dogDouble obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("father" Data.Aeson.Types.ToJSON..=)) (dogFather obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("float" Data.Aeson.Types.ToJSON..=)) (dogFloat obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("int32" Data.Aeson.Types.ToJSON..=)) (dogInt32 obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("int64" Data.Aeson.Types.ToJSON..=)) (dogInt64 obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("integer" Data.Aeson.Types.ToJSON..=)) (dogInteger obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("number" Data.Aeson.Types.ToJSON..=)) (dogNumber obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("pet_type" Data.Aeson.Types.ToJSON..=)) (dogPet_type obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("secondFather" Data.Aeson.Types.ToJSON..=)) (dogSecondFather obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("str" Data.Aeson.Types.ToJSON..=)) (dogStr obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("strDate" Data.Aeson.Types.ToJSON..=)) (dogStrDate obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("strDateTime" Data.Aeson.Types.ToJSON..=)) (dogStrDateTime obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("tags" Data.Aeson.Types.ToJSON..=)) (dogTags obj) : GHC.Base.mempty)))}
instance Data.Aeson.Types.FromJSON.FromJSON Dog
    where {parseJSON = Data.Aeson.Types.FromJSON.withObject "Dog" (\obj -> ((((((((((((((((GHC.Base.pure Dog GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "bark")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "binary")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "breed")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "byte")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "double")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "father")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "float")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "int32")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "int64")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "integer")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "number")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "pet_type")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "secondFather")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "str")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "strDate")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "strDateTime")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "tags"))}
-- | Create a new 'Dog' with all required fields.
mkDog :: Dog
mkDog = Dog{dogBark = GHC.Maybe.Nothing,
            dogBinary = GHC.Maybe.Nothing,
            dogBreed = GHC.Maybe.Nothing,
            dogByte = GHC.Maybe.Nothing,
            dogDouble = GHC.Maybe.Nothing,
            dogFather = GHC.Maybe.Nothing,
            dogFloat = GHC.Maybe.Nothing,
            dogInt32 = GHC.Maybe.Nothing,
            dogInt64 = GHC.Maybe.Nothing,
            dogInteger = GHC.Maybe.Nothing,
            dogNumber = GHC.Maybe.Nothing,
            dogPet_type = GHC.Maybe.Nothing,
            dogSecondFather = GHC.Maybe.Nothing,
            dogStr = GHC.Maybe.Nothing,
            dogStrDate = GHC.Maybe.Nothing,
            dogStrDateTime = GHC.Maybe.Nothing,
            dogTags = GHC.Maybe.Nothing}
-- | Defines the enum schema located at @components.schemas.Dog.properties.breed@ in the specification.
-- 
-- 
data DogBreed =
   DogBreedOther Data.Aeson.Types.Internal.Value -- ^ This case is used if the value encountered during decoding does not match any of the provided cases in the specification.
  | DogBreedTyped Data.Text.Internal.Text -- ^ This constructor can be used to send values to the server which are not present in the specification yet.
  | DogBreedEnumDingo -- ^ Represents the JSON value @"Dingo"@
  | DogBreedEnumHusky -- ^ Represents the JSON value @"Husky"@
  | DogBreedEnumRetriever -- ^ Represents the JSON value @"Retriever"@
  | DogBreedEnumShepherd -- ^ Represents the JSON value @"Shepherd"@
  deriving (GHC.Show.Show, GHC.Classes.Eq)
instance Data.Aeson.Types.ToJSON.ToJSON DogBreed
    where {toJSON (DogBreedOther val) = val;
           toJSON (DogBreedTyped val) = Data.Aeson.Types.ToJSON.toJSON val;
           toJSON (DogBreedEnumDingo) = "Dingo";
           toJSON (DogBreedEnumHusky) = "Husky";
           toJSON (DogBreedEnumRetriever) = "Retriever";
           toJSON (DogBreedEnumShepherd) = "Shepherd"}
instance Data.Aeson.Types.FromJSON.FromJSON DogBreed
    where {parseJSON val = GHC.Base.pure (if | val GHC.Classes.== "Dingo" -> DogBreedEnumDingo
                                             | val GHC.Classes.== "Husky" -> DogBreedEnumHusky
                                             | val GHC.Classes.== "Retriever" -> DogBreedEnumRetriever
                                             | val GHC.Classes.== "Shepherd" -> DogBreedEnumShepherd
                                             | GHC.Base.otherwise -> DogBreedOther val)}
