{-# 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 #-}
module Amazonka.SageMakerFeatureStoreRuntime.PutRecord
(
PutRecord (..),
newPutRecord,
putRecord_targetStores,
putRecord_featureGroupName,
putRecord_record,
PutRecordResponse (..),
newPutRecordResponse,
)
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 qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.SageMakerFeatureStoreRuntime.Types
data PutRecord = PutRecord'
{
PutRecord -> Maybe (NonEmpty TargetStore)
targetStores :: Prelude.Maybe (Prelude.NonEmpty TargetStore),
PutRecord -> Text
featureGroupName :: Prelude.Text,
PutRecord -> NonEmpty FeatureValue
record :: Prelude.NonEmpty FeatureValue
}
deriving (PutRecord -> PutRecord -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutRecord -> PutRecord -> Bool
$c/= :: PutRecord -> PutRecord -> Bool
== :: PutRecord -> PutRecord -> Bool
$c== :: PutRecord -> PutRecord -> Bool
Prelude.Eq, ReadPrec [PutRecord]
ReadPrec PutRecord
Int -> ReadS PutRecord
ReadS [PutRecord]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutRecord]
$creadListPrec :: ReadPrec [PutRecord]
readPrec :: ReadPrec PutRecord
$creadPrec :: ReadPrec PutRecord
readList :: ReadS [PutRecord]
$creadList :: ReadS [PutRecord]
readsPrec :: Int -> ReadS PutRecord
$creadsPrec :: Int -> ReadS PutRecord
Prelude.Read, Int -> PutRecord -> ShowS
[PutRecord] -> ShowS
PutRecord -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutRecord] -> ShowS
$cshowList :: [PutRecord] -> ShowS
show :: PutRecord -> String
$cshow :: PutRecord -> String
showsPrec :: Int -> PutRecord -> ShowS
$cshowsPrec :: Int -> PutRecord -> ShowS
Prelude.Show, forall x. Rep PutRecord x -> PutRecord
forall x. PutRecord -> Rep PutRecord x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PutRecord x -> PutRecord
$cfrom :: forall x. PutRecord -> Rep PutRecord x
Prelude.Generic)
newPutRecord ::
Prelude.Text ->
Prelude.NonEmpty FeatureValue ->
PutRecord
newPutRecord :: Text -> NonEmpty FeatureValue -> PutRecord
newPutRecord Text
pFeatureGroupName_ NonEmpty FeatureValue
pRecord_ =
PutRecord'
{ $sel:targetStores:PutRecord' :: Maybe (NonEmpty TargetStore)
targetStores = forall a. Maybe a
Prelude.Nothing,
$sel:featureGroupName:PutRecord' :: Text
featureGroupName = Text
pFeatureGroupName_,
$sel:record:PutRecord' :: 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_
}
putRecord_targetStores :: Lens.Lens' PutRecord (Prelude.Maybe (Prelude.NonEmpty TargetStore))
putRecord_targetStores :: Lens' PutRecord (Maybe (NonEmpty TargetStore))
putRecord_targetStores = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutRecord' {Maybe (NonEmpty TargetStore)
targetStores :: Maybe (NonEmpty TargetStore)
$sel:targetStores:PutRecord' :: PutRecord -> Maybe (NonEmpty TargetStore)
targetStores} -> Maybe (NonEmpty TargetStore)
targetStores) (\s :: PutRecord
s@PutRecord' {} Maybe (NonEmpty TargetStore)
a -> PutRecord
s {$sel:targetStores:PutRecord' :: Maybe (NonEmpty TargetStore)
targetStores = Maybe (NonEmpty TargetStore)
a} :: PutRecord) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
putRecord_featureGroupName :: Lens.Lens' PutRecord Prelude.Text
putRecord_featureGroupName :: Lens' PutRecord Text
putRecord_featureGroupName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutRecord' {Text
featureGroupName :: Text
$sel:featureGroupName:PutRecord' :: PutRecord -> Text
featureGroupName} -> Text
featureGroupName) (\s :: PutRecord
s@PutRecord' {} Text
a -> PutRecord
s {$sel:featureGroupName:PutRecord' :: Text
featureGroupName = Text
a} :: PutRecord)
putRecord_record :: Lens.Lens' PutRecord (Prelude.NonEmpty FeatureValue)
putRecord_record :: Lens' PutRecord (NonEmpty FeatureValue)
putRecord_record = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutRecord' {NonEmpty FeatureValue
record :: NonEmpty FeatureValue
$sel:record:PutRecord' :: PutRecord -> NonEmpty FeatureValue
record} -> NonEmpty FeatureValue
record) (\s :: PutRecord
s@PutRecord' {} NonEmpty FeatureValue
a -> PutRecord
s {$sel:record:PutRecord' :: NonEmpty FeatureValue
record = NonEmpty FeatureValue
a} :: PutRecord) 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 Core.AWSRequest PutRecord where
type AWSResponse PutRecord = PutRecordResponse
request :: (Service -> Service) -> PutRecord -> Request PutRecord
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy PutRecord
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse PutRecord)))
response = forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull PutRecordResponse
PutRecordResponse'
instance Prelude.Hashable PutRecord where
hashWithSalt :: Int -> PutRecord -> Int
hashWithSalt Int
_salt PutRecord' {Maybe (NonEmpty TargetStore)
NonEmpty FeatureValue
Text
record :: NonEmpty FeatureValue
featureGroupName :: Text
targetStores :: Maybe (NonEmpty TargetStore)
$sel:record:PutRecord' :: PutRecord -> NonEmpty FeatureValue
$sel:featureGroupName:PutRecord' :: PutRecord -> Text
$sel:targetStores:PutRecord' :: PutRecord -> Maybe (NonEmpty TargetStore)
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty TargetStore)
targetStores
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
featureGroupName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` NonEmpty FeatureValue
record
instance Prelude.NFData PutRecord where
rnf :: PutRecord -> ()
rnf PutRecord' {Maybe (NonEmpty TargetStore)
NonEmpty FeatureValue
Text
record :: NonEmpty FeatureValue
featureGroupName :: Text
targetStores :: Maybe (NonEmpty TargetStore)
$sel:record:PutRecord' :: PutRecord -> NonEmpty FeatureValue
$sel:featureGroupName:PutRecord' :: PutRecord -> Text
$sel:targetStores:PutRecord' :: PutRecord -> Maybe (NonEmpty TargetStore)
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty TargetStore)
targetStores
seq :: forall a b. a -> b -> b
`Prelude.seq` 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 NonEmpty FeatureValue
record
instance Data.ToHeaders PutRecord where
toHeaders :: PutRecord -> [Header]
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> [Header]
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON PutRecord where
toJSON :: PutRecord -> Value
toJSON PutRecord' {Maybe (NonEmpty TargetStore)
NonEmpty FeatureValue
Text
record :: NonEmpty FeatureValue
featureGroupName :: Text
targetStores :: Maybe (NonEmpty TargetStore)
$sel:record:PutRecord' :: PutRecord -> NonEmpty FeatureValue
$sel:featureGroupName:PutRecord' :: PutRecord -> Text
$sel:targetStores:PutRecord' :: PutRecord -> Maybe (NonEmpty TargetStore)
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"TargetStores" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty TargetStore)
targetStores,
forall a. a -> Maybe a
Prelude.Just (Key
"Record" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= NonEmpty FeatureValue
record)
]
)
instance Data.ToPath PutRecord where
toPath :: PutRecord -> ByteString
toPath PutRecord' {Maybe (NonEmpty TargetStore)
NonEmpty FeatureValue
Text
record :: NonEmpty FeatureValue
featureGroupName :: Text
targetStores :: Maybe (NonEmpty TargetStore)
$sel:record:PutRecord' :: PutRecord -> NonEmpty FeatureValue
$sel:featureGroupName:PutRecord' :: PutRecord -> Text
$sel:targetStores:PutRecord' :: PutRecord -> Maybe (NonEmpty TargetStore)
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/FeatureGroup/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
featureGroupName]
instance Data.ToQuery PutRecord where
toQuery :: PutRecord -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data PutRecordResponse = PutRecordResponse'
{
}
deriving (PutRecordResponse -> PutRecordResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutRecordResponse -> PutRecordResponse -> Bool
$c/= :: PutRecordResponse -> PutRecordResponse -> Bool
== :: PutRecordResponse -> PutRecordResponse -> Bool
$c== :: PutRecordResponse -> PutRecordResponse -> Bool
Prelude.Eq, ReadPrec [PutRecordResponse]
ReadPrec PutRecordResponse
Int -> ReadS PutRecordResponse
ReadS [PutRecordResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutRecordResponse]
$creadListPrec :: ReadPrec [PutRecordResponse]
readPrec :: ReadPrec PutRecordResponse
$creadPrec :: ReadPrec PutRecordResponse
readList :: ReadS [PutRecordResponse]
$creadList :: ReadS [PutRecordResponse]
readsPrec :: Int -> ReadS PutRecordResponse
$creadsPrec :: Int -> ReadS PutRecordResponse
Prelude.Read, Int -> PutRecordResponse -> ShowS
[PutRecordResponse] -> ShowS
PutRecordResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutRecordResponse] -> ShowS
$cshowList :: [PutRecordResponse] -> ShowS
show :: PutRecordResponse -> String
$cshow :: PutRecordResponse -> String
showsPrec :: Int -> PutRecordResponse -> ShowS
$cshowsPrec :: Int -> PutRecordResponse -> ShowS
Prelude.Show, forall x. Rep PutRecordResponse x -> PutRecordResponse
forall x. PutRecordResponse -> Rep PutRecordResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PutRecordResponse x -> PutRecordResponse
$cfrom :: forall x. PutRecordResponse -> Rep PutRecordResponse x
Prelude.Generic)
newPutRecordResponse ::
PutRecordResponse
newPutRecordResponse :: PutRecordResponse
newPutRecordResponse = PutRecordResponse
PutRecordResponse'
instance Prelude.NFData PutRecordResponse where
rnf :: PutRecordResponse -> ()
rnf PutRecordResponse
_ = ()