{-# 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.Kafka.Types.BrokerSoftwareInfo
-- 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.Kafka.Types.BrokerSoftwareInfo where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Information about the current software installed on the cluster.
--
-- /See:/ 'newBrokerSoftwareInfo' smart constructor.
data BrokerSoftwareInfo = BrokerSoftwareInfo'
  { -- | The revision of the configuration to use. This field isn\'t visible in
    -- this preview release.
    BrokerSoftwareInfo -> Maybe Integer
configurationRevision :: Prelude.Maybe Prelude.Integer,
    -- | The version of Apache Kafka.
    BrokerSoftwareInfo -> Maybe Text
kafkaVersion :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the configuration used for the
    -- cluster. This field isn\'t visible in this preview release.
    BrokerSoftwareInfo -> Maybe Text
configurationArn :: Prelude.Maybe Prelude.Text
  }
  deriving (BrokerSoftwareInfo -> BrokerSoftwareInfo -> Bool
(BrokerSoftwareInfo -> BrokerSoftwareInfo -> Bool)
-> (BrokerSoftwareInfo -> BrokerSoftwareInfo -> Bool)
-> Eq BrokerSoftwareInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BrokerSoftwareInfo -> BrokerSoftwareInfo -> Bool
$c/= :: BrokerSoftwareInfo -> BrokerSoftwareInfo -> Bool
== :: BrokerSoftwareInfo -> BrokerSoftwareInfo -> Bool
$c== :: BrokerSoftwareInfo -> BrokerSoftwareInfo -> Bool
Prelude.Eq, ReadPrec [BrokerSoftwareInfo]
ReadPrec BrokerSoftwareInfo
Int -> ReadS BrokerSoftwareInfo
ReadS [BrokerSoftwareInfo]
(Int -> ReadS BrokerSoftwareInfo)
-> ReadS [BrokerSoftwareInfo]
-> ReadPrec BrokerSoftwareInfo
-> ReadPrec [BrokerSoftwareInfo]
-> Read BrokerSoftwareInfo
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BrokerSoftwareInfo]
$creadListPrec :: ReadPrec [BrokerSoftwareInfo]
readPrec :: ReadPrec BrokerSoftwareInfo
$creadPrec :: ReadPrec BrokerSoftwareInfo
readList :: ReadS [BrokerSoftwareInfo]
$creadList :: ReadS [BrokerSoftwareInfo]
readsPrec :: Int -> ReadS BrokerSoftwareInfo
$creadsPrec :: Int -> ReadS BrokerSoftwareInfo
Prelude.Read, Int -> BrokerSoftwareInfo -> ShowS
[BrokerSoftwareInfo] -> ShowS
BrokerSoftwareInfo -> String
(Int -> BrokerSoftwareInfo -> ShowS)
-> (BrokerSoftwareInfo -> String)
-> ([BrokerSoftwareInfo] -> ShowS)
-> Show BrokerSoftwareInfo
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BrokerSoftwareInfo] -> ShowS
$cshowList :: [BrokerSoftwareInfo] -> ShowS
show :: BrokerSoftwareInfo -> String
$cshow :: BrokerSoftwareInfo -> String
showsPrec :: Int -> BrokerSoftwareInfo -> ShowS
$cshowsPrec :: Int -> BrokerSoftwareInfo -> ShowS
Prelude.Show, (forall x. BrokerSoftwareInfo -> Rep BrokerSoftwareInfo x)
-> (forall x. Rep BrokerSoftwareInfo x -> BrokerSoftwareInfo)
-> Generic BrokerSoftwareInfo
forall x. Rep BrokerSoftwareInfo x -> BrokerSoftwareInfo
forall x. BrokerSoftwareInfo -> Rep BrokerSoftwareInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BrokerSoftwareInfo x -> BrokerSoftwareInfo
$cfrom :: forall x. BrokerSoftwareInfo -> Rep BrokerSoftwareInfo x
Prelude.Generic)

-- |
-- Create a value of 'BrokerSoftwareInfo' 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:
--
-- 'configurationRevision', 'brokerSoftwareInfo_configurationRevision' - The revision of the configuration to use. This field isn\'t visible in
-- this preview release.
--
-- 'kafkaVersion', 'brokerSoftwareInfo_kafkaVersion' - The version of Apache Kafka.
--
-- 'configurationArn', 'brokerSoftwareInfo_configurationArn' - The Amazon Resource Name (ARN) of the configuration used for the
-- cluster. This field isn\'t visible in this preview release.
newBrokerSoftwareInfo ::
  BrokerSoftwareInfo
newBrokerSoftwareInfo :: BrokerSoftwareInfo
newBrokerSoftwareInfo =
  BrokerSoftwareInfo' :: Maybe Integer -> Maybe Text -> Maybe Text -> BrokerSoftwareInfo
BrokerSoftwareInfo'
    { $sel:configurationRevision:BrokerSoftwareInfo' :: Maybe Integer
configurationRevision =
        Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:kafkaVersion:BrokerSoftwareInfo' :: Maybe Text
kafkaVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:configurationArn:BrokerSoftwareInfo' :: Maybe Text
configurationArn = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The revision of the configuration to use. This field isn\'t visible in
-- this preview release.
brokerSoftwareInfo_configurationRevision :: Lens.Lens' BrokerSoftwareInfo (Prelude.Maybe Prelude.Integer)
brokerSoftwareInfo_configurationRevision :: (Maybe Integer -> f (Maybe Integer))
-> BrokerSoftwareInfo -> f BrokerSoftwareInfo
brokerSoftwareInfo_configurationRevision = (BrokerSoftwareInfo -> Maybe Integer)
-> (BrokerSoftwareInfo -> Maybe Integer -> BrokerSoftwareInfo)
-> Lens
     BrokerSoftwareInfo
     BrokerSoftwareInfo
     (Maybe Integer)
     (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BrokerSoftwareInfo' {Maybe Integer
configurationRevision :: Maybe Integer
$sel:configurationRevision:BrokerSoftwareInfo' :: BrokerSoftwareInfo -> Maybe Integer
configurationRevision} -> Maybe Integer
configurationRevision) (\s :: BrokerSoftwareInfo
s@BrokerSoftwareInfo' {} Maybe Integer
a -> BrokerSoftwareInfo
s {$sel:configurationRevision:BrokerSoftwareInfo' :: Maybe Integer
configurationRevision = Maybe Integer
a} :: BrokerSoftwareInfo)

-- | The version of Apache Kafka.
brokerSoftwareInfo_kafkaVersion :: Lens.Lens' BrokerSoftwareInfo (Prelude.Maybe Prelude.Text)
brokerSoftwareInfo_kafkaVersion :: (Maybe Text -> f (Maybe Text))
-> BrokerSoftwareInfo -> f BrokerSoftwareInfo
brokerSoftwareInfo_kafkaVersion = (BrokerSoftwareInfo -> Maybe Text)
-> (BrokerSoftwareInfo -> Maybe Text -> BrokerSoftwareInfo)
-> Lens
     BrokerSoftwareInfo BrokerSoftwareInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BrokerSoftwareInfo' {Maybe Text
kafkaVersion :: Maybe Text
$sel:kafkaVersion:BrokerSoftwareInfo' :: BrokerSoftwareInfo -> Maybe Text
kafkaVersion} -> Maybe Text
kafkaVersion) (\s :: BrokerSoftwareInfo
s@BrokerSoftwareInfo' {} Maybe Text
a -> BrokerSoftwareInfo
s {$sel:kafkaVersion:BrokerSoftwareInfo' :: Maybe Text
kafkaVersion = Maybe Text
a} :: BrokerSoftwareInfo)

-- | The Amazon Resource Name (ARN) of the configuration used for the
-- cluster. This field isn\'t visible in this preview release.
brokerSoftwareInfo_configurationArn :: Lens.Lens' BrokerSoftwareInfo (Prelude.Maybe Prelude.Text)
brokerSoftwareInfo_configurationArn :: (Maybe Text -> f (Maybe Text))
-> BrokerSoftwareInfo -> f BrokerSoftwareInfo
brokerSoftwareInfo_configurationArn = (BrokerSoftwareInfo -> Maybe Text)
-> (BrokerSoftwareInfo -> Maybe Text -> BrokerSoftwareInfo)
-> Lens
     BrokerSoftwareInfo BrokerSoftwareInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BrokerSoftwareInfo' {Maybe Text
configurationArn :: Maybe Text
$sel:configurationArn:BrokerSoftwareInfo' :: BrokerSoftwareInfo -> Maybe Text
configurationArn} -> Maybe Text
configurationArn) (\s :: BrokerSoftwareInfo
s@BrokerSoftwareInfo' {} Maybe Text
a -> BrokerSoftwareInfo
s {$sel:configurationArn:BrokerSoftwareInfo' :: Maybe Text
configurationArn = Maybe Text
a} :: BrokerSoftwareInfo)

instance Core.FromJSON BrokerSoftwareInfo where
  parseJSON :: Value -> Parser BrokerSoftwareInfo
parseJSON =
    String
-> (Object -> Parser BrokerSoftwareInfo)
-> Value
-> Parser BrokerSoftwareInfo
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"BrokerSoftwareInfo"
      ( \Object
x ->
          Maybe Integer -> Maybe Text -> Maybe Text -> BrokerSoftwareInfo
BrokerSoftwareInfo'
            (Maybe Integer -> Maybe Text -> Maybe Text -> BrokerSoftwareInfo)
-> Parser (Maybe Integer)
-> Parser (Maybe Text -> Maybe Text -> BrokerSoftwareInfo)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"configurationRevision")
            Parser (Maybe Text -> Maybe Text -> BrokerSoftwareInfo)
-> Parser (Maybe Text) -> Parser (Maybe Text -> BrokerSoftwareInfo)
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
"kafkaVersion")
            Parser (Maybe Text -> BrokerSoftwareInfo)
-> Parser (Maybe Text) -> Parser BrokerSoftwareInfo
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
"configurationArn")
      )

instance Prelude.Hashable BrokerSoftwareInfo

instance Prelude.NFData BrokerSoftwareInfo