{-# 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.Athena.Types.WorkGroup where
import Amazonka.Athena.Types.WorkGroupConfiguration
import Amazonka.Athena.Types.WorkGroupState
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 WorkGroup = WorkGroup'
{
WorkGroup -> Maybe WorkGroupConfiguration
configuration :: Prelude.Maybe WorkGroupConfiguration,
WorkGroup -> Maybe POSIX
creationTime :: Prelude.Maybe Data.POSIX,
WorkGroup -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
WorkGroup -> Maybe WorkGroupState
state :: Prelude.Maybe WorkGroupState,
WorkGroup -> Text
name :: Prelude.Text
}
deriving (WorkGroup -> WorkGroup -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: WorkGroup -> WorkGroup -> Bool
$c/= :: WorkGroup -> WorkGroup -> Bool
== :: WorkGroup -> WorkGroup -> Bool
$c== :: WorkGroup -> WorkGroup -> Bool
Prelude.Eq, ReadPrec [WorkGroup]
ReadPrec WorkGroup
Int -> ReadS WorkGroup
ReadS [WorkGroup]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [WorkGroup]
$creadListPrec :: ReadPrec [WorkGroup]
readPrec :: ReadPrec WorkGroup
$creadPrec :: ReadPrec WorkGroup
readList :: ReadS [WorkGroup]
$creadList :: ReadS [WorkGroup]
readsPrec :: Int -> ReadS WorkGroup
$creadsPrec :: Int -> ReadS WorkGroup
Prelude.Read, Int -> WorkGroup -> ShowS
[WorkGroup] -> ShowS
WorkGroup -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [WorkGroup] -> ShowS
$cshowList :: [WorkGroup] -> ShowS
show :: WorkGroup -> String
$cshow :: WorkGroup -> String
showsPrec :: Int -> WorkGroup -> ShowS
$cshowsPrec :: Int -> WorkGroup -> ShowS
Prelude.Show, forall x. Rep WorkGroup x -> WorkGroup
forall x. WorkGroup -> Rep WorkGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep WorkGroup x -> WorkGroup
$cfrom :: forall x. WorkGroup -> Rep WorkGroup x
Prelude.Generic)
newWorkGroup ::
Prelude.Text ->
WorkGroup
newWorkGroup :: Text -> WorkGroup
newWorkGroup Text
pName_ =
WorkGroup'
{ $sel:configuration:WorkGroup' :: Maybe WorkGroupConfiguration
configuration = forall a. Maybe a
Prelude.Nothing,
$sel:creationTime:WorkGroup' :: Maybe POSIX
creationTime = forall a. Maybe a
Prelude.Nothing,
$sel:description:WorkGroup' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
$sel:state:WorkGroup' :: Maybe WorkGroupState
state = forall a. Maybe a
Prelude.Nothing,
$sel:name:WorkGroup' :: Text
name = Text
pName_
}
workGroup_configuration :: Lens.Lens' WorkGroup (Prelude.Maybe WorkGroupConfiguration)
workGroup_configuration :: Lens' WorkGroup (Maybe WorkGroupConfiguration)
workGroup_configuration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkGroup' {Maybe WorkGroupConfiguration
configuration :: Maybe WorkGroupConfiguration
$sel:configuration:WorkGroup' :: WorkGroup -> Maybe WorkGroupConfiguration
configuration} -> Maybe WorkGroupConfiguration
configuration) (\s :: WorkGroup
s@WorkGroup' {} Maybe WorkGroupConfiguration
a -> WorkGroup
s {$sel:configuration:WorkGroup' :: Maybe WorkGroupConfiguration
configuration = Maybe WorkGroupConfiguration
a} :: WorkGroup)
workGroup_creationTime :: Lens.Lens' WorkGroup (Prelude.Maybe Prelude.UTCTime)
workGroup_creationTime :: Lens' WorkGroup (Maybe UTCTime)
workGroup_creationTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkGroup' {Maybe POSIX
creationTime :: Maybe POSIX
$sel:creationTime:WorkGroup' :: WorkGroup -> Maybe POSIX
creationTime} -> Maybe POSIX
creationTime) (\s :: WorkGroup
s@WorkGroup' {} Maybe POSIX
a -> WorkGroup
s {$sel:creationTime:WorkGroup' :: Maybe POSIX
creationTime = Maybe POSIX
a} :: WorkGroup) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
workGroup_description :: Lens.Lens' WorkGroup (Prelude.Maybe Prelude.Text)
workGroup_description :: Lens' WorkGroup (Maybe Text)
workGroup_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkGroup' {Maybe Text
description :: Maybe Text
$sel:description:WorkGroup' :: WorkGroup -> Maybe Text
description} -> Maybe Text
description) (\s :: WorkGroup
s@WorkGroup' {} Maybe Text
a -> WorkGroup
s {$sel:description:WorkGroup' :: Maybe Text
description = Maybe Text
a} :: WorkGroup)
workGroup_state :: Lens.Lens' WorkGroup (Prelude.Maybe WorkGroupState)
workGroup_state :: Lens' WorkGroup (Maybe WorkGroupState)
workGroup_state = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkGroup' {Maybe WorkGroupState
state :: Maybe WorkGroupState
$sel:state:WorkGroup' :: WorkGroup -> Maybe WorkGroupState
state} -> Maybe WorkGroupState
state) (\s :: WorkGroup
s@WorkGroup' {} Maybe WorkGroupState
a -> WorkGroup
s {$sel:state:WorkGroup' :: Maybe WorkGroupState
state = Maybe WorkGroupState
a} :: WorkGroup)
workGroup_name :: Lens.Lens' WorkGroup Prelude.Text
workGroup_name :: Lens' WorkGroup Text
workGroup_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkGroup' {Text
name :: Text
$sel:name:WorkGroup' :: WorkGroup -> Text
name} -> Text
name) (\s :: WorkGroup
s@WorkGroup' {} Text
a -> WorkGroup
s {$sel:name:WorkGroup' :: Text
name = Text
a} :: WorkGroup)
instance Data.FromJSON WorkGroup where
parseJSON :: Value -> Parser WorkGroup
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"WorkGroup"
( \Object
x ->
Maybe WorkGroupConfiguration
-> Maybe POSIX
-> Maybe Text
-> Maybe WorkGroupState
-> Text
-> WorkGroup
WorkGroup'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Configuration")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"CreationTime")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Description")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"State")
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
"Name")
)
instance Prelude.Hashable WorkGroup where
hashWithSalt :: Int -> WorkGroup -> Int
hashWithSalt Int
_salt WorkGroup' {Maybe Text
Maybe POSIX
Maybe WorkGroupConfiguration
Maybe WorkGroupState
Text
name :: Text
state :: Maybe WorkGroupState
description :: Maybe Text
creationTime :: Maybe POSIX
configuration :: Maybe WorkGroupConfiguration
$sel:name:WorkGroup' :: WorkGroup -> Text
$sel:state:WorkGroup' :: WorkGroup -> Maybe WorkGroupState
$sel:description:WorkGroup' :: WorkGroup -> Maybe Text
$sel:creationTime:WorkGroup' :: WorkGroup -> Maybe POSIX
$sel:configuration:WorkGroup' :: WorkGroup -> Maybe WorkGroupConfiguration
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe WorkGroupConfiguration
configuration
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
creationTime
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe WorkGroupState
state
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name
instance Prelude.NFData WorkGroup where
rnf :: WorkGroup -> ()
rnf WorkGroup' {Maybe Text
Maybe POSIX
Maybe WorkGroupConfiguration
Maybe WorkGroupState
Text
name :: Text
state :: Maybe WorkGroupState
description :: Maybe Text
creationTime :: Maybe POSIX
configuration :: Maybe WorkGroupConfiguration
$sel:name:WorkGroup' :: WorkGroup -> Text
$sel:state:WorkGroup' :: WorkGroup -> Maybe WorkGroupState
$sel:description:WorkGroup' :: WorkGroup -> Maybe Text
$sel:creationTime:WorkGroup' :: WorkGroup -> Maybe POSIX
$sel:configuration:WorkGroup' :: WorkGroup -> Maybe WorkGroupConfiguration
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe WorkGroupConfiguration
configuration
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
creationTime
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe WorkGroupState
state
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
name