{-# 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.UpdateChannel
-- 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)
--
-- Updates an existing channel.
module Amazonka.MediaTailor.UpdateChannel
  ( -- * Creating a Request
    UpdateChannel (..),
    newUpdateChannel,

    -- * Request Lenses
    updateChannel_channelName,
    updateChannel_outputs,

    -- * Destructuring the Response
    UpdateChannelResponse (..),
    newUpdateChannelResponse,

    -- * Response Lenses
    updateChannelResponse_creationTime,
    updateChannelResponse_arn,
    updateChannelResponse_lastModifiedTime,
    updateChannelResponse_playbackMode,
    updateChannelResponse_channelName,
    updateChannelResponse_outputs,
    updateChannelResponse_channelState,
    updateChannelResponse_fillerSlate,
    updateChannelResponse_tags,
    updateChannelResponse_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:/ 'newUpdateChannel' smart constructor.
data UpdateChannel = UpdateChannel'
  { -- | The identifier for the channel you are working on.
    UpdateChannel -> Text
channelName :: Prelude.Text,
    -- | The channel\'s output properties.
    UpdateChannel -> [RequestOutputItem]
outputs :: [RequestOutputItem]
  }
  deriving (UpdateChannel -> UpdateChannel -> Bool
(UpdateChannel -> UpdateChannel -> Bool)
-> (UpdateChannel -> UpdateChannel -> Bool) -> Eq UpdateChannel
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateChannel -> UpdateChannel -> Bool
$c/= :: UpdateChannel -> UpdateChannel -> Bool
== :: UpdateChannel -> UpdateChannel -> Bool
$c== :: UpdateChannel -> UpdateChannel -> Bool
Prelude.Eq, ReadPrec [UpdateChannel]
ReadPrec UpdateChannel
Int -> ReadS UpdateChannel
ReadS [UpdateChannel]
(Int -> ReadS UpdateChannel)
-> ReadS [UpdateChannel]
-> ReadPrec UpdateChannel
-> ReadPrec [UpdateChannel]
-> Read UpdateChannel
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateChannel]
$creadListPrec :: ReadPrec [UpdateChannel]
readPrec :: ReadPrec UpdateChannel
$creadPrec :: ReadPrec UpdateChannel
readList :: ReadS [UpdateChannel]
$creadList :: ReadS [UpdateChannel]
readsPrec :: Int -> ReadS UpdateChannel
$creadsPrec :: Int -> ReadS UpdateChannel
Prelude.Read, Int -> UpdateChannel -> ShowS
[UpdateChannel] -> ShowS
UpdateChannel -> String
(Int -> UpdateChannel -> ShowS)
-> (UpdateChannel -> String)
-> ([UpdateChannel] -> ShowS)
-> Show UpdateChannel
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateChannel] -> ShowS
$cshowList :: [UpdateChannel] -> ShowS
show :: UpdateChannel -> String
$cshow :: UpdateChannel -> String
showsPrec :: Int -> UpdateChannel -> ShowS
$cshowsPrec :: Int -> UpdateChannel -> ShowS
Prelude.Show, (forall x. UpdateChannel -> Rep UpdateChannel x)
-> (forall x. Rep UpdateChannel x -> UpdateChannel)
-> Generic UpdateChannel
forall x. Rep UpdateChannel x -> UpdateChannel
forall x. UpdateChannel -> Rep UpdateChannel x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateChannel x -> UpdateChannel
$cfrom :: forall x. UpdateChannel -> Rep UpdateChannel x
Prelude.Generic)

-- |
-- Create a value of 'UpdateChannel' 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:
--
-- 'channelName', 'updateChannel_channelName' - The identifier for the channel you are working on.
--
-- 'outputs', 'updateChannel_outputs' - The channel\'s output properties.
newUpdateChannel ::
  -- | 'channelName'
  Prelude.Text ->
  UpdateChannel
newUpdateChannel :: Text -> UpdateChannel
newUpdateChannel Text
pChannelName_ =
  UpdateChannel' :: Text -> [RequestOutputItem] -> UpdateChannel
UpdateChannel'
    { $sel:channelName:UpdateChannel' :: Text
channelName = Text
pChannelName_,
      $sel:outputs:UpdateChannel' :: [RequestOutputItem]
outputs = [RequestOutputItem]
forall a. Monoid a => a
Prelude.mempty
    }

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

-- | The channel\'s output properties.
updateChannel_outputs :: Lens.Lens' UpdateChannel [RequestOutputItem]
updateChannel_outputs :: ([RequestOutputItem] -> f [RequestOutputItem])
-> UpdateChannel -> f UpdateChannel
updateChannel_outputs = (UpdateChannel -> [RequestOutputItem])
-> (UpdateChannel -> [RequestOutputItem] -> UpdateChannel)
-> Lens
     UpdateChannel UpdateChannel [RequestOutputItem] [RequestOutputItem]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateChannel' {[RequestOutputItem]
outputs :: [RequestOutputItem]
$sel:outputs:UpdateChannel' :: UpdateChannel -> [RequestOutputItem]
outputs} -> [RequestOutputItem]
outputs) (\s :: UpdateChannel
s@UpdateChannel' {} [RequestOutputItem]
a -> UpdateChannel
s {$sel:outputs:UpdateChannel' :: [RequestOutputItem]
outputs = [RequestOutputItem]
a} :: UpdateChannel) (([RequestOutputItem] -> f [RequestOutputItem])
 -> UpdateChannel -> f UpdateChannel)
-> (([RequestOutputItem] -> f [RequestOutputItem])
    -> [RequestOutputItem] -> f [RequestOutputItem])
-> ([RequestOutputItem] -> f [RequestOutputItem])
-> UpdateChannel
-> f UpdateChannel
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([RequestOutputItem] -> f [RequestOutputItem])
-> [RequestOutputItem] -> f [RequestOutputItem]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.AWSRequest UpdateChannel where
  type
    AWSResponse UpdateChannel =
      UpdateChannelResponse
  request :: UpdateChannel -> Request UpdateChannel
request = Service -> UpdateChannel -> Request UpdateChannel
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdateChannel
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateChannel)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse UpdateChannel))
-> Logger
-> Service
-> Proxy UpdateChannel
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateChannel)))
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 POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe [ResponseOutputItem]
-> Maybe ChannelState
-> Maybe SlateSource
-> Maybe (HashMap Text Text)
-> Int
-> UpdateChannelResponse
UpdateChannelResponse'
            (Maybe POSIX
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe Text
 -> Maybe [ResponseOutputItem]
 -> Maybe ChannelState
 -> Maybe SlateSource
 -> Maybe (HashMap Text Text)
 -> Int
 -> UpdateChannelResponse)
-> Either String (Maybe POSIX)
-> Either
     String
     (Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe [ResponseOutputItem]
      -> Maybe ChannelState
      -> Maybe SlateSource
      -> Maybe (HashMap Text Text)
      -> Int
      -> UpdateChannelResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"CreationTime")
            Either
  String
  (Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe [ResponseOutputItem]
   -> Maybe ChannelState
   -> Maybe SlateSource
   -> Maybe (HashMap Text Text)
   -> Int
   -> UpdateChannelResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe [ResponseOutputItem]
      -> Maybe ChannelState
      -> Maybe SlateSource
      -> Maybe (HashMap Text Text)
      -> Int
      -> UpdateChannelResponse)
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
"Arn")
            Either
  String
  (Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe [ResponseOutputItem]
   -> Maybe ChannelState
   -> Maybe SlateSource
   -> Maybe (HashMap Text Text)
   -> Int
   -> UpdateChannelResponse)
-> Either String (Maybe POSIX)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe [ResponseOutputItem]
      -> Maybe ChannelState
      -> Maybe SlateSource
      -> Maybe (HashMap Text Text)
      -> Int
      -> UpdateChannelResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"LastModifiedTime")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe [ResponseOutputItem]
   -> Maybe ChannelState
   -> Maybe SlateSource
   -> Maybe (HashMap Text Text)
   -> Int
   -> UpdateChannelResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe [ResponseOutputItem]
      -> Maybe ChannelState
      -> Maybe SlateSource
      -> Maybe (HashMap Text Text)
      -> Int
      -> UpdateChannelResponse)
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
"PlaybackMode")
            Either
  String
  (Maybe Text
   -> Maybe [ResponseOutputItem]
   -> Maybe ChannelState
   -> Maybe SlateSource
   -> Maybe (HashMap Text Text)
   -> Int
   -> UpdateChannelResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [ResponseOutputItem]
      -> Maybe ChannelState
      -> Maybe SlateSource
      -> Maybe (HashMap Text Text)
      -> Int
      -> UpdateChannelResponse)
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
"ChannelName")
            Either
  String
  (Maybe [ResponseOutputItem]
   -> Maybe ChannelState
   -> Maybe SlateSource
   -> Maybe (HashMap Text Text)
   -> Int
   -> UpdateChannelResponse)
-> Either String (Maybe [ResponseOutputItem])
-> Either
     String
     (Maybe ChannelState
      -> Maybe SlateSource
      -> Maybe (HashMap Text Text)
      -> Int
      -> UpdateChannelResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text -> Either String (Maybe (Maybe [ResponseOutputItem]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Outputs" Either String (Maybe (Maybe [ResponseOutputItem]))
-> Maybe [ResponseOutputItem]
-> Either String (Maybe [ResponseOutputItem])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [ResponseOutputItem]
forall a. Monoid a => a
Prelude.mempty)
            Either
  String
  (Maybe ChannelState
   -> Maybe SlateSource
   -> Maybe (HashMap Text Text)
   -> Int
   -> UpdateChannelResponse)
-> Either String (Maybe ChannelState)
-> Either
     String
     (Maybe SlateSource
      -> Maybe (HashMap Text Text) -> Int -> UpdateChannelResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe ChannelState)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ChannelState")
            Either
  String
  (Maybe SlateSource
   -> Maybe (HashMap Text Text) -> Int -> UpdateChannelResponse)
-> Either String (Maybe SlateSource)
-> Either
     String (Maybe (HashMap Text Text) -> Int -> UpdateChannelResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe SlateSource)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"FillerSlate")
            Either
  String (Maybe (HashMap Text Text) -> Int -> UpdateChannelResponse)
-> Either String (Maybe (HashMap Text Text))
-> Either String (Int -> UpdateChannelResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"tags" Either String (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text)
-> Either String (Maybe (HashMap Text Text))
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
            Either String (Int -> UpdateChannelResponse)
-> Either String Int -> Either String UpdateChannelResponse
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 UpdateChannel

instance Prelude.NFData UpdateChannel

instance Core.ToHeaders UpdateChannel where
  toHeaders :: UpdateChannel -> ResponseHeaders
toHeaders =
    ResponseHeaders -> UpdateChannel -> 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.ToJSON UpdateChannel where
  toJSON :: UpdateChannel -> Value
toJSON UpdateChannel' {[RequestOutputItem]
Text
outputs :: [RequestOutputItem]
channelName :: Text
$sel:outputs:UpdateChannel' :: UpdateChannel -> [RequestOutputItem]
$sel:channelName:UpdateChannel' :: UpdateChannel -> Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Outputs" Text -> [RequestOutputItem] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [RequestOutputItem]
outputs)]
      )

instance Core.ToPath UpdateChannel where
  toPath :: UpdateChannel -> ByteString
toPath UpdateChannel' {[RequestOutputItem]
Text
outputs :: [RequestOutputItem]
channelName :: Text
$sel:outputs:UpdateChannel' :: UpdateChannel -> [RequestOutputItem]
$sel:channelName:UpdateChannel' :: UpdateChannel -> 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]

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

-- | /See:/ 'newUpdateChannelResponse' smart constructor.
data UpdateChannelResponse = UpdateChannelResponse'
  { -- | The timestamp of when the channel was created.
    UpdateChannelResponse -> Maybe POSIX
creationTime :: Prelude.Maybe Core.POSIX,
    -- | The ARN of the channel.
    UpdateChannelResponse -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The timestamp of when the channel was last modified.
    UpdateChannelResponse -> Maybe POSIX
lastModifiedTime :: Prelude.Maybe Core.POSIX,
    -- | The channel\'s playback mode.
    UpdateChannelResponse -> Maybe Text
playbackMode :: Prelude.Maybe Prelude.Text,
    -- | The name of the channel.
    UpdateChannelResponse -> Maybe Text
channelName :: Prelude.Maybe Prelude.Text,
    -- | The channel\'s output properties.
    UpdateChannelResponse -> Maybe [ResponseOutputItem]
outputs :: Prelude.Maybe [ResponseOutputItem],
    -- | Indicates whether the channel is in a running state or not.
    UpdateChannelResponse -> Maybe ChannelState
channelState :: Prelude.Maybe ChannelState,
    -- | Contains information about the slate used to fill gaps between programs
    -- in the schedule.
    UpdateChannelResponse -> Maybe SlateSource
fillerSlate :: Prelude.Maybe SlateSource,
    -- | The tags assigned to the channel.
    UpdateChannelResponse -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The response's http status code.
    UpdateChannelResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (UpdateChannelResponse -> UpdateChannelResponse -> Bool
(UpdateChannelResponse -> UpdateChannelResponse -> Bool)
-> (UpdateChannelResponse -> UpdateChannelResponse -> Bool)
-> Eq UpdateChannelResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateChannelResponse -> UpdateChannelResponse -> Bool
$c/= :: UpdateChannelResponse -> UpdateChannelResponse -> Bool
== :: UpdateChannelResponse -> UpdateChannelResponse -> Bool
$c== :: UpdateChannelResponse -> UpdateChannelResponse -> Bool
Prelude.Eq, ReadPrec [UpdateChannelResponse]
ReadPrec UpdateChannelResponse
Int -> ReadS UpdateChannelResponse
ReadS [UpdateChannelResponse]
(Int -> ReadS UpdateChannelResponse)
-> ReadS [UpdateChannelResponse]
-> ReadPrec UpdateChannelResponse
-> ReadPrec [UpdateChannelResponse]
-> Read UpdateChannelResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateChannelResponse]
$creadListPrec :: ReadPrec [UpdateChannelResponse]
readPrec :: ReadPrec UpdateChannelResponse
$creadPrec :: ReadPrec UpdateChannelResponse
readList :: ReadS [UpdateChannelResponse]
$creadList :: ReadS [UpdateChannelResponse]
readsPrec :: Int -> ReadS UpdateChannelResponse
$creadsPrec :: Int -> ReadS UpdateChannelResponse
Prelude.Read, Int -> UpdateChannelResponse -> ShowS
[UpdateChannelResponse] -> ShowS
UpdateChannelResponse -> String
(Int -> UpdateChannelResponse -> ShowS)
-> (UpdateChannelResponse -> String)
-> ([UpdateChannelResponse] -> ShowS)
-> Show UpdateChannelResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateChannelResponse] -> ShowS
$cshowList :: [UpdateChannelResponse] -> ShowS
show :: UpdateChannelResponse -> String
$cshow :: UpdateChannelResponse -> String
showsPrec :: Int -> UpdateChannelResponse -> ShowS
$cshowsPrec :: Int -> UpdateChannelResponse -> ShowS
Prelude.Show, (forall x. UpdateChannelResponse -> Rep UpdateChannelResponse x)
-> (forall x. Rep UpdateChannelResponse x -> UpdateChannelResponse)
-> Generic UpdateChannelResponse
forall x. Rep UpdateChannelResponse x -> UpdateChannelResponse
forall x. UpdateChannelResponse -> Rep UpdateChannelResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateChannelResponse x -> UpdateChannelResponse
$cfrom :: forall x. UpdateChannelResponse -> Rep UpdateChannelResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateChannelResponse' 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:
--
-- 'creationTime', 'updateChannelResponse_creationTime' - The timestamp of when the channel was created.
--
-- 'arn', 'updateChannelResponse_arn' - The ARN of the channel.
--
-- 'lastModifiedTime', 'updateChannelResponse_lastModifiedTime' - The timestamp of when the channel was last modified.
--
-- 'playbackMode', 'updateChannelResponse_playbackMode' - The channel\'s playback mode.
--
-- 'channelName', 'updateChannelResponse_channelName' - The name of the channel.
--
-- 'outputs', 'updateChannelResponse_outputs' - The channel\'s output properties.
--
-- 'channelState', 'updateChannelResponse_channelState' - Indicates whether the channel is in a running state or not.
--
-- 'fillerSlate', 'updateChannelResponse_fillerSlate' - Contains information about the slate used to fill gaps between programs
-- in the schedule.
--
-- 'tags', 'updateChannelResponse_tags' - The tags assigned to the channel.
--
-- 'httpStatus', 'updateChannelResponse_httpStatus' - The response's http status code.
newUpdateChannelResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateChannelResponse
newUpdateChannelResponse :: Int -> UpdateChannelResponse
newUpdateChannelResponse Int
pHttpStatus_ =
  UpdateChannelResponse' :: Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe [ResponseOutputItem]
-> Maybe ChannelState
-> Maybe SlateSource
-> Maybe (HashMap Text Text)
-> Int
-> UpdateChannelResponse
UpdateChannelResponse'
    { $sel:creationTime:UpdateChannelResponse' :: Maybe POSIX
creationTime =
        Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:arn:UpdateChannelResponse' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:lastModifiedTime:UpdateChannelResponse' :: Maybe POSIX
lastModifiedTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:playbackMode:UpdateChannelResponse' :: Maybe Text
playbackMode = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:channelName:UpdateChannelResponse' :: Maybe Text
channelName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:outputs:UpdateChannelResponse' :: Maybe [ResponseOutputItem]
outputs = Maybe [ResponseOutputItem]
forall a. Maybe a
Prelude.Nothing,
      $sel:channelState:UpdateChannelResponse' :: Maybe ChannelState
channelState = Maybe ChannelState
forall a. Maybe a
Prelude.Nothing,
      $sel:fillerSlate:UpdateChannelResponse' :: Maybe SlateSource
fillerSlate = Maybe SlateSource
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:UpdateChannelResponse' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:UpdateChannelResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The timestamp of when the channel was created.
updateChannelResponse_creationTime :: Lens.Lens' UpdateChannelResponse (Prelude.Maybe Prelude.UTCTime)
updateChannelResponse_creationTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> UpdateChannelResponse -> f UpdateChannelResponse
updateChannelResponse_creationTime = (UpdateChannelResponse -> Maybe POSIX)
-> (UpdateChannelResponse -> Maybe POSIX -> UpdateChannelResponse)
-> Lens
     UpdateChannelResponse
     UpdateChannelResponse
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateChannelResponse' {Maybe POSIX
creationTime :: Maybe POSIX
$sel:creationTime:UpdateChannelResponse' :: UpdateChannelResponse -> Maybe POSIX
creationTime} -> Maybe POSIX
creationTime) (\s :: UpdateChannelResponse
s@UpdateChannelResponse' {} Maybe POSIX
a -> UpdateChannelResponse
s {$sel:creationTime:UpdateChannelResponse' :: Maybe POSIX
creationTime = Maybe POSIX
a} :: UpdateChannelResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> UpdateChannelResponse -> f UpdateChannelResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> UpdateChannelResponse
-> f UpdateChannelResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The ARN of the channel.
updateChannelResponse_arn :: Lens.Lens' UpdateChannelResponse (Prelude.Maybe Prelude.Text)
updateChannelResponse_arn :: (Maybe Text -> f (Maybe Text))
-> UpdateChannelResponse -> f UpdateChannelResponse
updateChannelResponse_arn = (UpdateChannelResponse -> Maybe Text)
-> (UpdateChannelResponse -> Maybe Text -> UpdateChannelResponse)
-> Lens
     UpdateChannelResponse
     UpdateChannelResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateChannelResponse' {Maybe Text
arn :: Maybe Text
$sel:arn:UpdateChannelResponse' :: UpdateChannelResponse -> Maybe Text
arn} -> Maybe Text
arn) (\s :: UpdateChannelResponse
s@UpdateChannelResponse' {} Maybe Text
a -> UpdateChannelResponse
s {$sel:arn:UpdateChannelResponse' :: Maybe Text
arn = Maybe Text
a} :: UpdateChannelResponse)

-- | The timestamp of when the channel was last modified.
updateChannelResponse_lastModifiedTime :: Lens.Lens' UpdateChannelResponse (Prelude.Maybe Prelude.UTCTime)
updateChannelResponse_lastModifiedTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> UpdateChannelResponse -> f UpdateChannelResponse
updateChannelResponse_lastModifiedTime = (UpdateChannelResponse -> Maybe POSIX)
-> (UpdateChannelResponse -> Maybe POSIX -> UpdateChannelResponse)
-> Lens
     UpdateChannelResponse
     UpdateChannelResponse
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateChannelResponse' {Maybe POSIX
lastModifiedTime :: Maybe POSIX
$sel:lastModifiedTime:UpdateChannelResponse' :: UpdateChannelResponse -> Maybe POSIX
lastModifiedTime} -> Maybe POSIX
lastModifiedTime) (\s :: UpdateChannelResponse
s@UpdateChannelResponse' {} Maybe POSIX
a -> UpdateChannelResponse
s {$sel:lastModifiedTime:UpdateChannelResponse' :: Maybe POSIX
lastModifiedTime = Maybe POSIX
a} :: UpdateChannelResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> UpdateChannelResponse -> f UpdateChannelResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> UpdateChannelResponse
-> f UpdateChannelResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The channel\'s playback mode.
updateChannelResponse_playbackMode :: Lens.Lens' UpdateChannelResponse (Prelude.Maybe Prelude.Text)
updateChannelResponse_playbackMode :: (Maybe Text -> f (Maybe Text))
-> UpdateChannelResponse -> f UpdateChannelResponse
updateChannelResponse_playbackMode = (UpdateChannelResponse -> Maybe Text)
-> (UpdateChannelResponse -> Maybe Text -> UpdateChannelResponse)
-> Lens
     UpdateChannelResponse
     UpdateChannelResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateChannelResponse' {Maybe Text
playbackMode :: Maybe Text
$sel:playbackMode:UpdateChannelResponse' :: UpdateChannelResponse -> Maybe Text
playbackMode} -> Maybe Text
playbackMode) (\s :: UpdateChannelResponse
s@UpdateChannelResponse' {} Maybe Text
a -> UpdateChannelResponse
s {$sel:playbackMode:UpdateChannelResponse' :: Maybe Text
playbackMode = Maybe Text
a} :: UpdateChannelResponse)

-- | The name of the channel.
updateChannelResponse_channelName :: Lens.Lens' UpdateChannelResponse (Prelude.Maybe Prelude.Text)
updateChannelResponse_channelName :: (Maybe Text -> f (Maybe Text))
-> UpdateChannelResponse -> f UpdateChannelResponse
updateChannelResponse_channelName = (UpdateChannelResponse -> Maybe Text)
-> (UpdateChannelResponse -> Maybe Text -> UpdateChannelResponse)
-> Lens
     UpdateChannelResponse
     UpdateChannelResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateChannelResponse' {Maybe Text
channelName :: Maybe Text
$sel:channelName:UpdateChannelResponse' :: UpdateChannelResponse -> Maybe Text
channelName} -> Maybe Text
channelName) (\s :: UpdateChannelResponse
s@UpdateChannelResponse' {} Maybe Text
a -> UpdateChannelResponse
s {$sel:channelName:UpdateChannelResponse' :: Maybe Text
channelName = Maybe Text
a} :: UpdateChannelResponse)

-- | The channel\'s output properties.
updateChannelResponse_outputs :: Lens.Lens' UpdateChannelResponse (Prelude.Maybe [ResponseOutputItem])
updateChannelResponse_outputs :: (Maybe [ResponseOutputItem] -> f (Maybe [ResponseOutputItem]))
-> UpdateChannelResponse -> f UpdateChannelResponse
updateChannelResponse_outputs = (UpdateChannelResponse -> Maybe [ResponseOutputItem])
-> (UpdateChannelResponse
    -> Maybe [ResponseOutputItem] -> UpdateChannelResponse)
-> Lens
     UpdateChannelResponse
     UpdateChannelResponse
     (Maybe [ResponseOutputItem])
     (Maybe [ResponseOutputItem])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateChannelResponse' {Maybe [ResponseOutputItem]
outputs :: Maybe [ResponseOutputItem]
$sel:outputs:UpdateChannelResponse' :: UpdateChannelResponse -> Maybe [ResponseOutputItem]
outputs} -> Maybe [ResponseOutputItem]
outputs) (\s :: UpdateChannelResponse
s@UpdateChannelResponse' {} Maybe [ResponseOutputItem]
a -> UpdateChannelResponse
s {$sel:outputs:UpdateChannelResponse' :: Maybe [ResponseOutputItem]
outputs = Maybe [ResponseOutputItem]
a} :: UpdateChannelResponse) ((Maybe [ResponseOutputItem] -> f (Maybe [ResponseOutputItem]))
 -> UpdateChannelResponse -> f UpdateChannelResponse)
-> ((Maybe [ResponseOutputItem] -> f (Maybe [ResponseOutputItem]))
    -> Maybe [ResponseOutputItem] -> f (Maybe [ResponseOutputItem]))
-> (Maybe [ResponseOutputItem] -> f (Maybe [ResponseOutputItem]))
-> UpdateChannelResponse
-> f UpdateChannelResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ResponseOutputItem]
  [ResponseOutputItem]
  [ResponseOutputItem]
  [ResponseOutputItem]
-> Iso
     (Maybe [ResponseOutputItem])
     (Maybe [ResponseOutputItem])
     (Maybe [ResponseOutputItem])
     (Maybe [ResponseOutputItem])
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
  [ResponseOutputItem]
  [ResponseOutputItem]
  [ResponseOutputItem]
  [ResponseOutputItem]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Indicates whether the channel is in a running state or not.
updateChannelResponse_channelState :: Lens.Lens' UpdateChannelResponse (Prelude.Maybe ChannelState)
updateChannelResponse_channelState :: (Maybe ChannelState -> f (Maybe ChannelState))
-> UpdateChannelResponse -> f UpdateChannelResponse
updateChannelResponse_channelState = (UpdateChannelResponse -> Maybe ChannelState)
-> (UpdateChannelResponse
    -> Maybe ChannelState -> UpdateChannelResponse)
-> Lens
     UpdateChannelResponse
     UpdateChannelResponse
     (Maybe ChannelState)
     (Maybe ChannelState)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateChannelResponse' {Maybe ChannelState
channelState :: Maybe ChannelState
$sel:channelState:UpdateChannelResponse' :: UpdateChannelResponse -> Maybe ChannelState
channelState} -> Maybe ChannelState
channelState) (\s :: UpdateChannelResponse
s@UpdateChannelResponse' {} Maybe ChannelState
a -> UpdateChannelResponse
s {$sel:channelState:UpdateChannelResponse' :: Maybe ChannelState
channelState = Maybe ChannelState
a} :: UpdateChannelResponse)

-- | Contains information about the slate used to fill gaps between programs
-- in the schedule.
updateChannelResponse_fillerSlate :: Lens.Lens' UpdateChannelResponse (Prelude.Maybe SlateSource)
updateChannelResponse_fillerSlate :: (Maybe SlateSource -> f (Maybe SlateSource))
-> UpdateChannelResponse -> f UpdateChannelResponse
updateChannelResponse_fillerSlate = (UpdateChannelResponse -> Maybe SlateSource)
-> (UpdateChannelResponse
    -> Maybe SlateSource -> UpdateChannelResponse)
-> Lens
     UpdateChannelResponse
     UpdateChannelResponse
     (Maybe SlateSource)
     (Maybe SlateSource)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateChannelResponse' {Maybe SlateSource
fillerSlate :: Maybe SlateSource
$sel:fillerSlate:UpdateChannelResponse' :: UpdateChannelResponse -> Maybe SlateSource
fillerSlate} -> Maybe SlateSource
fillerSlate) (\s :: UpdateChannelResponse
s@UpdateChannelResponse' {} Maybe SlateSource
a -> UpdateChannelResponse
s {$sel:fillerSlate:UpdateChannelResponse' :: Maybe SlateSource
fillerSlate = Maybe SlateSource
a} :: UpdateChannelResponse)

-- | The tags assigned to the channel.
updateChannelResponse_tags :: Lens.Lens' UpdateChannelResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
updateChannelResponse_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> UpdateChannelResponse -> f UpdateChannelResponse
updateChannelResponse_tags = (UpdateChannelResponse -> Maybe (HashMap Text Text))
-> (UpdateChannelResponse
    -> Maybe (HashMap Text Text) -> UpdateChannelResponse)
-> Lens
     UpdateChannelResponse
     UpdateChannelResponse
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateChannelResponse' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:UpdateChannelResponse' :: UpdateChannelResponse -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: UpdateChannelResponse
s@UpdateChannelResponse' {} Maybe (HashMap Text Text)
a -> UpdateChannelResponse
s {$sel:tags:UpdateChannelResponse' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: UpdateChannelResponse) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> UpdateChannelResponse -> f UpdateChannelResponse)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> UpdateChannelResponse
-> f UpdateChannelResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
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
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData UpdateChannelResponse