{-# 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.IoTSiteWise.DeleteDashboard
(
DeleteDashboard (..),
newDeleteDashboard,
deleteDashboard_clientToken,
deleteDashboard_dashboardId,
DeleteDashboardResponse (..),
newDeleteDashboardResponse,
deleteDashboardResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.IoTSiteWise.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DeleteDashboard = DeleteDashboard'
{
DeleteDashboard -> Maybe Text
clientToken :: Prelude.Maybe Prelude.Text,
DeleteDashboard -> Text
dashboardId :: Prelude.Text
}
deriving (DeleteDashboard -> DeleteDashboard -> Bool
(DeleteDashboard -> DeleteDashboard -> Bool)
-> (DeleteDashboard -> DeleteDashboard -> Bool)
-> Eq DeleteDashboard
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteDashboard -> DeleteDashboard -> Bool
$c/= :: DeleteDashboard -> DeleteDashboard -> Bool
== :: DeleteDashboard -> DeleteDashboard -> Bool
$c== :: DeleteDashboard -> DeleteDashboard -> Bool
Prelude.Eq, ReadPrec [DeleteDashboard]
ReadPrec DeleteDashboard
Int -> ReadS DeleteDashboard
ReadS [DeleteDashboard]
(Int -> ReadS DeleteDashboard)
-> ReadS [DeleteDashboard]
-> ReadPrec DeleteDashboard
-> ReadPrec [DeleteDashboard]
-> Read DeleteDashboard
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteDashboard]
$creadListPrec :: ReadPrec [DeleteDashboard]
readPrec :: ReadPrec DeleteDashboard
$creadPrec :: ReadPrec DeleteDashboard
readList :: ReadS [DeleteDashboard]
$creadList :: ReadS [DeleteDashboard]
readsPrec :: Int -> ReadS DeleteDashboard
$creadsPrec :: Int -> ReadS DeleteDashboard
Prelude.Read, Int -> DeleteDashboard -> ShowS
[DeleteDashboard] -> ShowS
DeleteDashboard -> String
(Int -> DeleteDashboard -> ShowS)
-> (DeleteDashboard -> String)
-> ([DeleteDashboard] -> ShowS)
-> Show DeleteDashboard
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteDashboard] -> ShowS
$cshowList :: [DeleteDashboard] -> ShowS
show :: DeleteDashboard -> String
$cshow :: DeleteDashboard -> String
showsPrec :: Int -> DeleteDashboard -> ShowS
$cshowsPrec :: Int -> DeleteDashboard -> ShowS
Prelude.Show, (forall x. DeleteDashboard -> Rep DeleteDashboard x)
-> (forall x. Rep DeleteDashboard x -> DeleteDashboard)
-> Generic DeleteDashboard
forall x. Rep DeleteDashboard x -> DeleteDashboard
forall x. DeleteDashboard -> Rep DeleteDashboard x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteDashboard x -> DeleteDashboard
$cfrom :: forall x. DeleteDashboard -> Rep DeleteDashboard x
Prelude.Generic)
newDeleteDashboard ::
Prelude.Text ->
DeleteDashboard
newDeleteDashboard :: Text -> DeleteDashboard
newDeleteDashboard Text
pDashboardId_ =
DeleteDashboard' :: Maybe Text -> Text -> DeleteDashboard
DeleteDashboard'
{ $sel:clientToken:DeleteDashboard' :: Maybe Text
clientToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:dashboardId:DeleteDashboard' :: Text
dashboardId = Text
pDashboardId_
}
deleteDashboard_clientToken :: Lens.Lens' DeleteDashboard (Prelude.Maybe Prelude.Text)
deleteDashboard_clientToken :: (Maybe Text -> f (Maybe Text))
-> DeleteDashboard -> f DeleteDashboard
deleteDashboard_clientToken = (DeleteDashboard -> Maybe Text)
-> (DeleteDashboard -> Maybe Text -> DeleteDashboard)
-> Lens DeleteDashboard DeleteDashboard (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteDashboard' {Maybe Text
clientToken :: Maybe Text
$sel:clientToken:DeleteDashboard' :: DeleteDashboard -> Maybe Text
clientToken} -> Maybe Text
clientToken) (\s :: DeleteDashboard
s@DeleteDashboard' {} Maybe Text
a -> DeleteDashboard
s {$sel:clientToken:DeleteDashboard' :: Maybe Text
clientToken = Maybe Text
a} :: DeleteDashboard)
deleteDashboard_dashboardId :: Lens.Lens' DeleteDashboard Prelude.Text
deleteDashboard_dashboardId :: (Text -> f Text) -> DeleteDashboard -> f DeleteDashboard
deleteDashboard_dashboardId = (DeleteDashboard -> Text)
-> (DeleteDashboard -> Text -> DeleteDashboard)
-> Lens DeleteDashboard DeleteDashboard Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteDashboard' {Text
dashboardId :: Text
$sel:dashboardId:DeleteDashboard' :: DeleteDashboard -> Text
dashboardId} -> Text
dashboardId) (\s :: DeleteDashboard
s@DeleteDashboard' {} Text
a -> DeleteDashboard
s {$sel:dashboardId:DeleteDashboard' :: Text
dashboardId = Text
a} :: DeleteDashboard)
instance Core.AWSRequest DeleteDashboard where
type
AWSResponse DeleteDashboard =
DeleteDashboardResponse
request :: DeleteDashboard -> Request DeleteDashboard
request = Service -> DeleteDashboard -> Request DeleteDashboard
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteDashboard
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteDashboard)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse DeleteDashboard))
-> Logger
-> Service
-> Proxy DeleteDashboard
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteDashboard)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> DeleteDashboardResponse
DeleteDashboardResponse'
(Int -> DeleteDashboardResponse)
-> Either String Int -> Either String DeleteDashboardResponse
forall (f :: * -> *) a b. Functor 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 DeleteDashboard
instance Prelude.NFData DeleteDashboard
instance Core.ToHeaders DeleteDashboard where
toHeaders :: DeleteDashboard -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteDashboard -> 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.1" ::
Prelude.ByteString
)
]
)
instance Core.ToPath DeleteDashboard where
toPath :: DeleteDashboard -> ByteString
toPath DeleteDashboard' {Maybe Text
Text
dashboardId :: Text
clientToken :: Maybe Text
$sel:dashboardId:DeleteDashboard' :: DeleteDashboard -> Text
$sel:clientToken:DeleteDashboard' :: DeleteDashboard -> Maybe Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/dashboards/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
dashboardId]
instance Core.ToQuery DeleteDashboard where
toQuery :: DeleteDashboard -> QueryString
toQuery DeleteDashboard' {Maybe Text
Text
dashboardId :: Text
clientToken :: Maybe Text
$sel:dashboardId:DeleteDashboard' :: DeleteDashboard -> Text
$sel:clientToken:DeleteDashboard' :: DeleteDashboard -> Maybe Text
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"clientToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
clientToken]
data DeleteDashboardResponse = DeleteDashboardResponse'
{
DeleteDashboardResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteDashboardResponse -> DeleteDashboardResponse -> Bool
(DeleteDashboardResponse -> DeleteDashboardResponse -> Bool)
-> (DeleteDashboardResponse -> DeleteDashboardResponse -> Bool)
-> Eq DeleteDashboardResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteDashboardResponse -> DeleteDashboardResponse -> Bool
$c/= :: DeleteDashboardResponse -> DeleteDashboardResponse -> Bool
== :: DeleteDashboardResponse -> DeleteDashboardResponse -> Bool
$c== :: DeleteDashboardResponse -> DeleteDashboardResponse -> Bool
Prelude.Eq, ReadPrec [DeleteDashboardResponse]
ReadPrec DeleteDashboardResponse
Int -> ReadS DeleteDashboardResponse
ReadS [DeleteDashboardResponse]
(Int -> ReadS DeleteDashboardResponse)
-> ReadS [DeleteDashboardResponse]
-> ReadPrec DeleteDashboardResponse
-> ReadPrec [DeleteDashboardResponse]
-> Read DeleteDashboardResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteDashboardResponse]
$creadListPrec :: ReadPrec [DeleteDashboardResponse]
readPrec :: ReadPrec DeleteDashboardResponse
$creadPrec :: ReadPrec DeleteDashboardResponse
readList :: ReadS [DeleteDashboardResponse]
$creadList :: ReadS [DeleteDashboardResponse]
readsPrec :: Int -> ReadS DeleteDashboardResponse
$creadsPrec :: Int -> ReadS DeleteDashboardResponse
Prelude.Read, Int -> DeleteDashboardResponse -> ShowS
[DeleteDashboardResponse] -> ShowS
DeleteDashboardResponse -> String
(Int -> DeleteDashboardResponse -> ShowS)
-> (DeleteDashboardResponse -> String)
-> ([DeleteDashboardResponse] -> ShowS)
-> Show DeleteDashboardResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteDashboardResponse] -> ShowS
$cshowList :: [DeleteDashboardResponse] -> ShowS
show :: DeleteDashboardResponse -> String
$cshow :: DeleteDashboardResponse -> String
showsPrec :: Int -> DeleteDashboardResponse -> ShowS
$cshowsPrec :: Int -> DeleteDashboardResponse -> ShowS
Prelude.Show, (forall x.
DeleteDashboardResponse -> Rep DeleteDashboardResponse x)
-> (forall x.
Rep DeleteDashboardResponse x -> DeleteDashboardResponse)
-> Generic DeleteDashboardResponse
forall x. Rep DeleteDashboardResponse x -> DeleteDashboardResponse
forall x. DeleteDashboardResponse -> Rep DeleteDashboardResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteDashboardResponse x -> DeleteDashboardResponse
$cfrom :: forall x. DeleteDashboardResponse -> Rep DeleteDashboardResponse x
Prelude.Generic)
newDeleteDashboardResponse ::
Prelude.Int ->
DeleteDashboardResponse
newDeleteDashboardResponse :: Int -> DeleteDashboardResponse
newDeleteDashboardResponse Int
pHttpStatus_ =
DeleteDashboardResponse' :: Int -> DeleteDashboardResponse
DeleteDashboardResponse' {$sel:httpStatus:DeleteDashboardResponse' :: Int
httpStatus = Int
pHttpStatus_}
deleteDashboardResponse_httpStatus :: Lens.Lens' DeleteDashboardResponse Prelude.Int
deleteDashboardResponse_httpStatus :: (Int -> f Int)
-> DeleteDashboardResponse -> f DeleteDashboardResponse
deleteDashboardResponse_httpStatus = (DeleteDashboardResponse -> Int)
-> (DeleteDashboardResponse -> Int -> DeleteDashboardResponse)
-> Lens DeleteDashboardResponse DeleteDashboardResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteDashboardResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteDashboardResponse' :: DeleteDashboardResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteDashboardResponse
s@DeleteDashboardResponse' {} Int
a -> DeleteDashboardResponse
s {$sel:httpStatus:DeleteDashboardResponse' :: Int
httpStatus = Int
a} :: DeleteDashboardResponse)
instance Prelude.NFData DeleteDashboardResponse