{-# 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.AmplitudeConnectorProfileCredentials
-- 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.AmplitudeConnectorProfileCredentials 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 credentials required when using Amplitude.
--
-- /See:/ 'newAmplitudeConnectorProfileCredentials' smart constructor.
data AmplitudeConnectorProfileCredentials = AmplitudeConnectorProfileCredentials'
  { -- | A unique alphanumeric identifier used to authenticate a user, developer,
    -- or calling program to your API.
    AmplitudeConnectorProfileCredentials -> Sensitive Text
apiKey :: Data.Sensitive Prelude.Text,
    -- | The Secret Access Key portion of the credentials.
    AmplitudeConnectorProfileCredentials -> Sensitive Text
secretKey :: Data.Sensitive Prelude.Text
  }
  deriving (AmplitudeConnectorProfileCredentials
-> AmplitudeConnectorProfileCredentials -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AmplitudeConnectorProfileCredentials
-> AmplitudeConnectorProfileCredentials -> Bool
$c/= :: AmplitudeConnectorProfileCredentials
-> AmplitudeConnectorProfileCredentials -> Bool
== :: AmplitudeConnectorProfileCredentials
-> AmplitudeConnectorProfileCredentials -> Bool
$c== :: AmplitudeConnectorProfileCredentials
-> AmplitudeConnectorProfileCredentials -> Bool
Prelude.Eq, Int -> AmplitudeConnectorProfileCredentials -> ShowS
[AmplitudeConnectorProfileCredentials] -> ShowS
AmplitudeConnectorProfileCredentials -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AmplitudeConnectorProfileCredentials] -> ShowS
$cshowList :: [AmplitudeConnectorProfileCredentials] -> ShowS
show :: AmplitudeConnectorProfileCredentials -> String
$cshow :: AmplitudeConnectorProfileCredentials -> String
showsPrec :: Int -> AmplitudeConnectorProfileCredentials -> ShowS
$cshowsPrec :: Int -> AmplitudeConnectorProfileCredentials -> ShowS
Prelude.Show, forall x.
Rep AmplitudeConnectorProfileCredentials x
-> AmplitudeConnectorProfileCredentials
forall x.
AmplitudeConnectorProfileCredentials
-> Rep AmplitudeConnectorProfileCredentials x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AmplitudeConnectorProfileCredentials x
-> AmplitudeConnectorProfileCredentials
$cfrom :: forall x.
AmplitudeConnectorProfileCredentials
-> Rep AmplitudeConnectorProfileCredentials x
Prelude.Generic)

-- |
-- Create a value of 'AmplitudeConnectorProfileCredentials' 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:
--
-- 'apiKey', 'amplitudeConnectorProfileCredentials_apiKey' - A unique alphanumeric identifier used to authenticate a user, developer,
-- or calling program to your API.
--
-- 'secretKey', 'amplitudeConnectorProfileCredentials_secretKey' - The Secret Access Key portion of the credentials.
newAmplitudeConnectorProfileCredentials ::
  -- | 'apiKey'
  Prelude.Text ->
  -- | 'secretKey'
  Prelude.Text ->
  AmplitudeConnectorProfileCredentials
newAmplitudeConnectorProfileCredentials :: Text -> Text -> AmplitudeConnectorProfileCredentials
newAmplitudeConnectorProfileCredentials
  Text
pApiKey_
  Text
pSecretKey_ =
    AmplitudeConnectorProfileCredentials'
      { $sel:apiKey:AmplitudeConnectorProfileCredentials' :: Sensitive Text
apiKey =
          forall a. Iso' (Sensitive a) a
Data._Sensitive forall t b. AReview t b -> b -> t
Lens.# Text
pApiKey_,
        $sel:secretKey:AmplitudeConnectorProfileCredentials' :: Sensitive Text
secretKey =
          forall a. Iso' (Sensitive a) a
Data._Sensitive forall t b. AReview t b -> b -> t
Lens.# Text
pSecretKey_
      }

-- | A unique alphanumeric identifier used to authenticate a user, developer,
-- or calling program to your API.
amplitudeConnectorProfileCredentials_apiKey :: Lens.Lens' AmplitudeConnectorProfileCredentials Prelude.Text
amplitudeConnectorProfileCredentials_apiKey :: Lens' AmplitudeConnectorProfileCredentials Text
amplitudeConnectorProfileCredentials_apiKey = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AmplitudeConnectorProfileCredentials' {Sensitive Text
apiKey :: Sensitive Text
$sel:apiKey:AmplitudeConnectorProfileCredentials' :: AmplitudeConnectorProfileCredentials -> Sensitive Text
apiKey} -> Sensitive Text
apiKey) (\s :: AmplitudeConnectorProfileCredentials
s@AmplitudeConnectorProfileCredentials' {} Sensitive Text
a -> AmplitudeConnectorProfileCredentials
s {$sel:apiKey:AmplitudeConnectorProfileCredentials' :: Sensitive Text
apiKey = Sensitive Text
a} :: AmplitudeConnectorProfileCredentials) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a. Iso' (Sensitive a) a
Data._Sensitive

-- | The Secret Access Key portion of the credentials.
amplitudeConnectorProfileCredentials_secretKey :: Lens.Lens' AmplitudeConnectorProfileCredentials Prelude.Text
amplitudeConnectorProfileCredentials_secretKey :: Lens' AmplitudeConnectorProfileCredentials Text
amplitudeConnectorProfileCredentials_secretKey = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AmplitudeConnectorProfileCredentials' {Sensitive Text
secretKey :: Sensitive Text
$sel:secretKey:AmplitudeConnectorProfileCredentials' :: AmplitudeConnectorProfileCredentials -> Sensitive Text
secretKey} -> Sensitive Text
secretKey) (\s :: AmplitudeConnectorProfileCredentials
s@AmplitudeConnectorProfileCredentials' {} Sensitive Text
a -> AmplitudeConnectorProfileCredentials
s {$sel:secretKey:AmplitudeConnectorProfileCredentials' :: Sensitive Text
secretKey = Sensitive Text
a} :: AmplitudeConnectorProfileCredentials) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a. Iso' (Sensitive a) a
Data._Sensitive

instance
  Prelude.Hashable
    AmplitudeConnectorProfileCredentials
  where
  hashWithSalt :: Int -> AmplitudeConnectorProfileCredentials -> Int
hashWithSalt
    Int
_salt
    AmplitudeConnectorProfileCredentials' {Sensitive Text
secretKey :: Sensitive Text
apiKey :: Sensitive Text
$sel:secretKey:AmplitudeConnectorProfileCredentials' :: AmplitudeConnectorProfileCredentials -> Sensitive Text
$sel:apiKey:AmplitudeConnectorProfileCredentials' :: AmplitudeConnectorProfileCredentials -> Sensitive Text
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Sensitive Text
apiKey
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Sensitive Text
secretKey

instance
  Prelude.NFData
    AmplitudeConnectorProfileCredentials
  where
  rnf :: AmplitudeConnectorProfileCredentials -> ()
rnf AmplitudeConnectorProfileCredentials' {Sensitive Text
secretKey :: Sensitive Text
apiKey :: Sensitive Text
$sel:secretKey:AmplitudeConnectorProfileCredentials' :: AmplitudeConnectorProfileCredentials -> Sensitive Text
$sel:apiKey:AmplitudeConnectorProfileCredentials' :: AmplitudeConnectorProfileCredentials -> Sensitive Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Sensitive Text
apiKey
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Sensitive Text
secretKey

instance
  Data.ToJSON
    AmplitudeConnectorProfileCredentials
  where
  toJSON :: AmplitudeConnectorProfileCredentials -> Value
toJSON AmplitudeConnectorProfileCredentials' {Sensitive Text
secretKey :: Sensitive Text
apiKey :: Sensitive Text
$sel:secretKey:AmplitudeConnectorProfileCredentials' :: AmplitudeConnectorProfileCredentials -> Sensitive Text
$sel:apiKey:AmplitudeConnectorProfileCredentials' :: AmplitudeConnectorProfileCredentials -> Sensitive Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ forall a. a -> Maybe a
Prelude.Just (Key
"apiKey" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Sensitive Text
apiKey),
            forall a. a -> Maybe a
Prelude.Just (Key
"secretKey" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Sensitive Text
secretKey)
          ]
      )