{-# 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.SecurityHub.Types.AwsDynamoDbTableGlobalSecondaryIndex
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.SecurityHub.Types.AwsDynamoDbTableGlobalSecondaryIndex where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SecurityHub.Types.AwsDynamoDbTableKeySchema
import Amazonka.SecurityHub.Types.AwsDynamoDbTableProjection
import Amazonka.SecurityHub.Types.AwsDynamoDbTableProvisionedThroughput

-- | Information abut a global secondary index for the table.
--
-- /See:/ 'newAwsDynamoDbTableGlobalSecondaryIndex' smart constructor.
data AwsDynamoDbTableGlobalSecondaryIndex = AwsDynamoDbTableGlobalSecondaryIndex'
  { -- | Whether the index is currently backfilling.
    AwsDynamoDbTableGlobalSecondaryIndex -> Maybe Bool
backfilling :: Prelude.Maybe Prelude.Bool,
    -- | The total size in bytes of the index.
    AwsDynamoDbTableGlobalSecondaryIndex -> Maybe Integer
indexSizeBytes :: Prelude.Maybe Prelude.Integer,
    -- | The current status of the index.
    AwsDynamoDbTableGlobalSecondaryIndex -> Maybe Text
indexStatus :: Prelude.Maybe Prelude.Text,
    -- | Information about the provisioned throughput settings for the indexes.
    AwsDynamoDbTableGlobalSecondaryIndex
-> Maybe AwsDynamoDbTableProvisionedThroughput
provisionedThroughput :: Prelude.Maybe AwsDynamoDbTableProvisionedThroughput,
    -- | The ARN of the index.
    AwsDynamoDbTableGlobalSecondaryIndex -> Maybe Text
indexArn :: Prelude.Maybe Prelude.Text,
    -- | The key schema for the index.
    AwsDynamoDbTableGlobalSecondaryIndex
-> Maybe [AwsDynamoDbTableKeySchema]
keySchema :: Prelude.Maybe [AwsDynamoDbTableKeySchema],
    -- | Attributes that are copied from the table into an index.
    AwsDynamoDbTableGlobalSecondaryIndex
-> Maybe AwsDynamoDbTableProjection
projection :: Prelude.Maybe AwsDynamoDbTableProjection,
    -- | The number of items in the index.
    AwsDynamoDbTableGlobalSecondaryIndex -> Maybe Int
itemCount :: Prelude.Maybe Prelude.Int,
    -- | The name of the index.
    AwsDynamoDbTableGlobalSecondaryIndex -> Maybe Text
indexName :: Prelude.Maybe Prelude.Text
  }
  deriving (AwsDynamoDbTableGlobalSecondaryIndex
-> AwsDynamoDbTableGlobalSecondaryIndex -> Bool
(AwsDynamoDbTableGlobalSecondaryIndex
 -> AwsDynamoDbTableGlobalSecondaryIndex -> Bool)
-> (AwsDynamoDbTableGlobalSecondaryIndex
    -> AwsDynamoDbTableGlobalSecondaryIndex -> Bool)
-> Eq AwsDynamoDbTableGlobalSecondaryIndex
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AwsDynamoDbTableGlobalSecondaryIndex
-> AwsDynamoDbTableGlobalSecondaryIndex -> Bool
$c/= :: AwsDynamoDbTableGlobalSecondaryIndex
-> AwsDynamoDbTableGlobalSecondaryIndex -> Bool
== :: AwsDynamoDbTableGlobalSecondaryIndex
-> AwsDynamoDbTableGlobalSecondaryIndex -> Bool
$c== :: AwsDynamoDbTableGlobalSecondaryIndex
-> AwsDynamoDbTableGlobalSecondaryIndex -> Bool
Prelude.Eq, ReadPrec [AwsDynamoDbTableGlobalSecondaryIndex]
ReadPrec AwsDynamoDbTableGlobalSecondaryIndex
Int -> ReadS AwsDynamoDbTableGlobalSecondaryIndex
ReadS [AwsDynamoDbTableGlobalSecondaryIndex]
(Int -> ReadS AwsDynamoDbTableGlobalSecondaryIndex)
-> ReadS [AwsDynamoDbTableGlobalSecondaryIndex]
-> ReadPrec AwsDynamoDbTableGlobalSecondaryIndex
-> ReadPrec [AwsDynamoDbTableGlobalSecondaryIndex]
-> Read AwsDynamoDbTableGlobalSecondaryIndex
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AwsDynamoDbTableGlobalSecondaryIndex]
$creadListPrec :: ReadPrec [AwsDynamoDbTableGlobalSecondaryIndex]
readPrec :: ReadPrec AwsDynamoDbTableGlobalSecondaryIndex
$creadPrec :: ReadPrec AwsDynamoDbTableGlobalSecondaryIndex
readList :: ReadS [AwsDynamoDbTableGlobalSecondaryIndex]
$creadList :: ReadS [AwsDynamoDbTableGlobalSecondaryIndex]
readsPrec :: Int -> ReadS AwsDynamoDbTableGlobalSecondaryIndex
$creadsPrec :: Int -> ReadS AwsDynamoDbTableGlobalSecondaryIndex
Prelude.Read, Int -> AwsDynamoDbTableGlobalSecondaryIndex -> ShowS
[AwsDynamoDbTableGlobalSecondaryIndex] -> ShowS
AwsDynamoDbTableGlobalSecondaryIndex -> String
(Int -> AwsDynamoDbTableGlobalSecondaryIndex -> ShowS)
-> (AwsDynamoDbTableGlobalSecondaryIndex -> String)
-> ([AwsDynamoDbTableGlobalSecondaryIndex] -> ShowS)
-> Show AwsDynamoDbTableGlobalSecondaryIndex
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AwsDynamoDbTableGlobalSecondaryIndex] -> ShowS
$cshowList :: [AwsDynamoDbTableGlobalSecondaryIndex] -> ShowS
show :: AwsDynamoDbTableGlobalSecondaryIndex -> String
$cshow :: AwsDynamoDbTableGlobalSecondaryIndex -> String
showsPrec :: Int -> AwsDynamoDbTableGlobalSecondaryIndex -> ShowS
$cshowsPrec :: Int -> AwsDynamoDbTableGlobalSecondaryIndex -> ShowS
Prelude.Show, (forall x.
 AwsDynamoDbTableGlobalSecondaryIndex
 -> Rep AwsDynamoDbTableGlobalSecondaryIndex x)
