{-# 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.IoTAnalytics.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)
--
-- Used to create a channel. A channel collects data from an MQTT topic and
-- archives the raw, unprocessed messages before publishing the data to a
-- pipeline.
module Amazonka.IoTAnalytics.CreateChannel
  ( -- * Creating a Request
    CreateChannel (..),
    newCreateChannel,

    -- * Request Lenses
    createChannel_retentionPeriod,
    createChannel_channelStorage,
    createChannel_tags,
    createChannel_channelName,

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

    -- * Response Lenses
    createChannelResponse_channelArn,
    createChannelResponse_retentionPeriod,
    createChannelResponse_channelName,
    createChannelResponse_httpStatus,
  )
where

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

-- | /See:/ 'newCreateChannel' smart constructor.
data CreateChannel = CreateChannel'
  { -- | How long, in days, message data is kept for the channel. When
    -- @customerManagedS3@ storage is selected, this parameter is ignored.
    CreateChannel -> Maybe RetentionPeriod
retentionPeriod :: Prelude.Maybe RetentionPeriod,
    -- | Where channel data is stored. You can choose one of @serviceManagedS3@
    -- or @customerManagedS3@ storage. If not specified, the default is
    -- @serviceManagedS3@. You can\'t change this storage option after the
    -- channel is created.
    CreateChannel -> Maybe ChannelStorage
channelStorage :: Prelude.Maybe ChannelStorage,
    -- | Metadata which can be used to manage the channel.
    CreateChannel -> Maybe (NonEmpty Tag)
tags :: Prelude.Maybe (Prelude.NonEmpty Tag),
    -- | The name of the channel.
    CreateChannel -> Text
channelName :: 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:
--
-- 'retentionPeriod', 'createChannel_retentionPeriod' - How long, in days, message data is kept for the channel. When
-- @customerManagedS3@ storage is selected, this parameter is ignored.
--
-- 'channelStorage', 'createChannel_channelStorage' - Where channel data is stored. You can choose one of @serviceManagedS3@
-- or @customerManagedS3@ storage. If not specified, the default is
-- @serviceManagedS3@. You can\'t change this storage option after the
-- channel is created.
--
-- 'tags', 'createChannel_tags' - Metadata which can be used to manage the channel.
--
-- 'channelName', 'createChannel_channelName' - The name of the channel.
newCreateChannel ::
  -- | 'channelName'
  Prelude.Text ->
  CreateChannel
newCreateChannel :: Text -> CreateChannel
newCreateChannel Text
pChannelName_ =
  CreateChannel' :: Maybe RetentionPeriod
-> Maybe ChannelStorage
-> Maybe (NonEmpty Tag)
-> Text
-> CreateChannel
CreateChannel'
    { $sel:retentionPeriod:CreateChannel' :: Maybe RetentionPeriod
retentionPeriod = Maybe RetentionPeriod
forall a. Maybe a
Prelude.Nothing,
      $sel:channelStorage:CreateChannel' :: Maybe ChannelStorage
channelStorage = Maybe ChannelStorage
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:CreateChannel' :: Maybe (NonEmpty Tag)
tags = Maybe (NonEmpty Tag)
forall a. Maybe a
Prelude.Nothing,
      $sel:channelName:CreateChannel' :: Text
channelName = Text
pChannelName_
    }

-- | How long, in days, message data is kept for the channel. When
-- @customerManagedS3@ storage is selected, this parameter is ignored.
createChannel_retentionPeriod :: Lens.Lens' CreateChannel (Prelude.Maybe RetentionPeriod)
createChannel_retentionPeriod :: (Maybe RetentionPeriod -> f (Maybe RetentionPeriod))
-> CreateChannel -> f CreateChannel
createChannel_retentionPeriod = (CreateChannel -> Maybe RetentionPeriod)
-> (CreateChannel -> Maybe RetentionPeriod -> CreateChannel)
-> Lens
     CreateChannel
     CreateChannel
     (Maybe RetentionPeriod)
     (Maybe RetentionPeriod)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateChannel' {Maybe RetentionPeriod
retentionPeriod :: Maybe RetentionPeriod
$sel:retentionPeriod:CreateChannel' :: CreateChannel -> Maybe RetentionPeriod
retentionPeriod} -> Maybe RetentionPeriod
retentionPeriod) (\s :: CreateChannel
s@CreateChannel' {} Maybe RetentionPeriod
a -> CreateChannel
s {$sel:retentionPeriod:CreateChannel' :: Maybe RetentionPeriod
retentionPeriod = Maybe RetentionPeriod
a} :: CreateChannel)

