{-# 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.UpdateColumnStatisticsForPartition
-- 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)
--
-- Creates or updates partition statistics of columns.
--
-- The Identity and Access Management (IAM) permission required for this
-- operation is @UpdatePartition@.
module Amazonka.Glue.UpdateColumnStatisticsForPartition
  ( -- * Creating a Request
    UpdateColumnStatisticsForPartition (..),
    newUpdateColumnStatisticsForPartition,

    -- * Request Lenses
    updateColumnStatisticsForPartition_catalogId,
    updateColumnStatisticsForPartition_databaseName,
    updateColumnStatisticsForPartition_tableName,
    updateColumnStatisticsForPartition_partitionValues,
    updateColumnStatisticsForPartition_columnStatisticsList,

    -- * Destructuring the Response
    UpdateColumnStatisticsForPartitionResponse (..),
    newUpdateColumnStatisticsForPartitionResponse,

    -- * Response Lenses
    updateColumnStatisticsForPartitionResponse_errors,
    updateColumnStatisticsForPartitionResponse_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:/ 'newUpdateColumnStatisticsForPartition' smart constructor.
data UpdateColumnStatisticsForPartition = UpdateColumnStatisticsForPartition'
  { -- | 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.
    UpdateColumnStatisticsForPartition -> Maybe Text
catalogId :: Prelude.Maybe Prelude.Text,
    -- | The name of the catalog database where the partitions reside.
    UpdateColumnStatisticsForPartition -> Text
databaseName :: Prelude.Text,
    -- | The name of the partitions\' table.
    UpdateColumnStatisticsForPartition -> Text
tableName :: Prelude.Text,
    -- | A list of partition values identifying the partition.
    UpdateColumnStatisticsForPartition -> [Text]
partitionValues :: [Prelude.Text],
    -- | A list of the column statistics.
    UpdateColumnStatisticsForPartition -> [ColumnStatistics]
columnStatisticsList :: [ColumnStatistics]
  }
  deriving (UpdateColumnStatisticsForPartition
-> UpdateColumnStatisticsForPartition -> Bool
(UpdateColumnStatisticsForPartition
 -> UpdateColumnStatisticsForPartition -> Bool)
-> (UpdateColumnStatisticsForPartition
    -> UpdateColumnStatisticsForPartition -> Bool)
-> Eq UpdateColumnStatisticsForPartition
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateColumnStatisticsForPartition
-> UpdateColumnStatisticsForPartition -> Bool
$c/= :: UpdateColumnStatisticsForPartition
-> UpdateColumnStatisticsForPartition -> Bool
== :: UpdateColumnStatisticsForPartition
-> UpdateColumnStatisticsForPartition -> Bool
$c== :: UpdateColumnStatisticsForPartition
-> UpdateColumnStatisticsForPartition -> Bool
Prelude.Eq, ReadPrec [UpdateColumnStatisticsForPartition]
ReadPrec UpdateColumnStatisticsForPartition
Int -> ReadS UpdateColumnStatisticsForPartition
ReadS [UpdateColumnStatisticsForPartition]
(Int -> ReadS UpdateColumnStatisticsForPartition)
-> ReadS [UpdateColumnStatisticsForPartition]
-> ReadPrec UpdateColumnStatisticsForPartition
-> ReadPrec [UpdateColumnStatisticsForPartition]
-> Read UpdateColumnStatisticsForPartition
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateColumnStatisticsForPartition]
$creadListPrec :: ReadPrec [UpdateColumnStatisticsForPartition]
readPrec :: ReadPrec UpdateColumnStatisticsForPartition
$creadPrec :: ReadPrec UpdateColumnStatisticsForPartition
readList :: ReadS [UpdateColumnStatisticsForPartition]
$creadList :: ReadS [UpdateColumnStatisticsForPartition]
readsPrec :: Int -> ReadS UpdateColumnStatisticsForPartition
$creadsPrec :: Int -> ReadS UpdateColumnStatisticsForPartition
Prelude.Read, Int -> UpdateColumnStatisticsForPartition -> ShowS
[UpdateColumnStatisticsForPartition] -> ShowS
UpdateColumnStatisticsForPartition -> String
(Int -> UpdateColumnStatisticsForPartition -> ShowS)
-> (UpdateColumnStatisticsForPartition -> String)
-> ([UpdateColumnStatisticsForPartition] -> ShowS)
-> Show UpdateColumnStatisticsForPartition
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateColumnStatisticsForPartition] -> ShowS
$cshowList :: [UpdateColumnStatisticsForPartition] -> ShowS
show :: UpdateColumnStatisticsForPartition -> String
$cshow :: UpdateColumnStatisticsForPartition -> String
showsPrec :: Int -> UpdateColumnStatisticsForPartition -> ShowS
$cshowsPrec :: Int -> UpdateColumnStatisticsForPartition -> ShowS
Prelude.Show, (forall x.
 UpdateColumnStatisticsForPartition
 -> Rep UpdateColumnStatisticsForPartition x)
