{-# 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.CreateAnalysis
(
CreateAnalysis (..),
newCreateAnalysis,
createAnalysis_themeArn,
createAnalysis_parameters,
createAnalysis_permissions,
createAnalysis_tags,
createAnalysis_awsAccountId,
createAnalysis_analysisId,
createAnalysis_name,
createAnalysis_sourceEntity,
CreateAnalysisResponse (..),
newCreateAnalysisResponse,
createAnalysisResponse_requestId,
createAnalysisResponse_analysisId,
createAnalysisResponse_arn,
createAnalysisResponse_creationStatus,
createAnalysisResponse_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 CreateAnalysis = CreateAnalysis'
{
CreateAnalysis -> Maybe Text
themeArn :: Prelude.Maybe Prelude.Text,
CreateAnalysis -> Maybe Parameters
parameters :: Prelude.Maybe Parameters,
CreateAnalysis -> Maybe (NonEmpty ResourcePermission)
permissions :: Prelude.Maybe (Prelude.NonEmpty ResourcePermission),
CreateAnalysis -> Maybe (NonEmpty Tag)
tags :: Prelude.Maybe (Prelude.NonEmpty Tag),
CreateAnalysis -> Text
awsAccountId :: Prelude.Text,
CreateAnalysis -> Text
analysisId :: Prelude.Text,
CreateAnalysis -> Text
name :: Prelude.Text,
CreateAnalysis -> AnalysisSourceEntity
sourceEntity :: AnalysisSourceEntity
}
deriving (CreateAnalysis -> CreateAnalysis -> Bool
(CreateAnalysis -> CreateAnalysis -> Bool)
-> (CreateAnalysis -> CreateAnalysis -> Bool) -> Eq CreateAnalysis
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateAnalysis -> CreateAnalysis -> Bool
$c/= :: CreateAnalysis -> CreateAnalysis -> Bool
== :: CreateAnalysis -> CreateAnalysis -> Bool
$c== :: CreateAnalysis -> CreateAnalysis -> Bool
Prelude.Eq, ReadPrec [CreateAnalysis]
ReadPrec CreateAnalysis
Int -> ReadS CreateAnalysis
ReadS [CreateAnalysis]
(Int -> ReadS CreateAnalysis)
-> ReadS [CreateAnalysis]
-> ReadPrec CreateAnalysis
-> ReadPrec [CreateAnalysis]
-> Read CreateAnalysis
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateAnalysis]
$creadListPrec :: ReadPrec [CreateAnalysis]
readPrec :: ReadPrec CreateAnalysis
$creadPrec :: ReadPrec CreateAnalysis
readList :: ReadS [CreateAnalysis]
$creadList :: ReadS [CreateAnalysis]
readsPrec :: Int -> ReadS CreateAnalysis
$creadsPrec :: Int -> ReadS CreateAnalysis
Prelude.Read, Int -> CreateAnalysis -> ShowS
[CreateAnalysis] -> ShowS
CreateAnalysis -> String
(Int -> CreateAnalysis -> ShowS)
-> (CreateAnalysis -> String)
-> ([CreateAnalysis] -> ShowS)
-> Show CreateAnalysis
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateAnalysis] -> ShowS
$cshowList :: [CreateAnalysis] -> ShowS
show :: CreateAnalysis -> String
$cshow :: CreateAnalysis -> String
showsPrec :: Int -> CreateAnalysis -> ShowS
$cshowsPrec :: Int -> CreateAnalysis -> ShowS
Prelude.Show, (forall x. CreateAnalysis -> Rep CreateAnalysis x)
-> (forall x. Rep CreateAnalysis x -> CreateAnalysis)
-> Generic CreateAnalysis
forall x. Rep CreateAnalysis x -> CreateAnalysis
forall x. CreateAnalysis -> Rep CreateAnalysis x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateAnalysis x -> CreateAnalysis
$cfrom :: forall x. CreateAnalysis -> Rep CreateAnalysis x
Prelude.Generic)
newCreateAnalysis ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
AnalysisSourceEntity ->
CreateAnalysis
newCreateAnalysis :: Text -> Text -> Text -> AnalysisSourceEntity -> CreateAnalysis
newCreateAnalysis
Text
pAwsAccountId_
Text
pAnalysisId_
Text
pName_
AnalysisSourceEntity
pSourceEntity_ =
CreateAnalysis' :: Maybe Text
-> Maybe Parameters
-> Maybe (NonEmpty ResourcePermission)
-> Maybe (NonEmpty Tag)
-> Text
-> Text
-> Text
-> AnalysisSourceEntity
-> CreateAnalysis
CreateAnalysis'
{ $sel:themeArn:CreateAnalysis' :: Maybe Text
themeArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:parameters:CreateAnalysis' :: Maybe Parameters
parameters = Maybe Parameters
forall a. Maybe a
Prelude.Nothing,
$sel:permissions:CreateAnalysis' :: Maybe (NonEmpty ResourcePermission)
permissions = Maybe (NonEmpty ResourcePermission)
forall a. Maybe a
Prelude.Nothing,
$sel:tags:CreateAnalysis' :: Maybe (NonEmpty Tag)
tags = Maybe (NonEmpty Tag)
forall a. Maybe a
Prelude.Nothing,
$sel:awsAccountId:CreateAnalysis' :: Text
awsAccountId = Text
pAwsAccountId_,
$sel:analysisId:CreateAnalysis' :: Text
analysisId = Text
pAnalysisId_,
$sel:name:CreateAnalysis' :: Text
name = Text
pName_,
$sel:sourceEntity:CreateAnalysis' :: AnalysisSourceEntity
sourceEntity = AnalysisSourceEntity
pSourceEntity_
}
createAnalysis_themeArn :: Lens.Lens' CreateAnalysis (Prelude.Maybe Prelude.Text)
createAnalysis_themeArn :: (Maybe Text -> f (Maybe Text))
-> CreateAnalysis -> f CreateAnalysis
createAnalysis_themeArn = (CreateAnalysis -> Maybe Text)
-> (CreateAnalysis -> Maybe Text -> CreateAnalysis)
-> Lens CreateAnalysis CreateAnalysis (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAnalysis' {Maybe Text
themeArn :: Maybe Text
$sel:themeArn:CreateAnalysis' :: CreateAnalysis -> Maybe Text
themeArn} -> Maybe Text
themeArn) (\s :: CreateAnalysis
s@CreateAnalysis' {} Maybe Text
a -> CreateAnalysis
s {$sel:themeArn:CreateAnalysis' :: Maybe Text
themeArn = Maybe Text
a} :: CreateAnalysis)
createAnalysis_parameters :: Lens.Lens' CreateAnalysis (Prelude.Maybe Parameters)
createAnalysis_parameters :: (Maybe Parameters -> f (Maybe Parameters))
-> CreateAnalysis -> f CreateAnalysis
createAnalysis_parameters = (CreateAnalysis -> Maybe Parameters)
-> (CreateAnalysis -> Maybe Parameters -> CreateAnalysis)
-> Lens
CreateAnalysis CreateAnalysis (Maybe Parameters) (Maybe Parameters)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAnalysis' {Maybe Parameters
parameters :: Maybe Parameters
$sel:parameters:CreateAnalysis' :: CreateAnalysis -> Maybe Parameters
parameters} -> Maybe Parameters
parameters) (\s :: CreateAnalysis
s@CreateAnalysis' {} Maybe Parameters
a -> CreateAnalysis
s {$sel:parameters:CreateAnalysis' :: Maybe Parameters
parameters = Maybe Parameters
a} :: CreateAnalysis)
createAnalysis_permissions :: Lens.Lens' CreateAnalysis (Prelude.Maybe (Prelude.NonEmpty ResourcePermission))
createAnalysis_permissions :: (Maybe (NonEmpty ResourcePermission)
-> f (Maybe (NonEmpty ResourcePermission)))
-> CreateAnalysis -> f CreateAnalysis
createAnalysis_permissions = (CreateAnalysis -> Maybe (NonEmpty ResourcePermission))
-> (CreateAnalysis
-> Maybe (NonEmpty ResourcePermission) -> CreateAnalysis)
-> Lens
CreateAnalysis
CreateAnalysis
(Maybe (NonEmpty ResourcePermission))
(Maybe (NonEmpty ResourcePermission))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAnalysis' {Maybe (NonEmpty ResourcePermission)
permissions :: Maybe (NonEmpty ResourcePermission)
$sel:permissions:CreateAnalysis' :: CreateAnalysis -> Maybe (NonEmpty ResourcePermission)
permissions} -> Maybe (NonEmpty ResourcePermission)
permissions) (\s :: CreateAnalysis
s@CreateAnalysis' {} Maybe (NonEmpty ResourcePermission)
a -> CreateAnalysis
s {$sel:permissions:CreateAnalysis' :: Maybe (NonEmpty ResourcePermission)
permissions = Maybe (NonEmpty ResourcePermission)
a} :: CreateAnalysis) ((Maybe (NonEmpty ResourcePermission)
-> f (Maybe (NonEmpty ResourcePermission)))
-> CreateAnalysis -> f CreateAnalysis)
-> ((Maybe (NonEmpty ResourcePermission)
-> f (Maybe (NonEmpty ResourcePermission)))
-> Maybe (NonEmpty ResourcePermission)
-> f (Maybe (NonEmpty ResourcePermission)))
-> (Maybe (NonEmpty ResourcePermission)
-> f (Maybe (NonEmpty ResourcePermission)))
-> CreateAnalysis
-> f CreateAnalysis
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(NonEmpty ResourcePermission)
(NonEmpty ResourcePermission)
(NonEmpty ResourcePermission)
(NonEmpty ResourcePermission)
-> Iso
(Maybe (NonEmpty ResourcePermission))
(Maybe (NonEmpty ResourcePermission))
(Maybe (NonEmpty ResourcePermission))
(Maybe (NonEmpty ResourcePermission))
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
(NonEmpty ResourcePermission)
(NonEmpty ResourcePermission)
(NonEmpty ResourcePermission)
(NonEmpty ResourcePermission)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
createAnalysis_tags :: Lens.Lens' CreateAnalysis (Prelude.Maybe (Prelude.NonEmpty Tag))
createAnalysis_tags :: (Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> CreateAnalysis -> f CreateAnalysis
createAnalysis_tags = (CreateAnalysis -> Maybe (NonEmpty Tag))
-> (CreateAnalysis -> Maybe (NonEmpty Tag) -> CreateAnalysis)
-> Lens
CreateAnalysis
CreateAnalysis
(Maybe (NonEmpty Tag))
(Maybe (NonEmpty Tag))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAnalysis' {Maybe (NonEmpty Tag)
tags :: Maybe (NonEmpty Tag)
$sel:tags:CreateAnalysis' :: CreateAnalysis -> Maybe (NonEmpty Tag)
tags} -> Maybe (NonEmpty Tag)
tags) (\s :: CreateAnalysis
s@CreateAnalysis' {} Maybe (NonEmpty Tag)
a -> CreateAnalysis
s {$sel:tags:CreateAnalysis' :: Maybe (NonEmpty Tag)
tags = Maybe (NonEmpty Tag)
a} :: CreateAnalysis) ((Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> CreateAnalysis -> f CreateAnalysis)
-> ((Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> (Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> CreateAnalysis
-> f CreateAnalysis
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag)
-> Iso
(Maybe (NonEmpty Tag))
(Maybe (NonEmpty Tag))
(Maybe (NonEmpty Tag))
(Maybe (NonEmpty Tag))
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 (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
createAnalysis_awsAccountId :: Lens.Lens' CreateAnalysis Prelude.Text
createAnalysis_awsAccountId :: (Text -> f Text) -> CreateAnalysis -> f CreateAnalysis
createAnalysis_awsAccountId = (CreateAnalysis -> Text)
-> (CreateAnalysis -> Text -> CreateAnalysis)
-> Lens CreateAnalysis CreateAnalysis Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAnalysis' {Text
awsAccountId :: Text
$sel:awsAccountId:CreateAnalysis' :: CreateAnalysis -> Text
awsAccountId} -> Text
awsAccountId) (\s :: CreateAnalysis
s@CreateAnalysis' {} Text
a -> CreateAnalysis
s {$sel:awsAccountId:CreateAnalysis' :: Text
awsAccountId = Text
a} :: CreateAnalysis)
createAnalysis_analysisId :: Lens.Lens' CreateAnalysis Prelude.Text
createAnalysis_analysisId :: (Text -> f Text) -> CreateAnalysis -> f CreateAnalysis
createAnalysis_analysisId = (CreateAnalysis -> Text)
-> (CreateAnalysis -> Text -> CreateAnalysis)
-> Lens CreateAnalysis CreateAnalysis Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAnalysis' {Text
analysisId :: Text
$sel:analysisId:CreateAnalysis' :: CreateAnalysis -> Text
analysisId} -> Text
analysisId) (\s :: CreateAnalysis
s@CreateAnalysis' {} Text
a -> CreateAnalysis
s {$sel:analysisId:CreateAnalysis' :: Text
analysisId = Text
a} :: CreateAnalysis)
createAnalysis_name :: Lens.Lens' CreateAnalysis Prelude.Text
createAnalysis_name :: (Text -> f Text) -> CreateAnalysis -> f CreateAnalysis
createAnalysis_name = (CreateAnalysis -> Text)
-> (CreateAnalysis -> Text -> CreateAnalysis)
-> Lens CreateAnalysis CreateAnalysis Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAnalysis' {Text
name :: Text
$sel:name:CreateAnalysis' :: CreateAnalysis -> Text
name} -> Text
name) (\s :: CreateAnalysis
s@CreateAnalysis' {} Text
a -> CreateAnalysis
s {$sel:name:CreateAnalysis' :: Text
name = Text
a} :: CreateAnalysis)
createAnalysis_sourceEntity :: Lens.Lens' CreateAnalysis AnalysisSourceEntity
createAnalysis_sourceEntity :: (AnalysisSourceEntity -> f AnalysisSourceEntity)
-> CreateAnalysis -> f CreateAnalysis
createAnalysis_sourceEntity = (CreateAnalysis -> AnalysisSourceEntity)
-> (CreateAnalysis -> AnalysisSourceEntity -> CreateAnalysis)
-> Lens
CreateAnalysis
CreateAnalysis
AnalysisSourceEntity
AnalysisSourceEntity
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAnalysis' {AnalysisSourceEntity
sourceEntity :: AnalysisSourceEntity
$sel:sourceEntity:CreateAnalysis' :: CreateAnalysis -> AnalysisSourceEntity
sourceEntity} -> AnalysisSourceEntity
sourceEntity) (\s :: CreateAnalysis
s@CreateAnalysis' {} AnalysisSourceEntity
a -> CreateAnalysis
s {$sel:sourceEntity:CreateAnalysis' :: AnalysisSourceEntity
sourceEntity = AnalysisSourceEntity
a} :: CreateAnalysis)
instance Core.AWSRequest CreateAnalysis where
type
AWSResponse CreateAnalysis =
CreateAnalysisResponse
request :: CreateAnalysis -> Request CreateAnalysis
request = Service -> CreateAnalysis -> Request CreateAnalysis
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy CreateAnalysis
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateAnalysis)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse CreateAnalysis))
-> Logger
-> Service
-> Proxy CreateAnalysis
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateAnalysis)))
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
-> CreateAnalysisResponse
CreateAnalysisResponse'
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe ResourceStatus
-> Int
-> CreateAnalysisResponse)
-> Either String (Maybe Text)
-> Either
String
(Maybe Text
-> Maybe Text
-> Maybe ResourceStatus
-> Int
-> CreateAnalysisResponse)
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
-> CreateAnalysisResponse)
-> Either String (Maybe Text)
-> Either
String
(Maybe Text
-> Maybe ResourceStatus -> Int -> CreateAnalysisResponse)
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 -> CreateAnalysisResponse)
-> Either String (Maybe Text)
-> Either
String (Maybe ResourceStatus -> Int -> CreateAnalysisResponse)
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 -> CreateAnalysisResponse)
-> Either String (Maybe ResourceStatus)
-> Either String (Int -> CreateAnalysisResponse)
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
"CreationStatus")
Either String (Int -> CreateAnalysisResponse)
-> Either String Int -> Either String CreateAnalysisResponse
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 CreateAnalysis
instance Prelude.NFData CreateAnalysis
instance Core.ToHeaders CreateAnalysis where
toHeaders :: CreateAnalysis -> ResponseHeaders
toHeaders =
ResponseHeaders -> CreateAnalysis -> 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 CreateAnalysis where
toJSON :: CreateAnalysis -> Value
toJSON CreateAnalysis' {Maybe (NonEmpty ResourcePermission)
Maybe (NonEmpty Tag)
Maybe Text
Maybe Parameters
Text
AnalysisSourceEntity
sourceEntity :: AnalysisSourceEntity
name :: Text
analysisId :: Text
awsAccountId :: Text
tags :: Maybe (NonEmpty Tag)
permissions :: Maybe (NonEmpty ResourcePermission)
parameters :: Maybe Parameters
themeArn :: Maybe Text
$sel:sourceEntity:CreateAnalysis' :: CreateAnalysis -> AnalysisSourceEntity
$sel:name:CreateAnalysis' :: CreateAnalysis -> Text
$sel:analysisId:CreateAnalysis' :: CreateAnalysis -> Text
$sel:awsAccountId:CreateAnalysis' :: CreateAnalysis -> Text
$sel:tags:CreateAnalysis' :: CreateAnalysis -> Maybe (NonEmpty Tag)
$sel:permissions:CreateAnalysis' :: CreateAnalysis -> Maybe (NonEmpty ResourcePermission)
$sel:parameters:CreateAnalysis' :: CreateAnalysis -> Maybe Parameters
$sel:themeArn:CreateAnalysis' :: CreateAnalysis -> 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,
(Text
"Permissions" Text -> NonEmpty ResourcePermission -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (NonEmpty ResourcePermission -> Pair)
-> Maybe (NonEmpty ResourcePermission) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty ResourcePermission)
permissions,
(Text
"Tags" Text -> NonEmpty Tag -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (NonEmpty Tag -> Pair) -> Maybe (NonEmpty Tag) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty Tag)
tags,
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 CreateAnalysis where
toPath :: CreateAnalysis -> ByteString
toPath CreateAnalysis' {Maybe (NonEmpty ResourcePermission)
Maybe (NonEmpty Tag)
Maybe Text
Maybe Parameters
Text
AnalysisSourceEntity
sourceEntity :: AnalysisSourceEntity
name :: Text
analysisId :: Text
awsAccountId :: Text
tags :: Maybe (NonEmpty Tag)
permissions :: Maybe (NonEmpty ResourcePermission)
parameters :: Maybe Parameters
themeArn :: Maybe Text
$sel:sourceEntity:CreateAnalysis' :: CreateAnalysis -> AnalysisSourceEntity
$sel:name:CreateAnalysis' :: CreateAnalysis -> Text
$sel:analysisId:CreateAnalysis' :: CreateAnalysis -> Text
$sel:awsAccountId:CreateAnalysis' :: CreateAnalysis -> Text
$sel:tags:CreateAnalysis' :: CreateAnalysis -> Maybe (NonEmpty Tag)
$sel:permissions:CreateAnalysis' :: CreateAnalysis -> Maybe (NonEmpty ResourcePermission)
$sel:parameters:CreateAnalysis' :: CreateAnalysis -> Maybe Parameters
$sel:themeArn:CreateAnalysis' :: CreateAnalysis -> 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 CreateAnalysis where
toQuery :: CreateAnalysis -> QueryString
toQuery = QueryString -> CreateAnalysis -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data CreateAnalysisResponse = CreateAnalysisResponse'
{
CreateAnalysisResponse -> Maybe Text
requestId :: Prelude.Maybe Prelude.Text,
CreateAnalysisResponse -> Maybe Text
analysisId :: Prelude.Maybe Prelude.Text,
CreateAnalysisResponse -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
CreateAnalysisResponse -> Maybe ResourceStatus
creationStatus :: Prelude.Maybe ResourceStatus,
CreateAnalysisResponse -> Int
status :: Prelude.Int
}
deriving (CreateAnalysisResponse -> CreateAnalysisResponse -> Bool
(CreateAnalysisResponse -> CreateAnalysisResponse -> Bool)
-> (CreateAnalysisResponse -> CreateAnalysisResponse -> Bool)
-> Eq CreateAnalysisResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateAnalysisResponse -> CreateAnalysisResponse -> Bool
$c/= :: CreateAnalysisResponse -> CreateAnalysisResponse -> Bool
== :: CreateAnalysisResponse -> CreateAnalysisResponse -> Bool
$c== :: CreateAnalysisResponse -> CreateAnalysisResponse -> Bool
Prelude.Eq, ReadPrec [CreateAnalysisResponse]
ReadPrec CreateAnalysisResponse
Int -> ReadS CreateAnalysisResponse
ReadS [CreateAnalysisResponse]
(Int -> ReadS CreateAnalysisResponse)
-> ReadS [CreateAnalysisResponse]
-> ReadPrec CreateAnalysisResponse
-> ReadPrec [CreateAnalysisResponse]
-> Read CreateAnalysisResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateAnalysisResponse]
$creadListPrec :: ReadPrec [CreateAnalysisResponse]
readPrec :: ReadPrec CreateAnalysisResponse
$creadPrec :: ReadPrec CreateAnalysisResponse
readList :: ReadS [CreateAnalysisResponse]
$creadList :: ReadS [CreateAnalysisResponse]
readsPrec :: Int -> ReadS CreateAnalysisResponse
$creadsPrec :: Int -> ReadS CreateAnalysisResponse
Prelude.Read, Int -> CreateAnalysisResponse -> ShowS
[CreateAnalysisResponse] -> ShowS
CreateAnalysisResponse -> String
(Int -> CreateAnalysisResponse -> ShowS)
-> (CreateAnalysisResponse -> String)
-> ([CreateAnalysisResponse] -> ShowS)
-> Show CreateAnalysisResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateAnalysisResponse] -> ShowS
$cshowList :: [CreateAnalysisResponse] -> ShowS
show :: CreateAnalysisResponse -> String
$cshow :: CreateAnalysisResponse -> String
showsPrec :: Int -> CreateAnalysisResponse -> ShowS
$cshowsPrec :: Int -> CreateAnalysisResponse -> ShowS
Prelude.Show, (forall x. CreateAnalysisResponse -> Rep CreateAnalysisResponse x)
-> (forall x.
Rep CreateAnalysisResponse x -> CreateAnalysisResponse)
-> Generic CreateAnalysisResponse
forall x. Rep CreateAnalysisResponse x -> CreateAnalysisResponse
forall x. CreateAnalysisResponse -> Rep CreateAnalysisResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateAnalysisResponse x -> CreateAnalysisResponse
$cfrom :: forall x. CreateAnalysisResponse -> Rep CreateAnalysisResponse x
Prelude.Generic)
newCreateAnalysisResponse ::
Prelude.Int ->
CreateAnalysisResponse
newCreateAnalysisResponse :: Int -> CreateAnalysisResponse
newCreateAnalysisResponse Int
pStatus_ =
CreateAnalysisResponse' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe ResourceStatus
-> Int
-> CreateAnalysisResponse
CreateAnalysisResponse'
{ $sel:requestId:CreateAnalysisResponse' :: Maybe Text
requestId =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:analysisId:CreateAnalysisResponse' :: Maybe Text
analysisId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:arn:CreateAnalysisResponse' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:creationStatus:CreateAnalysisResponse' :: Maybe ResourceStatus
creationStatus = Maybe ResourceStatus
forall a. Maybe a
Prelude.Nothing,
$sel:status:CreateAnalysisResponse' :: Int
status = Int
pStatus_
}
createAnalysisResponse_requestId :: Lens.Lens' CreateAnalysisResponse (Prelude.Maybe Prelude.Text)
createAnalysisResponse_requestId :: (Maybe Text -> f (Maybe Text))
-> CreateAnalysisResponse -> f CreateAnalysisResponse
createAnalysisResponse_requestId = (CreateAnalysisResponse -> Maybe Text)
-> (CreateAnalysisResponse -> Maybe Text -> CreateAnalysisResponse)
-> Lens
CreateAnalysisResponse
CreateAnalysisResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAnalysisResponse' {Maybe Text
requestId :: Maybe Text
$sel:requestId:CreateAnalysisResponse' :: CreateAnalysisResponse -> Maybe Text
requestId} -> Maybe Text
requestId) (\s :: CreateAnalysisResponse
s@CreateAnalysisResponse' {} Maybe Text
a -> CreateAnalysisResponse
s {$sel:requestId:CreateAnalysisResponse' :: Maybe Text
requestId = Maybe Text
a} :: CreateAnalysisResponse)
createAnalysisResponse_analysisId :: Lens.Lens' CreateAnalysisResponse (Prelude.Maybe Prelude.Text)
createAnalysisResponse_analysisId :: (Maybe Text -> f (Maybe Text))
-> CreateAnalysisResponse -> f CreateAnalysisResponse
createAnalysisResponse_analysisId = (CreateAnalysisResponse -> Maybe Text)
-> (CreateAnalysisResponse -> Maybe Text -> CreateAnalysisResponse)
-> Lens
CreateAnalysisResponse
CreateAnalysisResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAnalysisResponse' {Maybe Text
analysisId :: Maybe Text
$sel:analysisId:CreateAnalysisResponse' :: CreateAnalysisResponse -> Maybe Text
analysisId} -> Maybe Text
analysisId) (\s :: CreateAnalysisResponse
s@CreateAnalysisResponse' {} Maybe Text
a -> CreateAnalysisResponse
s {$sel:analysisId:CreateAnalysisResponse' :: Maybe Text
analysisId = Maybe Text
a} :: CreateAnalysisResponse)
createAnalysisResponse_arn :: Lens.Lens' CreateAnalysisResponse (Prelude.Maybe Prelude.Text)
createAnalysisResponse_arn :: (Maybe Text -> f (Maybe Text))
-> CreateAnalysisResponse -> f CreateAnalysisResponse
createAnalysisResponse_arn = (CreateAnalysisResponse -> Maybe Text)
-> (CreateAnalysisResponse -> Maybe Text -> CreateAnalysisResponse)
-> Lens
CreateAnalysisResponse
CreateAnalysisResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAnalysisResponse' {Maybe Text
arn :: Maybe Text
$sel:arn:CreateAnalysisResponse' :: CreateAnalysisResponse -> Maybe Text
arn} -> Maybe Text
arn) (\s :: CreateAnalysisResponse
s@CreateAnalysisResponse' {} Maybe Text
a -> CreateAnalysisResponse
s {$sel:arn:CreateAnalysisResponse' :: Maybe Text
arn = Maybe Text
a} :: CreateAnalysisResponse)
createAnalysisResponse_creationStatus :: Lens.Lens' CreateAnalysisResponse (Prelude.Maybe ResourceStatus)
createAnalysisResponse_creationStatus :: (Maybe ResourceStatus -> f (Maybe ResourceStatus))
-> CreateAnalysisResponse -> f CreateAnalysisResponse
createAnalysisResponse_creationStatus = (CreateAnalysisResponse -> Maybe ResourceStatus)
-> (CreateAnalysisResponse
-> Maybe ResourceStatus -> CreateAnalysisResponse)
-> Lens
CreateAnalysisResponse
CreateAnalysisResponse
(Maybe ResourceStatus)
(Maybe ResourceStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAnalysisResponse' {Maybe ResourceStatus
creationStatus :: Maybe ResourceStatus
$sel:creationStatus:CreateAnalysisResponse' :: CreateAnalysisResponse -> Maybe ResourceStatus
creationStatus} -> Maybe ResourceStatus
creationStatus) (\s :: CreateAnalysisResponse
s@CreateAnalysisResponse' {} Maybe ResourceStatus
a -> CreateAnalysisResponse
s {$sel:creationStatus:CreateAnalysisResponse' :: Maybe ResourceStatus
creationStatus = Maybe ResourceStatus
a} :: CreateAnalysisResponse)
createAnalysisResponse_status :: Lens.Lens' CreateAnalysisResponse Prelude.Int
createAnalysisResponse_status :: (Int -> f Int)
-> CreateAnalysisResponse -> f CreateAnalysisResponse
createAnalysisResponse_status = (CreateAnalysisResponse -> Int)
-> (CreateAnalysisResponse -> Int -> CreateAnalysisResponse)
-> Lens CreateAnalysisResponse CreateAnalysisResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAnalysisResponse' {Int
status :: Int
$sel:status:CreateAnalysisResponse' :: CreateAnalysisResponse -> Int
status} -> Int
status) (\s :: CreateAnalysisResponse
s@CreateAnalysisResponse' {} Int
a -> CreateAnalysisResponse
s {$sel:status:CreateAnalysisResponse' :: Int
status = Int
a} :: CreateAnalysisResponse)
instance Prelude.NFData CreateAnalysisResponse