{-# 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.Glue.Types.Connection
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Glue.Types.Connection where

import qualified Amazonka.Core as Core
import Amazonka.Glue.Types.ConnectionPropertyKey
import Amazonka.Glue.Types.ConnectionType
import Amazonka.Glue.Types.PhysicalConnectionRequirements
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Defines a connection to a data source.
--
-- /See:/ 'newConnection' smart constructor.
data Connection = Connection'
  { -- | The time that this connection definition was created.
    Connection -> Maybe POSIX
creationTime :: Prelude.Maybe Core.POSIX,
    -- | The user, group, or role that last updated this connection definition.
    Connection -> Maybe Text
lastUpdatedBy :: Prelude.Maybe Prelude.Text,
    -- | These key-value pairs define parameters for the connection:
    --
    -- -   @HOST@ - The host URI: either the fully qualified domain name (FQDN)
    --     or the IPv4 address of the database host.
    --
    -- -   @PORT@ - The port number, between 1024 and 65535, of the port on
    --     which the database host is listening for database connections.
    --
    -- -   @USER_NAME@ - The name under which to log in to the database. The
    --     value string for @USER_NAME@ is \"@USERNAME@\".
    --
    -- -   @PASSWORD@ - A password, if one is used, for the user name.
    --
    -- -   @ENCRYPTED_PASSWORD@ - When you enable connection password
    --     protection by setting @ConnectionPasswordEncryption@ in the Data
    --     Catalog encryption settings, this field stores the encrypted
    --     password.
    --
    -- -   @JDBC_DRIVER_JAR_URI@ - The Amazon Simple Storage Service (Amazon
    --     S3) path of the JAR file that contains the JDBC driver to use.
    --
    -- -   @JDBC_DRIVER_CLASS_NAME@ - The class name of the JDBC driver to use.
    --
    -- -   @JDBC_ENGINE@ - The name of the JDBC engine to use.
    --
    -- -   @JDBC_ENGINE_VERSION@ - The version of the JDBC engine to use.
    --
    -- -   @CONFIG_FILES@ - (Reserved for future use.)
    --
    -- -   @INSTANCE_ID@ - The instance ID to use.
    --
    -- -   @JDBC_CONNECTION_URL@ - The URL for connecting to a JDBC data
    --     source.
    --
    -- -   @JDBC_ENFORCE_SSL@ - A Boolean string (true, false) specifying
    --     whether Secure Sockets Layer (SSL) with hostname matching is
    --     enforced for the JDBC connection on the client. The default is
    --     false.
    --
    -- -   @CUSTOM_JDBC_CERT@ - An Amazon S3 location specifying the
    --     customer\'s root certificate. Glue uses this root certificate to
    --     validate the customer’s certificate when connecting to the customer
    --     database. Glue only handles X.509 certificates. The certificate
    --     provided must be DER-encoded and supplied in Base64 encoding PEM
    --     format.
    --
    -- -   @SKIP_CUSTOM_JDBC_CERT_VALIDATION@ - By default, this is @false@.
    --     Glue validates the Signature algorithm and Subject Public Key
    --     Algorithm for the customer certificate. The only permitted
    --     algorithms for the Signature algorithm are SHA256withRSA,
    --     SHA384withRSA or SHA512withRSA. For the Subject Public Key
    --     Algorithm, the key length must be at least 2048. You can set the
    --     value of this property to @true@ to skip Glue’s validation of the
    --     customer certificate.
    --
    -- -   @CUSTOM_JDBC_CERT_STRING@ - A custom JDBC certificate string which
    --     is used for domain match or distinguished name match to prevent a
    --     man-in-the-middle attack. In Oracle database, this is used as the
    --     @SSL_SERVER_CERT_DN@; in Microsoft SQL Server, this is used as the
    --     @hostNameInCertificate@.
    --
    -- -   @CONNECTION_URL@ - The URL for connecting to a general (non-JDBC)
    --     data source.
    --
    -- -   @KAFKA_BOOTSTRAP_SERVERS@ - A comma-separated list of host and port
    --     pairs that are the addresses of the Apache Kafka brokers in a Kafka
    --     cluster to which a Kafka client will connect to and bootstrap
    --     itself.
    --
    -- -   @KAFKA_SSL_ENABLED@ - Whether to enable or disable SSL on an Apache
    --     Kafka connection. Default value is \"true\".
    --
    -- -   @KAFKA_CUSTOM_CERT@ - The Amazon S3 URL for the private CA cert file
    --     (.pem format). The default is an empty string.
    --
    -- -   @KAFKA_SKIP_CUSTOM_CERT_VALIDATION@ - Whether to skip the validation
    --     of the CA cert file or not. Glue validates for three algorithms:
    --     SHA256withRSA, SHA384withRSA and SHA512withRSA. Default value is
    --     \"false\".
    --
    -- -   @SECRET_ID@ - The secret ID used for the secret manager of
    --     credentials.
    --
    -- -   @CONNECTOR_URL@ - The connector URL for a MARKETPLACE or CUSTOM
    --     connection.
    --
    -- -   @CONNECTOR_TYPE@ - The connector type for a MARKETPLACE or CUSTOM
    --     connection.
    --
    -- -   @CONNECTOR_CLASS_NAME@ - The connector class name for a MARKETPLACE
    --     or CUSTOM connection.
    --
    -- -   @KAFKA_CLIENT_KEYSTORE@ - The Amazon S3 location of the client
    --     keystore file for Kafka client side authentication (Optional).
    --
    -- -   @KAFKA_CLIENT_KEYSTORE_PASSWORD@ - The password to access the
    --     provided keystore (Optional).
    --
    -- -   @KAFKA_CLIENT_KEY_PASSWORD@ - A keystore can consist of multiple
    --     keys, so this is the password to access the client key to be used
    --     with the Kafka server side key (Optional).
    --
    -- -   @ENCRYPTED_KAFKA_CLIENT_KEYSTORE_PASSWORD@ - The encrypted version
    --     of the Kafka client keystore password (if the user has the Glue
    --     encrypt passwords setting selected).
    --
    -- -   @ENCRYPTED_KAFKA_CLIENT_KEY_PASSWORD@ - The encrypted version of the
    --     Kafka client key password (if the user has the Glue encrypt
    --     passwords setting selected).
    Connection -> Maybe (HashMap ConnectionPropertyKey Text)
connectionProperties :: Prelude.Maybe (Prelude.HashMap ConnectionPropertyKey Prelude.Text),
    -- | The last time that this connection definition was updated.
    Connection -> Maybe POSIX
lastUpdatedTime :: Prelude.Maybe Core.POSIX,
    -- | A list of criteria that can be used in selecting this connection.
    Connection -> Maybe [Text]
matchCriteria :: Prelude.Maybe [Prelude.Text],
    -- | A map of physical connection requirements, such as virtual private cloud
    -- (VPC) and @SecurityGroup@, that are needed to make this connection
    -- successfully.
    Connection -> Maybe PhysicalConnectionRequirements
physicalConnectionRequirements :: Prelude.Maybe PhysicalConnectionRequirements,
    -- | The name of the connection definition.
    Connection -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The description of the connection.
    Connection -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The type of the connection. Currently, SFTP is not supported.
    Connection -> Maybe ConnectionType
connectionType :: Prelude.Maybe ConnectionType
  }
  deriving (Connection -> Connection -> Bool
(Connection -> Connection -> Bool)
-> (Connection -> Connection -> Bool) -> Eq Connection
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Connection -> Connection -> Bool
$c/= :: Connection -> Connection -> Bool
== :: Connection -> Connection -> Bool
$c== :: Connection -> Connection -> Bool
Prelude.Eq, ReadPrec [Connection]
ReadPrec Connection
Int -> ReadS Connection
ReadS [Connection]
(Int -> ReadS Connection)
-> ReadS [Connection]
-> ReadPrec Connection
-> ReadPrec [Connection]
-> Read Connection
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Connection]
$creadListPrec :: ReadPrec [Connection]
readPrec :: ReadPrec Connection
$creadPrec :: ReadPrec Connection
readList :: ReadS [Connection]
$creadList :: ReadS [Connection]
readsPrec :: Int -> ReadS Connection
$creadsPrec :: Int -> ReadS Connection
Prelude.Read, Int -> Connection -> ShowS
[Connection] -> ShowS
Connection -> String
(Int -> Connection -> ShowS)
-> (Connection -> String)
-> ([Connection] -> ShowS)
-> Show Connection
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Connection] -> ShowS
$cshowList :: [Connection] -> ShowS
show :: Connection -> String
$cshow :: Connection -> String
showsPrec :: Int -> Connection -> ShowS
$cshowsPrec :: Int -> Connection -> ShowS
Prelude.Show, (forall x. Connection -> Rep Connection x)
-> (forall x. Rep Connection x -> Connection) -> Generic Connection
forall x. Rep Connection x -> Connection
forall x. Connection -> Rep Connection x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Connection x -> Connection
$cfrom :: forall x. Connection -> Rep Connection x
Prelude.Generic)

