{-# 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.HttpInstanceSummary where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Route53AutoNaming.Types.HealthStatus
data HttpInstanceSummary = HttpInstanceSummary'
{
HttpInstanceSummary -> Maybe Text
instanceId :: Prelude.Maybe Prelude.Text,
HttpInstanceSummary -> Maybe Text
namespaceName :: Prelude.Maybe Prelude.Text,
HttpInstanceSummary -> Maybe (HashMap Text Text)
attributes :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
HttpInstanceSummary -> Maybe Text
serviceName :: Prelude.Maybe Prelude.Text,
HttpInstanceSummary -> Maybe HealthStatus
healthStatus :: Prelude.Maybe HealthStatus
}
deriving (HttpInstanceSummary -> HttpInstanceSummary -> Bool
(HttpInstanceSummary -> HttpInstanceSummary -> Bool)
-> (HttpInstanceSummary -> HttpInstanceSummary -> Bool)
-> Eq HttpInstanceSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: HttpInstanceSummary -> HttpInstanceSummary -> Bool
$c/= :: HttpInstanceSummary -> HttpInstanceSummary -> Bool
== :: HttpInstanceSummary -> HttpInstanceSummary -> Bool
$c== :: HttpInstanceSummary -> HttpInstanceSummary -> Bool
Prelude.Eq, ReadPrec [HttpInstanceSummary]
ReadPrec HttpInstanceSummary
Int -> ReadS HttpInstanceSummary
ReadS [HttpInstanceSummary]
(Int -> ReadS HttpInstanceSummary)
-> ReadS [HttpInstanceSummary]
-> ReadPrec HttpInstanceSummary
-> ReadPrec [HttpInstanceSummary]
-> Read HttpInstanceSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [HttpInstanceSummary]
$creadListPrec :: ReadPrec [HttpInstanceSummary]
readPrec :: ReadPrec HttpInstanceSummary
$creadPrec :: ReadPrec HttpInstanceSummary
readList :: ReadS [HttpInstanceSummary]
$creadList :: ReadS [HttpInstanceSummary]
readsPrec :: Int -> ReadS HttpInstanceSummary
$creadsPrec :: Int -> ReadS HttpInstanceSummary
Prelude.Read, Int -> HttpInstanceSummary -> ShowS
[HttpInstanceSummary] -> ShowS
HttpInstanceSummary -> String
(Int -> HttpInstanceSummary -> ShowS)
-> (HttpInstanceSummary -> String)
-> ([HttpInstanceSummary] -> ShowS)
-> Show HttpInstanceSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [HttpInstanceSummary] -> ShowS
$cshowList :: [HttpInstanceSummary] -> ShowS
show :: HttpInstanceSummary -> String
$cshow :: HttpInstanceSummary -> String
showsPrec :: Int -> HttpInstanceSummary -> ShowS
$cshowsPrec :: Int -> HttpInstanceSummary -> ShowS
Prelude.Show, (forall x. HttpInstanceSummary -> Rep HttpInstanceSummary x)
-> (forall x. Rep HttpInstanceSummary x -> HttpInstanceSummary)
-> Generic HttpInstanceSummary
forall x. Rep HttpInstanceSummary x -> HttpInstanceSummary
forall x. HttpInstanceSummary -> Rep HttpInstanceSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep HttpInstanceSummary x -> HttpInstanceSummary
$cfrom :: forall x. HttpInstanceSummary -> Rep HttpInstanceSummary x
Prelude.Generic)
newHttpInstanceSummary ::
HttpInstanceSummary
newHttpInstanceSummary :: HttpInstanceSummary
newHttpInstanceSummary =
HttpInstanceSummary' :: Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe Text
-> Maybe HealthStatus
-> HttpInstanceSummary
HttpInstanceSummary'
{ $sel:instanceId:HttpInstanceSummary' :: Maybe Text
instanceId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:namespaceName:HttpInstanceSummary' :: Maybe Text
namespaceName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:attributes:HttpInstanceSummary' :: Maybe (HashMap Text Text)
attributes = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
$sel:serviceName:HttpInstanceSummary' :: Maybe Text
serviceName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:healthStatus:HttpInstanceSummary' :: Maybe HealthStatus
healthStatus = Maybe HealthStatus
forall a. Maybe a
Prelude.Nothing
}
httpInstanceSummary_instanceId :: Lens.Lens' HttpInstanceSummary (Prelude.Maybe Prelude.Text)
httpInstanceSummary_instanceId :: (Maybe Text -> f (Maybe Text))
-> HttpInstanceSummary -> f HttpInstanceSummary
httpInstanceSummary_instanceId = (HttpInstanceSummary -> Maybe Text)
-> (HttpInstanceSummary -> Maybe Text -> HttpInstanceSummary)
-> Lens
HttpInstanceSummary HttpInstanceSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HttpInstanceSummary' {Maybe Text
instanceId :: Maybe Text
$sel:instanceId:HttpInstanceSummary' :: HttpInstanceSummary -> Maybe Text
instanceId} -> Maybe Text
instanceId) (\s :: HttpInstanceSummary
s@HttpInstanceSummary' {} Maybe Text
a -> HttpInstanceSummary
s {$sel:instanceId:HttpInstanceSummary' :: Maybe Text
instanceId = Maybe Text
a} :: HttpInstanceSummary)
httpInstanceSummary_namespaceName :: Lens.Lens' HttpInstanceSummary (Prelude.Maybe Prelude.Text)
httpInstanceSummary_namespaceName :: (Maybe Text -> f (Maybe Text))
-> HttpInstanceSummary -> f HttpInstanceSummary
httpInstanceSummary_namespaceName = (HttpInstanceSummary -> Maybe Text)
-> (HttpInstanceSummary -> Maybe Text -> HttpInstanceSummary)
-> Lens
HttpInstanceSummary HttpInstanceSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HttpInstanceSummary' {Maybe Text
namespaceName :: Maybe Text
$sel:namespaceName:HttpInstanceSummary' :: HttpInstanceSummary -> Maybe Text
namespaceName} -> Maybe Text
namespaceName) (\s :: HttpInstanceSummary
s@HttpInstanceSummary' {} Maybe Text
a -> HttpInstanceSummary
s {$sel:namespaceName:HttpInstanceSummary' :: Maybe Text
namespaceName = Maybe Text
a} :: HttpInstanceSummary)
httpInstanceSummary_attributes :: Lens.Lens' HttpInstanceSummary (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
httpInstanceSummary_attributes :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> HttpInstanceSummary -> f HttpInstanceSummary
httpInstanceSummary_attributes = (HttpInstanceSummary -> Maybe (HashMap Text Text))
-> (HttpInstanceSummary
-> Maybe (HashMap Text Text) -> HttpInstanceSummary)
-> Lens
HttpInstanceSummary
HttpInstanceSummary
(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 (\HttpInstanceSummary' {Maybe (HashMap Text Text)
attributes :: Maybe (HashMap Text Text)
$sel:attributes:HttpInstanceSummary' :: HttpInstanceSummary -> Maybe (HashMap Text Text)
attributes} -> Maybe (HashMap Text Text)
attributes) (\s :: HttpInstanceSummary
s@HttpInstanceSummary' {} Maybe (HashMap Text Text)
a -> HttpInstanceSummary
s {$sel:attributes:HttpInstanceSummary' :: Maybe (HashMap Text Text)
attributes = Maybe (HashMap Text Text)
a} :: HttpInstanceSummary) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> HttpInstanceSummary -> f HttpInstanceSummary)
-> ((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)))
-> HttpInstanceSummary
-> f HttpInstanceSummary
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
httpInstanceSummary_serviceName :: Lens.Lens' HttpInstanceSummary (Prelude.Maybe Prelude.Text)
httpInstanceSummary_serviceName :: (Maybe Text -> f (Maybe Text))
-> HttpInstanceSummary -> f HttpInstanceSummary
httpInstanceSummary_serviceName = (HttpInstanceSummary -> Maybe Text)
-> (HttpInstanceSummary -> Maybe Text -> HttpInstanceSummary)
-> Lens
HttpInstanceSummary HttpInstanceSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HttpInstanceSummary' {Maybe Text
serviceName :: Maybe Text
$sel:serviceName:HttpInstanceSummary' :: HttpInstanceSummary -> Maybe Text
serviceName} -> Maybe Text
serviceName) (\s :: HttpInstanceSummary
s@HttpInstanceSummary' {} Maybe Text
a -> HttpInstanceSummary
s {$sel:serviceName:HttpInstanceSummary' :: Maybe Text
serviceName = Maybe Text
a} :: HttpInstanceSummary)
httpInstanceSummary_healthStatus :: Lens.Lens' HttpInstanceSummary (Prelude.Maybe HealthStatus)
httpInstanceSummary_healthStatus :: (Maybe HealthStatus -> f (Maybe HealthStatus))
-> HttpInstanceSummary -> f HttpInstanceSummary
httpInstanceSummary_healthStatus = (HttpInstanceSummary -> Maybe HealthStatus)
-> (HttpInstanceSummary
-> Maybe HealthStatus -> HttpInstanceSummary)
-> Lens
HttpInstanceSummary
HttpInstanceSummary
(Maybe HealthStatus)
(Maybe HealthStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HttpInstanceSummary' {Maybe HealthStatus
healthStatus :: Maybe HealthStatus
$sel:healthStatus:HttpInstanceSummary' :: HttpInstanceSummary -> Maybe HealthStatus
healthStatus} -> Maybe HealthStatus
healthStatus) (\s :: HttpInstanceSummary
s@HttpInstanceSummary' {} Maybe HealthStatus
a -> HttpInstanceSummary
s {$sel:healthStatus:HttpInstanceSummary' :: Maybe HealthStatus
healthStatus = Maybe HealthStatus
a} :: HttpInstanceSummary)
instance Core.FromJSON HttpInstanceSummary where
parseJSON :: Value -> Parser HttpInstanceSummary
parseJSON =
String
-> (Object -> Parser HttpInstanceSummary)
-> Value
-> Parser HttpInstanceSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"HttpInstanceSummary"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe Text
-> Maybe HealthStatus
-> HttpInstanceSummary
HttpInstanceSummary'
(Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe Text
-> Maybe HealthStatus
-> HttpInstanceSummary)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe Text
-> Maybe HealthStatus
-> HttpInstanceSummary)
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
"InstanceId")
Parser
(Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe Text
-> Maybe HealthStatus
-> HttpInstanceSummary)
-> Parser (Maybe Text)
-> Parser
(Maybe (HashMap Text Text)
-> Maybe Text -> Maybe HealthStatus -> HttpInstanceSummary)
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
"NamespaceName")
Parser
(Maybe (HashMap Text Text)
-> Maybe Text -> Maybe HealthStatus -> HttpInstanceSummary)
-> Parser (Maybe (HashMap Text Text))
-> Parser (Maybe Text -> Maybe HealthStatus -> HttpInstanceSummary)
forall (f :: * -> *) a b. Applicative f => 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 -> Maybe HealthStatus -> HttpInstanceSummary)
-> Parser (Maybe Text)
-> Parser (Maybe HealthStatus -> HttpInstanceSummary)
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
"ServiceName")
Parser (Maybe HealthStatus -> HttpInstanceSummary)
-> Parser (Maybe HealthStatus) -> Parser HttpInstanceSummary
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe HealthStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"HealthStatus")
)
instance Prelude.Hashable HttpInstanceSummary
instance Prelude.NFData HttpInstanceSummary