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

import qualified Amazonka.Core as Core
import Amazonka.DMS.Types.ReplicationEndpointTypeValue
import qualified Amazonka.Lens as Lens
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 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 type of endpoint. Valid values are @source@ and @target@.
    SupportedEndpointType -> Maybe ReplicationEndpointTypeValue
endpointType :: Prelude.Maybe ReplicationEndpointTypeValue,
    -- | The database engine name. Valid values, depending on the EndpointType,
    -- include @\"mysql\"@, @\"oracle\"@, @\"postgres\"@, @\"mariadb\"@,
    -- @\"aurora\"@, @\"aurora-postgresql\"@, @\"redshift\"@, @\"s3\"@,
    -- @\"db2\"@, @\"azuredb\"@, @\"sybase\"@, @\"dynamodb\"@, @\"mongodb\"@,
    -- @\"kinesis\"@, @\"kafka\"@, @\"elasticsearch\"@, @\"documentdb\"@,
    -- @\"sqlserver\"@, and @\"neptune\"@.
    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
(SupportedEndpointType -> SupportedEndpointType -> Bool)
-> (SupportedEndpointType -> SupportedEndpointType -> Bool)
-> Eq SupportedEndpointType
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]
(Int -> ReadS SupportedEndpointType)
-> ReadS [SupportedEndpointType]
-> ReadPrec SupportedEndpointType
-> ReadPrec [SupportedEndpointType]
-> Read 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
(Int -> SupportedEndpointType -> ShowS)
-> (SupportedEndpointType -> String)
-> ([SupportedEndpointType] -> ShowS)
-> Show SupportedEndpointType
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. SupportedEndpointType -> Rep SupportedEndpointType x)
-> (forall x. Rep SupportedEndpointType x -> SupportedEndpointType)
-> Generic SupportedEndpointType
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:
--
-- '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.\"
--
-- 'endpointType', 'supportedEndpointType_endpointType' - The type of endpoint. Valid values are @source@ and @target@.
--
-- 'engineName', 'supportedEndpointType_engineName' - The database engine name. Valid values, depending on the EndpointType,
-- include @\"mysql\"@, @\"oracle\"@, @\"postgres\"@, @\"mariadb\"@,
-- @\"aurora\"@, @\"aurora-postgresql\"@, @\"redshift\"@, @\"s3\"@,
-- @\"db2\"@, @\"azuredb\"@, @\"sybase\"@, @\"dynamodb\"@, @\"mongodb\"@,
-- @\"kinesis\"@, @\"kafka\"@, @\"elasticsearch\"@, @\"documentdb\"@,
-- @\"sqlserver\"@, and @\"neptune\"@.
--
-- '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' :: Maybe Text
-> Maybe ReplicationEndpointTypeValue
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> SupportedEndpointType
SupportedEndpointType'
    { $sel:engineDisplayName:SupportedEndpointType' :: Maybe Text
engineDisplayName =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:endpointType:SupportedEndpointType' :: Maybe ReplicationEndpointTypeValue
endpointType = Maybe ReplicationEndpointTypeValue
forall a. Maybe a
Prelude.Nothing,
      $sel:engineName:SupportedEndpointType' :: Maybe Text
engineName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:replicationInstanceEngineMinimumVersion:SupportedEndpointType' :: Maybe Text
replicationInstanceEngineMinimumVersion =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:supportsCDC:SupportedEndpointType' :: Maybe Bool
supportsCDC = Maybe Bool
forall a. Maybe a
Prelude.Nothing
    }

-- | 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 :: (Maybe Text -> f (Maybe Text))
-> SupportedEndpointType -> f SupportedEndpointType
supportedEndpointType_engineDisplayName = (SupportedEndpointType -> Maybe Text)
-> (SupportedEndpointType -> Maybe Text -> SupportedEndpointType)
-> Lens
     SupportedEndpointType
     SupportedEndpointType
     (Maybe Text)
     (Maybe Text)
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 type of endpoint. Valid values are @source@ and @target@.
supportedEndpointType_endpointType :: Lens.Lens' SupportedEndpointType (Prelude.Maybe ReplicationEndpointTypeValue)
supportedEndpointType_endpointType :: (Maybe ReplicationEndpointTypeValue
 -> f (Maybe ReplicationEndpointTypeValue))
-> SupportedEndpointType -> f SupportedEndpointType
supportedEndpointType_endpointType = (SupportedEndpointType -> Maybe ReplicationEndpointTypeValue)
-> (SupportedEndpointType
    -> Maybe ReplicationEndpointTypeValue -> SupportedEndpointType)
-> Lens
     SupportedEndpointType
     SupportedEndpointType
     (Maybe ReplicationEndpointTypeValue)
     (Maybe ReplicationEndpointTypeValue)
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 database engine name. Valid values, depending on the EndpointType,
-- include @\"mysql\"@, @\"oracle\"@, @\"postgres\"@, @\"mariadb\"@,
-- @\"aurora\"@, @\"aurora-postgresql\"@, @\"redshift\"@, @\"s3\"@,
-- @\"db2\"@, @\"azuredb\"@, @\"sybase\"@, @\"dynamodb\"@, @\"mongodb\"@,
-- @\"kinesis\"@, @\"kafka\"@, @\"elasticsearch\"@, @\"documentdb\"@,
-- @\"sqlserver\"@, and @\"neptune\"@.
supportedEndpointType_engineName :: Lens.Lens' SupportedEndpointType (Prelude.Maybe Prelude.Text)
supportedEndpointType_engineName :: (Maybe Text -> f (Maybe Text))
-> SupportedEndpointType -> f SupportedEndpointType
supportedEndpointType_engineName = (SupportedEndpointType -> Maybe Text)
-> (SupportedEndpointType -> Maybe Text -> SupportedEndpointType)
-> Lens
     SupportedEndpointType
     SupportedEndpointType
     (Maybe Text)
     (Maybe Text)
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 :: (Maybe Text -> f (Maybe Text))
-> SupportedEndpointType -> f SupportedEndpointType
supportedEndpointType_replicationInstanceEngineMinimumVersion = (SupportedEndpointType -> Maybe Text)
-> (SupportedEndpointType -> Maybe Text -> SupportedEndpointType)
-> Lens
     SupportedEndpointType
     SupportedEndpointType
     (Maybe Text)
     (Maybe Text)
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 :: (Maybe Bool -> f (Maybe Bool))
-> SupportedEndpointType -> f SupportedEndpointType
supportedEndpointType_supportsCDC = (SupportedEndpointType -> Maybe Bool)
-> (SupportedEndpointType -> Maybe Bool -> SupportedEndpointType)
-> Lens
     SupportedEndpointType
     SupportedEndpointType
     (Maybe Bool)
     (Maybe Bool)
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 Core.FromJSON SupportedEndpointType where
  parseJSON :: Value -> Parser SupportedEndpointType
parseJSON =
    String
-> (Object -> Parser SupportedEndpointType)
-> Value
-> Parser SupportedEndpointType
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"SupportedEndpointType"
      ( \Object
x ->
          Maybe Text
-> Maybe ReplicationEndpointTypeValue
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> SupportedEndpointType
SupportedEndpointType'
            (Maybe Text
 -> Maybe ReplicationEndpointTypeValue
 -> Maybe Text
 -> Maybe Text
 -> Maybe Bool
 -> SupportedEndpointType)
-> Parser (Maybe Text)
-> Parser
     (Maybe ReplicationEndpointTypeValue
      -> Maybe Text -> Maybe Text -> Maybe Bool -> SupportedEndpointType)
forall (f :: * -> *) a b. Functor 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
"EngineDisplayName")
            Parser
  (Maybe ReplicationEndpointTypeValue
   -> Maybe Text -> Maybe Text -> Maybe Bool -> SupportedEndpointType)
-> Parser (Maybe ReplicationEndpointTypeValue)
-> Parser
     (Maybe Text -> Maybe Text -> Maybe Bool -> SupportedEndpointType)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ReplicationEndpointTypeValue)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"EndpointType")
            Parser
  (Maybe Text -> Maybe Text -> Maybe Bool -> SupportedEndpointType)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Bool -> SupportedEndpointType)
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
"EngineName")
            Parser (Maybe Text -> Maybe Bool -> SupportedEndpointType)
-> Parser (Maybe Text)
-> Parser (Maybe Bool -> SupportedEndpointType)
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
"ReplicationInstanceEngineMinimumVersion"
                        )
            Parser (Maybe Bool -> SupportedEndpointType)
-> Parser (Maybe Bool) -> Parser SupportedEndpointType
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SupportsCDC")
      )

instance Prelude.Hashable SupportedEndpointType

instance Prelude.NFData SupportedEndpointType