{-# 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.MQ.Types.BrokerInstance where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data BrokerInstance = BrokerInstance'
{
BrokerInstance -> Maybe Text
consoleURL :: Prelude.Maybe Prelude.Text,
BrokerInstance -> Maybe [Text]
endpoints :: Prelude.Maybe [Prelude.Text],
BrokerInstance -> Maybe Text
ipAddress :: Prelude.Maybe Prelude.Text
}
deriving (BrokerInstance -> BrokerInstance -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BrokerInstance -> BrokerInstance -> Bool
$c/= :: BrokerInstance -> BrokerInstance -> Bool
== :: BrokerInstance -> BrokerInstance -> Bool
$c== :: BrokerInstance -> BrokerInstance -> Bool
Prelude.Eq, ReadPrec [BrokerInstance]
ReadPrec BrokerInstance
Int -> ReadS BrokerInstance
ReadS [BrokerInstance]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BrokerInstance]
$creadListPrec :: ReadPrec [BrokerInstance]
readPrec :: ReadPrec BrokerInstance
$creadPrec :: ReadPrec BrokerInstance
readList :: ReadS [BrokerInstance]
$creadList :: ReadS [BrokerInstance]
readsPrec :: Int -> ReadS BrokerInstance
$creadsPrec :: Int -> ReadS BrokerInstance
Prelude.Read, Int -> BrokerInstance -> ShowS
[BrokerInstance] -> ShowS
BrokerInstance -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BrokerInstance] -> ShowS
$cshowList :: [BrokerInstance] -> ShowS
show :: BrokerInstance -> String
$cshow :: BrokerInstance -> String
showsPrec :: Int -> BrokerInstance -> ShowS
$cshowsPrec :: Int -> BrokerInstance -> ShowS
Prelude.Show, forall x. Rep BrokerInstance x -> BrokerInstance
forall x. BrokerInstance -> Rep BrokerInstance x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BrokerInstance x -> BrokerInstance
$cfrom :: forall x. BrokerInstance -> Rep BrokerInstance x
Prelude.Generic)
newBrokerInstance ::
BrokerInstance
newBrokerInstance :: BrokerInstance
newBrokerInstance =
BrokerInstance'
{ $sel:consoleURL:BrokerInstance' :: Maybe Text
consoleURL = forall a. Maybe a
Prelude.Nothing,
$sel:endpoints:BrokerInstance' :: Maybe [Text]
endpoints = forall a. Maybe a
Prelude.Nothing,
$sel:ipAddress:BrokerInstance' :: Maybe Text
ipAddress = forall a. Maybe a
Prelude.Nothing
}
brokerInstance_consoleURL :: Lens.Lens' BrokerInstance (Prelude.Maybe Prelude.Text)
brokerInstance_consoleURL :: Lens' BrokerInstance (Maybe Text)
brokerInstance_consoleURL = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BrokerInstance' {Maybe Text
consoleURL :: Maybe Text
$sel:consoleURL:BrokerInstance' :: BrokerInstance -> Maybe Text
consoleURL} -> Maybe Text
consoleURL) (\s :: BrokerInstance
s@BrokerInstance' {} Maybe Text
a -> BrokerInstance
s {$sel:consoleURL:BrokerInstance' :: Maybe Text
consoleURL = Maybe Text
a} :: BrokerInstance)
brokerInstance_endpoints :: Lens.Lens' BrokerInstance (Prelude.Maybe [Prelude.Text])
brokerInstance_endpoints :: Lens' BrokerInstance (Maybe [Text])
brokerInstance_endpoints = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BrokerInstance' {Maybe [Text]
endpoints :: Maybe [Text]
$sel:endpoints:BrokerInstance' :: BrokerInstance -> Maybe [Text]
endpoints} -> Maybe [Text]
endpoints) (\s :: BrokerInstance
s@BrokerInstance' {} Maybe [Text]
a -> BrokerInstance
s {$sel:endpoints:BrokerInstance' :: Maybe [Text]
endpoints = Maybe [Text]
a} :: BrokerInstance) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
brokerInstance_ipAddress :: Lens.Lens' BrokerInstance (Prelude.Maybe Prelude.Text)
brokerInstance_ipAddress :: Lens' BrokerInstance (Maybe Text)
brokerInstance_ipAddress = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BrokerInstance' {Maybe Text
ipAddress :: Maybe Text
$sel:ipAddress:BrokerInstance' :: BrokerInstance -> Maybe Text
ipAddress} -> Maybe Text
ipAddress) (\s :: BrokerInstance
s@BrokerInstance' {} Maybe Text
a -> BrokerInstance
s {$sel:ipAddress:BrokerInstance' :: Maybe Text
ipAddress = Maybe Text
a} :: BrokerInstance)
instance Data.FromJSON BrokerInstance where
parseJSON :: Value -> Parser BrokerInstance
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"BrokerInstance"
( \Object
x ->
Maybe Text -> Maybe [Text] -> Maybe Text -> BrokerInstance
BrokerInstance'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"consoleURL")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"endpoints" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ipAddress")
)
instance Prelude.Hashable BrokerInstance where
hashWithSalt :: Int -> BrokerInstance -> Int
hashWithSalt Int
_salt BrokerInstance' {Maybe [Text]
Maybe Text
ipAddress :: Maybe Text
endpoints :: Maybe [Text]
consoleURL :: Maybe Text
$sel:ipAddress:BrokerInstance' :: BrokerInstance -> Maybe Text
$sel:endpoints:BrokerInstance' :: BrokerInstance -> Maybe [Text]
$sel:consoleURL:BrokerInstance' :: BrokerInstance -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
consoleURL
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
endpoints
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
ipAddress
instance Prelude.NFData BrokerInstance where
rnf :: BrokerInstance -> ()
rnf BrokerInstance' {Maybe [Text]
Maybe Text
ipAddress :: Maybe Text
endpoints :: Maybe [Text]
consoleURL :: Maybe Text
$sel:ipAddress:BrokerInstance' :: BrokerInstance -> Maybe Text
$sel:endpoints:BrokerInstance' :: BrokerInstance -> Maybe [Text]
$sel:consoleURL:BrokerInstance' :: BrokerInstance -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
consoleURL
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
endpoints
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
ipAddress