{-# 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.Config.DeliverConfigSnapshot
(
DeliverConfigSnapshot (..),
newDeliverConfigSnapshot,
deliverConfigSnapshot_deliveryChannelName,
DeliverConfigSnapshotResponse (..),
newDeliverConfigSnapshotResponse,
deliverConfigSnapshotResponse_configSnapshotId,
deliverConfigSnapshotResponse_httpStatus,
)
where
import Amazonka.Config.Types
import qualified Amazonka.Core as Core
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 DeliverConfigSnapshot = DeliverConfigSnapshot'
{
DeliverConfigSnapshot -> Text
deliveryChannelName :: Prelude.Text
}
deriving (DeliverConfigSnapshot -> DeliverConfigSnapshot -> Bool
(DeliverConfigSnapshot -> DeliverConfigSnapshot -> Bool)
-> (DeliverConfigSnapshot -> DeliverConfigSnapshot -> Bool)
-> Eq DeliverConfigSnapshot
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeliverConfigSnapshot -> DeliverConfigSnapshot -> Bool
$c/= :: DeliverConfigSnapshot -> DeliverConfigSnapshot -> Bool
== :: DeliverConfigSnapshot -> DeliverConfigSnapshot -> Bool
$c== :: DeliverConfigSnapshot -> DeliverConfigSnapshot -> Bool
Prelude.Eq, ReadPrec [DeliverConfigSnapshot]
ReadPrec DeliverConfigSnapshot
Int -> ReadS DeliverConfigSnapshot
ReadS [DeliverConfigSnapshot]
(Int -> ReadS DeliverConfigSnapshot)
-> ReadS [DeliverConfigSnapshot]
-> ReadPrec DeliverConfigSnapshot
-> ReadPrec [DeliverConfigSnapshot]
-> Read DeliverConfigSnapshot
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeliverConfigSnapshot]
$creadListPrec :: ReadPrec [DeliverConfigSnapshot]
readPrec :: ReadPrec DeliverConfigSnapshot
$creadPrec :: ReadPrec DeliverConfigSnapshot
readList :: ReadS [DeliverConfigSnapshot]
$creadList :: ReadS [DeliverConfigSnapshot]
readsPrec :: Int -> ReadS DeliverConfigSnapshot
$creadsPrec :: Int -> ReadS DeliverConfigSnapshot
Prelude.Read, Int -> DeliverConfigSnapshot -> ShowS
[DeliverConfigSnapshot] -> ShowS
DeliverConfigSnapshot -> String
(Int -> DeliverConfigSnapshot -> ShowS)
-> (DeliverConfigSnapshot -> String)
-> ([DeliverConfigSnapshot] -> ShowS)
-> Show DeliverConfigSnapshot
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeliverConfigSnapshot] -> ShowS
$cshowList :: [DeliverConfigSnapshot] -> ShowS
show :: DeliverConfigSnapshot -> String
$cshow :: DeliverConfigSnapshot -> String
showsPrec :: Int -> DeliverConfigSnapshot -> ShowS
$cshowsPrec :: Int -> DeliverConfigSnapshot -> ShowS
Prelude.Show, (forall x. DeliverConfigSnapshot -> Rep DeliverConfigSnapshot x)
-> (forall x. Rep DeliverConfigSnapshot x -> DeliverConfigSnapshot)
-> Generic DeliverConfigSnapshot
forall x. Rep DeliverConfigSnapshot x -> DeliverConfigSnapshot
forall x. DeliverConfigSnapshot -> Rep DeliverConfigSnapshot x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeliverConfigSnapshot x -> DeliverConfigSnapshot
$cfrom :: forall x. DeliverConfigSnapshot -> Rep DeliverConfigSnapshot x
Prelude.Generic)
newDeliverConfigSnapshot ::
Prelude.Text ->
DeliverConfigSnapshot
newDeliverConfigSnapshot :: Text -> DeliverConfigSnapshot
newDeliverConfigSnapshot Text
pDeliveryChannelName_ =
DeliverConfigSnapshot' :: Text -> DeliverConfigSnapshot
DeliverConfigSnapshot'
{ $sel:deliveryChannelName:DeliverConfigSnapshot' :: Text
deliveryChannelName =
Text
pDeliveryChannelName_
}
deliverConfigSnapshot_deliveryChannelName :: Lens.Lens' DeliverConfigSnapshot Prelude.Text
deliverConfigSnapshot_deliveryChannelName :: (Text -> f Text)
-> DeliverConfigSnapshot -> f DeliverConfigSnapshot
deliverConfigSnapshot_deliveryChannelName = (DeliverConfigSnapshot -> Text)
-> (DeliverConfigSnapshot -> Text -> DeliverConfigSnapshot)
-> Lens DeliverConfigSnapshot DeliverConfigSnapshot Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeliverConfigSnapshot' {Text
deliveryChannelName :: Text
$sel:deliveryChannelName:DeliverConfigSnapshot' :: DeliverConfigSnapshot -> Text
deliveryChannelName} -> Text
deliveryChannelName) (\s :: DeliverConfigSnapshot
s@DeliverConfigSnapshot' {} Text
a -> DeliverConfigSnapshot
s {$sel:deliveryChannelName:DeliverConfigSnapshot' :: Text
deliveryChannelName = Text
a} :: DeliverConfigSnapshot)
instance Core.AWSRequest DeliverConfigSnapshot where
type
AWSResponse DeliverConfigSnapshot =
DeliverConfigSnapshotResponse
request :: DeliverConfigSnapshot -> Request DeliverConfigSnapshot
request = Service -> DeliverConfigSnapshot -> Request DeliverConfigSnapshot
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DeliverConfigSnapshot
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeliverConfigSnapshot)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DeliverConfigSnapshot))
-> Logger
-> Service
-> Proxy DeliverConfigSnapshot
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeliverConfigSnapshot)))
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 -> Int -> DeliverConfigSnapshotResponse
DeliverConfigSnapshotResponse'
(Maybe Text -> Int -> DeliverConfigSnapshotResponse)
-> Either String (Maybe Text)
-> Either String (Int -> DeliverConfigSnapshotResponse)
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
"configSnapshotId")
Either String (Int -> DeliverConfigSnapshotResponse)
-> Either String Int -> Either String DeliverConfigSnapshotResponse
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 DeliverConfigSnapshot
instance Prelude.NFData DeliverConfigSnapshot
instance Core.ToHeaders DeliverConfigSnapshot where
toHeaders :: DeliverConfigSnapshot -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeliverConfigSnapshot -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"StarlingDoveService.DeliverConfigSnapshot" ::
Prelude.ByteString
),
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 DeliverConfigSnapshot where
toJSON :: DeliverConfigSnapshot -> Value
toJSON DeliverConfigSnapshot' {Text
deliveryChannelName :: Text
$sel:deliveryChannelName:DeliverConfigSnapshot' :: DeliverConfigSnapshot -> 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
"deliveryChannelName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
deliveryChannelName)
]
)
instance Core.ToPath DeliverConfigSnapshot where
toPath :: DeliverConfigSnapshot -> ByteString
toPath = ByteString -> DeliverConfigSnapshot -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DeliverConfigSnapshot where
toQuery :: DeliverConfigSnapshot -> QueryString
toQuery = QueryString -> DeliverConfigSnapshot -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeliverConfigSnapshotResponse = DeliverConfigSnapshotResponse'
{
DeliverConfigSnapshotResponse -> Maybe Text
configSnapshotId :: Prelude.Maybe Prelude.Text,
DeliverConfigSnapshotResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeliverConfigSnapshotResponse
-> DeliverConfigSnapshotResponse -> Bool
(DeliverConfigSnapshotResponse
-> DeliverConfigSnapshotResponse -> Bool)
-> (DeliverConfigSnapshotResponse
-> DeliverConfigSnapshotResponse -> Bool)
-> Eq DeliverConfigSnapshotResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeliverConfigSnapshotResponse
-> DeliverConfigSnapshotResponse -> Bool
$c/= :: DeliverConfigSnapshotResponse
-> DeliverConfigSnapshotResponse -> Bool
== :: DeliverConfigSnapshotResponse
-> DeliverConfigSnapshotResponse -> Bool
$c== :: DeliverConfigSnapshotResponse
-> DeliverConfigSnapshotResponse -> Bool
Prelude.Eq, ReadPrec [DeliverConfigSnapshotResponse]
ReadPrec DeliverConfigSnapshotResponse
Int -> ReadS DeliverConfigSnapshotResponse
ReadS [DeliverConfigSnapshotResponse]
(Int -> ReadS DeliverConfigSnapshotResponse)
-> ReadS [DeliverConfigSnapshotResponse]
-> ReadPrec DeliverConfigSnapshotResponse
-> ReadPrec [DeliverConfigSnapshotResponse]
-> Read DeliverConfigSnapshotResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeliverConfigSnapshotResponse]
$creadListPrec :: ReadPrec [DeliverConfigSnapshotResponse]
readPrec :: ReadPrec DeliverConfigSnapshotResponse
$creadPrec :: ReadPrec DeliverConfigSnapshotResponse
readList :: ReadS [DeliverConfigSnapshotResponse]
$creadList :: ReadS [DeliverConfigSnapshotResponse]
readsPrec :: Int -> ReadS DeliverConfigSnapshotResponse
$creadsPrec :: Int -> ReadS DeliverConfigSnapshotResponse
Prelude.Read, Int -> DeliverConfigSnapshotResponse -> ShowS
[DeliverConfigSnapshotResponse] -> ShowS
DeliverConfigSnapshotResponse -> String
(Int -> DeliverConfigSnapshotResponse -> ShowS)
-> (DeliverConfigSnapshotResponse -> String)
-> ([DeliverConfigSnapshotResponse] -> ShowS)
-> Show DeliverConfigSnapshotResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeliverConfigSnapshotResponse] -> ShowS
$cshowList :: [DeliverConfigSnapshotResponse] -> ShowS
show :: DeliverConfigSnapshotResponse -> String
$cshow :: DeliverConfigSnapshotResponse -> String
showsPrec :: Int -> DeliverConfigSnapshotResponse -> ShowS
$cshowsPrec :: Int -> DeliverConfigSnapshotResponse -> ShowS
Prelude.Show, (forall x.
DeliverConfigSnapshotResponse
-> Rep DeliverConfigSnapshotResponse x)
-> (forall x.
Rep DeliverConfigSnapshotResponse x
-> DeliverConfigSnapshotResponse)
-> Generic DeliverConfigSnapshotResponse
forall x.
Rep DeliverConfigSnapshotResponse x
-> DeliverConfigSnapshotResponse
forall x.
DeliverConfigSnapshotResponse
-> Rep DeliverConfigSnapshotResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeliverConfigSnapshotResponse x
-> DeliverConfigSnapshotResponse
$cfrom :: forall x.
DeliverConfigSnapshotResponse
-> Rep DeliverConfigSnapshotResponse x
Prelude.Generic)
newDeliverConfigSnapshotResponse ::
Prelude.Int ->
DeliverConfigSnapshotResponse
newDeliverConfigSnapshotResponse :: Int -> DeliverConfigSnapshotResponse
newDeliverConfigSnapshotResponse Int
pHttpStatus_ =
DeliverConfigSnapshotResponse' :: Maybe Text -> Int -> DeliverConfigSnapshotResponse
DeliverConfigSnapshotResponse'
{ $sel:configSnapshotId:DeliverConfigSnapshotResponse' :: Maybe Text
configSnapshotId =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DeliverConfigSnapshotResponse' :: Int
httpStatus = Int
pHttpStatus_
}
deliverConfigSnapshotResponse_configSnapshotId :: Lens.Lens' DeliverConfigSnapshotResponse (Prelude.Maybe Prelude.Text)
deliverConfigSnapshotResponse_configSnapshotId :: (Maybe Text -> f (Maybe Text))
-> DeliverConfigSnapshotResponse -> f DeliverConfigSnapshotResponse
deliverConfigSnapshotResponse_configSnapshotId = (DeliverConfigSnapshotResponse -> Maybe Text)
-> (DeliverConfigSnapshotResponse
-> Maybe Text -> DeliverConfigSnapshotResponse)
-> Lens
DeliverConfigSnapshotResponse
DeliverConfigSnapshotResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeliverConfigSnapshotResponse' {Maybe Text
configSnapshotId :: Maybe Text
$sel:configSnapshotId:DeliverConfigSnapshotResponse' :: DeliverConfigSnapshotResponse -> Maybe Text
configSnapshotId} -> Maybe Text
configSnapshotId) (\s :: DeliverConfigSnapshotResponse
s@DeliverConfigSnapshotResponse' {} Maybe Text
a -> DeliverConfigSnapshotResponse
s {$sel:configSnapshotId:DeliverConfigSnapshotResponse' :: Maybe Text
configSnapshotId = Maybe Text
a} :: DeliverConfigSnapshotResponse)
deliverConfigSnapshotResponse_httpStatus :: Lens.Lens' DeliverConfigSnapshotResponse Prelude.Int
deliverConfigSnapshotResponse_httpStatus :: (Int -> f Int)
-> DeliverConfigSnapshotResponse -> f DeliverConfigSnapshotResponse
deliverConfigSnapshotResponse_httpStatus = (DeliverConfigSnapshotResponse -> Int)
-> (DeliverConfigSnapshotResponse
-> Int -> DeliverConfigSnapshotResponse)
-> Lens
DeliverConfigSnapshotResponse DeliverConfigSnapshotResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeliverConfigSnapshotResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeliverConfigSnapshotResponse' :: DeliverConfigSnapshotResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeliverConfigSnapshotResponse
s@DeliverConfigSnapshotResponse' {} Int
a -> DeliverConfigSnapshotResponse
s {$sel:httpStatus:DeliverConfigSnapshotResponse' :: Int
httpStatus = Int
a} :: DeliverConfigSnapshotResponse)
instance Prelude.NFData DeliverConfigSnapshotResponse