{-# 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.GetMatches
-- 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)
--
-- This API is in preview release for Amazon Connect and subject to change.
--
-- Before calling this API, use
-- <https://docs.aws.amazon.com/customerprofiles/latest/APIReference/API_CreateDomain.html CreateDomain>
-- or
-- <https://docs.aws.amazon.com/customerprofiles/latest/APIReference/API_UpdateDomain.html UpdateDomain>
-- to enable identity resolution: set @Matching@ to true.
--
-- GetMatches returns potentially matching profiles, based on the results
-- of the latest run of a machine learning process.
--
-- Amazon Connect starts a batch process every Saturday at 12AM UTC to
-- identify matching profiles. The results are returned up to seven days
-- after the Saturday run.
--
-- Amazon Connect uses the following profile attributes to identify
-- matches:
--
-- -   PhoneNumber
--
-- -   HomePhoneNumber
--
-- -   BusinessPhoneNumber
--
-- -   MobilePhoneNumber
--
-- -   EmailAddress
--
-- -   PersonalEmailAddress
--
-- -   BusinessEmailAddress
--
-- -   FullName
--
-- -   BusinessName
--
-- For example, two or more profiles—with spelling mistakes such as __John
-- Doe__ and __Jhn Doe__, or different casing email addresses such as
-- __JOHN_DOE\@ANYCOMPANY.COM__ and __johndoe\@anycompany.com__, or
-- different phone number formats such as __555-010-0000__ and
-- __+1-555-010-0000__—can be detected as belonging to the same customer
-- __John Doe__ and merged into a unified profile.
module Amazonka.CustomerProfiles.GetMatches
  ( -- * Creating a Request
    GetMatches (..),
    newGetMatches,

    -- * Request Lenses
    getMatches_nextToken,
    getMatches_maxResults,
    getMatches_domainName,

    -- * Destructuring the Response
    GetMatchesResponse (..),
    newGetMatchesResponse,

    -- * Response Lenses
    getMatchesResponse_matches,
    getMatchesResponse_matchGenerationDate,
    getMatchesResponse_nextToken,
    getMatchesResponse_potentialMatches,
    getMatchesResponse_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:/ 'newGetMatches' smart constructor.
data GetMatches = GetMatches'
  { -- | The token for the next set of results. Use the value returned in the
    -- previous response in the next request to retrieve the next set of
    -- results.
    GetMatches -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of results to return per page.
    GetMatches -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The unique name of the domain.
    GetMatches -> Text
domainName :: Prelude.Text
  }
  deriving (GetMatches -> GetMatches -> Bool
(GetMatches -> GetMatches -> Bool)
-> (GetMatches -> GetMatches -> Bool) -> Eq GetMatches
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetMatches -> GetMatches -> Bool
$c/= :: GetMatches -> GetMatches -> Bool
== :: GetMatches -> GetMatches -> Bool
$c== :: GetMatches -> GetMatches -> Bool
Prelude.Eq, ReadPrec [GetMatches]
ReadPrec GetMatches
Int -> ReadS GetMatches
ReadS [GetMatches]
(Int -> ReadS GetMatches)
-> ReadS [GetMatches]
-> ReadPrec GetMatches
-> ReadPrec [GetMatches]
-> Read GetMatches
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetMatches]
$creadListPrec :: ReadPrec [GetMatches]
readPrec :: ReadPrec GetMatches
$creadPrec :: ReadPrec GetMatches
readList :: ReadS [GetMatches]
$creadList :: ReadS [GetMatches]
readsPrec :: Int -> ReadS GetMatches
$creadsPrec :: Int -> ReadS GetMatches
Prelude.Read, Int -> GetMatches -> ShowS
[GetMatches] -> ShowS
GetMatches -> String
(Int -> GetMatches -> ShowS)
-> (GetMatches -> String)
-> ([GetMatches] -> ShowS)
-> Show GetMatches
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetMatches] -> ShowS
$cshowList :: [GetMatches] -> ShowS
show :: GetMatches -> String
$cshow :: GetMatches -> String
showsPrec :: Int -> GetMatches -> ShowS
$cshowsPrec :: Int -> GetMatches -> ShowS
Prelude.Show, (forall x. GetMatches -> Rep GetMatches x)
-> (forall x. Rep GetMatches x -> GetMatches) -> Generic GetMatches
forall x. Rep GetMatches x -> GetMatches
forall x. GetMatches -> Rep GetMatches x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetMatches x -> GetMatches
$cfrom :: forall x. GetMatches -> Rep GetMatches x
Prelude.Generic)

