{-# 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.BrokerInstanceOption
-- 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.MQ.Types.BrokerInstanceOption where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.MQ.Types.AvailabilityZone
import Amazonka.MQ.Types.BrokerStorageType
import Amazonka.MQ.Types.DeploymentMode
import Amazonka.MQ.Types.EngineType
import qualified Amazonka.Prelude as Prelude

-- | Option for host instance type.
--
-- /See:/ 'newBrokerInstanceOption' smart constructor.
data BrokerInstanceOption = BrokerInstanceOption'
  { -- | The list of available az.
    BrokerInstanceOption -> Maybe [AvailabilityZone]
availabilityZones :: Prelude.Maybe [AvailabilityZone],
    -- | The broker\'s engine type.
    BrokerInstanceOption -> Maybe EngineType
engineType :: Prelude.Maybe EngineType,
    -- | The broker\'s instance type.
    BrokerInstanceOption -> Maybe Text
hostInstanceType :: Prelude.Maybe Prelude.Text,
    -- | The broker\'s storage type.
    BrokerInstanceOption -> Maybe BrokerStorageType
storageType :: Prelude.Maybe BrokerStorageType,
    -- | The list of supported deployment modes.
    BrokerInstanceOption -> Maybe [DeploymentMode]
supportedDeploymentModes :: Prelude.Maybe [DeploymentMode],
    -- | The list of supported engine versions.
    BrokerInstanceOption -> Maybe [Text]
supportedEngineVersions :: Prelude.Maybe [Prelude.Text]
  }
  deriving (BrokerInstanceOption -> BrokerInstanceOption -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BrokerInstanceOption -> BrokerInstanceOption -> Bool
$c/= :: BrokerInstanceOption -> BrokerInstanceOption -> Bool
== :: BrokerInstanceOption -> BrokerInstanceOption -> Bool
$c== :: BrokerInstanceOption -> BrokerInstanceOption -> Bool
Prelude.Eq, ReadPrec [BrokerInstanceOption]
ReadPrec BrokerInstanceOption
Int -> ReadS BrokerInstanceOption
ReadS [BrokerInstanceOption]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BrokerInstanceOption]
$creadListPrec :: ReadPrec [BrokerInstanceOption]
readPrec :: ReadPrec BrokerInstanceOption
$creadPrec :: ReadPrec BrokerInstanceOption
readList :: ReadS [BrokerInstanceOption]
$creadList :: ReadS [BrokerInstanceOption]
readsPrec :: Int -> ReadS BrokerInstanceOption
$creadsPrec :: Int -> ReadS BrokerInstanceOption
Prelude.Read, Int -> BrokerInstanceOption -> ShowS
[BrokerInstanceOption] -> ShowS
BrokerInstanceOption -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BrokerInstanceOption] -> ShowS
$cshowList :: [BrokerInstanceOption] -> ShowS
show :: BrokerInstanceOption -> String
$cshow :: BrokerInstanceOption -> String
showsPrec :: Int -> BrokerInstanceOption -> ShowS
$cshowsPrec :: Int -> BrokerInstanceOption -> ShowS
Prelude.Show, forall x. Rep BrokerInstanceOption x -> BrokerInstanceOption
forall x. BrokerInstanceOption -> Rep BrokerInstanceOption x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BrokerInstanceOption x -> BrokerInstanceOption
$cfrom :: forall x. BrokerInstanceOption -> Rep BrokerInstanceOption x
Prelude.Generic)

-- |
-- Create a value of 'BrokerInstanceOption' 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:
--
-- 'availabilityZones', 'brokerInstanceOption_availabilityZones' - The list of available az.
--
-- 'engineType', 'brokerInstanceOption_engineType' - The broker\'s engine type.
--
-- 'hostInstanceType', 'brokerInstanceOption_hostInstanceType' - The broker\'s instance type.
--
-- 'storageType', 'brokerInstanceOption_storageType' - The broker\'s storage type.
--
-- 'supportedDeploymentModes', 'brokerInstanceOption_supportedDeploymentModes' - The list of supported deployment modes.
--
-- 'supportedEngineVersions', 'brokerInstanceOption_supportedEngineVersions' - The list of supported engine versions.
newBrokerInstanceOption ::
  BrokerInstanceOption
