{-# 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.Update where
import qualified Amazonka.Core as Core
import Amazonka.EKS.Types.ErrorDetail
import Amazonka.EKS.Types.UpdateParam
import Amazonka.EKS.Types.UpdateStatus
import Amazonka.EKS.Types.UpdateType
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Update = Update'
{
Update -> Maybe UpdateStatus
status :: Prelude.Maybe UpdateStatus,
Update -> Maybe POSIX
createdAt :: Prelude.Maybe Core.POSIX,
Update -> Maybe [UpdateParam]
params :: Prelude.Maybe [UpdateParam],
Update -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
Update -> Maybe UpdateType
type' :: Prelude.Maybe UpdateType,
Update -> Maybe [ErrorDetail]
errors :: Prelude.Maybe [ErrorDetail]
}
deriving (Update -> Update -> Bool
(Update -> Update -> Bool)
-> (Update -> Update -> Bool) -> Eq Update
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Update -> Update -> Bool
$c/= :: Update -> Update -> Bool
== :: Update -> Update -> Bool
$c== :: Update -> Update -> Bool
Prelude.Eq, ReadPrec [Update]
ReadPrec Update
Int -> ReadS Update
ReadS [Update]
(Int -> ReadS Update)
-> ReadS [Update]
-> ReadPrec Update
-> ReadPrec [Update]
-> Read Update
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Update]
$creadListPrec :: ReadPrec [Update]
readPrec :: ReadPrec Update
$creadPrec :: ReadPrec Update
readList :: ReadS [Update]
$creadList :: ReadS [Update]
readsPrec :: Int -> ReadS Update
$creadsPrec :: Int -> ReadS Update
Prelude.Read, Int -> Update -> ShowS
[Update] -> ShowS
Update -> String
(Int -> Update -> ShowS)
-> (Update -> String) -> ([Update] -> ShowS) -> Show Update
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Update] -> ShowS
$cshowList :: [Update] -> ShowS
show :: Update -> String
$cshow :: Update -> String
showsPrec :: Int -> Update -> ShowS
$cshowsPrec :: Int -> Update -> ShowS
Prelude.Show, (forall x. Update -> Rep Update x)
-> (forall x. Rep Update x -> Update) -> Generic Update
forall x. Rep Update x -> Update
forall x. Update -> Rep Update x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Update x -> Update
$cfrom :: forall x. Update -> Rep Update x
Prelude.Generic)
newUpdate ::
Update
newUpdate :: Update
newUpdate =
Update' :: Maybe UpdateStatus
-> Maybe POSIX
-> Maybe [UpdateParam]
-> Maybe Text
-> Maybe UpdateType
-> Maybe [ErrorDetail]
-> Update
Update'
{ $sel:status:Update' :: Maybe UpdateStatus
status = Maybe UpdateStatus
forall a. Maybe a
Prelude.Nothing,
$sel:createdAt:Update' :: Maybe POSIX
createdAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:params:Update' :: Maybe [UpdateParam]
params = Maybe [UpdateParam]
forall a. Maybe a
Prelude.Nothing,
$sel:id:Update' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:type':Update' :: Maybe UpdateType
type' = Maybe UpdateType
forall a. Maybe a
Prelude.Nothing,
$sel:errors:Update' :: Maybe [ErrorDetail]
errors = Maybe [ErrorDetail]
forall a. Maybe a
Prelude.Nothing
}
update_status :: Lens.Lens' Update (Prelude.Maybe UpdateStatus)
update_status :: (Maybe UpdateStatus -> f (Maybe UpdateStatus))
-> Update -> f Update
update_status = (Update -> Maybe UpdateStatus)
-> (Update -> Maybe UpdateStatus -> Update)
-> Lens Update Update (Maybe UpdateStatus) (Maybe UpdateStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Update' {Maybe UpdateStatus
status :: Maybe UpdateStatus
$sel:status:Update' :: Update -> Maybe UpdateStatus
status} -> Maybe UpdateStatus
status) (\s :: Update
s@Update' {} Maybe UpdateStatus
a -> Update
s {$sel:status:Update' :: Maybe UpdateStatus
status = Maybe UpdateStatus
a} :: Update)
update_createdAt :: Lens.Lens' Update (Prelude.Maybe Prelude.UTCTime)
update_createdAt :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Update -> f Update
update_createdAt = (Update -> Maybe POSIX)
-> (Update -> Maybe POSIX -> Update)
-> Lens Update Update (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Update' {Maybe POSIX
createdAt :: Maybe POSIX
$sel:createdAt:Update' :: Update -> Maybe POSIX
createdAt} -> Maybe POSIX
createdAt) (\s :: Update
s@Update' {} Maybe POSIX
a -> Update
s {$sel:createdAt:Update' :: Maybe POSIX
createdAt = Maybe POSIX
a} :: Update) ((Maybe POSIX -> f (Maybe POSIX)) -> Update -> f Update)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Update
-> f Update
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
update_params :: Lens.Lens' Update (Prelude.Maybe [UpdateParam])
update_params :: (Maybe [UpdateParam] -> f (Maybe [UpdateParam]))
-> Update -> f Update
update_params = (Update -> Maybe [UpdateParam])
-> (Update -> Maybe [UpdateParam] -> Update)
-> Lens Update Update (Maybe [UpdateParam]) (Maybe [UpdateParam])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Update' {Maybe [UpdateParam]
params :: Maybe [UpdateParam]
$sel:params:Update' :: Update -> Maybe [UpdateParam]
params} -> Maybe [UpdateParam]
params) (\s :: Update
s@Update' {} Maybe [UpdateParam]
a -> Update
s {$sel:params:Update' :: Maybe [UpdateParam]
params = Maybe [UpdateParam]
a} :: Update) ((Maybe [UpdateParam] -> f (Maybe [UpdateParam]))
-> Update -> f Update)
-> ((Maybe [UpdateParam] -> f (Maybe [UpdateParam]))
-> Maybe [UpdateParam] -> f (Maybe [UpdateParam]))
-> (Maybe [UpdateParam] -> f (Maybe [UpdateParam]))
-> Update
-> f Update
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [UpdateParam] [UpdateParam] [UpdateParam] [UpdateParam]
-> Iso
(Maybe [UpdateParam])
(Maybe [UpdateParam])
(Maybe [UpdateParam])
(Maybe [UpdateParam])
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 [UpdateParam] [UpdateParam] [UpdateParam] [UpdateParam]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
update_id :: Lens.Lens' Update (Prelude.Maybe Prelude.Text)
update_id :: (Maybe Text -> f (Maybe Text)) -> Update -> f Update
update_id = (Update -> Maybe Text)
-> (Update -> Maybe Text -> Update)
-> Lens Update Update (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Update' {Maybe Text
id :: Maybe Text
$sel:id:Update' :: Update -> Maybe Text
id} -> Maybe Text
id) (\s :: Update
s@Update' {} Maybe Text
a -> Update
s {$sel:id:Update' :: Maybe Text
id = Maybe Text
a} :: Update)
update_type :: Lens.Lens' Update (Prelude.Maybe UpdateType)
update_type :: (Maybe UpdateType -> f (Maybe UpdateType)) -> Update -> f Update
update_type = (Update -> Maybe UpdateType)
-> (Update -> Maybe UpdateType -> Update)
-> Lens Update Update (Maybe UpdateType) (Maybe UpdateType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Update' {Maybe UpdateType
type' :: Maybe UpdateType
$sel:type':Update' :: Update -> Maybe UpdateType
type'} -> Maybe UpdateType
type') (\s :: Update
s@Update' {} Maybe UpdateType
a -> Update
s {$sel:type':Update' :: Maybe UpdateType
type' = Maybe UpdateType
a} :: Update)
update_errors :: Lens.Lens' Update (Prelude.Maybe [ErrorDetail])
update_errors :: (Maybe [ErrorDetail] -> f (Maybe [ErrorDetail]))
-> Update -> f Update
update_errors = (Update -> Maybe [ErrorDetail])
-> (Update -> Maybe [ErrorDetail] -> Update)
-> Lens Update Update (Maybe [ErrorDetail]) (Maybe [ErrorDetail])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Update' {Maybe [ErrorDetail]
errors :: Maybe [ErrorDetail]
$sel:errors:Update' :: Update -> Maybe [ErrorDetail]
errors} -> Maybe [ErrorDetail]
errors) (\s :: Update
s@Update' {} Maybe [ErrorDetail]
a -> Update
s {$sel:errors:Update' :: Maybe [ErrorDetail]
errors = Maybe [ErrorDetail]
a} :: Update) ((Maybe [ErrorDetail] -> f (Maybe [ErrorDetail]))
-> Update -> f Update)
-> ((Maybe [ErrorDetail] -> f (Maybe [ErrorDetail]))
-> Maybe [ErrorDetail] -> f (Maybe [ErrorDetail]))
-> (Maybe [ErrorDetail] -> f (Maybe [ErrorDetail]))
-> Update
-> f Update
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [ErrorDetail] [ErrorDetail] [ErrorDetail] [ErrorDetail]
-> Iso
(Maybe [ErrorDetail])
(Maybe [ErrorDetail])
(Maybe [ErrorDetail])
(Maybe [ErrorDetail])
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 [ErrorDetail] [ErrorDetail] [ErrorDetail] [ErrorDetail]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.FromJSON Update where
parseJSON :: Value -> Parser Update
parseJSON =
String -> (Object -> Parser Update) -> Value -> Parser Update
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Update"
( \Object
x ->
Maybe UpdateStatus
-> Maybe POSIX
-> Maybe [UpdateParam]
-> Maybe Text
-> Maybe UpdateType
-> Maybe [ErrorDetail]
-> Update
Update'
(Maybe UpdateStatus
-> Maybe POSIX
-> Maybe [UpdateParam]
-> Maybe Text
-> Maybe UpdateType
-> Maybe [ErrorDetail]
-> Update)
-> Parser (Maybe UpdateStatus)
-> Parser
(Maybe POSIX
-> Maybe [UpdateParam]
-> Maybe Text
-> Maybe UpdateType
-> Maybe [ErrorDetail]
-> Update)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe UpdateStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"status")
Parser
(Maybe POSIX
-> Maybe [UpdateParam]
-> Maybe Text
-> Maybe UpdateType
-> Maybe [ErrorDetail]
-> Update)
-> Parser (Maybe POSIX)
-> Parser
(Maybe [UpdateParam]
-> Maybe Text -> Maybe UpdateType -> Maybe [ErrorDetail] -> Update)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"createdAt")
Parser
(Maybe [UpdateParam]
-> Maybe Text -> Maybe UpdateType -> Maybe [ErrorDetail] -> Update)
-> Parser (Maybe [UpdateParam])
-> Parser
(Maybe Text -> Maybe UpdateType -> Maybe [ErrorDetail] -> Update)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [UpdateParam]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"params" Parser (Maybe (Maybe [UpdateParam]))
-> Maybe [UpdateParam] -> Parser (Maybe [UpdateParam])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [UpdateParam]
forall a. Monoid a => a
Prelude.mempty)
Parser
(Maybe Text -> Maybe UpdateType -> Maybe [ErrorDetail] -> Update)
-> Parser (Maybe Text)
-> Parser (Maybe UpdateType -> Maybe [ErrorDetail] -> Update)
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 UpdateType -> Maybe [ErrorDetail] -> Update)
-> Parser (Maybe UpdateType)
-> Parser (Maybe [ErrorDetail] -> Update)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe UpdateType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"type")
Parser (Maybe [ErrorDetail] -> Update)
-> Parser (Maybe [ErrorDetail]) -> Parser Update
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [ErrorDetail]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"errors" Parser (Maybe (Maybe [ErrorDetail]))
-> Maybe [ErrorDetail] -> Parser (Maybe [ErrorDetail])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [ErrorDetail]
forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable Update
instance Prelude.NFData Update