{-# 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.Kinesis.DescribeStream
-- 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)
--
-- Describes the specified Kinesis data stream.
--
-- The information returned includes the stream name, Amazon Resource Name
-- (ARN), creation time, enhanced metric configuration, and shard map. The
-- shard map is an array of shard objects. For each shard object, there is
-- the hash key and sequence number ranges that the shard spans, and the
-- IDs of any earlier shards that played in a role in creating the shard.
-- Every record ingested in the stream is identified by a sequence number,
-- which is assigned when the record is put into the stream.
--
-- You can limit the number of shards returned by each call. For more
-- information, see
-- <https://docs.aws.amazon.com/kinesis/latest/dev/kinesis-using-sdk-java-retrieve-shards.html Retrieving Shards from a Stream>
-- in the /Amazon Kinesis Data Streams Developer Guide/.
--
-- There are no guarantees about the chronological order shards returned.
-- To process shards in chronological order, use the ID of the parent shard
-- to track the lineage to the oldest shard.
--
-- This operation has a limit of 10 transactions per second per account.
--
-- This operation returns paginated results.
module Amazonka.Kinesis.DescribeStream
  ( -- * Creating a Request
    DescribeStream (..),
    newDescribeStream,

    -- * Request Lenses
    describeStream_exclusiveStartShardId,
    describeStream_limit,
    describeStream_streamName,

    -- * Destructuring the Response
    DescribeStreamResponse (..),
    newDescribeStreamResponse,

    -- * Response Lenses
    describeStreamResponse_httpStatus,
    describeStreamResponse_streamDescription,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.Kinesis.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

-- | Represents the input for @DescribeStream@.
--
-- /See:/ 'newDescribeStream' smart constructor.
data DescribeStream = DescribeStream'
  { -- | The shard ID of the shard to start with.
    DescribeStream -> Maybe Text
exclusiveStartShardId :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of shards to return in a single call. The default
    -- value is 100. If you specify a value greater than 100, at most 100
    -- shards are returned.
    DescribeStream -> Maybe Natural
limit :: Prelude.Maybe Prelude.Natural,
    -- | The name of the stream to describe.
    DescribeStream -> Text
streamName :: Prelude.Text
  }
  deriving (DescribeStream -> DescribeStream -> Bool
(DescribeStream -> DescribeStream -> Bool)
-> (DescribeStream -> DescribeStream -> Bool) -> Eq DescribeStream
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeStream -> DescribeStream -> Bool
$c/= :: DescribeStream -> DescribeStream -> Bool
== :: DescribeStream -> DescribeStream -> Bool
$c== :: DescribeStream -> DescribeStream -> Bool
Prelude.Eq, ReadPrec [DescribeStream]
ReadPrec DescribeStream
Int -> ReadS DescribeStream
ReadS [DescribeStream]
(Int -> ReadS DescribeStream)
-> ReadS [DescribeStream]
-> ReadPrec DescribeStream
-> ReadPrec [DescribeStream]
-> Read DescribeStream
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeStream]
$creadListPrec :: ReadPrec [DescribeStream]
readPrec :: ReadPrec DescribeStream
$creadPrec :: ReadPrec DescribeStream
readList :: ReadS [DescribeStream]
$creadList :: ReadS [DescribeStream]
readsPrec :: Int -> ReadS DescribeStream
$creadsPrec :: Int -> ReadS DescribeStream
Prelude.Read, Int -> DescribeStream -> ShowS
[DescribeStream] -> ShowS
DescribeStream -> String
(Int -> DescribeStream -> ShowS)
-> (DescribeStream -> String)
-> ([DescribeStream] -> ShowS)
-> Show DescribeStream
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeStream] -> ShowS
$cshowList :: [DescribeStream] -> ShowS
show :: DescribeStream -> String
$cshow :: DescribeStream -> String
showsPrec :: Int -> DescribeStream -> ShowS
$cshowsPrec :: Int -> DescribeStream -> ShowS
Prelude.Show, (forall x. DescribeStream -> Rep DescribeStream x)
-> (forall x. Rep DescribeStream x -> DescribeStream)
-> Generic DescribeStream
forall x. Rep DescribeStream x -> DescribeStream
forall x. DescribeStream -> Rep DescribeStream x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeStream x -> DescribeStream
$cfrom :: forall x. DescribeStream -> Rep DescribeStream x
Prelude.Generic)

