{-# 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.Shield.Types.Contributor where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Contributor = Contributor'
{
Contributor -> Maybe Integer
value :: Prelude.Maybe Prelude.Integer,
Contributor -> Maybe Text
name :: Prelude.Maybe Prelude.Text
}
deriving (Contributor -> Contributor -> Bool
(Contributor -> Contributor -> Bool)
-> (Contributor -> Contributor -> Bool) -> Eq Contributor
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Contributor -> Contributor -> Bool
$c/= :: Contributor -> Contributor -> Bool
== :: Contributor -> Contributor -> Bool
$c== :: Contributor -> Contributor -> Bool
Prelude.Eq, ReadPrec [Contributor]
ReadPrec Contributor
Int -> ReadS Contributor
ReadS [Contributor]
(Int -> ReadS Contributor)
-> ReadS [Contributor]
-> ReadPrec Contributor
-> ReadPrec [Contributor]
-> Read Contributor
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Contributor]
$creadListPrec :: ReadPrec [Contributor]
readPrec :: ReadPrec Contributor
$creadPrec :: ReadPrec Contributor
readList :: ReadS [Contributor]
$creadList :: ReadS [Contributor]
readsPrec :: Int -> ReadS Contributor
$creadsPrec :: Int -> ReadS Contributor
Prelude.Read, Int -> Contributor -> ShowS
[Contributor] -> ShowS
Contributor -> String
(Int -> Contributor -> ShowS)
-> (Contributor -> String)
-> ([Contributor] -> ShowS)
-> Show Contributor
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Contributor] -> ShowS
$cshowList :: [Contributor] -> ShowS
show :: Contributor -> String
$cshow :: Contributor -> String
showsPrec :: Int -> Contributor -> ShowS
$cshowsPrec :: Int -> Contributor -> ShowS
Prelude.Show, (forall x. Contributor -> Rep Contributor x)
-> (forall x. Rep Contributor x -> Contributor)
-> Generic Contributor
forall x. Rep Contributor x -> Contributor
forall x. Contributor -> Rep Contributor x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Contributor x -> Contributor
$cfrom :: forall x. Contributor -> Rep Contributor x
Prelude.Generic)
newContributor ::
Contributor
newContributor :: Contributor
newContributor =
Contributor' :: Maybe Integer -> Maybe Text -> Contributor
Contributor'
{ $sel:value:Contributor' :: Maybe Integer
value = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
$sel:name:Contributor' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
contributor_value :: Lens.Lens' Contributor (Prelude.Maybe Prelude.Integer)
contributor_value :: (Maybe Integer -> f (Maybe Integer))
-> Contributor -> f Contributor
contributor_value = (Contributor -> Maybe Integer)
-> (Contributor -> Maybe Integer -> Contributor)
-> Lens Contributor Contributor (Maybe Integer) (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Contributor' {Maybe Integer
value :: Maybe Integer
$sel:value:Contributor' :: Contributor -> Maybe Integer
value} -> Maybe Integer
value) (\s :: Contributor
s@Contributor' {} Maybe Integer
a -> Contributor
s {$sel:value:Contributor' :: Maybe Integer
value = Maybe Integer
a} :: Contributor)
contributor_name :: Lens.Lens' Contributor (Prelude.Maybe Prelude.Text)
contributor_name :: (Maybe Text -> f (Maybe Text)) -> Contributor -> f Contributor
contributor_name = (Contributor -> Maybe Text)
-> (Contributor -> Maybe Text -> Contributor)
-> Lens Contributor Contributor (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Contributor' {Maybe Text
name :: Maybe Text
$sel:name:Contributor' :: Contributor -> Maybe Text
name} -> Maybe Text
name) (\s :: Contributor
s@Contributor' {} Maybe Text
a -> Contributor
s {$sel:name:Contributor' :: Maybe Text
name = Maybe Text
a} :: Contributor)
instance Core.FromJSON Contributor where
parseJSON :: Value -> Parser Contributor
parseJSON =
String
-> (Object -> Parser Contributor) -> Value -> Parser Contributor
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Contributor"
( \Object
x ->
Maybe Integer -> Maybe Text -> Contributor
Contributor'
(Maybe Integer -> Maybe Text -> Contributor)
-> Parser (Maybe Integer) -> Parser (Maybe Text -> Contributor)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Value") Parser (Maybe Text -> Contributor)
-> Parser (Maybe Text) -> Parser Contributor
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")
)
instance Prelude.Hashable Contributor
instance Prelude.NFData Contributor