{-# 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.OpenSearch.Types.InstanceTypeDetails
-- 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.OpenSearch.Types.InstanceTypeDetails where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.OpenSearch.Types.OpenSearchPartitionInstanceType
import qualified Amazonka.Prelude as Prelude

-- | Lists all instance types and available features for a given OpenSearch
-- or Elasticsearch version.
--
-- /See:/ 'newInstanceTypeDetails' smart constructor.
data InstanceTypeDetails = InstanceTypeDetails'
  { -- | Whether fine-grained access control is supported for the instance type.
    InstanceTypeDetails -> Maybe Bool
advancedSecurityEnabled :: Prelude.Maybe Prelude.Bool,
    -- | Whether logging is supported for the instance type.
    InstanceTypeDetails -> Maybe Bool
appLogsEnabled :: Prelude.Maybe Prelude.Bool,
    -- | Whether Amazon Cognito access is supported for the instance type.
    InstanceTypeDetails -> Maybe Bool
cognitoEnabled :: Prelude.Maybe Prelude.Bool,
    -- | Whether encryption at rest and node-to-node encryption are supported for
    -- the instance type.
    InstanceTypeDetails -> Maybe Bool
encryptionEnabled :: Prelude.Maybe Prelude.Bool,
    -- | Whether the instance acts as a data node, a dedicated master node, or an
    -- UltraWarm node.
    InstanceTypeDetails -> Maybe [Text]
instanceRole :: Prelude.Maybe [Prelude.Text],
    -- | The instance type.
    InstanceTypeDetails -> Maybe OpenSearchPartitionInstanceType
instanceType :: Prelude.Maybe OpenSearchPartitionInstanceType,
    -- | Whether UltraWarm is supported for the instance type.
    InstanceTypeDetails -> Maybe Bool
warmEnabled :: Prelude.Maybe Prelude.Bool
  }
  deriving (InstanceTypeDetails -> InstanceTypeDetails -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InstanceTypeDetails -> InstanceTypeDetails -> Bool
$c/= :: InstanceTypeDetails -> InstanceTypeDetails -> Bool
== :: InstanceTypeDetails -> InstanceTypeDetails -> Bool
$c== :: InstanceTypeDetails -> InstanceTypeDetails -> Bool
Prelude.Eq, ReadPrec [InstanceTypeDetails]
ReadPrec InstanceTypeDetails
Int -> ReadS InstanceTypeDetails
ReadS [InstanceTypeDetails]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InstanceTypeDetails]
$creadListPrec :: ReadPrec [InstanceTypeDetails]
readPrec :: ReadPrec InstanceTypeDetails
$creadPrec :: ReadPrec InstanceTypeDetails
readList :: ReadS [InstanceTypeDetails]
$creadList :: ReadS [InstanceTypeDetails]
readsPrec :: Int -> ReadS InstanceTypeDetails
$creadsPrec :: Int -> ReadS InstanceTypeDetails
Prelude.Read, Int -> InstanceTypeDetails -> ShowS
[InstanceTypeDetails] -> ShowS
InstanceTypeDetails -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InstanceTypeDetails] -> ShowS
$cshowList :: [InstanceTypeDetails] -> ShowS
show :: InstanceTypeDetails -> String
$cshow :: InstanceTypeDetails -> String
showsPrec :: Int -> InstanceTypeDetails -> ShowS
$cshowsPrec :: Int -> InstanceTypeDetails -> ShowS
Prelude.Show, forall x. Rep InstanceTypeDetails x -> InstanceTypeDetails
forall x. InstanceTypeDetails -> Rep InstanceTypeDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InstanceTypeDetails x -> InstanceTypeDetails
$cfrom :: forall x. InstanceTypeDetails -> Rep InstanceTypeDetails x
Prelude.Generic)

