{-# 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.ServiceCatalog.DeleteTagOption
(
DeleteTagOption (..),
newDeleteTagOption,
deleteTagOption_id,
DeleteTagOptionResponse (..),
newDeleteTagOptionResponse,
deleteTagOptionResponse_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.ServiceCatalog.Types
data DeleteTagOption = DeleteTagOption'
{
DeleteTagOption -> Text
id :: Prelude.Text
}
deriving (DeleteTagOption -> DeleteTagOption -> Bool
(DeleteTagOption -> DeleteTagOption -> Bool)
-> (DeleteTagOption -> DeleteTagOption -> Bool)
-> Eq DeleteTagOption
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteTagOption -> DeleteTagOption -> Bool
$c/= :: DeleteTagOption -> DeleteTagOption -> Bool
== :: DeleteTagOption -> DeleteTagOption -> Bool
$c== :: DeleteTagOption -> DeleteTagOption -> Bool
Prelude.Eq, ReadPrec [DeleteTagOption]
ReadPrec DeleteTagOption
Int -> ReadS DeleteTagOption
ReadS [DeleteTagOption]
(Int -> ReadS DeleteTagOption)
-> ReadS [DeleteTagOption]
-> ReadPrec DeleteTagOption
-> ReadPrec [DeleteTagOption]
-> Read DeleteTagOption
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteTagOption]
$creadListPrec :: ReadPrec [DeleteTagOption]
readPrec :: ReadPrec DeleteTagOption
$creadPrec :: ReadPrec DeleteTagOption
readList :: ReadS [DeleteTagOption]
$creadList :: ReadS [DeleteTagOption]
readsPrec :: Int -> ReadS DeleteTagOption
$creadsPrec :: Int -> ReadS DeleteTagOption
Prelude.Read, Int -> DeleteTagOption -> ShowS
[DeleteTagOption] -> ShowS
DeleteTagOption -> String
(Int -> DeleteTagOption -> ShowS)
-> (DeleteTagOption -> String)
-> ([DeleteTagOption] -> ShowS)
-> Show DeleteTagOption
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteTagOption] -> ShowS
$cshowList :: [DeleteTagOption] -> ShowS
show :: DeleteTagOption -> String
$cshow :: DeleteTagOption -> String
showsPrec :: Int -> DeleteTagOption -> ShowS
$cshowsPrec :: Int -> DeleteTagOption -> ShowS
Prelude.Show, (forall x. DeleteTagOption -> Rep DeleteTagOption x)
-> (forall x. Rep DeleteTagOption x -> DeleteTagOption)
-> Generic DeleteTagOption
forall x. Rep DeleteTagOption x -> DeleteTagOption
forall x. DeleteTagOption -> Rep DeleteTagOption x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteTagOption x -> DeleteTagOption
$cfrom :: forall x. DeleteTagOption -> Rep DeleteTagOption x
Prelude.Generic)
newDeleteTagOption ::
Prelude.Text ->
DeleteTagOption
newDeleteTagOption :: Text -> DeleteTagOption
newDeleteTagOption Text
pId_ = DeleteTagOption' :: Text -> DeleteTagOption
DeleteTagOption' {$sel:id:DeleteTagOption' :: Text
id = Text
pId_}
deleteTagOption_id :: Lens.Lens' DeleteTagOption Prelude.Text
deleteTagOption_id :: (Text -> f Text) -> DeleteTagOption -> f DeleteTagOption
deleteTagOption_id = (DeleteTagOption -> Text)
-> (DeleteTagOption -> Text -> DeleteTagOption)
-> Lens DeleteTagOption DeleteTagOption Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteTagOption' {Text
id :: Text
$sel:id:DeleteTagOption' :: DeleteTagOption -> Text
id} -> Text
id) (\s :: DeleteTagOption
s@DeleteTagOption' {} Text
a -> DeleteTagOption
s {$sel:id:DeleteTagOption' :: Text
id = Text
a} :: DeleteTagOption)
instance Core.AWSRequest DeleteTagOption where
type
AWSResponse DeleteTagOption =
DeleteTagOptionResponse
request :: DeleteTagOption -> Request DeleteTagOption
request = Service -> DeleteTagOption -> Request DeleteTagOption
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteTagOption
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteTagOption)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse DeleteTagOption))
-> Logger
-> Service
-> Proxy DeleteTagOption
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteTagOption)))
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 -> DeleteTagOptionResponse
DeleteTagOptionResponse'
(Int -> DeleteTagOptionResponse)
-> Either String Int -> Either String DeleteTagOptionResponse
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 DeleteTagOption
instance Prelude.NFData DeleteTagOption
instance Core.ToHeaders DeleteTagOption where
toHeaders :: DeleteTagOption -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteTagOption -> 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
"AWS242ServiceCatalogService.DeleteTagOption" ::
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 DeleteTagOption where
toJSON :: DeleteTagOption -> Value
toJSON DeleteTagOption' {Text
id :: Text
$sel:id:DeleteTagOption' :: DeleteTagOption -> 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
"Id" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
id)])
instance Core.ToPath DeleteTagOption where
toPath :: DeleteTagOption -> ByteString
toPath = ByteString -> DeleteTagOption -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DeleteTagOption where
toQuery :: DeleteTagOption -> QueryString
toQuery = QueryString -> DeleteTagOption -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteTagOptionResponse = DeleteTagOptionResponse'
{
DeleteTagOptionResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteTagOptionResponse -> DeleteTagOptionResponse -> Bool
(DeleteTagOptionResponse -> DeleteTagOptionResponse -> Bool)
-> (DeleteTagOptionResponse -> DeleteTagOptionResponse -> Bool)
-> Eq DeleteTagOptionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteTagOptionResponse -> DeleteTagOptionResponse -> Bool
$c/= :: DeleteTagOptionResponse -> DeleteTagOptionResponse -> Bool
== :: DeleteTagOptionResponse -> DeleteTagOptionResponse -> Bool
$c== :: DeleteTagOptionResponse -> DeleteTagOptionResponse -> Bool
Prelude.Eq, ReadPrec [DeleteTagOptionResponse]
ReadPrec DeleteTagOptionResponse
Int -> ReadS DeleteTagOptionResponse
ReadS [DeleteTagOptionResponse]
(Int -> ReadS DeleteTagOptionResponse)
-> ReadS [DeleteTagOptionResponse]
-> ReadPrec DeleteTagOptionResponse
-> ReadPrec [DeleteTagOptionResponse]
-> Read DeleteTagOptionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteTagOptionResponse]
$creadListPrec :: ReadPrec [DeleteTagOptionResponse]
readPrec :: ReadPrec DeleteTagOptionResponse
$creadPrec :: ReadPrec DeleteTagOptionResponse
readList :: ReadS [DeleteTagOptionResponse]
$creadList :: ReadS [DeleteTagOptionResponse]
readsPrec :: Int -> ReadS DeleteTagOptionResponse
$creadsPrec :: Int -> ReadS DeleteTagOptionResponse
Prelude.Read, Int -> DeleteTagOptionResponse -> ShowS
[DeleteTagOptionResponse] -> ShowS
DeleteTagOptionResponse -> String
(Int -> DeleteTagOptionResponse -> ShowS)
-> (DeleteTagOptionResponse -> String)
-> ([DeleteTagOptionResponse] -> ShowS)
-> Show DeleteTagOptionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteTagOptionResponse] -> ShowS
$cshowList :: [DeleteTagOptionResponse] -> ShowS
show :: DeleteTagOptionResponse -> String
$cshow :: DeleteTagOptionResponse -> String
showsPrec :: Int -> DeleteTagOptionResponse -> ShowS
$cshowsPrec :: Int -> DeleteTagOptionResponse -> ShowS
Prelude.Show, (forall x.
DeleteTagOptionResponse -> Rep DeleteTagOptionResponse x)
-> (forall x.
Rep DeleteTagOptionResponse x -> DeleteTagOptionResponse)
-> Generic DeleteTagOptionResponse
forall x. Rep DeleteTagOptionResponse x -> DeleteTagOptionResponse
forall x. DeleteTagOptionResponse -> Rep DeleteTagOptionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteTagOptionResponse x -> DeleteTagOptionResponse
$cfrom :: forall x. DeleteTagOptionResponse -> Rep DeleteTagOptionResponse x
Prelude.Generic)
newDeleteTagOptionResponse ::
Prelude.Int ->
DeleteTagOptionResponse
newDeleteTagOptionResponse :: Int -> DeleteTagOptionResponse
newDeleteTagOptionResponse Int
pHttpStatus_ =
DeleteTagOptionResponse' :: Int -> DeleteTagOptionResponse
DeleteTagOptionResponse' {$sel:httpStatus:DeleteTagOptionResponse' :: Int
httpStatus = Int
pHttpStatus_}
deleteTagOptionResponse_httpStatus :: Lens.Lens' DeleteTagOptionResponse Prelude.Int
deleteTagOptionResponse_httpStatus :: (Int -> f Int)
-> DeleteTagOptionResponse -> f DeleteTagOptionResponse
deleteTagOptionResponse_httpStatus = (DeleteTagOptionResponse -> Int)
-> (DeleteTagOptionResponse -> Int -> DeleteTagOptionResponse)
-> Lens DeleteTagOptionResponse DeleteTagOptionResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteTagOptionResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteTagOptionResponse' :: DeleteTagOptionResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteTagOptionResponse
s@DeleteTagOptionResponse' {} Int
a -> DeleteTagOptionResponse
s {$sel:httpStatus:DeleteTagOptionResponse' :: Int
httpStatus = Int
a} :: DeleteTagOptionResponse)
instance Prelude.NFData DeleteTagOptionResponse