{-# 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.AxisLabelReferenceOptions where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import Amazonka.QuickSight.Types.ColumnIdentifier
data AxisLabelReferenceOptions = AxisLabelReferenceOptions'
{
AxisLabelReferenceOptions -> Text
fieldId :: Prelude.Text,
AxisLabelReferenceOptions -> ColumnIdentifier
column :: ColumnIdentifier
}
deriving (AxisLabelReferenceOptions -> AxisLabelReferenceOptions -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AxisLabelReferenceOptions -> AxisLabelReferenceOptions -> Bool
$c/= :: AxisLabelReferenceOptions -> AxisLabelReferenceOptions -> Bool
== :: AxisLabelReferenceOptions -> AxisLabelReferenceOptions -> Bool
$c== :: AxisLabelReferenceOptions -> AxisLabelReferenceOptions -> Bool
Prelude.Eq, ReadPrec [AxisLabelReferenceOptions]
ReadPrec AxisLabelReferenceOptions
Int -> ReadS AxisLabelReferenceOptions
ReadS [AxisLabelReferenceOptions]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AxisLabelReferenceOptions]
$creadListPrec :: ReadPrec [AxisLabelReferenceOptions]
readPrec :: ReadPrec AxisLabelReferenceOptions
$creadPrec :: ReadPrec AxisLabelReferenceOptions
readList :: ReadS [AxisLabelReferenceOptions]
$creadList :: ReadS [AxisLabelReferenceOptions]
readsPrec :: Int -> ReadS AxisLabelReferenceOptions
$creadsPrec :: Int -> ReadS AxisLabelReferenceOptions
Prelude.Read, Int -> AxisLabelReferenceOptions -> ShowS
[AxisLabelReferenceOptions] -> ShowS
AxisLabelReferenceOptions -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AxisLabelReferenceOptions] -> ShowS
$cshowList :: [AxisLabelReferenceOptions] -> ShowS
show :: AxisLabelReferenceOptions -> String
$cshow :: AxisLabelReferenceOptions -> String
showsPrec :: Int -> AxisLabelReferenceOptions -> ShowS
$cshowsPrec :: Int -> AxisLabelReferenceOptions -> ShowS
Prelude.Show, forall x.
Rep AxisLabelReferenceOptions x -> AxisLabelReferenceOptions
forall x.
AxisLabelReferenceOptions -> Rep AxisLabelReferenceOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AxisLabelReferenceOptions x -> AxisLabelReferenceOptions
$cfrom :: forall x.
AxisLabelReferenceOptions -> Rep AxisLabelReferenceOptions x
Prelude.Generic)
newAxisLabelReferenceOptions ::
Prelude.Text ->
ColumnIdentifier ->
AxisLabelReferenceOptions
newAxisLabelReferenceOptions :: Text -> ColumnIdentifier -> AxisLabelReferenceOptions
newAxisLabelReferenceOptions Text
pFieldId_ ColumnIdentifier
pColumn_ =
AxisLabelReferenceOptions'
{ $sel:fieldId:AxisLabelReferenceOptions' :: Text
fieldId = Text
pFieldId_,
$sel:column:AxisLabelReferenceOptions' :: ColumnIdentifier
column = ColumnIdentifier
pColumn_
}
axisLabelReferenceOptions_fieldId :: Lens.Lens' AxisLabelReferenceOptions Prelude.Text
axisLabelReferenceOptions_fieldId :: Lens' AxisLabelReferenceOptions Text
axisLabelReferenceOptions_fieldId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AxisLabelReferenceOptions' {Text
fieldId :: Text
$sel:fieldId:AxisLabelReferenceOptions' :: AxisLabelReferenceOptions -> Text
fieldId} -> Text
fieldId) (\s :: AxisLabelReferenceOptions
s@AxisLabelReferenceOptions' {} Text
a -> AxisLabelReferenceOptions
s {$sel:fieldId:AxisLabelReferenceOptions' :: Text
fieldId = Text
a} :: AxisLabelReferenceOptions)
axisLabelReferenceOptions_column :: Lens.Lens' AxisLabelReferenceOptions ColumnIdentifier
axisLabelReferenceOptions_column :: Lens' AxisLabelReferenceOptions ColumnIdentifier
axisLabelReferenceOptions_column = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AxisLabelReferenceOptions' {ColumnIdentifier
column :: ColumnIdentifier
$sel:column:AxisLabelReferenceOptions' :: AxisLabelReferenceOptions -> ColumnIdentifier
column} -> ColumnIdentifier
column) (\s :: AxisLabelReferenceOptions
s@AxisLabelReferenceOptions' {} ColumnIdentifier
a -> AxisLabelReferenceOptions
s {$sel:column:AxisLabelReferenceOptions' :: ColumnIdentifier
column = ColumnIdentifier
a} :: AxisLabelReferenceOptions)
instance Data.FromJSON AxisLabelReferenceOptions where
parseJSON :: Value -> Parser AxisLabelReferenceOptions
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"AxisLabelReferenceOptions"
( \Object
x ->
Text -> ColumnIdentifier -> AxisLabelReferenceOptions
AxisLabelReferenceOptions'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"FieldId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"Column")
)
instance Prelude.Hashable AxisLabelReferenceOptions where
hashWithSalt :: Int -> AxisLabelReferenceOptions -> Int
hashWithSalt Int
_salt AxisLabelReferenceOptions' {Text
ColumnIdentifier
column :: ColumnIdentifier
fieldId :: Text
$sel:column:AxisLabelReferenceOptions' :: AxisLabelReferenceOptions -> ColumnIdentifier
$sel:fieldId:AxisLabelReferenceOptions' :: AxisLabelReferenceOptions -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
fieldId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ColumnIdentifier
column
instance Prelude.NFData AxisLabelReferenceOptions where
rnf :: AxisLabelReferenceOptions -> ()
rnf AxisLabelReferenceOptions' {Text
ColumnIdentifier
column :: ColumnIdentifier
fieldId :: Text
$sel:column:AxisLabelReferenceOptions' :: AxisLabelReferenceOptions -> ColumnIdentifier
$sel:fieldId:AxisLabelReferenceOptions' :: AxisLabelReferenceOptions -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
fieldId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ColumnIdentifier
column
instance Data.ToJSON AxisLabelReferenceOptions where
toJSON :: AxisLabelReferenceOptions -> Value
toJSON AxisLabelReferenceOptions' {Text
ColumnIdentifier
column :: ColumnIdentifier
fieldId :: Text
$sel:column:AxisLabelReferenceOptions' :: AxisLabelReferenceOptions -> ColumnIdentifier
$sel:fieldId:AxisLabelReferenceOptions' :: AxisLabelReferenceOptions -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"FieldId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
fieldId),
forall a. a -> Maybe a
Prelude.Just (Key
"Column" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= ColumnIdentifier
column)
]
)