{-# 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.MachineLearning.GetBatchPrediction
-- 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)
--
-- Returns a @BatchPrediction@ that includes detailed metadata, status, and
-- data file information for a @Batch Prediction@ request.
module Amazonka.MachineLearning.GetBatchPrediction
  ( -- * Creating a Request
    GetBatchPrediction (..),
    newGetBatchPrediction,

    -- * Request Lenses
    getBatchPrediction_batchPredictionId,

    -- * Destructuring the Response
    GetBatchPredictionResponse (..),
    newGetBatchPredictionResponse,

    -- * Response Lenses
    getBatchPredictionResponse_status,
    getBatchPredictionResponse_lastUpdatedAt,
    getBatchPredictionResponse_createdAt,
    getBatchPredictionResponse_computeTime,
    getBatchPredictionResponse_inputDataLocationS3,
    getBatchPredictionResponse_mLModelId,
    getBatchPredictionResponse_batchPredictionDataSourceId,
    getBatchPredictionResponse_totalRecordCount,
    getBatchPredictionResponse_startedAt,
    getBatchPredictionResponse_batchPredictionId,
    getBatchPredictionResponse_finishedAt,
    getBatchPredictionResponse_invalidRecordCount,
    getBatchPredictionResponse_createdByIamUser,
    getBatchPredictionResponse_name,
    getBatchPredictionResponse_logUri,
    getBatchPredictionResponse_message,
    getBatchPredictionResponse_outputUri,
    getBatchPredictionResponse_httpStatus,
  )
where

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

-- | /See:/ 'newGetBatchPrediction' smart constructor.
data GetBatchPrediction = GetBatchPrediction'
  { -- | An ID assigned to the @BatchPrediction@ at creation.
    GetBatchPrediction -> Text
batchPredictionId :: Prelude.Text
  }
  deriving (GetBatchPrediction -> GetBatchPrediction -> Bool
(GetBatchPrediction -> GetBatchPrediction -> Bool)
-> (GetBatchPrediction -> GetBatchPrediction -> Bool)
-> Eq GetBatchPrediction
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetBatchPrediction -> GetBatchPrediction -> Bool
$c/= :: GetBatchPrediction -> GetBatchPrediction -> Bool
== :: GetBatchPrediction -> GetBatchPrediction -> Bool
$c== :: GetBatchPrediction -> GetBatchPrediction -> Bool
Prelude.Eq, ReadPrec [GetBatchPrediction]
ReadPrec GetBatchPrediction
Int -> ReadS GetBatchPrediction
ReadS [GetBatchPrediction]
(Int -> ReadS GetBatchPrediction)
-> ReadS [GetBatchPrediction]
-> ReadPrec GetBatchPrediction
-> ReadPrec [GetBatchPrediction]
-> Read GetBatchPrediction
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetBatchPrediction]
$creadListPrec :: ReadPrec [GetBatchPrediction]
readPrec :: ReadPrec GetBatchPrediction
$creadPrec :: ReadPrec GetBatchPrediction
readList :: ReadS [GetBatchPrediction]
$creadList :: ReadS [GetBatchPrediction]
readsPrec :: Int -> ReadS GetBatchPrediction
$creadsPrec :: Int -> ReadS GetBatchPrediction
Prelude.Read, Int -> GetBatchPrediction -> ShowS
[GetBatchPrediction] -> ShowS
GetBatchPrediction -> String
(Int -> GetBatchPrediction -> ShowS)
-> (GetBatchPrediction -> String)
-> ([GetBatchPrediction] -> ShowS)
-> Show GetBatchPrediction
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetBatchPrediction] -> ShowS
$cshowList :: [GetBatchPrediction] -> ShowS
show :: GetBatchPrediction -> String
$cshow :: GetBatchPrediction -> String
showsPrec :: Int -> GetBatchPrediction -> ShowS
$cshowsPrec :: Int -> GetBatchPrediction -> ShowS
Prelude.Show, (forall x. GetBatchPrediction -> Rep GetBatchPrediction x)
-> (forall x. Rep GetBatchPrediction x -> GetBatchPrediction)
-> Generic GetBatchPrediction
forall x. Rep GetBatchPrediction x -> GetBatchPrediction
forall x. GetBatchPrediction -> Rep GetBatchPrediction x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetBatchPrediction x -> GetBatchPrediction
$cfrom :: forall x. GetBatchPrediction -> Rep GetBatchPrediction x
Prelude.Generic)

-- |
-- Create a value of 'GetBatchPrediction' 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:
--
-- 'batchPredictionId', 'getBatchPrediction_batchPredictionId' - An ID assigned to the @BatchPrediction@ at creation.
newGetBatchPrediction ::
  -- | 'batchPredictionId'
  Prelude.Text ->
  GetBatchPrediction
newGetBatchPrediction :: Text -> GetBatchPrediction
newGetBatchPrediction Text
pBatchPredictionId_ =
  GetBatchPrediction' :: Text -> GetBatchPrediction
GetBatchPrediction'
    { $sel:batchPredictionId:GetBatchPrediction' :: Text
batchPredictionId =
        Text
pBatchPredictionId_
    }

-- | An ID assigned to the @BatchPrediction@ at creation.
getBatchPrediction_batchPredictionId :: Lens.Lens' GetBatchPrediction Prelude.Text
getBatchPrediction_batchPredictionId :: (Text -> f Text) -> GetBatchPrediction -> f GetBatchPrediction
getBatchPrediction_batchPredictionId = (GetBatchPrediction -> Text)
-> (GetBatchPrediction -> Text -> GetBatchPrediction)
-> Lens GetBatchPrediction GetBatchPrediction Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBatchPrediction' {Text
batchPredictionId :: Text
$sel:batchPredictionId:GetBatchPrediction' :: GetBatchPrediction -> Text
batchPredictionId} -> Text
batchPredictionId) (\s :: GetBatchPrediction
s@GetBatchPrediction' {} Text
a -> GetBatchPrediction
s {$sel:batchPredictionId:GetBatchPrediction' :: Text
batchPredictionId = Text
a} :: GetBatchPrediction)