-- |
-- Create a value of 'Connection' 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:
--
-- 'creationTime', 'connection_creationTime' - The time that this connection definition was created.
--
-- 'lastUpdatedBy', 'connection_lastUpdatedBy' - The user, group, or role that last updated this connection definition.
--
-- 'connectionProperties', 'connection_connectionProperties' - These key-value pairs define parameters for the connection:
--
-- -   @HOST@ - The host URI: either the fully qualified domain name (FQDN)
--     or the IPv4 address of the database host.
--
-- -   @PORT@ - The port number, between 1024 and 65535, of the port on
--     which the database host is listening for database connections.
--
-- -   @USER_NAME@ - The name under which to log in to the database. The
--     value string for @USER_NAME@ is \"@USERNAME@\".
--
-- -   @PASSWORD@ - A password, if one is used, for the user name.
--
-- -   @ENCRYPTED_PASSWORD@ - When you enable connection password
--     protection by setting @ConnectionPasswordEncryption@ in the Data
--     Catalog encryption settings, this field stores the encrypted
--     password.
--
-- -   @JDBC_DRIVER_JAR_URI@ - The Amazon Simple Storage Service (Amazon
--     S3) path of the JAR file that contains the JDBC driver to use.
--
-- -   @JDBC_DRIVER_CLASS_NAME@ - The class name of the JDBC driver to use.
--
-- -   @JDBC_ENGINE@ - The name of the JDBC engine to use.
--
-- -   @JDBC_ENGINE_VERSION@ - The version of the JDBC engine to use.
--
-- -   @CONFIG_FILES@ - (Reserved for future use.)
--
-- -   @INSTANCE_ID@ - The instance ID to use.
--
-- -   @JDBC_CONNECTION_URL@ - The URL for connecting to a JDBC data
--     source.
--
-- -   @JDBC_ENFORCE_SSL@ - A Boolean string (true, false) specifying
--     whether Secure Sockets Layer (SSL) with hostname matching is
--     enforced for the JDBC connection on the client. The default is
--     false.
--
-- -   @CUSTOM_JDBC_CERT@ - An Amazon S3 location specifying the
--     customer\'s root certificate. Glue uses this root certificate to
--     validate the customer’s certificate when connecting to the customer
--     database. Glue only handles X.509 certificates. The certificate
--     provided must be DER-encoded and supplied in Base64 encoding PEM
--     format.
--
-- -   @SKIP_CUSTOM_JDBC_CERT_VALIDATION@ - By default, this is @false@.
--     Glue validates the Signature algorithm and Subject Public Key
--     Algorithm for the customer certificate. The only permitted
--     algorithms for the Signature algorithm are SHA256withRSA,
--     SHA384withRSA or SHA512withRSA. For the Subject Public Key
--     Algorithm, the key length must be at least 2048. You can set the
--     value of this property to @true@ to skip Glue’s validation of the
--     customer certificate.
--
-- -   @CUSTOM_JDBC_CERT_STRING@ - A custom JDBC certificate string which
--     is used for domain match or distinguished name match to prevent a
--     man-in-the-middle attack. In Oracle database, this is used as the
--     @SSL_SERVER_CERT_DN@; in Microsoft SQL Server, this is used as the
--     @hostNameInCertificate@.
--
-- -   @CONNECTION_URL@ - The URL for connecting to a general (non-JDBC)
--     data source.
--
-- -   @KAFKA_BOOTSTRAP_SERVERS@ - A comma-separated list of host and port
--     pairs that are the addresses of the Apache Kafka brokers in a Kafka
--     cluster to which a Kafka client will connect to and bootstrap
--     itself.
--
-- -   @KAFKA_SSL_ENABLED@ - Whether to enable or disable SSL on an Apache
--     Kafka connection. Default value is \"true\".
--
-- -   @KAFKA_CUSTOM_CERT@ - The Amazon S3 URL for the private CA cert file
--     (.pem format). The default is an empty string.
--
-- -   @KAFKA_SKIP_CUSTOM_CERT_VALIDATION@ - Whether to skip the validation
--     of the CA cert file or not. Glue validates for three algorithms:
--     SHA256withRSA, SHA384withRSA and SHA512withRSA. Default value is
--     \"false\".
--
-- -   @SECRET_ID@ - The secret ID used for the secret manager of
--     credentials.
--
-- -   @CONNECTOR_URL@ - The connector URL for a MARKETPLACE or CUSTOM
--     connection.
--
-- -   @CONNECTOR_TYPE@ - The connector type for a MARKETPLACE or CUSTOM
--     connection.
--
-- -   @CONNECTOR_CLASS_NAME@ - The connector class name for a MARKETPLACE
--     or CUSTOM connection.
--
-- -   @KAFKA_CLIENT_KEYSTORE@ - The Amazon S3 location of the client
--     keystore file for Kafka client side authentication (Optional).
--
-- -   @KAFKA_CLIENT_KEYSTORE_PASSWORD@ - The password to access the
--     provided keystore (Optional).
--
-- -   @KAFKA_CLIENT_KEY_PASSWORD@ - A keystore can consist of multiple
--     keys, so this is the password to access the client key to be used
--     with the Kafka server side key (Optional).
--
-- -   @ENCRYPTED_KAFKA_CLIENT_KEYSTORE_PASSWORD@ - The encrypted version
--     of the Kafka client keystore password (if the user has the Glue
--     encrypt passwords setting selected).
--
-- -   @ENCRYPTED_KAFKA_CLIENT_KEY_PASSWORD@ - The encrypted version of the
--     Kafka client key password (if the user has the Glue encrypt
--     passwords setting selected).
--
-- 'lastUpdatedTime', 'connection_lastUpdatedTime' - The last time that this connection definition was updated.
--
-- 'matchCriteria', 'connection_matchCriteria' - A list of criteria that can be used in selecting this connection.
--
-- 'physicalConnectionRequirements', 'connection_physicalConnectionRequirements' - A map of physical connection requirements, such as virtual private cloud
-- (VPC) and @SecurityGroup@, that are needed to make this connection
-- successfully.
--
-- 'name', 'connection_name' - The name of the connection definition.
--
-- 'description', 'connection_description' - The description of the connection.
--
-- 'connectionType', 'connection_connectionType' - The type of the connection. Currently, SFTP is not supported.
newConnection ::
  Connection
