{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.AlexaBusiness.UpdateNetworkProfile
-- 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)
--
-- Updates a network profile by the network profile ARN.
module Amazonka.AlexaBusiness.UpdateNetworkProfile
  ( -- * Creating a Request
    UpdateNetworkProfile (..),
    newUpdateNetworkProfile,

    -- * Request Lenses
    updateNetworkProfile_networkProfileName,
    updateNetworkProfile_currentPassword,
    updateNetworkProfile_nextPassword,
    updateNetworkProfile_description,
    updateNetworkProfile_trustAnchors,
    updateNetworkProfile_certificateAuthorityArn,
    updateNetworkProfile_networkProfileArn,

    -- * Destructuring the Response
    UpdateNetworkProfileResponse (..),
    newUpdateNetworkProfileResponse,

    -- * Response Lenses
    updateNetworkProfileResponse_httpStatus,
  )
where

import Amazonka.AlexaBusiness.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newUpdateNetworkProfile' smart constructor.
data UpdateNetworkProfile = UpdateNetworkProfile'
  { -- | The name of the network profile associated with a device.
    UpdateNetworkProfile -> Maybe Text
networkProfileName :: Prelude.Maybe Prelude.Text,
    -- | The current password of the Wi-Fi network.
    UpdateNetworkProfile -> Maybe (Sensitive Text)
currentPassword :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | The next, or subsequent, password of the Wi-Fi network. This password is
    -- asynchronously transmitted to the device and is used when the password
    -- of the network changes to NextPassword.
    UpdateNetworkProfile -> Maybe (Sensitive Text)
nextPassword :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | Detailed information about a device\'s network profile.
    UpdateNetworkProfile -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The root certificate(s) of your authentication server that will be
    -- installed on your devices and used to trust your authentication server
    -- during EAP negotiation.
    UpdateNetworkProfile -> Maybe (NonEmpty Text)
trustAnchors :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
    -- | The ARN of the Private Certificate Authority (PCA) created in AWS
    -- Certificate Manager (ACM). This is used to issue certificates to the
    -- devices.
    UpdateNetworkProfile -> Maybe Text
certificateAuthorityArn :: Prelude.Maybe Prelude.Text,
    -- | The ARN of the network profile associated with a device.
    UpdateNetworkProfile -> Text
networkProfileArn :: Prelude.Text
  }
  deriving (UpdateNetworkProfile -> UpdateNetworkProfile -> Bool
(UpdateNetworkProfile -> UpdateNetworkProfile -> Bool)
-> (UpdateNetworkProfile -> UpdateNetworkProfile -> Bool)
-> Eq UpdateNetworkProfile
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateNetworkProfile -> UpdateNetworkProfile -> Bool
$c/= :: UpdateNetworkProfile -> UpdateNetworkProfile -> Bool
== :: UpdateNetworkProfile -> UpdateNetworkProfile -> Bool
$c== :: UpdateNetworkProfile -> UpdateNetworkProfile -> Bool
Prelude.Eq, Int -> UpdateNetworkProfile -> ShowS
[UpdateNetworkProfile] -> ShowS
UpdateNetworkProfile -> String
(Int -> UpdateNetworkProfile -> ShowS)
-> (UpdateNetworkProfile -> String)
-> ([UpdateNetworkProfile] -> ShowS)
-> Show UpdateNetworkProfile
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateNetworkProfile] -> ShowS
$cshowList :: [UpdateNetworkProfile] -> ShowS
show :: UpdateNetworkProfile -> String
$cshow :: UpdateNetworkProfile -> String
showsPrec :: Int -> UpdateNetworkProfile -> ShowS
$cshowsPrec :: Int -> UpdateNetworkProfile -> ShowS
Prelude.Show, (forall x. UpdateNetworkProfile -> Rep UpdateNetworkProfile x)
-> (forall x. Rep UpdateNetworkProfile x -> UpdateNetworkProfile)
-> Generic UpdateNetworkProfile
forall x. Rep UpdateNetworkProfile x -> UpdateNetworkProfile
forall x. UpdateNetworkProfile -> Rep UpdateNetworkProfile x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateNetworkProfile x -> UpdateNetworkProfile
$cfrom :: forall x. UpdateNetworkProfile -> Rep UpdateNetworkProfile x
Prelude.Generic)

