{-# 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.GetAssetPropertyValue
(
GetAssetPropertyValue (..),
newGetAssetPropertyValue,
getAssetPropertyValue_propertyAlias,
getAssetPropertyValue_propertyId,
getAssetPropertyValue_assetId,
GetAssetPropertyValueResponse (..),
newGetAssetPropertyValueResponse,
getAssetPropertyValueResponse_propertyValue,
getAssetPropertyValueResponse_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 GetAssetPropertyValue = GetAssetPropertyValue'
{
GetAssetPropertyValue -> Maybe Text
propertyAlias :: Prelude.Maybe Prelude.Text,
GetAssetPropertyValue -> Maybe Text
propertyId :: Prelude.Maybe Prelude.Text,
GetAssetPropertyValue -> Maybe Text
assetId :: Prelude.Maybe Prelude.Text
}
deriving (GetAssetPropertyValue -> GetAssetPropertyValue -> Bool
(GetAssetPropertyValue -> GetAssetPropertyValue -> Bool)
-> (GetAssetPropertyValue -> GetAssetPropertyValue -> Bool)
-> Eq GetAssetPropertyValue
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetAssetPropertyValue -> GetAssetPropertyValue -> Bool
$c/= :: GetAssetPropertyValue -> GetAssetPropertyValue -> Bool
== :: GetAssetPropertyValue -> GetAssetPropertyValue -> Bool
$c== :: GetAssetPropertyValue -> GetAssetPropertyValue -> Bool
Prelude.Eq, ReadPrec [GetAssetPropertyValue]
ReadPrec GetAssetPropertyValue
Int -> ReadS GetAssetPropertyValue
ReadS [GetAssetPropertyValue]
(Int -> ReadS GetAssetPropertyValue)
-> ReadS [GetAssetPropertyValue]
-> ReadPrec GetAssetPropertyValue
-> ReadPrec [GetAssetPropertyValue]
-> Read GetAssetPropertyValue
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetAssetPropertyValue]
$creadListPrec :: ReadPrec [GetAssetPropertyValue]
readPrec :: ReadPrec GetAssetPropertyValue
$creadPrec :: ReadPrec GetAssetPropertyValue
readList :: ReadS [GetAssetPropertyValue]
$creadList :: ReadS [GetAssetPropertyValue]
readsPrec :: Int -> ReadS GetAssetPropertyValue
$creadsPrec :: Int -> ReadS GetAssetPropertyValue
Prelude.Read, Int -> GetAssetPropertyValue -> ShowS
[GetAssetPropertyValue] -> ShowS
GetAssetPropertyValue -> String
(Int -> GetAssetPropertyValue -> ShowS)
-> (GetAssetPropertyValue -> String)
-> ([GetAssetPropertyValue] -> ShowS)
-> Show GetAssetPropertyValue
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetAssetPropertyValue] -> ShowS
$cshowList :: [GetAssetPropertyValue] -> ShowS
show :: GetAssetPropertyValue -> String
$cshow :: GetAssetPropertyValue -> String
showsPrec :: Int -> GetAssetPropertyValue -> ShowS
$cshowsPrec :: Int -> GetAssetPropertyValue -> ShowS
Prelude.Show, (forall x. GetAssetPropertyValue -> Rep GetAssetPropertyValue x)
-> (forall x. Rep GetAssetPropertyValue x -> GetAssetPropertyValue)
-> Generic GetAssetPropertyValue
forall x. Rep GetAssetPropertyValue x -> GetAssetPropertyValue
forall x. GetAssetPropertyValue -> Rep GetAssetPropertyValue x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetAssetPropertyValue x -> GetAssetPropertyValue
$cfrom :: forall x. GetAssetPropertyValue -> Rep GetAssetPropertyValue x
Prelude.Generic)
newGetAssetPropertyValue ::
GetAssetPropertyValue
newGetAssetPropertyValue :: GetAssetPropertyValue
newGetAssetPropertyValue =
GetAssetPropertyValue' :: Maybe Text -> Maybe Text -> Maybe Text -> GetAssetPropertyValue
GetAssetPropertyValue'
{ $sel:propertyAlias:GetAssetPropertyValue' :: Maybe Text
propertyAlias =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:propertyId:GetAssetPropertyValue' :: Maybe Text
propertyId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:assetId:GetAssetPropertyValue' :: Maybe Text
assetId = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
getAssetPropertyValue_propertyAlias :: Lens.Lens' GetAssetPropertyValue (Prelude.Maybe Prelude.Text)
getAssetPropertyValue_propertyAlias :: (Maybe Text -> f (Maybe Text))
-> GetAssetPropertyValue -> f GetAssetPropertyValue
getAssetPropertyValue_propertyAlias = (GetAssetPropertyValue -> Maybe Text)
-> (GetAssetPropertyValue -> Maybe Text -> GetAssetPropertyValue)
-> Lens
GetAssetPropertyValue
GetAssetPropertyValue
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAssetPropertyValue' {Maybe Text
propertyAlias :: Maybe Text
$sel:propertyAlias:GetAssetPropertyValue' :: GetAssetPropertyValue -> Maybe Text
propertyAlias} -> Maybe Text
propertyAlias) (\s :: GetAssetPropertyValue
s@GetAssetPropertyValue' {} Maybe Text
a -> GetAssetPropertyValue
s {$sel:propertyAlias:GetAssetPropertyValue' :: Maybe Text
propertyAlias = Maybe Text
a} :: GetAssetPropertyValue)
getAssetPropertyValue_propertyId :: Lens.Lens' GetAssetPropertyValue (Prelude.Maybe Prelude.Text)
getAssetPropertyValue_propertyId :: (Maybe Text -> f (Maybe Text))
-> GetAssetPropertyValue -> f GetAssetPropertyValue
getAssetPropertyValue_propertyId = (GetAssetPropertyValue -> Maybe Text)
-> (GetAssetPropertyValue -> Maybe Text -> GetAssetPropertyValue)
-> Lens
GetAssetPropertyValue
GetAssetPropertyValue
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAssetPropertyValue' {Maybe Text
propertyId :: Maybe Text
$sel:propertyId:GetAssetPropertyValue' :: GetAssetPropertyValue -> Maybe Text
propertyId} -> Maybe Text
propertyId) (\s :: GetAssetPropertyValue
s@GetAssetPropertyValue' {} Maybe Text
a -> GetAssetPropertyValue
s {$sel:propertyId:GetAssetPropertyValue' :: Maybe Text
propertyId = Maybe Text
a} :: GetAssetPropertyValue)
getAssetPropertyValue_assetId :: Lens.Lens' GetAssetPropertyValue (Prelude.Maybe Prelude.Text)
getAssetPropertyValue_assetId :: (Maybe Text -> f (Maybe Text))
-> GetAssetPropertyValue -> f GetAssetPropertyValue
getAssetPropertyValue_assetId = (GetAssetPropertyValue -> Maybe Text)
-> (GetAssetPropertyValue -> Maybe Text -> GetAssetPropertyValue)
-> Lens
GetAssetPropertyValue
GetAssetPropertyValue
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAssetPropertyValue' {Maybe Text
assetId :: Maybe Text
$sel:assetId:GetAssetPropertyValue' :: GetAssetPropertyValue -> Maybe Text
assetId} -> Maybe Text
assetId) (\s :: GetAssetPropertyValue
s@GetAssetPropertyValue' {} Maybe Text
a -> GetAssetPropertyValue
s {$sel:assetId:GetAssetPropertyValue' :: Maybe Text
assetId = Maybe Text
a} :: GetAssetPropertyValue)
instance Core.AWSRequest GetAssetPropertyValue where
type
AWSResponse GetAssetPropertyValue =
GetAssetPropertyValueResponse
request :: GetAssetPropertyValue -> Request GetAssetPropertyValue
request = Service -> GetAssetPropertyValue -> Request GetAssetPropertyValue
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy GetAssetPropertyValue
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetAssetPropertyValue)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse GetAssetPropertyValue))
-> Logger
-> Service
-> Proxy GetAssetPropertyValue
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetAssetPropertyValue)))
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 AssetPropertyValue -> Int -> GetAssetPropertyValueResponse
GetAssetPropertyValueResponse'
(Maybe AssetPropertyValue -> Int -> GetAssetPropertyValueResponse)
-> Either String (Maybe AssetPropertyValue)
-> Either String (Int -> GetAssetPropertyValueResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe AssetPropertyValue)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"propertyValue")
Either String (Int -> GetAssetPropertyValueResponse)
-> Either String Int -> Either String GetAssetPropertyValueResponse
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 GetAssetPropertyValue
instance Prelude.NFData GetAssetPropertyValue
instance Core.ToHeaders GetAssetPropertyValue where
toHeaders :: GetAssetPropertyValue -> ResponseHeaders
toHeaders =
ResponseHeaders -> GetAssetPropertyValue -> 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 GetAssetPropertyValue where
toPath :: GetAssetPropertyValue -> ByteString
toPath = ByteString -> GetAssetPropertyValue -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/properties/latest"
instance Core.ToQuery GetAssetPropertyValue where
toQuery :: GetAssetPropertyValue -> QueryString
toQuery GetAssetPropertyValue' {Maybe Text
assetId :: Maybe Text
propertyId :: Maybe Text
propertyAlias :: Maybe Text
$sel:assetId:GetAssetPropertyValue' :: GetAssetPropertyValue -> Maybe Text
$sel:propertyId:GetAssetPropertyValue' :: GetAssetPropertyValue -> Maybe Text
$sel:propertyAlias:GetAssetPropertyValue' :: GetAssetPropertyValue -> Maybe Text
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"propertyAlias" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
propertyAlias,
ByteString
"propertyId" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
propertyId,
ByteString
"assetId" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
assetId
]
data GetAssetPropertyValueResponse = GetAssetPropertyValueResponse'
{
GetAssetPropertyValueResponse -> Maybe AssetPropertyValue
propertyValue :: Prelude.Maybe AssetPropertyValue,
GetAssetPropertyValueResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetAssetPropertyValueResponse
-> GetAssetPropertyValueResponse -> Bool
(GetAssetPropertyValueResponse
-> GetAssetPropertyValueResponse -> Bool)
-> (GetAssetPropertyValueResponse
-> GetAssetPropertyValueResponse -> Bool)
-> Eq GetAssetPropertyValueResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetAssetPropertyValueResponse
-> GetAssetPropertyValueResponse -> Bool
$c/= :: GetAssetPropertyValueResponse
-> GetAssetPropertyValueResponse -> Bool
== :: GetAssetPropertyValueResponse
-> GetAssetPropertyValueResponse -> Bool
$c== :: GetAssetPropertyValueResponse
-> GetAssetPropertyValueResponse -> Bool
Prelude.Eq, ReadPrec [GetAssetPropertyValueResponse]
ReadPrec GetAssetPropertyValueResponse
Int -> ReadS GetAssetPropertyValueResponse
ReadS [GetAssetPropertyValueResponse]
(Int -> ReadS GetAssetPropertyValueResponse)
-> ReadS [GetAssetPropertyValueResponse]
-> ReadPrec GetAssetPropertyValueResponse
-> ReadPrec [GetAssetPropertyValueResponse]
-> Read GetAssetPropertyValueResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetAssetPropertyValueResponse]
$creadListPrec :: ReadPrec [GetAssetPropertyValueResponse]
readPrec :: ReadPrec GetAssetPropertyValueResponse
$creadPrec :: ReadPrec GetAssetPropertyValueResponse
readList :: ReadS [GetAssetPropertyValueResponse]
$creadList :: ReadS [GetAssetPropertyValueResponse]
readsPrec :: Int -> ReadS GetAssetPropertyValueResponse
$creadsPrec :: Int -> ReadS GetAssetPropertyValueResponse
Prelude.Read, Int -> GetAssetPropertyValueResponse -> ShowS
[GetAssetPropertyValueResponse] -> ShowS
GetAssetPropertyValueResponse -> String
(Int -> GetAssetPropertyValueResponse -> ShowS)
-> (GetAssetPropertyValueResponse -> String)
-> ([GetAssetPropertyValueResponse] -> ShowS)
-> Show GetAssetPropertyValueResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetAssetPropertyValueResponse] -> ShowS
$cshowList :: [GetAssetPropertyValueResponse] -> ShowS
show :: GetAssetPropertyValueResponse -> String
$cshow :: GetAssetPropertyValueResponse -> String
showsPrec :: Int -> GetAssetPropertyValueResponse -> ShowS
$cshowsPrec :: Int -> GetAssetPropertyValueResponse -> ShowS
Prelude.Show, (forall x.
GetAssetPropertyValueResponse
-> Rep GetAssetPropertyValueResponse x)
-> (forall x.
Rep GetAssetPropertyValueResponse x
-> GetAssetPropertyValueResponse)
-> Generic GetAssetPropertyValueResponse
forall x.
Rep GetAssetPropertyValueResponse x
-> GetAssetPropertyValueResponse
forall x.
GetAssetPropertyValueResponse
-> Rep GetAssetPropertyValueResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetAssetPropertyValueResponse x
-> GetAssetPropertyValueResponse
$cfrom :: forall x.
GetAssetPropertyValueResponse
-> Rep GetAssetPropertyValueResponse x
Prelude.Generic)
newGetAssetPropertyValueResponse ::
Prelude.Int ->
GetAssetPropertyValueResponse
newGetAssetPropertyValueResponse :: Int -> GetAssetPropertyValueResponse
newGetAssetPropertyValueResponse Int
pHttpStatus_ =
GetAssetPropertyValueResponse' :: Maybe AssetPropertyValue -> Int -> GetAssetPropertyValueResponse
GetAssetPropertyValueResponse'
{ $sel:propertyValue:GetAssetPropertyValueResponse' :: Maybe AssetPropertyValue
propertyValue =
Maybe AssetPropertyValue
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetAssetPropertyValueResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getAssetPropertyValueResponse_propertyValue :: Lens.Lens' GetAssetPropertyValueResponse (Prelude.Maybe AssetPropertyValue)
getAssetPropertyValueResponse_propertyValue :: (Maybe AssetPropertyValue -> f (Maybe AssetPropertyValue))
-> GetAssetPropertyValueResponse -> f GetAssetPropertyValueResponse
getAssetPropertyValueResponse_propertyValue = (GetAssetPropertyValueResponse -> Maybe AssetPropertyValue)
-> (GetAssetPropertyValueResponse
-> Maybe AssetPropertyValue -> GetAssetPropertyValueResponse)
-> Lens
GetAssetPropertyValueResponse
GetAssetPropertyValueResponse
(Maybe AssetPropertyValue)
(Maybe AssetPropertyValue)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAssetPropertyValueResponse' {Maybe AssetPropertyValue
propertyValue :: Maybe AssetPropertyValue
$sel:propertyValue:GetAssetPropertyValueResponse' :: GetAssetPropertyValueResponse -> Maybe AssetPropertyValue
propertyValue} -> Maybe AssetPropertyValue
propertyValue) (\s :: GetAssetPropertyValueResponse
s@GetAssetPropertyValueResponse' {} Maybe AssetPropertyValue
a -> GetAssetPropertyValueResponse
s {$sel:propertyValue:GetAssetPropertyValueResponse' :: Maybe AssetPropertyValue
propertyValue = Maybe AssetPropertyValue
a} :: GetAssetPropertyValueResponse)
getAssetPropertyValueResponse_httpStatus :: Lens.Lens' GetAssetPropertyValueResponse Prelude.Int
getAssetPropertyValueResponse_httpStatus :: (Int -> f Int)
-> GetAssetPropertyValueResponse -> f GetAssetPropertyValueResponse
getAssetPropertyValueResponse_httpStatus = (GetAssetPropertyValueResponse -> Int)
-> (GetAssetPropertyValueResponse
-> Int -> GetAssetPropertyValueResponse)
-> Lens
GetAssetPropertyValueResponse GetAssetPropertyValueResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAssetPropertyValueResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetAssetPropertyValueResponse' :: GetAssetPropertyValueResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetAssetPropertyValueResponse
s@GetAssetPropertyValueResponse' {} Int
a -> GetAssetPropertyValueResponse
s {$sel:httpStatus:GetAssetPropertyValueResponse' :: Int
httpStatus = Int
a} :: GetAssetPropertyValueResponse)
instance Prelude.NFData GetAssetPropertyValueResponse