{-# 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.AddonInfo where
import qualified Amazonka.Core as Core
import Amazonka.EKS.Types.AddonVersionInfo
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data AddonInfo = AddonInfo'
{
AddonInfo -> Maybe Text
addonName :: Prelude.Maybe Prelude.Text,
AddonInfo -> Maybe Text
type' :: Prelude.Maybe Prelude.Text,
AddonInfo -> Maybe [AddonVersionInfo]
addonVersions :: Prelude.Maybe [AddonVersionInfo]
}
deriving (AddonInfo -> AddonInfo -> Bool
(AddonInfo -> AddonInfo -> Bool)
-> (AddonInfo -> AddonInfo -> Bool) -> Eq AddonInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AddonInfo -> AddonInfo -> Bool
$c/= :: AddonInfo -> AddonInfo -> Bool
== :: AddonInfo -> AddonInfo -> Bool
$c== :: AddonInfo -> AddonInfo -> Bool
Prelude.Eq, ReadPrec [AddonInfo]
ReadPrec AddonInfo
Int -> ReadS AddonInfo
ReadS [AddonInfo]
(Int -> ReadS AddonInfo)
-> ReadS [AddonInfo]
-> ReadPrec AddonInfo
-> ReadPrec [AddonInfo]
-> Read AddonInfo
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AddonInfo]
$creadListPrec :: ReadPrec [AddonInfo]
readPrec :: ReadPrec AddonInfo
$creadPrec :: ReadPrec AddonInfo
readList :: ReadS [AddonInfo]
$creadList :: ReadS [AddonInfo]
readsPrec :: Int -> ReadS AddonInfo
$creadsPrec :: Int -> ReadS AddonInfo
Prelude.Read, Int -> AddonInfo -> ShowS
[AddonInfo] -> ShowS
AddonInfo -> String
(Int -> AddonInfo -> ShowS)
-> (AddonInfo -> String)
-> ([AddonInfo] -> ShowS)
-> Show AddonInfo
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AddonInfo] -> ShowS
$cshowList :: [AddonInfo] -> ShowS
show :: AddonInfo -> String
$cshow :: AddonInfo -> String
showsPrec :: Int -> AddonInfo -> ShowS
$cshowsPrec :: Int -> AddonInfo -> ShowS
Prelude.Show, (forall x. AddonInfo -> Rep AddonInfo x)
-> (forall x. Rep AddonInfo x -> AddonInfo) -> Generic AddonInfo
forall x. Rep AddonInfo x -> AddonInfo
forall x. AddonInfo -> Rep AddonInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AddonInfo x -> AddonInfo
$cfrom :: forall x. AddonInfo -> Rep AddonInfo x
Prelude.Generic)
newAddonInfo ::
AddonInfo
newAddonInfo :: AddonInfo
newAddonInfo =
AddonInfo' :: Maybe Text -> Maybe Text -> Maybe [AddonVersionInfo] -> AddonInfo
AddonInfo'
{ $sel:addonName:AddonInfo' :: Maybe Text
addonName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:type':AddonInfo' :: Maybe Text
type' = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:addonVersions:AddonInfo' :: Maybe [AddonVersionInfo]
addonVersions = Maybe [AddonVersionInfo]
forall a. Maybe a
Prelude.Nothing
}
addonInfo_addonName :: Lens.Lens' AddonInfo (Prelude.Maybe Prelude.Text)
addonInfo_addonName :: (Maybe Text -> f (Maybe Text)) -> AddonInfo -> f AddonInfo
addonInfo_addonName = (AddonInfo -> Maybe Text)
-> (AddonInfo -> Maybe Text -> AddonInfo)
-> Lens AddonInfo AddonInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AddonInfo' {Maybe Text
addonName :: Maybe Text
$sel:addonName:AddonInfo' :: AddonInfo -> Maybe Text
addonName} -> Maybe Text
addonName) (\s :: AddonInfo
s@AddonInfo' {} Maybe Text
a -> AddonInfo
s {$sel:addonName:AddonInfo' :: Maybe Text
addonName = Maybe Text
a} :: AddonInfo)
addonInfo_type :: Lens.Lens' AddonInfo (Prelude.Maybe Prelude.Text)
addonInfo_type :: (Maybe Text -> f (Maybe Text)) -> AddonInfo -> f AddonInfo
addonInfo_type = (AddonInfo -> Maybe Text)
-> (AddonInfo -> Maybe Text -> AddonInfo)
-> Lens AddonInfo AddonInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AddonInfo' {Maybe Text
type' :: Maybe Text
$sel:type':AddonInfo' :: AddonInfo -> Maybe Text
type'} -> Maybe Text
type') (\s :: AddonInfo
s@AddonInfo' {} Maybe Text
a -> AddonInfo
s {$sel:type':AddonInfo' :: Maybe Text
type' = Maybe Text
a} :: AddonInfo)
addonInfo_addonVersions :: Lens.Lens' AddonInfo (Prelude.Maybe [AddonVersionInfo])
addonInfo_addonVersions :: (Maybe [AddonVersionInfo] -> f (Maybe [AddonVersionInfo]))
-> AddonInfo -> f AddonInfo
addonInfo_addonVersions = (AddonInfo -> Maybe [AddonVersionInfo])
-> (AddonInfo -> Maybe [AddonVersionInfo] -> AddonInfo)
-> Lens
AddonInfo
AddonInfo
(Maybe [AddonVersionInfo])
(Maybe [AddonVersionInfo])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AddonInfo' {Maybe [AddonVersionInfo]
addonVersions :: Maybe [AddonVersionInfo]
$sel:addonVersions:AddonInfo' :: AddonInfo -> Maybe [AddonVersionInfo]
addonVersions} -> Maybe [AddonVersionInfo]
addonVersions) (\s :: AddonInfo
s@AddonInfo' {} Maybe [AddonVersionInfo]
a -> AddonInfo
s {$sel:addonVersions:AddonInfo' :: Maybe [AddonVersionInfo]
addonVersions = Maybe [AddonVersionInfo]
a} :: AddonInfo) ((Maybe [AddonVersionInfo] -> f (Maybe [AddonVersionInfo]))
-> AddonInfo -> f AddonInfo)
-> ((Maybe [AddonVersionInfo] -> f (Maybe [AddonVersionInfo]))
-> Maybe [AddonVersionInfo] -> f (Maybe [AddonVersionInfo]))
-> (Maybe [AddonVersionInfo] -> f (Maybe [AddonVersionInfo]))
-> AddonInfo
-> f AddonInfo
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[AddonVersionInfo]
[AddonVersionInfo]
[AddonVersionInfo]
[AddonVersionInfo]
-> Iso
(Maybe [AddonVersionInfo])
(Maybe [AddonVersionInfo])
(Maybe [AddonVersionInfo])
(Maybe [AddonVersionInfo])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
[AddonVersionInfo]
[AddonVersionInfo]
[AddonVersionInfo]
[AddonVersionInfo]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.FromJSON AddonInfo where
parseJSON :: Value -> Parser AddonInfo
parseJSON =
String -> (Object -> Parser AddonInfo) -> Value -> Parser AddonInfo
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"AddonInfo"
( \Object
x ->
Maybe Text -> Maybe Text -> Maybe [AddonVersionInfo] -> AddonInfo
AddonInfo'
(Maybe Text -> Maybe Text -> Maybe [AddonVersionInfo] -> AddonInfo)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe [AddonVersionInfo] -> AddonInfo)
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
"addonName")
Parser (Maybe Text -> Maybe [AddonVersionInfo] -> AddonInfo)
-> Parser (Maybe Text)
-> Parser (Maybe [AddonVersionInfo] -> AddonInfo)
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
"type")
Parser (Maybe [AddonVersionInfo] -> AddonInfo)
-> Parser (Maybe [AddonVersionInfo]) -> Parser AddonInfo
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [AddonVersionInfo]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"addonVersions" Parser (Maybe (Maybe [AddonVersionInfo]))
-> Maybe [AddonVersionInfo] -> Parser (Maybe [AddonVersionInfo])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [AddonVersionInfo]
forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable AddonInfo
instance Prelude.NFData AddonInfo