{-# 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 Amazonka.HoneyCode.Types.UpsertAction
import qualified Amazonka.Lens as Lens
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
(UpsertRowsResult -> UpsertRowsResult -> Bool)
-> (UpsertRowsResult -> UpsertRowsResult -> Bool)
-> Eq UpsertRowsResult
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]
(Int -> ReadS UpsertRowsResult)
-> ReadS [UpsertRowsResult]
-> ReadPrec UpsertRowsResult
-> ReadPrec [UpsertRowsResult]
-> Read 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
(Int -> UpsertRowsResult -> ShowS)
-> (UpsertRowsResult -> String)
-> ([UpsertRowsResult] -> ShowS)
-> Show UpsertRowsResult
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. UpsertRowsResult -> Rep UpsertRowsResult x)
-> (forall x. Rep UpsertRowsResult x -> UpsertRowsResult)
-> Generic UpsertRowsResult
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' :: NonEmpty Text -> UpsertAction -> UpsertRowsResult
UpsertRowsResult'
{ $sel:rowIds:UpsertRowsResult' :: NonEmpty Text
rowIds =
Tagged (NonEmpty Text) (Identity (NonEmpty Text))
-> Tagged (NonEmpty Text) (Identity (NonEmpty Text))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced (Tagged (NonEmpty Text) (Identity (NonEmpty Text))
-> Tagged (NonEmpty Text) (Identity (NonEmpty Text)))
-> NonEmpty Text -> NonEmpty Text
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 :: (NonEmpty Text -> f (NonEmpty Text))
-> UpsertRowsResult -> f UpsertRowsResult
upsertRowsResult_rowIds = (UpsertRowsResult -> NonEmpty Text)
-> (UpsertRowsResult -> NonEmpty Text -> UpsertRowsResult)
-> Lens
UpsertRowsResult UpsertRowsResult (NonEmpty Text) (NonEmpty Text)
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) ((NonEmpty Text -> f (NonEmpty Text))
-> UpsertRowsResult -> f UpsertRowsResult)
-> ((NonEmpty Text -> f (NonEmpty Text))
-> NonEmpty Text -> f (NonEmpty Text))
-> (NonEmpty Text -> f (NonEmpty Text))
-> UpsertRowsResult
-> f UpsertRowsResult
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NonEmpty Text -> f (NonEmpty Text))
-> NonEmpty Text -> f (NonEmpty Text)
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 :: (UpsertAction -> f UpsertAction)
-> UpsertRowsResult -> f UpsertRowsResult
upsertRowsResult_upsertAction = (UpsertRowsResult -> UpsertAction)
-> (UpsertRowsResult -> UpsertAction -> UpsertRowsResult)
-> Lens UpsertRowsResult UpsertRowsResult UpsertAction 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 Core.FromJSON UpsertRowsResult where
parseJSON :: Value -> Parser UpsertRowsResult
parseJSON =
String
-> (Object -> Parser UpsertRowsResult)
-> Value
-> Parser UpsertRowsResult
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"UpsertRowsResult"
( \Object
x ->
NonEmpty Text -> UpsertAction -> UpsertRowsResult
UpsertRowsResult'
(NonEmpty Text -> UpsertAction -> UpsertRowsResult)
-> Parser (NonEmpty Text)
-> Parser (UpsertAction -> UpsertRowsResult)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (NonEmpty Text)
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"rowIds")
Parser (UpsertAction -> UpsertRowsResult)
-> Parser UpsertAction -> Parser UpsertRowsResult
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser UpsertAction
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"upsertAction")
)
instance Prelude.Hashable UpsertRowsResult
instance Prelude.NFData UpsertRowsResult