{-# 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.CloudControl.DeleteResource
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Deletes the specified resource. For details, see
-- <https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-operations-delete.html Deleting a resource>
-- in the /Amazon Web Services Cloud Control API User Guide/.
--
-- After you have initiated a resource deletion request, you can monitor
-- the progress of your request by calling
-- <https://docs.aws.amazon.com/cloudcontrolapi/latest/APIReference/API_GetResourceRequestStatus.html GetResourceRequestStatus>
-- using the @RequestToken@ of the @ProgressEvent@ returned by
-- @DeleteResource@.
module Amazonka.CloudControl.DeleteResource
  ( -- * Creating a Request
    DeleteResource (..),
    newDeleteResource,

    -- * Request Lenses
    deleteResource_clientToken,
    deleteResource_roleArn,
    deleteResource_typeVersionId,
    deleteResource_typeName,
    deleteResource_identifier,

    -- * Destructuring the Response
    DeleteResourceResponse (..),
    newDeleteResourceResponse,

    -- * Response Lenses
    deleteResourceResponse_progressEvent,
    deleteResourceResponse_httpStatus,
  )
where

import Amazonka.CloudControl.Types
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

-- | /See:/ 'newDeleteResource' smart constructor.
data DeleteResource = DeleteResource'
  { -- | A unique identifier to ensure the idempotency of the resource request.
    -- As a best practice, specify this token to ensure idempotency, so that
    -- Amazon Web Services Cloud Control API can accurately distinguish between
    -- request retries and new resource requests. You might retry a resource
    -- request to ensure that it was successfully received.
    --
    -- A client token is valid for 36 hours once used. After that, a resource
    -- request with the same client token is treated as a new request.
    --
    -- If you do not specify a client token, one is generated for inclusion in
    -- the request.
    --
    -- For more information, see
    -- <https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-operations.html#resource-operations-idempotency Ensuring resource operation requests are unique>
    -- in the /Amazon Web Services Cloud Control API User Guide/.
    DeleteResource -> Maybe Text
clientToken :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the Identity and Access Management
    -- (IAM) role for Cloud Control API to use when performing this resource
    -- operation. The role specified must have the permissions required for
    -- this operation. The necessary permissions for each event handler are
    -- defined in the
    -- @ @<https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-schema.html#schema-properties-handlers handlers>@ @
    -- section of the
    -- <https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-schema.html resource type definition schema>.
    --
    -- If you do not specify a role, Cloud Control API uses a temporary session
    -- created using your Amazon Web Services user credentials.
    --
    -- For more information, see
    -- <https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-operations.html#resource-operations-permissions Specifying credentials>
    -- in the /Amazon Web Services Cloud Control API User Guide/.
    DeleteResource -> Maybe Text
roleArn :: Prelude.Maybe Prelude.Text,
    -- | For private resource types, the type version to use in this resource
    -- operation. If you do not specify a resource version, CloudFormation uses
    -- the default version.
    DeleteResource -> Maybe Text
typeVersionId :: Prelude.Maybe Prelude.Text,
    -- | The name of the resource type.
    DeleteResource -> Text
typeName :: Prelude.Text,
    -- | The identifier for the resource.
    --
    -- You can specify the primary identifier, or any secondary identifier
    -- defined for the resource type in its resource schema. You can only
    -- specify one identifier. Primary identifiers can be specified as a string
    -- or JSON; secondary identifiers must be specified as JSON.
    --
    -- For compound primary identifiers (that is, one that consists of multiple
    -- resource properties strung together), to specify the primary identifier
    -- as a string, list the property values /in the order they are specified/
    -- in the primary identifier definition, separated by @|@.
    --
    -- For more information, see
    -- <https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-identifier.html Identifying resources>
    -- in the /Amazon Web Services Cloud Control API User Guide/.
    DeleteResource -> Text
identifier :: Prelude.Text
  }
  deriving (DeleteResource -> DeleteResource -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteResource -> DeleteResource -> Bool
$c/= :: DeleteResource -> DeleteResource -> Bool
== :: DeleteResource -> DeleteResource -> Bool
$c== :: DeleteResource -> DeleteResource -> Bool
Prelude.Eq, ReadPrec [DeleteResource]
ReadPrec DeleteResource
Int -> ReadS DeleteResource
ReadS [DeleteResource]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteResource]
$creadListPrec :: ReadPrec [DeleteResource]
readPrec :: ReadPrec DeleteResource
$creadPrec :: ReadPrec DeleteResource
readList :: ReadS [DeleteResource]
$creadList :: ReadS [DeleteResource]
readsPrec :: Int -> ReadS DeleteResource
$creadsPrec :: Int -> ReadS DeleteResource
Prelude.Read, Int -> DeleteResource -> ShowS
[DeleteResource] -> ShowS
DeleteResource -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteResource] -> ShowS
$cshowList :: [DeleteResource] -> ShowS
show :: DeleteResource -> String
$cshow :: DeleteResource -> String
showsPrec :: Int -> DeleteResource -> ShowS
$cshowsPrec :: Int -> DeleteResource -> ShowS
Prelude.Show, forall x. Rep DeleteResource x -> DeleteResource
forall x. DeleteResource -> Rep DeleteResource x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteResource x -> DeleteResource
$cfrom :: forall x. DeleteResource -> Rep DeleteResource x
Prelude.Generic)