-- |
-- Create a value of 'DescribeStream' 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:
--
-- 'exclusiveStartShardId', 'describeStream_exclusiveStartShardId' - The shard ID of the shard to start with.
--
-- 'limit', 'describeStream_limit' - The maximum number of shards to return in a single call. The default
-- value is 100. If you specify a value greater than 100, at most 100
-- shards are returned.
--
-- 'streamName', 'describeStream_streamName' - The name of the stream to describe.
newDescribeStream ::
  -- | 'streamName'
  Prelude.Text ->
  DescribeStream
newDescribeStream :: Text -> DescribeStream
newDescribeStream Text
pStreamName_ =
  DescribeStream' :: Maybe Text -> Maybe Natural -> Text -> DescribeStream
DescribeStream'
    { $sel:exclusiveStartShardId:DescribeStream' :: Maybe Text
exclusiveStartShardId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:limit:DescribeStream' :: Maybe Natural
limit = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:streamName:DescribeStream' :: Text
streamName = Text
pStreamName_
    }

-- | The shard ID of the shard to start with.
describeStream_exclusiveStartShardId :: Lens.Lens' DescribeStream (Prelude.Maybe Prelude.Text)
describeStream_exclusiveStartShardId :: (Maybe Text -> f (Maybe Text))
-> DescribeStream -> f DescribeStream
describeStream_exclusiveStartShardId = (DescribeStream -> Maybe Text)
-> (DescribeStream -> Maybe Text -> DescribeStream)
-> Lens DescribeStream DescribeStream (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeStream' {Maybe Text
exclusiveStartShardId :: Maybe Text
$sel:exclusiveStartShardId:DescribeStream' :: DescribeStream -> Maybe Text
exclusiveStartShardId} -> Maybe Text
exclusiveStartShardId) (\s :: DescribeStream
s@DescribeStream' {} Maybe Text
a -> DescribeStream
s {$sel:exclusiveStartShardId:DescribeStream' :: Maybe Text
exclusiveStartShardId = Maybe Text
a} :: DescribeStream)

-- | The maximum number of shards to return in a single call. The default
-- value is 100. If you specify a value greater than 100, at most 100
-- shards are returned.
describeStream_limit :: Lens.Lens' DescribeStream (Prelude.Maybe Prelude.Natural)
describeStream_limit :: (Maybe Natural -> f (Maybe Natural))
-> DescribeStream -> f DescribeStream
describeStream_limit = (DescribeStream -> Maybe Natural)
-> (DescribeStream -> Maybe Natural -> DescribeStream)
-> Lens
     DescribeStream DescribeStream (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeStream' {Maybe Natural
limit :: Maybe Natural
$sel:limit:DescribeStream' :: DescribeStream -> Maybe Natural
limit} -> Maybe Natural
limit) (\s :: DescribeStream
s@DescribeStream' {} Maybe Natural
a -> DescribeStream
s {$sel:limit:DescribeStream' :: Maybe Natural
limit = Maybe Natural
a} :: DescribeStream)

-- | The name of the stream to describe.
describeStream_streamName :: Lens.Lens' DescribeStream Prelude.Text
describeStream_streamName :: (Text -> f Text) -> DescribeStream -> f DescribeStream
describeStream_streamName = (DescribeStream -> Text)
-> (DescribeStream -> Text -> DescribeStream)
-> Lens DescribeStream DescribeStream Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeStream' {Text
streamName :: Text
$sel:streamName:DescribeStream' :: DescribeStream -> Text
streamName} -> Text
streamName) (\s :: DescribeStream
s@DescribeStream' {} Text
a -> DescribeStream
s {$sel:streamName:DescribeStream' :: Text
streamName = Text
a} :: DescribeStream)

instance Core.AWSPager DescribeStream where
  page :: DescribeStream
-> AWSResponse DescribeStream -> Maybe DescribeStream
page DescribeStream
rq AWSResponse DescribeStream
rs
    | Bool -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeStream
DescribeStreamResponse
rs
            DescribeStreamResponse