-> (forall x.
    Rep UpdateColumnStatisticsForPartition x
    -> UpdateColumnStatisticsForPartition)
-> Generic UpdateColumnStatisticsForPartition
forall x.
Rep UpdateColumnStatisticsForPartition x
-> UpdateColumnStatisticsForPartition
forall x.
UpdateColumnStatisticsForPartition
-> Rep UpdateColumnStatisticsForPartition x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateColumnStatisticsForPartition x
-> UpdateColumnStatisticsForPartition
$cfrom :: forall x.
UpdateColumnStatisticsForPartition
-> Rep UpdateColumnStatisticsForPartition x
Prelude.Generic)

-- |
-- Create a value of 'UpdateColumnStatisticsForPartition' 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', 'updateColumnStatisticsForPartition_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', 'updateColumnStatisticsForPartition_databaseName' - The name of the catalog database where the partitions reside.
--
-- 'tableName', 'updateColumnStatisticsForPartition_tableName' - The name of the partitions\' table.
--
-- 'partitionValues', 'updateColumnStatisticsForPartition_partitionValues' - A list of partition values identifying the partition.
--
-- 'columnStatisticsList', 'updateColumnStatisticsForPartition_columnStatisticsList' - A list of the column statistics.
newUpdateColumnStatisticsForPartition ::
  -- | 'databaseName'
  Prelude.Text ->
  -- | 'tableName'
  Prelude.Text ->
  UpdateColumnStatisticsForPartition
newUpdateColumnStatisticsForPartition :: Text -> Text -> UpdateColumnStatisticsForPartition
newUpdateColumnStatisticsForPartition
  Text
pDatabaseName_
  Text
pTableName_ =
    UpdateColumnStatisticsForPartition' :: Maybe Text
-> Text
-> Text
-> [Text]
-> [ColumnStatistics]
-> UpdateColumnStatisticsForPartition
UpdateColumnStatisticsForPartition'
      { $sel:catalogId:UpdateColumnStatisticsForPartition' :: Maybe Text
catalogId =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:databaseName:UpdateColumnStatisticsForPartition' :: Text
databaseName = Text
pDatabaseName_,
        $sel:tableName:UpdateColumnStatisticsForPartition' :: Text
tableName = Text
pTableName_,
        $sel:partitionValues:UpdateColumnStatisticsForPartition' :: [Text]
partitionValues = [Text]
forall a. Monoid a => a
Prelude.mempty,
        $sel:columnStatisticsList:UpdateColumnStatisticsForPartition' :: [ColumnStatistics]
columnStatisticsList = [ColumnStatistics]
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.
updateColumnStatisticsForPartition_catalogId :: Lens.Lens' UpdateColumnStatisticsForPartition (Prelude.Maybe Prelude.Text)
updateColumnStatisticsForPartition_catalogId :: (Maybe Text -> f (Maybe Text))
-> UpdateColumnStatisticsForPartition
-> f UpdateColumnStatisticsForPartition
updateColumnStatisticsForPartition_catalogId = (UpdateColumnStatisticsForPartition -> Maybe Text)
-> (UpdateColumnStatisticsForPartition
    -> Maybe Text -> UpdateColumnStatisticsForPartition)
-> Lens
     UpdateColumnStatisticsForPartition
     UpdateColumnStatisticsForPartition
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateColumnStatisticsForPartition' {Maybe Text
catalogId :: Maybe Text
$sel:catalogId:UpdateColumnStatisticsForPartition' :: UpdateColumnStatisticsForPartition -> Maybe Text
catalogId} -> Maybe Text
catalogId) (\s :: UpdateColumnStatisticsForPartition
s@UpdateColumnStatisticsForPartition' {} Maybe Text
a -> UpdateColumnStatisticsForPartition
s {$sel:catalogId:UpdateColumnStatisticsForPartition' :: Maybe Text
catalogId = Maybe Text
a} :: UpdateColumnStatisticsForPartition)

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

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