newConnection :: Connection
newConnection =
  Connection' :: Maybe POSIX
-> Maybe Text
-> Maybe (HashMap ConnectionPropertyKey Text)
-> Maybe POSIX
-> Maybe [Text]
-> Maybe PhysicalConnectionRequirements
-> Maybe Text
-> Maybe Text
-> Maybe ConnectionType
-> Connection
Connection'
    { $sel:creationTime:Connection' :: Maybe POSIX
creationTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:lastUpdatedBy:Connection' :: Maybe Text
lastUpdatedBy = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:connectionProperties:Connection' :: Maybe (HashMap ConnectionPropertyKey Text)
connectionProperties = Maybe (HashMap ConnectionPropertyKey Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:lastUpdatedTime:Connection' :: Maybe POSIX
lastUpdatedTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:matchCriteria:Connection' :: Maybe [Text]
matchCriteria = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:physicalConnectionRequirements:Connection' :: Maybe PhysicalConnectionRequirements
physicalConnectionRequirements = Maybe PhysicalConnectionRequirements
forall a. Maybe a
Prelude.Nothing,
      $sel:name:Connection' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:description:Connection' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:connectionType:Connection' :: Maybe ConnectionType
connectionType = Maybe ConnectionType
forall a. Maybe a
Prelude.Nothing
    }

-- | The time that this connection definition was created.
connection_creationTime :: Lens.Lens' Connection (Prelude.Maybe Prelude.UTCTime)
connection_creationTime :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Connection -> f Connection
connection_creationTime = (Connection -> Maybe POSIX)
-> (Connection -> Maybe POSIX -> Connection)
-> Lens Connection Connection (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Connection' {Maybe POSIX
creationTime :: Maybe POSIX
$sel:creationTime:Connection' :: Connection -> Maybe POSIX
creationTime} -> Maybe POSIX
creationTime) (\s :: Connection
s@Connection' {} Maybe POSIX
a -> Connection
s {$sel:creationTime:Connection' :: Maybe POSIX
creationTime = Maybe POSIX
a} :: Connection) ((Maybe POSIX -> f (Maybe POSIX)) -> Connection -> f Connection)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Connection
-> f Connection
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

