{-# 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-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)
--
-- 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_provisionedProductName,
    terminateProvisionedProduct_retainPhysicalResources,
    terminateProvisionedProduct_acceptLanguage,
    terminateProvisionedProduct_ignoreErrors,
    terminateProvisionedProduct_provisionedProductId,
    terminateProvisionedProduct_terminateToken,

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

    -- * Response Lenses
    terminateProvisionedProductResponse_recordDetail,
    terminateProvisionedProductResponse_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:/ 'newTerminateProvisionedProduct' smart constructor.
data TerminateProvisionedProduct = TerminateProvisionedProduct'
  { -- | 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,
    -- | The language code.
    --
    -- -   @en@ - English (default)
    --
    -- -   @jp@ - Japanese
    --
    -- -   @zh@ - Chinese
    TerminateProvisionedProduct -> Maybe Text
acceptLanguage :: Prelude.Maybe Prelude.Text,
    -- | If set to true, AWS 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,
    -- | 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
(TerminateProvisionedProduct
 -> TerminateProvisionedProduct -> Bool)
-> (TerminateProvisionedProduct
    -> TerminateProvisionedProduct -> Bool)
-> Eq TerminateProvisionedProduct
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]
(Int -> ReadS TerminateProvisionedProduct)
-> ReadS [TerminateProvisionedProduct]
-> ReadPrec TerminateProvisionedProduct
-> ReadPrec [TerminateProvisionedProduct]
-> Read 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
(Int -> TerminateProvisionedProduct -> ShowS)
-> (TerminateProvisionedProduct -> String)
-> ([TerminateProvisionedProduct] -> ShowS)
-> Show TerminateProvisionedProduct
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.
 TerminateProvisionedProduct -> Rep TerminateProvisionedProduct x)
-> (forall x.
    Rep TerminateProvisionedProduct x -> TerminateProvisionedProduct)
-> Generic TerminateProvisionedProduct
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:
--
-- '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.
--
-- 'acceptLanguage', 'terminateProvisionedProduct_acceptLanguage' - The language code.
--
-- -   @en@ - English (default)
--
-- -   @jp@ - Japanese
--
-- -   @zh@ - Chinese
--
-- 'ignoreErrors', 'terminateProvisionedProduct_ignoreErrors' - If set to true, AWS 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@.
--
-- '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' :: Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Text
-> TerminateProvisionedProduct
TerminateProvisionedProduct'
    { $sel:provisionedProductName:TerminateProvisionedProduct' :: Maybe Text
provisionedProductName =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:retainPhysicalResources:TerminateProvisionedProduct' :: Maybe Bool
retainPhysicalResources = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:acceptLanguage:TerminateProvisionedProduct' :: Maybe Text
acceptLanguage = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:ignoreErrors:TerminateProvisionedProduct' :: Maybe Bool
ignoreErrors = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:provisionedProductId:TerminateProvisionedProduct' :: Maybe Text
provisionedProductId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:terminateToken:TerminateProvisionedProduct' :: Text
terminateToken = Text
pTerminateToken_
    }

-- | The name of the provisioned product. You cannot specify both
-- @ProvisionedProductName@ and @ProvisionedProductId@.
terminateProvisionedProduct_provisionedProductName :: Lens.Lens' TerminateProvisionedProduct (Prelude.Maybe Prelude.Text)
terminateProvisionedProduct_provisionedProductName :: (Maybe Text -> f (Maybe Text))
-> TerminateProvisionedProduct -> f TerminateProvisionedProduct
terminateProvisionedProduct_provisionedProductName = (TerminateProvisionedProduct -> Maybe Text)
-> (TerminateProvisionedProduct
    -> Maybe Text -> TerminateProvisionedProduct)
-> Lens
     TerminateProvisionedProduct
     TerminateProvisionedProduct
     (Maybe Text)
     (Maybe Text)
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 :: (Maybe Bool -> f (Maybe Bool))
-> TerminateProvisionedProduct -> f TerminateProvisionedProduct
terminateProvisionedProduct_retainPhysicalResources = (TerminateProvisionedProduct -> Maybe Bool)
-> (TerminateProvisionedProduct
    -> Maybe Bool -> TerminateProvisionedProduct)
-> Lens
     TerminateProvisionedProduct
     TerminateProvisionedProduct
     (Maybe Bool)
     (Maybe Bool)
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)

-- | The language code.
--
-- -   @en@ - English (default)
--
-- -   @jp@ - Japanese
--
-- -   @zh@ - Chinese
terminateProvisionedProduct_acceptLanguage :: Lens.Lens' TerminateProvisionedProduct (Prelude.Maybe Prelude.Text)
terminateProvisionedProduct_acceptLanguage :: (Maybe Text -> f (Maybe Text))
-> TerminateProvisionedProduct -> f TerminateProvisionedProduct
terminateProvisionedProduct_acceptLanguage = (TerminateProvisionedProduct -> Maybe Text)
-> (TerminateProvisionedProduct
    -> Maybe Text -> TerminateProvisionedProduct)
