{-# 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.AlexaBusiness.SearchContacts
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Searches contacts and lists the ones that meet a set of filter and sort
-- criteria.
module Amazonka.AlexaBusiness.SearchContacts
  ( -- * Creating a Request
    SearchContacts (..),
    newSearchContacts,

    -- * Request Lenses
    searchContacts_filters,
    searchContacts_maxResults,
    searchContacts_nextToken,
    searchContacts_sortCriteria,

    -- * Destructuring the Response
    SearchContactsResponse (..),
    newSearchContactsResponse,

    -- * Response Lenses
    searchContactsResponse_contacts,
    searchContactsResponse_nextToken,
    searchContactsResponse_totalCount,
    searchContactsResponse_httpStatus,
  )
where

import Amazonka.AlexaBusiness.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newSearchContacts' smart constructor.
data SearchContacts = SearchContacts'
  { -- | The filters to use to list a specified set of address books. The
    -- supported filter keys are DisplayName, FirstName, LastName, and
    -- AddressBookArns.
    SearchContacts -> Maybe [Filter]
filters :: Prelude.Maybe [Filter],
    -- | The maximum number of results to include in the response. If more
    -- results exist than the specified MaxResults value, a token is included
    -- in the response so that the remaining results can be retrieved.
    SearchContacts -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | An optional token returned from a prior request. Use this token for
    -- pagination of results from this action. If this parameter is specified,
    -- the response only includes results beyond the token, up to the value
    -- specified by MaxResults.
    SearchContacts -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The sort order to use in listing the specified set of contacts. The
    -- supported sort keys are DisplayName, FirstName, and LastName.
    SearchContacts -> Maybe [Sort]
sortCriteria :: Prelude.Maybe [Sort]
  }
  deriving (SearchContacts -> SearchContacts -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SearchContacts -> SearchContacts -> Bool
$c/= :: SearchContacts -> SearchContacts -> Bool
== :: SearchContacts -> SearchContacts -> Bool
$c== :: SearchContacts -> SearchContacts -> Bool
Prelude.Eq, ReadPrec [SearchContacts]
ReadPrec SearchContacts
Int -> ReadS SearchContacts
ReadS [SearchContacts]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SearchContacts]
$creadListPrec :: ReadPrec [SearchContacts]
readPrec :: ReadPrec SearchContacts
$creadPrec :: ReadPrec SearchContacts
readList :: ReadS [SearchContacts]
$creadList :: ReadS [SearchContacts]
readsPrec :: Int -> ReadS SearchContacts
$creadsPrec :: Int -> ReadS SearchContacts
Prelude.Read, Int -> SearchContacts -> ShowS
[SearchContacts] -> ShowS
SearchContacts -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SearchContacts] -> ShowS
$cshowList :: [SearchContacts] -> ShowS
show :: SearchContacts -> String
$cshow :: SearchContacts -> String
showsPrec :: Int -> SearchContacts -> ShowS
$cshowsPrec :: Int -> SearchContacts -> ShowS
Prelude.Show, forall x. Rep SearchContacts x -> SearchContacts
forall x. SearchContacts -> Rep SearchContacts x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SearchContacts x -> SearchContacts
$cfrom :: forall x. SearchContacts -> Rep SearchContacts x
Prelude.Generic)

-- |
-- Create a value of 'SearchContacts' 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:
--
-- 'filters', 'searchContacts_filters' - The filters to use to list a specified set of address books. The
-- supported filter keys are DisplayName, FirstName, LastName, and
-- AddressBookArns.
--
-- 'maxResults', 'searchContacts_maxResults' - The maximum number of results to include in the response. If more
-- results exist than the specified MaxResults value, a token is included
-- in the response so that the remaining results can be retrieved.
--
-- 'nextToken', 'searchContacts_nextToken' - An optional token returned from a prior request. Use this token for
-- pagination of results from this action. If this parameter is specified,
-- the response only includes results beyond the token, up to the value
-- specified by MaxResults.
--
-- 'sortCriteria', 'searchContacts_sortCriteria' - The sort order to use in listing the specified set of contacts. The
-- supported sort keys are DisplayName, FirstName, and LastName.
newSearchContacts ::
  SearchContacts
