{-# 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 #-}
module Amazonka.IoTAnalytics.UpdateChannel
(
UpdateChannel (..),
newUpdateChannel,
updateChannel_channelStorage,
updateChannel_retentionPeriod,
updateChannel_channelName,
UpdateChannelResponse (..),
newUpdateChannelResponse,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.IoTAnalytics.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data UpdateChannel = UpdateChannel'
{
UpdateChannel -> Maybe ChannelStorage
channelStorage :: Prelude.Maybe ChannelStorage,
UpdateChannel -> Maybe RetentionPeriod
retentionPeriod :: Prelude.Maybe RetentionPeriod,
UpdateChannel -> Text
channelName :: Prelude.Text
}
deriving (UpdateChannel -> UpdateChannel -> Bool
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]
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
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. 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)
newUpdateChannel ::
Prelude.Text ->
UpdateChannel
newUpdateChannel :: Text -> UpdateChannel
newUpdateChannel Text
pChannelName_ =
UpdateChannel'
{ $sel:channelStorage:UpdateChannel' :: Maybe ChannelStorage
channelStorage = forall a. Maybe a
Prelude.Nothing,
$sel:retentionPeriod:UpdateChannel' :: Maybe RetentionPeriod
retentionPeriod = forall a. Maybe a
Prelude.Nothing,
$sel:channelName:UpdateChannel' :: Text
channelName = Text
pChannelName_
}
updateChannel_channelStorage :: Lens.Lens' UpdateChannel (Prelude.Maybe ChannelStorage)
updateChannel_channelStorage :: Lens' UpdateChannel (Maybe ChannelStorage)
updateChannel_channelStorage = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateChannel' {Maybe ChannelStorage
channelStorage :: Maybe ChannelStorage
$sel:channelStorage:UpdateChannel' :: UpdateChannel -> Maybe ChannelStorage
channelStorage} -> Maybe ChannelStorage
channelStorage) (\s :: UpdateChannel
s@UpdateChannel' {} Maybe ChannelStorage
a -> UpdateChannel
s {$sel:channelStorage:UpdateChannel' :: Maybe ChannelStorage
channelStorage = Maybe ChannelStorage
a} :: UpdateChannel)
updateChannel_retentionPeriod :: Lens.Lens' UpdateChannel (Prelude.Maybe RetentionPeriod)
updateChannel_retentionPeriod :: Lens' UpdateChannel (Maybe RetentionPeriod)
updateChannel_retentionPeriod = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateChannel' {Maybe RetentionPeriod
retentionPeriod :: Maybe RetentionPeriod
$sel:retentionPeriod:UpdateChannel' :: UpdateChannel -> Maybe RetentionPeriod
retentionPeriod} -> Maybe RetentionPeriod
retentionPeriod) (\s :: UpdateChannel
s@UpdateChannel' {} Maybe RetentionPeriod
a -> UpdateChannel
s {$sel:retentionPeriod:UpdateChannel' :: Maybe RetentionPeriod
retentionPeriod = Maybe RetentionPeriod
a} :: UpdateChannel)
updateChannel_channelName :: Lens.Lens' UpdateChannel Prelude.Text
updateChannel_channelName :: Lens' UpdateChannel Text
updateChannel_channelName = 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)
instance Core.AWSRequest UpdateChannel where
type
AWSResponse UpdateChannel =
UpdateChannelResponse
request :: (Service -> Service) -> UpdateChannel -> Request UpdateChannel
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy UpdateChannel
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateChannel)))
response =
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull UpdateChannelResponse
UpdateChannelResponse'
instance Prelude.Hashable UpdateChannel where
hashWithSalt :: Int -> UpdateChannel -> Int
hashWithSalt Int
_salt UpdateChannel' {Maybe RetentionPeriod
Maybe ChannelStorage
Text
channelName :: Text
retentionPeriod :: Maybe RetentionPeriod
channelStorage :: Maybe ChannelStorage
$sel:channelName:UpdateChannel' :: UpdateChannel -> Text
$sel:retentionPeriod:UpdateChannel' :: UpdateChannel -> Maybe RetentionPeriod
$sel:channelStorage:UpdateChannel' :: UpdateChannel -> Maybe ChannelStorage
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ChannelStorage
channelStorage
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe RetentionPeriod
retentionPeriod
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
channelName
instance Prelude.NFData UpdateChannel where
rnf :: UpdateChannel -> ()
rnf UpdateChannel' {Maybe RetentionPeriod
Maybe ChannelStorage
Text
channelName :: Text
retentionPeriod :: Maybe RetentionPeriod
channelStorage :: Maybe ChannelStorage
$sel:channelName:UpdateChannel' :: UpdateChannel -> Text
$sel:retentionPeriod:UpdateChannel' :: UpdateChannel -> Maybe RetentionPeriod
$sel:channelStorage:UpdateChannel' :: UpdateChannel -> Maybe ChannelStorage
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe ChannelStorage
channelStorage
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe RetentionPeriod
retentionPeriod
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
channelName
instance Data.ToHeaders UpdateChannel where
toHeaders :: UpdateChannel -> [Header]
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToJSON UpdateChannel where
toJSON :: UpdateChannel -> Value
toJSON UpdateChannel' {Maybe RetentionPeriod
Maybe ChannelStorage
Text
channelName :: Text
retentionPeriod :: Maybe RetentionPeriod
channelStorage :: Maybe ChannelStorage
$sel:channelName:UpdateChannel' :: UpdateChannel -> Text
$sel:retentionPeriod:UpdateChannel' :: UpdateChannel -> Maybe RetentionPeriod
$sel:channelStorage:UpdateChannel' :: UpdateChannel -> Maybe ChannelStorage
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"channelStorage" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ChannelStorage
channelStorage,
(Key
"retentionPeriod" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe RetentionPeriod
retentionPeriod
]
)
instance Data.ToPath UpdateChannel where
toPath :: UpdateChannel -> ByteString
toPath UpdateChannel' {Maybe RetentionPeriod
Maybe ChannelStorage
Text
channelName :: Text
retentionPeriod :: Maybe RetentionPeriod
channelStorage :: Maybe ChannelStorage
$sel:channelName:UpdateChannel' :: UpdateChannel -> Text
$sel:retentionPeriod:UpdateChannel' :: UpdateChannel -> Maybe RetentionPeriod
$sel:channelStorage:UpdateChannel' :: UpdateChannel -> Maybe ChannelStorage
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/channels/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
channelName]
instance Data.ToQuery UpdateChannel where
toQuery :: UpdateChannel -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data UpdateChannelResponse = UpdateChannelResponse'
{
}
deriving (UpdateChannelResponse -> UpdateChannelResponse -> Bool
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]
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
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. 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)
newUpdateChannelResponse ::
UpdateChannelResponse
newUpdateChannelResponse :: UpdateChannelResponse
newUpdateChannelResponse = UpdateChannelResponse
UpdateChannelResponse'
instance Prelude.NFData UpdateChannelResponse where
rnf :: UpdateChannelResponse -> ()
rnf UpdateChannelResponse
_ = ()