{-# 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.AppFlow.Types.SlackMetadata where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data SlackMetadata = SlackMetadata'
{
SlackMetadata -> Maybe [Text]
oAuthScopes :: Prelude.Maybe [Prelude.Text]
}
deriving (SlackMetadata -> SlackMetadata -> Bool
(SlackMetadata -> SlackMetadata -> Bool)
-> (SlackMetadata -> SlackMetadata -> Bool) -> Eq SlackMetadata
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SlackMetadata -> SlackMetadata -> Bool
$c/= :: SlackMetadata -> SlackMetadata -> Bool
== :: SlackMetadata -> SlackMetadata -> Bool
$c== :: SlackMetadata -> SlackMetadata -> Bool
Prelude.Eq, ReadPrec [SlackMetadata]
ReadPrec SlackMetadata
Int -> ReadS SlackMetadata
ReadS [SlackMetadata]
(Int -> ReadS SlackMetadata)
-> ReadS [SlackMetadata]
-> ReadPrec SlackMetadata
-> ReadPrec [SlackMetadata]
-> Read SlackMetadata
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SlackMetadata]
$creadListPrec :: ReadPrec [SlackMetadata]
readPrec :: ReadPrec SlackMetadata
$creadPrec :: ReadPrec SlackMetadata
readList :: ReadS [SlackMetadata]
$creadList :: ReadS [SlackMetadata]
readsPrec :: Int -> ReadS SlackMetadata
$creadsPrec :: Int -> ReadS SlackMetadata
Prelude.Read, Int -> SlackMetadata -> ShowS
[SlackMetadata] -> ShowS
SlackMetadata -> String
(Int -> SlackMetadata -> ShowS)
-> (SlackMetadata -> String)
-> ([SlackMetadata] -> ShowS)
-> Show SlackMetadata
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SlackMetadata] -> ShowS
$cshowList :: [SlackMetadata] -> ShowS
show :: SlackMetadata -> String
$cshow :: SlackMetadata -> String
showsPrec :: Int -> SlackMetadata -> ShowS
$cshowsPrec :: Int -> SlackMetadata -> ShowS
Prelude.Show, (forall x. SlackMetadata -> Rep SlackMetadata x)
-> (forall x. Rep SlackMetadata x -> SlackMetadata)
-> Generic SlackMetadata
forall x. Rep SlackMetadata x -> SlackMetadata
forall x. SlackMetadata -> Rep SlackMetadata x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SlackMetadata x -> SlackMetadata
$cfrom :: forall x. SlackMetadata -> Rep SlackMetadata x
Prelude.Generic)
newSlackMetadata ::
SlackMetadata
newSlackMetadata :: SlackMetadata
newSlackMetadata =
SlackMetadata' :: Maybe [Text] -> SlackMetadata
SlackMetadata' {$sel:oAuthScopes:SlackMetadata' :: Maybe [Text]
oAuthScopes = Maybe [Text]
forall a. Maybe a
Prelude.Nothing}
slackMetadata_oAuthScopes :: Lens.Lens' SlackMetadata (Prelude.Maybe [Prelude.Text])
slackMetadata_oAuthScopes :: (Maybe [Text] -> f (Maybe [Text]))
-> SlackMetadata -> f SlackMetadata
slackMetadata_oAuthScopes = (SlackMetadata -> Maybe [Text])
-> (SlackMetadata -> Maybe [Text] -> SlackMetadata)
-> Lens SlackMetadata SlackMetadata (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SlackMetadata' {Maybe [Text]
oAuthScopes :: Maybe [Text]
$sel:oAuthScopes:SlackMetadata' :: SlackMetadata -> Maybe [Text]
oAuthScopes} -> Maybe [Text]
oAuthScopes) (\s :: SlackMetadata
s@SlackMetadata' {} Maybe [Text]
a -> SlackMetadata
s {$sel:oAuthScopes:SlackMetadata' :: Maybe [Text]
oAuthScopes = Maybe [Text]
a} :: SlackMetadata) ((Maybe [Text] -> f (Maybe [Text]))
-> SlackMetadata -> f SlackMetadata)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> SlackMetadata
-> f SlackMetadata
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.FromJSON SlackMetadata where
parseJSON :: Value -> Parser SlackMetadata
parseJSON =
String
-> (Object -> Parser SlackMetadata)
-> Value
-> Parser SlackMetadata
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"SlackMetadata"
( \Object
x ->
Maybe [Text] -> SlackMetadata
SlackMetadata'
(Maybe [Text] -> SlackMetadata)
-> Parser (Maybe [Text]) -> Parser SlackMetadata
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"oAuthScopes" Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable SlackMetadata
instance Prelude.NFData SlackMetadata