{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.ServiceCatalog.DescribeProductAsAdmin
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Gets information about the specified product. This operation is run with
-- administrator access.
module Amazonka.ServiceCatalog.DescribeProductAsAdmin
  ( -- * Creating a Request
    DescribeProductAsAdmin (..),
    newDescribeProductAsAdmin,

    -- * Request Lenses
    describeProductAsAdmin_sourcePortfolioId,
    describeProductAsAdmin_name,
    describeProductAsAdmin_acceptLanguage,
    describeProductAsAdmin_id,

    -- * Destructuring the Response
    DescribeProductAsAdminResponse (..),
    newDescribeProductAsAdminResponse,

    -- * Response Lenses
    describeProductAsAdminResponse_productViewDetail,
    describeProductAsAdminResponse_tagOptions,
    describeProductAsAdminResponse_provisioningArtifactSummaries,
    describeProductAsAdminResponse_budgets,
    describeProductAsAdminResponse_tags,
    describeProductAsAdminResponse_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

-- | /See:/ 'newDescribeProductAsAdmin' smart constructor.
data DescribeProductAsAdmin = DescribeProductAsAdmin'
  { -- | The unique identifier of the shared portfolio that the specified product
    -- is associated with.
    --
    -- You can provide this parameter to retrieve the shared TagOptions
    -- associated with the product. If this parameter is provided and if
    -- TagOptions sharing is enabled in the portfolio share, the API returns
    -- both local and shared TagOptions associated with the product. Otherwise
    -- only local TagOptions will be returned.
    DescribeProductAsAdmin -> Maybe Text
sourcePortfolioId :: Prelude.Maybe Prelude.Text,
    -- | The product name.
    DescribeProductAsAdmin -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The language code.
    --
    -- -   @en@ - English (default)
    --
    -- -   @jp@ - Japanese
    --
    -- -   @zh@ - Chinese
    DescribeProductAsAdmin -> Maybe Text
acceptLanguage :: Prelude.Maybe Prelude.Text,
    -- | The product identifier.
    DescribeProductAsAdmin -> Maybe Text
id :: Prelude.Maybe Prelude.Text
  }
  deriving (DescribeProductAsAdmin -> DescribeProductAsAdmin -> Bool
(DescribeProductAsAdmin -> DescribeProductAsAdmin -> Bool)
-> (DescribeProductAsAdmin -> DescribeProductAsAdmin -> Bool)
-> Eq DescribeProductAsAdmin
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeProductAsAdmin -> DescribeProductAsAdmin -> Bool
$c/= :: DescribeProductAsAdmin -> DescribeProductAsAdmin -> Bool
== :: DescribeProductAsAdmin -> DescribeProductAsAdmin -> Bool
$c== :: DescribeProductAsAdmin -> DescribeProductAsAdmin -> Bool
Prelude.Eq, ReadPrec [DescribeProductAsAdmin]
ReadPrec DescribeProductAsAdmin
Int -> ReadS DescribeProductAsAdmin
ReadS [DescribeProductAsAdmin]
(Int -> ReadS DescribeProductAsAdmin)
-> ReadS [DescribeProductAsAdmin]
-> ReadPrec DescribeProductAsAdmin
-> ReadPrec [DescribeProductAsAdmin]
-> Read DescribeProductAsAdmin
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeProductAsAdmin]
$creadListPrec :: ReadPrec [DescribeProductAsAdmin]
readPrec :: ReadPrec DescribeProductAsAdmin
$creadPrec :: ReadPrec DescribeProductAsAdmin
readList :: ReadS [DescribeProductAsAdmin]
$creadList :: ReadS [DescribeProductAsAdmin]
readsPrec :: Int -> ReadS DescribeProductAsAdmin
$creadsPrec :: Int -> ReadS DescribeProductAsAdmin
Prelude.Read, Int -> DescribeProductAsAdmin -> ShowS
[DescribeProductAsAdmin] -> ShowS
DescribeProductAsAdmin -> String
(Int -> DescribeProductAsAdmin -> ShowS)
-> (DescribeProductAsAdmin -> String)
-> ([DescribeProductAsAdmin] -> ShowS)
-> Show DescribeProductAsAdmin
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeProductAsAdmin] -> ShowS
$cshowList :: [DescribeProductAsAdmin] -> ShowS
show :: DescribeProductAsAdmin -> String
$cshow :: DescribeProductAsAdmin -> String
showsPrec :: Int -> DescribeProductAsAdmin -> ShowS
$cshowsPrec :: Int -> DescribeProductAsAdmin -> ShowS
Prelude.Show, (forall x. DescribeProductAsAdmin -> Rep DescribeProductAsAdmin x)
-> (forall x.
    Rep DescribeProductAsAdmin x -> DescribeProductAsAdmin)
-> Generic DescribeProductAsAdmin
forall x. Rep DescribeProductAsAdmin x -> DescribeProductAsAdmin
forall x. DescribeProductAsAdmin -> Rep DescribeProductAsAdmin x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeProductAsAdmin x -> DescribeProductAsAdmin
$cfrom :: forall x. DescribeProductAsAdmin -> Rep DescribeProductAsAdmin x
Prelude.Generic)

