{-# 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.KinesisVideoArchivedMedia.GetMediaForFragmentList
-- 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)
--
-- Gets media for a list of fragments (specified by fragment number) from
-- the archived data in an Amazon Kinesis video stream.
--
-- You must first call the @GetDataEndpoint@ API to get an endpoint. Then
-- send the @GetMediaForFragmentList@ requests to this endpoint using the
-- <https://docs.aws.amazon.com/cli/latest/reference/ --endpoint-url parameter>.
--
-- For limits, see
-- <http://docs.aws.amazon.com/kinesisvideostreams/latest/dg/limits.html Kinesis Video Streams Limits>.
--
-- If an error is thrown after invoking a Kinesis Video Streams archived
-- media API, in addition to the HTTP status code and the response body, it
-- includes the following pieces of information:
--
-- -   @x-amz-ErrorType@ HTTP header – contains a more specific error type
--     in addition to what the HTTP status code provides.
--
-- -   @x-amz-RequestId@ HTTP header – if you want to report an issue to
--     AWS, the support team can better diagnose the problem if given the
--     Request Id.
--
-- Both the HTTP status code and the ErrorType header can be utilized to
-- make programmatic decisions about whether errors are retry-able and
-- under what conditions, as well as provide information on what actions
-- the client programmer might need to take in order to successfully try
-- again.
--
-- For more information, see the __Errors__ section at the bottom of this
-- topic, as well as
-- <https://docs.aws.amazon.com/kinesisvideostreams/latest/dg/CommonErrors.html Common Errors>.
module Amazonka.KinesisVideoArchivedMedia.GetMediaForFragmentList
  ( -- * Creating a Request
    GetMediaForFragmentList (..),
    newGetMediaForFragmentList,

    -- * Request Lenses
    getMediaForFragmentList_streamARN,
    getMediaForFragmentList_streamName,
    getMediaForFragmentList_fragments,

    -- * Destructuring the Response
    GetMediaForFragmentListResponse (..),
    newGetMediaForFragmentListResponse,

    -- * Response Lenses
    getMediaForFragmentListResponse_contentType,
    getMediaForFragmentListResponse_httpStatus,
    getMediaForFragmentListResponse_payload,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.KinesisVideoArchivedMedia.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:/ 'newGetMediaForFragmentList' smart constructor.
data GetMediaForFragmentList = GetMediaForFragmentList'
  { -- | The Amazon Resource Name (ARN) of the stream from which to retrieve
    -- fragment media. Specify either this parameter or the @StreamName@
    -- parameter.
    GetMediaForFragmentList -> Maybe Text
streamARN :: Prelude.Maybe Prelude.Text,
    -- | The name of the stream from which to retrieve fragment media. Specify
    -- either this parameter or the @StreamARN@ parameter.
    GetMediaForFragmentList -> Maybe Text
streamName :: Prelude.Maybe Prelude.Text,
    -- | A list of the numbers of fragments for which to retrieve media. You
    -- retrieve these values with ListFragments.
    GetMediaForFragmentList -> NonEmpty Text
fragments :: Prelude.NonEmpty Prelude.Text
  }
  deriving (GetMediaForFragmentList -> GetMediaForFragmentList -> Bool
(GetMediaForFragmentList -> GetMediaForFragmentList -> Bool)
-> (GetMediaForFragmentList -> GetMediaForFragmentList -> Bool)
-> Eq GetMediaForFragmentList
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetMediaForFragmentList -> GetMediaForFragmentList -> Bool
$c/= :: GetMediaForFragmentList -> GetMediaForFragmentList -> Bool
== :: GetMediaForFragmentList -> GetMediaForFragmentList -> Bool
$c== :: GetMediaForFragmentList -> GetMediaForFragmentList -> Bool
Prelude.Eq, ReadPrec [GetMediaForFragmentList]
ReadPrec GetMediaForFragmentList
Int -> ReadS GetMediaForFragmentList
ReadS [GetMediaForFragmentList]
(Int -> ReadS GetMediaForFragmentList)
-> ReadS [GetMediaForFragmentList]
-> ReadPrec GetMediaForFragmentList
-> ReadPrec [GetMediaForFragmentList]
-> Read GetMediaForFragmentList
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetMediaForFragmentList]
$creadListPrec :: ReadPrec [GetMediaForFragmentList]
readPrec :: ReadPrec GetMediaForFragmentList
$creadPrec :: ReadPrec GetMediaForFragmentList
readList :: ReadS [GetMediaForFragmentList]
$creadList :: ReadS [GetMediaForFragmentList]
readsPrec :: Int -> ReadS GetMediaForFragmentList
$creadsPrec :: Int -> ReadS GetMediaForFragmentList
Prelude.Read, Int -> GetMediaForFragmentList -> ShowS
[GetMediaForFragmentList] -> ShowS
GetMediaForFragmentList -> String
(Int -> GetMediaForFragmentList -> ShowS)
-> (GetMediaForFragmentList -> String)
-> ([GetMediaForFragmentList] -> ShowS)
-> Show GetMediaForFragmentList
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetMediaForFragmentList] -> ShowS
$cshowList :: [GetMediaForFragmentList] -> ShowS
show :: GetMediaForFragmentList -> String
$cshow :: GetMediaForFragmentList -> String
showsPrec :: Int -> GetMediaForFragmentList -> ShowS
$cshowsPrec :: Int -> GetMediaForFragmentList -> ShowS
Prelude.Show, (forall x.
 GetMediaForFragmentList -> Rep GetMediaForFragmentList x)
