{-# 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.TrendmicroConnectorProfileCredentials
-- 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.TrendmicroConnectorProfileCredentials 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 when using Trend
-- Micro.
--
-- /See:/ 'newTrendmicroConnectorProfileCredentials' smart constructor.
data TrendmicroConnectorProfileCredentials = TrendmicroConnectorProfileCredentials'
  { -- | The Secret Access Key portion of the credentials.
    TrendmicroConnectorProfileCredentials -> Sensitive Text
apiSecretKey :: Core.Sensitive Prelude.Text
  }
  deriving (TrendmicroConnectorProfileCredentials
-> TrendmicroConnectorProfileCredentials -> Bool
(TrendmicroConnectorProfileCredentials
 -> TrendmicroConnectorProfileCredentials -> Bool)
-> (TrendmicroConnectorProfileCredentials
    -> TrendmicroConnectorProfileCredentials -> Bool)
-> Eq TrendmicroConnectorProfileCredentials
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TrendmicroConnectorProfileCredentials
-> TrendmicroConnectorProfileCredentials -> Bool
$c/= :: TrendmicroConnectorProfileCredentials
-> TrendmicroConnectorProfileCredentials -> Bool
== :: TrendmicroConnectorProfileCredentials
-> TrendmicroConnectorProfileCredentials -> Bool
$c== :: TrendmicroConnectorProfileCredentials
-> TrendmicroConnectorProfileCredentials -> Bool
Prelude.Eq, Int -> TrendmicroConnectorProfileCredentials -> ShowS
[TrendmicroConnectorProfileCredentials] -> ShowS
TrendmicroConnectorProfileCredentials -> String
(Int -> TrendmicroConnectorProfileCredentials -> ShowS)
-> (TrendmicroConnectorProfileCredentials -> String)
-> ([TrendmicroConnectorProfileCredentials] -> ShowS)
-> Show TrendmicroConnectorProfileCredentials
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TrendmicroConnectorProfileCredentials] -> ShowS
$cshowList :: [TrendmicroConnectorProfileCredentials] -> ShowS
show :: TrendmicroConnectorProfileCredentials -> String
$cshow :: TrendmicroConnectorProfileCredentials -> String
showsPrec :: Int -> TrendmicroConnectorProfileCredentials -> ShowS
$cshowsPrec :: Int -> TrendmicroConnectorProfileCredentials -> ShowS
Prelude.Show, (forall x.
 TrendmicroConnectorProfileCredentials
 -> Rep TrendmicroConnectorProfileCredentials x)
-> (forall x.
    Rep TrendmicroConnectorProfileCredentials x
    -> TrendmicroConnectorProfileCredentials)
-> Generic TrendmicroConnectorProfileCredentials
forall x.
Rep TrendmicroConnectorProfileCredentials x
-> TrendmicroConnectorProfileCredentials
forall x.
TrendmicroConnectorProfileCredentials
-> Rep TrendmicroConnectorProfileCredentials x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep TrendmicroConnectorProfileCredentials x
-> TrendmicroConnectorProfileCredentials
$cfrom :: forall x.
TrendmicroConnectorProfileCredentials
-> Rep TrendmicroConnectorProfileCredentials x
Prelude.Generic)

-- |
-- Create a value of 'TrendmicroConnectorProfileCredentials' 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:
--
-- 'apiSecretKey', 'trendmicroConnectorProfileCredentials_apiSecretKey' - The Secret Access Key portion of the credentials.
newTrendmicroConnectorProfileCredentials ::
  -- | 'apiSecretKey'
  Prelude.Text ->
  TrendmicroConnectorProfileCredentials
newTrendmicroConnectorProfileCredentials :: Text -> TrendmicroConnectorProfileCredentials
newTrendmicroConnectorProfileCredentials
  Text
pApiSecretKey_ =
    TrendmicroConnectorProfileCredentials' :: Sensitive Text -> TrendmicroConnectorProfileCredentials
TrendmicroConnectorProfileCredentials'
      { $sel:apiSecretKey:TrendmicroConnectorProfileCredentials' :: Sensitive Text
apiSecretKey =
          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
pApiSecretKey_
      }

-- | The Secret Access Key portion of the credentials.
trendmicroConnectorProfileCredentials_apiSecretKey :: Lens.Lens' TrendmicroConnectorProfileCredentials Prelude.Text
trendmicroConnectorProfileCredentials_apiSecretKey :: (Text -> f Text)
-> TrendmicroConnectorProfileCredentials
-> f TrendmicroConnectorProfileCredentials
trendmicroConnectorProfileCredentials_apiSecretKey = (TrendmicroConnectorProfileCredentials -> Sensitive Text)
-> (TrendmicroConnectorProfileCredentials
    -> Sensitive Text -> TrendmicroConnectorProfileCredentials)
-> Lens
     TrendmicroConnectorProfileCredentials
     TrendmicroConnectorProfileCredentials
     (Sensitive Text)
     (Sensitive Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TrendmicroConnectorProfileCredentials' {Sensitive Text
apiSecretKey :: Sensitive Text
$sel:apiSecretKey:TrendmicroConnectorProfileCredentials' :: TrendmicroConnectorProfileCredentials -> Sensitive Text
apiSecretKey} -> Sensitive Text
apiSecretKey) (\s :: TrendmicroConnectorProfileCredentials
s@TrendmicroConnectorProfileCredentials' {} Sensitive Text
a -> TrendmicroConnectorProfileCredentials
s {$sel:apiSecretKey:TrendmicroConnectorProfileCredentials' :: Sensitive Text
apiSecretKey = Sensitive Text
a} :: TrendmicroConnectorProfileCredentials) ((Sensitive Text -> f (Sensitive Text))
 -> TrendmicroConnectorProfileCredentials
 -> f TrendmicroConnectorProfileCredentials)
-> ((Text -> f Text) -> Sensitive Text -> f (Sensitive Text))
-> (Text -> f Text)
-> TrendmicroConnectorProfileCredentials
-> f TrendmicroConnectorProfileCredentials
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
    TrendmicroConnectorProfileCredentials

instance
  Prelude.NFData
    TrendmicroConnectorProfileCredentials

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