{-# 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 Amazonka.HoneyCode.Types.CellInput
import qualified Amazonka.Lens as Lens
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
(CreateRowData -> CreateRowData -> Bool)
-> (CreateRowData -> CreateRowData -> Bool) -> Eq CreateRowData
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
(Int -> CreateRowData -> ShowS)
-> (CreateRowData -> String)
-> ([CreateRowData] -> ShowS)
-> Show CreateRowData
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. CreateRowData -> Rep CreateRowData x)
-> (forall x. Rep CreateRowData x -> CreateRowData)
-> Generic CreateRowData
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' :: Text -> HashMap Text CellInput -> CreateRowData
CreateRowData'
{ $sel:batchItemId:CreateRowData' :: Text
batchItemId = Text
pBatchItemId_,
$sel:cellsToCreate:CreateRowData' :: HashMap Text CellInput
cellsToCreate = HashMap Text CellInput
forall a. Monoid a => a
Prelude.mempty
}
createRowData_batchItemId :: Lens.Lens' CreateRowData Prelude.Text
createRowData_batchItemId :: (Text -> f Text) -> CreateRowData -> f CreateRowData
createRowData_batchItemId = (CreateRowData -> Text)
-> (CreateRowData -> Text -> CreateRowData)
-> Lens CreateRowData CreateRowData Text Text
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 :: (HashMap Text CellInput -> f (HashMap Text CellInput))
-> CreateRowData -> f CreateRowData
createRowData_cellsToCreate = (CreateRowData -> HashMap Text CellInput)
-> (CreateRowData -> HashMap Text CellInput -> CreateRowData)
-> Lens
CreateRowData
CreateRowData
(HashMap Text CellInput)
(HashMap Text CellInput)
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) ((HashMap Text CellInput -> f (HashMap Text CellInput))
-> CreateRowData -> f CreateRowData)
-> ((HashMap Text CellInput -> f (HashMap Text CellInput))
-> HashMap Text CellInput -> f (HashMap Text CellInput))
-> (HashMap Text CellInput -> f (HashMap Text CellInput))
-> CreateRowData
-> f CreateRowData
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 CreateRowData
instance Prelude.NFData CreateRowData
instance Core.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
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"batchItemId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
batchItemId),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"cellsToCreate" Text -> HashMap Text CellInput -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= HashMap Text CellInput
cellsToCreate)
]
)