{-# 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 qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.HoneyCode.Types.CellInput
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
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
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. 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'
{ $sel:rowId:UpdateRowData' :: Text
rowId = Text
pRowId_,
$sel:cellsToUpdate:UpdateRowData' :: HashMap Text CellInput
cellsToUpdate = forall a. Monoid a => a
Prelude.mempty
}
updateRowData_rowId :: Lens.Lens' UpdateRowData Prelude.Text
updateRowData_rowId :: Lens' UpdateRowData Text
updateRowData_rowId = 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 :: Lens' UpdateRowData (HashMap Text CellInput)
updateRowData_cellsToUpdate = 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) 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 UpdateRowData where
hashWithSalt :: Int -> UpdateRowData -> Int
hashWithSalt Int
_salt UpdateRowData' {Text
HashMap Text CellInput
cellsToUpdate :: HashMap Text CellInput
rowId :: Text
$sel:cellsToUpdate:UpdateRowData' :: UpdateRowData -> HashMap Text CellInput
$sel:rowId:UpdateRowData' :: UpdateRowData -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
rowId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` HashMap Text CellInput
cellsToUpdate
instance Prelude.NFData UpdateRowData where
rnf :: UpdateRowData -> ()
rnf UpdateRowData' {Text
HashMap Text CellInput
cellsToUpdate :: HashMap Text CellInput
rowId :: Text
$sel:cellsToUpdate:UpdateRowData' :: UpdateRowData -> HashMap Text CellInput
$sel:rowId:UpdateRowData' :: UpdateRowData -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
rowId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf HashMap Text CellInput
cellsToUpdate
instance Data.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
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"rowId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
rowId),
forall a. a -> Maybe a
Prelude.Just
(Key
"cellsToUpdate" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= HashMap Text CellInput
cellsToUpdate)
]
)