{-# 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.CreateNetworkProfile
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Creates a network profile with the specified details.
module Amazonka.AlexaBusiness.CreateNetworkProfile
  ( -- * Creating a Request
    CreateNetworkProfile (..),
    newCreateNetworkProfile,

    -- * Request Lenses
    createNetworkProfile_certificateAuthorityArn,
    createNetworkProfile_currentPassword,
    createNetworkProfile_description,
    createNetworkProfile_eapMethod,
    createNetworkProfile_nextPassword,
    createNetworkProfile_tags,
    createNetworkProfile_trustAnchors,
    createNetworkProfile_networkProfileName,
    createNetworkProfile_ssid,
    createNetworkProfile_securityType,
    createNetworkProfile_clientRequestToken,

    -- * Destructuring the Response
    CreateNetworkProfileResponse (..),
    newCreateNetworkProfileResponse,

    -- * Response Lenses
    createNetworkProfileResponse_networkProfileArn,
    createNetworkProfileResponse_httpStatus,
  )
where

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

-- | /See:/ 'newCreateNetworkProfile' smart constructor.
data CreateNetworkProfile = CreateNetworkProfile'
  { -- | The ARN of the Private Certificate Authority (PCA) created in AWS
    -- Certificate Manager (ACM). This is used to issue certificates to the
    -- devices.
    CreateNetworkProfile -> Maybe Text
certificateAuthorityArn :: Prelude.Maybe Prelude.Text,
    -- | The current password of the Wi-Fi network.
    CreateNetworkProfile -> Maybe (Sensitive Text)
currentPassword :: Prelude.Maybe (Data.Sensitive Prelude.Text),
    -- | Detailed information about a device\'s network profile.
    CreateNetworkProfile -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The authentication standard that is used in the EAP framework.
    -- Currently, EAP_TLS is supported.
    CreateNetworkProfile -> Maybe NetworkEapMethod
eapMethod :: Prelude.Maybe NetworkEapMethod,
    -- | 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.
    CreateNetworkProfile -> Maybe (Sensitive Text)
nextPassword :: Prelude.Maybe (Data.Sensitive Prelude.Text),
    -- | The tags to be added to the specified resource. Do not provide system
    -- tags.
    CreateNetworkProfile -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | The root certificates of your authentication server that is installed on
    -- your devices and used to trust your authentication server during EAP
    -- negotiation.
    CreateNetworkProfile -> Maybe (NonEmpty Text)
trustAnchors :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
    -- | The name of the network profile associated with a device.
    CreateNetworkProfile -> Text
networkProfileName :: Prelude.Text,
    -- | The SSID of the Wi-Fi network.
    CreateNetworkProfile -> Text
ssid :: Prelude.Text,
    -- | The security type of the Wi-Fi network. This can be WPA2_ENTERPRISE,
    -- WPA2_PSK, WPA_PSK, WEP, or OPEN.
    CreateNetworkProfile -> NetworkSecurityType
securityType :: NetworkSecurityType,
    CreateNetworkProfile -> Text
clientRequestToken :: Prelude.Text
  }
  deriving (CreateNetworkProfile -> CreateNetworkProfile -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateNetworkProfile -> CreateNetworkProfile -> Bool
$c/= :: CreateNetworkProfile -> CreateNetworkProfile -> Bool
== :: CreateNetworkProfile -> CreateNetworkProfile -> Bool
$c== :: CreateNetworkProfile -> CreateNetworkProfile -> Bool
Prelude.Eq, Int -> CreateNetworkProfile -> ShowS
[CreateNetworkProfile] -> ShowS
CreateNetworkProfile -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateNetworkProfile] -> ShowS
$cshowList :: [CreateNetworkProfile] -> ShowS
show :: CreateNetworkProfile -> String
$cshow :: CreateNetworkProfile -> String
showsPrec :: Int -> CreateNetworkProfile -> ShowS
$cshowsPrec :: Int -> CreateNetworkProfile -> ShowS
Prelude.Show, forall x. Rep CreateNetworkProfile x -> CreateNetworkProfile
forall x. CreateNetworkProfile -> Rep CreateNetworkProfile x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateNetworkProfile x -> CreateNetworkProfile
$cfrom :: forall x. CreateNetworkProfile -> Rep CreateNetworkProfile x
Prelude.Generic)

-- |
-- Create a value of 'CreateNetworkProfile' 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:
--
-- 'certificateAuthorityArn', 'createNetworkProfile_certificateAuthorityArn' - The ARN of the Private Certificate Authority (PCA) created in AWS
-- Certificate Manager (ACM). This is used to issue certificates to the
-- devices.
--
-- 'currentPassword', 'createNetworkProfile_currentPassword' - The current password of the Wi-Fi network.
--
-- 'description', 'createNetworkProfile_description' - Detailed information about a device\'s network profile.
--
-- 'eapMethod', 'createNetworkProfile_eapMethod' - The authentication standard that is used in the EAP framework.
-- Currently, EAP_TLS is supported.
--
-- 'nextPassword', 'createNetworkProfile_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.
--
-- 'tags', 'createNetworkProfile_tags' - The tags to be added to the specified resource. Do not provide system
-- tags.
--
-- 'trustAnchors', 'createNetworkProfile_trustAnchors' - The root certificates of your authentication server that is installed on
-- your devices and used to trust your authentication server during EAP
-- negotiation.
--
-- 'networkProfileName', 'createNetworkProfile_networkProfileName' - The name of the network profile associated with a device.
--
-- 'ssid', 'createNetworkProfile_ssid' - The SSID of the Wi-Fi network.
--
-- 'securityType', 'createNetworkProfile_securityType' - The security type of the Wi-Fi network. This can be WPA2_ENTERPRISE,
-- WPA2_PSK, WPA_PSK, WEP, or OPEN.
--
-- 'clientRequestToken', 'createNetworkProfile_clientRequestToken' - Undocumented member.
newCreateNetworkProfile ::
  -- | 'networkProfileName'
  Prelude.Text ->
  -- | 'ssid'
  Prelude.Text ->
  -- | 'securityType'
  NetworkSecurityType ->
  -- | 'clientRequestToken'
  Prelude.Text ->
  CreateNetworkProfile
newCreateNetworkProfile :: Text -> Text -> NetworkSecurityType -> Text -> CreateNetworkProfile
newCreateNetworkProfile
  Text
pNetworkProfileName_
  Text
pSsid_
  NetworkSecurityType
pSecurityType_
  Text
pClientRequestToken_ =
    CreateNetworkProfile'
      { $sel:certificateAuthorityArn:CreateNetworkProfile' :: Maybe Text
certificateAuthorityArn =
          forall a. Maybe a
Prelude.Nothing,
        $sel:currentPassword:CreateNetworkProfile' :: Maybe (Sensitive Text)
currentPassword = forall a. Maybe a
Prelude.Nothing,
        $sel:description:CreateNetworkProfile' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
        $sel:eapMethod:CreateNetworkProfile' :: Maybe NetworkEapMethod
eapMethod = forall a. Maybe a
Prelude.Nothing,
        $sel:nextPassword:CreateNetworkProfile' :: Maybe (Sensitive Text)
nextPassword = forall a. Maybe a
Prelude.Nothing,
        $sel:tags:CreateNetworkProfile' :: Maybe [Tag]
tags = forall a. Maybe a
Prelude.Nothing,
        $sel:trustAnchors:CreateNetworkProfile' :: Maybe (NonEmpty Text)
trustAnchors = forall a. Maybe a
Prelude.Nothing,
        $sel:networkProfileName:CreateNetworkProfile' :: Text
networkProfileName = Text
pNetworkProfileName_,
        $sel:ssid:CreateNetworkProfile' :: Text
ssid = Text
pSsid_,
        $sel:securityType:CreateNetworkProfile' :: NetworkSecurityType
securityType = NetworkSecurityType
pSecurityType_,
        $sel:clientRequestToken:CreateNetworkProfile' :: Text
clientRequestToken = Text
pClientRequestToken_
      }

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

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

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

-- | The authentication standard that is used in the EAP framework.
-- Currently, EAP_TLS is supported.
createNetworkProfile_eapMethod :: Lens.Lens' CreateNetworkProfile (Prelude.Maybe NetworkEapMethod)
createNetworkProfile_eapMethod :: Lens' CreateNetworkProfile (Maybe NetworkEapMethod)
createNetworkProfile_eapMethod = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateNetworkProfile' {Maybe NetworkEapMethod
eapMethod :: Maybe NetworkEapMethod
$sel:eapMethod:CreateNetworkProfile' :: CreateNetworkProfile -> Maybe NetworkEapMethod
eapMethod} -> Maybe NetworkEapMethod
eapMethod) (\s :: CreateNetworkProfile
s@CreateNetworkProfile' {} Maybe NetworkEapMethod
a -> CreateNetworkProfile
s {$sel:eapMethod:CreateNetworkProfile' :: Maybe NetworkEapMethod
eapMethod = Maybe NetworkEapMethod
a} :: CreateNetworkProfile)

