{-# 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.Glue.GetColumnStatisticsForPartition
-- 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)
--
-- Retrieves partition statistics of columns.
--
-- The Identity and Access Management (IAM) permission required for this
-- operation is @GetPartition@.
module Amazonka.Glue.GetColumnStatisticsForPartition
  ( -- * Creating a Request
    GetColumnStatisticsForPartition (..),
    newGetColumnStatisticsForPartition,

    -- * Request Lenses
    getColumnStatisticsForPartition_catalogId,
    getColumnStatisticsForPartition_databaseName,
    getColumnStatisticsForPartition_tableName,
    getColumnStatisticsForPartition_partitionValues,
    getColumnStatisticsForPartition_columnNames,

    -- * Destructuring the Response
    GetColumnStatisticsForPartitionResponse (..),
    newGetColumnStatisticsForPartitionResponse,

    -- * Response Lenses
    getColumnStatisticsForPartitionResponse_errors,
    getColumnStatisticsForPartitionResponse_columnStatisticsList,
    getColumnStatisticsForPartitionResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.Glue.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newGetColumnStatisticsForPartition' smart constructor.
data GetColumnStatisticsForPartition = GetColumnStatisticsForPartition'
  { -- | The ID of the Data Catalog where the partitions in question reside. If
    -- none is supplied, the Amazon Web Services account ID is used by default.
    GetColumnStatisticsForPartition -> Maybe Text
catalogId :: Prelude.Maybe Prelude.Text,
    -- | The name of the catalog database where the partitions reside.
    GetColumnStatisticsForPartition -> Text
databaseName :: Prelude.Text,
    -- | The name of the partitions\' table.
    GetColumnStatisticsForPartition -> Text
tableName :: Prelude.Text,
    -- | A list of partition values identifying the partition.
    GetColumnStatisticsForPartition -> [Text]
partitionValues :: [Prelude.Text],
    -- | A list of the column names.
    GetColumnStatisticsForPartition -> [Text]
columnNames :: [Prelude.Text]
  }
  deriving (GetColumnStatisticsForPartition
-> GetColumnStatisticsForPartition -> Bool
(GetColumnStatisticsForPartition
 -> GetColumnStatisticsForPartition -> Bool)
-> (GetColumnStatisticsForPartition
    -> GetColumnStatisticsForPartition -> Bool)
-> Eq GetColumnStatisticsForPartition
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetColumnStatisticsForPartition
-> GetColumnStatisticsForPartition -> Bool
$c/= :: GetColumnStatisticsForPartition
-> GetColumnStatisticsForPartition -> Bool
== :: GetColumnStatisticsForPartition
-> GetColumnStatisticsForPartition -> Bool
$c== :: GetColumnStatisticsForPartition
-> GetColumnStatisticsForPartition -> Bool
Prelude.Eq, ReadPrec [GetColumnStatisticsForPartition]
ReadPrec GetColumnStatisticsForPartition
Int -> ReadS GetColumnStatisticsForPartition
ReadS [GetColumnStatisticsForPartition]
(Int -> ReadS GetColumnStatisticsForPartition)
-> ReadS [GetColumnStatisticsForPartition]
-> ReadPrec GetColumnStatisticsForPartition
-> ReadPrec [GetColumnStatisticsForPartition]
-> Read GetColumnStatisticsForPartition
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetColumnStatisticsForPartition]
$creadListPrec :: ReadPrec [GetColumnStatisticsForPartition]
readPrec :: ReadPrec GetColumnStatisticsForPartition
$creadPrec :: ReadPrec GetColumnStatisticsForPartition
readList :: ReadS [GetColumnStatisticsForPartition]
$creadList :: ReadS [GetColumnStatisticsForPartition]
readsPrec :: Int -> ReadS GetColumnStatisticsForPartition
$creadsPrec :: Int -> ReadS GetColumnStatisticsForPartition
Prelude.Read, Int -> GetColumnStatisticsForPartition -> ShowS
[GetColumnStatisticsForPartition] -> ShowS
GetColumnStatisticsForPartition -> String
(Int -> GetColumnStatisticsForPartition -> ShowS)
-> (GetColumnStatisticsForPartition -> String)
-> ([GetColumnStatisticsForPartition] -> ShowS)
-> Show GetColumnStatisticsForPartition
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetColumnStatisticsForPartition] -> ShowS
$cshowList :: [GetColumnStatisticsForPartition] -> ShowS
show :: GetColumnStatisticsForPartition -> String
$cshow :: GetColumnStatisticsForPartition -> String
showsPrec :: Int -> GetColumnStatisticsForPartition -> ShowS
$cshowsPrec :: Int -> GetColumnStatisticsForPartition -> ShowS
Prelude.Show, (forall x.
 GetColumnStatisticsForPartition
 -> Rep GetColumnStatisticsForPartition x)
