{-# 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 #-}
module Amazonka.HoneyCode.Types.UpsertRowsResult where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.HoneyCode.Types.UpsertAction
import qualified Amazonka.Prelude as Prelude
data UpsertRowsResult = UpsertRowsResult'
{
UpsertRowsResult -> NonEmpty Text
rowIds :: Prelude.NonEmpty Prelude.Text,
UpsertRowsResult -> UpsertAction
upsertAction :: UpsertAction
}
deriving (UpsertRowsResult -> UpsertRowsResult -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpsertRowsResult -> UpsertRowsResult -> Bool
$c/= :: UpsertRowsResult -> UpsertRowsResult -> Bool
== :: UpsertRowsResult -> UpsertRowsResult -> Bool
$c== :: UpsertRowsResult -> UpsertRowsResult -> Bool
Prelude.Eq, ReadPrec [UpsertRowsResult]
ReadPrec UpsertRowsResult
Int -> ReadS UpsertRowsResult
ReadS [UpsertRowsResult]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpsertRowsResult]
$creadListPrec :: ReadPrec [UpsertRowsResult]
readPrec :: ReadPrec UpsertRowsResult
$creadPrec :: ReadPrec UpsertRowsResult
readList :: ReadS [UpsertRowsResult]
$creadList :: ReadS [UpsertRowsResult]
readsPrec :: Int -> ReadS UpsertRowsResult
$creadsPrec :: Int -> ReadS UpsertRowsResult
Prelude.Read, Int -> UpsertRowsResult -> ShowS
[UpsertRowsResult] -> ShowS
UpsertRowsResult -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpsertRowsResult] -> ShowS
$cshowList :: [UpsertRowsResult] -> ShowS
show :: UpsertRowsResult -> String
$cshow :: UpsertRowsResult -> String
showsPrec :: Int -> UpsertRowsResult -> ShowS
$cshowsPrec :: Int -> UpsertRowsResult -> ShowS
Prelude.Show, forall x. Rep UpsertRowsResult x -> UpsertRowsResult
forall x. UpsertRowsResult -> Rep UpsertRowsResult x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpsertRowsResult x -> UpsertRowsResult
$cfrom :: forall x. UpsertRowsResult -> Rep UpsertRowsResult x
Prelude.Generic)
newUpsertRowsResult ::
Prelude.NonEmpty Prelude.Text ->
UpsertAction ->
UpsertRowsResult
newUpsertRowsResult :: NonEmpty Text -> UpsertAction -> UpsertRowsResult
newUpsertRowsResult NonEmpty Text
pRowIds_ UpsertAction
pUpsertAction_ =
UpsertRowsResult'
{ $sel:rowIds:UpsertRowsResult' :: NonEmpty Text
rowIds =
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 Text
pRowIds_,
$sel:upsertAction:UpsertRowsResult' :: UpsertAction
upsertAction = UpsertAction
pUpsertAction_
}
upsertRowsResult_rowIds :: Lens.Lens' UpsertRowsResult (Prelude.NonEmpty Prelude.Text)
upsertRowsResult_rowIds :: Lens' UpsertRowsResult (NonEmpty Text)
upsertRowsResult_rowIds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpsertRowsResult' {NonEmpty Text
rowIds :: NonEmpty Text
$sel:rowIds:UpsertRowsResult' :: UpsertRowsResult -> NonEmpty Text
rowIds} -> NonEmpty Text
rowIds) (\s :: UpsertRowsResult
s@UpsertRowsResult' {} NonEmpty Text
a -> UpsertRowsResult
s {$sel:rowIds:UpsertRowsResult' :: NonEmpty Text
rowIds = NonEmpty Text
a} :: UpsertRowsResult) 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
upsertRowsResult_upsertAction :: Lens.Lens' UpsertRowsResult UpsertAction
upsertRowsResult_upsertAction :: Lens' UpsertRowsResult UpsertAction
upsertRowsResult_upsertAction = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpsertRowsResult' {UpsertAction
upsertAction :: UpsertAction
$sel:upsertAction:UpsertRowsResult' :: UpsertRowsResult -> UpsertAction
upsertAction} -> UpsertAction
upsertAction) (\s :: UpsertRowsResult
s@UpsertRowsResult' {} UpsertAction
a -> UpsertRowsResult
s {$sel:upsertAction:UpsertRowsResult' :: UpsertAction
upsertAction = UpsertAction
a} :: UpsertRowsResult)
instance Data.FromJSON UpsertRowsResult where
parseJSON :: Value -> Parser UpsertRowsResult
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"UpsertRowsResult"
( \Object
x ->
NonEmpty Text -> UpsertAction -> UpsertRowsResult
UpsertRowsResult'
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
"rowIds")
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
"upsertAction")
)
instance Prelude.Hashable UpsertRowsResult where
hashWithSalt :: Int -> UpsertRowsResult -> Int
hashWithSalt Int
_salt UpsertRowsResult' {NonEmpty Text
UpsertAction
upsertAction :: UpsertAction
rowIds :: NonEmpty Text
$sel:upsertAction:UpsertRowsResult' :: UpsertRowsResult -> UpsertAction
$sel:rowIds:UpsertRowsResult' :: UpsertRowsResult -> NonEmpty Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` NonEmpty Text
rowIds
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` UpsertAction
upsertAction
instance Prelude.NFData UpsertRowsResult where
rnf :: UpsertRowsResult -> ()
rnf UpsertRowsResult' {NonEmpty Text
UpsertAction
upsertAction :: UpsertAction
rowIds :: NonEmpty Text
$sel:upsertAction:UpsertRowsResult' :: UpsertRowsResult -> UpsertAction
$sel:rowIds:UpsertRowsResult' :: UpsertRowsResult -> NonEmpty Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf NonEmpty Text
rowIds
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf UpsertAction
upsertAction