newBrokerInstanceOption :: BrokerInstanceOption
newBrokerInstanceOption =
  BrokerInstanceOption'
    { $sel:availabilityZones:BrokerInstanceOption' :: Maybe [AvailabilityZone]
availabilityZones =
        forall a. Maybe a
Prelude.Nothing,
      $sel:engineType:BrokerInstanceOption' :: Maybe EngineType
engineType = forall a. Maybe a
Prelude.Nothing,
      $sel:hostInstanceType:BrokerInstanceOption' :: Maybe Text
hostInstanceType = forall a. Maybe a
Prelude.Nothing,
      $sel:storageType:BrokerInstanceOption' :: Maybe BrokerStorageType
storageType = forall a. Maybe a
Prelude.Nothing,
      $sel:supportedDeploymentModes:BrokerInstanceOption' :: Maybe [DeploymentMode]
supportedDeploymentModes = forall a. Maybe a
Prelude.Nothing,
      $sel:supportedEngineVersions:BrokerInstanceOption' :: Maybe [Text]
supportedEngineVersions = forall a. Maybe a
Prelude.Nothing
    }

-- | The list of available az.
brokerInstanceOption_availabilityZones :: Lens.Lens' BrokerInstanceOption (Prelude.Maybe [AvailabilityZone])
brokerInstanceOption_availabilityZones :: Lens' BrokerInstanceOption (Maybe [AvailabilityZone])
brokerInstanceOption_availabilityZones = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BrokerInstanceOption' {Maybe [AvailabilityZone]
availabilityZones :: Maybe [AvailabilityZone]
$sel:availabilityZones:BrokerInstanceOption' :: BrokerInstanceOption -> Maybe [AvailabilityZone]
availabilityZones} -> Maybe [AvailabilityZone]
availabilityZones) (\s :: BrokerInstanceOption
s@BrokerInstanceOption' {} Maybe [AvailabilityZone]
a -> BrokerInstanceOption
s {$sel:availabilityZones:BrokerInstanceOption' :: Maybe [AvailabilityZone]
availabilityZones = Maybe [AvailabilityZone]
a} :: BrokerInstanceOption) 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

-- | The broker\'s engine type.
brokerInstanceOption_engineType :: Lens.Lens' BrokerInstanceOption (Prelude.Maybe EngineType)
brokerInstanceOption_engineType :: Lens' BrokerInstanceOption (Maybe EngineType)
brokerInstanceOption_engineType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BrokerInstanceOption' {Maybe EngineType
engineType :: Maybe EngineType
$sel:engineType:BrokerInstanceOption' :: BrokerInstanceOption -> Maybe EngineType
engineType} -> Maybe EngineType
engineType) (\s :: BrokerInstanceOption
s@BrokerInstanceOption' {} Maybe EngineType
a -> BrokerInstanceOption
s {$sel:engineType:BrokerInstanceOption' :: Maybe EngineType
engineType = Maybe EngineType
a} :: BrokerInstanceOption)

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

-- | The broker\'s storage type.
brokerInstanceOption_storageType :: Lens.Lens' BrokerInstanceOption (Prelude.Maybe BrokerStorageType)
brokerInstanceOption_storageType :: Lens' BrokerInstanceOption (Maybe BrokerStorageType)
brokerInstanceOption_storageType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BrokerInstanceOption' {Maybe BrokerStorageType
storageType :: Maybe BrokerStorageType
$sel:storageType:BrokerInstanceOption' :: BrokerInstanceOption -> Maybe BrokerStorageType
storageType} -> Maybe BrokerStorageType
storageType) (\s :: BrokerInstanceOption
s@BrokerInstanceOption' {} Maybe BrokerStorageType
a -> BrokerInstanceOption
s {$sel:storageType:BrokerInstanceOption' :: Maybe BrokerStorageType
storageType = Maybe BrokerStorageType
a} :: BrokerInstanceOption)

-- | The list of supported deployment modes.
brokerInstanceOption_supportedDeploymentModes :: Lens.Lens' BrokerInstanceOption (Prelude.Maybe [DeploymentMode])
brokerInstanceOption_supportedDeploymentModes :: Lens' BrokerInstanceOption (Maybe [DeploymentMode])
brokerInstanceOption_supportedDeploymentModes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BrokerInstanceOption' {Maybe [DeploymentMode]
supportedDeploymentModes :: Maybe [DeploymentMode]
$sel:supportedDeploymentModes:BrokerInstanceOption' :: BrokerInstanceOption -> Maybe [DeploymentMode]
supportedDeploymentModes} -> Maybe [DeploymentMode]
supportedDeploymentModes) (\s :: BrokerInstanceOption
s@BrokerInstanceOption' {} Maybe [DeploymentMode]
a -> BrokerInstanceOption
s {$sel:supportedDeploymentModes:BrokerInstanceOption' :: Maybe [DeploymentMode]
supportedDeploymentModes = Maybe [DeploymentMode]
a} :: BrokerInstanceOption) 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

