{-# 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.Wisdom.Types.AppIntegrationsConfiguration where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data AppIntegrationsConfiguration = AppIntegrationsConfiguration'
{
AppIntegrationsConfiguration -> Text
appIntegrationArn :: Prelude.Text,
AppIntegrationsConfiguration -> NonEmpty Text
objectFields :: Prelude.NonEmpty Prelude.Text
}
deriving (AppIntegrationsConfiguration
-> AppIntegrationsConfiguration -> Bool
(AppIntegrationsConfiguration
-> AppIntegrationsConfiguration -> Bool)
-> (AppIntegrationsConfiguration
-> AppIntegrationsConfiguration -> Bool)
-> Eq AppIntegrationsConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AppIntegrationsConfiguration
-> AppIntegrationsConfiguration -> Bool
$c/= :: AppIntegrationsConfiguration
-> AppIntegrationsConfiguration -> Bool
== :: AppIntegrationsConfiguration
-> AppIntegrationsConfiguration -> Bool
$c== :: AppIntegrationsConfiguration
-> AppIntegrationsConfiguration -> Bool
Prelude.Eq, ReadPrec [AppIntegrationsConfiguration]
ReadPrec AppIntegrationsConfiguration
Int -> ReadS AppIntegrationsConfiguration
ReadS [AppIntegrationsConfiguration]
(Int -> ReadS AppIntegrationsConfiguration)
-> ReadS [AppIntegrationsConfiguration]
-> ReadPrec AppIntegrationsConfiguration
-> ReadPrec [AppIntegrationsConfiguration]
-> Read AppIntegrationsConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AppIntegrationsConfiguration]
$creadListPrec :: ReadPrec [AppIntegrationsConfiguration]
readPrec :: ReadPrec AppIntegrationsConfiguration
$creadPrec :: ReadPrec AppIntegrationsConfiguration
readList :: ReadS [AppIntegrationsConfiguration]
$creadList :: ReadS [AppIntegrationsConfiguration]
readsPrec :: Int -> ReadS AppIntegrationsConfiguration
$creadsPrec :: Int -> ReadS AppIntegrationsConfiguration
Prelude.Read, Int -> AppIntegrationsConfiguration -> ShowS
[AppIntegrationsConfiguration] -> ShowS
AppIntegrationsConfiguration -> String
(Int -> AppIntegrationsConfiguration -> ShowS)
-> (AppIntegrationsConfiguration -> String)
-> ([AppIntegrationsConfiguration] -> ShowS)
-> Show AppIntegrationsConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AppIntegrationsConfiguration] -> ShowS
$cshowList :: [AppIntegrationsConfiguration] -> ShowS
show :: AppIntegrationsConfiguration -> String
$cshow :: AppIntegrationsConfiguration -> String
showsPrec :: Int -> AppIntegrationsConfiguration -> ShowS
$cshowsPrec :: Int -> AppIntegrationsConfiguration -> ShowS
Prelude.Show, (forall x.
AppIntegrationsConfiguration -> Rep AppIntegrationsConfiguration x)
-> (forall x.
Rep AppIntegrationsConfiguration x -> AppIntegrationsConfiguration)
-> Generic AppIntegrationsConfiguration
forall x.
Rep AppIntegrationsConfiguration x -> AppIntegrationsConfiguration
forall x.
AppIntegrationsConfiguration -> Rep AppIntegrationsConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AppIntegrationsConfiguration x -> AppIntegrationsConfiguration
$cfrom :: forall x.
AppIntegrationsConfiguration -> Rep AppIntegrationsConfiguration x
Prelude.Generic)
newAppIntegrationsConfiguration ::
Prelude.Text ->
Prelude.NonEmpty Prelude.Text ->
AppIntegrationsConfiguration
newAppIntegrationsConfiguration :: Text -> NonEmpty Text -> AppIntegrationsConfiguration
newAppIntegrationsConfiguration
Text
pAppIntegrationArn_
NonEmpty Text
pObjectFields_ =
AppIntegrationsConfiguration' :: Text -> NonEmpty Text -> AppIntegrationsConfiguration
AppIntegrationsConfiguration'
{ $sel:appIntegrationArn:AppIntegrationsConfiguration' :: Text
appIntegrationArn =
Text
pAppIntegrationArn_,
$sel:objectFields:AppIntegrationsConfiguration' :: NonEmpty Text
objectFields =
Tagged (NonEmpty Text) (Identity (NonEmpty Text))
-> Tagged (NonEmpty Text) (Identity (NonEmpty Text))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced (Tagged (NonEmpty Text) (Identity (NonEmpty Text))
-> Tagged (NonEmpty Text) (Identity (NonEmpty Text)))
-> NonEmpty Text -> NonEmpty Text
forall t b. AReview t b -> b -> t
Lens.# NonEmpty Text
pObjectFields_
}
appIntegrationsConfiguration_appIntegrationArn :: Lens.Lens' AppIntegrationsConfiguration Prelude.Text
appIntegrationsConfiguration_appIntegrationArn :: (Text -> f Text)
-> AppIntegrationsConfiguration -> f AppIntegrationsConfiguration
appIntegrationsConfiguration_appIntegrationArn = (AppIntegrationsConfiguration -> Text)
-> (AppIntegrationsConfiguration
-> Text -> AppIntegrationsConfiguration)
-> Lens
AppIntegrationsConfiguration AppIntegrationsConfiguration Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AppIntegrationsConfiguration' {Text
appIntegrationArn :: Text
$sel:appIntegrationArn:AppIntegrationsConfiguration' :: AppIntegrationsConfiguration -> Text
appIntegrationArn} -> Text
appIntegrationArn) (\s :: AppIntegrationsConfiguration
s@AppIntegrationsConfiguration' {} Text
a -> AppIntegrationsConfiguration
s {$sel:appIntegrationArn:AppIntegrationsConfiguration' :: Text
appIntegrationArn = Text
a} :: AppIntegrationsConfiguration)
appIntegrationsConfiguration_objectFields :: Lens.Lens' AppIntegrationsConfiguration (Prelude.NonEmpty Prelude.Text)
appIntegrationsConfiguration_objectFields :: (NonEmpty Text -> f (NonEmpty Text))
-> AppIntegrationsConfiguration -> f AppIntegrationsConfiguration
appIntegrationsConfiguration_objectFields = (AppIntegrationsConfiguration -> NonEmpty Text)
-> (AppIntegrationsConfiguration
-> NonEmpty Text -> AppIntegrationsConfiguration)
-> Lens
AppIntegrationsConfiguration
AppIntegrationsConfiguration
(NonEmpty Text)
(NonEmpty Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AppIntegrationsConfiguration' {NonEmpty Text
objectFields :: NonEmpty Text
$sel:objectFields:AppIntegrationsConfiguration' :: AppIntegrationsConfiguration -> NonEmpty Text
objectFields} -> NonEmpty Text
objectFields) (\s :: AppIntegrationsConfiguration
s@AppIntegrationsConfiguration' {} NonEmpty Text
a -> AppIntegrationsConfiguration
s {$sel:objectFields:AppIntegrationsConfiguration' :: NonEmpty Text
objectFields = NonEmpty Text
a} :: AppIntegrationsConfiguration) ((NonEmpty Text -> f (NonEmpty Text))
-> AppIntegrationsConfiguration -> f AppIntegrationsConfiguration)
-> ((NonEmpty Text -> f (NonEmpty Text))
-> NonEmpty Text -> f (NonEmpty Text))
-> (NonEmpty Text -> f (NonEmpty Text))
-> AppIntegrationsConfiguration
-> f AppIntegrationsConfiguration
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NonEmpty Text -> f (NonEmpty Text))
-> NonEmpty Text -> f (NonEmpty Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.FromJSON AppIntegrationsConfiguration where
parseJSON :: Value -> Parser AppIntegrationsConfiguration
parseJSON =
String
-> (Object -> Parser AppIntegrationsConfiguration)
-> Value
-> Parser AppIntegrationsConfiguration
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"AppIntegrationsConfiguration"
( \Object
x ->
Text -> NonEmpty Text -> AppIntegrationsConfiguration
AppIntegrationsConfiguration'
(Text -> NonEmpty Text -> AppIntegrationsConfiguration)
-> Parser Text
-> Parser (NonEmpty Text -> AppIntegrationsConfiguration)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"appIntegrationArn")
Parser (NonEmpty Text -> AppIntegrationsConfiguration)
-> Parser (NonEmpty Text) -> Parser AppIntegrationsConfiguration
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (NonEmpty Text)
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"objectFields")
)
instance
Prelude.Hashable
AppIntegrationsConfiguration
instance Prelude.NFData AppIntegrationsConfiguration
instance Core.ToJSON AppIntegrationsConfiguration where
toJSON :: AppIntegrationsConfiguration -> Value
toJSON AppIntegrationsConfiguration' {NonEmpty Text
Text
objectFields :: NonEmpty Text
appIntegrationArn :: Text
$sel:objectFields:AppIntegrationsConfiguration' :: AppIntegrationsConfiguration -> NonEmpty Text
$sel:appIntegrationArn:AppIntegrationsConfiguration' :: AppIntegrationsConfiguration -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"appIntegrationArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
appIntegrationArn),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"objectFields" Text -> NonEmpty Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= NonEmpty Text
objectFields)
]
)