{-# 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.ImportAsProvisionedProduct
-- 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)
--
-- Requests the import of a resource as a Service Catalog provisioned
-- product that is associated to a Service Catalog product and provisioning
-- artifact. Once imported, all supported Service Catalog governance
-- actions are supported on the provisioned product.
--
-- Resource import only supports CloudFormation stack ARNs. CloudFormation
-- StackSets and non-root nested stacks are not supported.
--
-- The CloudFormation stack must have one of the following statuses to be
-- imported: @CREATE_COMPLETE@, @UPDATE_COMPLETE@,
-- @UPDATE_ROLLBACK_COMPLETE@, @IMPORT_COMPLETE@,
-- @IMPORT_ROLLBACK_COMPLETE@.
--
-- Import of the resource requires that the CloudFormation stack template
-- matches the associated Service Catalog product provisioning artifact.
--
-- The user or role that performs this operation must have the
-- @cloudformation:GetTemplate@ and @cloudformation:DescribeStacks@ IAM
-- policy permissions.
module Amazonka.ServiceCatalog.ImportAsProvisionedProduct
  ( -- * Creating a Request
    ImportAsProvisionedProduct (..),
    newImportAsProvisionedProduct,

    -- * Request Lenses
    importAsProvisionedProduct_acceptLanguage,
    importAsProvisionedProduct_productId,
    importAsProvisionedProduct_provisioningArtifactId,
    importAsProvisionedProduct_provisionedProductName,
    importAsProvisionedProduct_physicalId,
    importAsProvisionedProduct_idempotencyToken,

    -- * Destructuring the Response
    ImportAsProvisionedProductResponse (..),
    newImportAsProvisionedProductResponse,

    -- * Response Lenses
    importAsProvisionedProductResponse_recordDetail,
    importAsProvisionedProductResponse_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:/ 'newImportAsProvisionedProduct' smart constructor.
data ImportAsProvisionedProduct = ImportAsProvisionedProduct'
  { -- | The language code.
    --
    -- -   @en@ - English (default)
    --
    -- -   @jp@ - Japanese
    --
    -- -   @zh@ - Chinese
    ImportAsProvisionedProduct -> Maybe Text
acceptLanguage :: Prelude.Maybe Prelude.Text,
    -- | The product identifier.
    ImportAsProvisionedProduct -> Text
productId :: Prelude.Text,
    -- | The identifier of the provisioning artifact.
    ImportAsProvisionedProduct -> Text
provisioningArtifactId :: Prelude.Text,
    -- | The user-friendly name of the provisioned product. The value must be
    -- unique for the AWS account. The name cannot be updated after the product
    -- is provisioned.
    ImportAsProvisionedProduct -> Text
provisionedProductName :: Prelude.Text,
    -- | The unique identifier of the resource to be imported. It only currently
    -- supports CloudFormation stack IDs.
    ImportAsProvisionedProduct -> Text
physicalId :: Prelude.Text,
    -- | A unique identifier that you provide to ensure idempotency. If multiple
    -- requests differ only by the idempotency token, the same response is
    -- returned for each repeated request.
    ImportAsProvisionedProduct -> Text
idempotencyToken :: Prelude.Text
  }
  deriving (ImportAsProvisionedProduct -> ImportAsProvisionedProduct -> Bool
(ImportAsProvisionedProduct -> ImportAsProvisionedProduct -> Bool)
-> (ImportAsProvisionedProduct
    -> ImportAsProvisionedProduct -> Bool)
-> Eq ImportAsProvisionedProduct
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ImportAsProvisionedProduct -> ImportAsProvisionedProduct -> Bool
$c/= :: ImportAsProvisionedProduct -> ImportAsProvisionedProduct -> Bool
== :: ImportAsProvisionedProduct -> ImportAsProvisionedProduct -> Bool
$c== :: ImportAsProvisionedProduct -> ImportAsProvisionedProduct -> Bool
Prelude.Eq, ReadPrec [ImportAsProvisionedProduct]
ReadPrec ImportAsProvisionedProduct
Int -> ReadS ImportAsProvisionedProduct
ReadS [ImportAsProvisionedProduct]
(Int -> ReadS ImportAsProvisionedProduct)
-> ReadS [ImportAsProvisionedProduct]
-> ReadPrec ImportAsProvisionedProduct
-> ReadPrec [ImportAsProvisionedProduct]
-> Read ImportAsProvisionedProduct
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ImportAsProvisionedProduct]
$creadListPrec :: ReadPrec [ImportAsProvisionedProduct]
readPrec :: ReadPrec ImportAsProvisionedProduct
$creadPrec :: ReadPrec ImportAsProvisionedProduct
readList :: ReadS [ImportAsProvisionedProduct]
$creadList :: ReadS [ImportAsProvisionedProduct]
readsPrec :: Int -> ReadS ImportAsProvisionedProduct
$creadsPrec :: Int -> ReadS ImportAsProvisionedProduct
Prelude.Read, Int -> ImportAsProvisionedProduct -> ShowS
[ImportAsProvisionedProduct] -> ShowS
ImportAsProvisionedProduct -> String
(Int -> ImportAsProvisionedProduct -> ShowS)
-> (ImportAsProvisionedProduct -> String)
-> ([ImportAsProvisionedProduct] -> ShowS)
-> Show ImportAsProvisionedProduct
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ImportAsProvisionedProduct] -> ShowS
$cshowList :: [ImportAsProvisionedProduct] -> ShowS
show :: ImportAsProvisionedProduct -> String
$cshow :: ImportAsProvisionedProduct -> String
showsPrec :: Int -> ImportAsProvisionedProduct -> ShowS
$cshowsPrec :: Int -> ImportAsProvisionedProduct -> ShowS
Prelude.Show, (forall x.
 ImportAsProvisionedProduct -> Rep ImportAsProvisionedProduct x)