-> (forall x.
    Rep AwsDynamoDbTableGlobalSecondaryIndex x
    -> AwsDynamoDbTableGlobalSecondaryIndex)
-> Generic AwsDynamoDbTableGlobalSecondaryIndex
forall x.
Rep AwsDynamoDbTableGlobalSecondaryIndex x
-> AwsDynamoDbTableGlobalSecondaryIndex
forall x.
AwsDynamoDbTableGlobalSecondaryIndex
-> Rep AwsDynamoDbTableGlobalSecondaryIndex x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AwsDynamoDbTableGlobalSecondaryIndex x
-> AwsDynamoDbTableGlobalSecondaryIndex
$cfrom :: forall x.
AwsDynamoDbTableGlobalSecondaryIndex
-> Rep AwsDynamoDbTableGlobalSecondaryIndex x
Prelude.Generic)

-- |
-- Create a value of 'AwsDynamoDbTableGlobalSecondaryIndex' 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', 'awsDynamoDbTableGlobalSecondaryIndex_backfilling' - Whether the index is currently backfilling.
--
-- 'indexSizeBytes', 'awsDynamoDbTableGlobalSecondaryIndex_indexSizeBytes' - The total size in bytes of the index.
--
-- 'indexStatus', 'awsDynamoDbTableGlobalSecondaryIndex_indexStatus' - The current status of the index.
--
-- 'provisionedThroughput', 'awsDynamoDbTableGlobalSecondaryIndex_provisionedThroughput' - Information about the provisioned throughput settings for the indexes.
--
-- 'indexArn', 'awsDynamoDbTableGlobalSecondaryIndex_indexArn' - The ARN of the index.
--
-- 'keySchema', 'awsDynamoDbTableGlobalSecondaryIndex_keySchema' - The key schema for the index.
--
-- 'projection', 'awsDynamoDbTableGlobalSecondaryIndex_projection' - Attributes that are copied from the table into an index.
--
-- 'itemCount', 'awsDynamoDbTableGlobalSecondaryIndex_itemCount' - The number of items in the index.
--
-- 'indexName', 'awsDynamoDbTableGlobalSecondaryIndex_indexName' - The name of the index.
newAwsDynamoDbTableGlobalSecondaryIndex ::
  AwsDynamoDbTableGlobalSecondaryIndex
newAwsDynamoDbTableGlobalSecondaryIndex :: AwsDynamoDbTableGlobalSecondaryIndex
newAwsDynamoDbTableGlobalSecondaryIndex =
  AwsDynamoDbTableGlobalSecondaryIndex' :: Maybe Bool
