{-# 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.Kendra.Types.ServiceNowConfiguration where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Kendra.Types.ServiceNowAuthenticationType
import Amazonka.Kendra.Types.ServiceNowBuildVersionType
import Amazonka.Kendra.Types.ServiceNowKnowledgeArticleConfiguration
import Amazonka.Kendra.Types.ServiceNowServiceCatalogConfiguration
import qualified Amazonka.Prelude as Prelude
data ServiceNowConfiguration = ServiceNowConfiguration'
{
ServiceNowConfiguration -> Maybe ServiceNowAuthenticationType
authenticationType :: Prelude.Maybe ServiceNowAuthenticationType,
ServiceNowConfiguration
-> Maybe ServiceNowKnowledgeArticleConfiguration
knowledgeArticleConfiguration :: Prelude.Maybe ServiceNowKnowledgeArticleConfiguration,
ServiceNowConfiguration
-> Maybe ServiceNowServiceCatalogConfiguration
serviceCatalogConfiguration :: Prelude.Maybe ServiceNowServiceCatalogConfiguration,
ServiceNowConfiguration -> Text
hostUrl :: Prelude.Text,
ServiceNowConfiguration -> Text
secretArn :: Prelude.Text,
ServiceNowConfiguration -> ServiceNowBuildVersionType
serviceNowBuildVersion :: ServiceNowBuildVersionType
}
deriving (ServiceNowConfiguration -> ServiceNowConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ServiceNowConfiguration -> ServiceNowConfiguration -> Bool
$c/= :: ServiceNowConfiguration -> ServiceNowConfiguration -> Bool
== :: ServiceNowConfiguration -> ServiceNowConfiguration -> Bool
$c== :: ServiceNowConfiguration -> ServiceNowConfiguration -> Bool
Prelude.Eq, ReadPrec [ServiceNowConfiguration]
ReadPrec ServiceNowConfiguration
Int -> ReadS ServiceNowConfiguration
ReadS [ServiceNowConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ServiceNowConfiguration]
$creadListPrec :: ReadPrec [ServiceNowConfiguration]
readPrec :: ReadPrec ServiceNowConfiguration
$creadPrec :: ReadPrec ServiceNowConfiguration
readList :: ReadS [ServiceNowConfiguration]
$creadList :: ReadS [ServiceNowConfiguration]
readsPrec :: Int -> ReadS ServiceNowConfiguration
$creadsPrec :: Int -> ReadS ServiceNowConfiguration
Prelude.Read, Int -> ServiceNowConfiguration -> ShowS
[ServiceNowConfiguration] -> ShowS
ServiceNowConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ServiceNowConfiguration] -> ShowS
$cshowList :: [ServiceNowConfiguration] -> ShowS
show :: ServiceNowConfiguration -> String
$cshow :: ServiceNowConfiguration -> String
showsPrec :: Int -> ServiceNowConfiguration -> ShowS
$cshowsPrec :: Int -> ServiceNowConfiguration -> ShowS
Prelude.Show, forall x. Rep ServiceNowConfiguration x -> ServiceNowConfiguration
forall x. ServiceNowConfiguration -> Rep ServiceNowConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ServiceNowConfiguration x -> ServiceNowConfiguration
$cfrom :: forall x. ServiceNowConfiguration -> Rep ServiceNowConfiguration x
Prelude.Generic)
newServiceNowConfiguration ::
Prelude.Text ->
Prelude.Text ->
ServiceNowBuildVersionType ->
ServiceNowConfiguration
newServiceNowConfiguration :: Text
-> Text -> ServiceNowBuildVersionType -> ServiceNowConfiguration
newServiceNowConfiguration
Text
pHostUrl_
Text
pSecretArn_
ServiceNowBuildVersionType
pServiceNowBuildVersion_ =
ServiceNowConfiguration'
{ $sel:authenticationType:ServiceNowConfiguration' :: Maybe ServiceNowAuthenticationType
authenticationType =
forall a. Maybe a
Prelude.Nothing,
$sel:knowledgeArticleConfiguration:ServiceNowConfiguration' :: Maybe ServiceNowKnowledgeArticleConfiguration
knowledgeArticleConfiguration = forall a. Maybe a
Prelude.Nothing,
$sel:serviceCatalogConfiguration:ServiceNowConfiguration' :: Maybe ServiceNowServiceCatalogConfiguration
serviceCatalogConfiguration = forall a. Maybe a
Prelude.Nothing,
$sel:hostUrl:ServiceNowConfiguration' :: Text
hostUrl = Text
pHostUrl_,
$sel:secretArn:ServiceNowConfiguration' :: Text
secretArn = Text
pSecretArn_,
$sel:serviceNowBuildVersion:ServiceNowConfiguration' :: ServiceNowBuildVersionType
serviceNowBuildVersion = ServiceNowBuildVersionType
pServiceNowBuildVersion_
}
serviceNowConfiguration_authenticationType :: Lens.Lens' ServiceNowConfiguration (Prelude.Maybe ServiceNowAuthenticationType)
serviceNowConfiguration_authenticationType :: Lens' ServiceNowConfiguration (Maybe ServiceNowAuthenticationType)
serviceNowConfiguration_authenticationType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceNowConfiguration' {Maybe ServiceNowAuthenticationType
authenticationType :: Maybe ServiceNowAuthenticationType
$sel:authenticationType:ServiceNowConfiguration' :: ServiceNowConfiguration -> Maybe ServiceNowAuthenticationType
authenticationType} -> Maybe ServiceNowAuthenticationType
authenticationType) (\s :: ServiceNowConfiguration
s@ServiceNowConfiguration' {} Maybe ServiceNowAuthenticationType
a -> ServiceNowConfiguration
s {$sel:authenticationType:ServiceNowConfiguration' :: Maybe ServiceNowAuthenticationType
authenticationType = Maybe ServiceNowAuthenticationType
a} :: ServiceNowConfiguration)
serviceNowConfiguration_knowledgeArticleConfiguration :: Lens.Lens' ServiceNowConfiguration (Prelude.Maybe ServiceNowKnowledgeArticleConfiguration)
serviceNowConfiguration_knowledgeArticleConfiguration :: Lens'
ServiceNowConfiguration
(Maybe ServiceNowKnowledgeArticleConfiguration)
serviceNowConfiguration_knowledgeArticleConfiguration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceNowConfiguration' {Maybe ServiceNowKnowledgeArticleConfiguration
knowledgeArticleConfiguration :: Maybe ServiceNowKnowledgeArticleConfiguration
$sel:knowledgeArticleConfiguration:ServiceNowConfiguration' :: ServiceNowConfiguration
-> Maybe ServiceNowKnowledgeArticleConfiguration
knowledgeArticleConfiguration} -> Maybe ServiceNowKnowledgeArticleConfiguration
knowledgeArticleConfiguration) (\s :: ServiceNowConfiguration
s@ServiceNowConfiguration' {} Maybe ServiceNowKnowledgeArticleConfiguration
a -> ServiceNowConfiguration
s {$sel:knowledgeArticleConfiguration:ServiceNowConfiguration' :: Maybe ServiceNowKnowledgeArticleConfiguration
knowledgeArticleConfiguration = Maybe ServiceNowKnowledgeArticleConfiguration
a} :: ServiceNowConfiguration)
serviceNowConfiguration_serviceCatalogConfiguration :: Lens.Lens' ServiceNowConfiguration (Prelude.Maybe ServiceNowServiceCatalogConfiguration)
serviceNowConfiguration_serviceCatalogConfiguration :: Lens'
ServiceNowConfiguration
(Maybe ServiceNowServiceCatalogConfiguration)
serviceNowConfiguration_serviceCatalogConfiguration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceNowConfiguration' {Maybe ServiceNowServiceCatalogConfiguration
serviceCatalogConfiguration :: Maybe ServiceNowServiceCatalogConfiguration
$sel:serviceCatalogConfiguration:ServiceNowConfiguration' :: ServiceNowConfiguration
-> Maybe ServiceNowServiceCatalogConfiguration
serviceCatalogConfiguration} -> Maybe ServiceNowServiceCatalogConfiguration
serviceCatalogConfiguration) (\s :: ServiceNowConfiguration
s@ServiceNowConfiguration' {} Maybe ServiceNowServiceCatalogConfiguration
a -> ServiceNowConfiguration
s {$sel:serviceCatalogConfiguration:ServiceNowConfiguration' :: Maybe ServiceNowServiceCatalogConfiguration
serviceCatalogConfiguration = Maybe ServiceNowServiceCatalogConfiguration
a} :: ServiceNowConfiguration)
serviceNowConfiguration_hostUrl :: Lens.Lens' ServiceNowConfiguration Prelude.Text
serviceNowConfiguration_hostUrl :: Lens' ServiceNowConfiguration Text
serviceNowConfiguration_hostUrl = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceNowConfiguration' {Text
hostUrl :: Text
$sel:hostUrl:ServiceNowConfiguration' :: ServiceNowConfiguration -> Text
hostUrl} -> Text
hostUrl) (\s :: ServiceNowConfiguration
s@ServiceNowConfiguration' {} Text
a -> ServiceNowConfiguration
s {$sel:hostUrl:ServiceNowConfiguration' :: Text
hostUrl = Text
a} :: ServiceNowConfiguration)
serviceNowConfiguration_secretArn :: Lens.Lens' ServiceNowConfiguration Prelude.Text
serviceNowConfiguration_secretArn :: Lens' ServiceNowConfiguration Text
serviceNowConfiguration_secretArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceNowConfiguration' {Text
secretArn :: Text
$sel:secretArn:ServiceNowConfiguration' :: ServiceNowConfiguration -> Text
secretArn} -> Text
secretArn) (\s :: ServiceNowConfiguration
s@ServiceNowConfiguration' {} Text
a -> ServiceNowConfiguration
s {$sel:secretArn:ServiceNowConfiguration' :: Text
secretArn = Text
a} :: ServiceNowConfiguration)
serviceNowConfiguration_serviceNowBuildVersion :: Lens.Lens' ServiceNowConfiguration ServiceNowBuildVersionType
serviceNowConfiguration_serviceNowBuildVersion :: Lens' ServiceNowConfiguration ServiceNowBuildVersionType
serviceNowConfiguration_serviceNowBuildVersion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceNowConfiguration' {ServiceNowBuildVersionType
serviceNowBuildVersion :: ServiceNowBuildVersionType
$sel:serviceNowBuildVersion:ServiceNowConfiguration' :: ServiceNowConfiguration -> ServiceNowBuildVersionType
serviceNowBuildVersion} -> ServiceNowBuildVersionType
serviceNowBuildVersion) (\s :: ServiceNowConfiguration
s@ServiceNowConfiguration' {} ServiceNowBuildVersionType
a -> ServiceNowConfiguration
s {$sel:serviceNowBuildVersion:ServiceNowConfiguration' :: ServiceNowBuildVersionType
serviceNowBuildVersion = ServiceNowBuildVersionType
a} :: ServiceNowConfiguration)
instance Data.FromJSON ServiceNowConfiguration where
parseJSON :: Value -> Parser ServiceNowConfiguration
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"ServiceNowConfiguration"
( \Object
x ->
Maybe ServiceNowAuthenticationType
-> Maybe ServiceNowKnowledgeArticleConfiguration
-> Maybe ServiceNowServiceCatalogConfiguration
-> Text
-> Text
-> ServiceNowBuildVersionType
-> ServiceNowConfiguration
ServiceNowConfiguration'
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
"AuthenticationType")
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
"KnowledgeArticleConfiguration")
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
"ServiceCatalogConfiguration")
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
"HostUrl")
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
"SecretArn")
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
"ServiceNowBuildVersion")
)
instance Prelude.Hashable ServiceNowConfiguration where
hashWithSalt :: Int -> ServiceNowConfiguration -> Int
hashWithSalt Int
_salt ServiceNowConfiguration' {Maybe ServiceNowAuthenticationType
Maybe ServiceNowKnowledgeArticleConfiguration
Maybe ServiceNowServiceCatalogConfiguration
Text
ServiceNowBuildVersionType
serviceNowBuildVersion :: ServiceNowBuildVersionType
secretArn :: Text
hostUrl :: Text
serviceCatalogConfiguration :: Maybe ServiceNowServiceCatalogConfiguration
knowledgeArticleConfiguration :: Maybe ServiceNowKnowledgeArticleConfiguration
authenticationType :: Maybe ServiceNowAuthenticationType
$sel:serviceNowBuildVersion:ServiceNowConfiguration' :: ServiceNowConfiguration -> ServiceNowBuildVersionType
$sel:secretArn:ServiceNowConfiguration' :: ServiceNowConfiguration -> Text
$sel:hostUrl:ServiceNowConfiguration' :: ServiceNowConfiguration -> Text
$sel:serviceCatalogConfiguration:ServiceNowConfiguration' :: ServiceNowConfiguration
-> Maybe ServiceNowServiceCatalogConfiguration
$sel:knowledgeArticleConfiguration:ServiceNowConfiguration' :: ServiceNowConfiguration
-> Maybe ServiceNowKnowledgeArticleConfiguration
$sel:authenticationType:ServiceNowConfiguration' :: ServiceNowConfiguration -> Maybe ServiceNowAuthenticationType
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ServiceNowAuthenticationType
authenticationType
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ServiceNowKnowledgeArticleConfiguration
knowledgeArticleConfiguration
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ServiceNowServiceCatalogConfiguration
serviceCatalogConfiguration
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
hostUrl
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
secretArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ServiceNowBuildVersionType
serviceNowBuildVersion
instance Prelude.NFData ServiceNowConfiguration where
rnf :: ServiceNowConfiguration -> ()
rnf ServiceNowConfiguration' {Maybe ServiceNowAuthenticationType
Maybe ServiceNowKnowledgeArticleConfiguration
Maybe ServiceNowServiceCatalogConfiguration
Text
ServiceNowBuildVersionType
serviceNowBuildVersion :: ServiceNowBuildVersionType
secretArn :: Text
hostUrl :: Text
serviceCatalogConfiguration :: Maybe ServiceNowServiceCatalogConfiguration
knowledgeArticleConfiguration :: Maybe ServiceNowKnowledgeArticleConfiguration
authenticationType :: Maybe ServiceNowAuthenticationType
$sel:serviceNowBuildVersion:ServiceNowConfiguration' :: ServiceNowConfiguration -> ServiceNowBuildVersionType
$sel:secretArn:ServiceNowConfiguration' :: ServiceNowConfiguration -> Text
$sel:hostUrl:ServiceNowConfiguration' :: ServiceNowConfiguration -> Text
$sel:serviceCatalogConfiguration:ServiceNowConfiguration' :: ServiceNowConfiguration
-> Maybe ServiceNowServiceCatalogConfiguration
$sel:knowledgeArticleConfiguration:ServiceNowConfiguration' :: ServiceNowConfiguration
-> Maybe ServiceNowKnowledgeArticleConfiguration
$sel:authenticationType:ServiceNowConfiguration' :: ServiceNowConfiguration -> Maybe ServiceNowAuthenticationType
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe ServiceNowAuthenticationType
authenticationType
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ServiceNowKnowledgeArticleConfiguration
knowledgeArticleConfiguration
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ServiceNowServiceCatalogConfiguration
serviceCatalogConfiguration
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
hostUrl
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
secretArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ServiceNowBuildVersionType
serviceNowBuildVersion
instance Data.ToJSON ServiceNowConfiguration where
toJSON :: ServiceNowConfiguration -> Value
toJSON ServiceNowConfiguration' {Maybe ServiceNowAuthenticationType
Maybe ServiceNowKnowledgeArticleConfiguration
Maybe ServiceNowServiceCatalogConfiguration
Text
ServiceNowBuildVersionType
serviceNowBuildVersion :: ServiceNowBuildVersionType
secretArn :: Text
hostUrl :: Text
serviceCatalogConfiguration :: Maybe ServiceNowServiceCatalogConfiguration
knowledgeArticleConfiguration :: Maybe ServiceNowKnowledgeArticleConfiguration
authenticationType :: Maybe ServiceNowAuthenticationType
$sel:serviceNowBuildVersion:ServiceNowConfiguration' :: ServiceNowConfiguration -> ServiceNowBuildVersionType
$sel:secretArn:ServiceNowConfiguration' :: ServiceNowConfiguration -> Text
$sel:hostUrl:ServiceNowConfiguration' :: ServiceNowConfiguration -> Text
$sel:serviceCatalogConfiguration:ServiceNowConfiguration' :: ServiceNowConfiguration
-> Maybe ServiceNowServiceCatalogConfiguration
$sel:knowledgeArticleConfiguration:ServiceNowConfiguration' :: ServiceNowConfiguration
-> Maybe ServiceNowKnowledgeArticleConfiguration
$sel:authenticationType:ServiceNowConfiguration' :: ServiceNowConfiguration -> Maybe ServiceNowAuthenticationType
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"AuthenticationType" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ServiceNowAuthenticationType
authenticationType,
(Key
"KnowledgeArticleConfiguration" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ServiceNowKnowledgeArticleConfiguration
knowledgeArticleConfiguration,
(Key
"ServiceCatalogConfiguration" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ServiceNowServiceCatalogConfiguration
serviceCatalogConfiguration,
forall a. a -> Maybe a
Prelude.Just (Key
"HostUrl" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
hostUrl),
forall a. a -> Maybe a
Prelude.Just (Key
"SecretArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
secretArn),
forall a. a -> Maybe a
Prelude.Just
( Key
"ServiceNowBuildVersion"
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= ServiceNowBuildVersionType
serviceNowBuildVersion
)
]
)