{-# 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.GlobalSecondaryIndexInfo where
import qualified Amazonka.Core as Core
import Amazonka.DynamoDB.Types.KeySchemaElement
import Amazonka.DynamoDB.Types.Projection
import Amazonka.DynamoDB.Types.ProvisionedThroughput
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data GlobalSecondaryIndexInfo = GlobalSecondaryIndexInfo'
{
GlobalSecondaryIndexInfo -> Maybe ProvisionedThroughput
provisionedThroughput :: Prelude.Maybe ProvisionedThroughput,
GlobalSecondaryIndexInfo -> Maybe (NonEmpty KeySchemaElement)
keySchema :: Prelude.Maybe (Prelude.NonEmpty KeySchemaElement),
GlobalSecondaryIndexInfo -> Maybe Projection
projection :: Prelude.Maybe Projection,
GlobalSecondaryIndexInfo -> Maybe Text
indexName :: Prelude.Maybe Prelude.Text
}
deriving (GlobalSecondaryIndexInfo -> GlobalSecondaryIndexInfo -> Bool
(GlobalSecondaryIndexInfo -> GlobalSecondaryIndexInfo -> Bool)
-> (GlobalSecondaryIndexInfo -> GlobalSecondaryIndexInfo -> Bool)
-> Eq GlobalSecondaryIndexInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GlobalSecondaryIndexInfo -> GlobalSecondaryIndexInfo -> Bool
$c/= :: GlobalSecondaryIndexInfo -> GlobalSecondaryIndexInfo -> Bool
== :: GlobalSecondaryIndexInfo -> GlobalSecondaryIndexInfo -> Bool
$c== :: GlobalSecondaryIndexInfo -> GlobalSecondaryIndexInfo -> Bool
Prelude.Eq, ReadPrec [GlobalSecondaryIndexInfo]
ReadPrec GlobalSecondaryIndexInfo
Int -> ReadS GlobalSecondaryIndexInfo
ReadS [GlobalSecondaryIndexInfo]
(Int -> ReadS GlobalSecondaryIndexInfo)
-> ReadS [GlobalSecondaryIndexInfo]
-> ReadPrec GlobalSecondaryIndexInfo
-> ReadPrec [GlobalSecondaryIndexInfo]
-> Read GlobalSecondaryIndexInfo
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GlobalSecondaryIndexInfo]
$creadListPrec :: ReadPrec [GlobalSecondaryIndexInfo]
readPrec :: ReadPrec GlobalSecondaryIndexInfo
$creadPrec :: ReadPrec GlobalSecondaryIndexInfo
readList :: ReadS [GlobalSecondaryIndexInfo]
$creadList :: ReadS [GlobalSecondaryIndexInfo]
readsPrec :: Int -> ReadS GlobalSecondaryIndexInfo
$creadsPrec :: Int -> ReadS GlobalSecondaryIndexInfo
Prelude.Read, Int -> GlobalSecondaryIndexInfo -> ShowS
[GlobalSecondaryIndexInfo] -> ShowS
GlobalSecondaryIndexInfo -> String
(Int -> GlobalSecondaryIndexInfo -> ShowS)
-> (GlobalSecondaryIndexInfo -> String)
-> ([GlobalSecondaryIndexInfo] -> ShowS)
-> Show GlobalSecondaryIndexInfo
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GlobalSecondaryIndexInfo] -> ShowS
$cshowList :: [GlobalSecondaryIndexInfo] -> ShowS
show :: GlobalSecondaryIndexInfo -> String
$cshow :: GlobalSecondaryIndexInfo -> String
showsPrec :: Int -> GlobalSecondaryIndexInfo -> ShowS
$cshowsPrec :: Int -> GlobalSecondaryIndexInfo -> ShowS
Prelude.Show, (forall x.
GlobalSecondaryIndexInfo -> Rep GlobalSecondaryIndexInfo x)
-> (forall x.
Rep GlobalSecondaryIndexInfo x -> GlobalSecondaryIndexInfo)
-> Generic GlobalSecondaryIndexInfo
forall x.
Rep GlobalSecondaryIndexInfo x -> GlobalSecondaryIndexInfo
forall x.
GlobalSecondaryIndexInfo -> Rep GlobalSecondaryIndexInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GlobalSecondaryIndexInfo x -> GlobalSecondaryIndexInfo
$cfrom :: forall x.
GlobalSecondaryIndexInfo -> Rep GlobalSecondaryIndexInfo x
Prelude.Generic)
newGlobalSecondaryIndexInfo ::
GlobalSecondaryIndexInfo
newGlobalSecondaryIndexInfo :: GlobalSecondaryIndexInfo
newGlobalSecondaryIndexInfo =
GlobalSecondaryIndexInfo' :: Maybe ProvisionedThroughput
-> Maybe (NonEmpty KeySchemaElement)
-> Maybe Projection
-> Maybe Text
-> GlobalSecondaryIndexInfo
GlobalSecondaryIndexInfo'
{ $sel:provisionedThroughput:GlobalSecondaryIndexInfo' :: Maybe ProvisionedThroughput
provisionedThroughput =
Maybe ProvisionedThroughput
forall a. Maybe a
Prelude.Nothing,
$sel:keySchema:GlobalSecondaryIndexInfo' :: Maybe (NonEmpty KeySchemaElement)
keySchema = Maybe (NonEmpty KeySchemaElement)
forall a. Maybe a
Prelude.Nothing,
$sel:projection:GlobalSecondaryIndexInfo' :: Maybe Projection
projection = Maybe Projection
forall a. Maybe a
Prelude.Nothing,
$sel:indexName:GlobalSecondaryIndexInfo' :: Maybe Text
indexName = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
globalSecondaryIndexInfo_provisionedThroughput :: Lens.Lens' GlobalSecondaryIndexInfo (Prelude.Maybe ProvisionedThroughput)
globalSecondaryIndexInfo_provisionedThroughput :: (Maybe ProvisionedThroughput -> f (Maybe ProvisionedThroughput))
-> GlobalSecondaryIndexInfo -> f GlobalSecondaryIndexInfo
globalSecondaryIndexInfo_provisionedThroughput = (GlobalSecondaryIndexInfo -> Maybe ProvisionedThroughput)
-> (GlobalSecondaryIndexInfo
-> Maybe ProvisionedThroughput -> GlobalSecondaryIndexInfo)
-> Lens
GlobalSecondaryIndexInfo
GlobalSecondaryIndexInfo
(Maybe ProvisionedThroughput)
(Maybe ProvisionedThroughput)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GlobalSecondaryIndexInfo' {Maybe ProvisionedThroughput
provisionedThroughput :: Maybe ProvisionedThroughput
$sel:provisionedThroughput:GlobalSecondaryIndexInfo' :: GlobalSecondaryIndexInfo -> Maybe ProvisionedThroughput
provisionedThroughput} -> Maybe ProvisionedThroughput
provisionedThroughput) (\s :: GlobalSecondaryIndexInfo
s@GlobalSecondaryIndexInfo' {} Maybe ProvisionedThroughput
a -> GlobalSecondaryIndexInfo
s {$sel:provisionedThroughput:GlobalSecondaryIndexInfo' :: Maybe ProvisionedThroughput
provisionedThroughput = Maybe ProvisionedThroughput
a} :: GlobalSecondaryIndexInfo)
globalSecondaryIndexInfo_keySchema :: Lens.Lens' GlobalSecondaryIndexInfo (Prelude.Maybe (Prelude.NonEmpty KeySchemaElement))
globalSecondaryIndexInfo_keySchema :: (Maybe (NonEmpty KeySchemaElement)
-> f (Maybe (NonEmpty KeySchemaElement)))
-> GlobalSecondaryIndexInfo -> f GlobalSecondaryIndexInfo
globalSecondaryIndexInfo_keySchema = (GlobalSecondaryIndexInfo -> Maybe (NonEmpty KeySchemaElement))
-> (GlobalSecondaryIndexInfo
-> Maybe (NonEmpty KeySchemaElement) -> GlobalSecondaryIndexInfo)
-> Lens
GlobalSecondaryIndexInfo
GlobalSecondaryIndexInfo
(Maybe (NonEmpty KeySchemaElement))
(Maybe (NonEmpty KeySchemaElement))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GlobalSecondaryIndexInfo' {Maybe (NonEmpty KeySchemaElement)
keySchema :: Maybe (NonEmpty KeySchemaElement)
$sel:keySchema:GlobalSecondaryIndexInfo' :: GlobalSecondaryIndexInfo -> Maybe (NonEmpty KeySchemaElement)
keySchema} -> Maybe (NonEmpty KeySchemaElement)
keySchema) (\s :: GlobalSecondaryIndexInfo
s@GlobalSecondaryIndexInfo' {} Maybe (NonEmpty KeySchemaElement)
a -> GlobalSecondaryIndexInfo
s {$sel:keySchema:GlobalSecondaryIndexInfo' :: Maybe (NonEmpty KeySchemaElement)
keySchema = Maybe (NonEmpty KeySchemaElement)
a} :: GlobalSecondaryIndexInfo) ((Maybe (NonEmpty KeySchemaElement)
-> f (Maybe (NonEmpty KeySchemaElement)))
-> GlobalSecondaryIndexInfo -> f GlobalSecondaryIndexInfo)
-> ((Maybe (NonEmpty KeySchemaElement)
-> f (Maybe (NonEmpty KeySchemaElement)))
-> Maybe (NonEmpty KeySchemaElement)
-> f (Maybe (NonEmpty KeySchemaElement)))
-> (Maybe (NonEmpty KeySchemaElement)
-> f (Maybe (NonEmpty KeySchemaElement)))
-> GlobalSecondaryIndexInfo
-> f GlobalSecondaryIndexInfo
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
globalSecondaryIndexInfo_projection :: Lens.Lens' GlobalSecondaryIndexInfo (Prelude.Maybe Projection)
globalSecondaryIndexInfo_projection :: (Maybe Projection -> f (Maybe Projection))
-> GlobalSecondaryIndexInfo -> f GlobalSecondaryIndexInfo
globalSecondaryIndexInfo_projection = (GlobalSecondaryIndexInfo -> Maybe Projection)
-> (GlobalSecondaryIndexInfo
-> Maybe Projection -> GlobalSecondaryIndexInfo)
-> Lens
GlobalSecondaryIndexInfo
GlobalSecondaryIndexInfo
(Maybe Projection)
(Maybe Projection)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GlobalSecondaryIndexInfo' {Maybe Projection
projection :: Maybe Projection
$sel:projection:GlobalSecondaryIndexInfo' :: GlobalSecondaryIndexInfo -> Maybe Projection
projection} -> Maybe Projection
projection) (\s :: GlobalSecondaryIndexInfo
s@GlobalSecondaryIndexInfo' {} Maybe Projection
a -> GlobalSecondaryIndexInfo
s {$sel:projection:GlobalSecondaryIndexInfo' :: Maybe Projection
projection = Maybe Projection
a} :: GlobalSecondaryIndexInfo)
globalSecondaryIndexInfo_indexName :: Lens.Lens' GlobalSecondaryIndexInfo (Prelude.Maybe Prelude.Text)
globalSecondaryIndexInfo_indexName :: (Maybe Text -> f (Maybe Text))
-> GlobalSecondaryIndexInfo -> f GlobalSecondaryIndexInfo
globalSecondaryIndexInfo_indexName = (GlobalSecondaryIndexInfo -> Maybe Text)
-> (GlobalSecondaryIndexInfo
-> Maybe Text -> GlobalSecondaryIndexInfo)
-> Lens
GlobalSecondaryIndexInfo
GlobalSecondaryIndexInfo
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GlobalSecondaryIndexInfo' {Maybe Text
indexName :: Maybe Text
$sel:indexName:GlobalSecondaryIndexInfo' :: GlobalSecondaryIndexInfo -> Maybe Text
indexName} -> Maybe Text
indexName) (\s :: GlobalSecondaryIndexInfo
s@GlobalSecondaryIndexInfo' {} Maybe Text
a -> GlobalSecondaryIndexInfo
s {$sel:indexName:GlobalSecondaryIndexInfo' :: Maybe Text
indexName = Maybe Text
a} :: GlobalSecondaryIndexInfo)
instance Core.FromJSON GlobalSecondaryIndexInfo where
parseJSON :: Value -> Parser GlobalSecondaryIndexInfo
parseJSON =
String
-> (Object -> Parser GlobalSecondaryIndexInfo)
-> Value
-> Parser GlobalSecondaryIndexInfo
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"GlobalSecondaryIndexInfo"
( \Object
x ->
Maybe ProvisionedThroughput
-> Maybe (NonEmpty KeySchemaElement)
-> Maybe Projection
-> Maybe Text
-> GlobalSecondaryIndexInfo
GlobalSecondaryIndexInfo'
(Maybe ProvisionedThroughput
-> Maybe (NonEmpty KeySchemaElement)
-> Maybe Projection
-> Maybe Text
-> GlobalSecondaryIndexInfo)
-> Parser (Maybe ProvisionedThroughput)
-> Parser
(Maybe (NonEmpty KeySchemaElement)
-> Maybe Projection -> Maybe Text -> GlobalSecondaryIndexInfo)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe ProvisionedThroughput)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ProvisionedThroughput")
Parser
(Maybe (NonEmpty KeySchemaElement)
-> Maybe Projection -> Maybe Text -> GlobalSecondaryIndexInfo)
-> Parser (Maybe (NonEmpty KeySchemaElement))
-> Parser
(Maybe Projection -> Maybe Text -> GlobalSecondaryIndexInfo)
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 Text -> GlobalSecondaryIndexInfo)
-> Parser (Maybe Projection)
-> Parser (Maybe Text -> GlobalSecondaryIndexInfo)
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 -> GlobalSecondaryIndexInfo)
-> Parser (Maybe Text) -> Parser GlobalSecondaryIndexInfo
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 GlobalSecondaryIndexInfo
instance Prelude.NFData GlobalSecondaryIndexInfo