{-# 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.SNS.ListOriginationNumbers
-- 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)
--
-- Lists the calling account\'s dedicated origination numbers and their
-- metadata. For more information about origination numbers, see
-- <https://docs.aws.amazon.com/sns/latest/dg/channels-sms-originating-identities-origination-numbers.html Origination numbers>
-- in the /Amazon SNS Developer Guide/.
--
-- This operation returns paginated results.
module Amazonka.SNS.ListOriginationNumbers
  ( -- * Creating a Request
    ListOriginationNumbers (..),
    newListOriginationNumbers,

    -- * Request Lenses
    listOriginationNumbers_nextToken,
    listOriginationNumbers_maxResults,

    -- * Destructuring the Response
    ListOriginationNumbersResponse (..),
    newListOriginationNumbersResponse,

    -- * Response Lenses
    listOriginationNumbersResponse_nextToken,
    listOriginationNumbersResponse_phoneNumbers,
    listOriginationNumbersResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.SNS.Types

-- | /See:/ 'newListOriginationNumbers' smart constructor.
data ListOriginationNumbers = ListOriginationNumbers'
  { -- | Token that the previous @ListOriginationNumbers@ request returns.
    ListOriginationNumbers -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of origination numbers to return.
    ListOriginationNumbers -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
  }
  deriving (ListOriginationNumbers -> ListOriginationNumbers -> Bool
(ListOriginationNumbers -> ListOriginationNumbers -> Bool)
-> (ListOriginationNumbers -> ListOriginationNumbers -> Bool)
-> Eq ListOriginationNumbers
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListOriginationNumbers -> ListOriginationNumbers -> Bool
$c/= :: ListOriginationNumbers -> ListOriginationNumbers -> Bool
== :: ListOriginationNumbers -> ListOriginationNumbers -> Bool
$c== :: ListOriginationNumbers -> ListOriginationNumbers -> Bool
Prelude.Eq, ReadPrec [ListOriginationNumbers]
ReadPrec ListOriginationNumbers
Int -> ReadS ListOriginationNumbers
ReadS [ListOriginationNumbers]
(Int -> ReadS ListOriginationNumbers)
-> ReadS [ListOriginationNumbers]
-> ReadPrec ListOriginationNumbers
-> ReadPrec [ListOriginationNumbers]
-> Read ListOriginationNumbers
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListOriginationNumbers]
$creadListPrec :: ReadPrec [ListOriginationNumbers]
readPrec :: ReadPrec ListOriginationNumbers
$creadPrec :: ReadPrec ListOriginationNumbers
readList :: ReadS [ListOriginationNumbers]
$creadList :: ReadS [ListOriginationNumbers]
readsPrec :: Int -> ReadS ListOriginationNumbers
$creadsPrec :: Int -> ReadS ListOriginationNumbers
Prelude.Read, Int -> ListOriginationNumbers -> ShowS
[ListOriginationNumbers] -> ShowS
ListOriginationNumbers -> String
(Int -> ListOriginationNumbers -> ShowS)
-> (ListOriginationNumbers -> String)
-> ([ListOriginationNumbers] -> ShowS)
-> Show ListOriginationNumbers
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListOriginationNumbers] -> ShowS
$cshowList :: [ListOriginationNumbers] -> ShowS
show :: ListOriginationNumbers -> String
$cshow :: ListOriginationNumbers -> String
showsPrec :: Int -> ListOriginationNumbers -> ShowS
$cshowsPrec :: Int -> ListOriginationNumbers -> ShowS
Prelude.Show, (forall x. ListOriginationNumbers -> Rep ListOriginationNumbers x)
-> (forall x.
    Rep ListOriginationNumbers x -> ListOriginationNumbers)
-> Generic ListOriginationNumbers
forall x. Rep ListOriginationNumbers x -> ListOriginationNumbers
forall x. ListOriginationNumbers -> Rep ListOriginationNumbers x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListOriginationNumbers x -> ListOriginationNumbers
$cfrom :: forall x. ListOriginationNumbers -> Rep ListOriginationNumbers x
Prelude.Generic)

-- |
-- Create a value of 'ListOriginationNumbers' 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:
--
-- 'nextToken', 'listOriginationNumbers_nextToken' - Token that the previous @ListOriginationNumbers@ request returns.
--
-- 'maxResults', 'listOriginationNumbers_maxResults' - The maximum number of origination numbers to return.
newListOriginationNumbers ::
  ListOriginationNumbers
newListOriginationNumbers :: ListOriginationNumbers
newListOriginationNumbers =
  ListOriginationNumbers' :: Maybe Text -> Maybe Natural -> ListOriginationNumbers
ListOriginationNumbers'
    { $sel:nextToken:ListOriginationNumbers' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListOriginationNumbers' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | Token that the previous @ListOriginationNumbers@ request returns.
listOriginationNumbers_nextToken :: Lens.Lens' ListOriginationNumbers (Prelude.Maybe Prelude.Text)
listOriginationNumbers_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListOriginationNumbers -> f ListOriginationNumbers
listOriginationNumbers_nextToken = (ListOriginationNumbers -> Maybe Text)
-> (ListOriginationNumbers -> Maybe Text -> ListOriginationNumbers)
-> Lens
     ListOriginationNumbers
     ListOriginationNumbers
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListOriginationNumbers' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListOriginationNumbers' :: ListOriginationNumbers -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListOriginationNumbers
s@ListOriginationNumbers' {} Maybe Text
a -> ListOriginationNumbers
s {$sel:nextToken:ListOriginationNumbers' :: Maybe Text
nextToken = Maybe Text
a} :: ListOriginationNumbers)

-- | The maximum number of origination numbers to return.
listOriginationNumbers_maxResults :: Lens.Lens' ListOriginationNumbers (Prelude.Maybe Prelude.Natural)
listOriginationNumbers_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListOriginationNumbers -> f ListOriginationNumbers
listOriginationNumbers_maxResults = (ListOriginationNumbers -> Maybe Natural)
-> (ListOriginationNumbers
    -> Maybe Natural -> ListOriginationNumbers)
-> Lens
     ListOriginationNumbers
     ListOriginationNumbers
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListOriginationNumbers' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListOriginationNumbers' :: ListOriginationNumbers -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListOriginationNumbers
s@ListOriginationNumbers' {} Maybe Natural
a -> ListOriginationNumbers
s {$sel:maxResults:ListOriginationNumbers' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListOriginationNumbers)

instance Core.AWSPager ListOriginationNumbers where
  page :: ListOriginationNumbers
-> AWSResponse ListOriginationNumbers
-> Maybe ListOriginationNumbers
page ListOriginationNumbers
rq AWSResponse ListOriginationNumbers
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListOriginationNumbers
ListOriginationNumbersResponse
rs
            ListOriginationNumbersResponse
-> Getting (First Text) ListOriginationNumbersResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListOriginationNumbersResponse
-> Const (First Text) ListOriginationNumbersResponse
Lens' ListOriginationNumbersResponse (Maybe Text)
listOriginationNumbersResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListOriginationNumbersResponse
 -> Const (First Text) ListOriginationNumbersResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListOriginationNumbersResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListOriginationNumbers
forall a. Maybe a
Prelude.Nothing
    | Maybe [PhoneNumberInformation] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListOriginationNumbers
ListOriginationNumbersResponse
rs
            ListOriginationNumbersResponse
-> Getting
     (First [PhoneNumberInformation])
     ListOriginationNumbersResponse
     [PhoneNumberInformation]
-> Maybe [PhoneNumberInformation]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [PhoneNumberInformation]
 -> Const
      (First [PhoneNumberInformation]) (Maybe [PhoneNumberInformation]))
-> ListOriginationNumbersResponse
-> Const
     (First [PhoneNumberInformation]) ListOriginationNumbersResponse
Lens'
  ListOriginationNumbersResponse (Maybe [PhoneNumberInformation])
listOriginationNumbersResponse_phoneNumbers
              ((Maybe [PhoneNumberInformation]
  -> Const
       (First [PhoneNumberInformation]) (Maybe [PhoneNumberInformation]))
 -> ListOriginationNumbersResponse
 -> Const
      (First [PhoneNumberInformation]) ListOriginationNumbersResponse)
-> (([PhoneNumberInformation]
     -> Const (First [PhoneNumberInformation]) [PhoneNumberInformation])
    -> Maybe [PhoneNumberInformation]
    -> Const
         (First [PhoneNumberInformation]) (Maybe [PhoneNumberInformation]))
-> Getting
     (First [PhoneNumberInformation])
     ListOriginationNumbersResponse
     [PhoneNumberInformation]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([PhoneNumberInformation]
 -> Const (First [PhoneNumberInformation]) [PhoneNumberInformation])
