{-# 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.DatadogConnectorProfileCredentials
-- 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.DatadogConnectorProfileCredentials 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 by Datadog.
--
-- /See:/ 'newDatadogConnectorProfileCredentials' smart constructor.
data DatadogConnectorProfileCredentials = DatadogConnectorProfileCredentials'
  { -- | A unique alphanumeric identifier used to authenticate a user, developer,
    -- or calling program to your API.
    DatadogConnectorProfileCredentials -> Sensitive Text
apiKey :: Data.Sensitive Prelude.Text,
    -- | Application keys, in conjunction with your API key, give you full access
    -- to Datadog’s programmatic API. Application keys are associated with the
    -- user account that created them. The application key is used to log all
    -- requests made to the API.
    DatadogConnectorProfileCredentials -> Text
applicationKey :: Prelude.Text
  }
  deriving (DatadogConnectorProfileCredentials
-> DatadogConnectorProfileCredentials -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DatadogConnectorProfileCredentials
-> DatadogConnectorProfileCredentials -> Bool
$c/= :: DatadogConnectorProfileCredentials
-> DatadogConnectorProfileCredentials -> Bool
== :: DatadogConnectorProfileCredentials
-> DatadogConnectorProfileCredentials -> Bool
$c== :: DatadogConnectorProfileCredentials
-> DatadogConnectorProfileCredentials -> Bool
Prelude.Eq, Int -> DatadogConnectorProfileCredentials -> ShowS
[DatadogConnectorProfileCredentials] -> ShowS
DatadogConnectorProfileCredentials -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DatadogConnectorProfileCredentials] -> ShowS
$cshowList :: [DatadogConnectorProfileCredentials] -> ShowS
show :: DatadogConnectorProfileCredentials -> String
$cshow :: DatadogConnectorProfileCredentials -> String
showsPrec :: Int -> DatadogConnectorProfileCredentials -> ShowS
$cshowsPrec :: Int -> DatadogConnectorProfileCredentials -> ShowS
Prelude.Show, forall x.
Rep DatadogConnectorProfileCredentials x
-> DatadogConnectorProfileCredentials
forall x.
DatadogConnectorProfileCredentials
-> Rep DatadogConnectorProfileCredentials x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DatadogConnectorProfileCredentials x
-> DatadogConnectorProfileCredentials
$cfrom :: forall x.
DatadogConnectorProfileCredentials
-> Rep DatadogConnectorProfileCredentials x
Prelude.Generic)

-- |
-- Create a value of 'DatadogConnectorProfileCredentials' 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', 'datadogConnectorProfileCredentials_apiKey' - A unique alphanumeric identifier used to authenticate a user, developer,
-- or calling program to your API.
--
-- 'applicationKey', 'datadogConnectorProfileCredentials_applicationKey' - Application keys, in conjunction with your API key, give you full access
-- to Datadog’s programmatic API. Application keys are associated with the
-- user account that created them. The application key is used to log all
-- requests made to the API.
newDatadogConnectorProfileCredentials ::
  -- | 'apiKey'
  Prelude.Text ->
  -- | 'applicationKey'
  Prelude.Text ->
  DatadogConnectorProfileCredentials
newDatadogConnectorProfileCredentials :: Text -> Text -> DatadogConnectorProfileCredentials
newDatadogConnectorProfileCredentials
  Text
pApiKey_
  Text
pApplicationKey_ =
    DatadogConnectorProfileCredentials'
      { $sel:apiKey:DatadogConnectorProfileCredentials' :: Sensitive Text
apiKey =
          forall a. Iso' (Sensitive a) a
Data._Sensitive forall t b. AReview t b -> b -> t
Lens.# Text
pApiKey_,
        $sel:applicationKey:DatadogConnectorProfileCredentials' :: Text
applicationKey = Text
pApplicationKey_
      }

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

-- | Application keys, in conjunction with your API key, give you full access
-- to Datadog’s programmatic API. Application keys are associated with the
-- user account that created them. The application key is used to log all
-- requests made to the API.
datadogConnectorProfileCredentials_applicationKey :: Lens.Lens' DatadogConnectorProfileCredentials Prelude.Text
datadogConnectorProfileCredentials_applicationKey :: Lens' DatadogConnectorProfileCredentials Text
datadogConnectorProfileCredentials_applicationKey = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DatadogConnectorProfileCredentials' {Text
applicationKey :: Text
$sel:applicationKey:DatadogConnectorProfileCredentials' :: DatadogConnectorProfileCredentials -> Text
applicationKey} -> Text
applicationKey) (\s :: DatadogConnectorProfileCredentials
s@DatadogConnectorProfileCredentials' {} Text
a -> DatadogConnectorProfileCredentials
s {$sel:applicationKey:DatadogConnectorProfileCredentials' :: Text
applicationKey = Text
a} :: DatadogConnectorProfileCredentials)

instance
  Prelude.Hashable
    DatadogConnectorProfileCredentials
  where
  hashWithSalt :: Int -> DatadogConnectorProfileCredentials -> Int
hashWithSalt
    Int
_salt
    DatadogConnectorProfileCredentials' {Text
Sensitive Text
applicationKey :: Text
apiKey :: Sensitive Text
$sel:applicationKey:DatadogConnectorProfileCredentials' :: DatadogConnectorProfileCredentials -> Text
$sel:apiKey:DatadogConnectorProfileCredentials' :: DatadogConnectorProfileCredentials -> 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` Text
applicationKey

instance
  Prelude.NFData
    DatadogConnectorProfileCredentials
  where
  rnf :: DatadogConnectorProfileCredentials -> ()
rnf DatadogConnectorProfileCredentials' {Text
Sensitive Text
applicationKey :: Text
apiKey :: Sensitive Text
$sel:applicationKey:DatadogConnectorProfileCredentials' :: DatadogConnectorProfileCredentials -> Text
$sel:apiKey:DatadogConnectorProfileCredentials' :: DatadogConnectorProfileCredentials -> 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 Text
applicationKey

instance
  Data.ToJSON
    DatadogConnectorProfileCredentials
  where
  toJSON :: DatadogConnectorProfileCredentials -> Value
toJSON DatadogConnectorProfileCredentials' {Text
Sensitive Text
applicationKey :: Text
apiKey :: Sensitive Text
$sel:applicationKey:DatadogConnectorProfileCredentials' :: DatadogConnectorProfileCredentials -> Text
$sel:apiKey:DatadogConnectorProfileCredentials' :: DatadogConnectorProfileCredentials -> 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
"applicationKey" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
applicationKey)
          ]
      )