{-# 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.MediaTailor.GetPrefetchSchedule
-- 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 information about the prefetch schedule for a specific playback
-- configuration. If you call GetPrefetchSchedule on an expired prefetch
-- schedule, MediaTailor returns an HTTP 404 status code.
module Amazonka.MediaTailor.GetPrefetchSchedule
  ( -- * Creating a Request
    GetPrefetchSchedule (..),
    newGetPrefetchSchedule,

    -- * Request Lenses
    getPrefetchSchedule_name,
    getPrefetchSchedule_playbackConfigurationName,

    -- * Destructuring the Response
    GetPrefetchScheduleResponse (..),
    newGetPrefetchScheduleResponse,

    -- * Response Lenses
    getPrefetchScheduleResponse_arn,
    getPrefetchScheduleResponse_playbackConfigurationName,
    getPrefetchScheduleResponse_retrieval,
    getPrefetchScheduleResponse_name,
    getPrefetchScheduleResponse_consumption,
    getPrefetchScheduleResponse_streamId,
    getPrefetchScheduleResponse_httpStatus,
  )
where

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

-- | /See:/ 'newGetPrefetchSchedule' smart constructor.
data GetPrefetchSchedule = GetPrefetchSchedule'
  { -- | The identifier for the playback configuration.
    GetPrefetchSchedule -> Text
name :: Prelude.Text,
    -- | The name of the playback configuration.
    GetPrefetchSchedule -> Text
playbackConfigurationName :: Prelude.Text
  }
  deriving (GetPrefetchSchedule -> GetPrefetchSchedule -> Bool
(GetPrefetchSchedule -> GetPrefetchSchedule -> Bool)
-> (GetPrefetchSchedule -> GetPrefetchSchedule -> Bool)
-> Eq GetPrefetchSchedule
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetPrefetchSchedule -> GetPrefetchSchedule -> Bool
$c/= :: GetPrefetchSchedule -> GetPrefetchSchedule -> Bool
== :: GetPrefetchSchedule -> GetPrefetchSchedule -> Bool
$c== :: GetPrefetchSchedule -> GetPrefetchSchedule -> Bool
Prelude.Eq, ReadPrec [GetPrefetchSchedule]
ReadPrec GetPrefetchSchedule
Int -> ReadS GetPrefetchSchedule
ReadS [GetPrefetchSchedule]
(Int -> ReadS GetPrefetchSchedule)
-> ReadS [GetPrefetchSchedule]
-> ReadPrec GetPrefetchSchedule
-> ReadPrec [GetPrefetchSchedule]
-> Read GetPrefetchSchedule
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetPrefetchSchedule]
$creadListPrec :: ReadPrec [GetPrefetchSchedule]
readPrec :: ReadPrec GetPrefetchSchedule
$creadPrec :: ReadPrec GetPrefetchSchedule
readList :: ReadS [GetPrefetchSchedule]
$creadList :: ReadS [GetPrefetchSchedule]
readsPrec :: Int -> ReadS GetPrefetchSchedule
$creadsPrec :: Int -> ReadS GetPrefetchSchedule
Prelude.Read, Int -> GetPrefetchSchedule -> ShowS
[GetPrefetchSchedule] -> ShowS
GetPrefetchSchedule -> String
(Int -> GetPrefetchSchedule -> ShowS)
-> (GetPrefetchSchedule -> String)
-> ([GetPrefetchSchedule] -> ShowS)
-> Show GetPrefetchSchedule
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetPrefetchSchedule] -> ShowS
$cshowList :: [GetPrefetchSchedule] -> ShowS
show :: GetPrefetchSchedule -> String
$cshow :: GetPrefetchSchedule -> String
showsPrec :: Int -> GetPrefetchSchedule -> ShowS
$cshowsPrec :: Int -> GetPrefetchSchedule -> ShowS
Prelude.Show, (forall x. GetPrefetchSchedule -> Rep GetPrefetchSchedule x)
-> (forall x. Rep GetPrefetchSchedule x -> GetPrefetchSchedule)
-> Generic GetPrefetchSchedule
forall x. Rep GetPrefetchSchedule x -> GetPrefetchSchedule
forall x. GetPrefetchSchedule -> Rep GetPrefetchSchedule x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetPrefetchSchedule x -> GetPrefetchSchedule
$cfrom :: forall x. GetPrefetchSchedule -> Rep GetPrefetchSchedule x
Prelude.Generic)

