{-# 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.Chime.ListPhoneNumbers
-- 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 phone numbers for the specified Amazon Chime account, Amazon
-- Chime user, Amazon Chime Voice Connector, or Amazon Chime Voice
-- Connector group.
module Amazonka.Chime.ListPhoneNumbers
  ( -- * Creating a Request
    ListPhoneNumbers (..),
    newListPhoneNumbers,

    -- * Request Lenses
    listPhoneNumbers_status,
    listPhoneNumbers_filterName,
    listPhoneNumbers_productType,
    listPhoneNumbers_nextToken,
    listPhoneNumbers_filterValue,
    listPhoneNumbers_maxResults,

    -- * Destructuring the Response
    ListPhoneNumbersResponse (..),
    newListPhoneNumbersResponse,

    -- * Response Lenses
    listPhoneNumbersResponse_nextToken,
    listPhoneNumbersResponse_phoneNumbers,
    listPhoneNumbersResponse_httpStatus,
  )
where

import Amazonka.Chime.Types
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

-- | /See:/ 'newListPhoneNumbers' smart constructor.
data ListPhoneNumbers = ListPhoneNumbers'
  { -- | The phone number status.
    ListPhoneNumbers -> Maybe PhoneNumberStatus
status :: Prelude.Maybe PhoneNumberStatus,
    -- | The filter to use to limit the number of results.
    ListPhoneNumbers -> Maybe PhoneNumberAssociationName
filterName :: Prelude.Maybe PhoneNumberAssociationName,
    -- | The phone number product type.
    ListPhoneNumbers -> Maybe PhoneNumberProductType
productType :: Prelude.Maybe PhoneNumberProductType,
    -- | The token to use to retrieve the next page of results.
    ListPhoneNumbers -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The value to use for the filter.
    ListPhoneNumbers -> Maybe Text
filterValue :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of results to return in a single call.
    ListPhoneNumbers -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
  }
  deriving (ListPhoneNumbers -> ListPhoneNumbers -> Bool
(ListPhoneNumbers -> ListPhoneNumbers -> Bool)
-> (ListPhoneNumbers -> ListPhoneNumbers -> Bool)
-> Eq ListPhoneNumbers
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListPhoneNumbers -> ListPhoneNumbers -> Bool
$c/= :: ListPhoneNumbers -> ListPhoneNumbers -> Bool
== :: ListPhoneNumbers -> ListPhoneNumbers -> Bool
$c== :: ListPhoneNumbers -> ListPhoneNumbers -> Bool
Prelude.Eq, ReadPrec [ListPhoneNumbers]
ReadPrec ListPhoneNumbers
Int -> ReadS ListPhoneNumbers
ReadS [ListPhoneNumbers]
(Int -> ReadS ListPhoneNumbers)
-> ReadS [ListPhoneNumbers]
-> ReadPrec ListPhoneNumbers
-> ReadPrec [ListPhoneNumbers]
-> Read ListPhoneNumbers
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListPhoneNumbers]
$creadListPrec :: ReadPrec [ListPhoneNumbers]
readPrec :: ReadPrec ListPhoneNumbers
$creadPrec :: ReadPrec ListPhoneNumbers
readList :: ReadS [ListPhoneNumbers]
$creadList :: ReadS [ListPhoneNumbers]
readsPrec :: Int -> ReadS ListPhoneNumbers
$creadsPrec :: Int -> ReadS ListPhoneNumbers
Prelude.Read, Int -> ListPhoneNumbers -> ShowS
[ListPhoneNumbers] -> ShowS
ListPhoneNumbers -> String
(Int -> ListPhoneNumbers -> ShowS)
-> (ListPhoneNumbers -> String)
-> ([ListPhoneNumbers] -> ShowS)
-> Show ListPhoneNumbers
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListPhoneNumbers] -> ShowS
$cshowList :: [ListPhoneNumbers] -> ShowS
show :: ListPhoneNumbers -> String
$cshow :: ListPhoneNumbers -> String
showsPrec :: Int -> ListPhoneNumbers -> ShowS
$cshowsPrec :: Int -> ListPhoneNumbers -> ShowS
Prelude.Show, (forall x. ListPhoneNumbers -> Rep ListPhoneNumbers x)
-> (forall x. Rep ListPhoneNumbers x -> ListPhoneNumbers)
-> Generic ListPhoneNumbers
forall x. Rep ListPhoneNumbers x -> ListPhoneNumbers
forall x. ListPhoneNumbers -> Rep ListPhoneNumbers x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListPhoneNumbers x -> ListPhoneNumbers
$cfrom :: forall x. ListPhoneNumbers -> Rep ListPhoneNumbers x
Prelude.Generic)

