{-# 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.AlexaBusiness.DeleteDeviceUsageData
(
DeleteDeviceUsageData (..),
newDeleteDeviceUsageData,
deleteDeviceUsageData_deviceArn,
deleteDeviceUsageData_deviceUsageType,
DeleteDeviceUsageDataResponse (..),
newDeleteDeviceUsageDataResponse,
deleteDeviceUsageDataResponse_httpStatus,
)
where
import Amazonka.AlexaBusiness.Types
import qualified Amazonka.Core as Core
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 DeleteDeviceUsageData = DeleteDeviceUsageData'
{
DeleteDeviceUsageData -> Text
deviceArn :: Prelude.Text,
DeleteDeviceUsageData -> DeviceUsageType
deviceUsageType :: DeviceUsageType
}
deriving (DeleteDeviceUsageData -> DeleteDeviceUsageData -> Bool
(DeleteDeviceUsageData -> DeleteDeviceUsageData -> Bool)
-> (DeleteDeviceUsageData -> DeleteDeviceUsageData -> Bool)
-> Eq DeleteDeviceUsageData
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteDeviceUsageData -> DeleteDeviceUsageData -> Bool
$c/= :: DeleteDeviceUsageData -> DeleteDeviceUsageData -> Bool
== :: DeleteDeviceUsageData -> DeleteDeviceUsageData -> Bool
$c== :: DeleteDeviceUsageData -> DeleteDeviceUsageData -> Bool
Prelude.Eq, ReadPrec [DeleteDeviceUsageData]
ReadPrec DeleteDeviceUsageData
Int -> ReadS DeleteDeviceUsageData
ReadS [DeleteDeviceUsageData]
(Int -> ReadS DeleteDeviceUsageData)
-> ReadS [DeleteDeviceUsageData]
-> ReadPrec DeleteDeviceUsageData
-> ReadPrec [DeleteDeviceUsageData]
-> Read DeleteDeviceUsageData
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteDeviceUsageData]
$creadListPrec :: ReadPrec [DeleteDeviceUsageData]
readPrec :: ReadPrec DeleteDeviceUsageData
$creadPrec :: ReadPrec DeleteDeviceUsageData
readList :: ReadS [DeleteDeviceUsageData]
$creadList :: ReadS [DeleteDeviceUsageData]
readsPrec :: Int -> ReadS DeleteDeviceUsageData
$creadsPrec :: Int -> ReadS DeleteDeviceUsageData
Prelude.Read, Int -> DeleteDeviceUsageData -> ShowS
[DeleteDeviceUsageData] -> ShowS
DeleteDeviceUsageData -> String
(Int -> DeleteDeviceUsageData -> ShowS)
-> (DeleteDeviceUsageData -> String)
-> ([DeleteDeviceUsageData] -> ShowS)
-> Show DeleteDeviceUsageData
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteDeviceUsageData] -> ShowS
$cshowList :: [DeleteDeviceUsageData] -> ShowS
show :: DeleteDeviceUsageData -> String
$cshow :: DeleteDeviceUsageData -> String
showsPrec :: Int -> DeleteDeviceUsageData -> ShowS
$cshowsPrec :: Int -> DeleteDeviceUsageData -> ShowS
Prelude.Show, (forall x. DeleteDeviceUsageData -> Rep DeleteDeviceUsageData x)
-> (forall x. Rep DeleteDeviceUsageData x -> DeleteDeviceUsageData)
-> Generic DeleteDeviceUsageData
forall x. Rep DeleteDeviceUsageData x -> DeleteDeviceUsageData
forall x. DeleteDeviceUsageData -> Rep DeleteDeviceUsageData x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteDeviceUsageData x -> DeleteDeviceUsageData
$cfrom :: forall x. DeleteDeviceUsageData -> Rep DeleteDeviceUsageData x
Prelude.Generic)
newDeleteDeviceUsageData ::
Prelude.Text ->
DeviceUsageType ->
DeleteDeviceUsageData
newDeleteDeviceUsageData :: Text -> DeviceUsageType -> DeleteDeviceUsageData
newDeleteDeviceUsageData
Text
pDeviceArn_
DeviceUsageType
pDeviceUsageType_ =
DeleteDeviceUsageData' :: Text -> DeviceUsageType -> DeleteDeviceUsageData
DeleteDeviceUsageData'
{ $sel:deviceArn:DeleteDeviceUsageData' :: Text
deviceArn = Text
pDeviceArn_,
$sel:deviceUsageType:DeleteDeviceUsageData' :: DeviceUsageType
deviceUsageType = DeviceUsageType
pDeviceUsageType_
}
deleteDeviceUsageData_deviceArn :: Lens.Lens' DeleteDeviceUsageData Prelude.Text
deleteDeviceUsageData_deviceArn :: (Text -> f Text)
-> DeleteDeviceUsageData -> f DeleteDeviceUsageData
deleteDeviceUsageData_deviceArn = (DeleteDeviceUsageData -> Text)
-> (DeleteDeviceUsageData -> Text -> DeleteDeviceUsageData)
-> Lens DeleteDeviceUsageData DeleteDeviceUsageData Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteDeviceUsageData' {Text
deviceArn :: Text
$sel:deviceArn:DeleteDeviceUsageData' :: DeleteDeviceUsageData -> Text
deviceArn} -> Text
deviceArn) (\s :: DeleteDeviceUsageData
s@DeleteDeviceUsageData' {} Text
a -> DeleteDeviceUsageData
s {$sel:deviceArn:DeleteDeviceUsageData' :: Text
deviceArn = Text
a} :: DeleteDeviceUsageData)
deleteDeviceUsageData_deviceUsageType :: Lens.Lens' DeleteDeviceUsageData DeviceUsageType
deleteDeviceUsageData_deviceUsageType :: (DeviceUsageType -> f DeviceUsageType)
-> DeleteDeviceUsageData -> f DeleteDeviceUsageData
deleteDeviceUsageData_deviceUsageType = (DeleteDeviceUsageData -> DeviceUsageType)
-> (DeleteDeviceUsageData
-> DeviceUsageType -> DeleteDeviceUsageData)
-> Lens
DeleteDeviceUsageData
DeleteDeviceUsageData
DeviceUsageType
DeviceUsageType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteDeviceUsageData' {DeviceUsageType
deviceUsageType :: DeviceUsageType
$sel:deviceUsageType:DeleteDeviceUsageData' :: DeleteDeviceUsageData -> DeviceUsageType
deviceUsageType} -> DeviceUsageType
deviceUsageType) (\s :: DeleteDeviceUsageData
s@DeleteDeviceUsageData' {} DeviceUsageType
a -> DeleteDeviceUsageData
s {$sel:deviceUsageType:DeleteDeviceUsageData' :: DeviceUsageType
deviceUsageType = DeviceUsageType
a} :: DeleteDeviceUsageData)
instance Core.AWSRequest DeleteDeviceUsageData where
type
AWSResponse DeleteDeviceUsageData =
DeleteDeviceUsageDataResponse
request :: DeleteDeviceUsageData -> Request DeleteDeviceUsageData
request = Service -> DeleteDeviceUsageData -> Request DeleteDeviceUsageData
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteDeviceUsageData
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteDeviceUsageData)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse DeleteDeviceUsageData))
-> Logger
-> Service
-> Proxy DeleteDeviceUsageData
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteDeviceUsageData)))
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 -> DeleteDeviceUsageDataResponse
DeleteDeviceUsageDataResponse'
(Int -> DeleteDeviceUsageDataResponse)
-> Either String Int -> Either String DeleteDeviceUsageDataResponse
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 DeleteDeviceUsageData
instance Prelude.NFData DeleteDeviceUsageData
instance Core.ToHeaders DeleteDeviceUsageData where
toHeaders :: DeleteDeviceUsageData -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteDeviceUsageData -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"AlexaForBusiness.DeleteDeviceUsageData" ::
Prelude.ByteString
),
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.ToJSON DeleteDeviceUsageData where
toJSON :: DeleteDeviceUsageData -> Value
toJSON DeleteDeviceUsageData' {Text
DeviceUsageType
deviceUsageType :: DeviceUsageType
deviceArn :: Text
$sel:deviceUsageType:DeleteDeviceUsageData' :: DeleteDeviceUsageData -> DeviceUsageType
$sel:deviceArn:DeleteDeviceUsageData' :: DeleteDeviceUsageData -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"DeviceArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
deviceArn),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"DeviceUsageType" Text -> DeviceUsageType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= DeviceUsageType
deviceUsageType)
]
)
instance Core.ToPath DeleteDeviceUsageData where
toPath :: DeleteDeviceUsageData -> ByteString
toPath = ByteString -> DeleteDeviceUsageData -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DeleteDeviceUsageData where
toQuery :: DeleteDeviceUsageData -> QueryString
toQuery = QueryString -> DeleteDeviceUsageData -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteDeviceUsageDataResponse = DeleteDeviceUsageDataResponse'
{
DeleteDeviceUsageDataResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteDeviceUsageDataResponse
-> DeleteDeviceUsageDataResponse -> Bool
(DeleteDeviceUsageDataResponse
-> DeleteDeviceUsageDataResponse -> Bool)
-> (DeleteDeviceUsageDataResponse
-> DeleteDeviceUsageDataResponse -> Bool)
-> Eq DeleteDeviceUsageDataResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteDeviceUsageDataResponse
-> DeleteDeviceUsageDataResponse -> Bool
$c/= :: DeleteDeviceUsageDataResponse
-> DeleteDeviceUsageDataResponse -> Bool
== :: DeleteDeviceUsageDataResponse
-> DeleteDeviceUsageDataResponse -> Bool
$c== :: DeleteDeviceUsageDataResponse
-> DeleteDeviceUsageDataResponse -> Bool
Prelude.Eq, ReadPrec [DeleteDeviceUsageDataResponse]
ReadPrec DeleteDeviceUsageDataResponse
Int -> ReadS DeleteDeviceUsageDataResponse
ReadS [DeleteDeviceUsageDataResponse]
(Int -> ReadS DeleteDeviceUsageDataResponse)
-> ReadS [DeleteDeviceUsageDataResponse]
-> ReadPrec DeleteDeviceUsageDataResponse
-> ReadPrec [DeleteDeviceUsageDataResponse]
-> Read DeleteDeviceUsageDataResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteDeviceUsageDataResponse]
$creadListPrec :: ReadPrec [DeleteDeviceUsageDataResponse]
readPrec :: ReadPrec DeleteDeviceUsageDataResponse
$creadPrec :: ReadPrec DeleteDeviceUsageDataResponse
readList :: ReadS [DeleteDeviceUsageDataResponse]
$creadList :: ReadS [DeleteDeviceUsageDataResponse]
readsPrec :: Int -> ReadS DeleteDeviceUsageDataResponse
$creadsPrec :: Int -> ReadS DeleteDeviceUsageDataResponse
Prelude.Read, Int -> DeleteDeviceUsageDataResponse -> ShowS
[DeleteDeviceUsageDataResponse] -> ShowS
DeleteDeviceUsageDataResponse -> String
(Int -> DeleteDeviceUsageDataResponse -> ShowS)
-> (DeleteDeviceUsageDataResponse -> String)
-> ([DeleteDeviceUsageDataResponse] -> ShowS)
-> Show DeleteDeviceUsageDataResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteDeviceUsageDataResponse] -> ShowS
$cshowList :: [DeleteDeviceUsageDataResponse] -> ShowS
show :: DeleteDeviceUsageDataResponse -> String
$cshow :: DeleteDeviceUsageDataResponse -> String
showsPrec :: Int -> DeleteDeviceUsageDataResponse -> ShowS
$cshowsPrec :: Int -> DeleteDeviceUsageDataResponse -> ShowS
Prelude.Show, (forall x.
DeleteDeviceUsageDataResponse
-> Rep DeleteDeviceUsageDataResponse x)
-> (forall x.
Rep DeleteDeviceUsageDataResponse x
-> DeleteDeviceUsageDataResponse)
-> Generic DeleteDeviceUsageDataResponse
forall x.
Rep DeleteDeviceUsageDataResponse x
-> DeleteDeviceUsageDataResponse
forall x.
DeleteDeviceUsageDataResponse
-> Rep DeleteDeviceUsageDataResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteDeviceUsageDataResponse x
-> DeleteDeviceUsageDataResponse
$cfrom :: forall x.
DeleteDeviceUsageDataResponse
-> Rep DeleteDeviceUsageDataResponse x
Prelude.Generic)
newDeleteDeviceUsageDataResponse ::
Prelude.Int ->
DeleteDeviceUsageDataResponse
newDeleteDeviceUsageDataResponse :: Int -> DeleteDeviceUsageDataResponse
newDeleteDeviceUsageDataResponse Int
pHttpStatus_ =
DeleteDeviceUsageDataResponse' :: Int -> DeleteDeviceUsageDataResponse
DeleteDeviceUsageDataResponse'
{ $sel:httpStatus:DeleteDeviceUsageDataResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
deleteDeviceUsageDataResponse_httpStatus :: Lens.Lens' DeleteDeviceUsageDataResponse Prelude.Int
deleteDeviceUsageDataResponse_httpStatus :: (Int -> f Int)
-> DeleteDeviceUsageDataResponse -> f DeleteDeviceUsageDataResponse
deleteDeviceUsageDataResponse_httpStatus = (DeleteDeviceUsageDataResponse -> Int)
-> (DeleteDeviceUsageDataResponse
-> Int -> DeleteDeviceUsageDataResponse)
-> Lens
DeleteDeviceUsageDataResponse DeleteDeviceUsageDataResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteDeviceUsageDataResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteDeviceUsageDataResponse' :: DeleteDeviceUsageDataResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteDeviceUsageDataResponse
s@DeleteDeviceUsageDataResponse' {} Int
a -> DeleteDeviceUsageDataResponse
s {$sel:httpStatus:DeleteDeviceUsageDataResponse' :: Int
httpStatus = Int
a} :: DeleteDeviceUsageDataResponse)
instance Prelude.NFData DeleteDeviceUsageDataResponse