-- |
-- Create a value of 'UpdateNetworkProfile' 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:
--
-- 'networkProfileName', 'updateNetworkProfile_networkProfileName' - The name of the network profile associated with a device.
--
-- 'currentPassword', 'updateNetworkProfile_currentPassword' - The current password of the Wi-Fi network.
--
-- 'nextPassword', 'updateNetworkProfile_nextPassword' - The next, or subsequent, password of the Wi-Fi network. This password is
-- asynchronously transmitted to the device and is used when the password
-- of the network changes to NextPassword.
--
-- 'description', 'updateNetworkProfile_description' - Detailed information about a device\'s network profile.
--
-- 'trustAnchors', 'updateNetworkProfile_trustAnchors' - The root certificate(s) of your authentication server that will be
-- installed on your devices and used to trust your authentication server
-- during EAP negotiation.
--
-- 'certificateAuthorityArn', 'updateNetworkProfile_certificateAuthorityArn' - The ARN of the Private Certificate Authority (PCA) created in AWS
-- Certificate Manager (ACM). This is used to issue certificates to the
-- devices.
--
-- 'networkProfileArn', 'updateNetworkProfile_networkProfileArn' - The ARN of the network profile associated with a device.
newUpdateNetworkProfile ::
  -- | 'networkProfileArn'
  Prelude.Text ->
  UpdateNetworkProfile
newUpdateNetworkProfile :: Text -> UpdateNetworkProfile
newUpdateNetworkProfile Text
pNetworkProfileArn_ =
  UpdateNetworkProfile' :: Maybe Text
-> Maybe (Sensitive Text)
-> Maybe (Sensitive Text)
-> Maybe Text
-> Maybe (NonEmpty Text)
-> Maybe Text
-> Text
-> UpdateNetworkProfile
UpdateNetworkProfile'
    { $sel:networkProfileName:UpdateNetworkProfile' :: Maybe Text
networkProfileName =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:currentPassword:UpdateNetworkProfile' :: Maybe (Sensitive Text)
currentPassword = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:nextPassword:UpdateNetworkProfile' :: Maybe (Sensitive Text)
nextPassword = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:description:UpdateNetworkProfile' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:trustAnchors:UpdateNetworkProfile' :: Maybe (NonEmpty Text)
trustAnchors = Maybe (NonEmpty Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:certificateAuthorityArn:UpdateNetworkProfile' :: Maybe Text
certificateAuthorityArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:networkProfileArn:UpdateNetworkProfile' :: Text
networkProfileArn = Text
pNetworkProfileArn_
    }

-- | The name of the network profile associated with a device.
updateNetworkProfile_networkProfileName :: Lens.Lens' UpdateNetworkProfile (Prelude.Maybe Prelude.Text)
updateNetworkProfile_networkProfileName :: (Maybe Text -> f (Maybe Text))
-> UpdateNetworkProfile -> f UpdateNetworkProfile
updateNetworkProfile_networkProfileName = (UpdateNetworkProfile -> Maybe Text)
-> (UpdateNetworkProfile -> Maybe Text -> UpdateNetworkProfile)
-> Lens
     UpdateNetworkProfile UpdateNetworkProfile (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateNetworkProfile' {Maybe Text
networkProfileName :: Maybe Text
$sel:networkProfileName:UpdateNetworkProfile' :: UpdateNetworkProfile -> Maybe Text
networkProfileName} -> Maybe Text
networkProfileName) (\s :: UpdateNetworkProfile
s@UpdateNetworkProfile' {} Maybe Text
a -> UpdateNetworkProfile
s {$sel:networkProfileName:UpdateNetworkProfile' :: Maybe Text
networkProfileName = Maybe Text
a} :: UpdateNetworkProfile)