-- |
-- Create a value of 'ListPhoneNumbers' 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:
--
-- 'status', 'listPhoneNumbers_status' - The phone number status.
--
-- 'filterName', 'listPhoneNumbers_filterName' - The filter to use to limit the number of results.
--
-- 'productType', 'listPhoneNumbers_productType' - The phone number product type.
--
-- 'nextToken', 'listPhoneNumbers_nextToken' - The token to use to retrieve the next page of results.
--
-- 'filterValue', 'listPhoneNumbers_filterValue' - The value to use for the filter.
--
-- 'maxResults', 'listPhoneNumbers_maxResults' - The maximum number of results to return in a single call.
newListPhoneNumbers ::
  ListPhoneNumbers
newListPhoneNumbers :: ListPhoneNumbers
newListPhoneNumbers =
  ListPhoneNumbers' :: Maybe PhoneNumberStatus
-> Maybe PhoneNumberAssociationName
-> Maybe PhoneNumberProductType
-> Maybe Text
-> Maybe Text
-> Maybe Natural
-> ListPhoneNumbers
ListPhoneNumbers'
    { $sel:status:ListPhoneNumbers' :: Maybe PhoneNumberStatus
status = Maybe PhoneNumberStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:filterName:ListPhoneNumbers' :: Maybe PhoneNumberAssociationName
filterName = Maybe PhoneNumberAssociationName
forall a. Maybe a
Prelude.Nothing,
      $sel:productType:ListPhoneNumbers' :: Maybe PhoneNumberProductType
productType = Maybe PhoneNumberProductType
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListPhoneNumbers' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:filterValue:ListPhoneNumbers' :: Maybe Text
filterValue = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListPhoneNumbers' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | The phone number status.
listPhoneNumbers_status :: Lens.Lens' ListPhoneNumbers (Prelude.Maybe PhoneNumberStatus)
listPhoneNumbers_status :: (Maybe PhoneNumberStatus -> f (Maybe PhoneNumberStatus))
-> ListPhoneNumbers -> f ListPhoneNumbers
listPhoneNumbers_status = (ListPhoneNumbers -> Maybe PhoneNumberStatus)
-> (ListPhoneNumbers
    -> Maybe PhoneNumberStatus -> ListPhoneNumbers)
-> Lens
     ListPhoneNumbers
     ListPhoneNumbers
     (Maybe PhoneNumberStatus)
     (Maybe PhoneNumberStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPhoneNumbers' {Maybe PhoneNumberStatus
status :: Maybe PhoneNumberStatus
$sel:status:ListPhoneNumbers' :: ListPhoneNumbers -> Maybe PhoneNumberStatus
status} -> Maybe PhoneNumberStatus
status) (\s :: ListPhoneNumbers
s@ListPhoneNumbers' {} Maybe PhoneNumberStatus
a -> ListPhoneNumbers
s {$sel:status:ListPhoneNumbers' :: Maybe PhoneNumberStatus
status = Maybe PhoneNumberStatus
a} :: ListPhoneNumbers)