-> (forall x.
    Rep ImportAsProvisionedProduct x -> ImportAsProvisionedProduct)
-> Generic ImportAsProvisionedProduct
forall x.
Rep ImportAsProvisionedProduct x -> ImportAsProvisionedProduct
forall x.
ImportAsProvisionedProduct -> Rep ImportAsProvisionedProduct x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ImportAsProvisionedProduct x -> ImportAsProvisionedProduct
$cfrom :: forall x.
ImportAsProvisionedProduct -> Rep ImportAsProvisionedProduct x
Prelude.Generic)

-- |
-- Create a value of 'ImportAsProvisionedProduct' 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:
--
-- 'acceptLanguage', 'importAsProvisionedProduct_acceptLanguage' - The language code.
--
-- -   @en@ - English (default)
--
-- -   @jp@ - Japanese
--
-- -   @zh@ - Chinese
--
-- 'productId', 'importAsProvisionedProduct_productId' - The product identifier.
--
-- 'provisioningArtifactId', 'importAsProvisionedProduct_provisioningArtifactId' - The identifier of the provisioning artifact.
--
-- 'provisionedProductName', 'importAsProvisionedProduct_provisionedProductName' - The user-friendly name of the provisioned product. The value must be
-- unique for the AWS account. The name cannot be updated after the product
-- is provisioned.
--
-- 'physicalId', 'importAsProvisionedProduct_physicalId' - The unique identifier of the resource to be imported. It only currently
-- supports CloudFormation stack IDs.
--
-- 'idempotencyToken', 'importAsProvisionedProduct_idempotencyToken' - A unique identifier that you provide to ensure idempotency. If multiple
-- requests differ only by the idempotency token, the same response is
-- returned for each repeated request.
newImportAsProvisionedProduct ::
  -- | 'productId'
  Prelude.Text ->
  -- | 'provisioningArtifactId'
  Prelude.Text ->
  -- | 'provisionedProductName'
  Prelude.Text ->
  -- | 'physicalId'
  Prelude.Text ->
  -- | 'idempotencyToken'
  Prelude.Text ->
  ImportAsProvisionedProduct
