{-# 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.ServiceCatalog.ListProvisioningArtifactsForServiceAction
-- 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 all provisioning artifacts (also known as versions) for the
-- specified self-service action.
--
-- This operation returns paginated results.
module Amazonka.ServiceCatalog.ListProvisioningArtifactsForServiceAction
  ( -- * Creating a Request
    ListProvisioningArtifactsForServiceAction (..),
    newListProvisioningArtifactsForServiceAction,

    -- * Request Lenses
    listProvisioningArtifactsForServiceAction_acceptLanguage,
    listProvisioningArtifactsForServiceAction_pageToken,
    listProvisioningArtifactsForServiceAction_pageSize,
    listProvisioningArtifactsForServiceAction_serviceActionId,

    -- * Destructuring the Response
    ListProvisioningArtifactsForServiceActionResponse (..),
    newListProvisioningArtifactsForServiceActionResponse,

    -- * Response Lenses
    listProvisioningArtifactsForServiceActionResponse_nextPageToken,
    listProvisioningArtifactsForServiceActionResponse_provisioningArtifactViews,
    listProvisioningArtifactsForServiceActionResponse_httpStatus,
  )
where

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

-- | /See:/ 'newListProvisioningArtifactsForServiceAction' smart constructor.
data ListProvisioningArtifactsForServiceAction = ListProvisioningArtifactsForServiceAction'
  { -- | The language code.
    --
    -- -   @en@ - English (default)
    --
    -- -   @jp@ - Japanese
    --
    -- -   @zh@ - Chinese
    ListProvisioningArtifactsForServiceAction -> Maybe Text
acceptLanguage :: Prelude.Maybe Prelude.Text,
    -- | The page token for the next set of results. To retrieve the first set of
    -- results, use null.
    ListProvisioningArtifactsForServiceAction -> Maybe Text
pageToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of items to return with this call.
    ListProvisioningArtifactsForServiceAction -> Maybe Natural
pageSize :: Prelude.Maybe Prelude.Natural,
    -- | The self-service action identifier. For example, @act-fs7abcd89wxyz@.
    ListProvisioningArtifactsForServiceAction -> Text
serviceActionId :: Prelude.Text
  }
  deriving (ListProvisioningArtifactsForServiceAction
-> ListProvisioningArtifactsForServiceAction -> Bool
(ListProvisioningArtifactsForServiceAction
 -> ListProvisioningArtifactsForServiceAction -> Bool)
-> (ListProvisioningArtifactsForServiceAction
    -> ListProvisioningArtifactsForServiceAction -> Bool)
-> Eq ListProvisioningArtifactsForServiceAction
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListProvisioningArtifactsForServiceAction
-> ListProvisioningArtifactsForServiceAction -> Bool
$c/= :: ListProvisioningArtifactsForServiceAction
-> ListProvisioningArtifactsForServiceAction -> Bool
== :: ListProvisioningArtifactsForServiceAction
-> ListProvisioningArtifactsForServiceAction -> Bool
$c== :: ListProvisioningArtifactsForServiceAction
-> ListProvisioningArtifactsForServiceAction -> Bool
Prelude.Eq, ReadPrec [ListProvisioningArtifactsForServiceAction]
ReadPrec ListProvisioningArtifactsForServiceAction
Int -> ReadS ListProvisioningArtifactsForServiceAction
ReadS [ListProvisioningArtifactsForServiceAction]
(Int -> ReadS ListProvisioningArtifactsForServiceAction)
-> ReadS [ListProvisioningArtifactsForServiceAction]
-> ReadPrec ListProvisioningArtifactsForServiceAction
-> ReadPrec [ListProvisioningArtifactsForServiceAction]
-> Read ListProvisioningArtifactsForServiceAction
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListProvisioningArtifactsForServiceAction]
$creadListPrec :: ReadPrec [ListProvisioningArtifactsForServiceAction]
readPrec :: ReadPrec ListProvisioningArtifactsForServiceAction
$creadPrec :: ReadPrec ListProvisioningArtifactsForServiceAction
readList :: ReadS [ListProvisioningArtifactsForServiceAction]
$creadList :: ReadS [ListProvisioningArtifactsForServiceAction]
readsPrec :: Int -> ReadS ListProvisioningArtifactsForServiceAction
$creadsPrec :: Int -> ReadS ListProvisioningArtifactsForServiceAction
Prelude.Read, Int -> ListProvisioningArtifactsForServiceAction -> ShowS
[ListProvisioningArtifactsForServiceAction] -> ShowS
ListProvisioningArtifactsForServiceAction -> String
(Int -> ListProvisioningArtifactsForServiceAction -> ShowS)
-> (ListProvisioningArtifactsForServiceAction -> String)
-> ([ListProvisioningArtifactsForServiceAction] -> ShowS)
-> Show ListProvisioningArtifactsForServiceAction
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListProvisioningArtifactsForServiceAction] -> ShowS
$cshowList :: [ListProvisioningArtifactsForServiceAction] -> ShowS
show :: ListProvisioningArtifactsForServiceAction -> String
$cshow :: ListProvisioningArtifactsForServiceAction -> String
showsPrec :: Int -> ListProvisioningArtifactsForServiceAction -> ShowS
$cshowsPrec :: Int -> ListProvisioningArtifactsForServiceAction -> ShowS
Prelude.Show, (forall x.
 ListProvisioningArtifactsForServiceAction
 -> Rep ListProvisioningArtifactsForServiceAction x)