-- | 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.
createNetworkProfile_nextPassword :: Lens.Lens' CreateNetworkProfile (Prelude.Maybe Prelude.Text)
createNetworkProfile_nextPassword :: Lens' CreateNetworkProfile (Maybe Text)
createNetworkProfile_nextPassword = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateNetworkProfile' {Maybe (Sensitive Text)
nextPassword :: Maybe (Sensitive Text)
$sel:nextPassword:CreateNetworkProfile' :: CreateNetworkProfile -> Maybe (Sensitive Text)
nextPassword} -> Maybe (Sensitive Text)
nextPassword) (\s :: CreateNetworkProfile
s@CreateNetworkProfile' {} Maybe (Sensitive Text)
a -> CreateNetworkProfile
s {$sel:nextPassword:CreateNetworkProfile' :: Maybe (Sensitive Text)
nextPassword = Maybe (Sensitive Text)
a} :: CreateNetworkProfile) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall a. Iso' (Sensitive a) a
Data._Sensitive

-- | The tags to be added to the specified resource. Do not provide system
-- tags.
createNetworkProfile_tags :: Lens.Lens' CreateNetworkProfile (Prelude.Maybe [Tag])
createNetworkProfile_tags :: Lens' CreateNetworkProfile (Maybe [Tag])
createNetworkProfile_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateNetworkProfile' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateNetworkProfile' :: CreateNetworkProfile -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateNetworkProfile
s@CreateNetworkProfile' {} Maybe [Tag]
a -> CreateNetworkProfile
s {$sel:tags:CreateNetworkProfile' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateNetworkProfile) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

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

-- | The SSID of the Wi-Fi network.
createNetworkProfile_ssid :: Lens.Lens' CreateNetworkProfile Prelude.Text
createNetworkProfile_ssid :: Lens' CreateNetworkProfile Text
createNetworkProfile_ssid = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateNetworkProfile' {Text
ssid :: Text
$sel:ssid:CreateNetworkProfile' :: CreateNetworkProfile -> Text
ssid} -> Text
ssid) (\s :: CreateNetworkProfile
s@CreateNetworkProfile' {} Text
a -> CreateNetworkProfile
s {$sel:ssid:CreateNetworkProfile' :: Text
ssid = Text
a} :: CreateNetworkProfile)

-- | The security type of the Wi-Fi network. This can be WPA2_ENTERPRISE,
-- WPA2_PSK, WPA_PSK, WEP, or OPEN.
createNetworkProfile_securityType :: Lens.Lens' CreateNetworkProfile NetworkSecurityType
createNetworkProfile_securityType :: Lens' CreateNetworkProfile NetworkSecurityType
createNetworkProfile_securityType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateNetworkProfile' {NetworkSecurityType
securityType :: NetworkSecurityType
$sel:securityType:CreateNetworkProfile' :: CreateNetworkProfile -> NetworkSecurityType
securityType} -> NetworkSecurityType
securityType) (\s :: CreateNetworkProfile
s@CreateNetworkProfile' {} NetworkSecurityType
a -> CreateNetworkProfile
s {$sel:securityType:CreateNetworkProfile' :: NetworkSecurityType
securityType = NetworkSecurityType
a} :: CreateNetworkProfile)

-- | Undocumented member.
createNetworkProfile_clientRequestToken :: Lens.Lens' CreateNetworkProfile Prelude.Text
createNetworkProfile_clientRequestToken :: Lens' CreateNetworkProfile Text
createNetworkProfile_clientRequestToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateNetworkProfile' {Text
clientRequestToken :: Text
$sel:clientRequestToken:CreateNetworkProfile' :: CreateNetworkProfile -> Text
clientRequestToken} -> Text
clientRequestToken) (\s :: CreateNetworkProfile
s@CreateNetworkProfile' {} Text
a -> CreateNetworkProfile
s {$sel:clientRequestToken:CreateNetworkProfile' :: Text
clientRequestToken = Text
a} :: CreateNetworkProfile)

instance Core.AWSRequest CreateNetworkProfile where
  type
    AWSResponse CreateNetworkProfile =
      CreateNetworkProfileResponse
  request :: (Service -> Service)
