{-# 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-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)
--
-- Updates an analysis in Amazon QuickSight
module Amazonka.QuickSight.UpdateAnalysis
  ( -- * Creating a Request
    UpdateAnalysis (..),
    newUpdateAnalysis,

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

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

    -- * Response Lenses
    updateAnalysisResponse_requestId,
    updateAnalysisResponse_analysisId,
    updateAnalysisResponse_arn,
    updateAnalysisResponse_updateStatus,
    updateAnalysisResponse_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:/ 'newUpdateAnalysis' smart constructor.
data UpdateAnalysis = 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 -> Maybe Text
themeArn :: Prelude.Maybe Prelude.Text,
    -- | 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,
    -- | 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,
    -- | 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 -> AnalysisSourceEntity
sourceEntity :: AnalysisSourceEntity
  }
  deriving (UpdateAnalysis -> UpdateAnalysis -> Bool
(UpdateAnalysis -> UpdateAnalysis -> Bool)
-> (UpdateAnalysis -> UpdateAnalysis -> Bool) -> Eq UpdateAnalysis
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, ReadPrec [UpdateAnalysis]
ReadPrec UpdateAnalysis
Int -> ReadS UpdateAnalysis
ReadS [UpdateAnalysis]
(Int -> ReadS UpdateAnalysis)
-> ReadS [UpdateAnalysis]
-> ReadPrec UpdateAnalysis
-> ReadPrec [UpdateAnalysis]
-> Read UpdateAnalysis
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateAnalysis]
$creadListPrec :: ReadPrec [UpdateAnalysis]
readPrec :: ReadPrec UpdateAnalysis
$creadPrec :: ReadPrec UpdateAnalysis
readList :: ReadS [UpdateAnalysis]
$creadList :: ReadS [UpdateAnalysis]
readsPrec :: Int -> ReadS UpdateAnalysis
$creadsPrec :: Int -> ReadS UpdateAnalysis
Prelude.Read, Int -> UpdateAnalysis -> ShowS
[UpdateAnalysis] -> ShowS
UpdateAnalysis -> String
(Int -> UpdateAnalysis -> ShowS)
-> (UpdateAnalysis -> String)
-> ([UpdateAnalysis] -> ShowS)
-> Show UpdateAnalysis
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. UpdateAnalysis -> Rep UpdateAnalysis x)
-> (forall x. Rep UpdateAnalysis x -> UpdateAnalysis)
-> Generic UpdateAnalysis
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:
--
-- '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.
--
-- '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.
--
-- '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.
--
-- '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.
newUpdateAnalysis ::
  -- | 'awsAccountId'
  Prelude.Text ->
  -- | 'analysisId'
  Prelude.Text ->
  -- | 'name'
  Prelude.Text ->
  -- | 'sourceEntity'
  AnalysisSourceEntity ->
  UpdateAnalysis
newUpdateAnalysis :: Text -> Text -> Text -> AnalysisSourceEntity -> UpdateAnalysis
newUpdateAnalysis
  Text
pAwsAccountId_
  Text
pAnalysisId_
  Text
pName_
  AnalysisSourceEntity
pSourceEntity_ =
    UpdateAnalysis' :: Maybe Text
-> Maybe Parameters
-> Text
-> Text
-> Text
-> AnalysisSourceEntity
-> UpdateAnalysis
UpdateAnalysis'
      { $sel:themeArn:UpdateAnalysis' :: Maybe Text
themeArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:parameters:UpdateAnalysis' :: Maybe Parameters
parameters = Maybe Parameters
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_,
        $sel:sourceEntity:UpdateAnalysis' :: AnalysisSourceEntity
sourceEntity = AnalysisSourceEntity
pSourceEntity_
      }