-> (forall x.
    Rep ListProvisioningArtifactsForServiceAction x
    -> ListProvisioningArtifactsForServiceAction)
-> Generic ListProvisioningArtifactsForServiceAction
forall x.
Rep ListProvisioningArtifactsForServiceAction x
-> ListProvisioningArtifactsForServiceAction
forall x.
ListProvisioningArtifactsForServiceAction
-> Rep ListProvisioningArtifactsForServiceAction x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListProvisioningArtifactsForServiceAction x
-> ListProvisioningArtifactsForServiceAction
$cfrom :: forall x.
ListProvisioningArtifactsForServiceAction
-> Rep ListProvisioningArtifactsForServiceAction x
Prelude.Generic)

-- |
-- Create a value of 'ListProvisioningArtifactsForServiceAction' 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:
--
-- 'acceptLanguage', 'listProvisioningArtifactsForServiceAction_acceptLanguage' - The language code.
--
-- -   @en@ - English (default)
--
-- -   @jp@ - Japanese
--
-- -   @zh@ - Chinese
--
-- 'pageToken', 'listProvisioningArtifactsForServiceAction_pageToken' - The page token for the next set of results. To retrieve the first set of
-- results, use null.
--
-- 'pageSize', 'listProvisioningArtifactsForServiceAction_pageSize' - The maximum number of items to return with this call.
--
-- 'serviceActionId', 'listProvisioningArtifactsForServiceAction_serviceActionId' - The self-service action identifier. For example, @act-fs7abcd89wxyz@.
newListProvisioningArtifactsForServiceAction ::
  -- | 'serviceActionId'
  Prelude.Text ->
  ListProvisioningArtifactsForServiceAction
newListProvisioningArtifactsForServiceAction :: Text -> ListProvisioningArtifactsForServiceAction
newListProvisioningArtifactsForServiceAction
  Text
pServiceActionId_ =
    ListProvisioningArtifactsForServiceAction' :: Maybe Text
-> Maybe Text
-> Maybe Natural
-> Text
-> ListProvisioningArtifactsForServiceAction
ListProvisioningArtifactsForServiceAction'
      { $sel:acceptLanguage:ListProvisioningArtifactsForServiceAction' :: Maybe Text
acceptLanguage =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:pageToken:ListProvisioningArtifactsForServiceAction' :: Maybe Text
pageToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:pageSize:ListProvisioningArtifactsForServiceAction' :: Maybe Natural
pageSize = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
        $sel:serviceActionId:ListProvisioningArtifactsForServiceAction' :: Text
serviceActionId =
          Text
pServiceActionId_
      }

-- | The language code.
--
-- -   @en@ - English (default)
--
-- -   @jp@ - Japanese
--
-- -   @zh@ - Chinese
listProvisioningArtifactsForServiceAction_acceptLanguage :: Lens.Lens' ListProvisioningArtifactsForServiceAction (Prelude.Maybe Prelude.Text)
listProvisioningArtifactsForServiceAction_acceptLanguage :: (Maybe Text -> f (Maybe Text))
-> ListProvisioningArtifactsForServiceAction
-> f ListProvisioningArtifactsForServiceAction
listProvisioningArtifactsForServiceAction_acceptLanguage = (ListProvisioningArtifactsForServiceAction -> Maybe Text)
-> (ListProvisioningArtifactsForServiceAction
    -> Maybe Text -> ListProvisioningArtifactsForServiceAction)
-> Lens
     ListProvisioningArtifactsForServiceAction
     ListProvisioningArtifactsForServiceAction
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListProvisioningArtifactsForServiceAction' {Maybe Text
acceptLanguage :: Maybe Text
$sel:acceptLanguage:ListProvisioningArtifactsForServiceAction' :: ListProvisioningArtifactsForServiceAction -> Maybe Text
acceptLanguage} -> Maybe Text
acceptLanguage) (\s :: ListProvisioningArtifactsForServiceAction
s@ListProvisioningArtifactsForServiceAction' {} Maybe Text
a -> ListProvisioningArtifactsForServiceAction
s {$sel:acceptLanguage:ListProvisioningArtifactsForServiceAction' :: Maybe Text
acceptLanguage = Maybe Text
a} :: ListProvisioningArtifactsForServiceAction)

-- | The page token for the next set of results. To retrieve the first set of
-- results, use null.
listProvisioningArtifactsForServiceAction_pageToken :: Lens.Lens' ListProvisioningArtifactsForServiceAction (Prelude.Maybe Prelude.Text)
listProvisioningArtifactsForServiceAction_pageToken :: (Maybe Text -> f (Maybe Text))
-> ListProvisioningArtifactsForServiceAction
-> f ListProvisioningArtifactsForServiceAction
listProvisioningArtifactsForServiceAction_pageToken = (ListProvisioningArtifactsForServiceAction -> Maybe Text)
-> (ListProvisioningArtifactsForServiceAction
    -> Maybe Text -> ListProvisioningArtifactsForServiceAction)
-> Lens
     ListProvisioningArtifactsForServiceAction
     ListProvisioningArtifactsForServiceAction
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListProvisioningArtifactsForServiceAction' {Maybe Text
pageToken :: Maybe Text
$sel:pageToken:ListProvisioningArtifactsForServiceAction' :: ListProvisioningArtifactsForServiceAction -> Maybe Text
pageToken} -> Maybe Text
pageToken) (\s :: ListProvisioningArtifactsForServiceAction
s@ListProvisioningArtifactsForServiceAction' {} Maybe Text
a -> ListProvisioningArtifactsForServiceAction
s {$sel:pageToken:ListProvisioningArtifactsForServiceAction' :: Maybe Text
pageToken = Maybe Text
a} :: ListProvisioningArtifactsForServiceAction)

-- | The maximum number of items to return with this call.
listProvisioningArtifactsForServiceAction_pageSize :: Lens.Lens' ListProvisioningArtifactsForServiceAction (Prelude.Maybe Prelude.Natural)
listProvisioningArtifactsForServiceAction_pageSize :: (Maybe Natural -> f (Maybe Natural))
-> ListProvisioningArtifactsForServiceAction
-> f ListProvisioningArtifactsForServiceAction
listProvisioningArtifactsForServiceAction_pageSize = (ListProvisioningArtifactsForServiceAction -> Maybe Natural)
-> (ListProvisioningArtifactsForServiceAction
    -> Maybe Natural -> ListProvisioningArtifactsForServiceAction)
-> Lens
     ListProvisioningArtifactsForServiceAction
     ListProvisioningArtifactsForServiceAction
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListProvisioningArtifactsForServiceAction' {Maybe Natural
pageSize :: Maybe Natural
$sel:pageSize:ListProvisioningArtifactsForServiceAction' :: ListProvisioningArtifactsForServiceAction -> Maybe Natural
pageSize} -> Maybe Natural
pageSize) (\s :: ListProvisioningArtifactsForServiceAction
s@ListProvisioningArtifactsForServiceAction' {} Maybe Natural
a -> ListProvisioningArtifactsForServiceAction
s {$sel:pageSize:ListProvisioningArtifactsForServiceAction' :: Maybe Natural
pageSize = Maybe Natural
a} :: ListProvisioningArtifactsForServiceAction)

-- | The self-service action identifier. For example, @act-fs7abcd89wxyz@.
listProvisioningArtifactsForServiceAction_serviceActionId :: Lens.Lens' ListProvisioningArtifactsForServiceAction Prelude.Text
listProvisioningArtifactsForServiceAction_serviceActionId :: (Text -> f Text)
-> ListProvisioningArtifactsForServiceAction
-> f ListProvisioningArtifactsForServiceAction
listProvisioningArtifactsForServiceAction_serviceActionId = (ListProvisioningArtifactsForServiceAction -> Text)
-> (ListProvisioningArtifactsForServiceAction
    -> Text -> ListProvisioningArtifactsForServiceAction)
-> Lens
     ListProvisioningArtifactsForServiceAction
     ListProvisioningArtifactsForServiceAction
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListProvisioningArtifactsForServiceAction' {Text
serviceActionId :: Text
$sel:serviceActionId:ListProvisioningArtifactsForServiceAction' :: ListProvisioningArtifactsForServiceAction -> Text
serviceActionId} -> Text
serviceActionId) (\s :: ListProvisioningArtifactsForServiceAction
s@ListProvisioningArtifactsForServiceAction' {} Text
a -> ListProvisioningArtifactsForServiceAction
s {$sel:serviceActionId:ListProvisioningArtifactsForServiceAction' :: Text
serviceActionId = Text
a} :: ListProvisioningArtifactsForServiceAction)

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

instance
  Prelude.NFData
    ListProvisioningArtifactsForServiceAction

instance
  Core.ToHeaders
    ListProvisioningArtifactsForServiceAction
  where
  toHeaders :: ListProvisioningArtifactsForServiceAction -> ResponseHeaders
toHeaders =
    ResponseHeaders
-> ListProvisioningArtifactsForServiceAction -> 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
"AWS242ServiceCatalogService.ListProvisioningArtifactsForServiceAction" ::
                          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
    ListProvisioningArtifactsForServiceAction
  where
  toJSON :: ListProvisioningArtifactsForServiceAction -> Value
toJSON ListProvisioningArtifactsForServiceAction' {Maybe Natural
Maybe Text
Text
serviceActionId :: Text
pageSize :: Maybe Natural
pageToken :: Maybe Text
acceptLanguage :: Maybe Text
$sel:serviceActionId:ListProvisioningArtifactsForServiceAction' :: ListProvisioningArtifactsForServiceAction -> Text
$sel:pageSize:ListProvisioningArtifactsForServiceAction' :: ListProvisioningArtifactsForServiceAction -> Maybe Natural
$sel:pageToken:ListProvisioningArtifactsForServiceAction' :: ListProvisioningArtifactsForServiceAction -> Maybe Text
$sel:acceptLanguage:ListProvisioningArtifactsForServiceAction' :: ListProvisioningArtifactsForServiceAction -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"AcceptLanguage" 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
acceptLanguage,
            (Text
"PageToken" 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
pageToken,
            (Text
"PageSize" 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
pageSize,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"ServiceActionId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
serviceActionId)
          ]
      )

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

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

-- | /See:/ 'newListProvisioningArtifactsForServiceActionResponse' smart constructor.
data ListProvisioningArtifactsForServiceActionResponse = ListProvisioningArtifactsForServiceActionResponse'
  { -- | The page token to use to retrieve the next set of results. If there are
    -- no additional results, this value is null.
    ListProvisioningArtifactsForServiceActionResponse -> Maybe Text
nextPageToken :: Prelude.Maybe Prelude.Text,
    -- | An array of objects with information about product views and
    -- provisioning artifacts.
    ListProvisioningArtifactsForServiceActionResponse
-> Maybe [ProvisioningArtifactView]
provisioningArtifactViews :: Prelude.Maybe [ProvisioningArtifactView],
    -- | The response's http status code.
    ListProvisioningArtifactsForServiceActionResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListProvisioningArtifactsForServiceActionResponse
-> ListProvisioningArtifactsForServiceActionResponse -> Bool
(ListProvisioningArtifactsForServiceActionResponse
 -> ListProvisioningArtifactsForServiceActionResponse -> Bool)
-> (ListProvisioningArtifactsForServiceActionResponse
    -> ListProvisioningArtifactsForServiceActionResponse -> Bool)
-> Eq ListProvisioningArtifactsForServiceActionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListProvisioningArtifactsForServiceActionResponse
-> ListProvisioningArtifactsForServiceActionResponse -> Bool
$c/= :: ListProvisioningArtifactsForServiceActionResponse
-> ListProvisioningArtifactsForServiceActionResponse -> Bool
== :: ListProvisioningArtifactsForServiceActionResponse
-> ListProvisioningArtifactsForServiceActionResponse -> Bool
$c== :: ListProvisioningArtifactsForServiceActionResponse
-> ListProvisioningArtifactsForServiceActionResponse -> Bool
Prelude.Eq, ReadPrec [ListProvisioningArtifactsForServiceActionResponse]
ReadPrec ListProvisioningArtifactsForServiceActionResponse
Int -> ReadS ListProvisioningArtifactsForServiceActionResponse
ReadS [ListProvisioningArtifactsForServiceActionResponse]
(Int -> ReadS ListProvisioningArtifactsForServiceActionResponse)
-> ReadS [ListProvisioningArtifactsForServiceActionResponse]
-> ReadPrec ListProvisioningArtifactsForServiceActionResponse
-> ReadPrec [ListProvisioningArtifactsForServiceActionResponse]
-> Read ListProvisioningArtifactsForServiceActionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListProvisioningArtifactsForServiceActionResponse]
$creadListPrec :: ReadPrec [ListProvisioningArtifactsForServiceActionResponse]
readPrec :: ReadPrec ListProvisioningArtifactsForServiceActionResponse
$creadPrec :: ReadPrec ListProvisioningArtifactsForServiceActionResponse
readList :: ReadS [ListProvisioningArtifactsForServiceActionResponse]
$creadList :: ReadS [ListProvisioningArtifactsForServiceActionResponse]
readsPrec :: Int -> ReadS ListProvisioningArtifactsForServiceActionResponse
$creadsPrec :: Int -> ReadS ListProvisioningArtifactsForServiceActionResponse
Prelude.Read, Int -> ListProvisioningArtifactsForServiceActionResponse -> ShowS
[ListProvisioningArtifactsForServiceActionResponse] -> ShowS
ListProvisioningArtifactsForServiceActionResponse -> String
(Int -> ListProvisioningArtifactsForServiceActionResponse -> ShowS)
-> (ListProvisioningArtifactsForServiceActionResponse -> String)
-> ([ListProvisioningArtifactsForServiceActionResponse] -> ShowS)
-> Show ListProvisioningArtifactsForServiceActionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListProvisioningArtifactsForServiceActionResponse] -> ShowS
$cshowList :: [ListProvisioningArtifactsForServiceActionResponse] -> ShowS
show :: ListProvisioningArtifactsForServiceActionResponse -> String
$cshow :: ListProvisioningArtifactsForServiceActionResponse -> String
showsPrec :: Int -> ListProvisioningArtifactsForServiceActionResponse -> ShowS
$cshowsPrec :: Int -> ListProvisioningArtifactsForServiceActionResponse -> ShowS
Prelude.Show, (forall x.
 ListProvisioningArtifactsForServiceActionResponse
 -> Rep ListProvisioningArtifactsForServiceActionResponse x)
-> (forall x.
    Rep ListProvisioningArtifactsForServiceActionResponse x
    -> ListProvisioningArtifactsForServiceActionResponse)
-> Generic ListProvisioningArtifactsForServiceActionResponse
forall x.
Rep ListProvisioningArtifactsForServiceActionResponse x
-> ListProvisioningArtifactsForServiceActionResponse
forall x.
ListProvisioningArtifactsForServiceActionResponse
-> Rep ListProvisioningArtifactsForServiceActionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListProvisioningArtifactsForServiceActionResponse x
-> ListProvisioningArtifactsForServiceActionResponse
$cfrom :: forall x.
ListProvisioningArtifactsForServiceActionResponse
-> Rep ListProvisioningArtifactsForServiceActionResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListProvisioningArtifactsForServiceActionResponse' 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:
--
-- 'nextPageToken', 'listProvisioningArtifactsForServiceActionResponse_nextPageToken' - The page token to use to retrieve the next set of results. If there are
-- no additional results, this value is null.
--
-- 'provisioningArtifactViews', 'listProvisioningArtifactsForServiceActionResponse_provisioningArtifactViews' - An array of objects with information about product views and
-- provisioning artifacts.
--
-- 'httpStatus', 'listProvisioningArtifactsForServiceActionResponse_httpStatus' - The response's http status code.
newListProvisioningArtifactsForServiceActionResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListProvisioningArtifactsForServiceActionResponse
newListProvisioningArtifactsForServiceActionResponse :: Int -> ListProvisioningArtifactsForServiceActionResponse
newListProvisioningArtifactsForServiceActionResponse
  Int
pHttpStatus_ =
    ListProvisioningArtifactsForServiceActionResponse' :: Maybe Text
-> Maybe [ProvisioningArtifactView]
-> Int
-> ListProvisioningArtifactsForServiceActionResponse
ListProvisioningArtifactsForServiceActionResponse'
      { $sel:nextPageToken:ListProvisioningArtifactsForServiceActionResponse' :: Maybe Text
nextPageToken =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:provisioningArtifactViews:ListProvisioningArtifactsForServiceActionResponse' :: Maybe [ProvisioningArtifactView]
provisioningArtifactViews =
          Maybe [ProvisioningArtifactView]
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:ListProvisioningArtifactsForServiceActionResponse' :: Int
httpStatus =
          Int
pHttpStatus_
      }

-- | The page token to use to retrieve the next set of results. If there are
-- no additional results, this value is null.
listProvisioningArtifactsForServiceActionResponse_nextPageToken :: Lens.Lens' ListProvisioningArtifactsForServiceActionResponse (Prelude.Maybe Prelude.Text)
listProvisioningArtifactsForServiceActionResponse_nextPageToken :: (Maybe Text -> f (Maybe Text))
-> ListProvisioningArtifactsForServiceActionResponse
-> f ListProvisioningArtifactsForServiceActionResponse
listProvisioningArtifactsForServiceActionResponse_nextPageToken = (ListProvisioningArtifactsForServiceActionResponse -> Maybe Text)
-> (ListProvisioningArtifactsForServiceActionResponse
    -> Maybe Text -> ListProvisioningArtifactsForServiceActionResponse)
-> Lens'
     ListProvisioningArtifactsForServiceActionResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListProvisioningArtifactsForServiceActionResponse' {Maybe Text
nextPageToken :: Maybe Text
$sel:nextPageToken:ListProvisioningArtifactsForServiceActionResponse' :: ListProvisioningArtifactsForServiceActionResponse -> Maybe Text
nextPageToken} -> Maybe Text
nextPageToken) (\s :: ListProvisioningArtifactsForServiceActionResponse
s@ListProvisioningArtifactsForServiceActionResponse' {} Maybe Text
a -> ListProvisioningArtifactsForServiceActionResponse
s {$sel:nextPageToken:ListProvisioningArtifactsForServiceActionResponse' :: Maybe Text
nextPageToken = Maybe Text
a} :: ListProvisioningArtifactsForServiceActionResponse)

-- | An array of objects with information about product views and
-- provisioning artifacts.
listProvisioningArtifactsForServiceActionResponse_provisioningArtifactViews :: Lens.Lens' ListProvisioningArtifactsForServiceActionResponse (Prelude.Maybe [ProvisioningArtifactView])
listProvisioningArtifactsForServiceActionResponse_provisioningArtifactViews :: (Maybe [ProvisioningArtifactView]
 -> f (Maybe [ProvisioningArtifactView]))
-> ListProvisioningArtifactsForServiceActionResponse
-> f ListProvisioningArtifactsForServiceActionResponse
listProvisioningArtifactsForServiceActionResponse_provisioningArtifactViews = (ListProvisioningArtifactsForServiceActionResponse
 -> Maybe [ProvisioningArtifactView])
-> (ListProvisioningArtifactsForServiceActionResponse
    -> Maybe [ProvisioningArtifactView]
    -> ListProvisioningArtifactsForServiceActionResponse)
-> Lens'
     ListProvisioningArtifactsForServiceActionResponse
     (Maybe [ProvisioningArtifactView])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListProvisioningArtifactsForServiceActionResponse' {Maybe [ProvisioningArtifactView]
provisioningArtifactViews :: Maybe [ProvisioningArtifactView]
$sel:provisioningArtifactViews:ListProvisioningArtifactsForServiceActionResponse' :: ListProvisioningArtifactsForServiceActionResponse
-> Maybe [ProvisioningArtifactView]
provisioningArtifactViews} -> Maybe [ProvisioningArtifactView]
provisioningArtifactViews) (\s :: ListProvisioningArtifactsForServiceActionResponse
s@ListProvisioningArtifactsForServiceActionResponse' {} Maybe [ProvisioningArtifactView]
a -> ListProvisioningArtifactsForServiceActionResponse
s {$sel:provisioningArtifactViews:ListProvisioningArtifactsForServiceActionResponse' :: Maybe [ProvisioningArtifactView]
provisioningArtifactViews = Maybe [ProvisioningArtifactView]
a} :: ListProvisioningArtifactsForServiceActionResponse) ((Maybe [ProvisioningArtifactView]
  -> f (Maybe [ProvisioningArtifactView]))
 -> ListProvisioningArtifactsForServiceActionResponse
 -> f ListProvisioningArtifactsForServiceActionResponse)
-> ((Maybe [ProvisioningArtifactView]
     -> f (Maybe [ProvisioningArtifactView]))
    -> Maybe [ProvisioningArtifactView]
    -> f (Maybe [ProvisioningArtifactView]))
-> (Maybe [ProvisioningArtifactView]
    -> f (Maybe [ProvisioningArtifactView]))
-> ListProvisioningArtifactsForServiceActionResponse
-> f ListProvisioningArtifactsForServiceActionResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ProvisioningArtifactView]
  [ProvisioningArtifactView]
  [ProvisioningArtifactView]
  [ProvisioningArtifactView]
-> Iso
     (Maybe [ProvisioningArtifactView])
     (Maybe [ProvisioningArtifactView])
     (Maybe [ProvisioningArtifactView])
     (Maybe [ProvisioningArtifactView])
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
  [ProvisioningArtifactView]
  [ProvisioningArtifactView]
  [ProvisioningArtifactView]
  [ProvisioningArtifactView]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance
  Prelude.NFData
    ListProvisioningArtifactsForServiceActionResponse