{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.MQ.Types.BrokerSummary
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.MQ.Types.BrokerSummary where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MQ.Types.BrokerState
import Amazonka.MQ.Types.DeploymentMode
import Amazonka.MQ.Types.EngineType
import qualified Amazonka.Prelude as Prelude

-- | Returns information about all brokers.
--
-- /See:/ 'newBrokerSummary' smart constructor.
data BrokerSummary = BrokerSummary'
  { -- | The broker\'s name. This value is unique in your AWS account, 1-50
    -- characters long, and containing only letters, numbers, dashes, and
    -- underscores, and must not contain white spaces, brackets, wildcard
    -- characters, or special characters.
    BrokerSummary -> Maybe Text
brokerName :: Prelude.Maybe Prelude.Text,
    -- | The broker\'s status.
    BrokerSummary -> Maybe BrokerState
brokerState :: Prelude.Maybe BrokerState,
    -- | The time when the broker was created.
    BrokerSummary -> Maybe POSIX
created :: Prelude.Maybe Core.POSIX,
    -- | The unique ID that Amazon MQ generates for the broker.
    BrokerSummary -> Maybe Text
brokerId :: Prelude.Maybe Prelude.Text,
    -- | The broker\'s Amazon Resource Name (ARN).
    BrokerSummary -> Maybe Text
brokerArn :: Prelude.Maybe Prelude.Text,
    -- | The broker\'s instance type.
    BrokerSummary -> Maybe Text
hostInstanceType :: Prelude.Maybe Prelude.Text,
    -- | The broker\'s deployment mode.
    BrokerSummary -> DeploymentMode
deploymentMode :: DeploymentMode,
    -- | The type of broker engine.
    BrokerSummary -> EngineType
engineType :: EngineType
  }
  deriving (BrokerSummary -> BrokerSummary -> Bool
(BrokerSummary -> BrokerSummary -> Bool)
-> (BrokerSummary -> BrokerSummary -> Bool) -> Eq BrokerSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BrokerSummary -> BrokerSummary -> Bool
$c/= :: BrokerSummary -> BrokerSummary -> Bool
== :: BrokerSummary -> BrokerSummary -> Bool
$c== :: BrokerSummary -> BrokerSummary -> Bool
Prelude.Eq, ReadPrec [BrokerSummary]
ReadPrec BrokerSummary
Int -> ReadS BrokerSummary
ReadS [BrokerSummary]
(Int -> ReadS BrokerSummary)
-> ReadS [BrokerSummary]
-> ReadPrec BrokerSummary
-> ReadPrec [BrokerSummary]
-> Read BrokerSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BrokerSummary]
$creadListPrec :: ReadPrec [BrokerSummary]
readPrec :: ReadPrec BrokerSummary
$creadPrec :: ReadPrec BrokerSummary
readList :: ReadS [BrokerSummary]
$creadList :: ReadS [BrokerSummary]
readsPrec :: Int -> ReadS BrokerSummary
$creadsPrec :: Int -> ReadS BrokerSummary
Prelude.Read, Int -> BrokerSummary -> ShowS
[BrokerSummary] -> ShowS
BrokerSummary -> String
(Int -> BrokerSummary -> ShowS)
-> (BrokerSummary -> String)
-> ([BrokerSummary] -> ShowS)
-> Show BrokerSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BrokerSummary] -> ShowS
$cshowList :: [BrokerSummary] -> ShowS
show :: BrokerSummary -> String
$cshow :: BrokerSummary -> String
showsPrec :: Int -> BrokerSummary -> ShowS
$cshowsPrec :: Int -> BrokerSummary -> ShowS
Prelude.Show, (forall x. BrokerSummary -> Rep BrokerSummary x)
-> (forall x. Rep BrokerSummary x -> BrokerSummary)
-> Generic BrokerSummary
forall x. Rep BrokerSummary x -> BrokerSummary
forall x. BrokerSummary -> Rep BrokerSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BrokerSummary x -> BrokerSummary
$cfrom :: forall x. BrokerSummary -> Rep BrokerSummary x
Prelude.Generic)

-- |
-- Create a value of 'BrokerSummary' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'brokerName', 'brokerSummary_brokerName' - The broker\'s name. This value is unique in your AWS account, 1-50
-- characters long, and containing only letters, numbers, dashes, and
-- underscores, and must not contain white spaces, brackets, wildcard
-- characters, or special characters.
--
-- 'brokerState', 'brokerSummary_brokerState' - The broker\'s status.
--
-- 'created', 'brokerSummary_created' - The time when the broker was created.
--
-- 'brokerId', 'brokerSummary_brokerId' - The unique ID that Amazon MQ generates for the broker.
--
-- 'brokerArn', 'brokerSummary_brokerArn' - The broker\'s Amazon Resource Name (ARN).
--
-- 'hostInstanceType', 'brokerSummary_hostInstanceType' - The broker\'s instance type.
--
-- 'deploymentMode', 'brokerSummary_deploymentMode' - The broker\'s deployment mode.
--
-- 'engineType', 'brokerSummary_engineType' - The type of broker engine.
newBrokerSummary ::
  -- | 'deploymentMode'
  DeploymentMode ->
  -- | 'engineType'
  EngineType ->
  BrokerSummary
newBrokerSummary :: DeploymentMode -> EngineType -> BrokerSummary
newBrokerSummary DeploymentMode
pDeploymentMode_ EngineType
pEngineType_ =
  BrokerSummary' :: Maybe Text
-> Maybe BrokerState
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> DeploymentMode
-> EngineType
-> BrokerSummary
BrokerSummary'
    { $sel:brokerName:BrokerSummary' :: Maybe Text
brokerName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:brokerState:BrokerSummary' :: Maybe BrokerState
brokerState = Maybe BrokerState
forall a. Maybe a
Prelude.Nothing,
      $sel:created:BrokerSummary' :: Maybe POSIX
created = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:brokerId:BrokerSummary' :: Maybe Text
brokerId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:brokerArn:BrokerSummary' :: Maybe Text
brokerArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:hostInstanceType:BrokerSummary' :: Maybe Text
hostInstanceType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:deploymentMode:BrokerSummary' :: DeploymentMode
deploymentMode = DeploymentMode
pDeploymentMode_,
      $sel:engineType:BrokerSummary' :: EngineType
engineType = EngineType
pEngineType_
    }

-- | The broker\'s name. This value is unique in your AWS account, 1-50
-- characters long, and containing only letters, numbers, dashes, and
-- underscores, and must not contain white spaces, brackets, wildcard
-- characters, or special characters.
brokerSummary_brokerName :: Lens.Lens' BrokerSummary (Prelude.Maybe Prelude.Text)
brokerSummary_brokerName :: (Maybe Text -> f (Maybe Text)) -> BrokerSummary -> f BrokerSummary
brokerSummary_brokerName = (BrokerSummary -> Maybe Text)
-> (BrokerSummary -> Maybe Text -> BrokerSummary)
-> Lens BrokerSummary BrokerSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BrokerSummary' {Maybe Text
brokerName :: Maybe Text
$sel:brokerName:BrokerSummary' :: BrokerSummary -> Maybe Text
brokerName} -> Maybe Text
brokerName) (\s :: BrokerSummary
s@BrokerSummary' {} Maybe Text
a -> BrokerSummary
s {$sel:brokerName:BrokerSummary' :: Maybe Text
brokerName = Maybe Text
a} :: BrokerSummary)

-- | The broker\'s status.
brokerSummary_brokerState :: Lens.Lens' BrokerSummary (Prelude.Maybe BrokerState)
brokerSummary_brokerState :: (Maybe BrokerState -> f (Maybe BrokerState))
-> BrokerSummary -> f BrokerSummary
brokerSummary_brokerState = (BrokerSummary -> Maybe BrokerState)
-> (BrokerSummary -> Maybe BrokerState -> BrokerSummary)
-> Lens
     BrokerSummary BrokerSummary (Maybe BrokerState) (Maybe BrokerState)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BrokerSummary' {Maybe BrokerState
brokerState :: Maybe BrokerState
$sel:brokerState:BrokerSummary' :: BrokerSummary -> Maybe BrokerState
brokerState} -> Maybe BrokerState
brokerState) (\s :: BrokerSummary
s@BrokerSummary' {} Maybe BrokerState
a -> BrokerSummary
s {$sel:brokerState:BrokerSummary' :: Maybe BrokerState
brokerState = Maybe BrokerState
a} :: BrokerSummary)

-- | The time when the broker was created.
brokerSummary_created :: Lens.Lens' BrokerSummary (Prelude.Maybe Prelude.UTCTime)
brokerSummary_created :: (Maybe UTCTime -> f (Maybe UTCTime))
-> BrokerSummary -> f BrokerSummary
brokerSummary_created = (BrokerSummary -> Maybe POSIX)
-> (BrokerSummary -> Maybe POSIX -> BrokerSummary)
-> Lens BrokerSummary BrokerSummary (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BrokerSummary' {Maybe POSIX
created :: Maybe POSIX
$sel:created:BrokerSummary' :: BrokerSummary -> Maybe POSIX
created} -> Maybe POSIX
created) (\s :: BrokerSummary
s@BrokerSummary' {} Maybe POSIX
a -> BrokerSummary
s {$sel:created:BrokerSummary' :: Maybe POSIX
created = Maybe POSIX
a} :: BrokerSummary) ((Maybe POSIX -> f (Maybe POSIX))
 -> BrokerSummary -> f BrokerSummary)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> BrokerSummary
-> f BrokerSummary
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The unique ID that Amazon MQ generates for the broker.
brokerSummary_brokerId :: Lens.Lens' BrokerSummary (Prelude.Maybe Prelude.Text)
brokerSummary_brokerId :: (Maybe Text -> f (Maybe Text)) -> BrokerSummary -> f BrokerSummary
brokerSummary_brokerId = (BrokerSummary -> Maybe Text)
-> (BrokerSummary -> Maybe Text -> BrokerSummary)
-> Lens BrokerSummary BrokerSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BrokerSummary' {Maybe Text
brokerId :: Maybe Text
$sel:brokerId:BrokerSummary' :: BrokerSummary -> Maybe Text
brokerId} -> Maybe Text
brokerId) (\s :: BrokerSummary
s@BrokerSummary' {} Maybe Text
a -> BrokerSummary
s {$sel:brokerId:BrokerSummary' :: Maybe Text
brokerId = Maybe Text
a} :: BrokerSummary)

-- | The broker\'s Amazon Resource Name (ARN).
brokerSummary_brokerArn :: Lens.Lens' BrokerSummary (Prelude.Maybe Prelude.Text)
brokerSummary_brokerArn :: (Maybe Text -> f (Maybe Text)) -> BrokerSummary -> f BrokerSummary
brokerSummary_brokerArn = (BrokerSummary -> Maybe Text)
-> (BrokerSummary -> Maybe Text -> BrokerSummary)
-> Lens BrokerSummary BrokerSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BrokerSummary' {Maybe Text
brokerArn :: Maybe Text
$sel:brokerArn:BrokerSummary' :: BrokerSummary -> Maybe Text
brokerArn} -> Maybe Text
brokerArn) (\s :: BrokerSummary
s@BrokerSummary' {} Maybe Text
a -> BrokerSummary
s {$sel:brokerArn:BrokerSummary' :: Maybe Text
brokerArn = Maybe Text
a} :: BrokerSummary)

-- | The broker\'s instance type.
brokerSummary_hostInstanceType :: Lens.Lens' BrokerSummary (Prelude.Maybe Prelude.Text)
brokerSummary_hostInstanceType :: (Maybe Text -> f (Maybe Text)) -> BrokerSummary -> f BrokerSummary
brokerSummary_hostInstanceType = (BrokerSummary -> Maybe Text)
-> (BrokerSummary -> Maybe Text -> BrokerSummary)
-> Lens BrokerSummary BrokerSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BrokerSummary' {Maybe Text
hostInstanceType :: Maybe Text
$sel:hostInstanceType:BrokerSummary' :: BrokerSummary -> Maybe Text
hostInstanceType} -> Maybe Text
hostInstanceType) (\s :: BrokerSummary
s@BrokerSummary' {} Maybe Text
a -> BrokerSummary
s {$sel:hostInstanceType:BrokerSummary' :: Maybe Text
hostInstanceType = Maybe Text
a} :: BrokerSummary)

