{-# 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.KinesisVideo.ListStreams
-- 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)
--
-- Returns an array of @StreamInfo@ objects. Each object describes a
-- stream. To retrieve only streams that satisfy a specific condition, you
-- can specify a @StreamNameCondition@.
--
-- This operation returns paginated results.
module Amazonka.KinesisVideo.ListStreams
  ( -- * Creating a Request
    ListStreams (..),
    newListStreams,

    -- * Request Lenses
    listStreams_nextToken,
    listStreams_streamNameCondition,
    listStreams_maxResults,

    -- * Destructuring the Response
    ListStreamsResponse (..),
    newListStreamsResponse,

    -- * Response Lenses
    listStreamsResponse_streamInfoList,
    listStreamsResponse_nextToken,
    listStreamsResponse_httpStatus,
  )
where

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

-- | /See:/ 'newListStreams' smart constructor.
data ListStreams = ListStreams'
  { -- | If you specify this parameter, when the result of a @ListStreams@
    -- operation is truncated, the call returns the @NextToken@ in the
    -- response. To get another batch of streams, provide this token in your
    -- next request.
    ListStreams -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Optional: Returns only streams that satisfy a specific condition.
    -- Currently, you can specify only the prefix of a stream name as a
    -- condition.
    ListStreams -> Maybe StreamNameCondition
streamNameCondition :: Prelude.Maybe StreamNameCondition,
    -- | The maximum number of streams to return in the response. The default is
    -- 10,000.
    ListStreams -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
  }
  deriving (ListStreams -> ListStreams -> Bool
(ListStreams -> ListStreams -> Bool)
-> (ListStreams -> ListStreams -> Bool) -> Eq ListStreams
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListStreams -> ListStreams -> Bool
$c/= :: ListStreams -> ListStreams -> Bool
== :: ListStreams -> ListStreams -> Bool
$c== :: ListStreams -> ListStreams -> Bool
Prelude.Eq, ReadPrec [ListStreams]
ReadPrec ListStreams
Int -> ReadS ListStreams
ReadS [ListStreams]
(Int -> ReadS ListStreams)
-> ReadS [ListStreams]
-> ReadPrec ListStreams
-> ReadPrec [ListStreams]
-> Read ListStreams
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListStreams]
$creadListPrec :: ReadPrec [ListStreams]
readPrec :: ReadPrec ListStreams
$creadPrec :: ReadPrec ListStreams
readList :: ReadS [ListStreams]
$creadList :: ReadS [ListStreams]
readsPrec :: Int -> ReadS ListStreams
$creadsPrec :: Int -> ReadS ListStreams
Prelude.Read, Int -> ListStreams -> ShowS
[ListStreams] -> ShowS
ListStreams -> String
(Int -> ListStreams -> ShowS)
-> (ListStreams -> String)
-> ([ListStreams] -> ShowS)
-> Show ListStreams
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListStreams] -> ShowS
$cshowList :: [ListStreams] -> ShowS
show :: ListStreams -> String
$cshow :: ListStreams -> String
showsPrec :: Int -> ListStreams -> ShowS
$cshowsPrec :: Int -> ListStreams -> ShowS
Prelude.Show, (forall x. ListStreams -> Rep ListStreams x)
-> (forall x. Rep ListStreams x -> ListStreams)
-> Generic ListStreams
forall x. Rep ListStreams x -> ListStreams
forall x. ListStreams -> Rep ListStreams x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListStreams x -> ListStreams
$cfrom :: forall x. ListStreams -> Rep ListStreams x
Prelude.Generic)

-- |
-- Create a value of 'ListStreams' 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', 'listStreams_nextToken' - If you specify this parameter, when the result of a @ListStreams@
-- operation is truncated, the call returns the @NextToken@ in the
-- response. To get another batch of streams, provide this token in your
-- next request.
--
-- 'streamNameCondition', 'listStreams_streamNameCondition' - Optional: Returns only streams that satisfy a specific condition.
-- Currently, you can specify only the prefix of a stream name as a
-- condition.
--
-- 'maxResults', 'listStreams_maxResults' - The maximum number of streams to return in the response. The default is
-- 10,000.
newListStreams ::
  ListStreams
newListStreams :: ListStreams
newListStreams =
  ListStreams' :: Maybe Text
-> Maybe StreamNameCondition -> Maybe Natural -> ListStreams
ListStreams'
    { $sel:nextToken:ListStreams' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:streamNameCondition:ListStreams' :: Maybe StreamNameCondition
streamNameCondition = Maybe StreamNameCondition
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListStreams' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | If you specify this parameter, when the result of a @ListStreams@
-- operation is truncated, the call returns the @NextToken@ in the
-- response. To get another batch of streams, provide this token in your
-- next request.
listStreams_nextToken :: Lens.Lens' ListStreams (Prelude.Maybe Prelude.Text)
listStreams_nextToken :: (Maybe Text -> f (Maybe Text)) -> ListStreams -> f ListStreams
listStreams_nextToken = (ListStreams -> Maybe Text)
-> (ListStreams -> Maybe Text -> ListStreams)
-> Lens ListStreams ListStreams (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListStreams' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListStreams' :: ListStreams -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListStreams
s@ListStreams' {} Maybe Text
a -> ListStreams
s {$sel:nextToken:ListStreams' :: Maybe Text
nextToken = Maybe Text
a} :: ListStreams)

-- | Optional: Returns only streams that satisfy a specific condition.
-- Currently, you can specify only the prefix of a stream name as a
-- condition.
listStreams_streamNameCondition :: Lens.Lens' ListStreams (Prelude.Maybe StreamNameCondition)
listStreams_streamNameCondition :: (Maybe StreamNameCondition -> f (Maybe StreamNameCondition))
-> ListStreams -> f ListStreams
listStreams_streamNameCondition = (ListStreams -> Maybe StreamNameCondition)
-> (ListStreams -> Maybe StreamNameCondition -> ListStreams)
-> Lens
     ListStreams
     ListStreams
     (Maybe StreamNameCondition)
     (Maybe StreamNameCondition)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListStreams' {Maybe StreamNameCondition
streamNameCondition :: Maybe StreamNameCondition
$sel:streamNameCondition:ListStreams' :: ListStreams -> Maybe StreamNameCondition
streamNameCondition} -> Maybe StreamNameCondition
streamNameCondition) (\s :: ListStreams
s@ListStreams' {} Maybe StreamNameCondition
a -> ListStreams
s {$sel:streamNameCondition:ListStreams' :: Maybe StreamNameCondition
streamNameCondition = Maybe StreamNameCondition
a} :: ListStreams)

