{-# 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.DescribeServiceAction
(
DescribeServiceAction (..),
newDescribeServiceAction,
describeServiceAction_acceptLanguage,
describeServiceAction_id,
DescribeServiceActionResponse (..),
newDescribeServiceActionResponse,
describeServiceActionResponse_serviceActionDetail,
describeServiceActionResponse_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 DescribeServiceAction = DescribeServiceAction'
{
DescribeServiceAction -> Maybe Text
acceptLanguage :: Prelude.Maybe Prelude.Text,
DescribeServiceAction -> Text
id :: Prelude.Text
}
deriving (DescribeServiceAction -> DescribeServiceAction -> Bool
(DescribeServiceAction -> DescribeServiceAction -> Bool)
-> (DescribeServiceAction -> DescribeServiceAction -> Bool)
-> Eq DescribeServiceAction
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeServiceAction -> DescribeServiceAction -> Bool
$c/= :: DescribeServiceAction -> DescribeServiceAction -> Bool
== :: DescribeServiceAction -> DescribeServiceAction -> Bool
$c== :: DescribeServiceAction -> DescribeServiceAction -> Bool
Prelude.Eq, ReadPrec [DescribeServiceAction]
ReadPrec DescribeServiceAction
Int -> ReadS DescribeServiceAction
ReadS [DescribeServiceAction]
(Int -> ReadS DescribeServiceAction)
-> ReadS [DescribeServiceAction]
-> ReadPrec DescribeServiceAction
-> ReadPrec [DescribeServiceAction]
-> Read DescribeServiceAction
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeServiceAction]
$creadListPrec :: ReadPrec [DescribeServiceAction]
readPrec :: ReadPrec DescribeServiceAction
$creadPrec :: ReadPrec DescribeServiceAction
readList :: ReadS [DescribeServiceAction]
$creadList :: ReadS [DescribeServiceAction]
readsPrec :: Int -> ReadS DescribeServiceAction
$creadsPrec :: Int -> ReadS DescribeServiceAction
Prelude.Read, Int -> DescribeServiceAction -> ShowS
[DescribeServiceAction] -> ShowS
DescribeServiceAction -> String
(Int -> DescribeServiceAction -> ShowS)
-> (DescribeServiceAction -> String)
-> ([DescribeServiceAction] -> ShowS)
-> Show DescribeServiceAction
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeServiceAction] -> ShowS
$cshowList :: [DescribeServiceAction] -> ShowS
show :: DescribeServiceAction -> String
$cshow :: DescribeServiceAction -> String
showsPrec :: Int -> DescribeServiceAction -> ShowS
$cshowsPrec :: Int -> DescribeServiceAction -> ShowS
Prelude.Show, (forall x. DescribeServiceAction -> Rep DescribeServiceAction x)
-> (forall x. Rep DescribeServiceAction x -> DescribeServiceAction)
-> Generic DescribeServiceAction
forall x. Rep DescribeServiceAction x -> DescribeServiceAction
forall x. DescribeServiceAction -> Rep DescribeServiceAction x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeServiceAction x -> DescribeServiceAction
$cfrom :: forall x. DescribeServiceAction -> Rep DescribeServiceAction x
Prelude.Generic)
newDescribeServiceAction ::
Prelude.Text ->
DescribeServiceAction
newDescribeServiceAction :: Text -> DescribeServiceAction
newDescribeServiceAction Text
pId_ =
DescribeServiceAction' :: Maybe Text -> Text -> DescribeServiceAction
DescribeServiceAction'
{ $sel:acceptLanguage:DescribeServiceAction' :: Maybe Text
acceptLanguage =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:id:DescribeServiceAction' :: Text
id = Text
pId_
}
describeServiceAction_acceptLanguage :: Lens.Lens' DescribeServiceAction (Prelude.Maybe Prelude.Text)
describeServiceAction_acceptLanguage :: (Maybe Text -> f (Maybe Text))
-> DescribeServiceAction -> f DescribeServiceAction
describeServiceAction_acceptLanguage = (DescribeServiceAction -> Maybe Text)
-> (DescribeServiceAction -> Maybe Text -> DescribeServiceAction)
-> Lens
DescribeServiceAction
DescribeServiceAction
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeServiceAction' {Maybe Text
acceptLanguage :: Maybe Text
$sel:acceptLanguage:DescribeServiceAction' :: DescribeServiceAction -> Maybe Text
acceptLanguage} -> Maybe Text
acceptLanguage) (\s :: DescribeServiceAction
s@DescribeServiceAction' {} Maybe Text
a -> DescribeServiceAction
s {$sel:acceptLanguage:DescribeServiceAction' :: Maybe Text
acceptLanguage = Maybe Text
a} :: DescribeServiceAction)
describeServiceAction_id :: Lens.Lens' DescribeServiceAction Prelude.Text
describeServiceAction_id :: (Text -> f Text)
-> DescribeServiceAction -> f DescribeServiceAction
describeServiceAction_id = (DescribeServiceAction -> Text)
-> (DescribeServiceAction -> Text -> DescribeServiceAction)
-> Lens DescribeServiceAction DescribeServiceAction Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeServiceAction' {Text
id :: Text
$sel:id:DescribeServiceAction' :: DescribeServiceAction -> Text
id} -> Text
id) (\s :: DescribeServiceAction
s@DescribeServiceAction' {} Text
a -> DescribeServiceAction
s {$sel:id:DescribeServiceAction' :: Text
id = Text
a} :: DescribeServiceAction)
instance Core.AWSRequest DescribeServiceAction where
type
AWSResponse DescribeServiceAction =
DescribeServiceActionResponse
request :: DescribeServiceAction -> Request DescribeServiceAction
request = Service -> DescribeServiceAction -> Request DescribeServiceAction
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeServiceAction
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeServiceAction)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DescribeServiceAction))
-> Logger
-> Service
-> Proxy DescribeServiceAction
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeServiceAction)))
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 ServiceActionDetail -> Int -> DescribeServiceActionResponse
DescribeServiceActionResponse'
(Maybe ServiceActionDetail -> Int -> DescribeServiceActionResponse)
-> Either String (Maybe ServiceActionDetail)
-> Either String (Int -> DescribeServiceActionResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe ServiceActionDetail)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ServiceActionDetail")
Either String (Int -> DescribeServiceActionResponse)
-> Either String Int -> Either String DescribeServiceActionResponse
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 DescribeServiceAction
instance Prelude.NFData DescribeServiceAction
instance Core.ToHeaders DescribeServiceAction where
toHeaders :: DescribeServiceAction -> ResponseHeaders
toHeaders =
ResponseHeaders -> DescribeServiceAction -> 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.DescribeServiceAction" ::
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 DescribeServiceAction where
toJSON :: DescribeServiceAction -> Value
toJSON DescribeServiceAction' {Maybe Text
Text
id :: Text
acceptLanguage :: Maybe Text
$sel:id:DescribeServiceAction' :: DescribeServiceAction -> Text
$sel:acceptLanguage:DescribeServiceAction' :: DescribeServiceAction -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"AcceptLanguage" 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
acceptLanguage,
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 DescribeServiceAction where
toPath :: DescribeServiceAction -> ByteString
toPath = ByteString -> DescribeServiceAction -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DescribeServiceAction where
toQuery :: DescribeServiceAction -> QueryString
toQuery = QueryString -> DescribeServiceAction -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DescribeServiceActionResponse = DescribeServiceActionResponse'
{
DescribeServiceActionResponse -> Maybe ServiceActionDetail
serviceActionDetail :: Prelude.Maybe ServiceActionDetail,
DescribeServiceActionResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DescribeServiceActionResponse
-> DescribeServiceActionResponse -> Bool
(DescribeServiceActionResponse
-> DescribeServiceActionResponse -> Bool)
-> (DescribeServiceActionResponse
-> DescribeServiceActionResponse -> Bool)
-> Eq DescribeServiceActionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeServiceActionResponse
-> DescribeServiceActionResponse -> Bool
$c/= :: DescribeServiceActionResponse
-> DescribeServiceActionResponse -> Bool
== :: DescribeServiceActionResponse
-> DescribeServiceActionResponse -> Bool
$c== :: DescribeServiceActionResponse
-> DescribeServiceActionResponse -> Bool
Prelude.Eq, ReadPrec [DescribeServiceActionResponse]
ReadPrec DescribeServiceActionResponse
Int -> ReadS DescribeServiceActionResponse
ReadS [DescribeServiceActionResponse]
(Int -> ReadS DescribeServiceActionResponse)
-> ReadS [DescribeServiceActionResponse]
-> ReadPrec DescribeServiceActionResponse
-> ReadPrec [DescribeServiceActionResponse]
-> Read DescribeServiceActionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeServiceActionResponse]
$creadListPrec :: ReadPrec [DescribeServiceActionResponse]
readPrec :: ReadPrec DescribeServiceActionResponse
$creadPrec :: ReadPrec DescribeServiceActionResponse
readList :: ReadS [DescribeServiceActionResponse]
$creadList :: ReadS [DescribeServiceActionResponse]
readsPrec :: Int -> ReadS DescribeServiceActionResponse
$creadsPrec :: Int -> ReadS DescribeServiceActionResponse
Prelude.Read, Int -> DescribeServiceActionResponse -> ShowS
[DescribeServiceActionResponse] -> ShowS
DescribeServiceActionResponse -> String
(Int -> DescribeServiceActionResponse -> ShowS)
-> (DescribeServiceActionResponse -> String)
-> ([DescribeServiceActionResponse] -> ShowS)
-> Show DescribeServiceActionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeServiceActionResponse] -> ShowS
$cshowList :: [DescribeServiceActionResponse] -> ShowS
show :: DescribeServiceActionResponse -> String
$cshow :: DescribeServiceActionResponse -> String
showsPrec :: Int -> DescribeServiceActionResponse -> ShowS
$cshowsPrec :: Int -> DescribeServiceActionResponse -> ShowS
Prelude.Show, (forall x.
DescribeServiceActionResponse
-> Rep DescribeServiceActionResponse x)
-> (forall x.
Rep DescribeServiceActionResponse x
-> DescribeServiceActionResponse)
-> Generic DescribeServiceActionResponse
forall x.
Rep DescribeServiceActionResponse x
-> DescribeServiceActionResponse
forall x.
DescribeServiceActionResponse
-> Rep DescribeServiceActionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeServiceActionResponse x
-> DescribeServiceActionResponse
$cfrom :: forall x.
DescribeServiceActionResponse
-> Rep DescribeServiceActionResponse x
Prelude.Generic)
newDescribeServiceActionResponse ::
Prelude.Int ->
DescribeServiceActionResponse
newDescribeServiceActionResponse :: Int -> DescribeServiceActionResponse
newDescribeServiceActionResponse Int
pHttpStatus_ =
DescribeServiceActionResponse' :: Maybe ServiceActionDetail -> Int -> DescribeServiceActionResponse
DescribeServiceActionResponse'
{ $sel:serviceActionDetail:DescribeServiceActionResponse' :: Maybe ServiceActionDetail
serviceActionDetail =
Maybe ServiceActionDetail
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DescribeServiceActionResponse' :: Int
httpStatus = Int
pHttpStatus_
}
describeServiceActionResponse_serviceActionDetail :: Lens.Lens' DescribeServiceActionResponse (Prelude.Maybe ServiceActionDetail)
describeServiceActionResponse_serviceActionDetail :: (Maybe ServiceActionDetail -> f (Maybe ServiceActionDetail))
-> DescribeServiceActionResponse -> f DescribeServiceActionResponse
describeServiceActionResponse_serviceActionDetail = (DescribeServiceActionResponse -> Maybe ServiceActionDetail)
-> (DescribeServiceActionResponse
-> Maybe ServiceActionDetail -> DescribeServiceActionResponse)
-> Lens
DescribeServiceActionResponse
DescribeServiceActionResponse
(Maybe ServiceActionDetail)
(Maybe ServiceActionDetail)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeServiceActionResponse' {Maybe ServiceActionDetail
serviceActionDetail :: Maybe ServiceActionDetail
$sel:serviceActionDetail:DescribeServiceActionResponse' :: DescribeServiceActionResponse -> Maybe ServiceActionDetail
serviceActionDetail} -> Maybe ServiceActionDetail
serviceActionDetail) (\s :: DescribeServiceActionResponse
s@DescribeServiceActionResponse' {} Maybe ServiceActionDetail
a -> DescribeServiceActionResponse
s {$sel:serviceActionDetail:DescribeServiceActionResponse' :: Maybe ServiceActionDetail
serviceActionDetail = Maybe ServiceActionDetail
a} :: DescribeServiceActionResponse)
describeServiceActionResponse_httpStatus :: Lens.Lens' DescribeServiceActionResponse Prelude.Int
describeServiceActionResponse_httpStatus :: (Int -> f Int)
-> DescribeServiceActionResponse -> f DescribeServiceActionResponse
describeServiceActionResponse_httpStatus = (DescribeServiceActionResponse -> Int)
-> (DescribeServiceActionResponse
-> Int -> DescribeServiceActionResponse)
-> Lens
DescribeServiceActionResponse DescribeServiceActionResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeServiceActionResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeServiceActionResponse' :: DescribeServiceActionResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeServiceActionResponse
s@DescribeServiceActionResponse' {} Int
a -> DescribeServiceActionResponse
s {$sel:httpStatus:DescribeServiceActionResponse' :: Int
httpStatus = Int
a} :: DescribeServiceActionResponse)
instance Prelude.NFData DescribeServiceActionResponse