-- | The current password of the Wi-Fi network.
updateNetworkProfile_currentPassword :: Lens.Lens' UpdateNetworkProfile (Prelude.Maybe Prelude.Text)
updateNetworkProfile_currentPassword :: (Maybe Text -> f (Maybe Text))
-> UpdateNetworkProfile -> f UpdateNetworkProfile
updateNetworkProfile_currentPassword = (UpdateNetworkProfile -> Maybe (Sensitive Text))
-> (UpdateNetworkProfile
    -> Maybe (Sensitive Text) -> UpdateNetworkProfile)
-> Lens
     UpdateNetworkProfile
     UpdateNetworkProfile
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateNetworkProfile' {Maybe (Sensitive Text)
currentPassword :: Maybe (Sensitive Text)
$sel:currentPassword:UpdateNetworkProfile' :: UpdateNetworkProfile -> Maybe (Sensitive Text)
currentPassword} -> Maybe (Sensitive Text)
currentPassword) (\s :: UpdateNetworkProfile
s@UpdateNetworkProfile' {} Maybe (Sensitive Text)
a -> UpdateNetworkProfile
s {$sel:currentPassword:UpdateNetworkProfile' :: Maybe (Sensitive Text)
currentPassword = Maybe (Sensitive Text)
a} :: UpdateNetworkProfile) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> UpdateNetworkProfile -> f UpdateNetworkProfile)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> UpdateNetworkProfile
-> f UpdateNetworkProfile
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

-- | The next, or subsequent, password of the Wi-Fi network. This password is
-- asynchronously transmitted to the device and is used when the password
-- of the network changes to NextPassword.
updateNetworkProfile_nextPassword :: Lens.Lens' UpdateNetworkProfile (Prelude.Maybe Prelude.Text)
updateNetworkProfile_nextPassword :: (Maybe Text -> f (Maybe Text))
-> UpdateNetworkProfile -> f UpdateNetworkProfile
updateNetworkProfile_nextPassword = (UpdateNetworkProfile -> Maybe (Sensitive Text))
-> (UpdateNetworkProfile
    -> Maybe (Sensitive Text) -> UpdateNetworkProfile)
-> Lens
     UpdateNetworkProfile
     UpdateNetworkProfile
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateNetworkProfile' {Maybe (Sensitive Text)
nextPassword :: Maybe (Sensitive Text)
$sel:nextPassword:UpdateNetworkProfile' :: UpdateNetworkProfile -> Maybe (Sensitive Text)
nextPassword} -> Maybe (Sensitive Text)
nextPassword) (\s :: UpdateNetworkProfile
s@UpdateNetworkProfile' {} Maybe (Sensitive Text)
a -> UpdateNetworkProfile
s {$sel:nextPassword:UpdateNetworkProfile' :: Maybe (Sensitive Text)
nextPassword = Maybe (Sensitive Text)
a} :: UpdateNetworkProfile) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> UpdateNetworkProfile -> f UpdateNetworkProfile)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> UpdateNetworkProfile
-> f UpdateNetworkProfile
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

-- | Detailed information about a device\'s network profile.
updateNetworkProfile_description :: Lens.Lens' UpdateNetworkProfile (Prelude.Maybe Prelude.Text)
updateNetworkProfile_description :: (Maybe Text -> f (Maybe Text))
-> UpdateNetworkProfile -> f UpdateNetworkProfile
updateNetworkProfile_description = (UpdateNetworkProfile -> Maybe Text)
-> (UpdateNetworkProfile -> Maybe Text -> UpdateNetworkProfile)
-> Lens
     UpdateNetworkProfile UpdateNetworkProfile (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateNetworkProfile' {Maybe Text
description :: Maybe Text
$sel:description:UpdateNetworkProfile' :: UpdateNetworkProfile -> Maybe Text
description} -> Maybe Text
description) (\s :: UpdateNetworkProfile
s@UpdateNetworkProfile' {} Maybe Text
a -> UpdateNetworkProfile
s {$sel:description:UpdateNetworkProfile' :: Maybe Text
description = Maybe Text
a} :: UpdateNetworkProfile)

-- | The root certificate(s) of your authentication server that will be
-- installed on your devices and used to trust your authentication server
-- during EAP negotiation.
updateNetworkProfile_trustAnchors :: Lens.Lens' UpdateNetworkProfile (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
updateNetworkProfile_trustAnchors :: (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> UpdateNetworkProfile -> f UpdateNetworkProfile
updateNetworkProfile_trustAnchors = (UpdateNetworkProfile -> Maybe (NonEmpty Text))
-> (UpdateNetworkProfile
    -> Maybe (NonEmpty Text) -> UpdateNetworkProfile)
-> Lens
     UpdateNetworkProfile
     UpdateNetworkProfile
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateNetworkProfile' {Maybe (NonEmpty Text)
trustAnchors :: Maybe (NonEmpty Text)
$sel:trustAnchors:UpdateNetworkProfile' :: UpdateNetworkProfile -> Maybe (NonEmpty Text)
trustAnchors} -> Maybe (NonEmpty Text)
trustAnchors) (\s :: UpdateNetworkProfile
s@UpdateNetworkProfile' {} Maybe (NonEmpty Text)
a -> UpdateNetworkProfile
s {$sel:trustAnchors:UpdateNetworkProfile' :: Maybe (NonEmpty Text)
trustAnchors = Maybe (NonEmpty Text)
a} :: UpdateNetworkProfile) ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
 -> UpdateNetworkProfile -> f UpdateNetworkProfile)
-> ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
    -> Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> UpdateNetworkProfile
-> f UpdateNetworkProfile
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
-> Iso
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty 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
  (NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The ARN of the Private Certificate Authority (PCA) created in AWS
-- Certificate Manager (ACM). This is used to issue certificates to the
-- devices.
updateNetworkProfile_certificateAuthorityArn :: Lens.Lens' UpdateNetworkProfile (Prelude.Maybe Prelude.Text)
updateNetworkProfile_certificateAuthorityArn :: (Maybe Text -> f (Maybe Text))
-> UpdateNetworkProfile -> f UpdateNetworkProfile
updateNetworkProfile_certificateAuthorityArn = (UpdateNetworkProfile -> Maybe Text)
-> (UpdateNetworkProfile -> Maybe Text -> UpdateNetworkProfile)
-> Lens
     UpdateNetworkProfile UpdateNetworkProfile (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateNetworkProfile' {Maybe Text
certificateAuthorityArn :: Maybe Text
$sel:certificateAuthorityArn:UpdateNetworkProfile' :: UpdateNetworkProfile -> Maybe Text
certificateAuthorityArn} -> Maybe Text
certificateAuthorityArn) (\s :: UpdateNetworkProfile
s@UpdateNetworkProfile' {} Maybe Text
a -> UpdateNetworkProfile
s {$sel:certificateAuthorityArn:UpdateNetworkProfile' :: Maybe Text
certificateAuthorityArn = Maybe Text
a} :: UpdateNetworkProfile)

-- | The ARN of the network profile associated with a device.
updateNetworkProfile_networkProfileArn :: Lens.Lens' UpdateNetworkProfile Prelude.Text
updateNetworkProfile_networkProfileArn :: (Text -> f Text) -> UpdateNetworkProfile -> f UpdateNetworkProfile
updateNetworkProfile_networkProfileArn = (UpdateNetworkProfile -> Text)
-> (UpdateNetworkProfile -> Text -> UpdateNetworkProfile)
-> Lens UpdateNetworkProfile UpdateNetworkProfile Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateNetworkProfile' {Text
networkProfileArn :: Text
$sel:networkProfileArn:UpdateNetworkProfile' :: UpdateNetworkProfile -> Text
networkProfileArn} -> Text
networkProfileArn) (\s :: UpdateNetworkProfile
s@UpdateNetworkProfile' {} Text
a -> UpdateNetworkProfile
s {$sel:networkProfileArn:UpdateNetworkProfile' :: Text
networkProfileArn = Text
a} :: UpdateNetworkProfile)

instance Core.AWSRequest UpdateNetworkProfile where
  type
    AWSResponse UpdateNetworkProfile =
      UpdateNetworkProfileResponse
  request :: UpdateNetworkProfile -> Request UpdateNetworkProfile
request = Service -> UpdateNetworkProfile -> Request UpdateNetworkProfile
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdateNetworkProfile
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateNetworkProfile)))
response =
    (Int
 -> ResponseHeaders
 -> ()
 -> Either String (AWSResponse UpdateNetworkProfile))
-> Logger
-> Service
-> Proxy UpdateNetworkProfile
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateNetworkProfile)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
      ( \Int
s ResponseHeaders
h ()
x ->
          Int -> UpdateNetworkProfileResponse
UpdateNetworkProfileResponse'
            (Int -> UpdateNetworkProfileResponse)
-> Either String Int -> Either String UpdateNetworkProfileResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable UpdateNetworkProfile

instance Prelude.NFData UpdateNetworkProfile

instance Core.ToHeaders UpdateNetworkProfile where
  toHeaders :: UpdateNetworkProfile -> ResponseHeaders
toHeaders =
    ResponseHeaders -> UpdateNetworkProfile -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"AlexaForBusiness.UpdateNetworkProfile" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON UpdateNetworkProfile where
  toJSON :: UpdateNetworkProfile -> Value
toJSON UpdateNetworkProfile' {Maybe (NonEmpty Text)
Maybe Text
Maybe (Sensitive Text)
Text
networkProfileArn :: Text
certificateAuthorityArn :: Maybe Text
trustAnchors :: Maybe (NonEmpty Text)
description :: Maybe Text
nextPassword :: Maybe (Sensitive Text)
currentPassword :: Maybe (Sensitive Text)
networkProfileName :: Maybe Text
$sel:networkProfileArn:UpdateNetworkProfile' :: UpdateNetworkProfile -> Text
$sel:certificateAuthorityArn:UpdateNetworkProfile' :: UpdateNetworkProfile -> Maybe Text
$sel:trustAnchors:UpdateNetworkProfile' :: UpdateNetworkProfile -> Maybe (NonEmpty Text)
$sel:description:UpdateNetworkProfile' :: UpdateNetworkProfile -> Maybe Text
$sel:nextPassword:UpdateNetworkProfile' :: UpdateNetworkProfile -> Maybe (Sensitive Text)
$sel:currentPassword:UpdateNetworkProfile' :: UpdateNetworkProfile -> Maybe (Sensitive Text)
$sel:networkProfileName:UpdateNetworkProfile' :: UpdateNetworkProfile -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"NetworkProfileName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
networkProfileName,
            (Text
"CurrentPassword" 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)
currentPassword,
            (Text
"NextPassword" 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)
nextPassword,
            (Text
"Description" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
description,
            (Text
"TrustAnchors" Text -> NonEmpty Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (NonEmpty Text -> Pair) -> Maybe (NonEmpty Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty Text)
trustAnchors,
            (Text
"CertificateAuthorityArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
certificateAuthorityArn,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"NetworkProfileArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
networkProfileArn)
          ]
      )

instance Core.ToPath UpdateNetworkProfile where
  toPath :: UpdateNetworkProfile -> ByteString
toPath = ByteString -> UpdateNetworkProfile -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Core.ToQuery UpdateNetworkProfile where
  toQuery :: UpdateNetworkProfile -> QueryString
toQuery = QueryString -> UpdateNetworkProfile -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newUpdateNetworkProfileResponse' smart constructor.
data UpdateNetworkProfileResponse = UpdateNetworkProfileResponse'
  { -- | The response's http status code.
    UpdateNetworkProfileResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (UpdateNetworkProfileResponse
-> UpdateNetworkProfileResponse -> Bool
(UpdateNetworkProfileResponse
 -> UpdateNetworkProfileResponse -> Bool)
-> (UpdateNetworkProfileResponse
    -> UpdateNetworkProfileResponse -> Bool)
-> Eq UpdateNetworkProfileResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateNetworkProfileResponse
-> UpdateNetworkProfileResponse -> Bool
$c/= :: UpdateNetworkProfileResponse
-> UpdateNetworkProfileResponse -> Bool
== :: UpdateNetworkProfileResponse
-> UpdateNetworkProfileResponse -> Bool
$c== :: UpdateNetworkProfileResponse
-> UpdateNetworkProfileResponse -> Bool
Prelude.Eq, ReadPrec [UpdateNetworkProfileResponse]
ReadPrec UpdateNetworkProfileResponse
Int -> ReadS UpdateNetworkProfileResponse
ReadS [UpdateNetworkProfileResponse]
(Int -> ReadS UpdateNetworkProfileResponse)
-> ReadS [UpdateNetworkProfileResponse]
-> ReadPrec UpdateNetworkProfileResponse
-> ReadPrec [UpdateNetworkProfileResponse]
-> Read UpdateNetworkProfileResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateNetworkProfileResponse]
$creadListPrec :: ReadPrec [UpdateNetworkProfileResponse]
readPrec :: ReadPrec UpdateNetworkProfileResponse
$creadPrec :: ReadPrec UpdateNetworkProfileResponse
readList :: ReadS [UpdateNetworkProfileResponse]
$creadList :: ReadS [UpdateNetworkProfileResponse]
readsPrec :: Int -> ReadS UpdateNetworkProfileResponse
$creadsPrec :: Int -> ReadS UpdateNetworkProfileResponse
Prelude.Read, Int -> UpdateNetworkProfileResponse -> ShowS
[UpdateNetworkProfileResponse] -> ShowS
UpdateNetworkProfileResponse -> String
(Int -> UpdateNetworkProfileResponse -> ShowS)
-> (UpdateNetworkProfileResponse -> String)
-> ([UpdateNetworkProfileResponse] -> ShowS)
-> Show UpdateNetworkProfileResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateNetworkProfileResponse] -> ShowS
$cshowList :: [UpdateNetworkProfileResponse] -> ShowS
show :: UpdateNetworkProfileResponse -> String
$cshow :: UpdateNetworkProfileResponse -> String
showsPrec :: Int -> UpdateNetworkProfileResponse -> ShowS
$cshowsPrec :: Int -> UpdateNetworkProfileResponse -> ShowS
Prelude.Show, (forall x.
 UpdateNetworkProfileResponse -> Rep UpdateNetworkProfileResponse x)
-> (forall x.
    Rep UpdateNetworkProfileResponse x -> UpdateNetworkProfileResponse)
-> Generic UpdateNetworkProfileResponse
forall x.
Rep UpdateNetworkProfileResponse x -> UpdateNetworkProfileResponse
forall x.
UpdateNetworkProfileResponse -> Rep UpdateNetworkProfileResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateNetworkProfileResponse x -> UpdateNetworkProfileResponse
$cfrom :: forall x.
UpdateNetworkProfileResponse -> Rep UpdateNetworkProfileResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateNetworkProfileResponse' 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:
--
-- 'httpStatus', 'updateNetworkProfileResponse_httpStatus' - The response's http status code.
newUpdateNetworkProfileResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateNetworkProfileResponse
newUpdateNetworkProfileResponse :: Int -> UpdateNetworkProfileResponse
newUpdateNetworkProfileResponse Int
pHttpStatus_ =
  UpdateNetworkProfileResponse' :: Int -> UpdateNetworkProfileResponse
UpdateNetworkProfileResponse'
    { $sel:httpStatus:UpdateNetworkProfileResponse' :: Int
httpStatus =
        Int
pHttpStatus_
    }

-- | The response's http status code.
updateNetworkProfileResponse_httpStatus :: Lens.Lens' UpdateNetworkProfileResponse Prelude.Int
updateNetworkProfileResponse_httpStatus :: (Int -> f Int)
-> UpdateNetworkProfileResponse -> f UpdateNetworkProfileResponse
updateNetworkProfileResponse_httpStatus = (UpdateNetworkProfileResponse -> Int)
-> (UpdateNetworkProfileResponse
    -> Int -> UpdateNetworkProfileResponse)
-> Lens
     UpdateNetworkProfileResponse UpdateNetworkProfileResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateNetworkProfileResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateNetworkProfileResponse' :: UpdateNetworkProfileResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateNetworkProfileResponse
s@UpdateNetworkProfileResponse' {} Int
a -> UpdateNetworkProfileResponse
s {$sel:httpStatus:UpdateNetworkProfileResponse' :: Int
httpStatus = Int
a} :: UpdateNetworkProfileResponse)

instance Prelude.NFData UpdateNetworkProfileResponse