{-# 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.Kinesis.MergeShards
(
MergeShards (..),
newMergeShards,
mergeShards_streamName,
mergeShards_shardToMerge,
mergeShards_adjacentShardToMerge,
MergeShardsResponse (..),
newMergeShardsResponse,
)
where
import qualified Amazonka.Core as Core
import Amazonka.Kinesis.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
data MergeShards = MergeShards'
{
MergeShards -> Text
streamName :: Prelude.Text,
MergeShards -> Text
shardToMerge :: Prelude.Text,
MergeShards -> Text
adjacentShardToMerge :: Prelude.Text
}
deriving (MergeShards -> MergeShards -> Bool
(MergeShards -> MergeShards -> Bool)
-> (MergeShards -> MergeShards -> Bool) -> Eq MergeShards
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MergeShards -> MergeShards -> Bool
$c/= :: MergeShards -> MergeShards -> Bool
== :: MergeShards -> MergeShards -> Bool
$c== :: MergeShards -> MergeShards -> Bool
Prelude.Eq, ReadPrec [MergeShards]
ReadPrec MergeShards
Int -> ReadS MergeShards
ReadS [MergeShards]
(Int -> ReadS MergeShards)
-> ReadS [MergeShards]
-> ReadPrec MergeShards
-> ReadPrec [MergeShards]
-> Read MergeShards
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MergeShards]
$creadListPrec :: ReadPrec [MergeShards]
readPrec :: ReadPrec MergeShards
$creadPrec :: ReadPrec MergeShards
readList :: ReadS [MergeShards]
$creadList :: ReadS [MergeShards]
readsPrec :: Int -> ReadS MergeShards
$creadsPrec :: Int -> ReadS MergeShards
Prelude.Read, Int -> MergeShards -> ShowS
[MergeShards] -> ShowS
MergeShards -> String
(Int -> MergeShards -> ShowS)
-> (MergeShards -> String)
-> ([MergeShards] -> ShowS)
-> Show MergeShards
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MergeShards] -> ShowS
$cshowList :: [MergeShards] -> ShowS
show :: MergeShards -> String
$cshow :: MergeShards -> String
showsPrec :: Int -> MergeShards -> ShowS
$cshowsPrec :: Int -> MergeShards -> ShowS
Prelude.Show, (forall x. MergeShards -> Rep MergeShards x)
-> (forall x. Rep MergeShards x -> MergeShards)
-> Generic MergeShards
forall x. Rep MergeShards x -> MergeShards
forall x. MergeShards -> Rep MergeShards x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MergeShards x -> MergeShards
$cfrom :: forall x. MergeShards -> Rep MergeShards x
Prelude.Generic)
newMergeShards ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
MergeShards
newMergeShards :: Text -> Text -> Text -> MergeShards
newMergeShards
Text
pStreamName_
Text
pShardToMerge_
Text
pAdjacentShardToMerge_ =
MergeShards' :: Text -> Text -> Text -> MergeShards
MergeShards'
{ $sel:streamName:MergeShards' :: Text
streamName = Text
pStreamName_,
$sel:shardToMerge:MergeShards' :: Text
shardToMerge = Text
pShardToMerge_,
$sel:adjacentShardToMerge:MergeShards' :: Text
adjacentShardToMerge = Text
pAdjacentShardToMerge_
}
mergeShards_streamName :: Lens.Lens' MergeShards Prelude.Text
mergeShards_streamName :: (Text -> f Text) -> MergeShards -> f MergeShards
mergeShards_streamName = (MergeShards -> Text)
-> (MergeShards -> Text -> MergeShards)
-> Lens MergeShards MergeShards Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MergeShards' {Text
streamName :: Text
$sel:streamName:MergeShards' :: MergeShards -> Text
streamName} -> Text
streamName) (\s :: MergeShards
s@MergeShards' {} Text
a -> MergeShards
s {$sel:streamName:MergeShards' :: Text
streamName = Text
a} :: MergeShards)
mergeShards_shardToMerge :: Lens.Lens' MergeShards Prelude.Text
mergeShards_shardToMerge :: (Text -> f Text) -> MergeShards -> f MergeShards
mergeShards_shardToMerge = (MergeShards -> Text)
-> (MergeShards -> Text -> MergeShards)
-> Lens MergeShards MergeShards Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MergeShards' {Text
shardToMerge :: Text
$sel:shardToMerge:MergeShards' :: MergeShards -> Text
shardToMerge} -> Text
shardToMerge) (\s :: MergeShards
s@MergeShards' {} Text
a -> MergeShards
s {$sel:shardToMerge:MergeShards' :: Text
shardToMerge = Text
a} :: MergeShards)
mergeShards_adjacentShardToMerge :: Lens.Lens' MergeShards Prelude.Text
mergeShards_adjacentShardToMerge :: (Text -> f Text) -> MergeShards -> f MergeShards
mergeShards_adjacentShardToMerge = (MergeShards -> Text)
-> (MergeShards -> Text -> MergeShards)
-> Lens MergeShards MergeShards Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MergeShards' {Text
adjacentShardToMerge :: Text
$sel:adjacentShardToMerge:MergeShards' :: MergeShards -> Text
adjacentShardToMerge} -> Text
adjacentShardToMerge) (\s :: MergeShards
s@MergeShards' {} Text
a -> MergeShards
s {$sel:adjacentShardToMerge:MergeShards' :: Text
adjacentShardToMerge = Text
a} :: MergeShards)
instance Core.AWSRequest MergeShards where
type AWSResponse MergeShards = MergeShardsResponse
request :: MergeShards -> Request MergeShards
request = Service -> MergeShards -> Request MergeShards
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy MergeShards
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse MergeShards)))
response = AWSResponse MergeShards
-> Logger
-> Service
-> Proxy MergeShards
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse MergeShards)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse MergeShards
MergeShardsResponse
MergeShardsResponse'
instance Prelude.Hashable MergeShards
instance Prelude.NFData MergeShards
instance Core.ToHeaders MergeShards where
toHeaders :: MergeShards -> [Header]
toHeaders =
[Header] -> MergeShards -> [Header]
forall a b. a -> b -> a
Prelude.const
( [[Header]] -> [Header]
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"Kinesis_20131202.MergeShards" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON MergeShards where
toJSON :: MergeShards -> Value
toJSON MergeShards' {Text
adjacentShardToMerge :: Text
shardToMerge :: Text
streamName :: Text
$sel:adjacentShardToMerge:MergeShards' :: MergeShards -> Text
$sel:shardToMerge:MergeShards' :: MergeShards -> Text
$sel:streamName:MergeShards' :: MergeShards -> 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
"StreamName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
streamName),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ShardToMerge" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
shardToMerge),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Text
"AdjacentShardToMerge"
Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
adjacentShardToMerge
)
]
)
instance Core.ToPath MergeShards where
toPath :: MergeShards -> ByteString
toPath = ByteString -> MergeShards -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery MergeShards where
toQuery :: MergeShards -> QueryString
toQuery = QueryString -> MergeShards -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data MergeShardsResponse = MergeShardsResponse'
{
}
deriving (MergeShardsResponse -> MergeShardsResponse -> Bool
(MergeShardsResponse -> MergeShardsResponse -> Bool)
-> (MergeShardsResponse -> MergeShardsResponse -> Bool)
-> Eq MergeShardsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MergeShardsResponse -> MergeShardsResponse -> Bool
$c/= :: MergeShardsResponse -> MergeShardsResponse -> Bool
== :: MergeShardsResponse -> MergeShardsResponse -> Bool
$c== :: MergeShardsResponse -> MergeShardsResponse -> Bool
Prelude.Eq, ReadPrec [MergeShardsResponse]
ReadPrec MergeShardsResponse
Int -> ReadS MergeShardsResponse
ReadS [MergeShardsResponse]
(Int -> ReadS MergeShardsResponse)
-> ReadS [MergeShardsResponse]
-> ReadPrec MergeShardsResponse
-> ReadPrec [MergeShardsResponse]
-> Read MergeShardsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MergeShardsResponse]
$creadListPrec :: ReadPrec [MergeShardsResponse]
readPrec :: ReadPrec MergeShardsResponse
$creadPrec :: ReadPrec MergeShardsResponse
readList :: ReadS [MergeShardsResponse]
$creadList :: ReadS [MergeShardsResponse]
readsPrec :: Int -> ReadS MergeShardsResponse
$creadsPrec :: Int -> ReadS MergeShardsResponse
Prelude.Read, Int -> MergeShardsResponse -> ShowS
[MergeShardsResponse] -> ShowS
MergeShardsResponse -> String
(Int -> MergeShardsResponse -> ShowS)
-> (MergeShardsResponse -> String)
-> ([MergeShardsResponse] -> ShowS)
-> Show MergeShardsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MergeShardsResponse] -> ShowS
$cshowList :: [MergeShardsResponse] -> ShowS
show :: MergeShardsResponse -> String
$cshow :: MergeShardsResponse -> String
showsPrec :: Int -> MergeShardsResponse -> ShowS
$cshowsPrec :: Int -> MergeShardsResponse -> ShowS
Prelude.Show, (forall x. MergeShardsResponse -> Rep MergeShardsResponse x)
-> (forall x. Rep MergeShardsResponse x -> MergeShardsResponse)
-> Generic MergeShardsResponse
forall x. Rep MergeShardsResponse x -> MergeShardsResponse
forall x. MergeShardsResponse -> Rep MergeShardsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MergeShardsResponse x -> MergeShardsResponse
$cfrom :: forall x. MergeShardsResponse -> Rep MergeShardsResponse x
Prelude.Generic)
newMergeShardsResponse ::
MergeShardsResponse
newMergeShardsResponse :: MergeShardsResponse
newMergeShardsResponse = MergeShardsResponse
MergeShardsResponse'
instance Prelude.NFData MergeShardsResponse