{-# 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.DocumentDB.Types.OrderableDBInstanceOption
-- 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.DocumentDB.Types.OrderableDBInstanceOption where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.DocumentDB.Types.AvailabilityZone
import qualified Amazonka.Prelude as Prelude

-- | The options that are available for an instance.
--
-- /See:/ 'newOrderableDBInstanceOption' smart constructor.
data OrderableDBInstanceOption = OrderableDBInstanceOption'
  { -- | A list of Availability Zones for an instance.
    OrderableDBInstanceOption -> Maybe [AvailabilityZone]
availabilityZones :: Prelude.Maybe [AvailabilityZone],
    -- | The instance class for an instance.
    OrderableDBInstanceOption -> Maybe Text
dbInstanceClass :: Prelude.Maybe Prelude.Text,
    -- | The engine type of an instance.
    OrderableDBInstanceOption -> Maybe Text
engine :: Prelude.Maybe Prelude.Text,
    -- | The engine version of an instance.
    OrderableDBInstanceOption -> Maybe Text
engineVersion :: Prelude.Maybe Prelude.Text,
    -- | The license model for an instance.
    OrderableDBInstanceOption -> Maybe Text
licenseModel :: Prelude.Maybe Prelude.Text,
    -- | Indicates whether an instance is in a virtual private cloud (VPC).
    OrderableDBInstanceOption -> Maybe Bool
vpc :: Prelude.Maybe Prelude.Bool
  }
  deriving (OrderableDBInstanceOption -> OrderableDBInstanceOption -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: OrderableDBInstanceOption -> OrderableDBInstanceOption -> Bool
$c/= :: OrderableDBInstanceOption -> OrderableDBInstanceOption -> Bool
== :: OrderableDBInstanceOption -> OrderableDBInstanceOption -> Bool
$c== :: OrderableDBInstanceOption -> OrderableDBInstanceOption -> Bool
Prelude.Eq, ReadPrec [OrderableDBInstanceOption]
ReadPrec OrderableDBInstanceOption
Int -> ReadS OrderableDBInstanceOption
ReadS [OrderableDBInstanceOption]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [OrderableDBInstanceOption]
$creadListPrec :: ReadPrec [OrderableDBInstanceOption]
readPrec :: ReadPrec OrderableDBInstanceOption
$creadPrec :: ReadPrec OrderableDBInstanceOption
readList :: ReadS [OrderableDBInstanceOption]
$creadList :: ReadS [OrderableDBInstanceOption]
readsPrec :: Int -> ReadS OrderableDBInstanceOption
$creadsPrec :: Int -> ReadS OrderableDBInstanceOption
Prelude.Read, Int -> OrderableDBInstanceOption -> ShowS
[OrderableDBInstanceOption] -> ShowS
OrderableDBInstanceOption -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [OrderableDBInstanceOption] -> ShowS
$cshowList :: [OrderableDBInstanceOption] -> ShowS
show :: OrderableDBInstanceOption -> String
$cshow :: OrderableDBInstanceOption -> String
showsPrec :: Int -> OrderableDBInstanceOption -> ShowS
$cshowsPrec :: Int -> OrderableDBInstanceOption -> ShowS
Prelude.Show, forall x.
Rep OrderableDBInstanceOption x -> OrderableDBInstanceOption
forall x.
OrderableDBInstanceOption -> Rep OrderableDBInstanceOption x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep OrderableDBInstanceOption x -> OrderableDBInstanceOption
$cfrom :: forall x.
OrderableDBInstanceOption -> Rep OrderableDBInstanceOption x
Prelude.Generic)

-- |
-- Create a value of 'OrderableDBInstanceOption' 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', 'orderableDBInstanceOption_availabilityZones' - A list of Availability Zones for an instance.
--
-- 'dbInstanceClass', 'orderableDBInstanceOption_dbInstanceClass' - The instance class for an instance.
--
-- 'engine', 'orderableDBInstanceOption_engine' - The engine type of an instance.
--
-- 'engineVersion', 'orderableDBInstanceOption_engineVersion' - The engine version of an instance.
--
-- 'licenseModel', 'orderableDBInstanceOption_licenseModel' - The license model for an instance.
--
-- 'vpc', 'orderableDBInstanceOption_vpc' - Indicates whether an instance is in a virtual private cloud (VPC).
newOrderableDBInstanceOption ::
  OrderableDBInstanceOption
newOrderableDBInstanceOption :: OrderableDBInstanceOption
newOrderableDBInstanceOption =
  OrderableDBInstanceOption'
    { $sel:availabilityZones:OrderableDBInstanceOption' :: Maybe [AvailabilityZone]
availabilityZones =
        forall a. Maybe a
Prelude.Nothing,
      $sel:dbInstanceClass:OrderableDBInstanceOption' :: Maybe Text
dbInstanceClass = forall a. Maybe a
Prelude.Nothing,
      $sel:engine:OrderableDBInstanceOption' :: Maybe Text
engine = forall a. Maybe a
Prelude.Nothing,
      $sel:engineVersion:OrderableDBInstanceOption' :: Maybe Text
engineVersion = forall a. Maybe a
Prelude.Nothing,
      $sel:licenseModel:OrderableDBInstanceOption' :: Maybe Text
licenseModel = forall a. Maybe a
Prelude.Nothing,
      $sel:vpc:OrderableDBInstanceOption' :: Maybe Bool
vpc = forall a. Maybe a
Prelude.Nothing
    }

-- | A list of Availability Zones for an instance.
orderableDBInstanceOption_availabilityZones :: Lens.Lens' OrderableDBInstanceOption (Prelude.Maybe [AvailabilityZone])
orderableDBInstanceOption_availabilityZones :: Lens' OrderableDBInstanceOption (Maybe [AvailabilityZone])
orderableDBInstanceOption_availabilityZones = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OrderableDBInstanceOption' {Maybe [AvailabilityZone]
availabilityZones :: Maybe [AvailabilityZone]
$sel:availabilityZones:OrderableDBInstanceOption' :: OrderableDBInstanceOption -> Maybe [AvailabilityZone]
availabilityZones} -> Maybe [AvailabilityZone]
availabilityZones) (\s :: OrderableDBInstanceOption
s@OrderableDBInstanceOption' {} Maybe [AvailabilityZone]
a -> OrderableDBInstanceOption
s {$sel:availabilityZones:OrderableDBInstanceOption' :: Maybe [AvailabilityZone]
availabilityZones = Maybe [AvailabilityZone]
a} :: OrderableDBInstanceOption) 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 instance class for an instance.
orderableDBInstanceOption_dbInstanceClass :: Lens.Lens' OrderableDBInstanceOption (Prelude.Maybe Prelude.Text)
orderableDBInstanceOption_dbInstanceClass :: Lens' OrderableDBInstanceOption (Maybe Text)
orderableDBInstanceOption_dbInstanceClass = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OrderableDBInstanceOption' {Maybe Text
dbInstanceClass :: Maybe Text
$sel:dbInstanceClass:OrderableDBInstanceOption' :: OrderableDBInstanceOption -> Maybe Text
dbInstanceClass} -> Maybe Text
dbInstanceClass) (\s :: OrderableDBInstanceOption
s@OrderableDBInstanceOption' {} Maybe Text
a -> OrderableDBInstanceOption
s {$sel:dbInstanceClass:OrderableDBInstanceOption' :: Maybe Text
dbInstanceClass = Maybe Text
a} :: OrderableDBInstanceOption)

