{-# 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.BatchPutAssetPropertyValue
(
BatchPutAssetPropertyValue (..),
newBatchPutAssetPropertyValue,
batchPutAssetPropertyValue_entries,
BatchPutAssetPropertyValueResponse (..),
newBatchPutAssetPropertyValueResponse,
batchPutAssetPropertyValueResponse_httpStatus,
batchPutAssetPropertyValueResponse_errorEntries,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.IoTSiteWise.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data BatchPutAssetPropertyValue = BatchPutAssetPropertyValue'
{
BatchPutAssetPropertyValue -> [PutAssetPropertyValueEntry]
entries :: [PutAssetPropertyValueEntry]
}
deriving (BatchPutAssetPropertyValue -> BatchPutAssetPropertyValue -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchPutAssetPropertyValue -> BatchPutAssetPropertyValue -> Bool
$c/= :: BatchPutAssetPropertyValue -> BatchPutAssetPropertyValue -> Bool
== :: BatchPutAssetPropertyValue -> BatchPutAssetPropertyValue -> Bool
$c== :: BatchPutAssetPropertyValue -> BatchPutAssetPropertyValue -> Bool
Prelude.Eq, ReadPrec [BatchPutAssetPropertyValue]
ReadPrec BatchPutAssetPropertyValue
Int -> ReadS BatchPutAssetPropertyValue
ReadS [BatchPutAssetPropertyValue]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchPutAssetPropertyValue]
$creadListPrec :: ReadPrec [BatchPutAssetPropertyValue]
readPrec :: ReadPrec BatchPutAssetPropertyValue
$creadPrec :: ReadPrec BatchPutAssetPropertyValue
readList :: ReadS [BatchPutAssetPropertyValue]
$creadList :: ReadS [BatchPutAssetPropertyValue]
readsPrec :: Int -> ReadS BatchPutAssetPropertyValue
$creadsPrec :: Int -> ReadS BatchPutAssetPropertyValue
Prelude.Read, Int -> BatchPutAssetPropertyValue -> ShowS
[BatchPutAssetPropertyValue] -> ShowS
BatchPutAssetPropertyValue -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchPutAssetPropertyValue] -> ShowS
$cshowList :: [BatchPutAssetPropertyValue] -> ShowS
show :: BatchPutAssetPropertyValue -> String
$cshow :: BatchPutAssetPropertyValue -> String
showsPrec :: Int -> BatchPutAssetPropertyValue -> ShowS
$cshowsPrec :: Int -> BatchPutAssetPropertyValue -> ShowS
Prelude.Show, forall x.
Rep BatchPutAssetPropertyValue x -> BatchPutAssetPropertyValue
forall x.
BatchPutAssetPropertyValue -> Rep BatchPutAssetPropertyValue x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BatchPutAssetPropertyValue x -> BatchPutAssetPropertyValue
$cfrom :: forall x.
BatchPutAssetPropertyValue -> Rep BatchPutAssetPropertyValue x
Prelude.Generic)
newBatchPutAssetPropertyValue ::
BatchPutAssetPropertyValue
newBatchPutAssetPropertyValue :: BatchPutAssetPropertyValue
newBatchPutAssetPropertyValue =
BatchPutAssetPropertyValue'
{ $sel:entries:BatchPutAssetPropertyValue' :: [PutAssetPropertyValueEntry]
entries =
forall a. Monoid a => a
Prelude.mempty
}
batchPutAssetPropertyValue_entries :: Lens.Lens' BatchPutAssetPropertyValue [PutAssetPropertyValueEntry]
batchPutAssetPropertyValue_entries :: Lens' BatchPutAssetPropertyValue [PutAssetPropertyValueEntry]
batchPutAssetPropertyValue_entries = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchPutAssetPropertyValue' {[PutAssetPropertyValueEntry]
entries :: [PutAssetPropertyValueEntry]
$sel:entries:BatchPutAssetPropertyValue' :: BatchPutAssetPropertyValue -> [PutAssetPropertyValueEntry]
entries} -> [PutAssetPropertyValueEntry]
entries) (\s :: BatchPutAssetPropertyValue
s@BatchPutAssetPropertyValue' {} [PutAssetPropertyValueEntry]
a -> BatchPutAssetPropertyValue
s {$sel:entries:BatchPutAssetPropertyValue' :: [PutAssetPropertyValueEntry]
entries = [PutAssetPropertyValueEntry]
a} :: BatchPutAssetPropertyValue) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.AWSRequest BatchPutAssetPropertyValue where
type
AWSResponse BatchPutAssetPropertyValue =
BatchPutAssetPropertyValueResponse
request :: (Service -> Service)
-> BatchPutAssetPropertyValue -> Request BatchPutAssetPropertyValue
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy BatchPutAssetPropertyValue
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse BatchPutAssetPropertyValue)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Int
-> [BatchPutAssetPropertyErrorEntry]
-> BatchPutAssetPropertyValueResponse
BatchPutAssetPropertyValueResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"errorEntries" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable BatchPutAssetPropertyValue where
hashWithSalt :: Int -> BatchPutAssetPropertyValue -> Int
hashWithSalt Int
_salt BatchPutAssetPropertyValue' {[PutAssetPropertyValueEntry]
entries :: [PutAssetPropertyValueEntry]
$sel:entries:BatchPutAssetPropertyValue' :: BatchPutAssetPropertyValue -> [PutAssetPropertyValueEntry]
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` [PutAssetPropertyValueEntry]
entries
instance Prelude.NFData BatchPutAssetPropertyValue where
rnf :: BatchPutAssetPropertyValue -> ()
rnf BatchPutAssetPropertyValue' {[PutAssetPropertyValueEntry]
entries :: [PutAssetPropertyValueEntry]
$sel:entries:BatchPutAssetPropertyValue' :: BatchPutAssetPropertyValue -> [PutAssetPropertyValueEntry]
..} =
forall a. NFData a => a -> ()
Prelude.rnf [PutAssetPropertyValueEntry]
entries
instance Data.ToHeaders BatchPutAssetPropertyValue where
toHeaders :: BatchPutAssetPropertyValue -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON BatchPutAssetPropertyValue where
toJSON :: BatchPutAssetPropertyValue -> Value
toJSON BatchPutAssetPropertyValue' {[PutAssetPropertyValueEntry]
entries :: [PutAssetPropertyValueEntry]
$sel:entries:BatchPutAssetPropertyValue' :: BatchPutAssetPropertyValue -> [PutAssetPropertyValueEntry]
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[forall a. a -> Maybe a
Prelude.Just (Key
"entries" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= [PutAssetPropertyValueEntry]
entries)]
)
instance Data.ToPath BatchPutAssetPropertyValue where
toPath :: BatchPutAssetPropertyValue -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/properties"
instance Data.ToQuery BatchPutAssetPropertyValue where
toQuery :: BatchPutAssetPropertyValue -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data BatchPutAssetPropertyValueResponse = BatchPutAssetPropertyValueResponse'
{
BatchPutAssetPropertyValueResponse -> Int
httpStatus :: Prelude.Int,
BatchPutAssetPropertyValueResponse
-> [BatchPutAssetPropertyErrorEntry]
errorEntries :: [BatchPutAssetPropertyErrorEntry]
}
deriving (BatchPutAssetPropertyValueResponse
-> BatchPutAssetPropertyValueResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchPutAssetPropertyValueResponse
-> BatchPutAssetPropertyValueResponse -> Bool
$c/= :: BatchPutAssetPropertyValueResponse
-> BatchPutAssetPropertyValueResponse -> Bool
== :: BatchPutAssetPropertyValueResponse
-> BatchPutAssetPropertyValueResponse -> Bool
$c== :: BatchPutAssetPropertyValueResponse
-> BatchPutAssetPropertyValueResponse -> Bool
Prelude.Eq, ReadPrec [BatchPutAssetPropertyValueResponse]
ReadPrec BatchPutAssetPropertyValueResponse
Int -> ReadS BatchPutAssetPropertyValueResponse
ReadS [BatchPutAssetPropertyValueResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchPutAssetPropertyValueResponse]
$creadListPrec :: ReadPrec [BatchPutAssetPropertyValueResponse]
readPrec :: ReadPrec BatchPutAssetPropertyValueResponse
$creadPrec :: ReadPrec BatchPutAssetPropertyValueResponse
readList :: ReadS [BatchPutAssetPropertyValueResponse]
$creadList :: ReadS [BatchPutAssetPropertyValueResponse]
readsPrec :: Int -> ReadS BatchPutAssetPropertyValueResponse
$creadsPrec :: Int -> ReadS BatchPutAssetPropertyValueResponse
Prelude.Read, Int -> BatchPutAssetPropertyValueResponse -> ShowS
[BatchPutAssetPropertyValueResponse] -> ShowS
BatchPutAssetPropertyValueResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchPutAssetPropertyValueResponse] -> ShowS
$cshowList :: [BatchPutAssetPropertyValueResponse] -> ShowS
show :: BatchPutAssetPropertyValueResponse -> String
$cshow :: BatchPutAssetPropertyValueResponse -> String
showsPrec :: Int -> BatchPutAssetPropertyValueResponse -> ShowS
$cshowsPrec :: Int -> BatchPutAssetPropertyValueResponse -> ShowS
Prelude.Show, forall x.
Rep BatchPutAssetPropertyValueResponse x
-> BatchPutAssetPropertyValueResponse
forall x.
BatchPutAssetPropertyValueResponse
-> Rep BatchPutAssetPropertyValueResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BatchPutAssetPropertyValueResponse x
-> BatchPutAssetPropertyValueResponse
$cfrom :: forall x.
BatchPutAssetPropertyValueResponse
-> Rep BatchPutAssetPropertyValueResponse x
Prelude.Generic)
newBatchPutAssetPropertyValueResponse ::
Prelude.Int ->
BatchPutAssetPropertyValueResponse
newBatchPutAssetPropertyValueResponse :: Int -> BatchPutAssetPropertyValueResponse
newBatchPutAssetPropertyValueResponse Int
pHttpStatus_ =
BatchPutAssetPropertyValueResponse'
{ $sel:httpStatus:BatchPutAssetPropertyValueResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:errorEntries:BatchPutAssetPropertyValueResponse' :: [BatchPutAssetPropertyErrorEntry]
errorEntries = forall a. Monoid a => a
Prelude.mempty
}
batchPutAssetPropertyValueResponse_httpStatus :: Lens.Lens' BatchPutAssetPropertyValueResponse Prelude.Int
batchPutAssetPropertyValueResponse_httpStatus :: Lens' BatchPutAssetPropertyValueResponse Int
batchPutAssetPropertyValueResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchPutAssetPropertyValueResponse' {Int
httpStatus :: Int
$sel:httpStatus:BatchPutAssetPropertyValueResponse' :: BatchPutAssetPropertyValueResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: BatchPutAssetPropertyValueResponse
s@BatchPutAssetPropertyValueResponse' {} Int
a -> BatchPutAssetPropertyValueResponse
s {$sel:httpStatus:BatchPutAssetPropertyValueResponse' :: Int
httpStatus = Int
a} :: BatchPutAssetPropertyValueResponse)
batchPutAssetPropertyValueResponse_errorEntries :: Lens.Lens' BatchPutAssetPropertyValueResponse [BatchPutAssetPropertyErrorEntry]
batchPutAssetPropertyValueResponse_errorEntries :: Lens'
BatchPutAssetPropertyValueResponse
[BatchPutAssetPropertyErrorEntry]
batchPutAssetPropertyValueResponse_errorEntries = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchPutAssetPropertyValueResponse' {[BatchPutAssetPropertyErrorEntry]
errorEntries :: [BatchPutAssetPropertyErrorEntry]
$sel:errorEntries:BatchPutAssetPropertyValueResponse' :: BatchPutAssetPropertyValueResponse
-> [BatchPutAssetPropertyErrorEntry]
errorEntries} -> [BatchPutAssetPropertyErrorEntry]
errorEntries) (\s :: BatchPutAssetPropertyValueResponse
s@BatchPutAssetPropertyValueResponse' {} [BatchPutAssetPropertyErrorEntry]
a -> BatchPutAssetPropertyValueResponse
s {$sel:errorEntries:BatchPutAssetPropertyValueResponse' :: [BatchPutAssetPropertyErrorEntry]
errorEntries = [BatchPutAssetPropertyErrorEntry]
a} :: BatchPutAssetPropertyValueResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance
Prelude.NFData
BatchPutAssetPropertyValueResponse
where
rnf :: BatchPutAssetPropertyValueResponse -> ()
rnf BatchPutAssetPropertyValueResponse' {Int
[BatchPutAssetPropertyErrorEntry]
errorEntries :: [BatchPutAssetPropertyErrorEntry]
httpStatus :: Int
$sel:errorEntries:BatchPutAssetPropertyValueResponse' :: BatchPutAssetPropertyValueResponse
-> [BatchPutAssetPropertyErrorEntry]
$sel:httpStatus:BatchPutAssetPropertyValueResponse' :: BatchPutAssetPropertyValueResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [BatchPutAssetPropertyErrorEntry]
errorEntries