{-# 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.QuickSight.Types.CreateColumnsOperation where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.QuickSight.Types.CalculatedColumn
data CreateColumnsOperation = CreateColumnsOperation'
{
CreateColumnsOperation -> NonEmpty CalculatedColumn
columns :: Prelude.NonEmpty CalculatedColumn
}
deriving (CreateColumnsOperation -> CreateColumnsOperation -> Bool
(CreateColumnsOperation -> CreateColumnsOperation -> Bool)
-> (CreateColumnsOperation -> CreateColumnsOperation -> Bool)
-> Eq CreateColumnsOperation
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateColumnsOperation -> CreateColumnsOperation -> Bool
$c/= :: CreateColumnsOperation -> CreateColumnsOperation -> Bool
== :: CreateColumnsOperation -> CreateColumnsOperation -> Bool
$c== :: CreateColumnsOperation -> CreateColumnsOperation -> Bool
Prelude.Eq, ReadPrec [CreateColumnsOperation]
ReadPrec CreateColumnsOperation
Int -> ReadS CreateColumnsOperation
ReadS [CreateColumnsOperation]
(Int -> ReadS CreateColumnsOperation)
-> ReadS [CreateColumnsOperation]
-> ReadPrec CreateColumnsOperation
-> ReadPrec [CreateColumnsOperation]
-> Read CreateColumnsOperation
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateColumnsOperation]
$creadListPrec :: ReadPrec [CreateColumnsOperation]
readPrec :: ReadPrec CreateColumnsOperation
$creadPrec :: ReadPrec CreateColumnsOperation
readList :: ReadS [CreateColumnsOperation]
$creadList :: ReadS [CreateColumnsOperation]
readsPrec :: Int -> ReadS CreateColumnsOperation
$creadsPrec :: Int -> ReadS CreateColumnsOperation
Prelude.Read, Int -> CreateColumnsOperation -> ShowS
[CreateColumnsOperation] -> ShowS
CreateColumnsOperation -> String
(Int -> CreateColumnsOperation -> ShowS)
-> (CreateColumnsOperation -> String)
-> ([CreateColumnsOperation] -> ShowS)
-> Show CreateColumnsOperation
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateColumnsOperation] -> ShowS
$cshowList :: [CreateColumnsOperation] -> ShowS
show :: CreateColumnsOperation -> String
$cshow :: CreateColumnsOperation -> String
showsPrec :: Int -> CreateColumnsOperation -> ShowS
$cshowsPrec :: Int -> CreateColumnsOperation -> ShowS
Prelude.Show, (forall x. CreateColumnsOperation -> Rep CreateColumnsOperation x)
-> (forall x.
Rep CreateColumnsOperation x -> CreateColumnsOperation)
-> Generic CreateColumnsOperation
forall x. Rep CreateColumnsOperation x -> CreateColumnsOperation
forall x. CreateColumnsOperation -> Rep CreateColumnsOperation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateColumnsOperation x -> CreateColumnsOperation
$cfrom :: forall x. CreateColumnsOperation -> Rep CreateColumnsOperation x
Prelude.Generic)
newCreateColumnsOperation ::
Prelude.NonEmpty CalculatedColumn ->
CreateColumnsOperation
newCreateColumnsOperation :: NonEmpty CalculatedColumn -> CreateColumnsOperation
newCreateColumnsOperation NonEmpty CalculatedColumn
pColumns_ =
CreateColumnsOperation' :: NonEmpty CalculatedColumn -> CreateColumnsOperation
CreateColumnsOperation'
{ $sel:columns:CreateColumnsOperation' :: NonEmpty CalculatedColumn
columns =
Tagged
(NonEmpty CalculatedColumn) (Identity (NonEmpty CalculatedColumn))
-> Tagged
(NonEmpty CalculatedColumn) (Identity (NonEmpty CalculatedColumn))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced (Tagged
(NonEmpty CalculatedColumn) (Identity (NonEmpty CalculatedColumn))
-> Tagged
(NonEmpty CalculatedColumn) (Identity (NonEmpty CalculatedColumn)))
-> NonEmpty CalculatedColumn -> NonEmpty CalculatedColumn
forall t b. AReview t b -> b -> t
Lens.# NonEmpty CalculatedColumn
pColumns_
}
createColumnsOperation_columns :: Lens.Lens' CreateColumnsOperation (Prelude.NonEmpty CalculatedColumn)
createColumnsOperation_columns :: (NonEmpty CalculatedColumn -> f (NonEmpty CalculatedColumn))
-> CreateColumnsOperation -> f CreateColumnsOperation
createColumnsOperation_columns = (CreateColumnsOperation -> NonEmpty CalculatedColumn)
-> (CreateColumnsOperation
-> NonEmpty CalculatedColumn -> CreateColumnsOperation)
-> Lens
CreateColumnsOperation
CreateColumnsOperation
(NonEmpty CalculatedColumn)
(NonEmpty CalculatedColumn)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateColumnsOperation' {NonEmpty CalculatedColumn
columns :: NonEmpty CalculatedColumn
$sel:columns:CreateColumnsOperation' :: CreateColumnsOperation -> NonEmpty CalculatedColumn
columns} -> NonEmpty CalculatedColumn
columns) (\s :: CreateColumnsOperation
s@CreateColumnsOperation' {} NonEmpty CalculatedColumn
a -> CreateColumnsOperation
s {$sel:columns:CreateColumnsOperation' :: NonEmpty CalculatedColumn
columns = NonEmpty CalculatedColumn
a} :: CreateColumnsOperation) ((NonEmpty CalculatedColumn -> f (NonEmpty CalculatedColumn))
-> CreateColumnsOperation -> f CreateColumnsOperation)
-> ((NonEmpty CalculatedColumn -> f (NonEmpty CalculatedColumn))
-> NonEmpty CalculatedColumn -> f (NonEmpty CalculatedColumn))
-> (NonEmpty CalculatedColumn -> f (NonEmpty CalculatedColumn))
-> CreateColumnsOperation
-> f CreateColumnsOperation
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NonEmpty CalculatedColumn -> f (NonEmpty CalculatedColumn))
-> NonEmpty CalculatedColumn -> f (NonEmpty CalculatedColumn)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.FromJSON CreateColumnsOperation where
parseJSON :: Value -> Parser CreateColumnsOperation
parseJSON =
String
-> (Object -> Parser CreateColumnsOperation)
-> Value
-> Parser CreateColumnsOperation
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"CreateColumnsOperation"
( \Object
x ->
NonEmpty CalculatedColumn -> CreateColumnsOperation
CreateColumnsOperation'
(NonEmpty CalculatedColumn -> CreateColumnsOperation)
-> Parser (NonEmpty CalculatedColumn)
-> Parser CreateColumnsOperation
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (NonEmpty CalculatedColumn)
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Columns")
)
instance Prelude.Hashable CreateColumnsOperation
instance Prelude.NFData CreateColumnsOperation
instance Core.ToJSON CreateColumnsOperation where
toJSON :: CreateColumnsOperation -> Value
toJSON CreateColumnsOperation' {NonEmpty CalculatedColumn
columns :: NonEmpty CalculatedColumn
$sel:columns:CreateColumnsOperation' :: CreateColumnsOperation -> NonEmpty CalculatedColumn
..} =
[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
"Columns" Text -> NonEmpty CalculatedColumn -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= NonEmpty CalculatedColumn
columns)]
)