-- | The user, group, or role that last updated this connection definition.
connection_lastUpdatedBy :: Lens.Lens' Connection (Prelude.Maybe Prelude.Text)
connection_lastUpdatedBy :: (Maybe Text -> f (Maybe Text)) -> Connection -> f Connection
connection_lastUpdatedBy = (Connection -> Maybe Text)
-> (Connection -> Maybe Text -> Connection)
-> Lens Connection Connection (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Connection' {Maybe Text
lastUpdatedBy :: Maybe Text
$sel:lastUpdatedBy:Connection' :: Connection -> Maybe Text
lastUpdatedBy} -> Maybe Text
lastUpdatedBy) (\s :: Connection
s@Connection' {} Maybe Text
a -> Connection
s {$sel:lastUpdatedBy:Connection' :: Maybe Text
lastUpdatedBy = Maybe Text
a} :: Connection)

-- | These key-value pairs define parameters for the connection:
--
-- -   @HOST@ - The host URI: either the fully qualified domain name (FQDN)
--     or the IPv4 address of the database host.
--
-- -   @PORT@ - The port number, between 1024 and 65535, of the port on
--     which the database host is listening for database connections.
--
-- -   @USER_NAME@ - The name under which to log in to the database. The
--     value string for @USER_NAME@ is \"@USERNAME@\".
--
-- -   @PASSWORD@ - A password, if one is used, for the user name.
--
-- -   @ENCRYPTED_PASSWORD@ - When you enable connection password
--     protection by setting @ConnectionPasswordEncryption@ in the Data
--     Catalog encryption settings, this field stores the encrypted
--     password.
--
-- -   @JDBC_DRIVER_JAR_URI@ - The Amazon Simple Storage Service (Amazon
--     S3) path of the JAR file that contains the JDBC driver to use.
--
-- -   @JDBC_DRIVER_CLASS_NAME@ - The class name of the JDBC driver to use.
--
-- -   @JDBC_ENGINE@ - The name of the JDBC engine to use.
--
-- -   @JDBC_ENGINE_VERSION@ - The version of the JDBC engine to use.
--
-- -   @CONFIG_FILES@ - (Reserved for future use.)
--
-- -   @INSTANCE_ID@ - The instance ID to use.
--
-- -   @JDBC_CONNECTION_URL@ - The URL for connecting to a JDBC data
--     source.
--
-- -   @JDBC_ENFORCE_SSL@ - A Boolean string (true, false) specifying
--     whether Secure Sockets Layer (SSL) with hostname matching is
--     enforced for the JDBC connection on the client. The default is
--     false.
--
-- -   @CUSTOM_JDBC_CERT@ - An Amazon S3 location specifying the
--     customer\'s root certificate. Glue uses this root certificate to
--     validate the customer’s certificate when connecting to the customer
--     database. Glue only handles X.509 certificates. The certificate
--     provided must be DER-encoded and supplied in Base64 encoding PEM
--     format.
--
-- -   @SKIP_CUSTOM_JDBC_CERT_VALIDATION@ - By default, this is @false@.
--     Glue validates the Signature algorithm and Subject Public Key
--     Algorithm for the customer certificate. The only permitted
--     algorithms for the Signature algorithm are SHA256withRSA,
--     SHA384withRSA or SHA512withRSA. For the Subject Public Key
--     Algorithm, the key length must be at least 2048. You can set the
--     value of this property to @true@ to skip Glue’s validation of the
--     customer certificate.
--
-- -   @CUSTOM_JDBC_CERT_STRING@ - A custom JDBC certificate string which
--     is used for domain match or distinguished name match to prevent a
--     man-in-the-middle attack. In Oracle database, this is used as the
--     @SSL_SERVER_CERT_DN@; in Microsoft SQL Server, this is used as the
--     @hostNameInCertificate@.
--
-- -   @CONNECTION_URL@ - The URL for connecting to a general (non-JDBC)
--     data source.
--
-- -   @KAFKA_BOOTSTRAP_SERVERS@ - A comma-separated list of host and port
--     pairs that are the addresses of the Apache Kafka brokers in a Kafka
--     cluster to which a Kafka client will connect to and bootstrap
--     itself.
--
-- -   @KAFKA_SSL_ENABLED@ - Whether to enable or disable SSL on an Apache
--     Kafka connection. Default value is \"true\".
--
-- -   @KAFKA_CUSTOM_CERT@ - The Amazon S3 URL for the private CA cert file
--     (.pem format). The default is an empty string.
--
-- -   @KAFKA_SKIP_CUSTOM_CERT_VALIDATION@ - Whether to skip the validation
--     of the CA cert file or not. Glue validates for three algorithms:
--     SHA256withRSA, SHA384withRSA and SHA512withRSA. Default value is
--     \"false\".
--
-- -   @SECRET_ID@ - The secret ID used for the secret manager of
--     credentials.
--
-- -   @CONNECTOR_URL@ - The connector URL for a MARKETPLACE or CUSTOM
--     connection.
--
-- -   @CONNECTOR_TYPE@ - The connector type for a MARKETPLACE or CUSTOM
--     connection.
--
-- -   @CONNECTOR_CLASS_NAME@ - The connector class name for a MARKETPLACE
--     or CUSTOM connection.
--
-- -   @KAFKA_CLIENT_KEYSTORE@ - The Amazon S3 location of the client
--     keystore file for Kafka client side authentication (Optional).
--
-- -   @KAFKA_CLIENT_KEYSTORE_PASSWORD@ - The password to access the
--     provided keystore (Optional).
--
-- -   @KAFKA_CLIENT_KEY_PASSWORD@ - A keystore can consist of multiple
--     keys, so this is the password to access the client key to be used
--     with the Kafka server side key (Optional).
--
-- -   @ENCRYPTED_KAFKA_CLIENT_KEYSTORE_PASSWORD@ - The encrypted version
--     of the Kafka client keystore password (if the user has the Glue
--     encrypt passwords setting selected).
--
-- -   @ENCRYPTED_KAFKA_CLIENT_KEY_PASSWORD@ - The encrypted version of the
--     Kafka client key password (if the user has the Glue encrypt
--     passwords setting selected).
connection_connectionProperties :: Lens.Lens' Connection (Prelude.Maybe (Prelude.HashMap ConnectionPropertyKey Prelude.Text))
connection_connectionProperties :: (Maybe (HashMap ConnectionPropertyKey Text)
 -> f (Maybe (HashMap ConnectionPropertyKey Text)))
-> Connection -> f Connection
connection_connectionProperties = (Connection -> Maybe (HashMap ConnectionPropertyKey Text))
-> (Connection
    -> Maybe (HashMap ConnectionPropertyKey Text) -> Connection)
-> Lens
     Connection
     Connection
     (Maybe (HashMap ConnectionPropertyKey Text))
     (Maybe (HashMap ConnectionPropertyKey Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Connection' {Maybe (HashMap ConnectionPropertyKey Text)
connectionProperties :: Maybe (HashMap ConnectionPropertyKey Text)
$sel:connectionProperties:Connection' :: Connection -> Maybe (HashMap ConnectionPropertyKey Text)
connectionProperties} -> Maybe (HashMap ConnectionPropertyKey Text)
connectionProperties) (\s :: Connection
s@Connection' {} Maybe (HashMap ConnectionPropertyKey Text)
a -> Connection
s {$sel:connectionProperties:Connection' :: Maybe (HashMap ConnectionPropertyKey Text)
connectionProperties = Maybe (HashMap ConnectionPropertyKey Text)
a} :: Connection) ((Maybe (HashMap ConnectionPropertyKey Text)
  -> f (Maybe (HashMap ConnectionPropertyKey Text)))
 -> Connection -> f Connection)
-> ((Maybe (HashMap ConnectionPropertyKey Text)
     -> f (Maybe (HashMap ConnectionPropertyKey Text)))
    -> Maybe (HashMap ConnectionPropertyKey Text)
    -> f (Maybe (HashMap ConnectionPropertyKey Text)))
-> (Maybe (HashMap ConnectionPropertyKey Text)
    -> f (Maybe (HashMap ConnectionPropertyKey Text)))
-> Connection
-> f Connection
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap ConnectionPropertyKey Text)
  (HashMap ConnectionPropertyKey Text)
  (HashMap ConnectionPropertyKey Text)
  (HashMap ConnectionPropertyKey Text)
-> Iso
     (Maybe (HashMap ConnectionPropertyKey Text))
     (Maybe (HashMap ConnectionPropertyKey Text))
     (Maybe (HashMap ConnectionPropertyKey Text))
     (Maybe (HashMap ConnectionPropertyKey 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
  (HashMap ConnectionPropertyKey Text)
  (HashMap ConnectionPropertyKey Text)
  (HashMap ConnectionPropertyKey Text)
  (HashMap ConnectionPropertyKey Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The last time that this connection definition was updated.
connection_lastUpdatedTime :: Lens.Lens' Connection (Prelude.Maybe Prelude.UTCTime)
connection_lastUpdatedTime :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Connection -> f Connection
connection_lastUpdatedTime = (Connection -> Maybe POSIX)
-> (Connection -> Maybe POSIX -> Connection)
-> Lens Connection Connection (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Connection' {Maybe POSIX
lastUpdatedTime :: Maybe POSIX
$sel:lastUpdatedTime:Connection' :: Connection -> Maybe POSIX
lastUpdatedTime} -> Maybe POSIX
lastUpdatedTime) (\s :: Connection
s@Connection' {} Maybe POSIX
a -> Connection
s {$sel:lastUpdatedTime:Connection' :: Maybe POSIX
lastUpdatedTime = Maybe POSIX
a} :: Connection) ((Maybe POSIX -> f (Maybe POSIX)) -> Connection -> f Connection)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Connection
-> f Connection
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

-- | A list of criteria that can be used in selecting this connection.
connection_matchCriteria :: Lens.Lens' Connection (Prelude.Maybe [Prelude.Text])
connection_matchCriteria :: (Maybe [Text] -> f (Maybe [Text])) -> Connection -> f Connection
connection_matchCriteria = (Connection -> Maybe [Text])
-> (Connection -> Maybe [Text] -> Connection)
-> Lens Connection Connection (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Connection' {Maybe [Text]
matchCriteria :: Maybe [Text]
$sel:matchCriteria:Connection' :: Connection -> Maybe [Text]
matchCriteria} -> Maybe [Text]
matchCriteria) (\s :: Connection
s@Connection' {} Maybe [Text]
a -> Connection
s {$sel:matchCriteria:Connection' :: Maybe [Text]
matchCriteria = Maybe [Text]
a} :: Connection) ((Maybe [Text] -> f (Maybe [Text])) -> Connection -> f Connection)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> Connection
-> f Connection
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

-- | A map of physical connection requirements, such as virtual private cloud
-- (VPC) and @SecurityGroup@, that are needed to make this connection
-- successfully.
connection_physicalConnectionRequirements :: Lens.Lens' Connection (Prelude.Maybe PhysicalConnectionRequirements)
connection_physicalConnectionRequirements :: (Maybe PhysicalConnectionRequirements
 -> f (Maybe PhysicalConnectionRequirements))
-> Connection -> f Connection
connection_physicalConnectionRequirements = (Connection -> Maybe PhysicalConnectionRequirements)
-> (Connection
    -> Maybe PhysicalConnectionRequirements -> Connection)
-> Lens
     Connection
     Connection
     (Maybe PhysicalConnectionRequirements)
     (Maybe PhysicalConnectionRequirements)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Connection' {Maybe PhysicalConnectionRequirements
physicalConnectionRequirements :: Maybe PhysicalConnectionRequirements
$sel:physicalConnectionRequirements:Connection' :: Connection -> Maybe PhysicalConnectionRequirements
physicalConnectionRequirements} -> Maybe PhysicalConnectionRequirements
physicalConnectionRequirements) (\s :: Connection
s@Connection' {} Maybe PhysicalConnectionRequirements
a -> Connection
s {$sel:physicalConnectionRequirements:Connection' :: Maybe PhysicalConnectionRequirements
physicalConnectionRequirements = Maybe PhysicalConnectionRequirements
a} :: Connection)

