{-# 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 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 BatchPutAssetPropertyValue = BatchPutAssetPropertyValue'
{
BatchPutAssetPropertyValue -> [PutAssetPropertyValueEntry]
entries :: [PutAssetPropertyValueEntry]
}
deriving (BatchPutAssetPropertyValue -> BatchPutAssetPropertyValue -> Bool
(BatchPutAssetPropertyValue -> BatchPutAssetPropertyValue -> Bool)
-> (BatchPutAssetPropertyValue
-> BatchPutAssetPropertyValue -> Bool)
-> Eq BatchPutAssetPropertyValue
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]
(Int -> ReadS BatchPutAssetPropertyValue)
-> ReadS [BatchPutAssetPropertyValue]
-> ReadPrec BatchPutAssetPropertyValue
-> ReadPrec [BatchPutAssetPropertyValue]
-> Read 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
(Int -> BatchPutAssetPropertyValue -> ShowS)
-> (BatchPutAssetPropertyValue -> String)
-> ([BatchPutAssetPropertyValue] -> ShowS)
-> Show BatchPutAssetPropertyValue
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.
BatchPutAssetPropertyValue -> Rep BatchPutAssetPropertyValue x)
-> (forall x.
Rep BatchPutAssetPropertyValue x -> BatchPutAssetPropertyValue)
-> Generic BatchPutAssetPropertyValue
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' :: [PutAssetPropertyValueEntry] -> BatchPutAssetPropertyValue
BatchPutAssetPropertyValue'
{ $sel:entries:BatchPutAssetPropertyValue' :: [PutAssetPropertyValueEntry]
entries =
[PutAssetPropertyValueEntry]
forall a. Monoid a => a
Prelude.mempty
}
batchPutAssetPropertyValue_entries :: Lens.Lens' BatchPutAssetPropertyValue [PutAssetPropertyValueEntry]
batchPutAssetPropertyValue_entries :: ([PutAssetPropertyValueEntry] -> f [PutAssetPropertyValueEntry])
-> BatchPutAssetPropertyValue -> f BatchPutAssetPropertyValue
batchPutAssetPropertyValue_entries = (BatchPutAssetPropertyValue -> [PutAssetPropertyValueEntry])
-> (BatchPutAssetPropertyValue
-> [PutAssetPropertyValueEntry] -> BatchPutAssetPropertyValue)
-> Lens
BatchPutAssetPropertyValue
BatchPutAssetPropertyValue
[PutAssetPropertyValueEntry]
[PutAssetPropertyValueEntry]
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) (([PutAssetPropertyValueEntry] -> f [PutAssetPropertyValueEntry])
-> BatchPutAssetPropertyValue -> f BatchPutAssetPropertyValue)
-> (([PutAssetPropertyValueEntry]
-> f [PutAssetPropertyValueEntry])
-> [PutAssetPropertyValueEntry] -> f [PutAssetPropertyValueEntry])
-> ([PutAssetPropertyValueEntry] -> f [PutAssetPropertyValueEntry])
-> BatchPutAssetPropertyValue
-> f BatchPutAssetPropertyValue
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([PutAssetPropertyValueEntry] -> f [PutAssetPropertyValueEntry])
-> [PutAssetPropertyValueEntry] -> f [PutAssetPropertyValueEntry]
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 :: BatchPutAssetPropertyValue -> Request BatchPutAssetPropertyValue
request = Service
-> BatchPutAssetPropertyValue -> Request BatchPutAssetPropertyValue
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy BatchPutAssetPropertyValue
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse BatchPutAssetPropertyValue)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse BatchPutAssetPropertyValue))
-> Logger
-> Service
-> Proxy BatchPutAssetPropertyValue
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse BatchPutAssetPropertyValue)))
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
-> [BatchPutAssetPropertyErrorEntry]
-> BatchPutAssetPropertyValueResponse
BatchPutAssetPropertyValueResponse'
(Int
-> [BatchPutAssetPropertyErrorEntry]
-> BatchPutAssetPropertyValueResponse)
-> Either String Int
-> Either
String
([BatchPutAssetPropertyErrorEntry]
-> BatchPutAssetPropertyValueResponse)
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
([BatchPutAssetPropertyErrorEntry]
-> BatchPutAssetPropertyValueResponse)
-> Either String [BatchPutAssetPropertyErrorEntry]
-> Either String BatchPutAssetPropertyValueResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Key -> Either String (Maybe [BatchPutAssetPropertyErrorEntry])
forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Core..?> Key
"errorEntries" Either String (Maybe [BatchPutAssetPropertyErrorEntry])
-> [BatchPutAssetPropertyErrorEntry]
-> Either String [BatchPutAssetPropertyErrorEntry]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [BatchPutAssetPropertyErrorEntry]
forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable BatchPutAssetPropertyValue
instance Prelude.NFData BatchPutAssetPropertyValue
instance Core.ToHeaders BatchPutAssetPropertyValue where
toHeaders :: BatchPutAssetPropertyValue -> ResponseHeaders
toHeaders =
ResponseHeaders -> BatchPutAssetPropertyValue -> 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.ToJSON BatchPutAssetPropertyValue where
toJSON :: BatchPutAssetPropertyValue -> Value
toJSON BatchPutAssetPropertyValue' {[PutAssetPropertyValueEntry]
entries :: [PutAssetPropertyValueEntry]
$sel:entries:BatchPutAssetPropertyValue' :: BatchPutAssetPropertyValue -> [PutAssetPropertyValueEntry]
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Key
"entries" Key -> [PutAssetPropertyValueEntry] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Core..= [PutAssetPropertyValueEntry]
entries)]
)
instance Core.ToPath BatchPutAssetPropertyValue where
toPath :: BatchPutAssetPropertyValue -> ByteString
toPath = ByteString -> BatchPutAssetPropertyValue -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/properties"
instance Core.ToQuery BatchPutAssetPropertyValue where
toQuery :: BatchPutAssetPropertyValue -> QueryString
toQuery = QueryString -> BatchPutAssetPropertyValue -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data BatchPutAssetPropertyValueResponse = BatchPutAssetPropertyValueResponse'
{
BatchPutAssetPropertyValueResponse -> Int
httpStatus :: Prelude.Int,
BatchPutAssetPropertyValueResponse
-> [BatchPutAssetPropertyErrorEntry]
errorEntries :: [BatchPutAssetPropertyErrorEntry]
}
deriving (BatchPutAssetPropertyValueResponse
-> BatchPutAssetPropertyValueResponse -> Bool
(BatchPutAssetPropertyValueResponse
-> BatchPutAssetPropertyValueResponse -> Bool)
-> (BatchPutAssetPropertyValueResponse
-> BatchPutAssetPropertyValueResponse -> Bool)
-> Eq BatchPutAssetPropertyValueResponse
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]
(Int -> ReadS BatchPutAssetPropertyValueResponse)
-> ReadS [BatchPutAssetPropertyValueResponse]
-> ReadPrec BatchPutAssetPropertyValueResponse
-> ReadPrec [BatchPutAssetPropertyValueResponse]
-> Read 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
(Int -> BatchPutAssetPropertyValueResponse -> ShowS)
-> (BatchPutAssetPropertyValueResponse -> String)
-> ([BatchPutAssetPropertyValueResponse] -> ShowS)
-> Show BatchPutAssetPropertyValueResponse
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.
BatchPutAssetPropertyValueResponse
-> Rep BatchPutAssetPropertyValueResponse x)
-> (forall x.
Rep BatchPutAssetPropertyValueResponse x
-> BatchPutAssetPropertyValueResponse)
-> Generic BatchPutAssetPropertyValueResponse
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' :: Int
-> [BatchPutAssetPropertyErrorEntry]
-> BatchPutAssetPropertyValueResponse
BatchPutAssetPropertyValueResponse'
{ $sel:httpStatus:BatchPutAssetPropertyValueResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:errorEntries:BatchPutAssetPropertyValueResponse' :: [BatchPutAssetPropertyErrorEntry]
errorEntries = [BatchPutAssetPropertyErrorEntry]
forall a. Monoid a => a
Prelude.mempty
}
batchPutAssetPropertyValueResponse_httpStatus :: Lens.Lens' BatchPutAssetPropertyValueResponse Prelude.Int
batchPutAssetPropertyValueResponse_httpStatus :: (Int -> f Int)
-> BatchPutAssetPropertyValueResponse
-> f BatchPutAssetPropertyValueResponse
batchPutAssetPropertyValueResponse_httpStatus = (BatchPutAssetPropertyValueResponse -> Int)
-> (BatchPutAssetPropertyValueResponse
-> Int -> BatchPutAssetPropertyValueResponse)
-> Lens
BatchPutAssetPropertyValueResponse
BatchPutAssetPropertyValueResponse
Int
Int
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 :: ([BatchPutAssetPropertyErrorEntry]
-> f [BatchPutAssetPropertyErrorEntry])
-> BatchPutAssetPropertyValueResponse
-> f BatchPutAssetPropertyValueResponse
batchPutAssetPropertyValueResponse_errorEntries = (BatchPutAssetPropertyValueResponse
-> [BatchPutAssetPropertyErrorEntry])
-> (BatchPutAssetPropertyValueResponse
-> [BatchPutAssetPropertyErrorEntry]
-> BatchPutAssetPropertyValueResponse)
-> Lens
BatchPutAssetPropertyValueResponse
BatchPutAssetPropertyValueResponse
[BatchPutAssetPropertyErrorEntry]
[BatchPutAssetPropertyErrorEntry]
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) (([BatchPutAssetPropertyErrorEntry]
-> f [BatchPutAssetPropertyErrorEntry])
-> BatchPutAssetPropertyValueResponse
-> f BatchPutAssetPropertyValueResponse)
-> (([BatchPutAssetPropertyErrorEntry]
-> f [BatchPutAssetPropertyErrorEntry])
-> [BatchPutAssetPropertyErrorEntry]
-> f [BatchPutAssetPropertyErrorEntry])
-> ([BatchPutAssetPropertyErrorEntry]
-> f [BatchPutAssetPropertyErrorEntry])
-> BatchPutAssetPropertyValueResponse
-> f BatchPutAssetPropertyValueResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([BatchPutAssetPropertyErrorEntry]
-> f [BatchPutAssetPropertyErrorEntry])
-> [BatchPutAssetPropertyErrorEntry]
-> f [BatchPutAssetPropertyErrorEntry]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance
Prelude.NFData
BatchPutAssetPropertyValueResponse