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

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

-- | /See:/ 'newInstanceTypeDetails' smart constructor.
data InstanceTypeDetails = InstanceTypeDetails'
  { InstanceTypeDetails -> Maybe Bool
encryptionEnabled :: Prelude.Maybe Prelude.Bool,
    InstanceTypeDetails -> Maybe Bool
cognitoEnabled :: Prelude.Maybe Prelude.Bool,
    InstanceTypeDetails -> Maybe [Text]
instanceRole :: Prelude.Maybe [Prelude.Text],
    InstanceTypeDetails -> Maybe OpenSearchPartitionInstanceType
instanceType :: Prelude.Maybe OpenSearchPartitionInstanceType,
    InstanceTypeDetails -> Maybe Bool
warmEnabled :: Prelude.Maybe Prelude.Bool,
    InstanceTypeDetails -> Maybe Bool
advancedSecurityEnabled :: Prelude.Maybe Prelude.Bool,
    InstanceTypeDetails -> Maybe Bool
appLogsEnabled :: Prelude.Maybe Prelude.Bool
  }
  deriving (InstanceTypeDetails -> InstanceTypeDetails -> Bool
(InstanceTypeDetails -> InstanceTypeDetails -> Bool)
-> (InstanceTypeDetails -> InstanceTypeDetails -> Bool)
-> Eq InstanceTypeDetails
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]
(Int -> ReadS InstanceTypeDetails)
-> ReadS [InstanceTypeDetails]
-> ReadPrec InstanceTypeDetails
-> ReadPrec [InstanceTypeDetails]
-> Read 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
(Int -> InstanceTypeDetails -> ShowS)
-> (InstanceTypeDetails -> String)
-> ([InstanceTypeDetails] -> ShowS)
-> Show InstanceTypeDetails
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. InstanceTypeDetails -> Rep InstanceTypeDetails x)
-> (forall x. Rep InstanceTypeDetails x -> InstanceTypeDetails)
-> Generic InstanceTypeDetails
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:
--
-- 'encryptionEnabled', 'instanceTypeDetails_encryptionEnabled' - Undocumented member.
--
-- 'cognitoEnabled', 'instanceTypeDetails_cognitoEnabled' - Undocumented member.
--
-- 'instanceRole', 'instanceTypeDetails_instanceRole' - Undocumented member.
--
-- 'instanceType', 'instanceTypeDetails_instanceType' - Undocumented member.
--
-- 'warmEnabled', 'instanceTypeDetails_warmEnabled' - Undocumented member.
--
-- 'advancedSecurityEnabled', 'instanceTypeDetails_advancedSecurityEnabled' - Undocumented member.
--
-- 'appLogsEnabled', 'instanceTypeDetails_appLogsEnabled' - Undocumented member.
newInstanceTypeDetails ::
  InstanceTypeDetails
newInstanceTypeDetails :: InstanceTypeDetails
newInstanceTypeDetails =
  InstanceTypeDetails' :: Maybe Bool
-> Maybe Bool
-> Maybe [Text]
-> Maybe OpenSearchPartitionInstanceType
-> Maybe Bool
-> Maybe Bool
-> Maybe Bool
-> InstanceTypeDetails
InstanceTypeDetails'
    { $sel:encryptionEnabled:InstanceTypeDetails' :: Maybe Bool
encryptionEnabled =
        Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:cognitoEnabled:InstanceTypeDetails' :: Maybe Bool
cognitoEnabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:instanceRole:InstanceTypeDetails' :: Maybe [Text]
instanceRole = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:instanceType:InstanceTypeDetails' :: Maybe OpenSearchPartitionInstanceType
instanceType = Maybe OpenSearchPartitionInstanceType
forall a. Maybe a
Prelude.Nothing,
      $sel:warmEnabled:InstanceTypeDetails' :: Maybe Bool
warmEnabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:advancedSecurityEnabled:InstanceTypeDetails' :: Maybe Bool
advancedSecurityEnabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:appLogsEnabled:InstanceTypeDetails' :: Maybe Bool
appLogsEnabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing
    }

