{-# 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.DeleteAssetModel
(
DeleteAssetModel (..),
newDeleteAssetModel,
deleteAssetModel_clientToken,
deleteAssetModel_assetModelId,
DeleteAssetModelResponse (..),
newDeleteAssetModelResponse,
deleteAssetModelResponse_httpStatus,
deleteAssetModelResponse_assetModelStatus,
)
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 DeleteAssetModel = DeleteAssetModel'
{
DeleteAssetModel -> Maybe Text
clientToken :: Prelude.Maybe Prelude.Text,
DeleteAssetModel -> Text
assetModelId :: Prelude.Text
}
deriving (DeleteAssetModel -> DeleteAssetModel -> Bool
(DeleteAssetModel -> DeleteAssetModel -> Bool)
-> (DeleteAssetModel -> DeleteAssetModel -> Bool)
-> Eq DeleteAssetModel
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteAssetModel -> DeleteAssetModel -> Bool
$c/= :: DeleteAssetModel -> DeleteAssetModel -> Bool
== :: DeleteAssetModel -> DeleteAssetModel -> Bool
$c== :: DeleteAssetModel -> DeleteAssetModel -> Bool
Prelude.Eq, ReadPrec [DeleteAssetModel]
ReadPrec DeleteAssetModel
Int -> ReadS DeleteAssetModel
ReadS [DeleteAssetModel]
(Int -> ReadS DeleteAssetModel)
-> ReadS [DeleteAssetModel]
-> ReadPrec DeleteAssetModel
-> ReadPrec [DeleteAssetModel]
-> Read DeleteAssetModel
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteAssetModel]
$creadListPrec :: ReadPrec [DeleteAssetModel]
readPrec :: ReadPrec DeleteAssetModel
$creadPrec :: ReadPrec DeleteAssetModel
readList :: ReadS [DeleteAssetModel]
$creadList :: ReadS [DeleteAssetModel]
readsPrec :: Int -> ReadS DeleteAssetModel
$creadsPrec :: Int -> ReadS DeleteAssetModel
Prelude.Read, Int -> DeleteAssetModel -> ShowS
[DeleteAssetModel] -> ShowS
DeleteAssetModel -> String
(Int -> DeleteAssetModel -> ShowS)
-> (DeleteAssetModel -> String)
-> ([DeleteAssetModel] -> ShowS)
-> Show DeleteAssetModel
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteAssetModel] -> ShowS
$cshowList :: [DeleteAssetModel] -> ShowS
show :: DeleteAssetModel -> String
$cshow :: DeleteAssetModel -> String
showsPrec :: Int -> DeleteAssetModel -> ShowS
$cshowsPrec :: Int -> DeleteAssetModel -> ShowS
Prelude.Show, (forall x. DeleteAssetModel -> Rep DeleteAssetModel x)
-> (forall x. Rep DeleteAssetModel x -> DeleteAssetModel)
-> Generic DeleteAssetModel
forall x. Rep DeleteAssetModel x -> DeleteAssetModel
forall x. DeleteAssetModel -> Rep DeleteAssetModel x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteAssetModel x -> DeleteAssetModel
$cfrom :: forall x. DeleteAssetModel -> Rep DeleteAssetModel x
Prelude.Generic)
newDeleteAssetModel ::
Prelude.Text ->
DeleteAssetModel
newDeleteAssetModel :: Text -> DeleteAssetModel
newDeleteAssetModel Text
pAssetModelId_ =
DeleteAssetModel' :: Maybe Text -> Text -> DeleteAssetModel
DeleteAssetModel'
{ $sel:clientToken:DeleteAssetModel' :: Maybe Text
clientToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:assetModelId:DeleteAssetModel' :: Text
assetModelId = Text
pAssetModelId_
}
deleteAssetModel_clientToken :: Lens.Lens' DeleteAssetModel (Prelude.Maybe Prelude.Text)
deleteAssetModel_clientToken :: (Maybe Text -> f (Maybe Text))
-> DeleteAssetModel -> f DeleteAssetModel
deleteAssetModel_clientToken = (DeleteAssetModel -> Maybe Text)
-> (DeleteAssetModel -> Maybe Text -> DeleteAssetModel)
-> Lens DeleteAssetModel DeleteAssetModel (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteAssetModel' {Maybe Text
clientToken :: Maybe Text
$sel:clientToken:DeleteAssetModel' :: DeleteAssetModel -> Maybe Text
clientToken} -> Maybe Text
clientToken) (\s :: DeleteAssetModel
s@DeleteAssetModel' {} Maybe Text
a -> DeleteAssetModel
s {$sel:clientToken:DeleteAssetModel' :: Maybe Text
clientToken = Maybe Text
a} :: DeleteAssetModel)
deleteAssetModel_assetModelId :: Lens.Lens' DeleteAssetModel Prelude.Text
deleteAssetModel_assetModelId :: (Text -> f Text) -> DeleteAssetModel -> f DeleteAssetModel
deleteAssetModel_assetModelId = (DeleteAssetModel -> Text)
-> (DeleteAssetModel -> Text -> DeleteAssetModel)
-> Lens DeleteAssetModel DeleteAssetModel Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteAssetModel' {Text
assetModelId :: Text
$sel:assetModelId:DeleteAssetModel' :: DeleteAssetModel -> Text
assetModelId} -> Text
assetModelId) (\s :: DeleteAssetModel
s@DeleteAssetModel' {} Text
a -> DeleteAssetModel
s {$sel:assetModelId:DeleteAssetModel' :: Text
assetModelId = Text
a} :: DeleteAssetModel)
instance Core.AWSRequest DeleteAssetModel where
type
AWSResponse DeleteAssetModel =
DeleteAssetModelResponse
request :: DeleteAssetModel -> Request DeleteAssetModel
request = Service -> DeleteAssetModel -> Request DeleteAssetModel
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteAssetModel
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteAssetModel)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DeleteAssetModel))
-> Logger
-> Service
-> Proxy DeleteAssetModel
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteAssetModel)))
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 ->
Int -> AssetModelStatus -> DeleteAssetModelResponse
DeleteAssetModelResponse'
(Int -> AssetModelStatus -> DeleteAssetModelResponse)
-> Either String Int
-> Either String (AssetModelStatus -> DeleteAssetModelResponse)
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))
Either String (AssetModelStatus -> DeleteAssetModelResponse)
-> Either String AssetModelStatus
-> Either String DeleteAssetModelResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String AssetModelStatus
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"assetModelStatus")
)
instance Prelude.Hashable DeleteAssetModel
instance Prelude.NFData DeleteAssetModel
instance Core.ToHeaders DeleteAssetModel where
toHeaders :: DeleteAssetModel -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteAssetModel -> 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 DeleteAssetModel where
toPath :: DeleteAssetModel -> ByteString
toPath DeleteAssetModel' {Maybe Text
Text
assetModelId :: Text
clientToken :: Maybe Text
$sel:assetModelId:DeleteAssetModel' :: DeleteAssetModel -> Text
$sel:clientToken:DeleteAssetModel' :: DeleteAssetModel -> Maybe Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/asset-models/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
assetModelId]
instance Core.ToQuery DeleteAssetModel where
toQuery :: DeleteAssetModel -> QueryString
toQuery DeleteAssetModel' {Maybe Text
Text
assetModelId :: Text
clientToken :: Maybe Text
$sel:assetModelId:DeleteAssetModel' :: DeleteAssetModel -> Text
$sel:clientToken:DeleteAssetModel' :: DeleteAssetModel -> 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 DeleteAssetModelResponse = DeleteAssetModelResponse'
{
DeleteAssetModelResponse -> Int
httpStatus :: Prelude.Int,
DeleteAssetModelResponse -> AssetModelStatus
assetModelStatus :: AssetModelStatus
}
deriving (DeleteAssetModelResponse -> DeleteAssetModelResponse -> Bool
(DeleteAssetModelResponse -> DeleteAssetModelResponse -> Bool)
-> (DeleteAssetModelResponse -> DeleteAssetModelResponse -> Bool)
-> Eq DeleteAssetModelResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteAssetModelResponse -> DeleteAssetModelResponse -> Bool
$c/= :: DeleteAssetModelResponse -> DeleteAssetModelResponse -> Bool
== :: DeleteAssetModelResponse -> DeleteAssetModelResponse -> Bool
$c== :: DeleteAssetModelResponse -> DeleteAssetModelResponse -> Bool
Prelude.Eq, ReadPrec [DeleteAssetModelResponse]
ReadPrec DeleteAssetModelResponse
Int -> ReadS DeleteAssetModelResponse
ReadS [DeleteAssetModelResponse]
(Int -> ReadS DeleteAssetModelResponse)
-> ReadS [DeleteAssetModelResponse]
-> ReadPrec DeleteAssetModelResponse
-> ReadPrec [DeleteAssetModelResponse]
-> Read DeleteAssetModelResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteAssetModelResponse]
$creadListPrec :: ReadPrec [DeleteAssetModelResponse]
readPrec :: ReadPrec DeleteAssetModelResponse
$creadPrec :: ReadPrec DeleteAssetModelResponse
readList :: ReadS [DeleteAssetModelResponse]
$creadList :: ReadS [DeleteAssetModelResponse]
readsPrec :: Int -> ReadS DeleteAssetModelResponse
$creadsPrec :: Int -> ReadS DeleteAssetModelResponse
Prelude.Read, Int -> DeleteAssetModelResponse -> ShowS
[DeleteAssetModelResponse] -> ShowS
DeleteAssetModelResponse -> String
(Int -> DeleteAssetModelResponse -> ShowS)
-> (DeleteAssetModelResponse -> String)
-> ([DeleteAssetModelResponse] -> ShowS)
-> Show DeleteAssetModelResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteAssetModelResponse] -> ShowS
$cshowList :: [DeleteAssetModelResponse] -> ShowS
show :: DeleteAssetModelResponse -> String
$cshow :: DeleteAssetModelResponse -> String
showsPrec :: Int -> DeleteAssetModelResponse -> ShowS
$cshowsPrec :: Int -> DeleteAssetModelResponse -> ShowS
Prelude.Show, (forall x.
DeleteAssetModelResponse -> Rep DeleteAssetModelResponse x)
-> (forall x.
Rep DeleteAssetModelResponse x -> DeleteAssetModelResponse)
-> Generic DeleteAssetModelResponse
forall x.
Rep DeleteAssetModelResponse x -> DeleteAssetModelResponse
forall x.
DeleteAssetModelResponse -> Rep DeleteAssetModelResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteAssetModelResponse x -> DeleteAssetModelResponse
$cfrom :: forall x.
DeleteAssetModelResponse -> Rep DeleteAssetModelResponse x
Prelude.Generic)
newDeleteAssetModelResponse ::
Prelude.Int ->
AssetModelStatus ->
DeleteAssetModelResponse
newDeleteAssetModelResponse :: Int -> AssetModelStatus -> DeleteAssetModelResponse
newDeleteAssetModelResponse
Int
pHttpStatus_
AssetModelStatus
pAssetModelStatus_ =
DeleteAssetModelResponse' :: Int -> AssetModelStatus -> DeleteAssetModelResponse
DeleteAssetModelResponse'
{ $sel:httpStatus:DeleteAssetModelResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:assetModelStatus:DeleteAssetModelResponse' :: AssetModelStatus
assetModelStatus = AssetModelStatus
pAssetModelStatus_
}
deleteAssetModelResponse_httpStatus :: Lens.Lens' DeleteAssetModelResponse Prelude.Int
deleteAssetModelResponse_httpStatus :: (Int -> f Int)
-> DeleteAssetModelResponse -> f DeleteAssetModelResponse
deleteAssetModelResponse_httpStatus = (DeleteAssetModelResponse -> Int)
-> (DeleteAssetModelResponse -> Int -> DeleteAssetModelResponse)
-> Lens DeleteAssetModelResponse DeleteAssetModelResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteAssetModelResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteAssetModelResponse' :: DeleteAssetModelResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteAssetModelResponse
s@DeleteAssetModelResponse' {} Int
a -> DeleteAssetModelResponse
s {$sel:httpStatus:DeleteAssetModelResponse' :: Int
httpStatus = Int
a} :: DeleteAssetModelResponse)
deleteAssetModelResponse_assetModelStatus :: Lens.Lens' DeleteAssetModelResponse AssetModelStatus
deleteAssetModelResponse_assetModelStatus :: (AssetModelStatus -> f AssetModelStatus)
-> DeleteAssetModelResponse -> f DeleteAssetModelResponse
deleteAssetModelResponse_assetModelStatus = (DeleteAssetModelResponse -> AssetModelStatus)
-> (DeleteAssetModelResponse
-> AssetModelStatus -> DeleteAssetModelResponse)
-> Lens
DeleteAssetModelResponse
DeleteAssetModelResponse
AssetModelStatus
AssetModelStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteAssetModelResponse' {AssetModelStatus
assetModelStatus :: AssetModelStatus
$sel:assetModelStatus:DeleteAssetModelResponse' :: DeleteAssetModelResponse -> AssetModelStatus
assetModelStatus} -> AssetModelStatus
assetModelStatus) (\s :: DeleteAssetModelResponse
s@DeleteAssetModelResponse' {} AssetModelStatus
a -> DeleteAssetModelResponse
s {$sel:assetModelStatus:DeleteAssetModelResponse' :: AssetModelStatus
assetModelStatus = AssetModelStatus
a} :: DeleteAssetModelResponse)
instance Prelude.NFData DeleteAssetModelResponse