{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.APIGateway.Types.Model where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Model = Model'
{
Model -> Maybe Text
schema :: Prelude.Maybe Prelude.Text,
Model -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
Model -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
Model -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
Model -> Maybe Text
contentType :: Prelude.Maybe Prelude.Text
}
deriving (Model -> Model -> Bool
(Model -> Model -> Bool) -> (Model -> Model -> Bool) -> Eq Model
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Model -> Model -> Bool
$c/= :: Model -> Model -> Bool
== :: Model -> Model -> Bool
$c== :: Model -> Model -> Bool
Prelude.Eq, ReadPrec [Model]
ReadPrec Model
Int -> ReadS Model
ReadS [Model]
(Int -> ReadS Model)
-> ReadS [Model]
-> ReadPrec Model
-> ReadPrec [Model]
-> Read Model
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Model]
$creadListPrec :: ReadPrec [Model]
readPrec :: ReadPrec Model
$creadPrec :: ReadPrec Model
readList :: ReadS [Model]
$creadList :: ReadS [Model]
readsPrec :: Int -> ReadS Model
$creadsPrec :: Int -> ReadS Model
Prelude.Read, Int -> Model -> ShowS
[Model] -> ShowS
Model -> String
(Int -> Model -> ShowS)
-> (Model -> String) -> ([Model] -> ShowS) -> Show Model
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Model] -> ShowS
$cshowList :: [Model] -> ShowS
show :: Model -> String
$cshow :: Model -> String
showsPrec :: Int -> Model -> ShowS
$cshowsPrec :: Int -> Model -> ShowS
Prelude.Show, (forall x. Model -> Rep Model x)
-> (forall x. Rep Model x -> Model) -> Generic Model
forall x. Rep Model x -> Model
forall x. Model -> Rep Model x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Model x -> Model
$cfrom :: forall x. Model -> Rep Model x
Prelude.Generic)
newModel ::
Model
newModel :: Model
newModel =
Model' :: Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Model
Model'
{ $sel:schema:Model' :: Maybe Text
schema = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:name:Model' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:id:Model' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:description:Model' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:contentType:Model' :: Maybe Text
contentType = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
model_schema :: Lens.Lens' Model (Prelude.Maybe Prelude.Text)
model_schema :: (Maybe Text -> f (Maybe Text)) -> Model -> f Model
model_schema = (Model -> Maybe Text)
-> (Model -> Maybe Text -> Model)
-> Lens Model Model (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Model' {Maybe Text
schema :: Maybe Text
$sel:schema:Model' :: Model -> Maybe Text
schema} -> Maybe Text
schema) (\s :: Model
s@Model' {} Maybe Text
a -> Model
s {$sel:schema:Model' :: Maybe Text
schema = Maybe Text
a} :: Model)
model_name :: Lens.Lens' Model (Prelude.Maybe Prelude.Text)
model_name :: (Maybe Text -> f (Maybe Text)) -> Model -> f Model
model_name = (Model -> Maybe Text)
-> (Model -> Maybe Text -> Model)
-> Lens Model Model (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Model' {Maybe Text
name :: Maybe Text
$sel:name:Model' :: Model -> Maybe Text
name} -> Maybe Text
name) (\s :: Model
s@Model' {} Maybe Text
a -> Model
s {$sel:name:Model' :: Maybe Text
name = Maybe Text
a} :: Model)
model_id :: Lens.Lens' Model (Prelude.Maybe Prelude.Text)
model_id :: (Maybe Text -> f (Maybe Text)) -> Model -> f Model
model_id = (Model -> Maybe Text)
-> (Model -> Maybe Text -> Model)
-> Lens Model Model (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Model' {Maybe Text
id :: Maybe Text
$sel:id:Model' :: Model -> Maybe Text
id} -> Maybe Text
id) (\s :: Model
s@Model' {} Maybe Text
a -> Model
s {$sel:id:Model' :: Maybe Text
id = Maybe Text
a} :: Model)
model_description :: Lens.Lens' Model (Prelude.Maybe Prelude.Text)
model_description :: (Maybe Text -> f (Maybe Text)) -> Model -> f Model
model_description = (Model -> Maybe Text)
-> (Model -> Maybe Text -> Model)
-> Lens Model Model (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Model' {Maybe Text
description :: Maybe Text
$sel:description:Model' :: Model -> Maybe Text
description} -> Maybe Text
description) (\s :: Model
s@Model' {} Maybe Text
a -> Model
s {$sel:description:Model' :: Maybe Text
description = Maybe Text
a} :: Model)
model_contentType :: Lens.Lens' Model (Prelude.Maybe Prelude.Text)
model_contentType :: (Maybe Text -> f (Maybe Text)) -> Model -> f Model
model_contentType = (Model -> Maybe Text)
-> (Model -> Maybe Text -> Model)
-> Lens Model Model (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Model' {Maybe Text
contentType :: Maybe Text
$sel:contentType:Model' :: Model -> Maybe Text
contentType} -> Maybe Text
contentType) (\s :: Model
s@Model' {} Maybe Text
a -> Model
s {$sel:contentType:Model' :: Maybe Text
contentType = Maybe Text
a} :: Model)
instance Core.FromJSON Model where
parseJSON :: Value -> Parser Model
parseJSON =
String -> (Object -> Parser Model) -> Value -> Parser Model
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Model"
( \Object
x ->
Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Model
Model'
(Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Model)
-> Parser (Maybe Text)
-> Parser
(Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Model)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"schema")
Parser
(Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Model)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> Maybe Text -> Model)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"name")
Parser (Maybe Text -> Maybe Text -> Maybe Text -> Model)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> Model)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"id")
Parser (Maybe Text -> Maybe Text -> Model)
-> Parser (Maybe Text) -> Parser (Maybe Text -> Model)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"description")
Parser (Maybe Text -> Model) -> Parser (Maybe Text) -> Parser Model
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"contentType")
)
instance Prelude.Hashable Model
instance Prelude.NFData Model