{-# 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.LocalSecondaryIndexInfo 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 LocalSecondaryIndexInfo = LocalSecondaryIndexInfo'
{
LocalSecondaryIndexInfo -> Maybe Text
indexName :: Prelude.Maybe Prelude.Text,
LocalSecondaryIndexInfo -> Maybe (NonEmpty KeySchemaElement)
keySchema :: Prelude.Maybe (Prelude.NonEmpty KeySchemaElement),
LocalSecondaryIndexInfo -> Maybe Projection
projection :: Prelude.Maybe Projection
}
deriving (LocalSecondaryIndexInfo -> LocalSecondaryIndexInfo -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LocalSecondaryIndexInfo -> LocalSecondaryIndexInfo -> Bool
$c/= :: LocalSecondaryIndexInfo -> LocalSecondaryIndexInfo -> Bool
== :: LocalSecondaryIndexInfo -> LocalSecondaryIndexInfo -> Bool
$c== :: LocalSecondaryIndexInfo -> LocalSecondaryIndexInfo -> Bool
Prelude.Eq, ReadPrec [LocalSecondaryIndexInfo]
ReadPrec LocalSecondaryIndexInfo
Int -> ReadS LocalSecondaryIndexInfo
ReadS [LocalSecondaryIndexInfo]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LocalSecondaryIndexInfo]
$creadListPrec :: ReadPrec [LocalSecondaryIndexInfo]
readPrec :: ReadPrec LocalSecondaryIndexInfo
$creadPrec :: ReadPrec LocalSecondaryIndexInfo
readList :: ReadS [LocalSecondaryIndexInfo]
$creadList :: ReadS [LocalSecondaryIndexInfo]
readsPrec :: Int -> ReadS LocalSecondaryIndexInfo
$creadsPrec :: Int -> ReadS LocalSecondaryIndexInfo
Prelude.Read, Int -> LocalSecondaryIndexInfo -> ShowS
[LocalSecondaryIndexInfo] -> ShowS
LocalSecondaryIndexInfo -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LocalSecondaryIndexInfo] -> ShowS
$cshowList :: [LocalSecondaryIndexInfo] -> ShowS
show :: LocalSecondaryIndexInfo -> String
$cshow :: LocalSecondaryIndexInfo -> String
showsPrec :: Int -> LocalSecondaryIndexInfo -> ShowS
$cshowsPrec :: Int -> LocalSecondaryIndexInfo -> ShowS
Prelude.Show, forall x. Rep LocalSecondaryIndexInfo x -> LocalSecondaryIndexInfo
forall x. LocalSecondaryIndexInfo -> Rep LocalSecondaryIndexInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep LocalSecondaryIndexInfo x -> LocalSecondaryIndexInfo
$cfrom :: forall x. LocalSecondaryIndexInfo -> Rep LocalSecondaryIndexInfo x
Prelude.Generic)
newLocalSecondaryIndexInfo ::
LocalSecondaryIndexInfo
newLocalSecondaryIndexInfo :: LocalSecondaryIndexInfo
newLocalSecondaryIndexInfo =
LocalSecondaryIndexInfo'
{ $sel:indexName:LocalSecondaryIndexInfo' :: Maybe Text
indexName =
forall a. Maybe a
Prelude.Nothing,
$sel:keySchema:LocalSecondaryIndexInfo' :: Maybe (NonEmpty KeySchemaElement)
keySchema = forall a. Maybe a
Prelude.Nothing,
$sel:projection:LocalSecondaryIndexInfo' :: Maybe Projection
projection = forall a. Maybe a
Prelude.Nothing
}
localSecondaryIndexInfo_indexName :: Lens.Lens' LocalSecondaryIndexInfo (Prelude.Maybe Prelude.Text)
localSecondaryIndexInfo_indexName :: Lens' LocalSecondaryIndexInfo (Maybe Text)
localSecondaryIndexInfo_indexName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LocalSecondaryIndexInfo' {Maybe Text
indexName :: Maybe Text
$sel:indexName:LocalSecondaryIndexInfo' :: LocalSecondaryIndexInfo -> Maybe Text
indexName} -> Maybe Text
indexName) (\s :: LocalSecondaryIndexInfo
s@LocalSecondaryIndexInfo' {} Maybe Text
a -> LocalSecondaryIndexInfo
s {$sel:indexName:LocalSecondaryIndexInfo' :: Maybe Text
indexName = Maybe Text
a} :: LocalSecondaryIndexInfo)
localSecondaryIndexInfo_keySchema :: Lens.Lens' LocalSecondaryIndexInfo (Prelude.Maybe (Prelude.NonEmpty KeySchemaElement))
localSecondaryIndexInfo_keySchema :: Lens' LocalSecondaryIndexInfo (Maybe (NonEmpty KeySchemaElement))
localSecondaryIndexInfo_keySchema = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LocalSecondaryIndexInfo' {Maybe (NonEmpty KeySchemaElement)
keySchema :: Maybe (NonEmpty KeySchemaElement)
$sel:keySchema:LocalSecondaryIndexInfo' :: LocalSecondaryIndexInfo -> Maybe (NonEmpty KeySchemaElement)
keySchema} -> Maybe (NonEmpty KeySchemaElement)
keySchema) (\s :: LocalSecondaryIndexInfo
s@LocalSecondaryIndexInfo' {} Maybe (NonEmpty KeySchemaElement)
a -> LocalSecondaryIndexInfo
s {$sel:keySchema:LocalSecondaryIndexInfo' :: Maybe (NonEmpty KeySchemaElement)
keySchema = Maybe (NonEmpty KeySchemaElement)
a} :: LocalSecondaryIndexInfo) 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
localSecondaryIndexInfo_projection :: Lens.Lens' LocalSecondaryIndexInfo (Prelude.Maybe Projection)
localSecondaryIndexInfo_projection :: Lens' LocalSecondaryIndexInfo (Maybe Projection)
localSecondaryIndexInfo_projection = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LocalSecondaryIndexInfo' {Maybe Projection
projection :: Maybe Projection
$sel:projection:LocalSecondaryIndexInfo' :: LocalSecondaryIndexInfo -> Maybe Projection
projection} -> Maybe Projection
projection) (\s :: LocalSecondaryIndexInfo
s@LocalSecondaryIndexInfo' {} Maybe Projection
a -> LocalSecondaryIndexInfo
s {$sel:projection:LocalSecondaryIndexInfo' :: Maybe Projection
projection = Maybe Projection
a} :: LocalSecondaryIndexInfo)
instance Data.FromJSON LocalSecondaryIndexInfo where
parseJSON :: Value -> Parser LocalSecondaryIndexInfo
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"LocalSecondaryIndexInfo"
( \Object
x ->
Maybe Text
-> Maybe (NonEmpty KeySchemaElement)
-> Maybe Projection
-> LocalSecondaryIndexInfo
LocalSecondaryIndexInfo'
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
"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
"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 LocalSecondaryIndexInfo where
hashWithSalt :: Int -> LocalSecondaryIndexInfo -> Int
hashWithSalt Int
_salt LocalSecondaryIndexInfo' {Maybe (NonEmpty KeySchemaElement)
Maybe Text
Maybe Projection
projection :: Maybe Projection
keySchema :: Maybe (NonEmpty KeySchemaElement)
indexName :: Maybe Text
$sel:projection:LocalSecondaryIndexInfo' :: LocalSecondaryIndexInfo -> Maybe Projection
$sel:keySchema:LocalSecondaryIndexInfo' :: LocalSecondaryIndexInfo -> Maybe (NonEmpty KeySchemaElement)
$sel:indexName:LocalSecondaryIndexInfo' :: LocalSecondaryIndexInfo -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
indexName
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 LocalSecondaryIndexInfo where
rnf :: LocalSecondaryIndexInfo -> ()
rnf LocalSecondaryIndexInfo' {Maybe (NonEmpty KeySchemaElement)
Maybe Text
Maybe Projection
projection :: Maybe Projection
keySchema :: Maybe (NonEmpty KeySchemaElement)
indexName :: Maybe Text
$sel:projection:LocalSecondaryIndexInfo' :: LocalSecondaryIndexInfo -> Maybe Projection
$sel:keySchema:LocalSecondaryIndexInfo' :: LocalSecondaryIndexInfo -> Maybe (NonEmpty KeySchemaElement)
$sel:indexName:LocalSecondaryIndexInfo' :: LocalSecondaryIndexInfo -> Maybe Text
..} =
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 (NonEmpty KeySchemaElement)
keySchema
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Projection
projection