{-# 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.Route53AutoNaming.Types.InstanceSummary where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data InstanceSummary = InstanceSummary'
{
InstanceSummary -> Maybe (HashMap Text Text)
attributes :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
InstanceSummary -> Maybe Text
id :: Prelude.Maybe Prelude.Text
}
deriving (InstanceSummary -> InstanceSummary -> Bool
(InstanceSummary -> InstanceSummary -> Bool)
-> (InstanceSummary -> InstanceSummary -> Bool)
-> Eq InstanceSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InstanceSummary -> InstanceSummary -> Bool
$c/= :: InstanceSummary -> InstanceSummary -> Bool
== :: InstanceSummary -> InstanceSummary -> Bool
$c== :: InstanceSummary -> InstanceSummary -> Bool
Prelude.Eq, ReadPrec [InstanceSummary]
ReadPrec InstanceSummary
Int -> ReadS InstanceSummary
ReadS [InstanceSummary]
(Int -> ReadS InstanceSummary)
-> ReadS [InstanceSummary]
-> ReadPrec InstanceSummary
-> ReadPrec [InstanceSummary]
-> Read InstanceSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InstanceSummary]
$creadListPrec :: ReadPrec [InstanceSummary]
readPrec :: ReadPrec InstanceSummary
$creadPrec :: ReadPrec InstanceSummary
readList :: ReadS [InstanceSummary]
$creadList :: ReadS [InstanceSummary]
readsPrec :: Int -> ReadS InstanceSummary
$creadsPrec :: Int -> ReadS InstanceSummary
Prelude.Read, Int -> InstanceSummary -> ShowS
[InstanceSummary] -> ShowS
InstanceSummary -> String
(Int -> InstanceSummary -> ShowS)
-> (InstanceSummary -> String)
-> ([InstanceSummary] -> ShowS)
-> Show InstanceSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InstanceSummary] -> ShowS
$cshowList :: [InstanceSummary] -> ShowS
show :: InstanceSummary -> String
$cshow :: InstanceSummary -> String
showsPrec :: Int -> InstanceSummary -> ShowS
$cshowsPrec :: Int -> InstanceSummary -> ShowS
Prelude.Show, (forall x. InstanceSummary -> Rep InstanceSummary x)
-> (forall x. Rep InstanceSummary x -> InstanceSummary)
-> Generic InstanceSummary
forall x. Rep InstanceSummary x -> InstanceSummary
forall x. InstanceSummary -> Rep InstanceSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InstanceSummary x -> InstanceSummary
$cfrom :: forall x. InstanceSummary -> Rep InstanceSummary x
Prelude.Generic)
newInstanceSummary ::
InstanceSummary
newInstanceSummary :: InstanceSummary
newInstanceSummary =
InstanceSummary' :: Maybe (HashMap Text Text) -> Maybe Text -> InstanceSummary
InstanceSummary'
{ $sel:attributes:InstanceSummary' :: Maybe (HashMap Text Text)
attributes = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
$sel:id:InstanceSummary' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
instanceSummary_attributes :: Lens.Lens' InstanceSummary (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
instanceSummary_attributes :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> InstanceSummary -> f InstanceSummary
instanceSummary_attributes = (InstanceSummary -> Maybe (HashMap Text Text))
-> (InstanceSummary
-> Maybe (HashMap Text Text) -> InstanceSummary)
-> Lens
InstanceSummary
InstanceSummary
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceSummary' {Maybe (HashMap Text Text)
attributes :: Maybe (HashMap Text Text)
$sel:attributes:InstanceSummary' :: InstanceSummary -> Maybe (HashMap Text Text)
attributes} -> Maybe (HashMap Text Text)
attributes) (\s :: InstanceSummary
s@InstanceSummary' {} Maybe (HashMap Text Text)
a -> InstanceSummary
s {$sel:attributes:InstanceSummary' :: Maybe (HashMap Text Text)
attributes = Maybe (HashMap Text Text)
a} :: InstanceSummary) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> InstanceSummary -> f InstanceSummary)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> InstanceSummary
-> f InstanceSummary
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
-> Iso
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text 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
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instanceSummary_id :: Lens.Lens' InstanceSummary (Prelude.Maybe Prelude.Text)
instanceSummary_id :: (Maybe Text -> f (Maybe Text))
-> InstanceSummary -> f InstanceSummary
instanceSummary_id = (InstanceSummary -> Maybe Text)
-> (InstanceSummary -> Maybe Text -> InstanceSummary)
-> Lens InstanceSummary InstanceSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceSummary' {Maybe Text
id :: Maybe Text
$sel:id:InstanceSummary' :: InstanceSummary -> Maybe Text
id} -> Maybe Text
id) (\s :: InstanceSummary
s@InstanceSummary' {} Maybe Text
a -> InstanceSummary
s {$sel:id:InstanceSummary' :: Maybe Text
id = Maybe Text
a} :: InstanceSummary)
instance Core.FromJSON InstanceSummary where
parseJSON :: Value -> Parser InstanceSummary
parseJSON =
String
-> (Object -> Parser InstanceSummary)
-> Value
-> Parser InstanceSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"InstanceSummary"
( \Object
x ->
Maybe (HashMap Text Text) -> Maybe Text -> InstanceSummary
InstanceSummary'
(Maybe (HashMap Text Text) -> Maybe Text -> InstanceSummary)
-> Parser (Maybe (HashMap Text Text))
-> Parser (Maybe Text -> InstanceSummary)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Attributes" Parser (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> Parser (Maybe (HashMap Text Text))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
Parser (Maybe Text -> InstanceSummary)
-> Parser (Maybe Text) -> Parser InstanceSummary
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
"Id")
)
instance Prelude.Hashable InstanceSummary
instance Prelude.NFData InstanceSummary