{-# 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.CreateProfile
-- 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)
--
-- Creates a new room profile with the specified details.
module Amazonka.AlexaBusiness.CreateProfile
  ( -- * Creating a Request
    CreateProfile (..),
    newCreateProfile,

    -- * Request Lenses
    createProfile_setupModeDisabled,
    createProfile_pSTNEnabled,
    createProfile_locale,
    createProfile_meetingRoomConfiguration,
    createProfile_dataRetentionOptIn,
    createProfile_clientRequestToken,
    createProfile_maxVolumeLimit,
    createProfile_tags,
    createProfile_profileName,
    createProfile_timezone,
    createProfile_address,
    createProfile_distanceUnit,
    createProfile_temperatureUnit,
    createProfile_wakeWord,

    -- * Destructuring the Response
    CreateProfileResponse (..),
    newCreateProfileResponse,

    -- * Response Lenses
    createProfileResponse_profileArn,
    createProfileResponse_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:/ 'newCreateProfile' smart constructor.
data CreateProfile = CreateProfile'
  { -- | Whether room profile setup is enabled.
    CreateProfile -> Maybe Bool
setupModeDisabled :: Prelude.Maybe Prelude.Bool,
    -- | Whether PSTN calling is enabled.
    CreateProfile -> Maybe Bool
pSTNEnabled :: Prelude.Maybe Prelude.Bool,
    -- | The locale of the room profile. (This is currently only available to a
    -- limited preview audience.)
    CreateProfile -> Maybe Text
locale :: Prelude.Maybe Prelude.Text,
    -- | The meeting room settings of a room profile.
    CreateProfile -> Maybe CreateMeetingRoomConfiguration
meetingRoomConfiguration :: Prelude.Maybe CreateMeetingRoomConfiguration,
    -- | Whether data retention of the profile is enabled.
    CreateProfile -> Maybe Bool
dataRetentionOptIn :: Prelude.Maybe Prelude.Bool,
    -- | The user-specified token that is used during the creation of a profile.
    CreateProfile -> Maybe Text
clientRequestToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum volume limit for a room profile.
    CreateProfile -> Maybe Int
maxVolumeLimit :: Prelude.Maybe Prelude.Int,
    -- | The tags for the profile.
    CreateProfile -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | The name of a room profile.
    CreateProfile -> Text
profileName :: Prelude.Text,
    -- | The time zone used by a room profile.
    CreateProfile -> Text
timezone :: Prelude.Text,
    -- | The valid address for the room.
    CreateProfile -> Text
address :: Prelude.Text,
    -- | The distance unit to be used by devices in the profile.
    CreateProfile -> DistanceUnit
distanceUnit :: DistanceUnit,
    -- | The temperature unit to be used by devices in the profile.
    CreateProfile -> TemperatureUnit
temperatureUnit :: TemperatureUnit,
    -- | A wake word for Alexa, Echo, Amazon, or a computer.
    CreateProfile -> WakeWord
wakeWord :: WakeWord
  }
  deriving (CreateProfile -> CreateProfile -> Bool
(CreateProfile -> CreateProfile -> Bool)
-> (CreateProfile -> CreateProfile -> Bool) -> Eq CreateProfile
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateProfile -> CreateProfile -> Bool
$c/= :: CreateProfile -> CreateProfile -> Bool
== :: CreateProfile -> CreateProfile -> Bool
$c== :: CreateProfile -> CreateProfile -> Bool
Prelude.Eq, ReadPrec [CreateProfile]
ReadPrec CreateProfile
Int -> ReadS CreateProfile
ReadS [CreateProfile]
(Int -> ReadS CreateProfile)
-> ReadS [CreateProfile]
-> ReadPrec CreateProfile
-> ReadPrec [CreateProfile]
-> Read CreateProfile
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateProfile]
$creadListPrec :: ReadPrec [CreateProfile]
readPrec :: ReadPrec CreateProfile
$creadPrec :: ReadPrec CreateProfile
readList :: ReadS [CreateProfile]
$creadList :: ReadS [CreateProfile]
readsPrec :: Int -> ReadS CreateProfile
$creadsPrec :: Int -> ReadS CreateProfile
Prelude.Read, Int -> CreateProfile -> ShowS
[CreateProfile] -> ShowS
CreateProfile -> String
(Int -> CreateProfile -> ShowS)
-> (CreateProfile -> String)
-> ([CreateProfile] -> ShowS)
-> Show CreateProfile
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateProfile] -> ShowS
$cshowList :: [CreateProfile] -> ShowS
show :: CreateProfile -> String
$cshow :: CreateProfile -> String
showsPrec :: Int -> CreateProfile -> ShowS
$cshowsPrec :: Int -> CreateProfile -> ShowS
Prelude.Show, (forall x. CreateProfile -> Rep CreateProfile x)
-> (forall x. Rep CreateProfile x -> CreateProfile)
-> Generic CreateProfile
forall x. Rep CreateProfile x -> CreateProfile
forall x. CreateProfile -> Rep CreateProfile x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateProfile x -> CreateProfile
$cfrom :: forall x. CreateProfile -> Rep CreateProfile x
Prelude.Generic)

-- |
-- Create a value of 'CreateProfile' 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:
--
-- 'setupModeDisabled', 'createProfile_setupModeDisabled' - Whether room profile setup is enabled.
--
-- 'pSTNEnabled', 'createProfile_pSTNEnabled' - Whether PSTN calling is enabled.
--
-- 'locale', 'createProfile_locale' - The locale of the room profile. (This is currently only available to a
-- limited preview audience.)
--
-- 'meetingRoomConfiguration', 'createProfile_meetingRoomConfiguration' - The meeting room settings of a room profile.
--
-- 'dataRetentionOptIn', 'createProfile_dataRetentionOptIn' - Whether data retention of the profile is enabled.
--
-- 'clientRequestToken', 'createProfile_clientRequestToken' - The user-specified token that is used during the creation of a profile.
--
-- 'maxVolumeLimit', 'createProfile_maxVolumeLimit' - The maximum volume limit for a room profile.
--
-- 'tags', 'createProfile_tags' - The tags for the profile.
--
-- 'profileName', 'createProfile_profileName' - The name of a room profile.
--
-- 'timezone', 'createProfile_timezone' - The time zone used by a room profile.
--
-- 'address', 'createProfile_address' - The valid address for the room.
--
-- 'distanceUnit', 'createProfile_distanceUnit' - The distance unit to be used by devices in the profile.
--
-- 'temperatureUnit', 'createProfile_temperatureUnit' - The temperature unit to be used by devices in the profile.
--
-- 'wakeWord', 'createProfile_wakeWord' - A wake word for Alexa, Echo, Amazon, or a computer.
newCreateProfile ::
  -- | 'profileName'
  Prelude.Text ->
  -- | 'timezone'
  Prelude.Text ->
  -- | 'address'
  Prelude.Text ->
  -- | 'distanceUnit'
  DistanceUnit ->
  -- | 'temperatureUnit'
  TemperatureUnit ->
  -- | 'wakeWord'
  WakeWord ->
  CreateProfile
newCreateProfile :: Text
-> Text
-> Text
-> DistanceUnit
-> TemperatureUnit
-> WakeWord
-> CreateProfile
newCreateProfile
  Text
pProfileName_
  Text
pTimezone_
  Text
pAddress_
  DistanceUnit
pDistanceUnit_
  TemperatureUnit
pTemperatureUnit_
  WakeWord
pWakeWord_ =
    CreateProfile' :: Maybe Bool
