{-# 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 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.ProvisionedThroughput
import Amazonka.DynamoDB.Types.WriteRequest
import qualified Amazonka.Prelude as Prelude
data GlobalSecondaryIndexInfo = GlobalSecondaryIndexInfo'
{
GlobalSecondaryIndexInfo -> Maybe Text
indexName :: Prelude.Maybe Prelude.Text,
GlobalSecondaryIndexInfo -> Maybe (NonEmpty KeySchemaElement)
keySchema :: Prelude.Maybe (Prelude.NonEmpty KeySchemaElement),
GlobalSecondaryIndexInfo -> Maybe Projection
projection :: Prelude.Maybe Projection,
GlobalSecondaryIndexInfo -> Maybe ProvisionedThroughput
provisionedThroughput :: Prelude.Maybe ProvisionedThroughput
}
deriving (GlobalSecondaryIndexInfo -> GlobalSecondaryIndexInfo -> Bool
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]
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
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.
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'
{ $sel:indexName:GlobalSecondaryIndexInfo' :: Maybe Text
indexName =
forall a. Maybe a
Prelude.Nothing,
$sel:keySchema:GlobalSecondaryIndexInfo' :: Maybe (NonEmpty KeySchemaElement)
keySchema = forall a. Maybe a
Prelude.Nothing,
$sel:projection:GlobalSecondaryIndexInfo' :: Maybe Projection
projection = forall a. Maybe a
Prelude.Nothing,
$sel:provisionedThroughput:GlobalSecondaryIndexInfo' :: Maybe ProvisionedThroughput
provisionedThroughput = forall a. Maybe a
Prelude.Nothing
}
globalSecondaryIndexInfo_indexName :: Lens.Lens' GlobalSecondaryIndexInfo (Prelude.Maybe Prelude.Text)
globalSecondaryIndexInfo_indexName :: Lens' GlobalSecondaryIndexInfo (Maybe Text)
globalSecondaryIndexInfo_indexName = 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)
globalSecondaryIndexInfo_keySchema :: Lens.Lens' GlobalSecondaryIndexInfo (Prelude.Maybe (Prelude.NonEmpty KeySchemaElement))
globalSecondaryIndexInfo_keySchema :: Lens' GlobalSecondaryIndexInfo (Maybe (NonEmpty KeySchemaElement))
globalSecondaryIndexInfo_keySchema = 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) 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
globalSecondaryIndexInfo_projection :: Lens.Lens' GlobalSecondaryIndexInfo (Prelude.Maybe Projection)
globalSecondaryIndexInfo_projection :: Lens' GlobalSecondaryIndexInfo (Maybe Projection)
globalSecondaryIndexInfo_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_provisionedThroughput :: Lens.Lens' GlobalSecondaryIndexInfo (Prelude.Maybe ProvisionedThroughput)
globalSecondaryIndexInfo_provisionedThroughput :: Lens' GlobalSecondaryIndexInfo (Maybe ProvisionedThroughput)
globalSecondaryIndexInfo_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)
instance Data.FromJSON GlobalSecondaryIndexInfo where
parseJSON :: Value -> Parser GlobalSecondaryIndexInfo
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"GlobalSecondaryIndexInfo"
( \Object
x ->
Maybe Text
-> Maybe (NonEmpty KeySchemaElement)
-> Maybe Projection
-> Maybe ProvisionedThroughput
-> GlobalSecondaryIndexInfo
GlobalSecondaryIndexInfo'
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")
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
"ProvisionedThroughput")
)
instance Prelude.Hashable GlobalSecondaryIndexInfo where
hashWithSalt :: Int -> GlobalSecondaryIndexInfo -> Int
hashWithSalt Int
_salt GlobalSecondaryIndexInfo' {Maybe (NonEmpty KeySchemaElement)
Maybe Text
Maybe ProvisionedThroughput
Maybe Projection
provisionedThroughput :: Maybe ProvisionedThroughput
projection :: Maybe Projection
keySchema :: Maybe (NonEmpty KeySchemaElement)
indexName :: Maybe Text
$sel:provisionedThroughput:GlobalSecondaryIndexInfo' :: GlobalSecondaryIndexInfo -> Maybe ProvisionedThroughput
$sel:projection:GlobalSecondaryIndexInfo' :: GlobalSecondaryIndexInfo -> Maybe Projection
$sel:keySchema:GlobalSecondaryIndexInfo' :: GlobalSecondaryIndexInfo -> Maybe (NonEmpty KeySchemaElement)
$sel:indexName:GlobalSecondaryIndexInfo' :: GlobalSecondaryIndexInfo -> 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
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ProvisionedThroughput
provisionedThroughput
instance Prelude.NFData GlobalSecondaryIndexInfo where
rnf :: GlobalSecondaryIndexInfo -> ()
rnf GlobalSecondaryIndexInfo' {Maybe (NonEmpty KeySchemaElement)
Maybe Text
Maybe ProvisionedThroughput
Maybe Projection
provisionedThroughput :: Maybe ProvisionedThroughput
projection :: Maybe Projection
keySchema :: Maybe (NonEmpty KeySchemaElement)
indexName :: Maybe Text
$sel:provisionedThroughput:GlobalSecondaryIndexInfo' :: GlobalSecondaryIndexInfo -> Maybe ProvisionedThroughput
$sel:projection:GlobalSecondaryIndexInfo' :: GlobalSecondaryIndexInfo -> Maybe Projection
$sel:keySchema:GlobalSecondaryIndexInfo' :: GlobalSecondaryIndexInfo -> Maybe (NonEmpty KeySchemaElement)
$sel:indexName:GlobalSecondaryIndexInfo' :: GlobalSecondaryIndexInfo -> 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
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ProvisionedThroughput
provisionedThroughput