{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Pinpoint.Types.SMSChannelRequest where

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

-- | Specifies the status and settings of the SMS channel for an application.
--
-- /See:/ 'newSMSChannelRequest' smart constructor.
data SMSChannelRequest = SMSChannelRequest'
  { -- | 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,
    -- | 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
  }
  deriving (SMSChannelRequest -> SMSChannelRequest -> Bool
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]
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
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. 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:
--
-- '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.
--
-- 'shortCode', 'sMSChannelRequest_shortCode' - The registered short code that you want to use when you send messages
-- through the SMS channel.
newSMSChannelRequest ::
  SMSChannelRequest
newSMSChannelRequest :: SMSChannelRequest
newSMSChannelRequest =
  SMSChannelRequest'
    { $sel:enabled:SMSChannelRequest' :: Maybe Bool
enabled = forall a. Maybe a
Prelude.Nothing,
      $sel:senderId:SMSChannelRequest' :: Maybe Text
senderId = forall a. Maybe a
Prelude.Nothing,
      $sel:shortCode:SMSChannelRequest' :: Maybe Text
shortCode = forall a. Maybe a
Prelude.Nothing
    }

-- | Specifies whether to enable the SMS channel for the application.
sMSChannelRequest_enabled :: Lens.Lens' SMSChannelRequest (Prelude.Maybe Prelude.Bool)
sMSChannelRequest_enabled :: Lens' SMSChannelRequest (Maybe Bool)
sMSChannelRequest_enabled = 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 :: Lens' SMSChannelRequest (Maybe Text)
sMSChannelRequest_senderId = 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)

-- | 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 :: Lens' SMSChannelRequest (Maybe Text)
sMSChannelRequest_shortCode = 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)

instance Prelude.Hashable SMSChannelRequest where
  hashWithSalt :: Int -> SMSChannelRequest -> Int
hashWithSalt Int
_salt SMSChannelRequest' {Maybe Bool
Maybe Text
shortCode :: Maybe Text
senderId :: Maybe Text
enabled :: Maybe Bool
$sel:shortCode:SMSChannelRequest' :: SMSChannelRequest -> Maybe Text
$sel:senderId:SMSChannelRequest' :: SMSChannelRequest -> Maybe Text
$sel:enabled:SMSChannelRequest' :: SMSChannelRequest -> Maybe Bool
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
enabled
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
senderId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
shortCode

instance Prelude.NFData SMSChannelRequest where
  rnf :: SMSChannelRequest -> ()
rnf SMSChannelRequest' {Maybe Bool
Maybe Text
shortCode :: Maybe Text
senderId :: Maybe Text
enabled :: Maybe Bool
$sel:shortCode:SMSChannelRequest' :: SMSChannelRequest -> Maybe Text
$sel:senderId:SMSChannelRequest' :: SMSChannelRequest -> Maybe Text
$sel:enabled:SMSChannelRequest' :: SMSChannelRequest -> Maybe Bool
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
enabled
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
senderId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
shortCode

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