{-# 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.Route53AutoNaming.Types.Operation where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Route53AutoNaming.Types.OperationStatus
import Amazonka.Route53AutoNaming.Types.OperationTargetType
import Amazonka.Route53AutoNaming.Types.OperationType
data Operation = Operation'
{
Operation -> Maybe OperationStatus
status :: Prelude.Maybe OperationStatus,
Operation -> Maybe POSIX
updateDate :: Prelude.Maybe Core.POSIX,
Operation -> Maybe POSIX
createDate :: Prelude.Maybe Core.POSIX,
Operation -> Maybe (HashMap OperationTargetType Text)
targets :: Prelude.Maybe (Prelude.HashMap OperationTargetType Prelude.Text),
Operation -> Maybe Text
errorCode :: Prelude.Maybe Prelude.Text,
Operation -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
Operation -> Maybe OperationType
type' :: Prelude.Maybe OperationType,
Operation -> Maybe Text
errorMessage :: Prelude.Maybe Prelude.Text
}
deriving (Operation -> Operation -> Bool
(Operation -> Operation -> Bool)
-> (Operation -> Operation -> Bool) -> Eq Operation
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Operation -> Operation -> Bool
$c/= :: Operation -> Operation -> Bool
== :: Operation -> Operation -> Bool
$c== :: Operation -> Operation -> Bool
Prelude.Eq, ReadPrec [Operation]
ReadPrec Operation
Int -> ReadS Operation
ReadS [Operation]
(Int -> ReadS Operation)
-> ReadS [Operation]
-> ReadPrec Operation
-> ReadPrec [Operation]
-> Read Operation
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Operation]
$creadListPrec :: ReadPrec [Operation]
readPrec :: ReadPrec Operation
$creadPrec :: ReadPrec Operation
readList :: ReadS [Operation]
$creadList :: ReadS [Operation]
readsPrec :: Int -> ReadS Operation
$creadsPrec :: Int -> ReadS Operation
Prelude.Read, Int -> Operation -> ShowS
[Operation] -> ShowS
Operation -> String
(Int -> Operation -> ShowS)
-> (Operation -> String)
-> ([Operation] -> ShowS)
-> Show Operation
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Operation] -> ShowS
$cshowList :: [Operation] -> ShowS
show :: Operation -> String
$cshow :: Operation -> String
showsPrec :: Int -> Operation -> ShowS
$cshowsPrec :: Int -> Operation -> ShowS
Prelude.Show, (forall x. Operation -> Rep Operation x)
-> (forall x. Rep Operation x -> Operation) -> Generic Operation
forall x. Rep Operation x -> Operation
forall x. Operation -> Rep Operation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Operation x -> Operation
$cfrom :: forall x. Operation -> Rep Operation x
Prelude.Generic)
newOperation ::
Operation
newOperation :: Operation
newOperation =
Operation' :: Maybe OperationStatus
-> Maybe POSIX
-> Maybe POSIX
-> Maybe (HashMap OperationTargetType Text)
-> Maybe Text
-> Maybe Text
-> Maybe OperationType
-> Maybe Text
-> Operation
Operation'
{ $sel:status:Operation' :: Maybe OperationStatus
status = Maybe OperationStatus
forall a. Maybe a
Prelude.Nothing,
$sel:updateDate:Operation' :: Maybe POSIX
updateDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:createDate:Operation' :: Maybe POSIX
createDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:targets:Operation' :: Maybe (HashMap OperationTargetType Text)
targets = Maybe (HashMap OperationTargetType Text)
forall a. Maybe a
Prelude.Nothing,
$sel:errorCode:Operation' :: Maybe Text
errorCode = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:id:Operation' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:type':Operation' :: Maybe OperationType
type' = Maybe OperationType
forall a. Maybe a
Prelude.Nothing,
$sel:errorMessage:Operation' :: Maybe Text
errorMessage = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
operation_status :: Lens.Lens' Operation (Prelude.Maybe OperationStatus)
operation_status :: (Maybe OperationStatus -> f (Maybe OperationStatus))
-> Operation -> f Operation
operation_status = (Operation -> Maybe OperationStatus)
-> (Operation -> Maybe OperationStatus -> Operation)
-> Lens
Operation Operation (Maybe OperationStatus) (Maybe OperationStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Operation' {Maybe OperationStatus
status :: Maybe OperationStatus
$sel:status:Operation' :: Operation -> Maybe OperationStatus
status} -> Maybe OperationStatus
status) (\s :: Operation
s@Operation' {} Maybe OperationStatus
a -> Operation
s {$sel:status:Operation' :: Maybe OperationStatus
status = Maybe OperationStatus
a} :: Operation)
operation_updateDate :: Lens.Lens' Operation (Prelude.Maybe Prelude.UTCTime)
operation_updateDate :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Operation -> f Operation
operation_updateDate = (Operation -> Maybe POSIX)
-> (Operation -> Maybe POSIX -> Operation)
-> Lens Operation Operation (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Operation' {Maybe POSIX
updateDate :: Maybe POSIX
$sel:updateDate:Operation' :: Operation -> Maybe POSIX
updateDate} -> Maybe POSIX
updateDate) (\s :: Operation
s@Operation' {} Maybe POSIX
a -> Operation
s {$sel:updateDate:Operation' :: Maybe POSIX
updateDate = Maybe POSIX
a} :: Operation) ((Maybe POSIX -> f (Maybe POSIX)) -> Operation -> f Operation)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Operation
-> f Operation
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
operation_createDate :: Lens.Lens' Operation (Prelude.Maybe Prelude.UTCTime)
operation_createDate :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Operation -> f Operation
operation_createDate = (Operation -> Maybe POSIX)
-> (Operation -> Maybe POSIX -> Operation)
-> Lens Operation Operation (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Operation' {Maybe POSIX
createDate :: Maybe POSIX
$sel:createDate:Operation' :: Operation -> Maybe POSIX
createDate} -> Maybe POSIX
createDate) (\s :: Operation
s@Operation' {} Maybe POSIX
a -> Operation
s {$sel:createDate:Operation' :: Maybe POSIX
createDate = Maybe POSIX
a} :: Operation) ((Maybe POSIX -> f (Maybe POSIX)) -> Operation -> f Operation)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Operation
-> f Operation
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
operation_targets :: Lens.Lens' Operation (Prelude.Maybe (Prelude.HashMap OperationTargetType Prelude.Text))
operation_targets :: (Maybe (HashMap OperationTargetType Text)
-> f (Maybe (HashMap OperationTargetType Text)))
-> Operation -> f Operation
operation_targets = (Operation -> Maybe (HashMap OperationTargetType Text))
-> (Operation
-> Maybe (HashMap OperationTargetType Text) -> Operation)
-> Lens
Operation
Operation
(Maybe (HashMap OperationTargetType Text))
(Maybe (HashMap OperationTargetType Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Operation' {Maybe (HashMap OperationTargetType Text)
targets :: Maybe (HashMap OperationTargetType Text)
$sel:targets:Operation' :: Operation -> Maybe (HashMap OperationTargetType Text)
targets} -> Maybe (HashMap OperationTargetType Text)
targets) (\s :: Operation
s@Operation' {} Maybe (HashMap OperationTargetType Text)
a -> Operation
s {$sel:targets:Operation' :: Maybe (HashMap OperationTargetType Text)
targets = Maybe (HashMap OperationTargetType Text)
a} :: Operation) ((Maybe (HashMap OperationTargetType Text)
-> f (Maybe (HashMap OperationTargetType Text)))
-> Operation -> f Operation)
-> ((Maybe (HashMap OperationTargetType Text)
-> f (Maybe (HashMap OperationTargetType Text)))
-> Maybe (HashMap OperationTargetType Text)
-> f (Maybe (HashMap OperationTargetType Text)))
-> (Maybe (HashMap OperationTargetType Text)
-> f (Maybe (HashMap OperationTargetType Text)))
-> Operation
-> f Operation
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(HashMap OperationTargetType Text)
(HashMap OperationTargetType Text)
(HashMap OperationTargetType Text)
(HashMap OperationTargetType Text)
-> Iso
(Maybe (HashMap OperationTargetType Text))
(Maybe (HashMap OperationTargetType Text))
(Maybe (HashMap OperationTargetType Text))
(Maybe (HashMap OperationTargetType Text))
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
(HashMap OperationTargetType Text)
(HashMap OperationTargetType Text)
(HashMap OperationTargetType Text)
(HashMap OperationTargetType Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
operation_errorCode :: Lens.Lens' Operation (Prelude.Maybe Prelude.Text)
operation_errorCode :: (Maybe Text -> f (Maybe Text)) -> Operation -> f Operation
operation_errorCode = (Operation -> Maybe Text)
-> (Operation -> Maybe Text -> Operation)
-> Lens Operation Operation (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Operation' {Maybe Text
errorCode :: Maybe Text
$sel:errorCode:Operation' :: Operation -> Maybe Text
errorCode} -> Maybe Text
errorCode) (\s :: Operation
s@Operation' {} Maybe Text
a -> Operation
s {$sel:errorCode:Operation' :: Maybe Text
errorCode = Maybe Text
a} :: Operation)
operation_id :: Lens.Lens' Operation (Prelude.Maybe Prelude.Text)
operation_id :: (Maybe Text -> f (Maybe Text)) -> Operation -> f Operation
operation_id = (Operation -> Maybe Text)
-> (Operation -> Maybe Text -> Operation)
-> Lens Operation Operation (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Operation' {Maybe Text
id :: Maybe Text
$sel:id:Operation' :: Operation -> Maybe Text
id} -> Maybe Text
id) (\s :: Operation
s@Operation' {} Maybe Text
a -> Operation
s {$sel:id:Operation' :: Maybe Text
id = Maybe Text
a} :: Operation)
operation_type :: Lens.Lens' Operation (Prelude.Maybe OperationType)
operation_type :: (Maybe OperationType -> f (Maybe OperationType))
-> Operation -> f Operation
operation_type = (Operation -> Maybe OperationType)
-> (Operation -> Maybe OperationType -> Operation)
-> Lens
Operation Operation (Maybe OperationType) (Maybe OperationType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Operation' {Maybe OperationType
type' :: Maybe OperationType
$sel:type':Operation' :: Operation -> Maybe OperationType
type'} -> Maybe OperationType
type') (\s :: Operation
s@Operation' {} Maybe OperationType
a -> Operation
s {$sel:type':Operation' :: Maybe OperationType
type' = Maybe OperationType
a} :: Operation)
operation_errorMessage :: Lens.Lens' Operation (Prelude.Maybe Prelude.Text)
operation_errorMessage :: (Maybe Text -> f (Maybe Text)) -> Operation -> f Operation
operation_errorMessage = (Operation -> Maybe Text)
-> (Operation -> Maybe Text -> Operation)
-> Lens Operation Operation (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Operation' {Maybe Text
errorMessage :: Maybe Text
$sel:errorMessage:Operation' :: Operation -> Maybe Text
errorMessage} -> Maybe Text
errorMessage) (\s :: Operation
s@Operation' {} Maybe Text
a -> Operation
s {$sel:errorMessage:Operation' :: Maybe Text
errorMessage = Maybe Text
a} :: Operation)
instance Core.FromJSON Operation where
parseJSON :: Value -> Parser Operation
parseJSON =
String -> (Object -> Parser Operation) -> Value -> Parser Operation
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Operation"
( \Object
x ->
Maybe OperationStatus
-> Maybe POSIX
-> Maybe POSIX
-> Maybe (HashMap OperationTargetType Text)
-> Maybe Text
-> Maybe Text
-> Maybe OperationType
-> Maybe Text
-> Operation
Operation'
(Maybe OperationStatus
-> Maybe POSIX
-> Maybe POSIX
-> Maybe (HashMap OperationTargetType Text)
-> Maybe Text
-> Maybe Text
-> Maybe OperationType
-> Maybe Text
-> Operation)
-> Parser (Maybe OperationStatus)
-> Parser
(Maybe POSIX
-> Maybe POSIX
-> Maybe (HashMap OperationTargetType Text)
-> Maybe Text
-> Maybe Text
-> Maybe OperationType
-> Maybe Text
-> Operation)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe OperationStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Status")
Parser
(Maybe POSIX
-> Maybe POSIX
-> Maybe (HashMap OperationTargetType Text)
-> Maybe Text
-> Maybe Text
-> Maybe OperationType
-> Maybe Text
-> Operation)
-> Parser (Maybe POSIX)
-> Parser
(Maybe POSIX
-> Maybe (HashMap OperationTargetType Text)
-> Maybe Text
-> Maybe Text
-> Maybe OperationType
-> Maybe Text
-> Operation)
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
"UpdateDate")
Parser
(Maybe POSIX
-> Maybe (HashMap OperationTargetType Text)
-> Maybe Text
-> Maybe Text
-> Maybe OperationType
-> Maybe Text
-> Operation)
-> Parser (Maybe POSIX)
-> Parser
(Maybe (HashMap OperationTargetType Text)
-> Maybe Text
-> Maybe Text
-> Maybe OperationType
-> Maybe Text
-> Operation)
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
"CreateDate")
Parser
(Maybe (HashMap OperationTargetType Text)
-> Maybe Text
-> Maybe Text
-> Maybe OperationType
-> Maybe Text
-> Operation)
-> Parser (Maybe (HashMap OperationTargetType Text))
-> Parser
(Maybe Text
-> Maybe Text -> Maybe OperationType -> Maybe Text -> Operation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text
-> Parser (Maybe (Maybe (HashMap OperationTargetType Text)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Targets" Parser (Maybe (Maybe (HashMap OperationTargetType Text)))
-> Maybe (HashMap OperationTargetType Text)
-> Parser (Maybe (HashMap OperationTargetType Text))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap OperationTargetType Text)
forall a. Monoid a => a
Prelude.mempty)
Parser
(Maybe Text
-> Maybe Text -> Maybe OperationType -> Maybe Text -> Operation)
-> Parser (Maybe Text)
-> Parser
(Maybe Text -> Maybe OperationType -> Maybe Text -> Operation)
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
"ErrorCode")
Parser
(Maybe Text -> Maybe OperationType -> Maybe Text -> Operation)
-> Parser (Maybe Text)
-> Parser (Maybe OperationType -> Maybe Text -> Operation)
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 OperationType -> Maybe Text -> Operation)
-> Parser (Maybe OperationType) -> Parser (Maybe Text -> Operation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe OperationType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Type")
Parser (Maybe Text -> Operation)
-> Parser (Maybe Text) -> Parser Operation
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
"ErrorMessage")
)
instance Prelude.Hashable Operation
instance Prelude.NFData Operation