{-# 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.Translate.UpdateParallelData
-- 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)
--
-- Updates a previously created parallel data resource by importing a new
-- input file from Amazon S3.
module Amazonka.Translate.UpdateParallelData
  ( -- * Creating a Request
    UpdateParallelData (..),
    newUpdateParallelData,

    -- * Request Lenses
    updateParallelData_description,
    updateParallelData_name,
    updateParallelData_parallelDataConfig,
    updateParallelData_clientToken,

    -- * Destructuring the Response
    UpdateParallelDataResponse (..),
    newUpdateParallelDataResponse,

    -- * Response Lenses
    updateParallelDataResponse_status,
    updateParallelDataResponse_name,
    updateParallelDataResponse_latestUpdateAttemptAt,
    updateParallelDataResponse_latestUpdateAttemptStatus,
    updateParallelDataResponse_httpStatus,
  )
where

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

-- | /See:/ 'newUpdateParallelData' smart constructor.
data UpdateParallelData = UpdateParallelData'
  { -- | A custom description for the parallel data resource in Amazon Translate.
    UpdateParallelData -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The name of the parallel data resource being updated.
    UpdateParallelData -> Text
name :: Prelude.Text,
    -- | Specifies the format and S3 location of the parallel data input file.
    UpdateParallelData -> ParallelDataConfig
parallelDataConfig :: ParallelDataConfig,
    -- | A unique identifier for the request. This token is automatically
    -- generated when you use Amazon Translate through an AWS SDK.
    UpdateParallelData -> Text
clientToken :: Prelude.Text
  }
  deriving (UpdateParallelData -> UpdateParallelData -> Bool
(UpdateParallelData -> UpdateParallelData -> Bool)
-> (UpdateParallelData -> UpdateParallelData -> Bool)
-> Eq UpdateParallelData
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateParallelData -> UpdateParallelData -> Bool
$c/= :: UpdateParallelData -> UpdateParallelData -> Bool
== :: UpdateParallelData -> UpdateParallelData -> Bool
$c== :: UpdateParallelData -> UpdateParallelData -> Bool
Prelude.Eq, ReadPrec [UpdateParallelData]
ReadPrec UpdateParallelData
Int -> ReadS UpdateParallelData
ReadS [UpdateParallelData]
(Int -> ReadS UpdateParallelData)
-> ReadS [UpdateParallelData]
-> ReadPrec UpdateParallelData
-> ReadPrec [UpdateParallelData]
-> Read UpdateParallelData
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateParallelData]
$creadListPrec :: ReadPrec [UpdateParallelData]
readPrec :: ReadPrec UpdateParallelData
$creadPrec :: ReadPrec UpdateParallelData
readList :: ReadS [UpdateParallelData]
$creadList :: ReadS [UpdateParallelData]
readsPrec :: Int -> ReadS UpdateParallelData
$creadsPrec :: Int -> ReadS UpdateParallelData
Prelude.Read, Int -> UpdateParallelData -> ShowS
[UpdateParallelData] -> ShowS
UpdateParallelData -> String
(Int -> UpdateParallelData -> ShowS)
-> (UpdateParallelData -> String)
-> ([UpdateParallelData] -> ShowS)
-> Show UpdateParallelData
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateParallelData] -> ShowS
$cshowList :: [UpdateParallelData] -> ShowS
show :: UpdateParallelData -> String
$cshow :: UpdateParallelData -> String
showsPrec :: Int -> UpdateParallelData -> ShowS
$cshowsPrec :: Int -> UpdateParallelData -> ShowS
Prelude.Show, (forall x. UpdateParallelData -> Rep UpdateParallelData x)
-> (forall x. Rep UpdateParallelData x -> UpdateParallelData)
-> Generic UpdateParallelData
forall x. Rep UpdateParallelData x -> UpdateParallelData
forall x. UpdateParallelData -> Rep UpdateParallelData x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateParallelData x -> UpdateParallelData
$cfrom :: forall x. UpdateParallelData -> Rep UpdateParallelData x
Prelude.Generic)

