{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.DynamoDB.Types.GlobalSecondaryIndexDescription
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.DynamoDB.Types.GlobalSecondaryIndexDescription 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.IndexStatus
import Amazonka.DynamoDB.Types.KeySchemaElement
import Amazonka.DynamoDB.Types.Projection
import Amazonka.DynamoDB.Types.ProvisionedThroughputDescription
import Amazonka.DynamoDB.Types.WriteRequest
import qualified Amazonka.Prelude as Prelude

-- | Represents the properties of a global secondary index.
--
-- /See:/ 'newGlobalSecondaryIndexDescription' smart constructor.
data GlobalSecondaryIndexDescription = GlobalSecondaryIndexDescription'
  { -- | Indicates whether the index is currently backfilling. /Backfilling/ is
    -- the process of reading items from the table and determining whether they
    -- can be added to the index. (Not all items will qualify: For example, a
    -- partition key cannot have any duplicate values.) If an item can be added
    -- to the index, DynamoDB will do so. After all items have been processed,
    -- the backfilling operation is complete and @Backfilling@ is false.
    --
    -- You can delete an index that is being created during the @Backfilling@
    -- phase when @IndexStatus@ is set to CREATING and @Backfilling@ is true.
    -- You can\'t delete the index that is being created when @IndexStatus@ is
    -- set to CREATING and @Backfilling@ is false.
    --
    -- For indexes that were created during a @CreateTable@ operation, the
    -- @Backfilling@ attribute does not appear in the @DescribeTable@ output.
    GlobalSecondaryIndexDescription -> Maybe Bool
backfilling :: Prelude.Maybe Prelude.Bool,
    -- | The Amazon Resource Name (ARN) that uniquely identifies the index.
    GlobalSecondaryIndexDescription -> Maybe Text
indexArn :: Prelude.Maybe Prelude.Text,
    -- | The name of the global secondary index.
    GlobalSecondaryIndexDescription -> Maybe Text
indexName :: Prelude.Maybe Prelude.Text,
    -- | The total size of the specified index, in bytes. DynamoDB updates this
    -- value approximately every six hours. Recent changes might not be
    -- reflected in this value.
    GlobalSecondaryIndexDescription -> Maybe Integer
indexSizeBytes :: Prelude.Maybe Prelude.Integer,
    -- | The current state of the global secondary index:
    --
    -- -   @CREATING@ - The index is being created.
    --
    -- -   @UPDATING@ - The index is being updated.
    --
    -- -   @DELETING@ - The index is being deleted.
    --
    -- -   @ACTIVE@ - The index is ready for use.
    GlobalSecondaryIndexDescription -> Maybe IndexStatus
indexStatus :: Prelude.Maybe IndexStatus,
    -- | The number of items in the specified index. DynamoDB updates this value
    -- approximately every six hours. Recent changes might not be reflected in
    -- this value.
    GlobalSecondaryIndexDescription -> Maybe Integer
itemCount :: Prelude.Maybe Prelude.Integer,
    -- | The complete key schema for a global secondary index, which consists of
    -- one or more pairs of attribute names and key types:
    --
    -- -   @HASH@ - partition key
    --
    -- -   @RANGE@ - sort key
    --
    -- The partition key of an item is also known as its /hash attribute/. The
    -- term \"hash attribute\" derives from DynamoDB\'s usage of an internal
    -- hash function to evenly distribute data items across partitions, based
    -- on their partition key values.
    --
    -- The sort key of an item is also known as its /range attribute/. The term
    -- \"range attribute\" derives from the way DynamoDB stores items with the
    -- same partition key physically close together, in sorted order by the
    -- sort key value.
    GlobalSecondaryIndexDescription
-> Maybe (NonEmpty KeySchemaElement)
keySchema :: Prelude.Maybe (Prelude.NonEmpty KeySchemaElement),
    -- | Represents attributes that are copied (projected) from the table into
    -- the global secondary index. These are in addition to the primary key
    -- attributes and index key attributes, which are automatically projected.
    GlobalSecondaryIndexDescription -> Maybe Projection
projection :: Prelude.Maybe Projection,
    -- | Represents the provisioned throughput settings for the specified global
    -- secondary index.
    --
    -- For current minimum and maximum provisioned throughput values, see
    -- <https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html Service, Account, and Table Quotas>
    -- in the /Amazon DynamoDB Developer Guide/.
    GlobalSecondaryIndexDescription
-> Maybe ProvisionedThroughputDescription
provisionedThroughput :: Prelude.Maybe ProvisionedThroughputDescription
  }
  deriving (GlobalSecondaryIndexDescription
-> GlobalSecondaryIndexDescription -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GlobalSecondaryIndexDescription
-> GlobalSecondaryIndexDescription -> Bool
$c/= :: GlobalSecondaryIndexDescription
-> GlobalSecondaryIndexDescription -> Bool
== :: GlobalSecondaryIndexDescription
-> GlobalSecondaryIndexDescription -> Bool
$c== :: GlobalSecondaryIndexDescription
-> GlobalSecondaryIndexDescription -> Bool
Prelude.Eq, ReadPrec [GlobalSecondaryIndexDescription]
ReadPrec GlobalSecondaryIndexDescription
Int -> ReadS GlobalSecondaryIndexDescription
ReadS [GlobalSecondaryIndexDescription]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GlobalSecondaryIndexDescription]
$creadListPrec :: ReadPrec [GlobalSecondaryIndexDescription]
readPrec :: ReadPrec GlobalSecondaryIndexDescription
$creadPrec :: ReadPrec GlobalSecondaryIndexDescription
readList :: ReadS [GlobalSecondaryIndexDescription]
$creadList :: ReadS [GlobalSecondaryIndexDescription]
readsPrec :: Int -> ReadS GlobalSecondaryIndexDescription
$creadsPrec :: Int -> ReadS GlobalSecondaryIndexDescription
Prelude.Read, Int -> GlobalSecondaryIndexDescription -> ShowS
[GlobalSecondaryIndexDescription] -> ShowS
GlobalSecondaryIndexDescription -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GlobalSecondaryIndexDescription] -> ShowS
$cshowList :: [GlobalSecondaryIndexDescription] -> ShowS
show :: GlobalSecondaryIndexDescription -> String
$cshow :: GlobalSecondaryIndexDescription -> String
showsPrec :: Int -> GlobalSecondaryIndexDescription -> ShowS
$cshowsPrec :: Int -> GlobalSecondaryIndexDescription -> ShowS
Prelude.Show, forall x.
Rep GlobalSecondaryIndexDescription x
-> GlobalSecondaryIndexDescription
forall x.
GlobalSecondaryIndexDescription
-> Rep GlobalSecondaryIndexDescription x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GlobalSecondaryIndexDescription x
-> GlobalSecondaryIndexDescription
$cfrom :: forall x.
GlobalSecondaryIndexDescription
-> Rep GlobalSecondaryIndexDescription x
Prelude.Generic)