-- | The list of supported engine versions.
brokerInstanceOption_supportedEngineVersions :: Lens.Lens' BrokerInstanceOption (Prelude.Maybe [Prelude.Text])
brokerInstanceOption_supportedEngineVersions :: Lens' BrokerInstanceOption (Maybe [Text])
brokerInstanceOption_supportedEngineVersions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BrokerInstanceOption' {Maybe [Text]
supportedEngineVersions :: Maybe [Text]
$sel:supportedEngineVersions:BrokerInstanceOption' :: BrokerInstanceOption -> Maybe [Text]
supportedEngineVersions} -> Maybe [Text]
supportedEngineVersions) (\s :: BrokerInstanceOption
s@BrokerInstanceOption' {} Maybe [Text]
a -> BrokerInstanceOption
s {$sel:supportedEngineVersions:BrokerInstanceOption' :: Maybe [Text]
supportedEngineVersions = Maybe [Text]
a} :: BrokerInstanceOption) 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

instance Data.FromJSON BrokerInstanceOption where
  parseJSON :: Value -> Parser BrokerInstanceOption
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"BrokerInstanceOption"
      ( \Object
x ->
          Maybe [AvailabilityZone]
-> Maybe EngineType
-> Maybe Text
-> Maybe BrokerStorageType
-> Maybe [DeploymentMode]
-> Maybe [Text]
-> BrokerInstanceOption
BrokerInstanceOption'
            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
"availabilityZones"
                            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
"engineType")
            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
"hostInstanceType")
            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
"storageType")
            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
"supportedDeploymentModes"
                            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
"supportedEngineVersions"
                            forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
                        )
      )

instance Prelude.Hashable BrokerInstanceOption where
  hashWithSalt :: Int -> BrokerInstanceOption -> Int
hashWithSalt Int
_salt BrokerInstanceOption' {Maybe [Text]
Maybe [AvailabilityZone]
Maybe [DeploymentMode]
Maybe Text
Maybe BrokerStorageType
Maybe EngineType
supportedEngineVersions :: Maybe [Text]
supportedDeploymentModes :: Maybe [DeploymentMode]
storageType :: Maybe BrokerStorageType
hostInstanceType :: Maybe Text
engineType :: Maybe EngineType
availabilityZones :: Maybe [AvailabilityZone]
$sel:supportedEngineVersions:BrokerInstanceOption' :: BrokerInstanceOption -> Maybe [Text]
$sel:supportedDeploymentModes:BrokerInstanceOption' :: BrokerInstanceOption -> Maybe [DeploymentMode]
$sel:storageType:BrokerInstanceOption' :: BrokerInstanceOption -> Maybe BrokerStorageType
$sel:hostInstanceType:BrokerInstanceOption' :: BrokerInstanceOption -> Maybe Text
$sel:engineType:BrokerInstanceOption' :: BrokerInstanceOption -> Maybe EngineType
$sel:availabilityZones:BrokerInstanceOption' :: BrokerInstanceOption -> Maybe [AvailabilityZone]
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [AvailabilityZone]
availabilityZones
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe EngineType
engineType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
hostInstanceType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe BrokerStorageType
storageType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [DeploymentMode]
supportedDeploymentModes
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
supportedEngineVersions

instance Prelude.NFData BrokerInstanceOption where
  rnf :: BrokerInstanceOption -> ()
rnf BrokerInstanceOption' {Maybe [Text]
Maybe [AvailabilityZone]
Maybe [DeploymentMode]
Maybe Text
Maybe BrokerStorageType
Maybe EngineType
supportedEngineVersions :: Maybe [Text]
supportedDeploymentModes :: Maybe [DeploymentMode]
storageType :: Maybe BrokerStorageType
hostInstanceType :: Maybe Text
engineType :: Maybe EngineType
availabilityZones :: Maybe [AvailabilityZone]
$sel:supportedEngineVersions:BrokerInstanceOption' :: BrokerInstanceOption -> Maybe [Text]
$sel:supportedDeploymentModes:BrokerInstanceOption' :: BrokerInstanceOption -> Maybe [DeploymentMode]
$sel:storageType:BrokerInstanceOption' :: BrokerInstanceOption -> Maybe BrokerStorageType
$sel:hostInstanceType:BrokerInstanceOption' :: BrokerInstanceOption -> Maybe Text
$sel:engineType:BrokerInstanceOption' :: BrokerInstanceOption -> Maybe EngineType
$sel:availabilityZones:BrokerInstanceOption' :: BrokerInstanceOption -> Maybe [AvailabilityZone]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [AvailabilityZone]
availabilityZones
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe EngineType
engineType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
hostInstanceType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe BrokerStorageType
storageType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [DeploymentMode]
supportedDeploymentModes
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
supportedEngineVersions