-- | The filter to use to limit the number of results.
listPhoneNumbers_filterName :: Lens.Lens' ListPhoneNumbers (Prelude.Maybe PhoneNumberAssociationName)
listPhoneNumbers_filterName :: (Maybe PhoneNumberAssociationName
 -> f (Maybe PhoneNumberAssociationName))
-> ListPhoneNumbers -> f ListPhoneNumbers
listPhoneNumbers_filterName = (ListPhoneNumbers -> Maybe PhoneNumberAssociationName)
-> (ListPhoneNumbers
    -> Maybe PhoneNumberAssociationName -> ListPhoneNumbers)
-> Lens
     ListPhoneNumbers
     ListPhoneNumbers
     (Maybe PhoneNumberAssociationName)
     (Maybe PhoneNumberAssociationName)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPhoneNumbers' {Maybe PhoneNumberAssociationName
filterName :: Maybe PhoneNumberAssociationName
$sel:filterName:ListPhoneNumbers' :: ListPhoneNumbers -> Maybe PhoneNumberAssociationName
filterName} -> Maybe PhoneNumberAssociationName
filterName) (\s :: ListPhoneNumbers
s@ListPhoneNumbers' {} Maybe PhoneNumberAssociationName
a -> ListPhoneNumbers
s {$sel:filterName:ListPhoneNumbers' :: Maybe PhoneNumberAssociationName
filterName = Maybe PhoneNumberAssociationName
a} :: ListPhoneNumbers)

-- | The phone number product type.
listPhoneNumbers_productType :: Lens.Lens' ListPhoneNumbers (Prelude.Maybe PhoneNumberProductType)
listPhoneNumbers_productType :: (Maybe PhoneNumberProductType -> f (Maybe PhoneNumberProductType))
-> ListPhoneNumbers -> f ListPhoneNumbers
listPhoneNumbers_productType = (ListPhoneNumbers -> Maybe PhoneNumberProductType)
-> (ListPhoneNumbers
    -> Maybe PhoneNumberProductType -> ListPhoneNumbers)
-> Lens
     ListPhoneNumbers
     ListPhoneNumbers
     (Maybe PhoneNumberProductType)
     (Maybe PhoneNumberProductType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPhoneNumbers' {Maybe PhoneNumberProductType
productType :: Maybe PhoneNumberProductType
$sel:productType:ListPhoneNumbers' :: ListPhoneNumbers -> Maybe PhoneNumberProductType
productType} -> Maybe PhoneNumberProductType
productType) (\s :: ListPhoneNumbers
s@ListPhoneNumbers' {} Maybe PhoneNumberProductType
a -> ListPhoneNumbers
s {$sel:productType:ListPhoneNumbers' :: Maybe PhoneNumberProductType
productType = Maybe PhoneNumberProductType
a} :: ListPhoneNumbers)

-- | The token to use to retrieve the next page of results.
listPhoneNumbers_nextToken :: Lens.Lens' ListPhoneNumbers (Prelude.Maybe Prelude.Text)
listPhoneNumbers_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListPhoneNumbers -> f ListPhoneNumbers
listPhoneNumbers_nextToken = (ListPhoneNumbers -> Maybe Text)
-> (ListPhoneNumbers -> Maybe Text -> ListPhoneNumbers)
-> Lens ListPhoneNumbers ListPhoneNumbers (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPhoneNumbers' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListPhoneNumbers' :: ListPhoneNumbers -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListPhoneNumbers
s@ListPhoneNumbers' {} Maybe Text
a -> ListPhoneNumbers
s {$sel:nextToken:ListPhoneNumbers' :: Maybe Text
nextToken = Maybe Text
a} :: ListPhoneNumbers)

-- | The value to use for the filter.
listPhoneNumbers_filterValue :: Lens.Lens' ListPhoneNumbers (Prelude.Maybe Prelude.Text)
listPhoneNumbers_filterValue :: (Maybe Text -> f (Maybe Text))
-> ListPhoneNumbers -> f ListPhoneNumbers
listPhoneNumbers_filterValue = (ListPhoneNumbers -> Maybe Text)
-> (ListPhoneNumbers -> Maybe Text -> ListPhoneNumbers)
-> Lens ListPhoneNumbers ListPhoneNumbers (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPhoneNumbers' {Maybe Text
filterValue :: Maybe Text
$sel:filterValue:ListPhoneNumbers' :: ListPhoneNumbers -> Maybe Text
filterValue} -> Maybe Text
filterValue) (\s :: ListPhoneNumbers
s@ListPhoneNumbers' {} Maybe Text
a -> ListPhoneNumbers
s {$sel:filterValue:ListPhoneNumbers' :: Maybe Text
filterValue = Maybe Text
a} :: ListPhoneNumbers)

-- | The maximum number of results to return in a single call.
listPhoneNumbers_maxResults :: Lens.Lens' ListPhoneNumbers (Prelude.Maybe Prelude.Natural)
listPhoneNumbers_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListPhoneNumbers -> f ListPhoneNumbers
listPhoneNumbers_maxResults = (ListPhoneNumbers -> Maybe Natural)
-> (ListPhoneNumbers -> Maybe Natural -> ListPhoneNumbers)
-> Lens
     ListPhoneNumbers ListPhoneNumbers (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPhoneNumbers' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListPhoneNumbers' :: ListPhoneNumbers -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListPhoneNumbers
s@ListPhoneNumbers' {} Maybe Natural
a -> ListPhoneNumbers
s {$sel:maxResults:ListPhoneNumbers' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListPhoneNumbers)

instance Core.AWSRequest ListPhoneNumbers where
  type
    AWSResponse ListPhoneNumbers =
      ListPhoneNumbersResponse
  request :: ListPhoneNumbers -> Request ListPhoneNumbers
request = Service -> ListPhoneNumbers -> Request ListPhoneNumbers
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy ListPhoneNumbers
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListPhoneNumbers)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListPhoneNumbers))
-> Logger
-> Service
-> Proxy ListPhoneNumbers
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListPhoneNumbers)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Maybe [PhoneNumber] -> Int -> ListPhoneNumbersResponse
ListPhoneNumbersResponse'
            (Maybe Text
 -> Maybe [PhoneNumber] -> Int -> ListPhoneNumbersResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe [PhoneNumber] -> Int -> ListPhoneNumbersResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"NextToken")
            Either
  String (Maybe [PhoneNumber] -> Int -> ListPhoneNumbersResponse)
-> Either String (Maybe [PhoneNumber])
-> Either String (Int -> ListPhoneNumbersResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe [PhoneNumber]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"PhoneNumbers" Either String (Maybe (Maybe [PhoneNumber]))
-> Maybe [PhoneNumber] -> Either String (Maybe [PhoneNumber])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [PhoneNumber]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Int -> ListPhoneNumbersResponse)
-> Either String Int -> Either String ListPhoneNumbersResponse
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 ListPhoneNumbers

instance Prelude.NFData ListPhoneNumbers

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

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

instance Core.ToQuery ListPhoneNumbers where
  toQuery :: ListPhoneNumbers -> QueryString
toQuery ListPhoneNumbers' {Maybe Natural
Maybe Text
Maybe PhoneNumberAssociationName
Maybe PhoneNumberProductType
Maybe PhoneNumberStatus
maxResults :: Maybe Natural
filterValue :: Maybe Text
nextToken :: Maybe Text
productType :: Maybe PhoneNumberProductType
filterName :: Maybe PhoneNumberAssociationName
status :: Maybe PhoneNumberStatus
$sel:maxResults:ListPhoneNumbers' :: ListPhoneNumbers -> Maybe Natural
$sel:filterValue:ListPhoneNumbers' :: ListPhoneNumbers -> Maybe Text
$sel:nextToken:ListPhoneNumbers' :: ListPhoneNumbers -> Maybe Text
$sel:productType:ListPhoneNumbers' :: ListPhoneNumbers -> Maybe PhoneNumberProductType
$sel:filterName:ListPhoneNumbers' :: ListPhoneNumbers -> Maybe PhoneNumberAssociationName
$sel:status:ListPhoneNumbers' :: ListPhoneNumbers -> Maybe PhoneNumberStatus
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"status" ByteString -> Maybe PhoneNumberStatus -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe PhoneNumberStatus
status,
        ByteString
