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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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 -> Text
apiKey :: Prelude.Text,
    -- | The Secret Access Key portion of the credentials.
    AmplitudeConnectorProfileCredentials -> Sensitive Text
secretKey :: Core.Sensitive Prelude.Text
  }
  deriving (AmplitudeConnectorProfileCredentials
-> AmplitudeConnectorProfileCredentials -> Bool
(AmplitudeConnectorProfileCredentials
 -> AmplitudeConnectorProfileCredentials -> Bool)
-> (AmplitudeConnectorProfileCredentials
    -> AmplitudeConnectorProfileCredentials -> Bool)
-> Eq AmplitudeConnectorProfileCredentials
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
(Int -> AmplitudeConnectorProfileCredentials -> ShowS)
-> (AmplitudeConnectorProfileCredentials -> String)
-> ([AmplitudeConnectorProfileCredentials] -> ShowS)
-> Show AmplitudeConnectorProfileCredentials
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.
 AmplitudeConnectorProfileCredentials
 -> Rep AmplitudeConnectorProfileCredentials x)
-> (forall x.
    Rep AmplitudeConnectorProfileCredentials x
    -> AmplitudeConnectorProfileCredentials)
-> Generic AmplitudeConnectorProfileCredentials
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' :: Text -> Sensitive Text -> AmplitudeConnectorProfileCredentials
AmplitudeConnectorProfileCredentials'
      { $sel:apiKey:AmplitudeConnectorProfileCredentials' :: Text
apiKey =
          Text
pApiKey_,
        $sel:secretKey:AmplitudeConnectorProfileCredentials' :: Sensitive Text
secretKey =
          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
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 :: (Text -> f Text)
-> AmplitudeConnectorProfileCredentials
-> f AmplitudeConnectorProfileCredentials
amplitudeConnectorProfileCredentials_apiKey = (AmplitudeConnectorProfileCredentials -> Text)
-> (AmplitudeConnectorProfileCredentials
    -> Text -> AmplitudeConnectorProfileCredentials)
-> Lens
     AmplitudeConnectorProfileCredentials
     AmplitudeConnectorProfileCredentials
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AmplitudeConnectorProfileCredentials' {Text
apiKey :: Text
$sel:apiKey:AmplitudeConnectorProfileCredentials' :: AmplitudeConnectorProfileCredentials -> Text
apiKey} -> Text
apiKey) (\s :: AmplitudeConnectorProfileCredentials
s@AmplitudeConnectorProfileCredentials' {} Text
a -> AmplitudeConnectorProfileCredentials
s {$sel:apiKey:AmplitudeConnectorProfileCredentials' :: Text
apiKey = Text
a} :: AmplitudeConnectorProfileCredentials)

-- | The Secret Access Key portion of the credentials.
amplitudeConnectorProfileCredentials_secretKey :: Lens.Lens' AmplitudeConnectorProfileCredentials Prelude.Text
amplitudeConnectorProfileCredentials_secretKey :: (Text -> f Text)
-> AmplitudeConnectorProfileCredentials
-> f AmplitudeConnectorProfileCredentials
amplitudeConnectorProfileCredentials_secretKey = (AmplitudeConnectorProfileCredentials -> Sensitive Text)
-> (AmplitudeConnectorProfileCredentials
    -> Sensitive Text -> AmplitudeConnectorProfileCredentials)
-> Lens
     AmplitudeConnectorProfileCredentials
     AmplitudeConnectorProfileCredentials
     (Sensitive Text)
     (Sensitive Text)
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) ((Sensitive Text -> f (Sensitive Text))
 -> AmplitudeConnectorProfileCredentials
 -> f AmplitudeConnectorProfileCredentials)
-> ((Text -> f Text) -> Sensitive Text -> f (Sensitive Text))
-> (Text -> f Text)
-> AmplitudeConnectorProfileCredentials
-> f AmplitudeConnectorProfileCredentials
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

instance
  Prelude.Hashable
    AmplitudeConnectorProfileCredentials

instance
  Prelude.NFData
    AmplitudeConnectorProfileCredentials

instance
  Core.ToJSON
    AmplitudeConnectorProfileCredentials
  where
  toJSON :: AmplitudeConnectorProfileCredentials -> Value
toJSON AmplitudeConnectorProfileCredentials' {Text
Sensitive Text
secretKey :: Sensitive Text
apiKey :: Text
$sel:secretKey:AmplitudeConnectorProfileCredentials' :: AmplitudeConnectorProfileCredentials -> Sensitive Text
$sel:apiKey:AmplitudeConnectorProfileCredentials' :: AmplitudeConnectorProfileCredentials -> 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
"apiKey" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
apiKey),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"secretKey" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Sensitive Text
secretKey)
          ]
      )