{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

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

-- |
-- Module      : Amazonka.DMS.DescribeTableStatistics
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Returns table statistics on the database migration task, including table
-- name, rows inserted, rows updated, and rows deleted.
--
-- Note that the \"last updated\" column the DMS console only indicates the
-- time that DMS last updated the table statistics record for a table. It
-- does not indicate the time of the last update to the table.
--
-- This operation returns paginated results.
module Amazonka.DMS.DescribeTableStatistics
  ( -- * Creating a Request
    DescribeTableStatistics (..),
    newDescribeTableStatistics,

    -- * Request Lenses
    describeTableStatistics_filters,
    describeTableStatistics_marker,
    describeTableStatistics_maxRecords,
    describeTableStatistics_replicationTaskArn,

    -- * Destructuring the Response
    DescribeTableStatisticsResponse (..),
    newDescribeTableStatisticsResponse,

    -- * Response Lenses
    describeTableStatisticsResponse_marker,
    describeTableStatisticsResponse_replicationTaskArn,
    describeTableStatisticsResponse_tableStatistics,
    describeTableStatisticsResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import Amazonka.DMS.Types
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- |
--
-- /See:/ 'newDescribeTableStatistics' smart constructor.
data DescribeTableStatistics = DescribeTableStatistics'
  { -- | Filters applied to table statistics.
    --
    -- Valid filter names: schema-name | table-name | table-state
    --
    -- A combination of filters creates an AND condition where each record
    -- matches all specified filters.
    DescribeTableStatistics -> Maybe [Filter]
filters :: Prelude.Maybe [Filter],
    -- | An optional pagination token provided by a previous request. If this
    -- parameter is specified, the response includes only records beyond the
    -- marker, up to the value specified by @MaxRecords@.
    DescribeTableStatistics -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of records to include in the response. If more
    -- records exist than the specified @MaxRecords@ value, a pagination token
    -- called a marker is included in the response so that the remaining
    -- results can be retrieved.
    --
    -- Default: 100
    --
    -- Constraints: Minimum 20, maximum 500.
    DescribeTableStatistics -> Maybe Int
maxRecords :: Prelude.Maybe Prelude.Int,
    -- | The Amazon Resource Name (ARN) of the replication task.
    DescribeTableStatistics -> Text
replicationTaskArn :: Prelude.Text
  }
  deriving (DescribeTableStatistics -> DescribeTableStatistics -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeTableStatistics -> DescribeTableStatistics -> Bool
$c/= :: DescribeTableStatistics -> DescribeTableStatistics -> Bool
== :: DescribeTableStatistics -> DescribeTableStatistics -> Bool
$c== :: DescribeTableStatistics -> DescribeTableStatistics -> Bool
Prelude.Eq, ReadPrec [DescribeTableStatistics]
ReadPrec DescribeTableStatistics
Int -> ReadS DescribeTableStatistics
ReadS [DescribeTableStatistics]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeTableStatistics]
$creadListPrec :: ReadPrec [DescribeTableStatistics]
readPrec :: ReadPrec DescribeTableStatistics
$creadPrec :: ReadPrec DescribeTableStatistics
readList :: ReadS [DescribeTableStatistics]
$creadList :: ReadS [DescribeTableStatistics]
readsPrec :: Int -> ReadS DescribeTableStatistics
$creadsPrec :: Int -> ReadS DescribeTableStatistics
Prelude.Read, Int -> DescribeTableStatistics -> ShowS
[DescribeTableStatistics] -> ShowS
DescribeTableStatistics -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeTableStatistics] -> ShowS
$cshowList :: [DescribeTableStatistics] -> ShowS
show :: DescribeTableStatistics -> String
$cshow :: DescribeTableStatistics -> String
showsPrec :: Int -> DescribeTableStatistics -> ShowS
$cshowsPrec :: Int -> DescribeTableStatistics -> ShowS
Prelude.Show, forall x. Rep DescribeTableStatistics x -> DescribeTableStatistics
forall x. DescribeTableStatistics -> Rep DescribeTableStatistics x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeTableStatistics x -> DescribeTableStatistics
$cfrom :: forall x. DescribeTableStatistics -> Rep DescribeTableStatistics x
Prelude.Generic)