-- | A list of partition values identifying the partition.
updateColumnStatisticsForPartition_partitionValues :: Lens.Lens' UpdateColumnStatisticsForPartition [Prelude.Text]
updateColumnStatisticsForPartition_partitionValues :: ([Text] -> f [Text])
-> UpdateColumnStatisticsForPartition
-> f UpdateColumnStatisticsForPartition
updateColumnStatisticsForPartition_partitionValues = (UpdateColumnStatisticsForPartition -> [Text])
-> (UpdateColumnStatisticsForPartition
    -> [Text] -> UpdateColumnStatisticsForPartition)
-> Lens
     UpdateColumnStatisticsForPartition
     UpdateColumnStatisticsForPartition
     [Text]
     [Text]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateColumnStatisticsForPartition' {[Text]
partitionValues :: [Text]
$sel:partitionValues:UpdateColumnStatisticsForPartition' :: UpdateColumnStatisticsForPartition -> [Text]
partitionValues} -> [Text]
partitionValues) (\s :: UpdateColumnStatisticsForPartition
s@UpdateColumnStatisticsForPartition' {} [Text]
a -> UpdateColumnStatisticsForPartition
s {$sel:partitionValues:UpdateColumnStatisticsForPartition' :: [Text]
partitionValues = [Text]
a} :: UpdateColumnStatisticsForPartition) (([Text] -> f [Text])
 -> UpdateColumnStatisticsForPartition
 -> f UpdateColumnStatisticsForPartition)
-> (([Text] -> f [Text]) -> [Text] -> f [Text])
-> ([Text] -> f [Text])
-> UpdateColumnStatisticsForPartition
-> f UpdateColumnStatisticsForPartition
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 statistics.
updateColumnStatisticsForPartition_columnStatisticsList :: Lens.Lens' UpdateColumnStatisticsForPartition [ColumnStatistics]
updateColumnStatisticsForPartition_columnStatisticsList :: ([ColumnStatistics] -> f [ColumnStatistics])
-> UpdateColumnStatisticsForPartition
-> f UpdateColumnStatisticsForPartition
updateColumnStatisticsForPartition_columnStatisticsList = (UpdateColumnStatisticsForPartition -> [ColumnStatistics])
-> (UpdateColumnStatisticsForPartition
    -> [ColumnStatistics] -> UpdateColumnStatisticsForPartition)
-> Lens
     UpdateColumnStatisticsForPartition
     UpdateColumnStatisticsForPartition
     [ColumnStatistics]
     [ColumnStatistics]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateColumnStatisticsForPartition' {[ColumnStatistics]
columnStatisticsList :: [ColumnStatistics]
$sel:columnStatisticsList:UpdateColumnStatisticsForPartition' :: UpdateColumnStatisticsForPartition -> [ColumnStatistics]
columnStatisticsList} -> [ColumnStatistics]
columnStatisticsList) (\s :: UpdateColumnStatisticsForPartition
s@UpdateColumnStatisticsForPartition' {} [ColumnStatistics]
a -> UpdateColumnStatisticsForPartition
s {$sel:columnStatisticsList:UpdateColumnStatisticsForPartition' :: [ColumnStatistics]
columnStatisticsList = [ColumnStatistics]
a} :: UpdateColumnStatisticsForPartition) (([ColumnStatistics] -> f [ColumnStatistics])
 -> UpdateColumnStatisticsForPartition
 -> f UpdateColumnStatisticsForPartition)
-> (([ColumnStatistics] -> f [ColumnStatistics])
    -> [ColumnStatistics] -> f [ColumnStatistics])
-> ([ColumnStatistics] -> f [ColumnStatistics])
-> UpdateColumnStatisticsForPartition
-> f UpdateColumnStatisticsForPartition
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([ColumnStatistics] -> f [ColumnStatistics])
-> [ColumnStatistics] -> f [ColumnStatistics]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance
  Core.AWSRequest
    UpdateColumnStatisticsForPartition
  where
  type
    AWSResponse UpdateColumnStatisticsForPartition =
      UpdateColumnStatisticsForPartitionResponse
  request :: UpdateColumnStatisticsForPartition