-> Maybe Bool
-> Maybe Text
-> Maybe CreateMeetingRoomConfiguration
-> Maybe Bool
-> Maybe Text
-> Maybe Int
-> Maybe [Tag]
-> Text
-> Text
-> Text
-> DistanceUnit
-> TemperatureUnit
-> WakeWord
-> CreateProfile
CreateProfile'
      { $sel:setupModeDisabled:CreateProfile' :: Maybe Bool
setupModeDisabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
        $sel:pSTNEnabled:CreateProfile' :: Maybe Bool
pSTNEnabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
        $sel:locale:CreateProfile' :: Maybe Text
locale = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:meetingRoomConfiguration:CreateProfile' :: Maybe CreateMeetingRoomConfiguration
meetingRoomConfiguration = Maybe CreateMeetingRoomConfiguration
forall a. Maybe a
Prelude.Nothing,
        $sel:dataRetentionOptIn:CreateProfile' :: Maybe Bool
dataRetentionOptIn = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
        $sel:clientRequestToken:CreateProfile' :: Maybe Text
clientRequestToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:maxVolumeLimit:CreateProfile' :: Maybe Int
maxVolumeLimit = Maybe Int
forall a. Maybe a
Prelude.Nothing,
        $sel:tags:CreateProfile' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
        $sel:profileName:CreateProfile' :: Text
profileName = Text
pProfileName_,
        $sel:timezone:CreateProfile' :: Text
timezone = Text
pTimezone_,
        $sel:address:CreateProfile' :: Text
address = Text
pAddress_,
        $sel:distanceUnit:CreateProfile' :: DistanceUnit
distanceUnit = DistanceUnit
pDistanceUnit_,
        $sel:temperatureUnit:CreateProfile' :: TemperatureUnit
temperatureUnit = TemperatureUnit
pTemperatureUnit_,
        $sel:wakeWord:CreateProfile' :: WakeWord
wakeWord = WakeWord
pWakeWord_
      }

-- | Whether room profile setup is enabled.
createProfile_setupModeDisabled :: Lens.Lens' CreateProfile (Prelude.Maybe Prelude.Bool)
createProfile_setupModeDisabled :: (Maybe Bool -> f (Maybe Bool)) -> CreateProfile -> f CreateProfile
createProfile_setupModeDisabled = (CreateProfile -> Maybe Bool)
-> (CreateProfile -> Maybe Bool -> CreateProfile)
-> Lens CreateProfile CreateProfile (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateProfile' {Maybe Bool
setupModeDisabled :: Maybe Bool
$sel:setupModeDisabled:CreateProfile' :: CreateProfile -> Maybe Bool
setupModeDisabled} -> Maybe Bool
setupModeDisabled) (\s :: CreateProfile
s@CreateProfile' {} Maybe Bool
a -> CreateProfile
s {$sel:setupModeDisabled:CreateProfile' :: Maybe Bool
setupModeDisabled = Maybe Bool
a} :: CreateProfile)

-- | Whether PSTN calling is enabled.
createProfile_pSTNEnabled :: Lens.Lens' CreateProfile (Prelude.Maybe Prelude.Bool)
createProfile_pSTNEnabled :: (Maybe Bool -> f (Maybe Bool)) -> CreateProfile -> f CreateProfile
createProfile_pSTNEnabled = (CreateProfile -> Maybe Bool)
-> (CreateProfile -> Maybe Bool -> CreateProfile)
-> Lens CreateProfile CreateProfile (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateProfile' {Maybe Bool
pSTNEnabled :: Maybe Bool
$sel:pSTNEnabled:CreateProfile' :: CreateProfile -> Maybe Bool
pSTNEnabled} -> Maybe Bool
pSTNEnabled) (\s :: CreateProfile
s@CreateProfile' {} Maybe Bool
a -> CreateProfile
s {$sel:pSTNEnabled:CreateProfile' :: Maybe Bool
pSTNEnabled = Maybe Bool
a} :: CreateProfile)

-- | The locale of the room profile. (This is currently only available to a
-- limited preview audience.)
createProfile_locale :: Lens.Lens' CreateProfile (Prelude.Maybe Prelude.Text)
createProfile_locale :: (Maybe Text -> f (Maybe Text)) -> CreateProfile -> f CreateProfile
createProfile_locale = (CreateProfile -> Maybe Text)
-> (CreateProfile -> Maybe Text -> CreateProfile)
-> Lens CreateProfile CreateProfile (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateProfile' {Maybe Text
locale :: Maybe Text
$sel:locale:CreateProfile' :: CreateProfile -> Maybe Text
locale} -> Maybe Text
locale) (\s :: CreateProfile
s@CreateProfile' {} Maybe Text
a -> CreateProfile
s {$sel:locale:CreateProfile' :: Maybe Text
locale = Maybe Text
a} :: CreateProfile)

-- | The meeting room settings of a room profile.
createProfile_meetingRoomConfiguration :: Lens.Lens' CreateProfile (Prelude.Maybe CreateMeetingRoomConfiguration)
createProfile_meetingRoomConfiguration :: (Maybe CreateMeetingRoomConfiguration
 -> f (Maybe CreateMeetingRoomConfiguration))
-> CreateProfile -> f CreateProfile
createProfile_meetingRoomConfiguration = (CreateProfile -> Maybe CreateMeetingRoomConfiguration)
-> (CreateProfile
    -> Maybe CreateMeetingRoomConfiguration -> CreateProfile)
-> Lens
     CreateProfile
     CreateProfile
     (Maybe CreateMeetingRoomConfiguration)
     (Maybe CreateMeetingRoomConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateProfile' {Maybe CreateMeetingRoomConfiguration
meetingRoomConfiguration :: Maybe CreateMeetingRoomConfiguration
$sel:meetingRoomConfiguration:CreateProfile' :: CreateProfile -> Maybe CreateMeetingRoomConfiguration
meetingRoomConfiguration} -> Maybe CreateMeetingRoomConfiguration
meetingRoomConfiguration) (\s :: CreateProfile
s@CreateProfile' {} Maybe CreateMeetingRoomConfiguration
a -> CreateProfile
s {$sel:meetingRoomConfiguration:CreateProfile' :: Maybe CreateMeetingRoomConfiguration
meetingRoomConfiguration = Maybe CreateMeetingRoomConfiguration
a} :: CreateProfile)

-- | Whether data retention of the profile is enabled.
createProfile_dataRetentionOptIn :: Lens.Lens' CreateProfile (Prelude.Maybe Prelude.Bool)
createProfile_dataRetentionOptIn :: (Maybe Bool -> f (Maybe Bool)) -> CreateProfile -> f CreateProfile
createProfile_dataRetentionOptIn = (CreateProfile -> Maybe Bool)
-> (CreateProfile -> Maybe Bool -> CreateProfile)
-> Lens CreateProfile CreateProfile (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateProfile' {Maybe Bool
dataRetentionOptIn :: Maybe Bool
$sel:dataRetentionOptIn:CreateProfile' :: CreateProfile -> Maybe Bool
dataRetentionOptIn} -> Maybe Bool
dataRetentionOptIn) (\s :: CreateProfile
s@CreateProfile' {} Maybe Bool
a -> CreateProfile
s {$sel:dataRetentionOptIn:CreateProfile' :: Maybe Bool
dataRetentionOptIn = Maybe Bool
a} :: CreateProfile)

-- | The user-specified token that is used during the creation of a profile.
createProfile_clientRequestToken :: Lens.Lens' CreateProfile (Prelude.Maybe Prelude.Text)
createProfile_clientRequestToken :: (Maybe Text -> f (Maybe Text)) -> CreateProfile -> f CreateProfile
createProfile_clientRequestToken = (CreateProfile -> Maybe Text)
-> (CreateProfile -> Maybe Text -> CreateProfile)
-> Lens CreateProfile CreateProfile (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateProfile' {Maybe Text
clientRequestToken :: Maybe Text
$sel:clientRequestToken:CreateProfile' :: CreateProfile -> Maybe Text
clientRequestToken} -> Maybe Text
clientRequestToken) (\s :: CreateProfile
s@CreateProfile' {} Maybe Text
a -> CreateProfile
s {$sel:clientRequestToken:CreateProfile' :: Maybe Text
clientRequestToken = Maybe Text
a} :: CreateProfile)

-- | The maximum volume limit for a room profile.
createProfile_maxVolumeLimit :: Lens.Lens' CreateProfile (Prelude.Maybe Prelude.Int)
createProfile_maxVolumeLimit :: (Maybe Int -> f (Maybe Int)) -> CreateProfile -> f CreateProfile
createProfile_maxVolumeLimit = (CreateProfile -> Maybe Int)
-> (CreateProfile -> Maybe Int -> CreateProfile)
-> Lens CreateProfile CreateProfile (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateProfile' {Maybe Int
maxVolumeLimit :: Maybe Int
$sel:maxVolumeLimit:CreateProfile' :: CreateProfile -> Maybe Int
maxVolumeLimit} -> Maybe Int
maxVolumeLimit) (\s :: CreateProfile
s@CreateProfile' {} Maybe Int
a -> CreateProfile
s {$sel:maxVolumeLimit:CreateProfile' :: Maybe Int
maxVolumeLimit = Maybe Int
a} :: CreateProfile)

-- | The tags for the profile.
createProfile_tags :: Lens.Lens' CreateProfile (Prelude.Maybe [Tag])
createProfile_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateProfile -> f CreateProfile
createProfile_tags = (CreateProfile -> Maybe [Tag])
-> (CreateProfile -> Maybe [Tag] -> CreateProfile)
-> Lens CreateProfile CreateProfile (Maybe [Tag]) (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateProfile' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateProfile' :: CreateProfile -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateProfile
s@CreateProfile' {} Maybe [Tag]
a -> CreateProfile
s {$sel:tags:CreateProfile' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateProfile) ((Maybe [Tag] -> f (Maybe [Tag]))
 -> CreateProfile -> f CreateProfile)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
    -> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateProfile
-> f CreateProfile
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Tag] [Tag] [Tag] [Tag]
-> Iso (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag])
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 [Tag] [Tag] [Tag] [Tag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The name of a room profile.
createProfile_profileName :: Lens.Lens' CreateProfile Prelude.Text
createProfile_profileName :: (Text -> f Text) -> CreateProfile -> f CreateProfile
createProfile_profileName = (CreateProfile -> Text)
-> (CreateProfile -> Text -> CreateProfile)
-> Lens CreateProfile CreateProfile Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateProfile' {Text
profileName :: Text
$sel:profileName:CreateProfile' :: CreateProfile -> Text
profileName} -> Text
profileName) (\s :: CreateProfile
s@CreateProfile' {} Text
a -> CreateProfile
s {$sel:profileName:CreateProfile' :: Text
profileName = Text
a} :: CreateProfile)

-- | The time zone used by a room profile.
createProfile_timezone :: Lens.Lens' CreateProfile Prelude.Text
createProfile_timezone :: (Text -> f Text) -> CreateProfile -> f CreateProfile
createProfile_timezone = (CreateProfile -> Text)
-> (CreateProfile -> Text -> CreateProfile)
-> Lens CreateProfile CreateProfile Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateProfile' {Text
timezone :: Text
$sel:timezone:CreateProfile' :: CreateProfile -> Text
timezone} -> Text
timezone) (\s :: CreateProfile
s@CreateProfile' {} Text
a -> CreateProfile
s {$sel:timezone:CreateProfile' :: Text
timezone = Text
a} :: CreateProfile)

-- | The valid address for the room.
createProfile_address :: Lens.Lens' CreateProfile Prelude.Text
createProfile_address :: (Text -> f Text) -> CreateProfile -> f CreateProfile
createProfile_address = (CreateProfile -> Text)
-> (CreateProfile -> Text -> CreateProfile)
-> Lens CreateProfile CreateProfile Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateProfile' {Text
address :: Text
$sel:address:CreateProfile' :: CreateProfile -> Text
address} -> Text
address) (\s :: CreateProfile
s@CreateProfile' {} Text
a -> CreateProfile
s {$sel:address:CreateProfile' :: Text
address = Text
a} :: CreateProfile)

-- | The distance unit to be used by devices in the profile.
createProfile_distanceUnit :: Lens.Lens' CreateProfile DistanceUnit
createProfile_distanceUnit :: (DistanceUnit -> f DistanceUnit)
-> CreateProfile -> f CreateProfile
createProfile_distanceUnit = (CreateProfile -> DistanceUnit)
-> (CreateProfile -> DistanceUnit -> CreateProfile)
-> Lens CreateProfile CreateProfile DistanceUnit DistanceUnit
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateProfile' {DistanceUnit
distanceUnit :: DistanceUnit
$sel:distanceUnit:CreateProfile' :: CreateProfile -> DistanceUnit
distanceUnit} -> DistanceUnit
distanceUnit) (\s :: CreateProfile
s@CreateProfile' {} DistanceUnit
a -> CreateProfile
s {$sel:distanceUnit:CreateProfile' :: DistanceUnit
distanceUnit = DistanceUnit
a} :: CreateProfile)

-- | The temperature unit to be used by devices in the profile.
createProfile_temperatureUnit :: Lens.Lens' CreateProfile TemperatureUnit
createProfile_temperatureUnit :: (TemperatureUnit -> f TemperatureUnit)
-> CreateProfile -> f CreateProfile
createProfile_temperatureUnit = (CreateProfile -> TemperatureUnit)
-> (CreateProfile -> TemperatureUnit -> CreateProfile)
-> Lens CreateProfile CreateProfile TemperatureUnit TemperatureUnit
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateProfile' {TemperatureUnit
temperatureUnit :: TemperatureUnit
$sel:temperatureUnit:CreateProfile' :: CreateProfile -> TemperatureUnit
temperatureUnit} -> TemperatureUnit
temperatureUnit) (\s :: CreateProfile
s@CreateProfile' {} TemperatureUnit
a -> CreateProfile
s {$sel:temperatureUnit:CreateProfile' :: TemperatureUnit
temperatureUnit = TemperatureUnit
a} :: CreateProfile)

-- | A wake word for Alexa, Echo, Amazon, or a computer.
createProfile_wakeWord :: Lens.Lens' CreateProfile WakeWord
createProfile_wakeWord :: (WakeWord -> f WakeWord) -> CreateProfile -> f CreateProfile
createProfile_wakeWord = (CreateProfile -> WakeWord)
-> (CreateProfile -> WakeWord -> CreateProfile)
-> Lens CreateProfile CreateProfile WakeWord WakeWord
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateProfile' {WakeWord
wakeWord :: WakeWord
$sel:wakeWord:CreateProfile' :: CreateProfile -> WakeWord
wakeWord} -> WakeWord
wakeWord) (\s :: CreateProfile
s@CreateProfile' {} WakeWord
a -> CreateProfile
s {$sel:wakeWord:CreateProfile' :: WakeWord
wakeWord = WakeWord
a} :: CreateProfile)

instance Core.AWSRequest CreateProfile where
  type
    AWSResponse CreateProfile =
      CreateProfileResponse
  request :: CreateProfile -> Request CreateProfile
request = Service -> CreateProfile -> Request CreateProfile
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateProfile
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateProfile)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateProfile))
-> Logger
-> Service
-> Proxy CreateProfile
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateProfile)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text -> Int -> CreateProfileResponse
CreateProfileResponse'
            (Maybe Text -> Int -> CreateProfileResponse)
