{-# 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.DynamoDB.Types.LocalSecondaryIndexDescription where
import qualified Amazonka.Core as Core
import Amazonka.DynamoDB.Types.KeySchemaElement
import Amazonka.DynamoDB.Types.Projection
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data LocalSecondaryIndexDescription = LocalSecondaryIndexDescription'
{
LocalSecondaryIndexDescription -> Maybe Integer
indexSizeBytes :: Prelude.Maybe Prelude.Integer,
LocalSecondaryIndexDescription -> Maybe Text
indexArn :: Prelude.Maybe Prelude.Text,
LocalSecondaryIndexDescription -> Maybe (NonEmpty KeySchemaElement)
keySchema :: Prelude.Maybe (Prelude.NonEmpty KeySchemaElement),
LocalSecondaryIndexDescription -> Maybe Projection
projection :: Prelude.Maybe Projection,
LocalSecondaryIndexDescription -> Maybe Integer
itemCount :: Prelude.Maybe Prelude.Integer,
LocalSecondaryIndexDescription -> Maybe Text
indexName :: Prelude.Maybe Prelude.Text
}
deriving (LocalSecondaryIndexDescription
-> LocalSecondaryIndexDescription -> Bool
(LocalSecondaryIndexDescription
-> LocalSecondaryIndexDescription -> Bool)
-> (LocalSecondaryIndexDescription
-> LocalSecondaryIndexDescription -> Bool)
-> Eq LocalSecondaryIndexDescription
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LocalSecondaryIndexDescription
-> LocalSecondaryIndexDescription -> Bool
$c/= :: LocalSecondaryIndexDescription
-> LocalSecondaryIndexDescription -> Bool
== :: LocalSecondaryIndexDescription
-> LocalSecondaryIndexDescription -> Bool
$c== :: LocalSecondaryIndexDescription
-> LocalSecondaryIndexDescription -> Bool
Prelude.Eq, ReadPrec [LocalSecondaryIndexDescription]
ReadPrec LocalSecondaryIndexDescription
Int -> ReadS LocalSecondaryIndexDescription
ReadS [LocalSecondaryIndexDescription]
(Int -> ReadS LocalSecondaryIndexDescription)
-> ReadS [LocalSecondaryIndexDescription]
-> ReadPrec LocalSecondaryIndexDescription
-> ReadPrec [LocalSecondaryIndexDescription]
-> Read LocalSecondaryIndexDescription
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LocalSecondaryIndexDescription]
$creadListPrec :: ReadPrec [LocalSecondaryIndexDescription]
readPrec :: ReadPrec LocalSecondaryIndexDescription
$creadPrec :: ReadPrec LocalSecondaryIndexDescription
readList :: ReadS [LocalSecondaryIndexDescription]
$creadList :: ReadS [LocalSecondaryIndexDescription]
readsPrec :: Int -> ReadS LocalSecondaryIndexDescription
$creadsPrec :: Int -> ReadS LocalSecondaryIndexDescription
Prelude.Read, Int -> LocalSecondaryIndexDescription -> ShowS
[LocalSecondaryIndexDescription] -> ShowS
LocalSecondaryIndexDescription -> String
(Int -> LocalSecondaryIndexDescription -> ShowS)
-> (LocalSecondaryIndexDescription -> String)
-> ([LocalSecondaryIndexDescription] -> ShowS)
-> Show LocalSecondaryIndexDescription
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LocalSecondaryIndexDescription] -> ShowS
$cshowList :: [LocalSecondaryIndexDescription] -> ShowS
show :: LocalSecondaryIndexDescription -> String
$cshow :: LocalSecondaryIndexDescription -> String
showsPrec :: Int -> LocalSecondaryIndexDescription -> ShowS
$cshowsPrec :: Int -> LocalSecondaryIndexDescription -> ShowS
Prelude.Show, (forall x.
LocalSecondaryIndexDescription
-> Rep LocalSecondaryIndexDescription x)
-> (forall x.
Rep LocalSecondaryIndexDescription x
-> LocalSecondaryIndexDescription)
-> Generic LocalSecondaryIndexDescription
forall x.
Rep LocalSecondaryIndexDescription x
-> LocalSecondaryIndexDescription
forall x.
LocalSecondaryIndexDescription
-> Rep LocalSecondaryIndexDescription x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep LocalSecondaryIndexDescription x
-> LocalSecondaryIndexDescription
$cfrom :: forall x.
LocalSecondaryIndexDescription
-> Rep LocalSecondaryIndexDescription x
Prelude.Generic)
newLocalSecondaryIndexDescription ::
LocalSecondaryIndexDescription
newLocalSecondaryIndexDescription :: LocalSecondaryIndexDescription
newLocalSecondaryIndexDescription =
LocalSecondaryIndexDescription' :: Maybe Integer
-> Maybe Text
-> Maybe (NonEmpty KeySchemaElement)
-> Maybe Projection
-> Maybe Integer
-> Maybe Text
-> LocalSecondaryIndexDescription
LocalSecondaryIndexDescription'
{ $sel:indexSizeBytes:LocalSecondaryIndexDescription' :: Maybe Integer
indexSizeBytes =
Maybe Integer
forall a. Maybe a
Prelude.Nothing,
$sel:indexArn:LocalSecondaryIndexDescription' :: Maybe Text
indexArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:keySchema:LocalSecondaryIndexDescription' :: Maybe (NonEmpty KeySchemaElement)
keySchema = Maybe (NonEmpty KeySchemaElement)
forall a. Maybe a
Prelude.Nothing,
$sel:projection:LocalSecondaryIndexDescription' :: Maybe Projection
projection = Maybe Projection
forall a. Maybe a
Prelude.Nothing,
$sel:itemCount:LocalSecondaryIndexDescription' :: Maybe Integer
itemCount = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
$sel:indexName:LocalSecondaryIndexDescription' :: Maybe Text
indexName = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
localSecondaryIndexDescription_indexSizeBytes :: Lens.Lens' LocalSecondaryIndexDescription (Prelude.Maybe Prelude.Integer)
localSecondaryIndexDescription_indexSizeBytes :: (Maybe Integer -> f (Maybe Integer))
-> LocalSecondaryIndexDescription
-> f LocalSecondaryIndexDescription
localSecondaryIndexDescription_indexSizeBytes = (LocalSecondaryIndexDescription -> Maybe Integer)
-> (LocalSecondaryIndexDescription
-> Maybe Integer -> LocalSecondaryIndexDescription)
-> Lens
LocalSecondaryIndexDescription
LocalSecondaryIndexDescription
(Maybe Integer)
(Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LocalSecondaryIndexDescription' {Maybe Integer
indexSizeBytes :: Maybe Integer
$sel:indexSizeBytes:LocalSecondaryIndexDescription' :: LocalSecondaryIndexDescription -> Maybe Integer
indexSizeBytes} -> Maybe Integer
indexSizeBytes) (\s :: LocalSecondaryIndexDescription
s@LocalSecondaryIndexDescription' {} Maybe Integer
a -> LocalSecondaryIndexDescription
s {$sel:indexSizeBytes:LocalSecondaryIndexDescription' :: Maybe Integer
indexSizeBytes = Maybe Integer
a} :: LocalSecondaryIndexDescription)
localSecondaryIndexDescription_indexArn :: Lens.Lens' LocalSecondaryIndexDescription (Prelude.Maybe Prelude.Text)
localSecondaryIndexDescription_indexArn :: (Maybe Text -> f (Maybe Text))
-> LocalSecondaryIndexDescription
-> f LocalSecondaryIndexDescription
localSecondaryIndexDescription_indexArn = (LocalSecondaryIndexDescription -> Maybe Text)
-> (LocalSecondaryIndexDescription
-> Maybe Text -> LocalSecondaryIndexDescription)
-> Lens
LocalSecondaryIndexDescription
LocalSecondaryIndexDescription
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LocalSecondaryIndexDescription' {Maybe Text
indexArn :: Maybe Text
$sel:indexArn:LocalSecondaryIndexDescription' :: LocalSecondaryIndexDescription -> Maybe Text
indexArn} -> Maybe Text
indexArn) (\s :: LocalSecondaryIndexDescription
s@LocalSecondaryIndexDescription' {} Maybe Text
a -> LocalSecondaryIndexDescription
s {$sel:indexArn:LocalSecondaryIndexDescription' :: Maybe Text
indexArn = Maybe Text
a} :: LocalSecondaryIndexDescription)
localSecondaryIndexDescription_keySchema :: Lens.Lens' LocalSecondaryIndexDescription (Prelude.Maybe (Prelude.NonEmpty KeySchemaElement))
localSecondaryIndexDescription_keySchema :: (Maybe (NonEmpty KeySchemaElement)
-> f (Maybe (NonEmpty KeySchemaElement)))
-> LocalSecondaryIndexDescription
-> f LocalSecondaryIndexDescription
localSecondaryIndexDescription_keySchema = (LocalSecondaryIndexDescription
-> Maybe (NonEmpty KeySchemaElement))
-> (LocalSecondaryIndexDescription
-> Maybe (NonEmpty KeySchemaElement)
-> LocalSecondaryIndexDescription)
-> Lens
LocalSecondaryIndexDescription
LocalSecondaryIndexDescription
(Maybe (NonEmpty KeySchemaElement))
(Maybe (NonEmpty KeySchemaElement))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LocalSecondaryIndexDescription' {Maybe (NonEmpty KeySchemaElement)
keySchema :: Maybe (NonEmpty KeySchemaElement)
$sel:keySchema:LocalSecondaryIndexDescription' :: LocalSecondaryIndexDescription -> Maybe (NonEmpty KeySchemaElement)
keySchema} -> Maybe (NonEmpty KeySchemaElement)
keySchema) (\s :: LocalSecondaryIndexDescription
s@LocalSecondaryIndexDescription' {} Maybe (NonEmpty KeySchemaElement)
a -> LocalSecondaryIndexDescription
s {$sel:keySchema:LocalSecondaryIndexDescription' :: Maybe (NonEmpty KeySchemaElement)
keySchema = Maybe (NonEmpty KeySchemaElement)
a} :: LocalSecondaryIndexDescription) ((Maybe (NonEmpty KeySchemaElement)
-> f (Maybe (NonEmpty KeySchemaElement)))
-> LocalSecondaryIndexDescription
-> f LocalSecondaryIndexDescription)
-> ((Maybe (NonEmpty KeySchemaElement)
-> f (Maybe (NonEmpty KeySchemaElement)))
-> Maybe (NonEmpty KeySchemaElement)
-> f (Maybe (NonEmpty KeySchemaElement)))
-> (Maybe (NonEmpty KeySchemaElement)
-> f (Maybe (NonEmpty KeySchemaElement)))
-> LocalSecondaryIndexDescription
-> f LocalSecondaryIndexDescription
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(NonEmpty KeySchemaElement)
(NonEmpty KeySchemaElement)
(NonEmpty KeySchemaElement)
(NonEmpty KeySchemaElement)
-> Iso
(Maybe (NonEmpty KeySchemaElement))
(Maybe (NonEmpty KeySchemaElement))
(Maybe (NonEmpty KeySchemaElement))
(Maybe (NonEmpty KeySchemaElement))
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
(NonEmpty KeySchemaElement)
(NonEmpty KeySchemaElement)
(NonEmpty KeySchemaElement)
(NonEmpty KeySchemaElement)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
localSecondaryIndexDescription_projection :: Lens.Lens' LocalSecondaryIndexDescription (Prelude.Maybe Projection)
localSecondaryIndexDescription_projection :: (Maybe Projection -> f (Maybe Projection))
-> LocalSecondaryIndexDescription
-> f LocalSecondaryIndexDescription
localSecondaryIndexDescription_projection = (LocalSecondaryIndexDescription -> Maybe Projection)
-> (LocalSecondaryIndexDescription
-> Maybe Projection -> LocalSecondaryIndexDescription)
-> Lens
LocalSecondaryIndexDescription
LocalSecondaryIndexDescription
(Maybe Projection)
(Maybe Projection)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LocalSecondaryIndexDescription' {Maybe Projection
projection :: Maybe Projection
$sel:projection:LocalSecondaryIndexDescription' :: LocalSecondaryIndexDescription -> Maybe Projection
projection} -> Maybe Projection
projection) (\s :: LocalSecondaryIndexDescription
s@LocalSecondaryIndexDescription' {} Maybe Projection
a -> LocalSecondaryIndexDescription
s {$sel:projection:LocalSecondaryIndexDescription' :: Maybe Projection
projection = Maybe Projection
a} :: LocalSecondaryIndexDescription)
localSecondaryIndexDescription_itemCount :: Lens.Lens' LocalSecondaryIndexDescription (Prelude.Maybe Prelude.Integer)
localSecondaryIndexDescription_itemCount :: (Maybe Integer -> f (Maybe Integer))
-> LocalSecondaryIndexDescription
-> f LocalSecondaryIndexDescription
localSecondaryIndexDescription_itemCount = (LocalSecondaryIndexDescription -> Maybe Integer)
-> (LocalSecondaryIndexDescription
-> Maybe Integer -> LocalSecondaryIndexDescription)
-> Lens
LocalSecondaryIndexDescription
LocalSecondaryIndexDescription
(Maybe Integer)
(Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LocalSecondaryIndexDescription' {Maybe Integer
itemCount :: Maybe Integer
$sel:itemCount:LocalSecondaryIndexDescription' :: LocalSecondaryIndexDescription -> Maybe Integer
itemCount} -> Maybe Integer
itemCount) (\s :: LocalSecondaryIndexDescription
s@LocalSecondaryIndexDescription' {} Maybe Integer
a -> LocalSecondaryIndexDescription
s {$sel:itemCount:LocalSecondaryIndexDescription' :: Maybe Integer
itemCount = Maybe Integer
a} :: LocalSecondaryIndexDescription)
localSecondaryIndexDescription_indexName :: Lens.Lens' LocalSecondaryIndexDescription (Prelude.Maybe Prelude.Text)
localSecondaryIndexDescription_indexName :: (Maybe Text -> f (Maybe Text))
-> LocalSecondaryIndexDescription
-> f LocalSecondaryIndexDescription
localSecondaryIndexDescription_indexName = (LocalSecondaryIndexDescription -> Maybe Text)
-> (LocalSecondaryIndexDescription
-> Maybe Text -> LocalSecondaryIndexDescription)
-> Lens
LocalSecondaryIndexDescription
LocalSecondaryIndexDescription
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LocalSecondaryIndexDescription' {Maybe Text
indexName :: Maybe Text
$sel:indexName:LocalSecondaryIndexDescription' :: LocalSecondaryIndexDescription -> Maybe Text
indexName} -> Maybe Text
indexName) (\s :: LocalSecondaryIndexDescription
s@LocalSecondaryIndexDescription' {} Maybe Text
a -> LocalSecondaryIndexDescription
s {$sel:indexName:LocalSecondaryIndexDescription' :: Maybe Text
indexName = Maybe Text
a} :: LocalSecondaryIndexDescription)
instance Core.FromJSON LocalSecondaryIndexDescription where
parseJSON :: Value -> Parser LocalSecondaryIndexDescription
parseJSON =
String
-> (Object -> Parser LocalSecondaryIndexDescription)
-> Value
-> Parser LocalSecondaryIndexDescription
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"LocalSecondaryIndexDescription"
( \Object
x ->
Maybe Integer
-> Maybe Text
-> Maybe (NonEmpty KeySchemaElement)
-> Maybe Projection
-> Maybe Integer
-> Maybe Text
-> LocalSecondaryIndexDescription
LocalSecondaryIndexDescription'
(Maybe Integer
-> Maybe Text
-> Maybe (NonEmpty KeySchemaElement)
-> Maybe Projection
-> Maybe Integer
-> Maybe Text
-> LocalSecondaryIndexDescription)
-> Parser (Maybe Integer)
-> Parser
(Maybe Text
-> Maybe (NonEmpty KeySchemaElement)
-> Maybe Projection
-> Maybe Integer
-> Maybe Text
-> LocalSecondaryIndexDescription)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"IndexSizeBytes")
Parser
(Maybe Text
-> Maybe (NonEmpty KeySchemaElement)
-> Maybe Projection
-> Maybe Integer
-> Maybe Text
-> LocalSecondaryIndexDescription)
-> Parser (Maybe Text)
-> Parser
(Maybe (NonEmpty KeySchemaElement)
-> Maybe Projection
-> Maybe Integer
-> Maybe Text
-> LocalSecondaryIndexDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"IndexArn")
Parser
(Maybe (NonEmpty KeySchemaElement)
-> Maybe Projection
-> Maybe Integer
-> Maybe Text
-> LocalSecondaryIndexDescription)
-> Parser (Maybe (NonEmpty KeySchemaElement))
-> Parser
(Maybe Projection
-> Maybe Integer -> Maybe Text -> LocalSecondaryIndexDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (NonEmpty KeySchemaElement))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"KeySchema")
Parser
(Maybe Projection
-> Maybe Integer -> Maybe Text -> LocalSecondaryIndexDescription)
-> Parser (Maybe Projection)
-> Parser
(Maybe Integer -> Maybe Text -> LocalSecondaryIndexDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Projection)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Projection")
Parser
(Maybe Integer -> Maybe Text -> LocalSecondaryIndexDescription)
-> Parser (Maybe Integer)
-> Parser (Maybe Text -> LocalSecondaryIndexDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ItemCount")
Parser (Maybe Text -> LocalSecondaryIndexDescription)
-> Parser (Maybe Text) -> Parser LocalSecondaryIndexDescription
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"IndexName")
)
instance
Prelude.Hashable
LocalSecondaryIndexDescription
instance
Prelude.NFData
LocalSecondaryIndexDescription