-- |
-- Create a value of 'GetMatches' 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', 'getMatches_nextToken' - The token for the next set of results. Use the value returned in the
-- previous response in the next request to retrieve the next set of
-- results.
--
-- 'maxResults', 'getMatches_maxResults' - The maximum number of results to return per page.
--
-- 'domainName', 'getMatches_domainName' - The unique name of the domain.
newGetMatches ::
  -- | 'domainName'
  Prelude.Text ->
  GetMatches
newGetMatches :: Text -> GetMatches
newGetMatches Text
pDomainName_ =
  GetMatches' :: Maybe Text -> Maybe Natural -> Text -> GetMatches
GetMatches'
    { $sel:nextToken:GetMatches' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:GetMatches' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:domainName:GetMatches' :: Text
domainName = Text
pDomainName_
    }

-- | The token for the next set of results. Use the value returned in the
-- previous response in the next request to retrieve the next set of
-- results.
getMatches_nextToken :: Lens.Lens' GetMatches (Prelude.Maybe Prelude.Text)
getMatches_nextToken :: (Maybe Text -> f (Maybe Text)) -> GetMatches -> f GetMatches
getMatches_nextToken = (GetMatches -> Maybe Text)
-> (GetMatches -> Maybe Text -> GetMatches)
-> Lens GetMatches GetMatches (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMatches' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetMatches' :: GetMatches -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetMatches
s@GetMatches' {} Maybe Text
a -> GetMatches
s {$sel:nextToken:GetMatches' :: Maybe Text
nextToken = Maybe Text
a} :: GetMatches)

-- | The maximum number of results to return per page.
getMatches_maxResults :: Lens.Lens' GetMatches (Prelude.Maybe Prelude.Natural)
getMatches_maxResults :: (Maybe Natural -> f (Maybe Natural)) -> GetMatches -> f GetMatches
getMatches_maxResults = (GetMatches -> Maybe Natural)
-> (GetMatches -> Maybe Natural -> GetMatches)
-> Lens GetMatches GetMatches (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMatches' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:GetMatches' :: GetMatches -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: GetMatches
s@GetMatches' {} Maybe Natural
a -> GetMatches
s {$sel:maxResults:GetMatches' :: Maybe Natural
maxResults = Maybe Natural
a} :: GetMatches)

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

instance Core.AWSRequest GetMatches where
  type AWSResponse GetMatches = GetMatchesResponse
  request :: GetMatches -> Request GetMatches
request = Service -> GetMatches -> Request GetMatches
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy GetMatches
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetMatches)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse GetMatches))
-> Logger
-> Service
-> Proxy GetMatches
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetMatches)))
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 [MatchItem]
-> Maybe POSIX
-> Maybe Text
-> Maybe Natural
-> Int
-> GetMatchesResponse
GetMatchesResponse'
            (Maybe [MatchItem]
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe Natural
 -> Int
 -> GetMatchesResponse)