-> Either String (Maybe Text)
-> Either String (Int -> CreateProfileResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ProfileArn")
            Either String (Int -> CreateProfileResponse)
-> Either String Int -> Either String CreateProfileResponse
forall (f :: * -> *) a b. Applicative f => 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 CreateProfile

instance Prelude.NFData CreateProfile

instance Core.ToHeaders CreateProfile where
  toHeaders :: CreateProfile -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateProfile -> 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.CreateProfile" ::
                          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 CreateProfile where
  toJSON :: CreateProfile -> Value
toJSON CreateProfile' {Maybe Bool
Maybe Int
Maybe [Tag]
Maybe Text
Maybe CreateMeetingRoomConfiguration
Text
DistanceUnit
TemperatureUnit
WakeWord
wakeWord :: WakeWord
temperatureUnit :: TemperatureUnit
distanceUnit :: DistanceUnit
address :: Text
timezone :: Text
profileName :: Text
tags :: Maybe [Tag]
maxVolumeLimit :: Maybe Int
clientRequestToken :: Maybe Text
dataRetentionOptIn :: Maybe Bool
meetingRoomConfiguration :: Maybe CreateMeetingRoomConfiguration
locale :: Maybe Text
pSTNEnabled :: Maybe Bool
setupModeDisabled :: Maybe Bool
$sel:wakeWord:CreateProfile' :: CreateProfile -> WakeWord
$sel:temperatureUnit:CreateProfile' :: CreateProfile -> TemperatureUnit
$sel:distanceUnit:CreateProfile' :: CreateProfile -> DistanceUnit
$sel:address:CreateProfile' :: CreateProfile -> Text
$sel:timezone:CreateProfile' :: CreateProfile -> Text
$sel:profileName:CreateProfile' :: CreateProfile -> Text
$sel:tags:CreateProfile' :: CreateProfile -> Maybe [Tag]
$sel:maxVolumeLimit:CreateProfile' :: CreateProfile -> Maybe Int
$sel:clientRequestToken:CreateProfile' :: CreateProfile -> Maybe Text
$sel:dataRetentionOptIn:CreateProfile' :: CreateProfile -> Maybe Bool
$sel:meetingRoomConfiguration:CreateProfile' :: CreateProfile -> Maybe CreateMeetingRoomConfiguration
$sel:locale:CreateProfile' :: CreateProfile -> Maybe Text
$sel:pSTNEnabled:CreateProfile' :: CreateProfile -> Maybe Bool
$sel:setupModeDisabled:CreateProfile' :: CreateProfile -> Maybe Bool
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"SetupModeDisabled" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
setupModeDisabled,
            (Text
"PSTNEnabled" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
pSTNEnabled,
            (Text
"Locale" 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
locale,
            (Text
"MeetingRoomConfiguration" Text -> CreateMeetingRoomConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (CreateMeetingRoomConfiguration -> Pair)
-> Maybe CreateMeetingRoomConfiguration -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe CreateMeetingRoomConfiguration
meetingRoomConfiguration,
            (Text
"DataRetentionOptIn" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
dataRetentionOptIn,
            (Text
"ClientRequestToken" 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
clientRequestToken,
            (Text
"MaxVolumeLimit" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
maxVolumeLimit,
            (Text
"Tags" Text -> [Tag] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Tag] -> Pair) -> Maybe [Tag] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ProfileName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
profileName),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Timezone" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
timezone),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Address" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
address),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"DistanceUnit" Text -> DistanceUnit -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= DistanceUnit
distanceUnit),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"TemperatureUnit" Text -> TemperatureUnit -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= TemperatureUnit
temperatureUnit),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"WakeWord" Text -> WakeWord -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= WakeWord
wakeWord)
          ]
      )

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

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

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

-- |
-- Create a value of 'CreateProfileResponse' 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:
--
-- 'profileArn', 'createProfileResponse_profileArn' - The ARN of the newly created room profile in the response.
--
-- 'httpStatus', 'createProfileResponse_httpStatus' - The response's http status code.
newCreateProfileResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateProfileResponse
newCreateProfileResponse :: Int -> CreateProfileResponse
newCreateProfileResponse Int
pHttpStatus_ =
  CreateProfileResponse' :: Maybe Text -> Int -> CreateProfileResponse
CreateProfileResponse'
    { $sel:profileArn:CreateProfileResponse' :: Maybe Text
profileArn =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateProfileResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The ARN of the newly created room profile in the response.
createProfileResponse_profileArn :: Lens.Lens' CreateProfileResponse (Prelude.Maybe Prelude.Text)
createProfileResponse_profileArn :: (Maybe Text -> f (Maybe Text))
-> CreateProfileResponse -> f CreateProfileResponse
createProfileResponse_profileArn = (CreateProfileResponse -> Maybe Text)
-> (CreateProfileResponse -> Maybe Text -> CreateProfileResponse)
-> Lens
     CreateProfileResponse
     CreateProfileResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateProfileResponse' {Maybe Text
profileArn :: Maybe Text
$sel:profileArn:CreateProfileResponse' :: CreateProfileResponse -> Maybe Text
profileArn} -> Maybe Text
profileArn) (\s :: CreateProfileResponse
s@CreateProfileResponse' {} Maybe Text
a -> CreateProfileResponse
s {$sel:profileArn:CreateProfileResponse' :: Maybe Text
profileArn = Maybe Text
a} :: CreateProfileResponse)

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

instance Prelude.NFData CreateProfileResponse