-> (forall x.
    Rep GetMediaForFragmentList x -> GetMediaForFragmentList)
-> Generic GetMediaForFragmentList
forall x. Rep GetMediaForFragmentList x -> GetMediaForFragmentList
forall x. GetMediaForFragmentList -> Rep GetMediaForFragmentList x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetMediaForFragmentList x -> GetMediaForFragmentList
$cfrom :: forall x. GetMediaForFragmentList -> Rep GetMediaForFragmentList x
Prelude.Generic)

-- |
-- Create a value of 'GetMediaForFragmentList' 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:
--
-- 'streamARN', 'getMediaForFragmentList_streamARN' - The Amazon Resource Name (ARN) of the stream from which to retrieve
-- fragment media. Specify either this parameter or the @StreamName@
-- parameter.
--
-- 'streamName', 'getMediaForFragmentList_streamName' - The name of the stream from which to retrieve fragment media. Specify
-- either this parameter or the @StreamARN@ parameter.
--
-- 'fragments', 'getMediaForFragmentList_fragments' - A list of the numbers of fragments for which to retrieve media. You
-- retrieve these values with ListFragments.
newGetMediaForFragmentList ::
  -- | 'fragments'
  Prelude.NonEmpty Prelude.Text ->
  GetMediaForFragmentList
newGetMediaForFragmentList :: NonEmpty Text -> GetMediaForFragmentList
newGetMediaForFragmentList NonEmpty Text
pFragments_ =
  GetMediaForFragmentList' :: Maybe Text
-> Maybe Text -> NonEmpty Text -> GetMediaForFragmentList
GetMediaForFragmentList'
    { $sel:streamARN:GetMediaForFragmentList' :: Maybe Text
streamARN =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:streamName:GetMediaForFragmentList' :: Maybe Text
streamName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:fragments:GetMediaForFragmentList' :: NonEmpty Text
fragments = Tagged (NonEmpty Text) (Identity (NonEmpty Text))
-> Tagged (NonEmpty Text) (Identity (NonEmpty Text))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced (Tagged (NonEmpty Text) (Identity (NonEmpty Text))
 -> Tagged (NonEmpty Text) (Identity (NonEmpty Text)))
-> NonEmpty Text -> NonEmpty Text
forall t b. AReview t b -> b -> t
Lens.# NonEmpty Text
pFragments_
    }