-> Request UpdateColumnStatisticsForPartition
request = Service
-> UpdateColumnStatisticsForPartition
-> Request UpdateColumnStatisticsForPartition
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdateColumnStatisticsForPartition
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse UpdateColumnStatisticsForPartition)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse UpdateColumnStatisticsForPartition))
-> Logger
-> Service
-> Proxy UpdateColumnStatisticsForPartition
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse UpdateColumnStatisticsForPartition)))
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 [ColumnStatisticsError]
-> Int -> UpdateColumnStatisticsForPartitionResponse
UpdateColumnStatisticsForPartitionResponse'
            (Maybe [ColumnStatisticsError]
 -> Int -> UpdateColumnStatisticsForPartitionResponse)
-> Either String (Maybe [ColumnStatisticsError])
-> Either
     String (Int -> UpdateColumnStatisticsForPartitionResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object
-> Text -> Either String (Maybe (Maybe [ColumnStatisticsError]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Errors" Either String (Maybe (Maybe [ColumnStatisticsError]))
-> Maybe [ColumnStatisticsError]
-> Either String (Maybe [ColumnStatisticsError])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [ColumnStatisticsError]
forall a. Monoid a => a
Prelude.mempty)
              Either String (Int -> UpdateColumnStatisticsForPartitionResponse)
-> Either String Int
-> Either String UpdateColumnStatisticsForPartitionResponse
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
    UpdateColumnStatisticsForPartition

instance
  Prelude.NFData
    UpdateColumnStatisticsForPartition

instance
  Core.ToHeaders
    UpdateColumnStatisticsForPartition
  where
  toHeaders :: UpdateColumnStatisticsForPartition -> ResponseHeaders
toHeaders =
    ResponseHeaders
-> UpdateColumnStatisticsForPartition -> 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.UpdateColumnStatisticsForPartition" ::
                          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
    UpdateColumnStatisticsForPartition
  where
  toJSON :: UpdateColumnStatisticsForPartition -> Value
toJSON UpdateColumnStatisticsForPartition' {[Text]
[ColumnStatistics]
Maybe Text
Text
columnStatisticsList :: [ColumnStatistics]
partitionValues :: [Text]
tableName :: Text
databaseName :: Text
catalogId :: Maybe Text
$sel:columnStatisticsList:UpdateColumnStatisticsForPartition' :: UpdateColumnStatisticsForPartition -> [ColumnStatistics]
$sel:partitionValues:UpdateColumnStatisticsForPartition' :: UpdateColumnStatisticsForPartition -> [Text]
$sel:tableName:UpdateColumnStatisticsForPartition' :: UpdateColumnStatisticsForPartition -> Text
$sel:databaseName:UpdateColumnStatisticsForPartition' :: UpdateColumnStatisticsForPartition -> Text
$sel:catalogId:UpdateColumnStatisticsForPartition' :: UpdateColumnStatisticsForPartition -> 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
"ColumnStatisticsList"
                  Text -> [ColumnStatistics] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [ColumnStatistics]
columnStatisticsList
              )
          ]
      )

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

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