instance Core.AWSRequest GetBatchPrediction where
  type
    AWSResponse GetBatchPrediction =
      GetBatchPredictionResponse
  request :: GetBatchPrediction -> Request GetBatchPrediction
request = Service -> GetBatchPrediction -> Request GetBatchPrediction
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy GetBatchPrediction
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetBatchPrediction)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse GetBatchPrediction))
-> Logger
-> Service
-> Proxy GetBatchPrediction
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetBatchPrediction)))
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 EntityStatus
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Integer
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Integer
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe Integer
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Int
-> GetBatchPredictionResponse
GetBatchPredictionResponse'
            (Maybe EntityStatus
 -> Maybe POSIX
 -> Maybe POSIX
 -> Maybe Integer
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Integer
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe Integer
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Int
 -> GetBatchPredictionResponse)
-> Either String (Maybe EntityStatus)
-> Either
     String
     (Maybe POSIX
      -> Maybe POSIX
      -> Maybe Integer
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Integer
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Integer
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> GetBatchPredictionResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe EntityStatus)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Status")
            Either
  String
  (Maybe POSIX
   -> Maybe POSIX
   -> Maybe Integer
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Integer
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Integer
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> GetBatchPredictionResponse)
-> Either String (Maybe POSIX)
-> Either
     String
     (Maybe POSIX
      -> Maybe Integer
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Integer
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Integer
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> GetBatchPredictionResponse)
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
"LastUpdatedAt")
            Either
  String
  (Maybe POSIX
   -> Maybe Integer
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Integer
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Integer
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> GetBatchPredictionResponse)
-> Either String (Maybe POSIX)
-> Either
     String
     (Maybe Integer
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Integer
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Integer
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> GetBatchPredictionResponse)
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
"CreatedAt")
            Either
  String
  (Maybe Integer
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Integer
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Integer
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> GetBatchPredictionResponse)
-> Either String (Maybe Integer)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Integer
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Integer
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> GetBatchPredictionResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ComputeTime")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Integer
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Integer
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> GetBatchPredictionResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Integer
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Integer
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> GetBatchPredictionResponse)
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
"InputDataLocationS3")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Integer
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Integer
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> GetBatchPredictionResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Integer
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Integer
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> GetBatchPredictionResponse)
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
"MLModelId")
            Either
  String
  (Maybe Text
   -> Maybe Integer
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Integer
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> GetBatchPredictionResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Integer
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Integer
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> GetBatchPredictionResponse)
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
"BatchPredictionDataSourceId")
            Either
  String
  (Maybe Integer
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Integer
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> GetBatchPredictionResponse)
-> Either String (Maybe Integer)
-> Either
     String
     (Maybe POSIX
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Integer
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> GetBatchPredictionResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"TotalRecordCount")
            Either
  String
  (Maybe POSIX
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Integer
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> GetBatchPredictionResponse)
-> Either String (Maybe POSIX)
-> Either
     String
     (Maybe Text
      -> Maybe POSIX
      -> Maybe Integer
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> GetBatchPredictionResponse)
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
"StartedAt")
            Either
  String
  (Maybe Text
   -> Maybe POSIX
   -> Maybe Integer
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> GetBatchPredictionResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe POSIX
      -> Maybe Integer
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> GetBatchPredictionResponse)
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
"BatchPredictionId")
            Either
  String
  (Maybe POSIX
   -> Maybe Integer
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> GetBatchPredictionResponse)
-> Either String (Maybe POSIX)
-> Either
     String
     (Maybe Integer
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> GetBatchPredictionResponse)
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
"FinishedAt")
            Either
  String
  (Maybe Integer
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> GetBatchPredictionResponse)
-> Either String (Maybe Integer)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> GetBatchPredictionResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"InvalidRecordCount")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> GetBatchPredictionResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> GetBatchPredictionResponse)
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
"CreatedByIamUser")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> GetBatchPredictionResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text -> Maybe Text -> Int -> GetBatchPredictionResponse)
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 Text
   -> Maybe Text -> Maybe Text -> Int -> GetBatchPredictionResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text -> Maybe Text -> Int -> GetBatchPredictionResponse)
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
"LogUri")
            Either
  String
  (Maybe Text -> Maybe Text -> Int -> GetBatchPredictionResponse)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> Int -> GetBatchPredictionResponse)
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
"Message")
            Either String (Maybe Text -> Int -> GetBatchPredictionResponse)
-> Either String (Maybe Text)
-> Either String (Int -> GetBatchPredictionResponse)
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
"OutputUri")
            Either String (Int -> GetBatchPredictionResponse)
-> Either String Int -> Either String GetBatchPredictionResponse
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 GetBatchPrediction

instance Prelude.NFData GetBatchPrediction

instance Core.ToHeaders GetBatchPrediction where
  toHeaders :: GetBatchPrediction -> ResponseHeaders
toHeaders =
    ResponseHeaders -> GetBatchPrediction -> 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
"AmazonML_20141212.GetBatchPrediction" ::
                          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 GetBatchPrediction where
  toJSON :: GetBatchPrediction -> Value
toJSON GetBatchPrediction' {Text
batchPredictionId :: Text
$sel:batchPredictionId:GetBatchPrediction' :: GetBatchPrediction -> Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"BatchPredictionId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
batchPredictionId)
          ]
      )

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

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