-- | 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 :: (Maybe Text -> f (Maybe Text))
-> UpdateAnalysis -> f UpdateAnalysis
updateAnalysis_themeArn = (UpdateAnalysis -> Maybe Text)
-> (UpdateAnalysis -> Maybe Text -> UpdateAnalysis)
-> Lens UpdateAnalysis UpdateAnalysis (Maybe Text) (Maybe Text)
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 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 :: (Maybe Parameters -> f (Maybe Parameters))
-> UpdateAnalysis -> f UpdateAnalysis
updateAnalysis_parameters = (UpdateAnalysis -> Maybe Parameters)
-> (UpdateAnalysis -> Maybe Parameters -> UpdateAnalysis)
-> Lens
     UpdateAnalysis UpdateAnalysis (Maybe Parameters) (Maybe 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)

-- | 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 :: (Text -> f Text) -> UpdateAnalysis -> f UpdateAnalysis
updateAnalysis_awsAccountId = (UpdateAnalysis -> Text)
-> (UpdateAnalysis -> Text -> UpdateAnalysis)
-> Lens UpdateAnalysis UpdateAnalysis Text Text
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 :: (Text -> f Text) -> UpdateAnalysis -> f UpdateAnalysis
updateAnalysis_analysisId = (UpdateAnalysis -> Text)
-> (UpdateAnalysis -> Text -> UpdateAnalysis)
-> Lens UpdateAnalysis UpdateAnalysis Text Text
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 :: (Text -> f Text) -> UpdateAnalysis -> f UpdateAnalysis
updateAnalysis_name = (UpdateAnalysis -> Text)
-> (UpdateAnalysis -> Text -> UpdateAnalysis)
-> Lens UpdateAnalysis UpdateAnalysis Text Text
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)

-- | 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 AnalysisSourceEntity
updateAnalysis_sourceEntity :: (AnalysisSourceEntity -> f AnalysisSourceEntity)
-> UpdateAnalysis -> f UpdateAnalysis
updateAnalysis_sourceEntity = (UpdateAnalysis -> AnalysisSourceEntity)
-> (UpdateAnalysis -> AnalysisSourceEntity -> UpdateAnalysis)
-> Lens
     UpdateAnalysis
     UpdateAnalysis
     AnalysisSourceEntity
     AnalysisSourceEntity
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAnalysis' {AnalysisSourceEntity
sourceEntity :: AnalysisSourceEntity
$sel:sourceEntity:UpdateAnalysis' :: UpdateAnalysis -> AnalysisSourceEntity
sourceEntity} -> AnalysisSourceEntity
sourceEntity) (\s :: UpdateAnalysis
s@UpdateAnalysis' {} AnalysisSourceEntity
a -> UpdateAnalysis
s {$sel:sourceEntity:UpdateAnalysis' :: AnalysisSourceEntity
sourceEntity = AnalysisSourceEntity
a} :: UpdateAnalysis)

instance Core.AWSRequest UpdateAnalysis where
  type
    AWSResponse UpdateAnalysis =
      UpdateAnalysisResponse
  request :: UpdateAnalysis -> Request UpdateAnalysis
request = Service -> UpdateAnalysis -> Request UpdateAnalysis
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdateAnalysis
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateAnalysis)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse UpdateAnalysis))
-> Logger
-> Service
-> Proxy UpdateAnalysis
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateAnalysis)))
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 ResourceStatus
-> Int
-> UpdateAnalysisResponse
UpdateAnalysisResponse'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe ResourceStatus
 -> Int
 -> UpdateAnalysisResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe ResourceStatus
      -> Int
      -> UpdateAnalysisResponse)
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 ResourceStatus
   -> Int
   -> UpdateAnalysisResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe ResourceStatus -> Int -> UpdateAnalysisResponse)
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 ResourceStatus -> Int -> UpdateAnalysisResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe ResourceStatus -> Int -> UpdateAnalysisResponse)
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 ResourceStatus -> Int -> UpdateAnalysisResponse)
-> Either String (Maybe ResourceStatus)
-> Either String (Int -> UpdateAnalysisResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe ResourceStatus)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"UpdateStatus")
            Either String (Int -> UpdateAnalysisResponse)
-> Either String Int -> Either String UpdateAnalysisResponse
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 UpdateAnalysis

instance Prelude.NFData UpdateAnalysis

instance Core.ToHeaders UpdateAnalysis where
  toHeaders :: UpdateAnalysis -> ResponseHeaders
toHeaders =
    ResponseHeaders -> UpdateAnalysis -> 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.ToJSON UpdateAnalysis where
  toJSON :: UpdateAnalysis -> Value
toJSON UpdateAnalysis' {Maybe Text
Maybe Parameters
Text
AnalysisSourceEntity
sourceEntity :: AnalysisSourceEntity
name :: Text
analysisId :: Text
awsAccountId :: Text
parameters :: Maybe Parameters
themeArn :: Maybe Text
$sel:sourceEntity:UpdateAnalysis' :: UpdateAnalysis -> AnalysisSourceEntity
$sel:name:UpdateAnalysis' :: UpdateAnalysis -> Text
$sel:analysisId:UpdateAnalysis' :: UpdateAnalysis -> Text
$sel:awsAccountId:UpdateAnalysis' :: UpdateAnalysis -> Text
$sel:parameters:UpdateAnalysis' :: UpdateAnalysis -> Maybe Parameters
$sel:themeArn:UpdateAnalysis' :: UpdateAnalysis -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"ThemeArn" 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
themeArn,
            (Text
"Parameters" Text -> Parameters -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Parameters -> Pair) -> Maybe Parameters -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Parameters
parameters,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"SourceEntity" Text -> AnalysisSourceEntity -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= AnalysisSourceEntity
sourceEntity)
          ]
      )

instance Core.ToPath UpdateAnalysis where
  toPath :: UpdateAnalysis -> ByteString
toPath UpdateAnalysis' {Maybe Text
Maybe Parameters
Text
AnalysisSourceEntity
sourceEntity :: AnalysisSourceEntity
name :: Text
analysisId :: Text
awsAccountId :: Text
parameters :: Maybe Parameters
themeArn :: Maybe Text
$sel:sourceEntity:UpdateAnalysis' :: UpdateAnalysis -> AnalysisSourceEntity
$sel:name:UpdateAnalysis' :: UpdateAnalysis -> Text
$sel:analysisId:UpdateAnalysis' :: UpdateAnalysis -> Text
$sel:awsAccountId:UpdateAnalysis' :: UpdateAnalysis -> Text
$sel:parameters:UpdateAnalysis' :: UpdateAnalysis -> Maybe Parameters
$sel:themeArn:UpdateAnalysis' :: UpdateAnalysis -> Maybe Text
..} =
    [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 UpdateAnalysis where
  toQuery :: UpdateAnalysis -> QueryString
toQuery = QueryString -> UpdateAnalysis -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newUpdateAnalysisResponse' smart constructor.
data UpdateAnalysisResponse = UpdateAnalysisResponse'
  { -- | The Amazon Web Services request ID for this operation.
    UpdateAnalysisResponse -> Maybe Text
requestId :: Prelude.Maybe Prelude.Text,
    -- | 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 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
(UpdateAnalysisResponse -> UpdateAnalysisResponse -> Bool)
-> (UpdateAnalysisResponse -> UpdateAnalysisResponse -> Bool)
-> Eq UpdateAnalysisResponse
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]
(Int -> ReadS UpdateAnalysisResponse)
-> ReadS [UpdateAnalysisResponse]
-> ReadPrec UpdateAnalysisResponse
-> ReadPrec [UpdateAnalysisResponse]
-> Read 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
(Int -> UpdateAnalysisResponse -> ShowS)
-> (UpdateAnalysisResponse -> String)
-> ([UpdateAnalysisResponse] -> ShowS)
-> Show UpdateAnalysisResponse
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. UpdateAnalysisResponse -> Rep UpdateAnalysisResponse x)
-> (forall x.
    Rep UpdateAnalysisResponse x -> UpdateAnalysisResponse)