-- | Where channel data is stored. You can choose one of @serviceManagedS3@
-- or @customerManagedS3@ storage. If not specified, the default is
-- @serviceManagedS3@. You can\'t change this storage option after the
-- channel is created.
createChannel_channelStorage :: Lens.Lens' CreateChannel (Prelude.Maybe ChannelStorage)
createChannel_channelStorage :: (Maybe ChannelStorage -> f (Maybe ChannelStorage))
-> CreateChannel -> f CreateChannel
createChannel_channelStorage = (CreateChannel -> Maybe ChannelStorage)
-> (CreateChannel -> Maybe ChannelStorage -> CreateChannel)
-> Lens
     CreateChannel
     CreateChannel
     (Maybe ChannelStorage)
     (Maybe ChannelStorage)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateChannel' {Maybe ChannelStorage
channelStorage :: Maybe ChannelStorage
$sel:channelStorage:CreateChannel' :: CreateChannel -> Maybe ChannelStorage
channelStorage} -> Maybe ChannelStorage
channelStorage) (\s :: CreateChannel
s@CreateChannel' {} Maybe ChannelStorage
a -> CreateChannel
s {$sel:channelStorage:CreateChannel' :: Maybe ChannelStorage
channelStorage = Maybe ChannelStorage
a} :: CreateChannel)

