{-# 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.SSM.CreateResourceDataSync
(
CreateResourceDataSync (..),
newCreateResourceDataSync,
createResourceDataSync_syncType,
createResourceDataSync_syncSource,
createResourceDataSync_s3Destination,
createResourceDataSync_syncName,
CreateResourceDataSyncResponse (..),
newCreateResourceDataSyncResponse,
createResourceDataSyncResponse_httpStatus,
)
where
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
import Amazonka.SSM.Types
data CreateResourceDataSync = CreateResourceDataSync'
{
CreateResourceDataSync -> Maybe Text
syncType :: Prelude.Maybe Prelude.Text,
CreateResourceDataSync -> Maybe ResourceDataSyncSource
syncSource :: Prelude.Maybe ResourceDataSyncSource,
CreateResourceDataSync -> Maybe ResourceDataSyncS3Destination
s3Destination :: Prelude.Maybe ResourceDataSyncS3Destination,
CreateResourceDataSync -> Text
syncName :: Prelude.Text
}
deriving (CreateResourceDataSync -> CreateResourceDataSync -> Bool
(CreateResourceDataSync -> CreateResourceDataSync -> Bool)
-> (CreateResourceDataSync -> CreateResourceDataSync -> Bool)
-> Eq CreateResourceDataSync
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateResourceDataSync -> CreateResourceDataSync -> Bool
$c/= :: CreateResourceDataSync -> CreateResourceDataSync -> Bool
== :: CreateResourceDataSync -> CreateResourceDataSync -> Bool
$c== :: CreateResourceDataSync -> CreateResourceDataSync -> Bool
Prelude.Eq, ReadPrec [CreateResourceDataSync]
ReadPrec CreateResourceDataSync
Int -> ReadS CreateResourceDataSync
ReadS [CreateResourceDataSync]
(Int -> ReadS CreateResourceDataSync)
-> ReadS [CreateResourceDataSync]
-> ReadPrec CreateResourceDataSync
-> ReadPrec [CreateResourceDataSync]
-> Read CreateResourceDataSync
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateResourceDataSync]
$creadListPrec :: ReadPrec [CreateResourceDataSync]
readPrec :: ReadPrec CreateResourceDataSync
$creadPrec :: ReadPrec CreateResourceDataSync
readList :: ReadS [CreateResourceDataSync]
$creadList :: ReadS [CreateResourceDataSync]
readsPrec :: Int -> ReadS CreateResourceDataSync
$creadsPrec :: Int -> ReadS CreateResourceDataSync
Prelude.Read, Int -> CreateResourceDataSync -> ShowS
[CreateResourceDataSync] -> ShowS
CreateResourceDataSync -> String
(Int -> CreateResourceDataSync -> ShowS)
-> (CreateResourceDataSync -> String)
-> ([CreateResourceDataSync] -> ShowS)
-> Show CreateResourceDataSync
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateResourceDataSync] -> ShowS
$cshowList :: [CreateResourceDataSync] -> ShowS
show :: CreateResourceDataSync -> String
$cshow :: CreateResourceDataSync -> String
showsPrec :: Int -> CreateResourceDataSync -> ShowS
$cshowsPrec :: Int -> CreateResourceDataSync -> ShowS
Prelude.Show, (forall x. CreateResourceDataSync -> Rep CreateResourceDataSync x)
-> (forall x.
Rep CreateResourceDataSync x -> CreateResourceDataSync)
-> Generic CreateResourceDataSync
forall x. Rep CreateResourceDataSync x -> CreateResourceDataSync
forall x. CreateResourceDataSync -> Rep CreateResourceDataSync x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateResourceDataSync x -> CreateResourceDataSync
$cfrom :: forall x. CreateResourceDataSync -> Rep CreateResourceDataSync x
Prelude.Generic)
newCreateResourceDataSync ::
Prelude.Text ->
CreateResourceDataSync
newCreateResourceDataSync :: Text -> CreateResourceDataSync
newCreateResourceDataSync Text
pSyncName_ =
CreateResourceDataSync' :: Maybe Text
-> Maybe ResourceDataSyncSource
-> Maybe ResourceDataSyncS3Destination
-> Text
-> CreateResourceDataSync
CreateResourceDataSync'
{ $sel:syncType:CreateResourceDataSync' :: Maybe Text
syncType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:syncSource:CreateResourceDataSync' :: Maybe ResourceDataSyncSource
syncSource = Maybe ResourceDataSyncSource
forall a. Maybe a
Prelude.Nothing,
$sel:s3Destination:CreateResourceDataSync' :: Maybe ResourceDataSyncS3Destination
s3Destination = Maybe ResourceDataSyncS3Destination
forall a. Maybe a
Prelude.Nothing,
$sel:syncName:CreateResourceDataSync' :: Text
syncName = Text
pSyncName_
}
createResourceDataSync_syncType :: Lens.Lens' CreateResourceDataSync (Prelude.Maybe Prelude.Text)
createResourceDataSync_syncType :: (Maybe Text -> f (Maybe Text))
-> CreateResourceDataSync -> f CreateResourceDataSync
createResourceDataSync_syncType = (CreateResourceDataSync -> Maybe Text)
-> (CreateResourceDataSync -> Maybe Text -> CreateResourceDataSync)
-> Lens
CreateResourceDataSync
CreateResourceDataSync
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateResourceDataSync' {Maybe Text
syncType :: Maybe Text
$sel:syncType:CreateResourceDataSync' :: CreateResourceDataSync -> Maybe Text
syncType} -> Maybe Text
syncType) (\s :: CreateResourceDataSync
s@CreateResourceDataSync' {} Maybe Text
a -> CreateResourceDataSync
s {$sel:syncType:CreateResourceDataSync' :: Maybe Text
syncType = Maybe Text
a} :: CreateResourceDataSync)
createResourceDataSync_syncSource :: Lens.Lens' CreateResourceDataSync (Prelude.Maybe ResourceDataSyncSource)
createResourceDataSync_syncSource :: (Maybe ResourceDataSyncSource -> f (Maybe ResourceDataSyncSource))
-> CreateResourceDataSync -> f CreateResourceDataSync
createResourceDataSync_syncSource = (CreateResourceDataSync -> Maybe ResourceDataSyncSource)
-> (CreateResourceDataSync
-> Maybe ResourceDataSyncSource -> CreateResourceDataSync)
-> Lens
CreateResourceDataSync
CreateResourceDataSync
(Maybe ResourceDataSyncSource)
(Maybe ResourceDataSyncSource)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateResourceDataSync' {Maybe ResourceDataSyncSource
syncSource :: Maybe ResourceDataSyncSource
$sel:syncSource:CreateResourceDataSync' :: CreateResourceDataSync -> Maybe ResourceDataSyncSource
syncSource} -> Maybe ResourceDataSyncSource
syncSource) (\s :: CreateResourceDataSync
s@CreateResourceDataSync' {} Maybe ResourceDataSyncSource
a -> CreateResourceDataSync
s {$sel:syncSource:CreateResourceDataSync' :: Maybe ResourceDataSyncSource
syncSource = Maybe ResourceDataSyncSource
a} :: CreateResourceDataSync)
createResourceDataSync_s3Destination :: Lens.Lens' CreateResourceDataSync (Prelude.Maybe ResourceDataSyncS3Destination)
createResourceDataSync_s3Destination :: (Maybe ResourceDataSyncS3Destination
-> f (Maybe ResourceDataSyncS3Destination))
-> CreateResourceDataSync -> f CreateResourceDataSync
createResourceDataSync_s3Destination = (CreateResourceDataSync -> Maybe ResourceDataSyncS3Destination)
-> (CreateResourceDataSync
-> Maybe ResourceDataSyncS3Destination -> CreateResourceDataSync)
-> Lens
CreateResourceDataSync
CreateResourceDataSync
(Maybe ResourceDataSyncS3Destination)
(Maybe ResourceDataSyncS3Destination)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateResourceDataSync' {Maybe ResourceDataSyncS3Destination
s3Destination :: Maybe ResourceDataSyncS3Destination
$sel:s3Destination:CreateResourceDataSync' :: CreateResourceDataSync -> Maybe ResourceDataSyncS3Destination
s3Destination} -> Maybe ResourceDataSyncS3Destination
s3Destination) (\s :: CreateResourceDataSync
s@CreateResourceDataSync' {} Maybe ResourceDataSyncS3Destination
a -> CreateResourceDataSync
s {$sel:s3Destination:CreateResourceDataSync' :: Maybe ResourceDataSyncS3Destination
s3Destination = Maybe ResourceDataSyncS3Destination
a} :: CreateResourceDataSync)
createResourceDataSync_syncName :: Lens.Lens' CreateResourceDataSync Prelude.Text
createResourceDataSync_syncName :: (Text -> f Text)
-> CreateResourceDataSync -> f CreateResourceDataSync
createResourceDataSync_syncName = (CreateResourceDataSync -> Text)
-> (CreateResourceDataSync -> Text -> CreateResourceDataSync)
-> Lens CreateResourceDataSync CreateResourceDataSync Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateResourceDataSync' {Text
syncName :: Text
$sel:syncName:CreateResourceDataSync' :: CreateResourceDataSync -> Text
syncName} -> Text
syncName) (\s :: CreateResourceDataSync
s@CreateResourceDataSync' {} Text
a -> CreateResourceDataSync
s {$sel:syncName:CreateResourceDataSync' :: Text
syncName = Text
a} :: CreateResourceDataSync)
instance Core.AWSRequest CreateResourceDataSync where
type
AWSResponse CreateResourceDataSync =
CreateResourceDataSyncResponse
request :: CreateResourceDataSync -> Request CreateResourceDataSync
request = Service -> CreateResourceDataSync -> Request CreateResourceDataSync
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy CreateResourceDataSync
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateResourceDataSync)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse CreateResourceDataSync))
-> Logger
-> Service
-> Proxy CreateResourceDataSync
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateResourceDataSync)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> CreateResourceDataSyncResponse
CreateResourceDataSyncResponse'
(Int -> CreateResourceDataSyncResponse)
-> Either String Int
-> Either String CreateResourceDataSyncResponse
forall (f :: * -> *) a b. Functor 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 CreateResourceDataSync
instance Prelude.NFData CreateResourceDataSync
instance Core.ToHeaders CreateResourceDataSync where
toHeaders :: CreateResourceDataSync -> ResponseHeaders
toHeaders =
ResponseHeaders -> CreateResourceDataSync -> 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
"AmazonSSM.CreateResourceDataSync" ::
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 CreateResourceDataSync where
toJSON :: CreateResourceDataSync -> Value
toJSON CreateResourceDataSync' {Maybe Text
Maybe ResourceDataSyncS3Destination
Maybe ResourceDataSyncSource
Text
syncName :: Text
s3Destination :: Maybe ResourceDataSyncS3Destination
syncSource :: Maybe ResourceDataSyncSource
syncType :: Maybe Text
$sel:syncName:CreateResourceDataSync' :: CreateResourceDataSync -> Text
$sel:s3Destination:CreateResourceDataSync' :: CreateResourceDataSync -> Maybe ResourceDataSyncS3Destination
$sel:syncSource:CreateResourceDataSync' :: CreateResourceDataSync -> Maybe ResourceDataSyncSource
$sel:syncType:CreateResourceDataSync' :: CreateResourceDataSync -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"SyncType" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
syncType,
(Text
"SyncSource" Text -> ResourceDataSyncSource -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (ResourceDataSyncSource -> Pair)
-> Maybe ResourceDataSyncSource -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ResourceDataSyncSource
syncSource,
(Text
"S3Destination" Text -> ResourceDataSyncS3Destination -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (ResourceDataSyncS3Destination -> Pair)
-> Maybe ResourceDataSyncS3Destination -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ResourceDataSyncS3Destination
s3Destination,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"SyncName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
syncName)
]
)
instance Core.ToPath CreateResourceDataSync where
toPath :: CreateResourceDataSync -> ByteString
toPath = ByteString -> CreateResourceDataSync -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery CreateResourceDataSync where
toQuery :: CreateResourceDataSync -> QueryString
toQuery = QueryString -> CreateResourceDataSync -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data CreateResourceDataSyncResponse = CreateResourceDataSyncResponse'
{
CreateResourceDataSyncResponse -> Int
httpStatus :: Prelude.Int
}
deriving (CreateResourceDataSyncResponse
-> CreateResourceDataSyncResponse -> Bool
(CreateResourceDataSyncResponse
-> CreateResourceDataSyncResponse -> Bool)
-> (CreateResourceDataSyncResponse
-> CreateResourceDataSyncResponse -> Bool)
-> Eq CreateResourceDataSyncResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateResourceDataSyncResponse
-> CreateResourceDataSyncResponse -> Bool
$c/= :: CreateResourceDataSyncResponse
-> CreateResourceDataSyncResponse -> Bool
== :: CreateResourceDataSyncResponse
-> CreateResourceDataSyncResponse -> Bool
$c== :: CreateResourceDataSyncResponse
-> CreateResourceDataSyncResponse -> Bool
Prelude.Eq, ReadPrec [CreateResourceDataSyncResponse]
ReadPrec CreateResourceDataSyncResponse
Int -> ReadS CreateResourceDataSyncResponse
ReadS [CreateResourceDataSyncResponse]
(Int -> ReadS CreateResourceDataSyncResponse)
-> ReadS [CreateResourceDataSyncResponse]
-> ReadPrec CreateResourceDataSyncResponse
-> ReadPrec [CreateResourceDataSyncResponse]
-> Read CreateResourceDataSyncResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateResourceDataSyncResponse]
$creadListPrec :: ReadPrec [CreateResourceDataSyncResponse]
readPrec :: ReadPrec CreateResourceDataSyncResponse
$creadPrec :: ReadPrec CreateResourceDataSyncResponse
readList :: ReadS [CreateResourceDataSyncResponse]
$creadList :: ReadS [CreateResourceDataSyncResponse]
readsPrec :: Int -> ReadS CreateResourceDataSyncResponse
$creadsPrec :: Int -> ReadS CreateResourceDataSyncResponse
Prelude.Read, Int -> CreateResourceDataSyncResponse -> ShowS
[CreateResourceDataSyncResponse] -> ShowS
CreateResourceDataSyncResponse -> String
(Int -> CreateResourceDataSyncResponse -> ShowS)
-> (CreateResourceDataSyncResponse -> String)
-> ([CreateResourceDataSyncResponse] -> ShowS)
-> Show CreateResourceDataSyncResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateResourceDataSyncResponse] -> ShowS
$cshowList :: [CreateResourceDataSyncResponse] -> ShowS
show :: CreateResourceDataSyncResponse -> String
$cshow :: CreateResourceDataSyncResponse -> String
showsPrec :: Int -> CreateResourceDataSyncResponse -> ShowS
$cshowsPrec :: Int -> CreateResourceDataSyncResponse -> ShowS
Prelude.Show, (forall x.
CreateResourceDataSyncResponse
-> Rep CreateResourceDataSyncResponse x)
-> (forall x.
Rep CreateResourceDataSyncResponse x
-> CreateResourceDataSyncResponse)
-> Generic CreateResourceDataSyncResponse
forall x.
Rep CreateResourceDataSyncResponse x
-> CreateResourceDataSyncResponse
forall x.
CreateResourceDataSyncResponse
-> Rep CreateResourceDataSyncResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateResourceDataSyncResponse x
-> CreateResourceDataSyncResponse
$cfrom :: forall x.
CreateResourceDataSyncResponse
-> Rep CreateResourceDataSyncResponse x
Prelude.Generic)
newCreateResourceDataSyncResponse ::
Prelude.Int ->
CreateResourceDataSyncResponse
newCreateResourceDataSyncResponse :: Int -> CreateResourceDataSyncResponse
newCreateResourceDataSyncResponse Int
pHttpStatus_ =
CreateResourceDataSyncResponse' :: Int -> CreateResourceDataSyncResponse
CreateResourceDataSyncResponse'
{ $sel:httpStatus:CreateResourceDataSyncResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
createResourceDataSyncResponse_httpStatus :: Lens.Lens' CreateResourceDataSyncResponse Prelude.Int
createResourceDataSyncResponse_httpStatus :: (Int -> f Int)
-> CreateResourceDataSyncResponse
-> f CreateResourceDataSyncResponse
createResourceDataSyncResponse_httpStatus = (CreateResourceDataSyncResponse -> Int)
-> (CreateResourceDataSyncResponse
-> Int -> CreateResourceDataSyncResponse)
-> Lens
CreateResourceDataSyncResponse
CreateResourceDataSyncResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateResourceDataSyncResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateResourceDataSyncResponse' :: CreateResourceDataSyncResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateResourceDataSyncResponse
s@CreateResourceDataSyncResponse' {} Int
a -> CreateResourceDataSyncResponse
s {$sel:httpStatus:CreateResourceDataSyncResponse' :: Int
httpStatus = Int
a} :: CreateResourceDataSyncResponse)
instance
Prelude.NFData
CreateResourceDataSyncResponse