{-# 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.MonitoredResourceInfo where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Lightsail.Types.ResourceType
import qualified Amazonka.Prelude as Prelude
data MonitoredResourceInfo = MonitoredResourceInfo'
{
MonitoredResourceInfo -> Maybe ResourceType
resourceType :: Prelude.Maybe ResourceType,
MonitoredResourceInfo -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
MonitoredResourceInfo -> Maybe Text
name :: Prelude.Maybe Prelude.Text
}
deriving (MonitoredResourceInfo -> MonitoredResourceInfo -> Bool
(MonitoredResourceInfo -> MonitoredResourceInfo -> Bool)
-> (MonitoredResourceInfo -> MonitoredResourceInfo -> Bool)
-> Eq MonitoredResourceInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MonitoredResourceInfo -> MonitoredResourceInfo -> Bool
$c/= :: MonitoredResourceInfo -> MonitoredResourceInfo -> Bool
== :: MonitoredResourceInfo -> MonitoredResourceInfo -> Bool
$c== :: MonitoredResourceInfo -> MonitoredResourceInfo -> Bool
Prelude.Eq, ReadPrec [MonitoredResourceInfo]
ReadPrec MonitoredResourceInfo
Int -> ReadS MonitoredResourceInfo
ReadS [MonitoredResourceInfo]
(Int -> ReadS MonitoredResourceInfo)
-> ReadS [MonitoredResourceInfo]
-> ReadPrec MonitoredResourceInfo
-> ReadPrec [MonitoredResourceInfo]
-> Read MonitoredResourceInfo
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MonitoredResourceInfo]
$creadListPrec :: ReadPrec [MonitoredResourceInfo]
readPrec :: ReadPrec MonitoredResourceInfo
$creadPrec :: ReadPrec MonitoredResourceInfo
readList :: ReadS [MonitoredResourceInfo]
$creadList :: ReadS [MonitoredResourceInfo]
readsPrec :: Int -> ReadS MonitoredResourceInfo
$creadsPrec :: Int -> ReadS MonitoredResourceInfo
Prelude.Read, Int -> MonitoredResourceInfo -> ShowS
[MonitoredResourceInfo] -> ShowS
MonitoredResourceInfo -> String
(Int -> MonitoredResourceInfo -> ShowS)
-> (MonitoredResourceInfo -> String)
-> ([MonitoredResourceInfo] -> ShowS)
-> Show MonitoredResourceInfo
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MonitoredResourceInfo] -> ShowS
$cshowList :: [MonitoredResourceInfo] -> ShowS
show :: MonitoredResourceInfo -> String
$cshow :: MonitoredResourceInfo -> String
showsPrec :: Int -> MonitoredResourceInfo -> ShowS
$cshowsPrec :: Int -> MonitoredResourceInfo -> ShowS
Prelude.Show, (forall x. MonitoredResourceInfo -> Rep MonitoredResourceInfo x)
-> (forall x. Rep MonitoredResourceInfo x -> MonitoredResourceInfo)
-> Generic MonitoredResourceInfo
forall x. Rep MonitoredResourceInfo x -> MonitoredResourceInfo
forall x. MonitoredResourceInfo -> Rep MonitoredResourceInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MonitoredResourceInfo x -> MonitoredResourceInfo
$cfrom :: forall x. MonitoredResourceInfo -> Rep MonitoredResourceInfo x
Prelude.Generic)
newMonitoredResourceInfo ::
MonitoredResourceInfo
newMonitoredResourceInfo :: MonitoredResourceInfo
newMonitoredResourceInfo =
MonitoredResourceInfo' :: Maybe ResourceType
-> Maybe Text -> Maybe Text -> MonitoredResourceInfo
MonitoredResourceInfo'
{ $sel:resourceType:MonitoredResourceInfo' :: Maybe ResourceType
resourceType =
Maybe ResourceType
forall a. Maybe a
Prelude.Nothing,
$sel:arn:MonitoredResourceInfo' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:name:MonitoredResourceInfo' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
monitoredResourceInfo_resourceType :: Lens.Lens' MonitoredResourceInfo (Prelude.Maybe ResourceType)
monitoredResourceInfo_resourceType :: (Maybe ResourceType -> f (Maybe ResourceType))
-> MonitoredResourceInfo -> f MonitoredResourceInfo
monitoredResourceInfo_resourceType = (MonitoredResourceInfo -> Maybe ResourceType)
-> (MonitoredResourceInfo
-> Maybe ResourceType -> MonitoredResourceInfo)
-> Lens
MonitoredResourceInfo
MonitoredResourceInfo
(Maybe ResourceType)
(Maybe ResourceType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MonitoredResourceInfo' {Maybe ResourceType
resourceType :: Maybe ResourceType
$sel:resourceType:MonitoredResourceInfo' :: MonitoredResourceInfo -> Maybe ResourceType
resourceType} -> Maybe ResourceType
resourceType) (\s :: MonitoredResourceInfo
s@MonitoredResourceInfo' {} Maybe ResourceType
a -> MonitoredResourceInfo
s {$sel:resourceType:MonitoredResourceInfo' :: Maybe ResourceType
resourceType = Maybe ResourceType
a} :: MonitoredResourceInfo)
monitoredResourceInfo_arn :: Lens.Lens' MonitoredResourceInfo (Prelude.Maybe Prelude.Text)
monitoredResourceInfo_arn :: (Maybe Text -> f (Maybe Text))
-> MonitoredResourceInfo -> f MonitoredResourceInfo
monitoredResourceInfo_arn = (MonitoredResourceInfo -> Maybe Text)
-> (MonitoredResourceInfo -> Maybe Text -> MonitoredResourceInfo)
-> Lens
MonitoredResourceInfo
MonitoredResourceInfo
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MonitoredResourceInfo' {Maybe Text
arn :: Maybe Text
$sel:arn:MonitoredResourceInfo' :: MonitoredResourceInfo -> Maybe Text
arn} -> Maybe Text
arn) (\s :: MonitoredResourceInfo
s@MonitoredResourceInfo' {} Maybe Text
a -> MonitoredResourceInfo
s {$sel:arn:MonitoredResourceInfo' :: Maybe Text
arn = Maybe Text
a} :: MonitoredResourceInfo)
monitoredResourceInfo_name :: Lens.Lens' MonitoredResourceInfo (Prelude.Maybe Prelude.Text)
monitoredResourceInfo_name :: (Maybe Text -> f (Maybe Text))
-> MonitoredResourceInfo -> f MonitoredResourceInfo
monitoredResourceInfo_name = (MonitoredResourceInfo -> Maybe Text)
-> (MonitoredResourceInfo -> Maybe Text -> MonitoredResourceInfo)
-> Lens
MonitoredResourceInfo
MonitoredResourceInfo
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MonitoredResourceInfo' {Maybe Text
name :: Maybe Text
$sel:name:MonitoredResourceInfo' :: MonitoredResourceInfo -> Maybe Text
name} -> Maybe Text
name) (\s :: MonitoredResourceInfo
s@MonitoredResourceInfo' {} Maybe Text
a -> MonitoredResourceInfo
s {$sel:name:MonitoredResourceInfo' :: Maybe Text
name = Maybe Text
a} :: MonitoredResourceInfo)
instance Core.FromJSON MonitoredResourceInfo where
parseJSON :: Value -> Parser MonitoredResourceInfo
parseJSON =
String
-> (Object -> Parser MonitoredResourceInfo)
-> Value
-> Parser MonitoredResourceInfo
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"MonitoredResourceInfo"
( \Object
x ->
Maybe ResourceType
-> Maybe Text -> Maybe Text -> MonitoredResourceInfo
MonitoredResourceInfo'
(Maybe ResourceType
-> Maybe Text -> Maybe Text -> MonitoredResourceInfo)
-> Parser (Maybe ResourceType)
-> Parser (Maybe Text -> Maybe Text -> MonitoredResourceInfo)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe ResourceType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"resourceType")
Parser (Maybe Text -> Maybe Text -> MonitoredResourceInfo)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> MonitoredResourceInfo)
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 -> MonitoredResourceInfo)
-> Parser (Maybe Text) -> Parser MonitoredResourceInfo
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
"name")
)
instance Prelude.Hashable MonitoredResourceInfo
instance Prelude.NFData MonitoredResourceInfo