-- |
-- Create a value of 'DescribeTableStatistics' 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:
--
-- 'filters', 'describeTableStatistics_filters' - Filters applied to table statistics.
--
-- Valid filter names: schema-name | table-name | table-state
--
-- A combination of filters creates an AND condition where each record
-- matches all specified filters.
--
-- 'marker', 'describeTableStatistics_marker' - An optional pagination token provided by a previous request. If this
-- parameter is specified, the response includes only records beyond the
-- marker, up to the value specified by @MaxRecords@.
--
-- 'maxRecords', 'describeTableStatistics_maxRecords' - The maximum number of records to include in the response. If more
-- records exist than the specified @MaxRecords@ value, a pagination token
-- called a marker is included in the response so that the remaining
-- results can be retrieved.
--
-- Default: 100
--
-- Constraints: Minimum 20, maximum 500.
--
-- 'replicationTaskArn', 'describeTableStatistics_replicationTaskArn' - The Amazon Resource Name (ARN) of the replication task.
newDescribeTableStatistics ::
  -- | 'replicationTaskArn'
  Prelude.Text ->
  DescribeTableStatistics
newDescribeTableStatistics :: Text -> DescribeTableStatistics
newDescribeTableStatistics Text
pReplicationTaskArn_ =
  DescribeTableStatistics'
    { $sel:filters:DescribeTableStatistics' :: Maybe [Filter]
filters = forall a. Maybe a
Prelude.Nothing,
      $sel:marker:DescribeTableStatistics' :: Maybe Text
marker = forall a. Maybe a
Prelude.Nothing,
      $sel:maxRecords:DescribeTableStatistics' :: Maybe Int
maxRecords = forall a. Maybe a
Prelude.Nothing,
      $sel:replicationTaskArn:DescribeTableStatistics' :: Text
replicationTaskArn = Text
pReplicationTaskArn_
    }

-- | Filters applied to table statistics.
--
-- Valid filter names: schema-name | table-name | table-state
--
-- A combination of filters creates an AND condition where each record
-- matches all specified filters.
describeTableStatistics_filters :: Lens.Lens' DescribeTableStatistics (Prelude.Maybe [Filter])
describeTableStatistics_filters :: Lens' DescribeTableStatistics (Maybe [Filter])
describeTableStatistics_filters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTableStatistics' {Maybe [Filter]
filters :: Maybe [Filter]
$sel:filters:DescribeTableStatistics' :: DescribeTableStatistics -> Maybe [Filter]
filters} -> Maybe [Filter]
filters) (\s :: DescribeTableStatistics
s@DescribeTableStatistics' {} Maybe [Filter]
a -> DescribeTableStatistics
s {$sel:filters:DescribeTableStatistics' :: Maybe [Filter]
filters = Maybe [Filter]
a} :: DescribeTableStatistics) 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

-- | An optional pagination token provided by a previous request. If this
-- parameter is specified, the response includes only records beyond the
-- marker, up to the value specified by @MaxRecords@.
describeTableStatistics_marker :: Lens.Lens' DescribeTableStatistics (Prelude.Maybe Prelude.Text)
describeTableStatistics_marker :: Lens' DescribeTableStatistics (Maybe Text)
describeTableStatistics_marker = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTableStatistics' {Maybe Text
marker :: Maybe Text
$sel:marker:DescribeTableStatistics' :: DescribeTableStatistics -> Maybe Text
marker} -> Maybe Text
marker) (\s :: DescribeTableStatistics
s@DescribeTableStatistics' {} Maybe Text
a -> DescribeTableStatistics
s {$sel:marker:DescribeTableStatistics' :: Maybe Text
marker = Maybe Text
a} :: DescribeTableStatistics)

