{-# 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.UpdateAssetProperty
(
UpdateAssetProperty (..),
newUpdateAssetProperty,
updateAssetProperty_clientToken,
updateAssetProperty_propertyNotificationState,
updateAssetProperty_propertyAlias,
updateAssetProperty_assetId,
updateAssetProperty_propertyId,
UpdateAssetPropertyResponse (..),
newUpdateAssetPropertyResponse,
)
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 UpdateAssetProperty = UpdateAssetProperty'
{
UpdateAssetProperty -> Maybe Text
clientToken :: Prelude.Maybe Prelude.Text,
UpdateAssetProperty -> Maybe PropertyNotificationState
propertyNotificationState :: Prelude.Maybe PropertyNotificationState,
UpdateAssetProperty -> Maybe Text
propertyAlias :: Prelude.Maybe Prelude.Text,
UpdateAssetProperty -> Text
assetId :: Prelude.Text,
UpdateAssetProperty -> Text
propertyId :: Prelude.Text
}
deriving (UpdateAssetProperty -> UpdateAssetProperty -> Bool
(UpdateAssetProperty -> UpdateAssetProperty -> Bool)
-> (UpdateAssetProperty -> UpdateAssetProperty -> Bool)
-> Eq UpdateAssetProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateAssetProperty -> UpdateAssetProperty -> Bool
$c/= :: UpdateAssetProperty -> UpdateAssetProperty -> Bool
== :: UpdateAssetProperty -> UpdateAssetProperty -> Bool
$c== :: UpdateAssetProperty -> UpdateAssetProperty -> Bool
Prelude.Eq, ReadPrec [UpdateAssetProperty]
ReadPrec UpdateAssetProperty
Int -> ReadS UpdateAssetProperty
ReadS [UpdateAssetProperty]
(Int -> ReadS UpdateAssetProperty)
-> ReadS [UpdateAssetProperty]
-> ReadPrec UpdateAssetProperty
-> ReadPrec [UpdateAssetProperty]
-> Read UpdateAssetProperty
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateAssetProperty]
$creadListPrec :: ReadPrec [UpdateAssetProperty]
readPrec :: ReadPrec UpdateAssetProperty
$creadPrec :: ReadPrec UpdateAssetProperty
readList :: ReadS [UpdateAssetProperty]
$creadList :: ReadS [UpdateAssetProperty]
readsPrec :: Int -> ReadS UpdateAssetProperty
$creadsPrec :: Int -> ReadS UpdateAssetProperty
Prelude.Read, Int -> UpdateAssetProperty -> ShowS
[UpdateAssetProperty] -> ShowS
UpdateAssetProperty -> String
(Int -> UpdateAssetProperty -> ShowS)
-> (UpdateAssetProperty -> String)
-> ([UpdateAssetProperty] -> ShowS)
-> Show UpdateAssetProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateAssetProperty] -> ShowS
$cshowList :: [UpdateAssetProperty] -> ShowS
show :: UpdateAssetProperty -> String
$cshow :: UpdateAssetProperty -> String
showsPrec :: Int -> UpdateAssetProperty -> ShowS
$cshowsPrec :: Int -> UpdateAssetProperty -> ShowS
Prelude.Show, (forall x. UpdateAssetProperty -> Rep UpdateAssetProperty x)
-> (forall x. Rep UpdateAssetProperty x -> UpdateAssetProperty)
-> Generic UpdateAssetProperty
forall x. Rep UpdateAssetProperty x -> UpdateAssetProperty
forall x. UpdateAssetProperty -> Rep UpdateAssetProperty x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateAssetProperty x -> UpdateAssetProperty
$cfrom :: forall x. UpdateAssetProperty -> Rep UpdateAssetProperty x
Prelude.Generic)
newUpdateAssetProperty ::
Prelude.Text ->
Prelude.Text ->
UpdateAssetProperty
newUpdateAssetProperty :: Text -> Text -> UpdateAssetProperty
newUpdateAssetProperty Text
pAssetId_ Text
pPropertyId_ =
UpdateAssetProperty' :: Maybe Text
-> Maybe PropertyNotificationState
-> Maybe Text
-> Text
-> Text
-> UpdateAssetProperty
UpdateAssetProperty'
{ $sel:clientToken:UpdateAssetProperty' :: Maybe Text
clientToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:propertyNotificationState:UpdateAssetProperty' :: Maybe PropertyNotificationState
propertyNotificationState = Maybe PropertyNotificationState
forall a. Maybe a
Prelude.Nothing,
$sel:propertyAlias:UpdateAssetProperty' :: Maybe Text
propertyAlias = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:assetId:UpdateAssetProperty' :: Text
assetId = Text
pAssetId_,
$sel:propertyId:UpdateAssetProperty' :: Text
propertyId = Text
pPropertyId_
}
updateAssetProperty_clientToken :: Lens.Lens' UpdateAssetProperty (Prelude.Maybe Prelude.Text)
updateAssetProperty_clientToken :: (Maybe Text -> f (Maybe Text))
-> UpdateAssetProperty -> f UpdateAssetProperty
updateAssetProperty_clientToken = (UpdateAssetProperty -> Maybe Text)
-> (UpdateAssetProperty -> Maybe Text -> UpdateAssetProperty)
-> Lens
UpdateAssetProperty UpdateAssetProperty (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAssetProperty' {Maybe Text
clientToken :: Maybe Text
$sel:clientToken:UpdateAssetProperty' :: UpdateAssetProperty -> Maybe Text
clientToken} -> Maybe Text
clientToken) (\s :: UpdateAssetProperty
s@UpdateAssetProperty' {} Maybe Text
a -> UpdateAssetProperty
s {$sel:clientToken:UpdateAssetProperty' :: Maybe Text
clientToken = Maybe Text
a} :: UpdateAssetProperty)
updateAssetProperty_propertyNotificationState :: Lens.Lens' UpdateAssetProperty (Prelude.Maybe PropertyNotificationState)
updateAssetProperty_propertyNotificationState :: (Maybe PropertyNotificationState
-> f (Maybe PropertyNotificationState))
-> UpdateAssetProperty -> f UpdateAssetProperty
updateAssetProperty_propertyNotificationState = (UpdateAssetProperty -> Maybe PropertyNotificationState)
-> (UpdateAssetProperty
-> Maybe PropertyNotificationState -> UpdateAssetProperty)
-> Lens
UpdateAssetProperty
UpdateAssetProperty
(Maybe PropertyNotificationState)
(Maybe PropertyNotificationState)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAssetProperty' {Maybe PropertyNotificationState
propertyNotificationState :: Maybe PropertyNotificationState
$sel:propertyNotificationState:UpdateAssetProperty' :: UpdateAssetProperty -> Maybe PropertyNotificationState
propertyNotificationState} -> Maybe PropertyNotificationState
propertyNotificationState) (\s :: UpdateAssetProperty
s@UpdateAssetProperty' {} Maybe PropertyNotificationState
a -> UpdateAssetProperty
s {$sel:propertyNotificationState:UpdateAssetProperty' :: Maybe PropertyNotificationState
propertyNotificationState = Maybe PropertyNotificationState
a} :: UpdateAssetProperty)
updateAssetProperty_propertyAlias :: Lens.Lens' UpdateAssetProperty (Prelude.Maybe Prelude.Text)
updateAssetProperty_propertyAlias :: (Maybe Text -> f (Maybe Text))
-> UpdateAssetProperty -> f UpdateAssetProperty
updateAssetProperty_propertyAlias = (UpdateAssetProperty -> Maybe Text)
-> (UpdateAssetProperty -> Maybe Text -> UpdateAssetProperty)
-> Lens
UpdateAssetProperty UpdateAssetProperty (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAssetProperty' {Maybe Text
propertyAlias :: Maybe Text
$sel:propertyAlias:UpdateAssetProperty' :: UpdateAssetProperty -> Maybe Text
propertyAlias} -> Maybe Text
propertyAlias) (\s :: UpdateAssetProperty
s@UpdateAssetProperty' {} Maybe Text
a -> UpdateAssetProperty
s {$sel:propertyAlias:UpdateAssetProperty' :: Maybe Text
propertyAlias = Maybe Text
a} :: UpdateAssetProperty)
updateAssetProperty_assetId :: Lens.Lens' UpdateAssetProperty Prelude.Text
updateAssetProperty_assetId :: (Text -> f Text) -> UpdateAssetProperty -> f UpdateAssetProperty
updateAssetProperty_assetId = (UpdateAssetProperty -> Text)
-> (UpdateAssetProperty -> Text -> UpdateAssetProperty)
-> Lens UpdateAssetProperty UpdateAssetProperty Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAssetProperty' {Text
assetId :: Text
$sel:assetId:UpdateAssetProperty' :: UpdateAssetProperty -> Text
assetId} -> Text
assetId) (\s :: UpdateAssetProperty
s@UpdateAssetProperty' {} Text
a -> UpdateAssetProperty
s {$sel:assetId:UpdateAssetProperty' :: Text
assetId = Text
a} :: UpdateAssetProperty)
updateAssetProperty_propertyId :: Lens.Lens' UpdateAssetProperty Prelude.Text
updateAssetProperty_propertyId :: (Text -> f Text) -> UpdateAssetProperty -> f UpdateAssetProperty
updateAssetProperty_propertyId = (UpdateAssetProperty -> Text)
-> (UpdateAssetProperty -> Text -> UpdateAssetProperty)
-> Lens UpdateAssetProperty UpdateAssetProperty Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAssetProperty' {Text
propertyId :: Text
$sel:propertyId:UpdateAssetProperty' :: UpdateAssetProperty -> Text
propertyId} -> Text
propertyId) (\s :: UpdateAssetProperty
s@UpdateAssetProperty' {} Text
a -> UpdateAssetProperty
s {$sel:propertyId:UpdateAssetProperty' :: Text
propertyId = Text
a} :: UpdateAssetProperty)
instance Core.AWSRequest UpdateAssetProperty where
type
AWSResponse UpdateAssetProperty =
UpdateAssetPropertyResponse
request :: UpdateAssetProperty -> Request UpdateAssetProperty
request = Service -> UpdateAssetProperty -> Request UpdateAssetProperty
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateAssetProperty
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateAssetProperty)))
response =
AWSResponse UpdateAssetProperty
-> Logger
-> Service
-> Proxy UpdateAssetProperty
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateAssetProperty)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse UpdateAssetProperty
UpdateAssetPropertyResponse
UpdateAssetPropertyResponse'
instance Prelude.Hashable UpdateAssetProperty
instance Prelude.NFData UpdateAssetProperty
instance Core.ToHeaders UpdateAssetProperty where
toHeaders :: UpdateAssetProperty -> [Header]
toHeaders =
[Header] -> UpdateAssetProperty -> [Header]
forall a b. a -> b -> a
Prelude.const
( [[Header]] -> [Header]
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON UpdateAssetProperty where
toJSON :: UpdateAssetProperty -> Value
toJSON UpdateAssetProperty' {Maybe Text
Maybe PropertyNotificationState
Text
propertyId :: Text
assetId :: Text
propertyAlias :: Maybe Text
propertyNotificationState :: Maybe PropertyNotificationState
clientToken :: Maybe Text
$sel:propertyId:UpdateAssetProperty' :: UpdateAssetProperty -> Text
$sel:assetId:UpdateAssetProperty' :: UpdateAssetProperty -> Text
$sel:propertyAlias:UpdateAssetProperty' :: UpdateAssetProperty -> Maybe Text
$sel:propertyNotificationState:UpdateAssetProperty' :: UpdateAssetProperty -> Maybe PropertyNotificationState
$sel:clientToken:UpdateAssetProperty' :: UpdateAssetProperty -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"clientToken" 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
clientToken,
(Text
"propertyNotificationState" Text -> PropertyNotificationState -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(PropertyNotificationState -> Pair)
-> Maybe PropertyNotificationState -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe PropertyNotificationState
propertyNotificationState,
(Text
"propertyAlias" 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
propertyAlias
]
)
instance Core.ToPath UpdateAssetProperty where
toPath :: UpdateAssetProperty -> ByteString
toPath UpdateAssetProperty' {Maybe Text
Maybe PropertyNotificationState
Text
propertyId :: Text
assetId :: Text
propertyAlias :: Maybe Text
propertyNotificationState :: Maybe PropertyNotificationState
clientToken :: Maybe Text
$sel:propertyId:UpdateAssetProperty' :: UpdateAssetProperty -> Text
$sel:assetId:UpdateAssetProperty' :: UpdateAssetProperty -> Text
$sel:propertyAlias:UpdateAssetProperty' :: UpdateAssetProperty -> Maybe Text
$sel:propertyNotificationState:UpdateAssetProperty' :: UpdateAssetProperty -> Maybe PropertyNotificationState
$sel:clientToken:UpdateAssetProperty' :: UpdateAssetProperty -> Maybe Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/assets/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
assetId,
ByteString
"/properties/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
propertyId
]
instance Core.ToQuery UpdateAssetProperty where
toQuery :: UpdateAssetProperty -> QueryString
toQuery = QueryString -> UpdateAssetProperty -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data UpdateAssetPropertyResponse = UpdateAssetPropertyResponse'
{
}
deriving (UpdateAssetPropertyResponse -> UpdateAssetPropertyResponse -> Bool
(UpdateAssetPropertyResponse
-> UpdateAssetPropertyResponse -> Bool)
-> (UpdateAssetPropertyResponse
-> UpdateAssetPropertyResponse -> Bool)
-> Eq UpdateAssetPropertyResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateAssetPropertyResponse -> UpdateAssetPropertyResponse -> Bool
$c/= :: UpdateAssetPropertyResponse -> UpdateAssetPropertyResponse -> Bool
== :: UpdateAssetPropertyResponse -> UpdateAssetPropertyResponse -> Bool
$c== :: UpdateAssetPropertyResponse -> UpdateAssetPropertyResponse -> Bool
Prelude.Eq, ReadPrec [UpdateAssetPropertyResponse]
ReadPrec UpdateAssetPropertyResponse
Int -> ReadS UpdateAssetPropertyResponse
ReadS [UpdateAssetPropertyResponse]
(Int -> ReadS UpdateAssetPropertyResponse)
-> ReadS [UpdateAssetPropertyResponse]
-> ReadPrec UpdateAssetPropertyResponse
-> ReadPrec [UpdateAssetPropertyResponse]
-> Read UpdateAssetPropertyResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateAssetPropertyResponse]
$creadListPrec :: ReadPrec [UpdateAssetPropertyResponse]
readPrec :: ReadPrec UpdateAssetPropertyResponse
$creadPrec :: ReadPrec UpdateAssetPropertyResponse
readList :: ReadS [UpdateAssetPropertyResponse]
$creadList :: ReadS [UpdateAssetPropertyResponse]
readsPrec :: Int -> ReadS UpdateAssetPropertyResponse
$creadsPrec :: Int -> ReadS UpdateAssetPropertyResponse
Prelude.Read, Int -> UpdateAssetPropertyResponse -> ShowS
[UpdateAssetPropertyResponse] -> ShowS
UpdateAssetPropertyResponse -> String
(Int -> UpdateAssetPropertyResponse -> ShowS)
-> (UpdateAssetPropertyResponse -> String)
-> ([UpdateAssetPropertyResponse] -> ShowS)
-> Show UpdateAssetPropertyResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateAssetPropertyResponse] -> ShowS
$cshowList :: [UpdateAssetPropertyResponse] -> ShowS
show :: UpdateAssetPropertyResponse -> String
$cshow :: UpdateAssetPropertyResponse -> String
showsPrec :: Int -> UpdateAssetPropertyResponse -> ShowS
$cshowsPrec :: Int -> UpdateAssetPropertyResponse -> ShowS
Prelude.Show, (forall x.
UpdateAssetPropertyResponse -> Rep UpdateAssetPropertyResponse x)
-> (forall x.
Rep UpdateAssetPropertyResponse x -> UpdateAssetPropertyResponse)
-> Generic UpdateAssetPropertyResponse
forall x.
Rep UpdateAssetPropertyResponse x -> UpdateAssetPropertyResponse
forall x.
UpdateAssetPropertyResponse -> Rep UpdateAssetPropertyResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateAssetPropertyResponse x -> UpdateAssetPropertyResponse
$cfrom :: forall x.
UpdateAssetPropertyResponse -> Rep UpdateAssetPropertyResponse x
Prelude.Generic)
newUpdateAssetPropertyResponse ::
UpdateAssetPropertyResponse
newUpdateAssetPropertyResponse :: UpdateAssetPropertyResponse
newUpdateAssetPropertyResponse =
UpdateAssetPropertyResponse
UpdateAssetPropertyResponse'
instance Prelude.NFData UpdateAssetPropertyResponse