{-# 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 #-}
module Amazonka.QuickSight.RestoreAnalysis
(
RestoreAnalysis (..),
newRestoreAnalysis,
restoreAnalysis_awsAccountId,
restoreAnalysis_analysisId,
RestoreAnalysisResponse (..),
newRestoreAnalysisResponse,
restoreAnalysisResponse_requestId,
restoreAnalysisResponse_analysisId,
restoreAnalysisResponse_arn,
restoreAnalysisResponse_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
data RestoreAnalysis = RestoreAnalysis'
{
RestoreAnalysis -> Text
awsAccountId :: Prelude.Text,
RestoreAnalysis -> Text
analysisId :: Prelude.Text
}
deriving (RestoreAnalysis -> RestoreAnalysis -> Bool
(RestoreAnalysis -> RestoreAnalysis -> Bool)
-> (RestoreAnalysis -> RestoreAnalysis -> Bool)
-> Eq RestoreAnalysis
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RestoreAnalysis -> RestoreAnalysis -> Bool
$c/= :: RestoreAnalysis -> RestoreAnalysis -> Bool
== :: RestoreAnalysis -> RestoreAnalysis -> Bool
$c== :: RestoreAnalysis -> RestoreAnalysis -> Bool
Prelude.Eq, ReadPrec [RestoreAnalysis]
ReadPrec RestoreAnalysis
Int -> ReadS RestoreAnalysis
ReadS [RestoreAnalysis]
(Int -> ReadS RestoreAnalysis)
-> ReadS [RestoreAnalysis]
-> ReadPrec RestoreAnalysis
-> ReadPrec [RestoreAnalysis]
-> Read RestoreAnalysis
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RestoreAnalysis]
$creadListPrec :: ReadPrec [RestoreAnalysis]
readPrec :: ReadPrec RestoreAnalysis
$creadPrec :: ReadPrec RestoreAnalysis
readList :: ReadS [RestoreAnalysis]
$creadList :: ReadS [RestoreAnalysis]
readsPrec :: Int -> ReadS RestoreAnalysis
$creadsPrec :: Int -> ReadS RestoreAnalysis
Prelude.Read, Int -> RestoreAnalysis -> ShowS
[RestoreAnalysis] -> ShowS
RestoreAnalysis -> String
(Int -> RestoreAnalysis -> ShowS)
-> (RestoreAnalysis -> String)
-> ([RestoreAnalysis] -> ShowS)
-> Show RestoreAnalysis
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RestoreAnalysis] -> ShowS
$cshowList :: [RestoreAnalysis] -> ShowS
show :: RestoreAnalysis -> String
$cshow :: RestoreAnalysis -> String
showsPrec :: Int -> RestoreAnalysis -> ShowS
$cshowsPrec :: Int -> RestoreAnalysis -> ShowS
Prelude.Show, (forall x. RestoreAnalysis -> Rep RestoreAnalysis x)
-> (forall x. Rep RestoreAnalysis x -> RestoreAnalysis)
-> Generic RestoreAnalysis
forall x. Rep RestoreAnalysis x -> RestoreAnalysis
forall x. RestoreAnalysis -> Rep RestoreAnalysis x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RestoreAnalysis x -> RestoreAnalysis
$cfrom :: forall x. RestoreAnalysis -> Rep RestoreAnalysis x
Prelude.Generic)
newRestoreAnalysis ::
Prelude.Text ->
Prelude.Text ->
RestoreAnalysis
newRestoreAnalysis :: Text -> Text -> RestoreAnalysis
newRestoreAnalysis Text
pAwsAccountId_ Text
pAnalysisId_ =
RestoreAnalysis' :: Text -> Text -> RestoreAnalysis
RestoreAnalysis'
{ $sel:awsAccountId:RestoreAnalysis' :: Text
awsAccountId = Text
pAwsAccountId_,
$sel:analysisId:RestoreAnalysis' :: Text
analysisId = Text
pAnalysisId_
}
restoreAnalysis_awsAccountId :: Lens.Lens' RestoreAnalysis Prelude.Text
restoreAnalysis_awsAccountId :: (Text -> f Text) -> RestoreAnalysis -> f RestoreAnalysis
restoreAnalysis_awsAccountId = (RestoreAnalysis -> Text)
-> (RestoreAnalysis -> Text -> RestoreAnalysis)
-> Lens RestoreAnalysis RestoreAnalysis Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RestoreAnalysis' {Text
awsAccountId :: Text
$sel:awsAccountId:RestoreAnalysis' :: RestoreAnalysis -> Text
awsAccountId} -> Text
awsAccountId) (\s :: RestoreAnalysis
s@RestoreAnalysis' {} Text
a -> RestoreAnalysis
s {$sel:awsAccountId:RestoreAnalysis' :: Text
awsAccountId = Text
a} :: RestoreAnalysis)
restoreAnalysis_analysisId :: Lens.Lens' RestoreAnalysis Prelude.Text
restoreAnalysis_analysisId :: (Text -> f Text) -> RestoreAnalysis -> f RestoreAnalysis
restoreAnalysis_analysisId = (RestoreAnalysis -> Text)
-> (RestoreAnalysis -> Text -> RestoreAnalysis)
-> Lens RestoreAnalysis RestoreAnalysis Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RestoreAnalysis' {Text
analysisId :: Text
$sel:analysisId:RestoreAnalysis' :: RestoreAnalysis -> Text
analysisId} -> Text
analysisId) (\s :: RestoreAnalysis
s@RestoreAnalysis' {} Text
a -> RestoreAnalysis
s {$sel:analysisId:RestoreAnalysis' :: Text
analysisId = Text
a} :: RestoreAnalysis)
instance Core.AWSRequest RestoreAnalysis where
type
AWSResponse RestoreAnalysis =
RestoreAnalysisResponse
request :: RestoreAnalysis -> Request RestoreAnalysis
request = Service -> RestoreAnalysis -> Request RestoreAnalysis
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy RestoreAnalysis
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse RestoreAnalysis)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse RestoreAnalysis))
-> Logger
-> Service
-> Proxy RestoreAnalysis
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse RestoreAnalysis)))
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 -> Int -> RestoreAnalysisResponse
RestoreAnalysisResponse'
(Maybe Text
-> Maybe Text -> Maybe Text -> Int -> RestoreAnalysisResponse)
-> Either String (Maybe Text)
-> Either
String (Maybe Text -> Maybe Text -> Int -> RestoreAnalysisResponse)
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 -> Int -> RestoreAnalysisResponse)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> Int -> RestoreAnalysisResponse)
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 -> Int -> RestoreAnalysisResponse)
-> Either String (Maybe Text)
-> Either String (Int -> RestoreAnalysisResponse)
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 (Int -> RestoreAnalysisResponse)
-> Either String Int -> Either String RestoreAnalysisResponse
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 RestoreAnalysis
instance Prelude.NFData RestoreAnalysis
instance Core.ToHeaders RestoreAnalysis where
toHeaders :: RestoreAnalysis -> ResponseHeaders
toHeaders =
ResponseHeaders -> RestoreAnalysis -> 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 RestoreAnalysis where
toJSON :: RestoreAnalysis -> Value
toJSON = Value -> RestoreAnalysis -> Value
forall a b. a -> b -> a
Prelude.const (Object -> Value
Core.Object Object
forall a. Monoid a => a
Prelude.mempty)
instance Core.ToPath RestoreAnalysis where
toPath :: RestoreAnalysis -> ByteString
toPath RestoreAnalysis' {Text
analysisId :: Text
awsAccountId :: Text
$sel:analysisId:RestoreAnalysis' :: RestoreAnalysis -> Text
$sel:awsAccountId:RestoreAnalysis' :: RestoreAnalysis -> 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
"/restore/analyses/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
analysisId
]
instance Core.ToQuery RestoreAnalysis where
toQuery :: RestoreAnalysis -> QueryString
toQuery = QueryString -> RestoreAnalysis -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data RestoreAnalysisResponse = RestoreAnalysisResponse'
{
RestoreAnalysisResponse -> Maybe Text
requestId :: Prelude.Maybe Prelude.Text,
RestoreAnalysisResponse -> Maybe Text
analysisId :: Prelude.Maybe Prelude.Text,
RestoreAnalysisResponse -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
RestoreAnalysisResponse -> Int
status :: Prelude.Int
}
deriving (RestoreAnalysisResponse -> RestoreAnalysisResponse -> Bool
(RestoreAnalysisResponse -> RestoreAnalysisResponse -> Bool)
-> (RestoreAnalysisResponse -> RestoreAnalysisResponse -> Bool)
-> Eq RestoreAnalysisResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RestoreAnalysisResponse -> RestoreAnalysisResponse -> Bool
$c/= :: RestoreAnalysisResponse -> RestoreAnalysisResponse -> Bool
== :: RestoreAnalysisResponse -> RestoreAnalysisResponse -> Bool
$c== :: RestoreAnalysisResponse -> RestoreAnalysisResponse -> Bool
Prelude.Eq, ReadPrec [RestoreAnalysisResponse]
ReadPrec RestoreAnalysisResponse
Int -> ReadS RestoreAnalysisResponse
ReadS [RestoreAnalysisResponse]
(Int -> ReadS RestoreAnalysisResponse)
-> ReadS [RestoreAnalysisResponse]
-> ReadPrec RestoreAnalysisResponse
-> ReadPrec [RestoreAnalysisResponse]
-> Read RestoreAnalysisResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RestoreAnalysisResponse]
$creadListPrec :: ReadPrec [RestoreAnalysisResponse]
readPrec :: ReadPrec RestoreAnalysisResponse
$creadPrec :: ReadPrec RestoreAnalysisResponse
readList :: ReadS [RestoreAnalysisResponse]
$creadList :: ReadS [RestoreAnalysisResponse]
readsPrec :: Int -> ReadS RestoreAnalysisResponse
$creadsPrec :: Int -> ReadS RestoreAnalysisResponse
Prelude.Read, Int -> RestoreAnalysisResponse -> ShowS
[RestoreAnalysisResponse] -> ShowS
RestoreAnalysisResponse -> String
(Int -> RestoreAnalysisResponse -> ShowS)
-> (RestoreAnalysisResponse -> String)
-> ([RestoreAnalysisResponse] -> ShowS)
-> Show RestoreAnalysisResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RestoreAnalysisResponse] -> ShowS
$cshowList :: [RestoreAnalysisResponse] -> ShowS
show :: RestoreAnalysisResponse -> String
$cshow :: RestoreAnalysisResponse -> String
showsPrec :: Int -> RestoreAnalysisResponse -> ShowS
$cshowsPrec :: Int -> RestoreAnalysisResponse -> ShowS
Prelude.Show, (forall x.
RestoreAnalysisResponse -> Rep RestoreAnalysisResponse x)
-> (forall x.
Rep RestoreAnalysisResponse x -> RestoreAnalysisResponse)
-> Generic RestoreAnalysisResponse
forall x. Rep RestoreAnalysisResponse x -> RestoreAnalysisResponse
forall x. RestoreAnalysisResponse -> Rep RestoreAnalysisResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RestoreAnalysisResponse x -> RestoreAnalysisResponse
$cfrom :: forall x. RestoreAnalysisResponse -> Rep RestoreAnalysisResponse x
Prelude.Generic)
newRestoreAnalysisResponse ::
Prelude.Int ->
RestoreAnalysisResponse
newRestoreAnalysisResponse :: Int -> RestoreAnalysisResponse
newRestoreAnalysisResponse Int
pStatus_ =
RestoreAnalysisResponse' :: Maybe Text
-> Maybe Text -> Maybe Text -> Int -> RestoreAnalysisResponse
RestoreAnalysisResponse'
{ $sel:requestId:RestoreAnalysisResponse' :: Maybe Text
requestId =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:analysisId:RestoreAnalysisResponse' :: Maybe Text
analysisId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:arn:RestoreAnalysisResponse' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:status:RestoreAnalysisResponse' :: Int
status = Int
pStatus_
}
restoreAnalysisResponse_requestId :: Lens.Lens' RestoreAnalysisResponse (Prelude.Maybe Prelude.Text)
restoreAnalysisResponse_requestId :: (Maybe Text -> f (Maybe Text))
-> RestoreAnalysisResponse -> f RestoreAnalysisResponse
restoreAnalysisResponse_requestId = (RestoreAnalysisResponse -> Maybe Text)
-> (RestoreAnalysisResponse
-> Maybe Text -> RestoreAnalysisResponse)
-> Lens
RestoreAnalysisResponse
RestoreAnalysisResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RestoreAnalysisResponse' {Maybe Text
requestId :: Maybe Text
$sel:requestId:RestoreAnalysisResponse' :: RestoreAnalysisResponse -> Maybe Text
requestId} -> Maybe Text
requestId) (\s :: RestoreAnalysisResponse
s@RestoreAnalysisResponse' {} Maybe Text
a -> RestoreAnalysisResponse
s {$sel:requestId:RestoreAnalysisResponse' :: Maybe Text
requestId = Maybe Text
a} :: RestoreAnalysisResponse)
restoreAnalysisResponse_analysisId :: Lens.Lens' RestoreAnalysisResponse (Prelude.Maybe Prelude.Text)
restoreAnalysisResponse_analysisId :: (Maybe Text -> f (Maybe Text))
-> RestoreAnalysisResponse -> f RestoreAnalysisResponse
restoreAnalysisResponse_analysisId = (RestoreAnalysisResponse -> Maybe Text)
-> (RestoreAnalysisResponse
-> Maybe Text -> RestoreAnalysisResponse)
-> Lens
RestoreAnalysisResponse
RestoreAnalysisResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RestoreAnalysisResponse' {Maybe Text
analysisId :: Maybe Text
$sel:analysisId:RestoreAnalysisResponse' :: RestoreAnalysisResponse -> Maybe Text
analysisId} -> Maybe Text
analysisId) (\s :: RestoreAnalysisResponse
s@RestoreAnalysisResponse' {} Maybe Text
a -> RestoreAnalysisResponse
s {$sel:analysisId:RestoreAnalysisResponse' :: Maybe Text
analysisId = Maybe Text
a} :: RestoreAnalysisResponse)
restoreAnalysisResponse_arn :: Lens.Lens' RestoreAnalysisResponse (Prelude.Maybe Prelude.Text)
restoreAnalysisResponse_arn :: (Maybe Text -> f (Maybe Text))
-> RestoreAnalysisResponse -> f RestoreAnalysisResponse
restoreAnalysisResponse_arn = (RestoreAnalysisResponse -> Maybe Text)
-> (RestoreAnalysisResponse
-> Maybe Text -> RestoreAnalysisResponse)
-> Lens
RestoreAnalysisResponse
RestoreAnalysisResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RestoreAnalysisResponse' {Maybe Text
arn :: Maybe Text
$sel:arn:RestoreAnalysisResponse' :: RestoreAnalysisResponse -> Maybe Text
arn} -> Maybe Text
arn) (\s :: RestoreAnalysisResponse
s@RestoreAnalysisResponse' {} Maybe Text
a -> RestoreAnalysisResponse
s {$sel:arn:RestoreAnalysisResponse' :: Maybe Text
arn = Maybe Text
a} :: RestoreAnalysisResponse)
restoreAnalysisResponse_status :: Lens.Lens' RestoreAnalysisResponse Prelude.Int
restoreAnalysisResponse_status :: (Int -> f Int)
-> RestoreAnalysisResponse -> f RestoreAnalysisResponse
restoreAnalysisResponse_status = (RestoreAnalysisResponse -> Int)
-> (RestoreAnalysisResponse -> Int -> RestoreAnalysisResponse)
-> Lens RestoreAnalysisResponse RestoreAnalysisResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RestoreAnalysisResponse' {Int
status :: Int
$sel:status:RestoreAnalysisResponse' :: RestoreAnalysisResponse -> Int
status} -> Int
status) (\s :: RestoreAnalysisResponse
s@RestoreAnalysisResponse' {} Int
a -> RestoreAnalysisResponse
s {$sel:status:RestoreAnalysisResponse' :: Int
status = Int
a} :: RestoreAnalysisResponse)
instance Prelude.NFData RestoreAnalysisResponse