{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.AppFlow.Types.InforNexusConnectorProfileCredentials where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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 :: Data.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
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
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.
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'
      { $sel:accessKeyId:InforNexusConnectorProfileCredentials' :: Sensitive Text
accessKeyId =
          forall a. Iso' (Sensitive a) a
Data._Sensitive
            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 :: Lens' InforNexusConnectorProfileCredentials Text
inforNexusConnectorProfileCredentials_accessKeyId = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a. Iso' (Sensitive a) a
Data._Sensitive

-- | The identifier for the user.
inforNexusConnectorProfileCredentials_userId :: Lens.Lens' InforNexusConnectorProfileCredentials Prelude.Text
inforNexusConnectorProfileCredentials_userId :: Lens' InforNexusConnectorProfileCredentials Text
inforNexusConnectorProfileCredentials_userId = 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 :: Lens' InforNexusConnectorProfileCredentials Text
inforNexusConnectorProfileCredentials_secretAccessKey = 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 :: Lens' InforNexusConnectorProfileCredentials Text
inforNexusConnectorProfileCredentials_datakey = 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
  where
  hashWithSalt :: Int -> InforNexusConnectorProfileCredentials -> Int
hashWithSalt
    Int
_salt
    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
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Sensitive Text
accessKeyId
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
userId
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
secretAccessKey
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
datakey

instance
  Prelude.NFData
    InforNexusConnectorProfileCredentials
  where
  rnf :: InforNexusConnectorProfileCredentials -> ()
rnf 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
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Sensitive Text
accessKeyId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
userId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
secretAccessKey
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
datakey

instance
  Data.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
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ forall a. a -> Maybe a
Prelude.Just (Key
"accessKeyId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Sensitive Text
accessKeyId),
            forall a. a -> Maybe a
Prelude.Just (Key
"userId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
userId),
            forall a. a -> Maybe a
Prelude.Just
              (Key
"secretAccessKey" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
secretAccessKey),
            forall a. a -> Maybe a
Prelude.Just (Key
"datakey" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
datakey)
          ]
      )