-- | The engine type of an instance.
orderableDBInstanceOption_engine :: Lens.Lens' OrderableDBInstanceOption (Prelude.Maybe Prelude.Text)
orderableDBInstanceOption_engine :: Lens' OrderableDBInstanceOption (Maybe Text)
orderableDBInstanceOption_engine = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OrderableDBInstanceOption' {Maybe Text
engine :: Maybe Text
$sel:engine:OrderableDBInstanceOption' :: OrderableDBInstanceOption -> Maybe Text
engine} -> Maybe Text
engine) (\s :: OrderableDBInstanceOption
s@OrderableDBInstanceOption' {} Maybe Text
a -> OrderableDBInstanceOption
s {$sel:engine:OrderableDBInstanceOption' :: Maybe Text
engine = Maybe Text
a} :: OrderableDBInstanceOption)

-- | The engine version of an instance.
orderableDBInstanceOption_engineVersion :: Lens.Lens' OrderableDBInstanceOption (Prelude.Maybe Prelude.Text)
orderableDBInstanceOption_engineVersion :: Lens' OrderableDBInstanceOption (Maybe Text)
orderableDBInstanceOption_engineVersion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OrderableDBInstanceOption' {Maybe Text
engineVersion :: Maybe Text
$sel:engineVersion:OrderableDBInstanceOption' :: OrderableDBInstanceOption -> Maybe Text
engineVersion} -> Maybe Text
engineVersion) (\s :: OrderableDBInstanceOption
s@OrderableDBInstanceOption' {} Maybe Text
a -> OrderableDBInstanceOption
s {$sel:engineVersion:OrderableDBInstanceOption' :: Maybe Text
engineVersion = Maybe Text
a} :: OrderableDBInstanceOption)

