{-# 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.DMS.Types.SupportedEndpointType
-- 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.DMS.Types.SupportedEndpointType where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import Amazonka.DMS.Types.ReplicationEndpointTypeValue
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude

-- | Provides information about types of supported endpoints in response to a
-- request by the @DescribeEndpointTypes@ operation. This information
-- includes the type of endpoint, the database engine name, and whether
-- change data capture (CDC) is supported.
--
-- /See:/ 'newSupportedEndpointType' smart constructor.
data SupportedEndpointType = SupportedEndpointType'
  { -- | The type of endpoint. Valid values are @source@ and @target@.
    SupportedEndpointType -> Maybe ReplicationEndpointTypeValue
endpointType :: Prelude.Maybe ReplicationEndpointTypeValue,
    -- | The expanded name for the engine name. For example, if the @EngineName@
    -- parameter is \"aurora\", this value would be \"Amazon Aurora MySQL\".
    SupportedEndpointType -> Maybe Text
engineDisplayName :: Prelude.Maybe Prelude.Text,
    -- | The database engine name. Valid values, depending on the EndpointType,
    -- include @\"mysql\"@, @\"oracle\"@, @\"postgres\"@, @\"mariadb\"@,
    -- @\"aurora\"@, @\"aurora-postgresql\"@, @\"redshift\"@, @\"s3\"@,
    -- @\"db2\"@, @\"db2-zos\"@, @\"azuredb\"@, @\"sybase\"@, @\"dynamodb\"@,
    -- @\"mongodb\"@, @\"kinesis\"@, @\"kafka\"@, @\"elasticsearch\"@,
    -- @\"documentdb\"@, @\"sqlserver\"@, @\"neptune\"@, and @\"babelfish\"@.
    SupportedEndpointType -> Maybe Text
engineName :: Prelude.Maybe Prelude.Text,
    -- | The earliest DMS engine version that supports this endpoint engine. Note
    -- that endpoint engines released with DMS versions earlier than 3.1.1 do
    -- not return a value for this parameter.
    SupportedEndpointType -> Maybe Text
replicationInstanceEngineMinimumVersion :: Prelude.Maybe Prelude.Text,
    -- | Indicates if change data capture (CDC) is supported.
    SupportedEndpointType -> Maybe Bool
supportsCDC :: Prelude.Maybe Prelude.Bool
  }
  deriving (SupportedEndpointType -> SupportedEndpointType -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SupportedEndpointType -> SupportedEndpointType -> Bool
$c/= :: SupportedEndpointType -> SupportedEndpointType -> Bool
== :: SupportedEndpointType -> SupportedEndpointType -> Bool
$c== :: SupportedEndpointType -> SupportedEndpointType -> Bool
Prelude.Eq, ReadPrec [SupportedEndpointType]
ReadPrec SupportedEndpointType
Int -> ReadS SupportedEndpointType
ReadS [SupportedEndpointType]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SupportedEndpointType]
$creadListPrec :: ReadPrec [SupportedEndpointType]
readPrec :: ReadPrec SupportedEndpointType
$creadPrec :: ReadPrec SupportedEndpointType
readList :: ReadS [SupportedEndpointType]
$creadList :: ReadS [SupportedEndpointType]
readsPrec :: Int -> ReadS SupportedEndpointType
$creadsPrec :: Int -> ReadS SupportedEndpointType
Prelude.Read, Int -> SupportedEndpointType -> ShowS
[SupportedEndpointType] -> ShowS
SupportedEndpointType -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SupportedEndpointType] -> ShowS
$cshowList :: [SupportedEndpointType] -> ShowS
show :: SupportedEndpointType -> String
$cshow :: SupportedEndpointType -> String
showsPrec :: Int -> SupportedEndpointType -> ShowS
$cshowsPrec :: Int -> SupportedEndpointType -> ShowS
Prelude.Show, forall x. Rep SupportedEndpointType x -> SupportedEndpointType
forall x. SupportedEndpointType -> Rep SupportedEndpointType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SupportedEndpointType x -> SupportedEndpointType
$cfrom :: forall x. SupportedEndpointType -> Rep SupportedEndpointType x
Prelude.Generic)

-- |
-- Create a value of 'SupportedEndpointType' 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:
--
-- 'endpointType', 'supportedEndpointType_endpointType' - The type of endpoint. Valid values are @source@ and @target@.
--
-- 'engineDisplayName', 'supportedEndpointType_engineDisplayName' - The expanded name for the engine name. For example, if the @EngineName@
-- parameter is \"aurora\", this value would be \"Amazon Aurora MySQL\".
--
-- 'engineName', 'supportedEndpointType_engineName' - The database engine name. Valid values, depending on the EndpointType,
-- include @\"mysql\"@, @\"oracle\"@, @\"postgres\"@, @\"mariadb\"@,
-- @\"aurora\"@, @\"aurora-postgresql\"@, @\"redshift\"@, @\"s3\"@,
-- @\"db2\"@, @\"db2-zos\"@, @\"azuredb\"@, @\"sybase\"@, @\"dynamodb\"@,
-- @\"mongodb\"@, @\"kinesis\"@, @\"kafka\"@, @\"elasticsearch\"@,
-- @\"documentdb\"@, @\"sqlserver\"@, @\"neptune\"@, and @\"babelfish\"@.
--
-- 'replicationInstanceEngineMinimumVersion', 'supportedEndpointType_replicationInstanceEngineMinimumVersion' - The earliest DMS engine version that supports this endpoint engine. Note
-- that endpoint engines released with DMS versions earlier than 3.1.1 do
-- not return a value for this parameter.
--
-- 'supportsCDC', 'supportedEndpointType_supportsCDC' - Indicates if change data capture (CDC) is supported.
newSupportedEndpointType ::
  SupportedEndpointType
newSupportedEndpointType :: SupportedEndpointType
newSupportedEndpointType =
  SupportedEndpointType'
    { $sel:endpointType:SupportedEndpointType' :: Maybe ReplicationEndpointTypeValue
endpointType =
        forall a. Maybe a
Prelude.Nothing,
      $sel:engineDisplayName:SupportedEndpointType' :: Maybe Text
engineDisplayName = forall a. Maybe a
Prelude.Nothing,
      $sel:engineName:SupportedEndpointType' :: Maybe Text
engineName = forall a. Maybe a
Prelude.Nothing,
      $sel:replicationInstanceEngineMinimumVersion:SupportedEndpointType' :: Maybe Text
replicationInstanceEngineMinimumVersion =
        forall a. Maybe a
Prelude.Nothing,
      $sel:supportsCDC:SupportedEndpointType' :: Maybe Bool
supportsCDC = forall a. Maybe a
Prelude.Nothing
    }

-- | The type of endpoint. Valid values are @source@ and @target@.
supportedEndpointType_endpointType :: Lens.Lens' SupportedEndpointType (Prelude.Maybe ReplicationEndpointTypeValue)
supportedEndpointType_endpointType :: Lens' SupportedEndpointType (Maybe ReplicationEndpointTypeValue)
supportedEndpointType_endpointType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SupportedEndpointType' {Maybe ReplicationEndpointTypeValue
endpointType :: Maybe ReplicationEndpointTypeValue
$sel:endpointType:SupportedEndpointType' :: SupportedEndpointType -> Maybe ReplicationEndpointTypeValue
endpointType} -> Maybe ReplicationEndpointTypeValue
endpointType) (\s :: SupportedEndpointType
s@SupportedEndpointType' {} Maybe ReplicationEndpointTypeValue
a -> SupportedEndpointType
s {$sel:endpointType:SupportedEndpointType' :: Maybe ReplicationEndpointTypeValue
endpointType = Maybe ReplicationEndpointTypeValue
a} :: SupportedEndpointType)

-- | The expanded name for the engine name. For example, if the @EngineName@
-- parameter is \"aurora\", this value would be \"Amazon Aurora MySQL\".
supportedEndpointType_engineDisplayName :: Lens.Lens' SupportedEndpointType (Prelude.Maybe Prelude.Text)
supportedEndpointType_engineDisplayName :: Lens' SupportedEndpointType (Maybe Text)
supportedEndpointType_engineDisplayName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SupportedEndpointType' {Maybe Text
engineDisplayName :: Maybe Text
$sel:engineDisplayName:SupportedEndpointType' :: SupportedEndpointType -> Maybe Text
engineDisplayName} -> Maybe Text
engineDisplayName) (\s :: SupportedEndpointType
s@SupportedEndpointType' {} Maybe Text
a -> SupportedEndpointType
s {$sel:engineDisplayName:SupportedEndpointType' :: Maybe Text
engineDisplayName = Maybe Text
a} :: SupportedEndpointType)

-- | The database engine name. Valid values, depending on the EndpointType,
-- include @\"mysql\"@, @\"oracle\"@, @\"postgres\"@, @\"mariadb\"@,
-- @\"aurora\"@, @\"aurora-postgresql\"@, @\"redshift\"@, @\"s3\"@,
-- @\"db2\"@, @\"db2-zos\"@, @\"azuredb\"@, @\"sybase\"@, @\"dynamodb\"@,
-- @\"mongodb\"@, @\"kinesis\"@, @\"kafka\"@, @\"elasticsearch\"@,
-- @\"documentdb\"@, @\"sqlserver\"@, @\"neptune\"@, and @\"babelfish\"@.
supportedEndpointType_engineName :: Lens.Lens' SupportedEndpointType (Prelude.Maybe Prelude.Text)
supportedEndpointType_engineName :: Lens' SupportedEndpointType (Maybe Text)
supportedEndpointType_engineName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SupportedEndpointType' {Maybe Text
engineName :: Maybe Text
$sel:engineName:SupportedEndpointType' :: SupportedEndpointType -> Maybe Text
engineName} -> Maybe Text
engineName) (\s :: SupportedEndpointType
s@SupportedEndpointType' {} Maybe Text
a -> SupportedEndpointType
s {$sel:engineName:SupportedEndpointType' :: Maybe Text
engineName = Maybe Text
a} :: SupportedEndpointType)

-- | The earliest DMS engine version that supports this endpoint engine. Note
-- that endpoint engines released with DMS versions earlier than 3.1.1 do
-- not return a value for this parameter.
supportedEndpointType_replicationInstanceEngineMinimumVersion :: Lens.Lens' SupportedEndpointType (Prelude.Maybe Prelude.Text)
supportedEndpointType_replicationInstanceEngineMinimumVersion :: Lens' SupportedEndpointType (Maybe Text)
supportedEndpointType_replicationInstanceEngineMinimumVersion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SupportedEndpointType' {Maybe Text
replicationInstanceEngineMinimumVersion :: Maybe Text
$sel:replicationInstanceEngineMinimumVersion:SupportedEndpointType' :: SupportedEndpointType -> Maybe Text
replicationInstanceEngineMinimumVersion} -> Maybe Text
replicationInstanceEngineMinimumVersion) (\s :: SupportedEndpointType
s@SupportedEndpointType' {} Maybe Text
a -> SupportedEndpointType
s {$sel:replicationInstanceEngineMinimumVersion:SupportedEndpointType' :: Maybe Text
replicationInstanceEngineMinimumVersion = Maybe Text
a} :: SupportedEndpointType)

-- | Indicates if change data capture (CDC) is supported.
supportedEndpointType_supportsCDC :: Lens.Lens' SupportedEndpointType (Prelude.Maybe Prelude.Bool)
supportedEndpointType_supportsCDC :: Lens' SupportedEndpointType (Maybe Bool)
supportedEndpointType_supportsCDC = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SupportedEndpointType' {Maybe Bool
supportsCDC :: Maybe Bool
$sel:supportsCDC:SupportedEndpointType' :: SupportedEndpointType -> Maybe Bool
supportsCDC} -> Maybe Bool
supportsCDC) (\s :: SupportedEndpointType
s@SupportedEndpointType' {} Maybe Bool
a -> SupportedEndpointType
s {$sel:supportsCDC:SupportedEndpointType' :: Maybe Bool
supportsCDC = Maybe Bool
a} :: SupportedEndpointType)

instance Data.FromJSON SupportedEndpointType where
  parseJSON :: Value -> Parser SupportedEndpointType
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"SupportedEndpointType"
      ( \Object
x ->
          Maybe ReplicationEndpointTypeValue
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> SupportedEndpointType
SupportedEndpointType'
            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
"EndpointType")
            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
"EngineDisplayName")
            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
"EngineName")
            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
"ReplicationInstanceEngineMinimumVersion"
                        )
            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
"SupportsCDC")
      )

instance Prelude.Hashable SupportedEndpointType where
  hashWithSalt :: Int -> SupportedEndpointType -> Int
hashWithSalt Int
_salt SupportedEndpointType' {Maybe Bool
Maybe Text
Maybe ReplicationEndpointTypeValue
supportsCDC :: Maybe Bool
replicationInstanceEngineMinimumVersion :: Maybe Text
engineName :: Maybe Text
engineDisplayName :: Maybe Text
endpointType :: Maybe ReplicationEndpointTypeValue
$sel:supportsCDC:SupportedEndpointType' :: SupportedEndpointType -> Maybe Bool
$sel:replicationInstanceEngineMinimumVersion:SupportedEndpointType' :: SupportedEndpointType -> Maybe Text
$sel:engineName:SupportedEndpointType' :: SupportedEndpointType -> Maybe Text
$sel:engineDisplayName:SupportedEndpointType' :: SupportedEndpointType -> Maybe Text
$sel:endpointType:SupportedEndpointType' :: SupportedEndpointType -> Maybe ReplicationEndpointTypeValue
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ReplicationEndpointTypeValue
endpointType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
engineDisplayName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
engineName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
replicationInstanceEngineMinimumVersion
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
supportsCDC

instance Prelude.NFData SupportedEndpointType where
  rnf :: SupportedEndpointType -> ()
rnf SupportedEndpointType' {Maybe Bool
Maybe Text
Maybe ReplicationEndpointTypeValue
supportsCDC :: Maybe Bool
replicationInstanceEngineMinimumVersion :: Maybe Text
engineName :: Maybe Text
engineDisplayName :: Maybe Text
endpointType :: Maybe ReplicationEndpointTypeValue
$sel:supportsCDC:SupportedEndpointType' :: SupportedEndpointType -> Maybe Bool
$sel:replicationInstanceEngineMinimumVersion:SupportedEndpointType' :: SupportedEndpointType -> Maybe Text
$sel:engineName:SupportedEndpointType' :: SupportedEndpointType -> Maybe Text
$sel:engineDisplayName:SupportedEndpointType' :: SupportedEndpointType -> Maybe Text
$sel:endpointType:SupportedEndpointType' :: SupportedEndpointType -> Maybe ReplicationEndpointTypeValue
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe ReplicationEndpointTypeValue
endpointType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
engineDisplayName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
engineName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
replicationInstanceEngineMinimumVersion
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
supportsCDC