{-# 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.Nimble.ListLaunchProfiles
-- 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)
--
-- List all the launch profiles a studio.
--
-- This operation returns paginated results.
module Amazonka.Nimble.ListLaunchProfiles
  ( -- * Creating a Request
    ListLaunchProfiles (..),
    newListLaunchProfiles,

    -- * Request Lenses
    listLaunchProfiles_states,
    listLaunchProfiles_principalId,
    listLaunchProfiles_nextToken,
    listLaunchProfiles_maxResults,
    listLaunchProfiles_studioId,

    -- * Destructuring the Response
    ListLaunchProfilesResponse (..),
    newListLaunchProfilesResponse,

    -- * Response Lenses
    listLaunchProfilesResponse_launchProfiles,
    listLaunchProfilesResponse_nextToken,
    listLaunchProfilesResponse_httpStatus,
  )
where

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

-- | /See:/ 'newListLaunchProfiles' smart constructor.
data ListLaunchProfiles = ListLaunchProfiles'
  { -- | A list of states.
    ListLaunchProfiles -> Maybe [Text]
states :: Prelude.Maybe [Prelude.Text],
    -- | The principal ID.
    ListLaunchProfiles -> Maybe Text
principalId :: Prelude.Maybe Prelude.Text,
    -- | The token for the next set of results, or null if there are no more
    -- results.
    ListLaunchProfiles -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of results to be returned per request.
    ListLaunchProfiles -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The studio ID.
    ListLaunchProfiles -> Text
studioId :: Prelude.Text
  }
  deriving (ListLaunchProfiles -> ListLaunchProfiles -> Bool
(ListLaunchProfiles -> ListLaunchProfiles -> Bool)
-> (ListLaunchProfiles -> ListLaunchProfiles -> Bool)
-> Eq ListLaunchProfiles
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListLaunchProfiles -> ListLaunchProfiles -> Bool
$c/= :: ListLaunchProfiles -> ListLaunchProfiles -> Bool
== :: ListLaunchProfiles -> ListLaunchProfiles -> Bool
$c== :: ListLaunchProfiles -> ListLaunchProfiles -> Bool
Prelude.Eq, ReadPrec [ListLaunchProfiles]
ReadPrec ListLaunchProfiles
Int -> ReadS ListLaunchProfiles
ReadS [ListLaunchProfiles]
(Int -> ReadS ListLaunchProfiles)
-> ReadS [ListLaunchProfiles]
-> ReadPrec ListLaunchProfiles
-> ReadPrec [ListLaunchProfiles]
-> Read ListLaunchProfiles
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListLaunchProfiles]
$creadListPrec :: ReadPrec [ListLaunchProfiles]
readPrec :: ReadPrec ListLaunchProfiles
$creadPrec :: ReadPrec ListLaunchProfiles
readList :: ReadS [ListLaunchProfiles]
$creadList :: ReadS [ListLaunchProfiles]
readsPrec :: Int -> ReadS ListLaunchProfiles
$creadsPrec :: Int -> ReadS ListLaunchProfiles
Prelude.Read, Int -> ListLaunchProfiles -> ShowS
[ListLaunchProfiles] -> ShowS
ListLaunchProfiles -> String
(Int -> ListLaunchProfiles -> ShowS)
-> (ListLaunchProfiles -> String)
-> ([ListLaunchProfiles] -> ShowS)
-> Show ListLaunchProfiles
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListLaunchProfiles] -> ShowS
$cshowList :: [ListLaunchProfiles] -> ShowS
show :: ListLaunchProfiles -> String
$cshow :: ListLaunchProfiles -> String
showsPrec :: Int -> ListLaunchProfiles -> ShowS
$cshowsPrec :: Int -> ListLaunchProfiles -> ShowS
Prelude.Show, (forall x. ListLaunchProfiles -> Rep ListLaunchProfiles x)
-> (forall x. Rep ListLaunchProfiles x -> ListLaunchProfiles)
-> Generic ListLaunchProfiles
forall x. Rep ListLaunchProfiles x -> ListLaunchProfiles
forall x. ListLaunchProfiles -> Rep ListLaunchProfiles x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListLaunchProfiles x -> ListLaunchProfiles
$cfrom :: forall x. ListLaunchProfiles -> Rep ListLaunchProfiles x
Prelude.Generic)

-- |
-- Create a value of 'ListLaunchProfiles' 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:
--
-- 'states', 'listLaunchProfiles_states' - A list of states.
--
-- 'principalId', 'listLaunchProfiles_principalId' - The principal ID.
--
-- 'nextToken', 'listLaunchProfiles_nextToken' - The token for the next set of results, or null if there are no more
-- results.
--
-- 'maxResults', 'listLaunchProfiles_maxResults' - The maximum number of results to be returned per request.
--
-- 'studioId', 'listLaunchProfiles_studioId' - The studio ID.
newListLaunchProfiles ::
  -- | 'studioId'
  Prelude.Text ->
  ListLaunchProfiles
newListLaunchProfiles :: Text -> ListLaunchProfiles
newListLaunchProfiles Text
pStudioId_ =
  ListLaunchProfiles' :: Maybe [Text]
-> Maybe Text
-> Maybe Text
-> Maybe Natural
-> Text
-> ListLaunchProfiles
ListLaunchProfiles'
    { $sel:states:ListLaunchProfiles' :: Maybe [Text]
states = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:principalId:ListLaunchProfiles' :: Maybe Text
principalId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListLaunchProfiles' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListLaunchProfiles' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:studioId:ListLaunchProfiles' :: Text
studioId = Text
pStudioId_
    }

-- | A list of states.
listLaunchProfiles_states :: Lens.Lens' ListLaunchProfiles (Prelude.Maybe [Prelude.Text])
listLaunchProfiles_states :: (Maybe [Text] -> f (Maybe [Text]))
-> ListLaunchProfiles -> f ListLaunchProfiles
listLaunchProfiles_states = (ListLaunchProfiles -> Maybe [Text])
-> (ListLaunchProfiles -> Maybe [Text] -> ListLaunchProfiles)
-> Lens
     ListLaunchProfiles ListLaunchProfiles (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListLaunchProfiles' {Maybe [Text]
states :: Maybe [Text]
$sel:states:ListLaunchProfiles' :: ListLaunchProfiles -> Maybe [Text]
states} -> Maybe [Text]
states) (\s :: ListLaunchProfiles
s@ListLaunchProfiles' {} Maybe [Text]
a -> ListLaunchProfiles
s {$sel:states:ListLaunchProfiles' :: Maybe [Text]
states = Maybe [Text]
a} :: ListLaunchProfiles) ((Maybe [Text] -> f (Maybe [Text]))
 -> ListLaunchProfiles -> f ListLaunchProfiles)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> ListLaunchProfiles
-> f ListLaunchProfiles
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The principal ID.
listLaunchProfiles_principalId :: Lens.Lens' ListLaunchProfiles (Prelude.Maybe Prelude.Text)
listLaunchProfiles_principalId :: (Maybe Text -> f (Maybe Text))
-> ListLaunchProfiles -> f ListLaunchProfiles
listLaunchProfiles_principalId = (ListLaunchProfiles -> Maybe Text)
-> (ListLaunchProfiles -> Maybe Text -> ListLaunchProfiles)
-> Lens
     ListLaunchProfiles ListLaunchProfiles (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListLaunchProfiles' {Maybe Text
principalId :: Maybe Text
$sel:principalId:ListLaunchProfiles' :: ListLaunchProfiles -> Maybe Text
principalId} -> Maybe Text
principalId) (\s :: ListLaunchProfiles
s@ListLaunchProfiles' {} Maybe Text
a -> ListLaunchProfiles
s {$sel:principalId:ListLaunchProfiles' :: Maybe Text
principalId = Maybe Text
a} :: ListLaunchProfiles)

-- | The token for the next set of results, or null if there are no more
-- results.
listLaunchProfiles_nextToken :: Lens.Lens' ListLaunchProfiles (Prelude.Maybe Prelude.Text)
listLaunchProfiles_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListLaunchProfiles -> f ListLaunchProfiles
listLaunchProfiles_nextToken = (ListLaunchProfiles -> Maybe Text)
-> (ListLaunchProfiles -> Maybe Text -> ListLaunchProfiles)
-> Lens
     ListLaunchProfiles ListLaunchProfiles (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListLaunchProfiles' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListLaunchProfiles' :: ListLaunchProfiles -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListLaunchProfiles
s@ListLaunchProfiles' {} Maybe Text
a -> ListLaunchProfiles
s {$sel:nextToken:ListLaunchProfiles' :: Maybe Text
nextToken = Maybe Text
a} :: ListLaunchProfiles)

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

-- | The studio ID.
listLaunchProfiles_studioId :: Lens.Lens' ListLaunchProfiles Prelude.Text
listLaunchProfiles_studioId :: (Text -> f Text) -> ListLaunchProfiles -> f ListLaunchProfiles
listLaunchProfiles_studioId = (ListLaunchProfiles -> Text)
-> (ListLaunchProfiles -> Text -> ListLaunchProfiles)
-> Lens ListLaunchProfiles ListLaunchProfiles Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListLaunchProfiles' {Text
studioId :: Text
$sel:studioId:ListLaunchProfiles' :: ListLaunchProfiles -> Text
studioId} -> Text
studioId) (\s :: ListLaunchProfiles
s@ListLaunchProfiles' {} Text
a -> ListLaunchProfiles
s {$sel:studioId:ListLaunchProfiles' :: Text
studioId = Text
a} :: ListLaunchProfiles)

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

instance Prelude.NFData ListLaunchProfiles

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

instance Core.ToPath ListLaunchProfiles where
  toPath :: ListLaunchProfiles -> ByteString
toPath ListLaunchProfiles' {Maybe Natural
Maybe [Text]
Maybe Text
Text
studioId :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
principalId :: Maybe Text
states :: Maybe [Text]
$sel:studioId:ListLaunchProfiles' :: ListLaunchProfiles -> Text
$sel:maxResults:ListLaunchProfiles' :: ListLaunchProfiles -> Maybe Natural
$sel:nextToken:ListLaunchProfiles' :: ListLaunchProfiles -> Maybe Text
$sel:principalId:ListLaunchProfiles' :: ListLaunchProfiles -> Maybe Text
$sel:states:ListLaunchProfiles' :: ListLaunchProfiles -> Maybe [Text]
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/2020-08-01/studios/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
studioId,
        ByteString
"/launch-profiles"
      ]

instance Core.ToQuery ListLaunchProfiles where
  toQuery :: ListLaunchProfiles -> QueryString
toQuery ListLaunchProfiles' {Maybe Natural
Maybe [Text]
Maybe Text
Text
studioId :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
principalId :: Maybe Text
states :: Maybe [Text]
$sel:studioId:ListLaunchProfiles' :: ListLaunchProfiles -> Text
$sel:maxResults:ListLaunchProfiles' :: ListLaunchProfiles -> Maybe Natural
$sel:nextToken:ListLaunchProfiles' :: ListLaunchProfiles -> Maybe Text
$sel:principalId:ListLaunchProfiles' :: ListLaunchProfiles -> Maybe Text
$sel:states:ListLaunchProfiles' :: ListLaunchProfiles -> Maybe [Text]
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"states"
          ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
            (ByteString -> [Text] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"member" ([Text] -> QueryString) -> Maybe [Text] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
states),
        ByteString
"principalId" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
principalId,
        ByteString
"nextToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
nextToken,
        ByteString
"maxResults" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
maxResults
      ]

-- | /See:/ 'newListLaunchProfilesResponse' smart constructor.
data ListLaunchProfilesResponse = ListLaunchProfilesResponse'
  { -- | A collection of launch profiles.
    ListLaunchProfilesResponse -> Maybe [LaunchProfile]
launchProfiles :: Prelude.Maybe [LaunchProfile],
    -- | The token for the next set of results, or null if there are no more
    -- results.
    ListLaunchProfilesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListLaunchProfilesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListLaunchProfilesResponse -> ListLaunchProfilesResponse -> Bool
(ListLaunchProfilesResponse -> ListLaunchProfilesResponse -> Bool)
-> (ListLaunchProfilesResponse
    -> ListLaunchProfilesResponse -> Bool)
-> Eq ListLaunchProfilesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListLaunchProfilesResponse -> ListLaunchProfilesResponse -> Bool
$c/= :: ListLaunchProfilesResponse -> ListLaunchProfilesResponse -> Bool
== :: ListLaunchProfilesResponse -> ListLaunchProfilesResponse -> Bool
$c== :: ListLaunchProfilesResponse -> ListLaunchProfilesResponse -> Bool
Prelude.Eq, ReadPrec [ListLaunchProfilesResponse]
ReadPrec ListLaunchProfilesResponse
Int -> ReadS ListLaunchProfilesResponse
ReadS [ListLaunchProfilesResponse]
(Int -> ReadS ListLaunchProfilesResponse)
-> ReadS [ListLaunchProfilesResponse]
-> ReadPrec ListLaunchProfilesResponse
-> ReadPrec [ListLaunchProfilesResponse]
-> Read ListLaunchProfilesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListLaunchProfilesResponse]
$creadListPrec :: ReadPrec [ListLaunchProfilesResponse]
readPrec :: ReadPrec ListLaunchProfilesResponse
$creadPrec :: ReadPrec ListLaunchProfilesResponse
readList :: ReadS [ListLaunchProfilesResponse]
$creadList :: ReadS [ListLaunchProfilesResponse]
readsPrec :: Int -> ReadS ListLaunchProfilesResponse
$creadsPrec :: Int -> ReadS ListLaunchProfilesResponse
Prelude.Read, Int -> ListLaunchProfilesResponse -> ShowS
[ListLaunchProfilesResponse] -> ShowS
ListLaunchProfilesResponse -> String
(Int -> ListLaunchProfilesResponse -> ShowS)
-> (ListLaunchProfilesResponse -> String)
-> ([ListLaunchProfilesResponse] -> ShowS)
-> Show ListLaunchProfilesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListLaunchProfilesResponse] -> ShowS
$cshowList :: [ListLaunchProfilesResponse] -> ShowS
show :: ListLaunchProfilesResponse -> String
$cshow :: ListLaunchProfilesResponse -> String
showsPrec :: Int -> ListLaunchProfilesResponse -> ShowS
$cshowsPrec :: Int -> ListLaunchProfilesResponse -> ShowS
Prelude.Show, (forall x.
 ListLaunchProfilesResponse -> Rep ListLaunchProfilesResponse x)
-> (forall x.
    Rep ListLaunchProfilesResponse x -> ListLaunchProfilesResponse)
-> Generic ListLaunchProfilesResponse
forall x.
Rep ListLaunchProfilesResponse x -> ListLaunchProfilesResponse
forall x.
ListLaunchProfilesResponse -> Rep ListLaunchProfilesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListLaunchProfilesResponse x -> ListLaunchProfilesResponse
$cfrom :: forall x.
ListLaunchProfilesResponse -> Rep ListLaunchProfilesResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListLaunchProfilesResponse' 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:
--
-- 'launchProfiles', 'listLaunchProfilesResponse_launchProfiles' - A collection of launch profiles.
--
-- 'nextToken', 'listLaunchProfilesResponse_nextToken' - The token for the next set of results, or null if there are no more
-- results.
--
-- 'httpStatus', 'listLaunchProfilesResponse_httpStatus' - The response's http status code.
newListLaunchProfilesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListLaunchProfilesResponse
newListLaunchProfilesResponse :: Int -> ListLaunchProfilesResponse
newListLaunchProfilesResponse Int
pHttpStatus_ =
  ListLaunchProfilesResponse' :: Maybe [LaunchProfile]
-> Maybe Text -> Int -> ListLaunchProfilesResponse
ListLaunchProfilesResponse'
    { $sel:launchProfiles:ListLaunchProfilesResponse' :: Maybe [LaunchProfile]
launchProfiles =
        Maybe [LaunchProfile]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListLaunchProfilesResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListLaunchProfilesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A collection of launch profiles.
listLaunchProfilesResponse_launchProfiles :: Lens.Lens' ListLaunchProfilesResponse (Prelude.Maybe [LaunchProfile])
listLaunchProfilesResponse_launchProfiles :: (Maybe [LaunchProfile] -> f (Maybe [LaunchProfile]))
-> ListLaunchProfilesResponse -> f ListLaunchProfilesResponse
listLaunchProfilesResponse_launchProfiles = (ListLaunchProfilesResponse -> Maybe [LaunchProfile])
-> (ListLaunchProfilesResponse
    -> Maybe [LaunchProfile] -> ListLaunchProfilesResponse)
-> Lens' ListLaunchProfilesResponse (Maybe [LaunchProfile])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListLaunchProfilesResponse' {Maybe [LaunchProfile]
launchProfiles :: Maybe [LaunchProfile]
$sel:launchProfiles:ListLaunchProfilesResponse' :: ListLaunchProfilesResponse -> Maybe [LaunchProfile]
launchProfiles} -> Maybe [LaunchProfile]
launchProfiles) (\s :: ListLaunchProfilesResponse
s@ListLaunchProfilesResponse' {} Maybe [LaunchProfile]
a -> ListLaunchProfilesResponse
s {$sel:launchProfiles:ListLaunchProfilesResponse' :: Maybe [LaunchProfile]
launchProfiles = Maybe [LaunchProfile]
a} :: ListLaunchProfilesResponse) ((Maybe [LaunchProfile] -> f (Maybe [LaunchProfile]))
 -> ListLaunchProfilesResponse -> f ListLaunchProfilesResponse)
-> ((Maybe [LaunchProfile] -> f (Maybe [LaunchProfile]))
    -> Maybe [LaunchProfile] -> f (Maybe [LaunchProfile]))
-> (Maybe [LaunchProfile] -> f (Maybe [LaunchProfile]))
-> ListLaunchProfilesResponse
-> f ListLaunchProfilesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [LaunchProfile] [LaunchProfile] [LaunchProfile] [LaunchProfile]
-> Iso
     (Maybe [LaunchProfile])
     (Maybe [LaunchProfile])
     (Maybe [LaunchProfile])
     (Maybe [LaunchProfile])
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
  [LaunchProfile] [LaunchProfile] [LaunchProfile] [LaunchProfile]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The token for the next set of results, or null if there are no more
-- results.
listLaunchProfilesResponse_nextToken :: Lens.Lens' ListLaunchProfilesResponse (Prelude.Maybe Prelude.Text)
listLaunchProfilesResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListLaunchProfilesResponse -> f ListLaunchProfilesResponse
listLaunchProfilesResponse_nextToken = (ListLaunchProfilesResponse -> Maybe Text)
-> (ListLaunchProfilesResponse
    -> Maybe Text -> ListLaunchProfilesResponse)
-> Lens' ListLaunchProfilesResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListLaunchProfilesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListLaunchProfilesResponse' :: ListLaunchProfilesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListLaunchProfilesResponse
s@ListLaunchProfilesResponse' {} Maybe Text
a -> ListLaunchProfilesResponse
s {$sel:nextToken:ListLaunchProfilesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListLaunchProfilesResponse)

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

instance Prelude.NFData ListLaunchProfilesResponse