{-# 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.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data WorkGroup = WorkGroup'
{
WorkGroup -> Maybe POSIX
creationTime :: Prelude.Maybe Core.POSIX,
WorkGroup -> Maybe WorkGroupState
state :: Prelude.Maybe WorkGroupState,
WorkGroup -> Maybe WorkGroupConfiguration
configuration :: Prelude.Maybe WorkGroupConfiguration,
WorkGroup -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
WorkGroup -> Text
name :: Prelude.Text
}
deriving (WorkGroup -> WorkGroup -> Bool
(WorkGroup -> WorkGroup -> Bool)
-> (WorkGroup -> WorkGroup -> Bool) -> Eq WorkGroup
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]
(Int -> ReadS WorkGroup)
-> ReadS [WorkGroup]
-> ReadPrec WorkGroup
-> ReadPrec [WorkGroup]
-> Read 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
(Int -> WorkGroup -> ShowS)
-> (WorkGroup -> String)
-> ([WorkGroup] -> ShowS)
-> Show WorkGroup
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. WorkGroup -> Rep WorkGroup x)
-> (forall x. Rep WorkGroup x -> WorkGroup) -> Generic WorkGroup
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' :: Maybe POSIX
-> Maybe WorkGroupState
-> Maybe WorkGroupConfiguration
-> Maybe Text
-> Text
-> WorkGroup
WorkGroup'
{ $sel:creationTime:WorkGroup' :: Maybe POSIX
creationTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:state:WorkGroup' :: Maybe WorkGroupState
state = Maybe WorkGroupState
forall a. Maybe a
Prelude.Nothing,
$sel:configuration:WorkGroup' :: Maybe WorkGroupConfiguration
configuration = Maybe WorkGroupConfiguration
forall a. Maybe a
Prelude.Nothing,
$sel:description:WorkGroup' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:name:WorkGroup' :: Text
name = Text
pName_
}
workGroup_creationTime :: Lens.Lens' WorkGroup (Prelude.Maybe Prelude.UTCTime)
workGroup_creationTime :: (Maybe UTCTime -> f (Maybe UTCTime)) -> WorkGroup -> f WorkGroup
workGroup_creationTime = (WorkGroup -> Maybe POSIX)
-> (WorkGroup -> Maybe POSIX -> WorkGroup)
-> Lens WorkGroup WorkGroup (Maybe POSIX) (Maybe POSIX)
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) ((Maybe POSIX -> f (Maybe POSIX)) -> WorkGroup -> f WorkGroup)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> WorkGroup
-> f WorkGroup
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
workGroup_state :: Lens.Lens' WorkGroup (Prelude.Maybe WorkGroupState)
workGroup_state :: (Maybe WorkGroupState -> f (Maybe WorkGroupState))
-> WorkGroup -> f WorkGroup
workGroup_state = (WorkGroup -> Maybe WorkGroupState)
-> (WorkGroup -> Maybe WorkGroupState -> WorkGroup)
-> Lens
WorkGroup WorkGroup (Maybe WorkGroupState) (Maybe WorkGroupState)
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_configuration :: Lens.Lens' WorkGroup (Prelude.Maybe WorkGroupConfiguration)
workGroup_configuration :: (Maybe WorkGroupConfiguration -> f (Maybe WorkGroupConfiguration))
-> WorkGroup -> f WorkGroup
workGroup_configuration = (WorkGroup -> Maybe WorkGroupConfiguration)
-> (WorkGroup -> Maybe WorkGroupConfiguration -> WorkGroup)
-> Lens
WorkGroup
WorkGroup
(Maybe WorkGroupConfiguration)
(Maybe WorkGroupConfiguration)
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_description :: Lens.Lens' WorkGroup (Prelude.Maybe Prelude.Text)
workGroup_description :: (Maybe Text -> f (Maybe Text)) -> WorkGroup -> f WorkGroup
workGroup_description = (WorkGroup -> Maybe Text)
-> (WorkGroup -> Maybe Text -> WorkGroup)
-> Lens WorkGroup WorkGroup (Maybe Text) (Maybe Text)
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_name :: Lens.Lens' WorkGroup Prelude.Text
workGroup_name :: (Text -> f Text) -> WorkGroup -> f WorkGroup
workGroup_name = (WorkGroup -> Text)
-> (WorkGroup -> Text -> WorkGroup)
-> Lens WorkGroup WorkGroup Text Text
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 Core.FromJSON WorkGroup where
parseJSON :: Value -> Parser WorkGroup
parseJSON =
String -> (Object -> Parser WorkGroup) -> Value -> Parser WorkGroup
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"WorkGroup"
( \Object
x ->
Maybe POSIX
-> Maybe WorkGroupState
-> Maybe WorkGroupConfiguration
-> Maybe Text
-> Text
-> WorkGroup
WorkGroup'
(Maybe POSIX
-> Maybe WorkGroupState
-> Maybe WorkGroupConfiguration
-> Maybe Text
-> Text
-> WorkGroup)
-> Parser (Maybe POSIX)
-> Parser
(Maybe WorkGroupState
-> Maybe WorkGroupConfiguration -> Maybe Text -> Text -> WorkGroup)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CreationTime")
Parser
(Maybe WorkGroupState
-> Maybe WorkGroupConfiguration -> Maybe Text -> Text -> WorkGroup)
-> Parser (Maybe WorkGroupState)
-> Parser
(Maybe WorkGroupConfiguration -> Maybe Text -> Text -> WorkGroup)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe WorkGroupState)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"State")
Parser
(Maybe WorkGroupConfiguration -> Maybe Text -> Text -> WorkGroup)
-> Parser (Maybe WorkGroupConfiguration)
-> Parser (Maybe Text -> Text -> WorkGroup)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe WorkGroupConfiguration)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Configuration")
Parser (Maybe Text -> Text -> WorkGroup)
-> Parser (Maybe Text) -> Parser (Text -> WorkGroup)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Description")
Parser (Text -> WorkGroup) -> Parser Text -> Parser WorkGroup
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Name")
)
instance Prelude.Hashable WorkGroup
instance Prelude.NFData WorkGroup