{-# 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.SenderIdInformation
-- 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.SenderIdInformation where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.PinpointSmsVoiceV2.Types.MessageType
import qualified Amazonka.Prelude as Prelude

-- | The information for all SenderIds in an Amazon Web Services account.
--
-- /See:/ 'newSenderIdInformation' smart constructor.
data SenderIdInformation = SenderIdInformation'
  { -- | The Amazon Resource Name (ARN) associated with the SenderId.
    SenderIdInformation -> Text
senderIdArn :: Prelude.Text,
    -- | The alphanumeric sender ID in a specific country that you\'d like to
    -- describe.
    SenderIdInformation -> Text
senderId :: Prelude.Text,
    -- | The two-character code, in ISO 3166-1 alpha-2 format, for the country or
    -- region.
    SenderIdInformation -> Text
isoCountryCode :: Prelude.Text,
    -- | The type of message. Valid values are TRANSACTIONAL for messages that
    -- are critical or time-sensitive and PROMOTIONAL for messages that aren\'t
    -- critical or time-sensitive.
    SenderIdInformation -> [MessageType]
messageTypes :: [MessageType],
    -- | The monthly leasing price, in US dollars.
    SenderIdInformation -> Text
monthlyLeasingPrice :: Prelude.Text
  }
  deriving (SenderIdInformation -> SenderIdInformation -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SenderIdInformation -> SenderIdInformation -> Bool
$c/= :: SenderIdInformation -> SenderIdInformation -> Bool
== :: SenderIdInformation -> SenderIdInformation -> Bool
$c== :: SenderIdInformation -> SenderIdInformation -> Bool
Prelude.Eq, ReadPrec [SenderIdInformation]
ReadPrec SenderIdInformation
Int -> ReadS SenderIdInformation
ReadS [SenderIdInformation]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SenderIdInformation]
$creadListPrec :: ReadPrec [SenderIdInformation]
readPrec :: ReadPrec SenderIdInformation
$creadPrec :: ReadPrec SenderIdInformation
readList :: ReadS [SenderIdInformation]
$creadList :: ReadS [SenderIdInformation]
readsPrec :: Int -> ReadS SenderIdInformation
$creadsPrec :: Int -> ReadS SenderIdInformation
Prelude.Read, Int -> SenderIdInformation -> ShowS
[SenderIdInformation] -> ShowS
SenderIdInformation -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SenderIdInformation] -> ShowS
$cshowList :: [SenderIdInformation] -> ShowS
show :: SenderIdInformation -> String
$cshow :: SenderIdInformation -> String
showsPrec :: Int -> SenderIdInformation -> ShowS
$cshowsPrec :: Int -> SenderIdInformation -> ShowS
Prelude.Show, forall x. Rep SenderIdInformation x -> SenderIdInformation
forall x. SenderIdInformation -> Rep SenderIdInformation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SenderIdInformation x -> SenderIdInformation
$cfrom :: forall x. SenderIdInformation -> Rep SenderIdInformation x
Prelude.Generic)

-- |
-- Create a value of 'SenderIdInformation' 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:
--
-- 'senderIdArn', 'senderIdInformation_senderIdArn' - The Amazon Resource Name (ARN) associated with the SenderId.
--
-- 'senderId', 'senderIdInformation_senderId' - The alphanumeric sender ID in a specific country that you\'d like to
-- describe.
--
-- 'isoCountryCode', 'senderIdInformation_isoCountryCode' - The two-character code, in ISO 3166-1 alpha-2 format, for the country or
-- region.
--
-- 'messageTypes', 'senderIdInformation_messageTypes' - The type of message. Valid values are TRANSACTIONAL for messages that
-- are critical or time-sensitive and PROMOTIONAL for messages that aren\'t
-- critical or time-sensitive.
--
-- 'monthlyLeasingPrice', 'senderIdInformation_monthlyLeasingPrice' - The monthly leasing price, in US dollars.
newSenderIdInformation ::
  -- | 'senderIdArn'
  Prelude.Text ->
  -- | 'senderId'
  Prelude.Text ->
  -- | 'isoCountryCode'
  Prelude.Text ->
  -- | 'monthlyLeasingPrice'
  Prelude.Text ->
  SenderIdInformation
newSenderIdInformation :: Text -> Text -> Text -> Text -> SenderIdInformation
newSenderIdInformation
  Text
pSenderIdArn_
  Text
pSenderId_
  Text
pIsoCountryCode_
  Text
pMonthlyLeasingPrice_ =
    SenderIdInformation'
      { $sel:senderIdArn:SenderIdInformation' :: Text
senderIdArn = Text
pSenderIdArn_,
        $sel:senderId:SenderIdInformation' :: Text
senderId = Text
pSenderId_,
        $sel:isoCountryCode:SenderIdInformation' :: Text
isoCountryCode = Text
pIsoCountryCode_,
        $sel:messageTypes:SenderIdInformation' :: [MessageType]
messageTypes = forall a. Monoid a => a
Prelude.mempty,
        $sel:monthlyLeasingPrice:SenderIdInformation' :: Text
monthlyLeasingPrice = Text
pMonthlyLeasingPrice_
      }

-- | The Amazon Resource Name (ARN) associated with the SenderId.
senderIdInformation_senderIdArn :: Lens.Lens' SenderIdInformation Prelude.Text
senderIdInformation_senderIdArn :: Lens' SenderIdInformation Text
senderIdInformation_senderIdArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SenderIdInformation' {Text
senderIdArn :: Text
$sel:senderIdArn:SenderIdInformation' :: SenderIdInformation -> Text
senderIdArn} -> Text
senderIdArn) (\s :: SenderIdInformation
s@SenderIdInformation' {} Text
a -> SenderIdInformation
s {$sel:senderIdArn:SenderIdInformation' :: Text
senderIdArn = Text
a} :: SenderIdInformation)

-- | The alphanumeric sender ID in a specific country that you\'d like to
-- describe.
senderIdInformation_senderId :: Lens.Lens' SenderIdInformation Prelude.Text
senderIdInformation_senderId :: Lens' SenderIdInformation Text
senderIdInformation_senderId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SenderIdInformation' {Text
senderId :: Text
$sel:senderId:SenderIdInformation' :: SenderIdInformation -> Text
senderId} -> Text
senderId) (\s :: SenderIdInformation
s@SenderIdInformation' {} Text
a -> SenderIdInformation
s {$sel:senderId:SenderIdInformation' :: Text
senderId = Text
a} :: SenderIdInformation)

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

-- | The type of message. Valid values are TRANSACTIONAL for messages that
-- are critical or time-sensitive and PROMOTIONAL for messages that aren\'t
-- critical or time-sensitive.
senderIdInformation_messageTypes :: Lens.Lens' SenderIdInformation [MessageType]
senderIdInformation_messageTypes :: Lens' SenderIdInformation [MessageType]
senderIdInformation_messageTypes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SenderIdInformation' {[MessageType]
messageTypes :: [MessageType]
$sel:messageTypes:SenderIdInformation' :: SenderIdInformation -> [MessageType]
messageTypes} -> [MessageType]
messageTypes) (\s :: SenderIdInformation
s@SenderIdInformation' {} [MessageType]
a -> SenderIdInformation
s {$sel:messageTypes:SenderIdInformation' :: [MessageType]
messageTypes = [MessageType]
a} :: SenderIdInformation) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The monthly leasing price, in US dollars.
senderIdInformation_monthlyLeasingPrice :: Lens.Lens' SenderIdInformation Prelude.Text
senderIdInformation_monthlyLeasingPrice :: Lens' SenderIdInformation Text
senderIdInformation_monthlyLeasingPrice = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SenderIdInformation' {Text
monthlyLeasingPrice :: Text
$sel:monthlyLeasingPrice:SenderIdInformation' :: SenderIdInformation -> Text
monthlyLeasingPrice} -> Text
monthlyLeasingPrice) (\s :: SenderIdInformation
s@SenderIdInformation' {} Text
a -> SenderIdInformation
s {$sel:monthlyLeasingPrice:SenderIdInformation' :: Text
monthlyLeasingPrice = Text
a} :: SenderIdInformation)

instance Data.FromJSON SenderIdInformation where
  parseJSON :: Value -> Parser SenderIdInformation
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"SenderIdInformation"
      ( \Object
x ->
          Text
-> Text -> Text -> [MessageType] -> Text -> SenderIdInformation
SenderIdInformation'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"SenderIdArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"SenderId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"IsoCountryCode")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"MessageTypes" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"MonthlyLeasingPrice")
      )

instance Prelude.Hashable SenderIdInformation where
  hashWithSalt :: Int -> SenderIdInformation -> Int
hashWithSalt Int
_salt SenderIdInformation' {[MessageType]
Text
monthlyLeasingPrice :: Text
messageTypes :: [MessageType]
isoCountryCode :: Text
senderId :: Text
senderIdArn :: Text
$sel:monthlyLeasingPrice:SenderIdInformation' :: SenderIdInformation -> Text
$sel:messageTypes:SenderIdInformation' :: SenderIdInformation -> [MessageType]
$sel:isoCountryCode:SenderIdInformation' :: SenderIdInformation -> Text
$sel:senderId:SenderIdInformation' :: SenderIdInformation -> Text
$sel:senderIdArn:SenderIdInformation' :: SenderIdInformation -> Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
senderIdArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
senderId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
isoCountryCode
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` [MessageType]
messageTypes
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
monthlyLeasingPrice

instance Prelude.NFData SenderIdInformation where
  rnf :: SenderIdInformation -> ()
rnf SenderIdInformation' {[MessageType]
Text
monthlyLeasingPrice :: Text
messageTypes :: [MessageType]
isoCountryCode :: Text
senderId :: Text
senderIdArn :: Text
$sel:monthlyLeasingPrice:SenderIdInformation' :: SenderIdInformation -> Text
$sel:messageTypes:SenderIdInformation' :: SenderIdInformation -> [MessageType]
$sel:isoCountryCode:SenderIdInformation' :: SenderIdInformation -> Text
$sel:senderId:SenderIdInformation' :: SenderIdInformation -> Text
$sel:senderIdArn:SenderIdInformation' :: SenderIdInformation -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
senderIdArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` 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
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [MessageType]
messageTypes
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
monthlyLeasingPrice