{-# 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 qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.DynamoDB.Types.AttributeValue
import Amazonka.DynamoDB.Types.KeySchemaElement
import Amazonka.DynamoDB.Types.Projection
import Amazonka.DynamoDB.Types.WriteRequest
import qualified Amazonka.Prelude as Prelude
data LocalSecondaryIndexDescription = LocalSecondaryIndexDescription'
{
LocalSecondaryIndexDescription -> Maybe Text
indexArn :: Prelude.Maybe Prelude.Text,
LocalSecondaryIndexDescription -> Maybe Text
indexName :: Prelude.Maybe Prelude.Text,
LocalSecondaryIndexDescription -> Maybe Integer
indexSizeBytes :: Prelude.Maybe Prelude.Integer,
LocalSecondaryIndexDescription -> Maybe Integer
itemCount :: Prelude.Maybe Prelude.Integer,
LocalSecondaryIndexDescription -> Maybe (NonEmpty KeySchemaElement)
keySchema :: Prelude.Maybe (Prelude.NonEmpty KeySchemaElement),
LocalSecondaryIndexDescription -> Maybe Projection
projection :: Prelude.Maybe Projection
}
deriving (LocalSecondaryIndexDescription
-> LocalSecondaryIndexDescription -> Bool
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]
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
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.
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'
{ $sel:indexArn:LocalSecondaryIndexDescription' :: Maybe Text
indexArn =
forall a. Maybe a
Prelude.Nothing,
$sel:indexName:LocalSecondaryIndexDescription' :: Maybe Text
indexName = forall a. Maybe a
Prelude.Nothing,
$sel:indexSizeBytes:LocalSecondaryIndexDescription' :: Maybe Integer
indexSizeBytes = forall a. Maybe a
Prelude.Nothing,
$sel:itemCount:LocalSecondaryIndexDescription' :: Maybe Integer
itemCount = forall a. Maybe a
Prelude.Nothing,
$sel:keySchema:LocalSecondaryIndexDescription' :: Maybe (NonEmpty KeySchemaElement)
keySchema = forall a. Maybe a
Prelude.Nothing,
$sel:projection:LocalSecondaryIndexDescription' :: Maybe Projection
projection = forall a. Maybe a
Prelude.Nothing
}
localSecondaryIndexDescription_indexArn :: Lens.Lens' LocalSecondaryIndexDescription (Prelude.Maybe Prelude.Text)
localSecondaryIndexDescription_indexArn :: Lens' LocalSecondaryIndexDescription (Maybe Text)
localSecondaryIndexDescription_indexArn = 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_indexName :: Lens.Lens' LocalSecondaryIndexDescription (Prelude.Maybe Prelude.Text)
localSecondaryIndexDescription_indexName :: Lens' LocalSecondaryIndexDescription (Maybe Text)
localSecondaryIndexDescription_indexName = 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)
localSecondaryIndexDescription_indexSizeBytes :: Lens.Lens' LocalSecondaryIndexDescription (Prelude.Maybe Prelude.Integer)
localSecondaryIndexDescription_indexSizeBytes :: Lens' LocalSecondaryIndexDescription (Maybe Integer)
localSecondaryIndexDescription_indexSizeBytes = 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_itemCount :: Lens.Lens' LocalSecondaryIndexDescription (Prelude.Maybe Prelude.Integer)
localSecondaryIndexDescription_itemCount :: Lens' LocalSecondaryIndexDescription (Maybe Integer)
localSecondaryIndexDescription_itemCount = 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_keySchema :: Lens.Lens' LocalSecondaryIndexDescription (Prelude.Maybe (Prelude.NonEmpty KeySchemaElement))
localSecondaryIndexDescription_keySchema :: Lens'
LocalSecondaryIndexDescription (Maybe (NonEmpty KeySchemaElement))
localSecondaryIndexDescription_keySchema = 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) 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
localSecondaryIndexDescription_projection :: Lens.Lens' LocalSecondaryIndexDescription (Prelude.Maybe Projection)
localSecondaryIndexDescription_projection :: Lens' LocalSecondaryIndexDescription (Maybe Projection)
localSecondaryIndexDescription_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)
instance Data.FromJSON LocalSecondaryIndexDescription where
parseJSON :: Value -> Parser LocalSecondaryIndexDescription
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"LocalSecondaryIndexDescription"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe Integer
-> Maybe Integer
-> Maybe (NonEmpty KeySchemaElement)
-> Maybe Projection
-> LocalSecondaryIndexDescription
LocalSecondaryIndexDescription'
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
"IndexArn")
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
"IndexName")
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
"IndexSizeBytes")
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
"ItemCount")
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
"KeySchema")
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
"Projection")
)
instance
Prelude.Hashable
LocalSecondaryIndexDescription
where
hashWithSalt :: Int -> LocalSecondaryIndexDescription -> Int
hashWithSalt
Int
_salt
LocalSecondaryIndexDescription' {Maybe Integer
Maybe (NonEmpty KeySchemaElement)
Maybe Text
Maybe Projection
projection :: Maybe Projection
keySchema :: Maybe (NonEmpty KeySchemaElement)
itemCount :: Maybe Integer
indexSizeBytes :: Maybe Integer
indexName :: Maybe Text
indexArn :: Maybe Text
$sel:projection:LocalSecondaryIndexDescription' :: LocalSecondaryIndexDescription -> Maybe Projection
$sel:keySchema:LocalSecondaryIndexDescription' :: LocalSecondaryIndexDescription -> Maybe (NonEmpty KeySchemaElement)
$sel:itemCount:LocalSecondaryIndexDescription' :: LocalSecondaryIndexDescription -> Maybe Integer
$sel:indexSizeBytes:LocalSecondaryIndexDescription' :: LocalSecondaryIndexDescription -> Maybe Integer
$sel:indexName:LocalSecondaryIndexDescription' :: LocalSecondaryIndexDescription -> Maybe Text
$sel:indexArn:LocalSecondaryIndexDescription' :: LocalSecondaryIndexDescription -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
indexArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
indexName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
indexSizeBytes
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
itemCount
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty KeySchemaElement)
keySchema
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Projection
projection
instance
Prelude.NFData
LocalSecondaryIndexDescription
where
rnf :: LocalSecondaryIndexDescription -> ()
rnf LocalSecondaryIndexDescription' {Maybe Integer
Maybe (NonEmpty KeySchemaElement)
Maybe Text
Maybe Projection
projection :: Maybe Projection
keySchema :: Maybe (NonEmpty KeySchemaElement)
itemCount :: Maybe Integer
indexSizeBytes :: Maybe Integer
indexName :: Maybe Text
indexArn :: Maybe Text
$sel:projection:LocalSecondaryIndexDescription' :: LocalSecondaryIndexDescription -> Maybe Projection
$sel:keySchema:LocalSecondaryIndexDescription' :: LocalSecondaryIndexDescription -> Maybe (NonEmpty KeySchemaElement)
$sel:itemCount:LocalSecondaryIndexDescription' :: LocalSecondaryIndexDescription -> Maybe Integer
$sel:indexSizeBytes:LocalSecondaryIndexDescription' :: LocalSecondaryIndexDescription -> Maybe Integer
$sel:indexName:LocalSecondaryIndexDescription' :: LocalSecondaryIndexDescription -> Maybe Text
$sel:indexArn:LocalSecondaryIndexDescription' :: LocalSecondaryIndexDescription -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
indexArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
indexName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
indexSizeBytes
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
itemCount
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty KeySchemaElement)
keySchema
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Projection
projection