-> Getting Bool DescribeStreamResponse Bool -> Bool
forall s a. s -> Getting a s a -> a
Lens.^. (StreamDescription -> Const Bool StreamDescription)
-> DescribeStreamResponse -> Const Bool DescribeStreamResponse
Lens' DescribeStreamResponse StreamDescription
describeStreamResponse_streamDescription
              ((StreamDescription -> Const Bool StreamDescription)
 -> DescribeStreamResponse -> Const Bool DescribeStreamResponse)
-> ((Bool -> Const Bool Bool)
    -> StreamDescription -> Const Bool StreamDescription)
-> Getting Bool DescribeStreamResponse Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Bool -> Const Bool Bool)
-> StreamDescription -> Const Bool StreamDescription
Lens' StreamDescription Bool
streamDescription_hasMoreShards
        ) =
      Maybe DescribeStream
forall a. Maybe a
Prelude.Nothing
    | Maybe Text -> Bool
forall a. Maybe a -> Bool
Prelude.isNothing
        ( AWSResponse DescribeStream
DescribeStreamResponse
rs
            DescribeStreamResponse
-> Getting (First Text) DescribeStreamResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (StreamDescription -> Const (First Text) StreamDescription)
-> DescribeStreamResponse
-> Const (First Text) DescribeStreamResponse
Lens' DescribeStreamResponse StreamDescription
describeStreamResponse_streamDescription
              ((StreamDescription -> Const (First Text) StreamDescription)
 -> DescribeStreamResponse
 -> Const (First Text) DescribeStreamResponse)
-> ((Text -> Const (First Text) Text)
    -> StreamDescription -> Const (First Text) StreamDescription)
-> Getting (First Text) DescribeStreamResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Shard] -> Const (First Text) [Shard])
-> StreamDescription -> Const (First Text) StreamDescription
Lens' StreamDescription [Shard]
streamDescription_shards
              (([Shard] -> Const (First Text) [Shard])
 -> StreamDescription -> Const (First Text) StreamDescription)
-> ((Text -> Const (First Text) Text)
    -> [Shard] -> Const (First Text) [Shard])
-> (Text -> Const (First Text) Text)
-> StreamDescription
-> Const (First Text) StreamDescription
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Shard -> Const (First Text) Shard)
-> [Shard] -> Const (First Text) [Shard]
forall s a. Snoc s s a a => Traversal' s a
Lens._last
              ((Shard -> Const (First Text) Shard)
 -> [Shard] -> Const (First Text) [Shard])
-> ((Text -> Const (First Text) Text)
    -> Shard -> Const (First Text) Shard)
-> (Text -> Const (First Text) Text)
-> [Shard]
-> Const (First Text) [Shard]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Shard -> Const (First Text) Shard
Lens' Shard Text
shard_shardId
        ) =
      Maybe DescribeStream
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      DescribeStream -> Maybe DescribeStream
forall a. a -> Maybe a
Prelude.Just (DescribeStream -> Maybe DescribeStream)
-> DescribeStream -> Maybe DescribeStream
forall a b. (a -> b) -> a -> b
Prelude.$
        DescribeStream
rq
          DescribeStream
-> (DescribeStream -> DescribeStream) -> DescribeStream
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> DescribeStream -> Identity DescribeStream
Lens DescribeStream DescribeStream (Maybe Text) (Maybe Text)
describeStream_exclusiveStartShardId
          ((Maybe Text -> Identity (Maybe Text))
 -> DescribeStream -> Identity DescribeStream)
-> Maybe Text -> DescribeStream -> DescribeStream
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeStream
DescribeStreamResponse
rs
          DescribeStreamResponse
-> Getting (First Text) DescribeStreamResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (StreamDescription -> Const (First Text) StreamDescription)
-> DescribeStreamResponse
-> Const (First Text) DescribeStreamResponse
Lens' DescribeStreamResponse StreamDescription
describeStreamResponse_streamDescription
            ((StreamDescription -> Const (First Text) StreamDescription)
 -> DescribeStreamResponse
 -> Const (First Text) DescribeStreamResponse)
-> ((Text -> Const (First Text) Text)
    -> StreamDescription -> Const (First Text) StreamDescription)
