{-# 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.UpdateDocumentDefaultVersion
(
UpdateDocumentDefaultVersion (..),
newUpdateDocumentDefaultVersion,
updateDocumentDefaultVersion_name,
updateDocumentDefaultVersion_documentVersion,
UpdateDocumentDefaultVersionResponse (..),
newUpdateDocumentDefaultVersionResponse,
updateDocumentDefaultVersionResponse_description,
updateDocumentDefaultVersionResponse_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 UpdateDocumentDefaultVersion = UpdateDocumentDefaultVersion'
{
UpdateDocumentDefaultVersion -> Text
name :: Prelude.Text,
UpdateDocumentDefaultVersion -> Text
documentVersion :: Prelude.Text
}
deriving (UpdateDocumentDefaultVersion
-> UpdateDocumentDefaultVersion -> Bool
(UpdateDocumentDefaultVersion
-> UpdateDocumentDefaultVersion -> Bool)
-> (UpdateDocumentDefaultVersion
-> UpdateDocumentDefaultVersion -> Bool)
-> Eq UpdateDocumentDefaultVersion
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateDocumentDefaultVersion
-> UpdateDocumentDefaultVersion -> Bool
$c/= :: UpdateDocumentDefaultVersion
-> UpdateDocumentDefaultVersion -> Bool
== :: UpdateDocumentDefaultVersion
-> UpdateDocumentDefaultVersion -> Bool
$c== :: UpdateDocumentDefaultVersion
-> UpdateDocumentDefaultVersion -> Bool
Prelude.Eq, ReadPrec [UpdateDocumentDefaultVersion]
ReadPrec UpdateDocumentDefaultVersion
Int -> ReadS UpdateDocumentDefaultVersion
ReadS [UpdateDocumentDefaultVersion]
(Int -> ReadS UpdateDocumentDefaultVersion)
-> ReadS [UpdateDocumentDefaultVersion]
-> ReadPrec UpdateDocumentDefaultVersion
-> ReadPrec [UpdateDocumentDefaultVersion]
-> Read UpdateDocumentDefaultVersion
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateDocumentDefaultVersion]
$creadListPrec :: ReadPrec [UpdateDocumentDefaultVersion]
readPrec :: ReadPrec UpdateDocumentDefaultVersion
$creadPrec :: ReadPrec UpdateDocumentDefaultVersion
readList :: ReadS [UpdateDocumentDefaultVersion]
$creadList :: ReadS [UpdateDocumentDefaultVersion]
readsPrec :: Int -> ReadS UpdateDocumentDefaultVersion
$creadsPrec :: Int -> ReadS UpdateDocumentDefaultVersion
Prelude.Read, Int -> UpdateDocumentDefaultVersion -> ShowS
[UpdateDocumentDefaultVersion] -> ShowS
UpdateDocumentDefaultVersion -> String
(Int -> UpdateDocumentDefaultVersion -> ShowS)
-> (UpdateDocumentDefaultVersion -> String)
-> ([UpdateDocumentDefaultVersion] -> ShowS)
-> Show UpdateDocumentDefaultVersion
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateDocumentDefaultVersion] -> ShowS
$cshowList :: [UpdateDocumentDefaultVersion] -> ShowS
show :: UpdateDocumentDefaultVersion -> String
$cshow :: UpdateDocumentDefaultVersion -> String
showsPrec :: Int -> UpdateDocumentDefaultVersion -> ShowS
$cshowsPrec :: Int -> UpdateDocumentDefaultVersion -> ShowS
Prelude.Show, (forall x.
UpdateDocumentDefaultVersion -> Rep UpdateDocumentDefaultVersion x)
-> (forall x.
Rep UpdateDocumentDefaultVersion x -> UpdateDocumentDefaultVersion)
-> Generic UpdateDocumentDefaultVersion
forall x.
Rep UpdateDocumentDefaultVersion x -> UpdateDocumentDefaultVersion
forall x.
UpdateDocumentDefaultVersion -> Rep UpdateDocumentDefaultVersion x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateDocumentDefaultVersion x -> UpdateDocumentDefaultVersion
$cfrom :: forall x.
UpdateDocumentDefaultVersion -> Rep UpdateDocumentDefaultVersion x
Prelude.Generic)
newUpdateDocumentDefaultVersion ::
Prelude.Text ->
Prelude.Text ->
UpdateDocumentDefaultVersion
newUpdateDocumentDefaultVersion :: Text -> Text -> UpdateDocumentDefaultVersion
newUpdateDocumentDefaultVersion
Text
pName_
Text
pDocumentVersion_ =
UpdateDocumentDefaultVersion' :: Text -> Text -> UpdateDocumentDefaultVersion
UpdateDocumentDefaultVersion'
{ $sel:name:UpdateDocumentDefaultVersion' :: Text
name = Text
pName_,
$sel:documentVersion:UpdateDocumentDefaultVersion' :: Text
documentVersion = Text
pDocumentVersion_
}
updateDocumentDefaultVersion_name :: Lens.Lens' UpdateDocumentDefaultVersion Prelude.Text
updateDocumentDefaultVersion_name :: (Text -> f Text)
-> UpdateDocumentDefaultVersion -> f UpdateDocumentDefaultVersion
updateDocumentDefaultVersion_name = (UpdateDocumentDefaultVersion -> Text)
-> (UpdateDocumentDefaultVersion
-> Text -> UpdateDocumentDefaultVersion)
-> Lens
UpdateDocumentDefaultVersion UpdateDocumentDefaultVersion Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDocumentDefaultVersion' {Text
name :: Text
$sel:name:UpdateDocumentDefaultVersion' :: UpdateDocumentDefaultVersion -> Text
name} -> Text
name) (\s :: UpdateDocumentDefaultVersion
s@UpdateDocumentDefaultVersion' {} Text
a -> UpdateDocumentDefaultVersion
s {$sel:name:UpdateDocumentDefaultVersion' :: Text
name = Text
a} :: UpdateDocumentDefaultVersion)
updateDocumentDefaultVersion_documentVersion :: Lens.Lens' UpdateDocumentDefaultVersion Prelude.Text
updateDocumentDefaultVersion_documentVersion :: (Text -> f Text)
-> UpdateDocumentDefaultVersion -> f UpdateDocumentDefaultVersion
updateDocumentDefaultVersion_documentVersion = (UpdateDocumentDefaultVersion -> Text)
-> (UpdateDocumentDefaultVersion
-> Text -> UpdateDocumentDefaultVersion)
-> Lens
UpdateDocumentDefaultVersion UpdateDocumentDefaultVersion Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDocumentDefaultVersion' {Text
documentVersion :: Text
$sel:documentVersion:UpdateDocumentDefaultVersion' :: UpdateDocumentDefaultVersion -> Text
documentVersion} -> Text
documentVersion) (\s :: UpdateDocumentDefaultVersion
s@UpdateDocumentDefaultVersion' {} Text
a -> UpdateDocumentDefaultVersion
s {$sel:documentVersion:UpdateDocumentDefaultVersion' :: Text
documentVersion = Text
a} :: UpdateDocumentDefaultVersion)
instance Core.AWSRequest UpdateDocumentDefaultVersion where
type
AWSResponse UpdateDocumentDefaultVersion =
UpdateDocumentDefaultVersionResponse
request :: UpdateDocumentDefaultVersion
-> Request UpdateDocumentDefaultVersion
request = Service
-> UpdateDocumentDefaultVersion
-> Request UpdateDocumentDefaultVersion
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateDocumentDefaultVersion
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateDocumentDefaultVersion)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse UpdateDocumentDefaultVersion))
-> Logger
-> Service
-> Proxy UpdateDocumentDefaultVersion
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateDocumentDefaultVersion)))
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 DocumentDefaultVersionDescription
-> Int -> UpdateDocumentDefaultVersionResponse
UpdateDocumentDefaultVersionResponse'
(Maybe DocumentDefaultVersionDescription
-> Int -> UpdateDocumentDefaultVersionResponse)
-> Either String (Maybe DocumentDefaultVersionDescription)
-> Either String (Int -> UpdateDocumentDefaultVersionResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object
-> Text -> Either String (Maybe DocumentDefaultVersionDescription)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Description")
Either String (Int -> UpdateDocumentDefaultVersionResponse)
-> Either String Int
-> Either String UpdateDocumentDefaultVersionResponse
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
UpdateDocumentDefaultVersion
instance Prelude.NFData UpdateDocumentDefaultVersion
instance Core.ToHeaders UpdateDocumentDefaultVersion where
toHeaders :: UpdateDocumentDefaultVersion -> ResponseHeaders
toHeaders =
ResponseHeaders -> UpdateDocumentDefaultVersion -> 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.UpdateDocumentDefaultVersion" ::
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 UpdateDocumentDefaultVersion where
toJSON :: UpdateDocumentDefaultVersion -> Value
toJSON UpdateDocumentDefaultVersion' {Text
documentVersion :: Text
name :: Text
$sel:documentVersion:UpdateDocumentDefaultVersion' :: UpdateDocumentDefaultVersion -> Text
$sel:name:UpdateDocumentDefaultVersion' :: UpdateDocumentDefaultVersion -> 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
"Name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"DocumentVersion" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
documentVersion)
]
)
instance Core.ToPath UpdateDocumentDefaultVersion where
toPath :: UpdateDocumentDefaultVersion -> ByteString
toPath = ByteString -> UpdateDocumentDefaultVersion -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery UpdateDocumentDefaultVersion where
toQuery :: UpdateDocumentDefaultVersion -> QueryString
toQuery = QueryString -> UpdateDocumentDefaultVersion -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data UpdateDocumentDefaultVersionResponse = UpdateDocumentDefaultVersionResponse'
{
UpdateDocumentDefaultVersionResponse
-> Maybe DocumentDefaultVersionDescription
description :: Prelude.Maybe DocumentDefaultVersionDescription,
UpdateDocumentDefaultVersionResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateDocumentDefaultVersionResponse
-> UpdateDocumentDefaultVersionResponse -> Bool
(UpdateDocumentDefaultVersionResponse
-> UpdateDocumentDefaultVersionResponse -> Bool)
-> (UpdateDocumentDefaultVersionResponse
-> UpdateDocumentDefaultVersionResponse -> Bool)
-> Eq UpdateDocumentDefaultVersionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateDocumentDefaultVersionResponse
-> UpdateDocumentDefaultVersionResponse -> Bool
$c/= :: UpdateDocumentDefaultVersionResponse
-> UpdateDocumentDefaultVersionResponse -> Bool
== :: UpdateDocumentDefaultVersionResponse
-> UpdateDocumentDefaultVersionResponse -> Bool
$c== :: UpdateDocumentDefaultVersionResponse
-> UpdateDocumentDefaultVersionResponse -> Bool
Prelude.Eq, ReadPrec [UpdateDocumentDefaultVersionResponse]
ReadPrec UpdateDocumentDefaultVersionResponse
Int -> ReadS UpdateDocumentDefaultVersionResponse
ReadS [UpdateDocumentDefaultVersionResponse]
(Int -> ReadS UpdateDocumentDefaultVersionResponse)
-> ReadS [UpdateDocumentDefaultVersionResponse]
-> ReadPrec UpdateDocumentDefaultVersionResponse
-> ReadPrec [UpdateDocumentDefaultVersionResponse]
-> Read UpdateDocumentDefaultVersionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateDocumentDefaultVersionResponse]
$creadListPrec :: ReadPrec [UpdateDocumentDefaultVersionResponse]
readPrec :: ReadPrec UpdateDocumentDefaultVersionResponse
$creadPrec :: ReadPrec UpdateDocumentDefaultVersionResponse
readList :: ReadS [UpdateDocumentDefaultVersionResponse]
$creadList :: ReadS [UpdateDocumentDefaultVersionResponse]
readsPrec :: Int -> ReadS UpdateDocumentDefaultVersionResponse
$creadsPrec :: Int -> ReadS UpdateDocumentDefaultVersionResponse
Prelude.Read, Int -> UpdateDocumentDefaultVersionResponse -> ShowS
[UpdateDocumentDefaultVersionResponse] -> ShowS
UpdateDocumentDefaultVersionResponse -> String
(Int -> UpdateDocumentDefaultVersionResponse -> ShowS)
-> (UpdateDocumentDefaultVersionResponse -> String)
-> ([UpdateDocumentDefaultVersionResponse] -> ShowS)
-> Show UpdateDocumentDefaultVersionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateDocumentDefaultVersionResponse] -> ShowS
$cshowList :: [UpdateDocumentDefaultVersionResponse] -> ShowS
show :: UpdateDocumentDefaultVersionResponse -> String
$cshow :: UpdateDocumentDefaultVersionResponse -> String
showsPrec :: Int -> UpdateDocumentDefaultVersionResponse -> ShowS
$cshowsPrec :: Int -> UpdateDocumentDefaultVersionResponse -> ShowS
Prelude.Show, (forall x.
UpdateDocumentDefaultVersionResponse
-> Rep UpdateDocumentDefaultVersionResponse x)
-> (forall x.
Rep UpdateDocumentDefaultVersionResponse x
-> UpdateDocumentDefaultVersionResponse)
-> Generic UpdateDocumentDefaultVersionResponse
forall x.
Rep UpdateDocumentDefaultVersionResponse x
-> UpdateDocumentDefaultVersionResponse
forall x.
UpdateDocumentDefaultVersionResponse
-> Rep UpdateDocumentDefaultVersionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateDocumentDefaultVersionResponse x
-> UpdateDocumentDefaultVersionResponse
$cfrom :: forall x.
UpdateDocumentDefaultVersionResponse
-> Rep UpdateDocumentDefaultVersionResponse x
Prelude.Generic)
newUpdateDocumentDefaultVersionResponse ::
Prelude.Int ->
UpdateDocumentDefaultVersionResponse
newUpdateDocumentDefaultVersionResponse :: Int -> UpdateDocumentDefaultVersionResponse
newUpdateDocumentDefaultVersionResponse Int
pHttpStatus_ =
UpdateDocumentDefaultVersionResponse' :: Maybe DocumentDefaultVersionDescription
-> Int -> UpdateDocumentDefaultVersionResponse
UpdateDocumentDefaultVersionResponse'
{ $sel:description:UpdateDocumentDefaultVersionResponse' :: Maybe DocumentDefaultVersionDescription
description =
Maybe DocumentDefaultVersionDescription
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:UpdateDocumentDefaultVersionResponse' :: Int
httpStatus = Int
pHttpStatus_
}
updateDocumentDefaultVersionResponse_description :: Lens.Lens' UpdateDocumentDefaultVersionResponse (Prelude.Maybe DocumentDefaultVersionDescription)
updateDocumentDefaultVersionResponse_description :: (Maybe DocumentDefaultVersionDescription
-> f (Maybe DocumentDefaultVersionDescription))
-> UpdateDocumentDefaultVersionResponse
-> f UpdateDocumentDefaultVersionResponse
updateDocumentDefaultVersionResponse_description = (UpdateDocumentDefaultVersionResponse
-> Maybe DocumentDefaultVersionDescription)
-> (UpdateDocumentDefaultVersionResponse
-> Maybe DocumentDefaultVersionDescription
-> UpdateDocumentDefaultVersionResponse)
-> Lens
UpdateDocumentDefaultVersionResponse
UpdateDocumentDefaultVersionResponse
(Maybe DocumentDefaultVersionDescription)
(Maybe DocumentDefaultVersionDescription)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDocumentDefaultVersionResponse' {Maybe DocumentDefaultVersionDescription
description :: Maybe DocumentDefaultVersionDescription
$sel:description:UpdateDocumentDefaultVersionResponse' :: UpdateDocumentDefaultVersionResponse
-> Maybe DocumentDefaultVersionDescription
description} -> Maybe DocumentDefaultVersionDescription
description) (\s :: UpdateDocumentDefaultVersionResponse
s@UpdateDocumentDefaultVersionResponse' {} Maybe DocumentDefaultVersionDescription
a -> UpdateDocumentDefaultVersionResponse
s {$sel:description:UpdateDocumentDefaultVersionResponse' :: Maybe DocumentDefaultVersionDescription
description = Maybe DocumentDefaultVersionDescription
a} :: UpdateDocumentDefaultVersionResponse)
updateDocumentDefaultVersionResponse_httpStatus :: Lens.Lens' UpdateDocumentDefaultVersionResponse Prelude.Int
updateDocumentDefaultVersionResponse_httpStatus :: (Int -> f Int)
-> UpdateDocumentDefaultVersionResponse
-> f UpdateDocumentDefaultVersionResponse
updateDocumentDefaultVersionResponse_httpStatus = (UpdateDocumentDefaultVersionResponse -> Int)
-> (UpdateDocumentDefaultVersionResponse
-> Int -> UpdateDocumentDefaultVersionResponse)
-> Lens
UpdateDocumentDefaultVersionResponse
UpdateDocumentDefaultVersionResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDocumentDefaultVersionResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateDocumentDefaultVersionResponse' :: UpdateDocumentDefaultVersionResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateDocumentDefaultVersionResponse
s@UpdateDocumentDefaultVersionResponse' {} Int
a -> UpdateDocumentDefaultVersionResponse
s {$sel:httpStatus:UpdateDocumentDefaultVersionResponse' :: Int
httpStatus = Int
a} :: UpdateDocumentDefaultVersionResponse)
instance
Prelude.NFData
UpdateDocumentDefaultVersionResponse