{-# 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.BatchGetRecordResultDetail
-- 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.BatchGetRecordResultDetail where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SageMakerFeatureStoreRuntime.Types.FeatureValue

-- | The output of Records that have been retrieved in a batch.
--
-- /See:/ 'newBatchGetRecordResultDetail' smart constructor.
data BatchGetRecordResultDetail = BatchGetRecordResultDetail'
  { -- | The @FeatureGroupName@ containing Records you retrieved in a batch.
    BatchGetRecordResultDetail -> Text
featureGroupName :: Prelude.Text,
    -- | The value of the record identifer in string format.
    BatchGetRecordResultDetail -> Text
recordIdentifierValueAsString :: Prelude.Text,
    -- | The @Record@ retrieved.
    BatchGetRecordResultDetail -> NonEmpty FeatureValue
record :: Prelude.NonEmpty FeatureValue
  }
  deriving (BatchGetRecordResultDetail -> BatchGetRecordResultDetail -> Bool
(BatchGetRecordResultDetail -> BatchGetRecordResultDetail -> Bool)
-> (BatchGetRecordResultDetail
    -> BatchGetRecordResultDetail -> Bool)
-> Eq BatchGetRecordResultDetail
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchGetRecordResultDetail -> BatchGetRecordResultDetail -> Bool
$c/= :: BatchGetRecordResultDetail -> BatchGetRecordResultDetail -> Bool
== :: BatchGetRecordResultDetail -> BatchGetRecordResultDetail -> Bool
$c== :: BatchGetRecordResultDetail -> BatchGetRecordResultDetail -> Bool
Prelude.Eq, ReadPrec [BatchGetRecordResultDetail]
ReadPrec BatchGetRecordResultDetail
Int -> ReadS BatchGetRecordResultDetail
ReadS [BatchGetRecordResultDetail]
(Int -> ReadS BatchGetRecordResultDetail)
-> ReadS [BatchGetRecordResultDetail]
-> ReadPrec BatchGetRecordResultDetail
-> ReadPrec [BatchGetRecordResultDetail]
-> Read BatchGetRecordResultDetail
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchGetRecordResultDetail]
$creadListPrec :: ReadPrec [BatchGetRecordResultDetail]
readPrec :: ReadPrec BatchGetRecordResultDetail
$creadPrec :: ReadPrec BatchGetRecordResultDetail
readList :: ReadS [BatchGetRecordResultDetail]
$creadList :: ReadS [BatchGetRecordResultDetail]
readsPrec :: Int -> ReadS BatchGetRecordResultDetail
$creadsPrec :: Int -> ReadS BatchGetRecordResultDetail
Prelude.Read, Int -> BatchGetRecordResultDetail -> ShowS
[BatchGetRecordResultDetail] -> ShowS
BatchGetRecordResultDetail -> String
(Int -> BatchGetRecordResultDetail -> ShowS)
-> (BatchGetRecordResultDetail -> String)
-> ([BatchGetRecordResultDetail] -> ShowS)
-> Show BatchGetRecordResultDetail
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchGetRecordResultDetail] -> ShowS
$cshowList :: [BatchGetRecordResultDetail] -> ShowS
show :: BatchGetRecordResultDetail -> String
$cshow :: BatchGetRecordResultDetail -> String
showsPrec :: Int -> BatchGetRecordResultDetail -> ShowS
$cshowsPrec :: Int -> BatchGetRecordResultDetail -> ShowS
Prelude.Show, (forall x.
 BatchGetRecordResultDetail -> Rep BatchGetRecordResultDetail x)
-> (forall x.
    Rep BatchGetRecordResultDetail x -> BatchGetRecordResultDetail)
-> Generic BatchGetRecordResultDetail
forall x.
Rep BatchGetRecordResultDetail x -> BatchGetRecordResultDetail
forall x.
BatchGetRecordResultDetail -> Rep BatchGetRecordResultDetail x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BatchGetRecordResultDetail x -> BatchGetRecordResultDetail
$cfrom :: forall x.
BatchGetRecordResultDetail -> Rep BatchGetRecordResultDetail x
Prelude.Generic)