-- |
-- Create a value of 'GlobalSecondaryIndexDescription' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'backfilling', 'globalSecondaryIndexDescription_backfilling' - Indicates whether the index is currently backfilling. /Backfilling/ is
-- the process of reading items from the table and determining whether they
-- can be added to the index. (Not all items will qualify: For example, a
-- partition key cannot have any duplicate values.) If an item can be added
-- to the index, DynamoDB will do so. After all items have been processed,
-- the backfilling operation is complete and @Backfilling@ is false.
--
-- You can delete an index that is being created during the @Backfilling@
-- phase when @IndexStatus@ is set to CREATING and @Backfilling@ is true.
-- You can\'t delete the index that is being created when @IndexStatus@ is
-- set to CREATING and @Backfilling@ is false.
--
-- For indexes that were created during a @CreateTable@ operation, the
-- @Backfilling@ attribute does not appear in the @DescribeTable@ output.
--
-- 'indexArn', 'globalSecondaryIndexDescription_indexArn' - The Amazon Resource Name (ARN) that uniquely identifies the index.
--
-- 'indexName', 'globalSecondaryIndexDescription_indexName' - The name of the global secondary index.
--
-- 'indexSizeBytes', 'globalSecondaryIndexDescription_indexSizeBytes' - The total size of the specified index, in bytes. DynamoDB updates this
-- value approximately every six hours. Recent changes might not be
-- reflected in this value.
--
-- 'indexStatus', 'globalSecondaryIndexDescription_indexStatus' - The current state of the global secondary index:
--
-- -   @CREATING@ - The index is being created.
--
-- -   @UPDATING@ - The index is being updated.
--
-- -   @DELETING@ - The index is being deleted.
--
-- -   @ACTIVE@ - The index is ready for use.
--
-- 'itemCount', 'globalSecondaryIndexDescription_itemCount' - The number of items in the specified index. DynamoDB updates this value
-- approximately every six hours. Recent changes might not be reflected in
-- this value.
--
-- 'keySchema', 'globalSecondaryIndexDescription_keySchema' - The complete key schema for a global secondary index, which consists of
-- one or more pairs of attribute names and key types:
--
-- -   @HASH@ - partition key
--
-- -   @RANGE@ - sort key
--
-- The partition key of an item is also known as its /hash attribute/. The
-- term \"hash attribute\" derives from DynamoDB\'s usage of an internal
-- hash function to evenly distribute data items across partitions, based
-- on their partition key values.
--
-- The sort key of an item is also known as its /range attribute/. The term
-- \"range attribute\" derives from the way DynamoDB stores items with the
-- same partition key physically close together, in sorted order by the
-- sort key value.
--
-- 'projection', 'globalSecondaryIndexDescription_projection' - Represents attributes that are copied (projected) from the table into
-- the global secondary index. These are in addition to the primary key
-- attributes and index key attributes, which are automatically projected.
--
-- 'provisionedThroughput', 'globalSecondaryIndexDescription_provisionedThroughput' - Represents the provisioned throughput settings for the specified global
-- secondary index.
--
-- For current minimum and maximum provisioned throughput values, see
-- <https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html Service, Account, and Table Quotas>
-- in the /Amazon DynamoDB Developer Guide/.
newGlobalSecondaryIndexDescription ::
  GlobalSecondaryIndexDescription
