{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# 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.AssociateOriginationIdentity
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Associates the specified origination identity with a pool.
--
-- If the origination identity is a phone number and is already associated
-- with another pool, an Error is returned. A sender ID can be associated
-- with multiple pools.
--
-- If the origination identity configuration doesn\'t match the pool\'s
-- configuration, an Error is returned.
module Amazonka.PinpointSmsVoiceV2.AssociateOriginationIdentity
  ( -- * Creating a Request
    AssociateOriginationIdentity (..),
    newAssociateOriginationIdentity,

    -- * Request Lenses
    associateOriginationIdentity_clientToken,
    associateOriginationIdentity_poolId,
    associateOriginationIdentity_originationIdentity,
    associateOriginationIdentity_isoCountryCode,

    -- * Destructuring the Response
    AssociateOriginationIdentityResponse (..),
    newAssociateOriginationIdentityResponse,

    -- * Response Lenses
    associateOriginationIdentityResponse_isoCountryCode,
    associateOriginationIdentityResponse_originationIdentity,
    associateOriginationIdentityResponse_originationIdentityArn,
    associateOriginationIdentityResponse_poolArn,
    associateOriginationIdentityResponse_poolId,
    associateOriginationIdentityResponse_httpStatus,
  )
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
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newAssociateOriginationIdentity' smart constructor.
data AssociateOriginationIdentity = AssociateOriginationIdentity'
  { -- | Unique, case-sensitive identifier that you provide to ensure the
    -- idempotency of the request. If you don\'t specify a client token, a
    -- randomly generated token is used for the request to ensure idempotency.
    AssociateOriginationIdentity -> Maybe Text
clientToken :: Prelude.Maybe Prelude.Text,
    -- | The pool to update with the new Identity. This value can be either the
    -- PoolId or PoolArn, and you can find these values using DescribePools.
    AssociateOriginationIdentity -> Text
poolId :: Prelude.Text,
    -- | The origination identity to use, such as PhoneNumberId, PhoneNumberArn,
    -- SenderId, or SenderIdArn. You can use DescribePhoneNumbers to find the
    -- values for PhoneNumberId and PhoneNumberArn, while DescribeSenderIds can
    -- be used to get the values for SenderId and SenderIdArn.
    AssociateOriginationIdentity -> Text
originationIdentity :: Prelude.Text,
    -- | The new two-character code, in ISO 3166-1 alpha-2 format, for the
    -- country or region of the origination identity.
    AssociateOriginationIdentity -> Text
isoCountryCode :: Prelude.Text
  }
  deriving (AssociateOriginationIdentity
-> AssociateOriginationIdentity -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AssociateOriginationIdentity
-> AssociateOriginationIdentity -> Bool
$c/= :: AssociateOriginationIdentity
-> AssociateOriginationIdentity -> Bool
== :: AssociateOriginationIdentity
-> AssociateOriginationIdentity -> Bool
$c== :: AssociateOriginationIdentity
-> AssociateOriginationIdentity -> Bool
Prelude.Eq, ReadPrec [AssociateOriginationIdentity]
ReadPrec AssociateOriginationIdentity
Int -> ReadS AssociateOriginationIdentity
ReadS [AssociateOriginationIdentity]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AssociateOriginationIdentity]
$creadListPrec :: ReadPrec [AssociateOriginationIdentity]
readPrec :: ReadPrec AssociateOriginationIdentity
$creadPrec :: ReadPrec AssociateOriginationIdentity
readList :: ReadS [AssociateOriginationIdentity]
$creadList :: ReadS [AssociateOriginationIdentity]
readsPrec :: Int -> ReadS AssociateOriginationIdentity
$creadsPrec :: Int -> ReadS AssociateOriginationIdentity
Prelude.Read, Int -> AssociateOriginationIdentity -> ShowS
[AssociateOriginationIdentity] -> ShowS
AssociateOriginationIdentity -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AssociateOriginationIdentity] -> ShowS
$cshowList :: [AssociateOriginationIdentity] -> ShowS
show :: AssociateOriginationIdentity -> String
$cshow :: AssociateOriginationIdentity -> String
showsPrec :: Int -> AssociateOriginationIdentity -> ShowS
$cshowsPrec :: Int -> AssociateOriginationIdentity -> ShowS
Prelude.Show, forall x.
Rep AssociateOriginationIdentity x -> AssociateOriginationIdentity
forall x.
AssociateOriginationIdentity -> Rep AssociateOriginationIdentity x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AssociateOriginationIdentity x -> AssociateOriginationIdentity
$cfrom :: forall x.
AssociateOriginationIdentity -> Rep AssociateOriginationIdentity x
Prelude.Generic)

-- |
-- Create a value of 'AssociateOriginationIdentity' 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:
--
-- 'clientToken', 'associateOriginationIdentity_clientToken' - Unique, case-sensitive identifier that you provide to ensure the
-- idempotency of the request. If you don\'t specify a client token, a
-- randomly generated token is used for the request to ensure idempotency.
--
-- 'poolId', 'associateOriginationIdentity_poolId' - The pool to update with the new Identity. This value can be either the
-- PoolId or PoolArn, and you can find these values using DescribePools.
--
-- 'originationIdentity', 'associateOriginationIdentity_originationIdentity' - The origination identity to use, such as PhoneNumberId, PhoneNumberArn,
-- SenderId, or SenderIdArn. You can use DescribePhoneNumbers to find the
-- values for PhoneNumberId and PhoneNumberArn, while DescribeSenderIds can
-- be used to get the values for SenderId and SenderIdArn.
--
-- 'isoCountryCode', 'associateOriginationIdentity_isoCountryCode' - The new two-character code, in ISO 3166-1 alpha-2 format, for the
-- country or region of the origination identity.
newAssociateOriginationIdentity ::
  -- | 'poolId'
  Prelude.Text ->
  -- | 'originationIdentity'
  Prelude.Text ->
  -- | 'isoCountryCode'
  Prelude.Text ->
  AssociateOriginationIdentity
newAssociateOriginationIdentity :: Text -> Text -> Text -> AssociateOriginationIdentity
newAssociateOriginationIdentity
  Text
pPoolId_
  Text
pOriginationIdentity_
  Text
pIsoCountryCode_ =
    AssociateOriginationIdentity'
      { $sel:clientToken:AssociateOriginationIdentity' :: Maybe Text
clientToken =
          forall a. Maybe a
Prelude.Nothing,
        $sel:poolId:AssociateOriginationIdentity' :: Text
poolId = Text
pPoolId_,
        $sel:originationIdentity:AssociateOriginationIdentity' :: Text
originationIdentity = Text
pOriginationIdentity_,
        $sel:isoCountryCode:AssociateOriginationIdentity' :: Text
isoCountryCode = Text
pIsoCountryCode_
      }

-- | Unique, case-sensitive identifier that you provide to ensure the
-- idempotency of the request. If you don\'t specify a client token, a
-- randomly generated token is used for the request to ensure idempotency.
associateOriginationIdentity_clientToken :: Lens.Lens' AssociateOriginationIdentity (Prelude.Maybe Prelude.Text)
associateOriginationIdentity_clientToken :: Lens' AssociateOriginationIdentity (Maybe Text)
associateOriginationIdentity_clientToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateOriginationIdentity' {Maybe Text
clientToken :: Maybe Text
$sel:clientToken:AssociateOriginationIdentity' :: AssociateOriginationIdentity -> Maybe Text
clientToken} -> Maybe Text
clientToken) (\s :: AssociateOriginationIdentity
s@AssociateOriginationIdentity' {} Maybe Text
a -> AssociateOriginationIdentity
s {$sel:clientToken:AssociateOriginationIdentity' :: Maybe Text
clientToken = Maybe Text
a} :: AssociateOriginationIdentity)

-- | The pool to update with the new Identity. This value can be either the
-- PoolId or PoolArn, and you can find these values using DescribePools.
associateOriginationIdentity_poolId :: Lens.Lens' AssociateOriginationIdentity Prelude.Text
associateOriginationIdentity_poolId :: Lens' AssociateOriginationIdentity Text
associateOriginationIdentity_poolId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateOriginationIdentity' {Text
poolId :: Text
$sel:poolId:AssociateOriginationIdentity' :: AssociateOriginationIdentity -> Text
poolId} -> Text
poolId) (\s :: AssociateOriginationIdentity
s@AssociateOriginationIdentity' {} Text
a -> AssociateOriginationIdentity
s {$sel:poolId:AssociateOriginationIdentity' :: Text
poolId = Text
a} :: AssociateOriginationIdentity)

-- | The origination identity to use, such as PhoneNumberId, PhoneNumberArn,
-- SenderId, or SenderIdArn. You can use DescribePhoneNumbers to find the
-- values for PhoneNumberId and PhoneNumberArn, while DescribeSenderIds can
-- be used to get the values for SenderId and SenderIdArn.
associateOriginationIdentity_originationIdentity :: Lens.Lens' AssociateOriginationIdentity Prelude.Text
associateOriginationIdentity_originationIdentity :: Lens' AssociateOriginationIdentity Text
associateOriginationIdentity_originationIdentity = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateOriginationIdentity' {Text
originationIdentity :: Text
$sel:originationIdentity:AssociateOriginationIdentity' :: AssociateOriginationIdentity -> Text
originationIdentity} -> Text
originationIdentity) (\s :: AssociateOriginationIdentity
s@AssociateOriginationIdentity' {} Text
a -> AssociateOriginationIdentity
s {$sel:originationIdentity:AssociateOriginationIdentity' :: Text
originationIdentity = Text
a} :: AssociateOriginationIdentity)

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

instance Core.AWSRequest AssociateOriginationIdentity where
  type
    AWSResponse AssociateOriginationIdentity =
      AssociateOriginationIdentityResponse
  request :: (Service -> Service)
-> AssociateOriginationIdentity
-> Request AssociateOriginationIdentity
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy AssociateOriginationIdentity
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse AssociateOriginationIdentity)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Int
-> AssociateOriginationIdentityResponse
AssociateOriginationIdentityResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe 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 -> Either String (Maybe a)
Data..?> Key
"OriginationIdentity")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"OriginationIdentityArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"PoolArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"PoolId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance
  Prelude.Hashable
    AssociateOriginationIdentity
  where
  hashWithSalt :: Int -> AssociateOriginationIdentity -> Int
hashWithSalt Int
_salt AssociateOriginationIdentity' {Maybe Text
Text
isoCountryCode :: Text
originationIdentity :: Text
poolId :: Text
clientToken :: Maybe Text
$sel:isoCountryCode:AssociateOriginationIdentity' :: AssociateOriginationIdentity -> Text
$sel:originationIdentity:AssociateOriginationIdentity' :: AssociateOriginationIdentity -> Text
$sel:poolId:AssociateOriginationIdentity' :: AssociateOriginationIdentity -> Text
$sel:clientToken:AssociateOriginationIdentity' :: AssociateOriginationIdentity -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
clientToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
poolId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
originationIdentity
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
isoCountryCode

instance Prelude.NFData AssociateOriginationIdentity where
  rnf :: AssociateOriginationIdentity -> ()
rnf AssociateOriginationIdentity' {Maybe Text
Text
isoCountryCode :: Text
originationIdentity :: Text
poolId :: Text
clientToken :: Maybe Text
$sel:isoCountryCode:AssociateOriginationIdentity' :: AssociateOriginationIdentity -> Text
$sel:originationIdentity:AssociateOriginationIdentity' :: AssociateOriginationIdentity -> Text
$sel:poolId:AssociateOriginationIdentity' :: AssociateOriginationIdentity -> Text
$sel:clientToken:AssociateOriginationIdentity' :: AssociateOriginationIdentity -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
clientToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
poolId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
originationIdentity
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
isoCountryCode

instance Data.ToHeaders AssociateOriginationIdentity where
  toHeaders :: AssociateOriginationIdentity -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"PinpointSMSVoiceV2.AssociateOriginationIdentity" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.0" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON AssociateOriginationIdentity where
  toJSON :: AssociateOriginationIdentity -> Value
toJSON AssociateOriginationIdentity' {Maybe Text
Text
isoCountryCode :: Text
originationIdentity :: Text
poolId :: Text
clientToken :: Maybe Text
$sel:isoCountryCode:AssociateOriginationIdentity' :: AssociateOriginationIdentity -> Text
$sel:originationIdentity:AssociateOriginationIdentity' :: AssociateOriginationIdentity -> Text
$sel:poolId:AssociateOriginationIdentity' :: AssociateOriginationIdentity -> Text
$sel:clientToken:AssociateOriginationIdentity' :: AssociateOriginationIdentity -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"ClientToken" 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
clientToken,
            forall a. a -> Maybe a
Prelude.Just (Key
"PoolId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
poolId),
            forall a. a -> Maybe a
Prelude.Just
              (Key
"OriginationIdentity" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
originationIdentity),
            forall a. a -> Maybe a
Prelude.Just
              (Key
"IsoCountryCode" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
isoCountryCode)
          ]
      )

instance Data.ToPath AssociateOriginationIdentity where
  toPath :: AssociateOriginationIdentity -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Data.ToQuery AssociateOriginationIdentity where
  toQuery :: AssociateOriginationIdentity -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newAssociateOriginationIdentityResponse' smart constructor.
data AssociateOriginationIdentityResponse = AssociateOriginationIdentityResponse'
  { -- | The two-character code, in ISO 3166-1 alpha-2 format, for the country or
    -- region.
    AssociateOriginationIdentityResponse -> Maybe Text
isoCountryCode :: Prelude.Maybe Prelude.Text,
    -- | The PhoneNumberId or SenderId of the origination identity.
    AssociateOriginationIdentityResponse -> Maybe Text
originationIdentity :: Prelude.Maybe Prelude.Text,
    -- | The PhoneNumberArn or SenderIdArn of the origination identity.
    AssociateOriginationIdentityResponse -> Maybe Text
originationIdentityArn :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the pool that is now associated with
    -- the origination identity.
    AssociateOriginationIdentityResponse -> Maybe Text
poolArn :: Prelude.Maybe Prelude.Text,
    -- | The PoolId of the pool that is now associated with the origination
    -- identity.
    AssociateOriginationIdentityResponse -> Maybe Text
poolId :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    AssociateOriginationIdentityResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (AssociateOriginationIdentityResponse
-> AssociateOriginationIdentityResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AssociateOriginationIdentityResponse
-> AssociateOriginationIdentityResponse -> Bool
$c/= :: AssociateOriginationIdentityResponse
-> AssociateOriginationIdentityResponse -> Bool
== :: AssociateOriginationIdentityResponse
-> AssociateOriginationIdentityResponse -> Bool
$c== :: AssociateOriginationIdentityResponse
-> AssociateOriginationIdentityResponse -> Bool
Prelude.Eq, ReadPrec [AssociateOriginationIdentityResponse]
ReadPrec AssociateOriginationIdentityResponse
Int -> ReadS AssociateOriginationIdentityResponse
ReadS [AssociateOriginationIdentityResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AssociateOriginationIdentityResponse]
$creadListPrec :: ReadPrec [AssociateOriginationIdentityResponse]
readPrec :: ReadPrec AssociateOriginationIdentityResponse
$creadPrec :: ReadPrec AssociateOriginationIdentityResponse
readList :: ReadS [AssociateOriginationIdentityResponse]
$creadList :: ReadS [AssociateOriginationIdentityResponse]
readsPrec :: Int -> ReadS AssociateOriginationIdentityResponse
$creadsPrec :: Int -> ReadS AssociateOriginationIdentityResponse
Prelude.Read, Int -> AssociateOriginationIdentityResponse -> ShowS
[AssociateOriginationIdentityResponse] -> ShowS
AssociateOriginationIdentityResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AssociateOriginationIdentityResponse] -> ShowS
$cshowList :: [AssociateOriginationIdentityResponse] -> ShowS
show :: AssociateOriginationIdentityResponse -> String
$cshow :: AssociateOriginationIdentityResponse -> String
showsPrec :: Int -> AssociateOriginationIdentityResponse -> ShowS
$cshowsPrec :: Int -> AssociateOriginationIdentityResponse -> ShowS
Prelude.Show, forall x.
Rep AssociateOriginationIdentityResponse x
-> AssociateOriginationIdentityResponse
forall x.
AssociateOriginationIdentityResponse
-> Rep AssociateOriginationIdentityResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AssociateOriginationIdentityResponse x
-> AssociateOriginationIdentityResponse
$cfrom :: forall x.
AssociateOriginationIdentityResponse
-> Rep AssociateOriginationIdentityResponse x
Prelude.Generic)

