{-# 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.MigrationHub.ListDiscoveredResources
-- 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 discovered resources associated with the given @MigrationTask@.
--
-- This operation returns paginated results.
module Amazonka.MigrationHub.ListDiscoveredResources
  ( -- * Creating a Request
    ListDiscoveredResources (..),
    newListDiscoveredResources,

    -- * Request Lenses
    listDiscoveredResources_nextToken,
    listDiscoveredResources_maxResults,
    listDiscoveredResources_progressUpdateStream,
    listDiscoveredResources_migrationTaskName,

    -- * Destructuring the Response
    ListDiscoveredResourcesResponse (..),
    newListDiscoveredResourcesResponse,

    -- * Response Lenses
    listDiscoveredResourcesResponse_discoveredResourceList,
    listDiscoveredResourcesResponse_nextToken,
    listDiscoveredResourcesResponse_httpStatus,
  )
where

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

-- | /See:/ 'newListDiscoveredResources' smart constructor.
data ListDiscoveredResources = ListDiscoveredResources'
  { -- | If a @NextToken@ was returned by a previous call, there are more results
    -- available. To retrieve the next page of results, make the call again
    -- using the returned token in @NextToken@.
    ListDiscoveredResources -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of results returned per page.
    ListDiscoveredResources -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The name of the ProgressUpdateStream.
    ListDiscoveredResources -> Text
progressUpdateStream :: Prelude.Text,
    -- | The name of the MigrationTask. /Do not store personal data in this
    -- field./
    ListDiscoveredResources -> Text
migrationTaskName :: Prelude.Text
  }
  deriving (ListDiscoveredResources -> ListDiscoveredResources -> Bool
(ListDiscoveredResources -> ListDiscoveredResources -> Bool)
-> (ListDiscoveredResources -> ListDiscoveredResources -> Bool)
-> Eq ListDiscoveredResources
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListDiscoveredResources -> ListDiscoveredResources -> Bool
$c/= :: ListDiscoveredResources -> ListDiscoveredResources -> Bool
== :: ListDiscoveredResources -> ListDiscoveredResources -> Bool
$c== :: ListDiscoveredResources -> ListDiscoveredResources -> Bool
Prelude.Eq, ReadPrec [ListDiscoveredResources]
ReadPrec ListDiscoveredResources
Int -> ReadS ListDiscoveredResources
ReadS [ListDiscoveredResources]
(Int -> ReadS ListDiscoveredResources)
-> ReadS [ListDiscoveredResources]
-> ReadPrec ListDiscoveredResources
-> ReadPrec [ListDiscoveredResources]
-> Read ListDiscoveredResources
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListDiscoveredResources]
$creadListPrec :: ReadPrec [ListDiscoveredResources]
readPrec :: ReadPrec ListDiscoveredResources
$creadPrec :: ReadPrec ListDiscoveredResources
readList :: ReadS [ListDiscoveredResources]
$creadList :: ReadS [ListDiscoveredResources]
readsPrec :: Int -> ReadS ListDiscoveredResources
$creadsPrec :: Int -> ReadS ListDiscoveredResources
Prelude.Read, Int -> ListDiscoveredResources -> ShowS
[ListDiscoveredResources] -> ShowS
ListDiscoveredResources -> String
(Int -> ListDiscoveredResources -> ShowS)
-> (ListDiscoveredResources -> String)
-> ([ListDiscoveredResources] -> ShowS)
-> Show ListDiscoveredResources
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListDiscoveredResources] -> ShowS
$cshowList :: [ListDiscoveredResources] -> ShowS
show :: ListDiscoveredResources -> String
$cshow :: ListDiscoveredResources -> String
showsPrec :: Int -> ListDiscoveredResources -> ShowS
$cshowsPrec :: Int -> ListDiscoveredResources -> ShowS
Prelude.Show, (forall x.
 ListDiscoveredResources -> Rep ListDiscoveredResources x)
-> (forall x.
    Rep ListDiscoveredResources x -> ListDiscoveredResources)
-> Generic ListDiscoveredResources
forall x. Rep ListDiscoveredResources x -> ListDiscoveredResources
forall x. ListDiscoveredResources -> Rep ListDiscoveredResources x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListDiscoveredResources x -> ListDiscoveredResources
$cfrom :: forall x. ListDiscoveredResources -> Rep ListDiscoveredResources x
Prelude.Generic)

