{-# 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 Amazonka.DynamoDB.Types.KeySchemaElement
import Amazonka.DynamoDB.Types.Projection
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data LocalSecondaryIndexInfo = LocalSecondaryIndexInfo'
{
LocalSecondaryIndexInfo -> Maybe (NonEmpty KeySchemaElement)
keySchema :: Prelude.Maybe (Prelude.NonEmpty KeySchemaElement),
LocalSecondaryIndexInfo -> Maybe Projection
projection :: Prelude.Maybe Projection,
LocalSecondaryIndexInfo -> Maybe Text
indexName :: Prelude.Maybe Prelude.Text
}
deriving (LocalSecondaryIndexInfo -> LocalSecondaryIndexInfo -> Bool
(LocalSecondaryIndexInfo -> LocalSecondaryIndexInfo -> Bool)
-> (LocalSecondaryIndexInfo -> LocalSecondaryIndexInfo -> Bool)
-> Eq LocalSecondaryIndexInfo
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]
(Int -> ReadS LocalSecondaryIndexInfo)
-> ReadS [LocalSecondaryIndexInfo]
-> ReadPrec LocalSecondaryIndexInfo
-> ReadPrec [LocalSecondaryIndexInfo]
-> Read 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
(Int -> LocalSecondaryIndexInfo -> ShowS)
-> (LocalSecondaryIndexInfo -> String)
-> ([LocalSecondaryIndexInfo] -> ShowS)
-> Show LocalSecondaryIndexInfo
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.
LocalSecondaryIndexInfo -> Rep LocalSecondaryIndexInfo x)
-> (forall x.
Rep LocalSecondaryIndexInfo x -> LocalSecondaryIndexInfo)
-> Generic LocalSecondaryIndexInfo
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' :: Maybe (NonEmpty KeySchemaElement)
-> Maybe Projection -> Maybe Text -> LocalSecondaryIndexInfo
LocalSecondaryIndexInfo'
{ $sel:keySchema:LocalSecondaryIndexInfo' :: Maybe (NonEmpty KeySchemaElement)
keySchema =
Maybe (NonEmpty KeySchemaElement)
forall a. Maybe a
Prelude.Nothing,
$sel:projection:LocalSecondaryIndexInfo' :: Maybe Projection
projection = Maybe Projection
forall a. Maybe a
Prelude.Nothing,
$sel:indexName:LocalSecondaryIndexInfo' :: Maybe Text
indexName = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
localSecondaryIndexInfo_keySchema :: Lens.Lens' LocalSecondaryIndexInfo (Prelude.Maybe (Prelude.NonEmpty KeySchemaElement))
localSecondaryIndexInfo_keySchema :: (Maybe (NonEmpty KeySchemaElement)
-> f (Maybe (NonEmpty KeySchemaElement)))
-> LocalSecondaryIndexInfo -> f LocalSecondaryIndexInfo
localSecondaryIndexInfo_keySchema = (LocalSecondaryIndexInfo -> Maybe (NonEmpty KeySchemaElement))
-> (LocalSecondaryIndexInfo
-> Maybe (NonEmpty KeySchemaElement) -> LocalSecondaryIndexInfo)
-> Lens
LocalSecondaryIndexInfo
LocalSecondaryIndexInfo
(Maybe (NonEmpty KeySchemaElement))
(Maybe (NonEmpty KeySchemaElement))
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) ((Maybe (NonEmpty KeySchemaElement)
-> f (Maybe (NonEmpty KeySchemaElement)))
-> LocalSecondaryIndexInfo -> f LocalSecondaryIndexInfo)
-> ((Maybe (NonEmpty KeySchemaElement)
-> f (Maybe (NonEmpty KeySchemaElement)))
-> Maybe (NonEmpty KeySchemaElement)
-> f (Maybe (NonEmpty KeySchemaElement)))
-> (Maybe (NonEmpty KeySchemaElement)
-> f (Maybe (NonEmpty KeySchemaElement)))
-> LocalSecondaryIndexInfo
-> f LocalSecondaryIndexInfo
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
localSecondaryIndexInfo_projection :: Lens.Lens' LocalSecondaryIndexInfo (Prelude.Maybe Projection)
localSecondaryIndexInfo_projection :: (Maybe Projection -> f (Maybe Projection))
-> LocalSecondaryIndexInfo -> f LocalSecondaryIndexInfo
localSecondaryIndexInfo_projection = (LocalSecondaryIndexInfo -> Maybe Projection)
-> (LocalSecondaryIndexInfo
-> Maybe Projection -> LocalSecondaryIndexInfo)
-> Lens
LocalSecondaryIndexInfo
LocalSecondaryIndexInfo
(Maybe Projection)
(Maybe 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)
localSecondaryIndexInfo_indexName :: Lens.Lens' LocalSecondaryIndexInfo (Prelude.Maybe Prelude.Text)
localSecondaryIndexInfo_indexName :: (Maybe Text -> f (Maybe Text))
-> LocalSecondaryIndexInfo -> f LocalSecondaryIndexInfo
localSecondaryIndexInfo_indexName = (LocalSecondaryIndexInfo -> Maybe Text)
-> (LocalSecondaryIndexInfo
-> Maybe Text -> LocalSecondaryIndexInfo)
-> Lens
LocalSecondaryIndexInfo
LocalSecondaryIndexInfo
(Maybe Text)
(Maybe Text)
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)
instance Core.FromJSON LocalSecondaryIndexInfo where
parseJSON :: Value -> Parser LocalSecondaryIndexInfo
parseJSON =
String
-> (Object -> Parser LocalSecondaryIndexInfo)
-> Value
-> Parser LocalSecondaryIndexInfo
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"LocalSecondaryIndexInfo"
( \Object
x ->
Maybe (NonEmpty KeySchemaElement)
-> Maybe Projection -> Maybe Text -> LocalSecondaryIndexInfo
LocalSecondaryIndexInfo'
(Maybe (NonEmpty KeySchemaElement)
-> Maybe Projection -> Maybe Text -> LocalSecondaryIndexInfo)
-> Parser (Maybe (NonEmpty KeySchemaElement))
-> Parser
(Maybe Projection -> Maybe Text -> LocalSecondaryIndexInfo)
forall (f :: * -> *) a b. Functor 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 Text -> LocalSecondaryIndexInfo)
-> Parser (Maybe Projection)
-> Parser (Maybe Text -> LocalSecondaryIndexInfo)
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 Text -> LocalSecondaryIndexInfo)
-> Parser (Maybe Text) -> Parser LocalSecondaryIndexInfo
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 LocalSecondaryIndexInfo
instance Prelude.NFData LocalSecondaryIndexInfo