{-# 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.UpdateResourceDataSync
(
UpdateResourceDataSync (..),
newUpdateResourceDataSync,
updateResourceDataSync_syncName,
updateResourceDataSync_syncType,
updateResourceDataSync_syncSource,
UpdateResourceDataSyncResponse (..),
newUpdateResourceDataSyncResponse,
updateResourceDataSyncResponse_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 UpdateResourceDataSync = UpdateResourceDataSync'
{
UpdateResourceDataSync -> Text
syncName :: Prelude.Text,
UpdateResourceDataSync -> Text
syncType :: Prelude.Text,
UpdateResourceDataSync -> ResourceDataSyncSource
syncSource :: ResourceDataSyncSource
}
deriving (UpdateResourceDataSync -> UpdateResourceDataSync -> Bool
(UpdateResourceDataSync -> UpdateResourceDataSync -> Bool)
-> (UpdateResourceDataSync -> UpdateResourceDataSync -> Bool)
-> Eq UpdateResourceDataSync
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateResourceDataSync -> UpdateResourceDataSync -> Bool
$c/= :: UpdateResourceDataSync -> UpdateResourceDataSync -> Bool
== :: UpdateResourceDataSync -> UpdateResourceDataSync -> Bool
$c== :: UpdateResourceDataSync -> UpdateResourceDataSync -> Bool
Prelude.Eq, ReadPrec [UpdateResourceDataSync]
ReadPrec UpdateResourceDataSync
Int -> ReadS UpdateResourceDataSync
ReadS [UpdateResourceDataSync]
(Int -> ReadS UpdateResourceDataSync)
-> ReadS [UpdateResourceDataSync]
-> ReadPrec UpdateResourceDataSync
-> ReadPrec [UpdateResourceDataSync]
-> Read UpdateResourceDataSync
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateResourceDataSync]
$creadListPrec :: ReadPrec [UpdateResourceDataSync]
readPrec :: ReadPrec UpdateResourceDataSync
$creadPrec :: ReadPrec UpdateResourceDataSync
readList :: ReadS [UpdateResourceDataSync]
$creadList :: ReadS [UpdateResourceDataSync]
readsPrec :: Int -> ReadS UpdateResourceDataSync
$creadsPrec :: Int -> ReadS UpdateResourceDataSync
Prelude.Read, Int -> UpdateResourceDataSync -> ShowS
[UpdateResourceDataSync] -> ShowS
UpdateResourceDataSync -> String
(Int -> UpdateResourceDataSync -> ShowS)
-> (UpdateResourceDataSync -> String)
-> ([UpdateResourceDataSync] -> ShowS)
-> Show UpdateResourceDataSync
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateResourceDataSync] -> ShowS
$cshowList :: [UpdateResourceDataSync] -> ShowS
show :: UpdateResourceDataSync -> String
$cshow :: UpdateResourceDataSync -> String
showsPrec :: Int -> UpdateResourceDataSync -> ShowS
$cshowsPrec :: Int -> UpdateResourceDataSync -> ShowS
Prelude.Show, (forall x. UpdateResourceDataSync -> Rep UpdateResourceDataSync x)
-> (forall x.
Rep UpdateResourceDataSync x -> UpdateResourceDataSync)
-> Generic UpdateResourceDataSync
forall x. Rep UpdateResourceDataSync x -> UpdateResourceDataSync
forall x. UpdateResourceDataSync -> Rep UpdateResourceDataSync x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateResourceDataSync x -> UpdateResourceDataSync
$cfrom :: forall x. UpdateResourceDataSync -> Rep UpdateResourceDataSync x
Prelude.Generic)
newUpdateResourceDataSync ::
Prelude.Text ->
Prelude.Text ->
ResourceDataSyncSource ->
UpdateResourceDataSync
newUpdateResourceDataSync :: Text -> Text -> ResourceDataSyncSource -> UpdateResourceDataSync
newUpdateResourceDataSync
Text
pSyncName_
Text
pSyncType_
ResourceDataSyncSource
pSyncSource_ =
UpdateResourceDataSync' :: Text -> Text -> ResourceDataSyncSource -> UpdateResourceDataSync
UpdateResourceDataSync'
{ $sel:syncName:UpdateResourceDataSync' :: Text
syncName = Text
pSyncName_,
$sel:syncType:UpdateResourceDataSync' :: Text
syncType = Text
pSyncType_,
$sel:syncSource:UpdateResourceDataSync' :: ResourceDataSyncSource
syncSource = ResourceDataSyncSource
pSyncSource_
}
updateResourceDataSync_syncName :: Lens.Lens' UpdateResourceDataSync Prelude.Text
updateResourceDataSync_syncName :: (Text -> f Text)
-> UpdateResourceDataSync -> f UpdateResourceDataSync
updateResourceDataSync_syncName = (UpdateResourceDataSync -> Text)
-> (UpdateResourceDataSync -> Text -> UpdateResourceDataSync)
-> Lens UpdateResourceDataSync UpdateResourceDataSync Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateResourceDataSync' {Text
syncName :: Text
$sel:syncName:UpdateResourceDataSync' :: UpdateResourceDataSync -> Text
syncName} -> Text
syncName) (\s :: UpdateResourceDataSync
s@UpdateResourceDataSync' {} Text
a -> UpdateResourceDataSync
s {$sel:syncName:UpdateResourceDataSync' :: Text
syncName = Text
a} :: UpdateResourceDataSync)
updateResourceDataSync_syncType :: Lens.Lens' UpdateResourceDataSync Prelude.Text
updateResourceDataSync_syncType :: (Text -> f Text)
-> UpdateResourceDataSync -> f UpdateResourceDataSync
updateResourceDataSync_syncType = (UpdateResourceDataSync -> Text)
-> (UpdateResourceDataSync -> Text -> UpdateResourceDataSync)
-> Lens UpdateResourceDataSync UpdateResourceDataSync Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateResourceDataSync' {Text
syncType :: Text
$sel:syncType:UpdateResourceDataSync' :: UpdateResourceDataSync -> Text
syncType} -> Text
syncType) (\s :: UpdateResourceDataSync
s@UpdateResourceDataSync' {} Text
a -> UpdateResourceDataSync
s {$sel:syncType:UpdateResourceDataSync' :: Text
syncType = Text
a} :: UpdateResourceDataSync)
updateResourceDataSync_syncSource :: Lens.Lens' UpdateResourceDataSync ResourceDataSyncSource
updateResourceDataSync_syncSource :: (ResourceDataSyncSource -> f ResourceDataSyncSource)
-> UpdateResourceDataSync -> f UpdateResourceDataSync
updateResourceDataSync_syncSource = (UpdateResourceDataSync -> ResourceDataSyncSource)
-> (UpdateResourceDataSync
-> ResourceDataSyncSource -> UpdateResourceDataSync)
-> Lens
UpdateResourceDataSync
UpdateResourceDataSync
ResourceDataSyncSource
ResourceDataSyncSource
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateResourceDataSync' {ResourceDataSyncSource
syncSource :: ResourceDataSyncSource
$sel:syncSource:UpdateResourceDataSync' :: UpdateResourceDataSync -> ResourceDataSyncSource
syncSource} -> ResourceDataSyncSource
syncSource) (\s :: UpdateResourceDataSync
s@UpdateResourceDataSync' {} ResourceDataSyncSource
a -> UpdateResourceDataSync
s {$sel:syncSource:UpdateResourceDataSync' :: ResourceDataSyncSource
syncSource = ResourceDataSyncSource
a} :: UpdateResourceDataSync)
instance Core.AWSRequest UpdateResourceDataSync where
type
AWSResponse UpdateResourceDataSync =
UpdateResourceDataSyncResponse
request :: UpdateResourceDataSync -> Request UpdateResourceDataSync
request = Service -> UpdateResourceDataSync -> Request UpdateResourceDataSync
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateResourceDataSync
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateResourceDataSync)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse UpdateResourceDataSync))
-> Logger
-> Service
-> Proxy UpdateResourceDataSync
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateResourceDataSync)))
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 -> UpdateResourceDataSyncResponse
UpdateResourceDataSyncResponse'
(Int -> UpdateResourceDataSyncResponse)
-> Either String Int
-> Either String UpdateResourceDataSyncResponse
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 UpdateResourceDataSync
instance Prelude.NFData UpdateResourceDataSync
instance Core.ToHeaders UpdateResourceDataSync where
toHeaders :: UpdateResourceDataSync -> ResponseHeaders
toHeaders =
ResponseHeaders -> UpdateResourceDataSync -> 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.UpdateResourceDataSync" ::
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 UpdateResourceDataSync where
toJSON :: UpdateResourceDataSync -> Value
toJSON UpdateResourceDataSync' {Text
ResourceDataSyncSource
syncSource :: ResourceDataSyncSource
syncType :: Text
syncName :: Text
$sel:syncSource:UpdateResourceDataSync' :: UpdateResourceDataSync -> ResourceDataSyncSource
$sel:syncType:UpdateResourceDataSync' :: UpdateResourceDataSync -> Text
$sel:syncName:UpdateResourceDataSync' :: UpdateResourceDataSync -> 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
"SyncName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
syncName),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"SyncType" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
syncType),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"SyncSource" Text -> ResourceDataSyncSource -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ResourceDataSyncSource
syncSource)
]
)
instance Core.ToPath UpdateResourceDataSync where
toPath :: UpdateResourceDataSync -> ByteString
toPath = ByteString -> UpdateResourceDataSync -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery UpdateResourceDataSync where
toQuery :: UpdateResourceDataSync -> QueryString
toQuery = QueryString -> UpdateResourceDataSync -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data UpdateResourceDataSyncResponse = UpdateResourceDataSyncResponse'
{
UpdateResourceDataSyncResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateResourceDataSyncResponse
-> UpdateResourceDataSyncResponse -> Bool
(UpdateResourceDataSyncResponse
-> UpdateResourceDataSyncResponse -> Bool)
-> (UpdateResourceDataSyncResponse
-> UpdateResourceDataSyncResponse -> Bool)
-> Eq UpdateResourceDataSyncResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateResourceDataSyncResponse
-> UpdateResourceDataSyncResponse -> Bool
$c/= :: UpdateResourceDataSyncResponse
-> UpdateResourceDataSyncResponse -> Bool
== :: UpdateResourceDataSyncResponse
-> UpdateResourceDataSyncResponse -> Bool
$c== :: UpdateResourceDataSyncResponse
-> UpdateResourceDataSyncResponse -> Bool
Prelude.Eq, ReadPrec [UpdateResourceDataSyncResponse]
ReadPrec UpdateResourceDataSyncResponse
Int -> ReadS UpdateResourceDataSyncResponse
ReadS [UpdateResourceDataSyncResponse]
(Int -> ReadS UpdateResourceDataSyncResponse)
-> ReadS [UpdateResourceDataSyncResponse]
-> ReadPrec UpdateResourceDataSyncResponse
-> ReadPrec [UpdateResourceDataSyncResponse]
-> Read UpdateResourceDataSyncResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateResourceDataSyncResponse]
$creadListPrec :: ReadPrec [UpdateResourceDataSyncResponse]
readPrec :: ReadPrec UpdateResourceDataSyncResponse
$creadPrec :: ReadPrec UpdateResourceDataSyncResponse
readList :: ReadS [UpdateResourceDataSyncResponse]
$creadList :: ReadS [UpdateResourceDataSyncResponse]
readsPrec :: Int -> ReadS UpdateResourceDataSyncResponse
$creadsPrec :: Int -> ReadS UpdateResourceDataSyncResponse
Prelude.Read, Int -> UpdateResourceDataSyncResponse -> ShowS
[UpdateResourceDataSyncResponse] -> ShowS
UpdateResourceDataSyncResponse -> String
(Int -> UpdateResourceDataSyncResponse -> ShowS)
-> (UpdateResourceDataSyncResponse -> String)
-> ([UpdateResourceDataSyncResponse] -> ShowS)
-> Show UpdateResourceDataSyncResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateResourceDataSyncResponse] -> ShowS
$cshowList :: [UpdateResourceDataSyncResponse] -> ShowS
show :: UpdateResourceDataSyncResponse -> String
$cshow :: UpdateResourceDataSyncResponse -> String
showsPrec :: Int -> UpdateResourceDataSyncResponse -> ShowS
$cshowsPrec :: Int -> UpdateResourceDataSyncResponse -> ShowS
Prelude.Show, (forall x.
UpdateResourceDataSyncResponse
-> Rep UpdateResourceDataSyncResponse x)
-> (forall x.
Rep UpdateResourceDataSyncResponse x
-> UpdateResourceDataSyncResponse)
-> Generic UpdateResourceDataSyncResponse
forall x.
Rep UpdateResourceDataSyncResponse x
-> UpdateResourceDataSyncResponse
forall x.
UpdateResourceDataSyncResponse
-> Rep UpdateResourceDataSyncResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateResourceDataSyncResponse x
-> UpdateResourceDataSyncResponse
$cfrom :: forall x.
UpdateResourceDataSyncResponse
-> Rep UpdateResourceDataSyncResponse x
Prelude.Generic)
newUpdateResourceDataSyncResponse ::
Prelude.Int ->
UpdateResourceDataSyncResponse
newUpdateResourceDataSyncResponse :: Int -> UpdateResourceDataSyncResponse
newUpdateResourceDataSyncResponse Int
pHttpStatus_ =
UpdateResourceDataSyncResponse' :: Int -> UpdateResourceDataSyncResponse
UpdateResourceDataSyncResponse'
{ $sel:httpStatus:UpdateResourceDataSyncResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
updateResourceDataSyncResponse_httpStatus :: Lens.Lens' UpdateResourceDataSyncResponse Prelude.Int
updateResourceDataSyncResponse_httpStatus :: (Int -> f Int)
-> UpdateResourceDataSyncResponse
-> f UpdateResourceDataSyncResponse
updateResourceDataSyncResponse_httpStatus = (UpdateResourceDataSyncResponse -> Int)
-> (UpdateResourceDataSyncResponse
-> Int -> UpdateResourceDataSyncResponse)
-> Lens
UpdateResourceDataSyncResponse
UpdateResourceDataSyncResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateResourceDataSyncResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateResourceDataSyncResponse' :: UpdateResourceDataSyncResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateResourceDataSyncResponse
s@UpdateResourceDataSyncResponse' {} Int
a -> UpdateResourceDataSyncResponse
s {$sel:httpStatus:UpdateResourceDataSyncResponse' :: Int
httpStatus = Int
a} :: UpdateResourceDataSyncResponse)
instance
Prelude.NFData
UpdateResourceDataSyncResponse