-> Maybe Integer
-> Maybe Text
-> Maybe AwsDynamoDbTableProvisionedThroughput
-> Maybe Text
-> Maybe [AwsDynamoDbTableKeySchema]
-> Maybe AwsDynamoDbTableProjection
-> Maybe Int
-> Maybe Text
-> AwsDynamoDbTableGlobalSecondaryIndex
AwsDynamoDbTableGlobalSecondaryIndex'
    { $sel:backfilling:AwsDynamoDbTableGlobalSecondaryIndex' :: Maybe Bool
backfilling =
        Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:indexSizeBytes:AwsDynamoDbTableGlobalSecondaryIndex' :: Maybe Integer
indexSizeBytes = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:indexStatus:AwsDynamoDbTableGlobalSecondaryIndex' :: Maybe Text
indexStatus = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:provisionedThroughput:AwsDynamoDbTableGlobalSecondaryIndex' :: Maybe AwsDynamoDbTableProvisionedThroughput
provisionedThroughput =
        Maybe AwsDynamoDbTableProvisionedThroughput
forall a. Maybe a
Prelude.Nothing,
      $sel:indexArn:AwsDynamoDbTableGlobalSecondaryIndex' :: Maybe Text
indexArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:keySchema:AwsDynamoDbTableGlobalSecondaryIndex' :: Maybe [AwsDynamoDbTableKeySchema]
keySchema = Maybe [AwsDynamoDbTableKeySchema]
forall a. Maybe a
Prelude.Nothing,
      $sel:projection:AwsDynamoDbTableGlobalSecondaryIndex' :: Maybe AwsDynamoDbTableProjection
projection = Maybe AwsDynamoDbTableProjection
forall a. Maybe a
Prelude.Nothing,
      $sel:itemCount:AwsDynamoDbTableGlobalSecondaryIndex' :: Maybe Int
itemCount = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:indexName:AwsDynamoDbTableGlobalSecondaryIndex' :: Maybe Text
indexName = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | Whether the index is currently backfilling.
awsDynamoDbTableGlobalSecondaryIndex_backfilling :: Lens.Lens' AwsDynamoDbTableGlobalSecondaryIndex (Prelude.Maybe Prelude.Bool)
awsDynamoDbTableGlobalSecondaryIndex_backfilling :: (Maybe Bool -> f (Maybe Bool))
-> AwsDynamoDbTableGlobalSecondaryIndex
-> f AwsDynamoDbTableGlobalSecondaryIndex
awsDynamoDbTableGlobalSecondaryIndex_backfilling = (AwsDynamoDbTableGlobalSecondaryIndex -> Maybe Bool)
-> (AwsDynamoDbTableGlobalSecondaryIndex
    -> Maybe Bool -> AwsDynamoDbTableGlobalSecondaryIndex)
-> Lens
     AwsDynamoDbTableGlobalSecondaryIndex
     AwsDynamoDbTableGlobalSecondaryIndex
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsDynamoDbTableGlobalSecondaryIndex' {Maybe Bool
backfilling :: Maybe Bool
$sel:backfilling:AwsDynamoDbTableGlobalSecondaryIndex' :: AwsDynamoDbTableGlobalSecondaryIndex -> Maybe Bool
backfilling} -> Maybe Bool
backfilling) (\s :: AwsDynamoDbTableGlobalSecondaryIndex
s@AwsDynamoDbTableGlobalSecondaryIndex' {} Maybe Bool
a -> AwsDynamoDbTableGlobalSecondaryIndex
s {$sel:backfilling:AwsDynamoDbTableGlobalSecondaryIndex' :: Maybe Bool
backfilling = Maybe Bool
a} :: AwsDynamoDbTableGlobalSecondaryIndex)

-- | The total size in bytes of the index.
awsDynamoDbTableGlobalSecondaryIndex_indexSizeBytes :: Lens.Lens' AwsDynamoDbTableGlobalSecondaryIndex (Prelude.Maybe Prelude.Integer)
awsDynamoDbTableGlobalSecondaryIndex_indexSizeBytes :: (Maybe Integer -> f (Maybe Integer))
-> AwsDynamoDbTableGlobalSecondaryIndex
-> f AwsDynamoDbTableGlobalSecondaryIndex
awsDynamoDbTableGlobalSecondaryIndex_indexSizeBytes = (AwsDynamoDbTableGlobalSecondaryIndex -> Maybe Integer)
-> (AwsDynamoDbTableGlobalSecondaryIndex
    -> Maybe Integer -> AwsDynamoDbTableGlobalSecondaryIndex)
-> Lens
     AwsDynamoDbTableGlobalSecondaryIndex
     AwsDynamoDbTableGlobalSecondaryIndex
     (Maybe Integer)
     (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsDynamoDbTableGlobalSecondaryIndex' {Maybe Integer
indexSizeBytes :: Maybe Integer
$sel:indexSizeBytes:AwsDynamoDbTableGlobalSecondaryIndex' :: AwsDynamoDbTableGlobalSecondaryIndex -> Maybe Integer
indexSizeBytes} -> Maybe Integer
indexSizeBytes) (\s :: AwsDynamoDbTableGlobalSecondaryIndex
s@AwsDynamoDbTableGlobalSecondaryIndex' {} Maybe Integer
a -> AwsDynamoDbTableGlobalSecondaryIndex
s {$sel:indexSizeBytes:AwsDynamoDbTableGlobalSecondaryIndex' :: Maybe Integer
indexSizeBytes = Maybe Integer
a} :: AwsDynamoDbTableGlobalSecondaryIndex)

-- | The current status of the index.
awsDynamoDbTableGlobalSecondaryIndex_indexStatus :: Lens.Lens' AwsDynamoDbTableGlobalSecondaryIndex (Prelude.Maybe Prelude.Text)
awsDynamoDbTableGlobalSecondaryIndex_indexStatus :: (Maybe Text -> f (Maybe Text))
-> AwsDynamoDbTableGlobalSecondaryIndex
-> f AwsDynamoDbTableGlobalSecondaryIndex
awsDynamoDbTableGlobalSecondaryIndex_indexStatus = (AwsDynamoDbTableGlobalSecondaryIndex -> Maybe Text)
-> (AwsDynamoDbTableGlobalSecondaryIndex
    -> Maybe Text -> AwsDynamoDbTableGlobalSecondaryIndex)
-> Lens
     AwsDynamoDbTableGlobalSecondaryIndex
     AwsDynamoDbTableGlobalSecondaryIndex
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsDynamoDbTableGlobalSecondaryIndex' {Maybe Text
indexStatus :: Maybe Text
$sel:indexStatus:AwsDynamoDbTableGlobalSecondaryIndex' :: AwsDynamoDbTableGlobalSecondaryIndex -> Maybe Text
indexStatus} -> Maybe Text
indexStatus) (\s :: AwsDynamoDbTableGlobalSecondaryIndex
s@AwsDynamoDbTableGlobalSecondaryIndex' {} Maybe Text
a -> AwsDynamoDbTableGlobalSecondaryIndex
s {$sel:indexStatus:AwsDynamoDbTableGlobalSecondaryIndex' :: Maybe Text
indexStatus = Maybe Text
a} :: AwsDynamoDbTableGlobalSecondaryIndex)

-- | Information about the provisioned throughput settings for the indexes.
awsDynamoDbTableGlobalSecondaryIndex_provisionedThroughput :: Lens.Lens' AwsDynamoDbTableGlobalSecondaryIndex (Prelude.Maybe AwsDynamoDbTableProvisionedThroughput)
awsDynamoDbTableGlobalSecondaryIndex_provisionedThroughput :: (Maybe AwsDynamoDbTableProvisionedThroughput
 -> f (Maybe AwsDynamoDbTableProvisionedThroughput))
-> AwsDynamoDbTableGlobalSecondaryIndex
-> f AwsDynamoDbTableGlobalSecondaryIndex
awsDynamoDbTableGlobalSecondaryIndex_provisionedThroughput = (AwsDynamoDbTableGlobalSecondaryIndex
 -> Maybe AwsDynamoDbTableProvisionedThroughput)
-> (AwsDynamoDbTableGlobalSecondaryIndex
    -> Maybe AwsDynamoDbTableProvisionedThroughput
    -> AwsDynamoDbTableGlobalSecondaryIndex)
-> Lens
     AwsDynamoDbTableGlobalSecondaryIndex
     AwsDynamoDbTableGlobalSecondaryIndex
     (Maybe AwsDynamoDbTableProvisionedThroughput)
     (Maybe AwsDynamoDbTableProvisionedThroughput)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsDynamoDbTableGlobalSecondaryIndex' {Maybe AwsDynamoDbTableProvisionedThroughput
provisionedThroughput :: Maybe AwsDynamoDbTableProvisionedThroughput
$sel:provisionedThroughput:AwsDynamoDbTableGlobalSecondaryIndex' :: AwsDynamoDbTableGlobalSecondaryIndex
-> Maybe AwsDynamoDbTableProvisionedThroughput
provisionedThroughput} -> Maybe AwsDynamoDbTableProvisionedThroughput
provisionedThroughput) (\s :: AwsDynamoDbTableGlobalSecondaryIndex
s@AwsDynamoDbTableGlobalSecondaryIndex' {} Maybe AwsDynamoDbTableProvisionedThroughput
a -> AwsDynamoDbTableGlobalSecondaryIndex
s {$sel:provisionedThroughput:AwsDynamoDbTableGlobalSecondaryIndex' :: Maybe AwsDynamoDbTableProvisionedThroughput
provisionedThroughput = Maybe AwsDynamoDbTableProvisionedThroughput
a} :: AwsDynamoDbTableGlobalSecondaryIndex)

-- | The ARN of the index.
awsDynamoDbTableGlobalSecondaryIndex_indexArn :: Lens.Lens' AwsDynamoDbTableGlobalSecondaryIndex (Prelude.Maybe Prelude.Text)
awsDynamoDbTableGlobalSecondaryIndex_indexArn :: (Maybe Text -> f (Maybe Text))
-> AwsDynamoDbTableGlobalSecondaryIndex
-> f AwsDynamoDbTableGlobalSecondaryIndex
awsDynamoDbTableGlobalSecondaryIndex_indexArn = (AwsDynamoDbTableGlobalSecondaryIndex -> Maybe Text)
-> (AwsDynamoDbTableGlobalSecondaryIndex
    -> Maybe Text -> AwsDynamoDbTableGlobalSecondaryIndex)
-> Lens
     AwsDynamoDbTableGlobalSecondaryIndex
     AwsDynamoDbTableGlobalSecondaryIndex
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsDynamoDbTableGlobalSecondaryIndex' {Maybe Text
indexArn :: Maybe Text
$sel:indexArn:AwsDynamoDbTableGlobalSecondaryIndex' :: AwsDynamoDbTableGlobalSecondaryIndex -> Maybe Text
indexArn} -> Maybe Text
indexArn) (\s :: AwsDynamoDbTableGlobalSecondaryIndex
s@AwsDynamoDbTableGlobalSecondaryIndex' {} Maybe Text
a -> AwsDynamoDbTableGlobalSecondaryIndex
s {$sel:indexArn:AwsDynamoDbTableGlobalSecondaryIndex' :: Maybe Text
indexArn = Maybe Text
a} :: AwsDynamoDbTableGlobalSecondaryIndex)

-- | The key schema for the index.
awsDynamoDbTableGlobalSecondaryIndex_keySchema :: Lens.Lens' AwsDynamoDbTableGlobalSecondaryIndex (Prelude.Maybe [AwsDynamoDbTableKeySchema])
awsDynamoDbTableGlobalSecondaryIndex_keySchema :: (Maybe [AwsDynamoDbTableKeySchema]
 -> f (Maybe [AwsDynamoDbTableKeySchema]))
-> AwsDynamoDbTableGlobalSecondaryIndex
-> f AwsDynamoDbTableGlobalSecondaryIndex
awsDynamoDbTableGlobalSecondaryIndex_keySchema = (AwsDynamoDbTableGlobalSecondaryIndex
 -> Maybe [AwsDynamoDbTableKeySchema])
-> (AwsDynamoDbTableGlobalSecondaryIndex
    -> Maybe [AwsDynamoDbTableKeySchema]
    -> AwsDynamoDbTableGlobalSecondaryIndex)
-> Lens
     AwsDynamoDbTableGlobalSecondaryIndex
     AwsDynamoDbTableGlobalSecondaryIndex
     (Maybe [AwsDynamoDbTableKeySchema])
     (Maybe [AwsDynamoDbTableKeySchema])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsDynamoDbTableGlobalSecondaryIndex' {Maybe [AwsDynamoDbTableKeySchema]
keySchema :: Maybe [AwsDynamoDbTableKeySchema]
$sel:keySchema:AwsDynamoDbTableGlobalSecondaryIndex' :: AwsDynamoDbTableGlobalSecondaryIndex
-> Maybe [AwsDynamoDbTableKeySchema]
keySchema} -> Maybe [AwsDynamoDbTableKeySchema]
keySchema) (\s :: AwsDynamoDbTableGlobalSecondaryIndex
s@AwsDynamoDbTableGlobalSecondaryIndex' {} Maybe [AwsDynamoDbTableKeySchema]
a -> AwsDynamoDbTableGlobalSecondaryIndex
s {$sel:keySchema:AwsDynamoDbTableGlobalSecondaryIndex' :: Maybe [AwsDynamoDbTableKeySchema]
keySchema = Maybe [AwsDynamoDbTableKeySchema]
a} :: AwsDynamoDbTableGlobalSecondaryIndex) ((Maybe [AwsDynamoDbTableKeySchema]
  -> f (Maybe [AwsDynamoDbTableKeySchema]))
 -> AwsDynamoDbTableGlobalSecondaryIndex
 -> f AwsDynamoDbTableGlobalSecondaryIndex)
-> ((Maybe [AwsDynamoDbTableKeySchema]
     -> f (Maybe [AwsDynamoDbTableKeySchema]))
    -> Maybe [AwsDynamoDbTableKeySchema]
    -> f (Maybe [AwsDynamoDbTableKeySchema]))
-> (Maybe [AwsDynamoDbTableKeySchema]
    -> f (Maybe [AwsDynamoDbTableKeySchema]))
-> AwsDynamoDbTableGlobalSecondaryIndex
-> f AwsDynamoDbTableGlobalSecondaryIndex
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [AwsDynamoDbTableKeySchema]
  [AwsDynamoDbTableKeySchema]
  [AwsDynamoDbTableKeySchema]
  [AwsDynamoDbTableKeySchema]
-> Iso
     (Maybe [AwsDynamoDbTableKeySchema])
     (Maybe [AwsDynamoDbTableKeySchema])
     (Maybe [AwsDynamoDbTableKeySchema])
     (Maybe [AwsDynamoDbTableKeySchema])
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
  [AwsDynamoDbTableKeySchema]
  [AwsDynamoDbTableKeySchema]
  [AwsDynamoDbTableKeySchema]
  [AwsDynamoDbTableKeySchema]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Attributes that are copied from the table into an index.
awsDynamoDbTableGlobalSecondaryIndex_projection :: Lens.Lens' AwsDynamoDbTableGlobalSecondaryIndex (Prelude.Maybe AwsDynamoDbTableProjection)
awsDynamoDbTableGlobalSecondaryIndex_projection :: (Maybe AwsDynamoDbTableProjection
 -> f (Maybe AwsDynamoDbTableProjection))
-> AwsDynamoDbTableGlobalSecondaryIndex
-> f AwsDynamoDbTableGlobalSecondaryIndex
awsDynamoDbTableGlobalSecondaryIndex_projection = (AwsDynamoDbTableGlobalSecondaryIndex
 -> Maybe AwsDynamoDbTableProjection)
-> (AwsDynamoDbTableGlobalSecondaryIndex
    -> Maybe AwsDynamoDbTableProjection
    -> AwsDynamoDbTableGlobalSecondaryIndex)
-> Lens
     AwsDynamoDbTableGlobalSecondaryIndex
     AwsDynamoDbTableGlobalSecondaryIndex
     (Maybe AwsDynamoDbTableProjection)
     (Maybe AwsDynamoDbTableProjection)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsDynamoDbTableGlobalSecondaryIndex' {Maybe AwsDynamoDbTableProjection
projection :: Maybe AwsDynamoDbTableProjection
$sel:projection:AwsDynamoDbTableGlobalSecondaryIndex' :: AwsDynamoDbTableGlobalSecondaryIndex
-> Maybe AwsDynamoDbTableProjection
projection} -> Maybe AwsDynamoDbTableProjection
projection) (\s :: AwsDynamoDbTableGlobalSecondaryIndex
s@AwsDynamoDbTableGlobalSecondaryIndex' {} Maybe AwsDynamoDbTableProjection
a -> AwsDynamoDbTableGlobalSecondaryIndex
s {$sel:projection:AwsDynamoDbTableGlobalSecondaryIndex' :: Maybe AwsDynamoDbTableProjection
projection = Maybe AwsDynamoDbTableProjection
a} :: AwsDynamoDbTableGlobalSecondaryIndex)

-- | The number of items in the index.
awsDynamoDbTableGlobalSecondaryIndex_itemCount :: Lens.Lens' AwsDynamoDbTableGlobalSecondaryIndex (Prelude.Maybe Prelude.Int)
awsDynamoDbTableGlobalSecondaryIndex_itemCount :: (Maybe Int -> f (Maybe Int))
-> AwsDynamoDbTableGlobalSecondaryIndex
-> f AwsDynamoDbTableGlobalSecondaryIndex
awsDynamoDbTableGlobalSecondaryIndex_itemCount = (AwsDynamoDbTableGlobalSecondaryIndex -> Maybe Int)
-> (AwsDynamoDbTableGlobalSecondaryIndex
    -> Maybe Int -> AwsDynamoDbTableGlobalSecondaryIndex)
-> Lens
     AwsDynamoDbTableGlobalSecondaryIndex
     AwsDynamoDbTableGlobalSecondaryIndex
     (Maybe Int)
     (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsDynamoDbTableGlobalSecondaryIndex' {Maybe Int
itemCount :: Maybe Int
$sel:itemCount:AwsDynamoDbTableGlobalSecondaryIndex' :: AwsDynamoDbTableGlobalSecondaryIndex -> Maybe Int
itemCount} -> Maybe Int
itemCount) (\s :: AwsDynamoDbTableGlobalSecondaryIndex
s@AwsDynamoDbTableGlobalSecondaryIndex' {} Maybe Int
a -> AwsDynamoDbTableGlobalSecondaryIndex
s {$sel:itemCount:AwsDynamoDbTableGlobalSecondaryIndex' :: Maybe Int
itemCount = Maybe Int
a} :: AwsDynamoDbTableGlobalSecondaryIndex)

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

instance
  Core.FromJSON
    AwsDynamoDbTableGlobalSecondaryIndex
  where
  parseJSON :: Value -> Parser AwsDynamoDbTableGlobalSecondaryIndex
parseJSON =
    String
-> (Object -> Parser AwsDynamoDbTableGlobalSecondaryIndex)
-> Value
-> Parser AwsDynamoDbTableGlobalSecondaryIndex
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AwsDynamoDbTableGlobalSecondaryIndex"
      ( \Object
x ->
          Maybe Bool
-> Maybe Integer
-> Maybe Text
-> Maybe AwsDynamoDbTableProvisionedThroughput
-> Maybe Text
-> Maybe [AwsDynamoDbTableKeySchema]
-> Maybe AwsDynamoDbTableProjection
-> Maybe Int
-> Maybe Text
-> AwsDynamoDbTableGlobalSecondaryIndex
AwsDynamoDbTableGlobalSecondaryIndex'
            (Maybe Bool
 -> Maybe Integer
 -> Maybe Text
 -> Maybe AwsDynamoDbTableProvisionedThroughput
 -> Maybe Text
 -> Maybe [AwsDynamoDbTableKeySchema]
 -> Maybe AwsDynamoDbTableProjection
 -> Maybe Int
 -> Maybe Text
 -> AwsDynamoDbTableGlobalSecondaryIndex)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Integer
      -> Maybe Text
      -> Maybe AwsDynamoDbTableProvisionedThroughput
      -> Maybe Text
      -> Maybe [AwsDynamoDbTableKeySchema]
      -> Maybe AwsDynamoDbTableProjection
      -> Maybe Int
      -> Maybe Text
      -> AwsDynamoDbTableGlobalSecondaryIndex)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Backfilling")
            Parser
  (Maybe Integer
   -> Maybe Text
   -> Maybe AwsDynamoDbTableProvisionedThroughput
   -> Maybe Text
   -> Maybe [AwsDynamoDbTableKeySchema]
   -> Maybe AwsDynamoDbTableProjection
   -> Maybe Int
   -> Maybe Text
   -> AwsDynamoDbTableGlobalSecondaryIndex)
-> Parser (Maybe Integer)
-> Parser
     (Maybe Text
      -> Maybe AwsDynamoDbTableProvisionedThroughput
      -> Maybe Text
      -> Maybe [AwsDynamoDbTableKeySchema]
      -> Maybe AwsDynamoDbTableProjection
      -> Maybe Int
      -> Maybe Text
      -> AwsDynamoDbTableGlobalSecondaryIndex)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"IndexSizeBytes")
            Parser
  (Maybe Text
   -> Maybe AwsDynamoDbTableProvisionedThroughput
   -> Maybe Text
   -> Maybe [AwsDynamoDbTableKeySchema]
   -> Maybe AwsDynamoDbTableProjection
   -> Maybe Int
   -> Maybe Text
   -> AwsDynamoDbTableGlobalSecondaryIndex)
-> Parser (Maybe Text)
-> Parser
     (Maybe AwsDynamoDbTableProvisionedThroughput
      -> Maybe Text
      -> Maybe [AwsDynamoDbTableKeySchema]
      -> Maybe AwsDynamoDbTableProjection
      -> Maybe Int
      -> Maybe Text
      -> AwsDynamoDbTableGlobalSecondaryIndex)
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
"IndexStatus")
            Parser
  (Maybe AwsDynamoDbTableProvisionedThroughput
   -> Maybe Text
   -> Maybe [AwsDynamoDbTableKeySchema]
   -> Maybe AwsDynamoDbTableProjection
   -> Maybe Int
   -> Maybe Text
   -> AwsDynamoDbTableGlobalSecondaryIndex)
-> Parser (Maybe AwsDynamoDbTableProvisionedThroughput)
-> Parser
     (Maybe Text
      -> Maybe [AwsDynamoDbTableKeySchema]
      -> Maybe AwsDynamoDbTableProjection
      -> Maybe Int
      -> Maybe Text
      -> AwsDynamoDbTableGlobalSecondaryIndex)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text -> Parser (Maybe AwsDynamoDbTableProvisionedThroughput)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ProvisionedThroughput")
            Parser
  (Maybe Text
   -> Maybe [AwsDynamoDbTableKeySchema]
   -> Maybe AwsDynamoDbTableProjection
   -> Maybe Int
   -> Maybe Text
   -> AwsDynamoDbTableGlobalSecondaryIndex)
-> Parser (Maybe Text)
-> Parser
     (Maybe [AwsDynamoDbTableKeySchema]
      -> Maybe AwsDynamoDbTableProjection
      -> Maybe Int
      -> Maybe Text
      -> AwsDynamoDbTableGlobalSecondaryIndex)
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
"IndexArn")
            Parser
  (Maybe [AwsDynamoDbTableKeySchema]
   -> Maybe AwsDynamoDbTableProjection
   -> Maybe Int
   -> Maybe Text
   -> AwsDynamoDbTableGlobalSecondaryIndex)
-> Parser (Maybe [AwsDynamoDbTableKeySchema])
-> Parser
     (Maybe AwsDynamoDbTableProjection
      -> Maybe Int -> Maybe Text -> AwsDynamoDbTableGlobalSecondaryIndex)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text -> Parser (Maybe (Maybe [AwsDynamoDbTableKeySchema]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"KeySchema" Parser (Maybe (Maybe [AwsDynamoDbTableKeySchema]))
-> Maybe [AwsDynamoDbTableKeySchema]
-> Parser (Maybe [AwsDynamoDbTableKeySchema])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [AwsDynamoDbTableKeySchema]
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe AwsDynamoDbTableProjection
   -> Maybe Int -> Maybe Text -> AwsDynamoDbTableGlobalSecondaryIndex)
-> Parser (Maybe AwsDynamoDbTableProjection)
-> Parser
     (Maybe Int -> Maybe Text -> AwsDynamoDbTableGlobalSecondaryIndex)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe AwsDynamoDbTableProjection)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Projection")
            Parser
  (Maybe Int -> Maybe Text -> AwsDynamoDbTableGlobalSecondaryIndex)
-> Parser (Maybe Int)
-> Parser (Maybe Text -> AwsDynamoDbTableGlobalSecondaryIndex)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ItemCount")
            Parser (Maybe Text -> AwsDynamoDbTableGlobalSecondaryIndex)
-> Parser (Maybe Text)
-> Parser AwsDynamoDbTableGlobalSecondaryIndex
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
    AwsDynamoDbTableGlobalSecondaryIndex

instance
  Prelude.NFData
    AwsDynamoDbTableGlobalSecondaryIndex

instance
  Core.ToJSON
    AwsDynamoDbTableGlobalSecondaryIndex
  where
  toJSON :: AwsDynamoDbTableGlobalSecondaryIndex -> Value
toJSON AwsDynamoDbTableGlobalSecondaryIndex' {Maybe Bool
Maybe Int
Maybe Integer
Maybe [AwsDynamoDbTableKeySchema]
Maybe Text
Maybe AwsDynamoDbTableProjection
Maybe AwsDynamoDbTableProvisionedThroughput
indexName :: Maybe Text
itemCount :: Maybe Int
projection :: Maybe AwsDynamoDbTableProjection
keySchema :: Maybe [AwsDynamoDbTableKeySchema]
indexArn :: Maybe Text
provisionedThroughput :: Maybe AwsDynamoDbTableProvisionedThroughput
indexStatus :: Maybe Text
indexSizeBytes :: Maybe Integer
backfilling :: Maybe Bool
$sel:indexName:AwsDynamoDbTableGlobalSecondaryIndex' :: AwsDynamoDbTableGlobalSecondaryIndex -> Maybe Text
$sel:itemCount:AwsDynamoDbTableGlobalSecondaryIndex' :: AwsDynamoDbTableGlobalSecondaryIndex -> Maybe Int
$sel:projection:AwsDynamoDbTableGlobalSecondaryIndex' :: AwsDynamoDbTableGlobalSecondaryIndex
-> Maybe AwsDynamoDbTableProjection
$sel:keySchema:AwsDynamoDbTableGlobalSecondaryIndex' :: AwsDynamoDbTableGlobalSecondaryIndex
-> Maybe [AwsDynamoDbTableKeySchema]
$sel:indexArn:AwsDynamoDbTableGlobalSecondaryIndex' :: AwsDynamoDbTableGlobalSecondaryIndex -> Maybe Text
$sel:provisionedThroughput:AwsDynamoDbTableGlobalSecondaryIndex' :: AwsDynamoDbTableGlobalSecondaryIndex
-> Maybe AwsDynamoDbTableProvisionedThroughput
$sel:indexStatus:AwsDynamoDbTableGlobalSecondaryIndex' :: AwsDynamoDbTableGlobalSecondaryIndex -> Maybe Text
$sel:indexSizeBytes:AwsDynamoDbTableGlobalSecondaryIndex' :: AwsDynamoDbTableGlobalSecondaryIndex -> Maybe Integer
$sel:backfilling:AwsDynamoDbTableGlobalSecondaryIndex' :: AwsDynamoDbTableGlobalSecondaryIndex -> Maybe Bool
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"Backfilling" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
backfilling,
            (Text
"IndexSizeBytes" Text -> Integer -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Integer -> Pair) -> Maybe Integer -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Integer
indexSizeBytes,
            (Text
"IndexStatus" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
indexStatus,
            (Text
"ProvisionedThroughput" Text -> AwsDynamoDbTableProvisionedThroughput -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (AwsDynamoDbTableProvisionedThroughput -> Pair)
-> Maybe AwsDynamoDbTableProvisionedThroughput -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AwsDynamoDbTableProvisionedThroughput
provisionedThroughput,
            (Text
"IndexArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
indexArn,
            (Text
"KeySchema" Text -> [AwsDynamoDbTableKeySchema] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([AwsDynamoDbTableKeySchema] -> Pair)
-> Maybe [AwsDynamoDbTableKeySchema] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [AwsDynamoDbTableKeySchema]
keySchema,
            (Text
"Projection" Text -> AwsDynamoDbTableProjection -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (AwsDynamoDbTableProjection -> Pair)
-> Maybe AwsDynamoDbTableProjection -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AwsDynamoDbTableProjection
projection,
            (Text
"ItemCount" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
itemCount,
            (Text
"IndexName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
indexName
          ]
      )