{-# 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 #-}
module Amazonka.ElasticSearch.Types.StorageType where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.ElasticSearch.Types.StorageTypeLimit
import qualified Amazonka.Prelude as Prelude
data StorageType = StorageType'
{ StorageType -> Maybe Text
storageSubTypeName :: Prelude.Maybe Prelude.Text,
StorageType -> Maybe [StorageTypeLimit]
storageTypeLimits :: Prelude.Maybe [StorageTypeLimit],
StorageType -> Maybe Text
storageTypeName :: Prelude.Maybe Prelude.Text
}
deriving (StorageType -> StorageType -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StorageType -> StorageType -> Bool
$c/= :: StorageType -> StorageType -> Bool
== :: StorageType -> StorageType -> Bool
$c== :: StorageType -> StorageType -> Bool
Prelude.Eq, ReadPrec [StorageType]
ReadPrec StorageType
Int -> ReadS StorageType
ReadS [StorageType]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StorageType]
$creadListPrec :: ReadPrec [StorageType]
readPrec :: ReadPrec StorageType
$creadPrec :: ReadPrec StorageType
readList :: ReadS [StorageType]
$creadList :: ReadS [StorageType]
readsPrec :: Int -> ReadS StorageType
$creadsPrec :: Int -> ReadS StorageType
Prelude.Read, Int -> StorageType -> ShowS
[StorageType] -> ShowS
StorageType -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StorageType] -> ShowS
$cshowList :: [StorageType] -> ShowS
show :: StorageType -> String
$cshow :: StorageType -> String
showsPrec :: Int -> StorageType -> ShowS
$cshowsPrec :: Int -> StorageType -> ShowS
Prelude.Show, forall x. Rep StorageType x -> StorageType
forall x. StorageType -> Rep StorageType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StorageType x -> StorageType
$cfrom :: forall x. StorageType -> Rep StorageType x
Prelude.Generic)
newStorageType ::
StorageType
newStorageType :: StorageType
newStorageType =
StorageType'
{ $sel:storageSubTypeName:StorageType' :: Maybe Text
storageSubTypeName = forall a. Maybe a
Prelude.Nothing,
$sel:storageTypeLimits:StorageType' :: Maybe [StorageTypeLimit]
storageTypeLimits = forall a. Maybe a
Prelude.Nothing,
$sel:storageTypeName:StorageType' :: Maybe Text
storageTypeName = forall a. Maybe a
Prelude.Nothing
}
storageType_storageSubTypeName :: Lens.Lens' StorageType (Prelude.Maybe Prelude.Text)
storageType_storageSubTypeName :: Lens' StorageType (Maybe Text)
storageType_storageSubTypeName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StorageType' {Maybe Text
storageSubTypeName :: Maybe Text
$sel:storageSubTypeName:StorageType' :: StorageType -> Maybe Text
storageSubTypeName} -> Maybe Text
storageSubTypeName) (\s :: StorageType
s@StorageType' {} Maybe Text
a -> StorageType
s {$sel:storageSubTypeName:StorageType' :: Maybe Text
storageSubTypeName = Maybe Text
a} :: StorageType)
storageType_storageTypeLimits :: Lens.Lens' StorageType (Prelude.Maybe [StorageTypeLimit])
storageType_storageTypeLimits :: Lens' StorageType (Maybe [StorageTypeLimit])
storageType_storageTypeLimits = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StorageType' {Maybe [StorageTypeLimit]
storageTypeLimits :: Maybe [StorageTypeLimit]
$sel:storageTypeLimits:StorageType' :: StorageType -> Maybe [StorageTypeLimit]
storageTypeLimits} -> Maybe [StorageTypeLimit]
storageTypeLimits) (\s :: StorageType
s@StorageType' {} Maybe [StorageTypeLimit]
a -> StorageType
s {$sel:storageTypeLimits:StorageType' :: Maybe [StorageTypeLimit]
storageTypeLimits = Maybe [StorageTypeLimit]
a} :: StorageType) 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
storageType_storageTypeName :: Lens.Lens' StorageType (Prelude.Maybe Prelude.Text)
storageType_storageTypeName :: Lens' StorageType (Maybe Text)
storageType_storageTypeName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StorageType' {Maybe Text
storageTypeName :: Maybe Text
$sel:storageTypeName:StorageType' :: StorageType -> Maybe Text
storageTypeName} -> Maybe Text
storageTypeName) (\s :: StorageType
s@StorageType' {} Maybe Text
a -> StorageType
s {$sel:storageTypeName:StorageType' :: Maybe Text
storageTypeName = Maybe Text
a} :: StorageType)
instance Data.FromJSON StorageType where
parseJSON :: Value -> Parser StorageType
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"StorageType"
( \Object
x ->
Maybe Text -> Maybe [StorageTypeLimit] -> Maybe Text -> StorageType
StorageType'
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
"StorageSubTypeName")
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
"StorageTypeLimits"
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
"StorageTypeName")
)
instance Prelude.Hashable StorageType where
hashWithSalt :: Int -> StorageType -> Int
hashWithSalt Int
_salt StorageType' {Maybe [StorageTypeLimit]
Maybe Text
storageTypeName :: Maybe Text
storageTypeLimits :: Maybe [StorageTypeLimit]
storageSubTypeName :: Maybe Text
$sel:storageTypeName:StorageType' :: StorageType -> Maybe Text
$sel:storageTypeLimits:StorageType' :: StorageType -> Maybe [StorageTypeLimit]
$sel:storageSubTypeName:StorageType' :: StorageType -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
storageSubTypeName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [StorageTypeLimit]
storageTypeLimits
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
storageTypeName
instance Prelude.NFData StorageType where
rnf :: StorageType -> ()
rnf StorageType' {Maybe [StorageTypeLimit]
Maybe Text
storageTypeName :: Maybe Text
storageTypeLimits :: Maybe [StorageTypeLimit]
storageSubTypeName :: Maybe Text
$sel:storageTypeName:StorageType' :: StorageType -> Maybe Text
$sel:storageTypeLimits:StorageType' :: StorageType -> Maybe [StorageTypeLimit]
$sel:storageSubTypeName:StorageType' :: StorageType -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
storageSubTypeName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [StorageTypeLimit]
storageTypeLimits
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
storageTypeName