-- | The broker\'s deployment mode.
brokerSummary_deploymentMode :: Lens.Lens' BrokerSummary DeploymentMode
brokerSummary_deploymentMode :: (DeploymentMode -> f DeploymentMode)
-> BrokerSummary -> f BrokerSummary
brokerSummary_deploymentMode = (BrokerSummary -> DeploymentMode)
-> (BrokerSummary -> DeploymentMode -> BrokerSummary)
-> Lens BrokerSummary BrokerSummary DeploymentMode DeploymentMode
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BrokerSummary' {DeploymentMode
deploymentMode :: DeploymentMode
$sel:deploymentMode:BrokerSummary' :: BrokerSummary -> DeploymentMode
deploymentMode} -> DeploymentMode
deploymentMode) (\s :: BrokerSummary
s@BrokerSummary' {} DeploymentMode
a -> BrokerSummary
s {$sel:deploymentMode:BrokerSummary' :: DeploymentMode
deploymentMode = DeploymentMode
a} :: BrokerSummary)

-- | The type of broker engine.
brokerSummary_engineType :: Lens.Lens' BrokerSummary EngineType
brokerSummary_engineType :: (EngineType -> f EngineType) -> BrokerSummary -> f BrokerSummary
brokerSummary_engineType = (BrokerSummary -> EngineType)
-> (BrokerSummary -> EngineType -> BrokerSummary)
-> Lens BrokerSummary BrokerSummary EngineType EngineType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BrokerSummary' {EngineType
engineType :: EngineType
$sel:engineType:BrokerSummary' :: BrokerSummary -> EngineType
engineType} -> EngineType
engineType) (\s :: BrokerSummary
s@BrokerSummary' {} EngineType
a -> BrokerSummary
s {$sel:engineType:BrokerSummary' :: EngineType
engineType = EngineType
a} :: BrokerSummary)

instance Core.FromJSON BrokerSummary where
  parseJSON :: Value -> Parser BrokerSummary
parseJSON =
    String
-> (Object -> Parser BrokerSummary)
-> Value
-> Parser BrokerSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"BrokerSummary"
      ( \Object
x ->
          Maybe Text
-> Maybe BrokerState
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> DeploymentMode
-> EngineType
-> BrokerSummary
BrokerSummary'
            (Maybe Text
 -> Maybe BrokerState
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> DeploymentMode
 -> EngineType
 -> BrokerSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe BrokerState
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> DeploymentMode
      -> EngineType
      -> BrokerSummary)
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
"brokerName")
            Parser
  (Maybe BrokerState
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> DeploymentMode
   -> EngineType
   -> BrokerSummary)
-> Parser (Maybe BrokerState)
-> Parser
     (Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> DeploymentMode
      -> EngineType
      -> BrokerSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe BrokerState)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"brokerState")
            Parser
  (Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> DeploymentMode
   -> EngineType
   -> BrokerSummary)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> DeploymentMode
      -> EngineType
      -> BrokerSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"created")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> DeploymentMode
   -> EngineType
   -> BrokerSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text -> DeploymentMode -> EngineType -> BrokerSummary)
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
"brokerId")
            Parser
  (Maybe Text
   -> Maybe Text -> DeploymentMode -> EngineType -> BrokerSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text -> DeploymentMode -> EngineType -> BrokerSummary)
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
"brokerArn")
            Parser
  (Maybe Text -> DeploymentMode -> EngineType -> BrokerSummary)
-> Parser (Maybe Text)
-> Parser (DeploymentMode -> EngineType -> BrokerSummary)
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
"hostInstanceType")
            Parser (DeploymentMode -> EngineType -> BrokerSummary)
-> Parser DeploymentMode -> Parser (EngineType -> BrokerSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser DeploymentMode
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"deploymentMode")
            Parser (EngineType -> BrokerSummary)
-> Parser EngineType -> Parser BrokerSummary
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser EngineType
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"engineType")
      )

instance Prelude.Hashable BrokerSummary

instance Prelude.NFData BrokerSummary