{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.Route53AutoNaming.Types.Operation
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
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

-- | A complex type that contains information about a specified operation.
--
-- /See:/ 'newOperation' smart constructor.
data Operation = Operation'
  { -- | The status of the operation. Values include the following:
    --
    -- [SUBMITTED]
    --     This is the initial state that occurs immediately after you submit a
    --     request.
    --
    -- [PENDING]
    --     Cloud Map is performing the operation.
    --
    -- [SUCCESS]
    --     The operation succeeded.
    --
    -- [FAIL]
    --     The operation failed. For the failure reason, see @ErrorMessage@.
    Operation -> Maybe OperationStatus
status :: Prelude.Maybe OperationStatus,
    -- | The date and time that the value of @Status@ changed to the current
    -- value, in Unix date\/time format and Coordinated Universal Time (UTC).
    -- The value of @UpdateDate@ is accurate to milliseconds. For example, the
    -- value @1516925490.087@ represents Friday, January 26, 2018 12:11:30.087
    -- AM.
    Operation -> Maybe POSIX
updateDate :: Prelude.Maybe Core.POSIX,
    -- | The date and time that the request was submitted, in Unix date\/time
    -- format and Coordinated Universal Time (UTC). The value of @CreateDate@
    -- is accurate to milliseconds. For example, the value @1516925490.087@
    -- represents Friday, January 26, 2018 12:11:30.087 AM.
    Operation -> Maybe POSIX
createDate :: Prelude.Maybe Core.POSIX,
    -- | The name of the target entity that\'s associated with the operation:
    --
    -- [NAMESPACE]
    --     The namespace ID is returned in the @ResourceId@ property.
    --
    -- [SERVICE]
    --     The service ID is returned in the @ResourceId@ property.
    --
    -- [INSTANCE]
    --     The instance ID is returned in the @ResourceId@ property.
    Operation -> Maybe (HashMap OperationTargetType Text)
targets :: Prelude.Maybe (Prelude.HashMap OperationTargetType Prelude.Text),
    -- | The code associated with @ErrorMessage@. Values for @ErrorCode@ include
    -- the following:
    --
    -- -   @ACCESS_DENIED@
    --
    -- -   @CANNOT_CREATE_HOSTED_ZONE@
    --
    -- -   @EXPIRED_TOKEN@
    --
    -- -   @HOSTED_ZONE_NOT_FOUND@
    --
    -- -   @INTERNAL_FAILURE@
    --
    -- -   @INVALID_CHANGE_BATCH@
    --
    -- -   @THROTTLED_REQUEST@
    Operation -> Maybe Text
errorCode :: Prelude.Maybe Prelude.Text,
    -- | The ID of the operation that you want to get information about.
    Operation -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | The name of the operation that\'s associated with the specified ID.
    Operation -> Maybe OperationType
type' :: Prelude.Maybe OperationType,
    -- | If the value of @Status@ is @FAIL@, the reason that the operation
    -- failed.
    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)

-- |
-- Create a value of 'Operation' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'status', 'operation_status' - The status of the operation. Values include the following:
--
-- [SUBMITTED]
--     This is the initial state that occurs immediately after you submit a
--     request.
--
-- [PENDING]
--     Cloud Map is performing the operation.
--
-- [SUCCESS]
--     The operation succeeded.
--
-- [FAIL]
--     The operation failed. For the failure reason, see @ErrorMessage@.
--
-- 'updateDate', 'operation_updateDate' - The date and time that the value of @Status@ changed to the current
-- value, in Unix date\/time format and Coordinated Universal Time (UTC).
-- The value of @UpdateDate@ is accurate to milliseconds. For example, the
-- value @1516925490.087@ represents Friday, January 26, 2018 12:11:30.087
-- AM.
--
-- 'createDate', 'operation_createDate' - The date and time that the request was submitted, in Unix date\/time
-- format and Coordinated Universal Time (UTC). The value of @CreateDate@
-- is accurate to milliseconds. For example, the value @1516925490.087@
-- represents Friday, January 26, 2018 12:11:30.087 AM.
--
-- 'targets', 'operation_targets' - The name of the target entity that\'s associated with the operation:
--
-- [NAMESPACE]
--     The namespace ID is returned in the @ResourceId@ property.
--
-- [SERVICE]
--     The service ID is returned in the @ResourceId@ property.
--
-- [INSTANCE]
--     The instance ID is returned in the @ResourceId@ property.
--
-- 'errorCode', 'operation_errorCode' - The code associated with @ErrorMessage@. Values for @ErrorCode@ include
-- the following:
--
-- -   @ACCESS_DENIED@
--
-- -   @CANNOT_CREATE_HOSTED_ZONE@
--
-- -   @EXPIRED_TOKEN@
--
-- -   @HOSTED_ZONE_NOT_FOUND@
--
-- -   @INTERNAL_FAILURE@
--
-- -   @INVALID_CHANGE_BATCH@
--
-- -   @THROTTLED_REQUEST@
--
-- 'id', 'operation_id' - The ID of the operation that you want to get information about.
--
-- 'type'', 'operation_type' - The name of the operation that\'s associated with the specified ID.
--
-- 'errorMessage', 'operation_errorMessage' - If the value of @Status@ is @FAIL@, the reason that the operation
-- failed.
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
    }

-- | The status of the operation. Values include the following:
--
-- [SUBMITTED]
--     This is the initial state that occurs immediately after you submit a
--     request.
--
-- [PENDING]
--     Cloud Map is performing the operation.
--
-- [SUCCESS]
--     The operation succeeded.
--
-- [FAIL]
--     The operation failed. For the failure reason, see @ErrorMessage@.
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)

-- | The date and time that the value of @Status@ changed to the current
-- value, in Unix date\/time format and Coordinated Universal Time (UTC).
-- The value of @UpdateDate@ is accurate to milliseconds. For example, the
-- value @1516925490.087@ represents Friday, January 26, 2018 12:11:30.087
-- AM.
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

-- | The date and time that the request was submitted, in Unix date\/time
-- format and Coordinated Universal Time (UTC). The value of @CreateDate@
-- is accurate to milliseconds. For example, the value @1516925490.087@
-- represents Friday, January 26, 2018 12:11:30.087 AM.
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

-- | The name of the target entity that\'s associated with the operation:
--
-- [NAMESPACE]
--     The namespace ID is returned in the @ResourceId@ property.
--
-- [SERVICE]
--     The service ID is returned in the @ResourceId@ property.
--
-- [INSTANCE]
--     The instance ID is returned in the @ResourceId@ property.
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

-- | The code associated with @ErrorMessage@. Values for @ErrorCode@ include
-- the following:
--
-- -   @ACCESS_DENIED@
--
-- -   @CANNOT_CREATE_HOSTED_ZONE@
--
-- -   @EXPIRED_TOKEN@
--
-- -   @HOSTED_ZONE_NOT_FOUND@
--
-- -   @INTERNAL_FAILURE@
--
-- -   @INVALID_CHANGE_BATCH@
--
-- -   @THROTTLED_REQUEST@
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)

-- | The ID of the operation that you want to get information about.
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)

-- | The name of the operation that\'s associated with the specified ID.
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)

-- | If the value of @Status@ is @FAIL@, the reason that the operation
-- failed.
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