-- | The maximum number of streams to return in the response. The default is
-- 10,000.
listStreams_maxResults :: Lens.Lens' ListStreams (Prelude.Maybe Prelude.Natural)
listStreams_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListStreams -> f ListStreams
listStreams_maxResults = (ListStreams -> Maybe Natural)
-> (ListStreams -> Maybe Natural -> ListStreams)
-> Lens ListStreams ListStreams (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListStreams' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListStreams' :: ListStreams -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListStreams
s@ListStreams' {} Maybe Natural
a -> ListStreams
s {$sel:maxResults:ListStreams' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListStreams)

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

instance Prelude.NFData ListStreams

instance Core.ToHeaders ListStreams where
  toHeaders :: ListStreams -> ResponseHeaders
toHeaders = ResponseHeaders -> ListStreams -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty

instance Core.ToJSON ListStreams where
  toJSON :: ListStreams -> Value
toJSON ListStreams' {Maybe Natural
Maybe Text
Maybe StreamNameCondition
maxResults :: Maybe Natural
streamNameCondition :: Maybe StreamNameCondition
nextToken :: Maybe Text
$sel:maxResults:ListStreams' :: ListStreams -> Maybe Natural
$sel:streamNameCondition:ListStreams' :: ListStreams -> Maybe StreamNameCondition
$sel:nextToken:ListStreams' :: ListStreams -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"NextToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
            (Text
"StreamNameCondition" Text -> StreamNameCondition -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (StreamNameCondition -> Pair)
-> Maybe StreamNameCondition -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe StreamNameCondition
streamNameCondition,
            (Text
"MaxResults" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults
          ]
      )

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

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

-- | /See:/ 'newListStreamsResponse' smart constructor.
data ListStreamsResponse = ListStreamsResponse'
  { -- | An array of @StreamInfo@ objects.
    ListStreamsResponse -> Maybe [StreamInfo]
streamInfoList :: Prelude.Maybe [StreamInfo],
    -- | If the response is truncated, the call returns this element with a
    -- token. To get the next batch of streams, use this token in your next
    -- request.
    ListStreamsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListStreamsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListStreamsResponse -> ListStreamsResponse -> Bool
(ListStreamsResponse -> ListStreamsResponse -> Bool)
-> (ListStreamsResponse -> ListStreamsResponse -> Bool)
-> Eq ListStreamsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListStreamsResponse -> ListStreamsResponse -> Bool
$c/= :: ListStreamsResponse -> ListStreamsResponse -> Bool
== :: ListStreamsResponse -> ListStreamsResponse -> Bool
$c== :: ListStreamsResponse -> ListStreamsResponse -> Bool
Prelude.Eq, ReadPrec [ListStreamsResponse]
ReadPrec ListStreamsResponse
Int -> ReadS ListStreamsResponse
ReadS [ListStreamsResponse]
(Int -> ReadS ListStreamsResponse)
-> ReadS [ListStreamsResponse]
-> ReadPrec ListStreamsResponse
-> ReadPrec [ListStreamsResponse]
-> Read ListStreamsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListStreamsResponse]
$creadListPrec :: ReadPrec [ListStreamsResponse]
readPrec :: ReadPrec ListStreamsResponse
$creadPrec :: ReadPrec ListStreamsResponse
readList :: ReadS [ListStreamsResponse]
$creadList :: ReadS [ListStreamsResponse]
readsPrec :: Int -> ReadS ListStreamsResponse
$creadsPrec :: Int -> ReadS ListStreamsResponse
Prelude.Read, Int -> ListStreamsResponse -> ShowS
[ListStreamsResponse] -> ShowS
ListStreamsResponse -> String
(Int -> ListStreamsResponse -> ShowS)
-> (ListStreamsResponse -> String)
-> ([ListStreamsResponse] -> ShowS)
-> Show ListStreamsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListStreamsResponse] -> ShowS
$cshowList :: [ListStreamsResponse] -> ShowS
show :: ListStreamsResponse -> String
$cshow :: ListStreamsResponse -> String
showsPrec :: Int -> ListStreamsResponse -> ShowS
$cshowsPrec :: Int -> ListStreamsResponse -> ShowS
Prelude.Show, (forall x. ListStreamsResponse -> Rep ListStreamsResponse x)
-> (forall x. Rep ListStreamsResponse x -> ListStreamsResponse)
-> Generic ListStreamsResponse
forall x. Rep ListStreamsResponse x -> ListStreamsResponse
forall x. ListStreamsResponse -> Rep ListStreamsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListStreamsResponse x -> ListStreamsResponse
$cfrom :: forall x. ListStreamsResponse -> Rep ListStreamsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListStreamsResponse' 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:
--
-- 'streamInfoList', 'listStreamsResponse_streamInfoList' - An array of @StreamInfo@ objects.
--
-- 'nextToken', 'listStreamsResponse_nextToken' - If the response is truncated, the call returns this element with a
-- token. To get the next batch of streams, use this token in your next
-- request.
--
-- 'httpStatus', 'listStreamsResponse_httpStatus' - The response's http status code.
newListStreamsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListStreamsResponse
newListStreamsResponse :: Int -> ListStreamsResponse
newListStreamsResponse Int
pHttpStatus_ =
  ListStreamsResponse' :: Maybe [StreamInfo] -> Maybe Text -> Int -> ListStreamsResponse
ListStreamsResponse'
    { $sel:streamInfoList:ListStreamsResponse' :: Maybe [StreamInfo]
streamInfoList =
        Maybe [StreamInfo]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListStreamsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListStreamsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | An array of @StreamInfo@ objects.
listStreamsResponse_streamInfoList :: Lens.Lens' ListStreamsResponse (Prelude.Maybe [StreamInfo])
listStreamsResponse_streamInfoList :: (Maybe [StreamInfo] -> f (Maybe [StreamInfo]))
-> ListStreamsResponse -> f ListStreamsResponse
listStreamsResponse_streamInfoList = (ListStreamsResponse -> Maybe [StreamInfo])
-> (ListStreamsResponse
    -> Maybe [StreamInfo] -> ListStreamsResponse)
-> Lens' ListStreamsResponse (Maybe [StreamInfo])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListStreamsResponse' {Maybe [StreamInfo]
streamInfoList :: Maybe [StreamInfo]
$sel:streamInfoList:ListStreamsResponse' :: ListStreamsResponse -> Maybe [StreamInfo]
streamInfoList} -> Maybe [StreamInfo]
streamInfoList) (\s :: ListStreamsResponse
s@ListStreamsResponse' {} Maybe [StreamInfo]
a -> ListStreamsResponse
s {$sel:streamInfoList:ListStreamsResponse' :: Maybe [StreamInfo]
streamInfoList = Maybe [StreamInfo]
a} :: ListStreamsResponse) ((Maybe [StreamInfo] -> f (Maybe [StreamInfo]))
 -> ListStreamsResponse -> f ListStreamsResponse)
-> ((Maybe [StreamInfo] -> f (Maybe [StreamInfo]))
    -> Maybe [StreamInfo] -> f (Maybe [StreamInfo]))
-> (Maybe [StreamInfo] -> f (Maybe [StreamInfo]))
-> ListStreamsResponse
-> f ListStreamsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [StreamInfo] [StreamInfo] [StreamInfo] [StreamInfo]
-> Iso
     (Maybe [StreamInfo])
     (Maybe [StreamInfo])
     (Maybe [StreamInfo])
     (Maybe [StreamInfo])
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 [StreamInfo] [StreamInfo] [StreamInfo] [StreamInfo]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | If the response is truncated, the call returns this element with a
-- token. To get the next batch of streams, use this token in your next
-- request.
listStreamsResponse_nextToken :: Lens.Lens' ListStreamsResponse (Prelude.Maybe Prelude.Text)
listStreamsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListStreamsResponse -> f ListStreamsResponse
listStreamsResponse_nextToken = (ListStreamsResponse -> Maybe Text)
-> (ListStreamsResponse -> Maybe Text -> ListStreamsResponse)
-> Lens' ListStreamsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListStreamsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListStreamsResponse' :: ListStreamsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListStreamsResponse
s@ListStreamsResponse' {} Maybe Text
a -> ListStreamsResponse
s {$sel:nextToken:ListStreamsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListStreamsResponse)

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

instance Prelude.NFData ListStreamsResponse