-- | Represents the output of a @GetBatchPrediction@ operation and describes
-- a @BatchPrediction@.
--
-- /See:/ 'newGetBatchPredictionResponse' smart constructor.
data GetBatchPredictionResponse = GetBatchPredictionResponse'
  { -- | The status of the @BatchPrediction@, which can be one of the following
    -- values:
    --
    -- -   @PENDING@ - Amazon Machine Learning (Amazon ML) submitted a request
    --     to generate batch predictions.
    --
    -- -   @INPROGRESS@ - The batch predictions are in progress.
    --
    -- -   @FAILED@ - The request to perform a batch prediction did not run to
    --     completion. It is not usable.
    --
    -- -   @COMPLETED@ - The batch prediction process completed successfully.
    --
    -- -   @DELETED@ - The @BatchPrediction@ is marked as deleted. It is not
    --     usable.
    GetBatchPredictionResponse -> Maybe EntityStatus
status :: Prelude.Maybe EntityStatus,
    -- | The time of the most recent edit to @BatchPrediction@. The time is
    -- expressed in epoch time.
    GetBatchPredictionResponse -> Maybe POSIX
lastUpdatedAt :: Prelude.Maybe Core.POSIX,
    -- | The time when the @BatchPrediction@ was created. The time is expressed
    -- in epoch time.
    GetBatchPredictionResponse -> Maybe POSIX
createdAt :: Prelude.Maybe Core.POSIX,
    -- | The approximate CPU time in milliseconds that Amazon Machine Learning
    -- spent processing the @BatchPrediction@, normalized and scaled on
    -- computation resources. @ComputeTime@ is only available if the
    -- @BatchPrediction@ is in the @COMPLETED@ state.
    GetBatchPredictionResponse -> Maybe Integer
computeTime :: Prelude.Maybe Prelude.Integer,
    -- | The location of the data file or directory in Amazon Simple Storage
    -- Service (Amazon S3).
    GetBatchPredictionResponse -> Maybe Text
inputDataLocationS3 :: Prelude.Maybe Prelude.Text,
    -- | The ID of the @MLModel@ that generated predictions for the
    -- @BatchPrediction@ request.
    GetBatchPredictionResponse -> Maybe Text
mLModelId :: Prelude.Maybe Prelude.Text,
    -- | The ID of the @DataSource@ that was used to create the
    -- @BatchPrediction@.
    GetBatchPredictionResponse -> Maybe Text
batchPredictionDataSourceId :: Prelude.Maybe Prelude.Text,
    -- | The number of total records that Amazon Machine Learning saw while
    -- processing the @BatchPrediction@.
    GetBatchPredictionResponse -> Maybe Integer
totalRecordCount :: Prelude.Maybe Prelude.Integer,
    -- | The epoch time when Amazon Machine Learning marked the @BatchPrediction@
    -- as @INPROGRESS@. @StartedAt@ isn\'t available if the @BatchPrediction@
    -- is in the @PENDING@ state.
    GetBatchPredictionResponse -> Maybe POSIX
startedAt :: Prelude.Maybe Core.POSIX,
    -- | An ID assigned to the @BatchPrediction@ at creation. This value should
    -- be identical to the value of the @BatchPredictionID@ in the request.
    GetBatchPredictionResponse -> Maybe Text
batchPredictionId :: Prelude.Maybe Prelude.Text,
    -- | The epoch time when Amazon Machine Learning marked the @BatchPrediction@
    -- as @COMPLETED@ or @FAILED@. @FinishedAt@ is only available when the
    -- @BatchPrediction@ is in the @COMPLETED@ or @FAILED@ state.
    GetBatchPredictionResponse -> Maybe POSIX
finishedAt :: Prelude.Maybe Core.POSIX,
    -- | The number of invalid records that Amazon Machine Learning saw while
    -- processing the @BatchPrediction@.
    GetBatchPredictionResponse -> Maybe Integer
invalidRecordCount :: Prelude.Maybe Prelude.Integer,
    -- | The AWS user account that invoked the @BatchPrediction@. The account
    -- type can be either an AWS root account or an AWS Identity and Access
    -- Management (IAM) user account.
    GetBatchPredictionResponse -> Maybe Text
createdByIamUser :: Prelude.Maybe Prelude.Text,
    -- | A user-supplied name or description of the @BatchPrediction@.
    GetBatchPredictionResponse -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | A link to the file that contains logs of the @CreateBatchPrediction@
    -- operation.
    GetBatchPredictionResponse -> Maybe Text
logUri :: Prelude.Maybe Prelude.Text,
    -- | A description of the most recent details about processing the batch
    -- prediction request.
    GetBatchPredictionResponse -> Maybe Text
message :: Prelude.Maybe Prelude.Text,
    -- | The location of an Amazon S3 bucket or directory to receive the
    -- operation results.
    GetBatchPredictionResponse -> Maybe Text
outputUri :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    GetBatchPredictionResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetBatchPredictionResponse -> GetBatchPredictionResponse -> Bool
(GetBatchPredictionResponse -> GetBatchPredictionResponse -> Bool)
-> (GetBatchPredictionResponse
    -> GetBatchPredictionResponse -> Bool)
-> Eq GetBatchPredictionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetBatchPredictionResponse -> GetBatchPredictionResponse -> Bool
$c/= :: GetBatchPredictionResponse -> GetBatchPredictionResponse -> Bool
== :: GetBatchPredictionResponse -> GetBatchPredictionResponse -> Bool
$c== :: GetBatchPredictionResponse -> GetBatchPredictionResponse -> Bool
Prelude.Eq, ReadPrec [GetBatchPredictionResponse]
ReadPrec GetBatchPredictionResponse
Int -> ReadS GetBatchPredictionResponse
ReadS [GetBatchPredictionResponse]
(Int -> ReadS GetBatchPredictionResponse)
-> ReadS [GetBatchPredictionResponse]
-> ReadPrec GetBatchPredictionResponse
-> ReadPrec [GetBatchPredictionResponse]
-> Read GetBatchPredictionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetBatchPredictionResponse]
$creadListPrec :: ReadPrec [GetBatchPredictionResponse]
readPrec :: ReadPrec GetBatchPredictionResponse
$creadPrec :: ReadPrec GetBatchPredictionResponse
readList :: ReadS [GetBatchPredictionResponse]
$creadList :: ReadS [GetBatchPredictionResponse]
readsPrec :: Int -> ReadS GetBatchPredictionResponse
$creadsPrec :: Int -> ReadS GetBatchPredictionResponse
Prelude.Read, Int -> GetBatchPredictionResponse -> ShowS
[GetBatchPredictionResponse] -> ShowS
GetBatchPredictionResponse -> String
(Int -> GetBatchPredictionResponse -> ShowS)
-> (GetBatchPredictionResponse -> String)
-> ([GetBatchPredictionResponse] -> ShowS)
-> Show GetBatchPredictionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetBatchPredictionResponse] -> ShowS
$cshowList :: [GetBatchPredictionResponse] -> ShowS
show :: GetBatchPredictionResponse -> String
$cshow :: GetBatchPredictionResponse -> String
showsPrec :: Int -> GetBatchPredictionResponse -> ShowS
$cshowsPrec :: Int -> GetBatchPredictionResponse -> ShowS
Prelude.Show, (forall x.
 GetBatchPredictionResponse -> Rep GetBatchPredictionResponse x)
-> (forall x.
    Rep GetBatchPredictionResponse x -> GetBatchPredictionResponse)
-> Generic GetBatchPredictionResponse
forall x.
Rep GetBatchPredictionResponse x -> GetBatchPredictionResponse
forall x.
GetBatchPredictionResponse -> Rep GetBatchPredictionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetBatchPredictionResponse x -> GetBatchPredictionResponse
$cfrom :: forall x.
GetBatchPredictionResponse -> Rep GetBatchPredictionResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetBatchPredictionResponse' 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', 'getBatchPredictionResponse_status' - The status of the @BatchPrediction@, which can be one of the following
-- values:
--
-- -   @PENDING@ - Amazon Machine Learning (Amazon ML) submitted a request
--     to generate batch predictions.
--
-- -   @INPROGRESS@ - The batch predictions are in progress.
--
-- -   @FAILED@ - The request to perform a batch prediction did not run to
--     completion. It is not usable.
--
-- -   @COMPLETED@ - The batch prediction process completed successfully.
--
-- -   @DELETED@ - The @BatchPrediction@ is marked as deleted. It is not
--     usable.
--
-- 'lastUpdatedAt', 'getBatchPredictionResponse_lastUpdatedAt' - The time of the most recent edit to @BatchPrediction@. The time is
-- expressed in epoch time.
--
-- 'createdAt', 'getBatchPredictionResponse_createdAt' - The time when the @BatchPrediction@ was created. The time is expressed
-- in epoch time.
--
-- 'computeTime', 'getBatchPredictionResponse_computeTime' - The approximate CPU time in milliseconds that Amazon Machine Learning
-- spent processing the @BatchPrediction@, normalized and scaled on
-- computation resources. @ComputeTime@ is only available if the
-- @BatchPrediction@ is in the @COMPLETED@ state.
--
-- 'inputDataLocationS3', 'getBatchPredictionResponse_inputDataLocationS3' - The location of the data file or directory in Amazon Simple Storage
-- Service (Amazon S3).
--
-- 'mLModelId', 'getBatchPredictionResponse_mLModelId' - The ID of the @MLModel@ that generated predictions for the
-- @BatchPrediction@ request.
--
-- 'batchPredictionDataSourceId', 'getBatchPredictionResponse_batchPredictionDataSourceId' - The ID of the @DataSource@ that was used to create the
-- @BatchPrediction@.
--
-- 'totalRecordCount', 'getBatchPredictionResponse_totalRecordCount' - The number of total records that Amazon Machine Learning saw while
-- processing the @BatchPrediction@.
--
-- 'startedAt', 'getBatchPredictionResponse_startedAt' - The epoch time when Amazon Machine Learning marked the @BatchPrediction@
-- as @INPROGRESS@. @StartedAt@ isn\'t available if the @BatchPrediction@
-- is in the @PENDING@ state.
--
-- 'batchPredictionId', 'getBatchPredictionResponse_batchPredictionId' - An ID assigned to the @BatchPrediction@ at creation. This value should
-- be identical to the value of the @BatchPredictionID@ in the request.
--
-- 'finishedAt', 'getBatchPredictionResponse_finishedAt' - The epoch time when Amazon Machine Learning marked the @BatchPrediction@
-- as @COMPLETED@ or @FAILED@. @FinishedAt@ is only available when the
-- @BatchPrediction@ is in the @COMPLETED@ or @FAILED@ state.
--
-- 'invalidRecordCount', 'getBatchPredictionResponse_invalidRecordCount' - The number of invalid records that Amazon Machine Learning saw while
-- processing the @BatchPrediction@.
--
-- 'createdByIamUser', 'getBatchPredictionResponse_createdByIamUser' - The AWS user account that invoked the @BatchPrediction@. The account
-- type can be either an AWS root account or an AWS Identity and Access
-- Management (IAM) user account.
--
-- 'name', 'getBatchPredictionResponse_name' - A user-supplied name or description of the @BatchPrediction@.
--
-- 'logUri', 'getBatchPredictionResponse_logUri' - A link to the file that contains logs of the @CreateBatchPrediction@
-- operation.
--
-- 'message', 'getBatchPredictionResponse_message' - A description of the most recent details about processing the batch
-- prediction request.
--
-- 'outputUri', 'getBatchPredictionResponse_outputUri' - The location of an Amazon S3 bucket or directory to receive the
-- operation results.
--
-- 'httpStatus', 'getBatchPredictionResponse_httpStatus' - The response's http status code.
newGetBatchPredictionResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetBatchPredictionResponse
newGetBatchPredictionResponse :: Int -> GetBatchPredictionResponse
newGetBatchPredictionResponse Int
pHttpStatus_ =
  GetBatchPredictionResponse' :: Maybe EntityStatus
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Integer
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Integer
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe Integer
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Int
-> GetBatchPredictionResponse
GetBatchPredictionResponse'
    { $sel:status:GetBatchPredictionResponse' :: Maybe EntityStatus
status =
        Maybe EntityStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:lastUpdatedAt:GetBatchPredictionResponse' :: Maybe POSIX
lastUpdatedAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:createdAt:GetBatchPredictionResponse' :: Maybe POSIX
createdAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:computeTime:GetBatchPredictionResponse' :: Maybe Integer
computeTime = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:inputDataLocationS3:GetBatchPredictionResponse' :: Maybe Text
inputDataLocationS3 = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:mLModelId:GetBatchPredictionResponse' :: Maybe Text
mLModelId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:batchPredictionDataSourceId:GetBatchPredictionResponse' :: Maybe Text
batchPredictionDataSourceId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:totalRecordCount:GetBatchPredictionResponse' :: Maybe Integer
totalRecordCount = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:startedAt:GetBatchPredictionResponse' :: Maybe POSIX
startedAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:batchPredictionId:GetBatchPredictionResponse' :: Maybe Text
batchPredictionId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:finishedAt:GetBatchPredictionResponse' :: Maybe POSIX
finishedAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:invalidRecordCount:GetBatchPredictionResponse' :: Maybe Integer
invalidRecordCount = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:createdByIamUser:GetBatchPredictionResponse' :: Maybe Text
createdByIamUser = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:name:GetBatchPredictionResponse' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:logUri:GetBatchPredictionResponse' :: Maybe Text
logUri = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:message:GetBatchPredictionResponse' :: Maybe Text
message = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:outputUri:GetBatchPredictionResponse' :: Maybe Text
outputUri = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetBatchPredictionResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The status of the @BatchPrediction@, which can be one of the following
-- values:
--
-- -   @PENDING@ - Amazon Machine Learning (Amazon ML) submitted a request
--     to generate batch predictions.
--
-- -   @INPROGRESS@ - The batch predictions are in progress.
--
-- -   @FAILED@ - The request to perform a batch prediction did not run to
--     completion. It is not usable.
--
-- -   @COMPLETED@ - The batch prediction process completed successfully.
--
-- -   @DELETED@ - The @BatchPrediction@ is marked as deleted. It is not
--     usable.
getBatchPredictionResponse_status :: Lens.Lens' GetBatchPredictionResponse (Prelude.Maybe EntityStatus)
getBatchPredictionResponse_status :: (Maybe EntityStatus -> f (Maybe EntityStatus))
-> GetBatchPredictionResponse -> f GetBatchPredictionResponse
getBatchPredictionResponse_status = (GetBatchPredictionResponse -> Maybe EntityStatus)
-> (GetBatchPredictionResponse
    -> Maybe EntityStatus -> GetBatchPredictionResponse)
-> Lens
     GetBatchPredictionResponse
     GetBatchPredictionResponse
     (Maybe EntityStatus)
     (Maybe EntityStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBatchPredictionResponse' {Maybe EntityStatus
status :: Maybe EntityStatus
$sel:status:GetBatchPredictionResponse' :: GetBatchPredictionResponse -> Maybe EntityStatus
status} -> Maybe EntityStatus
status) (\s :: GetBatchPredictionResponse
s@GetBatchPredictionResponse' {} Maybe EntityStatus
a -> GetBatchPredictionResponse
s {$sel:status:GetBatchPredictionResponse' :: Maybe EntityStatus
status = Maybe EntityStatus
a} :: GetBatchPredictionResponse)