-- | The Amazon Resource Name (ARN) of the stream from which to retrieve
-- fragment media. Specify either this parameter or the @StreamName@
-- parameter.
getMediaForFragmentList_streamARN :: Lens.Lens' GetMediaForFragmentList (Prelude.Maybe Prelude.Text)
getMediaForFragmentList_streamARN :: (Maybe Text -> f (Maybe Text))
-> GetMediaForFragmentList -> f GetMediaForFragmentList
getMediaForFragmentList_streamARN = (GetMediaForFragmentList -> Maybe Text)
-> (GetMediaForFragmentList
    -> Maybe Text -> GetMediaForFragmentList)
-> Lens
     GetMediaForFragmentList
     GetMediaForFragmentList
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMediaForFragmentList' {Maybe Text
streamARN :: Maybe Text
$sel:streamARN:GetMediaForFragmentList' :: GetMediaForFragmentList -> Maybe Text
streamARN} -> Maybe Text
streamARN) (\s :: GetMediaForFragmentList
s@GetMediaForFragmentList' {} Maybe Text
a -> GetMediaForFragmentList
s {$sel:streamARN:GetMediaForFragmentList' :: Maybe Text
streamARN = Maybe Text
a} :: GetMediaForFragmentList)

-- | The name of the stream from which to retrieve fragment media. Specify
-- either this parameter or the @StreamARN@ parameter.
getMediaForFragmentList_streamName :: Lens.Lens' GetMediaForFragmentList (Prelude.Maybe Prelude.Text)
getMediaForFragmentList_streamName :: (Maybe Text -> f (Maybe Text))
-> GetMediaForFragmentList -> f GetMediaForFragmentList
getMediaForFragmentList_streamName = (GetMediaForFragmentList -> Maybe Text)
-> (GetMediaForFragmentList
    -> Maybe Text -> GetMediaForFragmentList)
-> Lens
     GetMediaForFragmentList
     GetMediaForFragmentList
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMediaForFragmentList' {Maybe Text
streamName :: Maybe Text
$sel:streamName:GetMediaForFragmentList' :: GetMediaForFragmentList -> Maybe Text
streamName} -> Maybe Text
streamName) (\s :: GetMediaForFragmentList
s@GetMediaForFragmentList' {} Maybe Text
a -> GetMediaForFragmentList
s {$sel:streamName:GetMediaForFragmentList' :: Maybe Text
streamName = Maybe Text
a} :: GetMediaForFragmentList)

-- | A list of the numbers of fragments for which to retrieve media. You
-- retrieve these values with ListFragments.
getMediaForFragmentList_fragments :: Lens.Lens' GetMediaForFragmentList (Prelude.NonEmpty Prelude.Text)
getMediaForFragmentList_fragments :: (NonEmpty Text -> f (NonEmpty Text))
-> GetMediaForFragmentList -> f GetMediaForFragmentList
getMediaForFragmentList_fragments = (GetMediaForFragmentList -> NonEmpty Text)
-> (GetMediaForFragmentList
    -> NonEmpty Text -> GetMediaForFragmentList)
-> Lens
     GetMediaForFragmentList
     GetMediaForFragmentList
     (NonEmpty Text)
     (NonEmpty Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMediaForFragmentList' {NonEmpty Text
fragments :: NonEmpty Text
$sel:fragments:GetMediaForFragmentList' :: GetMediaForFragmentList -> NonEmpty Text
fragments} -> NonEmpty Text
fragments) (\s :: GetMediaForFragmentList
s@GetMediaForFragmentList' {} NonEmpty Text
a -> GetMediaForFragmentList
s {$sel:fragments:GetMediaForFragmentList' :: NonEmpty Text
fragments = NonEmpty Text
a} :: GetMediaForFragmentList) ((NonEmpty Text -> f (NonEmpty Text))
 -> GetMediaForFragmentList -> f GetMediaForFragmentList)
-> ((NonEmpty Text -> f (NonEmpty Text))
    -> NonEmpty Text -> f (NonEmpty Text))
