{-# 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.RAM.Types.Resource where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.RAM.Types.ResourceStatus
data Resource = Resource'
{
Resource -> Maybe POSIX
creationTime :: Prelude.Maybe Core.POSIX,
Resource -> Maybe ResourceStatus
status :: Prelude.Maybe ResourceStatus,
Resource -> Maybe Text
resourceShareArn :: Prelude.Maybe Prelude.Text,
Resource -> Maybe POSIX
lastUpdatedTime :: Prelude.Maybe Core.POSIX,
Resource -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
Resource -> Maybe Text
resourceGroupArn :: Prelude.Maybe Prelude.Text,
Resource -> Maybe Text
statusMessage :: Prelude.Maybe Prelude.Text,
Resource -> Maybe Text
type' :: Prelude.Maybe Prelude.Text
}
deriving (Resource -> Resource -> Bool
(Resource -> Resource -> Bool)
-> (Resource -> Resource -> Bool) -> Eq Resource
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Resource -> Resource -> Bool
$c/= :: Resource -> Resource -> Bool
== :: Resource -> Resource -> Bool
$c== :: Resource -> Resource -> Bool
Prelude.Eq, ReadPrec [Resource]
ReadPrec Resource
Int -> ReadS Resource
ReadS [Resource]
(Int -> ReadS Resource)
-> ReadS [Resource]
-> ReadPrec Resource
-> ReadPrec [Resource]
-> Read Resource
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Resource]
$creadListPrec :: ReadPrec [Resource]
readPrec :: ReadPrec Resource
$creadPrec :: ReadPrec Resource
readList :: ReadS [Resource]
$creadList :: ReadS [Resource]
readsPrec :: Int -> ReadS Resource
$creadsPrec :: Int -> ReadS Resource
Prelude.Read, Int -> Resource -> ShowS
[Resource] -> ShowS
Resource -> String
(Int -> Resource -> ShowS)
-> (Resource -> String) -> ([Resource] -> ShowS) -> Show Resource
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Resource] -> ShowS
$cshowList :: [Resource] -> ShowS
show :: Resource -> String
$cshow :: Resource -> String
showsPrec :: Int -> Resource -> ShowS
$cshowsPrec :: Int -> Resource -> ShowS
Prelude.Show, (forall x. Resource -> Rep Resource x)
-> (forall x. Rep Resource x -> Resource) -> Generic Resource
forall x. Rep Resource x -> Resource
forall x. Resource -> Rep Resource x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Resource x -> Resource
$cfrom :: forall x. Resource -> Rep Resource x
Prelude.Generic)
newResource ::
Resource
newResource :: Resource
newResource =
Resource' :: Maybe POSIX
-> Maybe ResourceStatus
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Resource
Resource'
{ $sel:creationTime:Resource' :: Maybe POSIX
creationTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:status:Resource' :: Maybe ResourceStatus
status = Maybe ResourceStatus
forall a. Maybe a
Prelude.Nothing,
$sel:resourceShareArn:Resource' :: Maybe Text
resourceShareArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:lastUpdatedTime:Resource' :: Maybe POSIX
lastUpdatedTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:arn:Resource' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:resourceGroupArn:Resource' :: Maybe Text
resourceGroupArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:statusMessage:Resource' :: Maybe Text
statusMessage = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:type':Resource' :: Maybe Text
type' = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
resource_creationTime :: Lens.Lens' Resource (Prelude.Maybe Prelude.UTCTime)
resource_creationTime :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Resource -> f Resource
resource_creationTime = (Resource -> Maybe POSIX)
-> (Resource -> Maybe POSIX -> Resource)
-> Lens Resource Resource (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Resource' {Maybe POSIX
creationTime :: Maybe POSIX
$sel:creationTime:Resource' :: Resource -> Maybe POSIX
creationTime} -> Maybe POSIX
creationTime) (\s :: Resource
s@Resource' {} Maybe POSIX
a -> Resource
s {$sel:creationTime:Resource' :: Maybe POSIX
creationTime = Maybe POSIX
a} :: Resource) ((Maybe POSIX -> f (Maybe POSIX)) -> Resource -> f Resource)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Resource
-> f Resource
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
resource_status :: Lens.Lens' Resource (Prelude.Maybe ResourceStatus)
resource_status :: (Maybe ResourceStatus -> f (Maybe ResourceStatus))
-> Resource -> f Resource
resource_status = (Resource -> Maybe ResourceStatus)
-> (Resource -> Maybe ResourceStatus -> Resource)
-> Lens
Resource Resource (Maybe ResourceStatus) (Maybe ResourceStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Resource' {Maybe ResourceStatus
status :: Maybe ResourceStatus
$sel:status:Resource' :: Resource -> Maybe ResourceStatus
status} -> Maybe ResourceStatus
status) (\s :: Resource
s@Resource' {} Maybe ResourceStatus
a -> Resource
s {$sel:status:Resource' :: Maybe ResourceStatus
status = Maybe ResourceStatus
a} :: Resource)
resource_resourceShareArn :: Lens.Lens' Resource (Prelude.Maybe Prelude.Text)
resource_resourceShareArn :: (Maybe Text -> f (Maybe Text)) -> Resource -> f Resource
resource_resourceShareArn = (Resource -> Maybe Text)
-> (Resource -> Maybe Text -> Resource)
-> Lens Resource Resource (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Resource' {Maybe Text
resourceShareArn :: Maybe Text
$sel:resourceShareArn:Resource' :: Resource -> Maybe Text
resourceShareArn} -> Maybe Text
resourceShareArn) (\s :: Resource
s@Resource' {} Maybe Text
a -> Resource
s {$sel:resourceShareArn:Resource' :: Maybe Text
resourceShareArn = Maybe Text
a} :: Resource)
resource_lastUpdatedTime :: Lens.Lens' Resource (Prelude.Maybe Prelude.UTCTime)
resource_lastUpdatedTime :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Resource -> f Resource
resource_lastUpdatedTime = (Resource -> Maybe POSIX)
-> (Resource -> Maybe POSIX -> Resource)
-> Lens Resource Resource (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Resource' {Maybe POSIX
lastUpdatedTime :: Maybe POSIX
$sel:lastUpdatedTime:Resource' :: Resource -> Maybe POSIX
lastUpdatedTime} -> Maybe POSIX
lastUpdatedTime) (\s :: Resource
s@Resource' {} Maybe POSIX
a -> Resource
s {$sel:lastUpdatedTime:Resource' :: Maybe POSIX
lastUpdatedTime = Maybe POSIX
a} :: Resource) ((Maybe POSIX -> f (Maybe POSIX)) -> Resource -> f Resource)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Resource
-> f Resource
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
resource_arn :: Lens.Lens' Resource (Prelude.Maybe Prelude.Text)
resource_arn :: (Maybe Text -> f (Maybe Text)) -> Resource -> f Resource
resource_arn = (Resource -> Maybe Text)
-> (Resource -> Maybe Text -> Resource)
-> Lens Resource Resource (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Resource' {Maybe Text
arn :: Maybe Text
$sel:arn:Resource' :: Resource -> Maybe Text
arn} -> Maybe Text
arn) (\s :: Resource
s@Resource' {} Maybe Text
a -> Resource
s {$sel:arn:Resource' :: Maybe Text
arn = Maybe Text
a} :: Resource)
resource_resourceGroupArn :: Lens.Lens' Resource (Prelude.Maybe Prelude.Text)
resource_resourceGroupArn :: (Maybe Text -> f (Maybe Text)) -> Resource -> f Resource
resource_resourceGroupArn = (Resource -> Maybe Text)
-> (Resource -> Maybe Text -> Resource)
-> Lens Resource Resource (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Resource' {Maybe Text
resourceGroupArn :: Maybe Text
$sel:resourceGroupArn:Resource' :: Resource -> Maybe Text
resourceGroupArn} -> Maybe Text
resourceGroupArn) (\s :: Resource
s@Resource' {} Maybe Text
a -> Resource
s {$sel:resourceGroupArn:Resource' :: Maybe Text
resourceGroupArn = Maybe Text
a} :: Resource)
resource_statusMessage :: Lens.Lens' Resource (Prelude.Maybe Prelude.Text)
resource_statusMessage :: (Maybe Text -> f (Maybe Text)) -> Resource -> f Resource
resource_statusMessage = (Resource -> Maybe Text)
-> (Resource -> Maybe Text -> Resource)
-> Lens Resource Resource (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Resource' {Maybe Text
statusMessage :: Maybe Text
$sel:statusMessage:Resource' :: Resource -> Maybe Text
statusMessage} -> Maybe Text
statusMessage) (\s :: Resource
s@Resource' {} Maybe Text
a -> Resource
s {$sel:statusMessage:Resource' :: Maybe Text
statusMessage = Maybe Text
a} :: Resource)
resource_type :: Lens.Lens' Resource (Prelude.Maybe Prelude.Text)
resource_type :: (Maybe Text -> f (Maybe Text)) -> Resource -> f Resource
resource_type = (Resource -> Maybe Text)
-> (Resource -> Maybe Text -> Resource)
-> Lens Resource Resource (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Resource' {Maybe Text
type' :: Maybe Text
$sel:type':Resource' :: Resource -> Maybe Text
type'} -> Maybe Text
type') (\s :: Resource
s@Resource' {} Maybe Text
a -> Resource
s {$sel:type':Resource' :: Maybe Text
type' = Maybe Text
a} :: Resource)
instance Core.FromJSON Resource where
parseJSON :: Value -> Parser Resource
parseJSON =
String -> (Object -> Parser Resource) -> Value -> Parser Resource
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Resource"
( \Object
x ->
Maybe POSIX
-> Maybe ResourceStatus
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Resource
Resource'
(Maybe POSIX
-> Maybe ResourceStatus
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Resource)
-> Parser (Maybe POSIX)
-> Parser
(Maybe ResourceStatus
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Resource)
forall (f :: * -> *) a b. Functor 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
"creationTime")
Parser
(Maybe ResourceStatus
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Resource)
-> Parser (Maybe ResourceStatus)
-> Parser
(Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Resource)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ResourceStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"status")
Parser
(Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Resource)
-> Parser (Maybe Text)
-> Parser
(Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Resource)
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
"resourceShareArn")
Parser
(Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Resource)
-> Parser (Maybe POSIX)
-> Parser
(Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Resource)
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
"lastUpdatedTime")
Parser
(Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Resource)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> Maybe Text -> Resource)
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
"arn")
Parser (Maybe Text -> Maybe Text -> Maybe Text -> Resource)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> Resource)
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
"resourceGroupArn")
Parser (Maybe Text -> Maybe Text -> Resource)
-> Parser (Maybe Text) -> Parser (Maybe Text -> Resource)
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
"statusMessage")
Parser (Maybe Text -> Resource)
-> Parser (Maybe Text) -> Parser Resource
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
"type")
)
instance Prelude.Hashable Resource
instance Prelude.NFData Resource