{-# 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.ListStreamingSessions
-- 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 streaming image resources in a studio.
--
-- This operation returns paginated results.
module Amazonka.Nimble.ListStreamingSessions
  ( -- * Creating a Request
    ListStreamingSessions (..),
    newListStreamingSessions,

    -- * Request Lenses
    listStreamingSessions_ownedBy,
    listStreamingSessions_createdBy,
    listStreamingSessions_nextToken,
    listStreamingSessions_sessionIds,
    listStreamingSessions_studioId,

    -- * Destructuring the Response
    ListStreamingSessionsResponse (..),
    newListStreamingSessionsResponse,

    -- * Response Lenses
    listStreamingSessionsResponse_nextToken,
    listStreamingSessionsResponse_sessions,
    listStreamingSessionsResponse_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:/ 'newListStreamingSessions' smart constructor.
data ListStreamingSessions = ListStreamingSessions'
  { -- | The user ID of the user that owns the streaming session.
    ListStreamingSessions -> Maybe Text
ownedBy :: Prelude.Maybe Prelude.Text,
    -- | The user ID of the user that created the streaming session.
    ListStreamingSessions -> Maybe Text
createdBy :: Prelude.Maybe Prelude.Text,
    -- | The token for the next set of results, or null if there are no more
    -- results.
    ListStreamingSessions -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | A collection of session IDs.
    ListStreamingSessions -> Maybe Text
sessionIds :: Prelude.Maybe Prelude.Text,
    -- | The studio ID.
    ListStreamingSessions -> Text
studioId :: Prelude.Text
  }
  deriving (ListStreamingSessions -> ListStreamingSessions -> Bool
(ListStreamingSessions -> ListStreamingSessions -> Bool)
-> (ListStreamingSessions -> ListStreamingSessions -> Bool)
-> Eq ListStreamingSessions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListStreamingSessions -> ListStreamingSessions -> Bool
$c/= :: ListStreamingSessions -> ListStreamingSessions -> Bool
== :: ListStreamingSessions -> ListStreamingSessions -> Bool
$c== :: ListStreamingSessions -> ListStreamingSessions -> Bool
Prelude.Eq, ReadPrec [ListStreamingSessions]
ReadPrec ListStreamingSessions
Int -> ReadS ListStreamingSessions
ReadS [ListStreamingSessions]
(Int -> ReadS ListStreamingSessions)
-> ReadS [ListStreamingSessions]
-> ReadPrec ListStreamingSessions
-> ReadPrec [ListStreamingSessions]
-> Read ListStreamingSessions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListStreamingSessions]
$creadListPrec :: ReadPrec [ListStreamingSessions]
readPrec :: ReadPrec ListStreamingSessions
$creadPrec :: ReadPrec ListStreamingSessions
readList :: ReadS [ListStreamingSessions]
$creadList :: ReadS [ListStreamingSessions]
readsPrec :: Int -> ReadS ListStreamingSessions
$creadsPrec :: Int -> ReadS ListStreamingSessions
Prelude.Read, Int -> ListStreamingSessions -> ShowS
[ListStreamingSessions] -> ShowS
ListStreamingSessions -> String
(Int -> ListStreamingSessions -> ShowS)
-> (ListStreamingSessions -> String)
-> ([ListStreamingSessions] -> ShowS)
-> Show ListStreamingSessions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListStreamingSessions] -> ShowS
$cshowList :: [ListStreamingSessions] -> ShowS
show :: ListStreamingSessions -> String
$cshow :: ListStreamingSessions -> String
showsPrec :: Int -> ListStreamingSessions -> ShowS
$cshowsPrec :: Int -> ListStreamingSessions -> ShowS
Prelude.Show, (forall x. ListStreamingSessions -> Rep ListStreamingSessions x)
-> (forall x. Rep ListStreamingSessions x -> ListStreamingSessions)
-> Generic ListStreamingSessions
forall x. Rep ListStreamingSessions x -> ListStreamingSessions
forall x. ListStreamingSessions -> Rep ListStreamingSessions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListStreamingSessions x -> ListStreamingSessions
$cfrom :: forall x. ListStreamingSessions -> Rep ListStreamingSessions x
Prelude.Generic)

-- |
-- Create a value of 'ListStreamingSessions' 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:
--
-- 'ownedBy', 'listStreamingSessions_ownedBy' - The user ID of the user that owns the streaming session.
--
-- 'createdBy', 'listStreamingSessions_createdBy' - The user ID of the user that created the streaming session.
--
-- 'nextToken', 'listStreamingSessions_nextToken' - The token for the next set of results, or null if there are no more
-- results.
--
-- 'sessionIds', 'listStreamingSessions_sessionIds' - A collection of session IDs.
--
-- 'studioId', 'listStreamingSessions_studioId' - The studio ID.
newListStreamingSessions ::
  -- | 'studioId'
  Prelude.Text ->
  ListStreamingSessions
newListStreamingSessions :: Text -> ListStreamingSessions
newListStreamingSessions Text
pStudioId_ =
  ListStreamingSessions' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Text
-> ListStreamingSessions
ListStreamingSessions'
    { $sel:ownedBy:ListStreamingSessions' :: Maybe Text
ownedBy = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:createdBy:ListStreamingSessions' :: Maybe Text
createdBy = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListStreamingSessions' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:sessionIds:ListStreamingSessions' :: Maybe Text
sessionIds = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:studioId:ListStreamingSessions' :: Text
studioId = Text
pStudioId_
    }

-- | The user ID of the user that owns the streaming session.
listStreamingSessions_ownedBy :: Lens.Lens' ListStreamingSessions (Prelude.Maybe Prelude.Text)
listStreamingSessions_ownedBy :: (Maybe Text -> f (Maybe Text))
-> ListStreamingSessions -> f ListStreamingSessions
listStreamingSessions_ownedBy = (ListStreamingSessions -> Maybe Text)
-> (ListStreamingSessions -> Maybe Text -> ListStreamingSessions)
-> Lens
     ListStreamingSessions
     ListStreamingSessions
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListStreamingSessions' {Maybe Text
ownedBy :: Maybe Text
$sel:ownedBy:ListStreamingSessions' :: ListStreamingSessions -> Maybe Text
ownedBy} -> Maybe Text
ownedBy) (\s :: ListStreamingSessions
s@ListStreamingSessions' {} Maybe Text
a -> ListStreamingSessions
s {$sel:ownedBy:ListStreamingSessions' :: Maybe Text
ownedBy = Maybe Text
a} :: ListStreamingSessions)

-- | The user ID of the user that created the streaming session.
listStreamingSessions_createdBy :: Lens.Lens' ListStreamingSessions (Prelude.Maybe Prelude.Text)
listStreamingSessions_createdBy :: (Maybe Text -> f (Maybe Text))
-> ListStreamingSessions -> f ListStreamingSessions
listStreamingSessions_createdBy = (ListStreamingSessions -> Maybe Text)
-> (ListStreamingSessions -> Maybe Text -> ListStreamingSessions)
-> Lens
     ListStreamingSessions
     ListStreamingSessions
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListStreamingSessions' {Maybe Text
createdBy :: Maybe Text
$sel:createdBy:ListStreamingSessions' :: ListStreamingSessions -> Maybe Text
createdBy} -> Maybe Text
createdBy) (\s :: ListStreamingSessions
s@ListStreamingSessions' {} Maybe Text
a -> ListStreamingSessions
s {$sel:createdBy:ListStreamingSessions' :: Maybe Text
createdBy = Maybe Text
a} :: ListStreamingSessions)

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

-- | A collection of session IDs.
listStreamingSessions_sessionIds :: Lens.Lens' ListStreamingSessions (Prelude.Maybe Prelude.Text)
listStreamingSessions_sessionIds :: (Maybe Text -> f (Maybe Text))
-> ListStreamingSessions -> f ListStreamingSessions
listStreamingSessions_sessionIds = (ListStreamingSessions -> Maybe Text)
-> (ListStreamingSessions -> Maybe Text -> ListStreamingSessions)
-> Lens
     ListStreamingSessions
     ListStreamingSessions
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListStreamingSessions' {Maybe Text
sessionIds :: Maybe Text
$sel:sessionIds:ListStreamingSessions' :: ListStreamingSessions -> Maybe Text
sessionIds} -> Maybe Text
sessionIds) (\s :: ListStreamingSessions
s@ListStreamingSessions' {} Maybe Text
a -> ListStreamingSessions
s {$sel:sessionIds:ListStreamingSessions' :: Maybe Text
sessionIds = Maybe Text
a} :: ListStreamingSessions)

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

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

instance Prelude.NFData ListStreamingSessions

instance Core.ToHeaders ListStreamingSessions where
  toHeaders :: ListStreamingSessions -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListStreamingSessions -> 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 ListStreamingSessions where
  toPath :: ListStreamingSessions -> ByteString
toPath ListStreamingSessions' {Maybe Text
Text
studioId :: Text
sessionIds :: Maybe Text
nextToken :: Maybe Text
createdBy :: Maybe Text
ownedBy :: Maybe Text
$sel:studioId:ListStreamingSessions' :: ListStreamingSessions -> Text
$sel:sessionIds:ListStreamingSessions' :: ListStreamingSessions -> Maybe Text
$sel:nextToken:ListStreamingSessions' :: ListStreamingSessions -> Maybe Text
$sel:createdBy:ListStreamingSessions' :: ListStreamingSessions -> Maybe Text
$sel:ownedBy:ListStreamingSessions' :: ListStreamingSessions -> 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
"/streaming-sessions"
      ]

instance Core.ToQuery ListStreamingSessions where
  toQuery :: ListStreamingSessions -> QueryString
toQuery ListStreamingSessions' {Maybe Text
Text
studioId :: Text
sessionIds :: Maybe Text
nextToken :: Maybe Text
createdBy :: Maybe Text
ownedBy :: Maybe Text
$sel:studioId:ListStreamingSessions' :: ListStreamingSessions -> Text
$sel:sessionIds:ListStreamingSessions' :: ListStreamingSessions -> Maybe Text
$sel:nextToken:ListStreamingSessions' :: ListStreamingSessions -> Maybe Text
$sel:createdBy:ListStreamingSessions' :: ListStreamingSessions -> Maybe Text
$sel:ownedBy:ListStreamingSessions' :: ListStreamingSessions -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"ownedBy" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
ownedBy,
        ByteString
"createdBy" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
createdBy,
        ByteString
"nextToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
nextToken,
        ByteString
"sessionIds" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
sessionIds
      ]

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

-- |
-- Create a value of 'ListStreamingSessionsResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'nextToken', 'listStreamingSessionsResponse_nextToken' - The token for the next set of results, or null if there are no more
-- results.
--
-- 'sessions', 'listStreamingSessionsResponse_sessions' - A collection of streaming sessions.
--
-- 'httpStatus', 'listStreamingSessionsResponse_httpStatus' - The response's http status code.
newListStreamingSessionsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListStreamingSessionsResponse
newListStreamingSessionsResponse :: Int -> ListStreamingSessionsResponse
newListStreamingSessionsResponse Int
pHttpStatus_ =
  ListStreamingSessionsResponse' :: Maybe Text
-> Maybe [StreamingSession] -> Int -> ListStreamingSessionsResponse
ListStreamingSessionsResponse'
    { $sel:nextToken:ListStreamingSessionsResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:sessions:ListStreamingSessionsResponse' :: Maybe [StreamingSession]
sessions = Maybe [StreamingSession]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListStreamingSessionsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

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

-- | A collection of streaming sessions.
listStreamingSessionsResponse_sessions :: Lens.Lens' ListStreamingSessionsResponse (Prelude.Maybe [StreamingSession])
listStreamingSessionsResponse_sessions :: (Maybe [StreamingSession] -> f (Maybe [StreamingSession]))
-> ListStreamingSessionsResponse -> f ListStreamingSessionsResponse
listStreamingSessionsResponse_sessions = (ListStreamingSessionsResponse -> Maybe [StreamingSession])
-> (ListStreamingSessionsResponse
    -> Maybe [StreamingSession] -> ListStreamingSessionsResponse)
-> Lens' ListStreamingSessionsResponse (Maybe [StreamingSession])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListStreamingSessionsResponse' {Maybe [StreamingSession]
sessions :: Maybe [StreamingSession]
$sel:sessions:ListStreamingSessionsResponse' :: ListStreamingSessionsResponse -> Maybe [StreamingSession]
sessions} -> Maybe [StreamingSession]
sessions) (\s :: ListStreamingSessionsResponse
s@ListStreamingSessionsResponse' {} Maybe [StreamingSession]
a -> ListStreamingSessionsResponse
s {$sel:sessions:ListStreamingSessionsResponse' :: Maybe [StreamingSession]
sessions = Maybe [StreamingSession]
a} :: ListStreamingSessionsResponse) ((Maybe [StreamingSession] -> f (Maybe [StreamingSession]))
 -> ListStreamingSessionsResponse
 -> f ListStreamingSessionsResponse)
-> ((Maybe [StreamingSession] -> f (Maybe [StreamingSession]))
    -> Maybe [StreamingSession] -> f (Maybe [StreamingSession]))
-> (Maybe [StreamingSession] -> f (Maybe [StreamingSession]))
-> ListStreamingSessionsResponse
-> f ListStreamingSessionsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [StreamingSession]
  [StreamingSession]
  [StreamingSession]
  [StreamingSession]
-> Iso
     (Maybe [StreamingSession])
     (Maybe [StreamingSession])
     (Maybe [StreamingSession])
     (Maybe [StreamingSession])
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
  [StreamingSession]
  [StreamingSession]
  [StreamingSession]
  [StreamingSession]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData ListStreamingSessionsResponse