{-# 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.CloudControl.Types.ResourceDescription where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ResourceDescription = ResourceDescription'
{
ResourceDescription -> Maybe Text
identifier :: Prelude.Maybe Prelude.Text,
ResourceDescription -> Maybe (Sensitive Text)
properties :: Prelude.Maybe (Core.Sensitive Prelude.Text)
}
deriving (ResourceDescription -> ResourceDescription -> Bool
(ResourceDescription -> ResourceDescription -> Bool)
-> (ResourceDescription -> ResourceDescription -> Bool)
-> Eq ResourceDescription
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ResourceDescription -> ResourceDescription -> Bool
$c/= :: ResourceDescription -> ResourceDescription -> Bool
== :: ResourceDescription -> ResourceDescription -> Bool
$c== :: ResourceDescription -> ResourceDescription -> Bool
Prelude.Eq, Int -> ResourceDescription -> ShowS
[ResourceDescription] -> ShowS
ResourceDescription -> String
(Int -> ResourceDescription -> ShowS)
-> (ResourceDescription -> String)
-> ([ResourceDescription] -> ShowS)
-> Show ResourceDescription
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ResourceDescription] -> ShowS
$cshowList :: [ResourceDescription] -> ShowS
show :: ResourceDescription -> String
$cshow :: ResourceDescription -> String
showsPrec :: Int -> ResourceDescription -> ShowS
$cshowsPrec :: Int -> ResourceDescription -> ShowS
Prelude.Show, (forall x. ResourceDescription -> Rep ResourceDescription x)
-> (forall x. Rep ResourceDescription x -> ResourceDescription)
-> Generic ResourceDescription
forall x. Rep ResourceDescription x -> ResourceDescription
forall x. ResourceDescription -> Rep ResourceDescription x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ResourceDescription x -> ResourceDescription
$cfrom :: forall x. ResourceDescription -> Rep ResourceDescription x
Prelude.Generic)
newResourceDescription ::
ResourceDescription
newResourceDescription :: ResourceDescription
newResourceDescription =
ResourceDescription' :: Maybe Text -> Maybe (Sensitive Text) -> ResourceDescription
ResourceDescription'
{ $sel:identifier:ResourceDescription' :: Maybe Text
identifier = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:properties:ResourceDescription' :: Maybe (Sensitive Text)
properties = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing
}
resourceDescription_identifier :: Lens.Lens' ResourceDescription (Prelude.Maybe Prelude.Text)
resourceDescription_identifier :: (Maybe Text -> f (Maybe Text))
-> ResourceDescription -> f ResourceDescription
resourceDescription_identifier = (ResourceDescription -> Maybe Text)
-> (ResourceDescription -> Maybe Text -> ResourceDescription)
-> Lens
ResourceDescription ResourceDescription (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceDescription' {Maybe Text
identifier :: Maybe Text
$sel:identifier:ResourceDescription' :: ResourceDescription -> Maybe Text
identifier} -> Maybe Text
identifier) (\s :: ResourceDescription
s@ResourceDescription' {} Maybe Text
a -> ResourceDescription
s {$sel:identifier:ResourceDescription' :: Maybe Text
identifier = Maybe Text
a} :: ResourceDescription)
resourceDescription_properties :: Lens.Lens' ResourceDescription (Prelude.Maybe Prelude.Text)
resourceDescription_properties :: (Maybe Text -> f (Maybe Text))
-> ResourceDescription -> f ResourceDescription
resourceDescription_properties = (ResourceDescription -> Maybe (Sensitive Text))
-> (ResourceDescription
-> Maybe (Sensitive Text) -> ResourceDescription)
-> Lens
ResourceDescription
ResourceDescription
(Maybe (Sensitive Text))
(Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceDescription' {Maybe (Sensitive Text)
properties :: Maybe (Sensitive Text)
$sel:properties:ResourceDescription' :: ResourceDescription -> Maybe (Sensitive Text)
properties} -> Maybe (Sensitive Text)
properties) (\s :: ResourceDescription
s@ResourceDescription' {} Maybe (Sensitive Text)
a -> ResourceDescription
s {$sel:properties:ResourceDescription' :: Maybe (Sensitive Text)
properties = Maybe (Sensitive Text)
a} :: ResourceDescription) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> ResourceDescription -> f ResourceDescription)
-> ((Maybe Text -> f (Maybe Text))
-> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> ResourceDescription
-> f ResourceDescription
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
(Maybe (Sensitive Text))
(Maybe (Sensitive Text))
(Maybe Text)
(Maybe 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 (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive
instance Core.FromJSON ResourceDescription where
parseJSON :: Value -> Parser ResourceDescription
parseJSON =
String
-> (Object -> Parser ResourceDescription)
-> Value
-> Parser ResourceDescription
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ResourceDescription"
( \Object
x ->
Maybe Text -> Maybe (Sensitive Text) -> ResourceDescription
ResourceDescription'
(Maybe Text -> Maybe (Sensitive Text) -> ResourceDescription)
-> Parser (Maybe Text)
-> Parser (Maybe (Sensitive Text) -> ResourceDescription)
forall (f :: * -> *) a b. Functor 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
"Identifier")
Parser (Maybe (Sensitive Text) -> ResourceDescription)
-> Parser (Maybe (Sensitive Text)) -> Parser ResourceDescription
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Sensitive Text))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Properties")
)
instance Prelude.Hashable ResourceDescription
instance Prelude.NFData ResourceDescription