{-# 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.UpdateAnalysis
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Updates an analysis in Amazon QuickSight
module Amazonka.QuickSight.UpdateAnalysis
  ( -- * Creating a Request
    UpdateAnalysis (..),
    newUpdateAnalysis,

    -- * Request Lenses
    updateAnalysis_definition,
    updateAnalysis_parameters,
    updateAnalysis_sourceEntity,
    updateAnalysis_themeArn,
    updateAnalysis_awsAccountId,
    updateAnalysis_analysisId,
    updateAnalysis_name,

    -- * Destructuring the Response
    UpdateAnalysisResponse (..),
    newUpdateAnalysisResponse,

    -- * Response Lenses
    updateAnalysisResponse_analysisId,
    updateAnalysisResponse_arn,
    updateAnalysisResponse_requestId,
    updateAnalysisResponse_updateStatus,
    updateAnalysisResponse_status,
  )
where

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

-- | /See:/ 'newUpdateAnalysis' smart constructor.
data UpdateAnalysis = UpdateAnalysis'
  { -- | The definition of an analysis.
    --
    -- A definition is the data model of all features in a Dashboard, Template,
    -- or Analysis.
    UpdateAnalysis -> Maybe AnalysisDefinition
definition :: Prelude.Maybe AnalysisDefinition,
    -- | The parameter names and override values that you want to use. An
    -- analysis can have any parameter type, and some parameters might accept
    -- multiple values.
    UpdateAnalysis -> Maybe Parameters
parameters :: Prelude.Maybe Parameters,
    -- | A source entity to use for the analysis that you\'re updating. This
    -- metadata structure contains details that describe a source template and
    -- one or more datasets.
    UpdateAnalysis -> Maybe AnalysisSourceEntity
sourceEntity :: Prelude.Maybe AnalysisSourceEntity,
    -- | The Amazon Resource Name (ARN) for the theme to apply to the analysis
    -- that you\'re creating. To see the theme in the Amazon QuickSight
    -- console, make sure that you have access to it.
    UpdateAnalysis -> Maybe Text
themeArn :: Prelude.Maybe Prelude.Text,
    -- | The ID of the Amazon Web Services account that contains the analysis
    -- that you\'re updating.
    UpdateAnalysis -> Text
awsAccountId :: Prelude.Text,
    -- | The ID for the analysis that you\'re updating. This ID displays in the
    -- URL of the analysis.
    UpdateAnalysis -> Text
analysisId :: Prelude.Text,
    -- | A descriptive name for the analysis that you\'re updating. This name
    -- displays for the analysis in the Amazon QuickSight console.
    UpdateAnalysis -> Text
name :: Prelude.Text
  }
  deriving (UpdateAnalysis -> UpdateAnalysis -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateAnalysis -> UpdateAnalysis -> Bool
$c/= :: UpdateAnalysis -> UpdateAnalysis -> Bool
== :: UpdateAnalysis -> UpdateAnalysis -> Bool
$c== :: UpdateAnalysis -> UpdateAnalysis -> Bool
Prelude.Eq, Int -> UpdateAnalysis -> ShowS
[UpdateAnalysis] -> ShowS
UpdateAnalysis -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateAnalysis] -> ShowS
$cshowList :: [UpdateAnalysis] -> ShowS
show :: UpdateAnalysis -> String
$cshow :: UpdateAnalysis -> String
showsPrec :: Int -> UpdateAnalysis -> ShowS
$cshowsPrec :: Int -> UpdateAnalysis -> ShowS
Prelude.Show, forall x. Rep UpdateAnalysis x -> UpdateAnalysis
forall x. UpdateAnalysis -> Rep UpdateAnalysis x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateAnalysis x -> UpdateAnalysis
$cfrom :: forall x. UpdateAnalysis -> Rep UpdateAnalysis x
Prelude.Generic)

-- |
-- Create a value of 'UpdateAnalysis' 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:
--
-- 'definition', 'updateAnalysis_definition' - The definition of an analysis.
--
-- A definition is the data model of all features in a Dashboard, Template,
-- or Analysis.
--
-- 'parameters', 'updateAnalysis_parameters' - The parameter names and override values that you want to use. An
-- analysis can have any parameter type, and some parameters might accept
-- multiple values.
--
-- 'sourceEntity', 'updateAnalysis_sourceEntity' - A source entity to use for the analysis that you\'re updating. This
-- metadata structure contains details that describe a source template and
-- one or more datasets.
--
-- 'themeArn', 'updateAnalysis_themeArn' - The Amazon Resource Name (ARN) for the theme to apply to the analysis
-- that you\'re creating. To see the theme in the Amazon QuickSight
-- console, make sure that you have access to it.
--
-- 'awsAccountId', 'updateAnalysis_awsAccountId' - The ID of the Amazon Web Services account that contains the analysis
-- that you\'re updating.
--
-- 'analysisId', 'updateAnalysis_analysisId' - The ID for the analysis that you\'re updating. This ID displays in the
-- URL of the analysis.
--
-- 'name', 'updateAnalysis_name' - A descriptive name for the analysis that you\'re updating. This name
-- displays for the analysis in the Amazon QuickSight console.
newUpdateAnalysis ::
  -- | 'awsAccountId'
  Prelude.Text ->
  -- | 'analysisId'
  Prelude.Text ->
  -- | 'name'
  Prelude.Text ->
  UpdateAnalysis
newUpdateAnalysis :: Text -> Text -> Text -> UpdateAnalysis
newUpdateAnalysis Text
pAwsAccountId_ Text
pAnalysisId_ Text
pName_ =
  UpdateAnalysis'
    { $sel:definition:UpdateAnalysis' :: Maybe AnalysisDefinition
definition = forall a. Maybe a
Prelude.Nothing,
      $sel:parameters:UpdateAnalysis' :: Maybe Parameters
parameters = forall a. Maybe a
Prelude.Nothing,
      $sel:sourceEntity:UpdateAnalysis' :: Maybe AnalysisSourceEntity
sourceEntity = forall a. Maybe a
Prelude.Nothing,
      $sel:themeArn:UpdateAnalysis' :: Maybe Text
themeArn = forall a. Maybe a
Prelude.Nothing,
      $sel:awsAccountId:UpdateAnalysis' :: Text
awsAccountId = Text
pAwsAccountId_,
      $sel:analysisId:UpdateAnalysis' :: Text
analysisId = Text
pAnalysisId_,
      $sel:name:UpdateAnalysis' :: Text
name = Text
pName_
    }

-- | The definition of an analysis.
--
-- A definition is the data model of all features in a Dashboard, Template,
-- or Analysis.
updateAnalysis_definition :: Lens.Lens' UpdateAnalysis (Prelude.Maybe AnalysisDefinition)
updateAnalysis_definition :: Lens' UpdateAnalysis (Maybe AnalysisDefinition)
updateAnalysis_definition = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAnalysis' {Maybe AnalysisDefinition
definition :: Maybe AnalysisDefinition
$sel:definition:UpdateAnalysis' :: UpdateAnalysis -> Maybe AnalysisDefinition
definition} -> Maybe AnalysisDefinition
definition) (\s :: UpdateAnalysis
s@UpdateAnalysis' {} Maybe AnalysisDefinition
a -> UpdateAnalysis
s {$sel:definition:UpdateAnalysis' :: Maybe AnalysisDefinition
definition = Maybe AnalysisDefinition
a} :: UpdateAnalysis)

-- | The parameter names and override values that you want to use. An
-- analysis can have any parameter type, and some parameters might accept
-- multiple values.
updateAnalysis_parameters :: Lens.Lens' UpdateAnalysis (Prelude.Maybe Parameters)
updateAnalysis_parameters :: Lens' UpdateAnalysis (Maybe Parameters)
updateAnalysis_parameters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAnalysis' {Maybe Parameters
parameters :: Maybe Parameters
$sel:parameters:UpdateAnalysis' :: UpdateAnalysis -> Maybe Parameters
parameters} -> Maybe Parameters
parameters) (\s :: UpdateAnalysis
s@UpdateAnalysis' {} Maybe Parameters
a -> UpdateAnalysis
s {$sel:parameters:UpdateAnalysis' :: Maybe Parameters
parameters = Maybe Parameters
a} :: UpdateAnalysis)

-- | A source entity to use for the analysis that you\'re updating. This
-- metadata structure contains details that describe a source template and
-- one or more datasets.
updateAnalysis_sourceEntity :: Lens.Lens' UpdateAnalysis (Prelude.Maybe AnalysisSourceEntity)
updateAnalysis_sourceEntity :: Lens' UpdateAnalysis (Maybe AnalysisSourceEntity)
updateAnalysis_sourceEntity = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAnalysis' {Maybe AnalysisSourceEntity
sourceEntity :: Maybe AnalysisSourceEntity
$sel:sourceEntity:UpdateAnalysis' :: UpdateAnalysis -> Maybe AnalysisSourceEntity
sourceEntity} -> Maybe AnalysisSourceEntity
sourceEntity) (\s :: UpdateAnalysis
s@UpdateAnalysis' {} Maybe AnalysisSourceEntity
a -> UpdateAnalysis
s {$sel:sourceEntity:UpdateAnalysis' :: Maybe AnalysisSourceEntity
sourceEntity = Maybe AnalysisSourceEntity
a} :: UpdateAnalysis)

-- | The Amazon Resource Name (ARN) for the theme to apply to the analysis
-- that you\'re creating. To see the theme in the Amazon QuickSight
-- console, make sure that you have access to it.
updateAnalysis_themeArn :: Lens.Lens' UpdateAnalysis (Prelude.Maybe Prelude.Text)
updateAnalysis_themeArn :: Lens' UpdateAnalysis (Maybe Text)
updateAnalysis_themeArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAnalysis' {Maybe Text
themeArn :: Maybe Text
$sel:themeArn:UpdateAnalysis' :: UpdateAnalysis -> Maybe Text
themeArn} -> Maybe Text
themeArn) (\s :: UpdateAnalysis
s@UpdateAnalysis' {} Maybe Text
a -> UpdateAnalysis
s {$sel:themeArn:UpdateAnalysis' :: Maybe Text
themeArn = Maybe Text
a} :: UpdateAnalysis)

-- | The ID of the Amazon Web Services account that contains the analysis
-- that you\'re updating.
updateAnalysis_awsAccountId :: Lens.Lens' UpdateAnalysis Prelude.Text
updateAnalysis_awsAccountId :: Lens' UpdateAnalysis Text
updateAnalysis_awsAccountId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAnalysis' {Text
awsAccountId :: Text
$sel:awsAccountId:UpdateAnalysis' :: UpdateAnalysis -> Text
awsAccountId} -> Text
awsAccountId) (\s :: UpdateAnalysis
s@UpdateAnalysis' {} Text
a -> UpdateAnalysis
s {$sel:awsAccountId:UpdateAnalysis' :: Text
awsAccountId = Text
a} :: UpdateAnalysis)

-- | The ID for the analysis that you\'re updating. This ID displays in the
-- URL of the analysis.
updateAnalysis_analysisId :: Lens.Lens' UpdateAnalysis Prelude.Text
updateAnalysis_analysisId :: Lens' UpdateAnalysis Text
updateAnalysis_analysisId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAnalysis' {Text
analysisId :: Text
$sel:analysisId:UpdateAnalysis' :: UpdateAnalysis -> Text
analysisId} -> Text
analysisId) (\s :: UpdateAnalysis
s@UpdateAnalysis' {} Text
a -> UpdateAnalysis
s {$sel:analysisId:UpdateAnalysis' :: Text
analysisId = Text
a} :: UpdateAnalysis)

-- | A descriptive name for the analysis that you\'re updating. This name
-- displays for the analysis in the Amazon QuickSight console.
updateAnalysis_name :: Lens.Lens' UpdateAnalysis Prelude.Text
updateAnalysis_name :: Lens' UpdateAnalysis Text
updateAnalysis_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAnalysis' {Text
name :: Text
$sel:name:UpdateAnalysis' :: UpdateAnalysis -> Text
name} -> Text
name) (\s :: UpdateAnalysis
s@UpdateAnalysis' {} Text
a -> UpdateAnalysis
s {$sel:name:UpdateAnalysis' :: Text
name = Text
a} :: UpdateAnalysis)

instance Core.AWSRequest UpdateAnalysis where
  type
    AWSResponse UpdateAnalysis =
      UpdateAnalysisResponse
  request :: (Service -> Service) -> UpdateAnalysis -> Request UpdateAnalysis
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy UpdateAnalysis
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateAnalysis)))
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 Text
-> Maybe Text
-> Maybe Text
-> Maybe ResourceStatus
-> Int
-> UpdateAnalysisResponse
UpdateAnalysisResponse'
            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
"AnalysisId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"Arn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"RequestId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"UpdateStatus")
            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 UpdateAnalysis where
  hashWithSalt :: Int -> UpdateAnalysis -> Int
hashWithSalt Int
_salt UpdateAnalysis' {Maybe Text
Maybe AnalysisSourceEntity
Maybe Parameters
Maybe AnalysisDefinition
Text
name :: Text
analysisId :: Text
awsAccountId :: Text
themeArn :: Maybe Text
sourceEntity :: Maybe AnalysisSourceEntity
parameters :: Maybe Parameters
definition :: Maybe AnalysisDefinition
$sel:name:UpdateAnalysis' :: UpdateAnalysis -> Text
$sel:analysisId:UpdateAnalysis' :: UpdateAnalysis -> Text
$sel:awsAccountId:UpdateAnalysis' :: UpdateAnalysis -> Text
$sel:themeArn:UpdateAnalysis' :: UpdateAnalysis -> Maybe Text
$sel:sourceEntity:UpdateAnalysis' :: UpdateAnalysis -> Maybe AnalysisSourceEntity
$sel:parameters:UpdateAnalysis' :: UpdateAnalysis -> Maybe Parameters
$sel:definition:UpdateAnalysis' :: UpdateAnalysis -> Maybe AnalysisDefinition
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AnalysisDefinition
definition
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Parameters
parameters
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AnalysisSourceEntity
sourceEntity
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
themeArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
awsAccountId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
analysisId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name

instance Prelude.NFData UpdateAnalysis where
  rnf :: UpdateAnalysis -> ()
rnf UpdateAnalysis' {Maybe Text
Maybe AnalysisSourceEntity
Maybe Parameters
Maybe AnalysisDefinition
Text
name :: Text
analysisId :: Text
awsAccountId :: Text
themeArn :: Maybe Text
sourceEntity :: Maybe AnalysisSourceEntity
parameters :: Maybe Parameters
definition :: Maybe AnalysisDefinition
$sel:name:UpdateAnalysis' :: UpdateAnalysis -> Text
$sel:analysisId:UpdateAnalysis' :: UpdateAnalysis -> Text
$sel:awsAccountId:UpdateAnalysis' :: UpdateAnalysis -> Text
$sel:themeArn:UpdateAnalysis' :: UpdateAnalysis -> Maybe Text
$sel:sourceEntity:UpdateAnalysis' :: UpdateAnalysis -> Maybe AnalysisSourceEntity
$sel:parameters:UpdateAnalysis' :: UpdateAnalysis -> Maybe Parameters
$sel:definition:UpdateAnalysis' :: UpdateAnalysis -> Maybe AnalysisDefinition
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe AnalysisDefinition
definition
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Parameters
parameters
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe AnalysisSourceEntity
sourceEntity
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
themeArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
awsAccountId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
analysisId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
name

instance Data.ToHeaders UpdateAnalysis where
  toHeaders :: UpdateAnalysis -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.0" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON UpdateAnalysis where
  toJSON :: UpdateAnalysis -> Value
toJSON UpdateAnalysis' {Maybe Text
Maybe AnalysisSourceEntity
Maybe Parameters
Maybe AnalysisDefinition
Text
name :: Text
analysisId :: Text
awsAccountId :: Text
themeArn :: Maybe Text
sourceEntity :: Maybe AnalysisSourceEntity
parameters :: Maybe Parameters
definition :: Maybe AnalysisDefinition
$sel:name:UpdateAnalysis' :: UpdateAnalysis -> Text
$sel:analysisId:UpdateAnalysis' :: UpdateAnalysis -> Text
$sel:awsAccountId:UpdateAnalysis' :: UpdateAnalysis -> Text
$sel:themeArn:UpdateAnalysis' :: UpdateAnalysis -> Maybe Text
$sel:sourceEntity:UpdateAnalysis' :: UpdateAnalysis -> Maybe AnalysisSourceEntity
$sel:parameters:UpdateAnalysis' :: UpdateAnalysis -> Maybe Parameters
$sel:definition:UpdateAnalysis' :: UpdateAnalysis -> Maybe AnalysisDefinition
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"Definition" 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 AnalysisDefinition
definition,
            (Key
"Parameters" 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 Parameters
parameters,
            (Key
"SourceEntity" 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 AnalysisSourceEntity
sourceEntity,
            (Key
"ThemeArn" 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
themeArn,
            forall a. a -> Maybe a
Prelude.Just (Key
"Name" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
name)
          ]
      )

instance Data.ToPath UpdateAnalysis where
  toPath :: UpdateAnalysis -> ByteString
toPath UpdateAnalysis' {Maybe Text
Maybe AnalysisSourceEntity
Maybe Parameters
Maybe AnalysisDefinition
Text
name :: Text
analysisId :: Text
awsAccountId :: Text
themeArn :: Maybe Text
sourceEntity :: Maybe AnalysisSourceEntity
parameters :: Maybe Parameters
definition :: Maybe AnalysisDefinition
$sel:name:UpdateAnalysis' :: UpdateAnalysis -> Text
$sel:analysisId:UpdateAnalysis' :: UpdateAnalysis -> Text
$sel:awsAccountId:UpdateAnalysis' :: UpdateAnalysis -> Text
$sel:themeArn:UpdateAnalysis' :: UpdateAnalysis -> Maybe Text
$sel:sourceEntity:UpdateAnalysis' :: UpdateAnalysis -> Maybe AnalysisSourceEntity
$sel:parameters:UpdateAnalysis' :: UpdateAnalysis -> Maybe Parameters
$sel:definition:UpdateAnalysis' :: UpdateAnalysis -> Maybe AnalysisDefinition
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/accounts/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
awsAccountId,
        ByteString
"/analyses/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
analysisId
      ]

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

-- | /See:/ 'newUpdateAnalysisResponse' smart constructor.
data UpdateAnalysisResponse = UpdateAnalysisResponse'
  { -- | The ID of the analysis.
    UpdateAnalysisResponse -> Maybe Text
analysisId :: Prelude.Maybe Prelude.Text,
    -- | The ARN of the analysis that you\'re updating.
    UpdateAnalysisResponse -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Web Services request ID for this operation.
    UpdateAnalysisResponse -> Maybe Text
requestId :: Prelude.Maybe Prelude.Text,
    -- | The update status of the last update that was made to the analysis.
    UpdateAnalysisResponse -> Maybe ResourceStatus
updateStatus :: Prelude.Maybe ResourceStatus,
    -- | The HTTP status of the request.
    UpdateAnalysisResponse -> Int
status :: Prelude.Int
  }
  deriving (UpdateAnalysisResponse -> UpdateAnalysisResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateAnalysisResponse -> UpdateAnalysisResponse -> Bool
$c/= :: UpdateAnalysisResponse -> UpdateAnalysisResponse -> Bool
== :: UpdateAnalysisResponse -> UpdateAnalysisResponse -> Bool
$c== :: UpdateAnalysisResponse -> UpdateAnalysisResponse -> Bool
Prelude.Eq, ReadPrec [UpdateAnalysisResponse]
ReadPrec UpdateAnalysisResponse
Int -> ReadS UpdateAnalysisResponse
ReadS [UpdateAnalysisResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateAnalysisResponse]
$creadListPrec :: ReadPrec [UpdateAnalysisResponse]
readPrec :: ReadPrec UpdateAnalysisResponse
$creadPrec :: ReadPrec UpdateAnalysisResponse
readList :: ReadS [UpdateAnalysisResponse]
$creadList :: ReadS [UpdateAnalysisResponse]
readsPrec :: Int -> ReadS UpdateAnalysisResponse
$creadsPrec :: Int -> ReadS UpdateAnalysisResponse
Prelude.Read, Int -> UpdateAnalysisResponse -> ShowS
[UpdateAnalysisResponse] -> ShowS
UpdateAnalysisResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateAnalysisResponse] -> ShowS
$cshowList :: [UpdateAnalysisResponse] -> ShowS
show :: UpdateAnalysisResponse -> String
$cshow :: UpdateAnalysisResponse -> String
showsPrec :: Int -> UpdateAnalysisResponse -> ShowS
$cshowsPrec :: Int -> UpdateAnalysisResponse -> ShowS
Prelude.Show, forall x. Rep UpdateAnalysisResponse x -> UpdateAnalysisResponse
forall x. UpdateAnalysisResponse -> Rep UpdateAnalysisResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateAnalysisResponse x -> UpdateAnalysisResponse
$cfrom :: forall x. UpdateAnalysisResponse -> Rep UpdateAnalysisResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateAnalysisResponse' 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:
--
-- 'analysisId', 'updateAnalysisResponse_analysisId' - The ID of the analysis.
--
-- 'arn', 'updateAnalysisResponse_arn' - The ARN of the analysis that you\'re updating.
--
-- 'requestId', 'updateAnalysisResponse_requestId' - The Amazon Web Services request ID for this operation.
--
-- 'updateStatus', 'updateAnalysisResponse_updateStatus' - The update status of the last update that was made to the analysis.
--
-- 'status', 'updateAnalysisResponse_status' - The HTTP status of the request.
newUpdateAnalysisResponse ::
  -- | 'status'
  Prelude.Int ->
  UpdateAnalysisResponse
newUpdateAnalysisResponse :: Int -> UpdateAnalysisResponse
newUpdateAnalysisResponse Int
pStatus_ =
  UpdateAnalysisResponse'
    { $sel:analysisId:UpdateAnalysisResponse' :: Maybe Text
analysisId =
        forall a. Maybe a
Prelude.Nothing,
      $sel:arn:UpdateAnalysisResponse' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
      $sel:requestId:UpdateAnalysisResponse' :: Maybe Text
requestId = forall a. Maybe a
Prelude.Nothing,
      $sel:updateStatus:UpdateAnalysisResponse' :: Maybe ResourceStatus
updateStatus = forall a. Maybe a
Prelude.Nothing,
      $sel:status:UpdateAnalysisResponse' :: Int
status = Int
pStatus_
    }

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

-- | The ARN of the analysis that you\'re updating.
updateAnalysisResponse_arn :: Lens.Lens' UpdateAnalysisResponse (Prelude.Maybe Prelude.Text)
updateAnalysisResponse_arn :: Lens' UpdateAnalysisResponse (Maybe Text)
updateAnalysisResponse_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAnalysisResponse' {Maybe Text
arn :: Maybe Text
$sel:arn:UpdateAnalysisResponse' :: UpdateAnalysisResponse -> Maybe Text
arn} -> Maybe Text
arn) (\s :: UpdateAnalysisResponse
s@UpdateAnalysisResponse' {} Maybe Text
a -> UpdateAnalysisResponse
s {$sel:arn:UpdateAnalysisResponse' :: Maybe Text
arn = Maybe Text
a} :: UpdateAnalysisResponse)

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

-- | The update status of the last update that was made to the analysis.
updateAnalysisResponse_updateStatus :: Lens.Lens' UpdateAnalysisResponse (Prelude.Maybe ResourceStatus)
updateAnalysisResponse_updateStatus :: Lens' UpdateAnalysisResponse (Maybe ResourceStatus)
updateAnalysisResponse_updateStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAnalysisResponse' {Maybe ResourceStatus
updateStatus :: Maybe ResourceStatus
$sel:updateStatus:UpdateAnalysisResponse' :: UpdateAnalysisResponse -> Maybe ResourceStatus
updateStatus} -> Maybe ResourceStatus
updateStatus) (\s :: UpdateAnalysisResponse
s@UpdateAnalysisResponse' {} Maybe ResourceStatus
a -> UpdateAnalysisResponse
s {$sel:updateStatus:UpdateAnalysisResponse' :: Maybe ResourceStatus
updateStatus = Maybe ResourceStatus
a} :: UpdateAnalysisResponse)

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

instance Prelude.NFData UpdateAnalysisResponse where
  rnf :: UpdateAnalysisResponse -> ()
rnf UpdateAnalysisResponse' {Int
Maybe Text
Maybe ResourceStatus
status :: Int
updateStatus :: Maybe ResourceStatus
requestId :: Maybe Text
arn :: Maybe Text
analysisId :: Maybe Text
$sel:status:UpdateAnalysisResponse' :: UpdateAnalysisResponse -> Int
$sel:updateStatus:UpdateAnalysisResponse' :: UpdateAnalysisResponse -> Maybe ResourceStatus
$sel:requestId:UpdateAnalysisResponse' :: UpdateAnalysisResponse -> Maybe Text
$sel:arn:UpdateAnalysisResponse' :: UpdateAnalysisResponse -> Maybe Text
$sel:analysisId:UpdateAnalysisResponse' :: UpdateAnalysisResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
analysisId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
arn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
requestId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ResourceStatus
updateStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
status