newSearchContacts :: SearchContacts
newSearchContacts =
  SearchContacts'
    { $sel:filters:SearchContacts' :: Maybe [Filter]
filters = forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:SearchContacts' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:SearchContacts' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:sortCriteria:SearchContacts' :: Maybe [Sort]
sortCriteria = forall a. Maybe a
Prelude.Nothing
    }

-- | The filters to use to list a specified set of address books. The
-- supported filter keys are DisplayName, FirstName, LastName, and
-- AddressBookArns.
searchContacts_filters :: Lens.Lens' SearchContacts (Prelude.Maybe [Filter])
searchContacts_filters :: Lens' SearchContacts (Maybe [Filter])
searchContacts_filters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchContacts' {Maybe [Filter]
filters :: Maybe [Filter]
$sel:filters:SearchContacts' :: SearchContacts -> Maybe [Filter]
filters} -> Maybe [Filter]
filters) (\s :: SearchContacts
s@SearchContacts' {} Maybe [Filter]
a -> SearchContacts
s {$sel:filters:SearchContacts' :: Maybe [Filter]
filters = Maybe [Filter]
a} :: SearchContacts) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The maximum number of results to include in the response. If more
-- results exist than the specified MaxResults value, a token is included
-- in the response so that the remaining results can be retrieved.
searchContacts_maxResults :: Lens.Lens' SearchContacts (Prelude.Maybe Prelude.Natural)
searchContacts_maxResults :: Lens' SearchContacts (Maybe Natural)
searchContacts_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchContacts' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:SearchContacts' :: SearchContacts -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: SearchContacts
s@SearchContacts' {} Maybe Natural
a -> SearchContacts
s {$sel:maxResults:SearchContacts' :: Maybe Natural
maxResults = Maybe Natural
a} :: SearchContacts)

-- | An optional token returned from a prior request. Use this token for
-- pagination of results from this action. If this parameter is specified,
-- the response only includes results beyond the token, up to the value
-- specified by MaxResults.
searchContacts_nextToken :: Lens.Lens' SearchContacts (Prelude.Maybe Prelude.Text)
searchContacts_nextToken :: Lens' SearchContacts (Maybe Text)
searchContacts_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchContacts' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:SearchContacts' :: SearchContacts -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: SearchContacts
s@SearchContacts' {} Maybe Text
a -> SearchContacts
s {$sel:nextToken:SearchContacts' :: Maybe Text
nextToken = Maybe Text
a} :: SearchContacts)

-- | The sort order to use in listing the specified set of contacts. The
-- supported sort keys are DisplayName, FirstName, and LastName.
searchContacts_sortCriteria :: Lens.Lens' SearchContacts (Prelude.Maybe [Sort])
searchContacts_sortCriteria :: Lens' SearchContacts (Maybe [Sort])
searchContacts_sortCriteria = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchContacts' {Maybe [Sort]
sortCriteria :: Maybe [Sort]
$sel:sortCriteria:SearchContacts' :: SearchContacts -> Maybe [Sort]
sortCriteria} -> Maybe [Sort]
sortCriteria) (\s :: SearchContacts
s@SearchContacts' {} Maybe [Sort]
a -> SearchContacts
s {$sel:sortCriteria:SearchContacts' :: Maybe [Sort]
sortCriteria = Maybe [Sort]
a} :: SearchContacts) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.AWSRequest SearchContacts where
  type
    AWSResponse SearchContacts =
      SearchContactsResponse
  request :: (Service -> Service) -> SearchContacts -> Request SearchContacts
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 SearchContacts
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse SearchContacts)))
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 [ContactData]
-> Maybe Text -> Maybe Int -> Int -> SearchContactsResponse
SearchContactsResponse'
            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
"Contacts" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ 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 -> Either String (Maybe a)
Data..?> Key
"NextToken")
            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
"TotalCount")
            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 SearchContacts where
  hashWithSalt :: Int -> SearchContacts -> Int
hashWithSalt Int
_salt SearchContacts' {Maybe Natural
Maybe [Filter]
Maybe [Sort]
Maybe Text
sortCriteria :: Maybe [Sort]
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe [Filter]
$sel:sortCriteria:SearchContacts' :: SearchContacts -> Maybe [Sort]
$sel:nextToken:SearchContacts' :: SearchContacts -> Maybe Text
$sel:maxResults:SearchContacts' :: SearchContacts -> Maybe Natural
$sel:filters:SearchContacts' :: SearchContacts -> Maybe [Filter]
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Filter]
filters
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Sort]
sortCriteria

instance Prelude.NFData SearchContacts where
  rnf :: SearchContacts -> ()
rnf SearchContacts' {Maybe Natural
Maybe [Filter]
Maybe [Sort]
Maybe Text
sortCriteria :: Maybe [Sort]
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe [Filter]
$sel:sortCriteria:SearchContacts' :: SearchContacts -> Maybe [Sort]
$sel:nextToken:SearchContacts' :: SearchContacts -> Maybe Text
$sel:maxResults:SearchContacts' :: SearchContacts -> Maybe Natural
$sel:filters:SearchContacts' :: SearchContacts -> Maybe [Filter]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [Filter]
filters
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxResults
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Sort]
sortCriteria

instance Data.ToHeaders SearchContacts where
  toHeaders :: SearchContacts -> 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
"AlexaForBusiness.SearchContacts" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON SearchContacts where
  toJSON :: SearchContacts -> Value