-> Getting (First Text) DescribeStreamResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Shard] -> Const (First Text) [Shard])
-> StreamDescription -> Const (First Text) StreamDescription
Lens' StreamDescription [Shard]
streamDescription_shards
            (([Shard] -> Const (First Text) [Shard])
 -> StreamDescription -> Const (First Text) StreamDescription)
-> ((Text -> Const (First Text) Text)
    -> [Shard] -> Const (First Text) [Shard])
-> (Text -> Const (First Text) Text)
-> StreamDescription
-> Const (First Text) StreamDescription
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Shard -> Const (First Text) Shard)
-> [Shard] -> Const (First Text) [Shard]
forall s a. Snoc s s a a => Traversal' s a
Lens._last
            ((Shard -> Const (First Text) Shard)
 -> [Shard] -> Const (First Text) [Shard])
-> ((Text -> Const (First Text) Text)
    -> Shard -> Const (First Text) Shard)
-> (Text -> Const (First Text) Text)
-> [Shard]
-> Const (First Text) [Shard]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Shard -> Const (First Text) Shard
Lens' Shard Text
shard_shardId

instance Core.AWSRequest DescribeStream where
  type
    AWSResponse DescribeStream =
      DescribeStreamResponse
  request :: DescribeStream -> Request DescribeStream
request = Service -> DescribeStream -> Request DescribeStream
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy DescribeStream
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DescribeStream)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse DescribeStream))
-> Logger
-> Service
-> Proxy DescribeStream
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DescribeStream)))
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 ->
          Int -> StreamDescription -> DescribeStreamResponse
DescribeStreamResponse'
            (Int -> StreamDescription -> DescribeStreamResponse)
-> Either String Int
-> Either String (StreamDescription -> DescribeStreamResponse)
forall (f :: * -> *) a b. Functor 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))
            Either String (StreamDescription -> DescribeStreamResponse)
-> Either String StreamDescription
-> Either String DescribeStreamResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String StreamDescription
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"StreamDescription")
      )

instance Prelude.Hashable DescribeStream

instance Prelude.NFData DescribeStream

instance Core.ToHeaders DescribeStream where
  toHeaders :: DescribeStream -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DescribeStream -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"Kinesis_20131202.DescribeStream" ::
                          Prelude.ByteString
                      ),
            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.ToJSON DescribeStream where
  toJSON :: DescribeStream -> Value
toJSON DescribeStream' {Maybe Natural
Maybe Text
Text
streamName :: Text
limit :: Maybe Natural
exclusiveStartShardId :: Maybe Text
$sel:streamName:DescribeStream' :: DescribeStream -> Text
$sel:limit:DescribeStream' :: DescribeStream -> Maybe Natural
$sel:exclusiveStartShardId:DescribeStream' :: DescribeStream -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"ExclusiveStartShardId" 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
exclusiveStartShardId,
            (Text
"Limit" 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
limit,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"StreamName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
streamName)
          ]
      )

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

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

