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

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

-- |
-- Module      : Amazonka.Chime.Types.AlexaForBusinessMetadata
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Chime.Types.AlexaForBusinessMetadata where

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

-- | The Alexa for Business metadata associated with an Amazon Chime user,
-- used to integrate Alexa for Business with a device.
--
-- /See:/ 'newAlexaForBusinessMetadata' smart constructor.
data AlexaForBusinessMetadata = AlexaForBusinessMetadata'
  { -- | The ARN of the room resource.
    AlexaForBusinessMetadata -> Maybe (Sensitive Text)
alexaForBusinessRoomArn :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | Starts or stops Alexa for Business.
    AlexaForBusinessMetadata -> Maybe Bool
isAlexaForBusinessEnabled :: Prelude.Maybe Prelude.Bool
  }
  deriving (AlexaForBusinessMetadata -> AlexaForBusinessMetadata -> Bool
(AlexaForBusinessMetadata -> AlexaForBusinessMetadata -> Bool)
-> (AlexaForBusinessMetadata -> AlexaForBusinessMetadata -> Bool)
-> Eq AlexaForBusinessMetadata
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AlexaForBusinessMetadata -> AlexaForBusinessMetadata -> Bool
$c/= :: AlexaForBusinessMetadata -> AlexaForBusinessMetadata -> Bool
== :: AlexaForBusinessMetadata -> AlexaForBusinessMetadata -> Bool
$c== :: AlexaForBusinessMetadata -> AlexaForBusinessMetadata -> Bool
Prelude.Eq, Int -> AlexaForBusinessMetadata -> ShowS
[AlexaForBusinessMetadata] -> ShowS
AlexaForBusinessMetadata -> String
(Int -> AlexaForBusinessMetadata -> ShowS)
-> (AlexaForBusinessMetadata -> String)
-> ([AlexaForBusinessMetadata] -> ShowS)
-> Show AlexaForBusinessMetadata
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AlexaForBusinessMetadata] -> ShowS
$cshowList :: [AlexaForBusinessMetadata] -> ShowS
show :: AlexaForBusinessMetadata -> String
$cshow :: AlexaForBusinessMetadata -> String
showsPrec :: Int -> AlexaForBusinessMetadata -> ShowS
$cshowsPrec :: Int -> AlexaForBusinessMetadata -> ShowS
Prelude.Show, (forall x.
 AlexaForBusinessMetadata -> Rep AlexaForBusinessMetadata x)
-> (forall x.
    Rep AlexaForBusinessMetadata x -> AlexaForBusinessMetadata)
-> Generic AlexaForBusinessMetadata
forall x.
Rep AlexaForBusinessMetadata x -> AlexaForBusinessMetadata
forall x.
AlexaForBusinessMetadata -> Rep AlexaForBusinessMetadata x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AlexaForBusinessMetadata x -> AlexaForBusinessMetadata
$cfrom :: forall x.
AlexaForBusinessMetadata -> Rep AlexaForBusinessMetadata x
Prelude.Generic)

-- |
-- Create a value of 'AlexaForBusinessMetadata' 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:
--
-- 'alexaForBusinessRoomArn', 'alexaForBusinessMetadata_alexaForBusinessRoomArn' - The ARN of the room resource.
--
-- 'isAlexaForBusinessEnabled', 'alexaForBusinessMetadata_isAlexaForBusinessEnabled' - Starts or stops Alexa for Business.
newAlexaForBusinessMetadata ::
  AlexaForBusinessMetadata
newAlexaForBusinessMetadata :: AlexaForBusinessMetadata
newAlexaForBusinessMetadata =
  AlexaForBusinessMetadata' :: Maybe (Sensitive Text) -> Maybe Bool -> AlexaForBusinessMetadata
AlexaForBusinessMetadata'
    { $sel:alexaForBusinessRoomArn:AlexaForBusinessMetadata' :: Maybe (Sensitive Text)
alexaForBusinessRoomArn =
        Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:isAlexaForBusinessEnabled:AlexaForBusinessMetadata' :: Maybe Bool
isAlexaForBusinessEnabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing
    }

-- | The ARN of the room resource.
alexaForBusinessMetadata_alexaForBusinessRoomArn :: Lens.Lens' AlexaForBusinessMetadata (Prelude.Maybe Prelude.Text)
alexaForBusinessMetadata_alexaForBusinessRoomArn :: (Maybe Text -> f (Maybe Text))
-> AlexaForBusinessMetadata -> f AlexaForBusinessMetadata
alexaForBusinessMetadata_alexaForBusinessRoomArn = (AlexaForBusinessMetadata -> Maybe (Sensitive Text))
-> (AlexaForBusinessMetadata
    -> Maybe (Sensitive Text) -> AlexaForBusinessMetadata)