-- |
-- Create a value of 'GetPrefetchSchedule' 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:
--
-- 'name', 'getPrefetchSchedule_name' - The identifier for the playback configuration.
--
-- 'playbackConfigurationName', 'getPrefetchSchedule_playbackConfigurationName' - The name of the playback configuration.
newGetPrefetchSchedule ::
  -- | 'name'
  Prelude.Text ->
  -- | 'playbackConfigurationName'
  Prelude.Text ->
  GetPrefetchSchedule
newGetPrefetchSchedule :: Text -> Text -> GetPrefetchSchedule
newGetPrefetchSchedule
  Text
pName_
  Text
pPlaybackConfigurationName_ =
    GetPrefetchSchedule' :: Text -> Text -> GetPrefetchSchedule
GetPrefetchSchedule'
      { $sel:name:GetPrefetchSchedule' :: Text
name = Text
pName_,
        $sel:playbackConfigurationName:GetPrefetchSchedule' :: Text
playbackConfigurationName =
          Text
pPlaybackConfigurationName_
      }

-- | The identifier for the playback configuration.
getPrefetchSchedule_name :: Lens.Lens' GetPrefetchSchedule Prelude.Text
getPrefetchSchedule_name :: (Text -> f Text) -> GetPrefetchSchedule -> f GetPrefetchSchedule
getPrefetchSchedule_name = (GetPrefetchSchedule -> Text)
-> (GetPrefetchSchedule -> Text -> GetPrefetchSchedule)
-> Lens GetPrefetchSchedule GetPrefetchSchedule Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetPrefetchSchedule' {Text
name :: Text
$sel:name:GetPrefetchSchedule' :: GetPrefetchSchedule -> Text
name} -> Text
name) (\s :: GetPrefetchSchedule
s@GetPrefetchSchedule' {} Text
a -> GetPrefetchSchedule
s {$sel:name:GetPrefetchSchedule' :: Text
name = Text
a} :: GetPrefetchSchedule)

-- | The name of the playback configuration.
getPrefetchSchedule_playbackConfigurationName :: Lens.Lens' GetPrefetchSchedule Prelude.Text
getPrefetchSchedule_playbackConfigurationName :: (Text -> f Text) -> GetPrefetchSchedule -> f GetPrefetchSchedule
getPrefetchSchedule_playbackConfigurationName = (GetPrefetchSchedule -> Text)
-> (GetPrefetchSchedule -> Text -> GetPrefetchSchedule)
-> Lens GetPrefetchSchedule GetPrefetchSchedule Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetPrefetchSchedule' {Text
playbackConfigurationName :: Text
$sel:playbackConfigurationName:GetPrefetchSchedule' :: GetPrefetchSchedule -> Text
playbackConfigurationName} -> Text
playbackConfigurationName) (\s :: GetPrefetchSchedule
s@GetPrefetchSchedule' {} Text
a -> GetPrefetchSchedule
s {$sel:playbackConfigurationName:GetPrefetchSchedule' :: Text
playbackConfigurationName = Text
a} :: GetPrefetchSchedule)

instance Core.AWSRequest GetPrefetchSchedule where
  type
    AWSResponse GetPrefetchSchedule =
      GetPrefetchScheduleResponse
  request :: GetPrefetchSchedule -> Request GetPrefetchSchedule