-- |
-- Create a value of 'UpdateParallelData' 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:
--
-- 'description', 'updateParallelData_description' - A custom description for the parallel data resource in Amazon Translate.
--
-- 'name', 'updateParallelData_name' - The name of the parallel data resource being updated.
--
-- 'parallelDataConfig', 'updateParallelData_parallelDataConfig' - Specifies the format and S3 location of the parallel data input file.
--
-- 'clientToken', 'updateParallelData_clientToken' - A unique identifier for the request. This token is automatically
-- generated when you use Amazon Translate through an AWS SDK.
newUpdateParallelData ::
  -- | 'name'
  Prelude.Text ->
  -- | 'parallelDataConfig'
  ParallelDataConfig ->
  -- | 'clientToken'
  Prelude.Text ->
  UpdateParallelData
newUpdateParallelData :: Text -> ParallelDataConfig -> Text -> UpdateParallelData
newUpdateParallelData
  Text
pName_
  ParallelDataConfig
pParallelDataConfig_
  Text
pClientToken_ =
    UpdateParallelData' :: Maybe Text
-> Text -> ParallelDataConfig -> Text -> UpdateParallelData
UpdateParallelData'
      { $sel:description:UpdateParallelData' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:name:UpdateParallelData' :: Text
name = Text
pName_,
        $sel:parallelDataConfig:UpdateParallelData' :: ParallelDataConfig
parallelDataConfig = ParallelDataConfig
pParallelDataConfig_,
        $sel:clientToken:UpdateParallelData' :: Text
clientToken = Text
pClientToken_
      }

-- | A custom description for the parallel data resource in Amazon Translate.
updateParallelData_description :: Lens.Lens' UpdateParallelData (Prelude.Maybe Prelude.Text)
updateParallelData_description :: (Maybe Text -> f (Maybe Text))
-> UpdateParallelData -> f UpdateParallelData
updateParallelData_description = (UpdateParallelData -> Maybe Text)
-> (UpdateParallelData -> Maybe Text -> UpdateParallelData)
-> Lens
     UpdateParallelData UpdateParallelData (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateParallelData' {Maybe Text
description :: Maybe Text
$sel:description:UpdateParallelData' :: UpdateParallelData -> Maybe Text
description} -> Maybe Text
description) (\s :: UpdateParallelData
s@UpdateParallelData' {} Maybe Text
a -> UpdateParallelData
s {$sel:description:UpdateParallelData' :: Maybe Text
description = Maybe Text
a} :: UpdateParallelData)

-- | The name of the parallel data resource being updated.
updateParallelData_name :: Lens.Lens' UpdateParallelData Prelude.Text
updateParallelData_name :: (Text -> f Text) -> UpdateParallelData -> f UpdateParallelData
updateParallelData_name = (UpdateParallelData -> Text)
-> (UpdateParallelData -> Text -> UpdateParallelData)
-> Lens UpdateParallelData UpdateParallelData Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateParallelData' {Text
name :: Text
$sel:name:UpdateParallelData' :: UpdateParallelData -> Text
name} -> Text
name) (\s :: UpdateParallelData
s@UpdateParallelData' {} Text
a -> UpdateParallelData
s {$sel:name:UpdateParallelData' :: Text
name = Text
a} :: UpdateParallelData)

-- | Specifies the format and S3 location of the parallel data input file.
updateParallelData_parallelDataConfig :: Lens.Lens' UpdateParallelData ParallelDataConfig
updateParallelData_parallelDataConfig :: (ParallelDataConfig -> f ParallelDataConfig)
-> UpdateParallelData -> f UpdateParallelData
updateParallelData_parallelDataConfig = (UpdateParallelData -> ParallelDataConfig)
-> (UpdateParallelData -> ParallelDataConfig -> UpdateParallelData)
-> Lens
     UpdateParallelData
     UpdateParallelData
     ParallelDataConfig
     ParallelDataConfig
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateParallelData' {ParallelDataConfig
parallelDataConfig :: ParallelDataConfig
$sel:parallelDataConfig:UpdateParallelData' :: UpdateParallelData -> ParallelDataConfig
parallelDataConfig} -> ParallelDataConfig
parallelDataConfig) (\s :: UpdateParallelData
s@UpdateParallelData' {} ParallelDataConfig
a -> UpdateParallelData
s {$sel:parallelDataConfig:UpdateParallelData' :: ParallelDataConfig
parallelDataConfig = ParallelDataConfig
a} :: UpdateParallelData)

-- | A unique identifier for the request. This token is automatically
-- generated when you use Amazon Translate through an AWS SDK.
updateParallelData_clientToken :: Lens.Lens' UpdateParallelData Prelude.Text
updateParallelData_clientToken :: (Text -> f Text) -> UpdateParallelData -> f UpdateParallelData
updateParallelData_clientToken = (UpdateParallelData -> Text)
-> (UpdateParallelData -> Text -> UpdateParallelData)
-> Lens UpdateParallelData UpdateParallelData Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateParallelData' {Text
clientToken :: Text
$sel:clientToken:UpdateParallelData' :: UpdateParallelData -> Text
clientToken} -> Text
clientToken) (\s :: UpdateParallelData
s@UpdateParallelData' {} Text
a -> UpdateParallelData
s {$sel:clientToken:UpdateParallelData' :: Text
clientToken = Text
a} :: UpdateParallelData)

instance Core.AWSRequest UpdateParallelData where
  type
    AWSResponse UpdateParallelData =
      UpdateParallelDataResponse
  request :: UpdateParallelData -> Request UpdateParallelData
request = Service -> UpdateParallelData -> Request UpdateParallelData
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdateParallelData
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateParallelData)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse UpdateParallelData))
-> Logger
-> Service
-> Proxy UpdateParallelData
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateParallelData)))
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 ParallelDataStatus
-> Maybe Text
-> Maybe POSIX
-> Maybe ParallelDataStatus
-> Int
-> UpdateParallelDataResponse
UpdateParallelDataResponse'
            (Maybe ParallelDataStatus
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe ParallelDataStatus
 -> Int
 -> UpdateParallelDataResponse)
-> Either String (Maybe ParallelDataStatus)
-> Either
     String
     (Maybe Text
      -> Maybe POSIX
      -> Maybe ParallelDataStatus
      -> Int
      -> UpdateParallelDataResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe ParallelDataStatus)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Status")
            Either
  String
  (Maybe Text
   -> Maybe POSIX
   -> Maybe ParallelDataStatus
   -> Int
   -> UpdateParallelDataResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe POSIX
      -> Maybe ParallelDataStatus -> Int -> UpdateParallelDataResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Name")
            Either
  String
  (Maybe POSIX
   -> Maybe ParallelDataStatus -> Int -> UpdateParallelDataResponse)
-> Either String (Maybe POSIX)
-> Either
     String
     (Maybe ParallelDataStatus -> Int -> UpdateParallelDataResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"LatestUpdateAttemptAt")
            Either
  String
  (Maybe ParallelDataStatus -> Int -> UpdateParallelDataResponse)
-> Either String (Maybe ParallelDataStatus)
-> Either String (Int -> UpdateParallelDataResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe ParallelDataStatus)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"LatestUpdateAttemptStatus")
            Either String (Int -> UpdateParallelDataResponse)
-> Either String Int -> Either String UpdateParallelDataResponse
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 UpdateParallelData

instance Prelude.NFData UpdateParallelData

instance Core.ToHeaders UpdateParallelData where
  toHeaders :: UpdateParallelData -> ResponseHeaders
toHeaders =
    ResponseHeaders -> UpdateParallelData -> 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
"AWSShineFrontendService_20170701.UpdateParallelData" ::
                          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 UpdateParallelData where
  toJSON :: UpdateParallelData -> Value
toJSON UpdateParallelData' {Maybe Text
Text
ParallelDataConfig
clientToken :: Text
parallelDataConfig :: ParallelDataConfig
name :: Text
description :: Maybe Text
$sel:clientToken:UpdateParallelData' :: UpdateParallelData -> Text
$sel:parallelDataConfig:UpdateParallelData' :: UpdateParallelData -> ParallelDataConfig
$sel:name:UpdateParallelData' :: UpdateParallelData -> Text
$sel:description:UpdateParallelData' :: UpdateParallelData -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"Description" 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
description,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"ParallelDataConfig" Text -> ParallelDataConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ParallelDataConfig
parallelDataConfig),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ClientToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
clientToken)
          ]
      )

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

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

-- | /See:/ 'newUpdateParallelDataResponse' smart constructor.
data UpdateParallelDataResponse = UpdateParallelDataResponse'
  { -- | The status of the parallel data resource that you are attempting to
    -- update. Your update request is accepted only if this status is either
    -- @ACTIVE@ or @FAILED@.
    UpdateParallelDataResponse -> Maybe ParallelDataStatus
status :: Prelude.Maybe ParallelDataStatus,
    -- | The name of the parallel data resource being updated.
    UpdateParallelDataResponse -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The time that the most recent update was attempted.
    UpdateParallelDataResponse -> Maybe POSIX
latestUpdateAttemptAt :: Prelude.Maybe Core.POSIX,
    -- | The status of the parallel data update attempt. When the updated
    -- parallel data resource is ready for you to use, the status is @ACTIVE@.
    UpdateParallelDataResponse -> Maybe ParallelDataStatus
latestUpdateAttemptStatus :: Prelude.Maybe ParallelDataStatus,
    -- | The response's http status code.
    UpdateParallelDataResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (UpdateParallelDataResponse -> UpdateParallelDataResponse -> Bool
(UpdateParallelDataResponse -> UpdateParallelDataResponse -> Bool)
-> (UpdateParallelDataResponse
    -> UpdateParallelDataResponse -> Bool)
-> Eq UpdateParallelDataResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateParallelDataResponse -> UpdateParallelDataResponse -> Bool
$c/= :: UpdateParallelDataResponse -> UpdateParallelDataResponse -> Bool
== :: UpdateParallelDataResponse -> UpdateParallelDataResponse -> Bool
$c== :: UpdateParallelDataResponse -> UpdateParallelDataResponse -> Bool
Prelude.Eq, ReadPrec [UpdateParallelDataResponse]
ReadPrec UpdateParallelDataResponse
Int -> ReadS UpdateParallelDataResponse
ReadS [UpdateParallelDataResponse]
(Int -> ReadS UpdateParallelDataResponse)
-> ReadS [UpdateParallelDataResponse]
-> ReadPrec UpdateParallelDataResponse
-> ReadPrec [UpdateParallelDataResponse]
-> Read UpdateParallelDataResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateParallelDataResponse]
$creadListPrec :: ReadPrec [UpdateParallelDataResponse]
readPrec :: ReadPrec UpdateParallelDataResponse
$creadPrec :: ReadPrec UpdateParallelDataResponse
readList :: ReadS [UpdateParallelDataResponse]
$creadList :: ReadS [UpdateParallelDataResponse]
readsPrec :: Int -> ReadS UpdateParallelDataResponse
$creadsPrec :: Int -> ReadS UpdateParallelDataResponse
Prelude.Read, Int -> UpdateParallelDataResponse -> ShowS
[UpdateParallelDataResponse] -> ShowS
UpdateParallelDataResponse -> String
(Int -> UpdateParallelDataResponse -> ShowS)
-> (UpdateParallelDataResponse -> String)
-> ([UpdateParallelDataResponse] -> ShowS)
-> Show UpdateParallelDataResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateParallelDataResponse] -> ShowS
$cshowList :: [UpdateParallelDataResponse] -> ShowS
show :: UpdateParallelDataResponse -> String
$cshow :: UpdateParallelDataResponse -> String
showsPrec :: Int -> UpdateParallelDataResponse -> ShowS
$cshowsPrec :: Int -> UpdateParallelDataResponse -> ShowS
Prelude.Show, (forall x.
 UpdateParallelDataResponse -> Rep UpdateParallelDataResponse x)
-> (forall x.
    Rep UpdateParallelDataResponse x -> UpdateParallelDataResponse)
-> Generic UpdateParallelDataResponse
forall x.
Rep UpdateParallelDataResponse x -> UpdateParallelDataResponse
forall x.
UpdateParallelDataResponse -> Rep UpdateParallelDataResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateParallelDataResponse x -> UpdateParallelDataResponse
$cfrom :: forall x.
UpdateParallelDataResponse -> Rep UpdateParallelDataResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateParallelDataResponse' 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:
--
-- 'status', 'updateParallelDataResponse_status' - The status of the parallel data resource that you are attempting to
-- update. Your update request is accepted only if this status is either
-- @ACTIVE@ or @FAILED@.
--
-- 'name', 'updateParallelDataResponse_name' - The name of the parallel data resource being updated.
--
-- 'latestUpdateAttemptAt', 'updateParallelDataResponse_latestUpdateAttemptAt' - The time that the most recent update was attempted.
--
-- 'latestUpdateAttemptStatus', 'updateParallelDataResponse_latestUpdateAttemptStatus' - The status of the parallel data update attempt. When the updated
-- parallel data resource is ready for you to use, the status is @ACTIVE@.
--
-- 'httpStatus', 'updateParallelDataResponse_httpStatus' - The response's http status code.
newUpdateParallelDataResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateParallelDataResponse
newUpdateParallelDataResponse :: Int -> UpdateParallelDataResponse
newUpdateParallelDataResponse Int
pHttpStatus_ =
  UpdateParallelDataResponse' :: Maybe ParallelDataStatus
-> Maybe Text
-> Maybe POSIX
-> Maybe ParallelDataStatus
-> Int
-> UpdateParallelDataResponse
UpdateParallelDataResponse'
    { $sel:status:UpdateParallelDataResponse' :: Maybe ParallelDataStatus
status =
        Maybe ParallelDataStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:name:UpdateParallelDataResponse' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:latestUpdateAttemptAt:UpdateParallelDataResponse' :: Maybe POSIX
latestUpdateAttemptAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:latestUpdateAttemptStatus:UpdateParallelDataResponse' :: Maybe ParallelDataStatus
latestUpdateAttemptStatus = Maybe ParallelDataStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:UpdateParallelDataResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The status of the parallel data resource that you are attempting to
-- update. Your update request is accepted only if this status is either
-- @ACTIVE@ or @FAILED@.
updateParallelDataResponse_status :: Lens.Lens' UpdateParallelDataResponse (Prelude.Maybe ParallelDataStatus)
updateParallelDataResponse_status :: (Maybe ParallelDataStatus -> f (Maybe ParallelDataStatus))
-> UpdateParallelDataResponse -> f UpdateParallelDataResponse
updateParallelDataResponse_status = (UpdateParallelDataResponse -> Maybe ParallelDataStatus)
-> (UpdateParallelDataResponse
    -> Maybe ParallelDataStatus -> UpdateParallelDataResponse)
-> Lens
     UpdateParallelDataResponse
     UpdateParallelDataResponse
     (Maybe ParallelDataStatus)
     (Maybe ParallelDataStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateParallelDataResponse' {Maybe ParallelDataStatus
status :: Maybe ParallelDataStatus
$sel:status:UpdateParallelDataResponse' :: UpdateParallelDataResponse -> Maybe ParallelDataStatus
status} -> Maybe ParallelDataStatus
status) (\s :: UpdateParallelDataResponse
s@UpdateParallelDataResponse' {} Maybe ParallelDataStatus
a -> UpdateParallelDataResponse
s {$sel:status:UpdateParallelDataResponse' :: Maybe ParallelDataStatus
status = Maybe ParallelDataStatus
a} :: UpdateParallelDataResponse)

-- | The name of the parallel data resource being updated.
updateParallelDataResponse_name :: Lens.Lens' UpdateParallelDataResponse (Prelude.Maybe Prelude.Text)
updateParallelDataResponse_name :: (Maybe Text -> f (Maybe Text))
-> UpdateParallelDataResponse -> f UpdateParallelDataResponse
updateParallelDataResponse_name = (UpdateParallelDataResponse -> Maybe Text)
-> (UpdateParallelDataResponse
    -> Maybe Text -> UpdateParallelDataResponse)
-> Lens
     UpdateParallelDataResponse
     UpdateParallelDataResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateParallelDataResponse' {Maybe Text
name :: Maybe Text
$sel:name:UpdateParallelDataResponse' :: UpdateParallelDataResponse -> Maybe Text
name} -> Maybe Text
name) (\s :: UpdateParallelDataResponse
s@UpdateParallelDataResponse' {} Maybe Text
a -> UpdateParallelDataResponse
s {$sel:name:UpdateParallelDataResponse' :: Maybe Text
name = Maybe Text
a} :: UpdateParallelDataResponse)

-- | The time that the most recent update was attempted.
updateParallelDataResponse_latestUpdateAttemptAt :: Lens.Lens' UpdateParallelDataResponse (Prelude.Maybe Prelude.UTCTime)
updateParallelDataResponse_latestUpdateAttemptAt :: (Maybe UTCTime -> f (Maybe UTCTime))
-> UpdateParallelDataResponse -> f UpdateParallelDataResponse
updateParallelDataResponse_latestUpdateAttemptAt = (UpdateParallelDataResponse -> Maybe POSIX)
-> (UpdateParallelDataResponse
    -> Maybe POSIX -> UpdateParallelDataResponse)
-> Lens
     UpdateParallelDataResponse
     UpdateParallelDataResponse
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateParallelDataResponse' {Maybe POSIX
latestUpdateAttemptAt :: Maybe POSIX
$sel:latestUpdateAttemptAt:UpdateParallelDataResponse' :: UpdateParallelDataResponse -> Maybe POSIX
latestUpdateAttemptAt} -> Maybe POSIX
latestUpdateAttemptAt) (\s :: UpdateParallelDataResponse
s@UpdateParallelDataResponse' {} Maybe POSIX
a -> UpdateParallelDataResponse
s {$sel:latestUpdateAttemptAt:UpdateParallelDataResponse' :: Maybe POSIX
latestUpdateAttemptAt = Maybe POSIX
a} :: UpdateParallelDataResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> UpdateParallelDataResponse -> f UpdateParallelDataResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> UpdateParallelDataResponse
-> f UpdateParallelDataResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The status of the parallel data update attempt. When the updated
-- parallel data resource is ready for you to use, the status is @ACTIVE@.
updateParallelDataResponse_latestUpdateAttemptStatus :: Lens.Lens' UpdateParallelDataResponse (Prelude.Maybe ParallelDataStatus)
updateParallelDataResponse_latestUpdateAttemptStatus :: (Maybe ParallelDataStatus -> f (Maybe ParallelDataStatus))
-> UpdateParallelDataResponse -> f UpdateParallelDataResponse
updateParallelDataResponse_latestUpdateAttemptStatus = (UpdateParallelDataResponse -> Maybe ParallelDataStatus)
-> (UpdateParallelDataResponse
    -> Maybe ParallelDataStatus -> UpdateParallelDataResponse)
-> Lens
     UpdateParallelDataResponse
     UpdateParallelDataResponse
     (Maybe ParallelDataStatus)
     (Maybe ParallelDataStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateParallelDataResponse' {Maybe ParallelDataStatus
latestUpdateAttemptStatus :: Maybe ParallelDataStatus
$sel:latestUpdateAttemptStatus:UpdateParallelDataResponse' :: UpdateParallelDataResponse -> Maybe ParallelDataStatus
latestUpdateAttemptStatus} -> Maybe ParallelDataStatus
latestUpdateAttemptStatus) (\s :: UpdateParallelDataResponse
s@UpdateParallelDataResponse' {} Maybe ParallelDataStatus
a -> UpdateParallelDataResponse
s {$sel:latestUpdateAttemptStatus:UpdateParallelDataResponse' :: Maybe ParallelDataStatus
latestUpdateAttemptStatus = Maybe ParallelDataStatus
a} :: UpdateParallelDataResponse)

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

instance Prelude.NFData UpdateParallelDataResponse