newGlobalSecondaryIndexDescription :: GlobalSecondaryIndexDescription
newGlobalSecondaryIndexDescription =
  GlobalSecondaryIndexDescription'
    { $sel:backfilling:GlobalSecondaryIndexDescription' :: Maybe Bool
backfilling =
        forall a. Maybe a
Prelude.Nothing,
      $sel:indexArn:GlobalSecondaryIndexDescription' :: Maybe Text
indexArn = forall a. Maybe a
Prelude.Nothing,
      $sel:indexName:GlobalSecondaryIndexDescription' :: Maybe Text
indexName = forall a. Maybe a
Prelude.Nothing,
      $sel:indexSizeBytes:GlobalSecondaryIndexDescription' :: Maybe Integer
indexSizeBytes = forall a. Maybe a
Prelude.Nothing,
      $sel:indexStatus:GlobalSecondaryIndexDescription' :: Maybe IndexStatus
indexStatus = forall a. Maybe a
Prelude.Nothing,
      $sel:itemCount:GlobalSecondaryIndexDescription' :: Maybe Integer
itemCount = forall a. Maybe a
Prelude.Nothing,
      $sel:keySchema:GlobalSecondaryIndexDescription' :: Maybe (NonEmpty KeySchemaElement)
keySchema = forall a. Maybe a
Prelude.Nothing,
      $sel:projection:GlobalSecondaryIndexDescription' :: Maybe Projection
projection = forall a. Maybe a
Prelude.Nothing,
      $sel:provisionedThroughput:GlobalSecondaryIndexDescription' :: Maybe ProvisionedThroughputDescription
provisionedThroughput = forall a. Maybe a
Prelude.Nothing
    }