-- | Represents the output for @DescribeStream@.
--
-- /See:/ 'newDescribeStreamResponse' smart constructor.
data DescribeStreamResponse = DescribeStreamResponse'
  { -- | The response's http status code.
    DescribeStreamResponse -> Int
httpStatus :: Prelude.Int,
    -- | The current status of the stream, the stream Amazon Resource Name (ARN),
    -- an array of shard objects that comprise the stream, and whether there
    -- are more shards available.
    DescribeStreamResponse -> StreamDescription
streamDescription :: StreamDescription
  }
  deriving (DescribeStreamResponse -> DescribeStreamResponse -> Bool
(DescribeStreamResponse -> DescribeStreamResponse -> Bool)
-> (DescribeStreamResponse -> DescribeStreamResponse -> Bool)
-> Eq DescribeStreamResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeStreamResponse -> DescribeStreamResponse -> Bool
$c/= :: DescribeStreamResponse -> DescribeStreamResponse -> Bool
== :: DescribeStreamResponse -> DescribeStreamResponse -> Bool
$c== :: DescribeStreamResponse -> DescribeStreamResponse -> Bool
Prelude.Eq, ReadPrec [DescribeStreamResponse]
ReadPrec DescribeStreamResponse
Int -> ReadS DescribeStreamResponse
ReadS [DescribeStreamResponse]
(Int -> ReadS DescribeStreamResponse)
-> ReadS [DescribeStreamResponse]
-> ReadPrec DescribeStreamResponse
-> ReadPrec [DescribeStreamResponse]
-> Read DescribeStreamResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeStreamResponse]
$creadListPrec :: ReadPrec [DescribeStreamResponse]
readPrec :: ReadPrec DescribeStreamResponse
$creadPrec :: ReadPrec DescribeStreamResponse
readList :: ReadS [DescribeStreamResponse]
$creadList :: ReadS [DescribeStreamResponse]
readsPrec :: Int -> ReadS DescribeStreamResponse
$creadsPrec :: Int -> ReadS DescribeStreamResponse
Prelude.Read, Int -> DescribeStreamResponse -> ShowS
[DescribeStreamResponse] -> ShowS
DescribeStreamResponse -> String
(Int -> DescribeStreamResponse -> ShowS)
-> (DescribeStreamResponse -> String)
-> ([DescribeStreamResponse] -> ShowS)
-> Show DescribeStreamResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeStreamResponse] -> ShowS
$cshowList :: [DescribeStreamResponse] -> ShowS
show :: DescribeStreamResponse -> String
$cshow :: DescribeStreamResponse -> String
showsPrec :: Int -> DescribeStreamResponse -> ShowS
$cshowsPrec :: Int -> DescribeStreamResponse -> ShowS
Prelude.Show, (forall x. DescribeStreamResponse -> Rep DescribeStreamResponse x)
-> (forall x.
    Rep DescribeStreamResponse x -> DescribeStreamResponse)
-> Generic DescribeStreamResponse
forall x. Rep DescribeStreamResponse x -> DescribeStreamResponse
forall x. DescribeStreamResponse -> Rep DescribeStreamResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeStreamResponse x -> DescribeStreamResponse
$cfrom :: forall x. DescribeStreamResponse -> Rep DescribeStreamResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeStreamResponse' 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:
--
-- 'httpStatus', 'describeStreamResponse_httpStatus' - The response's http status code.
--
-- 'streamDescription', 'describeStreamResponse_streamDescription' - The current status of the stream, the stream Amazon Resource Name (ARN),
-- an array of shard objects that comprise the stream, and whether there
-- are more shards available.
newDescribeStreamResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'streamDescription'
  StreamDescription ->
  DescribeStreamResponse
newDescribeStreamResponse :: Int -> StreamDescription -> DescribeStreamResponse
newDescribeStreamResponse
  Int
pHttpStatus_
  StreamDescription
pStreamDescription_ =
    DescribeStreamResponse' :: Int -> StreamDescription -> DescribeStreamResponse
DescribeStreamResponse'
      { $sel:httpStatus:DescribeStreamResponse' :: Int
httpStatus = Int
pHttpStatus_,
        $sel:streamDescription:DescribeStreamResponse' :: StreamDescription
streamDescription = StreamDescription
pStreamDescription_
      }

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

-- | The current status of the stream, the stream Amazon Resource Name (ARN),
-- an array of shard objects that comprise the stream, and whether there
-- are more shards available.
describeStreamResponse_streamDescription :: Lens.Lens' DescribeStreamResponse StreamDescription
describeStreamResponse_streamDescription :: (StreamDescription -> f StreamDescription)
-> DescribeStreamResponse -> f DescribeStreamResponse
describeStreamResponse_streamDescription = (DescribeStreamResponse -> StreamDescription)
-> (DescribeStreamResponse
    -> StreamDescription -> DescribeStreamResponse)
-> Lens' DescribeStreamResponse StreamDescription
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeStreamResponse' {StreamDescription
streamDescription :: StreamDescription
$sel:streamDescription:DescribeStreamResponse' :: DescribeStreamResponse -> StreamDescription
streamDescription} -> StreamDescription
streamDescription) (\s :: DescribeStreamResponse
s@DescribeStreamResponse' {} StreamDescription
a -> DescribeStreamResponse
s {$sel:streamDescription:DescribeStreamResponse' :: StreamDescription
streamDescription = StreamDescription
a} :: DescribeStreamResponse)

instance Prelude.NFData DescribeStreamResponse