{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Kafka.Types.BrokerSoftwareInfo 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

-- | Information about the current software installed on the cluster.
--
-- /See:/ 'newBrokerSoftwareInfo' smart constructor.
data BrokerSoftwareInfo = BrokerSoftwareInfo'
  { -- | 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,
    -- | 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
  }
  deriving (BrokerSoftwareInfo -> BrokerSoftwareInfo -> Bool
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]
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
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. 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:
--
-- 'configurationArn', 'brokerSoftwareInfo_configurationArn' - The Amazon Resource Name (ARN) of the configuration used for the
-- cluster. This field isn\'t visible in this preview release.
--
-- '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.
newBrokerSoftwareInfo ::
  BrokerSoftwareInfo
newBrokerSoftwareInfo :: BrokerSoftwareInfo
newBrokerSoftwareInfo =
  BrokerSoftwareInfo'
    { $sel:configurationArn:BrokerSoftwareInfo' :: Maybe Text
configurationArn =
        forall a. Maybe a
Prelude.Nothing,
      $sel:configurationRevision:BrokerSoftwareInfo' :: Maybe Integer
configurationRevision = forall a. Maybe a
Prelude.Nothing,
      $sel:kafkaVersion:BrokerSoftwareInfo' :: Maybe Text
kafkaVersion = forall a. Maybe a
Prelude.Nothing
    }

-- | 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 :: Lens' BrokerSoftwareInfo (Maybe Text)
brokerSoftwareInfo_configurationArn = 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)

-- | 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 :: Lens' BrokerSoftwareInfo (Maybe Integer)
brokerSoftwareInfo_configurationRevision = 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 :: Lens' BrokerSoftwareInfo (Maybe Text)
brokerSoftwareInfo_kafkaVersion = 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)

instance Data.FromJSON BrokerSoftwareInfo where
  parseJSON :: Value -> Parser BrokerSoftwareInfo
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"BrokerSoftwareInfo"
      ( \Object
x ->
          Maybe Text -> Maybe Integer -> Maybe Text -> BrokerSoftwareInfo
BrokerSoftwareInfo'
            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
"configurationArn")
            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
"configurationRevision")
            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
"kafkaVersion")
      )

instance Prelude.Hashable BrokerSoftwareInfo where
  hashWithSalt :: Int -> BrokerSoftwareInfo -> Int
hashWithSalt Int
_salt BrokerSoftwareInfo' {Maybe Integer
Maybe Text
kafkaVersion :: Maybe Text
configurationRevision :: Maybe Integer
configurationArn :: Maybe Text
$sel:kafkaVersion:BrokerSoftwareInfo' :: BrokerSoftwareInfo -> Maybe Text
$sel:configurationRevision:BrokerSoftwareInfo' :: BrokerSoftwareInfo -> Maybe Integer
$sel:configurationArn:BrokerSoftwareInfo' :: BrokerSoftwareInfo -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
configurationArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
configurationRevision
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
kafkaVersion

instance Prelude.NFData BrokerSoftwareInfo where
  rnf :: BrokerSoftwareInfo -> ()
rnf BrokerSoftwareInfo' {Maybe Integer
Maybe Text
kafkaVersion :: Maybe Text
configurationRevision :: Maybe Integer
configurationArn :: Maybe Text
$sel:kafkaVersion:BrokerSoftwareInfo' :: BrokerSoftwareInfo -> Maybe Text
$sel:configurationRevision:BrokerSoftwareInfo' :: BrokerSoftwareInfo -> Maybe Integer
$sel:configurationArn:BrokerSoftwareInfo' :: BrokerSoftwareInfo -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
configurationArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
configurationRevision
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
kafkaVersion