request = Service -> GetPrefetchSchedule -> Request GetPrefetchSchedule
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy GetPrefetchSchedule
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetPrefetchSchedule)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse GetPrefetchSchedule))
-> Logger
-> Service
-> Proxy GetPrefetchSchedule
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetPrefetchSchedule)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe PrefetchRetrieval
-> Maybe Text
-> Maybe PrefetchConsumption
-> Maybe Text
-> Int
-> GetPrefetchScheduleResponse
GetPrefetchScheduleResponse'
            (Maybe Text
 -> Maybe Text
 -> Maybe PrefetchRetrieval
 -> Maybe Text
 -> Maybe PrefetchConsumption
 -> Maybe Text
 -> Int
 -> GetPrefetchScheduleResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe PrefetchRetrieval
      -> Maybe Text
      -> Maybe PrefetchConsumption
      -> Maybe Text
      -> Int
      -> GetPrefetchScheduleResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Arn")
            Either
  String
  (Maybe Text
   -> Maybe PrefetchRetrieval
   -> Maybe Text
   -> Maybe PrefetchConsumption
   -> Maybe Text
   -> Int
   -> GetPrefetchScheduleResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe PrefetchRetrieval
      -> Maybe Text
      -> Maybe PrefetchConsumption
      -> Maybe Text
      -> Int
      -> GetPrefetchScheduleResponse)
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
"PlaybackConfigurationName")
            Either
  String
  (Maybe PrefetchRetrieval
   -> Maybe Text
   -> Maybe PrefetchConsumption
   -> Maybe Text
   -> Int
   -> GetPrefetchScheduleResponse)
-> Either String (Maybe PrefetchRetrieval)
-> Either
     String
     (Maybe Text
      -> Maybe PrefetchConsumption
      -> Maybe Text
      -> Int
      -> GetPrefetchScheduleResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe PrefetchRetrieval)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Retrieval")
            Either
  String
  (Maybe Text
   -> Maybe PrefetchConsumption
   -> Maybe Text
   -> Int
   -> GetPrefetchScheduleResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe PrefetchConsumption
      -> Maybe Text -> Int -> GetPrefetchScheduleResponse)
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
"Name")
            Either
  String
  (Maybe PrefetchConsumption
   -> Maybe Text -> Int -> GetPrefetchScheduleResponse)
-> Either String (Maybe PrefetchConsumption)
-> Either String (Maybe Text -> Int -> GetPrefetchScheduleResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe PrefetchConsumption)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Consumption")
            Either String (Maybe Text -> Int -> GetPrefetchScheduleResponse)
-> Either String (Maybe Text)
-> Either String (Int -> GetPrefetchScheduleResponse)
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
"StreamId")
            Either String (Int -> GetPrefetchScheduleResponse)
-> Either String Int -> Either String GetPrefetchScheduleResponse
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 GetPrefetchSchedule

instance Prelude.NFData GetPrefetchSchedule

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

instance Core.ToPath GetPrefetchSchedule where
  toPath :: GetPrefetchSchedule -> ByteString
toPath GetPrefetchSchedule' {Text
playbackConfigurationName :: Text
name :: Text
$sel:playbackConfigurationName:GetPrefetchSchedule' :: GetPrefetchSchedule -> Text
$sel:name:GetPrefetchSchedule' :: GetPrefetchSchedule -> Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/prefetchSchedule/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
playbackConfigurationName,
        ByteString
"/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
name
      ]

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

-- | /See:/ 'newGetPrefetchScheduleResponse' smart constructor.
data GetPrefetchScheduleResponse = GetPrefetchScheduleResponse'
  { -- | The Amazon Resource Name (ARN) of the prefetch schedule.
    GetPrefetchScheduleResponse -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The name of the playback configuration to create the prefetch schedule
    -- for.
    GetPrefetchScheduleResponse -> Maybe Text
playbackConfigurationName :: Prelude.Maybe Prelude.Text,
    -- | A complex type that contains settings for prefetch retrieval from the ad
    -- decision server (ADS).
    GetPrefetchScheduleResponse -> Maybe PrefetchRetrieval
retrieval :: Prelude.Maybe PrefetchRetrieval,
    -- | The name of the prefetch schedule. The name must be unique among all
    -- prefetch schedules that are associated with the specified playback
    -- configuration.
    GetPrefetchScheduleResponse -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | Consumption settings determine how, and when, MediaTailor places the
    -- prefetched ads into ad breaks. Ad consumption occurs within a span of
    -- time that you define, called a /consumption window/. You can designate
    -- which ad breaks that MediaTailor fills with prefetch ads by setting
    -- avail matching criteria.
    GetPrefetchScheduleResponse -> Maybe PrefetchConsumption
consumption :: Prelude.Maybe PrefetchConsumption,
    -- | An optional stream identifier that you can specify in order to prefetch
    -- for multiple streams that use the same playback configuration.
    GetPrefetchScheduleResponse -> Maybe Text
streamId :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    GetPrefetchScheduleResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetPrefetchScheduleResponse -> GetPrefetchScheduleResponse -> Bool
(GetPrefetchScheduleResponse
 -> GetPrefetchScheduleResponse -> Bool)
-> (GetPrefetchScheduleResponse
    -> GetPrefetchScheduleResponse -> Bool)
-> Eq GetPrefetchScheduleResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetPrefetchScheduleResponse -> GetPrefetchScheduleResponse -> Bool
$c/= :: GetPrefetchScheduleResponse -> GetPrefetchScheduleResponse -> Bool
== :: GetPrefetchScheduleResponse -> GetPrefetchScheduleResponse -> Bool
$c== :: GetPrefetchScheduleResponse -> GetPrefetchScheduleResponse -> Bool
Prelude.Eq, ReadPrec [GetPrefetchScheduleResponse]
ReadPrec GetPrefetchScheduleResponse
Int -> ReadS GetPrefetchScheduleResponse
ReadS [GetPrefetchScheduleResponse]
(Int -> ReadS GetPrefetchScheduleResponse)
-> ReadS [GetPrefetchScheduleResponse]
-> ReadPrec GetPrefetchScheduleResponse
-> ReadPrec [GetPrefetchScheduleResponse]
-> Read GetPrefetchScheduleResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetPrefetchScheduleResponse]
$creadListPrec :: ReadPrec [GetPrefetchScheduleResponse]
readPrec :: ReadPrec GetPrefetchScheduleResponse
$creadPrec :: ReadPrec GetPrefetchScheduleResponse
readList :: ReadS [GetPrefetchScheduleResponse]
$creadList :: ReadS [GetPrefetchScheduleResponse]
readsPrec :: Int -> ReadS GetPrefetchScheduleResponse
$creadsPrec :: Int -> ReadS GetPrefetchScheduleResponse
Prelude.Read, Int -> GetPrefetchScheduleResponse -> ShowS
[GetPrefetchScheduleResponse] -> ShowS
GetPrefetchScheduleResponse -> String
(Int -> GetPrefetchScheduleResponse -> ShowS)
-> (GetPrefetchScheduleResponse -> String)
-> ([GetPrefetchScheduleResponse] -> ShowS)
-> Show GetPrefetchScheduleResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetPrefetchScheduleResponse] -> ShowS
$cshowList :: [GetPrefetchScheduleResponse] -> ShowS
show :: GetPrefetchScheduleResponse -> String
$cshow :: GetPrefetchScheduleResponse -> String
showsPrec :: Int -> GetPrefetchScheduleResponse -> ShowS
$cshowsPrec :: Int -> GetPrefetchScheduleResponse -> ShowS
Prelude.Show, (forall x.
 GetPrefetchScheduleResponse -> Rep GetPrefetchScheduleResponse x)
-> (forall x.
    Rep GetPrefetchScheduleResponse x -> GetPrefetchScheduleResponse)
-> Generic GetPrefetchScheduleResponse
forall x.
Rep GetPrefetchScheduleResponse x -> GetPrefetchScheduleResponse
forall x.
GetPrefetchScheduleResponse -> Rep GetPrefetchScheduleResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetPrefetchScheduleResponse x -> GetPrefetchScheduleResponse
$cfrom :: forall x.
GetPrefetchScheduleResponse -> Rep GetPrefetchScheduleResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetPrefetchScheduleResponse' 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:
--
-- 'arn', 'getPrefetchScheduleResponse_arn' - The Amazon Resource Name (ARN) of the prefetch schedule.
--
-- 'playbackConfigurationName', 'getPrefetchScheduleResponse_playbackConfigurationName' - The name of the playback configuration to create the prefetch schedule
-- for.
--
-- 'retrieval', 'getPrefetchScheduleResponse_retrieval' - A complex type that contains settings for prefetch retrieval from the ad
-- decision server (ADS).
--
-- 'name', 'getPrefetchScheduleResponse_name' - The name of the prefetch schedule. The name must be unique among all
-- prefetch schedules that are associated with the specified playback
-- configuration.
--
-- 'consumption', 'getPrefetchScheduleResponse_consumption' - Consumption settings determine how, and when, MediaTailor places the
-- prefetched ads into ad breaks. Ad consumption occurs within a span of
-- time that you define, called a /consumption window/. You can designate
-- which ad breaks that MediaTailor fills with prefetch ads by setting
-- avail matching criteria.
--
-- 'streamId', 'getPrefetchScheduleResponse_streamId' - An optional stream identifier that you can specify in order to prefetch
-- for multiple streams that use the same playback configuration.
--
-- 'httpStatus', 'getPrefetchScheduleResponse_httpStatus' - The response's http status code.
newGetPrefetchScheduleResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetPrefetchScheduleResponse
newGetPrefetchScheduleResponse :: Int -> GetPrefetchScheduleResponse
newGetPrefetchScheduleResponse Int
pHttpStatus_ =
  GetPrefetchScheduleResponse' :: Maybe Text
-> Maybe Text
-> Maybe PrefetchRetrieval
-> Maybe Text
-> Maybe PrefetchConsumption
-> Maybe Text
-> Int
-> GetPrefetchScheduleResponse
GetPrefetchScheduleResponse'
    { $sel:arn:GetPrefetchScheduleResponse' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:playbackConfigurationName:GetPrefetchScheduleResponse' :: Maybe Text
playbackConfigurationName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:retrieval:GetPrefetchScheduleResponse' :: Maybe PrefetchRetrieval
retrieval = Maybe PrefetchRetrieval
forall a. Maybe a
Prelude.Nothing,
      $sel:name:GetPrefetchScheduleResponse' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:consumption:GetPrefetchScheduleResponse' :: Maybe PrefetchConsumption
consumption = Maybe PrefetchConsumption
forall a. Maybe a
Prelude.Nothing,
      $sel:streamId:GetPrefetchScheduleResponse' :: Maybe Text
streamId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetPrefetchScheduleResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The Amazon Resource Name (ARN) of the prefetch schedule.
getPrefetchScheduleResponse_arn :: Lens.Lens' GetPrefetchScheduleResponse (Prelude.Maybe Prelude.Text)
getPrefetchScheduleResponse_arn :: (Maybe Text -> f (Maybe Text))
-> GetPrefetchScheduleResponse -> f GetPrefetchScheduleResponse
getPrefetchScheduleResponse_arn = (GetPrefetchScheduleResponse -> Maybe Text)
-> (GetPrefetchScheduleResponse
    -> Maybe Text -> GetPrefetchScheduleResponse)
-> Lens
     GetPrefetchScheduleResponse
     GetPrefetchScheduleResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetPrefetchScheduleResponse' {Maybe Text
arn :: Maybe Text
$sel:arn:GetPrefetchScheduleResponse' :: GetPrefetchScheduleResponse -> Maybe Text
arn} -> Maybe Text
arn) (\s :: GetPrefetchScheduleResponse
s@GetPrefetchScheduleResponse' {} Maybe Text
a -> GetPrefetchScheduleResponse
s {$sel:arn:GetPrefetchScheduleResponse' :: Maybe Text
arn = Maybe Text
a} :: GetPrefetchScheduleResponse)

-- | The name of the playback configuration to create the prefetch schedule
-- for.
getPrefetchScheduleResponse_playbackConfigurationName :: Lens.Lens' GetPrefetchScheduleResponse (Prelude.Maybe Prelude.Text)
getPrefetchScheduleResponse_playbackConfigurationName :: (Maybe Text -> f (Maybe Text))
-> GetPrefetchScheduleResponse -> f GetPrefetchScheduleResponse
getPrefetchScheduleResponse_playbackConfigurationName = (GetPrefetchScheduleResponse -> Maybe Text)
-> (GetPrefetchScheduleResponse
    -> Maybe Text -> GetPrefetchScheduleResponse)
-> Lens
     GetPrefetchScheduleResponse
     GetPrefetchScheduleResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetPrefetchScheduleResponse' {Maybe Text
playbackConfigurationName :: Maybe Text
$sel:playbackConfigurationName:GetPrefetchScheduleResponse' :: GetPrefetchScheduleResponse -> Maybe Text
playbackConfigurationName} -> Maybe Text
playbackConfigurationName) (\s :: GetPrefetchScheduleResponse
s@GetPrefetchScheduleResponse' {} Maybe Text
a -> GetPrefetchScheduleResponse
s {$sel:playbackConfigurationName:GetPrefetchScheduleResponse' :: Maybe Text
playbackConfigurationName = Maybe Text
a} :: GetPrefetchScheduleResponse)

-- | A complex type that contains settings for prefetch retrieval from the ad
-- decision server (ADS).
getPrefetchScheduleResponse_retrieval :: Lens.Lens' GetPrefetchScheduleResponse (Prelude.Maybe PrefetchRetrieval)
getPrefetchScheduleResponse_retrieval :: (Maybe PrefetchRetrieval -> f (Maybe PrefetchRetrieval))
-> GetPrefetchScheduleResponse -> f GetPrefetchScheduleResponse
getPrefetchScheduleResponse_retrieval = (GetPrefetchScheduleResponse -> Maybe PrefetchRetrieval)
-> (GetPrefetchScheduleResponse
    -> Maybe PrefetchRetrieval -> GetPrefetchScheduleResponse)
-> Lens
     GetPrefetchScheduleResponse
     GetPrefetchScheduleResponse
     (Maybe PrefetchRetrieval)
     (Maybe PrefetchRetrieval)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetPrefetchScheduleResponse' {Maybe PrefetchRetrieval
retrieval :: Maybe PrefetchRetrieval
$sel:retrieval:GetPrefetchScheduleResponse' :: GetPrefetchScheduleResponse -> Maybe PrefetchRetrieval
retrieval} -> Maybe PrefetchRetrieval
retrieval) (\s :: GetPrefetchScheduleResponse
s@GetPrefetchScheduleResponse' {} Maybe PrefetchRetrieval
a -> GetPrefetchScheduleResponse
s {$sel:retrieval:GetPrefetchScheduleResponse' :: Maybe PrefetchRetrieval
retrieval = Maybe PrefetchRetrieval
a} :: GetPrefetchScheduleResponse)

-- | The name of the prefetch schedule. The name must be unique among all
-- prefetch schedules that are associated with the specified playback
-- configuration.
getPrefetchScheduleResponse_name :: Lens.Lens' GetPrefetchScheduleResponse (Prelude.Maybe Prelude.Text)
getPrefetchScheduleResponse_name :: (Maybe Text -> f (Maybe Text))
-> GetPrefetchScheduleResponse -> f GetPrefetchScheduleResponse
getPrefetchScheduleResponse_name = (GetPrefetchScheduleResponse -> Maybe Text)
-> (GetPrefetchScheduleResponse
    -> Maybe Text -> GetPrefetchScheduleResponse)
-> Lens
     GetPrefetchScheduleResponse
     GetPrefetchScheduleResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetPrefetchScheduleResponse' {Maybe Text
name :: Maybe Text
$sel:name:GetPrefetchScheduleResponse' :: GetPrefetchScheduleResponse -> Maybe Text
name} -> Maybe Text
name) (\s :: GetPrefetchScheduleResponse
s@GetPrefetchScheduleResponse' {} Maybe Text
a -> GetPrefetchScheduleResponse
s {$sel:name:GetPrefetchScheduleResponse' :: Maybe Text
name = Maybe Text
a} :: GetPrefetchScheduleResponse)

-- | Consumption settings determine how, and when, MediaTailor places the
-- prefetched ads into ad breaks. Ad consumption occurs within a span of
-- time that you define, called a /consumption window/. You can designate
-- which ad breaks that MediaTailor fills with prefetch ads by setting
-- avail matching criteria.
getPrefetchScheduleResponse_consumption :: Lens.Lens' GetPrefetchScheduleResponse (Prelude.Maybe PrefetchConsumption)
getPrefetchScheduleResponse_consumption :: (Maybe PrefetchConsumption -> f (Maybe PrefetchConsumption))
-> GetPrefetchScheduleResponse -> f GetPrefetchScheduleResponse
getPrefetchScheduleResponse_consumption = (GetPrefetchScheduleResponse -> Maybe PrefetchConsumption)
-> (GetPrefetchScheduleResponse
    -> Maybe PrefetchConsumption -> GetPrefetchScheduleResponse)
-> Lens
     GetPrefetchScheduleResponse
     GetPrefetchScheduleResponse
     (Maybe PrefetchConsumption)
     (Maybe PrefetchConsumption)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetPrefetchScheduleResponse' {Maybe PrefetchConsumption
consumption :: Maybe PrefetchConsumption
$sel:consumption:GetPrefetchScheduleResponse' :: GetPrefetchScheduleResponse -> Maybe PrefetchConsumption
consumption} -> Maybe PrefetchConsumption
consumption) (\s :: GetPrefetchScheduleResponse
s@GetPrefetchScheduleResponse' {} Maybe PrefetchConsumption
a -> GetPrefetchScheduleResponse
s {$sel:consumption:GetPrefetchScheduleResponse' :: Maybe PrefetchConsumption
consumption = Maybe PrefetchConsumption
a} :: GetPrefetchScheduleResponse)

-- | An optional stream identifier that you can specify in order to prefetch
-- for multiple streams that use the same playback configuration.
getPrefetchScheduleResponse_streamId :: Lens.Lens' GetPrefetchScheduleResponse (Prelude.Maybe Prelude.Text)
getPrefetchScheduleResponse_streamId :: (Maybe Text -> f (Maybe Text))
-> GetPrefetchScheduleResponse -> f GetPrefetchScheduleResponse
getPrefetchScheduleResponse_streamId = (GetPrefetchScheduleResponse -> Maybe Text)
-> (GetPrefetchScheduleResponse
    -> Maybe Text -> GetPrefetchScheduleResponse)
-> Lens
     GetPrefetchScheduleResponse
     GetPrefetchScheduleResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetPrefetchScheduleResponse' {Maybe Text
streamId :: Maybe Text
$sel:streamId:GetPrefetchScheduleResponse' :: GetPrefetchScheduleResponse -> Maybe Text
streamId} -> Maybe Text
streamId) (\s :: GetPrefetchScheduleResponse
s@GetPrefetchScheduleResponse' {} Maybe Text
a -> GetPrefetchScheduleResponse
s {$sel:streamId:GetPrefetchScheduleResponse' :: Maybe Text
streamId = Maybe Text
a} :: GetPrefetchScheduleResponse)

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

instance Prelude.NFData GetPrefetchScheduleResponse