-> CreateNetworkProfile -> Request CreateNetworkProfile
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy CreateNetworkProfile
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateNetworkProfile)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text -> Int -> CreateNetworkProfileResponse
CreateNetworkProfileResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"NetworkProfileArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable CreateNetworkProfile where
  hashWithSalt :: Int -> CreateNetworkProfile -> Int
hashWithSalt Int
_salt CreateNetworkProfile' {Maybe [Tag]
Maybe (NonEmpty Text)
Maybe Text
Maybe (Sensitive Text)
Maybe NetworkEapMethod
Text
NetworkSecurityType
clientRequestToken :: Text
securityType :: NetworkSecurityType
ssid :: Text
networkProfileName :: Text
trustAnchors :: Maybe (NonEmpty Text)
tags :: Maybe [Tag]
nextPassword :: Maybe (Sensitive Text)
eapMethod :: Maybe NetworkEapMethod
description :: Maybe Text
currentPassword :: Maybe (Sensitive Text)
certificateAuthorityArn :: Maybe Text
$sel:clientRequestToken:CreateNetworkProfile' :: CreateNetworkProfile -> Text
$sel:securityType:CreateNetworkProfile' :: CreateNetworkProfile -> NetworkSecurityType
$sel:ssid:CreateNetworkProfile' :: CreateNetworkProfile -> Text
$sel:networkProfileName:CreateNetworkProfile' :: CreateNetworkProfile -> Text
$sel:trustAnchors:CreateNetworkProfile' :: CreateNetworkProfile -> Maybe (NonEmpty Text)
$sel:tags:CreateNetworkProfile' :: CreateNetworkProfile -> Maybe [Tag]
$sel:nextPassword:CreateNetworkProfile' :: CreateNetworkProfile -> Maybe (Sensitive Text)
$sel:eapMethod:CreateNetworkProfile' :: CreateNetworkProfile -> Maybe NetworkEapMethod
$sel:description:CreateNetworkProfile' :: CreateNetworkProfile -> Maybe Text
$sel:currentPassword:CreateNetworkProfile' :: CreateNetworkProfile -> Maybe (Sensitive Text)
$sel:certificateAuthorityArn:CreateNetworkProfile' :: CreateNetworkProfile -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
certificateAuthorityArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
currentPassword
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe NetworkEapMethod
eapMethod
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
nextPassword
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Tag]
tags
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty Text)
trustAnchors
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
networkProfileName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
ssid
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` NetworkSecurityType
securityType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
clientRequestToken

instance Prelude.NFData CreateNetworkProfile where
  rnf :: CreateNetworkProfile -> ()
rnf CreateNetworkProfile' {Maybe [Tag]
Maybe (NonEmpty Text)
Maybe Text
Maybe (Sensitive Text)
Maybe NetworkEapMethod
Text
NetworkSecurityType
clientRequestToken :: Text
securityType :: NetworkSecurityType
ssid :: Text
networkProfileName :: Text
trustAnchors :: Maybe (NonEmpty Text)
tags :: Maybe [Tag]
nextPassword :: Maybe (Sensitive Text)
eapMethod :: Maybe NetworkEapMethod
description :: Maybe Text
currentPassword :: Maybe (Sensitive Text)
certificateAuthorityArn :: Maybe Text
$sel:clientRequestToken:CreateNetworkProfile' :: CreateNetworkProfile -> Text
$sel:securityType:CreateNetworkProfile' :: CreateNetworkProfile -> NetworkSecurityType
$sel:ssid:CreateNetworkProfile' :: CreateNetworkProfile -> Text
$sel:networkProfileName:CreateNetworkProfile' :: CreateNetworkProfile -> Text
$sel:trustAnchors:CreateNetworkProfile' :: CreateNetworkProfile -> Maybe (NonEmpty Text)
$sel:tags:CreateNetworkProfile' :: CreateNetworkProfile -> Maybe [Tag]
$sel:nextPassword:CreateNetworkProfile' :: CreateNetworkProfile -> Maybe (Sensitive Text)
$sel:eapMethod:CreateNetworkProfile' :: CreateNetworkProfile -> Maybe NetworkEapMethod
$sel:description:CreateNetworkProfile' :: CreateNetworkProfile -> Maybe Text
$sel:currentPassword:CreateNetworkProfile' :: CreateNetworkProfile -> Maybe (Sensitive Text)
$sel:certificateAuthorityArn:CreateNetworkProfile' :: CreateNetworkProfile -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
certificateAuthorityArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
currentPassword
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe NetworkEapMethod
eapMethod
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
nextPassword
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Tag]
tags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty Text)
trustAnchors
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
networkProfileName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
ssid
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf NetworkSecurityType
securityType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
clientRequestToken

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

instance Data.ToJSON CreateNetworkProfile where
  toJSON :: CreateNetworkProfile -> Value
toJSON CreateNetworkProfile' {Maybe [Tag]
Maybe (NonEmpty Text)
Maybe Text
Maybe (Sensitive Text)
Maybe NetworkEapMethod
Text
NetworkSecurityType
clientRequestToken :: Text
securityType :: NetworkSecurityType
ssid :: Text
networkProfileName :: Text
trustAnchors :: Maybe (NonEmpty Text)
tags :: Maybe [Tag]
nextPassword :: Maybe (Sensitive Text)
eapMethod :: Maybe NetworkEapMethod
description :: Maybe Text
currentPassword :: Maybe (Sensitive Text)
certificateAuthorityArn :: Maybe Text
$sel:clientRequestToken:CreateNetworkProfile' :: CreateNetworkProfile -> Text
$sel:securityType:CreateNetworkProfile' :: CreateNetworkProfile -> NetworkSecurityType
$sel:ssid:CreateNetworkProfile' :: CreateNetworkProfile -> Text
$sel:networkProfileName:CreateNetworkProfile' :: CreateNetworkProfile -> Text
$sel:trustAnchors:CreateNetworkProfile' :: CreateNetworkProfile -> Maybe (NonEmpty Text)
$sel:tags:CreateNetworkProfile' :: CreateNetworkProfile -> Maybe [Tag]
$sel:nextPassword:CreateNetworkProfile' :: CreateNetworkProfile -> Maybe (Sensitive Text)
$sel:eapMethod:CreateNetworkProfile' :: CreateNetworkProfile -> Maybe NetworkEapMethod
$sel:description:CreateNetworkProfile' :: CreateNetworkProfile -> Maybe Text
$sel:currentPassword:CreateNetworkProfile' :: CreateNetworkProfile -> Maybe (Sensitive Text)
$sel:certificateAuthorityArn:CreateNetworkProfile' :: CreateNetworkProfile -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"CertificateAuthorityArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
certificateAuthorityArn,
            (Key
"CurrentPassword" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive Text)
currentPassword,
            (Key
"Description" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
description,
            (Key
"EapMethod" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe NetworkEapMethod
eapMethod,
            (Key
"NextPassword" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive Text)
nextPassword,
            (Key
"Tags" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags,
            (Key
"TrustAnchors" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty Text)
trustAnchors,
            forall a. a -> Maybe a
Prelude.Just
              (Key
"NetworkProfileName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
networkProfileName),
            forall a. a -> Maybe a
Prelude.Just (Key
"Ssid" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
ssid),
            forall a. a -> Maybe a
Prelude.Just (Key
"SecurityType" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= NetworkSecurityType
securityType),
            forall a. a -> Maybe a
Prelude.Just
              (Key
"ClientRequestToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
clientRequestToken)
          ]
      )

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

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

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

-- |
-- Create a value of 'CreateNetworkProfileResponse' 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:
--
-- 'networkProfileArn', 'createNetworkProfileResponse_networkProfileArn' - The ARN of the network profile associated with a device.
--
-- 'httpStatus', 'createNetworkProfileResponse_httpStatus' - The response's http status code.
newCreateNetworkProfileResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateNetworkProfileResponse
newCreateNetworkProfileResponse :: Int -> CreateNetworkProfileResponse
newCreateNetworkProfileResponse Int
pHttpStatus_ =
  CreateNetworkProfileResponse'
    { $sel:networkProfileArn:CreateNetworkProfileResponse' :: Maybe Text
networkProfileArn =
        forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateNetworkProfileResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

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

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

instance Prelude.NFData CreateNetworkProfileResponse where
  rnf :: CreateNetworkProfileResponse -> ()
rnf CreateNetworkProfileResponse' {Int
Maybe Text
httpStatus :: Int
networkProfileArn :: Maybe Text
$sel:httpStatus:CreateNetworkProfileResponse' :: CreateNetworkProfileResponse -> Int
$sel:networkProfileArn:CreateNetworkProfileResponse' :: CreateNetworkProfileResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
networkProfileArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus