{-# 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.UpdateRowData where
import qualified Amazonka.Core as Core
import Amazonka.HoneyCode.Types.CellInput
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data UpdateRowData = UpdateRowData'
{
UpdateRowData -> Text
rowId :: Prelude.Text,
UpdateRowData -> HashMap Text CellInput
cellsToUpdate :: Prelude.HashMap Prelude.Text CellInput
}
deriving (UpdateRowData -> UpdateRowData -> Bool
(UpdateRowData -> UpdateRowData -> Bool)
-> (UpdateRowData -> UpdateRowData -> Bool) -> Eq UpdateRowData
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateRowData -> UpdateRowData -> Bool
$c/= :: UpdateRowData -> UpdateRowData -> Bool
== :: UpdateRowData -> UpdateRowData -> Bool
$c== :: UpdateRowData -> UpdateRowData -> Bool
Prelude.Eq, Int -> UpdateRowData -> ShowS
[UpdateRowData] -> ShowS
UpdateRowData -> String
(Int -> UpdateRowData -> ShowS)
-> (UpdateRowData -> String)
-> ([UpdateRowData] -> ShowS)
-> Show UpdateRowData
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateRowData] -> ShowS
$cshowList :: [UpdateRowData] -> ShowS
show :: UpdateRowData -> String
$cshow :: UpdateRowData -> String
showsPrec :: Int -> UpdateRowData -> ShowS
$cshowsPrec :: Int -> UpdateRowData -> ShowS
Prelude.Show, (forall x. UpdateRowData -> Rep UpdateRowData x)
-> (forall x. Rep UpdateRowData x -> UpdateRowData)
-> Generic UpdateRowData
forall x. Rep UpdateRowData x -> UpdateRowData
forall x. UpdateRowData -> Rep UpdateRowData x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateRowData x -> UpdateRowData
$cfrom :: forall x. UpdateRowData -> Rep UpdateRowData x
Prelude.Generic)
newUpdateRowData ::
Prelude.Text ->
UpdateRowData
newUpdateRowData :: Text -> UpdateRowData
newUpdateRowData Text
pRowId_ =
UpdateRowData' :: Text -> HashMap Text CellInput -> UpdateRowData
UpdateRowData'
{ $sel:rowId:UpdateRowData' :: Text
rowId = Text
pRowId_,
$sel:cellsToUpdate:UpdateRowData' :: HashMap Text CellInput
cellsToUpdate = HashMap Text CellInput
forall a. Monoid a => a
Prelude.mempty
}
updateRowData_rowId :: Lens.Lens' UpdateRowData Prelude.Text
updateRowData_rowId :: (Text -> f Text) -> UpdateRowData -> f UpdateRowData
updateRowData_rowId = (UpdateRowData -> Text)
-> (UpdateRowData -> Text -> UpdateRowData)
-> Lens UpdateRowData UpdateRowData Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateRowData' {Text
rowId :: Text
$sel:rowId:UpdateRowData' :: UpdateRowData -> Text
rowId} -> Text
rowId) (\s :: UpdateRowData
s@UpdateRowData' {} Text
a -> UpdateRowData
s {$sel:rowId:UpdateRowData' :: Text
rowId = Text
a} :: UpdateRowData)
updateRowData_cellsToUpdate :: Lens.Lens' UpdateRowData (Prelude.HashMap Prelude.Text CellInput)
updateRowData_cellsToUpdate :: (HashMap Text CellInput -> f (HashMap Text CellInput))
-> UpdateRowData -> f UpdateRowData
updateRowData_cellsToUpdate = (UpdateRowData -> HashMap Text CellInput)
-> (UpdateRowData -> HashMap Text CellInput -> UpdateRowData)
-> Lens
UpdateRowData
UpdateRowData
(HashMap Text CellInput)
(HashMap Text CellInput)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateRowData' {HashMap Text CellInput
cellsToUpdate :: HashMap Text CellInput
$sel:cellsToUpdate:UpdateRowData' :: UpdateRowData -> HashMap Text CellInput
cellsToUpdate} -> HashMap Text CellInput
cellsToUpdate) (\s :: UpdateRowData
s@UpdateRowData' {} HashMap Text CellInput
a -> UpdateRowData
s {$sel:cellsToUpdate:UpdateRowData' :: HashMap Text CellInput
cellsToUpdate = HashMap Text CellInput
a} :: UpdateRowData) ((HashMap Text CellInput -> f (HashMap Text CellInput))
-> UpdateRowData -> f UpdateRowData)
-> ((HashMap Text CellInput -> f (HashMap Text CellInput))
-> HashMap Text CellInput -> f (HashMap Text CellInput))
-> (HashMap Text CellInput -> f (HashMap Text CellInput))
-> UpdateRowData
-> f UpdateRowData
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (HashMap Text CellInput -> f (HashMap Text CellInput))
-> HashMap Text CellInput -> f (HashMap Text CellInput)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Prelude.Hashable UpdateRowData
instance Prelude.NFData UpdateRowData
instance Core.ToJSON UpdateRowData where
toJSON :: UpdateRowData -> Value
toJSON UpdateRowData' {Text
HashMap Text CellInput
cellsToUpdate :: HashMap Text CellInput
rowId :: Text
$sel:cellsToUpdate:UpdateRowData' :: UpdateRowData -> HashMap Text CellInput
$sel:rowId:UpdateRowData' :: UpdateRowData -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"rowId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
rowId),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"cellsToUpdate" Text -> HashMap Text CellInput -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= HashMap Text CellInput
cellsToUpdate)
]
)