-- |
-- Create a value of 'BatchGetRecordResultDetail' 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', 'batchGetRecordResultDetail_featureGroupName' - The @FeatureGroupName@ containing Records you retrieved in a batch.
--
-- 'recordIdentifierValueAsString', 'batchGetRecordResultDetail_recordIdentifierValueAsString' - The value of the record identifer in string format.
--
-- 'record', 'batchGetRecordResultDetail_record' - The @Record@ retrieved.
newBatchGetRecordResultDetail ::
  -- | 'featureGroupName'
  Prelude.Text ->
  -- | 'recordIdentifierValueAsString'
  Prelude.Text ->
  -- | 'record'
  Prelude.NonEmpty FeatureValue ->
  BatchGetRecordResultDetail
newBatchGetRecordResultDetail :: Text -> Text -> NonEmpty FeatureValue -> BatchGetRecordResultDetail
newBatchGetRecordResultDetail
  Text
pFeatureGroupName_
  Text
pRecordIdentifierValueAsString_
  NonEmpty FeatureValue
pRecord_ =
    BatchGetRecordResultDetail' :: Text -> Text -> NonEmpty FeatureValue -> BatchGetRecordResultDetail
BatchGetRecordResultDetail'
      { $sel:featureGroupName:BatchGetRecordResultDetail' :: Text
featureGroupName =
          Text
pFeatureGroupName_,
        $sel:recordIdentifierValueAsString:BatchGetRecordResultDetail' :: Text
recordIdentifierValueAsString =
          Text
pRecordIdentifierValueAsString_,
        $sel:record:BatchGetRecordResultDetail' :: NonEmpty FeatureValue
record = Tagged (NonEmpty FeatureValue) (Identity (NonEmpty FeatureValue))
-> Tagged
     (NonEmpty FeatureValue) (Identity (NonEmpty FeatureValue))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced (Tagged (NonEmpty FeatureValue) (Identity (NonEmpty FeatureValue))
 -> Tagged
      (NonEmpty FeatureValue) (Identity (NonEmpty FeatureValue)))
-> NonEmpty FeatureValue -> NonEmpty FeatureValue
forall t b. AReview t b -> b -> t
Lens.# NonEmpty FeatureValue
pRecord_
      }

-- | The @FeatureGroupName@ containing Records you retrieved in a batch.
batchGetRecordResultDetail_featureGroupName :: Lens.Lens' BatchGetRecordResultDetail Prelude.Text
batchGetRecordResultDetail_featureGroupName :: (Text -> f Text)
-> BatchGetRecordResultDetail -> f BatchGetRecordResultDetail
batchGetRecordResultDetail_featureGroupName = (BatchGetRecordResultDetail -> Text)
-> (BatchGetRecordResultDetail
    -> Text -> BatchGetRecordResultDetail)
-> Lens
     BatchGetRecordResultDetail BatchGetRecordResultDetail Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchGetRecordResultDetail' {Text
featureGroupName :: Text
$sel:featureGroupName:BatchGetRecordResultDetail' :: BatchGetRecordResultDetail -> Text
featureGroupName} -> Text
featureGroupName) (\s :: BatchGetRecordResultDetail
s@BatchGetRecordResultDetail' {} Text
a -> BatchGetRecordResultDetail
s {$sel:featureGroupName:BatchGetRecordResultDetail' :: Text
featureGroupName = Text
a} :: BatchGetRecordResultDetail)

-- | The value of the record identifer in string format.
batchGetRecordResultDetail_recordIdentifierValueAsString :: Lens.Lens' BatchGetRecordResultDetail Prelude.Text
batchGetRecordResultDetail_recordIdentifierValueAsString :: (Text -> f Text)
-> BatchGetRecordResultDetail -> f BatchGetRecordResultDetail
batchGetRecordResultDetail_recordIdentifierValueAsString = (BatchGetRecordResultDetail -> Text)
-> (BatchGetRecordResultDetail
    -> Text -> BatchGetRecordResultDetail)
