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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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 -> Text
apiKey :: 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
(DatadogConnectorProfileCredentials
 -> DatadogConnectorProfileCredentials -> Bool)
-> (DatadogConnectorProfileCredentials
    -> DatadogConnectorProfileCredentials -> Bool)
-> Eq DatadogConnectorProfileCredentials
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, ReadPrec [DatadogConnectorProfileCredentials]
ReadPrec DatadogConnectorProfileCredentials
Int -> ReadS DatadogConnectorProfileCredentials
ReadS [DatadogConnectorProfileCredentials]
(Int -> ReadS DatadogConnectorProfileCredentials)
-> ReadS [DatadogConnectorProfileCredentials]
-> ReadPrec DatadogConnectorProfileCredentials
-> ReadPrec [DatadogConnectorProfileCredentials]
-> Read DatadogConnectorProfileCredentials
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DatadogConnectorProfileCredentials]
$creadListPrec :: ReadPrec [DatadogConnectorProfileCredentials]
readPrec :: ReadPrec DatadogConnectorProfileCredentials
$creadPrec :: ReadPrec DatadogConnectorProfileCredentials
readList :: ReadS [DatadogConnectorProfileCredentials]
$creadList :: ReadS [DatadogConnectorProfileCredentials]
readsPrec :: Int -> ReadS DatadogConnectorProfileCredentials
$creadsPrec :: Int -> ReadS DatadogConnectorProfileCredentials
Prelude.Read, Int -> DatadogConnectorProfileCredentials -> ShowS
[DatadogConnectorProfileCredentials] -> ShowS
DatadogConnectorProfileCredentials -> String
(Int -> DatadogConnectorProfileCredentials -> ShowS)
-> (DatadogConnectorProfileCredentials -> String)
-> ([DatadogConnectorProfileCredentials] -> ShowS)
-> Show DatadogConnectorProfileCredentials
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.
 DatadogConnectorProfileCredentials
 -> Rep DatadogConnectorProfileCredentials x)
-> (forall x.
    Rep DatadogConnectorProfileCredentials x
    -> DatadogConnectorProfileCredentials)
-> Generic DatadogConnectorProfileCredentials
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' :: Text -> Text -> DatadogConnectorProfileCredentials
DatadogConnectorProfileCredentials'
      { $sel:apiKey:DatadogConnectorProfileCredentials' :: Text
apiKey =
          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 :: (Text -> f Text)
-> DatadogConnectorProfileCredentials
-> f DatadogConnectorProfileCredentials
datadogConnectorProfileCredentials_apiKey = (DatadogConnectorProfileCredentials -> Text)
-> (DatadogConnectorProfileCredentials
    -> Text -> DatadogConnectorProfileCredentials)
-> Lens
     DatadogConnectorProfileCredentials
     DatadogConnectorProfileCredentials
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DatadogConnectorProfileCredentials' {Text
apiKey :: Text
$sel:apiKey:DatadogConnectorProfileCredentials' :: DatadogConnectorProfileCredentials -> Text
apiKey} -> Text
apiKey) (\s :: DatadogConnectorProfileCredentials
s@DatadogConnectorProfileCredentials' {} Text
a -> DatadogConnectorProfileCredentials
s {$sel:apiKey:DatadogConnectorProfileCredentials' :: Text
apiKey = Text
a} :: DatadogConnectorProfileCredentials)

-- | 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 :: (Text -> f Text)
-> DatadogConnectorProfileCredentials
-> f DatadogConnectorProfileCredentials
datadogConnectorProfileCredentials_applicationKey = (DatadogConnectorProfileCredentials -> Text)
-> (DatadogConnectorProfileCredentials
    -> Text -> DatadogConnectorProfileCredentials)
-> Lens
     DatadogConnectorProfileCredentials
     DatadogConnectorProfileCredentials
     Text
     Text
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

instance
  Prelude.NFData
    DatadogConnectorProfileCredentials

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