-> (forall x.
    Rep GetColumnStatisticsForPartition x
    -> GetColumnStatisticsForPartition)
-> Generic GetColumnStatisticsForPartition
forall x.
Rep GetColumnStatisticsForPartition x
-> GetColumnStatisticsForPartition
forall x.
GetColumnStatisticsForPartition
-> Rep GetColumnStatisticsForPartition x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetColumnStatisticsForPartition x
-> GetColumnStatisticsForPartition
$cfrom :: forall x.
GetColumnStatisticsForPartition
-> Rep GetColumnStatisticsForPartition x
Prelude.Generic)

-- |
-- Create a value of 'GetColumnStatisticsForPartition' 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:
--
-- 'catalogId', 'getColumnStatisticsForPartition_catalogId' - The ID of the Data Catalog where the partitions in question reside. If
-- none is supplied, the Amazon Web Services account ID is used by default.
--
-- 'databaseName', 'getColumnStatisticsForPartition_databaseName' - The name of the catalog database where the partitions reside.
--
-- 'tableName', 'getColumnStatisticsForPartition_tableName' - The name of the partitions\' table.
--
-- 'partitionValues', 'getColumnStatisticsForPartition_partitionValues' - A list of partition values identifying the partition.
--
-- 'columnNames', 'getColumnStatisticsForPartition_columnNames' - A list of the column names.
newGetColumnStatisticsForPartition ::
  -- | 'databaseName'
  Prelude.Text ->
  -- | 'tableName'
  Prelude.Text ->
  GetColumnStatisticsForPartition
newGetColumnStatisticsForPartition :: Text -> Text -> GetColumnStatisticsForPartition
newGetColumnStatisticsForPartition
  Text
pDatabaseName_
  Text
pTableName_ =
    GetColumnStatisticsForPartition' :: Maybe Text
-> Text
-> Text
-> [Text]
-> [Text]
-> GetColumnStatisticsForPartition
GetColumnStatisticsForPartition'
      { $sel:catalogId:GetColumnStatisticsForPartition' :: Maybe Text
catalogId =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:databaseName:GetColumnStatisticsForPartition' :: Text
databaseName = Text
pDatabaseName_,
        $sel:tableName:GetColumnStatisticsForPartition' :: Text
tableName = Text
pTableName_,
        $sel:partitionValues:GetColumnStatisticsForPartition' :: [Text]
partitionValues = [Text]
forall a. Monoid a => a
Prelude.mempty,
        $sel:columnNames:GetColumnStatisticsForPartition' :: [Text]
columnNames = [Text]
forall a. Monoid a => a
Prelude.mempty
      }

-- | The ID of the Data Catalog where the partitions in question reside. If
-- none is supplied, the Amazon Web Services account ID is used by default.
getColumnStatisticsForPartition_catalogId :: Lens.Lens' GetColumnStatisticsForPartition (Prelude.Maybe Prelude.Text)
getColumnStatisticsForPartition_catalogId :: (Maybe Text -> f (Maybe Text))
-> GetColumnStatisticsForPartition
-> f GetColumnStatisticsForPartition
getColumnStatisticsForPartition_catalogId = (GetColumnStatisticsForPartition -> Maybe Text)
-> (GetColumnStatisticsForPartition
    -> Maybe Text -> GetColumnStatisticsForPartition)
