{-# 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.EndpointSetting
-- 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.EndpointSetting where

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

-- | Endpoint settings.
--
-- /See:/ 'newEndpointSetting' smart constructor.
data EndpointSetting = EndpointSetting'
  { -- | The relevance or validity of an endpoint setting for an engine name and
    -- its endpoint type.
    EndpointSetting -> Maybe Text
applicability :: Prelude.Maybe Prelude.Text,
    -- | The default value of the endpoint setting if no value is specified using
    -- @CreateEndpoint@ or @ModifyEndpoint@.
    EndpointSetting -> Maybe Text
defaultValue :: Prelude.Maybe Prelude.Text,
    -- | Enumerated values to use for this endpoint.
    EndpointSetting -> Maybe [Text]
enumValues :: Prelude.Maybe [Prelude.Text],
    -- | The maximum value of an endpoint setting that is of type @int@.
    EndpointSetting -> Maybe Int
intValueMax :: Prelude.Maybe Prelude.Int,
    -- | The minimum value of an endpoint setting that is of type @int@.
    EndpointSetting -> Maybe Int
intValueMin :: Prelude.Maybe Prelude.Int,
    -- | The name that you want to give the endpoint settings.
    EndpointSetting -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | A value that marks this endpoint setting as sensitive.
    EndpointSetting -> Maybe Bool
sensitive :: Prelude.Maybe Prelude.Bool,
    -- | The type of endpoint. Valid values are @source@ and @target@.
    EndpointSetting -> Maybe EndpointSettingTypeValue
type' :: Prelude.Maybe EndpointSettingTypeValue,
    -- | The unit of measure for this endpoint setting.
    EndpointSetting -> Maybe Text
units :: Prelude.Maybe Prelude.Text
  }
  deriving (EndpointSetting -> EndpointSetting -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EndpointSetting -> EndpointSetting -> Bool
$c/= :: EndpointSetting -> EndpointSetting -> Bool
== :: EndpointSetting -> EndpointSetting -> Bool
$c== :: EndpointSetting -> EndpointSetting -> Bool
Prelude.Eq, ReadPrec [EndpointSetting]
ReadPrec EndpointSetting
Int -> ReadS EndpointSetting
ReadS [EndpointSetting]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EndpointSetting]
$creadListPrec :: ReadPrec [EndpointSetting]
readPrec :: ReadPrec EndpointSetting
$creadPrec :: ReadPrec EndpointSetting
readList :: ReadS [EndpointSetting]
$creadList :: ReadS [EndpointSetting]
readsPrec :: Int -> ReadS EndpointSetting
$creadsPrec :: Int -> ReadS EndpointSetting
Prelude.Read, Int -> EndpointSetting -> ShowS
[EndpointSetting] -> ShowS
EndpointSetting -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EndpointSetting] -> ShowS
$cshowList :: [EndpointSetting] -> ShowS
show :: EndpointSetting -> String
$cshow :: EndpointSetting -> String
showsPrec :: Int -> EndpointSetting -> ShowS
$cshowsPrec :: Int -> EndpointSetting -> ShowS
Prelude.Show, forall x. Rep EndpointSetting x -> EndpointSetting
forall x. EndpointSetting -> Rep EndpointSetting x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EndpointSetting x -> EndpointSetting
$cfrom :: forall x. EndpointSetting -> Rep EndpointSetting x
Prelude.Generic)

-- |
-- Create a value of 'EndpointSetting' 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:
--
-- 'applicability', 'endpointSetting_applicability' - The relevance or validity of an endpoint setting for an engine name and
-- its endpoint type.
--
-- 'defaultValue', 'endpointSetting_defaultValue' - The default value of the endpoint setting if no value is specified using
-- @CreateEndpoint@ or @ModifyEndpoint@.
--
-- 'enumValues', 'endpointSetting_enumValues' - Enumerated values to use for this endpoint.
--
-- 'intValueMax', 'endpointSetting_intValueMax' - The maximum value of an endpoint setting that is of type @int@.
--
-- 'intValueMin', 'endpointSetting_intValueMin' - The minimum value of an endpoint setting that is of type @int@.
--
-- 'name', 'endpointSetting_name' - The name that you want to give the endpoint settings.
--
-- 'sensitive', 'endpointSetting_sensitive' - A value that marks this endpoint setting as sensitive.
--
-- 'type'', 'endpointSetting_type' - The type of endpoint. Valid values are @source@ and @target@.
--
-- 'units', 'endpointSetting_units' - The unit of measure for this endpoint setting.
newEndpointSetting ::
  EndpointSetting
newEndpointSetting :: EndpointSetting
newEndpointSetting =
  EndpointSetting'
    { $sel:applicability:EndpointSetting' :: Maybe Text
applicability = forall a. Maybe a
Prelude.Nothing,
      $sel:defaultValue:EndpointSetting' :: Maybe Text
defaultValue = forall a. Maybe a
Prelude.Nothing,
      $sel:enumValues:EndpointSetting' :: Maybe [Text]
enumValues = forall a. Maybe a
Prelude.Nothing,
      $sel:intValueMax:EndpointSetting' :: Maybe Int
intValueMax = forall a. Maybe a
Prelude.Nothing,
      $sel:intValueMin:EndpointSetting' :: Maybe Int
intValueMin = forall a. Maybe a
Prelude.Nothing,
      $sel:name:EndpointSetting' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
      $sel:sensitive:EndpointSetting' :: Maybe Bool
sensitive = forall a. Maybe a
Prelude.Nothing,
      $sel:type':EndpointSetting' :: Maybe EndpointSettingTypeValue
type' = forall a. Maybe a
Prelude.Nothing,
      $sel:units:EndpointSetting' :: Maybe Text
units = forall a. Maybe a
Prelude.Nothing
    }

-- | The relevance or validity of an endpoint setting for an engine name and
-- its endpoint type.
endpointSetting_applicability :: Lens.Lens' EndpointSetting (Prelude.Maybe Prelude.Text)
endpointSetting_applicability :: Lens' EndpointSetting (Maybe Text)
endpointSetting_applicability = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EndpointSetting' {Maybe Text
applicability :: Maybe Text
$sel:applicability:EndpointSetting' :: EndpointSetting -> Maybe Text
applicability} -> Maybe Text
applicability) (\s :: EndpointSetting
s@EndpointSetting' {} Maybe Text
a -> EndpointSetting
s {$sel:applicability:EndpointSetting' :: Maybe Text
applicability = Maybe Text
a} :: EndpointSetting)

-- | The default value of the endpoint setting if no value is specified using
-- @CreateEndpoint@ or @ModifyEndpoint@.
endpointSetting_defaultValue :: Lens.Lens' EndpointSetting (Prelude.Maybe Prelude.Text)
endpointSetting_defaultValue :: Lens' EndpointSetting (Maybe Text)
endpointSetting_defaultValue = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EndpointSetting' {Maybe Text
defaultValue :: Maybe Text
$sel:defaultValue:EndpointSetting' :: EndpointSetting -> Maybe Text
defaultValue} -> Maybe Text
defaultValue) (\s :: EndpointSetting
s@EndpointSetting' {} Maybe Text
a -> EndpointSetting
s {$sel:defaultValue:EndpointSetting' :: Maybe Text
defaultValue = Maybe Text
a} :: EndpointSetting)

-- | Enumerated values to use for this endpoint.
endpointSetting_enumValues :: Lens.Lens' EndpointSetting (Prelude.Maybe [Prelude.Text])
endpointSetting_enumValues :: Lens' EndpointSetting (Maybe [Text])
endpointSetting_enumValues = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EndpointSetting' {Maybe [Text]
enumValues :: Maybe [Text]
$sel:enumValues:EndpointSetting' :: EndpointSetting -> Maybe [Text]
enumValues} -> Maybe [Text]
enumValues) (\s :: EndpointSetting
s@EndpointSetting' {} Maybe [Text]
a -> EndpointSetting
s {$sel:enumValues:EndpointSetting' :: Maybe [Text]
enumValues = Maybe [Text]
a} :: EndpointSetting) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The maximum value of an endpoint setting that is of type @int@.
endpointSetting_intValueMax :: Lens.Lens' EndpointSetting (Prelude.Maybe Prelude.Int)
endpointSetting_intValueMax :: Lens' EndpointSetting (Maybe Int)
endpointSetting_intValueMax = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EndpointSetting' {Maybe Int
intValueMax :: Maybe Int
$sel:intValueMax:EndpointSetting' :: EndpointSetting -> Maybe Int
intValueMax} -> Maybe Int
intValueMax) (\s :: EndpointSetting
s@EndpointSetting' {} Maybe Int
a -> EndpointSetting
s {$sel:intValueMax:EndpointSetting' :: Maybe Int
intValueMax = Maybe Int
a} :: EndpointSetting)

-- | The minimum value of an endpoint setting that is of type @int@.
endpointSetting_intValueMin :: Lens.Lens' EndpointSetting (Prelude.Maybe Prelude.Int)
endpointSetting_intValueMin :: Lens' EndpointSetting (Maybe Int)
endpointSetting_intValueMin = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EndpointSetting' {Maybe Int
intValueMin :: Maybe Int
$sel:intValueMin:EndpointSetting' :: EndpointSetting -> Maybe Int
intValueMin} -> Maybe Int
intValueMin) (\s :: EndpointSetting
s@EndpointSetting' {} Maybe Int
a -> EndpointSetting
s {$sel:intValueMin:EndpointSetting' :: Maybe Int
intValueMin = Maybe Int
a} :: EndpointSetting)

-- | The name that you want to give the endpoint settings.
endpointSetting_name :: Lens.Lens' EndpointSetting (Prelude.Maybe Prelude.Text)
endpointSetting_name :: Lens' EndpointSetting (Maybe Text)
endpointSetting_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EndpointSetting' {Maybe Text
name :: Maybe Text
$sel:name:EndpointSetting' :: EndpointSetting -> Maybe Text
name} -> Maybe Text
name) (\s :: EndpointSetting
s@EndpointSetting' {} Maybe Text
a -> EndpointSetting
s {$sel:name:EndpointSetting' :: Maybe Text
name = Maybe Text
a} :: EndpointSetting)

-- | A value that marks this endpoint setting as sensitive.
endpointSetting_sensitive :: Lens.Lens' EndpointSetting (Prelude.Maybe Prelude.Bool)
endpointSetting_sensitive :: Lens' EndpointSetting (Maybe Bool)
endpointSetting_sensitive = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EndpointSetting' {Maybe Bool
sensitive :: Maybe Bool
$sel:sensitive:EndpointSetting' :: EndpointSetting -> Maybe Bool
sensitive} -> Maybe Bool
sensitive) (\s :: EndpointSetting
s@EndpointSetting' {} Maybe Bool
a -> EndpointSetting
s {$sel:sensitive:EndpointSetting' :: Maybe Bool
sensitive = Maybe Bool
a} :: EndpointSetting)

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

-- | The unit of measure for this endpoint setting.
endpointSetting_units :: Lens.Lens' EndpointSetting (Prelude.Maybe Prelude.Text)
endpointSetting_units :: Lens' EndpointSetting (Maybe Text)
endpointSetting_units = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EndpointSetting' {Maybe Text
units :: Maybe Text
$sel:units:EndpointSetting' :: EndpointSetting -> Maybe Text
units} -> Maybe Text
units) (\s :: EndpointSetting
s@EndpointSetting' {} Maybe Text
a -> EndpointSetting
s {$sel:units:EndpointSetting' :: Maybe Text
units = Maybe Text
a} :: EndpointSetting)

instance Data.FromJSON EndpointSetting where
  parseJSON :: Value -> Parser EndpointSetting
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"EndpointSetting"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe Bool
-> Maybe EndpointSettingTypeValue
-> Maybe Text
-> EndpointSetting
EndpointSetting'
            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
"Applicability")
            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
"DefaultValue")
            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
"EnumValues" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
            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
"IntValueMax")
            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
"IntValueMin")
            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
"Name")
            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
"Sensitive")
            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
"Type")
            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
"Units")
      )

instance Prelude.Hashable EndpointSetting where
  hashWithSalt :: Int -> EndpointSetting -> Int
hashWithSalt Int
_salt EndpointSetting' {Maybe Bool
Maybe Int
Maybe [Text]
Maybe Text
Maybe EndpointSettingTypeValue
units :: Maybe Text
type' :: Maybe EndpointSettingTypeValue
sensitive :: Maybe Bool
name :: Maybe Text
intValueMin :: Maybe Int
intValueMax :: Maybe Int
enumValues :: Maybe [Text]
defaultValue :: Maybe Text
applicability :: Maybe Text
$sel:units:EndpointSetting' :: EndpointSetting -> Maybe Text
$sel:type':EndpointSetting' :: EndpointSetting -> Maybe EndpointSettingTypeValue
$sel:sensitive:EndpointSetting' :: EndpointSetting -> Maybe Bool
$sel:name:EndpointSetting' :: EndpointSetting -> Maybe Text
$sel:intValueMin:EndpointSetting' :: EndpointSetting -> Maybe Int
$sel:intValueMax:EndpointSetting' :: EndpointSetting -> Maybe Int
$sel:enumValues:EndpointSetting' :: EndpointSetting -> Maybe [Text]
$sel:defaultValue:EndpointSetting' :: EndpointSetting -> Maybe Text
$sel:applicability:EndpointSetting' :: EndpointSetting -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
applicability
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
defaultValue
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
enumValues
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
intValueMax
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
intValueMin
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
sensitive
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe EndpointSettingTypeValue
type'
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
units

instance Prelude.NFData EndpointSetting where
  rnf :: EndpointSetting -> ()
rnf EndpointSetting' {Maybe Bool
Maybe Int
Maybe [Text]
Maybe Text
Maybe EndpointSettingTypeValue
units :: Maybe Text
type' :: Maybe EndpointSettingTypeValue
sensitive :: Maybe Bool
name :: Maybe Text
intValueMin :: Maybe Int
intValueMax :: Maybe Int
enumValues :: Maybe [Text]
defaultValue :: Maybe Text
applicability :: Maybe Text
$sel:units:EndpointSetting' :: EndpointSetting -> Maybe Text
$sel:type':EndpointSetting' :: EndpointSetting -> Maybe EndpointSettingTypeValue
$sel:sensitive:EndpointSetting' :: EndpointSetting -> Maybe Bool
$sel:name:EndpointSetting' :: EndpointSetting -> Maybe Text
$sel:intValueMin:EndpointSetting' :: EndpointSetting -> Maybe Int
$sel:intValueMax:EndpointSetting' :: EndpointSetting -> Maybe Int
$sel:enumValues:EndpointSetting' :: EndpointSetting -> Maybe [Text]
$sel:defaultValue:EndpointSetting' :: EndpointSetting -> Maybe Text
$sel:applicability:EndpointSetting' :: EndpointSetting -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
applicability
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
defaultValue
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
enumValues
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
intValueMax
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
intValueMin
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
sensitive
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe EndpointSettingTypeValue
type'
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
units