toJSON SearchContacts' {Maybe Natural
Maybe [Filter]
Maybe [Sort]
Maybe Text
sortCriteria :: Maybe [Sort]
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe [Filter]
$sel:sortCriteria:SearchContacts' :: SearchContacts -> Maybe [Sort]
$sel:nextToken:SearchContacts' :: SearchContacts -> Maybe Text
$sel:maxResults:SearchContacts' :: SearchContacts -> Maybe Natural
$sel:filters:SearchContacts' :: SearchContacts -> Maybe [Filter]
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"Filters" 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 [Filter]
filters,
            (Key
"MaxResults" 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 Natural
maxResults,
            (Key
"NextToken" 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
nextToken,
            (Key
"SortCriteria" 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 [Sort]
sortCriteria
          ]
      )

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

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

-- | /See:/ 'newSearchContactsResponse' smart constructor.
data SearchContactsResponse = SearchContactsResponse'
  { -- | The contacts that meet the specified set of filter criteria, in sort
    -- order.
    SearchContactsResponse -> Maybe [ContactData]
contacts :: Prelude.Maybe [ContactData],
    -- | The token returned to indicate that there is more data available.
    SearchContactsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The total number of contacts returned.
    SearchContactsResponse -> Maybe Int
totalCount :: Prelude.Maybe Prelude.Int,
    -- | The response's http status code.
    SearchContactsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (SearchContactsResponse -> SearchContactsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SearchContactsResponse -> SearchContactsResponse -> Bool
$c/= :: SearchContactsResponse -> SearchContactsResponse -> Bool
== :: SearchContactsResponse -> SearchContactsResponse -> Bool
$c== :: SearchContactsResponse -> SearchContactsResponse -> Bool
Prelude.Eq, Int -> SearchContactsResponse -> ShowS
[SearchContactsResponse] -> ShowS
SearchContactsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SearchContactsResponse] -> ShowS
$cshowList :: [SearchContactsResponse] -> ShowS
show :: SearchContactsResponse -> String
$cshow :: SearchContactsResponse -> String
showsPrec :: Int -> SearchContactsResponse -> ShowS
$cshowsPrec :: Int -> SearchContactsResponse -> ShowS
Prelude.Show, forall x. Rep SearchContactsResponse x -> SearchContactsResponse
forall x. SearchContactsResponse -> Rep SearchContactsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SearchContactsResponse x -> SearchContactsResponse
$cfrom :: forall x. SearchContactsResponse -> Rep SearchContactsResponse x
Prelude.Generic)

-- |
-- Create a value of 'SearchContactsResponse' 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:
--
-- 'contacts', 'searchContactsResponse_contacts' - The contacts that meet the specified set of filter criteria, in sort
-- order.
--
-- 'nextToken', 'searchContactsResponse_nextToken' - The token returned to indicate that there is more data available.
--
-- 'totalCount', 'searchContactsResponse_totalCount' - The total number of contacts returned.
--
-- 'httpStatus', 'searchContactsResponse_httpStatus' - The response's http status code.
newSearchContactsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  SearchContactsResponse
newSearchContactsResponse :: Int -> SearchContactsResponse
newSearchContactsResponse Int
pHttpStatus_ =
  SearchContactsResponse'
    { $sel:contacts:SearchContactsResponse' :: Maybe [ContactData]
contacts = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:SearchContactsResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:totalCount:SearchContactsResponse' :: Maybe Int
totalCount = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:SearchContactsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The contacts that meet the specified set of filter criteria, in sort
-- order.
searchContactsResponse_contacts :: Lens.Lens' SearchContactsResponse (Prelude.Maybe [ContactData])
searchContactsResponse_contacts :: Lens' SearchContactsResponse (Maybe [ContactData])
searchContactsResponse_contacts = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchContactsResponse' {Maybe [ContactData]
contacts :: Maybe [ContactData]
$sel:contacts:SearchContactsResponse' :: SearchContactsResponse -> Maybe [ContactData]
contacts} -> Maybe [ContactData]
contacts) (\s :: SearchContactsResponse
s@SearchContactsResponse' {} Maybe [ContactData]
a -> SearchContactsResponse
s {$sel:contacts:SearchContactsResponse' :: Maybe [ContactData]
contacts = Maybe [ContactData]
a} :: SearchContactsResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The token returned to indicate that there is more data available.
searchContactsResponse_nextToken :: Lens.Lens' SearchContactsResponse (Prelude.Maybe Prelude.Text)
searchContactsResponse_nextToken :: Lens' SearchContactsResponse (Maybe Text)
searchContactsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchContactsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:SearchContactsResponse' :: SearchContactsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: SearchContactsResponse
s@SearchContactsResponse' {} Maybe Text
a -> SearchContactsResponse
s {$sel:nextToken:SearchContactsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: SearchContactsResponse)

-- | The total number of contacts returned.
searchContactsResponse_totalCount :: Lens.Lens' SearchContactsResponse (Prelude.Maybe Prelude.Int)
searchContactsResponse_totalCount :: Lens' SearchContactsResponse (Maybe Int)
searchContactsResponse_totalCount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchContactsResponse' {Maybe Int
totalCount :: Maybe Int
$sel:totalCount:SearchContactsResponse' :: SearchContactsResponse -> Maybe Int
totalCount} -> Maybe Int
totalCount) (\s :: SearchContactsResponse
s@SearchContactsResponse' {} Maybe Int
a -> SearchContactsResponse
s {$sel:totalCount:SearchContactsResponse' :: Maybe Int
totalCount = Maybe Int
a} :: SearchContactsResponse)

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

instance Prelude.NFData SearchContactsResponse where
  rnf :: SearchContactsResponse -> ()
rnf SearchContactsResponse' {Int
Maybe Int
Maybe [ContactData]
Maybe Text
httpStatus :: Int
totalCount :: Maybe Int
nextToken :: Maybe Text
contacts :: Maybe [ContactData]
$sel:httpStatus:SearchContactsResponse' :: SearchContactsResponse -> Int
$sel:totalCount:SearchContactsResponse' :: SearchContactsResponse -> Maybe Int
$sel:nextToken:SearchContactsResponse' :: SearchContactsResponse -> Maybe Text
$sel:contacts:SearchContactsResponse' :: SearchContactsResponse -> Maybe [ContactData]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [ContactData]
contacts
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
totalCount
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus