{-# 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.Lightsail.Types.Operation where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Lightsail.Types.OperationStatus
import Amazonka.Lightsail.Types.OperationType
import Amazonka.Lightsail.Types.ResourceLocation
import Amazonka.Lightsail.Types.ResourceType
import qualified Amazonka.Prelude as Prelude
data Operation = Operation'
{
Operation -> Maybe POSIX
createdAt :: Prelude.Maybe Data.POSIX,
Operation -> Maybe Text
errorCode :: Prelude.Maybe Prelude.Text,
Operation -> Maybe Text
errorDetails :: Prelude.Maybe Prelude.Text,
Operation -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
Operation -> Maybe Bool
isTerminal :: Prelude.Maybe Prelude.Bool,
Operation -> Maybe ResourceLocation
location :: Prelude.Maybe ResourceLocation,
Operation -> Maybe Text
operationDetails :: Prelude.Maybe Prelude.Text,
Operation -> Maybe OperationType
operationType :: Prelude.Maybe OperationType,
Operation -> Maybe Text
resourceName :: Prelude.Maybe Prelude.Text,
Operation -> Maybe ResourceType
resourceType :: Prelude.Maybe ResourceType,
Operation -> Maybe OperationStatus
status :: Prelude.Maybe OperationStatus,
Operation -> Maybe POSIX
statusChangedAt :: Prelude.Maybe Data.POSIX
}
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:createdAt:Operation' :: Maybe POSIX
createdAt = forall a. Maybe a
Prelude.Nothing,
$sel:errorCode:Operation' :: Maybe Text
errorCode = forall a. Maybe a
Prelude.Nothing,
$sel:errorDetails:Operation' :: Maybe Text
errorDetails = forall a. Maybe a
Prelude.Nothing,
$sel:id:Operation' :: Maybe Text
id = forall a. Maybe a
Prelude.Nothing,
$sel:isTerminal:Operation' :: Maybe Bool
isTerminal = forall a. Maybe a
Prelude.Nothing,
$sel:location:Operation' :: Maybe ResourceLocation
location = forall a. Maybe a
Prelude.Nothing,
$sel:operationDetails:Operation' :: Maybe Text
operationDetails = forall a. Maybe a
Prelude.Nothing,
$sel:operationType:Operation' :: Maybe OperationType
operationType = forall a. Maybe a
Prelude.Nothing,
$sel:resourceName:Operation' :: Maybe Text
resourceName = forall a. Maybe a
Prelude.Nothing,
$sel:resourceType:Operation' :: Maybe ResourceType
resourceType = forall a. Maybe a
Prelude.Nothing,
$sel:status:Operation' :: Maybe OperationStatus
status = forall a. Maybe a
Prelude.Nothing,
$sel:statusChangedAt:Operation' :: Maybe POSIX
statusChangedAt = forall a. Maybe a
Prelude.Nothing
}
operation_createdAt :: Lens.Lens' Operation (Prelude.Maybe Prelude.UTCTime)
operation_createdAt :: Lens' Operation (Maybe UTCTime)
operation_createdAt = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Operation' {Maybe POSIX
createdAt :: Maybe POSIX
$sel:createdAt:Operation' :: Operation -> Maybe POSIX
createdAt} -> Maybe POSIX
createdAt) (\s :: Operation
s@Operation' {} Maybe POSIX
a -> Operation
s {$sel:createdAt:Operation' :: Maybe POSIX
createdAt = 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_errorCode :: Lens.Lens' Operation (Prelude.Maybe Prelude.Text)
operation_errorCode :: Lens' Operation (Maybe Text)
operation_errorCode = 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_errorDetails :: Lens.Lens' Operation (Prelude.Maybe Prelude.Text)
operation_errorDetails :: Lens' Operation (Maybe Text)
operation_errorDetails = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Operation' {Maybe Text
errorDetails :: Maybe Text
$sel:errorDetails:Operation' :: Operation -> Maybe Text
errorDetails} -> Maybe Text
errorDetails) (\s :: Operation
s@Operation' {} Maybe Text
a -> Operation
s {$sel:errorDetails:Operation' :: Maybe Text
errorDetails = Maybe Text
a} :: Operation)
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_isTerminal :: Lens.Lens' Operation (Prelude.Maybe Prelude.Bool)
operation_isTerminal :: Lens' Operation (Maybe Bool)
operation_isTerminal = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Operation' {Maybe Bool
isTerminal :: Maybe Bool
$sel:isTerminal:Operation' :: Operation -> Maybe Bool
isTerminal} -> Maybe Bool
isTerminal) (\s :: Operation
s@Operation' {} Maybe Bool
a -> Operation
s {$sel:isTerminal:Operation' :: Maybe Bool
isTerminal = Maybe Bool
a} :: Operation)
operation_location :: Lens.Lens' Operation (Prelude.Maybe ResourceLocation)
operation_location :: Lens' Operation (Maybe ResourceLocation)
operation_location = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Operation' {Maybe ResourceLocation
location :: Maybe ResourceLocation
$sel:location:Operation' :: Operation -> Maybe ResourceLocation
location} -> Maybe ResourceLocation
location) (\s :: Operation
s@Operation' {} Maybe ResourceLocation
a -> Operation
s {$sel:location:Operation' :: Maybe ResourceLocation
location = Maybe ResourceLocation
a} :: Operation)
operation_operationDetails :: Lens.Lens' Operation (Prelude.Maybe Prelude.Text)
operation_operationDetails :: Lens' Operation (Maybe Text)
operation_operationDetails = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Operation' {Maybe Text
operationDetails :: Maybe Text
$sel:operationDetails:Operation' :: Operation -> Maybe Text
operationDetails} -> Maybe Text
operationDetails) (\s :: Operation
s@Operation' {} Maybe Text
a -> Operation
s {$sel:operationDetails:Operation' :: Maybe Text
operationDetails = Maybe Text
a} :: Operation)
operation_operationType :: Lens.Lens' Operation (Prelude.Maybe OperationType)
operation_operationType :: Lens' Operation (Maybe OperationType)
operation_operationType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Operation' {Maybe OperationType
operationType :: Maybe OperationType
$sel:operationType:Operation' :: Operation -> Maybe OperationType
operationType} -> Maybe OperationType
operationType) (\s :: Operation
s@Operation' {} Maybe OperationType
a -> Operation
s {$sel:operationType:Operation' :: Maybe OperationType
operationType = Maybe OperationType
a} :: Operation)
operation_resourceName :: Lens.Lens' Operation (Prelude.Maybe Prelude.Text)
operation_resourceName :: Lens' Operation (Maybe Text)
operation_resourceName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Operation' {Maybe Text
resourceName :: Maybe Text
$sel:resourceName:Operation' :: Operation -> Maybe Text
resourceName} -> Maybe Text
resourceName) (\s :: Operation
s@Operation' {} Maybe Text
a -> Operation
s {$sel:resourceName:Operation' :: Maybe Text
resourceName = Maybe Text
a} :: Operation)
operation_resourceType :: Lens.Lens' Operation (Prelude.Maybe ResourceType)
operation_resourceType :: Lens' Operation (Maybe ResourceType)
operation_resourceType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Operation' {Maybe ResourceType
resourceType :: Maybe ResourceType
$sel:resourceType:Operation' :: Operation -> Maybe ResourceType
resourceType} -> Maybe ResourceType
resourceType) (\s :: Operation
s@Operation' {} Maybe ResourceType
a -> Operation
s {$sel:resourceType:Operation' :: Maybe ResourceType
resourceType = Maybe ResourceType
a} :: Operation)
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_statusChangedAt :: Lens.Lens' Operation (Prelude.Maybe Prelude.UTCTime)
operation_statusChangedAt :: Lens' Operation (Maybe UTCTime)
operation_statusChangedAt = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Operation' {Maybe POSIX
statusChangedAt :: Maybe POSIX
$sel:statusChangedAt:Operation' :: Operation -> Maybe POSIX
statusChangedAt} -> Maybe POSIX
statusChangedAt) (\s :: Operation
s@Operation' {} Maybe POSIX
a -> Operation
s {$sel:statusChangedAt:Operation' :: Maybe POSIX
statusChangedAt = 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
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 Text
-> Maybe Text
-> Maybe Bool
-> Maybe ResourceLocation
-> Maybe Text
-> Maybe OperationType
-> Maybe Text
-> Maybe ResourceType
-> Maybe OperationStatus
-> Maybe POSIX
-> 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
"createdAt")
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
"errorCode")
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
"errorDetails")
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
"isTerminal")
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
"location")
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
"operationDetails")
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
"operationType")
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
"resourceName")
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
"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
"statusChangedAt")
)
instance Prelude.Hashable Operation where
hashWithSalt :: Int -> Operation -> Int
hashWithSalt Int
_salt Operation' {Maybe Bool
Maybe Text
Maybe POSIX
Maybe OperationStatus
Maybe OperationType
Maybe ResourceLocation
Maybe ResourceType
statusChangedAt :: Maybe POSIX
status :: Maybe OperationStatus
resourceType :: Maybe ResourceType
resourceName :: Maybe Text
operationType :: Maybe OperationType
operationDetails :: Maybe Text
location :: Maybe ResourceLocation
isTerminal :: Maybe Bool
id :: Maybe Text
errorDetails :: Maybe Text
errorCode :: Maybe Text
createdAt :: Maybe POSIX
$sel:statusChangedAt:Operation' :: Operation -> Maybe POSIX
$sel:status:Operation' :: Operation -> Maybe OperationStatus
$sel:resourceType:Operation' :: Operation -> Maybe ResourceType
$sel:resourceName:Operation' :: Operation -> Maybe Text
$sel:operationType:Operation' :: Operation -> Maybe OperationType
$sel:operationDetails:Operation' :: Operation -> Maybe Text
$sel:location:Operation' :: Operation -> Maybe ResourceLocation
$sel:isTerminal:Operation' :: Operation -> Maybe Bool
$sel:id:Operation' :: Operation -> Maybe Text
$sel:errorDetails:Operation' :: Operation -> Maybe Text
$sel:errorCode:Operation' :: Operation -> Maybe Text
$sel:createdAt:Operation' :: Operation -> Maybe POSIX
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
createdAt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
errorCode
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
errorDetails
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
id
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
isTerminal
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ResourceLocation
location
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
operationDetails
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe OperationType
operationType
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
resourceName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ResourceType
resourceType
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe OperationStatus
status
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
statusChangedAt
instance Prelude.NFData Operation where
rnf :: Operation -> ()
rnf Operation' {Maybe Bool
Maybe Text
Maybe POSIX
Maybe OperationStatus
Maybe OperationType
Maybe ResourceLocation
Maybe ResourceType
statusChangedAt :: Maybe POSIX
status :: Maybe OperationStatus
resourceType :: Maybe ResourceType
resourceName :: Maybe Text
operationType :: Maybe OperationType
operationDetails :: Maybe Text
location :: Maybe ResourceLocation
isTerminal :: Maybe Bool
id :: Maybe Text
errorDetails :: Maybe Text
errorCode :: Maybe Text
createdAt :: Maybe POSIX
$sel:statusChangedAt:Operation' :: Operation -> Maybe POSIX
$sel:status:Operation' :: Operation -> Maybe OperationStatus
$sel:resourceType:Operation' :: Operation -> Maybe ResourceType
$sel:resourceName:Operation' :: Operation -> Maybe Text
$sel:operationType:Operation' :: Operation -> Maybe OperationType
$sel:operationDetails:Operation' :: Operation -> Maybe Text
$sel:location:Operation' :: Operation -> Maybe ResourceLocation
$sel:isTerminal:Operation' :: Operation -> Maybe Bool
$sel:id:Operation' :: Operation -> Maybe Text
$sel:errorDetails:Operation' :: Operation -> Maybe Text
$sel:errorCode:Operation' :: Operation -> Maybe Text
$sel:createdAt:Operation' :: Operation -> Maybe POSIX
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
createdAt
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
errorCode
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
errorDetails
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 Bool
isTerminal
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ResourceLocation
location
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
operationDetails
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe OperationType
operationType
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
resourceName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ResourceType
resourceType
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 POSIX
statusChangedAt