{-# 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.PinpointSmsVoiceV2.Types.SenderIdAndCountry
-- 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.PinpointSmsVoiceV2.Types.SenderIdAndCountry 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

-- | The alphanumeric sender ID in a specific country that you want to
-- describe. For more information on sender IDs see
-- <https://docs.aws.amazon.com/pinpoint/latest/userguide/channels-sms-awssupport-sender-id.html Requesting sender IDs for SMS messaging with Amazon Pinpoint>
-- in the /Amazon Pinpoint User Guide/.
--
-- /See:/ 'newSenderIdAndCountry' smart constructor.
data SenderIdAndCountry = SenderIdAndCountry'
  { -- | The unique identifier of the sender.
    SenderIdAndCountry -> Text
senderId :: Prelude.Text,
    -- | The two-character code, in ISO 3166-1 alpha-2 format, for the country or
    -- region.
    SenderIdAndCountry -> Text
isoCountryCode :: Prelude.Text
  }
  deriving (SenderIdAndCountry -> SenderIdAndCountry -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SenderIdAndCountry -> SenderIdAndCountry -> Bool
$c/= :: SenderIdAndCountry -> SenderIdAndCountry -> Bool
== :: SenderIdAndCountry -> SenderIdAndCountry -> Bool
$c== :: SenderIdAndCountry -> SenderIdAndCountry -> Bool
Prelude.Eq, ReadPrec [SenderIdAndCountry]
ReadPrec SenderIdAndCountry
Int -> ReadS SenderIdAndCountry
ReadS [SenderIdAndCountry]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SenderIdAndCountry]
$creadListPrec :: ReadPrec [SenderIdAndCountry]
readPrec :: ReadPrec SenderIdAndCountry
$creadPrec :: ReadPrec SenderIdAndCountry
readList :: ReadS [SenderIdAndCountry]
$creadList :: ReadS [SenderIdAndCountry]
readsPrec :: Int -> ReadS SenderIdAndCountry
$creadsPrec :: Int -> ReadS SenderIdAndCountry
Prelude.Read, Int -> SenderIdAndCountry -> ShowS
[SenderIdAndCountry] -> ShowS
SenderIdAndCountry -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SenderIdAndCountry] -> ShowS
$cshowList :: [SenderIdAndCountry] -> ShowS
show :: SenderIdAndCountry -> String
$cshow :: SenderIdAndCountry -> String
showsPrec :: Int -> SenderIdAndCountry -> ShowS
$cshowsPrec :: Int -> SenderIdAndCountry -> ShowS
Prelude.Show, forall x. Rep SenderIdAndCountry x -> SenderIdAndCountry
forall x. SenderIdAndCountry -> Rep SenderIdAndCountry x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SenderIdAndCountry x -> SenderIdAndCountry
$cfrom :: forall x. SenderIdAndCountry -> Rep SenderIdAndCountry x
Prelude.Generic)

-- |
-- Create a value of 'SenderIdAndCountry' 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:
--
-- 'senderId', 'senderIdAndCountry_senderId' - The unique identifier of the sender.
--
-- 'isoCountryCode', 'senderIdAndCountry_isoCountryCode' - The two-character code, in ISO 3166-1 alpha-2 format, for the country or
-- region.
newSenderIdAndCountry ::
  -- | 'senderId'
  Prelude.Text ->
  -- | 'isoCountryCode'
  Prelude.Text ->
  SenderIdAndCountry
newSenderIdAndCountry :: Text -> Text -> SenderIdAndCountry
newSenderIdAndCountry Text
pSenderId_ Text
pIsoCountryCode_ =
  SenderIdAndCountry'
    { $sel:senderId:SenderIdAndCountry' :: Text
senderId = Text
pSenderId_,
      $sel:isoCountryCode:SenderIdAndCountry' :: Text
isoCountryCode = Text
pIsoCountryCode_
    }

-- | The unique identifier of the sender.
senderIdAndCountry_senderId :: Lens.Lens' SenderIdAndCountry Prelude.Text
senderIdAndCountry_senderId :: Lens' SenderIdAndCountry Text
senderIdAndCountry_senderId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SenderIdAndCountry' {Text
senderId :: Text
$sel:senderId:SenderIdAndCountry' :: SenderIdAndCountry -> Text
senderId} -> Text
senderId) (\s :: SenderIdAndCountry
s@SenderIdAndCountry' {} Text
a -> SenderIdAndCountry
s {$sel:senderId:SenderIdAndCountry' :: Text
senderId = Text
a} :: SenderIdAndCountry)

-- | The two-character code, in ISO 3166-1 alpha-2 format, for the country or
-- region.
senderIdAndCountry_isoCountryCode :: Lens.Lens' SenderIdAndCountry Prelude.Text
senderIdAndCountry_isoCountryCode :: Lens' SenderIdAndCountry Text
senderIdAndCountry_isoCountryCode = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SenderIdAndCountry' {Text
isoCountryCode :: Text
$sel:isoCountryCode:SenderIdAndCountry' :: SenderIdAndCountry -> Text
isoCountryCode} -> Text
isoCountryCode) (\s :: SenderIdAndCountry
s@SenderIdAndCountry' {} Text
a -> SenderIdAndCountry
s {$sel:isoCountryCode:SenderIdAndCountry' :: Text
isoCountryCode = Text
a} :: SenderIdAndCountry)

instance Prelude.Hashable SenderIdAndCountry where
  hashWithSalt :: Int -> SenderIdAndCountry -> Int
hashWithSalt Int
_salt SenderIdAndCountry' {Text
isoCountryCode :: Text
senderId :: Text
$sel:isoCountryCode:SenderIdAndCountry' :: SenderIdAndCountry -> Text
$sel:senderId:SenderIdAndCountry' :: SenderIdAndCountry -> Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
senderId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
isoCountryCode

instance Prelude.NFData SenderIdAndCountry where
  rnf :: SenderIdAndCountry -> ()
rnf SenderIdAndCountry' {Text
isoCountryCode :: Text
senderId :: Text
$sel:isoCountryCode:SenderIdAndCountry' :: SenderIdAndCountry -> Text
$sel:senderId:SenderIdAndCountry' :: SenderIdAndCountry -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
senderId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
isoCountryCode

instance Data.ToJSON SenderIdAndCountry where
  toJSON :: SenderIdAndCountry -> Value
toJSON SenderIdAndCountry' {Text
isoCountryCode :: Text
senderId :: Text
$sel:isoCountryCode:SenderIdAndCountry' :: SenderIdAndCountry -> Text
$sel:senderId:SenderIdAndCountry' :: SenderIdAndCountry -> Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ forall a. a -> Maybe a
Prelude.Just (Key
"SenderId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
senderId),
            forall a. a -> Maybe a
Prelude.Just
              (Key
"IsoCountryCode" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
isoCountryCode)
          ]
      )