-- | The maximum number of records to include in the response. If more
-- records exist than the specified @MaxRecords@ value, a pagination token
-- called a marker is included in the response so that the remaining
-- results can be retrieved.
--
-- Default: 100
--
-- Constraints: Minimum 20, maximum 500.
describeTableStatistics_maxRecords :: Lens.Lens' DescribeTableStatistics (Prelude.Maybe Prelude.Int)
describeTableStatistics_maxRecords :: Lens' DescribeTableStatistics (Maybe Int)
describeTableStatistics_maxRecords = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTableStatistics' {Maybe Int
maxRecords :: Maybe Int
$sel:maxRecords:DescribeTableStatistics' :: DescribeTableStatistics -> Maybe Int
maxRecords} -> Maybe Int
maxRecords) (\s :: DescribeTableStatistics
s@DescribeTableStatistics' {} Maybe Int
a -> DescribeTableStatistics
s {$sel:maxRecords:DescribeTableStatistics' :: Maybe Int
maxRecords = Maybe Int
a} :: DescribeTableStatistics)

-- | The Amazon Resource Name (ARN) of the replication task.
describeTableStatistics_replicationTaskArn :: Lens.Lens' DescribeTableStatistics Prelude.Text
describeTableStatistics_replicationTaskArn :: Lens' DescribeTableStatistics Text
describeTableStatistics_replicationTaskArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTableStatistics' {Text
replicationTaskArn :: Text
$sel:replicationTaskArn:DescribeTableStatistics' :: DescribeTableStatistics -> Text
replicationTaskArn} -> Text
replicationTaskArn) (\s :: DescribeTableStatistics
s@DescribeTableStatistics' {} Text
a -> DescribeTableStatistics
s {$sel:replicationTaskArn:DescribeTableStatistics' :: Text
replicationTaskArn = Text
a} :: DescribeTableStatistics)

instance Core.AWSPager DescribeTableStatistics where
  page :: DescribeTableStatistics
-> AWSResponse DescribeTableStatistics
-> Maybe DescribeTableStatistics
page DescribeTableStatistics
rq AWSResponse DescribeTableStatistics
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeTableStatistics
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeTableStatisticsResponse (Maybe Text)
describeTableStatisticsResponse_marker
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeTableStatistics
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeTableStatisticsResponse (Maybe [TableStatistics])
describeTableStatisticsResponse_tableStatistics
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
        forall a. a -> Maybe a
Prelude.Just
          forall a b. (a -> b) -> a -> b
Prelude.$ DescribeTableStatistics
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' DescribeTableStatistics (Maybe Text)
describeTableStatistics_marker
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeTableStatistics
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeTableStatisticsResponse (Maybe Text)
describeTableStatisticsResponse_marker
          forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest DescribeTableStatistics where
  type
    AWSResponse DescribeTableStatistics =
      DescribeTableStatisticsResponse
  request :: (Service -> Service)
-> DescribeTableStatistics -> Request DescribeTableStatistics
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DescribeTableStatistics
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeTableStatistics)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe [TableStatistics]
-> Int
-> DescribeTableStatisticsResponse
DescribeTableStatisticsResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"Marker")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"ReplicationTaskArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
                            forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"TableStatistics"
                            forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable DescribeTableStatistics where
  hashWithSalt :: Int -> DescribeTableStatistics -> Int
hashWithSalt Int
_salt DescribeTableStatistics' {Maybe Int
Maybe [Filter]
Maybe Text
Text
replicationTaskArn :: Text
maxRecords :: Maybe Int
marker :: Maybe Text
filters :: Maybe [Filter]
$sel:replicationTaskArn:DescribeTableStatistics' :: DescribeTableStatistics -> Text
$sel:maxRecords:DescribeTableStatistics' :: DescribeTableStatistics -> Maybe Int
$sel:marker:DescribeTableStatistics' :: DescribeTableStatistics -> Maybe Text
$sel:filters:DescribeTableStatistics' :: DescribeTableStatistics -> Maybe [Filter]
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Filter]
filters
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
marker
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
maxRecords
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
replicationTaskArn