-> Lens
     TerminateProvisionedProduct
     TerminateProvisionedProduct
     (Maybe Text)
     (Maybe Text)
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, AWS 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 :: (Maybe Bool -> f (Maybe Bool))
-> TerminateProvisionedProduct -> f TerminateProvisionedProduct
terminateProvisionedProduct_ignoreErrors = (TerminateProvisionedProduct -> Maybe Bool)
-> (TerminateProvisionedProduct
    -> Maybe Bool -> TerminateProvisionedProduct)
-> Lens
     TerminateProvisionedProduct
     TerminateProvisionedProduct
     (Maybe Bool)
     (Maybe Bool)
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 :: (Maybe Text -> f (Maybe Text))
-> TerminateProvisionedProduct -> f TerminateProvisionedProduct
terminateProvisionedProduct_provisionedProductId = (TerminateProvisionedProduct -> Maybe Text)
-> (TerminateProvisionedProduct
    -> Maybe Text -> TerminateProvisionedProduct)
-> Lens
     TerminateProvisionedProduct
     TerminateProvisionedProduct
     (Maybe Text)
     (Maybe Text)
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)

-- | 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 :: (Text -> f Text)
-> TerminateProvisionedProduct -> f TerminateProvisionedProduct
terminateProvisionedProduct_terminateToken = (TerminateProvisionedProduct -> Text)
-> (TerminateProvisionedProduct
    -> Text -> TerminateProvisionedProduct)
-> Lens
     TerminateProvisionedProduct TerminateProvisionedProduct Text Text
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 :: TerminateProvisionedProduct -> Request TerminateProvisionedProduct
request = Service
-> TerminateProvisionedProduct
-> Request TerminateProvisionedProduct
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy TerminateProvisionedProduct
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse TerminateProvisionedProduct)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse TerminateProvisionedProduct))
-> Logger
-> Service
-> Proxy TerminateProvisionedProduct
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse TerminateProvisionedProduct)))
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 -> TerminateProvisionedProductResponse
TerminateProvisionedProductResponse'
            (Maybe RecordDetail -> Int -> TerminateProvisionedProductResponse)
-> Either String (Maybe RecordDetail)
-> Either String (Int -> TerminateProvisionedProductResponse)
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 -> TerminateProvisionedProductResponse)
-> Either String Int
-> Either String TerminateProvisionedProductResponse
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 TerminateProvisionedProduct

instance Prelude.NFData TerminateProvisionedProduct

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

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

instance Core.ToQuery TerminateProvisionedProduct where
  toQuery :: TerminateProvisionedProduct -> QueryString
toQuery = QueryString -> TerminateProvisionedProduct -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
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
(TerminateProvisionedProductResponse
 -> TerminateProvisionedProductResponse -> Bool)
-> (TerminateProvisionedProductResponse
    -> TerminateProvisionedProductResponse -> Bool)
-> Eq TerminateProvisionedProductResponse
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]
(Int -> ReadS TerminateProvisionedProductResponse)
-> ReadS [TerminateProvisionedProductResponse]
-> ReadPrec TerminateProvisionedProductResponse
-> ReadPrec [TerminateProvisionedProductResponse]
-> Read 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
(Int -> TerminateProvisionedProductResponse -> ShowS)
-> (TerminateProvisionedProductResponse -> String)
-> ([TerminateProvisionedProductResponse] -> ShowS)
-> Show TerminateProvisionedProductResponse
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.
 TerminateProvisionedProductResponse
 -> Rep TerminateProvisionedProductResponse x)
-> (forall x.
    Rep TerminateProvisionedProductResponse x
    -> TerminateProvisionedProductResponse)
-> Generic TerminateProvisionedProductResponse
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' :: Maybe RecordDetail -> Int -> TerminateProvisionedProductResponse
TerminateProvisionedProductResponse'
    { $sel:recordDetail:TerminateProvisionedProductResponse' :: Maybe RecordDetail
recordDetail =
        Maybe 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 :: (Maybe RecordDetail -> f (Maybe RecordDetail))
-> TerminateProvisionedProductResponse
-> f TerminateProvisionedProductResponse
terminateProvisionedProductResponse_recordDetail = (TerminateProvisionedProductResponse -> Maybe RecordDetail)
-> (TerminateProvisionedProductResponse
    -> Maybe RecordDetail -> TerminateProvisionedProductResponse)
-> Lens
     TerminateProvisionedProductResponse
     TerminateProvisionedProductResponse
     (Maybe RecordDetail)
     (Maybe 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 :: (Int -> f Int)
-> TerminateProvisionedProductResponse
-> f TerminateProvisionedProductResponse
terminateProvisionedProductResponse_httpStatus = (TerminateProvisionedProductResponse -> Int)
-> (TerminateProvisionedProductResponse
    -> Int -> TerminateProvisionedProductResponse)
-> Lens
     TerminateProvisionedProductResponse
     TerminateProvisionedProductResponse
     Int
     Int
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