-- | The name of the connection definition.
connection_name :: Lens.Lens' Connection (Prelude.Maybe Prelude.Text)
connection_name :: (Maybe Text -> f (Maybe Text)) -> Connection -> f Connection
connection_name = (Connection -> Maybe Text)
-> (Connection -> Maybe Text -> Connection)
-> Lens Connection Connection (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Connection' {Maybe Text
name :: Maybe Text
$sel:name:Connection' :: Connection -> Maybe Text
name} -> Maybe Text
name) (\s :: Connection
s@Connection' {} Maybe Text
a -> Connection
s {$sel:name:Connection' :: Maybe Text
name = Maybe Text
a} :: Connection)

-- | The description of the connection.
connection_description :: Lens.Lens' Connection (Prelude.Maybe Prelude.Text)
connection_description :: (Maybe Text -> f (Maybe Text)) -> Connection -> f Connection
connection_description = (Connection -> Maybe Text)
-> (Connection -> Maybe Text -> Connection)
-> Lens Connection Connection (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Connection' {Maybe Text
description :: Maybe Text
$sel:description:Connection' :: Connection -> Maybe Text
description} -> Maybe Text
description) (\s :: Connection
s@Connection' {} Maybe Text
a -> Connection
s {$sel:description:Connection' :: Maybe Text
description = Maybe Text
a} :: Connection)

-- | The type of the connection. Currently, SFTP is not supported.
connection_connectionType :: Lens.Lens' Connection (Prelude.Maybe ConnectionType)
connection_connectionType :: (Maybe ConnectionType -> f (Maybe ConnectionType))
-> Connection -> f Connection
connection_connectionType = (Connection -> Maybe ConnectionType)
-> (Connection -> Maybe ConnectionType -> Connection)
-> Lens
     Connection Connection (Maybe ConnectionType) (Maybe ConnectionType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Connection' {Maybe ConnectionType
connectionType :: Maybe ConnectionType
$sel:connectionType:Connection' :: Connection -> Maybe ConnectionType
connectionType} -> Maybe ConnectionType
connectionType) (\s :: Connection
s@Connection' {} Maybe ConnectionType
a -> Connection
s {$sel:connectionType:Connection' :: Maybe ConnectionType
connectionType = Maybe ConnectionType
a} :: Connection)

instance Core.FromJSON Connection where
  parseJSON :: Value -> Parser Connection
parseJSON =
    String
-> (Object -> Parser Connection) -> Value -> Parser Connection
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"Connection"
      ( \Object
x ->
          Maybe POSIX
-> Maybe Text
-> Maybe (HashMap ConnectionPropertyKey Text)
-> Maybe POSIX
-> Maybe [Text]
-> Maybe PhysicalConnectionRequirements
-> Maybe Text
-> Maybe Text
-> Maybe ConnectionType
-> Connection
Connection'
            (Maybe POSIX
 -> Maybe Text
 -> Maybe (HashMap ConnectionPropertyKey Text)
 -> Maybe POSIX
 -> Maybe [Text]
 -> Maybe PhysicalConnectionRequirements
 -> Maybe Text
 -> Maybe Text
 -> Maybe ConnectionType
 -> Connection)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text
      -> Maybe (HashMap ConnectionPropertyKey Text)
      -> Maybe POSIX
      -> Maybe [Text]
      -> Maybe PhysicalConnectionRequirements
      -> Maybe Text
      -> Maybe Text
      -> Maybe ConnectionType
      -> Connection)
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 Text
   -> Maybe (HashMap ConnectionPropertyKey Text)
   -> Maybe POSIX
   -> Maybe [Text]
   -> Maybe PhysicalConnectionRequirements
   -> Maybe Text
   -> Maybe Text
   -> Maybe ConnectionType
   -> Connection)
-> Parser (Maybe Text)
-> Parser
     (Maybe (HashMap ConnectionPropertyKey Text)
      -> Maybe POSIX
      -> Maybe [Text]
      -> Maybe PhysicalConnectionRequirements
      -> Maybe Text
      -> Maybe Text
      -> Maybe ConnectionType
      -> Connection)
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
"LastUpdatedBy")
            Parser
  (Maybe (HashMap ConnectionPropertyKey Text)
   -> Maybe POSIX
   -> Maybe [Text]
   -> Maybe PhysicalConnectionRequirements
   -> Maybe Text
   -> Maybe Text
   -> Maybe ConnectionType
   -> Connection)
-> Parser (Maybe (HashMap ConnectionPropertyKey Text))
-> Parser
     (Maybe POSIX
      -> Maybe [Text]
      -> Maybe PhysicalConnectionRequirements
      -> Maybe Text
      -> Maybe Text
      -> Maybe ConnectionType
      -> Connection)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object
-> Text
-> Parser (Maybe (Maybe (HashMap ConnectionPropertyKey Text)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ConnectionProperties"
                            Parser (Maybe (Maybe (HashMap ConnectionPropertyKey Text)))
-> Maybe (HashMap ConnectionPropertyKey Text)
-> Parser (Maybe (HashMap ConnectionPropertyKey Text))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap ConnectionPropertyKey Text)
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser
  (Maybe POSIX
   -> Maybe [Text]
   -> Maybe PhysicalConnectionRequirements
   -> Maybe Text
   -> Maybe Text
   -> Maybe ConnectionType
   -> Connection)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe [Text]
      -> Maybe PhysicalConnectionRequirements
      -> Maybe Text
      -> Maybe Text
      -> Maybe ConnectionType
      -> Connection)
forall (f :: * -> *) a b. Applicative f => 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
"LastUpdatedTime")
            Parser
  (Maybe [Text]
   -> Maybe PhysicalConnectionRequirements
   -> Maybe Text
   -> Maybe Text
   -> Maybe ConnectionType
   -> Connection)
-> Parser (Maybe [Text])
-> Parser
     (Maybe PhysicalConnectionRequirements
      -> Maybe Text -> Maybe Text -> Maybe ConnectionType -> Connection)
forall (f :: * -> *) a b. Applicative f => 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
"MatchCriteria" 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)
            Parser
  (Maybe PhysicalConnectionRequirements
   -> Maybe Text -> Maybe Text -> Maybe ConnectionType -> Connection)
-> Parser (Maybe PhysicalConnectionRequirements)
-> Parser
     (Maybe Text -> Maybe Text -> Maybe ConnectionType -> Connection)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe PhysicalConnectionRequirements)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"PhysicalConnectionRequirements")
            Parser
  (Maybe Text -> Maybe Text -> Maybe ConnectionType -> Connection)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe ConnectionType -> Connection)
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
"Name")
            Parser (Maybe Text -> Maybe ConnectionType -> Connection)
-> Parser (Maybe Text)
-> Parser (Maybe ConnectionType -> Connection)
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 (Maybe ConnectionType -> Connection)
-> Parser (Maybe ConnectionType) -> Parser Connection
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ConnectionType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ConnectionType")
      )

instance Prelude.Hashable Connection

instance Prelude.NFData Connection