{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Lists the streaming sessions in a studio.
--
-- This operation returns paginated results.
module Amazonka.Nimble.ListStreamingSessions
  ( -- * Creating a Request
    ListStreamingSessions (..),
    newListStreamingSessions,

    -- * Request Lenses
    listStreamingSessions_createdBy,
    listStreamingSessions_nextToken,
    listStreamingSessions_ownedBy,
    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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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'
  { -- | Filters the request to streaming sessions created by the given user.
    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,
    -- | Filters the request to streaming session owned by the given user
    ListStreamingSessions -> Maybe Text
ownedBy :: Prelude.Maybe Prelude.Text,
    -- | Filters the request to only the provided session IDs.
    ListStreamingSessions -> Maybe Text
sessionIds :: Prelude.Maybe Prelude.Text,
    -- | The studio ID.
    ListStreamingSessions -> Text
studioId :: Prelude.Text
  }
  deriving (ListStreamingSessions -> ListStreamingSessions -> Bool
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]
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
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. 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:
--
-- 'createdBy', 'listStreamingSessions_createdBy' - Filters the request to streaming sessions created by the given user.
--
-- 'nextToken', 'listStreamingSessions_nextToken' - The token for the next set of results, or null if there are no more
-- results.
--
-- 'ownedBy', 'listStreamingSessions_ownedBy' - Filters the request to streaming session owned by the given user
--
-- 'sessionIds', 'listStreamingSessions_sessionIds' - Filters the request to only the provided session IDs.
--
-- 'studioId', 'listStreamingSessions_studioId' - The studio ID.
newListStreamingSessions ::
  -- | 'studioId'
  Prelude.Text ->
  ListStreamingSessions
newListStreamingSessions :: Text -> ListStreamingSessions
newListStreamingSessions Text
pStudioId_ =
  ListStreamingSessions'
    { $sel:createdBy:ListStreamingSessions' :: Maybe Text
createdBy = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListStreamingSessions' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:ownedBy:ListStreamingSessions' :: Maybe Text
ownedBy = forall a. Maybe a
Prelude.Nothing,
      $sel:sessionIds:ListStreamingSessions' :: Maybe Text
sessionIds = forall a. Maybe a
Prelude.Nothing,
      $sel:studioId:ListStreamingSessions' :: Text
studioId = Text
pStudioId_
    }

-- | Filters the request to streaming sessions created by the given user.
listStreamingSessions_createdBy :: Lens.Lens' ListStreamingSessions (Prelude.Maybe Prelude.Text)
listStreamingSessions_createdBy :: Lens' ListStreamingSessions (Maybe Text)
listStreamingSessions_createdBy = 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 :: Lens' ListStreamingSessions (Maybe Text)
listStreamingSessions_nextToken = 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)

-- | Filters the request to streaming session owned by the given user
listStreamingSessions_ownedBy :: Lens.Lens' ListStreamingSessions (Prelude.Maybe Prelude.Text)
listStreamingSessions_ownedBy :: Lens' ListStreamingSessions (Maybe Text)
listStreamingSessions_ownedBy = 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)

-- | Filters the request to only the provided session IDs.
listStreamingSessions_sessionIds :: Lens.Lens' ListStreamingSessions (Prelude.Maybe Prelude.Text)
listStreamingSessions_sessionIds :: Lens' ListStreamingSessions (Maybe Text)
listStreamingSessions_sessionIds = 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 :: Lens' ListStreamingSessions Text
listStreamingSessions_studioId = 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
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListStreamingSessions
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListStreamingSessionsResponse (Maybe Text)
listStreamingSessionsResponse_nextToken
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListStreamingSessions
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListStreamingSessionsResponse (Maybe [StreamingSession])
listStreamingSessionsResponse_sessions
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
        forall a. a -> Maybe a
Prelude.Just
          forall a b. (a -> b) -> a -> b
Prelude.$ ListStreamingSessions
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListStreamingSessions (Maybe Text)
listStreamingSessions_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListStreamingSessions
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListStreamingSessionsResponse (Maybe Text)
listStreamingSessionsResponse_nextToken
          forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest ListStreamingSessions where
  type
    AWSResponse ListStreamingSessions =
      ListStreamingSessionsResponse
  request :: (Service -> Service)
-> ListStreamingSessions -> Request ListStreamingSessions
request Service -> Service
overrides =
    forall a. ToRequest a => Service -> a -> Request a
Request.get (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListStreamingSessions
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListStreamingSessions)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> 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'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"nextToken")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"sessions" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable ListStreamingSessions where
  hashWithSalt :: Int -> ListStreamingSessions -> Int
hashWithSalt Int
_salt ListStreamingSessions' {Maybe Text
Text
studioId :: Text
sessionIds :: Maybe Text
ownedBy :: Maybe Text
nextToken :: Maybe Text
createdBy :: Maybe Text
$sel:studioId:ListStreamingSessions' :: ListStreamingSessions -> Text
$sel:sessionIds:ListStreamingSessions' :: ListStreamingSessions -> Maybe Text
$sel:ownedBy:ListStreamingSessions' :: ListStreamingSessions -> Maybe Text
$sel:nextToken:ListStreamingSessions' :: ListStreamingSessions -> Maybe Text
$sel:createdBy:ListStreamingSessions' :: ListStreamingSessions -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
createdBy
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
ownedBy
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
sessionIds
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
studioId

instance Prelude.NFData ListStreamingSessions where
  rnf :: ListStreamingSessions -> ()
rnf ListStreamingSessions' {Maybe Text
Text
studioId :: Text
sessionIds :: Maybe Text
ownedBy :: Maybe Text
nextToken :: Maybe Text
createdBy :: Maybe Text
$sel:studioId:ListStreamingSessions' :: ListStreamingSessions -> Text
$sel:sessionIds:ListStreamingSessions' :: ListStreamingSessions -> Maybe Text
$sel:ownedBy:ListStreamingSessions' :: ListStreamingSessions -> Maybe Text
$sel:nextToken:ListStreamingSessions' :: ListStreamingSessions -> Maybe Text
$sel:createdBy:ListStreamingSessions' :: ListStreamingSessions -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
createdBy
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
ownedBy
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
sessionIds
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
studioId

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

instance Data.ToPath ListStreamingSessions where
  toPath :: ListStreamingSessions -> ByteString
toPath ListStreamingSessions' {Maybe Text
Text
studioId :: Text
sessionIds :: Maybe Text
ownedBy :: Maybe Text
nextToken :: Maybe Text
createdBy :: Maybe Text
$sel:studioId:ListStreamingSessions' :: ListStreamingSessions -> Text
$sel:sessionIds:ListStreamingSessions' :: ListStreamingSessions -> Maybe Text
$sel:ownedBy:ListStreamingSessions' :: ListStreamingSessions -> Maybe Text
$sel:nextToken:ListStreamingSessions' :: ListStreamingSessions -> Maybe Text
$sel:createdBy:ListStreamingSessions' :: ListStreamingSessions -> Maybe Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/2020-08-01/studios/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
studioId,
        ByteString
"/streaming-sessions"
      ]

instance Data.ToQuery ListStreamingSessions where
  toQuery :: ListStreamingSessions -> QueryString
toQuery ListStreamingSessions' {Maybe Text
Text
studioId :: Text
sessionIds :: Maybe Text
ownedBy :: Maybe Text
nextToken :: Maybe Text
createdBy :: Maybe Text
$sel:studioId:ListStreamingSessions' :: ListStreamingSessions -> Text
$sel:sessionIds:ListStreamingSessions' :: ListStreamingSessions -> Maybe Text
$sel:ownedBy:ListStreamingSessions' :: ListStreamingSessions -> Maybe Text
$sel:nextToken:ListStreamingSessions' :: ListStreamingSessions -> Maybe Text
$sel:createdBy:ListStreamingSessions' :: ListStreamingSessions -> Maybe Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"createdBy" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
createdBy,
        ByteString
"nextToken" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
nextToken,
        ByteString
"ownedBy" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
ownedBy,
        ByteString
"sessionIds" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: 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
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]
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
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.
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'
    { $sel:nextToken:ListStreamingSessionsResponse' :: Maybe Text
nextToken =
        forall a. Maybe a
Prelude.Nothing,
      $sel:sessions:ListStreamingSessionsResponse' :: Maybe [StreamingSession]
sessions = 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 :: Lens' ListStreamingSessionsResponse (Maybe Text)
listStreamingSessionsResponse_nextToken = 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 :: Lens' ListStreamingSessionsResponse (Maybe [StreamingSession])
listStreamingSessionsResponse_sessions = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 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 :: Lens' ListStreamingSessionsResponse Int
listStreamingSessionsResponse_httpStatus = 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 where
  rnf :: ListStreamingSessionsResponse -> ()
rnf ListStreamingSessionsResponse' {Int
Maybe [StreamingSession]
Maybe Text
httpStatus :: Int
sessions :: Maybe [StreamingSession]
nextToken :: Maybe Text
$sel:httpStatus:ListStreamingSessionsResponse' :: ListStreamingSessionsResponse -> Int
$sel:sessions:ListStreamingSessionsResponse' :: ListStreamingSessionsResponse -> Maybe [StreamingSession]
$sel:nextToken:ListStreamingSessionsResponse' :: ListStreamingSessionsResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [StreamingSession]
sessions
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus