{-# 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.CreateDashboard
(
CreateDashboard (..),
newCreateDashboard,
createDashboard_themeArn,
createDashboard_dashboardPublishOptions,
createDashboard_versionDescription,
createDashboard_parameters,
createDashboard_permissions,
createDashboard_tags,
createDashboard_awsAccountId,
createDashboard_dashboardId,
createDashboard_name,
createDashboard_sourceEntity,
CreateDashboardResponse (..),
newCreateDashboardResponse,
createDashboardResponse_requestId,
createDashboardResponse_arn,
createDashboardResponse_creationStatus,
createDashboardResponse_dashboardId,
createDashboardResponse_versionArn,
createDashboardResponse_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 CreateDashboard = CreateDashboard'
{
CreateDashboard -> Maybe Text
themeArn :: Prelude.Maybe Prelude.Text,
CreateDashboard -> Maybe DashboardPublishOptions
dashboardPublishOptions :: Prelude.Maybe DashboardPublishOptions,
CreateDashboard -> Maybe Text
versionDescription :: Prelude.Maybe Prelude.Text,
CreateDashboard -> Maybe Parameters
parameters :: Prelude.Maybe Parameters,
CreateDashboard -> Maybe (NonEmpty ResourcePermission)
permissions :: Prelude.Maybe (Prelude.NonEmpty ResourcePermission),
CreateDashboard -> Maybe (NonEmpty Tag)
tags :: Prelude.Maybe (Prelude.NonEmpty Tag),
CreateDashboard -> Text
awsAccountId :: Prelude.Text,
CreateDashboard -> Text
dashboardId :: Prelude.Text,
CreateDashboard -> Text
name :: Prelude.Text,
CreateDashboard -> DashboardSourceEntity
sourceEntity :: DashboardSourceEntity
}
deriving (CreateDashboard -> CreateDashboard -> Bool
(CreateDashboard -> CreateDashboard -> Bool)
-> (CreateDashboard -> CreateDashboard -> Bool)
-> Eq CreateDashboard
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateDashboard -> CreateDashboard -> Bool
$c/= :: CreateDashboard -> CreateDashboard -> Bool
== :: CreateDashboard -> CreateDashboard -> Bool
$c== :: CreateDashboard -> CreateDashboard -> Bool
Prelude.Eq, ReadPrec [CreateDashboard]
ReadPrec CreateDashboard
Int -> ReadS CreateDashboard
ReadS [CreateDashboard]
(Int -> ReadS CreateDashboard)
-> ReadS [CreateDashboard]
-> ReadPrec CreateDashboard
-> ReadPrec [CreateDashboard]
-> Read CreateDashboard
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateDashboard]
$creadListPrec :: ReadPrec [CreateDashboard]
readPrec :: ReadPrec CreateDashboard
$creadPrec :: ReadPrec CreateDashboard
readList :: ReadS [CreateDashboard]
$creadList :: ReadS [CreateDashboard]
readsPrec :: Int -> ReadS CreateDashboard
$creadsPrec :: Int -> ReadS CreateDashboard
Prelude.Read, Int -> CreateDashboard -> ShowS
[CreateDashboard] -> ShowS
CreateDashboard -> String
(Int -> CreateDashboard -> ShowS)
-> (CreateDashboard -> String)
-> ([CreateDashboard] -> ShowS)
-> Show CreateDashboard
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateDashboard] -> ShowS
$cshowList :: [CreateDashboard] -> ShowS
show :: CreateDashboard -> String
$cshow :: CreateDashboard -> String
showsPrec :: Int -> CreateDashboard -> ShowS
$cshowsPrec :: Int -> CreateDashboard -> ShowS
Prelude.Show, (forall x. CreateDashboard -> Rep CreateDashboard x)
-> (forall x. Rep CreateDashboard x -> CreateDashboard)
-> Generic CreateDashboard
forall x. Rep CreateDashboard x -> CreateDashboard
forall x. CreateDashboard -> Rep CreateDashboard x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateDashboard x -> CreateDashboard
$cfrom :: forall x. CreateDashboard -> Rep CreateDashboard x
Prelude.Generic)
newCreateDashboard ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
DashboardSourceEntity ->
CreateDashboard
newCreateDashboard :: Text -> Text -> Text -> DashboardSourceEntity -> CreateDashboard
newCreateDashboard
Text
pAwsAccountId_
Text
pDashboardId_
Text
pName_
DashboardSourceEntity
pSourceEntity_ =
CreateDashboard' :: Maybe Text
-> Maybe DashboardPublishOptions
-> Maybe Text
-> Maybe Parameters
-> Maybe (NonEmpty ResourcePermission)
-> Maybe (NonEmpty Tag)
-> Text
-> Text
-> Text
-> DashboardSourceEntity
-> CreateDashboard
CreateDashboard'
{ $sel:themeArn:CreateDashboard' :: Maybe Text
themeArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:dashboardPublishOptions:CreateDashboard' :: Maybe DashboardPublishOptions
dashboardPublishOptions = Maybe DashboardPublishOptions
forall a. Maybe a
Prelude.Nothing,
$sel:versionDescription:CreateDashboard' :: Maybe Text
versionDescription = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:parameters:CreateDashboard' :: Maybe Parameters
parameters = Maybe Parameters
forall a. Maybe a
Prelude.Nothing,
$sel:permissions:CreateDashboard' :: Maybe (NonEmpty ResourcePermission)
permissions = Maybe (NonEmpty ResourcePermission)
forall a. Maybe a
Prelude.Nothing,
$sel:tags:CreateDashboard' :: Maybe (NonEmpty Tag)
tags = Maybe (NonEmpty Tag)
forall a. Maybe a
Prelude.Nothing,
$sel:awsAccountId:CreateDashboard' :: Text
awsAccountId = Text
pAwsAccountId_,
$sel:dashboardId:CreateDashboard' :: Text
dashboardId = Text
pDashboardId_,
$sel:name:CreateDashboard' :: Text
name = Text
pName_,
$sel:sourceEntity:CreateDashboard' :: DashboardSourceEntity
sourceEntity = DashboardSourceEntity
pSourceEntity_
}
createDashboard_themeArn :: Lens.Lens' CreateDashboard (Prelude.Maybe Prelude.Text)
createDashboard_themeArn :: (Maybe Text -> f (Maybe Text))
-> CreateDashboard -> f CreateDashboard
createDashboard_themeArn = (CreateDashboard -> Maybe Text)
-> (CreateDashboard -> Maybe Text -> CreateDashboard)
-> Lens CreateDashboard CreateDashboard (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDashboard' {Maybe Text
themeArn :: Maybe Text
$sel:themeArn:CreateDashboard' :: CreateDashboard -> Maybe Text
themeArn} -> Maybe Text
themeArn) (\s :: CreateDashboard
s@CreateDashboard' {} Maybe Text
a -> CreateDashboard
s {$sel:themeArn:CreateDashboard' :: Maybe Text
themeArn = Maybe Text
a} :: CreateDashboard)
createDashboard_dashboardPublishOptions :: Lens.Lens' CreateDashboard (Prelude.Maybe DashboardPublishOptions)
createDashboard_dashboardPublishOptions :: (Maybe DashboardPublishOptions
-> f (Maybe DashboardPublishOptions))
-> CreateDashboard -> f CreateDashboard
createDashboard_dashboardPublishOptions = (CreateDashboard -> Maybe DashboardPublishOptions)
-> (CreateDashboard
-> Maybe DashboardPublishOptions -> CreateDashboard)
-> Lens
CreateDashboard
CreateDashboard
(Maybe DashboardPublishOptions)
(Maybe DashboardPublishOptions)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDashboard' {Maybe DashboardPublishOptions
dashboardPublishOptions :: Maybe DashboardPublishOptions
$sel:dashboardPublishOptions:CreateDashboard' :: CreateDashboard -> Maybe DashboardPublishOptions
dashboardPublishOptions} -> Maybe DashboardPublishOptions
dashboardPublishOptions) (\s :: CreateDashboard
s@CreateDashboard' {} Maybe DashboardPublishOptions
a -> CreateDashboard
s {$sel:dashboardPublishOptions:CreateDashboard' :: Maybe DashboardPublishOptions
dashboardPublishOptions = Maybe DashboardPublishOptions
a} :: CreateDashboard)
createDashboard_versionDescription :: Lens.Lens' CreateDashboard (Prelude.Maybe Prelude.Text)
createDashboard_versionDescription :: (Maybe Text -> f (Maybe Text))
-> CreateDashboard -> f CreateDashboard
createDashboard_versionDescription = (CreateDashboard -> Maybe Text)
-> (CreateDashboard -> Maybe Text -> CreateDashboard)
-> Lens CreateDashboard CreateDashboard (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDashboard' {Maybe Text
versionDescription :: Maybe Text
$sel:versionDescription:CreateDashboard' :: CreateDashboard -> Maybe Text
versionDescription} -> Maybe Text
versionDescription) (\s :: CreateDashboard
s@CreateDashboard' {} Maybe Text
a -> CreateDashboard
s {$sel:versionDescription:CreateDashboard' :: Maybe Text
versionDescription = Maybe Text
a} :: CreateDashboard)
createDashboard_parameters :: Lens.Lens' CreateDashboard (Prelude.Maybe Parameters)
createDashboard_parameters :: (Maybe Parameters -> f (Maybe Parameters))
-> CreateDashboard -> f CreateDashboard
createDashboard_parameters = (CreateDashboard -> Maybe Parameters)
-> (CreateDashboard -> Maybe Parameters -> CreateDashboard)
-> Lens
CreateDashboard
CreateDashboard
(Maybe Parameters)
(Maybe Parameters)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDashboard' {Maybe Parameters
parameters :: Maybe Parameters
$sel:parameters:CreateDashboard' :: CreateDashboard -> Maybe Parameters
parameters} -> Maybe Parameters
parameters) (\s :: CreateDashboard
s@CreateDashboard' {} Maybe Parameters
a -> CreateDashboard
s {$sel:parameters:CreateDashboard' :: Maybe Parameters
parameters = Maybe Parameters
a} :: CreateDashboard)
createDashboard_permissions :: Lens.Lens' CreateDashboard (Prelude.Maybe (Prelude.NonEmpty ResourcePermission))
createDashboard_permissions :: (Maybe (NonEmpty ResourcePermission)
-> f (Maybe (NonEmpty ResourcePermission)))
-> CreateDashboard -> f CreateDashboard
createDashboard_permissions = (CreateDashboard -> Maybe (NonEmpty ResourcePermission))
-> (CreateDashboard
-> Maybe (NonEmpty ResourcePermission) -> CreateDashboard)
-> Lens
CreateDashboard
CreateDashboard
(Maybe (NonEmpty ResourcePermission))
(Maybe (NonEmpty ResourcePermission))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDashboard' {Maybe (NonEmpty ResourcePermission)
permissions :: Maybe (NonEmpty ResourcePermission)
$sel:permissions:CreateDashboard' :: CreateDashboard -> Maybe (NonEmpty ResourcePermission)
permissions} -> Maybe (NonEmpty ResourcePermission)
permissions) (\s :: CreateDashboard
s@CreateDashboard' {} Maybe (NonEmpty ResourcePermission)
a -> CreateDashboard
s {$sel:permissions:CreateDashboard' :: Maybe (NonEmpty ResourcePermission)
permissions = Maybe (NonEmpty ResourcePermission)
a} :: CreateDashboard) ((Maybe (NonEmpty ResourcePermission)
-> f (Maybe (NonEmpty ResourcePermission)))
-> CreateDashboard -> f CreateDashboard)
-> ((Maybe (NonEmpty ResourcePermission)
-> f (Maybe (NonEmpty ResourcePermission)))
-> Maybe (NonEmpty ResourcePermission)
-> f (Maybe (NonEmpty ResourcePermission)))
-> (Maybe (NonEmpty ResourcePermission)
-> f (Maybe (NonEmpty ResourcePermission)))
-> CreateDashboard
-> f CreateDashboard
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
createDashboard_tags :: Lens.Lens' CreateDashboard (Prelude.Maybe (Prelude.NonEmpty Tag))
createDashboard_tags :: (Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> CreateDashboard -> f CreateDashboard
createDashboard_tags = (CreateDashboard -> Maybe (NonEmpty Tag))
-> (CreateDashboard -> Maybe (NonEmpty Tag) -> CreateDashboard)
-> Lens
CreateDashboard
CreateDashboard
(Maybe (NonEmpty Tag))
(Maybe (NonEmpty Tag))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDashboard' {Maybe (NonEmpty Tag)
tags :: Maybe (NonEmpty Tag)
$sel:tags:CreateDashboard' :: CreateDashboard -> Maybe (NonEmpty Tag)
tags} -> Maybe (NonEmpty Tag)
tags) (\s :: CreateDashboard
s@CreateDashboard' {} Maybe (NonEmpty Tag)
a -> CreateDashboard
s {$sel:tags:CreateDashboard' :: Maybe (NonEmpty Tag)
tags = Maybe (NonEmpty Tag)
a} :: CreateDashboard) ((Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> CreateDashboard -> f CreateDashboard)
-> ((Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> (Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> CreateDashboard
-> f CreateDashboard
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
createDashboard_awsAccountId :: Lens.Lens' CreateDashboard Prelude.Text
createDashboard_awsAccountId :: (Text -> f Text) -> CreateDashboard -> f CreateDashboard
createDashboard_awsAccountId = (CreateDashboard -> Text)
-> (CreateDashboard -> Text -> CreateDashboard)
-> Lens CreateDashboard CreateDashboard Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDashboard' {Text
awsAccountId :: Text
$sel:awsAccountId:CreateDashboard' :: CreateDashboard -> Text
awsAccountId} -> Text
awsAccountId) (\s :: CreateDashboard
s@CreateDashboard' {} Text
a -> CreateDashboard
s {$sel:awsAccountId:CreateDashboard' :: Text
awsAccountId = Text
a} :: CreateDashboard)
createDashboard_dashboardId :: Lens.Lens' CreateDashboard Prelude.Text
createDashboard_dashboardId :: (Text -> f Text) -> CreateDashboard -> f CreateDashboard
createDashboard_dashboardId = (CreateDashboard -> Text)
-> (CreateDashboard -> Text -> CreateDashboard)
-> Lens CreateDashboard CreateDashboard Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDashboard' {Text
dashboardId :: Text
$sel:dashboardId:CreateDashboard' :: CreateDashboard -> Text
dashboardId} -> Text
dashboardId) (\s :: CreateDashboard
s@CreateDashboard' {} Text
a -> CreateDashboard
s {$sel:dashboardId:CreateDashboard' :: Text
dashboardId = Text
a} :: CreateDashboard)
createDashboard_name :: Lens.Lens' CreateDashboard Prelude.Text
createDashboard_name :: (Text -> f Text) -> CreateDashboard -> f CreateDashboard
createDashboard_name = (CreateDashboard -> Text)
-> (CreateDashboard -> Text -> CreateDashboard)
-> Lens CreateDashboard CreateDashboard Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDashboard' {Text
name :: Text
$sel:name:CreateDashboard' :: CreateDashboard -> Text
name} -> Text
name) (\s :: CreateDashboard
s@CreateDashboard' {} Text
a -> CreateDashboard
s {$sel:name:CreateDashboard' :: Text
name = Text
a} :: CreateDashboard)
createDashboard_sourceEntity :: Lens.Lens' CreateDashboard DashboardSourceEntity
createDashboard_sourceEntity :: (DashboardSourceEntity -> f DashboardSourceEntity)
-> CreateDashboard -> f CreateDashboard
createDashboard_sourceEntity = (CreateDashboard -> DashboardSourceEntity)
-> (CreateDashboard -> DashboardSourceEntity -> CreateDashboard)
-> Lens
CreateDashboard
CreateDashboard
DashboardSourceEntity
DashboardSourceEntity
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDashboard' {DashboardSourceEntity
sourceEntity :: DashboardSourceEntity
$sel:sourceEntity:CreateDashboard' :: CreateDashboard -> DashboardSourceEntity
sourceEntity} -> DashboardSourceEntity
sourceEntity) (\s :: CreateDashboard
s@CreateDashboard' {} DashboardSourceEntity
a -> CreateDashboard
s {$sel:sourceEntity:CreateDashboard' :: DashboardSourceEntity
sourceEntity = DashboardSourceEntity
a} :: CreateDashboard)
instance Core.AWSRequest CreateDashboard where
type
AWSResponse CreateDashboard =
CreateDashboardResponse
request :: CreateDashboard -> Request CreateDashboard
request = Service -> CreateDashboard -> Request CreateDashboard
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy CreateDashboard
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateDashboard)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse CreateDashboard))
-> Logger
-> Service
-> Proxy CreateDashboard
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateDashboard)))
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 ResourceStatus
-> Maybe Text
-> Maybe Text
-> Int
-> CreateDashboardResponse
CreateDashboardResponse'
(Maybe Text
-> Maybe Text
-> Maybe ResourceStatus
-> Maybe Text
-> Maybe Text
-> Int
-> CreateDashboardResponse)
-> Either String (Maybe Text)
-> Either
String
(Maybe Text
-> Maybe ResourceStatus
-> Maybe Text
-> Maybe Text
-> Int
-> CreateDashboardResponse)
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 ResourceStatus
-> Maybe Text
-> Maybe Text
-> Int
-> CreateDashboardResponse)
-> Either String (Maybe Text)
-> Either
String
(Maybe ResourceStatus
-> Maybe Text -> Maybe Text -> Int -> CreateDashboardResponse)
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
-> Maybe Text -> Maybe Text -> Int -> CreateDashboardResponse)
-> Either String (Maybe ResourceStatus)
-> Either
String (Maybe Text -> Maybe Text -> Int -> CreateDashboardResponse)
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 (Maybe Text -> Maybe Text -> Int -> CreateDashboardResponse)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> Int -> CreateDashboardResponse)
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
"DashboardId")
Either String (Maybe Text -> Int -> CreateDashboardResponse)
-> Either String (Maybe Text)
-> Either String (Int -> CreateDashboardResponse)
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
"VersionArn")
Either String (Int -> CreateDashboardResponse)
-> Either String Int -> Either String CreateDashboardResponse
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 CreateDashboard
instance Prelude.NFData CreateDashboard
instance Core.ToHeaders CreateDashboard where
toHeaders :: CreateDashboard -> ResponseHeaders
toHeaders =
ResponseHeaders -> CreateDashboard -> 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 CreateDashboard where
toJSON :: CreateDashboard -> Value
toJSON CreateDashboard' {Maybe (NonEmpty ResourcePermission)
Maybe (NonEmpty Tag)
Maybe Text
Maybe DashboardPublishOptions
Maybe Parameters
Text
DashboardSourceEntity
sourceEntity :: DashboardSourceEntity
name :: Text
dashboardId :: Text
awsAccountId :: Text
tags :: Maybe (NonEmpty Tag)
permissions :: Maybe (NonEmpty ResourcePermission)
parameters :: Maybe Parameters
versionDescription :: Maybe Text
dashboardPublishOptions :: Maybe DashboardPublishOptions
themeArn :: Maybe Text
$sel:sourceEntity:CreateDashboard' :: CreateDashboard -> DashboardSourceEntity
$sel:name:CreateDashboard' :: CreateDashboard -> Text
$sel:dashboardId:CreateDashboard' :: CreateDashboard -> Text
$sel:awsAccountId:CreateDashboard' :: CreateDashboard -> Text
$sel:tags:CreateDashboard' :: CreateDashboard -> Maybe (NonEmpty Tag)
$sel:permissions:CreateDashboard' :: CreateDashboard -> Maybe (NonEmpty ResourcePermission)
$sel:parameters:CreateDashboard' :: CreateDashboard -> Maybe Parameters
$sel:versionDescription:CreateDashboard' :: CreateDashboard -> Maybe Text
$sel:dashboardPublishOptions:CreateDashboard' :: CreateDashboard -> Maybe DashboardPublishOptions
$sel:themeArn:CreateDashboard' :: CreateDashboard -> 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
"DashboardPublishOptions" Text -> DashboardPublishOptions -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(DashboardPublishOptions -> Pair)
-> Maybe DashboardPublishOptions -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe DashboardPublishOptions
dashboardPublishOptions,
(Text
"VersionDescription" 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
versionDescription,
(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 -> DashboardSourceEntity -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= DashboardSourceEntity
sourceEntity)
]
)
instance Core.ToPath CreateDashboard where
toPath :: CreateDashboard -> ByteString
toPath CreateDashboard' {Maybe (NonEmpty ResourcePermission)
Maybe (NonEmpty Tag)
Maybe Text
Maybe DashboardPublishOptions
Maybe Parameters
Text
DashboardSourceEntity
sourceEntity :: DashboardSourceEntity
name :: Text
dashboardId :: Text
awsAccountId :: Text
tags :: Maybe (NonEmpty Tag)
permissions :: Maybe (NonEmpty ResourcePermission)
parameters :: Maybe Parameters
versionDescription :: Maybe Text
dashboardPublishOptions :: Maybe DashboardPublishOptions
themeArn :: Maybe Text
$sel:sourceEntity:CreateDashboard' :: CreateDashboard -> DashboardSourceEntity
$sel:name:CreateDashboard' :: CreateDashboard -> Text
$sel:dashboardId:CreateDashboard' :: CreateDashboard -> Text
$sel:awsAccountId:CreateDashboard' :: CreateDashboard -> Text
$sel:tags:CreateDashboard' :: CreateDashboard -> Maybe (NonEmpty Tag)
$sel:permissions:CreateDashboard' :: CreateDashboard -> Maybe (NonEmpty ResourcePermission)
$sel:parameters:CreateDashboard' :: CreateDashboard -> Maybe Parameters
$sel:versionDescription:CreateDashboard' :: CreateDashboard -> Maybe Text
$sel:dashboardPublishOptions:CreateDashboard' :: CreateDashboard -> Maybe DashboardPublishOptions
$sel:themeArn:CreateDashboard' :: CreateDashboard -> 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
"/dashboards/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
dashboardId
]
instance Core.ToQuery CreateDashboard where
toQuery :: CreateDashboard -> QueryString
toQuery = QueryString -> CreateDashboard -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data CreateDashboardResponse = CreateDashboardResponse'
{
CreateDashboardResponse -> Maybe Text
requestId :: Prelude.Maybe Prelude.Text,
CreateDashboardResponse -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
CreateDashboardResponse -> Maybe ResourceStatus
creationStatus :: Prelude.Maybe ResourceStatus,
CreateDashboardResponse -> Maybe Text
dashboardId :: Prelude.Maybe Prelude.Text,
CreateDashboardResponse -> Maybe Text
versionArn :: Prelude.Maybe Prelude.Text,
CreateDashboardResponse -> Int
status :: Prelude.Int
}
deriving (CreateDashboardResponse -> CreateDashboardResponse -> Bool
(CreateDashboardResponse -> CreateDashboardResponse -> Bool)
-> (CreateDashboardResponse -> CreateDashboardResponse -> Bool)
-> Eq CreateDashboardResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateDashboardResponse -> CreateDashboardResponse -> Bool
$c/= :: CreateDashboardResponse -> CreateDashboardResponse -> Bool
== :: CreateDashboardResponse -> CreateDashboardResponse -> Bool
$c== :: CreateDashboardResponse -> CreateDashboardResponse -> Bool
Prelude.Eq, ReadPrec [CreateDashboardResponse]
ReadPrec CreateDashboardResponse
Int -> ReadS CreateDashboardResponse
ReadS [CreateDashboardResponse]
(Int -> ReadS CreateDashboardResponse)
-> ReadS [CreateDashboardResponse]
-> ReadPrec CreateDashboardResponse
-> ReadPrec [CreateDashboardResponse]
-> Read CreateDashboardResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateDashboardResponse]
$creadListPrec :: ReadPrec [CreateDashboardResponse]
readPrec :: ReadPrec CreateDashboardResponse
$creadPrec :: ReadPrec CreateDashboardResponse
readList :: ReadS [CreateDashboardResponse]
$creadList :: ReadS [CreateDashboardResponse]
readsPrec :: Int -> ReadS CreateDashboardResponse
$creadsPrec :: Int -> ReadS CreateDashboardResponse
Prelude.Read, Int -> CreateDashboardResponse -> ShowS
[CreateDashboardResponse] -> ShowS
CreateDashboardResponse -> String
(Int -> CreateDashboardResponse -> ShowS)
-> (CreateDashboardResponse -> String)
-> ([CreateDashboardResponse] -> ShowS)
-> Show CreateDashboardResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateDashboardResponse] -> ShowS
$cshowList :: [CreateDashboardResponse] -> ShowS
show :: CreateDashboardResponse -> String
$cshow :: CreateDashboardResponse -> String
showsPrec :: Int -> CreateDashboardResponse -> ShowS
$cshowsPrec :: Int -> CreateDashboardResponse -> ShowS
Prelude.Show, (forall x.
CreateDashboardResponse -> Rep CreateDashboardResponse x)
-> (forall x.
Rep CreateDashboardResponse x -> CreateDashboardResponse)
-> Generic CreateDashboardResponse
forall x. Rep CreateDashboardResponse x -> CreateDashboardResponse
forall x. CreateDashboardResponse -> Rep CreateDashboardResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateDashboardResponse x -> CreateDashboardResponse
$cfrom :: forall x. CreateDashboardResponse -> Rep CreateDashboardResponse x
Prelude.Generic)
newCreateDashboardResponse ::
Prelude.Int ->
CreateDashboardResponse
newCreateDashboardResponse :: Int -> CreateDashboardResponse
newCreateDashboardResponse Int
pStatus_ =
CreateDashboardResponse' :: Maybe Text
-> Maybe Text
-> Maybe ResourceStatus
-> Maybe Text
-> Maybe Text
-> Int
-> CreateDashboardResponse
CreateDashboardResponse'
{ $sel:requestId:CreateDashboardResponse' :: Maybe Text
requestId =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:arn:CreateDashboardResponse' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:creationStatus:CreateDashboardResponse' :: Maybe ResourceStatus
creationStatus = Maybe ResourceStatus
forall a. Maybe a
Prelude.Nothing,
$sel:dashboardId:CreateDashboardResponse' :: Maybe Text
dashboardId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:versionArn:CreateDashboardResponse' :: Maybe Text
versionArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:status:CreateDashboardResponse' :: Int
status = Int
pStatus_
}
createDashboardResponse_requestId :: Lens.Lens' CreateDashboardResponse (Prelude.Maybe Prelude.Text)
createDashboardResponse_requestId :: (Maybe Text -> f (Maybe Text))
-> CreateDashboardResponse -> f CreateDashboardResponse
createDashboardResponse_requestId = (CreateDashboardResponse -> Maybe Text)
-> (CreateDashboardResponse
-> Maybe Text -> CreateDashboardResponse)
-> Lens
CreateDashboardResponse
CreateDashboardResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDashboardResponse' {Maybe Text
requestId :: Maybe Text
$sel:requestId:CreateDashboardResponse' :: CreateDashboardResponse -> Maybe Text
requestId} -> Maybe Text
requestId) (\s :: CreateDashboardResponse
s@CreateDashboardResponse' {} Maybe Text
a -> CreateDashboardResponse
s {$sel:requestId:CreateDashboardResponse' :: Maybe Text
requestId = Maybe Text
a} :: CreateDashboardResponse)
createDashboardResponse_arn :: Lens.Lens' CreateDashboardResponse (Prelude.Maybe Prelude.Text)
createDashboardResponse_arn :: (Maybe Text -> f (Maybe Text))
-> CreateDashboardResponse -> f CreateDashboardResponse
createDashboardResponse_arn = (CreateDashboardResponse -> Maybe Text)
-> (CreateDashboardResponse
-> Maybe Text -> CreateDashboardResponse)
-> Lens
CreateDashboardResponse
CreateDashboardResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDashboardResponse' {Maybe Text
arn :: Maybe Text
$sel:arn:CreateDashboardResponse' :: CreateDashboardResponse -> Maybe Text
arn} -> Maybe Text
arn) (\s :: CreateDashboardResponse
s@CreateDashboardResponse' {} Maybe Text
a -> CreateDashboardResponse
s {$sel:arn:CreateDashboardResponse' :: Maybe Text
arn = Maybe Text
a} :: CreateDashboardResponse)
createDashboardResponse_creationStatus :: Lens.Lens' CreateDashboardResponse (Prelude.Maybe ResourceStatus)
createDashboardResponse_creationStatus :: (Maybe ResourceStatus -> f (Maybe ResourceStatus))
-> CreateDashboardResponse -> f CreateDashboardResponse
createDashboardResponse_creationStatus = (CreateDashboardResponse -> Maybe ResourceStatus)
-> (CreateDashboardResponse
-> Maybe ResourceStatus -> CreateDashboardResponse)
-> Lens
CreateDashboardResponse
CreateDashboardResponse
(Maybe ResourceStatus)
(Maybe ResourceStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDashboardResponse' {Maybe ResourceStatus
creationStatus :: Maybe ResourceStatus
$sel:creationStatus:CreateDashboardResponse' :: CreateDashboardResponse -> Maybe ResourceStatus
creationStatus} -> Maybe ResourceStatus
creationStatus) (\s :: CreateDashboardResponse
s@CreateDashboardResponse' {} Maybe ResourceStatus
a -> CreateDashboardResponse
s {$sel:creationStatus:CreateDashboardResponse' :: Maybe ResourceStatus
creationStatus = Maybe ResourceStatus
a} :: CreateDashboardResponse)
createDashboardResponse_dashboardId :: Lens.Lens' CreateDashboardResponse (Prelude.Maybe Prelude.Text)
createDashboardResponse_dashboardId :: (Maybe Text -> f (Maybe Text))
-> CreateDashboardResponse -> f CreateDashboardResponse
createDashboardResponse_dashboardId = (CreateDashboardResponse -> Maybe Text)
-> (CreateDashboardResponse
-> Maybe Text -> CreateDashboardResponse)
-> Lens
CreateDashboardResponse
CreateDashboardResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDashboardResponse' {Maybe Text
dashboardId :: Maybe Text
$sel:dashboardId:CreateDashboardResponse' :: CreateDashboardResponse -> Maybe Text
dashboardId} -> Maybe Text
dashboardId) (\s :: CreateDashboardResponse
s@CreateDashboardResponse' {} Maybe Text
a -> CreateDashboardResponse
s {$sel:dashboardId:CreateDashboardResponse' :: Maybe Text
dashboardId = Maybe Text
a} :: CreateDashboardResponse)
createDashboardResponse_versionArn :: Lens.Lens' CreateDashboardResponse (Prelude.Maybe Prelude.Text)
createDashboardResponse_versionArn :: (Maybe Text -> f (Maybe Text))
-> CreateDashboardResponse -> f CreateDashboardResponse
createDashboardResponse_versionArn = (CreateDashboardResponse -> Maybe Text)
-> (CreateDashboardResponse
-> Maybe Text -> CreateDashboardResponse)
-> Lens
CreateDashboardResponse
CreateDashboardResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDashboardResponse' {Maybe Text
versionArn :: Maybe Text
$sel:versionArn:CreateDashboardResponse' :: CreateDashboardResponse -> Maybe Text
versionArn} -> Maybe Text
versionArn) (\s :: CreateDashboardResponse
s@CreateDashboardResponse' {} Maybe Text
a -> CreateDashboardResponse
s {$sel:versionArn:CreateDashboardResponse' :: Maybe Text
versionArn = Maybe Text
a} :: CreateDashboardResponse)
createDashboardResponse_status :: Lens.Lens' CreateDashboardResponse Prelude.Int
createDashboardResponse_status :: (Int -> f Int)
-> CreateDashboardResponse -> f CreateDashboardResponse
createDashboardResponse_status = (CreateDashboardResponse -> Int)
-> (CreateDashboardResponse -> Int -> CreateDashboardResponse)
-> Lens CreateDashboardResponse CreateDashboardResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDashboardResponse' {Int
status :: Int
$sel:status:CreateDashboardResponse' :: CreateDashboardResponse -> Int
status} -> Int
status) (\s :: CreateDashboardResponse
s@CreateDashboardResponse' {} Int
a -> CreateDashboardResponse
s {$sel:status:CreateDashboardResponse' :: Int
status = Int
a} :: CreateDashboardResponse)
instance Prelude.NFData CreateDashboardResponse