{-# 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.CreateRowData 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 CreateRowData = CreateRowData'
{
CreateRowData -> Text
batchItemId :: Prelude.Text,
CreateRowData -> HashMap Text CellInput
cellsToCreate :: Prelude.HashMap Prelude.Text CellInput
}
deriving (CreateRowData -> CreateRowData -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateRowData -> CreateRowData -> Bool
$c/= :: CreateRowData -> CreateRowData -> Bool
== :: CreateRowData -> CreateRowData -> Bool
$c== :: CreateRowData -> CreateRowData -> Bool
Prelude.Eq, Int -> CreateRowData -> ShowS
[CreateRowData] -> ShowS
CreateRowData -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateRowData] -> ShowS
$cshowList :: [CreateRowData] -> ShowS
show :: CreateRowData -> String
$cshow :: CreateRowData -> String
showsPrec :: Int -> CreateRowData -> ShowS
$cshowsPrec :: Int -> CreateRowData -> ShowS
Prelude.Show, forall x. Rep CreateRowData x -> CreateRowData
forall x. CreateRowData -> Rep CreateRowData x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateRowData x -> CreateRowData
$cfrom :: forall x. CreateRowData -> Rep CreateRowData x
Prelude.Generic)
newCreateRowData ::
Prelude.Text ->
CreateRowData
newCreateRowData :: Text -> CreateRowData
newCreateRowData Text
pBatchItemId_ =
CreateRowData'
{ $sel:batchItemId:CreateRowData' :: Text
batchItemId = Text
pBatchItemId_,
$sel:cellsToCreate:CreateRowData' :: HashMap Text CellInput
cellsToCreate = forall a. Monoid a => a
Prelude.mempty
}
createRowData_batchItemId :: Lens.Lens' CreateRowData Prelude.Text
createRowData_batchItemId :: Lens' CreateRowData Text
createRowData_batchItemId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRowData' {Text
batchItemId :: Text
$sel:batchItemId:CreateRowData' :: CreateRowData -> Text
batchItemId} -> Text
batchItemId) (\s :: CreateRowData
s@CreateRowData' {} Text
a -> CreateRowData
s {$sel:batchItemId:CreateRowData' :: Text
batchItemId = Text
a} :: CreateRowData)
createRowData_cellsToCreate :: Lens.Lens' CreateRowData (Prelude.HashMap Prelude.Text CellInput)
createRowData_cellsToCreate :: Lens' CreateRowData (HashMap Text CellInput)
createRowData_cellsToCreate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRowData' {HashMap Text CellInput
cellsToCreate :: HashMap Text CellInput
$sel:cellsToCreate:CreateRowData' :: CreateRowData -> HashMap Text CellInput
cellsToCreate} -> HashMap Text CellInput
cellsToCreate) (\s :: CreateRowData
s@CreateRowData' {} HashMap Text CellInput
a -> CreateRowData
s {$sel:cellsToCreate:CreateRowData' :: HashMap Text CellInput
cellsToCreate = HashMap Text CellInput
a} :: CreateRowData) 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 CreateRowData where
hashWithSalt :: Int -> CreateRowData -> Int
hashWithSalt Int
_salt CreateRowData' {Text
HashMap Text CellInput
cellsToCreate :: HashMap Text CellInput
batchItemId :: Text
$sel:cellsToCreate:CreateRowData' :: CreateRowData -> HashMap Text CellInput
$sel:batchItemId:CreateRowData' :: CreateRowData -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
batchItemId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` HashMap Text CellInput
cellsToCreate
instance Prelude.NFData CreateRowData where
rnf :: CreateRowData -> ()
rnf CreateRowData' {Text
HashMap Text CellInput
cellsToCreate :: HashMap Text CellInput
batchItemId :: Text
$sel:cellsToCreate:CreateRowData' :: CreateRowData -> HashMap Text CellInput
$sel:batchItemId:CreateRowData' :: CreateRowData -> 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 HashMap Text CellInput
cellsToCreate
instance Data.ToJSON CreateRowData where
toJSON :: CreateRowData -> Value
toJSON CreateRowData' {Text
HashMap Text CellInput
cellsToCreate :: HashMap Text CellInput
batchItemId :: Text
$sel:cellsToCreate:CreateRowData' :: CreateRowData -> HashMap Text CellInput
$sel:batchItemId:CreateRowData' :: CreateRowData -> 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
"cellsToCreate" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= HashMap Text CellInput
cellsToCreate)
]
)