-> Lens
     AlexaForBusinessMetadata
     AlexaForBusinessMetadata
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AlexaForBusinessMetadata' {Maybe (Sensitive Text)
alexaForBusinessRoomArn :: Maybe (Sensitive Text)
$sel:alexaForBusinessRoomArn:AlexaForBusinessMetadata' :: AlexaForBusinessMetadata -> Maybe (Sensitive Text)
alexaForBusinessRoomArn} -> Maybe (Sensitive Text)
alexaForBusinessRoomArn) (\s :: AlexaForBusinessMetadata
s@AlexaForBusinessMetadata' {} Maybe (Sensitive Text)
a -> AlexaForBusinessMetadata
s {$sel:alexaForBusinessRoomArn:AlexaForBusinessMetadata' :: Maybe (Sensitive Text)
alexaForBusinessRoomArn = Maybe (Sensitive Text)
a} :: AlexaForBusinessMetadata) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> AlexaForBusinessMetadata -> f AlexaForBusinessMetadata)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> AlexaForBusinessMetadata
-> f AlexaForBusinessMetadata
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

-- | Starts or stops Alexa for Business.
alexaForBusinessMetadata_isAlexaForBusinessEnabled :: Lens.Lens' AlexaForBusinessMetadata (Prelude.Maybe Prelude.Bool)
alexaForBusinessMetadata_isAlexaForBusinessEnabled :: (Maybe Bool -> f (Maybe Bool))
-> AlexaForBusinessMetadata -> f AlexaForBusinessMetadata
alexaForBusinessMetadata_isAlexaForBusinessEnabled = (AlexaForBusinessMetadata -> Maybe Bool)
-> (AlexaForBusinessMetadata
    -> Maybe Bool -> AlexaForBusinessMetadata)
-> Lens
     AlexaForBusinessMetadata
     AlexaForBusinessMetadata
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AlexaForBusinessMetadata' {Maybe Bool
isAlexaForBusinessEnabled :: Maybe Bool
$sel:isAlexaForBusinessEnabled:AlexaForBusinessMetadata' :: AlexaForBusinessMetadata -> Maybe Bool
isAlexaForBusinessEnabled} -> Maybe Bool
isAlexaForBusinessEnabled) (\s :: AlexaForBusinessMetadata
s@AlexaForBusinessMetadata' {} Maybe Bool
a -> AlexaForBusinessMetadata
s {$sel:isAlexaForBusinessEnabled:AlexaForBusinessMetadata' :: Maybe Bool
isAlexaForBusinessEnabled = Maybe Bool
a} :: AlexaForBusinessMetadata)

instance Core.FromJSON AlexaForBusinessMetadata where
  parseJSON :: Value -> Parser AlexaForBusinessMetadata
parseJSON =
    String
-> (Object -> Parser AlexaForBusinessMetadata)
-> Value
-> Parser AlexaForBusinessMetadata
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AlexaForBusinessMetadata"
      ( \Object
x ->
          Maybe (Sensitive Text) -> Maybe Bool -> AlexaForBusinessMetadata
AlexaForBusinessMetadata'
            (Maybe (Sensitive Text) -> Maybe Bool -> AlexaForBusinessMetadata)
-> Parser (Maybe (Sensitive Text))
-> Parser (Maybe Bool -> AlexaForBusinessMetadata)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe (Sensitive Text))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"AlexaForBusinessRoomArn")
            Parser (Maybe Bool -> AlexaForBusinessMetadata)
-> Parser (Maybe Bool) -> Parser AlexaForBusinessMetadata
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"IsAlexaForBusinessEnabled")
      )

instance Prelude.Hashable AlexaForBusinessMetadata

instance Prelude.NFData AlexaForBusinessMetadata

instance Core.ToJSON AlexaForBusinessMetadata where
  toJSON :: AlexaForBusinessMetadata -> Value
toJSON AlexaForBusinessMetadata' {Maybe Bool
Maybe (Sensitive Text)
isAlexaForBusinessEnabled :: Maybe Bool
alexaForBusinessRoomArn :: Maybe (Sensitive Text)
$sel:isAlexaForBusinessEnabled:AlexaForBusinessMetadata' :: AlexaForBusinessMetadata -> Maybe Bool
$sel:alexaForBusinessRoomArn:AlexaForBusinessMetadata' :: AlexaForBusinessMetadata -> Maybe (Sensitive Text)
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"AlexaForBusinessRoomArn" 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)
alexaForBusinessRoomArn,
            (Text
"IsAlexaForBusinessEnabled" 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
isAlexaForBusinessEnabled
          ]
      )