-> Either String (Maybe [MatchItem])
-> Either
     String
     (Maybe POSIX
      -> Maybe Text -> Maybe Natural -> Int -> GetMatchesResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (Maybe [MatchItem]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Matches" Either String (Maybe (Maybe [MatchItem]))
-> Maybe [MatchItem] -> Either String (Maybe [MatchItem])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [MatchItem]
forall a. Monoid a => a
Prelude.mempty)
            Either
  String
  (Maybe POSIX
   -> Maybe Text -> Maybe Natural -> Int -> GetMatchesResponse)
-> Either String (Maybe POSIX)
-> Either
     String (Maybe Text -> Maybe Natural -> Int -> GetMatchesResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"MatchGenerationDate")
            Either
  String (Maybe Text -> Maybe Natural -> Int -> GetMatchesResponse)
-> Either String (Maybe Text)
-> Either String (Maybe Natural -> Int -> GetMatchesResponse)
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 (Maybe Natural -> Int -> GetMatchesResponse)
-> Either String (Maybe Natural)
-> Either String (Int -> GetMatchesResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"PotentialMatches")
            Either String (Int -> GetMatchesResponse)
-> Either String Int -> Either String GetMatchesResponse
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 GetMatches

instance Prelude.NFData GetMatches

instance Core.ToHeaders GetMatches where
  toHeaders :: GetMatches -> ResponseHeaders
toHeaders =
    ResponseHeaders -> GetMatches -> 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.ToPath GetMatches where
  toPath :: GetMatches -> ByteString
toPath GetMatches' {Maybe Natural
Maybe Text
Text
domainName :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:domainName:GetMatches' :: GetMatches -> Text
$sel:maxResults:GetMatches' :: GetMatches -> Maybe Natural
$sel:nextToken:GetMatches' :: GetMatches -> 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
"/matches"]

instance Core.ToQuery GetMatches where
  toQuery :: GetMatches -> QueryString
toQuery GetMatches' {Maybe Natural
Maybe Text
Text
domainName :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:domainName:GetMatches' :: GetMatches -> Text
$sel:maxResults:GetMatches' :: GetMatches -> Maybe Natural
$sel:nextToken:GetMatches' :: GetMatches -> 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:/ 'newGetMatchesResponse' smart constructor.
data GetMatchesResponse = GetMatchesResponse'
  { -- | The list of matched profiles for this instance.
    GetMatchesResponse -> Maybe [MatchItem]
matches :: Prelude.Maybe [MatchItem],
    -- | The timestamp this version of Match Result generated.
    GetMatchesResponse -> Maybe POSIX
matchGenerationDate :: Prelude.Maybe Core.POSIX,
    -- | If there are additional results, this is the token for the next set of
    -- results.
    GetMatchesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The number of potential matches found.
    GetMatchesResponse -> Maybe Natural
potentialMatches :: Prelude.Maybe Prelude.Natural,
    -- | The response's http status code.
    GetMatchesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetMatchesResponse -> GetMatchesResponse -> Bool
(GetMatchesResponse -> GetMatchesResponse -> Bool)
-> (GetMatchesResponse -> GetMatchesResponse -> Bool)
-> Eq GetMatchesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetMatchesResponse -> GetMatchesResponse -> Bool
$c/= :: GetMatchesResponse -> GetMatchesResponse -> Bool
== :: GetMatchesResponse -> GetMatchesResponse -> Bool
$c== :: GetMatchesResponse -> GetMatchesResponse -> Bool
Prelude.Eq, ReadPrec [GetMatchesResponse]
ReadPrec GetMatchesResponse
Int -> ReadS GetMatchesResponse
ReadS [GetMatchesResponse]
(Int -> ReadS GetMatchesResponse)
-> ReadS [GetMatchesResponse]
-> ReadPrec GetMatchesResponse
-> ReadPrec [GetMatchesResponse]
-> Read GetMatchesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetMatchesResponse]
$creadListPrec :: ReadPrec [GetMatchesResponse]
readPrec :: ReadPrec GetMatchesResponse
$creadPrec :: ReadPrec GetMatchesResponse
readList :: ReadS [GetMatchesResponse]
$creadList :: ReadS [GetMatchesResponse]
readsPrec :: Int -> ReadS GetMatchesResponse
$creadsPrec :: Int -> ReadS GetMatchesResponse
Prelude.Read, Int -> GetMatchesResponse -> ShowS
[GetMatchesResponse] -> ShowS
GetMatchesResponse -> String
(Int -> GetMatchesResponse -> ShowS)
-> (GetMatchesResponse -> String)
-> ([GetMatchesResponse] -> ShowS)
-> Show GetMatchesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetMatchesResponse] -> ShowS
$cshowList :: [GetMatchesResponse] -> ShowS
show :: GetMatchesResponse -> String
$cshow :: GetMatchesResponse -> String
showsPrec :: Int -> GetMatchesResponse -> ShowS
$cshowsPrec :: Int -> GetMatchesResponse -> ShowS
Prelude.Show, (forall x. GetMatchesResponse -> Rep GetMatchesResponse x)
-> (forall x. Rep GetMatchesResponse x -> GetMatchesResponse)
-> Generic GetMatchesResponse
forall x. Rep GetMatchesResponse x -> GetMatchesResponse
forall x. GetMatchesResponse -> Rep GetMatchesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetMatchesResponse x -> GetMatchesResponse
$cfrom :: forall x. GetMatchesResponse -> Rep GetMatchesResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetMatchesResponse' 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:
--
-- 'matches', 'getMatchesResponse_matches' - The list of matched profiles for this instance.
--
-- 'matchGenerationDate', 'getMatchesResponse_matchGenerationDate' - The timestamp this version of Match Result generated.
--
-- 'nextToken', 'getMatchesResponse_nextToken' - If there are additional results, this is the token for the next set of
-- results.
--
-- 'potentialMatches', 'getMatchesResponse_potentialMatches' - The number of potential matches found.
--
-- 'httpStatus', 'getMatchesResponse_httpStatus' - The response's http status code.
newGetMatchesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetMatchesResponse
newGetMatchesResponse :: Int -> GetMatchesResponse
newGetMatchesResponse Int
pHttpStatus_ =
  GetMatchesResponse' :: Maybe [MatchItem]
-> Maybe POSIX
-> Maybe Text
-> Maybe Natural
-> Int
-> GetMatchesResponse
GetMatchesResponse'
    { $sel:matches:GetMatchesResponse' :: Maybe [MatchItem]
matches = Maybe [MatchItem]
forall a. Maybe a
Prelude.Nothing,
      $sel:matchGenerationDate:GetMatchesResponse' :: Maybe POSIX
matchGenerationDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:GetMatchesResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:potentialMatches:GetMatchesResponse' :: Maybe Natural
potentialMatches = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetMatchesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The list of matched profiles for this instance.
getMatchesResponse_matches :: Lens.Lens' GetMatchesResponse (Prelude.Maybe [MatchItem])
getMatchesResponse_matches :: (Maybe [MatchItem] -> f (Maybe [MatchItem]))
-> GetMatchesResponse -> f GetMatchesResponse
getMatchesResponse_matches = (GetMatchesResponse -> Maybe [MatchItem])
-> (GetMatchesResponse -> Maybe [MatchItem] -> GetMatchesResponse)
-> Lens
     GetMatchesResponse
     GetMatchesResponse
     (Maybe [MatchItem])
     (Maybe [MatchItem])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMatchesResponse' {Maybe [MatchItem]
matches :: Maybe [MatchItem]
$sel:matches:GetMatchesResponse' :: GetMatchesResponse -> Maybe [MatchItem]
matches} -> Maybe [MatchItem]
matches) (\s :: GetMatchesResponse
s@GetMatchesResponse' {} Maybe [MatchItem]
a -> GetMatchesResponse
s {$sel:matches:GetMatchesResponse' :: Maybe [MatchItem]
matches = Maybe [MatchItem]
a} :: GetMatchesResponse) ((Maybe [MatchItem] -> f (Maybe [MatchItem]))
 -> GetMatchesResponse -> f GetMatchesResponse)