-- |
-- Create a value of 'ListDiscoveredResources' 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', 'listDiscoveredResources_nextToken' - If a @NextToken@ was returned by a previous call, there are more results
-- available. To retrieve the next page of results, make the call again
-- using the returned token in @NextToken@.
--
-- 'maxResults', 'listDiscoveredResources_maxResults' - The maximum number of results returned per page.
--
-- 'progressUpdateStream', 'listDiscoveredResources_progressUpdateStream' - The name of the ProgressUpdateStream.
--
-- 'migrationTaskName', 'listDiscoveredResources_migrationTaskName' - The name of the MigrationTask. /Do not store personal data in this
-- field./
newListDiscoveredResources ::
  -- | 'progressUpdateStream'
  Prelude.Text ->
  -- | 'migrationTaskName'
  Prelude.Text ->
  ListDiscoveredResources
newListDiscoveredResources :: Text -> Text -> ListDiscoveredResources
newListDiscoveredResources
  Text
pProgressUpdateStream_
  Text
pMigrationTaskName_ =
    ListDiscoveredResources' :: Maybe Text
-> Maybe Natural -> Text -> Text -> ListDiscoveredResources
ListDiscoveredResources'
      { $sel:nextToken:ListDiscoveredResources' :: Maybe Text
nextToken =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:maxResults:ListDiscoveredResources' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
        $sel:progressUpdateStream:ListDiscoveredResources' :: Text
progressUpdateStream = Text
pProgressUpdateStream_,
        $sel:migrationTaskName:ListDiscoveredResources' :: Text
migrationTaskName = Text
pMigrationTaskName_
      }

-- | If a @NextToken@ was returned by a previous call, there are more results
-- available. To retrieve the next page of results, make the call again
-- using the returned token in @NextToken@.
listDiscoveredResources_nextToken :: Lens.Lens' ListDiscoveredResources (Prelude.Maybe Prelude.Text)
listDiscoveredResources_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListDiscoveredResources -> f ListDiscoveredResources
listDiscoveredResources_nextToken = (ListDiscoveredResources -> Maybe Text)
-> (ListDiscoveredResources
    -> Maybe Text -> ListDiscoveredResources)
-> Lens
     ListDiscoveredResources
     ListDiscoveredResources
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDiscoveredResources' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListDiscoveredResources' :: ListDiscoveredResources -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListDiscoveredResources
s@ListDiscoveredResources' {} Maybe Text
a -> ListDiscoveredResources
s {$sel:nextToken:ListDiscoveredResources' :: Maybe Text
nextToken = Maybe Text
a} :: ListDiscoveredResources)

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

-- | The name of the ProgressUpdateStream.
listDiscoveredResources_progressUpdateStream :: Lens.Lens' ListDiscoveredResources Prelude.Text
listDiscoveredResources_progressUpdateStream :: (Text -> f Text)
-> ListDiscoveredResources -> f ListDiscoveredResources
listDiscoveredResources_progressUpdateStream = (ListDiscoveredResources -> Text)
-> (ListDiscoveredResources -> Text -> ListDiscoveredResources)
-> Lens ListDiscoveredResources ListDiscoveredResources Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDiscoveredResources' {Text
progressUpdateStream :: Text
$sel:progressUpdateStream:ListDiscoveredResources' :: ListDiscoveredResources -> Text
progressUpdateStream} -> Text
progressUpdateStream) (\s :: ListDiscoveredResources
s@ListDiscoveredResources' {} Text
a -> ListDiscoveredResources
s {$sel:progressUpdateStream:ListDiscoveredResources' :: Text
progressUpdateStream = Text
a} :: ListDiscoveredResources)

-- | The name of the MigrationTask. /Do not store personal data in this
-- field./
listDiscoveredResources_migrationTaskName :: Lens.Lens' ListDiscoveredResources Prelude.Text
listDiscoveredResources_migrationTaskName :: (Text -> f Text)
-> ListDiscoveredResources -> f ListDiscoveredResources
listDiscoveredResources_migrationTaskName = (ListDiscoveredResources -> Text)
-> (ListDiscoveredResources -> Text -> ListDiscoveredResources)
-> Lens ListDiscoveredResources ListDiscoveredResources Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDiscoveredResources' {Text
migrationTaskName :: Text
$sel:migrationTaskName:ListDiscoveredResources' :: ListDiscoveredResources -> Text
migrationTaskName} -> Text
migrationTaskName) (\s :: ListDiscoveredResources
s@ListDiscoveredResources' {} Text
a -> ListDiscoveredResources
s {$sel:migrationTaskName:ListDiscoveredResources' :: Text
migrationTaskName = Text
a} :: ListDiscoveredResources)

instance Core.AWSPager ListDiscoveredResources where
  page :: ListDiscoveredResources
-> AWSResponse ListDiscoveredResources
-> Maybe ListDiscoveredResources
page ListDiscoveredResources
rq AWSResponse ListDiscoveredResources
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListDiscoveredResources
ListDiscoveredResourcesResponse
rs
            ListDiscoveredResourcesResponse
-> Getting (First Text) ListDiscoveredResourcesResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListDiscoveredResourcesResponse
-> Const (First Text) ListDiscoveredResourcesResponse
Lens' ListDiscoveredResourcesResponse (Maybe Text)
listDiscoveredResourcesResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListDiscoveredResourcesResponse
 -> Const (First Text) ListDiscoveredResourcesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListDiscoveredResourcesResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListDiscoveredResources
forall a. Maybe a
Prelude.Nothing
    | Maybe [DiscoveredResource] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListDiscoveredResources
ListDiscoveredResourcesResponse
rs
            ListDiscoveredResourcesResponse
-> Getting
     (First [DiscoveredResource])
     ListDiscoveredResourcesResponse
     [DiscoveredResource]
-> Maybe [DiscoveredResource]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [DiscoveredResource]
 -> Const (First [DiscoveredResource]) (Maybe [DiscoveredResource]))
-> ListDiscoveredResourcesResponse
-> Const
     (First [DiscoveredResource]) ListDiscoveredResourcesResponse
Lens' ListDiscoveredResourcesResponse (Maybe [DiscoveredResource])
listDiscoveredResourcesResponse_discoveredResourceList
              ((Maybe [DiscoveredResource]
  -> Const (First [DiscoveredResource]) (Maybe [DiscoveredResource]))
 -> ListDiscoveredResourcesResponse
 -> Const
      (First [DiscoveredResource]) ListDiscoveredResourcesResponse)
-> (([DiscoveredResource]
     -> Const (First [DiscoveredResource]) [DiscoveredResource])
    -> Maybe [DiscoveredResource]
    -> Const (First [DiscoveredResource]) (Maybe [DiscoveredResource]))
-> Getting
     (First [DiscoveredResource])
     ListDiscoveredResourcesResponse
     [DiscoveredResource]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([DiscoveredResource]
 -> Const (First [DiscoveredResource]) [DiscoveredResource])
-> Maybe [DiscoveredResource]
-> Const (First [DiscoveredResource]) (Maybe [DiscoveredResource])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListDiscoveredResources
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListDiscoveredResources -> Maybe ListDiscoveredResources
forall a. a -> Maybe a
Prelude.Just (ListDiscoveredResources -> Maybe ListDiscoveredResources)
-> ListDiscoveredResources -> Maybe ListDiscoveredResources
forall a b. (a -> b) -> a -> b
Prelude.$
        ListDiscoveredResources
rq
          ListDiscoveredResources
-> (ListDiscoveredResources -> ListDiscoveredResources)
-> ListDiscoveredResources
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListDiscoveredResources -> Identity ListDiscoveredResources
Lens
  ListDiscoveredResources
  ListDiscoveredResources
  (Maybe Text)
  (Maybe Text)
listDiscoveredResources_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListDiscoveredResources -> Identity ListDiscoveredResources)
-> Maybe Text -> ListDiscoveredResources -> ListDiscoveredResources
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListDiscoveredResources
ListDiscoveredResourcesResponse
rs
          ListDiscoveredResourcesResponse
-> Getting (First Text) ListDiscoveredResourcesResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListDiscoveredResourcesResponse
-> Const (First Text) ListDiscoveredResourcesResponse
Lens' ListDiscoveredResourcesResponse (Maybe Text)
listDiscoveredResourcesResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListDiscoveredResourcesResponse
 -> Const (First Text) ListDiscoveredResourcesResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListDiscoveredResourcesResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

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

instance Prelude.NFData ListDiscoveredResources

instance Core.ToHeaders ListDiscoveredResources where
  toHeaders :: ListDiscoveredResources -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListDiscoveredResources -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"AWSMigrationHub.ListDiscoveredResources" ::
                          Prelude.ByteString
                      ),
            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 ListDiscoveredResources where
  toJSON :: ListDiscoveredResources -> Value
toJSON ListDiscoveredResources' {Maybe Natural
Maybe Text
Text
migrationTaskName :: Text
progressUpdateStream :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:migrationTaskName:ListDiscoveredResources' :: ListDiscoveredResources -> Text
$sel:progressUpdateStream:ListDiscoveredResources' :: ListDiscoveredResources -> Text
$sel:maxResults:ListDiscoveredResources' :: ListDiscoveredResources -> Maybe Natural
$sel:nextToken:ListDiscoveredResources' :: ListDiscoveredResources -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"NextToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
            (Text
"MaxResults" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              ( Text
"ProgressUpdateStream"
                  Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
progressUpdateStream
              ),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"MigrationTaskName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
migrationTaskName)
          ]
      )

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

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

-- | /See:/ 'newListDiscoveredResourcesResponse' smart constructor.
data ListDiscoveredResourcesResponse = ListDiscoveredResourcesResponse'
  { -- | Returned list of discovered resources associated with the given
    -- MigrationTask.
    ListDiscoveredResourcesResponse -> Maybe [DiscoveredResource]
discoveredResourceList :: Prelude.Maybe [DiscoveredResource],
    -- | If there are more discovered resources than the max result, return the
    -- next token to be passed to the next call as a bookmark of where to start
    -- from.
    ListDiscoveredResourcesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListDiscoveredResourcesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListDiscoveredResourcesResponse
-> ListDiscoveredResourcesResponse -> Bool
(ListDiscoveredResourcesResponse
 -> ListDiscoveredResourcesResponse -> Bool)
-> (ListDiscoveredResourcesResponse
    -> ListDiscoveredResourcesResponse -> Bool)
-> Eq ListDiscoveredResourcesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListDiscoveredResourcesResponse
-> ListDiscoveredResourcesResponse -> Bool
$c/= :: ListDiscoveredResourcesResponse
-> ListDiscoveredResourcesResponse -> Bool
== :: ListDiscoveredResourcesResponse
-> ListDiscoveredResourcesResponse -> Bool
$c== :: ListDiscoveredResourcesResponse
-> ListDiscoveredResourcesResponse -> Bool
Prelude.Eq, ReadPrec [ListDiscoveredResourcesResponse]
ReadPrec ListDiscoveredResourcesResponse
Int -> ReadS ListDiscoveredResourcesResponse
ReadS [ListDiscoveredResourcesResponse]
(Int -> ReadS ListDiscoveredResourcesResponse)
-> ReadS [ListDiscoveredResourcesResponse]
-> ReadPrec ListDiscoveredResourcesResponse
-> ReadPrec [ListDiscoveredResourcesResponse]
-> Read ListDiscoveredResourcesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListDiscoveredResourcesResponse]
$creadListPrec :: ReadPrec [ListDiscoveredResourcesResponse]
readPrec :: ReadPrec ListDiscoveredResourcesResponse
$creadPrec :: ReadPrec ListDiscoveredResourcesResponse
readList :: ReadS [ListDiscoveredResourcesResponse]
$creadList :: ReadS [ListDiscoveredResourcesResponse]
readsPrec :: Int -> ReadS ListDiscoveredResourcesResponse
$creadsPrec :: Int -> ReadS ListDiscoveredResourcesResponse
Prelude.Read, Int -> ListDiscoveredResourcesResponse -> ShowS
[ListDiscoveredResourcesResponse] -> ShowS
ListDiscoveredResourcesResponse -> String
(Int -> ListDiscoveredResourcesResponse -> ShowS)
-> (ListDiscoveredResourcesResponse -> String)
-> ([ListDiscoveredResourcesResponse] -> ShowS)
-> Show ListDiscoveredResourcesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListDiscoveredResourcesResponse] -> ShowS
$cshowList :: [ListDiscoveredResourcesResponse] -> ShowS
show :: ListDiscoveredResourcesResponse -> String
$cshow :: ListDiscoveredResourcesResponse -> String
showsPrec :: Int -> ListDiscoveredResourcesResponse -> ShowS
$cshowsPrec :: Int -> ListDiscoveredResourcesResponse -> ShowS
Prelude.Show, (forall x.
 ListDiscoveredResourcesResponse
 -> Rep ListDiscoveredResourcesResponse x)
-> (forall x.
    Rep ListDiscoveredResourcesResponse x
    -> ListDiscoveredResourcesResponse)
-> Generic ListDiscoveredResourcesResponse
forall x.
Rep ListDiscoveredResourcesResponse x
-> ListDiscoveredResourcesResponse
forall x.
ListDiscoveredResourcesResponse
-> Rep ListDiscoveredResourcesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListDiscoveredResourcesResponse x
-> ListDiscoveredResourcesResponse
$cfrom :: forall x.
ListDiscoveredResourcesResponse
-> Rep ListDiscoveredResourcesResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListDiscoveredResourcesResponse' 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:
--
-- 'discoveredResourceList', 'listDiscoveredResourcesResponse_discoveredResourceList' - Returned list of discovered resources associated with the given
-- MigrationTask.
--
-- 'nextToken', 'listDiscoveredResourcesResponse_nextToken' - If there are more discovered resources than the max result, return the
-- next token to be passed to the next call as a bookmark of where to start
-- from.
--
-- 'httpStatus', 'listDiscoveredResourcesResponse_httpStatus' - The response's http status code.
newListDiscoveredResourcesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListDiscoveredResourcesResponse
newListDiscoveredResourcesResponse :: Int -> ListDiscoveredResourcesResponse
newListDiscoveredResourcesResponse Int
pHttpStatus_ =
  ListDiscoveredResourcesResponse' :: Maybe [DiscoveredResource]
-> Maybe Text -> Int -> ListDiscoveredResourcesResponse
ListDiscoveredResourcesResponse'
    { $sel:discoveredResourceList:ListDiscoveredResourcesResponse' :: Maybe [DiscoveredResource]
discoveredResourceList =
        Maybe [DiscoveredResource]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListDiscoveredResourcesResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListDiscoveredResourcesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Returned list of discovered resources associated with the given
-- MigrationTask.
listDiscoveredResourcesResponse_discoveredResourceList :: Lens.Lens' ListDiscoveredResourcesResponse (Prelude.Maybe [DiscoveredResource])
listDiscoveredResourcesResponse_discoveredResourceList :: (Maybe [DiscoveredResource] -> f (Maybe [DiscoveredResource]))
-> ListDiscoveredResourcesResponse
-> f ListDiscoveredResourcesResponse
listDiscoveredResourcesResponse_discoveredResourceList = (ListDiscoveredResourcesResponse -> Maybe [DiscoveredResource])
-> (ListDiscoveredResourcesResponse
    -> Maybe [DiscoveredResource] -> ListDiscoveredResourcesResponse)
-> Lens'
     ListDiscoveredResourcesResponse (Maybe [DiscoveredResource])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDiscoveredResourcesResponse' {Maybe [DiscoveredResource]
discoveredResourceList :: Maybe [DiscoveredResource]
$sel:discoveredResourceList:ListDiscoveredResourcesResponse' :: ListDiscoveredResourcesResponse -> Maybe [DiscoveredResource]
discoveredResourceList} -> Maybe [DiscoveredResource]
discoveredResourceList) (\s :: ListDiscoveredResourcesResponse
s@ListDiscoveredResourcesResponse' {} Maybe [DiscoveredResource]
a -> ListDiscoveredResourcesResponse
s {$sel:discoveredResourceList:ListDiscoveredResourcesResponse' :: Maybe [DiscoveredResource]
discoveredResourceList = Maybe [DiscoveredResource]
a} :: ListDiscoveredResourcesResponse) ((Maybe [DiscoveredResource] -> f (Maybe [DiscoveredResource]))
 -> ListDiscoveredResourcesResponse
 -> f ListDiscoveredResourcesResponse)
-> ((Maybe [DiscoveredResource] -> f (Maybe [DiscoveredResource]))
    -> Maybe [DiscoveredResource] -> f (Maybe [DiscoveredResource]))
-> (Maybe [DiscoveredResource] -> f (Maybe [DiscoveredResource]))
-> ListDiscoveredResourcesResponse
-> f ListDiscoveredResourcesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [DiscoveredResource]
  [DiscoveredResource]
  [DiscoveredResource]
  [DiscoveredResource]
-> Iso
     (Maybe [DiscoveredResource])
     (Maybe [DiscoveredResource])
     (Maybe [DiscoveredResource])
     (Maybe [DiscoveredResource])
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
  [DiscoveredResource]
  [DiscoveredResource]
  [DiscoveredResource]
  [DiscoveredResource]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | If there are more discovered resources than the max result, return the
-- next token to be passed to the next call as a bookmark of where to start
-- from.
listDiscoveredResourcesResponse_nextToken :: Lens.Lens' ListDiscoveredResourcesResponse (Prelude.Maybe Prelude.Text)
listDiscoveredResourcesResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListDiscoveredResourcesResponse
-> f ListDiscoveredResourcesResponse
listDiscoveredResourcesResponse_nextToken = (ListDiscoveredResourcesResponse -> Maybe Text)
-> (ListDiscoveredResourcesResponse
    -> Maybe Text -> ListDiscoveredResourcesResponse)
-> Lens' ListDiscoveredResourcesResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDiscoveredResourcesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListDiscoveredResourcesResponse' :: ListDiscoveredResourcesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListDiscoveredResourcesResponse
s@ListDiscoveredResourcesResponse' {} Maybe Text
a -> ListDiscoveredResourcesResponse
s {$sel:nextToken:ListDiscoveredResourcesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListDiscoveredResourcesResponse)

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

instance
  Prelude.NFData
    ListDiscoveredResourcesResponse