-- |
-- Create a value of 'InstanceTypeDetails' 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:
--
-- 'advancedSecurityEnabled', 'instanceTypeDetails_advancedSecurityEnabled' - Whether fine-grained access control is supported for the instance type.
--
-- 'appLogsEnabled', 'instanceTypeDetails_appLogsEnabled' - Whether logging is supported for the instance type.
--
-- 'cognitoEnabled', 'instanceTypeDetails_cognitoEnabled' - Whether Amazon Cognito access is supported for the instance type.
--
-- 'encryptionEnabled', 'instanceTypeDetails_encryptionEnabled' - Whether encryption at rest and node-to-node encryption are supported for
-- the instance type.
--
-- 'instanceRole', 'instanceTypeDetails_instanceRole' - Whether the instance acts as a data node, a dedicated master node, or an
-- UltraWarm node.
--
-- 'instanceType', 'instanceTypeDetails_instanceType' - The instance type.
--
-- 'warmEnabled', 'instanceTypeDetails_warmEnabled' - Whether UltraWarm is supported for the instance type.
newInstanceTypeDetails ::
  InstanceTypeDetails
newInstanceTypeDetails :: InstanceTypeDetails
newInstanceTypeDetails =
  InstanceTypeDetails'
    { $sel:advancedSecurityEnabled:InstanceTypeDetails' :: Maybe Bool
advancedSecurityEnabled =
        forall a. Maybe a
Prelude.Nothing,
      $sel:appLogsEnabled:InstanceTypeDetails' :: Maybe Bool
appLogsEnabled = forall a. Maybe a
Prelude.Nothing,
      $sel:cognitoEnabled:InstanceTypeDetails' :: Maybe Bool
cognitoEnabled = forall a. Maybe a
Prelude.Nothing,
      $sel:encryptionEnabled:InstanceTypeDetails' :: Maybe Bool
encryptionEnabled = forall a. Maybe a
Prelude.Nothing,
      $sel:instanceRole:InstanceTypeDetails' :: Maybe [Text]
instanceRole = forall a. Maybe a
Prelude.Nothing,
      $sel:instanceType:InstanceTypeDetails' :: Maybe OpenSearchPartitionInstanceType
instanceType = forall a. Maybe a
Prelude.Nothing,
      $sel:warmEnabled:InstanceTypeDetails' :: Maybe Bool
warmEnabled = forall a. Maybe a
Prelude.Nothing
    }

-- | Whether fine-grained access control is supported for the instance type.
instanceTypeDetails_advancedSecurityEnabled :: Lens.Lens' InstanceTypeDetails (Prelude.Maybe Prelude.Bool)
instanceTypeDetails_advancedSecurityEnabled :: Lens' InstanceTypeDetails (Maybe Bool)
instanceTypeDetails_advancedSecurityEnabled = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceTypeDetails' {Maybe Bool
advancedSecurityEnabled :: Maybe Bool
$sel:advancedSecurityEnabled:InstanceTypeDetails' :: InstanceTypeDetails -> Maybe Bool
advancedSecurityEnabled} -> Maybe Bool
advancedSecurityEnabled) (\s :: InstanceTypeDetails
s@InstanceTypeDetails' {} Maybe Bool
a -> InstanceTypeDetails
s {$sel:advancedSecurityEnabled:InstanceTypeDetails' :: Maybe Bool
advancedSecurityEnabled = Maybe Bool
a} :: InstanceTypeDetails)

-- | Whether logging is supported for the instance type.
instanceTypeDetails_appLogsEnabled :: Lens.Lens' InstanceTypeDetails (Prelude.Maybe Prelude.Bool)
instanceTypeDetails_appLogsEnabled :: Lens' InstanceTypeDetails (Maybe Bool)
instanceTypeDetails_appLogsEnabled = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceTypeDetails' {Maybe Bool
appLogsEnabled :: Maybe Bool
$sel:appLogsEnabled:InstanceTypeDetails' :: InstanceTypeDetails -> Maybe Bool
appLogsEnabled} -> Maybe Bool
appLogsEnabled) (\s :: InstanceTypeDetails
s@InstanceTypeDetails' {} Maybe Bool
a -> InstanceTypeDetails
s {$sel:appLogsEnabled:InstanceTypeDetails' :: Maybe Bool
appLogsEnabled = Maybe Bool
a} :: InstanceTypeDetails)

-- | Whether Amazon Cognito access is supported for the instance type.
instanceTypeDetails_cognitoEnabled :: Lens.Lens' InstanceTypeDetails (Prelude.Maybe Prelude.Bool)
instanceTypeDetails_cognitoEnabled :: Lens' InstanceTypeDetails (Maybe Bool)
instanceTypeDetails_cognitoEnabled = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceTypeDetails' {Maybe Bool
cognitoEnabled :: Maybe Bool
$sel:cognitoEnabled:InstanceTypeDetails' :: InstanceTypeDetails -> Maybe Bool
cognitoEnabled} -> Maybe Bool
cognitoEnabled) (\s :: InstanceTypeDetails
s@InstanceTypeDetails' {} Maybe Bool
a -> InstanceTypeDetails
s {$sel:cognitoEnabled:InstanceTypeDetails' :: Maybe Bool
cognitoEnabled = Maybe Bool
a} :: InstanceTypeDetails)

-- | Whether encryption at rest and node-to-node encryption are supported for
-- the instance type.
instanceTypeDetails_encryptionEnabled :: Lens.Lens' InstanceTypeDetails (Prelude.Maybe Prelude.Bool)
instanceTypeDetails_encryptionEnabled :: Lens' InstanceTypeDetails (Maybe Bool)
instanceTypeDetails_encryptionEnabled = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceTypeDetails' {Maybe Bool
encryptionEnabled :: Maybe Bool
$sel:encryptionEnabled:InstanceTypeDetails' :: InstanceTypeDetails -> Maybe Bool
encryptionEnabled} -> Maybe Bool
encryptionEnabled) (\s :: InstanceTypeDetails
s@InstanceTypeDetails' {} Maybe Bool
a -> InstanceTypeDetails
s {$sel:encryptionEnabled:InstanceTypeDetails' :: Maybe Bool
encryptionEnabled = Maybe Bool
a} :: InstanceTypeDetails)

-- | Whether the instance acts as a data node, a dedicated master node, or an
-- UltraWarm node.
instanceTypeDetails_instanceRole :: Lens.Lens' InstanceTypeDetails (Prelude.Maybe [Prelude.Text])
instanceTypeDetails_instanceRole :: Lens' InstanceTypeDetails (Maybe [Text])
instanceTypeDetails_instanceRole = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceTypeDetails' {Maybe [Text]
instanceRole :: Maybe [Text]
$sel:instanceRole:InstanceTypeDetails' :: InstanceTypeDetails -> Maybe [Text]
instanceRole} -> Maybe [Text]
instanceRole) (\s :: InstanceTypeDetails
s@InstanceTypeDetails' {} Maybe [Text]
a -> InstanceTypeDetails
s {$sel:instanceRole:InstanceTypeDetails' :: Maybe [Text]
instanceRole = Maybe [Text]
a} :: InstanceTypeDetails) 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 type.
instanceTypeDetails_instanceType :: Lens.Lens' InstanceTypeDetails (Prelude.Maybe OpenSearchPartitionInstanceType)
instanceTypeDetails_instanceType :: Lens' InstanceTypeDetails (Maybe OpenSearchPartitionInstanceType)
instanceTypeDetails_instanceType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceTypeDetails' {Maybe OpenSearchPartitionInstanceType
instanceType :: Maybe OpenSearchPartitionInstanceType
$sel:instanceType:InstanceTypeDetails' :: InstanceTypeDetails -> Maybe OpenSearchPartitionInstanceType
instanceType} -> Maybe OpenSearchPartitionInstanceType
instanceType) (\s :: InstanceTypeDetails
s@InstanceTypeDetails' {} Maybe OpenSearchPartitionInstanceType
a -> InstanceTypeDetails
s {$sel:instanceType:InstanceTypeDetails' :: Maybe OpenSearchPartitionInstanceType
instanceType = Maybe OpenSearchPartitionInstanceType
a} :: InstanceTypeDetails)

-- | Whether UltraWarm is supported for the instance type.
instanceTypeDetails_warmEnabled :: Lens.Lens' InstanceTypeDetails (Prelude.Maybe Prelude.Bool)
instanceTypeDetails_warmEnabled :: Lens' InstanceTypeDetails (Maybe Bool)
instanceTypeDetails_warmEnabled = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceTypeDetails' {Maybe Bool
warmEnabled :: Maybe Bool
$sel:warmEnabled:InstanceTypeDetails' :: InstanceTypeDetails -> Maybe Bool
warmEnabled} -> Maybe Bool
warmEnabled) (\s :: InstanceTypeDetails
s@InstanceTypeDetails' {} Maybe Bool
a -> InstanceTypeDetails
s {$sel:warmEnabled:InstanceTypeDetails' :: Maybe Bool
warmEnabled = Maybe Bool
a} :: InstanceTypeDetails)

instance Data.FromJSON InstanceTypeDetails where
  parseJSON :: Value -> Parser InstanceTypeDetails
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"InstanceTypeDetails"
      ( \Object
x ->
          Maybe Bool
-> Maybe Bool
-> Maybe Bool
-> Maybe Bool
-> Maybe [Text]
-> Maybe OpenSearchPartitionInstanceType
-> Maybe Bool
-> InstanceTypeDetails
InstanceTypeDetails'
            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
"AdvancedSecurityEnabled")
            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
"AppLogsEnabled")
            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
"CognitoEnabled")
            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
"EncryptionEnabled")
            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
"InstanceRole" 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
"InstanceType")
            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
"WarmEnabled")
      )

instance Prelude.Hashable InstanceTypeDetails where
  hashWithSalt :: Int -> InstanceTypeDetails -> Int
hashWithSalt Int
_salt InstanceTypeDetails' {Maybe Bool
Maybe [Text]
Maybe OpenSearchPartitionInstanceType
warmEnabled :: Maybe Bool
instanceType :: Maybe OpenSearchPartitionInstanceType
instanceRole :: Maybe [Text]
encryptionEnabled :: Maybe Bool
cognitoEnabled :: Maybe Bool
appLogsEnabled :: Maybe Bool
advancedSecurityEnabled :: Maybe Bool
$sel:warmEnabled:InstanceTypeDetails' :: InstanceTypeDetails -> Maybe Bool
$sel:instanceType:InstanceTypeDetails' :: InstanceTypeDetails -> Maybe OpenSearchPartitionInstanceType
$sel:instanceRole:InstanceTypeDetails' :: InstanceTypeDetails -> Maybe [Text]
$sel:encryptionEnabled:InstanceTypeDetails' :: InstanceTypeDetails -> Maybe Bool
$sel:cognitoEnabled:InstanceTypeDetails' :: InstanceTypeDetails -> Maybe Bool
$sel:appLogsEnabled:InstanceTypeDetails' :: InstanceTypeDetails -> Maybe Bool
$sel:advancedSecurityEnabled:InstanceTypeDetails' :: InstanceTypeDetails -> Maybe Bool
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
advancedSecurityEnabled
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
appLogsEnabled
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
cognitoEnabled
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
encryptionEnabled
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
instanceRole
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe OpenSearchPartitionInstanceType
instanceType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
warmEnabled

instance Prelude.NFData InstanceTypeDetails where
  rnf :: InstanceTypeDetails -> ()
rnf InstanceTypeDetails' {Maybe Bool
Maybe [Text]
Maybe OpenSearchPartitionInstanceType
warmEnabled :: Maybe Bool
instanceType :: Maybe OpenSearchPartitionInstanceType
instanceRole :: Maybe [Text]
encryptionEnabled :: Maybe Bool
cognitoEnabled :: Maybe Bool
appLogsEnabled :: Maybe Bool
advancedSecurityEnabled :: Maybe Bool
$sel:warmEnabled:InstanceTypeDetails' :: InstanceTypeDetails -> Maybe Bool
$sel:instanceType:InstanceTypeDetails' :: InstanceTypeDetails -> Maybe OpenSearchPartitionInstanceType
$sel:instanceRole:InstanceTypeDetails' :: InstanceTypeDetails -> Maybe [Text]
$sel:encryptionEnabled:InstanceTypeDetails' :: InstanceTypeDetails -> Maybe Bool
$sel:cognitoEnabled:InstanceTypeDetails' :: InstanceTypeDetails -> Maybe Bool
$sel:appLogsEnabled:InstanceTypeDetails' :: InstanceTypeDetails -> Maybe Bool
$sel:advancedSecurityEnabled:InstanceTypeDetails' :: InstanceTypeDetails -> Maybe Bool
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
advancedSecurityEnabled
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
appLogsEnabled
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
cognitoEnabled
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
encryptionEnabled
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
instanceRole
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe OpenSearchPartitionInstanceType
instanceType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
warmEnabled