{-# 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.SSMSAP.Types.Operation where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import Amazonka.SSMSAP.Types.OperationStatus
data Operation = Operation'
{ Operation -> Maybe POSIX
endTime :: Prelude.Maybe Data.POSIX,
Operation -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
Operation -> Maybe POSIX
lastUpdatedTime :: Prelude.Maybe Data.POSIX,
Operation -> Maybe (HashMap Text Text)
properties :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
Operation -> Maybe Text
resourceArn :: Prelude.Maybe Prelude.Text,
Operation -> Maybe Text
resourceId :: Prelude.Maybe Prelude.Text,
Operation -> Maybe Text
resourceType :: Prelude.Maybe Prelude.Text,
Operation -> Maybe POSIX
startTime :: Prelude.Maybe Data.POSIX,
Operation -> Maybe OperationStatus
status :: Prelude.Maybe OperationStatus,
Operation -> Maybe Text
statusMessage :: Prelude.Maybe Prelude.Text,
Operation -> Maybe Text
type' :: Prelude.Maybe Prelude.Text
}
deriving (Operation -> Operation -> Bool
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]
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
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. 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'
{ $sel:endTime:Operation' :: Maybe POSIX
endTime = forall a. Maybe a
Prelude.Nothing,
$sel:id:Operation' :: Maybe Text
id = forall a. Maybe a
Prelude.Nothing,
$sel:lastUpdatedTime:Operation' :: Maybe POSIX
lastUpdatedTime = forall a. Maybe a
Prelude.Nothing,
$sel:properties:Operation' :: Maybe (HashMap Text Text)
properties = forall a. Maybe a
Prelude.Nothing,
$sel:resourceArn:Operation' :: Maybe Text
resourceArn = forall a. Maybe a
Prelude.Nothing,
$sel:resourceId:Operation' :: Maybe Text
resourceId = forall a. Maybe a
Prelude.Nothing,
$sel:resourceType:Operation' :: Maybe Text
resourceType = forall a. Maybe a
Prelude.Nothing,
$sel:startTime:Operation' :: Maybe POSIX
startTime = forall a. Maybe a
Prelude.Nothing,
$sel:status:Operation' :: Maybe OperationStatus
status = forall a. Maybe a
Prelude.Nothing,
$sel:statusMessage:Operation' :: Maybe Text
statusMessage = forall a. Maybe a
Prelude.Nothing,
$sel:type':Operation' :: Maybe Text
type' = forall a. Maybe a
Prelude.Nothing
}
operation_endTime :: Lens.Lens' Operation (Prelude.Maybe Prelude.UTCTime)
operation_endTime :: Lens' Operation (Maybe UTCTime)
operation_endTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Operation' {Maybe POSIX
endTime :: Maybe POSIX
$sel:endTime:Operation' :: Operation -> Maybe POSIX
endTime} -> Maybe POSIX
endTime) (\s :: Operation
s@Operation' {} Maybe POSIX
a -> Operation
s {$sel:endTime:Operation' :: Maybe POSIX
endTime = Maybe POSIX
a} :: Operation) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
operation_id :: Lens.Lens' Operation (Prelude.Maybe Prelude.Text)
operation_id :: Lens' Operation (Maybe Text)
operation_id = 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_lastUpdatedTime :: Lens.Lens' Operation (Prelude.Maybe Prelude.UTCTime)
operation_lastUpdatedTime :: Lens' Operation (Maybe UTCTime)
operation_lastUpdatedTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Operation' {Maybe POSIX
lastUpdatedTime :: Maybe POSIX
$sel:lastUpdatedTime:Operation' :: Operation -> Maybe POSIX
lastUpdatedTime} -> Maybe POSIX
lastUpdatedTime) (\s :: Operation
s@Operation' {} Maybe POSIX
a -> Operation
s {$sel:lastUpdatedTime:Operation' :: Maybe POSIX
lastUpdatedTime = Maybe POSIX
a} :: Operation) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
operation_properties :: Lens.Lens' Operation (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
operation_properties :: Lens' Operation (Maybe (HashMap Text Text))
operation_properties = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Operation' {Maybe (HashMap Text Text)
properties :: Maybe (HashMap Text Text)
$sel:properties:Operation' :: Operation -> Maybe (HashMap Text Text)
properties} -> Maybe (HashMap Text Text)
properties) (\s :: Operation
s@Operation' {} Maybe (HashMap Text Text)
a -> Operation
s {$sel:properties:Operation' :: Maybe (HashMap Text Text)
properties = Maybe (HashMap Text Text)
a} :: Operation) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
operation_resourceArn :: Lens.Lens' Operation (Prelude.Maybe Prelude.Text)
operation_resourceArn :: Lens' Operation (Maybe Text)
operation_resourceArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Operation' {Maybe Text
resourceArn :: Maybe Text
$sel:resourceArn:Operation' :: Operation -> Maybe Text
resourceArn} -> Maybe Text
resourceArn) (\s :: Operation
s@Operation' {} Maybe Text
a -> Operation
s {$sel:resourceArn:Operation' :: Maybe Text
resourceArn = Maybe Text
a} :: Operation)
operation_resourceId :: Lens.Lens' Operation (Prelude.Maybe Prelude.Text)
operation_resourceId :: Lens' Operation (Maybe Text)
operation_resourceId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Operation' {Maybe Text
resourceId :: Maybe Text
$sel:resourceId:Operation' :: Operation -> Maybe Text
resourceId} -> Maybe Text
resourceId) (\s :: Operation
s@Operation' {} Maybe Text
a -> Operation
s {$sel:resourceId:Operation' :: Maybe Text
resourceId = Maybe Text
a} :: Operation)
operation_resourceType :: Lens.Lens' Operation (Prelude.Maybe Prelude.Text)
operation_resourceType :: Lens' Operation (Maybe Text)
operation_resourceType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Operation' {Maybe Text
resourceType :: Maybe Text
$sel:resourceType:Operation' :: Operation -> Maybe Text
resourceType} -> Maybe Text
resourceType) (\s :: Operation
s@Operation' {} Maybe Text
a -> Operation
s {$sel:resourceType:Operation' :: Maybe Text
resourceType = Maybe Text
a} :: Operation)
operation_startTime :: Lens.Lens' Operation (Prelude.Maybe Prelude.UTCTime)
operation_startTime :: Lens' Operation (Maybe UTCTime)
operation_startTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Operation' {Maybe POSIX
startTime :: Maybe POSIX
$sel:startTime:Operation' :: Operation -> Maybe POSIX
startTime} -> Maybe POSIX
startTime) (\s :: Operation
s@Operation' {} Maybe POSIX
a -> Operation
s {$sel:startTime:Operation' :: Maybe POSIX
startTime = Maybe POSIX
a} :: Operation) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
operation_status :: Lens.Lens' Operation (Prelude.Maybe OperationStatus)
operation_status :: Lens' Operation (Maybe OperationStatus)
operation_status = 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_statusMessage :: Lens.Lens' Operation (Prelude.Maybe Prelude.Text)
operation_statusMessage :: Lens' Operation (Maybe Text)
operation_statusMessage = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Operation' {Maybe Text
statusMessage :: Maybe Text
$sel:statusMessage:Operation' :: Operation -> Maybe Text
statusMessage} -> Maybe Text
statusMessage) (\s :: Operation
s@Operation' {} Maybe Text
a -> Operation
s {$sel:statusMessage:Operation' :: Maybe Text
statusMessage = Maybe Text
a} :: Operation)
operation_type :: Lens.Lens' Operation (Prelude.Maybe Prelude.Text)
operation_type :: Lens' Operation (Maybe Text)
operation_type = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Operation' {Maybe Text
type' :: Maybe Text
$sel:type':Operation' :: Operation -> Maybe Text
type'} -> Maybe Text
type') (\s :: Operation
s@Operation' {} Maybe Text
a -> Operation
s {$sel:type':Operation' :: Maybe Text
type' = Maybe Text
a} :: Operation)
instance Data.FromJSON Operation where
parseJSON :: Value -> Parser Operation
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"Operation"
( \Object
x ->
Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe (HashMap Text Text)
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe OperationStatus
-> Maybe Text
-> Maybe Text
-> Operation
Operation'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"EndTime")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Id")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"LastUpdatedTime")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Properties" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ResourceArn")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ResourceId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ResourceType")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"StartTime")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Status")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"StatusMessage")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Type")
)
instance Prelude.Hashable Operation where
hashWithSalt :: Int -> Operation -> Int
hashWithSalt Int
_salt Operation' {Maybe Text
Maybe (HashMap Text Text)
Maybe POSIX
Maybe OperationStatus
type' :: Maybe Text
statusMessage :: Maybe Text
status :: Maybe OperationStatus
startTime :: Maybe POSIX
resourceType :: Maybe Text
resourceId :: Maybe Text
resourceArn :: Maybe Text
properties :: Maybe (HashMap Text Text)
lastUpdatedTime :: Maybe POSIX
id :: Maybe Text
endTime :: Maybe POSIX
$sel:type':Operation' :: Operation -> Maybe Text
$sel:statusMessage:Operation' :: Operation -> Maybe Text
$sel:status:Operation' :: Operation -> Maybe OperationStatus
$sel:startTime:Operation' :: Operation -> Maybe POSIX
$sel:resourceType:Operation' :: Operation -> Maybe Text
$sel:resourceId:Operation' :: Operation -> Maybe Text
$sel:resourceArn:Operation' :: Operation -> Maybe Text
$sel:properties:Operation' :: Operation -> Maybe (HashMap Text Text)
$sel:lastUpdatedTime:Operation' :: Operation -> Maybe POSIX
$sel:id:Operation' :: Operation -> Maybe Text
$sel:endTime:Operation' :: Operation -> Maybe POSIX
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
endTime
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
id
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
lastUpdatedTime
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
properties
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
resourceArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
resourceId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
resourceType
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
startTime
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe OperationStatus
status
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
statusMessage
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
type'
instance Prelude.NFData Operation where
rnf :: Operation -> ()
rnf Operation' {Maybe Text
Maybe (HashMap Text Text)
Maybe POSIX
Maybe OperationStatus
type' :: Maybe Text
statusMessage :: Maybe Text
status :: Maybe OperationStatus
startTime :: Maybe POSIX
resourceType :: Maybe Text
resourceId :: Maybe Text
resourceArn :: Maybe Text
properties :: Maybe (HashMap Text Text)
lastUpdatedTime :: Maybe POSIX
id :: Maybe Text
endTime :: Maybe POSIX
$sel:type':Operation' :: Operation -> Maybe Text
$sel:statusMessage:Operation' :: Operation -> Maybe Text
$sel:status:Operation' :: Operation -> Maybe OperationStatus
$sel:startTime:Operation' :: Operation -> Maybe POSIX
$sel:resourceType:Operation' :: Operation -> Maybe Text
$sel:resourceId:Operation' :: Operation -> Maybe Text
$sel:resourceArn:Operation' :: Operation -> Maybe Text
$sel:properties:Operation' :: Operation -> Maybe (HashMap Text Text)
$sel:lastUpdatedTime:Operation' :: Operation -> Maybe POSIX
$sel:id:Operation' :: Operation -> Maybe Text
$sel:endTime:Operation' :: Operation -> Maybe POSIX
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
endTime
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
id
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
lastUpdatedTime
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
properties
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
resourceArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
resourceId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
resourceType
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
startTime
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe OperationStatus
status
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
statusMessage
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
type'