-- | Undocumented member.
instanceTypeDetails_encryptionEnabled :: Lens.Lens' InstanceTypeDetails (Prelude.Maybe Prelude.Bool)
instanceTypeDetails_encryptionEnabled :: (Maybe Bool -> f (Maybe Bool))
-> InstanceTypeDetails -> f InstanceTypeDetails
instanceTypeDetails_encryptionEnabled = (InstanceTypeDetails -> Maybe Bool)
-> (InstanceTypeDetails -> Maybe Bool -> InstanceTypeDetails)
-> Lens
     InstanceTypeDetails InstanceTypeDetails (Maybe Bool) (Maybe Bool)
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)

-- | Undocumented member.
instanceTypeDetails_cognitoEnabled :: Lens.Lens' InstanceTypeDetails (Prelude.Maybe Prelude.Bool)
instanceTypeDetails_cognitoEnabled :: (Maybe Bool -> f (Maybe Bool))
-> InstanceTypeDetails -> f InstanceTypeDetails
instanceTypeDetails_cognitoEnabled = (InstanceTypeDetails -> Maybe Bool)
-> (InstanceTypeDetails -> Maybe Bool -> InstanceTypeDetails)
-> Lens
     InstanceTypeDetails InstanceTypeDetails (Maybe Bool) (Maybe Bool)
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)

-- | Undocumented member.
instanceTypeDetails_instanceRole :: Lens.Lens' InstanceTypeDetails (Prelude.Maybe [Prelude.Text])
instanceTypeDetails_instanceRole :: (Maybe [Text] -> f (Maybe [Text]))
-> InstanceTypeDetails -> f InstanceTypeDetails
instanceTypeDetails_instanceRole = (InstanceTypeDetails -> Maybe [Text])
-> (InstanceTypeDetails -> Maybe [Text] -> InstanceTypeDetails)
-> Lens
     InstanceTypeDetails
     InstanceTypeDetails
     (Maybe [Text])
     (Maybe [Text])
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) ((Maybe [Text] -> f (Maybe [Text]))
 -> InstanceTypeDetails -> f InstanceTypeDetails)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> InstanceTypeDetails
-> f InstanceTypeDetails
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Undocumented member.
instanceTypeDetails_instanceType :: Lens.Lens' InstanceTypeDetails (Prelude.Maybe OpenSearchPartitionInstanceType)
instanceTypeDetails_instanceType :: (Maybe OpenSearchPartitionInstanceType
 -> f (Maybe OpenSearchPartitionInstanceType))
-> InstanceTypeDetails -> f InstanceTypeDetails
instanceTypeDetails_instanceType = (InstanceTypeDetails -> Maybe OpenSearchPartitionInstanceType)
-> (InstanceTypeDetails
    -> Maybe OpenSearchPartitionInstanceType -> InstanceTypeDetails)
-> Lens
     InstanceTypeDetails
     InstanceTypeDetails
     (Maybe OpenSearchPartitionInstanceType)
     (Maybe OpenSearchPartitionInstanceType)
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)

-- | Undocumented member.
instanceTypeDetails_warmEnabled :: Lens.Lens' InstanceTypeDetails (Prelude.Maybe Prelude.Bool)
instanceTypeDetails_warmEnabled :: (Maybe Bool -> f (Maybe Bool))
-> InstanceTypeDetails -> f InstanceTypeDetails
instanceTypeDetails_warmEnabled = (InstanceTypeDetails -> Maybe Bool)
-> (InstanceTypeDetails -> Maybe Bool -> InstanceTypeDetails)
-> Lens
     InstanceTypeDetails InstanceTypeDetails (Maybe Bool) (Maybe Bool)
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)

-- | Undocumented member.
instanceTypeDetails_advancedSecurityEnabled :: Lens.Lens' InstanceTypeDetails (Prelude.Maybe Prelude.Bool)
instanceTypeDetails_advancedSecurityEnabled :: (Maybe Bool -> f (Maybe Bool))
-> InstanceTypeDetails -> f InstanceTypeDetails
instanceTypeDetails_advancedSecurityEnabled = (InstanceTypeDetails -> Maybe Bool)
-> (InstanceTypeDetails -> Maybe Bool -> InstanceTypeDetails)
-> Lens
     InstanceTypeDetails InstanceTypeDetails (Maybe Bool) (Maybe Bool)
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)

-- | Undocumented member.
instanceTypeDetails_appLogsEnabled :: Lens.Lens' InstanceTypeDetails (Prelude.Maybe Prelude.Bool)
instanceTypeDetails_appLogsEnabled :: (Maybe Bool -> f (Maybe Bool))
-> InstanceTypeDetails -> f InstanceTypeDetails
instanceTypeDetails_appLogsEnabled = (InstanceTypeDetails -> Maybe Bool)
-> (InstanceTypeDetails -> Maybe Bool -> InstanceTypeDetails)
-> Lens
     InstanceTypeDetails InstanceTypeDetails (Maybe Bool) (Maybe Bool)
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)

instance Core.FromJSON InstanceTypeDetails where
  parseJSON :: Value -> Parser InstanceTypeDetails
parseJSON =
    String
-> (Object -> Parser InstanceTypeDetails)
-> Value
-> Parser InstanceTypeDetails
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"InstanceTypeDetails"
      ( \Object
x ->
          Maybe Bool
-> Maybe Bool
-> Maybe [Text]
-> Maybe OpenSearchPartitionInstanceType
-> Maybe Bool
-> Maybe Bool
-> Maybe Bool
-> InstanceTypeDetails
InstanceTypeDetails'
            (Maybe Bool
 -> Maybe Bool
 -> Maybe [Text]
 -> Maybe OpenSearchPartitionInstanceType
 -> Maybe Bool
 -> Maybe Bool
 -> Maybe Bool
 -> InstanceTypeDetails)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Bool
      -> Maybe [Text]
      -> Maybe OpenSearchPartitionInstanceType
      -> Maybe Bool
      -> Maybe Bool
      -> Maybe Bool
      -> InstanceTypeDetails)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"EncryptionEnabled")
            Parser
  (Maybe Bool
   -> Maybe [Text]
   -> Maybe OpenSearchPartitionInstanceType
   -> Maybe Bool
   -> Maybe Bool
   -> Maybe Bool
   -> InstanceTypeDetails)
-> Parser (Maybe Bool)
-> Parser
     (Maybe [Text]
      -> Maybe OpenSearchPartitionInstanceType
      -> Maybe Bool
      -> Maybe Bool
      -> Maybe Bool
      -> InstanceTypeDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CognitoEnabled")
            Parser
  (Maybe [Text]
   -> Maybe OpenSearchPartitionInstanceType
   -> Maybe Bool
   -> Maybe Bool
   -> Maybe Bool
   -> InstanceTypeDetails)
-> Parser (Maybe [Text])
-> Parser
     (Maybe OpenSearchPartitionInstanceType
      -> Maybe Bool -> Maybe Bool -> Maybe Bool -> InstanceTypeDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"InstanceRole" Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe OpenSearchPartitionInstanceType
   -> Maybe Bool -> Maybe Bool -> Maybe Bool -> InstanceTypeDetails)
-> Parser (Maybe OpenSearchPartitionInstanceType)
-> Parser
     (Maybe Bool -> Maybe Bool -> Maybe Bool -> InstanceTypeDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe OpenSearchPartitionInstanceType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"InstanceType")
            Parser
  (Maybe Bool -> Maybe Bool -> Maybe Bool -> InstanceTypeDetails)
-> Parser (Maybe Bool)
-> Parser (Maybe Bool -> Maybe Bool -> InstanceTypeDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"WarmEnabled")
            Parser (Maybe Bool -> Maybe Bool -> InstanceTypeDetails)
-> Parser (Maybe Bool)
-> Parser (Maybe Bool -> InstanceTypeDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"AdvancedSecurityEnabled")
            Parser (Maybe Bool -> InstanceTypeDetails)
-> Parser (Maybe Bool) -> Parser InstanceTypeDetails
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"AppLogsEnabled")
      )

instance Prelude.Hashable InstanceTypeDetails

instance Prelude.NFData InstanceTypeDetails