-- | /See:/ 'newUpdateColumnStatisticsForPartitionResponse' smart constructor.
data UpdateColumnStatisticsForPartitionResponse = UpdateColumnStatisticsForPartitionResponse'
  { -- | Error occurred during updating column statistics data.
    UpdateColumnStatisticsForPartitionResponse
-> Maybe [ColumnStatisticsError]
errors :: Prelude.Maybe [ColumnStatisticsError],
    -- | The response's http status code.
    UpdateColumnStatisticsForPartitionResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (UpdateColumnStatisticsForPartitionResponse
-> UpdateColumnStatisticsForPartitionResponse -> Bool
(UpdateColumnStatisticsForPartitionResponse
 -> UpdateColumnStatisticsForPartitionResponse -> Bool)
-> (UpdateColumnStatisticsForPartitionResponse
    -> UpdateColumnStatisticsForPartitionResponse -> Bool)
-> Eq UpdateColumnStatisticsForPartitionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateColumnStatisticsForPartitionResponse
-> UpdateColumnStatisticsForPartitionResponse -> Bool
$c/= :: UpdateColumnStatisticsForPartitionResponse
-> UpdateColumnStatisticsForPartitionResponse -> Bool
== :: UpdateColumnStatisticsForPartitionResponse
-> UpdateColumnStatisticsForPartitionResponse -> Bool
$c== :: UpdateColumnStatisticsForPartitionResponse
-> UpdateColumnStatisticsForPartitionResponse -> Bool
Prelude.Eq, ReadPrec [UpdateColumnStatisticsForPartitionResponse]
ReadPrec UpdateColumnStatisticsForPartitionResponse
Int -> ReadS UpdateColumnStatisticsForPartitionResponse
ReadS [UpdateColumnStatisticsForPartitionResponse]
(Int -> ReadS UpdateColumnStatisticsForPartitionResponse)
-> ReadS [UpdateColumnStatisticsForPartitionResponse]
-> ReadPrec UpdateColumnStatisticsForPartitionResponse
-> ReadPrec [UpdateColumnStatisticsForPartitionResponse]
-> Read UpdateColumnStatisticsForPartitionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateColumnStatisticsForPartitionResponse]
$creadListPrec :: ReadPrec [UpdateColumnStatisticsForPartitionResponse]
readPrec :: ReadPrec UpdateColumnStatisticsForPartitionResponse
$creadPrec :: ReadPrec UpdateColumnStatisticsForPartitionResponse
readList :: ReadS [UpdateColumnStatisticsForPartitionResponse]
$creadList :: ReadS [UpdateColumnStatisticsForPartitionResponse]
readsPrec :: Int -> ReadS UpdateColumnStatisticsForPartitionResponse
$creadsPrec :: Int -> ReadS UpdateColumnStatisticsForPartitionResponse
Prelude.Read, Int -> UpdateColumnStatisticsForPartitionResponse -> ShowS
[UpdateColumnStatisticsForPartitionResponse] -> ShowS
UpdateColumnStatisticsForPartitionResponse -> String
(Int -> UpdateColumnStatisticsForPartitionResponse -> ShowS)
-> (UpdateColumnStatisticsForPartitionResponse -> String)
-> ([UpdateColumnStatisticsForPartitionResponse] -> ShowS)
-> Show UpdateColumnStatisticsForPartitionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateColumnStatisticsForPartitionResponse] -> ShowS
$cshowList :: [UpdateColumnStatisticsForPartitionResponse] -> ShowS
show :: UpdateColumnStatisticsForPartitionResponse -> String
$cshow :: UpdateColumnStatisticsForPartitionResponse -> String
showsPrec :: Int -> UpdateColumnStatisticsForPartitionResponse -> ShowS
$cshowsPrec :: Int -> UpdateColumnStatisticsForPartitionResponse -> ShowS
Prelude.Show, (forall x.
 UpdateColumnStatisticsForPartitionResponse
 -> Rep UpdateColumnStatisticsForPartitionResponse x)
-> (forall x.
    Rep UpdateColumnStatisticsForPartitionResponse x
    -> UpdateColumnStatisticsForPartitionResponse)
-> Generic UpdateColumnStatisticsForPartitionResponse
forall x.
Rep UpdateColumnStatisticsForPartitionResponse x
-> UpdateColumnStatisticsForPartitionResponse
forall x.
UpdateColumnStatisticsForPartitionResponse
-> Rep UpdateColumnStatisticsForPartitionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateColumnStatisticsForPartitionResponse x
-> UpdateColumnStatisticsForPartitionResponse
$cfrom :: forall x.
UpdateColumnStatisticsForPartitionResponse
-> Rep UpdateColumnStatisticsForPartitionResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateColumnStatisticsForPartitionResponse' 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', 'updateColumnStatisticsForPartitionResponse_errors' - Error occurred during updating column statistics data.
--
-- 'httpStatus', 'updateColumnStatisticsForPartitionResponse_httpStatus' - The response's http status code.
newUpdateColumnStatisticsForPartitionResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateColumnStatisticsForPartitionResponse
newUpdateColumnStatisticsForPartitionResponse :: Int -> UpdateColumnStatisticsForPartitionResponse
newUpdateColumnStatisticsForPartitionResponse
  Int
pHttpStatus_ =
    UpdateColumnStatisticsForPartitionResponse' :: Maybe [ColumnStatisticsError]
-> Int -> UpdateColumnStatisticsForPartitionResponse
UpdateColumnStatisticsForPartitionResponse'
      { $sel:errors:UpdateColumnStatisticsForPartitionResponse' :: Maybe [ColumnStatisticsError]
errors =
          Maybe [ColumnStatisticsError]
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:UpdateColumnStatisticsForPartitionResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

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

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

instance
  Prelude.NFData
    UpdateColumnStatisticsForPartitionResponse