-> Generic UpdateAnalysisResponse
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:
--
-- 'requestId', 'updateAnalysisResponse_requestId' - The Amazon Web Services request ID for this operation.
--
-- 'analysisId', 'updateAnalysisResponse_analysisId' - The ID of the analysis.
--
-- 'arn', 'updateAnalysisResponse_arn' - The ARN of the analysis that you\'re updating.
--
-- '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' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe ResourceStatus
-> Int
-> UpdateAnalysisResponse
UpdateAnalysisResponse'
    { $sel:requestId:UpdateAnalysisResponse' :: Maybe Text
requestId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:analysisId:UpdateAnalysisResponse' :: Maybe Text
analysisId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:arn:UpdateAnalysisResponse' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:updateStatus:UpdateAnalysisResponse' :: Maybe ResourceStatus
updateStatus = Maybe ResourceStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:status:UpdateAnalysisResponse' :: Int
status = Int
pStatus_
    }

-- | The Amazon Web Services request ID for this operation.
updateAnalysisResponse_requestId :: Lens.Lens' UpdateAnalysisResponse (Prelude.Maybe Prelude.Text)
updateAnalysisResponse_requestId :: (Maybe Text -> f (Maybe Text))
-> UpdateAnalysisResponse -> f UpdateAnalysisResponse
updateAnalysisResponse_requestId = (UpdateAnalysisResponse -> Maybe Text)
-> (UpdateAnalysisResponse -> Maybe Text -> UpdateAnalysisResponse)
-> Lens
     UpdateAnalysisResponse
     UpdateAnalysisResponse
     (Maybe Text)
     (Maybe Text)
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 ID of the analysis.
updateAnalysisResponse_analysisId :: Lens.Lens' UpdateAnalysisResponse (Prelude.Maybe Prelude.Text)
updateAnalysisResponse_analysisId :: (Maybe Text -> f (Maybe Text))
-> UpdateAnalysisResponse -> f UpdateAnalysisResponse
updateAnalysisResponse_analysisId = (UpdateAnalysisResponse -> Maybe Text)
-> (UpdateAnalysisResponse -> Maybe Text -> UpdateAnalysisResponse)
-> Lens
     UpdateAnalysisResponse
     UpdateAnalysisResponse
     (Maybe Text)
     (Maybe Text)
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 :: (Maybe Text -> f (Maybe Text))
-> UpdateAnalysisResponse -> f UpdateAnalysisResponse
updateAnalysisResponse_arn = (UpdateAnalysisResponse -> Maybe Text)
-> (UpdateAnalysisResponse -> Maybe Text -> UpdateAnalysisResponse)
-> Lens
     UpdateAnalysisResponse
     UpdateAnalysisResponse
     (Maybe Text)
     (Maybe Text)
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 update status of the last update that was made to the analysis.
updateAnalysisResponse_updateStatus :: Lens.Lens' UpdateAnalysisResponse (Prelude.Maybe ResourceStatus)
updateAnalysisResponse_updateStatus :: (Maybe ResourceStatus -> f (Maybe ResourceStatus))
-> UpdateAnalysisResponse -> f UpdateAnalysisResponse
updateAnalysisResponse_updateStatus = (UpdateAnalysisResponse -> Maybe ResourceStatus)
-> (UpdateAnalysisResponse
    -> Maybe ResourceStatus -> UpdateAnalysisResponse)
-> Lens
     UpdateAnalysisResponse
     UpdateAnalysisResponse
     (Maybe ResourceStatus)
     (Maybe ResourceStatus)
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 :: (Int -> f Int)
-> UpdateAnalysisResponse -> f UpdateAnalysisResponse
updateAnalysisResponse_status = (UpdateAnalysisResponse -> Int)
-> (UpdateAnalysisResponse -> Int -> UpdateAnalysisResponse)
-> Lens UpdateAnalysisResponse UpdateAnalysisResponse Int Int
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