{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.SageMakerFeatureStoreRuntime.Types.BatchGetRecordResultDetail where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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.
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'
      { $sel:featureGroupName:BatchGetRecordResultDetail' :: Text
featureGroupName =
          Text
pFeatureGroupName_,
        $sel:recordIdentifierValueAsString:BatchGetRecordResultDetail' :: Text
recordIdentifierValueAsString =
          Text
pRecordIdentifierValueAsString_,
        $sel:record:BatchGetRecordResultDetail' :: NonEmpty FeatureValue
record = forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced 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 :: Lens' BatchGetRecordResultDetail Text
batchGetRecordResultDetail_featureGroupName = 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 :: Lens' BatchGetRecordResultDetail Text
batchGetRecordResultDetail_recordIdentifierValueAsString = 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 :: Lens' BatchGetRecordResultDetail (NonEmpty FeatureValue)
batchGetRecordResultDetail_record = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Data.FromJSON BatchGetRecordResultDetail where
  parseJSON :: Value -> Parser BatchGetRecordResultDetail
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"BatchGetRecordResultDetail"
      ( \Object
x ->
          Text -> Text -> NonEmpty FeatureValue -> BatchGetRecordResultDetail
BatchGetRecordResultDetail'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"FeatureGroupName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"RecordIdentifierValueAsString")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"Record")
      )

instance Prelude.Hashable BatchGetRecordResultDetail where
  hashWithSalt :: Int -> BatchGetRecordResultDetail -> Int
hashWithSalt Int
_salt BatchGetRecordResultDetail' {NonEmpty FeatureValue
Text
record :: NonEmpty FeatureValue
recordIdentifierValueAsString :: Text
featureGroupName :: Text
$sel:record:BatchGetRecordResultDetail' :: BatchGetRecordResultDetail -> NonEmpty FeatureValue
$sel:recordIdentifierValueAsString:BatchGetRecordResultDetail' :: BatchGetRecordResultDetail -> Text
$sel:featureGroupName:BatchGetRecordResultDetail' :: BatchGetRecordResultDetail -> Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
featureGroupName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
recordIdentifierValueAsString
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` NonEmpty FeatureValue
record

instance Prelude.NFData BatchGetRecordResultDetail where
  rnf :: BatchGetRecordResultDetail -> ()
rnf BatchGetRecordResultDetail' {NonEmpty FeatureValue
Text
record :: NonEmpty FeatureValue
recordIdentifierValueAsString :: Text
featureGroupName :: Text
$sel:record:BatchGetRecordResultDetail' :: BatchGetRecordResultDetail -> NonEmpty FeatureValue
$sel:recordIdentifierValueAsString:BatchGetRecordResultDetail' :: BatchGetRecordResultDetail -> Text
$sel:featureGroupName:BatchGetRecordResultDetail' :: BatchGetRecordResultDetail -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
featureGroupName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
recordIdentifierValueAsString
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf NonEmpty FeatureValue
record