-- | Indicates whether the index is currently backfilling. /Backfilling/ is
-- the process of reading items from the table and determining whether they
-- can be added to the index. (Not all items will qualify: For example, a
-- partition key cannot have any duplicate values.) If an item can be added
-- to the index, DynamoDB will do so. After all items have been processed,
-- the backfilling operation is complete and @Backfilling@ is false.
--
-- You can delete an index that is being created during the @Backfilling@
-- phase when @IndexStatus@ is set to CREATING and @Backfilling@ is true.
-- You can\'t delete the index that is being created when @IndexStatus@ is
-- set to CREATING and @Backfilling@ is false.
--
-- For indexes that were created during a @CreateTable@ operation, the
-- @Backfilling@ attribute does not appear in the @DescribeTable@ output.
globalSecondaryIndexDescription_backfilling :: Lens.Lens' GlobalSecondaryIndexDescription (Prelude.Maybe Prelude.Bool)
globalSecondaryIndexDescription_backfilling :: Lens' GlobalSecondaryIndexDescription (Maybe Bool)
globalSecondaryIndexDescription_backfilling = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GlobalSecondaryIndexDescription' {Maybe Bool
backfilling :: Maybe Bool
$sel:backfilling:GlobalSecondaryIndexDescription' :: GlobalSecondaryIndexDescription -> Maybe Bool
backfilling} -> Maybe Bool
backfilling) (\s :: GlobalSecondaryIndexDescription
s@GlobalSecondaryIndexDescription' {} Maybe Bool
a -> GlobalSecondaryIndexDescription
s {$sel:backfilling:GlobalSecondaryIndexDescription' :: Maybe Bool
backfilling = Maybe Bool
a} :: GlobalSecondaryIndexDescription)

-- | The Amazon Resource Name (ARN) that uniquely identifies the index.
globalSecondaryIndexDescription_indexArn :: Lens.Lens' GlobalSecondaryIndexDescription (Prelude.Maybe Prelude.Text)
globalSecondaryIndexDescription_indexArn :: Lens' GlobalSecondaryIndexDescription (Maybe Text)
globalSecondaryIndexDescription_indexArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GlobalSecondaryIndexDescription' {Maybe Text
indexArn :: Maybe Text
$sel:indexArn:GlobalSecondaryIndexDescription' :: GlobalSecondaryIndexDescription -> Maybe Text
indexArn} -> Maybe Text
indexArn) (\s :: GlobalSecondaryIndexDescription
s@GlobalSecondaryIndexDescription' {} Maybe Text
a -> GlobalSecondaryIndexDescription
s {$sel:indexArn:GlobalSecondaryIndexDescription' :: Maybe Text
indexArn = Maybe Text
a} :: GlobalSecondaryIndexDescription)

-- | The name of the global secondary index.
globalSecondaryIndexDescription_indexName :: Lens.Lens' GlobalSecondaryIndexDescription (Prelude.Maybe Prelude.Text)
globalSecondaryIndexDescription_indexName :: Lens' GlobalSecondaryIndexDescription (Maybe Text)
globalSecondaryIndexDescription_indexName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GlobalSecondaryIndexDescription' {Maybe Text
indexName :: Maybe Text
$sel:indexName:GlobalSecondaryIndexDescription' :: GlobalSecondaryIndexDescription -> Maybe Text
indexName} -> Maybe Text
indexName) (\s :: GlobalSecondaryIndexDescription
s@GlobalSecondaryIndexDescription' {} Maybe Text
a -> GlobalSecondaryIndexDescription
s {$sel:indexName:GlobalSecondaryIndexDescription' :: Maybe Text
indexName = Maybe Text
a} :: GlobalSecondaryIndexDescription)

-- | The total size of the specified index, in bytes. DynamoDB updates this
-- value approximately every six hours. Recent changes might not be
-- reflected in this value.
globalSecondaryIndexDescription_indexSizeBytes :: Lens.Lens' GlobalSecondaryIndexDescription (Prelude.Maybe Prelude.Integer)
globalSecondaryIndexDescription_indexSizeBytes :: Lens' GlobalSecondaryIndexDescription (Maybe Integer)
globalSecondaryIndexDescription_indexSizeBytes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GlobalSecondaryIndexDescription' {Maybe Integer
indexSizeBytes :: Maybe Integer
$sel:indexSizeBytes:GlobalSecondaryIndexDescription' :: GlobalSecondaryIndexDescription -> Maybe Integer
indexSizeBytes} -> Maybe Integer
indexSizeBytes) (\s :: GlobalSecondaryIndexDescription
s@GlobalSecondaryIndexDescription' {} Maybe Integer
a -> GlobalSecondaryIndexDescription
s {$sel:indexSizeBytes:GlobalSecondaryIndexDescription' :: Maybe Integer
indexSizeBytes = Maybe Integer
a} :: GlobalSecondaryIndexDescription)

