{-# 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.GetChannelSchedule
-- 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)
--
-- Retrieves information about your channel\'s schedule.
--
-- This operation returns paginated results.
module Amazonka.MediaTailor.GetChannelSchedule
  ( -- * Creating a Request
    GetChannelSchedule (..),
    newGetChannelSchedule,

    -- * Request Lenses
    getChannelSchedule_nextToken,
    getChannelSchedule_durationMinutes,
    getChannelSchedule_maxResults,
    getChannelSchedule_channelName,

    -- * Destructuring the Response
    GetChannelScheduleResponse (..),
    newGetChannelScheduleResponse,

    -- * Response Lenses
    getChannelScheduleResponse_items,
    getChannelScheduleResponse_nextToken,
    getChannelScheduleResponse_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:/ 'newGetChannelSchedule' smart constructor.
data GetChannelSchedule = GetChannelSchedule'
  { -- | Pagination token from the GET list request. Use the token to fetch the
    -- next page of results.
    GetChannelSchedule -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The schedule duration in minutes. The maximum duration is 4320 minutes
    -- (three days).
    GetChannelSchedule -> Maybe Text
durationMinutes :: Prelude.Maybe Prelude.Text,
    -- | Upper bound on number of records to return. The maximum number of
    -- results is 100.
    GetChannelSchedule -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The identifier for the channel you are working on.
    GetChannelSchedule -> Text
channelName :: Prelude.Text
  }
  deriving (GetChannelSchedule -> GetChannelSchedule -> Bool
(GetChannelSchedule -> GetChannelSchedule -> Bool)
-> (GetChannelSchedule -> GetChannelSchedule -> Bool)
-> Eq GetChannelSchedule
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetChannelSchedule -> GetChannelSchedule -> Bool
$c/= :: GetChannelSchedule -> GetChannelSchedule -> Bool
== :: GetChannelSchedule -> GetChannelSchedule -> Bool
$c== :: GetChannelSchedule -> GetChannelSchedule -> Bool
Prelude.Eq, ReadPrec [GetChannelSchedule]
ReadPrec GetChannelSchedule
Int -> ReadS GetChannelSchedule
ReadS [GetChannelSchedule]
(Int -> ReadS GetChannelSchedule)
-> ReadS [GetChannelSchedule]
-> ReadPrec GetChannelSchedule
-> ReadPrec [GetChannelSchedule]
-> Read GetChannelSchedule
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetChannelSchedule]
$creadListPrec :: ReadPrec [GetChannelSchedule]
readPrec :: ReadPrec GetChannelSchedule
$creadPrec :: ReadPrec GetChannelSchedule
readList :: ReadS [GetChannelSchedule]
$creadList :: ReadS [GetChannelSchedule]
readsPrec :: Int -> ReadS GetChannelSchedule
$creadsPrec :: Int -> ReadS GetChannelSchedule
Prelude.Read, Int -> GetChannelSchedule -> ShowS
[GetChannelSchedule] -> ShowS
GetChannelSchedule -> String
(Int -> GetChannelSchedule -> ShowS)
-> (GetChannelSchedule -> String)
-> ([GetChannelSchedule] -> ShowS)
-> Show GetChannelSchedule
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetChannelSchedule] -> ShowS
$cshowList :: [GetChannelSchedule] -> ShowS
show :: GetChannelSchedule -> String
$cshow :: GetChannelSchedule -> String
showsPrec :: Int -> GetChannelSchedule -> ShowS
$cshowsPrec :: Int -> GetChannelSchedule -> ShowS
Prelude.Show, (forall x. GetChannelSchedule -> Rep GetChannelSchedule x)
-> (forall x. Rep GetChannelSchedule x -> GetChannelSchedule)
-> Generic GetChannelSchedule
forall x. Rep GetChannelSchedule x -> GetChannelSchedule
forall x. GetChannelSchedule -> Rep GetChannelSchedule x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetChannelSchedule x -> GetChannelSchedule
$cfrom :: forall x. GetChannelSchedule -> Rep GetChannelSchedule x
Prelude.Generic)

-- |
-- Create a value of 'GetChannelSchedule' 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', 'getChannelSchedule_nextToken' - Pagination token from the GET list request. Use the token to fetch the
-- next page of results.
--
-- 'durationMinutes', 'getChannelSchedule_durationMinutes' - The schedule duration in minutes. The maximum duration is 4320 minutes
-- (three days).
--
-- 'maxResults', 'getChannelSchedule_maxResults' - Upper bound on number of records to return. The maximum number of
-- results is 100.
--
-- 'channelName', 'getChannelSchedule_channelName' - The identifier for the channel you are working on.
newGetChannelSchedule ::
  -- | 'channelName'
  Prelude.Text ->
  GetChannelSchedule
newGetChannelSchedule :: Text -> GetChannelSchedule
newGetChannelSchedule Text
pChannelName_ =
  GetChannelSchedule' :: Maybe Text
-> Maybe Text -> Maybe Natural -> Text -> GetChannelSchedule
GetChannelSchedule'
    { $sel:nextToken:GetChannelSchedule' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:durationMinutes:GetChannelSchedule' :: Maybe Text
durationMinutes = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:GetChannelSchedule' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:channelName:GetChannelSchedule' :: Text
channelName = Text
pChannelName_
    }

-- | Pagination token from the GET list request. Use the token to fetch the
-- next page of results.
getChannelSchedule_nextToken :: Lens.Lens' GetChannelSchedule (Prelude.Maybe Prelude.Text)
getChannelSchedule_nextToken :: (Maybe Text -> f (Maybe Text))
-> GetChannelSchedule -> f GetChannelSchedule
getChannelSchedule_nextToken = (GetChannelSchedule -> Maybe Text)
-> (GetChannelSchedule -> Maybe Text -> GetChannelSchedule)
-> Lens
     GetChannelSchedule GetChannelSchedule (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetChannelSchedule' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetChannelSchedule' :: GetChannelSchedule -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetChannelSchedule
s@GetChannelSchedule' {} Maybe Text
a -> GetChannelSchedule
s {$sel:nextToken:GetChannelSchedule' :: Maybe Text
nextToken = Maybe Text
a} :: GetChannelSchedule)

-- | The schedule duration in minutes. The maximum duration is 4320 minutes
-- (three days).
getChannelSchedule_durationMinutes :: Lens.Lens' GetChannelSchedule (Prelude.Maybe Prelude.Text)
getChannelSchedule_durationMinutes :: (Maybe Text -> f (Maybe Text))
-> GetChannelSchedule -> f GetChannelSchedule
getChannelSchedule_durationMinutes = (GetChannelSchedule -> Maybe Text)
-> (GetChannelSchedule -> Maybe Text -> GetChannelSchedule)
-> Lens
     GetChannelSchedule GetChannelSchedule (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetChannelSchedule' {Maybe Text
durationMinutes :: Maybe Text
$sel:durationMinutes:GetChannelSchedule' :: GetChannelSchedule -> Maybe Text
durationMinutes} -> Maybe Text
durationMinutes) (\s :: GetChannelSchedule
s@GetChannelSchedule' {} Maybe Text
a -> GetChannelSchedule
s {$sel:durationMinutes:GetChannelSchedule' :: Maybe Text
durationMinutes = Maybe Text
a} :: GetChannelSchedule)

-- | Upper bound on number of records to return. The maximum number of
-- results is 100.
getChannelSchedule_maxResults :: Lens.Lens' GetChannelSchedule (Prelude.Maybe Prelude.Natural)
getChannelSchedule_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> GetChannelSchedule -> f GetChannelSchedule
getChannelSchedule_maxResults = (GetChannelSchedule -> Maybe Natural)
-> (GetChannelSchedule -> Maybe Natural -> GetChannelSchedule)
-> Lens
     GetChannelSchedule
     GetChannelSchedule
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetChannelSchedule' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:GetChannelSchedule' :: GetChannelSchedule -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: GetChannelSchedule
s@GetChannelSchedule' {} Maybe Natural
a -> GetChannelSchedule
s {$sel:maxResults:GetChannelSchedule' :: Maybe Natural
maxResults = Maybe Natural
a} :: GetChannelSchedule)

-- | The identifier for the channel you are working on.
getChannelSchedule_channelName :: Lens.Lens' GetChannelSchedule Prelude.Text
getChannelSchedule_channelName :: (Text -> f Text) -> GetChannelSchedule -> f GetChannelSchedule
getChannelSchedule_channelName = (GetChannelSchedule -> Text)
-> (GetChannelSchedule -> Text -> GetChannelSchedule)
-> Lens GetChannelSchedule GetChannelSchedule Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetChannelSchedule' {Text
channelName :: Text
$sel:channelName:GetChannelSchedule' :: GetChannelSchedule -> Text
channelName} -> Text
channelName) (\s :: GetChannelSchedule
s@GetChannelSchedule' {} Text
a -> GetChannelSchedule
s {$sel:channelName:GetChannelSchedule' :: Text
channelName = Text
a} :: GetChannelSchedule)

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

instance Prelude.NFData GetChannelSchedule

instance Core.ToHeaders GetChannelSchedule where
  toHeaders :: GetChannelSchedule -> ResponseHeaders
toHeaders =
    ResponseHeaders -> GetChannelSchedule -> 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 GetChannelSchedule where
  toPath :: GetChannelSchedule -> ByteString
toPath GetChannelSchedule' {Maybe Natural
Maybe Text
Text
channelName :: Text
maxResults :: Maybe Natural
durationMinutes :: Maybe Text
nextToken :: Maybe Text
$sel:channelName:GetChannelSchedule' :: GetChannelSchedule -> Text
$sel:maxResults:GetChannelSchedule' :: GetChannelSchedule -> Maybe Natural
$sel:durationMinutes:GetChannelSchedule' :: GetChannelSchedule -> Maybe Text
$sel:nextToken:GetChannelSchedule' :: GetChannelSchedule -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/channel/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
channelName, ByteString
"/schedule"]

instance Core.ToQuery GetChannelSchedule where
  toQuery :: GetChannelSchedule -> QueryString
toQuery GetChannelSchedule' {Maybe Natural
Maybe Text
Text
channelName :: Text
maxResults :: Maybe Natural
durationMinutes :: Maybe Text
nextToken :: Maybe Text
$sel:channelName:GetChannelSchedule' :: GetChannelSchedule -> Text
$sel:maxResults:GetChannelSchedule' :: GetChannelSchedule -> Maybe Natural
$sel:durationMinutes:GetChannelSchedule' :: GetChannelSchedule -> Maybe Text
$sel:nextToken:GetChannelSchedule' :: GetChannelSchedule -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"nextToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
nextToken,
        ByteString
"durationMinutes" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
durationMinutes,
        ByteString
"maxResults" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
maxResults
      ]

-- | /See:/ 'newGetChannelScheduleResponse' smart constructor.
data GetChannelScheduleResponse = GetChannelScheduleResponse'
  { -- | An array of schedule entries for the channel.
    GetChannelScheduleResponse -> Maybe [ScheduleEntry]
items :: Prelude.Maybe [ScheduleEntry],
    -- | Pagination token from the GET list request. Use the token to fetch the
    -- next page of results.
    GetChannelScheduleResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    GetChannelScheduleResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetChannelScheduleResponse -> GetChannelScheduleResponse -> Bool
(GetChannelScheduleResponse -> GetChannelScheduleResponse -> Bool)
-> (GetChannelScheduleResponse
    -> GetChannelScheduleResponse -> Bool)
-> Eq GetChannelScheduleResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetChannelScheduleResponse -> GetChannelScheduleResponse -> Bool
$c/= :: GetChannelScheduleResponse -> GetChannelScheduleResponse -> Bool
== :: GetChannelScheduleResponse -> GetChannelScheduleResponse -> Bool
$c== :: GetChannelScheduleResponse -> GetChannelScheduleResponse -> Bool
Prelude.Eq, ReadPrec [GetChannelScheduleResponse]
ReadPrec GetChannelScheduleResponse
Int -> ReadS GetChannelScheduleResponse
ReadS [GetChannelScheduleResponse]
(Int -> ReadS GetChannelScheduleResponse)
-> ReadS [GetChannelScheduleResponse]
-> ReadPrec GetChannelScheduleResponse
-> ReadPrec [GetChannelScheduleResponse]
-> Read GetChannelScheduleResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetChannelScheduleResponse]
$creadListPrec :: ReadPrec [GetChannelScheduleResponse]
readPrec :: ReadPrec GetChannelScheduleResponse
$creadPrec :: ReadPrec GetChannelScheduleResponse
readList :: ReadS [GetChannelScheduleResponse]
$creadList :: ReadS [GetChannelScheduleResponse]
readsPrec :: Int -> ReadS GetChannelScheduleResponse
$creadsPrec :: Int -> ReadS GetChannelScheduleResponse
Prelude.Read, Int -> GetChannelScheduleResponse -> ShowS
[GetChannelScheduleResponse] -> ShowS
GetChannelScheduleResponse -> String
(Int -> GetChannelScheduleResponse -> ShowS)
-> (GetChannelScheduleResponse -> String)
-> ([GetChannelScheduleResponse] -> ShowS)
-> Show GetChannelScheduleResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetChannelScheduleResponse] -> ShowS
$cshowList :: [GetChannelScheduleResponse] -> ShowS
show :: GetChannelScheduleResponse -> String
$cshow :: GetChannelScheduleResponse -> String
showsPrec :: Int -> GetChannelScheduleResponse -> ShowS
$cshowsPrec :: Int -> GetChannelScheduleResponse -> ShowS
Prelude.Show, (forall x.
 GetChannelScheduleResponse -> Rep GetChannelScheduleResponse x)
-> (forall x.
    Rep GetChannelScheduleResponse x -> GetChannelScheduleResponse)
-> Generic GetChannelScheduleResponse
forall x.
Rep GetChannelScheduleResponse x -> GetChannelScheduleResponse
forall x.
GetChannelScheduleResponse -> Rep GetChannelScheduleResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetChannelScheduleResponse x -> GetChannelScheduleResponse
$cfrom :: forall x.
GetChannelScheduleResponse -> Rep GetChannelScheduleResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetChannelScheduleResponse' 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:
--
-- 'items', 'getChannelScheduleResponse_items' - An array of schedule entries for the channel.
--
-- 'nextToken', 'getChannelScheduleResponse_nextToken' - Pagination token from the GET list request. Use the token to fetch the
-- next page of results.
--
-- 'httpStatus', 'getChannelScheduleResponse_httpStatus' - The response's http status code.
newGetChannelScheduleResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetChannelScheduleResponse
newGetChannelScheduleResponse :: Int -> GetChannelScheduleResponse
newGetChannelScheduleResponse Int
pHttpStatus_ =
  GetChannelScheduleResponse' :: Maybe [ScheduleEntry]
-> Maybe Text -> Int -> GetChannelScheduleResponse
GetChannelScheduleResponse'
    { $sel:items:GetChannelScheduleResponse' :: Maybe [ScheduleEntry]
items =
        Maybe [ScheduleEntry]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:GetChannelScheduleResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetChannelScheduleResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | An array of schedule entries for the channel.
getChannelScheduleResponse_items :: Lens.Lens' GetChannelScheduleResponse (Prelude.Maybe [ScheduleEntry])
getChannelScheduleResponse_items :: (Maybe [ScheduleEntry] -> f (Maybe [ScheduleEntry]))
-> GetChannelScheduleResponse -> f GetChannelScheduleResponse
getChannelScheduleResponse_items = (GetChannelScheduleResponse -> Maybe [ScheduleEntry])
-> (GetChannelScheduleResponse
    -> Maybe [ScheduleEntry] -> GetChannelScheduleResponse)
-> Lens' GetChannelScheduleResponse (Maybe [ScheduleEntry])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetChannelScheduleResponse' {Maybe [ScheduleEntry]
items :: Maybe [ScheduleEntry]
$sel:items:GetChannelScheduleResponse' :: GetChannelScheduleResponse -> Maybe [ScheduleEntry]
items} -> Maybe [ScheduleEntry]
items) (\s :: GetChannelScheduleResponse
s@GetChannelScheduleResponse' {} Maybe [ScheduleEntry]
a -> GetChannelScheduleResponse
s {$sel:items:GetChannelScheduleResponse' :: Maybe [ScheduleEntry]
items = Maybe [ScheduleEntry]
a} :: GetChannelScheduleResponse) ((Maybe [ScheduleEntry] -> f (Maybe [ScheduleEntry]))
 -> GetChannelScheduleResponse -> f GetChannelScheduleResponse)
-> ((Maybe [ScheduleEntry] -> f (Maybe [ScheduleEntry]))
    -> Maybe [ScheduleEntry] -> f (Maybe [ScheduleEntry]))
-> (Maybe [ScheduleEntry] -> f (Maybe [ScheduleEntry]))
-> GetChannelScheduleResponse
-> f GetChannelScheduleResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ScheduleEntry] [ScheduleEntry] [ScheduleEntry] [ScheduleEntry]
-> Iso
     (Maybe [ScheduleEntry])
     (Maybe [ScheduleEntry])
     (Maybe [ScheduleEntry])
     (Maybe [ScheduleEntry])
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
  [ScheduleEntry] [ScheduleEntry] [ScheduleEntry] [ScheduleEntry]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Pagination token from the GET list request. Use the token to fetch the
-- next page of results.
getChannelScheduleResponse_nextToken :: Lens.Lens' GetChannelScheduleResponse (Prelude.Maybe Prelude.Text)
getChannelScheduleResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> GetChannelScheduleResponse -> f GetChannelScheduleResponse
getChannelScheduleResponse_nextToken = (GetChannelScheduleResponse -> Maybe Text)
-> (GetChannelScheduleResponse
    -> Maybe Text -> GetChannelScheduleResponse)
-> Lens' GetChannelScheduleResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetChannelScheduleResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetChannelScheduleResponse' :: GetChannelScheduleResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetChannelScheduleResponse
s@GetChannelScheduleResponse' {} Maybe Text
a -> GetChannelScheduleResponse
s {$sel:nextToken:GetChannelScheduleResponse' :: Maybe Text
nextToken = Maybe Text
a} :: GetChannelScheduleResponse)

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

instance Prelude.NFData GetChannelScheduleResponse