{-# 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.IoTAnalytics.Types.Partition 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
data Partition = Partition'
{
Partition -> Text
attributeName :: Prelude.Text
}
deriving (Partition -> Partition -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Partition -> Partition -> Bool
$c/= :: Partition -> Partition -> Bool
== :: Partition -> Partition -> Bool
$c== :: Partition -> Partition -> Bool
Prelude.Eq, ReadPrec [Partition]
ReadPrec Partition
Int -> ReadS Partition
ReadS [Partition]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Partition]
$creadListPrec :: ReadPrec [Partition]
readPrec :: ReadPrec Partition
$creadPrec :: ReadPrec Partition
readList :: ReadS [Partition]
$creadList :: ReadS [Partition]
readsPrec :: Int -> ReadS Partition
$creadsPrec :: Int -> ReadS Partition
Prelude.Read, Int -> Partition -> ShowS
[Partition] -> ShowS
Partition -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Partition] -> ShowS
$cshowList :: [Partition] -> ShowS
show :: Partition -> String
$cshow :: Partition -> String
showsPrec :: Int -> Partition -> ShowS
$cshowsPrec :: Int -> Partition -> ShowS
Prelude.Show, forall x. Rep Partition x -> Partition
forall x. Partition -> Rep Partition x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Partition x -> Partition
$cfrom :: forall x. Partition -> Rep Partition x
Prelude.Generic)
newPartition ::
Prelude.Text ->
Partition
newPartition :: Text -> Partition
newPartition Text
pAttributeName_ =
Partition' {$sel:attributeName:Partition' :: Text
attributeName = Text
pAttributeName_}
partition_attributeName :: Lens.Lens' Partition Prelude.Text
partition_attributeName :: Lens' Partition Text
partition_attributeName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Partition' {Text
attributeName :: Text
$sel:attributeName:Partition' :: Partition -> Text
attributeName} -> Text
attributeName) (\s :: Partition
s@Partition' {} Text
a -> Partition
s {$sel:attributeName:Partition' :: Text
attributeName = Text
a} :: Partition)
instance Data.FromJSON Partition where
parseJSON :: Value -> Parser Partition
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"Partition"
( \Object
x ->
Text -> Partition
Partition' 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
"attributeName")
)
instance Prelude.Hashable Partition where
hashWithSalt :: Int -> Partition -> Int
hashWithSalt Int
_salt Partition' {Text
attributeName :: Text
$sel:attributeName:Partition' :: Partition -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
attributeName
instance Prelude.NFData Partition where
rnf :: Partition -> ()
rnf Partition' {Text
attributeName :: Text
$sel:attributeName:Partition' :: Partition -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
attributeName
instance Data.ToJSON Partition where
toJSON :: Partition -> Value
toJSON Partition' {Text
attributeName :: Text
$sel:attributeName:Partition' :: Partition -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just
(Key
"attributeName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
attributeName)
]
)