{-# 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.DescribeProductView
(
DescribeProductView (..),
newDescribeProductView,
describeProductView_acceptLanguage,
describeProductView_id,
DescribeProductViewResponse (..),
newDescribeProductViewResponse,
describeProductViewResponse_productViewSummary,
describeProductViewResponse_provisioningArtifacts,
describeProductViewResponse_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 DescribeProductView = DescribeProductView'
{
DescribeProductView -> Maybe Text
acceptLanguage :: Prelude.Maybe Prelude.Text,
DescribeProductView -> Text
id :: Prelude.Text
}
deriving (DescribeProductView -> DescribeProductView -> Bool
(DescribeProductView -> DescribeProductView -> Bool)
-> (DescribeProductView -> DescribeProductView -> Bool)
-> Eq DescribeProductView
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeProductView -> DescribeProductView -> Bool
$c/= :: DescribeProductView -> DescribeProductView -> Bool
== :: DescribeProductView -> DescribeProductView -> Bool
$c== :: DescribeProductView -> DescribeProductView -> Bool
Prelude.Eq, ReadPrec [DescribeProductView]
ReadPrec DescribeProductView
Int -> ReadS DescribeProductView
ReadS [DescribeProductView]
(Int -> ReadS DescribeProductView)
-> ReadS [DescribeProductView]
-> ReadPrec DescribeProductView
-> ReadPrec [DescribeProductView]
-> Read DescribeProductView
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeProductView]
$creadListPrec :: ReadPrec [DescribeProductView]
readPrec :: ReadPrec DescribeProductView
$creadPrec :: ReadPrec DescribeProductView
readList :: ReadS [DescribeProductView]
$creadList :: ReadS [DescribeProductView]
readsPrec :: Int -> ReadS DescribeProductView
$creadsPrec :: Int -> ReadS DescribeProductView
Prelude.Read, Int -> DescribeProductView -> ShowS
[DescribeProductView] -> ShowS
DescribeProductView -> String
(Int -> DescribeProductView -> ShowS)
-> (DescribeProductView -> String)
-> ([DescribeProductView] -> ShowS)
-> Show DescribeProductView
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeProductView] -> ShowS
$cshowList :: [DescribeProductView] -> ShowS
show :: DescribeProductView -> String
$cshow :: DescribeProductView -> String
showsPrec :: Int -> DescribeProductView -> ShowS
$cshowsPrec :: Int -> DescribeProductView -> ShowS
Prelude.Show, (forall x. DescribeProductView -> Rep DescribeProductView x)
-> (forall x. Rep DescribeProductView x -> DescribeProductView)
-> Generic DescribeProductView
forall x. Rep DescribeProductView x -> DescribeProductView
forall x. DescribeProductView -> Rep DescribeProductView x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeProductView x -> DescribeProductView
$cfrom :: forall x. DescribeProductView -> Rep DescribeProductView x
Prelude.Generic)
newDescribeProductView ::
Prelude.Text ->
DescribeProductView
newDescribeProductView :: Text -> DescribeProductView
newDescribeProductView Text
pId_ =
DescribeProductView' :: Maybe Text -> Text -> DescribeProductView
DescribeProductView'
{ $sel:acceptLanguage:DescribeProductView' :: Maybe Text
acceptLanguage =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:id:DescribeProductView' :: Text
id = Text
pId_
}
describeProductView_acceptLanguage :: Lens.Lens' DescribeProductView (Prelude.Maybe Prelude.Text)
describeProductView_acceptLanguage :: (Maybe Text -> f (Maybe Text))
-> DescribeProductView -> f DescribeProductView
describeProductView_acceptLanguage = (DescribeProductView -> Maybe Text)
-> (DescribeProductView -> Maybe Text -> DescribeProductView)
-> Lens
DescribeProductView DescribeProductView (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeProductView' {Maybe Text
acceptLanguage :: Maybe Text
$sel:acceptLanguage:DescribeProductView' :: DescribeProductView -> Maybe Text
acceptLanguage} -> Maybe Text
acceptLanguage) (\s :: DescribeProductView
s@DescribeProductView' {} Maybe Text
a -> DescribeProductView
s {$sel:acceptLanguage:DescribeProductView' :: Maybe Text
acceptLanguage = Maybe Text
a} :: DescribeProductView)
describeProductView_id :: Lens.Lens' DescribeProductView Prelude.Text
describeProductView_id :: (Text -> f Text) -> DescribeProductView -> f DescribeProductView
describeProductView_id = (DescribeProductView -> Text)
-> (DescribeProductView -> Text -> DescribeProductView)
-> Lens DescribeProductView DescribeProductView Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeProductView' {Text
id :: Text
$sel:id:DescribeProductView' :: DescribeProductView -> Text
id} -> Text
id) (\s :: DescribeProductView
s@DescribeProductView' {} Text
a -> DescribeProductView
s {$sel:id:DescribeProductView' :: Text
id = Text
a} :: DescribeProductView)
instance Core.AWSRequest DescribeProductView where
type
AWSResponse DescribeProductView =
DescribeProductViewResponse
request :: DescribeProductView -> Request DescribeProductView
request = Service -> DescribeProductView -> Request DescribeProductView
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeProductView
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeProductView)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DescribeProductView))
-> Logger
-> Service
-> Proxy DescribeProductView
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeProductView)))
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 ProductViewSummary
-> Maybe [ProvisioningArtifact]
-> Int
-> DescribeProductViewResponse
DescribeProductViewResponse'
(Maybe ProductViewSummary
-> Maybe [ProvisioningArtifact]
-> Int
-> DescribeProductViewResponse)
-> Either String (Maybe ProductViewSummary)
-> Either
String
(Maybe [ProvisioningArtifact]
-> Int -> DescribeProductViewResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe ProductViewSummary)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ProductViewSummary")
Either
String
(Maybe [ProvisioningArtifact]
-> Int -> DescribeProductViewResponse)
-> Either String (Maybe [ProvisioningArtifact])
-> Either String (Int -> DescribeProductViewResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object
-> Text -> Either String (Maybe (Maybe [ProvisioningArtifact]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ProvisioningArtifacts"
Either String (Maybe (Maybe [ProvisioningArtifact]))
-> Maybe [ProvisioningArtifact]
-> Either String (Maybe [ProvisioningArtifact])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [ProvisioningArtifact]
forall a. Monoid a => a
Prelude.mempty
)
Either String (Int -> DescribeProductViewResponse)
-> Either String Int -> Either String DescribeProductViewResponse
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 DescribeProductView
instance Prelude.NFData DescribeProductView
instance Core.ToHeaders DescribeProductView where
toHeaders :: DescribeProductView -> ResponseHeaders
toHeaders =
ResponseHeaders -> DescribeProductView -> 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.DescribeProductView" ::
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 DescribeProductView where
toJSON :: DescribeProductView -> Value
toJSON DescribeProductView' {Maybe Text
Text
id :: Text
acceptLanguage :: Maybe Text
$sel:id:DescribeProductView' :: DescribeProductView -> Text
$sel:acceptLanguage:DescribeProductView' :: DescribeProductView -> 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 DescribeProductView where
toPath :: DescribeProductView -> ByteString
toPath = ByteString -> DescribeProductView -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DescribeProductView where
toQuery :: DescribeProductView -> QueryString
toQuery = QueryString -> DescribeProductView -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DescribeProductViewResponse = DescribeProductViewResponse'
{
DescribeProductViewResponse -> Maybe ProductViewSummary
productViewSummary :: Prelude.Maybe ProductViewSummary,
DescribeProductViewResponse -> Maybe [ProvisioningArtifact]
provisioningArtifacts :: Prelude.Maybe [ProvisioningArtifact],
DescribeProductViewResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DescribeProductViewResponse -> DescribeProductViewResponse -> Bool
(DescribeProductViewResponse
-> DescribeProductViewResponse -> Bool)
-> (DescribeProductViewResponse
-> DescribeProductViewResponse -> Bool)
-> Eq DescribeProductViewResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeProductViewResponse -> DescribeProductViewResponse -> Bool
$c/= :: DescribeProductViewResponse -> DescribeProductViewResponse -> Bool
== :: DescribeProductViewResponse -> DescribeProductViewResponse -> Bool
$c== :: DescribeProductViewResponse -> DescribeProductViewResponse -> Bool
Prelude.Eq, ReadPrec [DescribeProductViewResponse]
ReadPrec DescribeProductViewResponse
Int -> ReadS DescribeProductViewResponse
ReadS [DescribeProductViewResponse]
(Int -> ReadS DescribeProductViewResponse)
-> ReadS [DescribeProductViewResponse]
-> ReadPrec DescribeProductViewResponse
-> ReadPrec [DescribeProductViewResponse]
-> Read DescribeProductViewResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeProductViewResponse]
$creadListPrec :: ReadPrec [DescribeProductViewResponse]
readPrec :: ReadPrec DescribeProductViewResponse
$creadPrec :: ReadPrec DescribeProductViewResponse
readList :: ReadS [DescribeProductViewResponse]
$creadList :: ReadS [DescribeProductViewResponse]
readsPrec :: Int -> ReadS DescribeProductViewResponse
$creadsPrec :: Int -> ReadS DescribeProductViewResponse
Prelude.Read, Int -> DescribeProductViewResponse -> ShowS
[DescribeProductViewResponse] -> ShowS
DescribeProductViewResponse -> String
(Int -> DescribeProductViewResponse -> ShowS)
-> (DescribeProductViewResponse -> String)
-> ([DescribeProductViewResponse] -> ShowS)
-> Show DescribeProductViewResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeProductViewResponse] -> ShowS
$cshowList :: [DescribeProductViewResponse] -> ShowS
show :: DescribeProductViewResponse -> String
$cshow :: DescribeProductViewResponse -> String
showsPrec :: Int -> DescribeProductViewResponse -> ShowS
$cshowsPrec :: Int -> DescribeProductViewResponse -> ShowS
Prelude.Show, (forall x.
DescribeProductViewResponse -> Rep DescribeProductViewResponse x)
-> (forall x.
Rep DescribeProductViewResponse x -> DescribeProductViewResponse)
-> Generic DescribeProductViewResponse
forall x.
Rep DescribeProductViewResponse x -> DescribeProductViewResponse
forall x.
DescribeProductViewResponse -> Rep DescribeProductViewResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeProductViewResponse x -> DescribeProductViewResponse
$cfrom :: forall x.
DescribeProductViewResponse -> Rep DescribeProductViewResponse x
Prelude.Generic)
newDescribeProductViewResponse ::
Prelude.Int ->
DescribeProductViewResponse
newDescribeProductViewResponse :: Int -> DescribeProductViewResponse
newDescribeProductViewResponse Int
pHttpStatus_ =
DescribeProductViewResponse' :: Maybe ProductViewSummary
-> Maybe [ProvisioningArtifact]
-> Int
-> DescribeProductViewResponse
DescribeProductViewResponse'
{ $sel:productViewSummary:DescribeProductViewResponse' :: Maybe ProductViewSummary
productViewSummary =
Maybe ProductViewSummary
forall a. Maybe a
Prelude.Nothing,
$sel:provisioningArtifacts:DescribeProductViewResponse' :: Maybe [ProvisioningArtifact]
provisioningArtifacts = Maybe [ProvisioningArtifact]
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DescribeProductViewResponse' :: Int
httpStatus = Int
pHttpStatus_
}
describeProductViewResponse_productViewSummary :: Lens.Lens' DescribeProductViewResponse (Prelude.Maybe ProductViewSummary)
describeProductViewResponse_productViewSummary :: (Maybe ProductViewSummary -> f (Maybe ProductViewSummary))
-> DescribeProductViewResponse -> f DescribeProductViewResponse
describeProductViewResponse_productViewSummary = (DescribeProductViewResponse -> Maybe ProductViewSummary)
-> (DescribeProductViewResponse
-> Maybe ProductViewSummary -> DescribeProductViewResponse)
-> Lens
DescribeProductViewResponse
DescribeProductViewResponse
(Maybe ProductViewSummary)
(Maybe ProductViewSummary)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeProductViewResponse' {Maybe ProductViewSummary
productViewSummary :: Maybe ProductViewSummary
$sel:productViewSummary:DescribeProductViewResponse' :: DescribeProductViewResponse -> Maybe ProductViewSummary
productViewSummary} -> Maybe ProductViewSummary
productViewSummary) (\s :: DescribeProductViewResponse
s@DescribeProductViewResponse' {} Maybe ProductViewSummary
a -> DescribeProductViewResponse
s {$sel:productViewSummary:DescribeProductViewResponse' :: Maybe ProductViewSummary
productViewSummary = Maybe ProductViewSummary
a} :: DescribeProductViewResponse)
describeProductViewResponse_provisioningArtifacts :: Lens.Lens' DescribeProductViewResponse (Prelude.Maybe [ProvisioningArtifact])
describeProductViewResponse_provisioningArtifacts :: (Maybe [ProvisioningArtifact] -> f (Maybe [ProvisioningArtifact]))
-> DescribeProductViewResponse -> f DescribeProductViewResponse
describeProductViewResponse_provisioningArtifacts = (DescribeProductViewResponse -> Maybe [ProvisioningArtifact])
-> (DescribeProductViewResponse
-> Maybe [ProvisioningArtifact] -> DescribeProductViewResponse)
-> Lens
DescribeProductViewResponse
DescribeProductViewResponse
(Maybe [ProvisioningArtifact])
(Maybe [ProvisioningArtifact])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeProductViewResponse' {Maybe [ProvisioningArtifact]
provisioningArtifacts :: Maybe [ProvisioningArtifact]
$sel:provisioningArtifacts:DescribeProductViewResponse' :: DescribeProductViewResponse -> Maybe [ProvisioningArtifact]
provisioningArtifacts} -> Maybe [ProvisioningArtifact]
provisioningArtifacts) (\s :: DescribeProductViewResponse
s@DescribeProductViewResponse' {} Maybe [ProvisioningArtifact]
a -> DescribeProductViewResponse
s {$sel:provisioningArtifacts:DescribeProductViewResponse' :: Maybe [ProvisioningArtifact]
provisioningArtifacts = Maybe [ProvisioningArtifact]
a} :: DescribeProductViewResponse) ((Maybe [ProvisioningArtifact] -> f (Maybe [ProvisioningArtifact]))
-> DescribeProductViewResponse -> f DescribeProductViewResponse)
-> ((Maybe [ProvisioningArtifact]
-> f (Maybe [ProvisioningArtifact]))
-> Maybe [ProvisioningArtifact]
-> f (Maybe [ProvisioningArtifact]))
-> (Maybe [ProvisioningArtifact]
-> f (Maybe [ProvisioningArtifact]))
-> DescribeProductViewResponse
-> f DescribeProductViewResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[ProvisioningArtifact]
[ProvisioningArtifact]
[ProvisioningArtifact]
[ProvisioningArtifact]
-> Iso
(Maybe [ProvisioningArtifact])
(Maybe [ProvisioningArtifact])
(Maybe [ProvisioningArtifact])
(Maybe [ProvisioningArtifact])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
[ProvisioningArtifact]
[ProvisioningArtifact]
[ProvisioningArtifact]
[ProvisioningArtifact]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
describeProductViewResponse_httpStatus :: Lens.Lens' DescribeProductViewResponse Prelude.Int
describeProductViewResponse_httpStatus :: (Int -> f Int)
-> DescribeProductViewResponse -> f DescribeProductViewResponse
describeProductViewResponse_httpStatus = (DescribeProductViewResponse -> Int)
-> (DescribeProductViewResponse
-> Int -> DescribeProductViewResponse)
-> Lens
DescribeProductViewResponse DescribeProductViewResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeProductViewResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeProductViewResponse' :: DescribeProductViewResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeProductViewResponse
s@DescribeProductViewResponse' {} Int
a -> DescribeProductViewResponse
s {$sel:httpStatus:DescribeProductViewResponse' :: Int
httpStatus = Int
a} :: DescribeProductViewResponse)
instance Prelude.NFData DescribeProductViewResponse