instance Prelude.NFData DescribeTableStatistics where
  rnf :: DescribeTableStatistics -> ()
rnf DescribeTableStatistics' {Maybe Int
Maybe [Filter]
Maybe Text
Text
replicationTaskArn :: Text
maxRecords :: Maybe Int
marker :: Maybe Text
filters :: Maybe [Filter]
$sel:replicationTaskArn:DescribeTableStatistics' :: DescribeTableStatistics -> Text
$sel:maxRecords:DescribeTableStatistics' :: DescribeTableStatistics -> Maybe Int
$sel:marker:DescribeTableStatistics' :: DescribeTableStatistics -> Maybe Text
$sel:filters:DescribeTableStatistics' :: DescribeTableStatistics -> Maybe [Filter]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [Filter]
filters
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
marker
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
maxRecords
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
replicationTaskArn

instance Data.ToHeaders DescribeTableStatistics where
  toHeaders :: DescribeTableStatistics -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"AmazonDMSv20160101.DescribeTableStatistics" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON DescribeTableStatistics where
  toJSON :: DescribeTableStatistics -> Value
toJSON DescribeTableStatistics' {Maybe Int
Maybe [Filter]
Maybe Text
Text
replicationTaskArn :: Text
maxRecords :: Maybe Int
marker :: Maybe Text
filters :: Maybe [Filter]
$sel:replicationTaskArn:DescribeTableStatistics' :: DescribeTableStatistics -> Text
$sel:maxRecords:DescribeTableStatistics' :: DescribeTableStatistics -> Maybe Int
$sel:marker:DescribeTableStatistics' :: DescribeTableStatistics -> Maybe Text
$sel:filters:DescribeTableStatistics' :: DescribeTableStatistics -> Maybe [Filter]
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"Filters" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Filter]
filters,
            (Key
"Marker" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
marker,
            (Key
"MaxRecords" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
maxRecords,
            forall a. a -> Maybe a
Prelude.Just
              (Key
"ReplicationTaskArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
replicationTaskArn)
          ]
      )

instance Data.ToPath DescribeTableStatistics where
  toPath :: DescribeTableStatistics -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Data.ToQuery DescribeTableStatistics where
  toQuery :: DescribeTableStatistics -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