-> Lens
     BatchGetRecordResultDetail BatchGetRecordResultDetail Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchGetRecordResultDetail' {Text
recordIdentifierValueAsString :: Text
$sel:recordIdentifierValueAsString:BatchGetRecordResultDetail' :: BatchGetRecordResultDetail -> Text
recordIdentifierValueAsString} -> Text
recordIdentifierValueAsString) (\s :: BatchGetRecordResultDetail
s@BatchGetRecordResultDetail' {} Text
a -> BatchGetRecordResultDetail
s {$sel:recordIdentifierValueAsString:BatchGetRecordResultDetail' :: Text
recordIdentifierValueAsString = Text
a} :: BatchGetRecordResultDetail)

-- | The @Record@ retrieved.
batchGetRecordResultDetail_record :: Lens.Lens' BatchGetRecordResultDetail (Prelude.NonEmpty FeatureValue)
batchGetRecordResultDetail_record :: (NonEmpty FeatureValue -> f (NonEmpty FeatureValue))
-> BatchGetRecordResultDetail -> f BatchGetRecordResultDetail
batchGetRecordResultDetail_record = (BatchGetRecordResultDetail -> NonEmpty FeatureValue)
-> (BatchGetRecordResultDetail
    -> NonEmpty FeatureValue -> BatchGetRecordResultDetail)
-> Lens
     BatchGetRecordResultDetail
     BatchGetRecordResultDetail
     (NonEmpty FeatureValue)
     (NonEmpty FeatureValue)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchGetRecordResultDetail' {NonEmpty FeatureValue
record :: NonEmpty FeatureValue
$sel:record:BatchGetRecordResultDetail' :: BatchGetRecordResultDetail -> NonEmpty FeatureValue
record} -> NonEmpty FeatureValue
record) (\s :: BatchGetRecordResultDetail
s@BatchGetRecordResultDetail' {} NonEmpty FeatureValue
a -> BatchGetRecordResultDetail
s {$sel:record:BatchGetRecordResultDetail' :: NonEmpty FeatureValue
record = NonEmpty FeatureValue
a} :: BatchGetRecordResultDetail) ((NonEmpty FeatureValue -> f (NonEmpty FeatureValue))
 -> BatchGetRecordResultDetail -> f BatchGetRecordResultDetail)
-> ((NonEmpty FeatureValue -> f (NonEmpty FeatureValue))
    -> NonEmpty FeatureValue -> f (NonEmpty FeatureValue))
-> (NonEmpty FeatureValue -> f (NonEmpty FeatureValue))
-> BatchGetRecordResultDetail
-> f BatchGetRecordResultDetail
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NonEmpty FeatureValue -> f (NonEmpty FeatureValue))
-> NonEmpty FeatureValue -> f (NonEmpty FeatureValue)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.FromJSON BatchGetRecordResultDetail where
  parseJSON :: Value -> Parser BatchGetRecordResultDetail
parseJSON =
    String
-> (Object -> Parser BatchGetRecordResultDetail)
-> Value
-> Parser BatchGetRecordResultDetail
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"BatchGetRecordResultDetail"
      ( \Object
x ->
          Text -> Text -> NonEmpty FeatureValue -> BatchGetRecordResultDetail
BatchGetRecordResultDetail'
            (Text
 -> Text -> NonEmpty FeatureValue -> BatchGetRecordResultDetail)
-> Parser Text
-> Parser
     (Text -> NonEmpty FeatureValue -> BatchGetRecordResultDetail)
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 -> NonEmpty FeatureValue -> BatchGetRecordResultDetail)
-> Parser Text
-> Parser (NonEmpty FeatureValue -> BatchGetRecordResultDetail)
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 (NonEmpty FeatureValue -> BatchGetRecordResultDetail)
-> Parser (NonEmpty FeatureValue)
-> Parser BatchGetRecordResultDetail
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (NonEmpty FeatureValue)
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Record")
      )

instance Prelude.Hashable BatchGetRecordResultDetail

instance Prelude.NFData BatchGetRecordResultDetail