-- |
-- Create a value of 'AssociateOriginationIdentityResponse' 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:
--
-- 'isoCountryCode', 'associateOriginationIdentityResponse_isoCountryCode' - The two-character code, in ISO 3166-1 alpha-2 format, for the country or
-- region.
--
-- 'originationIdentity', 'associateOriginationIdentityResponse_originationIdentity' - The PhoneNumberId or SenderId of the origination identity.
--
-- 'originationIdentityArn', 'associateOriginationIdentityResponse_originationIdentityArn' - The PhoneNumberArn or SenderIdArn of the origination identity.
--
-- 'poolArn', 'associateOriginationIdentityResponse_poolArn' - The Amazon Resource Name (ARN) of the pool that is now associated with
-- the origination identity.
--
-- 'poolId', 'associateOriginationIdentityResponse_poolId' - The PoolId of the pool that is now associated with the origination
-- identity.
--
-- 'httpStatus', 'associateOriginationIdentityResponse_httpStatus' - The response's http status code.
newAssociateOriginationIdentityResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  AssociateOriginationIdentityResponse
newAssociateOriginationIdentityResponse :: Int -> AssociateOriginationIdentityResponse
newAssociateOriginationIdentityResponse Int
pHttpStatus_ =
  AssociateOriginationIdentityResponse'
    { $sel:isoCountryCode:AssociateOriginationIdentityResponse' :: Maybe Text
isoCountryCode =
        forall a. Maybe a
Prelude.Nothing,
      $sel:originationIdentity:AssociateOriginationIdentityResponse' :: Maybe Text
originationIdentity = forall a. Maybe a
Prelude.Nothing,
      $sel:originationIdentityArn:AssociateOriginationIdentityResponse' :: Maybe Text
originationIdentityArn =
        forall a. Maybe a
Prelude.Nothing,
      $sel:poolArn:AssociateOriginationIdentityResponse' :: Maybe Text
poolArn = forall a. Maybe a
Prelude.Nothing,
      $sel:poolId:AssociateOriginationIdentityResponse' :: Maybe Text
poolId = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:AssociateOriginationIdentityResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

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

-- | The PhoneNumberId or SenderId of the origination identity.
associateOriginationIdentityResponse_originationIdentity :: Lens.Lens' AssociateOriginationIdentityResponse (Prelude.Maybe Prelude.Text)
associateOriginationIdentityResponse_originationIdentity :: Lens' AssociateOriginationIdentityResponse (Maybe Text)
associateOriginationIdentityResponse_originationIdentity = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateOriginationIdentityResponse' {Maybe Text
originationIdentity :: Maybe Text
$sel:originationIdentity:AssociateOriginationIdentityResponse' :: AssociateOriginationIdentityResponse -> Maybe Text
originationIdentity} -> Maybe Text
originationIdentity) (\s :: AssociateOriginationIdentityResponse
s@AssociateOriginationIdentityResponse' {} Maybe Text
a -> AssociateOriginationIdentityResponse
s {$sel:originationIdentity:AssociateOriginationIdentityResponse' :: Maybe Text
originationIdentity = Maybe Text
a} :: AssociateOriginationIdentityResponse)

-- | The PhoneNumberArn or SenderIdArn of the origination identity.
associateOriginationIdentityResponse_originationIdentityArn :: Lens.Lens' AssociateOriginationIdentityResponse (Prelude.Maybe Prelude.Text)
associateOriginationIdentityResponse_originationIdentityArn :: Lens' AssociateOriginationIdentityResponse (Maybe Text)
associateOriginationIdentityResponse_originationIdentityArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateOriginationIdentityResponse' {Maybe Text
originationIdentityArn :: Maybe Text
$sel:originationIdentityArn:AssociateOriginationIdentityResponse' :: AssociateOriginationIdentityResponse -> Maybe Text
originationIdentityArn} -> Maybe Text
originationIdentityArn) (\s :: AssociateOriginationIdentityResponse
s@AssociateOriginationIdentityResponse' {} Maybe Text
a -> AssociateOriginationIdentityResponse
s {$sel:originationIdentityArn:AssociateOriginationIdentityResponse' :: Maybe Text
originationIdentityArn = Maybe Text
a} :: AssociateOriginationIdentityResponse)