-- | Metadata which can be used to manage the channel.
createChannel_tags :: Lens.Lens' CreateChannel (Prelude.Maybe (Prelude.NonEmpty Tag))
createChannel_tags :: (Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> CreateChannel -> f CreateChannel
createChannel_tags = (CreateChannel -> Maybe (NonEmpty Tag))
-> (CreateChannel -> Maybe (NonEmpty Tag) -> CreateChannel)
-> Lens
     CreateChannel
     CreateChannel
     (Maybe (NonEmpty Tag))
     (Maybe (NonEmpty Tag))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateChannel' {Maybe (NonEmpty Tag)
tags :: Maybe (NonEmpty Tag)
$sel:tags:CreateChannel' :: CreateChannel -> Maybe (NonEmpty Tag)
tags} -> Maybe (NonEmpty Tag)
tags) (\s :: CreateChannel
s@CreateChannel' {} Maybe (NonEmpty Tag)
a -> CreateChannel
s {$sel:tags:CreateChannel' :: Maybe (NonEmpty Tag)
tags = Maybe (NonEmpty Tag)
a} :: CreateChannel) ((Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
 -> CreateChannel -> f CreateChannel)
-> ((Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
    -> Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> (Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> CreateChannel
-> f CreateChannel
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag)
-> Iso
     (Maybe (NonEmpty Tag))
     (Maybe (NonEmpty Tag))
     (Maybe (NonEmpty Tag))
     (Maybe (NonEmpty Tag))
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 (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The name of the channel.
createChannel_channelName :: Lens.Lens' CreateChannel Prelude.Text
createChannel_channelName :: (Text -> f Text) -> CreateChannel -> f CreateChannel
createChannel_channelName = (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
channelName :: Text
$sel:channelName:CreateChannel' :: CreateChannel -> Text
channelName} -> Text
channelName) (\s :: CreateChannel
s@CreateChannel' {} Text
a -> CreateChannel
s {$sel:channelName:CreateChannel' :: Text
channelName = 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 Text
-> Maybe RetentionPeriod
-> Maybe Text
-> Int
-> CreateChannelResponse
CreateChannelResponse'
            (Maybe Text
 -> Maybe RetentionPeriod
 -> Maybe Text
 -> Int
 -> CreateChannelResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe RetentionPeriod
      -> Maybe Text -> Int -> CreateChannelResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"channelArn")
            Either
  String
  (Maybe RetentionPeriod
   -> Maybe Text -> Int -> CreateChannelResponse)
-> Either String (Maybe RetentionPeriod)
-> Either String (Maybe Text -> Int -> CreateChannelResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe RetentionPeriod)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"retentionPeriod")
            Either String (Maybe Text -> Int -> CreateChannelResponse)
-> Either String (Maybe 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 Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"channelName")
            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
forall a. Monoid a => a
Prelude.mempty

instance Core.ToJSON CreateChannel where
  toJSON :: CreateChannel -> Value
toJSON CreateChannel' {Maybe (NonEmpty Tag)
Maybe RetentionPeriod
Maybe ChannelStorage
Text
channelName :: Text
tags :: Maybe (NonEmpty Tag)
channelStorage :: Maybe ChannelStorage
retentionPeriod :: Maybe RetentionPeriod
$sel:channelName:CreateChannel' :: CreateChannel -> Text
$sel:tags:CreateChannel' :: CreateChannel -> Maybe (NonEmpty Tag)
$sel:channelStorage:CreateChannel' :: CreateChannel -> Maybe ChannelStorage
$sel:retentionPeriod:CreateChannel' :: CreateChannel -> Maybe RetentionPeriod
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"retentionPeriod" Text -> RetentionPeriod -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (RetentionPeriod -> Pair) -> Maybe RetentionPeriod -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe RetentionPeriod
retentionPeriod,
            (Text
"channelStorage" Text -> ChannelStorage -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (ChannelStorage -> Pair) -> Maybe ChannelStorage -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ChannelStorage
channelStorage,
            (Text
"tags" Text -> NonEmpty Tag -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (NonEmpty Tag -> Pair) -> Maybe (NonEmpty Tag) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty Tag)
tags,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"channelName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
channelName)
          ]
      )

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'
  { -- | The ARN of the channel.
    CreateChannelResponse -> Maybe Text
channelArn :: Prelude.Maybe Prelude.Text,
    -- | How long, in days, message data is kept for the channel.
    CreateChannelResponse -> Maybe RetentionPeriod
retentionPeriod :: Prelude.Maybe RetentionPeriod,
    -- | The name of the channel.
    CreateChannelResponse -> Maybe Text
channelName :: Prelude.Maybe 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:
--
-- 'channelArn', 'createChannelResponse_channelArn' - The ARN of the channel.
--
-- 'retentionPeriod', 'createChannelResponse_retentionPeriod' - How long, in days, message data is kept for the channel.
--
-- 'channelName', 'createChannelResponse_channelName' - The name of the channel.
--
-- 'httpStatus', 'createChannelResponse_httpStatus' - The response's http status code.
newCreateChannelResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateChannelResponse
newCreateChannelResponse :: Int -> CreateChannelResponse
newCreateChannelResponse Int
pHttpStatus_ =
  CreateChannelResponse' :: Maybe Text
-> Maybe RetentionPeriod
-> Maybe Text
-> Int
-> CreateChannelResponse
CreateChannelResponse'
    { $sel:channelArn:CreateChannelResponse' :: Maybe Text
channelArn =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:retentionPeriod:CreateChannelResponse' :: Maybe RetentionPeriod
retentionPeriod = Maybe RetentionPeriod
forall a. Maybe a
Prelude.Nothing,
      $sel:channelName:CreateChannelResponse' :: Maybe Text
channelName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateChannelResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The ARN of the channel.
createChannelResponse_channelArn :: Lens.Lens' CreateChannelResponse (Prelude.Maybe Prelude.Text)
createChannelResponse_channelArn :: (Maybe Text -> f (Maybe Text))
-> CreateChannelResponse -> f CreateChannelResponse
createChannelResponse_channelArn = (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
channelArn :: Maybe Text
$sel:channelArn:CreateChannelResponse' :: CreateChannelResponse -> Maybe Text
channelArn} -> Maybe Text
channelArn) (\s :: CreateChannelResponse
s@CreateChannelResponse' {} Maybe Text
a -> CreateChannelResponse
s {$sel:channelArn:CreateChannelResponse' :: Maybe Text
channelArn = Maybe Text
a} :: CreateChannelResponse)

-- | How long, in days, message data is kept for the channel.
createChannelResponse_retentionPeriod :: Lens.Lens' CreateChannelResponse (Prelude.Maybe RetentionPeriod)
createChannelResponse_retentionPeriod :: (Maybe RetentionPeriod -> f (Maybe RetentionPeriod))
-> CreateChannelResponse -> f CreateChannelResponse
createChannelResponse_retentionPeriod = (CreateChannelResponse -> Maybe RetentionPeriod)
-> (CreateChannelResponse
    -> Maybe RetentionPeriod -> CreateChannelResponse)
-> Lens
     CreateChannelResponse
     CreateChannelResponse
     (Maybe RetentionPeriod)
     (Maybe RetentionPeriod)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateChannelResponse' {Maybe RetentionPeriod
retentionPeriod :: Maybe RetentionPeriod
$sel:retentionPeriod:CreateChannelResponse' :: CreateChannelResponse -> Maybe RetentionPeriod
retentionPeriod} -> Maybe RetentionPeriod
retentionPeriod) (\s :: CreateChannelResponse
s@CreateChannelResponse' {} Maybe RetentionPeriod
a -> CreateChannelResponse
s {$sel:retentionPeriod:CreateChannelResponse' :: Maybe RetentionPeriod
retentionPeriod = Maybe RetentionPeriod
a} :: CreateChannelResponse)

-- | The name of the channel.
createChannelResponse_channelName :: Lens.Lens' CreateChannelResponse (Prelude.Maybe Prelude.Text)
createChannelResponse_channelName :: (Maybe Text -> f (Maybe Text))
-> CreateChannelResponse -> f CreateChannelResponse
createChannelResponse_channelName = (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
channelName :: Maybe Text
$sel:channelName:CreateChannelResponse' :: CreateChannelResponse -> Maybe Text
channelName} -> Maybe Text
channelName) (\s :: CreateChannelResponse
s@CreateChannelResponse' {} Maybe Text
a -> CreateChannelResponse
s {$sel:channelName:CreateChannelResponse' :: Maybe Text
channelName = Maybe Text
a} :: CreateChannelResponse)

-- | 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