{-# 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.CustomerProfiles.SearchProfiles
-- 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)
--
-- Searches for profiles within a specific domain name using name, phone
-- number, email address, account number, or a custom defined index.
module Amazonka.CustomerProfiles.SearchProfiles
  ( -- * Creating a Request
    SearchProfiles (..),
    newSearchProfiles,

    -- * Request Lenses
    searchProfiles_nextToken,
    searchProfiles_maxResults,
    searchProfiles_domainName,
    searchProfiles_keyName,
    searchProfiles_values,

    -- * Destructuring the Response
    SearchProfilesResponse (..),
    newSearchProfilesResponse,

    -- * Response Lenses
    searchProfilesResponse_items,
    searchProfilesResponse_nextToken,
    searchProfilesResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.CustomerProfiles.Types
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:/ 'newSearchProfiles' smart constructor.
data SearchProfiles = SearchProfiles'
  { -- | The pagination token from the previous SearchProfiles API call.
    SearchProfiles -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of objects returned per page.
    SearchProfiles -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The unique name of the domain.
    SearchProfiles -> Text
domainName :: Prelude.Text,
    -- | A searchable identifier of a customer profile. The predefined keys you
    -- can use to search include: _account, _profileId, _fullName, _phone,
    -- _email, _ctrContactId, _marketoLeadId, _salesforceAccountId,
    -- _salesforceContactId, _zendeskUserId, _zendeskExternalId,
    -- _serviceNowSystemId.
    SearchProfiles -> Text
keyName :: Prelude.Text,
    -- | A list of key values.
    SearchProfiles -> [Text]
values :: [Prelude.Text]
  }
  deriving (SearchProfiles -> SearchProfiles -> Bool
(SearchProfiles -> SearchProfiles -> Bool)
-> (SearchProfiles -> SearchProfiles -> Bool) -> Eq SearchProfiles
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SearchProfiles -> SearchProfiles -> Bool
$c/= :: SearchProfiles -> SearchProfiles -> Bool
== :: SearchProfiles -> SearchProfiles -> Bool
$c== :: SearchProfiles -> SearchProfiles -> Bool
Prelude.Eq, ReadPrec [SearchProfiles]
ReadPrec SearchProfiles
Int -> ReadS SearchProfiles
ReadS [SearchProfiles]
(Int -> ReadS SearchProfiles)
-> ReadS [SearchProfiles]
-> ReadPrec SearchProfiles
-> ReadPrec [SearchProfiles]
-> Read SearchProfiles
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SearchProfiles]
$creadListPrec :: ReadPrec [SearchProfiles]
readPrec :: ReadPrec SearchProfiles
$creadPrec :: ReadPrec SearchProfiles
readList :: ReadS [SearchProfiles]
$creadList :: ReadS [SearchProfiles]
readsPrec :: Int -> ReadS SearchProfiles
$creadsPrec :: Int -> ReadS SearchProfiles
Prelude.Read, Int -> SearchProfiles -> ShowS
[SearchProfiles] -> ShowS
SearchProfiles -> String
(Int -> SearchProfiles -> ShowS)
-> (SearchProfiles -> String)
-> ([SearchProfiles] -> ShowS)
-> Show SearchProfiles
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SearchProfiles] -> ShowS
$cshowList :: [SearchProfiles] -> ShowS
show :: SearchProfiles -> String
$cshow :: SearchProfiles -> String
showsPrec :: Int -> SearchProfiles -> ShowS
$cshowsPrec :: Int -> SearchProfiles -> ShowS
Prelude.Show, (forall x. SearchProfiles -> Rep SearchProfiles x)
-> (forall x. Rep SearchProfiles x -> SearchProfiles)
-> Generic SearchProfiles
forall x. Rep SearchProfiles x -> SearchProfiles
forall x. SearchProfiles -> Rep SearchProfiles x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SearchProfiles x -> SearchProfiles
$cfrom :: forall x. SearchProfiles -> Rep SearchProfiles x
Prelude.Generic)

-- |
-- Create a value of 'SearchProfiles' 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', 'searchProfiles_nextToken' - The pagination token from the previous SearchProfiles API call.
--
-- 'maxResults', 'searchProfiles_maxResults' - The maximum number of objects returned per page.
--
-- 'domainName', 'searchProfiles_domainName' - The unique name of the domain.
--
-- 'keyName', 'searchProfiles_keyName' - A searchable identifier of a customer profile. The predefined keys you
-- can use to search include: _account, _profileId, _fullName, _phone,
-- _email, _ctrContactId, _marketoLeadId, _salesforceAccountId,
-- _salesforceContactId, _zendeskUserId, _zendeskExternalId,
-- _serviceNowSystemId.
--
-- 'values', 'searchProfiles_values' - A list of key values.
newSearchProfiles ::
  -- | 'domainName'
  Prelude.Text ->
  -- | 'keyName'
  Prelude.Text ->
  SearchProfiles
newSearchProfiles :: Text -> Text -> SearchProfiles
newSearchProfiles Text
pDomainName_ Text
pKeyName_ =
  SearchProfiles' :: Maybe Text
-> Maybe Natural -> Text -> Text -> [Text] -> SearchProfiles
SearchProfiles'
    { $sel:nextToken:SearchProfiles' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:SearchProfiles' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:domainName:SearchProfiles' :: Text
domainName = Text
pDomainName_,
      $sel:keyName:SearchProfiles' :: Text
keyName = Text
pKeyName_,
      $sel:values:SearchProfiles' :: [Text]
values = [Text]
forall a. Monoid a => a
Prelude.mempty
    }

-- | The pagination token from the previous SearchProfiles API call.
searchProfiles_nextToken :: Lens.Lens' SearchProfiles (Prelude.Maybe Prelude.Text)
searchProfiles_nextToken :: (Maybe Text -> f (Maybe Text))
-> SearchProfiles -> f SearchProfiles
searchProfiles_nextToken = (SearchProfiles -> Maybe Text)
-> (SearchProfiles -> Maybe Text -> SearchProfiles)
-> Lens SearchProfiles SearchProfiles (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchProfiles' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:SearchProfiles' :: SearchProfiles -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: SearchProfiles
s@SearchProfiles' {} Maybe Text
a -> SearchProfiles
s {$sel:nextToken:SearchProfiles' :: Maybe Text
nextToken = Maybe Text
a} :: SearchProfiles)

-- | The maximum number of objects returned per page.
searchProfiles_maxResults :: Lens.Lens' SearchProfiles (Prelude.Maybe Prelude.Natural)
searchProfiles_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> SearchProfiles -> f SearchProfiles
searchProfiles_maxResults = (SearchProfiles -> Maybe Natural)
-> (SearchProfiles -> Maybe Natural -> SearchProfiles)
-> Lens
     SearchProfiles SearchProfiles (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchProfiles' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:SearchProfiles' :: SearchProfiles -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: SearchProfiles
s@SearchProfiles' {} Maybe Natural
a -> SearchProfiles
s {$sel:maxResults:SearchProfiles' :: Maybe Natural
maxResults = Maybe Natural
a} :: SearchProfiles)

-- | The unique name of the domain.
searchProfiles_domainName :: Lens.Lens' SearchProfiles Prelude.Text
searchProfiles_domainName :: (Text -> f Text) -> SearchProfiles -> f SearchProfiles
searchProfiles_domainName = (SearchProfiles -> Text)
-> (SearchProfiles -> Text -> SearchProfiles)
-> Lens SearchProfiles SearchProfiles Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchProfiles' {Text
domainName :: Text
$sel:domainName:SearchProfiles' :: SearchProfiles -> Text
domainName} -> Text
domainName) (\s :: SearchProfiles
s@SearchProfiles' {} Text
a -> SearchProfiles
s {$sel:domainName:SearchProfiles' :: Text
domainName = Text
a} :: SearchProfiles)

-- | A searchable identifier of a customer profile. The predefined keys you
-- can use to search include: _account, _profileId, _fullName, _phone,
-- _email, _ctrContactId, _marketoLeadId, _salesforceAccountId,
-- _salesforceContactId, _zendeskUserId, _zendeskExternalId,
-- _serviceNowSystemId.
searchProfiles_keyName :: Lens.Lens' SearchProfiles Prelude.Text
searchProfiles_keyName :: (Text -> f Text) -> SearchProfiles -> f SearchProfiles
searchProfiles_keyName = (SearchProfiles -> Text)
-> (SearchProfiles -> Text -> SearchProfiles)
-> Lens SearchProfiles SearchProfiles Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchProfiles' {Text
keyName :: Text
$sel:keyName:SearchProfiles' :: SearchProfiles -> Text
keyName} -> Text
keyName) (\s :: SearchProfiles
s@SearchProfiles' {} Text
a -> SearchProfiles
s {$sel:keyName:SearchProfiles' :: Text
keyName = Text
a} :: SearchProfiles)

-- | A list of key values.
searchProfiles_values :: Lens.Lens' SearchProfiles [Prelude.Text]
searchProfiles_values :: ([Text] -> f [Text]) -> SearchProfiles -> f SearchProfiles
searchProfiles_values = (SearchProfiles -> [Text])
-> (SearchProfiles -> [Text] -> SearchProfiles)
-> Lens SearchProfiles SearchProfiles [Text] [Text]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchProfiles' {[Text]
values :: [Text]
$sel:values:SearchProfiles' :: SearchProfiles -> [Text]
values} -> [Text]
values) (\s :: SearchProfiles
s@SearchProfiles' {} [Text]
a -> SearchProfiles
s {$sel:values:SearchProfiles' :: [Text]
values = [Text]
a} :: SearchProfiles) (([Text] -> f [Text]) -> SearchProfiles -> f SearchProfiles)
-> (([Text] -> f [Text]) -> [Text] -> f [Text])
-> ([Text] -> f [Text])
-> SearchProfiles
-> f SearchProfiles
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Text] -> f [Text]) -> [Text] -> f [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.AWSRequest SearchProfiles where
  type
    AWSResponse SearchProfiles =
      SearchProfilesResponse
  request :: SearchProfiles -> Request SearchProfiles
request = Service -> SearchProfiles -> Request SearchProfiles
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy SearchProfiles
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse SearchProfiles)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse SearchProfiles))
-> Logger
-> Service
-> Proxy SearchProfiles
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse SearchProfiles)))
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 [Profile] -> Maybe Text -> Int -> SearchProfilesResponse
SearchProfilesResponse'
            (Maybe [Profile] -> Maybe Text -> Int -> SearchProfilesResponse)
-> Either String (Maybe [Profile])
-> Either String (Maybe Text -> Int -> SearchProfilesResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (Maybe [Profile]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Items" Either String (Maybe (Maybe [Profile]))
-> Maybe [Profile] -> Either String (Maybe [Profile])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Profile]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Maybe Text -> Int -> SearchProfilesResponse)
-> Either String (Maybe Text)
-> Either String (Int -> SearchProfilesResponse)
forall (f :: * -> *) a b. Applicative f => 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 (Int -> SearchProfilesResponse)
-> Either String Int -> Either String SearchProfilesResponse
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 SearchProfiles

instance Prelude.NFData SearchProfiles

instance Core.ToHeaders SearchProfiles where
  toHeaders :: SearchProfiles -> ResponseHeaders
toHeaders =
    ResponseHeaders -> SearchProfiles -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON SearchProfiles where
  toJSON :: SearchProfiles -> Value
toJSON SearchProfiles' {[Text]
Maybe Natural
Maybe Text
Text
values :: [Text]
keyName :: Text
domainName :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:values:SearchProfiles' :: SearchProfiles -> [Text]
$sel:keyName:SearchProfiles' :: SearchProfiles -> Text
$sel:domainName:SearchProfiles' :: SearchProfiles -> Text
$sel:maxResults:SearchProfiles' :: SearchProfiles -> Maybe Natural
$sel:nextToken:SearchProfiles' :: SearchProfiles -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"KeyName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
keyName),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Values" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [Text]
values)
          ]
      )

instance Core.ToPath SearchProfiles where
  toPath :: SearchProfiles -> ByteString
toPath SearchProfiles' {[Text]
Maybe Natural
Maybe Text
Text
values :: [Text]
keyName :: Text
domainName :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:values:SearchProfiles' :: SearchProfiles -> [Text]
$sel:keyName:SearchProfiles' :: SearchProfiles -> Text
$sel:domainName:SearchProfiles' :: SearchProfiles -> Text
$sel:maxResults:SearchProfiles' :: SearchProfiles -> Maybe Natural
$sel:nextToken:SearchProfiles' :: SearchProfiles -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/domains/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
domainName,
        ByteString
"/profiles/search"
      ]

instance Core.ToQuery SearchProfiles where
  toQuery :: SearchProfiles -> QueryString
toQuery SearchProfiles' {[Text]
Maybe Natural
Maybe Text
Text
values :: [Text]
keyName :: Text
domainName :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:values:SearchProfiles' :: SearchProfiles -> [Text]
$sel:keyName:SearchProfiles' :: SearchProfiles -> Text
$sel:domainName:SearchProfiles' :: SearchProfiles -> Text
$sel:maxResults:SearchProfiles' :: SearchProfiles -> Maybe Natural
$sel:nextToken:SearchProfiles' :: SearchProfiles -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"next-token" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
nextToken,
        ByteString
"max-results" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
maxResults
      ]

-- | /See:/ 'newSearchProfilesResponse' smart constructor.
data SearchProfilesResponse = SearchProfilesResponse'
  { -- | The list of SearchProfiles instances.
    SearchProfilesResponse -> Maybe [Profile]
items :: Prelude.Maybe [Profile],
    -- | The pagination token from the previous SearchProfiles API call.
    SearchProfilesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    SearchProfilesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (SearchProfilesResponse -> SearchProfilesResponse -> Bool
(SearchProfilesResponse -> SearchProfilesResponse -> Bool)
-> (SearchProfilesResponse -> SearchProfilesResponse -> Bool)
-> Eq SearchProfilesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SearchProfilesResponse -> SearchProfilesResponse -> Bool
$c/= :: SearchProfilesResponse -> SearchProfilesResponse -> Bool
== :: SearchProfilesResponse -> SearchProfilesResponse -> Bool
$c== :: SearchProfilesResponse -> SearchProfilesResponse -> Bool
Prelude.Eq, ReadPrec [SearchProfilesResponse]
ReadPrec SearchProfilesResponse
Int -> ReadS SearchProfilesResponse
ReadS [SearchProfilesResponse]
(Int -> ReadS SearchProfilesResponse)
-> ReadS [SearchProfilesResponse]
-> ReadPrec SearchProfilesResponse
-> ReadPrec [SearchProfilesResponse]
-> Read SearchProfilesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SearchProfilesResponse]
$creadListPrec :: ReadPrec [SearchProfilesResponse]
readPrec :: ReadPrec SearchProfilesResponse
$creadPrec :: ReadPrec SearchProfilesResponse
readList :: ReadS [SearchProfilesResponse]
$creadList :: ReadS [SearchProfilesResponse]
readsPrec :: Int -> ReadS SearchProfilesResponse
$creadsPrec :: Int -> ReadS SearchProfilesResponse
Prelude.Read, Int -> SearchProfilesResponse -> ShowS
[SearchProfilesResponse] -> ShowS
SearchProfilesResponse -> String
(Int -> SearchProfilesResponse -> ShowS)
-> (SearchProfilesResponse -> String)
-> ([SearchProfilesResponse] -> ShowS)
-> Show SearchProfilesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SearchProfilesResponse] -> ShowS
$cshowList :: [SearchProfilesResponse] -> ShowS
show :: SearchProfilesResponse -> String
$cshow :: SearchProfilesResponse -> String
showsPrec :: Int -> SearchProfilesResponse -> ShowS
$cshowsPrec :: Int -> SearchProfilesResponse -> ShowS
Prelude.Show, (forall x. SearchProfilesResponse -> Rep SearchProfilesResponse x)
-> (forall x.
    Rep SearchProfilesResponse x -> SearchProfilesResponse)
-> Generic SearchProfilesResponse
forall x. Rep SearchProfilesResponse x -> SearchProfilesResponse
forall x. SearchProfilesResponse -> Rep SearchProfilesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SearchProfilesResponse x -> SearchProfilesResponse
$cfrom :: forall x. SearchProfilesResponse -> Rep SearchProfilesResponse x
Prelude.Generic)

-- |
-- Create a value of 'SearchProfilesResponse' 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:
--
-- 'items', 'searchProfilesResponse_items' - The list of SearchProfiles instances.
--
-- 'nextToken', 'searchProfilesResponse_nextToken' - The pagination token from the previous SearchProfiles API call.
--
-- 'httpStatus', 'searchProfilesResponse_httpStatus' - The response's http status code.
newSearchProfilesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  SearchProfilesResponse
newSearchProfilesResponse :: Int -> SearchProfilesResponse
newSearchProfilesResponse Int
pHttpStatus_ =
  SearchProfilesResponse' :: Maybe [Profile] -> Maybe Text -> Int -> SearchProfilesResponse
SearchProfilesResponse'
    { $sel:items:SearchProfilesResponse' :: Maybe [Profile]
items = Maybe [Profile]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:SearchProfilesResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:SearchProfilesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The list of SearchProfiles instances.
searchProfilesResponse_items :: Lens.Lens' SearchProfilesResponse (Prelude.Maybe [Profile])
searchProfilesResponse_items :: (Maybe [Profile] -> f (Maybe [Profile]))
-> SearchProfilesResponse -> f SearchProfilesResponse
searchProfilesResponse_items = (SearchProfilesResponse -> Maybe [Profile])
-> (SearchProfilesResponse
    -> Maybe [Profile] -> SearchProfilesResponse)
-> Lens
     SearchProfilesResponse
     SearchProfilesResponse
     (Maybe [Profile])
     (Maybe [Profile])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchProfilesResponse' {Maybe [Profile]
items :: Maybe [Profile]
$sel:items:SearchProfilesResponse' :: SearchProfilesResponse -> Maybe [Profile]
items} -> Maybe [Profile]
items) (\s :: SearchProfilesResponse
s@SearchProfilesResponse' {} Maybe [Profile]
a -> SearchProfilesResponse
s {$sel:items:SearchProfilesResponse' :: Maybe [Profile]
items = Maybe [Profile]
a} :: SearchProfilesResponse) ((Maybe [Profile] -> f (Maybe [Profile]))
 -> SearchProfilesResponse -> f SearchProfilesResponse)
-> ((Maybe [Profile] -> f (Maybe [Profile]))
    -> Maybe [Profile] -> f (Maybe [Profile]))
-> (Maybe [Profile] -> f (Maybe [Profile]))
-> SearchProfilesResponse
-> f SearchProfilesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Profile] [Profile] [Profile] [Profile]
-> Iso
     (Maybe [Profile])
     (Maybe [Profile])
     (Maybe [Profile])
     (Maybe [Profile])
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 [Profile] [Profile] [Profile] [Profile]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The pagination token from the previous SearchProfiles API call.
searchProfilesResponse_nextToken :: Lens.Lens' SearchProfilesResponse (Prelude.Maybe Prelude.Text)
searchProfilesResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> SearchProfilesResponse -> f SearchProfilesResponse
searchProfilesResponse_nextToken = (SearchProfilesResponse -> Maybe Text)
-> (SearchProfilesResponse -> Maybe Text -> SearchProfilesResponse)
-> Lens
     SearchProfilesResponse
     SearchProfilesResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchProfilesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:SearchProfilesResponse' :: SearchProfilesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: SearchProfilesResponse
s@SearchProfilesResponse' {} Maybe Text
a -> SearchProfilesResponse
s {$sel:nextToken:SearchProfilesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: SearchProfilesResponse)

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

instance Prelude.NFData SearchProfilesResponse