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

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

-- |
-- Module      : Amazonka.SageMakerFeatureStoreRuntime.Types.BatchGetRecordError
-- 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)
module Amazonka.SageMakerFeatureStoreRuntime.Types.BatchGetRecordError where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | The error that has occurred when attempting to retrieve a batch of
-- Records.
--
-- /See:/ 'newBatchGetRecordError' smart constructor.
data BatchGetRecordError = BatchGetRecordError'
  { -- | The name of the feature group that the record belongs to.
    BatchGetRecordError -> Text
featureGroupName :: Prelude.Text,
    -- | The value for the @RecordIdentifier@ in string format of a Record from a
    -- @FeatureGroup@ that is causing an error when attempting to be retrieved.
    BatchGetRecordError -> Text
recordIdentifierValueAsString :: Prelude.Text,
    -- | The error code of an error that has occured when attempting to retrieve
    -- a batch of Records. For more information on errors, see
    -- <https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_feature_store_GetRecord.html#API_feature_store_GetRecord_Errors Errors>.
    BatchGetRecordError -> Text
errorCode :: Prelude.Text,
    -- | The error message of an error that has occured when attempting to
    -- retrieve a record in the batch.
    BatchGetRecordError -> Text
errorMessage :: Prelude.Text
  }
  deriving (BatchGetRecordError -> BatchGetRecordError -> Bool
(BatchGetRecordError -> BatchGetRecordError -> Bool)
-> (BatchGetRecordError -> BatchGetRecordError -> Bool)
-> Eq BatchGetRecordError
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchGetRecordError -> BatchGetRecordError -> Bool
$c/= :: BatchGetRecordError -> BatchGetRecordError -> Bool
== :: BatchGetRecordError -> BatchGetRecordError -> Bool
$c== :: BatchGetRecordError -> BatchGetRecordError -> Bool
Prelude.Eq, ReadPrec [BatchGetRecordError]
ReadPrec BatchGetRecordError
Int -> ReadS BatchGetRecordError
ReadS [BatchGetRecordError]
(Int -> ReadS BatchGetRecordError)
-> ReadS [BatchGetRecordError]
-> ReadPrec BatchGetRecordError
-> ReadPrec [BatchGetRecordError]
-> Read BatchGetRecordError
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchGetRecordError]
$creadListPrec :: ReadPrec [BatchGetRecordError]
readPrec :: ReadPrec BatchGetRecordError
$creadPrec :: ReadPrec BatchGetRecordError
readList :: ReadS [BatchGetRecordError]
$creadList :: ReadS [BatchGetRecordError]
readsPrec :: Int -> ReadS BatchGetRecordError
$creadsPrec :: Int -> ReadS BatchGetRecordError
Prelude.Read, Int -> BatchGetRecordError -> ShowS
[BatchGetRecordError] -> ShowS
BatchGetRecordError -> String
(Int -> BatchGetRecordError -> ShowS)
-> (BatchGetRecordError -> String)
-> ([BatchGetRecordError] -> ShowS)
-> Show BatchGetRecordError
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchGetRecordError] -> ShowS
$cshowList :: [BatchGetRecordError] -> ShowS
show :: BatchGetRecordError -> String
$cshow :: BatchGetRecordError -> String
showsPrec :: Int -> BatchGetRecordError -> ShowS
$cshowsPrec :: Int -> BatchGetRecordError -> ShowS
Prelude.Show, (forall x. BatchGetRecordError -> Rep BatchGetRecordError x)
-> (forall x. Rep BatchGetRecordError x -> BatchGetRecordError)
-> Generic BatchGetRecordError
forall x. Rep BatchGetRecordError x -> BatchGetRecordError
forall x. BatchGetRecordError -> Rep BatchGetRecordError x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BatchGetRecordError x -> BatchGetRecordError
$cfrom :: forall x. BatchGetRecordError -> Rep BatchGetRecordError x
Prelude.Generic)

-- |
-- Create a value of 'BatchGetRecordError' 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:
--
-- 'featureGroupName', 'batchGetRecordError_featureGroupName' - The name of the feature group that the record belongs to.
--
-- 'recordIdentifierValueAsString', 'batchGetRecordError_recordIdentifierValueAsString' - The value for the @RecordIdentifier@ in string format of a Record from a
-- @FeatureGroup@ that is causing an error when attempting to be retrieved.
--
-- 'errorCode', 'batchGetRecordError_errorCode' - The error code of an error that has occured when attempting to retrieve
-- a batch of Records. For more information on errors, see
-- <https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_feature_store_GetRecord.html#API_feature_store_GetRecord_Errors Errors>.
--
-- 'errorMessage', 'batchGetRecordError_errorMessage' - The error message of an error that has occured when attempting to
-- retrieve a record in the batch.
newBatchGetRecordError ::
  -- | 'featureGroupName'
  Prelude.Text ->
  -- | 'recordIdentifierValueAsString'
  Prelude.Text ->
  -- | 'errorCode'
  Prelude.Text ->
  -- | 'errorMessage'
  Prelude.Text ->
  BatchGetRecordError
newBatchGetRecordError :: Text -> Text -> Text -> Text -> BatchGetRecordError
newBatchGetRecordError
  Text
pFeatureGroupName_
  Text
pRecordIdentifierValueAsString_
  Text
pErrorCode_
  Text
pErrorMessage_ =
    BatchGetRecordError' :: Text -> Text -> Text -> Text -> BatchGetRecordError
BatchGetRecordError'
      { $sel:featureGroupName:BatchGetRecordError' :: Text
featureGroupName =
          Text
pFeatureGroupName_,
        $sel:recordIdentifierValueAsString:BatchGetRecordError' :: Text
recordIdentifierValueAsString =
          Text
pRecordIdentifierValueAsString_,
        $sel:errorCode:BatchGetRecordError' :: Text
errorCode = Text
pErrorCode_,
        $sel:errorMessage:BatchGetRecordError' :: Text
errorMessage = Text
pErrorMessage_
      }

-- | The name of the feature group that the record belongs to.
batchGetRecordError_featureGroupName :: Lens.Lens' BatchGetRecordError Prelude.Text
batchGetRecordError_featureGroupName :: (Text -> f Text) -> BatchGetRecordError -> f BatchGetRecordError
batchGetRecordError_featureGroupName = (BatchGetRecordError -> Text)
-> (BatchGetRecordError -> Text -> BatchGetRecordError)
-> Lens BatchGetRecordError BatchGetRecordError Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchGetRecordError' {Text
featureGroupName :: Text
$sel:featureGroupName:BatchGetRecordError' :: BatchGetRecordError -> Text
featureGroupName} -> Text
featureGroupName) (\s :: BatchGetRecordError
s@BatchGetRecordError' {} Text
a -> BatchGetRecordError
s {$sel:featureGroupName:BatchGetRecordError' :: Text
featureGroupName = Text
a} :: BatchGetRecordError)

-- | The value for the @RecordIdentifier@ in string format of a Record from a
-- @FeatureGroup@ that is causing an error when attempting to be retrieved.
batchGetRecordError_recordIdentifierValueAsString :: Lens.Lens' BatchGetRecordError Prelude.Text
batchGetRecordError_recordIdentifierValueAsString :: (Text -> f Text) -> BatchGetRecordError -> f BatchGetRecordError
batchGetRecordError_recordIdentifierValueAsString = (BatchGetRecordError -> Text)
-> (BatchGetRecordError -> Text -> BatchGetRecordError)
-> Lens BatchGetRecordError BatchGetRecordError Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchGetRecordError' {Text
recordIdentifierValueAsString :: Text
$sel:recordIdentifierValueAsString:BatchGetRecordError' :: BatchGetRecordError -> Text
recordIdentifierValueAsString} -> Text
recordIdentifierValueAsString) (\s :: BatchGetRecordError
s@BatchGetRecordError' {} Text
a -> BatchGetRecordError
s {$sel:recordIdentifierValueAsString:BatchGetRecordError' :: Text
recordIdentifierValueAsString = Text
a} :: BatchGetRecordError)

-- | The error code of an error that has occured when attempting to retrieve
-- a batch of Records. For more information on errors, see
-- <https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_feature_store_GetRecord.html#API_feature_store_GetRecord_Errors Errors>.
batchGetRecordError_errorCode :: Lens.Lens' BatchGetRecordError Prelude.Text
batchGetRecordError_errorCode :: (Text -> f Text) -> BatchGetRecordError -> f BatchGetRecordError
batchGetRecordError_errorCode = (BatchGetRecordError -> Text)
-> (BatchGetRecordError -> Text -> BatchGetRecordError)
-> Lens BatchGetRecordError BatchGetRecordError Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchGetRecordError' {Text
errorCode :: Text
$sel:errorCode:BatchGetRecordError' :: BatchGetRecordError -> Text
errorCode} -> Text
errorCode) (\s :: BatchGetRecordError
s@BatchGetRecordError' {} Text
a -> BatchGetRecordError
s {$sel:errorCode:BatchGetRecordError' :: Text
errorCode = Text
a} :: BatchGetRecordError)

-- | The error message of an error that has occured when attempting to
-- retrieve a record in the batch.
batchGetRecordError_errorMessage :: Lens.Lens' BatchGetRecordError Prelude.Text
batchGetRecordError_errorMessage :: (Text -> f Text) -> BatchGetRecordError -> f BatchGetRecordError
batchGetRecordError_errorMessage = (BatchGetRecordError -> Text)
-> (BatchGetRecordError -> Text -> BatchGetRecordError)
-> Lens BatchGetRecordError BatchGetRecordError Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchGetRecordError' {Text
errorMessage :: Text
$sel:errorMessage:BatchGetRecordError' :: BatchGetRecordError -> Text
errorMessage} -> Text
errorMessage) (\s :: BatchGetRecordError
s@BatchGetRecordError' {} Text
a -> BatchGetRecordError
s {$sel:errorMessage:BatchGetRecordError' :: Text
errorMessage = Text
a} :: BatchGetRecordError)

instance Core.FromJSON BatchGetRecordError where
  parseJSON :: Value -> Parser BatchGetRecordError
parseJSON =
    String
-> (Object -> Parser BatchGetRecordError)
-> Value
-> Parser BatchGetRecordError
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"BatchGetRecordError"
      ( \Object
x ->
          Text -> Text -> Text -> Text -> BatchGetRecordError
BatchGetRecordError'
            (Text -> Text -> Text -> Text -> BatchGetRecordError)
-> Parser Text
-> Parser (Text -> Text -> Text -> BatchGetRecordError)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"FeatureGroupName")
            Parser (Text -> Text -> Text -> BatchGetRecordError)
-> Parser Text -> Parser (Text -> Text -> BatchGetRecordError)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"RecordIdentifierValueAsString")
            Parser (Text -> Text -> BatchGetRecordError)
-> Parser Text -> Parser (Text -> BatchGetRecordError)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"ErrorCode")
            Parser (Text -> BatchGetRecordError)
-> Parser Text -> Parser BatchGetRecordError
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"ErrorMessage")
      )

instance Prelude.Hashable BatchGetRecordError

instance Prelude.NFData BatchGetRecordError