-- | The license model for an instance.
orderableDBInstanceOption_licenseModel :: Lens.Lens' OrderableDBInstanceOption (Prelude.Maybe Prelude.Text)
orderableDBInstanceOption_licenseModel :: Lens' OrderableDBInstanceOption (Maybe Text)
orderableDBInstanceOption_licenseModel = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OrderableDBInstanceOption' {Maybe Text
licenseModel :: Maybe Text
$sel:licenseModel:OrderableDBInstanceOption' :: OrderableDBInstanceOption -> Maybe Text
licenseModel} -> Maybe Text
licenseModel) (\s :: OrderableDBInstanceOption
s@OrderableDBInstanceOption' {} Maybe Text
a -> OrderableDBInstanceOption
s {$sel:licenseModel:OrderableDBInstanceOption' :: Maybe Text
licenseModel = Maybe Text
a} :: OrderableDBInstanceOption)

-- | Indicates whether an instance is in a virtual private cloud (VPC).
orderableDBInstanceOption_vpc :: Lens.Lens' OrderableDBInstanceOption (Prelude.Maybe Prelude.Bool)
orderableDBInstanceOption_vpc :: Lens' OrderableDBInstanceOption (Maybe Bool)
orderableDBInstanceOption_vpc = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OrderableDBInstanceOption' {Maybe Bool
vpc :: Maybe Bool
$sel:vpc:OrderableDBInstanceOption' :: OrderableDBInstanceOption -> Maybe Bool
vpc} -> Maybe Bool
vpc) (\s :: OrderableDBInstanceOption
s@OrderableDBInstanceOption' {} Maybe Bool
a -> OrderableDBInstanceOption
s {$sel:vpc:OrderableDBInstanceOption' :: Maybe Bool
vpc = Maybe Bool
a} :: OrderableDBInstanceOption)

instance Data.FromXML OrderableDBInstanceOption where
  parseXML :: [Node] -> Either String OrderableDBInstanceOption
parseXML [Node]
x =
    Maybe [AvailabilityZone]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> OrderableDBInstanceOption
OrderableDBInstanceOption'
      forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( [Node]
x
                      forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"AvailabilityZones"
                      forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                      forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"AvailabilityZone")
                  )
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"DBInstanceClass")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"Engine")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"EngineVersion")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"LicenseModel")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"Vpc")

instance Prelude.Hashable OrderableDBInstanceOption where
  hashWithSalt :: Int -> OrderableDBInstanceOption -> Int
hashWithSalt Int
_salt OrderableDBInstanceOption' {Maybe Bool
Maybe [AvailabilityZone]
Maybe Text
vpc :: Maybe Bool
licenseModel :: Maybe Text
engineVersion :: Maybe Text
engine :: Maybe Text
dbInstanceClass :: Maybe Text
availabilityZones :: Maybe [AvailabilityZone]
$sel:vpc:OrderableDBInstanceOption' :: OrderableDBInstanceOption -> Maybe Bool
$sel:licenseModel:OrderableDBInstanceOption' :: OrderableDBInstanceOption -> Maybe Text
$sel:engineVersion:OrderableDBInstanceOption' :: OrderableDBInstanceOption -> Maybe Text
$sel:engine:OrderableDBInstanceOption' :: OrderableDBInstanceOption -> Maybe Text
$sel:dbInstanceClass:OrderableDBInstanceOption' :: OrderableDBInstanceOption -> Maybe Text
$sel:availabilityZones:OrderableDBInstanceOption' :: OrderableDBInstanceOption -> 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 Text
dbInstanceClass
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
engine
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
engineVersion
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
licenseModel
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
vpc

instance Prelude.NFData OrderableDBInstanceOption where
  rnf :: OrderableDBInstanceOption -> ()
rnf OrderableDBInstanceOption' {Maybe Bool
Maybe [AvailabilityZone]
Maybe Text
vpc :: Maybe Bool
licenseModel :: Maybe Text
engineVersion :: Maybe Text
engine :: Maybe Text
dbInstanceClass :: Maybe Text
availabilityZones :: Maybe [AvailabilityZone]
$sel:vpc:OrderableDBInstanceOption' :: OrderableDBInstanceOption -> Maybe Bool
$sel:licenseModel:OrderableDBInstanceOption' :: OrderableDBInstanceOption -> Maybe Text
$sel:engineVersion:OrderableDBInstanceOption' :: OrderableDBInstanceOption -> Maybe Text
$sel:engine:OrderableDBInstanceOption' :: OrderableDBInstanceOption -> Maybe Text
$sel:dbInstanceClass:OrderableDBInstanceOption' :: OrderableDBInstanceOption -> Maybe Text
$sel:availabilityZones:OrderableDBInstanceOption' :: OrderableDBInstanceOption -> 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 Text
dbInstanceClass
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
engine
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
engineVersion
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
licenseModel
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
vpc