-- | The current state of the global secondary index:
--
-- -   @CREATING@ - The index is being created.
--
-- -   @UPDATING@ - The index is being updated.
--
-- -   @DELETING@ - The index is being deleted.
--
-- -   @ACTIVE@ - The index is ready for use.
globalSecondaryIndexDescription_indexStatus :: Lens.Lens' GlobalSecondaryIndexDescription (Prelude.Maybe IndexStatus)
globalSecondaryIndexDescription_indexStatus :: Lens' GlobalSecondaryIndexDescription (Maybe IndexStatus)
globalSecondaryIndexDescription_indexStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GlobalSecondaryIndexDescription' {Maybe IndexStatus
indexStatus :: Maybe IndexStatus
$sel:indexStatus:GlobalSecondaryIndexDescription' :: GlobalSecondaryIndexDescription -> Maybe IndexStatus
indexStatus} -> Maybe IndexStatus
indexStatus) (\s :: GlobalSecondaryIndexDescription
s@GlobalSecondaryIndexDescription' {} Maybe IndexStatus
a -> GlobalSecondaryIndexDescription
s {$sel:indexStatus:GlobalSecondaryIndexDescription' :: Maybe IndexStatus
indexStatus = Maybe IndexStatus
a} :: GlobalSecondaryIndexDescription)

-- | The number of items in the specified index. DynamoDB updates this value
-- approximately every six hours. Recent changes might not be reflected in
-- this value.
globalSecondaryIndexDescription_itemCount :: Lens.Lens' GlobalSecondaryIndexDescription (Prelude.Maybe Prelude.Integer)
globalSecondaryIndexDescription_itemCount :: Lens' GlobalSecondaryIndexDescription (Maybe Integer)
globalSecondaryIndexDescription_itemCount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GlobalSecondaryIndexDescription' {Maybe Integer
itemCount :: Maybe Integer
$sel:itemCount:GlobalSecondaryIndexDescription' :: GlobalSecondaryIndexDescription -> Maybe Integer
itemCount} -> Maybe Integer
itemCount) (\s :: GlobalSecondaryIndexDescription
s@GlobalSecondaryIndexDescription' {} Maybe Integer
a -> GlobalSecondaryIndexDescription
s {$sel:itemCount:GlobalSecondaryIndexDescription' :: Maybe Integer
itemCount = Maybe Integer
a} :: GlobalSecondaryIndexDescription)

-- | The complete key schema for a global secondary index, which consists of
-- one or more pairs of attribute names and key types:
--
-- -   @HASH@ - partition key
--
-- -   @RANGE@ - sort key
--
-- The partition key of an item is also known as its /hash attribute/. The
-- term \"hash attribute\" derives from DynamoDB\'s usage of an internal
-- hash function to evenly distribute data items across partitions, based
-- on their partition key values.
--
-- The sort key of an item is also known as its /range attribute/. The term
-- \"range attribute\" derives from the way DynamoDB stores items with the
-- same partition key physically close together, in sorted order by the
-- sort key value.
globalSecondaryIndexDescription_keySchema :: Lens.Lens' GlobalSecondaryIndexDescription (Prelude.Maybe (Prelude.NonEmpty KeySchemaElement))
globalSecondaryIndexDescription_keySchema :: Lens'
  GlobalSecondaryIndexDescription (Maybe (NonEmpty KeySchemaElement))
globalSecondaryIndexDescription_keySchema = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GlobalSecondaryIndexDescription' {Maybe (NonEmpty KeySchemaElement)
keySchema :: Maybe (NonEmpty KeySchemaElement)
$sel:keySchema:GlobalSecondaryIndexDescription' :: GlobalSecondaryIndexDescription
-> Maybe (NonEmpty KeySchemaElement)
keySchema} -> Maybe (NonEmpty KeySchemaElement)
keySchema) (\s :: GlobalSecondaryIndexDescription
s@GlobalSecondaryIndexDescription' {} Maybe (NonEmpty KeySchemaElement)
a -> GlobalSecondaryIndexDescription
s {$sel:keySchema:GlobalSecondaryIndexDescription' :: Maybe (NonEmpty KeySchemaElement)
keySchema = Maybe (NonEmpty KeySchemaElement)
a} :: GlobalSecondaryIndexDescription) 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

-- | Represents attributes that are copied (projected) from the table into
-- the global secondary index. These are in addition to the primary key
-- attributes and index key attributes, which are automatically projected.
globalSecondaryIndexDescription_projection :: Lens.Lens' GlobalSecondaryIndexDescription (Prelude.Maybe Projection)
globalSecondaryIndexDescription_projection :: Lens' GlobalSecondaryIndexDescription (Maybe Projection)
globalSecondaryIndexDescription_projection = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GlobalSecondaryIndexDescription' {Maybe Projection
projection :: Maybe Projection
$sel:projection:GlobalSecondaryIndexDescription' :: GlobalSecondaryIndexDescription -> Maybe Projection
projection} -> Maybe Projection
projection) (\s :: GlobalSecondaryIndexDescription
s@GlobalSecondaryIndexDescription' {} Maybe Projection
a -> GlobalSecondaryIndexDescription
s {$sel:projection:GlobalSecondaryIndexDescription' :: Maybe Projection
projection = Maybe Projection
a} :: GlobalSecondaryIndexDescription)

-- | Represents the provisioned throughput settings for the specified global
-- secondary index.
--
-- For current minimum and maximum provisioned throughput values, see
-- <https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html Service, Account, and Table Quotas>
-- in the /Amazon DynamoDB Developer Guide/.
globalSecondaryIndexDescription_provisionedThroughput :: Lens.Lens' GlobalSecondaryIndexDescription (Prelude.Maybe ProvisionedThroughputDescription)
globalSecondaryIndexDescription_provisionedThroughput :: Lens'
  GlobalSecondaryIndexDescription
  (Maybe ProvisionedThroughputDescription)
globalSecondaryIndexDescription_provisionedThroughput = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GlobalSecondaryIndexDescription' {Maybe ProvisionedThroughputDescription
provisionedThroughput :: Maybe ProvisionedThroughputDescription
$sel:provisionedThroughput:GlobalSecondaryIndexDescription' :: GlobalSecondaryIndexDescription
-> Maybe ProvisionedThroughputDescription
provisionedThroughput} -> Maybe ProvisionedThroughputDescription
provisionedThroughput) (\s :: GlobalSecondaryIndexDescription
s@GlobalSecondaryIndexDescription' {} Maybe ProvisionedThroughputDescription
a -> GlobalSecondaryIndexDescription
s {$sel:provisionedThroughput:GlobalSecondaryIndexDescription' :: Maybe ProvisionedThroughputDescription
provisionedThroughput = Maybe ProvisionedThroughputDescription
a} :: GlobalSecondaryIndexDescription)

instance
  Data.FromJSON
    GlobalSecondaryIndexDescription
  where
  parseJSON :: Value -> Parser GlobalSecondaryIndexDescription
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"GlobalSecondaryIndexDescription"
      ( \Object
x ->
          Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Integer
-> Maybe IndexStatus
-> Maybe Integer
-> Maybe (NonEmpty KeySchemaElement)
-> Maybe Projection
-> Maybe ProvisionedThroughputDescription
-> GlobalSecondaryIndexDescription
GlobalSecondaryIndexDescription'
            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
"Backfilling")
            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
"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
"IndexStatus")
            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")
            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
    GlobalSecondaryIndexDescription
  where
  hashWithSalt :: Int -> GlobalSecondaryIndexDescription -> Int
hashWithSalt
    Int
_salt
    GlobalSecondaryIndexDescription' {Maybe Bool