-> (NonEmpty Text -> f (NonEmpty Text))
-> GetMediaForFragmentList
-> f GetMediaForFragmentList
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NonEmpty Text -> f (NonEmpty Text))
-> NonEmpty Text -> f (NonEmpty Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.AWSRequest GetMediaForFragmentList where
  type
    AWSResponse GetMediaForFragmentList =
      GetMediaForFragmentListResponse
  request :: GetMediaForFragmentList -> Request GetMediaForFragmentList
request = Service
-> GetMediaForFragmentList -> Request GetMediaForFragmentList
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy GetMediaForFragmentList
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetMediaForFragmentList)))
response =
    (Int
 -> ResponseHeaders
 -> ResponseBody
 -> Either String (AWSResponse GetMediaForFragmentList))
-> Logger
-> Service
-> Proxy GetMediaForFragmentList
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetMediaForFragmentList)))
forall (m :: * -> *) a.
MonadResource m =>
(Int
 -> ResponseHeaders
 -> ResponseBody
 -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveBody
      ( \Int
s ResponseHeaders
h ResponseBody
x ->
          Maybe Text
-> Int -> ResponseBody -> GetMediaForFragmentListResponse
GetMediaForFragmentListResponse'
            (Maybe Text
 -> Int -> ResponseBody -> GetMediaForFragmentListResponse)
-> Either String (Maybe Text)
-> Either
     String (Int -> ResponseBody -> GetMediaForFragmentListResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (ResponseHeaders
h ResponseHeaders -> HeaderName -> Either String (Maybe Text)
forall a.
FromText a =>
ResponseHeaders -> HeaderName -> Either String (Maybe a)
Core..#? HeaderName
"Content-Type")
            Either
  String (Int -> ResponseBody -> GetMediaForFragmentListResponse)
-> Either String Int
-> Either String (ResponseBody -> GetMediaForFragmentListResponse)
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))
            Either String (ResponseBody -> GetMediaForFragmentListResponse)
-> Either String ResponseBody
-> Either String GetMediaForFragmentListResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (ResponseBody -> Either String ResponseBody
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure ResponseBody
x)
      )

instance Prelude.Hashable GetMediaForFragmentList

instance Prelude.NFData GetMediaForFragmentList

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

instance Core.ToJSON GetMediaForFragmentList where
  toJSON :: GetMediaForFragmentList -> Value
toJSON GetMediaForFragmentList' {Maybe Text
NonEmpty Text
fragments :: NonEmpty Text
streamName :: Maybe Text
streamARN :: Maybe Text
$sel:fragments:GetMediaForFragmentList' :: GetMediaForFragmentList -> NonEmpty Text
$sel:streamName:GetMediaForFragmentList' :: GetMediaForFragmentList -> Maybe Text
$sel:streamARN:GetMediaForFragmentList' :: GetMediaForFragmentList -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"StreamARN" 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
streamARN,
            (Text
"StreamName" 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
streamName,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Fragments" Text -> NonEmpty Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= NonEmpty Text
fragments)
          ]
      )

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

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

-- | /See:/ 'newGetMediaForFragmentListResponse' smart constructor.
data GetMediaForFragmentListResponse = GetMediaForFragmentListResponse'
  { -- | The content type of the requested media.
    GetMediaForFragmentListResponse -> Maybe Text
contentType :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    GetMediaForFragmentListResponse -> Int
httpStatus :: Prelude.Int,
    -- | The payload that Kinesis Video Streams returns is a sequence of chunks
    -- from the specified stream. For information about the chunks, see
    -- <http://docs.aws.amazon.com/kinesisvideostreams/latest/dg/API_dataplane_PutMedia.html PutMedia>.
    -- The chunks that Kinesis Video Streams returns in the
    -- @GetMediaForFragmentList@ call also include the following additional
    -- Matroska (MKV) tags:
    --
    -- -   AWS_KINESISVIDEO_FRAGMENT_NUMBER - Fragment number returned in the
    --     chunk.
    --
    -- -   AWS_KINESISVIDEO_SERVER_SIDE_TIMESTAMP - Server-side timestamp of
    --     the fragment.
    --
    -- -   AWS_KINESISVIDEO_PRODUCER_SIDE_TIMESTAMP - Producer-side timestamp
    --     of the fragment.
    --
    -- The following tags will be included if an exception occurs:
    --
    -- -   AWS_KINESISVIDEO_FRAGMENT_NUMBER - The number of the fragment that
    --     threw the exception
    --
    -- -   AWS_KINESISVIDEO_EXCEPTION_ERROR_CODE - The integer code of the
    --     exception
    --
    -- -   AWS_KINESISVIDEO_EXCEPTION_MESSAGE - A text description of the
    --     exception
    GetMediaForFragmentListResponse -> ResponseBody
payload :: Core.ResponseBody
  }
  deriving (Int -> GetMediaForFragmentListResponse -> ShowS
[GetMediaForFragmentListResponse] -> ShowS
GetMediaForFragmentListResponse -> String
(Int -> GetMediaForFragmentListResponse -> ShowS)
-> (GetMediaForFragmentListResponse -> String)
-> ([GetMediaForFragmentListResponse] -> ShowS)
-> Show GetMediaForFragmentListResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetMediaForFragmentListResponse] -> ShowS
$cshowList :: [GetMediaForFragmentListResponse] -> ShowS
show :: GetMediaForFragmentListResponse -> String
$cshow :: GetMediaForFragmentListResponse -> String
showsPrec :: Int -> GetMediaForFragmentListResponse -> ShowS
$cshowsPrec :: Int -> GetMediaForFragmentListResponse -> ShowS
Prelude.Show, (forall x.
 GetMediaForFragmentListResponse
 -> Rep GetMediaForFragmentListResponse x)
-> (forall x.
    Rep GetMediaForFragmentListResponse x
    -> GetMediaForFragmentListResponse)
-> Generic GetMediaForFragmentListResponse
forall x.
Rep GetMediaForFragmentListResponse x
-> GetMediaForFragmentListResponse
forall x.
GetMediaForFragmentListResponse
-> Rep GetMediaForFragmentListResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetMediaForFragmentListResponse x
-> GetMediaForFragmentListResponse
$cfrom :: forall x.
GetMediaForFragmentListResponse
-> Rep GetMediaForFragmentListResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetMediaForFragmentListResponse' 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:
--
-- 'contentType', 'getMediaForFragmentListResponse_contentType' - The content type of the requested media.
--
-- 'httpStatus', 'getMediaForFragmentListResponse_httpStatus' - The response's http status code.
--
-- 'payload', 'getMediaForFragmentListResponse_payload' - The payload that Kinesis Video Streams returns is a sequence of chunks
-- from the specified stream. For information about the chunks, see
-- <http://docs.aws.amazon.com/kinesisvideostreams/latest/dg/API_dataplane_PutMedia.html PutMedia>.
-- The chunks that Kinesis Video Streams returns in the
-- @GetMediaForFragmentList@ call also include the following additional
-- Matroska (MKV) tags:
--
-- -   AWS_KINESISVIDEO_FRAGMENT_NUMBER - Fragment number returned in the
--     chunk.
--
-- -   AWS_KINESISVIDEO_SERVER_SIDE_TIMESTAMP - Server-side timestamp of
--     the fragment.
--
-- -   AWS_KINESISVIDEO_PRODUCER_SIDE_TIMESTAMP - Producer-side timestamp
--     of the fragment.
--
-- The following tags will be included if an exception occurs:
--
-- -   AWS_KINESISVIDEO_FRAGMENT_NUMBER - The number of the fragment that
--     threw the exception
--
-- -   AWS_KINESISVIDEO_EXCEPTION_ERROR_CODE - The integer code of the
--     exception
--
-- -   AWS_KINESISVIDEO_EXCEPTION_MESSAGE - A text description of the
--     exception
newGetMediaForFragmentListResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'payload'
  Core.ResponseBody ->
  GetMediaForFragmentListResponse
newGetMediaForFragmentListResponse :: Int -> ResponseBody -> GetMediaForFragmentListResponse
newGetMediaForFragmentListResponse
  Int
pHttpStatus_
  ResponseBody
pPayload_ =
    GetMediaForFragmentListResponse' :: Maybe Text
