{-# 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.IoTWireless.Types.SidewalkUpdateAccount
-- 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.IoTWireless.Types.SidewalkUpdateAccount where

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

-- | Sidewalk update.
--
-- /See:/ 'newSidewalkUpdateAccount' smart constructor.
data SidewalkUpdateAccount = SidewalkUpdateAccount'
  { -- | The new Sidewalk application server private key.
    SidewalkUpdateAccount -> Maybe (Sensitive Text)
appServerPrivateKey :: Prelude.Maybe (Core.Sensitive Prelude.Text)
  }
  deriving (SidewalkUpdateAccount -> SidewalkUpdateAccount -> Bool
(SidewalkUpdateAccount -> SidewalkUpdateAccount -> Bool)
-> (SidewalkUpdateAccount -> SidewalkUpdateAccount -> Bool)
-> Eq SidewalkUpdateAccount
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SidewalkUpdateAccount -> SidewalkUpdateAccount -> Bool
$c/= :: SidewalkUpdateAccount -> SidewalkUpdateAccount -> Bool
== :: SidewalkUpdateAccount -> SidewalkUpdateAccount -> Bool
$c== :: SidewalkUpdateAccount -> SidewalkUpdateAccount -> Bool
Prelude.Eq, Int -> SidewalkUpdateAccount -> ShowS
[SidewalkUpdateAccount] -> ShowS
SidewalkUpdateAccount -> String
(Int -> SidewalkUpdateAccount -> ShowS)
-> (SidewalkUpdateAccount -> String)
-> ([SidewalkUpdateAccount] -> ShowS)
-> Show SidewalkUpdateAccount
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SidewalkUpdateAccount] -> ShowS
$cshowList :: [SidewalkUpdateAccount] -> ShowS
show :: SidewalkUpdateAccount -> String
$cshow :: SidewalkUpdateAccount -> String
showsPrec :: Int -> SidewalkUpdateAccount -> ShowS
$cshowsPrec :: Int -> SidewalkUpdateAccount -> ShowS
Prelude.Show, (forall x. SidewalkUpdateAccount -> Rep SidewalkUpdateAccount x)
-> (forall x. Rep SidewalkUpdateAccount x -> SidewalkUpdateAccount)
-> Generic SidewalkUpdateAccount
forall x. Rep SidewalkUpdateAccount x -> SidewalkUpdateAccount
forall x. SidewalkUpdateAccount -> Rep SidewalkUpdateAccount x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SidewalkUpdateAccount x -> SidewalkUpdateAccount
$cfrom :: forall x. SidewalkUpdateAccount -> Rep SidewalkUpdateAccount x
Prelude.Generic)

-- |
-- Create a value of 'SidewalkUpdateAccount' 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:
--
-- 'appServerPrivateKey', 'sidewalkUpdateAccount_appServerPrivateKey' - The new Sidewalk application server private key.
newSidewalkUpdateAccount ::
  SidewalkUpdateAccount
newSidewalkUpdateAccount :: SidewalkUpdateAccount
newSidewalkUpdateAccount =
  SidewalkUpdateAccount' :: Maybe (Sensitive Text) -> SidewalkUpdateAccount
SidewalkUpdateAccount'
    { $sel:appServerPrivateKey:SidewalkUpdateAccount' :: Maybe (Sensitive Text)
appServerPrivateKey =
        Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing
    }

-- | The new Sidewalk application server private key.
sidewalkUpdateAccount_appServerPrivateKey :: Lens.Lens' SidewalkUpdateAccount (Prelude.Maybe Prelude.Text)
sidewalkUpdateAccount_appServerPrivateKey :: (Maybe Text -> f (Maybe Text))
-> SidewalkUpdateAccount -> f SidewalkUpdateAccount
sidewalkUpdateAccount_appServerPrivateKey = (SidewalkUpdateAccount -> Maybe (Sensitive Text))
-> (SidewalkUpdateAccount
    -> Maybe (Sensitive Text) -> SidewalkUpdateAccount)
-> Lens
     SidewalkUpdateAccount
     SidewalkUpdateAccount
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SidewalkUpdateAccount' {Maybe (Sensitive Text)
appServerPrivateKey :: Maybe (Sensitive Text)
$sel:appServerPrivateKey:SidewalkUpdateAccount' :: SidewalkUpdateAccount -> Maybe (Sensitive Text)
appServerPrivateKey} -> Maybe (Sensitive Text)
appServerPrivateKey) (\s :: SidewalkUpdateAccount
s@SidewalkUpdateAccount' {} Maybe (Sensitive Text)
a -> SidewalkUpdateAccount
s {$sel:appServerPrivateKey:SidewalkUpdateAccount' :: Maybe (Sensitive Text)
appServerPrivateKey = Maybe (Sensitive Text)
a} :: SidewalkUpdateAccount) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> SidewalkUpdateAccount -> f SidewalkUpdateAccount)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> SidewalkUpdateAccount
-> f SidewalkUpdateAccount
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
     (Maybe Text)
     (Maybe Text)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive

instance Prelude.Hashable SidewalkUpdateAccount

instance Prelude.NFData SidewalkUpdateAccount

instance Core.ToJSON SidewalkUpdateAccount where
  toJSON :: SidewalkUpdateAccount -> Value
toJSON SidewalkUpdateAccount' {Maybe (Sensitive Text)
appServerPrivateKey :: Maybe (Sensitive Text)
$sel:appServerPrivateKey:SidewalkUpdateAccount' :: SidewalkUpdateAccount -> Maybe (Sensitive Text)
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"AppServerPrivateKey" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Sensitive Text -> Pair) -> Maybe (Sensitive Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive Text)
appServerPrivateKey
          ]
      )