-- |
-- Create a value of 'DeleteResource' 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:
--
-- 'clientToken', 'deleteResource_clientToken' - A unique identifier to ensure the idempotency of the resource request.
-- As a best practice, specify this token to ensure idempotency, so that
-- Amazon Web Services Cloud Control API can accurately distinguish between
-- request retries and new resource requests. You might retry a resource
-- request to ensure that it was successfully received.
--
-- A client token is valid for 36 hours once used. After that, a resource
-- request with the same client token is treated as a new request.
--
-- If you do not specify a client token, one is generated for inclusion in
-- the request.
--
-- For more information, see
-- <https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-operations.html#resource-operations-idempotency Ensuring resource operation requests are unique>
-- in the /Amazon Web Services Cloud Control API User Guide/.
--
-- 'roleArn', 'deleteResource_roleArn' - The Amazon Resource Name (ARN) of the Identity and Access Management
-- (IAM) role for Cloud Control API to use when performing this resource
-- operation. The role specified must have the permissions required for
-- this operation. The necessary permissions for each event handler are
-- defined in the
-- @ @<https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-schema.html#schema-properties-handlers handlers>@ @
-- section of the
-- <https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-schema.html resource type definition schema>.
--
-- If you do not specify a role, Cloud Control API uses a temporary session
-- created using your Amazon Web Services user credentials.
--
-- For more information, see
-- <https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-operations.html#resource-operations-permissions Specifying credentials>
-- in the /Amazon Web Services Cloud Control API User Guide/.
--
-- 'typeVersionId', 'deleteResource_typeVersionId' - For private resource types, the type version to use in this resource
-- operation. If you do not specify a resource version, CloudFormation uses
-- the default version.
--
-- 'typeName', 'deleteResource_typeName' - The name of the resource type.
--
-- 'identifier', 'deleteResource_identifier' - The identifier for the resource.
--
-- You can specify the primary identifier, or any secondary identifier
-- defined for the resource type in its resource schema. You can only
-- specify one identifier. Primary identifiers can be specified as a string
-- or JSON; secondary identifiers must be specified as JSON.
--
-- For compound primary identifiers (that is, one that consists of multiple
-- resource properties strung together), to specify the primary identifier
-- as a string, list the property values /in the order they are specified/
-- in the primary identifier definition, separated by @|@.
--
-- For more information, see
-- <https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-identifier.html Identifying resources>
-- in the /Amazon Web Services Cloud Control API User Guide/.
newDeleteResource ::
  -- | 'typeName'
  Prelude.Text ->
  -- | 'identifier'
  Prelude.Text ->
  DeleteResource
newDeleteResource :: Text -> Text -> DeleteResource
newDeleteResource Text
pTypeName_ Text
pIdentifier_ =
  DeleteResource'
    { $sel:clientToken:DeleteResource' :: Maybe Text
clientToken = forall a. Maybe a
Prelude.Nothing,
      $sel:roleArn:DeleteResource' :: Maybe Text
roleArn = forall a. Maybe a
Prelude.Nothing,
      $sel:typeVersionId:DeleteResource' :: Maybe Text
typeVersionId = forall a. Maybe a
Prelude.Nothing,
      $sel:typeName:DeleteResource' :: Text
typeName = Text
pTypeName_,
      $sel:identifier:DeleteResource' :: Text
identifier = Text
pIdentifier_
    }

-- | A unique identifier to ensure the idempotency of the resource request.
-- As a best practice, specify this token to ensure idempotency, so that
-- Amazon Web Services Cloud Control API can accurately distinguish between
-- request retries and new resource requests. You might retry a resource
-- request to ensure that it was successfully received.
--
-- A client token is valid for 36 hours once used. After that, a resource
-- request with the same client token is treated as a new request.
--
-- If you do not specify a client token, one is generated for inclusion in
-- the request.
--
-- For more information, see
-- <https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-operations.html#resource-operations-idempotency Ensuring resource operation requests are unique>
-- in the /Amazon Web Services Cloud Control API User Guide/.
deleteResource_clientToken :: Lens.Lens' DeleteResource (Prelude.Maybe Prelude.Text)
deleteResource_clientToken :: Lens' DeleteResource (Maybe Text)
deleteResource_clientToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteResource' {Maybe Text
clientToken :: Maybe Text
$sel:clientToken:DeleteResource' :: DeleteResource -> Maybe Text
clientToken} -> Maybe Text
clientToken) (\s :: DeleteResource
s@DeleteResource' {} Maybe Text
a -> DeleteResource
s {$sel:clientToken:DeleteResource' :: Maybe Text
clientToken = Maybe Text
a} :: DeleteResource)

-- | The Amazon Resource Name (ARN) of the Identity and Access Management
-- (IAM) role for Cloud Control API to use when performing this resource
-- operation. The role specified must have the permissions required for
-- this operation. The necessary permissions for each event handler are
-- defined in the
-- @ @<https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-schema.html#schema-properties-handlers handlers>@ @
-- section of the
-- <https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-schema.html resource type definition schema>.
--
-- If you do not specify a role, Cloud Control API uses a temporary session
-- created using your Amazon Web Services user credentials.
--
-- For more information, see
-- <https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-operations.html#resource-operations-permissions Specifying credentials>
-- in the /Amazon Web Services Cloud Control API User Guide/.
deleteResource_roleArn :: Lens.Lens' DeleteResource (Prelude.Maybe Prelude.Text)
deleteResource_roleArn :: Lens' DeleteResource (Maybe Text)
deleteResource_roleArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteResource' {Maybe Text
roleArn :: Maybe Text
$sel:roleArn:DeleteResource' :: DeleteResource -> Maybe Text
roleArn} -> Maybe Text
roleArn) (\s :: DeleteResource
s@DeleteResource' {} Maybe Text
a -> DeleteResource
s {$sel:roleArn:DeleteResource' :: Maybe Text
roleArn = Maybe Text
a} :: DeleteResource)

-- | For private resource types, the type version to use in this resource
-- operation. If you do not specify a resource version, CloudFormation uses
-- the default version.
deleteResource_typeVersionId :: Lens.Lens' DeleteResource (Prelude.Maybe Prelude.Text)
deleteResource_typeVersionId :: Lens' DeleteResource (Maybe Text)
deleteResource_typeVersionId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteResource' {Maybe Text
typeVersionId :: Maybe Text
$sel:typeVersionId:DeleteResource' :: DeleteResource -> Maybe Text
typeVersionId} -> Maybe Text
typeVersionId) (\s :: DeleteResource
s@DeleteResource' {} Maybe Text
a -> DeleteResource
s {$sel:typeVersionId:DeleteResource' :: Maybe Text
typeVersionId = Maybe Text
a} :: DeleteResource)

-- | The name of the resource type.
deleteResource_typeName :: Lens.Lens' DeleteResource Prelude.Text
deleteResource_typeName :: Lens' DeleteResource Text
deleteResource_typeName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteResource' {Text
typeName :: Text
$sel:typeName:DeleteResource' :: DeleteResource -> Text
typeName} -> Text
typeName) (\s :: DeleteResource
s@DeleteResource' {} Text
a -> DeleteResource
s {$sel:typeName:DeleteResource' :: Text
typeName = Text
a} :: DeleteResource)

-- | The identifier for the resource.
--
-- You can specify the primary identifier, or any secondary identifier
-- defined for the resource type in its resource schema. You can only
-- specify one identifier. Primary identifiers can be specified as a string
-- or JSON; secondary identifiers must be specified as JSON.
--
-- For compound primary identifiers (that is, one that consists of multiple
-- resource properties strung together), to specify the primary identifier
-- as a string, list the property values /in the order they are specified/
-- in the primary identifier definition, separated by @|@.
--
-- For more information, see
-- <https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-identifier.html Identifying resources>
-- in the /Amazon Web Services Cloud Control API User Guide/.
deleteResource_identifier :: Lens.Lens' DeleteResource Prelude.Text
deleteResource_identifier :: Lens' DeleteResource Text
deleteResource_identifier = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteResource' {Text
identifier :: Text
$sel:identifier:DeleteResource' :: DeleteResource -> Text
identifier} -> Text
identifier) (\s :: DeleteResource
s@DeleteResource' {} Text
a -> DeleteResource
s {$sel:identifier:DeleteResource' :: Text
identifier = Text
a} :: DeleteResource)

instance Core.AWSRequest DeleteResource where
  type
    AWSResponse DeleteResource =
      DeleteResourceResponse
  request :: (Service -> Service) -> DeleteResource -> Request DeleteResource
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 DeleteResource
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteResource)))
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 ProgressEvent -> Int -> DeleteResourceResponse
DeleteResourceResponse'
            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
"ProgressEvent")
            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 DeleteResource where
  hashWithSalt :: Int -> DeleteResource -> Int
hashWithSalt Int
_salt DeleteResource' {Maybe Text
Text
identifier :: Text
typeName :: Text
typeVersionId :: Maybe Text
roleArn :: Maybe Text
clientToken :: Maybe Text
$sel:identifier:DeleteResource' :: DeleteResource -> Text
$sel:typeName:DeleteResource' :: DeleteResource -> Text
$sel:typeVersionId:DeleteResource' :: DeleteResource -> Maybe Text
$sel:roleArn:DeleteResource' :: DeleteResource -> Maybe Text
$sel:clientToken:DeleteResource' :: DeleteResource -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
clientToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
roleArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
typeVersionId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
typeName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
identifier

instance Prelude.NFData DeleteResource where
  rnf :: DeleteResource -> ()
rnf DeleteResource' {Maybe Text
Text
identifier :: Text
typeName :: Text
typeVersionId :: Maybe Text
roleArn :: Maybe Text
clientToken :: Maybe Text
$sel:identifier:DeleteResource' :: DeleteResource -> Text
$sel:typeName:DeleteResource' :: DeleteResource -> Text
$sel:typeVersionId:DeleteResource' :: DeleteResource -> Maybe Text
$sel:roleArn:DeleteResource' :: DeleteResource -> Maybe Text
$sel:clientToken:DeleteResource' :: DeleteResource -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
clientToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
roleArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
typeVersionId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
typeName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
identifier

instance Data.ToHeaders DeleteResource where
  toHeaders :: DeleteResource -> 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
"CloudApiService.DeleteResource" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.0" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON DeleteResource where
  toJSON :: DeleteResource -> Value
toJSON DeleteResource' {Maybe Text
Text
identifier :: Text
typeName :: Text
typeVersionId :: Maybe Text
roleArn :: Maybe Text
clientToken :: Maybe Text
$sel:identifier:DeleteResource' :: DeleteResource -> Text
$sel:typeName:DeleteResource' :: DeleteResource -> Text
$sel:typeVersionId:DeleteResource' :: DeleteResource -> Maybe Text
$sel:roleArn:DeleteResource' :: DeleteResource -> Maybe Text
$sel:clientToken:DeleteResource' :: DeleteResource -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"ClientToken" 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
clientToken,
            (Key
"RoleArn" 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
roleArn,
            (Key
"TypeVersionId" 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
typeVersionId,
            forall a. a -> Maybe a
Prelude.Just (Key
"TypeName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
typeName),
            forall a. a -> Maybe a
Prelude.Just (Key
"Identifier" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
identifier)
          ]
      )

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

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

