{-# 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.MediaPackage.CreateChannel
-- 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)
--
-- Creates a new Channel.
module Amazonka.MediaPackage.CreateChannel
  ( -- * Creating a Request
    CreateChannel (..),
    newCreateChannel,

    -- * Request Lenses
    createChannel_description,
    createChannel_tags,
    createChannel_id,

    -- * Destructuring the Response
    CreateChannelResponse (..),
    newCreateChannelResponse,

    -- * Response Lenses
    createChannelResponse_ingressAccessLogs,
    createChannelResponse_hlsIngest,
    createChannelResponse_arn,
    createChannelResponse_id,
    createChannelResponse_description,
    createChannelResponse_egressAccessLogs,
    createChannelResponse_tags,
    createChannelResponse_httpStatus,
  )
where

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

-- | A new Channel configuration.
--
-- /See:/ 'newCreateChannel' smart constructor.
data CreateChannel = CreateChannel'
  { -- | A short text description of the Channel.
    CreateChannel -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    CreateChannel -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The ID of the Channel. The ID must be unique within the region and it
    -- cannot be changed after a Channel is created.
    CreateChannel -> Text
id :: Prelude.Text
  }
  deriving (CreateChannel -> CreateChannel -> Bool
(CreateChannel -> CreateChannel -> Bool)
-> (CreateChannel -> CreateChannel -> Bool) -> Eq CreateChannel
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateChannel -> CreateChannel -> Bool
$c/= :: CreateChannel -> CreateChannel -> Bool
== :: CreateChannel -> CreateChannel -> Bool
$c== :: CreateChannel -> CreateChannel -> Bool
Prelude.Eq, ReadPrec [CreateChannel]
ReadPrec CreateChannel
Int -> ReadS CreateChannel
ReadS [CreateChannel]
(Int -> ReadS CreateChannel)
-> ReadS [CreateChannel]
-> ReadPrec CreateChannel
-> ReadPrec [CreateChannel]
-> Read CreateChannel
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateChannel]
$creadListPrec :: ReadPrec [CreateChannel]
readPrec :: ReadPrec CreateChannel
$creadPrec :: ReadPrec CreateChannel
readList :: ReadS [CreateChannel]
$creadList :: ReadS [CreateChannel]
readsPrec :: Int -> ReadS CreateChannel
$creadsPrec :: Int -> ReadS CreateChannel
Prelude.Read, Int -> CreateChannel -> ShowS
[CreateChannel] -> ShowS
CreateChannel -> String
(Int -> CreateChannel -> ShowS)
-> (CreateChannel -> String)
-> ([CreateChannel] -> ShowS)
-> Show CreateChannel
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateChannel] -> ShowS
$cshowList :: [CreateChannel] -> ShowS
show :: CreateChannel -> String
$cshow :: CreateChannel -> String
showsPrec :: Int -> CreateChannel -> ShowS
$cshowsPrec :: Int -> CreateChannel -> ShowS
Prelude.Show, (forall x. CreateChannel -> Rep CreateChannel x)
-> (forall x. Rep CreateChannel x -> CreateChannel)
-> Generic CreateChannel
forall x. Rep CreateChannel x -> CreateChannel
forall x. CreateChannel -> Rep CreateChannel x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateChannel x -> CreateChannel
$cfrom :: forall x. CreateChannel -> Rep CreateChannel x
Prelude.Generic)

-- |
-- Create a value of 'CreateChannel' 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:
--
-- 'description', 'createChannel_description' - A short text description of the Channel.
--
-- 'tags', 'createChannel_tags' - Undocumented member.
--
-- 'id', 'createChannel_id' - The ID of the Channel. The ID must be unique within the region and it
-- cannot be changed after a Channel is created.
newCreateChannel ::
  -- | 'id'
  Prelude.Text ->
  CreateChannel
newCreateChannel :: Text -> CreateChannel
newCreateChannel Text
pId_ =
  CreateChannel' :: Maybe Text -> Maybe (HashMap Text Text) -> Text -> CreateChannel
CreateChannel'
    { $sel:description:CreateChannel' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:CreateChannel' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:id:CreateChannel' :: Text
id = Text
pId_
    }

-- | A short text description of the Channel.
createChannel_description :: Lens.Lens' CreateChannel (Prelude.Maybe Prelude.Text)
createChannel_description :: (Maybe Text -> f (Maybe Text)) -> CreateChannel -> f CreateChannel
createChannel_description = (CreateChannel -> Maybe Text)
-> (CreateChannel -> Maybe Text -> CreateChannel)
-> Lens CreateChannel CreateChannel (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateChannel' {Maybe Text
description :: Maybe Text
$sel:description:CreateChannel' :: CreateChannel -> Maybe Text
description} -> Maybe Text
description) (\s :: CreateChannel
s@CreateChannel' {} Maybe Text
a -> CreateChannel
s {$sel:description:CreateChannel' :: Maybe Text
description = Maybe Text
a} :: CreateChannel)

-- | Undocumented member.
createChannel_tags :: Lens.Lens' CreateChannel (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createChannel_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateChannel -> f CreateChannel
createChannel_tags = (CreateChannel -> Maybe (HashMap Text Text))
-> (CreateChannel -> Maybe (HashMap Text Text) -> CreateChannel)
-> Lens
     CreateChannel
     CreateChannel
     (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 (\CreateChannel' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:CreateChannel' :: CreateChannel -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: CreateChannel
s@CreateChannel' {} Maybe (HashMap Text Text)
a -> CreateChannel
s {$sel:tags:CreateChannel' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: CreateChannel) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> CreateChannel -> f CreateChannel)
-> ((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)))
-> CreateChannel
-> f CreateChannel
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 ID of the Channel. The ID must be unique within the region and it
-- cannot be changed after a Channel is created.
createChannel_id :: Lens.Lens' CreateChannel Prelude.Text
createChannel_id :: (Text -> f Text) -> CreateChannel -> f CreateChannel
createChannel_id = (CreateChannel -> Text)
-> (CreateChannel -> Text -> CreateChannel)
-> Lens CreateChannel CreateChannel Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateChannel' {Text
id :: Text
$sel:id:CreateChannel' :: CreateChannel -> Text
id} -> Text
id) (\s :: CreateChannel
s@CreateChannel' {} Text
a -> CreateChannel
s {$sel:id:CreateChannel' :: Text
id = Text
a} :: CreateChannel)

instance Core.AWSRequest CreateChannel where
  type
    AWSResponse CreateChannel =
      CreateChannelResponse
  request :: CreateChannel -> Request CreateChannel
request = Service -> CreateChannel -> Request CreateChannel
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateChannel
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateChannel)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateChannel))
-> Logger
-> Service
-> Proxy CreateChannel
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateChannel)))
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 IngressAccessLogs
-> Maybe HlsIngest
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe EgressAccessLogs
-> Maybe (HashMap Text Text)
-> Int
-> CreateChannelResponse
CreateChannelResponse'
            (Maybe IngressAccessLogs
 -> Maybe HlsIngest
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe EgressAccessLogs
 -> Maybe (HashMap Text Text)
 -> Int
 -> CreateChannelResponse)
-> Either String (Maybe IngressAccessLogs)
-> Either
     String
     (Maybe HlsIngest
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe EgressAccessLogs
      -> Maybe (HashMap Text Text)
      -> Int
      -> CreateChannelResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe IngressAccessLogs)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ingressAccessLogs")
            Either
  String
  (Maybe HlsIngest
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe EgressAccessLogs
   -> Maybe (HashMap Text Text)
   -> Int
   -> CreateChannelResponse)
-> Either String (Maybe HlsIngest)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe EgressAccessLogs
      -> Maybe (HashMap Text Text)
      -> Int
      -> CreateChannelResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe HlsIngest)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"hlsIngest")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe EgressAccessLogs
   -> Maybe (HashMap Text Text)
   -> Int
   -> CreateChannelResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe EgressAccessLogs
      -> Maybe (HashMap Text Text)
      -> Int
      -> CreateChannelResponse)
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 Text
   -> Maybe Text
   -> Maybe EgressAccessLogs
   -> Maybe (HashMap Text Text)
   -> Int
   -> CreateChannelResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe EgressAccessLogs
      -> Maybe (HashMap Text Text)
      -> Int
      -> CreateChannelResponse)
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
"id")
            Either
  String
  (Maybe Text
   -> Maybe EgressAccessLogs
   -> Maybe (HashMap Text Text)
   -> Int
   -> CreateChannelResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe EgressAccessLogs
      -> Maybe (HashMap Text Text) -> Int -> CreateChannelResponse)
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
"description")
            Either
  String
  (Maybe EgressAccessLogs
   -> Maybe (HashMap Text Text) -> Int -> CreateChannelResponse)
-> Either String (Maybe EgressAccessLogs)
-> Either
     String (Maybe (HashMap Text Text) -> Int -> CreateChannelResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe EgressAccessLogs)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"egressAccessLogs")
            Either
  String (Maybe (HashMap Text Text) -> Int -> CreateChannelResponse)
-> Either String (Maybe (HashMap Text Text))
-> Either String (Int -> CreateChannelResponse)
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 -> CreateChannelResponse)
-> Either String Int -> Either String CreateChannelResponse
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 CreateChannel

instance Prelude.NFData CreateChannel

instance Core.ToHeaders CreateChannel where
  toHeaders :: CreateChannel -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateChannel -> 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 CreateChannel where
  toJSON :: CreateChannel -> Value
toJSON CreateChannel' {Maybe Text
Maybe (HashMap Text Text)
Text
id :: Text
tags :: Maybe (HashMap Text Text)
description :: Maybe Text
$sel:id:CreateChannel' :: CreateChannel -> Text
$sel:tags:CreateChannel' :: CreateChannel -> Maybe (HashMap Text Text)
$sel:description:CreateChannel' :: CreateChannel -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"description" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
description,
            (Text
"tags" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
tags,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"id" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
id)
          ]
      )

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

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

-- | /See:/ 'newCreateChannelResponse' smart constructor.
data CreateChannelResponse = CreateChannelResponse'
  { CreateChannelResponse -> Maybe IngressAccessLogs
ingressAccessLogs :: Prelude.Maybe IngressAccessLogs,
    CreateChannelResponse -> Maybe HlsIngest
hlsIngest :: Prelude.Maybe HlsIngest,
    -- | The Amazon Resource Name (ARN) assigned to the Channel.
    CreateChannelResponse -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The ID of the Channel.
    CreateChannelResponse -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | A short text description of the Channel.
    CreateChannelResponse -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    CreateChannelResponse -> Maybe EgressAccessLogs
egressAccessLogs :: Prelude.Maybe EgressAccessLogs,
    CreateChannelResponse -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The response's http status code.
    CreateChannelResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateChannelResponse -> CreateChannelResponse -> Bool
(CreateChannelResponse -> CreateChannelResponse -> Bool)
-> (CreateChannelResponse -> CreateChannelResponse -> Bool)
-> Eq CreateChannelResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateChannelResponse -> CreateChannelResponse -> Bool
$c/= :: CreateChannelResponse -> CreateChannelResponse -> Bool
== :: CreateChannelResponse -> CreateChannelResponse -> Bool
$c== :: CreateChannelResponse -> CreateChannelResponse -> Bool
Prelude.Eq, ReadPrec [CreateChannelResponse]
ReadPrec CreateChannelResponse
Int -> ReadS CreateChannelResponse
ReadS [CreateChannelResponse]
(Int -> ReadS CreateChannelResponse)
-> ReadS [CreateChannelResponse]
-> ReadPrec CreateChannelResponse
-> ReadPrec [CreateChannelResponse]
-> Read CreateChannelResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateChannelResponse]
$creadListPrec :: ReadPrec [CreateChannelResponse]
readPrec :: ReadPrec CreateChannelResponse
$creadPrec :: ReadPrec CreateChannelResponse
readList :: ReadS [CreateChannelResponse]
$creadList :: ReadS [CreateChannelResponse]
readsPrec :: Int -> ReadS CreateChannelResponse
$creadsPrec :: Int -> ReadS CreateChannelResponse
Prelude.Read, Int -> CreateChannelResponse -> ShowS
[CreateChannelResponse] -> ShowS
CreateChannelResponse -> String
(Int -> CreateChannelResponse -> ShowS)
-> (CreateChannelResponse -> String)
-> ([CreateChannelResponse] -> ShowS)
-> Show CreateChannelResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateChannelResponse] -> ShowS
$cshowList :: [CreateChannelResponse] -> ShowS
show :: CreateChannelResponse -> String
$cshow :: CreateChannelResponse -> String
showsPrec :: Int -> CreateChannelResponse -> ShowS
$cshowsPrec :: Int -> CreateChannelResponse -> ShowS
Prelude.Show, (forall x. CreateChannelResponse -> Rep CreateChannelResponse x)
-> (forall x. Rep CreateChannelResponse x -> CreateChannelResponse)
-> Generic CreateChannelResponse
forall x. Rep CreateChannelResponse x -> CreateChannelResponse
forall x. CreateChannelResponse -> Rep CreateChannelResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateChannelResponse x -> CreateChannelResponse
$cfrom :: forall x. CreateChannelResponse -> Rep CreateChannelResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateChannelResponse' 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:
--
-- 'ingressAccessLogs', 'createChannelResponse_ingressAccessLogs' - Undocumented member.
--
-- 'hlsIngest', 'createChannelResponse_hlsIngest' - Undocumented member.
--
-- 'arn', 'createChannelResponse_arn' - The Amazon Resource Name (ARN) assigned to the Channel.
--
-- 'id', 'createChannelResponse_id' - The ID of the Channel.
--
-- 'description', 'createChannelResponse_description' - A short text description of the Channel.
--
-- 'egressAccessLogs', 'createChannelResponse_egressAccessLogs' - Undocumented member.
--
-- 'tags', 'createChannelResponse_tags' - Undocumented member.
--
-- 'httpStatus', 'createChannelResponse_httpStatus' - The response's http status code.
newCreateChannelResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateChannelResponse
newCreateChannelResponse :: Int -> CreateChannelResponse
newCreateChannelResponse Int
pHttpStatus_ =
  CreateChannelResponse' :: Maybe IngressAccessLogs
-> Maybe HlsIngest
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe EgressAccessLogs
-> Maybe (HashMap Text Text)
-> Int
-> CreateChannelResponse
CreateChannelResponse'
    { $sel:ingressAccessLogs:CreateChannelResponse' :: Maybe IngressAccessLogs
ingressAccessLogs =
        Maybe IngressAccessLogs
forall a. Maybe a
Prelude.Nothing,
      $sel:hlsIngest:CreateChannelResponse' :: Maybe HlsIngest
hlsIngest = Maybe HlsIngest
forall a. Maybe a
Prelude.Nothing,
      $sel:arn:CreateChannelResponse' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:id:CreateChannelResponse' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:description:CreateChannelResponse' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:egressAccessLogs:CreateChannelResponse' :: Maybe EgressAccessLogs
egressAccessLogs = Maybe EgressAccessLogs
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:CreateChannelResponse' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateChannelResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Undocumented member.
createChannelResponse_ingressAccessLogs :: Lens.Lens' CreateChannelResponse (Prelude.Maybe IngressAccessLogs)
createChannelResponse_ingressAccessLogs :: (Maybe IngressAccessLogs -> f (Maybe IngressAccessLogs))
-> CreateChannelResponse -> f CreateChannelResponse
createChannelResponse_ingressAccessLogs = (CreateChannelResponse -> Maybe IngressAccessLogs)
-> (CreateChannelResponse
    -> Maybe IngressAccessLogs -> CreateChannelResponse)
-> Lens
     CreateChannelResponse
     CreateChannelResponse
     (Maybe IngressAccessLogs)
     (Maybe IngressAccessLogs)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateChannelResponse' {Maybe IngressAccessLogs
ingressAccessLogs :: Maybe IngressAccessLogs
$sel:ingressAccessLogs:CreateChannelResponse' :: CreateChannelResponse -> Maybe IngressAccessLogs
ingressAccessLogs} -> Maybe IngressAccessLogs
ingressAccessLogs) (\s :: CreateChannelResponse
s@CreateChannelResponse' {} Maybe IngressAccessLogs
a -> CreateChannelResponse
s {$sel:ingressAccessLogs:CreateChannelResponse' :: Maybe IngressAccessLogs
ingressAccessLogs = Maybe IngressAccessLogs
a} :: CreateChannelResponse)

-- | Undocumented member.
createChannelResponse_hlsIngest :: Lens.Lens' CreateChannelResponse (Prelude.Maybe HlsIngest)
createChannelResponse_hlsIngest :: (Maybe HlsIngest -> f (Maybe HlsIngest))
-> CreateChannelResponse -> f CreateChannelResponse
createChannelResponse_hlsIngest = (CreateChannelResponse -> Maybe HlsIngest)
-> (CreateChannelResponse
    -> Maybe HlsIngest -> CreateChannelResponse)
-> Lens
     CreateChannelResponse
     CreateChannelResponse
     (Maybe HlsIngest)
     (Maybe HlsIngest)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateChannelResponse' {Maybe HlsIngest
hlsIngest :: Maybe HlsIngest
$sel:hlsIngest:CreateChannelResponse' :: CreateChannelResponse -> Maybe HlsIngest
hlsIngest} -> Maybe HlsIngest
hlsIngest) (\s :: CreateChannelResponse
s@CreateChannelResponse' {} Maybe HlsIngest
a -> CreateChannelResponse
s {$sel:hlsIngest:CreateChannelResponse' :: Maybe HlsIngest
hlsIngest = Maybe HlsIngest
a} :: CreateChannelResponse)

-- | The Amazon Resource Name (ARN) assigned to the Channel.
createChannelResponse_arn :: Lens.Lens' CreateChannelResponse (Prelude.Maybe Prelude.Text)
createChannelResponse_arn :: (Maybe Text -> f (Maybe Text))
-> CreateChannelResponse -> f CreateChannelResponse
createChannelResponse_arn = (CreateChannelResponse -> Maybe Text)
-> (CreateChannelResponse -> Maybe Text -> CreateChannelResponse)
-> Lens
     CreateChannelResponse
     CreateChannelResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateChannelResponse' {Maybe Text
arn :: Maybe Text
$sel:arn:CreateChannelResponse' :: CreateChannelResponse -> Maybe Text
arn} -> Maybe Text
arn) (\s :: CreateChannelResponse
s@CreateChannelResponse' {} Maybe Text
a -> CreateChannelResponse
s {$sel:arn:CreateChannelResponse' :: Maybe Text
arn = Maybe Text
a} :: CreateChannelResponse)

-- | The ID of the Channel.
createChannelResponse_id :: Lens.Lens' CreateChannelResponse (Prelude.Maybe Prelude.Text)
createChannelResponse_id :: (Maybe Text -> f (Maybe Text))
-> CreateChannelResponse -> f CreateChannelResponse
createChannelResponse_id = (CreateChannelResponse -> Maybe Text)
-> (CreateChannelResponse -> Maybe Text -> CreateChannelResponse)
-> Lens
     CreateChannelResponse
     CreateChannelResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateChannelResponse' {Maybe Text
id :: Maybe Text
$sel:id:CreateChannelResponse' :: CreateChannelResponse -> Maybe Text
id} -> Maybe Text
id) (\s :: CreateChannelResponse
s@CreateChannelResponse' {} Maybe Text
a -> CreateChannelResponse
s {$sel:id:CreateChannelResponse' :: Maybe Text
id = Maybe Text
a} :: CreateChannelResponse)

-- | A short text description of the Channel.
createChannelResponse_description :: Lens.Lens' CreateChannelResponse (Prelude.Maybe Prelude.Text)
createChannelResponse_description :: (Maybe Text -> f (Maybe Text))
-> CreateChannelResponse -> f CreateChannelResponse
createChannelResponse_description = (CreateChannelResponse -> Maybe Text)
-> (CreateChannelResponse -> Maybe Text -> CreateChannelResponse)
-> Lens
     CreateChannelResponse
     CreateChannelResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateChannelResponse' {Maybe Text
description :: Maybe Text
$sel:description:CreateChannelResponse' :: CreateChannelResponse -> Maybe Text
description} -> Maybe Text
description) (\s :: CreateChannelResponse
s@CreateChannelResponse' {} Maybe Text
a -> CreateChannelResponse
s {$sel:description:CreateChannelResponse' :: Maybe Text
description = Maybe Text
a} :: CreateChannelResponse)

-- | Undocumented member.
createChannelResponse_egressAccessLogs :: Lens.Lens' CreateChannelResponse (Prelude.Maybe EgressAccessLogs)
createChannelResponse_egressAccessLogs :: (Maybe EgressAccessLogs -> f (Maybe EgressAccessLogs))
-> CreateChannelResponse -> f CreateChannelResponse
createChannelResponse_egressAccessLogs = (CreateChannelResponse -> Maybe EgressAccessLogs)
-> (CreateChannelResponse
    -> Maybe EgressAccessLogs -> CreateChannelResponse)
-> Lens
     CreateChannelResponse
     CreateChannelResponse
     (Maybe EgressAccessLogs)
     (Maybe EgressAccessLogs)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateChannelResponse' {Maybe EgressAccessLogs
egressAccessLogs :: Maybe EgressAccessLogs
$sel:egressAccessLogs:CreateChannelResponse' :: CreateChannelResponse -> Maybe EgressAccessLogs
egressAccessLogs} -> Maybe EgressAccessLogs
egressAccessLogs) (\s :: CreateChannelResponse
s@CreateChannelResponse' {} Maybe EgressAccessLogs
a -> CreateChannelResponse
s {$sel:egressAccessLogs:CreateChannelResponse' :: Maybe EgressAccessLogs
egressAccessLogs = Maybe EgressAccessLogs
a} :: CreateChannelResponse)

-- | Undocumented member.
createChannelResponse_tags :: Lens.Lens' CreateChannelResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createChannelResponse_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateChannelResponse -> f CreateChannelResponse
createChannelResponse_tags = (CreateChannelResponse -> Maybe (HashMap Text Text))
-> (CreateChannelResponse
    -> Maybe (HashMap Text Text) -> CreateChannelResponse)
-> Lens
     CreateChannelResponse
     CreateChannelResponse
     (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 (\CreateChannelResponse' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:CreateChannelResponse' :: CreateChannelResponse -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: CreateChannelResponse
s@CreateChannelResponse' {} Maybe (HashMap Text Text)
a -> CreateChannelResponse
s {$sel:tags:CreateChannelResponse' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: CreateChannelResponse) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> CreateChannelResponse -> f CreateChannelResponse)
-> ((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)))
-> CreateChannelResponse
-> f CreateChannelResponse
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.
createChannelResponse_httpStatus :: Lens.Lens' CreateChannelResponse Prelude.Int
createChannelResponse_httpStatus :: (Int -> f Int) -> CreateChannelResponse -> f CreateChannelResponse
createChannelResponse_httpStatus = (CreateChannelResponse -> Int)
-> (CreateChannelResponse -> Int -> CreateChannelResponse)
-> Lens CreateChannelResponse CreateChannelResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateChannelResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateChannelResponse' :: CreateChannelResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateChannelResponse
s@CreateChannelResponse' {} Int
a -> CreateChannelResponse
s {$sel:httpStatus:CreateChannelResponse' :: Int
httpStatus = Int
a} :: CreateChannelResponse)

instance Prelude.NFData CreateChannelResponse