"filter-name" ByteString -> Maybe PhoneNumberAssociationName -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe PhoneNumberAssociationName
filterName,
        ByteString
"product-type" ByteString -> Maybe PhoneNumberProductType -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe PhoneNumberProductType
productType,
        ByteString
"next-token" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
nextToken,
        ByteString
"filter-value" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
filterValue,
        ByteString
"max-results" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
maxResults
      ]

-- | /See:/ 'newListPhoneNumbersResponse' smart constructor.
data ListPhoneNumbersResponse = ListPhoneNumbersResponse'
  { -- | The token to use to retrieve the next page of results.
    ListPhoneNumbersResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The phone number details.
    ListPhoneNumbersResponse -> Maybe [PhoneNumber]
phoneNumbers :: Prelude.Maybe [PhoneNumber],
    -- | The response's http status code.
    ListPhoneNumbersResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListPhoneNumbersResponse -> ListPhoneNumbersResponse -> Bool
(ListPhoneNumbersResponse -> ListPhoneNumbersResponse -> Bool)
-> (ListPhoneNumbersResponse -> ListPhoneNumbersResponse -> Bool)
-> Eq ListPhoneNumbersResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListPhoneNumbersResponse -> ListPhoneNumbersResponse -> Bool
$c/= :: ListPhoneNumbersResponse -> ListPhoneNumbersResponse -> Bool
== :: ListPhoneNumbersResponse -> ListPhoneNumbersResponse -> Bool
$c== :: ListPhoneNumbersResponse -> ListPhoneNumbersResponse -> Bool
Prelude.Eq, Int -> ListPhoneNumbersResponse -> ShowS
[ListPhoneNumbersResponse] -> ShowS
ListPhoneNumbersResponse -> String
(Int -> ListPhoneNumbersResponse -> ShowS)
-> (ListPhoneNumbersResponse -> String)
-> ([ListPhoneNumbersResponse] -> ShowS)
-> Show ListPhoneNumbersResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListPhoneNumbersResponse] -> ShowS
$cshowList :: [ListPhoneNumbersResponse] -> ShowS
show :: ListPhoneNumbersResponse -> String
$cshow :: ListPhoneNumbersResponse -> String
showsPrec :: Int -> ListPhoneNumbersResponse -> ShowS
$cshowsPrec :: Int -> ListPhoneNumbersResponse -> ShowS
Prelude.Show, (forall x.
 ListPhoneNumbersResponse -> Rep ListPhoneNumbersResponse x)
-> (forall x.
    Rep ListPhoneNumbersResponse x -> ListPhoneNumbersResponse)
-> Generic ListPhoneNumbersResponse
forall x.
Rep ListPhoneNumbersResponse x -> ListPhoneNumbersResponse
forall x.
ListPhoneNumbersResponse -> Rep ListPhoneNumbersResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListPhoneNumbersResponse x -> ListPhoneNumbersResponse
$cfrom :: forall x.
ListPhoneNumbersResponse -> Rep ListPhoneNumbersResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListPhoneNumbersResponse' 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', 'listPhoneNumbersResponse_nextToken' - The token to use to retrieve the next page of results.
--
-- 'phoneNumbers', 'listPhoneNumbersResponse_phoneNumbers' - The phone number details.
--
-- 'httpStatus', 'listPhoneNumbersResponse_httpStatus' - The response's http status code.
newListPhoneNumbersResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListPhoneNumbersResponse
newListPhoneNumbersResponse :: Int -> ListPhoneNumbersResponse
newListPhoneNumbersResponse Int
pHttpStatus_ =
  ListPhoneNumbersResponse' :: Maybe Text
