{-# 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.Proton.DeleteServiceTemplateVersion
(
DeleteServiceTemplateVersion (..),
newDeleteServiceTemplateVersion,
deleteServiceTemplateVersion_majorVersion,
deleteServiceTemplateVersion_minorVersion,
deleteServiceTemplateVersion_templateName,
DeleteServiceTemplateVersionResponse (..),
newDeleteServiceTemplateVersionResponse,
deleteServiceTemplateVersionResponse_serviceTemplateVersion,
deleteServiceTemplateVersionResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Proton.Types
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DeleteServiceTemplateVersion = DeleteServiceTemplateVersion'
{
DeleteServiceTemplateVersion -> Text
majorVersion :: Prelude.Text,
DeleteServiceTemplateVersion -> Text
minorVersion :: Prelude.Text,
DeleteServiceTemplateVersion -> Text
templateName :: Prelude.Text
}
deriving (DeleteServiceTemplateVersion
-> DeleteServiceTemplateVersion -> Bool
(DeleteServiceTemplateVersion
-> DeleteServiceTemplateVersion -> Bool)
-> (DeleteServiceTemplateVersion
-> DeleteServiceTemplateVersion -> Bool)
-> Eq DeleteServiceTemplateVersion
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteServiceTemplateVersion
-> DeleteServiceTemplateVersion -> Bool
$c/= :: DeleteServiceTemplateVersion
-> DeleteServiceTemplateVersion -> Bool
== :: DeleteServiceTemplateVersion
-> DeleteServiceTemplateVersion -> Bool
$c== :: DeleteServiceTemplateVersion
-> DeleteServiceTemplateVersion -> Bool
Prelude.Eq, ReadPrec [DeleteServiceTemplateVersion]
ReadPrec DeleteServiceTemplateVersion
Int -> ReadS DeleteServiceTemplateVersion
ReadS [DeleteServiceTemplateVersion]
(Int -> ReadS DeleteServiceTemplateVersion)
-> ReadS [DeleteServiceTemplateVersion]
-> ReadPrec DeleteServiceTemplateVersion
-> ReadPrec [DeleteServiceTemplateVersion]
-> Read DeleteServiceTemplateVersion
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteServiceTemplateVersion]
$creadListPrec :: ReadPrec [DeleteServiceTemplateVersion]
readPrec :: ReadPrec DeleteServiceTemplateVersion
$creadPrec :: ReadPrec DeleteServiceTemplateVersion
readList :: ReadS [DeleteServiceTemplateVersion]
$creadList :: ReadS [DeleteServiceTemplateVersion]
readsPrec :: Int -> ReadS DeleteServiceTemplateVersion
$creadsPrec :: Int -> ReadS DeleteServiceTemplateVersion
Prelude.Read, Int -> DeleteServiceTemplateVersion -> ShowS
[DeleteServiceTemplateVersion] -> ShowS
DeleteServiceTemplateVersion -> String
(Int -> DeleteServiceTemplateVersion -> ShowS)
-> (DeleteServiceTemplateVersion -> String)
-> ([DeleteServiceTemplateVersion] -> ShowS)
-> Show DeleteServiceTemplateVersion
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteServiceTemplateVersion] -> ShowS
$cshowList :: [DeleteServiceTemplateVersion] -> ShowS
show :: DeleteServiceTemplateVersion -> String
$cshow :: DeleteServiceTemplateVersion -> String
showsPrec :: Int -> DeleteServiceTemplateVersion -> ShowS
$cshowsPrec :: Int -> DeleteServiceTemplateVersion -> ShowS
Prelude.Show, (forall x.
DeleteServiceTemplateVersion -> Rep DeleteServiceTemplateVersion x)
-> (forall x.
Rep DeleteServiceTemplateVersion x -> DeleteServiceTemplateVersion)
-> Generic DeleteServiceTemplateVersion
forall x.
Rep DeleteServiceTemplateVersion x -> DeleteServiceTemplateVersion
forall x.
DeleteServiceTemplateVersion -> Rep DeleteServiceTemplateVersion x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteServiceTemplateVersion x -> DeleteServiceTemplateVersion
$cfrom :: forall x.
DeleteServiceTemplateVersion -> Rep DeleteServiceTemplateVersion x
Prelude.Generic)
newDeleteServiceTemplateVersion ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
DeleteServiceTemplateVersion
newDeleteServiceTemplateVersion :: Text -> Text -> Text -> DeleteServiceTemplateVersion
newDeleteServiceTemplateVersion
Text
pMajorVersion_
Text
pMinorVersion_
Text
pTemplateName_ =
DeleteServiceTemplateVersion' :: Text -> Text -> Text -> DeleteServiceTemplateVersion
DeleteServiceTemplateVersion'
{ $sel:majorVersion:DeleteServiceTemplateVersion' :: Text
majorVersion =
Text
pMajorVersion_,
$sel:minorVersion:DeleteServiceTemplateVersion' :: Text
minorVersion = Text
pMinorVersion_,
$sel:templateName:DeleteServiceTemplateVersion' :: Text
templateName = Text
pTemplateName_
}
deleteServiceTemplateVersion_majorVersion :: Lens.Lens' DeleteServiceTemplateVersion Prelude.Text
deleteServiceTemplateVersion_majorVersion :: (Text -> f Text)
-> DeleteServiceTemplateVersion -> f DeleteServiceTemplateVersion
deleteServiceTemplateVersion_majorVersion = (DeleteServiceTemplateVersion -> Text)
-> (DeleteServiceTemplateVersion
-> Text -> DeleteServiceTemplateVersion)
-> Lens
DeleteServiceTemplateVersion DeleteServiceTemplateVersion Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteServiceTemplateVersion' {Text
majorVersion :: Text
$sel:majorVersion:DeleteServiceTemplateVersion' :: DeleteServiceTemplateVersion -> Text
majorVersion} -> Text
majorVersion) (\s :: DeleteServiceTemplateVersion
s@DeleteServiceTemplateVersion' {} Text
a -> DeleteServiceTemplateVersion
s {$sel:majorVersion:DeleteServiceTemplateVersion' :: Text
majorVersion = Text
a} :: DeleteServiceTemplateVersion)
deleteServiceTemplateVersion_minorVersion :: Lens.Lens' DeleteServiceTemplateVersion Prelude.Text
deleteServiceTemplateVersion_minorVersion :: (Text -> f Text)
-> DeleteServiceTemplateVersion -> f DeleteServiceTemplateVersion
deleteServiceTemplateVersion_minorVersion = (DeleteServiceTemplateVersion -> Text)
-> (DeleteServiceTemplateVersion
-> Text -> DeleteServiceTemplateVersion)
-> Lens
DeleteServiceTemplateVersion DeleteServiceTemplateVersion Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteServiceTemplateVersion' {Text
minorVersion :: Text
$sel:minorVersion:DeleteServiceTemplateVersion' :: DeleteServiceTemplateVersion -> Text
minorVersion} -> Text
minorVersion) (\s :: DeleteServiceTemplateVersion
s@DeleteServiceTemplateVersion' {} Text
a -> DeleteServiceTemplateVersion
s {$sel:minorVersion:DeleteServiceTemplateVersion' :: Text
minorVersion = Text
a} :: DeleteServiceTemplateVersion)
deleteServiceTemplateVersion_templateName :: Lens.Lens' DeleteServiceTemplateVersion Prelude.Text
deleteServiceTemplateVersion_templateName :: (Text -> f Text)
-> DeleteServiceTemplateVersion -> f DeleteServiceTemplateVersion
deleteServiceTemplateVersion_templateName = (DeleteServiceTemplateVersion -> Text)
-> (DeleteServiceTemplateVersion
-> Text -> DeleteServiceTemplateVersion)
-> Lens
DeleteServiceTemplateVersion DeleteServiceTemplateVersion Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteServiceTemplateVersion' {Text
templateName :: Text
$sel:templateName:DeleteServiceTemplateVersion' :: DeleteServiceTemplateVersion -> Text
templateName} -> Text
templateName) (\s :: DeleteServiceTemplateVersion
s@DeleteServiceTemplateVersion' {} Text
a -> DeleteServiceTemplateVersion
s {$sel:templateName:DeleteServiceTemplateVersion' :: Text
templateName = Text
a} :: DeleteServiceTemplateVersion)
instance Core.AWSRequest DeleteServiceTemplateVersion where
type
AWSResponse DeleteServiceTemplateVersion =
DeleteServiceTemplateVersionResponse
request :: DeleteServiceTemplateVersion
-> Request DeleteServiceTemplateVersion
request = Service
-> DeleteServiceTemplateVersion
-> Request DeleteServiceTemplateVersion
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteServiceTemplateVersion
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteServiceTemplateVersion)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DeleteServiceTemplateVersion))
-> Logger
-> Service
-> Proxy DeleteServiceTemplateVersion
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteServiceTemplateVersion)))
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 ServiceTemplateVersion
-> Int -> DeleteServiceTemplateVersionResponse
DeleteServiceTemplateVersionResponse'
(Maybe ServiceTemplateVersion
-> Int -> DeleteServiceTemplateVersionResponse)
-> Either String (Maybe ServiceTemplateVersion)
-> Either String (Int -> DeleteServiceTemplateVersionResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe ServiceTemplateVersion)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"serviceTemplateVersion")
Either String (Int -> DeleteServiceTemplateVersionResponse)
-> Either String Int
-> Either String DeleteServiceTemplateVersionResponse
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
DeleteServiceTemplateVersion
instance Prelude.NFData DeleteServiceTemplateVersion
instance Core.ToHeaders DeleteServiceTemplateVersion where
toHeaders :: DeleteServiceTemplateVersion -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteServiceTemplateVersion -> 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
"AwsProton20200720.DeleteServiceTemplateVersion" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.0" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON DeleteServiceTemplateVersion where
toJSON :: DeleteServiceTemplateVersion -> Value
toJSON DeleteServiceTemplateVersion' {Text
templateName :: Text
minorVersion :: Text
majorVersion :: Text
$sel:templateName:DeleteServiceTemplateVersion' :: DeleteServiceTemplateVersion -> Text
$sel:minorVersion:DeleteServiceTemplateVersion' :: DeleteServiceTemplateVersion -> Text
$sel:majorVersion:DeleteServiceTemplateVersion' :: DeleteServiceTemplateVersion -> 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
"majorVersion" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
majorVersion),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"minorVersion" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
minorVersion),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"templateName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
templateName)
]
)
instance Core.ToPath DeleteServiceTemplateVersion where
toPath :: DeleteServiceTemplateVersion -> ByteString
toPath = ByteString -> DeleteServiceTemplateVersion -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DeleteServiceTemplateVersion where
toQuery :: DeleteServiceTemplateVersion -> QueryString
toQuery = QueryString -> DeleteServiceTemplateVersion -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteServiceTemplateVersionResponse = DeleteServiceTemplateVersionResponse'
{
DeleteServiceTemplateVersionResponse
-> Maybe ServiceTemplateVersion
serviceTemplateVersion :: Prelude.Maybe ServiceTemplateVersion,
DeleteServiceTemplateVersionResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteServiceTemplateVersionResponse
-> DeleteServiceTemplateVersionResponse -> Bool
(DeleteServiceTemplateVersionResponse
-> DeleteServiceTemplateVersionResponse -> Bool)
-> (DeleteServiceTemplateVersionResponse
-> DeleteServiceTemplateVersionResponse -> Bool)
-> Eq DeleteServiceTemplateVersionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteServiceTemplateVersionResponse
-> DeleteServiceTemplateVersionResponse -> Bool
$c/= :: DeleteServiceTemplateVersionResponse
-> DeleteServiceTemplateVersionResponse -> Bool
== :: DeleteServiceTemplateVersionResponse
-> DeleteServiceTemplateVersionResponse -> Bool
$c== :: DeleteServiceTemplateVersionResponse
-> DeleteServiceTemplateVersionResponse -> Bool
Prelude.Eq, Int -> DeleteServiceTemplateVersionResponse -> ShowS
[DeleteServiceTemplateVersionResponse] -> ShowS
DeleteServiceTemplateVersionResponse -> String
(Int -> DeleteServiceTemplateVersionResponse -> ShowS)
-> (DeleteServiceTemplateVersionResponse -> String)
-> ([DeleteServiceTemplateVersionResponse] -> ShowS)
-> Show DeleteServiceTemplateVersionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteServiceTemplateVersionResponse] -> ShowS
$cshowList :: [DeleteServiceTemplateVersionResponse] -> ShowS
show :: DeleteServiceTemplateVersionResponse -> String
$cshow :: DeleteServiceTemplateVersionResponse -> String
showsPrec :: Int -> DeleteServiceTemplateVersionResponse -> ShowS
$cshowsPrec :: Int -> DeleteServiceTemplateVersionResponse -> ShowS
Prelude.Show, (forall x.
DeleteServiceTemplateVersionResponse
-> Rep DeleteServiceTemplateVersionResponse x)
-> (forall x.
Rep DeleteServiceTemplateVersionResponse x
-> DeleteServiceTemplateVersionResponse)
-> Generic DeleteServiceTemplateVersionResponse
forall x.
Rep DeleteServiceTemplateVersionResponse x
-> DeleteServiceTemplateVersionResponse
forall x.
DeleteServiceTemplateVersionResponse
-> Rep DeleteServiceTemplateVersionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteServiceTemplateVersionResponse x
-> DeleteServiceTemplateVersionResponse
$cfrom :: forall x.
DeleteServiceTemplateVersionResponse
-> Rep DeleteServiceTemplateVersionResponse x
Prelude.Generic)
newDeleteServiceTemplateVersionResponse ::
Prelude.Int ->
DeleteServiceTemplateVersionResponse
newDeleteServiceTemplateVersionResponse :: Int -> DeleteServiceTemplateVersionResponse
newDeleteServiceTemplateVersionResponse Int
pHttpStatus_ =
DeleteServiceTemplateVersionResponse' :: Maybe ServiceTemplateVersion
-> Int -> DeleteServiceTemplateVersionResponse
DeleteServiceTemplateVersionResponse'
{ $sel:serviceTemplateVersion:DeleteServiceTemplateVersionResponse' :: Maybe ServiceTemplateVersion
serviceTemplateVersion =
Maybe ServiceTemplateVersion
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DeleteServiceTemplateVersionResponse' :: Int
httpStatus = Int
pHttpStatus_
}
deleteServiceTemplateVersionResponse_serviceTemplateVersion :: Lens.Lens' DeleteServiceTemplateVersionResponse (Prelude.Maybe ServiceTemplateVersion)
deleteServiceTemplateVersionResponse_serviceTemplateVersion :: (Maybe ServiceTemplateVersion -> f (Maybe ServiceTemplateVersion))
-> DeleteServiceTemplateVersionResponse
-> f DeleteServiceTemplateVersionResponse
deleteServiceTemplateVersionResponse_serviceTemplateVersion = (DeleteServiceTemplateVersionResponse
-> Maybe ServiceTemplateVersion)
-> (DeleteServiceTemplateVersionResponse
-> Maybe ServiceTemplateVersion
-> DeleteServiceTemplateVersionResponse)
-> Lens
DeleteServiceTemplateVersionResponse
DeleteServiceTemplateVersionResponse
(Maybe ServiceTemplateVersion)
(Maybe ServiceTemplateVersion)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteServiceTemplateVersionResponse' {Maybe ServiceTemplateVersion
serviceTemplateVersion :: Maybe ServiceTemplateVersion
$sel:serviceTemplateVersion:DeleteServiceTemplateVersionResponse' :: DeleteServiceTemplateVersionResponse
-> Maybe ServiceTemplateVersion
serviceTemplateVersion} -> Maybe ServiceTemplateVersion
serviceTemplateVersion) (\s :: DeleteServiceTemplateVersionResponse
s@DeleteServiceTemplateVersionResponse' {} Maybe ServiceTemplateVersion
a -> DeleteServiceTemplateVersionResponse
s {$sel:serviceTemplateVersion:DeleteServiceTemplateVersionResponse' :: Maybe ServiceTemplateVersion
serviceTemplateVersion = Maybe ServiceTemplateVersion
a} :: DeleteServiceTemplateVersionResponse)
deleteServiceTemplateVersionResponse_httpStatus :: Lens.Lens' DeleteServiceTemplateVersionResponse Prelude.Int
deleteServiceTemplateVersionResponse_httpStatus :: (Int -> f Int)
-> DeleteServiceTemplateVersionResponse
-> f DeleteServiceTemplateVersionResponse
deleteServiceTemplateVersionResponse_httpStatus = (DeleteServiceTemplateVersionResponse -> Int)
-> (DeleteServiceTemplateVersionResponse
-> Int -> DeleteServiceTemplateVersionResponse)
-> Lens
DeleteServiceTemplateVersionResponse
DeleteServiceTemplateVersionResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteServiceTemplateVersionResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteServiceTemplateVersionResponse' :: DeleteServiceTemplateVersionResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteServiceTemplateVersionResponse
s@DeleteServiceTemplateVersionResponse' {} Int
a -> DeleteServiceTemplateVersionResponse
s {$sel:httpStatus:DeleteServiceTemplateVersionResponse' :: Int
httpStatus = Int
a} :: DeleteServiceTemplateVersionResponse)
instance
Prelude.NFData
DeleteServiceTemplateVersionResponse