-- | The Amazon Resource Name (ARN) of the pool that is now associated with
-- the origination identity.
associateOriginationIdentityResponse_poolArn :: Lens.Lens' AssociateOriginationIdentityResponse (Prelude.Maybe Prelude.Text)
associateOriginationIdentityResponse_poolArn :: Lens' AssociateOriginationIdentityResponse (Maybe Text)
associateOriginationIdentityResponse_poolArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateOriginationIdentityResponse' {Maybe Text
poolArn :: Maybe Text
$sel:poolArn:AssociateOriginationIdentityResponse' :: AssociateOriginationIdentityResponse -> Maybe Text
poolArn} -> Maybe Text
poolArn) (\s :: AssociateOriginationIdentityResponse
s@AssociateOriginationIdentityResponse' {} Maybe Text
a -> AssociateOriginationIdentityResponse
s {$sel:poolArn:AssociateOriginationIdentityResponse' :: Maybe Text
poolArn = Maybe Text
a} :: AssociateOriginationIdentityResponse)

-- | The PoolId of the pool that is now associated with the origination
-- identity.
associateOriginationIdentityResponse_poolId :: Lens.Lens' AssociateOriginationIdentityResponse (Prelude.Maybe Prelude.Text)
associateOriginationIdentityResponse_poolId :: Lens' AssociateOriginationIdentityResponse (Maybe Text)
associateOriginationIdentityResponse_poolId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateOriginationIdentityResponse' {Maybe Text
poolId :: Maybe Text
$sel:poolId:AssociateOriginationIdentityResponse' :: AssociateOriginationIdentityResponse -> Maybe Text
poolId} -> Maybe Text
poolId) (\s :: AssociateOriginationIdentityResponse
s@AssociateOriginationIdentityResponse' {} Maybe Text
a -> AssociateOriginationIdentityResponse
s {$sel:poolId:AssociateOriginationIdentityResponse' :: Maybe Text
poolId = Maybe Text
a} :: AssociateOriginationIdentityResponse)

-- | The response's http status code.
associateOriginationIdentityResponse_httpStatus :: Lens.Lens' AssociateOriginationIdentityResponse Prelude.Int
associateOriginationIdentityResponse_httpStatus :: Lens' AssociateOriginationIdentityResponse Int
associateOriginationIdentityResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateOriginationIdentityResponse' {Int
httpStatus :: Int
$sel:httpStatus:AssociateOriginationIdentityResponse' :: AssociateOriginationIdentityResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: AssociateOriginationIdentityResponse
s@AssociateOriginationIdentityResponse' {} Int
a -> AssociateOriginationIdentityResponse
s {$sel:httpStatus:AssociateOriginationIdentityResponse' :: Int
httpStatus = Int
a} :: AssociateOriginationIdentityResponse)

instance
  Prelude.NFData
    AssociateOriginationIdentityResponse
  where
  rnf :: AssociateOriginationIdentityResponse -> ()
rnf AssociateOriginationIdentityResponse' {Int
Maybe Text
httpStatus :: Int
poolId :: Maybe Text
poolArn :: Maybe Text
originationIdentityArn :: Maybe Text
originationIdentity :: Maybe Text
isoCountryCode :: Maybe Text
$sel:httpStatus:AssociateOriginationIdentityResponse' :: AssociateOriginationIdentityResponse -> Int
$sel:poolId:AssociateOriginationIdentityResponse' :: AssociateOriginationIdentityResponse -> Maybe Text
$sel:poolArn:AssociateOriginationIdentityResponse' :: AssociateOriginationIdentityResponse -> Maybe Text
$sel:originationIdentityArn:AssociateOriginationIdentityResponse' :: AssociateOriginationIdentityResponse -> Maybe Text
$sel:originationIdentity:AssociateOriginationIdentityResponse' :: AssociateOriginationIdentityResponse -> Maybe Text
$sel:isoCountryCode:AssociateOriginationIdentityResponse' :: AssociateOriginationIdentityResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
isoCountryCode
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
originationIdentity
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
originationIdentityArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
poolArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
poolId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus