{-# 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.QuickSight.DeleteAnalysis
-- 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 an analysis from Amazon QuickSight. You can optionally include a
-- recovery window during which you can restore the analysis. If you don\'t
-- specify a recovery window value, the operation defaults to 30 days.
-- Amazon QuickSight attaches a @DeletionTime@ stamp to the response that
-- specifies the end of the recovery window. At the end of the recovery
-- window, Amazon QuickSight deletes the analysis permanently.
--
-- At any time before recovery window ends, you can use the
-- @RestoreAnalysis@ API operation to remove the @DeletionTime@ stamp and
-- cancel the deletion of the analysis. The analysis remains visible in the
-- API until it\'s deleted, so you can describe it but you can\'t make a
-- template from it.
--
-- An analysis that\'s scheduled for deletion isn\'t accessible in the
-- Amazon QuickSight console. To access it in the console, restore it.
-- Deleting an analysis doesn\'t delete the dashboards that you publish
-- from it.
module Amazonka.QuickSight.DeleteAnalysis
  ( -- * Creating a Request
    DeleteAnalysis (..),
    newDeleteAnalysis,

    -- * Request Lenses
    deleteAnalysis_recoveryWindowInDays,
    deleteAnalysis_forceDeleteWithoutRecovery,
    deleteAnalysis_awsAccountId,
    deleteAnalysis_analysisId,

    -- * Destructuring the Response
    DeleteAnalysisResponse (..),
    newDeleteAnalysisResponse,

    -- * Response Lenses
    deleteAnalysisResponse_requestId,
    deleteAnalysisResponse_analysisId,
    deleteAnalysisResponse_arn,
    deleteAnalysisResponse_deletionTime,
    deleteAnalysisResponse_status,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.QuickSight.Types
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newDeleteAnalysis' smart constructor.
data DeleteAnalysis = DeleteAnalysis'
  { -- | A value that specifies the number of days that Amazon QuickSight waits
    -- before it deletes the analysis. You can\'t use this parameter with the
    -- @ForceDeleteWithoutRecovery@ option in the same API call. The default
    -- value is 30.
    DeleteAnalysis -> Maybe Natural
recoveryWindowInDays :: Prelude.Maybe Prelude.Natural,
    -- | This option defaults to the value @NoForceDeleteWithoutRecovery@. To
    -- immediately delete the analysis, add the @ForceDeleteWithoutRecovery@
    -- option. You can\'t restore an analysis after it\'s deleted.
    DeleteAnalysis -> Maybe Bool
forceDeleteWithoutRecovery :: Prelude.Maybe Prelude.Bool,
    -- | The ID of the Amazon Web Services account where you want to delete an
    -- analysis.
    DeleteAnalysis -> Text
awsAccountId :: Prelude.Text,
    -- | The ID of the analysis that you\'re deleting.
    DeleteAnalysis -> Text
analysisId :: Prelude.Text
  }
  deriving (DeleteAnalysis -> DeleteAnalysis -> Bool
(DeleteAnalysis -> DeleteAnalysis -> Bool)
-> (DeleteAnalysis -> DeleteAnalysis -> Bool) -> Eq DeleteAnalysis
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteAnalysis -> DeleteAnalysis -> Bool
$c/= :: DeleteAnalysis -> DeleteAnalysis -> Bool
== :: DeleteAnalysis -> DeleteAnalysis -> Bool
$c== :: DeleteAnalysis -> DeleteAnalysis -> Bool
Prelude.Eq, ReadPrec [DeleteAnalysis]
ReadPrec DeleteAnalysis
Int -> ReadS DeleteAnalysis
ReadS [DeleteAnalysis]
(Int -> ReadS DeleteAnalysis)
-> ReadS [DeleteAnalysis]
-> ReadPrec DeleteAnalysis
-> ReadPrec [DeleteAnalysis]
-> Read DeleteAnalysis
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteAnalysis]
$creadListPrec :: ReadPrec [DeleteAnalysis]
readPrec :: ReadPrec DeleteAnalysis
$creadPrec :: ReadPrec DeleteAnalysis
readList :: ReadS [DeleteAnalysis]
$creadList :: ReadS [DeleteAnalysis]
readsPrec :: Int -> ReadS DeleteAnalysis
$creadsPrec :: Int -> ReadS DeleteAnalysis
Prelude.Read, Int -> DeleteAnalysis -> ShowS
[DeleteAnalysis] -> ShowS
DeleteAnalysis -> String
(Int -> DeleteAnalysis -> ShowS)
-> (DeleteAnalysis -> String)
-> ([DeleteAnalysis] -> ShowS)
-> Show DeleteAnalysis
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteAnalysis] -> ShowS
$cshowList :: [DeleteAnalysis] -> ShowS
show :: DeleteAnalysis -> String
$cshow :: DeleteAnalysis -> String
showsPrec :: Int -> DeleteAnalysis -> ShowS
$cshowsPrec :: Int -> DeleteAnalysis -> ShowS
Prelude.Show, (forall x. DeleteAnalysis -> Rep DeleteAnalysis x)
-> (forall x. Rep DeleteAnalysis x -> DeleteAnalysis)
-> Generic DeleteAnalysis
forall x. Rep DeleteAnalysis x -> DeleteAnalysis
forall x. DeleteAnalysis -> Rep DeleteAnalysis x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteAnalysis x -> DeleteAnalysis
$cfrom :: forall x. DeleteAnalysis -> Rep DeleteAnalysis x
Prelude.Generic)

-- |
-- Create a value of 'DeleteAnalysis' 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:
--
-- 'recoveryWindowInDays', 'deleteAnalysis_recoveryWindowInDays' - A value that specifies the number of days that Amazon QuickSight waits
-- before it deletes the analysis. You can\'t use this parameter with the
-- @ForceDeleteWithoutRecovery@ option in the same API call. The default
-- value is 30.
--
-- 'forceDeleteWithoutRecovery', 'deleteAnalysis_forceDeleteWithoutRecovery' - This option defaults to the value @NoForceDeleteWithoutRecovery@. To
-- immediately delete the analysis, add the @ForceDeleteWithoutRecovery@
-- option. You can\'t restore an analysis after it\'s deleted.
--
-- 'awsAccountId', 'deleteAnalysis_awsAccountId' - The ID of the Amazon Web Services account where you want to delete an
-- analysis.
--
-- 'analysisId', 'deleteAnalysis_analysisId' - The ID of the analysis that you\'re deleting.
newDeleteAnalysis ::
  -- | 'awsAccountId'
  Prelude.Text ->
  -- | 'analysisId'
  Prelude.Text ->
  DeleteAnalysis
newDeleteAnalysis :: Text -> Text -> DeleteAnalysis
newDeleteAnalysis Text
pAwsAccountId_ Text
pAnalysisId_ =
  DeleteAnalysis' :: Maybe Natural -> Maybe Bool -> Text -> Text -> DeleteAnalysis
DeleteAnalysis'
    { $sel:recoveryWindowInDays:DeleteAnalysis' :: Maybe Natural
recoveryWindowInDays =
        Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:forceDeleteWithoutRecovery:DeleteAnalysis' :: Maybe Bool
forceDeleteWithoutRecovery = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:awsAccountId:DeleteAnalysis' :: Text
awsAccountId = Text
pAwsAccountId_,
      $sel:analysisId:DeleteAnalysis' :: Text
analysisId = Text
pAnalysisId_
    }

-- | A value that specifies the number of days that Amazon QuickSight waits
-- before it deletes the analysis. You can\'t use this parameter with the
-- @ForceDeleteWithoutRecovery@ option in the same API call. The default
-- value is 30.
deleteAnalysis_recoveryWindowInDays :: Lens.Lens' DeleteAnalysis (Prelude.Maybe Prelude.Natural)
deleteAnalysis_recoveryWindowInDays :: (Maybe Natural -> f (Maybe Natural))
-> DeleteAnalysis -> f DeleteAnalysis
deleteAnalysis_recoveryWindowInDays = (DeleteAnalysis -> Maybe Natural)
-> (DeleteAnalysis -> Maybe Natural -> DeleteAnalysis)
-> Lens
     DeleteAnalysis DeleteAnalysis (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteAnalysis' {Maybe Natural
recoveryWindowInDays :: Maybe Natural
$sel:recoveryWindowInDays:DeleteAnalysis' :: DeleteAnalysis -> Maybe Natural
recoveryWindowInDays} -> Maybe Natural
recoveryWindowInDays) (\s :: DeleteAnalysis
s@DeleteAnalysis' {} Maybe Natural
a -> DeleteAnalysis
s {$sel:recoveryWindowInDays:DeleteAnalysis' :: Maybe Natural
recoveryWindowInDays = Maybe Natural
a} :: DeleteAnalysis)

-- | This option defaults to the value @NoForceDeleteWithoutRecovery@. To
-- immediately delete the analysis, add the @ForceDeleteWithoutRecovery@
-- option. You can\'t restore an analysis after it\'s deleted.
deleteAnalysis_forceDeleteWithoutRecovery :: Lens.Lens' DeleteAnalysis (Prelude.Maybe Prelude.Bool)
deleteAnalysis_forceDeleteWithoutRecovery :: (Maybe Bool -> f (Maybe Bool))
-> DeleteAnalysis -> f DeleteAnalysis
deleteAnalysis_forceDeleteWithoutRecovery = (DeleteAnalysis -> Maybe Bool)
-> (DeleteAnalysis -> Maybe Bool -> DeleteAnalysis)
-> Lens DeleteAnalysis DeleteAnalysis (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteAnalysis' {Maybe Bool
forceDeleteWithoutRecovery :: Maybe Bool
$sel:forceDeleteWithoutRecovery:DeleteAnalysis' :: DeleteAnalysis -> Maybe Bool
forceDeleteWithoutRecovery} -> Maybe Bool
forceDeleteWithoutRecovery) (\s :: DeleteAnalysis
s@DeleteAnalysis' {} Maybe Bool
a -> DeleteAnalysis
s {$sel:forceDeleteWithoutRecovery:DeleteAnalysis' :: Maybe Bool
forceDeleteWithoutRecovery = Maybe Bool
a} :: DeleteAnalysis)

-- | The ID of the Amazon Web Services account where you want to delete an
-- analysis.
deleteAnalysis_awsAccountId :: Lens.Lens' DeleteAnalysis Prelude.Text
deleteAnalysis_awsAccountId :: (Text -> f Text) -> DeleteAnalysis -> f DeleteAnalysis
deleteAnalysis_awsAccountId = (DeleteAnalysis -> Text)
-> (DeleteAnalysis -> Text -> DeleteAnalysis)
-> Lens DeleteAnalysis DeleteAnalysis Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteAnalysis' {Text
awsAccountId :: Text
$sel:awsAccountId:DeleteAnalysis' :: DeleteAnalysis -> Text
awsAccountId} -> Text
awsAccountId) (\s :: DeleteAnalysis
s@DeleteAnalysis' {} Text
a -> DeleteAnalysis
s {$sel:awsAccountId:DeleteAnalysis' :: Text
awsAccountId = Text
a} :: DeleteAnalysis)

-- | The ID of the analysis that you\'re deleting.
deleteAnalysis_analysisId :: Lens.Lens' DeleteAnalysis Prelude.Text
deleteAnalysis_analysisId :: (Text -> f Text) -> DeleteAnalysis -> f DeleteAnalysis
deleteAnalysis_analysisId = (DeleteAnalysis -> Text)
-> (DeleteAnalysis -> Text -> DeleteAnalysis)
-> Lens DeleteAnalysis DeleteAnalysis Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteAnalysis' {Text
analysisId :: Text
$sel:analysisId:DeleteAnalysis' :: DeleteAnalysis -> Text
analysisId} -> Text
analysisId) (\s :: DeleteAnalysis
s@DeleteAnalysis' {} Text
a -> DeleteAnalysis
s {$sel:analysisId:DeleteAnalysis' :: Text
analysisId = Text
a} :: DeleteAnalysis)

instance Core.AWSRequest DeleteAnalysis where
  type
    AWSResponse DeleteAnalysis =
      DeleteAnalysisResponse
  request :: DeleteAnalysis -> Request DeleteAnalysis
request = Service -> DeleteAnalysis -> Request DeleteAnalysis
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
  response :: Logger
-> Service
-> Proxy DeleteAnalysis
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteAnalysis)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse DeleteAnalysis))
-> Logger
-> Service
-> Proxy DeleteAnalysis
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteAnalysis)))
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 Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Int
-> DeleteAnalysisResponse
DeleteAnalysisResponse'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe POSIX
 -> Int
 -> DeleteAnalysisResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text -> Maybe POSIX -> Int -> DeleteAnalysisResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"RequestId")
            Either
  String
  (Maybe Text
   -> Maybe Text -> Maybe POSIX -> Int -> DeleteAnalysisResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe Text -> Maybe POSIX -> Int -> DeleteAnalysisResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"AnalysisId")
            Either
  String (Maybe Text -> Maybe POSIX -> Int -> DeleteAnalysisResponse)
-> Either String (Maybe Text)
-> Either String (Maybe POSIX -> Int -> DeleteAnalysisResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Arn")
            Either String (Maybe POSIX -> Int -> DeleteAnalysisResponse)
-> Either String (Maybe POSIX)
-> Either String (Int -> DeleteAnalysisResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"DeletionTime")
            Either String (Int -> DeleteAnalysisResponse)
-> Either String Int -> Either String DeleteAnalysisResponse
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 DeleteAnalysis

instance Prelude.NFData DeleteAnalysis

instance Core.ToHeaders DeleteAnalysis where
  toHeaders :: DeleteAnalysis -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DeleteAnalysis -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ 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.ToPath DeleteAnalysis where
  toPath :: DeleteAnalysis -> ByteString
toPath DeleteAnalysis' {Maybe Bool
Maybe Natural
Text
analysisId :: Text
awsAccountId :: Text
forceDeleteWithoutRecovery :: Maybe Bool
recoveryWindowInDays :: Maybe Natural
$sel:analysisId:DeleteAnalysis' :: DeleteAnalysis -> Text
$sel:awsAccountId:DeleteAnalysis' :: DeleteAnalysis -> Text
$sel:forceDeleteWithoutRecovery:DeleteAnalysis' :: DeleteAnalysis -> Maybe Bool
$sel:recoveryWindowInDays:DeleteAnalysis' :: DeleteAnalysis -> Maybe Natural
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/accounts/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
awsAccountId,
        ByteString
"/analyses/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
analysisId
      ]

instance Core.ToQuery DeleteAnalysis where
  toQuery :: DeleteAnalysis -> QueryString
toQuery DeleteAnalysis' {Maybe Bool
Maybe Natural
Text
analysisId :: Text
awsAccountId :: Text
forceDeleteWithoutRecovery :: Maybe Bool
recoveryWindowInDays :: Maybe Natural
$sel:analysisId:DeleteAnalysis' :: DeleteAnalysis -> Text
$sel:awsAccountId:DeleteAnalysis' :: DeleteAnalysis -> Text
$sel:forceDeleteWithoutRecovery:DeleteAnalysis' :: DeleteAnalysis -> Maybe Bool
$sel:recoveryWindowInDays:DeleteAnalysis' :: DeleteAnalysis -> Maybe Natural
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"recovery-window-in-days"
          ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
recoveryWindowInDays,
        ByteString
"force-delete-without-recovery"
          ByteString -> Maybe Bool -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Bool
forceDeleteWithoutRecovery
      ]

-- | /See:/ 'newDeleteAnalysisResponse' smart constructor.
data DeleteAnalysisResponse = DeleteAnalysisResponse'
  { -- | The Amazon Web Services request ID for this operation.
    DeleteAnalysisResponse -> Maybe Text
requestId :: Prelude.Maybe Prelude.Text,
    -- | The ID of the deleted analysis.
    DeleteAnalysisResponse -> Maybe Text
analysisId :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the deleted analysis.
    DeleteAnalysisResponse -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The date and time that the analysis is scheduled to be deleted.
    DeleteAnalysisResponse -> Maybe POSIX
deletionTime :: Prelude.Maybe Core.POSIX,
    -- | The HTTP status of the request.
    DeleteAnalysisResponse -> Int
status :: Prelude.Int
  }
  deriving (DeleteAnalysisResponse -> DeleteAnalysisResponse -> Bool
(DeleteAnalysisResponse -> DeleteAnalysisResponse -> Bool)
-> (DeleteAnalysisResponse -> DeleteAnalysisResponse -> Bool)
-> Eq DeleteAnalysisResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteAnalysisResponse -> DeleteAnalysisResponse -> Bool
$c/= :: DeleteAnalysisResponse -> DeleteAnalysisResponse -> Bool
== :: DeleteAnalysisResponse -> DeleteAnalysisResponse -> Bool
$c== :: DeleteAnalysisResponse -> DeleteAnalysisResponse -> Bool
Prelude.Eq, ReadPrec [DeleteAnalysisResponse]
ReadPrec DeleteAnalysisResponse
Int -> ReadS DeleteAnalysisResponse
ReadS [DeleteAnalysisResponse]
(Int -> ReadS DeleteAnalysisResponse)
-> ReadS [DeleteAnalysisResponse]
-> ReadPrec DeleteAnalysisResponse
-> ReadPrec [DeleteAnalysisResponse]
-> Read DeleteAnalysisResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteAnalysisResponse]
$creadListPrec :: ReadPrec [DeleteAnalysisResponse]
readPrec :: ReadPrec DeleteAnalysisResponse
$creadPrec :: ReadPrec DeleteAnalysisResponse
readList :: ReadS [DeleteAnalysisResponse]
$creadList :: ReadS [DeleteAnalysisResponse]
readsPrec :: Int -> ReadS DeleteAnalysisResponse
$creadsPrec :: Int -> ReadS DeleteAnalysisResponse
Prelude.Read, Int -> DeleteAnalysisResponse -> ShowS
[DeleteAnalysisResponse] -> ShowS
DeleteAnalysisResponse -> String
(Int -> DeleteAnalysisResponse -> ShowS)
-> (DeleteAnalysisResponse -> String)
-> ([DeleteAnalysisResponse] -> ShowS)
-> Show DeleteAnalysisResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteAnalysisResponse] -> ShowS
$cshowList :: [DeleteAnalysisResponse] -> ShowS
show :: DeleteAnalysisResponse -> String
$cshow :: DeleteAnalysisResponse -> String
showsPrec :: Int -> DeleteAnalysisResponse -> ShowS
$cshowsPrec :: Int -> DeleteAnalysisResponse -> ShowS
Prelude.Show, (forall x. DeleteAnalysisResponse -> Rep DeleteAnalysisResponse x)
-> (forall x.
    Rep DeleteAnalysisResponse x -> DeleteAnalysisResponse)
-> Generic DeleteAnalysisResponse
forall x. Rep DeleteAnalysisResponse x -> DeleteAnalysisResponse
forall x. DeleteAnalysisResponse -> Rep DeleteAnalysisResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteAnalysisResponse x -> DeleteAnalysisResponse
$cfrom :: forall x. DeleteAnalysisResponse -> Rep DeleteAnalysisResponse x
Prelude.Generic)

-- |
-- Create a value of 'DeleteAnalysisResponse' 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:
--
-- 'requestId', 'deleteAnalysisResponse_requestId' - The Amazon Web Services request ID for this operation.
--
-- 'analysisId', 'deleteAnalysisResponse_analysisId' - The ID of the deleted analysis.
--
-- 'arn', 'deleteAnalysisResponse_arn' - The Amazon Resource Name (ARN) of the deleted analysis.
--
-- 'deletionTime', 'deleteAnalysisResponse_deletionTime' - The date and time that the analysis is scheduled to be deleted.
--
-- 'status', 'deleteAnalysisResponse_status' - The HTTP status of the request.
newDeleteAnalysisResponse ::
  -- | 'status'
  Prelude.Int ->
  DeleteAnalysisResponse
newDeleteAnalysisResponse :: Int -> DeleteAnalysisResponse
newDeleteAnalysisResponse Int
pStatus_ =
  DeleteAnalysisResponse' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Int
-> DeleteAnalysisResponse
DeleteAnalysisResponse'
    { $sel:requestId:DeleteAnalysisResponse' :: Maybe Text
requestId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:analysisId:DeleteAnalysisResponse' :: Maybe Text
analysisId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:arn:DeleteAnalysisResponse' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:deletionTime:DeleteAnalysisResponse' :: Maybe POSIX
deletionTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:status:DeleteAnalysisResponse' :: Int
status = Int
pStatus_
    }

-- | The Amazon Web Services request ID for this operation.
deleteAnalysisResponse_requestId :: Lens.Lens' DeleteAnalysisResponse (Prelude.Maybe Prelude.Text)
deleteAnalysisResponse_requestId :: (Maybe Text -> f (Maybe Text))
-> DeleteAnalysisResponse -> f DeleteAnalysisResponse
deleteAnalysisResponse_requestId = (DeleteAnalysisResponse -> Maybe Text)
-> (DeleteAnalysisResponse -> Maybe Text -> DeleteAnalysisResponse)
-> Lens
     DeleteAnalysisResponse
     DeleteAnalysisResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteAnalysisResponse' {Maybe Text
requestId :: Maybe Text
$sel:requestId:DeleteAnalysisResponse' :: DeleteAnalysisResponse -> Maybe Text
requestId} -> Maybe Text
requestId) (\s :: DeleteAnalysisResponse
s@DeleteAnalysisResponse' {} Maybe Text
a -> DeleteAnalysisResponse
s {$sel:requestId:DeleteAnalysisResponse' :: Maybe Text
requestId = Maybe Text
a} :: DeleteAnalysisResponse)

-- | The ID of the deleted analysis.
deleteAnalysisResponse_analysisId :: Lens.Lens' DeleteAnalysisResponse (Prelude.Maybe Prelude.Text)
deleteAnalysisResponse_analysisId :: (Maybe Text -> f (Maybe Text))
-> DeleteAnalysisResponse -> f DeleteAnalysisResponse
deleteAnalysisResponse_analysisId = (DeleteAnalysisResponse -> Maybe Text)
-> (DeleteAnalysisResponse -> Maybe Text -> DeleteAnalysisResponse)
-> Lens
     DeleteAnalysisResponse
     DeleteAnalysisResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteAnalysisResponse' {Maybe Text
analysisId :: Maybe Text
$sel:analysisId:DeleteAnalysisResponse' :: DeleteAnalysisResponse -> Maybe Text
analysisId} -> Maybe Text
analysisId) (\s :: DeleteAnalysisResponse
s@DeleteAnalysisResponse' {} Maybe Text
a -> DeleteAnalysisResponse
s {$sel:analysisId:DeleteAnalysisResponse' :: Maybe Text
analysisId = Maybe Text
a} :: DeleteAnalysisResponse)

-- | The Amazon Resource Name (ARN) of the deleted analysis.
deleteAnalysisResponse_arn :: Lens.Lens' DeleteAnalysisResponse (Prelude.Maybe Prelude.Text)
deleteAnalysisResponse_arn :: (Maybe Text -> f (Maybe Text))
-> DeleteAnalysisResponse -> f DeleteAnalysisResponse
deleteAnalysisResponse_arn = (DeleteAnalysisResponse -> Maybe Text)
-> (DeleteAnalysisResponse -> Maybe Text -> DeleteAnalysisResponse)
-> Lens
     DeleteAnalysisResponse
     DeleteAnalysisResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteAnalysisResponse' {Maybe Text
arn :: Maybe Text
$sel:arn:DeleteAnalysisResponse' :: DeleteAnalysisResponse -> Maybe Text
arn} -> Maybe Text
arn) (\s :: DeleteAnalysisResponse
s@DeleteAnalysisResponse' {} Maybe Text
a -> DeleteAnalysisResponse
s {$sel:arn:DeleteAnalysisResponse' :: Maybe Text
arn = Maybe Text
a} :: DeleteAnalysisResponse)

-- | The date and time that the analysis is scheduled to be deleted.
deleteAnalysisResponse_deletionTime :: Lens.Lens' DeleteAnalysisResponse (Prelude.Maybe Prelude.UTCTime)
deleteAnalysisResponse_deletionTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> DeleteAnalysisResponse -> f DeleteAnalysisResponse
deleteAnalysisResponse_deletionTime = (DeleteAnalysisResponse -> Maybe POSIX)
-> (DeleteAnalysisResponse
    -> Maybe POSIX -> DeleteAnalysisResponse)
-> Lens
     DeleteAnalysisResponse
     DeleteAnalysisResponse
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteAnalysisResponse' {Maybe POSIX
deletionTime :: Maybe POSIX
$sel:deletionTime:DeleteAnalysisResponse' :: DeleteAnalysisResponse -> Maybe POSIX
deletionTime} -> Maybe POSIX
deletionTime) (\s :: DeleteAnalysisResponse
s@DeleteAnalysisResponse' {} Maybe POSIX
a -> DeleteAnalysisResponse
s {$sel:deletionTime:DeleteAnalysisResponse' :: Maybe POSIX
deletionTime = Maybe POSIX
a} :: DeleteAnalysisResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> DeleteAnalysisResponse -> f DeleteAnalysisResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> DeleteAnalysisResponse
-> f DeleteAnalysisResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The HTTP status of the request.
deleteAnalysisResponse_status :: Lens.Lens' DeleteAnalysisResponse Prelude.Int
deleteAnalysisResponse_status :: (Int -> f Int)
-> DeleteAnalysisResponse -> f DeleteAnalysisResponse
deleteAnalysisResponse_status = (DeleteAnalysisResponse -> Int)
-> (DeleteAnalysisResponse -> Int -> DeleteAnalysisResponse)
-> Lens DeleteAnalysisResponse DeleteAnalysisResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteAnalysisResponse' {Int
status :: Int
$sel:status:DeleteAnalysisResponse' :: DeleteAnalysisResponse -> Int
status} -> Int
status) (\s :: DeleteAnalysisResponse
s@DeleteAnalysisResponse' {} Int
a -> DeleteAnalysisResponse
s {$sel:status:DeleteAnalysisResponse' :: Int
status = Int
a} :: DeleteAnalysisResponse)

instance Prelude.NFData DeleteAnalysisResponse