Maybe Integer
Maybe (NonEmpty KeySchemaElement)
Maybe Text
Maybe ProvisionedThroughputDescription
Maybe Projection
Maybe IndexStatus
provisionedThroughput :: Maybe ProvisionedThroughputDescription
projection :: Maybe Projection
keySchema :: Maybe (NonEmpty KeySchemaElement)
itemCount :: Maybe Integer
indexStatus :: Maybe IndexStatus
indexSizeBytes :: Maybe Integer
indexName :: Maybe Text
indexArn :: Maybe Text
backfilling :: Maybe Bool
$sel:provisionedThroughput:GlobalSecondaryIndexDescription' :: GlobalSecondaryIndexDescription
-> Maybe ProvisionedThroughputDescription
$sel:projection:GlobalSecondaryIndexDescription' :: GlobalSecondaryIndexDescription -> Maybe Projection
$sel:keySchema:GlobalSecondaryIndexDescription' :: GlobalSecondaryIndexDescription
-> Maybe (NonEmpty KeySchemaElement)
$sel:itemCount:GlobalSecondaryIndexDescription' :: GlobalSecondaryIndexDescription -> Maybe Integer
$sel:indexStatus:GlobalSecondaryIndexDescription' :: GlobalSecondaryIndexDescription -> Maybe IndexStatus
$sel:indexSizeBytes:GlobalSecondaryIndexDescription' :: GlobalSecondaryIndexDescription -> Maybe Integer
$sel:indexName:GlobalSecondaryIndexDescription' :: GlobalSecondaryIndexDescription -> Maybe Text
$sel:indexArn:GlobalSecondaryIndexDescription' :: GlobalSecondaryIndexDescription -> Maybe Text
$sel:backfilling:GlobalSecondaryIndexDescription' :: GlobalSecondaryIndexDescription -> Maybe Bool
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
backfilling
        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 IndexStatus
indexStatus
        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
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ProvisionedThroughputDescription
provisionedThroughput

instance
  Prelude.NFData
    GlobalSecondaryIndexDescription
  where
  rnf :: GlobalSecondaryIndexDescription -> ()
rnf GlobalSecondaryIndexDescription' {Maybe Bool
Maybe Integer
Maybe (NonEmpty KeySchemaElement)
Maybe Text
Maybe ProvisionedThroughputDescription
Maybe Projection
Maybe IndexStatus
provisionedThroughput :: Maybe ProvisionedThroughputDescription
projection :: Maybe Projection
keySchema :: Maybe (NonEmpty KeySchemaElement)
itemCount :: Maybe Integer
indexStatus :: Maybe IndexStatus
indexSizeBytes :: Maybe Integer
indexName :: Maybe Text
indexArn :: Maybe Text
backfilling :: Maybe Bool
$sel:provisionedThroughput:GlobalSecondaryIndexDescription' :: GlobalSecondaryIndexDescription
-> Maybe ProvisionedThroughputDescription
$sel:projection:GlobalSecondaryIndexDescription' :: GlobalSecondaryIndexDescription -> Maybe Projection
$sel:keySchema:GlobalSecondaryIndexDescription' :: GlobalSecondaryIndexDescription
-> Maybe (NonEmpty KeySchemaElement)
$sel:itemCount:GlobalSecondaryIndexDescription' :: GlobalSecondaryIndexDescription -> Maybe Integer
$sel:indexStatus:GlobalSecondaryIndexDescription' :: GlobalSecondaryIndexDescription -> Maybe IndexStatus
$sel:indexSizeBytes:GlobalSecondaryIndexDescription' :: GlobalSecondaryIndexDescription -> Maybe Integer
$sel:indexName:GlobalSecondaryIndexDescription' :: GlobalSecondaryIndexDescription -> Maybe Text
$sel:indexArn:GlobalSecondaryIndexDescription' :: GlobalSecondaryIndexDescription -> Maybe Text
$sel:backfilling:GlobalSecondaryIndexDescription' :: GlobalSecondaryIndexDescription -> Maybe Bool
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
backfilling
      seq :: forall a b. a -> b -> b
`Prelude.seq` 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 IndexStatus
indexStatus
      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
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ProvisionedThroughputDescription
provisionedThroughput