{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.Kendra.Types.ServiceNowConfiguration
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
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

-- | Provides the configuration information to connect to ServiceNow as your
-- data source.
--
-- /See:/ 'newServiceNowConfiguration' smart constructor.
data ServiceNowConfiguration = ServiceNowConfiguration'
  { -- | The type of authentication used to connect to the ServiceNow instance.
    -- If you choose @HTTP_BASIC@, Amazon Kendra is authenticated using the
    -- user name and password provided in the Secrets Manager secret in the
    -- @SecretArn@ field. If you choose @OAUTH2@, Amazon Kendra is
    -- authenticated using the credentials of client ID, client secret, user
    -- name and password.
    --
    -- When you use @OAUTH2@ authentication, you must generate a token and a
    -- client secret using the ServiceNow console. For more information, see
    -- <https://docs.aws.amazon.com/kendra/latest/dg/data-source-servicenow.html Using a ServiceNow data source>.
    ServiceNowConfiguration -> Maybe ServiceNowAuthenticationType
authenticationType :: Prelude.Maybe ServiceNowAuthenticationType,
    -- | Configuration information for crawling knowledge articles in the
    -- ServiceNow site.
    ServiceNowConfiguration
-> Maybe ServiceNowKnowledgeArticleConfiguration
knowledgeArticleConfiguration :: Prelude.Maybe ServiceNowKnowledgeArticleConfiguration,
    -- | Configuration information for crawling service catalogs in the
    -- ServiceNow site.
    ServiceNowConfiguration
-> Maybe ServiceNowServiceCatalogConfiguration
serviceCatalogConfiguration :: Prelude.Maybe ServiceNowServiceCatalogConfiguration,
    -- | The ServiceNow instance that the data source connects to. The host
    -- endpoint should look like the following: /{instance}.service-now.com./
    ServiceNowConfiguration -> Text
hostUrl :: Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the Secrets Manager secret that
    -- contains the user name and password required to connect to the
    -- ServiceNow instance. You can also provide OAuth authentication
    -- credentials of user name, password, client ID, and client secret. For
    -- more information, see
    -- <https://docs.aws.amazon.com/kendra/latest/dg/data-source-servicenow.html Using a ServiceNow data source>.
    ServiceNowConfiguration -> Text
secretArn :: Prelude.Text,
    -- | The identifier of the release that the ServiceNow host is running. If
    -- the host is not running the @LONDON@ release, use @OTHERS@.
    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)

-- |
-- Create a value of 'ServiceNowConfiguration' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'authenticationType', 'serviceNowConfiguration_authenticationType' - The type of authentication used to connect to the ServiceNow instance.
-- If you choose @HTTP_BASIC@, Amazon Kendra is authenticated using the
-- user name and password provided in the Secrets Manager secret in the
-- @SecretArn@ field. If you choose @OAUTH2@, Amazon Kendra is
-- authenticated using the credentials of client ID, client secret, user
-- name and password.
--
-- When you use @OAUTH2@ authentication, you must generate a token and a
-- client secret using the ServiceNow console. For more information, see
-- <https://docs.aws.amazon.com/kendra/latest/dg/data-source-servicenow.html Using a ServiceNow data source>.
--
-- 'knowledgeArticleConfiguration', 'serviceNowConfiguration_knowledgeArticleConfiguration' - Configuration information for crawling knowledge articles in the
-- ServiceNow site.
--
-- 'serviceCatalogConfiguration', 'serviceNowConfiguration_serviceCatalogConfiguration' - Configuration information for crawling service catalogs in the
-- ServiceNow site.
--
-- 'hostUrl', 'serviceNowConfiguration_hostUrl' - The ServiceNow instance that the data source connects to. The host
-- endpoint should look like the following: /{instance}.service-now.com./
--
-- 'secretArn', 'serviceNowConfiguration_secretArn' - The Amazon Resource Name (ARN) of the Secrets Manager secret that
-- contains the user name and password required to connect to the
-- ServiceNow instance. You can also provide OAuth authentication
-- credentials of user name, password, client ID, and client secret. For
-- more information, see
-- <https://docs.aws.amazon.com/kendra/latest/dg/data-source-servicenow.html Using a ServiceNow data source>.
--
-- 'serviceNowBuildVersion', 'serviceNowConfiguration_serviceNowBuildVersion' - The identifier of the release that the ServiceNow host is running. If
-- the host is not running the @LONDON@ release, use @OTHERS@.
newServiceNowConfiguration ::
  -- | 'hostUrl'
  Prelude.Text ->
  -- | 'secretArn'
  Prelude.Text ->
  -- | 'serviceNowBuildVersion'
  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_
      }

-- | The type of authentication used to connect to the ServiceNow instance.
-- If you choose @HTTP_BASIC@, Amazon Kendra is authenticated using the
-- user name and password provided in the Secrets Manager secret in the
-- @SecretArn@ field. If you choose @OAUTH2@, Amazon Kendra is
-- authenticated using the credentials of client ID, client secret, user
-- name and password.
--
-- When you use @OAUTH2@ authentication, you must generate a token and a
-- client secret using the ServiceNow console. For more information, see
-- <https://docs.aws.amazon.com/kendra/latest/dg/data-source-servicenow.html Using a ServiceNow data source>.
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)

-- | Configuration information for crawling knowledge articles in the
-- ServiceNow site.
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)

-- | Configuration information for crawling service catalogs in the
-- ServiceNow site.
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)

-- | The ServiceNow instance that the data source connects to. The host
-- endpoint should look like the following: /{instance}.service-now.com./
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)

-- | The Amazon Resource Name (ARN) of the Secrets Manager secret that
-- contains the user name and password required to connect to the
-- ServiceNow instance. You can also provide OAuth authentication
-- credentials of user name, password, client ID, and client secret. For
-- more information, see
-- <https://docs.aws.amazon.com/kendra/latest/dg/data-source-servicenow.html Using a ServiceNow data source>.
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)

-- | The identifier of the release that the ServiceNow host is running. If
-- the host is not running the @LONDON@ release, use @OTHERS@.
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
              )
          ]
      )