{-# 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.Provider where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Provider = Provider'
{
Provider -> Maybe Text
keyArn :: Prelude.Maybe Prelude.Text
}
deriving (Provider -> Provider -> Bool
(Provider -> Provider -> Bool)
-> (Provider -> Provider -> Bool) -> Eq Provider
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Provider -> Provider -> Bool
$c/= :: Provider -> Provider -> Bool
== :: Provider -> Provider -> Bool
$c== :: Provider -> Provider -> Bool
Prelude.Eq, ReadPrec [Provider]
ReadPrec Provider
Int -> ReadS Provider
ReadS [Provider]
(Int -> ReadS Provider)
-> ReadS [Provider]
-> ReadPrec Provider
-> ReadPrec [Provider]
-> Read Provider
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Provider]
$creadListPrec :: ReadPrec [Provider]
readPrec :: ReadPrec Provider
$creadPrec :: ReadPrec Provider
readList :: ReadS [Provider]
$creadList :: ReadS [Provider]
readsPrec :: Int -> ReadS Provider
$creadsPrec :: Int -> ReadS Provider
Prelude.Read, Int -> Provider -> ShowS
[Provider] -> ShowS
Provider -> String
(Int -> Provider -> ShowS)
-> (Provider -> String) -> ([Provider] -> ShowS) -> Show Provider
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Provider] -> ShowS
$cshowList :: [Provider] -> ShowS
show :: Provider -> String
$cshow :: Provider -> String
showsPrec :: Int -> Provider -> ShowS
$cshowsPrec :: Int -> Provider -> ShowS
Prelude.Show, (forall x. Provider -> Rep Provider x)
-> (forall x. Rep Provider x -> Provider) -> Generic Provider
forall x. Rep Provider x -> Provider
forall x. Provider -> Rep Provider x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Provider x -> Provider
$cfrom :: forall x. Provider -> Rep Provider x
Prelude.Generic)
newProvider ::
Provider
newProvider :: Provider
newProvider = Provider' :: Maybe Text -> Provider
Provider' {$sel:keyArn:Provider' :: Maybe Text
keyArn = Maybe Text
forall a. Maybe a
Prelude.Nothing}
provider_keyArn :: Lens.Lens' Provider (Prelude.Maybe Prelude.Text)
provider_keyArn :: (Maybe Text -> f (Maybe Text)) -> Provider -> f Provider
provider_keyArn = (Provider -> Maybe Text)
-> (Provider -> Maybe Text -> Provider)
-> Lens Provider Provider (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Provider' {Maybe Text
keyArn :: Maybe Text
$sel:keyArn:Provider' :: Provider -> Maybe Text
keyArn} -> Maybe Text
keyArn) (\s :: Provider
s@Provider' {} Maybe Text
a -> Provider
s {$sel:keyArn:Provider' :: Maybe Text
keyArn = Maybe Text
a} :: Provider)
instance Core.FromJSON Provider where
parseJSON :: Value -> Parser Provider
parseJSON =
String -> (Object -> Parser Provider) -> Value -> Parser Provider
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Provider"
(\Object
x -> Maybe Text -> Provider
Provider' (Maybe Text -> Provider) -> Parser (Maybe Text) -> Parser Provider
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
"keyArn"))
instance Prelude.Hashable Provider
instance Prelude.NFData Provider
instance Core.ToJSON Provider where
toJSON :: Provider -> Value
toJSON Provider' {Maybe Text
keyArn :: Maybe Text
$sel:keyArn:Provider' :: Provider -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[(Text
"keyArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
keyArn]
)