-> Maybe [PhoneNumber] -> Int -> ListPhoneNumbersResponse
ListPhoneNumbersResponse'
    { $sel:nextToken:ListPhoneNumbersResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:phoneNumbers:ListPhoneNumbersResponse' :: Maybe [PhoneNumber]
phoneNumbers = Maybe [PhoneNumber]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListPhoneNumbersResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The token to use to retrieve the next page of results.
listPhoneNumbersResponse_nextToken :: Lens.Lens' ListPhoneNumbersResponse (Prelude.Maybe Prelude.Text)
listPhoneNumbersResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListPhoneNumbersResponse -> f ListPhoneNumbersResponse
listPhoneNumbersResponse_nextToken = (ListPhoneNumbersResponse -> Maybe Text)
-> (ListPhoneNumbersResponse
    -> Maybe Text -> ListPhoneNumbersResponse)
-> Lens
     ListPhoneNumbersResponse
     ListPhoneNumbersResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPhoneNumbersResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListPhoneNumbersResponse' :: ListPhoneNumbersResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListPhoneNumbersResponse
s@ListPhoneNumbersResponse' {} Maybe Text
a -> ListPhoneNumbersResponse
s {$sel:nextToken:ListPhoneNumbersResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListPhoneNumbersResponse)

-- | The phone number details.
listPhoneNumbersResponse_phoneNumbers :: Lens.Lens' ListPhoneNumbersResponse (Prelude.Maybe [PhoneNumber])
listPhoneNumbersResponse_phoneNumbers :: (Maybe [PhoneNumber] -> f (Maybe [PhoneNumber]))
-> ListPhoneNumbersResponse -> f ListPhoneNumbersResponse
listPhoneNumbersResponse_phoneNumbers = (ListPhoneNumbersResponse -> Maybe [PhoneNumber])
-> (ListPhoneNumbersResponse
    -> Maybe [PhoneNumber] -> ListPhoneNumbersResponse)
-> Lens
     ListPhoneNumbersResponse
     ListPhoneNumbersResponse
     (Maybe [PhoneNumber])
     (Maybe [PhoneNumber])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPhoneNumbersResponse' {Maybe [PhoneNumber]
phoneNumbers :: Maybe [PhoneNumber]
$sel:phoneNumbers:ListPhoneNumbersResponse' :: ListPhoneNumbersResponse -> Maybe [PhoneNumber]
phoneNumbers} -> Maybe [PhoneNumber]
phoneNumbers) (\s :: ListPhoneNumbersResponse
s@ListPhoneNumbersResponse' {} Maybe [PhoneNumber]
a -> ListPhoneNumbersResponse
s {$sel:phoneNumbers:ListPhoneNumbersResponse' :: Maybe [PhoneNumber]
phoneNumbers = Maybe [PhoneNumber]
a} :: ListPhoneNumbersResponse) ((Maybe [PhoneNumber] -> f (Maybe [PhoneNumber]))
 -> ListPhoneNumbersResponse -> f ListPhoneNumbersResponse)
-> ((Maybe [PhoneNumber] -> f (Maybe [PhoneNumber]))
    -> Maybe [PhoneNumber] -> f (Maybe [PhoneNumber]))
-> (Maybe [PhoneNumber] -> f (Maybe [PhoneNumber]))
-> ListPhoneNumbersResponse
-> f ListPhoneNumbersResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [PhoneNumber] [PhoneNumber] [PhoneNumber] [PhoneNumber]
-> Iso
     (Maybe [PhoneNumber])
     (Maybe [PhoneNumber])
     (Maybe [PhoneNumber])
     (Maybe [PhoneNumber])
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 [PhoneNumber] [PhoneNumber] [PhoneNumber] [PhoneNumber]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData ListPhoneNumbersResponse