-- | The time of the most recent edit to @BatchPrediction@. The time is
-- expressed in epoch time.
getBatchPredictionResponse_lastUpdatedAt :: Lens.Lens' GetBatchPredictionResponse (Prelude.Maybe Prelude.UTCTime)
getBatchPredictionResponse_lastUpdatedAt :: (Maybe UTCTime -> f (Maybe UTCTime))
-> GetBatchPredictionResponse -> f GetBatchPredictionResponse
getBatchPredictionResponse_lastUpdatedAt = (GetBatchPredictionResponse -> Maybe POSIX)
-> (GetBatchPredictionResponse
    -> Maybe POSIX -> GetBatchPredictionResponse)
-> Lens
     GetBatchPredictionResponse
     GetBatchPredictionResponse
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBatchPredictionResponse' {Maybe POSIX
lastUpdatedAt :: Maybe POSIX
$sel:lastUpdatedAt:GetBatchPredictionResponse' :: GetBatchPredictionResponse -> Maybe POSIX
lastUpdatedAt} -> Maybe POSIX
lastUpdatedAt) (\s :: GetBatchPredictionResponse
s@GetBatchPredictionResponse' {} Maybe POSIX
a -> GetBatchPredictionResponse
s {$sel:lastUpdatedAt:GetBatchPredictionResponse' :: Maybe POSIX
lastUpdatedAt = Maybe POSIX
a} :: GetBatchPredictionResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> GetBatchPredictionResponse -> f GetBatchPredictionResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> GetBatchPredictionResponse
-> f GetBatchPredictionResponse
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 time when the @BatchPrediction@ was created. The time is expressed
-- in epoch time.
getBatchPredictionResponse_createdAt :: Lens.Lens' GetBatchPredictionResponse (Prelude.Maybe Prelude.UTCTime)
getBatchPredictionResponse_createdAt :: (Maybe UTCTime -> f (Maybe UTCTime))
-> GetBatchPredictionResponse -> f GetBatchPredictionResponse
getBatchPredictionResponse_createdAt = (GetBatchPredictionResponse -> Maybe POSIX)
-> (GetBatchPredictionResponse
    -> Maybe POSIX -> GetBatchPredictionResponse)
-> Lens
     GetBatchPredictionResponse
     GetBatchPredictionResponse
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBatchPredictionResponse' {Maybe POSIX
createdAt :: Maybe POSIX
$sel:createdAt:GetBatchPredictionResponse' :: GetBatchPredictionResponse -> Maybe POSIX
createdAt} -> Maybe POSIX
createdAt) (\s :: GetBatchPredictionResponse
s@GetBatchPredictionResponse' {} Maybe POSIX
a -> GetBatchPredictionResponse
s {$sel:createdAt:GetBatchPredictionResponse' :: Maybe POSIX
createdAt = Maybe POSIX
a} :: GetBatchPredictionResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> GetBatchPredictionResponse -> f GetBatchPredictionResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> GetBatchPredictionResponse
-> f GetBatchPredictionResponse
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 approximate CPU time in milliseconds that Amazon Machine Learning
-- spent processing the @BatchPrediction@, normalized and scaled on
-- computation resources. @ComputeTime@ is only available if the
-- @BatchPrediction@ is in the @COMPLETED@ state.
getBatchPredictionResponse_computeTime :: Lens.Lens' GetBatchPredictionResponse (Prelude.Maybe Prelude.Integer)
getBatchPredictionResponse_computeTime :: (Maybe Integer -> f (Maybe Integer))
-> GetBatchPredictionResponse -> f GetBatchPredictionResponse
getBatchPredictionResponse_computeTime = (GetBatchPredictionResponse -> Maybe Integer)
-> (GetBatchPredictionResponse
    -> Maybe Integer -> GetBatchPredictionResponse)
-> Lens
     GetBatchPredictionResponse
     GetBatchPredictionResponse
     (Maybe Integer)
     (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBatchPredictionResponse' {Maybe Integer
computeTime :: Maybe Integer
$sel:computeTime:GetBatchPredictionResponse' :: GetBatchPredictionResponse -> Maybe Integer
computeTime} -> Maybe Integer
computeTime) (\s :: GetBatchPredictionResponse
s@GetBatchPredictionResponse' {} Maybe Integer
a -> GetBatchPredictionResponse
s {$sel:computeTime:GetBatchPredictionResponse' :: Maybe Integer
computeTime = Maybe Integer
a} :: GetBatchPredictionResponse)

-- | The location of the data file or directory in Amazon Simple Storage
-- Service (Amazon S3).
getBatchPredictionResponse_inputDataLocationS3 :: Lens.Lens' GetBatchPredictionResponse (Prelude.Maybe Prelude.Text)
getBatchPredictionResponse_inputDataLocationS3 :: (Maybe Text -> f (Maybe Text))
-> GetBatchPredictionResponse -> f GetBatchPredictionResponse
getBatchPredictionResponse_inputDataLocationS3 = (GetBatchPredictionResponse -> Maybe Text)
-> (GetBatchPredictionResponse
    -> Maybe Text -> GetBatchPredictionResponse)
-> Lens
     GetBatchPredictionResponse
     GetBatchPredictionResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBatchPredictionResponse' {Maybe Text
inputDataLocationS3 :: Maybe Text
$sel:inputDataLocationS3:GetBatchPredictionResponse' :: GetBatchPredictionResponse -> Maybe Text
inputDataLocationS3} -> Maybe Text
inputDataLocationS3) (\s :: GetBatchPredictionResponse
s@GetBatchPredictionResponse' {} Maybe Text
a -> GetBatchPredictionResponse
s {$sel:inputDataLocationS3:GetBatchPredictionResponse' :: Maybe Text
inputDataLocationS3 = Maybe Text
a} :: GetBatchPredictionResponse)

-- | The ID of the @MLModel@ that generated predictions for the
-- @BatchPrediction@ request.
getBatchPredictionResponse_mLModelId :: Lens.Lens' GetBatchPredictionResponse (Prelude.Maybe Prelude.Text)
getBatchPredictionResponse_mLModelId :: (Maybe Text -> f (Maybe Text))
-> GetBatchPredictionResponse -> f GetBatchPredictionResponse
getBatchPredictionResponse_mLModelId = (GetBatchPredictionResponse -> Maybe Text)
-> (GetBatchPredictionResponse
    -> Maybe Text -> GetBatchPredictionResponse)
-> Lens
     GetBatchPredictionResponse
     GetBatchPredictionResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBatchPredictionResponse' {Maybe Text
mLModelId :: Maybe Text
$sel:mLModelId:GetBatchPredictionResponse' :: GetBatchPredictionResponse -> Maybe Text
mLModelId} -> Maybe Text
mLModelId) (\s :: GetBatchPredictionResponse
s@GetBatchPredictionResponse' {} Maybe Text
a -> GetBatchPredictionResponse
s {$sel:mLModelId:GetBatchPredictionResponse' :: Maybe Text
mLModelId = Maybe Text
a} :: GetBatchPredictionResponse)

-- | The ID of the @DataSource@ that was used to create the
-- @BatchPrediction@.
getBatchPredictionResponse_batchPredictionDataSourceId :: Lens.Lens' GetBatchPredictionResponse (Prelude.Maybe Prelude.Text)
getBatchPredictionResponse_batchPredictionDataSourceId :: (Maybe Text -> f (Maybe Text))
-> GetBatchPredictionResponse -> f GetBatchPredictionResponse
getBatchPredictionResponse_batchPredictionDataSourceId = (GetBatchPredictionResponse -> Maybe Text)
-> (GetBatchPredictionResponse
    -> Maybe Text -> GetBatchPredictionResponse)
-> Lens
     GetBatchPredictionResponse
     GetBatchPredictionResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBatchPredictionResponse' {Maybe Text
batchPredictionDataSourceId :: Maybe Text
$sel:batchPredictionDataSourceId:GetBatchPredictionResponse' :: GetBatchPredictionResponse -> Maybe Text
batchPredictionDataSourceId} -> Maybe Text
batchPredictionDataSourceId) (\s :: GetBatchPredictionResponse
s@GetBatchPredictionResponse' {} Maybe Text
a -> GetBatchPredictionResponse
s {$sel:batchPredictionDataSourceId:GetBatchPredictionResponse' :: Maybe Text
batchPredictionDataSourceId = Maybe Text
a} :: GetBatchPredictionResponse)

-- | The number of total records that Amazon Machine Learning saw while
-- processing the @BatchPrediction@.
getBatchPredictionResponse_totalRecordCount :: Lens.Lens' GetBatchPredictionResponse (Prelude.Maybe Prelude.Integer)
getBatchPredictionResponse_totalRecordCount :: (Maybe Integer -> f (Maybe Integer))
-> GetBatchPredictionResponse -> f GetBatchPredictionResponse
getBatchPredictionResponse_totalRecordCount = (GetBatchPredictionResponse -> Maybe Integer)
-> (GetBatchPredictionResponse
    -> Maybe Integer -> GetBatchPredictionResponse)
-> Lens
     GetBatchPredictionResponse
     GetBatchPredictionResponse
     (Maybe Integer)
     (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBatchPredictionResponse' {Maybe Integer
totalRecordCount :: Maybe Integer
$sel:totalRecordCount:GetBatchPredictionResponse' :: GetBatchPredictionResponse -> Maybe Integer
totalRecordCount} -> Maybe Integer
totalRecordCount) (\s :: GetBatchPredictionResponse
s@GetBatchPredictionResponse' {} Maybe Integer
a -> GetBatchPredictionResponse
s {$sel:totalRecordCount:GetBatchPredictionResponse' :: Maybe Integer
totalRecordCount = Maybe Integer
a} :: GetBatchPredictionResponse)

-- | The epoch time when Amazon Machine Learning marked the @BatchPrediction@
-- as @INPROGRESS@. @StartedAt@ isn\'t available if the @BatchPrediction@
-- is in the @PENDING@ state.
getBatchPredictionResponse_startedAt :: Lens.Lens' GetBatchPredictionResponse (Prelude.Maybe Prelude.UTCTime)
getBatchPredictionResponse_startedAt :: (Maybe UTCTime -> f (Maybe UTCTime))
-> GetBatchPredictionResponse -> f GetBatchPredictionResponse
getBatchPredictionResponse_startedAt = (GetBatchPredictionResponse -> Maybe POSIX)
-> (GetBatchPredictionResponse
    -> Maybe POSIX -> GetBatchPredictionResponse)
-> Lens
     GetBatchPredictionResponse
     GetBatchPredictionResponse
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBatchPredictionResponse' {Maybe POSIX
startedAt :: Maybe POSIX
$sel:startedAt:GetBatchPredictionResponse' :: GetBatchPredictionResponse -> Maybe POSIX
startedAt} -> Maybe POSIX
startedAt) (\s :: GetBatchPredictionResponse
s@GetBatchPredictionResponse' {} Maybe POSIX
a -> GetBatchPredictionResponse
s {$sel:startedAt:GetBatchPredictionResponse' :: Maybe POSIX
startedAt = Maybe POSIX
a} :: GetBatchPredictionResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> GetBatchPredictionResponse -> f GetBatchPredictionResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> GetBatchPredictionResponse
-> f GetBatchPredictionResponse
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

-- | An ID assigned to the @BatchPrediction@ at creation. This value should
-- be identical to the value of the @BatchPredictionID@ in the request.
getBatchPredictionResponse_batchPredictionId :: Lens.Lens' GetBatchPredictionResponse (Prelude.Maybe Prelude.Text)
getBatchPredictionResponse_batchPredictionId :: (Maybe Text -> f (Maybe Text))
-> GetBatchPredictionResponse -> f GetBatchPredictionResponse
getBatchPredictionResponse_batchPredictionId = (GetBatchPredictionResponse -> Maybe Text)
-> (GetBatchPredictionResponse
    -> Maybe Text -> GetBatchPredictionResponse)
-> Lens
     GetBatchPredictionResponse
     GetBatchPredictionResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBatchPredictionResponse' {Maybe Text
batchPredictionId :: Maybe Text
$sel:batchPredictionId:GetBatchPredictionResponse' :: GetBatchPredictionResponse -> Maybe Text
batchPredictionId} -> Maybe Text
batchPredictionId) (\s :: GetBatchPredictionResponse
s@GetBatchPredictionResponse' {} Maybe Text
a -> GetBatchPredictionResponse
s {$sel:batchPredictionId:GetBatchPredictionResponse' :: Maybe Text
batchPredictionId = Maybe Text
a} :: GetBatchPredictionResponse)

-- | The epoch time when Amazon Machine Learning marked the @BatchPrediction@
-- as @COMPLETED@ or @FAILED@. @FinishedAt@ is only available when the
-- @BatchPrediction@ is in the @COMPLETED@ or @FAILED@ state.
getBatchPredictionResponse_finishedAt :: Lens.Lens' GetBatchPredictionResponse (Prelude.Maybe Prelude.UTCTime)
getBatchPredictionResponse_finishedAt :: (Maybe UTCTime -> f (Maybe UTCTime))
-> GetBatchPredictionResponse -> f GetBatchPredictionResponse
getBatchPredictionResponse_finishedAt = (GetBatchPredictionResponse -> Maybe POSIX)
-> (GetBatchPredictionResponse
    -> Maybe POSIX -> GetBatchPredictionResponse)
-> Lens
     GetBatchPredictionResponse
     GetBatchPredictionResponse
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBatchPredictionResponse' {Maybe POSIX
finishedAt :: Maybe POSIX
$sel:finishedAt:GetBatchPredictionResponse' :: GetBatchPredictionResponse -> Maybe POSIX
finishedAt} -> Maybe POSIX
finishedAt) (\s :: GetBatchPredictionResponse
s@GetBatchPredictionResponse' {} Maybe POSIX
a -> GetBatchPredictionResponse
s {$sel:finishedAt:GetBatchPredictionResponse' :: Maybe POSIX
finishedAt = Maybe POSIX
a} :: GetBatchPredictionResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> GetBatchPredictionResponse -> f GetBatchPredictionResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> GetBatchPredictionResponse
-> f GetBatchPredictionResponse
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 number of invalid records that Amazon Machine Learning saw while
-- processing the @BatchPrediction@.
getBatchPredictionResponse_invalidRecordCount :: Lens.Lens' GetBatchPredictionResponse (Prelude.Maybe Prelude.Integer)
getBatchPredictionResponse_invalidRecordCount :: (Maybe Integer -> f (Maybe Integer))
-> GetBatchPredictionResponse -> f GetBatchPredictionResponse
getBatchPredictionResponse_invalidRecordCount = (GetBatchPredictionResponse -> Maybe Integer)
-> (GetBatchPredictionResponse
    -> Maybe Integer -> GetBatchPredictionResponse)
-> Lens
     GetBatchPredictionResponse
     GetBatchPredictionResponse
     (Maybe Integer)
     (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBatchPredictionResponse' {Maybe Integer
invalidRecordCount :: Maybe Integer
$sel:invalidRecordCount:GetBatchPredictionResponse' :: GetBatchPredictionResponse -> Maybe Integer
invalidRecordCount} -> Maybe Integer
invalidRecordCount) (\s :: GetBatchPredictionResponse
s@GetBatchPredictionResponse' {} Maybe Integer
a -> GetBatchPredictionResponse
s {$sel:invalidRecordCount:GetBatchPredictionResponse' :: Maybe Integer
invalidRecordCount = Maybe Integer
a} :: GetBatchPredictionResponse)

-- | The AWS user account that invoked the @BatchPrediction@. The account
-- type can be either an AWS root account or an AWS Identity and Access
-- Management (IAM) user account.
getBatchPredictionResponse_createdByIamUser :: Lens.Lens' GetBatchPredictionResponse (Prelude.Maybe Prelude.Text)
getBatchPredictionResponse_createdByIamUser :: (Maybe Text -> f (Maybe Text))
-> GetBatchPredictionResponse -> f GetBatchPredictionResponse
getBatchPredictionResponse_createdByIamUser = (GetBatchPredictionResponse -> Maybe Text)
-> (GetBatchPredictionResponse
    -> Maybe Text -> GetBatchPredictionResponse)
-> Lens
     GetBatchPredictionResponse
     GetBatchPredictionResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBatchPredictionResponse' {Maybe Text
createdByIamUser :: Maybe Text
$sel:createdByIamUser:GetBatchPredictionResponse' :: GetBatchPredictionResponse -> Maybe Text
createdByIamUser} -> Maybe Text
createdByIamUser) (\s :: GetBatchPredictionResponse
s@GetBatchPredictionResponse' {} Maybe Text
a -> GetBatchPredictionResponse
s {$sel:createdByIamUser:GetBatchPredictionResponse' :: Maybe Text
createdByIamUser = Maybe Text
a} :: GetBatchPredictionResponse)

-- | A user-supplied name or description of the @BatchPrediction@.
getBatchPredictionResponse_name :: Lens.Lens' GetBatchPredictionResponse (Prelude.Maybe Prelude.Text)
getBatchPredictionResponse_name :: (Maybe Text -> f (Maybe Text))
-> GetBatchPredictionResponse -> f GetBatchPredictionResponse
getBatchPredictionResponse_name = (GetBatchPredictionResponse -> Maybe Text)
-> (GetBatchPredictionResponse
    -> Maybe Text -> GetBatchPredictionResponse)
-> Lens
     GetBatchPredictionResponse
     GetBatchPredictionResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBatchPredictionResponse' {Maybe Text
name :: Maybe Text
$sel:name:GetBatchPredictionResponse' :: GetBatchPredictionResponse -> Maybe Text
name} -> Maybe Text
name) (\s :: GetBatchPredictionResponse
s@GetBatchPredictionResponse' {} Maybe Text
a -> GetBatchPredictionResponse
s {$sel:name:GetBatchPredictionResponse' :: Maybe Text
name = Maybe Text
a} :: GetBatchPredictionResponse)

-- | A link to the file that contains logs of the @CreateBatchPrediction@
-- operation.
getBatchPredictionResponse_logUri :: Lens.Lens' GetBatchPredictionResponse (Prelude.Maybe Prelude.Text)
getBatchPredictionResponse_logUri :: (Maybe Text -> f (Maybe Text))
-> GetBatchPredictionResponse -> f GetBatchPredictionResponse
getBatchPredictionResponse_logUri = (GetBatchPredictionResponse -> Maybe Text)
-> (GetBatchPredictionResponse
    -> Maybe Text -> GetBatchPredictionResponse)
-> Lens
     GetBatchPredictionResponse
     GetBatchPredictionResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBatchPredictionResponse' {Maybe Text
logUri :: Maybe Text
$sel:logUri:GetBatchPredictionResponse' :: GetBatchPredictionResponse -> Maybe Text
logUri} -> Maybe Text
logUri) (\s :: GetBatchPredictionResponse
s@GetBatchPredictionResponse' {} Maybe Text
a -> GetBatchPredictionResponse
s {$sel:logUri:GetBatchPredictionResponse' :: Maybe Text
logUri = Maybe Text
a} :: GetBatchPredictionResponse)

-- | A description of the most recent details about processing the batch
-- prediction request.
getBatchPredictionResponse_message :: Lens.Lens' GetBatchPredictionResponse (Prelude.Maybe Prelude.Text)
getBatchPredictionResponse_message :: (Maybe Text -> f (Maybe Text))
-> GetBatchPredictionResponse -> f GetBatchPredictionResponse
getBatchPredictionResponse_message = (GetBatchPredictionResponse -> Maybe Text)
-> (GetBatchPredictionResponse
    -> Maybe Text -> GetBatchPredictionResponse)
-> Lens
     GetBatchPredictionResponse
     GetBatchPredictionResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBatchPredictionResponse' {Maybe Text
message :: Maybe Text
$sel:message:GetBatchPredictionResponse' :: GetBatchPredictionResponse -> Maybe Text
message} -> Maybe Text
message) (\s :: GetBatchPredictionResponse
s@GetBatchPredictionResponse' {} Maybe Text
a -> GetBatchPredictionResponse
s {$sel:message:GetBatchPredictionResponse' :: Maybe Text
message = Maybe Text
a} :: GetBatchPredictionResponse)

-- | The location of an Amazon S3 bucket or directory to receive the
-- operation results.
getBatchPredictionResponse_outputUri :: Lens.Lens' GetBatchPredictionResponse (Prelude.Maybe Prelude.Text)
getBatchPredictionResponse_outputUri :: (Maybe Text -> f (Maybe Text))
-> GetBatchPredictionResponse -> f GetBatchPredictionResponse
getBatchPredictionResponse_outputUri = (GetBatchPredictionResponse -> Maybe Text)
-> (GetBatchPredictionResponse
    -> Maybe Text -> GetBatchPredictionResponse)
-> Lens
     GetBatchPredictionResponse
     GetBatchPredictionResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBatchPredictionResponse' {Maybe Text
outputUri :: Maybe Text
$sel:outputUri:GetBatchPredictionResponse' :: GetBatchPredictionResponse -> Maybe Text
outputUri} -> Maybe Text
outputUri) (\s :: GetBatchPredictionResponse
s@GetBatchPredictionResponse' {} Maybe Text
a -> GetBatchPredictionResponse
s {$sel:outputUri:GetBatchPredictionResponse' :: Maybe Text
outputUri = Maybe Text
a} :: GetBatchPredictionResponse)

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

instance Prelude.NFData GetBatchPredictionResponse