{-# 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.EKS.Types.Taint where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.EKS.Types.TaintEffect
import qualified Amazonka.Prelude as Prelude
data Taint = Taint'
{
Taint -> Maybe TaintEffect
effect :: Prelude.Maybe TaintEffect,
Taint -> Maybe Text
key :: Prelude.Maybe Prelude.Text,
Taint -> Maybe Text
value :: Prelude.Maybe Prelude.Text
}
deriving (Taint -> Taint -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Taint -> Taint -> Bool
$c/= :: Taint -> Taint -> Bool
== :: Taint -> Taint -> Bool
$c== :: Taint -> Taint -> Bool
Prelude.Eq, ReadPrec [Taint]
ReadPrec Taint
Int -> ReadS Taint
ReadS [Taint]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Taint]
$creadListPrec :: ReadPrec [Taint]
readPrec :: ReadPrec Taint
$creadPrec :: ReadPrec Taint
readList :: ReadS [Taint]
$creadList :: ReadS [Taint]
readsPrec :: Int -> ReadS Taint
$creadsPrec :: Int -> ReadS Taint
Prelude.Read, Int -> Taint -> ShowS
[Taint] -> ShowS
Taint -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Taint] -> ShowS
$cshowList :: [Taint] -> ShowS
show :: Taint -> String
$cshow :: Taint -> String
showsPrec :: Int -> Taint -> ShowS
$cshowsPrec :: Int -> Taint -> ShowS
Prelude.Show, forall x. Rep Taint x -> Taint
forall x. Taint -> Rep Taint x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Taint x -> Taint
$cfrom :: forall x. Taint -> Rep Taint x
Prelude.Generic)
newTaint ::
Taint
newTaint :: Taint
newTaint =
Taint'
{ $sel:effect:Taint' :: Maybe TaintEffect
effect = forall a. Maybe a
Prelude.Nothing,
$sel:key:Taint' :: Maybe Text
key = forall a. Maybe a
Prelude.Nothing,
$sel:value:Taint' :: Maybe Text
value = forall a. Maybe a
Prelude.Nothing
}
taint_effect :: Lens.Lens' Taint (Prelude.Maybe TaintEffect)
taint_effect :: Lens' Taint (Maybe TaintEffect)
taint_effect = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Taint' {Maybe TaintEffect
effect :: Maybe TaintEffect
$sel:effect:Taint' :: Taint -> Maybe TaintEffect
effect} -> Maybe TaintEffect
effect) (\s :: Taint
s@Taint' {} Maybe TaintEffect
a -> Taint
s {$sel:effect:Taint' :: Maybe TaintEffect
effect = Maybe TaintEffect
a} :: Taint)
taint_key :: Lens.Lens' Taint (Prelude.Maybe Prelude.Text)
taint_key :: Lens' Taint (Maybe Text)
taint_key = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Taint' {Maybe Text
key :: Maybe Text
$sel:key:Taint' :: Taint -> Maybe Text
key} -> Maybe Text
key) (\s :: Taint
s@Taint' {} Maybe Text
a -> Taint
s {$sel:key:Taint' :: Maybe Text
key = Maybe Text
a} :: Taint)
taint_value :: Lens.Lens' Taint (Prelude.Maybe Prelude.Text)
taint_value :: Lens' Taint (Maybe Text)
taint_value = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Taint' {Maybe Text
value :: Maybe Text
$sel:value:Taint' :: Taint -> Maybe Text
value} -> Maybe Text
value) (\s :: Taint
s@Taint' {} Maybe Text
a -> Taint
s {$sel:value:Taint' :: Maybe Text
value = Maybe Text
a} :: Taint)
instance Data.FromJSON Taint where
parseJSON :: Value -> Parser Taint
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"Taint"
( \Object
x ->
Maybe TaintEffect -> Maybe Text -> Maybe Text -> Taint
Taint'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"effect")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"key")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"value")
)
instance Prelude.Hashable Taint where
hashWithSalt :: Int -> Taint -> Int
hashWithSalt Int
_salt Taint' {Maybe Text
Maybe TaintEffect
value :: Maybe Text
key :: Maybe Text
effect :: Maybe TaintEffect
$sel:value:Taint' :: Taint -> Maybe Text
$sel:key:Taint' :: Taint -> Maybe Text
$sel:effect:Taint' :: Taint -> Maybe TaintEffect
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe TaintEffect
effect
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
key
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
value
instance Prelude.NFData Taint where
rnf :: Taint -> ()
rnf Taint' {Maybe Text
Maybe TaintEffect
value :: Maybe Text
key :: Maybe Text
effect :: Maybe TaintEffect
$sel:value:Taint' :: Taint -> Maybe Text
$sel:key:Taint' :: Taint -> Maybe Text
$sel:effect:Taint' :: Taint -> Maybe TaintEffect
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe TaintEffect
effect
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
key
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
value
instance Data.ToJSON Taint where
toJSON :: Taint -> Value
toJSON Taint' {Maybe Text
Maybe TaintEffect
value :: Maybe Text
key :: Maybe Text
effect :: Maybe TaintEffect
$sel:value:Taint' :: Taint -> Maybe Text
$sel:key:Taint' :: Taint -> Maybe Text
$sel:effect:Taint' :: Taint -> Maybe TaintEffect
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"effect" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe TaintEffect
effect,
(Key
"key" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
key,
(Key
"value" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
value
]
)