newImportAsProvisionedProduct :: Text -> Text -> Text -> Text -> Text -> ImportAsProvisionedProduct
newImportAsProvisionedProduct
  Text
pProductId_
  Text
pProvisioningArtifactId_
  Text
pProvisionedProductName_
  Text
pPhysicalId_
  Text
pIdempotencyToken_ =
    ImportAsProvisionedProduct' :: Maybe Text
-> Text
-> Text
-> Text
-> Text
-> Text
-> ImportAsProvisionedProduct
ImportAsProvisionedProduct'
      { $sel:acceptLanguage:ImportAsProvisionedProduct' :: Maybe Text
acceptLanguage =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:productId:ImportAsProvisionedProduct' :: Text
productId = Text
pProductId_,
        $sel:provisioningArtifactId:ImportAsProvisionedProduct' :: Text
provisioningArtifactId =
          Text
pProvisioningArtifactId_,
        $sel:provisionedProductName:ImportAsProvisionedProduct' :: Text
provisionedProductName =
          Text
pProvisionedProductName_,
        $sel:physicalId:ImportAsProvisionedProduct' :: Text
physicalId = Text
pPhysicalId_,
        $sel:idempotencyToken:ImportAsProvisionedProduct' :: Text
idempotencyToken = Text
pIdempotencyToken_
      }

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

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

-- | The identifier of the provisioning artifact.
importAsProvisionedProduct_provisioningArtifactId :: Lens.Lens' ImportAsProvisionedProduct Prelude.Text
importAsProvisionedProduct_provisioningArtifactId :: (Text -> f Text)
-> ImportAsProvisionedProduct -> f ImportAsProvisionedProduct
importAsProvisionedProduct_provisioningArtifactId = (ImportAsProvisionedProduct -> Text)
-> (ImportAsProvisionedProduct
    -> Text -> ImportAsProvisionedProduct)
-> Lens
     ImportAsProvisionedProduct ImportAsProvisionedProduct Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImportAsProvisionedProduct' {Text
provisioningArtifactId :: Text
$sel:provisioningArtifactId:ImportAsProvisionedProduct' :: ImportAsProvisionedProduct -> Text
provisioningArtifactId} -> Text
provisioningArtifactId) (\s :: ImportAsProvisionedProduct
s@ImportAsProvisionedProduct' {} Text
a -> ImportAsProvisionedProduct
s {$sel:provisioningArtifactId:ImportAsProvisionedProduct' :: Text
provisioningArtifactId = Text
a} :: ImportAsProvisionedProduct)

-- | The user-friendly name of the provisioned product. The value must be
-- unique for the AWS account. The name cannot be updated after the product
-- is provisioned.
importAsProvisionedProduct_provisionedProductName :: Lens.Lens' ImportAsProvisionedProduct Prelude.Text
importAsProvisionedProduct_provisionedProductName :: (Text -> f Text)
-> ImportAsProvisionedProduct -> f ImportAsProvisionedProduct
importAsProvisionedProduct_provisionedProductName = (ImportAsProvisionedProduct -> Text)
-> (ImportAsProvisionedProduct
    -> Text -> ImportAsProvisionedProduct)
-> Lens
     ImportAsProvisionedProduct ImportAsProvisionedProduct Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImportAsProvisionedProduct' {Text
provisionedProductName :: Text
$sel:provisionedProductName:ImportAsProvisionedProduct' :: ImportAsProvisionedProduct -> Text
provisionedProductName} -> Text
provisionedProductName) (\s :: ImportAsProvisionedProduct
s@ImportAsProvisionedProduct' {} Text
a -> ImportAsProvisionedProduct
s {$sel:provisionedProductName:ImportAsProvisionedProduct' :: Text
provisionedProductName = Text
a} :: ImportAsProvisionedProduct)

-- | The unique identifier of the resource to be imported. It only currently
-- supports CloudFormation stack IDs.
importAsProvisionedProduct_physicalId :: Lens.Lens' ImportAsProvisionedProduct Prelude.Text
importAsProvisionedProduct_physicalId :: (Text -> f Text)
-> ImportAsProvisionedProduct -> f ImportAsProvisionedProduct
importAsProvisionedProduct_physicalId = (ImportAsProvisionedProduct -> Text)
-> (ImportAsProvisionedProduct
    -> Text -> ImportAsProvisionedProduct)
-> Lens
     ImportAsProvisionedProduct ImportAsProvisionedProduct Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImportAsProvisionedProduct' {Text
physicalId :: Text
$sel:physicalId:ImportAsProvisionedProduct' :: ImportAsProvisionedProduct -> Text
physicalId} -> Text
physicalId) (\s :: ImportAsProvisionedProduct
s@ImportAsProvisionedProduct' {} Text
a -> ImportAsProvisionedProduct
s {$sel:physicalId:ImportAsProvisionedProduct' :: Text
physicalId = Text
a} :: ImportAsProvisionedProduct)

-- | A unique identifier that you provide to ensure idempotency. If multiple
-- requests differ only by the idempotency token, the same response is
-- returned for each repeated request.
importAsProvisionedProduct_idempotencyToken :: Lens.Lens' ImportAsProvisionedProduct Prelude.Text
importAsProvisionedProduct_idempotencyToken :: (Text -> f Text)
-> ImportAsProvisionedProduct -> f ImportAsProvisionedProduct
importAsProvisionedProduct_idempotencyToken = (ImportAsProvisionedProduct -> Text)
-> (ImportAsProvisionedProduct
    -> Text -> ImportAsProvisionedProduct)
-> Lens
     ImportAsProvisionedProduct ImportAsProvisionedProduct Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImportAsProvisionedProduct' {Text
idempotencyToken :: Text
$sel:idempotencyToken:ImportAsProvisionedProduct' :: ImportAsProvisionedProduct -> Text
idempotencyToken} -> Text
idempotencyToken) (\s :: ImportAsProvisionedProduct
s@ImportAsProvisionedProduct' {} Text
a -> ImportAsProvisionedProduct
s {$sel:idempotencyToken:ImportAsProvisionedProduct' :: Text
idempotencyToken = Text
a} :: ImportAsProvisionedProduct)

instance Core.AWSRequest ImportAsProvisionedProduct where
  type
    AWSResponse ImportAsProvisionedProduct =
      ImportAsProvisionedProductResponse
  request :: ImportAsProvisionedProduct -> Request ImportAsProvisionedProduct
request = Service
-> ImportAsProvisionedProduct -> Request ImportAsProvisionedProduct
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy ImportAsProvisionedProduct
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ImportAsProvisionedProduct)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ImportAsProvisionedProduct))
-> Logger
-> Service
-> Proxy ImportAsProvisionedProduct
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ImportAsProvisionedProduct)))
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 RecordDetail -> Int -> ImportAsProvisionedProductResponse
ImportAsProvisionedProductResponse'
            (Maybe RecordDetail -> Int -> ImportAsProvisionedProductResponse)
-> Either String (Maybe RecordDetail)
-> Either String (Int -> ImportAsProvisionedProductResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe RecordDetail)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"RecordDetail")
            Either String (Int -> ImportAsProvisionedProductResponse)
-> Either String Int
-> Either String ImportAsProvisionedProductResponse
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 ImportAsProvisionedProduct

instance Prelude.NFData ImportAsProvisionedProduct

instance Core.ToHeaders ImportAsProvisionedProduct where
  toHeaders :: ImportAsProvisionedProduct -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ImportAsProvisionedProduct -> 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.ImportAsProvisionedProduct" ::
                          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 ImportAsProvisionedProduct where
  toJSON :: ImportAsProvisionedProduct -> Value
toJSON ImportAsProvisionedProduct' {Maybe Text
Text
idempotencyToken :: Text
physicalId :: Text
provisionedProductName :: Text
provisioningArtifactId :: Text
productId :: Text
acceptLanguage :: Maybe Text
$sel:idempotencyToken:ImportAsProvisionedProduct' :: ImportAsProvisionedProduct -> Text
$sel:physicalId:ImportAsProvisionedProduct' :: ImportAsProvisionedProduct -> Text
$sel:provisionedProductName:ImportAsProvisionedProduct' :: ImportAsProvisionedProduct -> Text
$sel:provisioningArtifactId:ImportAsProvisionedProduct' :: ImportAsProvisionedProduct -> Text
$sel:productId:ImportAsProvisionedProduct' :: ImportAsProvisionedProduct -> Text
$sel:acceptLanguage:ImportAsProvisionedProduct' :: ImportAsProvisionedProduct -> 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
"ProductId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
productId),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              ( Text
"ProvisioningArtifactId"
                  Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
provisioningArtifactId
              ),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              ( Text
"ProvisionedProductName"
                  Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
provisionedProductName
              ),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"PhysicalId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
physicalId),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"IdempotencyToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
idempotencyToken)
          ]
      )

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

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

-- | /See:/ 'newImportAsProvisionedProductResponse' smart constructor.
data ImportAsProvisionedProductResponse = ImportAsProvisionedProductResponse'
  { ImportAsProvisionedProductResponse -> Maybe RecordDetail
recordDetail :: Prelude.Maybe RecordDetail,
    -- | The response's http status code.
    ImportAsProvisionedProductResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ImportAsProvisionedProductResponse
-> ImportAsProvisionedProductResponse -> Bool
(ImportAsProvisionedProductResponse
 -> ImportAsProvisionedProductResponse -> Bool)
-> (ImportAsProvisionedProductResponse
    -> ImportAsProvisionedProductResponse -> Bool)
-> Eq ImportAsProvisionedProductResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ImportAsProvisionedProductResponse
-> ImportAsProvisionedProductResponse -> Bool
$c/= :: ImportAsProvisionedProductResponse
-> ImportAsProvisionedProductResponse -> Bool
== :: ImportAsProvisionedProductResponse
-> ImportAsProvisionedProductResponse -> Bool
$c== :: ImportAsProvisionedProductResponse
-> ImportAsProvisionedProductResponse -> Bool
Prelude.Eq, ReadPrec [ImportAsProvisionedProductResponse]
ReadPrec ImportAsProvisionedProductResponse
Int -> ReadS ImportAsProvisionedProductResponse
ReadS [ImportAsProvisionedProductResponse]
(Int -> ReadS ImportAsProvisionedProductResponse)
-> ReadS [ImportAsProvisionedProductResponse]
-> ReadPrec ImportAsProvisionedProductResponse
-> ReadPrec [ImportAsProvisionedProductResponse]
-> Read ImportAsProvisionedProductResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ImportAsProvisionedProductResponse]
$creadListPrec :: ReadPrec [ImportAsProvisionedProductResponse]
readPrec :: ReadPrec ImportAsProvisionedProductResponse
$creadPrec :: ReadPrec ImportAsProvisionedProductResponse
readList :: ReadS [ImportAsProvisionedProductResponse]
$creadList :: ReadS [ImportAsProvisionedProductResponse]
readsPrec :: Int -> ReadS ImportAsProvisionedProductResponse
$creadsPrec :: Int -> ReadS ImportAsProvisionedProductResponse
Prelude.Read, Int -> ImportAsProvisionedProductResponse -> ShowS
[ImportAsProvisionedProductResponse] -> ShowS
ImportAsProvisionedProductResponse -> String
(Int -> ImportAsProvisionedProductResponse -> ShowS)
-> (ImportAsProvisionedProductResponse -> String)
-> ([ImportAsProvisionedProductResponse] -> ShowS)
-> Show ImportAsProvisionedProductResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ImportAsProvisionedProductResponse] -> ShowS
$cshowList :: [ImportAsProvisionedProductResponse] -> ShowS
show :: ImportAsProvisionedProductResponse -> String
$cshow :: ImportAsProvisionedProductResponse -> String
showsPrec :: Int -> ImportAsProvisionedProductResponse -> ShowS
$cshowsPrec :: Int -> ImportAsProvisionedProductResponse -> ShowS
Prelude.Show, (forall x.
 ImportAsProvisionedProductResponse
 -> Rep ImportAsProvisionedProductResponse x)
-> (forall x.
    Rep ImportAsProvisionedProductResponse x
    -> ImportAsProvisionedProductResponse)
-> Generic ImportAsProvisionedProductResponse
forall x.
Rep ImportAsProvisionedProductResponse x
-> ImportAsProvisionedProductResponse
forall x.
ImportAsProvisionedProductResponse
-> Rep ImportAsProvisionedProductResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ImportAsProvisionedProductResponse x
-> ImportAsProvisionedProductResponse
$cfrom :: forall x.
ImportAsProvisionedProductResponse
-> Rep ImportAsProvisionedProductResponse x
Prelude.Generic)

-- |
-- Create a value of 'ImportAsProvisionedProductResponse' 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:
--
-- 'recordDetail', 'importAsProvisionedProductResponse_recordDetail' - Undocumented member.
--
-- 'httpStatus', 'importAsProvisionedProductResponse_httpStatus' - The response's http status code.
newImportAsProvisionedProductResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ImportAsProvisionedProductResponse
newImportAsProvisionedProductResponse :: Int -> ImportAsProvisionedProductResponse
newImportAsProvisionedProductResponse Int
pHttpStatus_ =
  ImportAsProvisionedProductResponse' :: Maybe RecordDetail -> Int -> ImportAsProvisionedProductResponse
ImportAsProvisionedProductResponse'
    { $sel:recordDetail:ImportAsProvisionedProductResponse' :: Maybe RecordDetail
recordDetail =
        Maybe RecordDetail
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ImportAsProvisionedProductResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Undocumented member.
importAsProvisionedProductResponse_recordDetail :: Lens.Lens' ImportAsProvisionedProductResponse (Prelude.Maybe RecordDetail)
importAsProvisionedProductResponse_recordDetail :: (Maybe RecordDetail -> f (Maybe RecordDetail))
-> ImportAsProvisionedProductResponse
-> f ImportAsProvisionedProductResponse
importAsProvisionedProductResponse_recordDetail = (ImportAsProvisionedProductResponse -> Maybe RecordDetail)
-> (ImportAsProvisionedProductResponse
    -> Maybe RecordDetail -> ImportAsProvisionedProductResponse)
-> Lens
     ImportAsProvisionedProductResponse
     ImportAsProvisionedProductResponse
     (Maybe RecordDetail)
     (Maybe RecordDetail)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImportAsProvisionedProductResponse' {Maybe RecordDetail
recordDetail :: Maybe RecordDetail
$sel:recordDetail:ImportAsProvisionedProductResponse' :: ImportAsProvisionedProductResponse -> Maybe RecordDetail
recordDetail} -> Maybe RecordDetail
recordDetail) (\s :: ImportAsProvisionedProductResponse
s@ImportAsProvisionedProductResponse' {} Maybe RecordDetail
a -> ImportAsProvisionedProductResponse
s {$sel:recordDetail:ImportAsProvisionedProductResponse' :: Maybe RecordDetail
recordDetail = Maybe RecordDetail
a} :: ImportAsProvisionedProductResponse)

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

instance
  Prelude.NFData
    ImportAsProvisionedProductResponse