-> Lens
     GetColumnStatisticsForPartition
     GetColumnStatisticsForPartition
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetColumnStatisticsForPartition' {Maybe Text
catalogId :: Maybe Text
$sel:catalogId:GetColumnStatisticsForPartition' :: GetColumnStatisticsForPartition -> Maybe Text
catalogId} -> Maybe Text
catalogId) (\s :: GetColumnStatisticsForPartition
s@GetColumnStatisticsForPartition' {} Maybe Text
a -> GetColumnStatisticsForPartition
s {$sel:catalogId:GetColumnStatisticsForPartition' :: Maybe Text
catalogId = Maybe Text
a} :: GetColumnStatisticsForPartition)

-- | The name of the catalog database where the partitions reside.
getColumnStatisticsForPartition_databaseName :: Lens.Lens' GetColumnStatisticsForPartition Prelude.Text
getColumnStatisticsForPartition_databaseName :: (Text -> f Text)
-> GetColumnStatisticsForPartition
-> f GetColumnStatisticsForPartition
getColumnStatisticsForPartition_databaseName = (GetColumnStatisticsForPartition -> Text)
-> (GetColumnStatisticsForPartition
    -> Text -> GetColumnStatisticsForPartition)
-> Lens
     GetColumnStatisticsForPartition
     GetColumnStatisticsForPartition
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetColumnStatisticsForPartition' {Text
databaseName :: Text
$sel:databaseName:GetColumnStatisticsForPartition' :: GetColumnStatisticsForPartition -> Text
databaseName} -> Text
databaseName) (\s :: GetColumnStatisticsForPartition
s@GetColumnStatisticsForPartition' {} Text
a -> GetColumnStatisticsForPartition
s {$sel:databaseName:GetColumnStatisticsForPartition' :: Text
databaseName = Text
a} :: GetColumnStatisticsForPartition)

-- | The name of the partitions\' table.
getColumnStatisticsForPartition_tableName :: Lens.Lens' GetColumnStatisticsForPartition Prelude.Text
getColumnStatisticsForPartition_tableName :: (Text -> f Text)
-> GetColumnStatisticsForPartition
-> f GetColumnStatisticsForPartition
getColumnStatisticsForPartition_tableName = (GetColumnStatisticsForPartition -> Text)
-> (GetColumnStatisticsForPartition
    -> Text -> GetColumnStatisticsForPartition)
-> Lens
     GetColumnStatisticsForPartition
     GetColumnStatisticsForPartition
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetColumnStatisticsForPartition' {Text
tableName :: Text
$sel:tableName:GetColumnStatisticsForPartition' :: GetColumnStatisticsForPartition -> Text
tableName} -> Text
tableName) (\s :: GetColumnStatisticsForPartition
s@GetColumnStatisticsForPartition' {} Text
a -> GetColumnStatisticsForPartition
s {$sel:tableName:GetColumnStatisticsForPartition' :: Text
tableName = Text
a} :: GetColumnStatisticsForPartition)

-- | A list of partition values identifying the partition.
getColumnStatisticsForPartition_partitionValues :: Lens.Lens' GetColumnStatisticsForPartition [Prelude.Text]
getColumnStatisticsForPartition_partitionValues :: ([Text] -> f [Text])
-> GetColumnStatisticsForPartition
-> f GetColumnStatisticsForPartition
getColumnStatisticsForPartition_partitionValues = (GetColumnStatisticsForPartition -> [Text])
-> (GetColumnStatisticsForPartition
    -> [Text] -> GetColumnStatisticsForPartition)
-> Lens
     GetColumnStatisticsForPartition
     GetColumnStatisticsForPartition
     [Text]
     [Text]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetColumnStatisticsForPartition' {[Text]
partitionValues :: [Text]
$sel:partitionValues:GetColumnStatisticsForPartition' :: GetColumnStatisticsForPartition -> [Text]
partitionValues} -> [Text]
partitionValues) (\s :: GetColumnStatisticsForPartition
s@GetColumnStatisticsForPartition' {} [Text]
a -> GetColumnStatisticsForPartition
s {$sel:partitionValues:GetColumnStatisticsForPartition' :: [Text]
partitionValues = [Text]
a} :: GetColumnStatisticsForPartition) (([Text] -> f [Text])
 -> GetColumnStatisticsForPartition
 -> f GetColumnStatisticsForPartition)
-> (([Text] -> f [Text]) -> [Text] -> f [Text])
-> ([Text] -> f [Text])
-> GetColumnStatisticsForPartition
-> f GetColumnStatisticsForPartition
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Text] -> f [Text]) -> [Text] -> f [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A list of the column names.
getColumnStatisticsForPartition_columnNames :: Lens.Lens' GetColumnStatisticsForPartition [Prelude.Text]
getColumnStatisticsForPartition_columnNames :: ([Text] -> f [Text])
-> GetColumnStatisticsForPartition
-> f GetColumnStatisticsForPartition
getColumnStatisticsForPartition_columnNames = (GetColumnStatisticsForPartition -> [Text])
-> (GetColumnStatisticsForPartition
    -> [Text] -> GetColumnStatisticsForPartition)
-> Lens
     GetColumnStatisticsForPartition
     GetColumnStatisticsForPartition
     [Text]
     [Text]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetColumnStatisticsForPartition' {[Text]
columnNames :: [Text]
$sel:columnNames:GetColumnStatisticsForPartition' :: GetColumnStatisticsForPartition -> [Text]
columnNames} -> [Text]
columnNames) (\s :: GetColumnStatisticsForPartition
s@GetColumnStatisticsForPartition' {} [Text]
a -> GetColumnStatisticsForPartition
s {$sel:columnNames:GetColumnStatisticsForPartition' :: [Text]
columnNames = [Text]
a} :: GetColumnStatisticsForPartition) (([Text] -> f [Text])
 -> GetColumnStatisticsForPartition
 -> f GetColumnStatisticsForPartition)
-> (([Text] -> f [Text]) -> [Text] -> f [Text])
-> ([Text] -> f [Text])
-> GetColumnStatisticsForPartition
-> f GetColumnStatisticsForPartition
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Text] -> f [Text]) -> [Text] -> f [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance
  Core.AWSRequest
    GetColumnStatisticsForPartition
  where
  type
    AWSResponse GetColumnStatisticsForPartition =
      GetColumnStatisticsForPartitionResponse
  request :: GetColumnStatisticsForPartition
-> Request GetColumnStatisticsForPartition
request = Service
-> GetColumnStatisticsForPartition
-> Request GetColumnStatisticsForPartition
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy GetColumnStatisticsForPartition
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse GetColumnStatisticsForPartition)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse GetColumnStatisticsForPartition))
-> Logger
-> Service
-> Proxy GetColumnStatisticsForPartition
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse GetColumnStatisticsForPartition)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe [ColumnError]
-> Maybe [ColumnStatistics]
-> Int
-> GetColumnStatisticsForPartitionResponse
GetColumnStatisticsForPartitionResponse'
            (Maybe [ColumnError]
 -> Maybe [ColumnStatistics]
 -> Int
 -> GetColumnStatisticsForPartitionResponse)
-> Either String (Maybe [ColumnError])
-> Either
     String
     (Maybe [ColumnStatistics]
      -> Int -> GetColumnStatisticsForPartitionResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (Maybe [ColumnError]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Errors" Either String (Maybe (Maybe [ColumnError]))
-> Maybe [ColumnError] -> Either String (Maybe [ColumnError])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [ColumnError]
forall a. Monoid a => a
Prelude.mempty)
            Either
  String
  (Maybe [ColumnStatistics]
   -> Int -> GetColumnStatisticsForPartitionResponse)
-> Either String (Maybe [ColumnStatistics])
-> Either String (Int -> GetColumnStatisticsForPartitionResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Either String (Maybe (Maybe [ColumnStatistics]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ColumnStatisticsList"
                            Either String (Maybe (Maybe [ColumnStatistics]))
-> Maybe [ColumnStatistics]
-> Either String (Maybe [ColumnStatistics])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [ColumnStatistics]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either String (Int -> GetColumnStatisticsForPartitionResponse)
-> Either String Int
-> Either String GetColumnStatisticsForPartitionResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance
  Prelude.Hashable
    GetColumnStatisticsForPartition

instance
  Prelude.NFData
    GetColumnStatisticsForPartition

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

instance Core.ToJSON GetColumnStatisticsForPartition where
  toJSON :: GetColumnStatisticsForPartition -> Value
toJSON GetColumnStatisticsForPartition' {[Text]
Maybe Text
Text
columnNames :: [Text]
partitionValues :: [Text]
tableName :: Text
databaseName :: Text
catalogId :: Maybe Text
$sel:columnNames:GetColumnStatisticsForPartition' :: GetColumnStatisticsForPartition -> [Text]
$sel:partitionValues:GetColumnStatisticsForPartition' :: GetColumnStatisticsForPartition -> [Text]
$sel:tableName:GetColumnStatisticsForPartition' :: GetColumnStatisticsForPartition -> Text
$sel:databaseName:GetColumnStatisticsForPartition' :: GetColumnStatisticsForPartition -> Text
$sel:catalogId:GetColumnStatisticsForPartition' :: GetColumnStatisticsForPartition -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"CatalogId" 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
catalogId,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"DatabaseName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
databaseName),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"TableName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
tableName),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"PartitionValues" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [Text]
partitionValues),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ColumnNames" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [Text]
columnNames)
          ]
      )

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

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

-- | /See:/ 'newGetColumnStatisticsForPartitionResponse' smart constructor.
data GetColumnStatisticsForPartitionResponse = GetColumnStatisticsForPartitionResponse'
  { -- | Error occurred during retrieving column statistics data.
    GetColumnStatisticsForPartitionResponse -> Maybe [ColumnError]
errors :: Prelude.Maybe [ColumnError],
    -- | List of ColumnStatistics that failed to be retrieved.
    GetColumnStatisticsForPartitionResponse -> Maybe [ColumnStatistics]
columnStatisticsList :: Prelude.Maybe [ColumnStatistics],
    -- | The response's http status code.
    GetColumnStatisticsForPartitionResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetColumnStatisticsForPartitionResponse
-> GetColumnStatisticsForPartitionResponse -> Bool
(GetColumnStatisticsForPartitionResponse
 -> GetColumnStatisticsForPartitionResponse -> Bool)
-> (GetColumnStatisticsForPartitionResponse
    -> GetColumnStatisticsForPartitionResponse -> Bool)
-> Eq GetColumnStatisticsForPartitionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetColumnStatisticsForPartitionResponse
-> GetColumnStatisticsForPartitionResponse -> Bool
$c/= :: GetColumnStatisticsForPartitionResponse
-> GetColumnStatisticsForPartitionResponse -> Bool
== :: GetColumnStatisticsForPartitionResponse
-> GetColumnStatisticsForPartitionResponse -> Bool
$c== :: GetColumnStatisticsForPartitionResponse
-> GetColumnStatisticsForPartitionResponse -> Bool
Prelude.Eq, ReadPrec [GetColumnStatisticsForPartitionResponse]
ReadPrec GetColumnStatisticsForPartitionResponse
Int -> ReadS GetColumnStatisticsForPartitionResponse
ReadS [GetColumnStatisticsForPartitionResponse]
(Int -> ReadS GetColumnStatisticsForPartitionResponse)
-> ReadS [GetColumnStatisticsForPartitionResponse]
-> ReadPrec GetColumnStatisticsForPartitionResponse
-> ReadPrec [GetColumnStatisticsForPartitionResponse]
-> Read GetColumnStatisticsForPartitionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetColumnStatisticsForPartitionResponse]
$creadListPrec :: ReadPrec [GetColumnStatisticsForPartitionResponse]
readPrec :: ReadPrec GetColumnStatisticsForPartitionResponse
$creadPrec :: ReadPrec GetColumnStatisticsForPartitionResponse
readList :: ReadS [GetColumnStatisticsForPartitionResponse]
$creadList :: ReadS [GetColumnStatisticsForPartitionResponse]
readsPrec :: Int -> ReadS GetColumnStatisticsForPartitionResponse
$creadsPrec :: Int -> ReadS GetColumnStatisticsForPartitionResponse
Prelude.Read, Int -> GetColumnStatisticsForPartitionResponse -> ShowS
[GetColumnStatisticsForPartitionResponse] -> ShowS
GetColumnStatisticsForPartitionResponse -> String
(Int -> GetColumnStatisticsForPartitionResponse -> ShowS)
-> (GetColumnStatisticsForPartitionResponse -> String)
-> ([GetColumnStatisticsForPartitionResponse] -> ShowS)
-> Show GetColumnStatisticsForPartitionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetColumnStatisticsForPartitionResponse] -> ShowS
$cshowList :: [GetColumnStatisticsForPartitionResponse] -> ShowS
show :: GetColumnStatisticsForPartitionResponse -> String
$cshow :: GetColumnStatisticsForPartitionResponse -> String
showsPrec :: Int -> GetColumnStatisticsForPartitionResponse -> ShowS
$cshowsPrec :: Int -> GetColumnStatisticsForPartitionResponse -> ShowS
Prelude.Show, (forall x.
 GetColumnStatisticsForPartitionResponse
 -> Rep GetColumnStatisticsForPartitionResponse x)
-> (forall x.
    Rep GetColumnStatisticsForPartitionResponse x
    -> GetColumnStatisticsForPartitionResponse)
-> Generic GetColumnStatisticsForPartitionResponse
forall x.
Rep GetColumnStatisticsForPartitionResponse x
-> GetColumnStatisticsForPartitionResponse
forall x.
GetColumnStatisticsForPartitionResponse
-> Rep GetColumnStatisticsForPartitionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetColumnStatisticsForPartitionResponse x
-> GetColumnStatisticsForPartitionResponse
$cfrom :: forall x.
GetColumnStatisticsForPartitionResponse
-> Rep GetColumnStatisticsForPartitionResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetColumnStatisticsForPartitionResponse' 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:
--
-- 'errors', 'getColumnStatisticsForPartitionResponse_errors' - Error occurred during retrieving column statistics data.
--
-- 'columnStatisticsList', 'getColumnStatisticsForPartitionResponse_columnStatisticsList' - List of ColumnStatistics that failed to be retrieved.
--
-- 'httpStatus', 'getColumnStatisticsForPartitionResponse_httpStatus' - The response's http status code.
newGetColumnStatisticsForPartitionResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetColumnStatisticsForPartitionResponse
newGetColumnStatisticsForPartitionResponse :: Int -> GetColumnStatisticsForPartitionResponse
newGetColumnStatisticsForPartitionResponse
  Int
pHttpStatus_ =
    GetColumnStatisticsForPartitionResponse' :: Maybe [ColumnError]
-> Maybe [ColumnStatistics]
-> Int
-> GetColumnStatisticsForPartitionResponse
GetColumnStatisticsForPartitionResponse'
      { $sel:errors:GetColumnStatisticsForPartitionResponse' :: Maybe [ColumnError]
errors =
          Maybe [ColumnError]
forall a. Maybe a
Prelude.Nothing,
        $sel:columnStatisticsList:GetColumnStatisticsForPartitionResponse' :: Maybe [ColumnStatistics]
columnStatisticsList =
          Maybe [ColumnStatistics]
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:GetColumnStatisticsForPartitionResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | Error occurred during retrieving column statistics data.
getColumnStatisticsForPartitionResponse_errors :: Lens.Lens' GetColumnStatisticsForPartitionResponse (Prelude.Maybe [ColumnError])
getColumnStatisticsForPartitionResponse_errors :: (Maybe [ColumnError] -> f (Maybe [ColumnError]))
-> GetColumnStatisticsForPartitionResponse
-> f GetColumnStatisticsForPartitionResponse
getColumnStatisticsForPartitionResponse_errors = (GetColumnStatisticsForPartitionResponse -> Maybe [ColumnError])
-> (GetColumnStatisticsForPartitionResponse
    -> Maybe [ColumnError] -> GetColumnStatisticsForPartitionResponse)
-> Lens
     GetColumnStatisticsForPartitionResponse
     GetColumnStatisticsForPartitionResponse
     (Maybe [ColumnError])
     (Maybe [ColumnError])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetColumnStatisticsForPartitionResponse' {Maybe [ColumnError]
errors :: Maybe [ColumnError]
$sel:errors:GetColumnStatisticsForPartitionResponse' :: GetColumnStatisticsForPartitionResponse -> Maybe [ColumnError]
errors} -> Maybe [ColumnError]
errors) (\s :: GetColumnStatisticsForPartitionResponse
s@GetColumnStatisticsForPartitionResponse' {} Maybe [ColumnError]
a -> GetColumnStatisticsForPartitionResponse
s {$sel:errors:GetColumnStatisticsForPartitionResponse' :: Maybe [ColumnError]
errors = Maybe [ColumnError]
a} :: GetColumnStatisticsForPartitionResponse) ((Maybe [ColumnError] -> f (Maybe [ColumnError]))
 -> GetColumnStatisticsForPartitionResponse
 -> f GetColumnStatisticsForPartitionResponse)
-> ((Maybe [ColumnError] -> f (Maybe [ColumnError]))
    -> Maybe [ColumnError] -> f (Maybe [ColumnError]))
-> (Maybe [ColumnError] -> f (Maybe [ColumnError]))
-> GetColumnStatisticsForPartitionResponse
-> f GetColumnStatisticsForPartitionResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [ColumnError] [ColumnError] [ColumnError] [ColumnError]
-> Iso
     (Maybe [ColumnError])
     (Maybe [ColumnError])
     (Maybe [ColumnError])
     (Maybe [ColumnError])
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 [ColumnError] [ColumnError] [ColumnError] [ColumnError]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | List of ColumnStatistics that failed to be retrieved.
getColumnStatisticsForPartitionResponse_columnStatisticsList :: Lens.Lens' GetColumnStatisticsForPartitionResponse (Prelude.Maybe [ColumnStatistics])
getColumnStatisticsForPartitionResponse_columnStatisticsList :: (Maybe [ColumnStatistics] -> f (Maybe [ColumnStatistics]))
-> GetColumnStatisticsForPartitionResponse
-> f GetColumnStatisticsForPartitionResponse
getColumnStatisticsForPartitionResponse_columnStatisticsList = (GetColumnStatisticsForPartitionResponse
 -> Maybe [ColumnStatistics])
-> (GetColumnStatisticsForPartitionResponse
    -> Maybe [ColumnStatistics]
    -> GetColumnStatisticsForPartitionResponse)
-> Lens
     GetColumnStatisticsForPartitionResponse
     GetColumnStatisticsForPartitionResponse
     (Maybe [ColumnStatistics])
     (Maybe [ColumnStatistics])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetColumnStatisticsForPartitionResponse' {Maybe [ColumnStatistics]
columnStatisticsList :: Maybe [ColumnStatistics]
$sel:columnStatisticsList:GetColumnStatisticsForPartitionResponse' :: GetColumnStatisticsForPartitionResponse -> Maybe [ColumnStatistics]
columnStatisticsList} -> Maybe [ColumnStatistics]
columnStatisticsList) (\s :: GetColumnStatisticsForPartitionResponse
s@GetColumnStatisticsForPartitionResponse' {} Maybe [ColumnStatistics]
a -> GetColumnStatisticsForPartitionResponse
s {$sel:columnStatisticsList:GetColumnStatisticsForPartitionResponse' :: Maybe [ColumnStatistics]
columnStatisticsList = Maybe [ColumnStatistics]
a} :: GetColumnStatisticsForPartitionResponse) ((Maybe [ColumnStatistics] -> f (Maybe [ColumnStatistics]))
 -> GetColumnStatisticsForPartitionResponse
 -> f GetColumnStatisticsForPartitionResponse)
-> ((Maybe [ColumnStatistics] -> f (Maybe [ColumnStatistics]))
    -> Maybe [ColumnStatistics] -> f (Maybe [ColumnStatistics]))
-> (Maybe [ColumnStatistics] -> f (Maybe [ColumnStatistics]))
-> GetColumnStatisticsForPartitionResponse
-> f GetColumnStatisticsForPartitionResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ColumnStatistics]
  [ColumnStatistics]
  [ColumnStatistics]
  [ColumnStatistics]
-> Iso
     (Maybe [ColumnStatistics])
     (Maybe [ColumnStatistics])
     (Maybe [ColumnStatistics])
     (Maybe [ColumnStatistics])
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
  [ColumnStatistics]
  [ColumnStatistics]
  [ColumnStatistics]
  [ColumnStatistics]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance
  Prelude.NFData
    GetColumnStatisticsForPartitionResponse