{-# 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.Firehose.TagDeliveryStream
(
TagDeliveryStream (..),
newTagDeliveryStream,
tagDeliveryStream_deliveryStreamName,
tagDeliveryStream_tags,
TagDeliveryStreamResponse (..),
newTagDeliveryStreamResponse,
tagDeliveryStreamResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Firehose.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data TagDeliveryStream = TagDeliveryStream'
{
TagDeliveryStream -> Text
deliveryStreamName :: Prelude.Text,
TagDeliveryStream -> NonEmpty Tag
tags :: Prelude.NonEmpty Tag
}
deriving (TagDeliveryStream -> TagDeliveryStream -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TagDeliveryStream -> TagDeliveryStream -> Bool
$c/= :: TagDeliveryStream -> TagDeliveryStream -> Bool
== :: TagDeliveryStream -> TagDeliveryStream -> Bool
$c== :: TagDeliveryStream -> TagDeliveryStream -> Bool
Prelude.Eq, ReadPrec [TagDeliveryStream]
ReadPrec TagDeliveryStream
Int -> ReadS TagDeliveryStream
ReadS [TagDeliveryStream]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TagDeliveryStream]
$creadListPrec :: ReadPrec [TagDeliveryStream]
readPrec :: ReadPrec TagDeliveryStream
$creadPrec :: ReadPrec TagDeliveryStream
readList :: ReadS [TagDeliveryStream]
$creadList :: ReadS [TagDeliveryStream]
readsPrec :: Int -> ReadS TagDeliveryStream
$creadsPrec :: Int -> ReadS TagDeliveryStream
Prelude.Read, Int -> TagDeliveryStream -> ShowS
[TagDeliveryStream] -> ShowS
TagDeliveryStream -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TagDeliveryStream] -> ShowS
$cshowList :: [TagDeliveryStream] -> ShowS
show :: TagDeliveryStream -> String
$cshow :: TagDeliveryStream -> String
showsPrec :: Int -> TagDeliveryStream -> ShowS
$cshowsPrec :: Int -> TagDeliveryStream -> ShowS
Prelude.Show, forall x. Rep TagDeliveryStream x -> TagDeliveryStream
forall x. TagDeliveryStream -> Rep TagDeliveryStream x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TagDeliveryStream x -> TagDeliveryStream
$cfrom :: forall x. TagDeliveryStream -> Rep TagDeliveryStream x
Prelude.Generic)
newTagDeliveryStream ::
Prelude.Text ->
Prelude.NonEmpty Tag ->
TagDeliveryStream
newTagDeliveryStream :: Text -> NonEmpty Tag -> TagDeliveryStream
newTagDeliveryStream Text
pDeliveryStreamName_ NonEmpty Tag
pTags_ =
TagDeliveryStream'
{ $sel:deliveryStreamName:TagDeliveryStream' :: Text
deliveryStreamName =
Text
pDeliveryStreamName_,
$sel:tags:TagDeliveryStream' :: NonEmpty Tag
tags = forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced forall t b. AReview t b -> b -> t
Lens.# NonEmpty Tag
pTags_
}
tagDeliveryStream_deliveryStreamName :: Lens.Lens' TagDeliveryStream Prelude.Text
tagDeliveryStream_deliveryStreamName :: Lens' TagDeliveryStream Text
tagDeliveryStream_deliveryStreamName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TagDeliveryStream' {Text
deliveryStreamName :: Text
$sel:deliveryStreamName:TagDeliveryStream' :: TagDeliveryStream -> Text
deliveryStreamName} -> Text
deliveryStreamName) (\s :: TagDeliveryStream
s@TagDeliveryStream' {} Text
a -> TagDeliveryStream
s {$sel:deliveryStreamName:TagDeliveryStream' :: Text
deliveryStreamName = Text
a} :: TagDeliveryStream)
tagDeliveryStream_tags :: Lens.Lens' TagDeliveryStream (Prelude.NonEmpty Tag)
tagDeliveryStream_tags :: Lens' TagDeliveryStream (NonEmpty Tag)
tagDeliveryStream_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TagDeliveryStream' {NonEmpty Tag
tags :: NonEmpty Tag
$sel:tags:TagDeliveryStream' :: TagDeliveryStream -> NonEmpty Tag
tags} -> NonEmpty Tag
tags) (\s :: TagDeliveryStream
s@TagDeliveryStream' {} NonEmpty Tag
a -> TagDeliveryStream
s {$sel:tags:TagDeliveryStream' :: NonEmpty Tag
tags = NonEmpty Tag
a} :: TagDeliveryStream) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.AWSRequest TagDeliveryStream where
type
AWSResponse TagDeliveryStream =
TagDeliveryStreamResponse
request :: (Service -> Service)
-> TagDeliveryStream -> Request TagDeliveryStream
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy TagDeliveryStream
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse TagDeliveryStream)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> TagDeliveryStreamResponse
TagDeliveryStreamResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable TagDeliveryStream where
hashWithSalt :: Int -> TagDeliveryStream -> Int
hashWithSalt Int
_salt TagDeliveryStream' {NonEmpty Tag
Text
tags :: NonEmpty Tag
deliveryStreamName :: Text
$sel:tags:TagDeliveryStream' :: TagDeliveryStream -> NonEmpty Tag
$sel:deliveryStreamName:TagDeliveryStream' :: TagDeliveryStream -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
deliveryStreamName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` NonEmpty Tag
tags
instance Prelude.NFData TagDeliveryStream where
rnf :: TagDeliveryStream -> ()
rnf TagDeliveryStream' {NonEmpty Tag
Text
tags :: NonEmpty Tag
deliveryStreamName :: Text
$sel:tags:TagDeliveryStream' :: TagDeliveryStream -> NonEmpty Tag
$sel:deliveryStreamName:TagDeliveryStream' :: TagDeliveryStream -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
deliveryStreamName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf NonEmpty Tag
tags
instance Data.ToHeaders TagDeliveryStream where
toHeaders :: TagDeliveryStream -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"Firehose_20150804.TagDeliveryStream" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON TagDeliveryStream where
toJSON :: TagDeliveryStream -> Value
toJSON TagDeliveryStream' {NonEmpty Tag
Text
tags :: NonEmpty Tag
deliveryStreamName :: Text
$sel:tags:TagDeliveryStream' :: TagDeliveryStream -> NonEmpty Tag
$sel:deliveryStreamName:TagDeliveryStream' :: TagDeliveryStream -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just
(Key
"DeliveryStreamName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
deliveryStreamName),
forall a. a -> Maybe a
Prelude.Just (Key
"Tags" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= NonEmpty Tag
tags)
]
)
instance Data.ToPath TagDeliveryStream where
toPath :: TagDeliveryStream -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery TagDeliveryStream where
toQuery :: TagDeliveryStream -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data TagDeliveryStreamResponse = TagDeliveryStreamResponse'
{
TagDeliveryStreamResponse -> Int
httpStatus :: Prelude.Int
}
deriving (TagDeliveryStreamResponse -> TagDeliveryStreamResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TagDeliveryStreamResponse -> TagDeliveryStreamResponse -> Bool
$c/= :: TagDeliveryStreamResponse -> TagDeliveryStreamResponse -> Bool
== :: TagDeliveryStreamResponse -> TagDeliveryStreamResponse -> Bool
$c== :: TagDeliveryStreamResponse -> TagDeliveryStreamResponse -> Bool
Prelude.Eq, ReadPrec [TagDeliveryStreamResponse]
ReadPrec TagDeliveryStreamResponse
Int -> ReadS TagDeliveryStreamResponse
ReadS [TagDeliveryStreamResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TagDeliveryStreamResponse]
$creadListPrec :: ReadPrec [TagDeliveryStreamResponse]
readPrec :: ReadPrec TagDeliveryStreamResponse
$creadPrec :: ReadPrec TagDeliveryStreamResponse
readList :: ReadS [TagDeliveryStreamResponse]
$creadList :: ReadS [TagDeliveryStreamResponse]
readsPrec :: Int -> ReadS TagDeliveryStreamResponse
$creadsPrec :: Int -> ReadS TagDeliveryStreamResponse
Prelude.Read, Int -> TagDeliveryStreamResponse -> ShowS
[TagDeliveryStreamResponse] -> ShowS
TagDeliveryStreamResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TagDeliveryStreamResponse] -> ShowS
$cshowList :: [TagDeliveryStreamResponse] -> ShowS
show :: TagDeliveryStreamResponse -> String
$cshow :: TagDeliveryStreamResponse -> String
showsPrec :: Int -> TagDeliveryStreamResponse -> ShowS
$cshowsPrec :: Int -> TagDeliveryStreamResponse -> ShowS
Prelude.Show, forall x.
Rep TagDeliveryStreamResponse x -> TagDeliveryStreamResponse
forall x.
TagDeliveryStreamResponse -> Rep TagDeliveryStreamResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep TagDeliveryStreamResponse x -> TagDeliveryStreamResponse
$cfrom :: forall x.
TagDeliveryStreamResponse -> Rep TagDeliveryStreamResponse x
Prelude.Generic)
newTagDeliveryStreamResponse ::
Prelude.Int ->
TagDeliveryStreamResponse
newTagDeliveryStreamResponse :: Int -> TagDeliveryStreamResponse
newTagDeliveryStreamResponse Int
pHttpStatus_ =
TagDeliveryStreamResponse'
{ $sel:httpStatus:TagDeliveryStreamResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
tagDeliveryStreamResponse_httpStatus :: Lens.Lens' TagDeliveryStreamResponse Prelude.Int
tagDeliveryStreamResponse_httpStatus :: Lens' TagDeliveryStreamResponse Int
tagDeliveryStreamResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TagDeliveryStreamResponse' {Int
httpStatus :: Int
$sel:httpStatus:TagDeliveryStreamResponse' :: TagDeliveryStreamResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: TagDeliveryStreamResponse
s@TagDeliveryStreamResponse' {} Int
a -> TagDeliveryStreamResponse
s {$sel:httpStatus:TagDeliveryStreamResponse' :: Int
httpStatus = Int
a} :: TagDeliveryStreamResponse)
instance Prelude.NFData TagDeliveryStreamResponse where
rnf :: TagDeliveryStreamResponse -> ()
rnf TagDeliveryStreamResponse' {Int
httpStatus :: Int
$sel:httpStatus:TagDeliveryStreamResponse' :: TagDeliveryStreamResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus