{-# 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-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)
--
-- 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_typeVersionId,
    deleteResource_roleArn,
    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.Lens as Lens
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,
    -- | 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 Amazon Resource Name (ARN) of the Identity and Access Management
    -- (IAM) 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 @ 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,
    -- | 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
(DeleteResource -> DeleteResource -> Bool)
-> (DeleteResource -> DeleteResource -> Bool) -> Eq DeleteResource
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]
(Int -> ReadS DeleteResource)
-> ReadS [DeleteResource]
-> ReadPrec DeleteResource
-> ReadPrec [DeleteResource]
-> Read 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
(Int -> DeleteResource -> ShowS)
-> (DeleteResource -> String)
-> ([DeleteResource] -> ShowS)
-> Show DeleteResource
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. DeleteResource -> Rep DeleteResource x)
-> (forall x. Rep DeleteResource x -> DeleteResource)
-> Generic DeleteResource
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/.
--
-- '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.
--
-- 'roleArn', 'deleteResource_roleArn' - The Amazon Resource Name (ARN) of the Identity and Access Management
-- (IAM) 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 @ 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/.
--
-- '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' :: Maybe Text
-> Maybe Text -> Maybe Text -> Text -> Text -> DeleteResource
DeleteResource'
    { $sel:clientToken:DeleteResource' :: Maybe Text
clientToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:typeVersionId:DeleteResource' :: Maybe Text
typeVersionId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:roleArn:DeleteResource' :: Maybe Text
roleArn = Maybe Text
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 :: (Maybe Text -> f (Maybe Text))
-> DeleteResource -> f DeleteResource
deleteResource_clientToken = (DeleteResource -> Maybe Text)
-> (DeleteResource -> Maybe Text -> DeleteResource)
-> Lens DeleteResource DeleteResource (Maybe Text) (Maybe Text)
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)

-- | 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 :: (Maybe Text -> f (Maybe Text))
-> DeleteResource -> f DeleteResource
deleteResource_typeVersionId = (DeleteResource -> Maybe Text)
-> (DeleteResource -> Maybe Text -> DeleteResource)
-> Lens DeleteResource DeleteResource (Maybe Text) (Maybe Text)
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 Amazon Resource Name (ARN) of the Identity and Access Management
-- (IAM) 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 @ 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 :: (Maybe Text -> f (Maybe Text))
-> DeleteResource -> f DeleteResource
deleteResource_roleArn = (DeleteResource -> Maybe Text)
-> (DeleteResource -> Maybe Text -> DeleteResource)
-> Lens DeleteResource DeleteResource (Maybe Text) (Maybe Text)
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)

-- | The name of the resource type.
deleteResource_typeName :: Lens.Lens' DeleteResource Prelude.Text
deleteResource_typeName :: (Text -> f Text) -> DeleteResource -> f DeleteResource
deleteResource_typeName = (DeleteResource -> Text)
-> (DeleteResource -> Text -> DeleteResource)
-> Lens DeleteResource DeleteResource Text Text
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 :: (Text -> f Text) -> DeleteResource -> f DeleteResource
deleteResource_identifier = (DeleteResource -> Text)
-> (DeleteResource -> Text -> DeleteResource)
-> Lens DeleteResource DeleteResource Text Text
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 :: DeleteResource -> Request DeleteResource
request = Service -> DeleteResource -> Request DeleteResource
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy DeleteResource
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteResource)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse DeleteResource))
-> Logger
-> Service
-> Proxy DeleteResource
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteResource)))
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 ProgressEvent -> Int -> DeleteResourceResponse
DeleteResourceResponse'
            (Maybe ProgressEvent -> Int -> DeleteResourceResponse)
-> Either String (Maybe ProgressEvent)
-> Either String (Int -> DeleteResourceResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe ProgressEvent)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ProgressEvent")
            Either String (Int -> DeleteResourceResponse)
-> Either String Int -> Either String DeleteResourceResponse
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 DeleteResource

instance Prelude.NFData DeleteResource

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

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

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

instance Core.ToQuery DeleteResource where
  toQuery :: DeleteResource -> QueryString
toQuery = QueryString -> DeleteResource -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
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
(DeleteResourceResponse -> DeleteResourceResponse -> Bool)
-> (DeleteResourceResponse -> DeleteResourceResponse -> Bool)
-> Eq DeleteResourceResponse
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
(Int -> DeleteResourceResponse -> ShowS)
-> (DeleteResourceResponse -> String)
-> ([DeleteResourceResponse] -> ShowS)
-> Show DeleteResourceResponse
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. DeleteResourceResponse -> Rep DeleteResourceResponse x)
-> (forall x.
    Rep DeleteResourceResponse x -> DeleteResourceResponse)
-> Generic DeleteResourceResponse
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' :: Maybe ProgressEvent -> Int -> DeleteResourceResponse
DeleteResourceResponse'
    { $sel:progressEvent:DeleteResourceResponse' :: Maybe ProgressEvent
progressEvent =
        Maybe 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 :: (Maybe ProgressEvent -> f (Maybe ProgressEvent))
-> DeleteResourceResponse -> f DeleteResourceResponse
deleteResourceResponse_progressEvent = (DeleteResourceResponse -> Maybe ProgressEvent)
-> (DeleteResourceResponse
    -> Maybe ProgressEvent -> DeleteResourceResponse)
-> Lens
     DeleteResourceResponse
     DeleteResourceResponse
     (Maybe ProgressEvent)
     (Maybe 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 :: (Int -> f Int)
-> DeleteResourceResponse -> f DeleteResourceResponse
deleteResourceResponse_httpStatus = (DeleteResourceResponse -> Int)
-> (DeleteResourceResponse -> Int -> DeleteResourceResponse)
-> Lens DeleteResourceResponse DeleteResourceResponse Int Int
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