{-# 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.ListStudioComponents
-- 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 StudioComponents in a studio.
--
-- This operation returns paginated results.
module Amazonka.Nimble.ListStudioComponents
  ( -- * Creating a Request
    ListStudioComponents (..),
    newListStudioComponents,

    -- * Request Lenses
    listStudioComponents_states,
    listStudioComponents_types,
    listStudioComponents_nextToken,
    listStudioComponents_maxResults,
    listStudioComponents_studioId,

    -- * Destructuring the Response
    ListStudioComponentsResponse (..),
    newListStudioComponentsResponse,

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

-- |
-- Create a value of 'ListStudioComponents' 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', 'listStudioComponents_states' - A list of states.
--
-- 'types', 'listStudioComponents_types' - The types.
--
-- 'nextToken', 'listStudioComponents_nextToken' - The token for the next set of results, or null if there are no more
-- results.
--
-- 'maxResults', 'listStudioComponents_maxResults' - The maximum number of results to be returned per request.
--
-- 'studioId', 'listStudioComponents_studioId' - The studio ID.
newListStudioComponents ::
  -- | 'studioId'
  Prelude.Text ->
  ListStudioComponents
newListStudioComponents :: Text -> ListStudioComponents
newListStudioComponents Text
pStudioId_ =
  ListStudioComponents' :: Maybe [Text]
-> Maybe [Text]
-> Maybe Text
-> Maybe Natural
-> Text
-> ListStudioComponents
ListStudioComponents'
    { $sel:states:ListStudioComponents' :: Maybe [Text]
states = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:types:ListStudioComponents' :: Maybe [Text]
types = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListStudioComponents' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListStudioComponents' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:studioId:ListStudioComponents' :: Text
studioId = Text
pStudioId_
    }

-- | A list of states.
listStudioComponents_states :: Lens.Lens' ListStudioComponents (Prelude.Maybe [Prelude.Text])
listStudioComponents_states :: (Maybe [Text] -> f (Maybe [Text]))
-> ListStudioComponents -> f ListStudioComponents
listStudioComponents_states = (ListStudioComponents -> Maybe [Text])
-> (ListStudioComponents -> Maybe [Text] -> ListStudioComponents)
-> Lens
     ListStudioComponents
     ListStudioComponents
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListStudioComponents' {Maybe [Text]
states :: Maybe [Text]
$sel:states:ListStudioComponents' :: ListStudioComponents -> Maybe [Text]
states} -> Maybe [Text]
states) (\s :: ListStudioComponents
s@ListStudioComponents' {} Maybe [Text]
a -> ListStudioComponents
s {$sel:states:ListStudioComponents' :: Maybe [Text]
states = Maybe [Text]
a} :: ListStudioComponents) ((Maybe [Text] -> f (Maybe [Text]))
 -> ListStudioComponents -> f ListStudioComponents)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> ListStudioComponents
-> f ListStudioComponents
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 types.
listStudioComponents_types :: Lens.Lens' ListStudioComponents (Prelude.Maybe [Prelude.Text])
listStudioComponents_types :: (Maybe [Text] -> f (Maybe [Text]))
-> ListStudioComponents -> f ListStudioComponents
listStudioComponents_types = (ListStudioComponents -> Maybe [Text])
-> (ListStudioComponents -> Maybe [Text] -> ListStudioComponents)
-> Lens
     ListStudioComponents
     ListStudioComponents
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListStudioComponents' {Maybe [Text]
types :: Maybe [Text]
$sel:types:ListStudioComponents' :: ListStudioComponents -> Maybe [Text]
types} -> Maybe [Text]
types) (\s :: ListStudioComponents
s@ListStudioComponents' {} Maybe [Text]
a -> ListStudioComponents
s {$sel:types:ListStudioComponents' :: Maybe [Text]
types = Maybe [Text]
a} :: ListStudioComponents) ((Maybe [Text] -> f (Maybe [Text]))
 -> ListStudioComponents -> f ListStudioComponents)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> ListStudioComponents
-> f ListStudioComponents
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 token for the next set of results, or null if there are no more
-- results.
listStudioComponents_nextToken :: Lens.Lens' ListStudioComponents (Prelude.Maybe Prelude.Text)
listStudioComponents_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListStudioComponents -> f ListStudioComponents
listStudioComponents_nextToken = (ListStudioComponents -> Maybe Text)
-> (ListStudioComponents -> Maybe Text -> ListStudioComponents)
-> Lens
     ListStudioComponents ListStudioComponents (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListStudioComponents' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListStudioComponents' :: ListStudioComponents -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListStudioComponents
s@ListStudioComponents' {} Maybe Text
a -> ListStudioComponents
s {$sel:nextToken:ListStudioComponents' :: Maybe Text
nextToken = Maybe Text
a} :: ListStudioComponents)

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

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

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

instance Prelude.NFData ListStudioComponents

instance Core.ToHeaders ListStudioComponents where
  toHeaders :: ListStudioComponents -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListStudioComponents -> 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 ListStudioComponents where
  toPath :: ListStudioComponents -> ByteString
toPath ListStudioComponents' {Maybe Natural
Maybe [Text]
Maybe Text
Text
studioId :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
types :: Maybe [Text]
states :: Maybe [Text]
$sel:studioId:ListStudioComponents' :: ListStudioComponents -> Text
$sel:maxResults:ListStudioComponents' :: ListStudioComponents -> Maybe Natural
$sel:nextToken:ListStudioComponents' :: ListStudioComponents -> Maybe Text
$sel:types:ListStudioComponents' :: ListStudioComponents -> Maybe [Text]
$sel:states:ListStudioComponents' :: ListStudioComponents -> 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
"/studio-components"
      ]

instance Core.ToQuery ListStudioComponents where
  toQuery :: ListStudioComponents -> QueryString
toQuery ListStudioComponents' {Maybe Natural
Maybe [Text]
Maybe Text
Text
studioId :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
types :: Maybe [Text]
states :: Maybe [Text]
$sel:studioId:ListStudioComponents' :: ListStudioComponents -> Text
$sel:maxResults:ListStudioComponents' :: ListStudioComponents -> Maybe Natural
$sel:nextToken:ListStudioComponents' :: ListStudioComponents -> Maybe Text
$sel:types:ListStudioComponents' :: ListStudioComponents -> Maybe [Text]
$sel:states:ListStudioComponents' :: ListStudioComponents -> 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
"types"
          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]
types),
        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:/ 'newListStudioComponentsResponse' smart constructor.
data ListStudioComponentsResponse = ListStudioComponentsResponse'
  { -- | A collection of studio components.
    ListStudioComponentsResponse -> Maybe [StudioComponent]
studioComponents :: Prelude.Maybe [StudioComponent],
    -- | The token for the next set of results, or null if there are no more
    -- results.
    ListStudioComponentsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListStudioComponentsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListStudioComponentsResponse
-> ListStudioComponentsResponse -> Bool
(ListStudioComponentsResponse
 -> ListStudioComponentsResponse -> Bool)
-> (ListStudioComponentsResponse
    -> ListStudioComponentsResponse -> Bool)
-> Eq ListStudioComponentsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListStudioComponentsResponse
-> ListStudioComponentsResponse -> Bool
$c/= :: ListStudioComponentsResponse
-> ListStudioComponentsResponse -> Bool
== :: ListStudioComponentsResponse
-> ListStudioComponentsResponse -> Bool
$c== :: ListStudioComponentsResponse
-> ListStudioComponentsResponse -> Bool
Prelude.Eq, ReadPrec [ListStudioComponentsResponse]
ReadPrec ListStudioComponentsResponse
Int -> ReadS ListStudioComponentsResponse
ReadS [ListStudioComponentsResponse]
(Int -> ReadS ListStudioComponentsResponse)
-> ReadS [ListStudioComponentsResponse]
-> ReadPrec ListStudioComponentsResponse
-> ReadPrec [ListStudioComponentsResponse]
-> Read ListStudioComponentsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListStudioComponentsResponse]
$creadListPrec :: ReadPrec [ListStudioComponentsResponse]
readPrec :: ReadPrec ListStudioComponentsResponse
$creadPrec :: ReadPrec ListStudioComponentsResponse
readList :: ReadS [ListStudioComponentsResponse]
$creadList :: ReadS [ListStudioComponentsResponse]
readsPrec :: Int -> ReadS ListStudioComponentsResponse
$creadsPrec :: Int -> ReadS ListStudioComponentsResponse
Prelude.Read, Int -> ListStudioComponentsResponse -> ShowS
[ListStudioComponentsResponse] -> ShowS
ListStudioComponentsResponse -> String
(Int -> ListStudioComponentsResponse -> ShowS)
-> (ListStudioComponentsResponse -> String)
-> ([ListStudioComponentsResponse] -> ShowS)
-> Show ListStudioComponentsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListStudioComponentsResponse] -> ShowS
$cshowList :: [ListStudioComponentsResponse] -> ShowS
show :: ListStudioComponentsResponse -> String
$cshow :: ListStudioComponentsResponse -> String
showsPrec :: Int -> ListStudioComponentsResponse -> ShowS
$cshowsPrec :: Int -> ListStudioComponentsResponse -> ShowS
Prelude.Show, (forall x.
 ListStudioComponentsResponse -> Rep ListStudioComponentsResponse x)
-> (forall x.
    Rep ListStudioComponentsResponse x -> ListStudioComponentsResponse)
-> Generic ListStudioComponentsResponse
forall x.
Rep ListStudioComponentsResponse x -> ListStudioComponentsResponse
forall x.
ListStudioComponentsResponse -> Rep ListStudioComponentsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListStudioComponentsResponse x -> ListStudioComponentsResponse
$cfrom :: forall x.
ListStudioComponentsResponse -> Rep ListStudioComponentsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListStudioComponentsResponse' 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:
--
-- 'studioComponents', 'listStudioComponentsResponse_studioComponents' - A collection of studio components.
--
-- 'nextToken', 'listStudioComponentsResponse_nextToken' - The token for the next set of results, or null if there are no more
-- results.
--
-- 'httpStatus', 'listStudioComponentsResponse_httpStatus' - The response's http status code.
newListStudioComponentsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListStudioComponentsResponse
newListStudioComponentsResponse :: Int -> ListStudioComponentsResponse
newListStudioComponentsResponse Int
pHttpStatus_ =
  ListStudioComponentsResponse' :: Maybe [StudioComponent]
-> Maybe Text -> Int -> ListStudioComponentsResponse
ListStudioComponentsResponse'
    { $sel:studioComponents:ListStudioComponentsResponse' :: Maybe [StudioComponent]
studioComponents =
        Maybe [StudioComponent]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListStudioComponentsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListStudioComponentsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A collection of studio components.
listStudioComponentsResponse_studioComponents :: Lens.Lens' ListStudioComponentsResponse (Prelude.Maybe [StudioComponent])
listStudioComponentsResponse_studioComponents :: (Maybe [StudioComponent] -> f (Maybe [StudioComponent]))
-> ListStudioComponentsResponse -> f ListStudioComponentsResponse
listStudioComponentsResponse_studioComponents = (ListStudioComponentsResponse -> Maybe [StudioComponent])
-> (ListStudioComponentsResponse
    -> Maybe [StudioComponent] -> ListStudioComponentsResponse)
-> Lens' ListStudioComponentsResponse (Maybe [StudioComponent])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListStudioComponentsResponse' {Maybe [StudioComponent]
studioComponents :: Maybe [StudioComponent]
$sel:studioComponents:ListStudioComponentsResponse' :: ListStudioComponentsResponse -> Maybe [StudioComponent]
studioComponents} -> Maybe [StudioComponent]
studioComponents) (\s :: ListStudioComponentsResponse
s@ListStudioComponentsResponse' {} Maybe [StudioComponent]
a -> ListStudioComponentsResponse
s {$sel:studioComponents:ListStudioComponentsResponse' :: Maybe [StudioComponent]
studioComponents = Maybe [StudioComponent]
a} :: ListStudioComponentsResponse) ((Maybe [StudioComponent] -> f (Maybe [StudioComponent]))
 -> ListStudioComponentsResponse -> f ListStudioComponentsResponse)
-> ((Maybe [StudioComponent] -> f (Maybe [StudioComponent]))
    -> Maybe [StudioComponent] -> f (Maybe [StudioComponent]))
-> (Maybe [StudioComponent] -> f (Maybe [StudioComponent]))
-> ListStudioComponentsResponse
-> f ListStudioComponentsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [StudioComponent]
  [StudioComponent]
  [StudioComponent]
  [StudioComponent]
-> Iso
     (Maybe [StudioComponent])
     (Maybe [StudioComponent])
     (Maybe [StudioComponent])
     (Maybe [StudioComponent])
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
  [StudioComponent]
  [StudioComponent]
  [StudioComponent]
  [StudioComponent]
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.
listStudioComponentsResponse_nextToken :: Lens.Lens' ListStudioComponentsResponse (Prelude.Maybe Prelude.Text)
listStudioComponentsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListStudioComponentsResponse -> f ListStudioComponentsResponse
listStudioComponentsResponse_nextToken = (ListStudioComponentsResponse -> Maybe Text)
-> (ListStudioComponentsResponse
    -> Maybe Text -> ListStudioComponentsResponse)
-> Lens' ListStudioComponentsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListStudioComponentsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListStudioComponentsResponse' :: ListStudioComponentsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListStudioComponentsResponse
s@ListStudioComponentsResponse' {} Maybe Text
a -> ListStudioComponentsResponse
s {$sel:nextToken:ListStudioComponentsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListStudioComponentsResponse)

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

instance Prelude.NFData ListStudioComponentsResponse