-- |
--
-- /See:/ 'newDescribeTableStatisticsResponse' smart constructor.
data DescribeTableStatisticsResponse = DescribeTableStatisticsResponse'
  { -- | An optional pagination token provided by a previous request. If this
    -- parameter is specified, the response includes only records beyond the
    -- marker, up to the value specified by @MaxRecords@.
    DescribeTableStatisticsResponse -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the replication task.
    DescribeTableStatisticsResponse -> Maybe Text
replicationTaskArn :: Prelude.Maybe Prelude.Text,
    -- | The table statistics.
    DescribeTableStatisticsResponse -> Maybe [TableStatistics]
tableStatistics :: Prelude.Maybe [TableStatistics],
    -- | The response's http status code.
    DescribeTableStatisticsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeTableStatisticsResponse
-> DescribeTableStatisticsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeTableStatisticsResponse
-> DescribeTableStatisticsResponse -> Bool
$c/= :: DescribeTableStatisticsResponse
-> DescribeTableStatisticsResponse -> Bool
== :: DescribeTableStatisticsResponse
-> DescribeTableStatisticsResponse -> Bool
$c== :: DescribeTableStatisticsResponse
-> DescribeTableStatisticsResponse -> Bool
Prelude.Eq, ReadPrec [DescribeTableStatisticsResponse]
ReadPrec DescribeTableStatisticsResponse
Int -> ReadS DescribeTableStatisticsResponse
ReadS [DescribeTableStatisticsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeTableStatisticsResponse]
$creadListPrec :: ReadPrec [DescribeTableStatisticsResponse]
readPrec :: ReadPrec DescribeTableStatisticsResponse
$creadPrec :: ReadPrec DescribeTableStatisticsResponse
readList :: ReadS [DescribeTableStatisticsResponse]
$creadList :: ReadS [DescribeTableStatisticsResponse]
readsPrec :: Int -> ReadS DescribeTableStatisticsResponse
$creadsPrec :: Int -> ReadS DescribeTableStatisticsResponse
Prelude.Read, Int -> DescribeTableStatisticsResponse -> ShowS
[DescribeTableStatisticsResponse] -> ShowS
DescribeTableStatisticsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeTableStatisticsResponse] -> ShowS
$cshowList :: [DescribeTableStatisticsResponse] -> ShowS
show :: DescribeTableStatisticsResponse -> String
$cshow :: DescribeTableStatisticsResponse -> String
showsPrec :: Int -> DescribeTableStatisticsResponse -> ShowS
$cshowsPrec :: Int -> DescribeTableStatisticsResponse -> ShowS
Prelude.Show, forall x.
Rep DescribeTableStatisticsResponse x
-> DescribeTableStatisticsResponse
forall x.
DescribeTableStatisticsResponse
-> Rep DescribeTableStatisticsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeTableStatisticsResponse x
-> DescribeTableStatisticsResponse
$cfrom :: forall x.
DescribeTableStatisticsResponse
-> Rep DescribeTableStatisticsResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeTableStatisticsResponse' 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:
--
-- 'marker', 'describeTableStatisticsResponse_marker' - An optional pagination token provided by a previous request. If this
-- parameter is specified, the response includes only records beyond the
-- marker, up to the value specified by @MaxRecords@.
--
-- 'replicationTaskArn', 'describeTableStatisticsResponse_replicationTaskArn' - The Amazon Resource Name (ARN) of the replication task.
--
-- 'tableStatistics', 'describeTableStatisticsResponse_tableStatistics' - The table statistics.
--
-- 'httpStatus', 'describeTableStatisticsResponse_httpStatus' - The response's http status code.
newDescribeTableStatisticsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeTableStatisticsResponse
newDescribeTableStatisticsResponse :: Int -> DescribeTableStatisticsResponse
newDescribeTableStatisticsResponse Int
pHttpStatus_ =
  DescribeTableStatisticsResponse'
    { $sel:marker:DescribeTableStatisticsResponse' :: Maybe Text
marker =
        forall a. Maybe a
Prelude.Nothing,
      $sel:replicationTaskArn:DescribeTableStatisticsResponse' :: Maybe Text
replicationTaskArn = forall a. Maybe a
Prelude.Nothing,
      $sel:tableStatistics:DescribeTableStatisticsResponse' :: Maybe [TableStatistics]
tableStatistics = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeTableStatisticsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | An optional pagination token provided by a previous request. If this
-- parameter is specified, the response includes only records beyond the
-- marker, up to the value specified by @MaxRecords@.
describeTableStatisticsResponse_marker :: Lens.Lens' DescribeTableStatisticsResponse (Prelude.Maybe Prelude.Text)
describeTableStatisticsResponse_marker :: Lens' DescribeTableStatisticsResponse (Maybe Text)
describeTableStatisticsResponse_marker = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTableStatisticsResponse' {Maybe Text
marker :: Maybe Text
$sel:marker:DescribeTableStatisticsResponse' :: DescribeTableStatisticsResponse -> Maybe Text
marker} -> Maybe Text
marker) (\s :: DescribeTableStatisticsResponse
s@DescribeTableStatisticsResponse' {} Maybe Text
a -> DescribeTableStatisticsResponse
s {$sel:marker:DescribeTableStatisticsResponse' :: Maybe Text
marker = Maybe Text
a} :: DescribeTableStatisticsResponse)

-- | The Amazon Resource Name (ARN) of the replication task.
describeTableStatisticsResponse_replicationTaskArn :: Lens.Lens' DescribeTableStatisticsResponse (Prelude.Maybe Prelude.Text)
describeTableStatisticsResponse_replicationTaskArn :: Lens' DescribeTableStatisticsResponse (Maybe Text)
describeTableStatisticsResponse_replicationTaskArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTableStatisticsResponse' {Maybe Text
replicationTaskArn :: Maybe Text
$sel:replicationTaskArn:DescribeTableStatisticsResponse' :: DescribeTableStatisticsResponse -> Maybe Text
replicationTaskArn} -> Maybe Text
replicationTaskArn) (\s :: DescribeTableStatisticsResponse
s@DescribeTableStatisticsResponse' {} Maybe Text
a -> DescribeTableStatisticsResponse
s {$sel:replicationTaskArn:DescribeTableStatisticsResponse' :: Maybe Text
replicationTaskArn = Maybe Text
a} :: DescribeTableStatisticsResponse)

-- | The table statistics.
describeTableStatisticsResponse_tableStatistics :: Lens.Lens' DescribeTableStatisticsResponse (Prelude.Maybe [TableStatistics])
describeTableStatisticsResponse_tableStatistics :: Lens' DescribeTableStatisticsResponse (Maybe [TableStatistics])
describeTableStatisticsResponse_tableStatistics = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTableStatisticsResponse' {Maybe [TableStatistics]
tableStatistics :: Maybe [TableStatistics]
$sel:tableStatistics:DescribeTableStatisticsResponse' :: DescribeTableStatisticsResponse -> Maybe [TableStatistics]
tableStatistics} -> Maybe [TableStatistics]
tableStatistics) (\s :: DescribeTableStatisticsResponse
s@DescribeTableStatisticsResponse' {} Maybe [TableStatistics]
a -> DescribeTableStatisticsResponse
s {$sel:tableStatistics:DescribeTableStatisticsResponse' :: Maybe [TableStatistics]
tableStatistics = Maybe [TableStatistics]
a} :: DescribeTableStatisticsResponse) 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

-- | The response's http status code.
describeTableStatisticsResponse_httpStatus :: Lens.Lens' DescribeTableStatisticsResponse Prelude.Int
describeTableStatisticsResponse_httpStatus :: Lens' DescribeTableStatisticsResponse Int
describeTableStatisticsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeTableStatisticsResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeTableStatisticsResponse' :: DescribeTableStatisticsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeTableStatisticsResponse
s@DescribeTableStatisticsResponse' {} Int
a -> DescribeTableStatisticsResponse
s {$sel:httpStatus:DescribeTableStatisticsResponse' :: Int
httpStatus = Int
a} :: DescribeTableStatisticsResponse)

instance
  Prelude.NFData
    DescribeTableStatisticsResponse
  where
  rnf :: DescribeTableStatisticsResponse -> ()
rnf DescribeTableStatisticsResponse' {Int
Maybe [TableStatistics]
Maybe Text
httpStatus :: Int
tableStatistics :: Maybe [TableStatistics]
replicationTaskArn :: Maybe Text
marker :: Maybe Text
$sel:httpStatus:DescribeTableStatisticsResponse' :: DescribeTableStatisticsResponse -> Int
$sel:tableStatistics:DescribeTableStatisticsResponse' :: DescribeTableStatisticsResponse -> Maybe [TableStatistics]
$sel:replicationTaskArn:DescribeTableStatisticsResponse' :: DescribeTableStatisticsResponse -> Maybe Text
$sel:marker:DescribeTableStatisticsResponse' :: DescribeTableStatisticsResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
marker
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
replicationTaskArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [TableStatistics]
tableStatistics
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus