{-# 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.TerminateProvisionedProduct
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Terminates the specified provisioned product.
--
-- This operation does not delete any records associated with the
-- provisioned product.
--
-- You can check the status of this request using DescribeRecord.
module Amazonka.ServiceCatalog.TerminateProvisionedProduct
  ( -- * Creating a Request
    TerminateProvisionedProduct (..),
    newTerminateProvisionedProduct,

    -- * Request Lenses
    terminateProvisionedProduct_acceptLanguage,
    terminateProvisionedProduct_ignoreErrors,
    terminateProvisionedProduct_provisionedProductId,
    terminateProvisionedProduct_provisionedProductName,
    terminateProvisionedProduct_retainPhysicalResources,
    terminateProvisionedProduct_terminateToken,

    -- * Destructuring the Response
    TerminateProvisionedProductResponse (..),
    newTerminateProvisionedProductResponse,

    -- * Response Lenses
    terminateProvisionedProductResponse_recordDetail,
    terminateProvisionedProductResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.ServiceCatalog.Types

-- | /See:/ 'newTerminateProvisionedProduct' smart constructor.
data TerminateProvisionedProduct = TerminateProvisionedProduct'
  { -- | The language code.
    --
    -- -   @en@ - English (default)
    --
    -- -   @jp@ - Japanese
    --
    -- -   @zh@ - Chinese
    TerminateProvisionedProduct -> Maybe Text
acceptLanguage :: Prelude.Maybe Prelude.Text,
    -- | If set to true, Service Catalog stops managing the specified provisioned
    -- product even if it cannot delete the underlying resources.
    TerminateProvisionedProduct -> Maybe Bool
ignoreErrors :: Prelude.Maybe Prelude.Bool,
    -- | The identifier of the provisioned product. You cannot specify both
    -- @ProvisionedProductName@ and @ProvisionedProductId@.
    TerminateProvisionedProduct -> Maybe Text
provisionedProductId :: Prelude.Maybe Prelude.Text,
    -- | The name of the provisioned product. You cannot specify both
    -- @ProvisionedProductName@ and @ProvisionedProductId@.
    TerminateProvisionedProduct -> Maybe Text
provisionedProductName :: Prelude.Maybe Prelude.Text,
    -- | When this boolean parameter is set to true, the
    -- @TerminateProvisionedProduct@ API deletes the Service Catalog
    -- provisioned product. However, it does not remove the CloudFormation
    -- stack, stack set, or the underlying resources of the deleted provisioned
    -- product. The default value is false.
    TerminateProvisionedProduct -> Maybe Bool
retainPhysicalResources :: Prelude.Maybe Prelude.Bool,
    -- | An idempotency token that uniquely identifies the termination request.
    -- This token is only valid during the termination process. After the
    -- provisioned product is terminated, subsequent requests to terminate the
    -- same provisioned product always return __ResourceNotFound__.
    TerminateProvisionedProduct -> Text
terminateToken :: Prelude.Text
  }
  deriving (TerminateProvisionedProduct -> TerminateProvisionedProduct -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TerminateProvisionedProduct -> TerminateProvisionedProduct -> Bool
$c/= :: TerminateProvisionedProduct -> TerminateProvisionedProduct -> Bool
== :: TerminateProvisionedProduct -> TerminateProvisionedProduct -> Bool
$c== :: TerminateProvisionedProduct -> TerminateProvisionedProduct -> Bool
Prelude.Eq, ReadPrec [TerminateProvisionedProduct]
ReadPrec TerminateProvisionedProduct
Int -> ReadS TerminateProvisionedProduct
ReadS [TerminateProvisionedProduct]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TerminateProvisionedProduct]
$creadListPrec :: ReadPrec [TerminateProvisionedProduct]
readPrec :: ReadPrec TerminateProvisionedProduct
$creadPrec :: ReadPrec TerminateProvisionedProduct
readList :: ReadS [TerminateProvisionedProduct]
$creadList :: ReadS [TerminateProvisionedProduct]
readsPrec :: Int -> ReadS TerminateProvisionedProduct
$creadsPrec :: Int -> ReadS TerminateProvisionedProduct
Prelude.Read, Int -> TerminateProvisionedProduct -> ShowS
[TerminateProvisionedProduct] -> ShowS
TerminateProvisionedProduct -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TerminateProvisionedProduct] -> ShowS
$cshowList :: [TerminateProvisionedProduct] -> ShowS
show :: TerminateProvisionedProduct -> String
$cshow :: TerminateProvisionedProduct -> String
showsPrec :: Int -> TerminateProvisionedProduct -> ShowS
$cshowsPrec :: Int -> TerminateProvisionedProduct -> ShowS
Prelude.Show, forall x.
Rep TerminateProvisionedProduct x -> TerminateProvisionedProduct
forall x.
TerminateProvisionedProduct -> Rep TerminateProvisionedProduct x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep TerminateProvisionedProduct x -> TerminateProvisionedProduct
$cfrom :: forall x.
TerminateProvisionedProduct -> Rep TerminateProvisionedProduct x
Prelude.Generic)

-- |
-- Create a value of 'TerminateProvisionedProduct' 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', 'terminateProvisionedProduct_acceptLanguage' - The language code.
--
-- -   @en@ - English (default)
--
-- -   @jp@ - Japanese
--
-- -   @zh@ - Chinese
--
-- 'ignoreErrors', 'terminateProvisionedProduct_ignoreErrors' - If set to true, Service Catalog stops managing the specified provisioned
-- product even if it cannot delete the underlying resources.
--
-- 'provisionedProductId', 'terminateProvisionedProduct_provisionedProductId' - The identifier of the provisioned product. You cannot specify both
-- @ProvisionedProductName@ and @ProvisionedProductId@.
--
-- 'provisionedProductName', 'terminateProvisionedProduct_provisionedProductName' - The name of the provisioned product. You cannot specify both
-- @ProvisionedProductName@ and @ProvisionedProductId@.
--
-- 'retainPhysicalResources', 'terminateProvisionedProduct_retainPhysicalResources' - When this boolean parameter is set to true, the
-- @TerminateProvisionedProduct@ API deletes the Service Catalog
-- provisioned product. However, it does not remove the CloudFormation
-- stack, stack set, or the underlying resources of the deleted provisioned
-- product. The default value is false.
--
-- 'terminateToken', 'terminateProvisionedProduct_terminateToken' - An idempotency token that uniquely identifies the termination request.
-- This token is only valid during the termination process. After the
-- provisioned product is terminated, subsequent requests to terminate the
-- same provisioned product always return __ResourceNotFound__.
newTerminateProvisionedProduct ::
  -- | 'terminateToken'
  Prelude.Text ->
  TerminateProvisionedProduct
newTerminateProvisionedProduct :: Text -> TerminateProvisionedProduct
newTerminateProvisionedProduct Text
pTerminateToken_ =
  TerminateProvisionedProduct'
    { $sel:acceptLanguage:TerminateProvisionedProduct' :: Maybe Text
acceptLanguage =
        forall a. Maybe a
Prelude.Nothing,
      $sel:ignoreErrors:TerminateProvisionedProduct' :: Maybe Bool
ignoreErrors = forall a. Maybe a
Prelude.Nothing,
      $sel:provisionedProductId:TerminateProvisionedProduct' :: Maybe Text
provisionedProductId = forall a. Maybe a
Prelude.Nothing,
      $sel:provisionedProductName:TerminateProvisionedProduct' :: Maybe Text
provisionedProductName = forall a. Maybe a
Prelude.Nothing,
      $sel:retainPhysicalResources:TerminateProvisionedProduct' :: Maybe Bool
retainPhysicalResources = forall a. Maybe a
Prelude.Nothing,
      $sel:terminateToken:TerminateProvisionedProduct' :: Text
terminateToken = Text
pTerminateToken_
    }

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

-- | If set to true, Service Catalog stops managing the specified provisioned
-- product even if it cannot delete the underlying resources.
terminateProvisionedProduct_ignoreErrors :: Lens.Lens' TerminateProvisionedProduct (Prelude.Maybe Prelude.Bool)
terminateProvisionedProduct_ignoreErrors :: Lens' TerminateProvisionedProduct (Maybe Bool)
terminateProvisionedProduct_ignoreErrors = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TerminateProvisionedProduct' {Maybe Bool
ignoreErrors :: Maybe Bool
$sel:ignoreErrors:TerminateProvisionedProduct' :: TerminateProvisionedProduct -> Maybe Bool
ignoreErrors} -> Maybe Bool
ignoreErrors) (\s :: TerminateProvisionedProduct
s@TerminateProvisionedProduct' {} Maybe Bool
a -> TerminateProvisionedProduct
s {$sel:ignoreErrors:TerminateProvisionedProduct' :: Maybe Bool
ignoreErrors = Maybe Bool
a} :: TerminateProvisionedProduct)

-- | The identifier of the provisioned product. You cannot specify both
-- @ProvisionedProductName@ and @ProvisionedProductId@.
terminateProvisionedProduct_provisionedProductId :: Lens.Lens' TerminateProvisionedProduct (Prelude.Maybe Prelude.Text)
terminateProvisionedProduct_provisionedProductId :: Lens' TerminateProvisionedProduct (Maybe Text)
terminateProvisionedProduct_provisionedProductId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TerminateProvisionedProduct' {Maybe Text
provisionedProductId :: Maybe Text
$sel:provisionedProductId:TerminateProvisionedProduct' :: TerminateProvisionedProduct -> Maybe Text
provisionedProductId} -> Maybe Text
provisionedProductId) (\s :: TerminateProvisionedProduct
s@TerminateProvisionedProduct' {} Maybe Text
a -> TerminateProvisionedProduct
s {$sel:provisionedProductId:TerminateProvisionedProduct' :: Maybe Text
provisionedProductId = Maybe Text
a} :: TerminateProvisionedProduct)

-- | The name of the provisioned product. You cannot specify both
-- @ProvisionedProductName@ and @ProvisionedProductId@.
terminateProvisionedProduct_provisionedProductName :: Lens.Lens' TerminateProvisionedProduct (Prelude.Maybe Prelude.Text)
terminateProvisionedProduct_provisionedProductName :: Lens' TerminateProvisionedProduct (Maybe Text)
terminateProvisionedProduct_provisionedProductName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TerminateProvisionedProduct' {Maybe Text
provisionedProductName :: Maybe Text
$sel:provisionedProductName:TerminateProvisionedProduct' :: TerminateProvisionedProduct -> Maybe Text
provisionedProductName} -> Maybe Text
provisionedProductName) (\s :: TerminateProvisionedProduct
s@TerminateProvisionedProduct' {} Maybe Text
a -> TerminateProvisionedProduct
s {$sel:provisionedProductName:TerminateProvisionedProduct' :: Maybe Text
provisionedProductName = Maybe Text
a} :: TerminateProvisionedProduct)

-- | When this boolean parameter is set to true, the
-- @TerminateProvisionedProduct@ API deletes the Service Catalog
-- provisioned product. However, it does not remove the CloudFormation
-- stack, stack set, or the underlying resources of the deleted provisioned
-- product. The default value is false.
terminateProvisionedProduct_retainPhysicalResources :: Lens.Lens' TerminateProvisionedProduct (Prelude.Maybe Prelude.Bool)
terminateProvisionedProduct_retainPhysicalResources :: Lens' TerminateProvisionedProduct (Maybe Bool)
terminateProvisionedProduct_retainPhysicalResources = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TerminateProvisionedProduct' {Maybe Bool
retainPhysicalResources :: Maybe Bool
$sel:retainPhysicalResources:TerminateProvisionedProduct' :: TerminateProvisionedProduct -> Maybe Bool
retainPhysicalResources} -> Maybe Bool
retainPhysicalResources) (\s :: TerminateProvisionedProduct
s@TerminateProvisionedProduct' {} Maybe Bool
a -> TerminateProvisionedProduct
s {$sel:retainPhysicalResources:TerminateProvisionedProduct' :: Maybe Bool
retainPhysicalResources = Maybe Bool
a} :: TerminateProvisionedProduct)

-- | An idempotency token that uniquely identifies the termination request.
-- This token is only valid during the termination process. After the
-- provisioned product is terminated, subsequent requests to terminate the
-- same provisioned product always return __ResourceNotFound__.
terminateProvisionedProduct_terminateToken :: Lens.Lens' TerminateProvisionedProduct Prelude.Text
terminateProvisionedProduct_terminateToken :: Lens' TerminateProvisionedProduct Text
terminateProvisionedProduct_terminateToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TerminateProvisionedProduct' {Text
terminateToken :: Text
$sel:terminateToken:TerminateProvisionedProduct' :: TerminateProvisionedProduct -> Text
terminateToken} -> Text
terminateToken) (\s :: TerminateProvisionedProduct
s@TerminateProvisionedProduct' {} Text
a -> TerminateProvisionedProduct
s {$sel:terminateToken:TerminateProvisionedProduct' :: Text
terminateToken = Text
a} :: TerminateProvisionedProduct)

instance Core.AWSRequest TerminateProvisionedProduct where
  type
    AWSResponse TerminateProvisionedProduct =
      TerminateProvisionedProductResponse
  request :: (Service -> Service)
-> TerminateProvisionedProduct
-> Request TerminateProvisionedProduct
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy TerminateProvisionedProduct
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse TerminateProvisionedProduct)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe RecordDetail -> Int -> TerminateProvisionedProductResponse
TerminateProvisionedProductResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"RecordDetail")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable TerminateProvisionedProduct where
  hashWithSalt :: Int -> TerminateProvisionedProduct -> Int
hashWithSalt Int
_salt TerminateProvisionedProduct' {Maybe Bool
Maybe Text
Text
terminateToken :: Text
retainPhysicalResources :: Maybe Bool
provisionedProductName :: Maybe Text
provisionedProductId :: Maybe Text
ignoreErrors :: Maybe Bool
acceptLanguage :: Maybe Text
$sel:terminateToken:TerminateProvisionedProduct' :: TerminateProvisionedProduct -> Text
$sel:retainPhysicalResources:TerminateProvisionedProduct' :: TerminateProvisionedProduct -> Maybe Bool
$sel:provisionedProductName:TerminateProvisionedProduct' :: TerminateProvisionedProduct -> Maybe Text
$sel:provisionedProductId:TerminateProvisionedProduct' :: TerminateProvisionedProduct -> Maybe Text
$sel:ignoreErrors:TerminateProvisionedProduct' :: TerminateProvisionedProduct -> Maybe Bool
$sel:acceptLanguage:TerminateProvisionedProduct' :: TerminateProvisionedProduct -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
acceptLanguage
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
ignoreErrors
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
provisionedProductId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
provisionedProductName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
retainPhysicalResources
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
terminateToken

instance Prelude.NFData TerminateProvisionedProduct where
  rnf :: TerminateProvisionedProduct -> ()
rnf TerminateProvisionedProduct' {Maybe Bool
Maybe Text
Text
terminateToken :: Text
retainPhysicalResources :: Maybe Bool
provisionedProductName :: Maybe Text
provisionedProductId :: Maybe Text
ignoreErrors :: Maybe Bool
acceptLanguage :: Maybe Text
$sel:terminateToken:TerminateProvisionedProduct' :: TerminateProvisionedProduct -> Text
$sel:retainPhysicalResources:TerminateProvisionedProduct' :: TerminateProvisionedProduct -> Maybe Bool
$sel:provisionedProductName:TerminateProvisionedProduct' :: TerminateProvisionedProduct -> Maybe Text
$sel:provisionedProductId:TerminateProvisionedProduct' :: TerminateProvisionedProduct -> Maybe Text
$sel:ignoreErrors:TerminateProvisionedProduct' :: TerminateProvisionedProduct -> Maybe Bool
$sel:acceptLanguage:TerminateProvisionedProduct' :: TerminateProvisionedProduct -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
acceptLanguage
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
ignoreErrors
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
provisionedProductId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
provisionedProductName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
retainPhysicalResources
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
terminateToken

instance Data.ToHeaders TerminateProvisionedProduct where
  toHeaders :: TerminateProvisionedProduct -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"AWS242ServiceCatalogService.TerminateProvisionedProduct" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON TerminateProvisionedProduct where
  toJSON :: TerminateProvisionedProduct -> Value
toJSON TerminateProvisionedProduct' {Maybe Bool
Maybe Text
Text
terminateToken :: Text
retainPhysicalResources :: Maybe Bool
provisionedProductName :: Maybe Text
provisionedProductId :: Maybe Text
ignoreErrors :: Maybe Bool
acceptLanguage :: Maybe Text
$sel:terminateToken:TerminateProvisionedProduct' :: TerminateProvisionedProduct -> Text
$sel:retainPhysicalResources:TerminateProvisionedProduct' :: TerminateProvisionedProduct -> Maybe Bool
$sel:provisionedProductName:TerminateProvisionedProduct' :: TerminateProvisionedProduct -> Maybe Text
$sel:provisionedProductId:TerminateProvisionedProduct' :: TerminateProvisionedProduct -> Maybe Text
$sel:ignoreErrors:TerminateProvisionedProduct' :: TerminateProvisionedProduct -> Maybe Bool
$sel:acceptLanguage:TerminateProvisionedProduct' :: TerminateProvisionedProduct -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"AcceptLanguage" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
acceptLanguage,
            (Key
"IgnoreErrors" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
ignoreErrors,
            (Key
"ProvisionedProductId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
provisionedProductId,
            (Key
"ProvisionedProductName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
provisionedProductName,
            (Key
"RetainPhysicalResources" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
retainPhysicalResources,
            forall a. a -> Maybe a
Prelude.Just
              (Key
"TerminateToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
terminateToken)
          ]
      )

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

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

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

-- |
-- Create a value of 'TerminateProvisionedProductResponse' 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', 'terminateProvisionedProductResponse_recordDetail' - Information about the result of this request.
--
-- 'httpStatus', 'terminateProvisionedProductResponse_httpStatus' - The response's http status code.
newTerminateProvisionedProductResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  TerminateProvisionedProductResponse
newTerminateProvisionedProductResponse :: Int -> TerminateProvisionedProductResponse
newTerminateProvisionedProductResponse Int
pHttpStatus_ =
  TerminateProvisionedProductResponse'
    { $sel:recordDetail:TerminateProvisionedProductResponse' :: Maybe RecordDetail
recordDetail =
        forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:TerminateProvisionedProductResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Information about the result of this request.
terminateProvisionedProductResponse_recordDetail :: Lens.Lens' TerminateProvisionedProductResponse (Prelude.Maybe RecordDetail)
terminateProvisionedProductResponse_recordDetail :: Lens' TerminateProvisionedProductResponse (Maybe RecordDetail)
terminateProvisionedProductResponse_recordDetail = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TerminateProvisionedProductResponse' {Maybe RecordDetail
recordDetail :: Maybe RecordDetail
$sel:recordDetail:TerminateProvisionedProductResponse' :: TerminateProvisionedProductResponse -> Maybe RecordDetail
recordDetail} -> Maybe RecordDetail
recordDetail) (\s :: TerminateProvisionedProductResponse
s@TerminateProvisionedProductResponse' {} Maybe RecordDetail
a -> TerminateProvisionedProductResponse
s {$sel:recordDetail:TerminateProvisionedProductResponse' :: Maybe RecordDetail
recordDetail = Maybe RecordDetail
a} :: TerminateProvisionedProductResponse)

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

instance
  Prelude.NFData
    TerminateProvisionedProductResponse
  where
  rnf :: TerminateProvisionedProductResponse -> ()
rnf TerminateProvisionedProductResponse' {Int
Maybe RecordDetail
httpStatus :: Int
recordDetail :: Maybe RecordDetail
$sel:httpStatus:TerminateProvisionedProductResponse' :: TerminateProvisionedProductResponse -> Int
$sel:recordDetail:TerminateProvisionedProductResponse' :: TerminateProvisionedProductResponse -> Maybe RecordDetail
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe RecordDetail
recordDetail
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus