{-# 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.Pinpoint.Types.SMSChannelRequest
-- 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.Pinpoint.Types.SMSChannelRequest where

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

-- | Specifies the status and settings of the SMS channel for an application.
--
-- /See:/ 'newSMSChannelRequest' smart constructor.
data SMSChannelRequest = SMSChannelRequest'
  { -- | The registered short code that you want to use when you send messages
    -- through the SMS channel.
    SMSChannelRequest -> Maybe Text
shortCode :: Prelude.Maybe Prelude.Text,
    -- | Specifies whether to enable the SMS channel for the application.
    SMSChannelRequest -> Maybe Bool
enabled :: Prelude.Maybe Prelude.Bool,
    -- | The identity that you want to display on recipients\' devices when they
    -- receive messages from the SMS channel.
    SMSChannelRequest -> Maybe Text
senderId :: Prelude.Maybe Prelude.Text
  }
  deriving (SMSChannelRequest -> SMSChannelRequest -> Bool
(SMSChannelRequest -> SMSChannelRequest -> Bool)
-> (SMSChannelRequest -> SMSChannelRequest -> Bool)
-> Eq SMSChannelRequest
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SMSChannelRequest -> SMSChannelRequest -> Bool
$c/= :: SMSChannelRequest -> SMSChannelRequest -> Bool
== :: SMSChannelRequest -> SMSChannelRequest -> Bool
$c== :: SMSChannelRequest -> SMSChannelRequest -> Bool
Prelude.Eq, ReadPrec [SMSChannelRequest]
ReadPrec SMSChannelRequest
Int -> ReadS SMSChannelRequest
ReadS [SMSChannelRequest]
(Int -> ReadS SMSChannelRequest)
-> ReadS [SMSChannelRequest]
-> ReadPrec SMSChannelRequest
-> ReadPrec [SMSChannelRequest]
-> Read SMSChannelRequest
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SMSChannelRequest]
$creadListPrec :: ReadPrec [SMSChannelRequest]
readPrec :: ReadPrec SMSChannelRequest
$creadPrec :: ReadPrec SMSChannelRequest
readList :: ReadS [SMSChannelRequest]
$creadList :: ReadS [SMSChannelRequest]
readsPrec :: Int -> ReadS SMSChannelRequest
$creadsPrec :: Int -> ReadS SMSChannelRequest
Prelude.Read, Int -> SMSChannelRequest -> ShowS
[SMSChannelRequest] -> ShowS
SMSChannelRequest -> String
(Int -> SMSChannelRequest -> ShowS)
-> (SMSChannelRequest -> String)
-> ([SMSChannelRequest] -> ShowS)
-> Show SMSChannelRequest
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SMSChannelRequest] -> ShowS
$cshowList :: [SMSChannelRequest] -> ShowS
show :: SMSChannelRequest -> String
$cshow :: SMSChannelRequest -> String
showsPrec :: Int -> SMSChannelRequest -> ShowS
$cshowsPrec :: Int -> SMSChannelRequest -> ShowS
Prelude.Show, (forall x. SMSChannelRequest -> Rep SMSChannelRequest x)
-> (forall x. Rep SMSChannelRequest x -> SMSChannelRequest)
-> Generic SMSChannelRequest
forall x. Rep SMSChannelRequest x -> SMSChannelRequest
forall x. SMSChannelRequest -> Rep SMSChannelRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SMSChannelRequest x -> SMSChannelRequest
$cfrom :: forall x. SMSChannelRequest -> Rep SMSChannelRequest x
Prelude.Generic)

-- |
-- Create a value of 'SMSChannelRequest' 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:
--
-- 'shortCode', 'sMSChannelRequest_shortCode' - The registered short code that you want to use when you send messages
-- through the SMS channel.
--
-- 'enabled', 'sMSChannelRequest_enabled' - Specifies whether to enable the SMS channel for the application.
--
-- 'senderId', 'sMSChannelRequest_senderId' - The identity that you want to display on recipients\' devices when they
-- receive messages from the SMS channel.
newSMSChannelRequest ::
  SMSChannelRequest
newSMSChannelRequest :: SMSChannelRequest
newSMSChannelRequest =
  SMSChannelRequest' :: Maybe Text -> Maybe Bool -> Maybe Text -> SMSChannelRequest
SMSChannelRequest'
    { $sel:shortCode:SMSChannelRequest' :: Maybe Text
shortCode = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:enabled:SMSChannelRequest' :: Maybe Bool
enabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:senderId:SMSChannelRequest' :: Maybe Text
senderId = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The registered short code that you want to use when you send messages
-- through the SMS channel.
sMSChannelRequest_shortCode :: Lens.Lens' SMSChannelRequest (Prelude.Maybe Prelude.Text)
sMSChannelRequest_shortCode :: (Maybe Text -> f (Maybe Text))
-> SMSChannelRequest -> f SMSChannelRequest
sMSChannelRequest_shortCode = (SMSChannelRequest -> Maybe Text)
-> (SMSChannelRequest -> Maybe Text -> SMSChannelRequest)
-> Lens
     SMSChannelRequest SMSChannelRequest (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SMSChannelRequest' {Maybe Text
shortCode :: Maybe Text
$sel:shortCode:SMSChannelRequest' :: SMSChannelRequest -> Maybe Text
shortCode} -> Maybe Text
shortCode) (\s :: SMSChannelRequest
s@SMSChannelRequest' {} Maybe Text
a -> SMSChannelRequest
s {$sel:shortCode:SMSChannelRequest' :: Maybe Text
shortCode = Maybe Text
a} :: SMSChannelRequest)

-- | Specifies whether to enable the SMS channel for the application.
sMSChannelRequest_enabled :: Lens.Lens' SMSChannelRequest (Prelude.Maybe Prelude.Bool)
sMSChannelRequest_enabled :: (Maybe Bool -> f (Maybe Bool))
-> SMSChannelRequest -> f SMSChannelRequest
sMSChannelRequest_enabled = (SMSChannelRequest -> Maybe Bool)
-> (SMSChannelRequest -> Maybe Bool -> SMSChannelRequest)
-> Lens
     SMSChannelRequest SMSChannelRequest (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SMSChannelRequest' {Maybe Bool
enabled :: Maybe Bool
$sel:enabled:SMSChannelRequest' :: SMSChannelRequest -> Maybe Bool
enabled} -> Maybe Bool
enabled) (\s :: SMSChannelRequest
s@SMSChannelRequest' {} Maybe Bool
a -> SMSChannelRequest
s {$sel:enabled:SMSChannelRequest' :: Maybe Bool
enabled = Maybe Bool
a} :: SMSChannelRequest)

-- | The identity that you want to display on recipients\' devices when they
-- receive messages from the SMS channel.
sMSChannelRequest_senderId :: Lens.Lens' SMSChannelRequest (Prelude.Maybe Prelude.Text)
sMSChannelRequest_senderId :: (Maybe Text -> f (Maybe Text))
-> SMSChannelRequest -> f SMSChannelRequest
sMSChannelRequest_senderId = (SMSChannelRequest -> Maybe Text)
-> (SMSChannelRequest -> Maybe Text -> SMSChannelRequest)
-> Lens
     SMSChannelRequest SMSChannelRequest (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SMSChannelRequest' {Maybe Text
senderId :: Maybe Text
$sel:senderId:SMSChannelRequest' :: SMSChannelRequest -> Maybe Text
senderId} -> Maybe Text
senderId) (\s :: SMSChannelRequest
s@SMSChannelRequest' {} Maybe Text
a -> SMSChannelRequest
s {$sel:senderId:SMSChannelRequest' :: Maybe Text
senderId = Maybe Text
a} :: SMSChannelRequest)

instance Prelude.Hashable SMSChannelRequest

instance Prelude.NFData SMSChannelRequest

instance Core.ToJSON SMSChannelRequest where
  toJSON :: SMSChannelRequest -> Value
toJSON SMSChannelRequest' {Maybe Bool
Maybe Text
senderId :: Maybe Text
enabled :: Maybe Bool
shortCode :: Maybe Text
$sel:senderId:SMSChannelRequest' :: SMSChannelRequest -> Maybe Text
$sel:enabled:SMSChannelRequest' :: SMSChannelRequest -> Maybe Bool
$sel:shortCode:SMSChannelRequest' :: SMSChannelRequest -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"ShortCode" 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
shortCode,
            (Text
"Enabled" 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
enabled,
            (Text
"SenderId" 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
senderId
          ]
      )