-> Int -> ResponseBody -> GetMediaForFragmentListResponse
GetMediaForFragmentListResponse'
      { $sel:contentType:GetMediaForFragmentListResponse' :: Maybe Text
contentType =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:GetMediaForFragmentListResponse' :: Int
httpStatus = Int
pHttpStatus_,
        $sel:payload:GetMediaForFragmentListResponse' :: ResponseBody
payload = ResponseBody
pPayload_
      }

-- | The content type of the requested media.
getMediaForFragmentListResponse_contentType :: Lens.Lens' GetMediaForFragmentListResponse (Prelude.Maybe Prelude.Text)
getMediaForFragmentListResponse_contentType :: (Maybe Text -> f (Maybe Text))
-> GetMediaForFragmentListResponse
-> f GetMediaForFragmentListResponse
getMediaForFragmentListResponse_contentType = (GetMediaForFragmentListResponse -> Maybe Text)
-> (GetMediaForFragmentListResponse
    -> Maybe Text -> GetMediaForFragmentListResponse)
-> Lens
     GetMediaForFragmentListResponse
     GetMediaForFragmentListResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMediaForFragmentListResponse' {Maybe Text
contentType :: Maybe Text
$sel:contentType:GetMediaForFragmentListResponse' :: GetMediaForFragmentListResponse -> Maybe Text
contentType} -> Maybe Text
contentType) (\s :: GetMediaForFragmentListResponse
s@GetMediaForFragmentListResponse' {} Maybe Text
a -> GetMediaForFragmentListResponse
s {$sel:contentType:GetMediaForFragmentListResponse' :: Maybe Text
contentType = Maybe Text
a} :: GetMediaForFragmentListResponse)

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

-- | The payload that Kinesis Video Streams returns is a sequence of chunks
-- from the specified stream. For information about the chunks, see
-- <http://docs.aws.amazon.com/kinesisvideostreams/latest/dg/API_dataplane_PutMedia.html PutMedia>.
-- The chunks that Kinesis Video Streams returns in the
-- @GetMediaForFragmentList@ call also include the following additional
-- Matroska (MKV) tags:
--
-- -   AWS_KINESISVIDEO_FRAGMENT_NUMBER - Fragment number returned in the
--     chunk.
--
-- -   AWS_KINESISVIDEO_SERVER_SIDE_TIMESTAMP - Server-side timestamp of
--     the fragment.
--
-- -   AWS_KINESISVIDEO_PRODUCER_SIDE_TIMESTAMP - Producer-side timestamp
--     of the fragment.
--
-- The following tags will be included if an exception occurs:
--
-- -   AWS_KINESISVIDEO_FRAGMENT_NUMBER - The number of the fragment that
--     threw the exception
--
-- -   AWS_KINESISVIDEO_EXCEPTION_ERROR_CODE - The integer code of the
--     exception
--
-- -   AWS_KINESISVIDEO_EXCEPTION_MESSAGE - A text description of the
--     exception
getMediaForFragmentListResponse_payload :: Lens.Lens' GetMediaForFragmentListResponse Core.ResponseBody
getMediaForFragmentListResponse_payload :: (ResponseBody -> f ResponseBody)
-> GetMediaForFragmentListResponse
-> f GetMediaForFragmentListResponse
getMediaForFragmentListResponse_payload = (GetMediaForFragmentListResponse -> ResponseBody)
-> (GetMediaForFragmentListResponse
    -> ResponseBody -> GetMediaForFragmentListResponse)
-> Lens
     GetMediaForFragmentListResponse
     GetMediaForFragmentListResponse
     ResponseBody
     ResponseBody
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMediaForFragmentListResponse' {ResponseBody
payload :: ResponseBody
$sel:payload:GetMediaForFragmentListResponse' :: GetMediaForFragmentListResponse -> ResponseBody
payload} -> ResponseBody
payload) (\s :: GetMediaForFragmentListResponse
s@GetMediaForFragmentListResponse' {} ResponseBody
a -> GetMediaForFragmentListResponse
s {$sel:payload:GetMediaForFragmentListResponse' :: ResponseBody
payload = ResponseBody
a} :: GetMediaForFragmentListResponse)