-> Maybe [PhoneNumberInformation]
-> Const
     (First [PhoneNumberInformation]) (Maybe [PhoneNumberInformation])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListOriginationNumbers
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListOriginationNumbers -> Maybe ListOriginationNumbers
forall a. a -> Maybe a
Prelude.Just (ListOriginationNumbers -> Maybe ListOriginationNumbers)
-> ListOriginationNumbers -> Maybe ListOriginationNumbers
forall a b. (a -> b) -> a -> b
Prelude.$
        ListOriginationNumbers
rq
          ListOriginationNumbers
-> (ListOriginationNumbers -> ListOriginationNumbers)
-> ListOriginationNumbers
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListOriginationNumbers -> Identity ListOriginationNumbers
Lens
  ListOriginationNumbers
  ListOriginationNumbers
  (Maybe Text)
  (Maybe Text)
listOriginationNumbers_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListOriginationNumbers -> Identity ListOriginationNumbers)
-> Maybe Text -> ListOriginationNumbers -> ListOriginationNumbers
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListOriginationNumbers
ListOriginationNumbersResponse
rs
          ListOriginationNumbersResponse
-> Getting (First Text) ListOriginationNumbersResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListOriginationNumbersResponse
-> Const (First Text) ListOriginationNumbersResponse
Lens' ListOriginationNumbersResponse (Maybe Text)
listOriginationNumbersResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListOriginationNumbersResponse
 -> Const (First Text) ListOriginationNumbersResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListOriginationNumbersResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest ListOriginationNumbers where
  type
    AWSResponse ListOriginationNumbers =
      ListOriginationNumbersResponse
  request :: ListOriginationNumbers -> Request ListOriginationNumbers
request = Service -> ListOriginationNumbers -> Request ListOriginationNumbers
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
  response :: Logger
-> Service
-> Proxy ListOriginationNumbers
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListOriginationNumbers)))
response =
    Text
-> (Int
    -> ResponseHeaders
    -> [Node]
    -> Either String (AWSResponse ListOriginationNumbers))
-> Logger
-> Service
-> Proxy ListOriginationNumbers
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListOriginationNumbers)))
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
    -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
      Text
"ListOriginationNumbersResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe Text
-> Maybe [PhoneNumberInformation]
-> Int
-> ListOriginationNumbersResponse
ListOriginationNumbersResponse'
            (Maybe Text
 -> Maybe [PhoneNumberInformation]
 -> Int
 -> ListOriginationNumbersResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [PhoneNumberInformation]
      -> Int -> ListOriginationNumbersResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"NextToken")
            Either
  String
  (Maybe [PhoneNumberInformation]
   -> Int -> ListOriginationNumbersResponse)
-> Either String (Maybe [PhoneNumberInformation])
-> Either String (Int -> ListOriginationNumbersResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"PhoneNumbers" Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
                            Either String [Node]
-> ([Node] -> Either String (Maybe [PhoneNumberInformation]))
-> Either String (Maybe [PhoneNumberInformation])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [PhoneNumberInformation])
-> [Node] -> Either String (Maybe [PhoneNumberInformation])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [PhoneNumberInformation]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"member")
                        )
            Either String (Int -> ListOriginationNumbersResponse)
-> Either String Int
-> Either String ListOriginationNumbersResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable ListOriginationNumbers

instance Prelude.NFData ListOriginationNumbers

instance Core.ToHeaders ListOriginationNumbers where
  toHeaders :: ListOriginationNumbers -> ResponseHeaders
toHeaders = ResponseHeaders -> ListOriginationNumbers -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty

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

instance Core.ToQuery ListOriginationNumbers where
  toQuery :: ListOriginationNumbers -> QueryString
toQuery ListOriginationNumbers' {Maybe Natural
Maybe Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:maxResults:ListOriginationNumbers' :: ListOriginationNumbers -> Maybe Natural
$sel:nextToken:ListOriginationNumbers' :: ListOriginationNumbers -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"ListOriginationNumbers" :: Prelude.ByteString),
        ByteString
"Version"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2010-03-31" :: Prelude.ByteString),
        ByteString
"NextToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
nextToken,
        ByteString
"MaxResults" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
maxResults
      ]

