{-# 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.AppFlow.Types.InforNexusConnectorProfileCredentials
-- 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.AppFlow.Types.InforNexusConnectorProfileCredentials where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | The connector-specific profile credentials required by Infor Nexus.
--
-- /See:/ 'newInforNexusConnectorProfileCredentials' smart constructor.
data InforNexusConnectorProfileCredentials = InforNexusConnectorProfileCredentials'
  { -- | The Access Key portion of the credentials.
    InforNexusConnectorProfileCredentials -> Sensitive Text
accessKeyId :: Core.Sensitive Prelude.Text,
    -- | The identifier for the user.
    InforNexusConnectorProfileCredentials -> Text
userId :: Prelude.Text,
    -- | The secret key used to sign requests.
    InforNexusConnectorProfileCredentials -> Text
secretAccessKey :: Prelude.Text,
    -- | The encryption keys used to encrypt data.
    InforNexusConnectorProfileCredentials -> Text
datakey :: Prelude.Text
  }
  deriving (InforNexusConnectorProfileCredentials
-> InforNexusConnectorProfileCredentials -> Bool
(InforNexusConnectorProfileCredentials
 -> InforNexusConnectorProfileCredentials -> Bool)
-> (InforNexusConnectorProfileCredentials
    -> InforNexusConnectorProfileCredentials -> Bool)
-> Eq InforNexusConnectorProfileCredentials
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InforNexusConnectorProfileCredentials
-> InforNexusConnectorProfileCredentials -> Bool
$c/= :: InforNexusConnectorProfileCredentials
-> InforNexusConnectorProfileCredentials -> Bool
== :: InforNexusConnectorProfileCredentials
-> InforNexusConnectorProfileCredentials -> Bool
$c== :: InforNexusConnectorProfileCredentials
-> InforNexusConnectorProfileCredentials -> Bool
Prelude.Eq, Int -> InforNexusConnectorProfileCredentials -> ShowS
[InforNexusConnectorProfileCredentials] -> ShowS
InforNexusConnectorProfileCredentials -> String
(Int -> InforNexusConnectorProfileCredentials -> ShowS)
-> (InforNexusConnectorProfileCredentials -> String)
-> ([InforNexusConnectorProfileCredentials] -> ShowS)
-> Show InforNexusConnectorProfileCredentials
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InforNexusConnectorProfileCredentials] -> ShowS
$cshowList :: [InforNexusConnectorProfileCredentials] -> ShowS
show :: InforNexusConnectorProfileCredentials -> String
$cshow :: InforNexusConnectorProfileCredentials -> String
showsPrec :: Int -> InforNexusConnectorProfileCredentials -> ShowS
$cshowsPrec :: Int -> InforNexusConnectorProfileCredentials -> ShowS
Prelude.Show, (forall x.
 InforNexusConnectorProfileCredentials
 -> Rep InforNexusConnectorProfileCredentials x)
-> (forall x.
    Rep InforNexusConnectorProfileCredentials x
    -> InforNexusConnectorProfileCredentials)
-> Generic InforNexusConnectorProfileCredentials
forall x.
Rep InforNexusConnectorProfileCredentials x
-> InforNexusConnectorProfileCredentials
forall x.
InforNexusConnectorProfileCredentials
-> Rep InforNexusConnectorProfileCredentials x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep InforNexusConnectorProfileCredentials x
-> InforNexusConnectorProfileCredentials
$cfrom :: forall x.
InforNexusConnectorProfileCredentials
-> Rep InforNexusConnectorProfileCredentials x
Prelude.Generic)

-- |
-- Create a value of 'InforNexusConnectorProfileCredentials' 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:
--
-- 'accessKeyId', 'inforNexusConnectorProfileCredentials_accessKeyId' - The Access Key portion of the credentials.
--
-- 'userId', 'inforNexusConnectorProfileCredentials_userId' - The identifier for the user.
--
-- 'secretAccessKey', 'inforNexusConnectorProfileCredentials_secretAccessKey' - The secret key used to sign requests.
--
-- 'datakey', 'inforNexusConnectorProfileCredentials_datakey' - The encryption keys used to encrypt data.
newInforNexusConnectorProfileCredentials ::
  -- | 'accessKeyId'
  Prelude.Text ->
  -- | 'userId'
  Prelude.Text ->
  -- | 'secretAccessKey'
  Prelude.Text ->
  -- | 'datakey'
  Prelude.Text ->
  InforNexusConnectorProfileCredentials
newInforNexusConnectorProfileCredentials :: Text
-> Text -> Text -> Text -> InforNexusConnectorProfileCredentials
newInforNexusConnectorProfileCredentials
  Text
pAccessKeyId_
  Text
pUserId_
  Text
pSecretAccessKey_
  Text
pDatakey_ =
    InforNexusConnectorProfileCredentials' :: Sensitive Text
-> Text -> Text -> Text -> InforNexusConnectorProfileCredentials
InforNexusConnectorProfileCredentials'
      { $sel:accessKeyId:InforNexusConnectorProfileCredentials' :: Sensitive Text
accessKeyId =
          Tagged Text (Identity Text)
-> Tagged (Sensitive Text) (Identity (Sensitive Text))
forall a. Iso' (Sensitive a) a
Core._Sensitive
            (Tagged Text (Identity Text)
 -> Tagged (Sensitive Text) (Identity (Sensitive Text)))
-> Text -> Sensitive Text
forall t b. AReview t b -> b -> t
Lens.# Text
pAccessKeyId_,
        $sel:userId:InforNexusConnectorProfileCredentials' :: Text
userId = Text
pUserId_,
        $sel:secretAccessKey:InforNexusConnectorProfileCredentials' :: Text
secretAccessKey = Text
pSecretAccessKey_,
        $sel:datakey:InforNexusConnectorProfileCredentials' :: Text
datakey = Text
pDatakey_
      }

-- | The Access Key portion of the credentials.
inforNexusConnectorProfileCredentials_accessKeyId :: Lens.Lens' InforNexusConnectorProfileCredentials Prelude.Text
inforNexusConnectorProfileCredentials_accessKeyId :: (Text -> f Text)
-> InforNexusConnectorProfileCredentials
-> f InforNexusConnectorProfileCredentials
inforNexusConnectorProfileCredentials_accessKeyId = (InforNexusConnectorProfileCredentials -> Sensitive Text)
-> (InforNexusConnectorProfileCredentials
    -> Sensitive Text -> InforNexusConnectorProfileCredentials)
-> Lens
     InforNexusConnectorProfileCredentials
     InforNexusConnectorProfileCredentials
     (Sensitive Text)
     (Sensitive Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InforNexusConnectorProfileCredentials' {Sensitive Text
accessKeyId :: Sensitive Text
$sel:accessKeyId:InforNexusConnectorProfileCredentials' :: InforNexusConnectorProfileCredentials -> Sensitive Text
accessKeyId} -> Sensitive Text
accessKeyId) (\s :: InforNexusConnectorProfileCredentials
s@InforNexusConnectorProfileCredentials' {} Sensitive Text
a -> InforNexusConnectorProfileCredentials
s {$sel:accessKeyId:InforNexusConnectorProfileCredentials' :: Sensitive Text
accessKeyId = Sensitive Text
a} :: InforNexusConnectorProfileCredentials) ((Sensitive Text -> f (Sensitive Text))
 -> InforNexusConnectorProfileCredentials
 -> f InforNexusConnectorProfileCredentials)
-> ((Text -> f Text) -> Sensitive Text -> f (Sensitive Text))
-> (Text -> f Text)
-> InforNexusConnectorProfileCredentials
-> f InforNexusConnectorProfileCredentials
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> f Text) -> Sensitive Text -> f (Sensitive Text)
forall a. Iso' (Sensitive a) a
Core._Sensitive

-- | The identifier for the user.
inforNexusConnectorProfileCredentials_userId :: Lens.Lens' InforNexusConnectorProfileCredentials Prelude.Text
inforNexusConnectorProfileCredentials_userId :: (Text -> f Text)
-> InforNexusConnectorProfileCredentials
-> f InforNexusConnectorProfileCredentials
inforNexusConnectorProfileCredentials_userId = (InforNexusConnectorProfileCredentials -> Text)
-> (InforNexusConnectorProfileCredentials
    -> Text -> InforNexusConnectorProfileCredentials)
-> Lens
     InforNexusConnectorProfileCredentials
     InforNexusConnectorProfileCredentials
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InforNexusConnectorProfileCredentials' {Text
userId :: Text
$sel:userId:InforNexusConnectorProfileCredentials' :: InforNexusConnectorProfileCredentials -> Text
userId} -> Text
userId) (\s :: InforNexusConnectorProfileCredentials
s@InforNexusConnectorProfileCredentials' {} Text
a -> InforNexusConnectorProfileCredentials
s {$sel:userId:InforNexusConnectorProfileCredentials' :: Text
userId = Text
a} :: InforNexusConnectorProfileCredentials)

-- | The secret key used to sign requests.
inforNexusConnectorProfileCredentials_secretAccessKey :: Lens.Lens' InforNexusConnectorProfileCredentials Prelude.Text
inforNexusConnectorProfileCredentials_secretAccessKey :: (Text -> f Text)
-> InforNexusConnectorProfileCredentials
-> f InforNexusConnectorProfileCredentials
inforNexusConnectorProfileCredentials_secretAccessKey = (InforNexusConnectorProfileCredentials -> Text)
-> (InforNexusConnectorProfileCredentials
    -> Text -> InforNexusConnectorProfileCredentials)
-> Lens
     InforNexusConnectorProfileCredentials
     InforNexusConnectorProfileCredentials
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InforNexusConnectorProfileCredentials' {Text
secretAccessKey :: Text
$sel:secretAccessKey:InforNexusConnectorProfileCredentials' :: InforNexusConnectorProfileCredentials -> Text
secretAccessKey} -> Text
secretAccessKey) (\s :: InforNexusConnectorProfileCredentials
s@InforNexusConnectorProfileCredentials' {} Text
a -> InforNexusConnectorProfileCredentials
s {$sel:secretAccessKey:InforNexusConnectorProfileCredentials' :: Text
secretAccessKey = Text
a} :: InforNexusConnectorProfileCredentials)

-- | The encryption keys used to encrypt data.
inforNexusConnectorProfileCredentials_datakey :: Lens.Lens' InforNexusConnectorProfileCredentials Prelude.Text
inforNexusConnectorProfileCredentials_datakey :: (Text -> f Text)
-> InforNexusConnectorProfileCredentials
-> f InforNexusConnectorProfileCredentials
inforNexusConnectorProfileCredentials_datakey = (InforNexusConnectorProfileCredentials -> Text)
-> (InforNexusConnectorProfileCredentials
    -> Text -> InforNexusConnectorProfileCredentials)
-> Lens
     InforNexusConnectorProfileCredentials
     InforNexusConnectorProfileCredentials
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InforNexusConnectorProfileCredentials' {Text
datakey :: Text
$sel:datakey:InforNexusConnectorProfileCredentials' :: InforNexusConnectorProfileCredentials -> Text
datakey} -> Text
datakey) (\s :: InforNexusConnectorProfileCredentials
s@InforNexusConnectorProfileCredentials' {} Text
a -> InforNexusConnectorProfileCredentials
s {$sel:datakey:InforNexusConnectorProfileCredentials' :: Text
datakey = Text
a} :: InforNexusConnectorProfileCredentials)

instance
  Prelude.Hashable
    InforNexusConnectorProfileCredentials

instance
  Prelude.NFData
    InforNexusConnectorProfileCredentials

instance
  Core.ToJSON
    InforNexusConnectorProfileCredentials
  where
  toJSON :: InforNexusConnectorProfileCredentials -> Value
toJSON InforNexusConnectorProfileCredentials' {Text
Sensitive Text
datakey :: Text
secretAccessKey :: Text
userId :: Text
accessKeyId :: Sensitive Text
$sel:datakey:InforNexusConnectorProfileCredentials' :: InforNexusConnectorProfileCredentials -> Text
$sel:secretAccessKey:InforNexusConnectorProfileCredentials' :: InforNexusConnectorProfileCredentials -> Text
$sel:userId:InforNexusConnectorProfileCredentials' :: InforNexusConnectorProfileCredentials -> Text
$sel:accessKeyId:InforNexusConnectorProfileCredentials' :: InforNexusConnectorProfileCredentials -> Sensitive Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"accessKeyId" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Sensitive Text
accessKeyId),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"userId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
userId),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"secretAccessKey" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
secretAccessKey),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"datakey" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
datakey)
          ]
      )