-- | /See:/ 'newDeleteResourceResponse' smart constructor.
data DeleteResourceResponse = DeleteResourceResponse'
  { -- | Represents the current status of the resource deletion request.
    --
    -- After you have initiated a resource deletion request, you can monitor
    -- the progress of your request by calling
    -- <https://docs.aws.amazon.com/cloudcontrolapi/latest/APIReference/API_GetResourceRequestStatus.html GetResourceRequestStatus>
    -- using the @RequestToken@ of the @ProgressEvent@ returned by
    -- @DeleteResource@.
    DeleteResourceResponse -> Maybe ProgressEvent
progressEvent :: Prelude.Maybe ProgressEvent,
    -- | The response's http status code.
    DeleteResourceResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DeleteResourceResponse -> DeleteResourceResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteResourceResponse -> DeleteResourceResponse -> Bool
$c/= :: DeleteResourceResponse -> DeleteResourceResponse -> Bool
== :: DeleteResourceResponse -> DeleteResourceResponse -> Bool
$c== :: DeleteResourceResponse -> DeleteResourceResponse -> Bool
Prelude.Eq, Int -> DeleteResourceResponse -> ShowS
[DeleteResourceResponse] -> ShowS
DeleteResourceResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteResourceResponse] -> ShowS
$cshowList :: [DeleteResourceResponse] -> ShowS
show :: DeleteResourceResponse -> String
$cshow :: DeleteResourceResponse -> String
showsPrec :: Int -> DeleteResourceResponse -> ShowS
$cshowsPrec :: Int -> DeleteResourceResponse -> ShowS
Prelude.Show, forall x. Rep DeleteResourceResponse x -> DeleteResourceResponse
forall x. DeleteResourceResponse -> Rep DeleteResourceResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteResourceResponse x -> DeleteResourceResponse
$cfrom :: forall x. DeleteResourceResponse -> Rep DeleteResourceResponse x
Prelude.Generic)

-- |
-- Create a value of 'DeleteResourceResponse' 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:
--
-- 'progressEvent', 'deleteResourceResponse_progressEvent' - Represents the current status of the resource deletion request.
--
-- After you have initiated a resource deletion request, you can monitor
-- the progress of your request by calling
-- <https://docs.aws.amazon.com/cloudcontrolapi/latest/APIReference/API_GetResourceRequestStatus.html GetResourceRequestStatus>
-- using the @RequestToken@ of the @ProgressEvent@ returned by
-- @DeleteResource@.
--
-- 'httpStatus', 'deleteResourceResponse_httpStatus' - The response's http status code.
newDeleteResourceResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DeleteResourceResponse
newDeleteResourceResponse :: Int -> DeleteResourceResponse
newDeleteResourceResponse Int
pHttpStatus_ =
  DeleteResourceResponse'
    { $sel:progressEvent:DeleteResourceResponse' :: Maybe ProgressEvent
progressEvent =
        forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DeleteResourceResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Represents the current status of the resource deletion request.
--
-- After you have initiated a resource deletion request, you can monitor
-- the progress of your request by calling
-- <https://docs.aws.amazon.com/cloudcontrolapi/latest/APIReference/API_GetResourceRequestStatus.html GetResourceRequestStatus>
-- using the @RequestToken@ of the @ProgressEvent@ returned by
-- @DeleteResource@.
deleteResourceResponse_progressEvent :: Lens.Lens' DeleteResourceResponse (Prelude.Maybe ProgressEvent)
deleteResourceResponse_progressEvent :: Lens' DeleteResourceResponse (Maybe ProgressEvent)
deleteResourceResponse_progressEvent = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteResourceResponse' {Maybe ProgressEvent
progressEvent :: Maybe ProgressEvent
$sel:progressEvent:DeleteResourceResponse' :: DeleteResourceResponse -> Maybe ProgressEvent
progressEvent} -> Maybe ProgressEvent
progressEvent) (\s :: DeleteResourceResponse
s@DeleteResourceResponse' {} Maybe ProgressEvent
a -> DeleteResourceResponse
s {$sel:progressEvent:DeleteResourceResponse' :: Maybe ProgressEvent
progressEvent = Maybe ProgressEvent
a} :: DeleteResourceResponse)

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

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