-- |
-- Create a value of 'DescribeProductAsAdmin' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'sourcePortfolioId', 'describeProductAsAdmin_sourcePortfolioId' - The unique identifier of the shared portfolio that the specified product
-- is associated with.
--
-- You can provide this parameter to retrieve the shared TagOptions
-- associated with the product. If this parameter is provided and if
-- TagOptions sharing is enabled in the portfolio share, the API returns
-- both local and shared TagOptions associated with the product. Otherwise
-- only local TagOptions will be returned.
--
-- 'name', 'describeProductAsAdmin_name' - The product name.
--
-- 'acceptLanguage', 'describeProductAsAdmin_acceptLanguage' - The language code.
--
-- -   @en@ - English (default)
--
-- -   @jp@ - Japanese
--
-- -   @zh@ - Chinese
--
-- 'id', 'describeProductAsAdmin_id' - The product identifier.
newDescribeProductAsAdmin ::
  DescribeProductAsAdmin
newDescribeProductAsAdmin :: DescribeProductAsAdmin
newDescribeProductAsAdmin =
  DescribeProductAsAdmin' :: Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> DescribeProductAsAdmin
DescribeProductAsAdmin'
    { $sel:sourcePortfolioId:DescribeProductAsAdmin' :: Maybe Text
sourcePortfolioId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:name:DescribeProductAsAdmin' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:acceptLanguage:DescribeProductAsAdmin' :: Maybe Text
acceptLanguage = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:id:DescribeProductAsAdmin' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The unique identifier of the shared portfolio that the specified product
-- is associated with.
--
-- You can provide this parameter to retrieve the shared TagOptions
-- associated with the product. If this parameter is provided and if
-- TagOptions sharing is enabled in the portfolio share, the API returns
-- both local and shared TagOptions associated with the product. Otherwise
-- only local TagOptions will be returned.
describeProductAsAdmin_sourcePortfolioId :: Lens.Lens' DescribeProductAsAdmin (Prelude.Maybe Prelude.Text)
describeProductAsAdmin_sourcePortfolioId :: (Maybe Text -> f (Maybe Text))
-> DescribeProductAsAdmin -> f DescribeProductAsAdmin
describeProductAsAdmin_sourcePortfolioId = (DescribeProductAsAdmin -> Maybe Text)
-> (DescribeProductAsAdmin -> Maybe Text -> DescribeProductAsAdmin)
-> Lens
     DescribeProductAsAdmin
     DescribeProductAsAdmin
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeProductAsAdmin' {Maybe Text
sourcePortfolioId :: Maybe Text
$sel:sourcePortfolioId:DescribeProductAsAdmin' :: DescribeProductAsAdmin -> Maybe Text
sourcePortfolioId} -> Maybe Text
sourcePortfolioId) (\s :: DescribeProductAsAdmin
s@DescribeProductAsAdmin' {} Maybe Text
a -> DescribeProductAsAdmin
s {$sel:sourcePortfolioId:DescribeProductAsAdmin' :: Maybe Text
sourcePortfolioId = Maybe Text
a} :: DescribeProductAsAdmin)

-- | The product name.
describeProductAsAdmin_name :: Lens.Lens' DescribeProductAsAdmin (Prelude.Maybe Prelude.Text)
describeProductAsAdmin_name :: (Maybe Text -> f (Maybe Text))
-> DescribeProductAsAdmin -> f DescribeProductAsAdmin
describeProductAsAdmin_name = (DescribeProductAsAdmin -> Maybe Text)
-> (DescribeProductAsAdmin -> Maybe Text -> DescribeProductAsAdmin)
-> Lens
     DescribeProductAsAdmin
     DescribeProductAsAdmin
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeProductAsAdmin' {Maybe Text
name :: Maybe Text
$sel:name:DescribeProductAsAdmin' :: DescribeProductAsAdmin -> Maybe Text
name} -> Maybe Text
name) (\s :: DescribeProductAsAdmin
s@DescribeProductAsAdmin' {} Maybe Text
a -> DescribeProductAsAdmin
s {$sel:name:DescribeProductAsAdmin' :: Maybe Text
name = Maybe Text
a} :: DescribeProductAsAdmin)

-- | The language code.
--
-- -   @en@ - English (default)
--
-- -   @jp@ - Japanese
--
-- -   @zh@ - Chinese
describeProductAsAdmin_acceptLanguage :: Lens.Lens' DescribeProductAsAdmin (Prelude.Maybe Prelude.Text)
describeProductAsAdmin_acceptLanguage :: (Maybe Text -> f (Maybe Text))
-> DescribeProductAsAdmin -> f DescribeProductAsAdmin
describeProductAsAdmin_acceptLanguage = (DescribeProductAsAdmin -> Maybe Text)
-> (DescribeProductAsAdmin -> Maybe Text -> DescribeProductAsAdmin)
-> Lens
     DescribeProductAsAdmin
     DescribeProductAsAdmin
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeProductAsAdmin' {Maybe Text
acceptLanguage :: Maybe Text
$sel:acceptLanguage:DescribeProductAsAdmin' :: DescribeProductAsAdmin -> Maybe Text
acceptLanguage} -> Maybe Text
acceptLanguage) (\s :: DescribeProductAsAdmin
s@DescribeProductAsAdmin' {} Maybe Text
a -> DescribeProductAsAdmin
s {$sel:acceptLanguage:DescribeProductAsAdmin' :: Maybe Text
acceptLanguage = Maybe Text
a} :: DescribeProductAsAdmin)

-- | The product identifier.
describeProductAsAdmin_id :: Lens.Lens' DescribeProductAsAdmin (Prelude.Maybe Prelude.Text)
describeProductAsAdmin_id :: (Maybe Text -> f (Maybe Text))
-> DescribeProductAsAdmin -> f DescribeProductAsAdmin
describeProductAsAdmin_id = (DescribeProductAsAdmin -> Maybe Text)
-> (DescribeProductAsAdmin -> Maybe Text -> DescribeProductAsAdmin)
-> Lens
     DescribeProductAsAdmin
     DescribeProductAsAdmin
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeProductAsAdmin' {Maybe Text
id :: Maybe Text
$sel:id:DescribeProductAsAdmin' :: DescribeProductAsAdmin -> Maybe Text
id} -> Maybe Text
id) (\s :: DescribeProductAsAdmin
s@DescribeProductAsAdmin' {} Maybe Text
a -> DescribeProductAsAdmin
s {$sel:id:DescribeProductAsAdmin' :: Maybe Text
id = Maybe Text
a} :: DescribeProductAsAdmin)

instance Core.AWSRequest DescribeProductAsAdmin where
  type
    AWSResponse DescribeProductAsAdmin =
      DescribeProductAsAdminResponse
  request :: DescribeProductAsAdmin -> Request DescribeProductAsAdmin
request = Service -> DescribeProductAsAdmin -> Request DescribeProductAsAdmin
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy DescribeProductAsAdmin
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeProductAsAdmin)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse DescribeProductAsAdmin))
-> Logger
-> Service
-> Proxy DescribeProductAsAdmin
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeProductAsAdmin)))
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 ProductViewDetail
-> Maybe [TagOptionDetail]
-> Maybe [ProvisioningArtifactSummary]
-> Maybe [BudgetDetail]
-> Maybe [Tag]
-> Int
-> DescribeProductAsAdminResponse
DescribeProductAsAdminResponse'
            (Maybe ProductViewDetail
 -> Maybe [TagOptionDetail]
 -> Maybe [ProvisioningArtifactSummary]
 -> Maybe [BudgetDetail]
 -> Maybe [Tag]
 -> Int
 -> DescribeProductAsAdminResponse)
-> Either String (Maybe ProductViewDetail)
-> Either
     String
     (Maybe [TagOptionDetail]
      -> Maybe [ProvisioningArtifactSummary]
      -> Maybe [BudgetDetail]
      -> Maybe [Tag]
      -> Int
      -> DescribeProductAsAdminResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe ProductViewDetail)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ProductViewDetail")
            Either
  String
  (Maybe [TagOptionDetail]
   -> Maybe [ProvisioningArtifactSummary]
   -> Maybe [BudgetDetail]
   -> Maybe [Tag]
   -> Int
   -> DescribeProductAsAdminResponse)
-> Either String (Maybe [TagOptionDetail])
-> Either
     String
     (Maybe [ProvisioningArtifactSummary]
      -> Maybe [BudgetDetail]
      -> Maybe [Tag]
      -> Int
      -> DescribeProductAsAdminResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe [TagOptionDetail]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"TagOptions" Either String (Maybe (Maybe [TagOptionDetail]))
-> Maybe [TagOptionDetail]
-> Either String (Maybe [TagOptionDetail])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [TagOptionDetail]
forall a. Monoid a => a
Prelude.mempty)
            Either
  String
  (Maybe [ProvisioningArtifactSummary]
   -> Maybe [BudgetDetail]
   -> Maybe [Tag]
   -> Int
   -> DescribeProductAsAdminResponse)
-> Either String (Maybe [ProvisioningArtifactSummary])
-> Either
     String
     (Maybe [BudgetDetail]
      -> Maybe [Tag] -> Int -> DescribeProductAsAdminResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object
-> Text
-> Either String (Maybe (Maybe [ProvisioningArtifactSummary]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ProvisioningArtifactSummaries"
                            Either String (Maybe (Maybe [ProvisioningArtifactSummary]))
-> Maybe [ProvisioningArtifactSummary]
-> Either String (Maybe [ProvisioningArtifactSummary])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [ProvisioningArtifactSummary]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either
  String
  (Maybe [BudgetDetail]
   -> Maybe [Tag] -> Int -> DescribeProductAsAdminResponse)
-> Either String (Maybe [BudgetDetail])
-> Either
     String (Maybe [Tag] -> Int -> DescribeProductAsAdminResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe [BudgetDetail]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Budgets" Either String (Maybe (Maybe [BudgetDetail]))
-> Maybe [BudgetDetail] -> Either String (Maybe [BudgetDetail])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [BudgetDetail]
forall a. Monoid a => a
Prelude.mempty)
            Either
  String (Maybe [Tag] -> Int -> DescribeProductAsAdminResponse)
-> Either String (Maybe [Tag])
-> Either String (Int -> DescribeProductAsAdminResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe [Tag]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Tags" Either String (Maybe (Maybe [Tag]))
-> Maybe [Tag] -> Either String (Maybe [Tag])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Tag]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Int -> DescribeProductAsAdminResponse)
-> Either String Int
-> Either String DescribeProductAsAdminResponse
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 DescribeProductAsAdmin

instance Prelude.NFData DescribeProductAsAdmin

instance Core.ToHeaders DescribeProductAsAdmin where
  toHeaders :: DescribeProductAsAdmin -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DescribeProductAsAdmin -> 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.DescribeProductAsAdmin" ::
                          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 DescribeProductAsAdmin where
  toJSON :: DescribeProductAsAdmin -> Value
toJSON DescribeProductAsAdmin' {Maybe Text
id :: Maybe Text
acceptLanguage :: Maybe Text
name :: Maybe Text
sourcePortfolioId :: Maybe Text
$sel:id:DescribeProductAsAdmin' :: DescribeProductAsAdmin -> Maybe Text
$sel:acceptLanguage:DescribeProductAsAdmin' :: DescribeProductAsAdmin -> Maybe Text
$sel:name:DescribeProductAsAdmin' :: DescribeProductAsAdmin -> Maybe Text
$sel:sourcePortfolioId:DescribeProductAsAdmin' :: DescribeProductAsAdmin -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"SourcePortfolioId" 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
sourcePortfolioId,
            (Text
"Name" 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
name,
            (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,
            (Text
"Id" 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
id
          ]
      )

instance Core.ToPath DescribeProductAsAdmin where
  toPath :: DescribeProductAsAdmin -> ByteString
toPath = ByteString -> DescribeProductAsAdmin -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Core.ToQuery DescribeProductAsAdmin where
  toQuery :: DescribeProductAsAdmin -> QueryString
toQuery = QueryString -> DescribeProductAsAdmin -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newDescribeProductAsAdminResponse' smart constructor.
data DescribeProductAsAdminResponse = DescribeProductAsAdminResponse'
  { -- | Information about the product view.
    DescribeProductAsAdminResponse -> Maybe ProductViewDetail
productViewDetail :: Prelude.Maybe ProductViewDetail,
    -- | Information about the TagOptions associated with the product.
    DescribeProductAsAdminResponse -> Maybe [TagOptionDetail]
tagOptions :: Prelude.Maybe [TagOptionDetail],
    -- | Information about the provisioning artifacts (also known as versions)
    -- for the specified product.
    DescribeProductAsAdminResponse
-> Maybe [ProvisioningArtifactSummary]
provisioningArtifactSummaries :: Prelude.Maybe [ProvisioningArtifactSummary],
    -- | Information about the associated budgets.
    DescribeProductAsAdminResponse -> Maybe [BudgetDetail]
budgets :: Prelude.Maybe [BudgetDetail],
    -- | Information about the tags associated with the product.
    DescribeProductAsAdminResponse -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | The response's http status code.
    DescribeProductAsAdminResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeProductAsAdminResponse
-> DescribeProductAsAdminResponse -> Bool
(DescribeProductAsAdminResponse
 -> DescribeProductAsAdminResponse -> Bool)
-> (DescribeProductAsAdminResponse
    -> DescribeProductAsAdminResponse -> Bool)
-> Eq DescribeProductAsAdminResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeProductAsAdminResponse
-> DescribeProductAsAdminResponse -> Bool
$c/= :: DescribeProductAsAdminResponse
-> DescribeProductAsAdminResponse -> Bool
== :: DescribeProductAsAdminResponse
-> DescribeProductAsAdminResponse -> Bool
$c== :: DescribeProductAsAdminResponse
-> DescribeProductAsAdminResponse -> Bool
Prelude.Eq, ReadPrec [DescribeProductAsAdminResponse]
ReadPrec DescribeProductAsAdminResponse
Int -> ReadS DescribeProductAsAdminResponse
ReadS [DescribeProductAsAdminResponse]
(Int -> ReadS DescribeProductAsAdminResponse)
-> ReadS [DescribeProductAsAdminResponse]
-> ReadPrec DescribeProductAsAdminResponse
-> ReadPrec [DescribeProductAsAdminResponse]
-> Read DescribeProductAsAdminResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeProductAsAdminResponse]
$creadListPrec :: ReadPrec [DescribeProductAsAdminResponse]
readPrec :: ReadPrec DescribeProductAsAdminResponse
$creadPrec :: ReadPrec DescribeProductAsAdminResponse
readList :: ReadS [DescribeProductAsAdminResponse]
$creadList :: ReadS [DescribeProductAsAdminResponse]
readsPrec :: Int -> ReadS DescribeProductAsAdminResponse
$creadsPrec :: Int -> ReadS DescribeProductAsAdminResponse
Prelude.Read, Int -> DescribeProductAsAdminResponse -> ShowS
[DescribeProductAsAdminResponse] -> ShowS
DescribeProductAsAdminResponse -> String
(Int -> DescribeProductAsAdminResponse -> ShowS)
-> (DescribeProductAsAdminResponse -> String)
-> ([DescribeProductAsAdminResponse] -> ShowS)
-> Show DescribeProductAsAdminResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeProductAsAdminResponse] -> ShowS
$cshowList :: [DescribeProductAsAdminResponse] -> ShowS
show :: DescribeProductAsAdminResponse -> String
$cshow :: DescribeProductAsAdminResponse -> String
showsPrec :: Int -> DescribeProductAsAdminResponse -> ShowS
$cshowsPrec :: Int -> DescribeProductAsAdminResponse -> ShowS
Prelude.Show, (forall x.
 DescribeProductAsAdminResponse
 -> Rep DescribeProductAsAdminResponse x)
-> (forall x.
    Rep DescribeProductAsAdminResponse x
    -> DescribeProductAsAdminResponse)
-> Generic DescribeProductAsAdminResponse
forall x.
Rep DescribeProductAsAdminResponse x
-> DescribeProductAsAdminResponse
forall x.
DescribeProductAsAdminResponse
-> Rep DescribeProductAsAdminResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeProductAsAdminResponse x
-> DescribeProductAsAdminResponse
$cfrom :: forall x.
DescribeProductAsAdminResponse
-> Rep DescribeProductAsAdminResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeProductAsAdminResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'productViewDetail', 'describeProductAsAdminResponse_productViewDetail' - Information about the product view.
--
-- 'tagOptions', 'describeProductAsAdminResponse_tagOptions' - Information about the TagOptions associated with the product.
--
-- 'provisioningArtifactSummaries', 'describeProductAsAdminResponse_provisioningArtifactSummaries' - Information about the provisioning artifacts (also known as versions)
-- for the specified product.
--
-- 'budgets', 'describeProductAsAdminResponse_budgets' - Information about the associated budgets.
--
-- 'tags', 'describeProductAsAdminResponse_tags' - Information about the tags associated with the product.
--
-- 'httpStatus', 'describeProductAsAdminResponse_httpStatus' - The response's http status code.
newDescribeProductAsAdminResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeProductAsAdminResponse
newDescribeProductAsAdminResponse :: Int -> DescribeProductAsAdminResponse
newDescribeProductAsAdminResponse Int
pHttpStatus_ =
  DescribeProductAsAdminResponse' :: Maybe ProductViewDetail
-> Maybe [TagOptionDetail]
-> Maybe [ProvisioningArtifactSummary]
-> Maybe [BudgetDetail]
-> Maybe [Tag]
-> Int
-> DescribeProductAsAdminResponse
DescribeProductAsAdminResponse'
    { $sel:productViewDetail:DescribeProductAsAdminResponse' :: Maybe ProductViewDetail
productViewDetail =
        Maybe ProductViewDetail
forall a. Maybe a
Prelude.Nothing,
      $sel:tagOptions:DescribeProductAsAdminResponse' :: Maybe [TagOptionDetail]
tagOptions = Maybe [TagOptionDetail]
forall a. Maybe a
Prelude.Nothing,
      $sel:provisioningArtifactSummaries:DescribeProductAsAdminResponse' :: Maybe [ProvisioningArtifactSummary]
provisioningArtifactSummaries =
        Maybe [ProvisioningArtifactSummary]
forall a. Maybe a
Prelude.Nothing,
      $sel:budgets:DescribeProductAsAdminResponse' :: Maybe [BudgetDetail]
budgets = Maybe [BudgetDetail]
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:DescribeProductAsAdminResponse' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeProductAsAdminResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Information about the product view.
describeProductAsAdminResponse_productViewDetail :: Lens.Lens' DescribeProductAsAdminResponse (Prelude.Maybe ProductViewDetail)
describeProductAsAdminResponse_productViewDetail :: (Maybe ProductViewDetail -> f (Maybe ProductViewDetail))
-> DescribeProductAsAdminResponse
-> f DescribeProductAsAdminResponse
describeProductAsAdminResponse_productViewDetail = (DescribeProductAsAdminResponse -> Maybe ProductViewDetail)
-> (DescribeProductAsAdminResponse
    -> Maybe ProductViewDetail -> DescribeProductAsAdminResponse)
-> Lens
     DescribeProductAsAdminResponse
     DescribeProductAsAdminResponse
     (Maybe ProductViewDetail)
     (Maybe ProductViewDetail)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeProductAsAdminResponse' {Maybe ProductViewDetail
productViewDetail :: Maybe ProductViewDetail
$sel:productViewDetail:DescribeProductAsAdminResponse' :: DescribeProductAsAdminResponse -> Maybe ProductViewDetail
productViewDetail} -> Maybe ProductViewDetail
productViewDetail) (\s :: DescribeProductAsAdminResponse
s@DescribeProductAsAdminResponse' {} Maybe ProductViewDetail
a -> DescribeProductAsAdminResponse
s {$sel:productViewDetail:DescribeProductAsAdminResponse' :: Maybe ProductViewDetail
productViewDetail = Maybe ProductViewDetail
a} :: DescribeProductAsAdminResponse)

-- | Information about the TagOptions associated with the product.
describeProductAsAdminResponse_tagOptions :: Lens.Lens' DescribeProductAsAdminResponse (Prelude.Maybe [TagOptionDetail])
describeProductAsAdminResponse_tagOptions :: (Maybe [TagOptionDetail] -> f (Maybe [TagOptionDetail]))
-> DescribeProductAsAdminResponse
-> f DescribeProductAsAdminResponse
describeProductAsAdminResponse_tagOptions = (DescribeProductAsAdminResponse -> Maybe [TagOptionDetail])
-> (DescribeProductAsAdminResponse
    -> Maybe [TagOptionDetail] -> DescribeProductAsAdminResponse)
-> Lens
     DescribeProductAsAdminResponse
     DescribeProductAsAdminResponse
     (Maybe [TagOptionDetail])
     (Maybe [TagOptionDetail])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeProductAsAdminResponse' {Maybe [TagOptionDetail]
tagOptions :: Maybe [TagOptionDetail]
$sel:tagOptions:DescribeProductAsAdminResponse' :: DescribeProductAsAdminResponse -> Maybe [TagOptionDetail]
tagOptions} -> Maybe [TagOptionDetail]
tagOptions) (\s :: DescribeProductAsAdminResponse
s@DescribeProductAsAdminResponse' {} Maybe [TagOptionDetail]
a -> DescribeProductAsAdminResponse
s {$sel:tagOptions:DescribeProductAsAdminResponse' :: Maybe [TagOptionDetail]
tagOptions = Maybe [TagOptionDetail]
a} :: DescribeProductAsAdminResponse) ((Maybe [TagOptionDetail] -> f (Maybe [TagOptionDetail]))
 -> DescribeProductAsAdminResponse
 -> f DescribeProductAsAdminResponse)
-> ((Maybe [TagOptionDetail] -> f (Maybe [TagOptionDetail]))
    -> Maybe [TagOptionDetail] -> f (Maybe [TagOptionDetail]))
-> (Maybe [TagOptionDetail] -> f (Maybe [TagOptionDetail]))
-> DescribeProductAsAdminResponse
-> f DescribeProductAsAdminResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [TagOptionDetail]
  [TagOptionDetail]
  [TagOptionDetail]
  [TagOptionDetail]
-> Iso
     (Maybe [TagOptionDetail])
     (Maybe [TagOptionDetail])
     (Maybe [TagOptionDetail])
     (Maybe [TagOptionDetail])
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
  [TagOptionDetail]
  [TagOptionDetail]
  [TagOptionDetail]
  [TagOptionDetail]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Information about the provisioning artifacts (also known as versions)
-- for the specified product.
describeProductAsAdminResponse_provisioningArtifactSummaries :: Lens.Lens' DescribeProductAsAdminResponse (Prelude.Maybe [ProvisioningArtifactSummary])
describeProductAsAdminResponse_provisioningArtifactSummaries :: (Maybe [ProvisioningArtifactSummary]
 -> f (Maybe [ProvisioningArtifactSummary]))
-> DescribeProductAsAdminResponse
-> f DescribeProductAsAdminResponse
describeProductAsAdminResponse_provisioningArtifactSummaries = (DescribeProductAsAdminResponse
 -> Maybe [ProvisioningArtifactSummary])
-> (DescribeProductAsAdminResponse
    -> Maybe [ProvisioningArtifactSummary]
    -> DescribeProductAsAdminResponse)
-> Lens
     DescribeProductAsAdminResponse
     DescribeProductAsAdminResponse
     (Maybe [ProvisioningArtifactSummary])
     (Maybe [ProvisioningArtifactSummary])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeProductAsAdminResponse' {Maybe [ProvisioningArtifactSummary]
provisioningArtifactSummaries :: Maybe [ProvisioningArtifactSummary]
$sel:provisioningArtifactSummaries:DescribeProductAsAdminResponse' :: DescribeProductAsAdminResponse
-> Maybe [ProvisioningArtifactSummary]
provisioningArtifactSummaries} -> Maybe [ProvisioningArtifactSummary]
provisioningArtifactSummaries) (\s :: DescribeProductAsAdminResponse
s@DescribeProductAsAdminResponse' {} Maybe [ProvisioningArtifactSummary]
a -> DescribeProductAsAdminResponse
s {$sel:provisioningArtifactSummaries:DescribeProductAsAdminResponse' :: Maybe [ProvisioningArtifactSummary]
provisioningArtifactSummaries = Maybe [ProvisioningArtifactSummary]
a} :: DescribeProductAsAdminResponse) ((Maybe [ProvisioningArtifactSummary]
  -> f (Maybe [ProvisioningArtifactSummary]))
 -> DescribeProductAsAdminResponse
 -> f DescribeProductAsAdminResponse)
-> ((Maybe [ProvisioningArtifactSummary]
     -> f (Maybe [ProvisioningArtifactSummary]))
    -> Maybe [ProvisioningArtifactSummary]
    -> f (Maybe [ProvisioningArtifactSummary]))
-> (Maybe [ProvisioningArtifactSummary]
    -> f (Maybe [ProvisioningArtifactSummary]))
-> DescribeProductAsAdminResponse
-> f DescribeProductAsAdminResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ProvisioningArtifactSummary]
  [ProvisioningArtifactSummary]
  [ProvisioningArtifactSummary]
  [ProvisioningArtifactSummary]
-> Iso
     (Maybe [ProvisioningArtifactSummary])
     (Maybe [ProvisioningArtifactSummary])
     (Maybe [ProvisioningArtifactSummary])
     (Maybe [ProvisioningArtifactSummary])
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
  [ProvisioningArtifactSummary]
  [ProvisioningArtifactSummary]
  [ProvisioningArtifactSummary]
  [ProvisioningArtifactSummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Information about the associated budgets.
describeProductAsAdminResponse_budgets :: Lens.Lens' DescribeProductAsAdminResponse (Prelude.Maybe [BudgetDetail])
describeProductAsAdminResponse_budgets :: (Maybe [BudgetDetail] -> f (Maybe [BudgetDetail]))
-> DescribeProductAsAdminResponse
-> f DescribeProductAsAdminResponse
describeProductAsAdminResponse_budgets = (DescribeProductAsAdminResponse -> Maybe [BudgetDetail])
-> (DescribeProductAsAdminResponse
    -> Maybe [BudgetDetail] -> DescribeProductAsAdminResponse)
-> Lens
     DescribeProductAsAdminResponse
     DescribeProductAsAdminResponse
     (Maybe [BudgetDetail])
     (Maybe [BudgetDetail])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeProductAsAdminResponse' {Maybe [BudgetDetail]
budgets :: Maybe [BudgetDetail]
$sel:budgets:DescribeProductAsAdminResponse' :: DescribeProductAsAdminResponse -> Maybe [BudgetDetail]
budgets} -> Maybe [BudgetDetail]
budgets) (\s :: DescribeProductAsAdminResponse
s@DescribeProductAsAdminResponse' {} Maybe [BudgetDetail]
a -> DescribeProductAsAdminResponse
s {$sel:budgets:DescribeProductAsAdminResponse' :: Maybe [BudgetDetail]
budgets = Maybe [BudgetDetail]
a} :: DescribeProductAsAdminResponse) ((Maybe [BudgetDetail] -> f (Maybe [BudgetDetail]))
 -> DescribeProductAsAdminResponse
 -> f DescribeProductAsAdminResponse)
-> ((Maybe [BudgetDetail] -> f (Maybe [BudgetDetail]))
    -> Maybe [BudgetDetail] -> f (Maybe [BudgetDetail]))
-> (Maybe [BudgetDetail] -> f (Maybe [BudgetDetail]))
-> DescribeProductAsAdminResponse
-> f DescribeProductAsAdminResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [BudgetDetail] [BudgetDetail] [BudgetDetail] [BudgetDetail]
-> Iso
     (Maybe [BudgetDetail])
     (Maybe [BudgetDetail])
     (Maybe [BudgetDetail])
     (Maybe [BudgetDetail])
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 [BudgetDetail] [BudgetDetail] [BudgetDetail] [BudgetDetail]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Information about the tags associated with the product.
describeProductAsAdminResponse_tags :: Lens.Lens' DescribeProductAsAdminResponse (Prelude.Maybe [Tag])
describeProductAsAdminResponse_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> DescribeProductAsAdminResponse
-> f DescribeProductAsAdminResponse
describeProductAsAdminResponse_tags = (DescribeProductAsAdminResponse -> Maybe [Tag])
-> (DescribeProductAsAdminResponse
    -> Maybe [Tag] -> DescribeProductAsAdminResponse)
-> Lens
     DescribeProductAsAdminResponse
     DescribeProductAsAdminResponse
     (Maybe [Tag])
     (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeProductAsAdminResponse' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:DescribeProductAsAdminResponse' :: DescribeProductAsAdminResponse -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: DescribeProductAsAdminResponse
s@DescribeProductAsAdminResponse' {} Maybe [Tag]
a -> DescribeProductAsAdminResponse
s {$sel:tags:DescribeProductAsAdminResponse' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: DescribeProductAsAdminResponse) ((Maybe [Tag] -> f (Maybe [Tag]))
 -> DescribeProductAsAdminResponse
 -> f DescribeProductAsAdminResponse)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
    -> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> DescribeProductAsAdminResponse
-> f DescribeProductAsAdminResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Tag] [Tag] [Tag] [Tag]
-> Iso (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag])
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 [Tag] [Tag] [Tag] [Tag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The response's http status code.
describeProductAsAdminResponse_httpStatus :: Lens.Lens' DescribeProductAsAdminResponse Prelude.Int
describeProductAsAdminResponse_httpStatus :: (Int -> f Int)
-> DescribeProductAsAdminResponse
-> f DescribeProductAsAdminResponse
describeProductAsAdminResponse_httpStatus = (DescribeProductAsAdminResponse -> Int)
-> (DescribeProductAsAdminResponse
    -> Int -> DescribeProductAsAdminResponse)
-> Lens
     DescribeProductAsAdminResponse
     DescribeProductAsAdminResponse
     Int
     Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeProductAsAdminResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeProductAsAdminResponse' :: DescribeProductAsAdminResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeProductAsAdminResponse
s@DescribeProductAsAdminResponse' {} Int
a -> DescribeProductAsAdminResponse
s {$sel:httpStatus:DescribeProductAsAdminResponse' :: Int
httpStatus = Int
a} :: DescribeProductAsAdminResponse)

instance
  Prelude.NFData
    DescribeProductAsAdminResponse