{-# 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.UpsertRowData 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.CellInput
import Amazonka.HoneyCode.Types.Filter
import qualified Amazonka.Prelude as Prelude
data UpsertRowData = UpsertRowData'
{
UpsertRowData -> Text
batchItemId :: Prelude.Text,
UpsertRowData -> Filter
filter' :: Filter,
UpsertRowData -> HashMap Text CellInput
cellsToUpdate :: Prelude.HashMap Prelude.Text CellInput
}
deriving (UpsertRowData -> UpsertRowData -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpsertRowData -> UpsertRowData -> Bool
$c/= :: UpsertRowData -> UpsertRowData -> Bool
== :: UpsertRowData -> UpsertRowData -> Bool
$c== :: UpsertRowData -> UpsertRowData -> Bool
Prelude.Eq, Int -> UpsertRowData -> ShowS
[UpsertRowData] -> ShowS
UpsertRowData -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpsertRowData] -> ShowS
$cshowList :: [UpsertRowData] -> ShowS
show :: UpsertRowData -> String
$cshow :: UpsertRowData -> String
showsPrec :: Int -> UpsertRowData -> ShowS
$cshowsPrec :: Int -> UpsertRowData -> ShowS
Prelude.Show, forall x. Rep UpsertRowData x -> UpsertRowData
forall x. UpsertRowData -> Rep UpsertRowData x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpsertRowData x -> UpsertRowData
$cfrom :: forall x. UpsertRowData -> Rep UpsertRowData x
Prelude.Generic)
newUpsertRowData ::
Prelude.Text ->
Filter ->
UpsertRowData
newUpsertRowData :: Text -> Filter -> UpsertRowData
newUpsertRowData Text
pBatchItemId_ Filter
pFilter_ =
UpsertRowData'
{ $sel:batchItemId:UpsertRowData' :: Text
batchItemId = Text
pBatchItemId_,
$sel:filter':UpsertRowData' :: Filter
filter' = Filter
pFilter_,
$sel:cellsToUpdate:UpsertRowData' :: HashMap Text CellInput
cellsToUpdate = forall a. Monoid a => a
Prelude.mempty
}
upsertRowData_batchItemId :: Lens.Lens' UpsertRowData Prelude.Text
upsertRowData_batchItemId :: Lens' UpsertRowData Text
upsertRowData_batchItemId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpsertRowData' {Text
batchItemId :: Text
$sel:batchItemId:UpsertRowData' :: UpsertRowData -> Text
batchItemId} -> Text
batchItemId) (\s :: UpsertRowData
s@UpsertRowData' {} Text
a -> UpsertRowData
s {$sel:batchItemId:UpsertRowData' :: Text
batchItemId = Text
a} :: UpsertRowData)
upsertRowData_filter :: Lens.Lens' UpsertRowData Filter
upsertRowData_filter :: Lens' UpsertRowData Filter
upsertRowData_filter = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpsertRowData' {Filter
filter' :: Filter
$sel:filter':UpsertRowData' :: UpsertRowData -> Filter
filter'} -> Filter
filter') (\s :: UpsertRowData
s@UpsertRowData' {} Filter
a -> UpsertRowData
s {$sel:filter':UpsertRowData' :: Filter
filter' = Filter
a} :: UpsertRowData)
upsertRowData_cellsToUpdate :: Lens.Lens' UpsertRowData (Prelude.HashMap Prelude.Text CellInput)
upsertRowData_cellsToUpdate :: Lens' UpsertRowData (HashMap Text CellInput)
upsertRowData_cellsToUpdate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpsertRowData' {HashMap Text CellInput
cellsToUpdate :: HashMap Text CellInput
$sel:cellsToUpdate:UpsertRowData' :: UpsertRowData -> HashMap Text CellInput
cellsToUpdate} -> HashMap Text CellInput
cellsToUpdate) (\s :: UpsertRowData
s@UpsertRowData' {} HashMap Text CellInput
a -> UpsertRowData
s {$sel:cellsToUpdate:UpsertRowData' :: HashMap Text CellInput
cellsToUpdate = HashMap Text CellInput
a} :: UpsertRowData) 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 Prelude.Hashable UpsertRowData where
hashWithSalt :: Int -> UpsertRowData -> Int
hashWithSalt Int
_salt UpsertRowData' {Text
HashMap Text CellInput
Filter
cellsToUpdate :: HashMap Text CellInput
filter' :: Filter
batchItemId :: Text
$sel:cellsToUpdate:UpsertRowData' :: UpsertRowData -> HashMap Text CellInput
$sel:filter':UpsertRowData' :: UpsertRowData -> Filter
$sel:batchItemId:UpsertRowData' :: UpsertRowData -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
batchItemId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Filter
filter'
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` HashMap Text CellInput
cellsToUpdate
instance Prelude.NFData UpsertRowData where
rnf :: UpsertRowData -> ()
rnf UpsertRowData' {Text
HashMap Text CellInput
Filter
cellsToUpdate :: HashMap Text CellInput
filter' :: Filter
batchItemId :: Text
$sel:cellsToUpdate:UpsertRowData' :: UpsertRowData -> HashMap Text CellInput
$sel:filter':UpsertRowData' :: UpsertRowData -> Filter
$sel:batchItemId:UpsertRowData' :: UpsertRowData -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
batchItemId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Filter
filter'
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf HashMap Text CellInput
cellsToUpdate
instance Data.ToJSON UpsertRowData where
toJSON :: UpsertRowData -> Value
toJSON UpsertRowData' {Text
HashMap Text CellInput
Filter
cellsToUpdate :: HashMap Text CellInput
filter' :: Filter
batchItemId :: Text
$sel:cellsToUpdate:UpsertRowData' :: UpsertRowData -> HashMap Text CellInput
$sel:filter':UpsertRowData' :: UpsertRowData -> Filter
$sel:batchItemId:UpsertRowData' :: UpsertRowData -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"batchItemId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
batchItemId),
forall a. a -> Maybe a
Prelude.Just (Key
"filter" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Filter
filter'),
forall a. a -> Maybe a
Prelude.Just
(Key
"cellsToUpdate" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= HashMap Text CellInput
cellsToUpdate)
]
)