{-# 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.ListCreatedArtifacts
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Lists the created artifacts attached to a given migration task in an
-- update stream. This API has the following traits:
--
-- -   Gets the list of the created artifacts while migration is taking
--     place.
--
-- -   Shows the artifacts created by the migration tool that was
--     associated by the @AssociateCreatedArtifact@ API.
--
-- -   Lists created artifacts in a paginated interface.
--
-- This operation returns paginated results.
module Amazonka.MigrationHub.ListCreatedArtifacts
  ( -- * Creating a Request
    ListCreatedArtifacts (..),
    newListCreatedArtifacts,

    -- * Request Lenses
    listCreatedArtifacts_nextToken,
    listCreatedArtifacts_maxResults,
    listCreatedArtifacts_progressUpdateStream,
    listCreatedArtifacts_migrationTaskName,

    -- * Destructuring the Response
    ListCreatedArtifactsResponse (..),
    newListCreatedArtifactsResponse,

    -- * Response Lenses
    listCreatedArtifactsResponse_nextToken,
    listCreatedArtifactsResponse_createdArtifactList,
    listCreatedArtifactsResponse_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:/ 'newListCreatedArtifacts' smart constructor.
data ListCreatedArtifacts = ListCreatedArtifacts'
  { -- | 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@.
    ListCreatedArtifacts -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Maximum number of results to be returned per page.
    ListCreatedArtifacts -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The name of the ProgressUpdateStream.
    ListCreatedArtifacts -> Text
progressUpdateStream :: Prelude.Text,
    -- | Unique identifier that references the migration task. /Do not store
    -- personal data in this field./
    ListCreatedArtifacts -> Text
migrationTaskName :: Prelude.Text
  }
  deriving (ListCreatedArtifacts -> ListCreatedArtifacts -> Bool
(ListCreatedArtifacts -> ListCreatedArtifacts -> Bool)
-> (ListCreatedArtifacts -> ListCreatedArtifacts -> Bool)
-> Eq ListCreatedArtifacts
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListCreatedArtifacts -> ListCreatedArtifacts -> Bool
$c/= :: ListCreatedArtifacts -> ListCreatedArtifacts -> Bool
== :: ListCreatedArtifacts -> ListCreatedArtifacts -> Bool
$c== :: ListCreatedArtifacts -> ListCreatedArtifacts -> Bool
Prelude.Eq, ReadPrec [ListCreatedArtifacts]
ReadPrec ListCreatedArtifacts
Int -> ReadS ListCreatedArtifacts
ReadS [ListCreatedArtifacts]
(Int -> ReadS ListCreatedArtifacts)
-> ReadS [ListCreatedArtifacts]
-> ReadPrec ListCreatedArtifacts
-> ReadPrec [ListCreatedArtifacts]
-> Read ListCreatedArtifacts
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListCreatedArtifacts]
$creadListPrec :: ReadPrec [ListCreatedArtifacts]
readPrec :: ReadPrec ListCreatedArtifacts
$creadPrec :: ReadPrec ListCreatedArtifacts
readList :: ReadS [ListCreatedArtifacts]
$creadList :: ReadS [ListCreatedArtifacts]
readsPrec :: Int -> ReadS ListCreatedArtifacts
$creadsPrec :: Int -> ReadS ListCreatedArtifacts
Prelude.Read, Int -> ListCreatedArtifacts -> ShowS
[ListCreatedArtifacts] -> ShowS
ListCreatedArtifacts -> String
(Int -> ListCreatedArtifacts -> ShowS)
-> (ListCreatedArtifacts -> String)
-> ([ListCreatedArtifacts] -> ShowS)
-> Show ListCreatedArtifacts
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListCreatedArtifacts] -> ShowS
$cshowList :: [ListCreatedArtifacts] -> ShowS
show :: ListCreatedArtifacts -> String
$cshow :: ListCreatedArtifacts -> String
showsPrec :: Int -> ListCreatedArtifacts -> ShowS
$cshowsPrec :: Int -> ListCreatedArtifacts -> ShowS
Prelude.Show, (forall x. ListCreatedArtifacts -> Rep ListCreatedArtifacts x)
-> (forall x. Rep ListCreatedArtifacts x -> ListCreatedArtifacts)
-> Generic ListCreatedArtifacts
forall x. Rep ListCreatedArtifacts x -> ListCreatedArtifacts
forall x. ListCreatedArtifacts -> Rep ListCreatedArtifacts x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListCreatedArtifacts x -> ListCreatedArtifacts
$cfrom :: forall x. ListCreatedArtifacts -> Rep ListCreatedArtifacts x
Prelude.Generic)

-- |
-- Create a value of 'ListCreatedArtifacts' 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', 'listCreatedArtifacts_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', 'listCreatedArtifacts_maxResults' - Maximum number of results to be returned per page.
--
-- 'progressUpdateStream', 'listCreatedArtifacts_progressUpdateStream' - The name of the ProgressUpdateStream.
--
-- 'migrationTaskName', 'listCreatedArtifacts_migrationTaskName' - Unique identifier that references the migration task. /Do not store
-- personal data in this field./
newListCreatedArtifacts ::
  -- | 'progressUpdateStream'
  Prelude.Text ->
  -- | 'migrationTaskName'
  Prelude.Text ->
  ListCreatedArtifacts
newListCreatedArtifacts :: Text -> Text -> ListCreatedArtifacts
newListCreatedArtifacts
  Text
pProgressUpdateStream_
  Text
pMigrationTaskName_ =
    ListCreatedArtifacts' :: Maybe Text -> Maybe Natural -> Text -> Text -> ListCreatedArtifacts
ListCreatedArtifacts'
      { $sel:nextToken:ListCreatedArtifacts' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:maxResults:ListCreatedArtifacts' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
        $sel:progressUpdateStream:ListCreatedArtifacts' :: Text
progressUpdateStream = Text
pProgressUpdateStream_,
        $sel:migrationTaskName:ListCreatedArtifacts' :: 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@.
listCreatedArtifacts_nextToken :: Lens.Lens' ListCreatedArtifacts (Prelude.Maybe Prelude.Text)
listCreatedArtifacts_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListCreatedArtifacts -> f ListCreatedArtifacts
listCreatedArtifacts_nextToken = (ListCreatedArtifacts -> Maybe Text)
-> (ListCreatedArtifacts -> Maybe Text -> ListCreatedArtifacts)
-> Lens
     ListCreatedArtifacts ListCreatedArtifacts (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListCreatedArtifacts' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListCreatedArtifacts' :: ListCreatedArtifacts -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListCreatedArtifacts
s@ListCreatedArtifacts' {} Maybe Text
a -> ListCreatedArtifacts
s {$sel:nextToken:ListCreatedArtifacts' :: Maybe Text
nextToken = Maybe Text
a} :: ListCreatedArtifacts)

-- | Maximum number of results to be returned per page.
listCreatedArtifacts_maxResults :: Lens.Lens' ListCreatedArtifacts (Prelude.Maybe Prelude.Natural)
listCreatedArtifacts_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListCreatedArtifacts -> f ListCreatedArtifacts
listCreatedArtifacts_maxResults = (ListCreatedArtifacts -> Maybe Natural)
-> (ListCreatedArtifacts -> Maybe Natural -> ListCreatedArtifacts)
-> Lens
     ListCreatedArtifacts
     ListCreatedArtifacts
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListCreatedArtifacts' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListCreatedArtifacts' :: ListCreatedArtifacts -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListCreatedArtifacts
s@ListCreatedArtifacts' {} Maybe Natural
a -> ListCreatedArtifacts
s {$sel:maxResults:ListCreatedArtifacts' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListCreatedArtifacts)

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

-- | Unique identifier that references the migration task. /Do not store
-- personal data in this field./
listCreatedArtifacts_migrationTaskName :: Lens.Lens' ListCreatedArtifacts Prelude.Text
listCreatedArtifacts_migrationTaskName :: (Text -> f Text) -> ListCreatedArtifacts -> f ListCreatedArtifacts
listCreatedArtifacts_migrationTaskName = (ListCreatedArtifacts -> Text)
-> (ListCreatedArtifacts -> Text -> ListCreatedArtifacts)
-> Lens ListCreatedArtifacts ListCreatedArtifacts Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListCreatedArtifacts' {Text
migrationTaskName :: Text
$sel:migrationTaskName:ListCreatedArtifacts' :: ListCreatedArtifacts -> Text
migrationTaskName} -> Text
migrationTaskName) (\s :: ListCreatedArtifacts
s@ListCreatedArtifacts' {} Text
a -> ListCreatedArtifacts
s {$sel:migrationTaskName:ListCreatedArtifacts' :: Text
migrationTaskName = Text
a} :: ListCreatedArtifacts)

instance Core.AWSPager ListCreatedArtifacts where
  page :: ListCreatedArtifacts
-> AWSResponse ListCreatedArtifacts -> Maybe ListCreatedArtifacts
page ListCreatedArtifacts
rq AWSResponse ListCreatedArtifacts
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListCreatedArtifacts
ListCreatedArtifactsResponse
rs
            ListCreatedArtifactsResponse
-> Getting (First Text) ListCreatedArtifactsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListCreatedArtifactsResponse
-> Const (First Text) ListCreatedArtifactsResponse
Lens' ListCreatedArtifactsResponse (Maybe Text)
listCreatedArtifactsResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListCreatedArtifactsResponse
 -> Const (First Text) ListCreatedArtifactsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListCreatedArtifactsResponse 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 ListCreatedArtifacts
forall a. Maybe a
Prelude.Nothing
    | Maybe [CreatedArtifact] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListCreatedArtifacts
ListCreatedArtifactsResponse
rs
            ListCreatedArtifactsResponse
-> Getting
     (First [CreatedArtifact])
     ListCreatedArtifactsResponse
     [CreatedArtifact]
-> Maybe [CreatedArtifact]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [CreatedArtifact]
 -> Const (First [CreatedArtifact]) (Maybe [CreatedArtifact]))
-> ListCreatedArtifactsResponse
-> Const (First [CreatedArtifact]) ListCreatedArtifactsResponse
Lens' ListCreatedArtifactsResponse (Maybe [CreatedArtifact])
listCreatedArtifactsResponse_createdArtifactList
              ((Maybe [CreatedArtifact]
  -> Const (First [CreatedArtifact]) (Maybe [CreatedArtifact]))
 -> ListCreatedArtifactsResponse
 -> Const (First [CreatedArtifact]) ListCreatedArtifactsResponse)
-> (([CreatedArtifact]
     -> Const (First [CreatedArtifact]) [CreatedArtifact])
    -> Maybe [CreatedArtifact]
    -> Const (First [CreatedArtifact]) (Maybe [CreatedArtifact]))
-> Getting
     (First [CreatedArtifact])
     ListCreatedArtifactsResponse
     [CreatedArtifact]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([CreatedArtifact]
 -> Const (First [CreatedArtifact]) [CreatedArtifact])
-> Maybe [CreatedArtifact]
-> Const (First [CreatedArtifact]) (Maybe [CreatedArtifact])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListCreatedArtifacts
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListCreatedArtifacts -> Maybe ListCreatedArtifacts
forall a. a -> Maybe a
Prelude.Just (ListCreatedArtifacts -> Maybe ListCreatedArtifacts)
-> ListCreatedArtifacts -> Maybe ListCreatedArtifacts
forall a b. (a -> b) -> a -> b
Prelude.$
        ListCreatedArtifacts
rq
          ListCreatedArtifacts
-> (ListCreatedArtifacts -> ListCreatedArtifacts)
-> ListCreatedArtifacts
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListCreatedArtifacts -> Identity ListCreatedArtifacts
Lens
  ListCreatedArtifacts ListCreatedArtifacts (Maybe Text) (Maybe Text)
listCreatedArtifacts_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListCreatedArtifacts -> Identity ListCreatedArtifacts)
-> Maybe Text -> ListCreatedArtifacts -> ListCreatedArtifacts
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListCreatedArtifacts
ListCreatedArtifactsResponse
rs
          ListCreatedArtifactsResponse
-> Getting (First Text) ListCreatedArtifactsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListCreatedArtifactsResponse
-> Const (First Text) ListCreatedArtifactsResponse
Lens' ListCreatedArtifactsResponse (Maybe Text)
listCreatedArtifactsResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListCreatedArtifactsResponse
 -> Const (First Text) ListCreatedArtifactsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListCreatedArtifactsResponse 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 ListCreatedArtifacts where
  type
    AWSResponse ListCreatedArtifacts =
      ListCreatedArtifactsResponse
  request :: ListCreatedArtifacts -> Request ListCreatedArtifacts
request = Service -> ListCreatedArtifacts -> Request ListCreatedArtifacts
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy ListCreatedArtifacts
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListCreatedArtifacts)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListCreatedArtifacts))
-> Logger
-> Service
-> Proxy ListCreatedArtifacts
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListCreatedArtifacts)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Maybe [CreatedArtifact] -> Int -> ListCreatedArtifactsResponse
ListCreatedArtifactsResponse'
            (Maybe Text
 -> Maybe [CreatedArtifact] -> Int -> ListCreatedArtifactsResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [CreatedArtifact] -> Int -> ListCreatedArtifactsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"NextToken")
            Either
  String
  (Maybe [CreatedArtifact] -> Int -> ListCreatedArtifactsResponse)
-> Either String (Maybe [CreatedArtifact])
-> Either String (Int -> ListCreatedArtifactsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Either String (Maybe (Maybe [CreatedArtifact]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"CreatedArtifactList"
                            Either String (Maybe (Maybe [CreatedArtifact]))
-> Maybe [CreatedArtifact]
-> Either String (Maybe [CreatedArtifact])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [CreatedArtifact]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either String (Int -> ListCreatedArtifactsResponse)
-> Either String Int -> Either String ListCreatedArtifactsResponse
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 ListCreatedArtifacts

instance Prelude.NFData ListCreatedArtifacts

instance Core.ToHeaders ListCreatedArtifacts where
  toHeaders :: ListCreatedArtifacts -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListCreatedArtifacts -> 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.ListCreatedArtifacts" ::
                          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 ListCreatedArtifacts where
  toJSON :: ListCreatedArtifacts -> Value
toJSON ListCreatedArtifacts' {Maybe Natural
Maybe Text
Text
migrationTaskName :: Text
progressUpdateStream :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:migrationTaskName:ListCreatedArtifacts' :: ListCreatedArtifacts -> Text
$sel:progressUpdateStream:ListCreatedArtifacts' :: ListCreatedArtifacts -> Text
$sel:maxResults:ListCreatedArtifacts' :: ListCreatedArtifacts -> Maybe Natural
$sel:nextToken:ListCreatedArtifacts' :: ListCreatedArtifacts -> 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 ListCreatedArtifacts where
  toPath :: ListCreatedArtifacts -> ByteString
toPath = ByteString -> ListCreatedArtifacts -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

-- | /See:/ 'newListCreatedArtifactsResponse' smart constructor.
data ListCreatedArtifactsResponse = ListCreatedArtifactsResponse'
  { -- | If there are more created artifacts than the max result, return the next
    -- token to be passed to the next call as a bookmark of where to start
    -- from.
    ListCreatedArtifactsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | List of created artifacts up to the maximum number of results specified
    -- in the request.
    ListCreatedArtifactsResponse -> Maybe [CreatedArtifact]
createdArtifactList :: Prelude.Maybe [CreatedArtifact],
    -- | The response's http status code.
    ListCreatedArtifactsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListCreatedArtifactsResponse
-> ListCreatedArtifactsResponse -> Bool
(ListCreatedArtifactsResponse
 -> ListCreatedArtifactsResponse -> Bool)
-> (ListCreatedArtifactsResponse
    -> ListCreatedArtifactsResponse -> Bool)
-> Eq ListCreatedArtifactsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListCreatedArtifactsResponse
-> ListCreatedArtifactsResponse -> Bool
$c/= :: ListCreatedArtifactsResponse
-> ListCreatedArtifactsResponse -> Bool
== :: ListCreatedArtifactsResponse
-> ListCreatedArtifactsResponse -> Bool
$c== :: ListCreatedArtifactsResponse
-> ListCreatedArtifactsResponse -> Bool
Prelude.Eq, ReadPrec [ListCreatedArtifactsResponse]
ReadPrec ListCreatedArtifactsResponse
Int -> ReadS ListCreatedArtifactsResponse
ReadS [ListCreatedArtifactsResponse]
(Int -> ReadS ListCreatedArtifactsResponse)
-> ReadS [ListCreatedArtifactsResponse]
-> ReadPrec ListCreatedArtifactsResponse
-> ReadPrec [ListCreatedArtifactsResponse]
-> Read ListCreatedArtifactsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListCreatedArtifactsResponse]
$creadListPrec :: ReadPrec [ListCreatedArtifactsResponse]
readPrec :: ReadPrec ListCreatedArtifactsResponse
$creadPrec :: ReadPrec ListCreatedArtifactsResponse
readList :: ReadS [ListCreatedArtifactsResponse]
$creadList :: ReadS [ListCreatedArtifactsResponse]
readsPrec :: Int -> ReadS ListCreatedArtifactsResponse
$creadsPrec :: Int -> ReadS ListCreatedArtifactsResponse
Prelude.Read, Int -> ListCreatedArtifactsResponse -> ShowS
[ListCreatedArtifactsResponse] -> ShowS
ListCreatedArtifactsResponse -> String
(Int -> ListCreatedArtifactsResponse -> ShowS)
-> (ListCreatedArtifactsResponse -> String)
-> ([ListCreatedArtifactsResponse] -> ShowS)
-> Show ListCreatedArtifactsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListCreatedArtifactsResponse] -> ShowS
$cshowList :: [ListCreatedArtifactsResponse] -> ShowS
show :: ListCreatedArtifactsResponse -> String
$cshow :: ListCreatedArtifactsResponse -> String
showsPrec :: Int -> ListCreatedArtifactsResponse -> ShowS
$cshowsPrec :: Int -> ListCreatedArtifactsResponse -> ShowS
Prelude.Show, (forall x.
 ListCreatedArtifactsResponse -> Rep ListCreatedArtifactsResponse x)
-> (forall x.
    Rep ListCreatedArtifactsResponse x -> ListCreatedArtifactsResponse)
-> Generic ListCreatedArtifactsResponse
forall x.
Rep ListCreatedArtifactsResponse x -> ListCreatedArtifactsResponse
forall x.
ListCreatedArtifactsResponse -> Rep ListCreatedArtifactsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListCreatedArtifactsResponse x -> ListCreatedArtifactsResponse
$cfrom :: forall x.
ListCreatedArtifactsResponse -> Rep ListCreatedArtifactsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListCreatedArtifactsResponse' 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', 'listCreatedArtifactsResponse_nextToken' - If there are more created artifacts than the max result, return the next
-- token to be passed to the next call as a bookmark of where to start
-- from.
--
-- 'createdArtifactList', 'listCreatedArtifactsResponse_createdArtifactList' - List of created artifacts up to the maximum number of results specified
-- in the request.
--
-- 'httpStatus', 'listCreatedArtifactsResponse_httpStatus' - The response's http status code.
newListCreatedArtifactsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListCreatedArtifactsResponse
newListCreatedArtifactsResponse :: Int -> ListCreatedArtifactsResponse
newListCreatedArtifactsResponse Int
pHttpStatus_ =
  ListCreatedArtifactsResponse' :: Maybe Text
-> Maybe [CreatedArtifact] -> Int -> ListCreatedArtifactsResponse
ListCreatedArtifactsResponse'
    { $sel:nextToken:ListCreatedArtifactsResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:createdArtifactList:ListCreatedArtifactsResponse' :: Maybe [CreatedArtifact]
createdArtifactList = Maybe [CreatedArtifact]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListCreatedArtifactsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

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

-- | List of created artifacts up to the maximum number of results specified
-- in the request.
listCreatedArtifactsResponse_createdArtifactList :: Lens.Lens' ListCreatedArtifactsResponse (Prelude.Maybe [CreatedArtifact])
listCreatedArtifactsResponse_createdArtifactList :: (Maybe [CreatedArtifact] -> f (Maybe [CreatedArtifact]))
-> ListCreatedArtifactsResponse -> f ListCreatedArtifactsResponse
listCreatedArtifactsResponse_createdArtifactList = (ListCreatedArtifactsResponse -> Maybe [CreatedArtifact])
-> (ListCreatedArtifactsResponse
    -> Maybe [CreatedArtifact] -> ListCreatedArtifactsResponse)
-> Lens' ListCreatedArtifactsResponse (Maybe [CreatedArtifact])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListCreatedArtifactsResponse' {Maybe [CreatedArtifact]
createdArtifactList :: Maybe [CreatedArtifact]
$sel:createdArtifactList:ListCreatedArtifactsResponse' :: ListCreatedArtifactsResponse -> Maybe [CreatedArtifact]
createdArtifactList} -> Maybe [CreatedArtifact]
createdArtifactList) (\s :: ListCreatedArtifactsResponse
s@ListCreatedArtifactsResponse' {} Maybe [CreatedArtifact]
a -> ListCreatedArtifactsResponse
s {$sel:createdArtifactList:ListCreatedArtifactsResponse' :: Maybe [CreatedArtifact]
createdArtifactList = Maybe [CreatedArtifact]
a} :: ListCreatedArtifactsResponse) ((Maybe [CreatedArtifact] -> f (Maybe [CreatedArtifact]))
 -> ListCreatedArtifactsResponse -> f ListCreatedArtifactsResponse)
-> ((Maybe [CreatedArtifact] -> f (Maybe [CreatedArtifact]))
    -> Maybe [CreatedArtifact] -> f (Maybe [CreatedArtifact]))
-> (Maybe [CreatedArtifact] -> f (Maybe [CreatedArtifact]))
-> ListCreatedArtifactsResponse
-> f ListCreatedArtifactsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [CreatedArtifact]
  [CreatedArtifact]
  [CreatedArtifact]
  [CreatedArtifact]
-> Iso
     (Maybe [CreatedArtifact])
     (Maybe [CreatedArtifact])
     (Maybe [CreatedArtifact])
     (Maybe [CreatedArtifact])
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
  [CreatedArtifact]
  [CreatedArtifact]
  [CreatedArtifact]
  [CreatedArtifact]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData ListCreatedArtifactsResponse