-- | /See:/ 'newListOriginationNumbersResponse' smart constructor.
data ListOriginationNumbersResponse = ListOriginationNumbersResponse'
  { -- | A @NextToken@ string is returned when you call the
    -- @ListOriginationNumbers@ operation if additional pages of records are
    -- available.
    ListOriginationNumbersResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | A list of the calling account\'s verified and pending origination
    -- numbers.
    ListOriginationNumbersResponse -> Maybe [PhoneNumberInformation]
phoneNumbers :: Prelude.Maybe [PhoneNumberInformation],
    -- | The response's http status code.
    ListOriginationNumbersResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListOriginationNumbersResponse
-> ListOriginationNumbersResponse -> Bool
(ListOriginationNumbersResponse
 -> ListOriginationNumbersResponse -> Bool)
-> (ListOriginationNumbersResponse
    -> ListOriginationNumbersResponse -> Bool)
-> Eq ListOriginationNumbersResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListOriginationNumbersResponse
-> ListOriginationNumbersResponse -> Bool
$c/= :: ListOriginationNumbersResponse
-> ListOriginationNumbersResponse -> Bool
== :: ListOriginationNumbersResponse
-> ListOriginationNumbersResponse -> Bool
$c== :: ListOriginationNumbersResponse
-> ListOriginationNumbersResponse -> Bool
Prelude.Eq, ReadPrec [ListOriginationNumbersResponse]
ReadPrec ListOriginationNumbersResponse
Int -> ReadS ListOriginationNumbersResponse
ReadS [ListOriginationNumbersResponse]
(Int -> ReadS ListOriginationNumbersResponse)
-> ReadS [ListOriginationNumbersResponse]
-> ReadPrec ListOriginationNumbersResponse
-> ReadPrec [ListOriginationNumbersResponse]
-> Read ListOriginationNumbersResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListOriginationNumbersResponse]
$creadListPrec :: ReadPrec [ListOriginationNumbersResponse]
readPrec :: ReadPrec ListOriginationNumbersResponse
$creadPrec :: ReadPrec ListOriginationNumbersResponse
readList :: ReadS [ListOriginationNumbersResponse]
$creadList :: ReadS [ListOriginationNumbersResponse]
readsPrec :: Int -> ReadS ListOriginationNumbersResponse
$creadsPrec :: Int -> ReadS ListOriginationNumbersResponse
Prelude.Read, Int -> ListOriginationNumbersResponse -> ShowS
[ListOriginationNumbersResponse] -> ShowS
ListOriginationNumbersResponse -> String
(Int -> ListOriginationNumbersResponse -> ShowS)
-> (ListOriginationNumbersResponse -> String)
-> ([ListOriginationNumbersResponse] -> ShowS)
-> Show ListOriginationNumbersResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListOriginationNumbersResponse] -> ShowS
$cshowList :: [ListOriginationNumbersResponse] -> ShowS
show :: ListOriginationNumbersResponse -> String
$cshow :: ListOriginationNumbersResponse -> String
showsPrec :: Int -> ListOriginationNumbersResponse -> ShowS
$cshowsPrec :: Int -> ListOriginationNumbersResponse -> ShowS
Prelude.Show, (forall x.
 ListOriginationNumbersResponse
 -> Rep ListOriginationNumbersResponse x)
-> (forall x.
    Rep ListOriginationNumbersResponse x
    -> ListOriginationNumbersResponse)
-> Generic ListOriginationNumbersResponse
forall x.
Rep ListOriginationNumbersResponse x
-> ListOriginationNumbersResponse
forall x.
ListOriginationNumbersResponse
-> Rep ListOriginationNumbersResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListOriginationNumbersResponse x
-> ListOriginationNumbersResponse
$cfrom :: forall x.
ListOriginationNumbersResponse
-> Rep ListOriginationNumbersResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListOriginationNumbersResponse' 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:
--
-- 'nextToken', 'listOriginationNumbersResponse_nextToken' - A @NextToken@ string is returned when you call the
-- @ListOriginationNumbers@ operation if additional pages of records are
-- available.
--
-- 'phoneNumbers', 'listOriginationNumbersResponse_phoneNumbers' - A list of the calling account\'s verified and pending origination
-- numbers.
--
-- 'httpStatus', 'listOriginationNumbersResponse_httpStatus' - The response's http status code.
newListOriginationNumbersResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListOriginationNumbersResponse
newListOriginationNumbersResponse :: Int -> ListOriginationNumbersResponse
newListOriginationNumbersResponse Int
pHttpStatus_ =
  ListOriginationNumbersResponse' :: Maybe Text
-> Maybe [PhoneNumberInformation]
-> Int
-> ListOriginationNumbersResponse
ListOriginationNumbersResponse'
    { $sel:nextToken:ListOriginationNumbersResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:phoneNumbers:ListOriginationNumbersResponse' :: Maybe [PhoneNumberInformation]
phoneNumbers = Maybe [PhoneNumberInformation]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListOriginationNumbersResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A @NextToken@ string is returned when you call the
-- @ListOriginationNumbers@ operation if additional pages of records are
-- available.
listOriginationNumbersResponse_nextToken :: Lens.Lens' ListOriginationNumbersResponse (Prelude.Maybe Prelude.Text)
listOriginationNumbersResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListOriginationNumbersResponse
-> f ListOriginationNumbersResponse
listOriginationNumbersResponse_nextToken = (ListOriginationNumbersResponse -> Maybe Text)
-> (ListOriginationNumbersResponse
    -> Maybe Text -> ListOriginationNumbersResponse)
-> Lens' ListOriginationNumbersResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListOriginationNumbersResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListOriginationNumbersResponse' :: ListOriginationNumbersResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListOriginationNumbersResponse
s@ListOriginationNumbersResponse' {} Maybe Text
a -> ListOriginationNumbersResponse
s {$sel:nextToken:ListOriginationNumbersResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListOriginationNumbersResponse)

-- | A list of the calling account\'s verified and pending origination
-- numbers.
listOriginationNumbersResponse_phoneNumbers :: Lens.Lens' ListOriginationNumbersResponse (Prelude.Maybe [PhoneNumberInformation])
listOriginationNumbersResponse_phoneNumbers :: (Maybe [PhoneNumberInformation]
 -> f (Maybe [PhoneNumberInformation]))
-> ListOriginationNumbersResponse
-> f ListOriginationNumbersResponse
listOriginationNumbersResponse_phoneNumbers = (ListOriginationNumbersResponse -> Maybe [PhoneNumberInformation])
-> (ListOriginationNumbersResponse
    -> Maybe [PhoneNumberInformation]
    -> ListOriginationNumbersResponse)
-> Lens'
     ListOriginationNumbersResponse (Maybe [PhoneNumberInformation])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListOriginationNumbersResponse' {Maybe [PhoneNumberInformation]
phoneNumbers :: Maybe [PhoneNumberInformation]
$sel:phoneNumbers:ListOriginationNumbersResponse' :: ListOriginationNumbersResponse -> Maybe [PhoneNumberInformation]
phoneNumbers} -> Maybe [PhoneNumberInformation]
phoneNumbers) (\s :: ListOriginationNumbersResponse
s@ListOriginationNumbersResponse' {} Maybe [PhoneNumberInformation]
a -> ListOriginationNumbersResponse
s {$sel:phoneNumbers:ListOriginationNumbersResponse' :: Maybe [PhoneNumberInformation]
phoneNumbers = Maybe [PhoneNumberInformation]
a} :: ListOriginationNumbersResponse) ((Maybe [PhoneNumberInformation]
  -> f (Maybe [PhoneNumberInformation]))
 -> ListOriginationNumbersResponse
 -> f ListOriginationNumbersResponse)
-> ((Maybe [PhoneNumberInformation]
     -> f (Maybe [PhoneNumberInformation]))
    -> Maybe [PhoneNumberInformation]
    -> f (Maybe [PhoneNumberInformation]))
-> (Maybe [PhoneNumberInformation]
    -> f (Maybe [PhoneNumberInformation]))
-> ListOriginationNumbersResponse
-> f ListOriginationNumbersResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [PhoneNumberInformation]
  [PhoneNumberInformation]
  [PhoneNumberInformation]
  [PhoneNumberInformation]
-> Iso
     (Maybe [PhoneNumberInformation])
     (Maybe [PhoneNumberInformation])
     (Maybe [PhoneNumberInformation])
     (Maybe [PhoneNumberInformation])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  [PhoneNumberInformation]
  [PhoneNumberInformation]
  [PhoneNumberInformation]
  [PhoneNumberInformation]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance
  Prelude.NFData
    ListOriginationNumbersResponse