-> ((Maybe [MatchItem] -> f (Maybe [MatchItem]))
    -> Maybe [MatchItem] -> f (Maybe [MatchItem]))
-> (Maybe [MatchItem] -> f (Maybe [MatchItem]))
-> GetMatchesResponse
-> f GetMatchesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [MatchItem] [MatchItem] [MatchItem] [MatchItem]
-> Iso
     (Maybe [MatchItem])
     (Maybe [MatchItem])
     (Maybe [MatchItem])
     (Maybe [MatchItem])
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 [MatchItem] [MatchItem] [MatchItem] [MatchItem]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The timestamp this version of Match Result generated.
getMatchesResponse_matchGenerationDate :: Lens.Lens' GetMatchesResponse (Prelude.Maybe Prelude.UTCTime)
getMatchesResponse_matchGenerationDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> GetMatchesResponse -> f GetMatchesResponse
getMatchesResponse_matchGenerationDate = (GetMatchesResponse -> Maybe POSIX)
-> (GetMatchesResponse -> Maybe POSIX -> GetMatchesResponse)
-> Lens
     GetMatchesResponse GetMatchesResponse (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMatchesResponse' {Maybe POSIX
matchGenerationDate :: Maybe POSIX
$sel:matchGenerationDate:GetMatchesResponse' :: GetMatchesResponse -> Maybe POSIX
matchGenerationDate} -> Maybe POSIX
matchGenerationDate) (\s :: GetMatchesResponse
s@GetMatchesResponse' {} Maybe POSIX
a -> GetMatchesResponse
s {$sel:matchGenerationDate:GetMatchesResponse' :: Maybe POSIX
matchGenerationDate = Maybe POSIX
a} :: GetMatchesResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> GetMatchesResponse -> f GetMatchesResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> GetMatchesResponse
-> f GetMatchesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | If there are additional results, this is the token for the next set of
-- results.
getMatchesResponse_nextToken :: Lens.Lens' GetMatchesResponse (Prelude.Maybe Prelude.Text)
getMatchesResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> GetMatchesResponse -> f GetMatchesResponse
getMatchesResponse_nextToken = (GetMatchesResponse -> Maybe Text)
-> (GetMatchesResponse -> Maybe Text -> GetMatchesResponse)
-> Lens
     GetMatchesResponse GetMatchesResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMatchesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetMatchesResponse' :: GetMatchesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetMatchesResponse
s@GetMatchesResponse' {} Maybe Text
a -> GetMatchesResponse
s {$sel:nextToken:GetMatchesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: GetMatchesResponse)

-- | The number of potential matches found.
getMatchesResponse_potentialMatches :: Lens.Lens' GetMatchesResponse (Prelude.Maybe Prelude.Natural)
getMatchesResponse_potentialMatches :: (Maybe Natural -> f (Maybe Natural))
-> GetMatchesResponse -> f GetMatchesResponse
getMatchesResponse_potentialMatches = (GetMatchesResponse -> Maybe Natural)
-> (GetMatchesResponse -> Maybe Natural -> GetMatchesResponse)
-> Lens
     GetMatchesResponse
     GetMatchesResponse
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMatchesResponse' {Maybe Natural
potentialMatches :: Maybe Natural
$sel:potentialMatches:GetMatchesResponse' :: GetMatchesResponse -> Maybe Natural
potentialMatches} -> Maybe Natural
potentialMatches) (\s :: GetMatchesResponse
s@GetMatchesResponse' {} Maybe Natural
a -> GetMatchesResponse
s {$sel:potentialMatches:GetMatchesResponse' :: Maybe Natural
potentialMatches = Maybe Natural
a} :: GetMatchesResponse)

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

instance Prelude.NFData GetMatchesResponse