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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | The connector-specific profile credentials required by Dynatrace.
--
-- /See:/ 'newDynatraceConnectorProfileCredentials' smart constructor.
data DynatraceConnectorProfileCredentials = DynatraceConnectorProfileCredentials'
  { -- | The API tokens used by Dynatrace API to authenticate various API calls.
    DynatraceConnectorProfileCredentials -> Text
apiToken :: Prelude.Text
  }
  deriving (DynatraceConnectorProfileCredentials
-> DynatraceConnectorProfileCredentials -> Bool
(DynatraceConnectorProfileCredentials
 -> DynatraceConnectorProfileCredentials -> Bool)
-> (DynatraceConnectorProfileCredentials
    -> DynatraceConnectorProfileCredentials -> Bool)
-> Eq DynatraceConnectorProfileCredentials
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DynatraceConnectorProfileCredentials
-> DynatraceConnectorProfileCredentials -> Bool
$c/= :: DynatraceConnectorProfileCredentials
-> DynatraceConnectorProfileCredentials -> Bool
== :: DynatraceConnectorProfileCredentials
-> DynatraceConnectorProfileCredentials -> Bool
$c== :: DynatraceConnectorProfileCredentials
-> DynatraceConnectorProfileCredentials -> Bool
Prelude.Eq, ReadPrec [DynatraceConnectorProfileCredentials]
ReadPrec DynatraceConnectorProfileCredentials
Int -> ReadS DynatraceConnectorProfileCredentials
ReadS [DynatraceConnectorProfileCredentials]
(Int -> ReadS DynatraceConnectorProfileCredentials)
-> ReadS [DynatraceConnectorProfileCredentials]
-> ReadPrec DynatraceConnectorProfileCredentials
-> ReadPrec [DynatraceConnectorProfileCredentials]
-> Read DynatraceConnectorProfileCredentials
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DynatraceConnectorProfileCredentials]
$creadListPrec :: ReadPrec [DynatraceConnectorProfileCredentials]
readPrec :: ReadPrec DynatraceConnectorProfileCredentials
$creadPrec :: ReadPrec DynatraceConnectorProfileCredentials
readList :: ReadS [DynatraceConnectorProfileCredentials]
$creadList :: ReadS [DynatraceConnectorProfileCredentials]
readsPrec :: Int -> ReadS DynatraceConnectorProfileCredentials
$creadsPrec :: Int -> ReadS DynatraceConnectorProfileCredentials
Prelude.Read, Int -> DynatraceConnectorProfileCredentials -> ShowS
[DynatraceConnectorProfileCredentials] -> ShowS
DynatraceConnectorProfileCredentials -> String
(Int -> DynatraceConnectorProfileCredentials -> ShowS)
-> (DynatraceConnectorProfileCredentials -> String)
-> ([DynatraceConnectorProfileCredentials] -> ShowS)
-> Show DynatraceConnectorProfileCredentials
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DynatraceConnectorProfileCredentials] -> ShowS
$cshowList :: [DynatraceConnectorProfileCredentials] -> ShowS
show :: DynatraceConnectorProfileCredentials -> String
$cshow :: DynatraceConnectorProfileCredentials -> String
showsPrec :: Int -> DynatraceConnectorProfileCredentials -> ShowS
$cshowsPrec :: Int -> DynatraceConnectorProfileCredentials -> ShowS
Prelude.Show, (forall x.
 DynatraceConnectorProfileCredentials
 -> Rep DynatraceConnectorProfileCredentials x)
-> (forall x.
    Rep DynatraceConnectorProfileCredentials x
    -> DynatraceConnectorProfileCredentials)
-> Generic DynatraceConnectorProfileCredentials
forall x.
Rep DynatraceConnectorProfileCredentials x
-> DynatraceConnectorProfileCredentials
forall x.
DynatraceConnectorProfileCredentials
-> Rep DynatraceConnectorProfileCredentials x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DynatraceConnectorProfileCredentials x
-> DynatraceConnectorProfileCredentials
$cfrom :: forall x.
DynatraceConnectorProfileCredentials
-> Rep DynatraceConnectorProfileCredentials x
Prelude.Generic)

-- |
-- Create a value of 'DynatraceConnectorProfileCredentials' 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:
--
-- 'apiToken', 'dynatraceConnectorProfileCredentials_apiToken' - The API tokens used by Dynatrace API to authenticate various API calls.
newDynatraceConnectorProfileCredentials ::
  -- | 'apiToken'
  Prelude.Text ->
  DynatraceConnectorProfileCredentials
newDynatraceConnectorProfileCredentials :: Text -> DynatraceConnectorProfileCredentials
newDynatraceConnectorProfileCredentials Text
pApiToken_ =
  DynatraceConnectorProfileCredentials' :: Text -> DynatraceConnectorProfileCredentials
DynatraceConnectorProfileCredentials'
    { $sel:apiToken:DynatraceConnectorProfileCredentials' :: Text
apiToken =
        Text
pApiToken_
    }

-- | The API tokens used by Dynatrace API to authenticate various API calls.
dynatraceConnectorProfileCredentials_apiToken :: Lens.Lens' DynatraceConnectorProfileCredentials Prelude.Text
dynatraceConnectorProfileCredentials_apiToken :: (Text -> f Text)
-> DynatraceConnectorProfileCredentials
-> f DynatraceConnectorProfileCredentials
dynatraceConnectorProfileCredentials_apiToken = (DynatraceConnectorProfileCredentials -> Text)
-> (DynatraceConnectorProfileCredentials
    -> Text -> DynatraceConnectorProfileCredentials)
-> Lens
     DynatraceConnectorProfileCredentials
     DynatraceConnectorProfileCredentials
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DynatraceConnectorProfileCredentials' {Text
apiToken :: Text
$sel:apiToken:DynatraceConnectorProfileCredentials' :: DynatraceConnectorProfileCredentials -> Text
apiToken} -> Text
apiToken) (\s :: DynatraceConnectorProfileCredentials
s@DynatraceConnectorProfileCredentials' {} Text
a -> DynatraceConnectorProfileCredentials
s {$sel:apiToken:DynatraceConnectorProfileCredentials' :: Text
apiToken = Text
a} :: DynatraceConnectorProfileCredentials)

instance
  Prelude.Hashable
    DynatraceConnectorProfileCredentials

instance
  Prelude.NFData
    DynatraceConnectorProfileCredentials

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