{-# 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.IoTThingsGraph.UploadEntityDefinitions
(
UploadEntityDefinitions (..),
newUploadEntityDefinitions,
uploadEntityDefinitions_syncWithPublicNamespace,
uploadEntityDefinitions_deprecateExistingEntities,
uploadEntityDefinitions_document,
UploadEntityDefinitionsResponse (..),
newUploadEntityDefinitionsResponse,
uploadEntityDefinitionsResponse_httpStatus,
uploadEntityDefinitionsResponse_uploadId,
)
where
import qualified Amazonka.Core as Core
import Amazonka.IoTThingsGraph.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 UploadEntityDefinitions = UploadEntityDefinitions'
{
UploadEntityDefinitions -> Maybe Bool
syncWithPublicNamespace :: Prelude.Maybe Prelude.Bool,
UploadEntityDefinitions -> Maybe Bool
deprecateExistingEntities :: Prelude.Maybe Prelude.Bool,
UploadEntityDefinitions -> Maybe DefinitionDocument
document :: Prelude.Maybe DefinitionDocument
}
deriving (UploadEntityDefinitions -> UploadEntityDefinitions -> Bool
(UploadEntityDefinitions -> UploadEntityDefinitions -> Bool)
-> (UploadEntityDefinitions -> UploadEntityDefinitions -> Bool)
-> Eq UploadEntityDefinitions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UploadEntityDefinitions -> UploadEntityDefinitions -> Bool
$c/= :: UploadEntityDefinitions -> UploadEntityDefinitions -> Bool
== :: UploadEntityDefinitions -> UploadEntityDefinitions -> Bool
$c== :: UploadEntityDefinitions -> UploadEntityDefinitions -> Bool
Prelude.Eq, ReadPrec [UploadEntityDefinitions]
ReadPrec UploadEntityDefinitions
Int -> ReadS UploadEntityDefinitions
ReadS [UploadEntityDefinitions]
(Int -> ReadS UploadEntityDefinitions)
-> ReadS [UploadEntityDefinitions]
-> ReadPrec UploadEntityDefinitions
-> ReadPrec [UploadEntityDefinitions]
-> Read UploadEntityDefinitions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UploadEntityDefinitions]
$creadListPrec :: ReadPrec [UploadEntityDefinitions]
readPrec :: ReadPrec UploadEntityDefinitions
$creadPrec :: ReadPrec UploadEntityDefinitions
readList :: ReadS [UploadEntityDefinitions]
$creadList :: ReadS [UploadEntityDefinitions]
readsPrec :: Int -> ReadS UploadEntityDefinitions
$creadsPrec :: Int -> ReadS UploadEntityDefinitions
Prelude.Read, Int -> UploadEntityDefinitions -> ShowS
[UploadEntityDefinitions] -> ShowS
UploadEntityDefinitions -> String
(Int -> UploadEntityDefinitions -> ShowS)
-> (UploadEntityDefinitions -> String)
-> ([UploadEntityDefinitions] -> ShowS)
-> Show UploadEntityDefinitions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UploadEntityDefinitions] -> ShowS
$cshowList :: [UploadEntityDefinitions] -> ShowS
show :: UploadEntityDefinitions -> String
$cshow :: UploadEntityDefinitions -> String
showsPrec :: Int -> UploadEntityDefinitions -> ShowS
$cshowsPrec :: Int -> UploadEntityDefinitions -> ShowS
Prelude.Show, (forall x.
UploadEntityDefinitions -> Rep UploadEntityDefinitions x)
-> (forall x.
Rep UploadEntityDefinitions x -> UploadEntityDefinitions)
-> Generic UploadEntityDefinitions
forall x. Rep UploadEntityDefinitions x -> UploadEntityDefinitions
forall x. UploadEntityDefinitions -> Rep UploadEntityDefinitions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UploadEntityDefinitions x -> UploadEntityDefinitions
$cfrom :: forall x. UploadEntityDefinitions -> Rep UploadEntityDefinitions x
Prelude.Generic)
newUploadEntityDefinitions ::
UploadEntityDefinitions
newUploadEntityDefinitions :: UploadEntityDefinitions
newUploadEntityDefinitions =
UploadEntityDefinitions' :: Maybe Bool
-> Maybe Bool
-> Maybe DefinitionDocument
-> UploadEntityDefinitions
UploadEntityDefinitions'
{ $sel:syncWithPublicNamespace:UploadEntityDefinitions' :: Maybe Bool
syncWithPublicNamespace =
Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:deprecateExistingEntities:UploadEntityDefinitions' :: Maybe Bool
deprecateExistingEntities = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:document:UploadEntityDefinitions' :: Maybe DefinitionDocument
document = Maybe DefinitionDocument
forall a. Maybe a
Prelude.Nothing
}
uploadEntityDefinitions_syncWithPublicNamespace :: Lens.Lens' UploadEntityDefinitions (Prelude.Maybe Prelude.Bool)
uploadEntityDefinitions_syncWithPublicNamespace :: (Maybe Bool -> f (Maybe Bool))
-> UploadEntityDefinitions -> f UploadEntityDefinitions
uploadEntityDefinitions_syncWithPublicNamespace = (UploadEntityDefinitions -> Maybe Bool)
-> (UploadEntityDefinitions
-> Maybe Bool -> UploadEntityDefinitions)
-> Lens
UploadEntityDefinitions
UploadEntityDefinitions
(Maybe Bool)
(Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UploadEntityDefinitions' {Maybe Bool
syncWithPublicNamespace :: Maybe Bool
$sel:syncWithPublicNamespace:UploadEntityDefinitions' :: UploadEntityDefinitions -> Maybe Bool
syncWithPublicNamespace} -> Maybe Bool
syncWithPublicNamespace) (\s :: UploadEntityDefinitions
s@UploadEntityDefinitions' {} Maybe Bool
a -> UploadEntityDefinitions
s {$sel:syncWithPublicNamespace:UploadEntityDefinitions' :: Maybe Bool
syncWithPublicNamespace = Maybe Bool
a} :: UploadEntityDefinitions)
uploadEntityDefinitions_deprecateExistingEntities :: Lens.Lens' UploadEntityDefinitions (Prelude.Maybe Prelude.Bool)
uploadEntityDefinitions_deprecateExistingEntities :: (Maybe Bool -> f (Maybe Bool))
-> UploadEntityDefinitions -> f UploadEntityDefinitions
uploadEntityDefinitions_deprecateExistingEntities = (UploadEntityDefinitions -> Maybe Bool)
-> (UploadEntityDefinitions
-> Maybe Bool -> UploadEntityDefinitions)
-> Lens
UploadEntityDefinitions
UploadEntityDefinitions
(Maybe Bool)
(Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UploadEntityDefinitions' {Maybe Bool
deprecateExistingEntities :: Maybe Bool
$sel:deprecateExistingEntities:UploadEntityDefinitions' :: UploadEntityDefinitions -> Maybe Bool
deprecateExistingEntities} -> Maybe Bool
deprecateExistingEntities) (\s :: UploadEntityDefinitions
s@UploadEntityDefinitions' {} Maybe Bool
a -> UploadEntityDefinitions
s {$sel:deprecateExistingEntities:UploadEntityDefinitions' :: Maybe Bool
deprecateExistingEntities = Maybe Bool
a} :: UploadEntityDefinitions)
uploadEntityDefinitions_document :: Lens.Lens' UploadEntityDefinitions (Prelude.Maybe DefinitionDocument)
uploadEntityDefinitions_document :: (Maybe DefinitionDocument -> f (Maybe DefinitionDocument))
-> UploadEntityDefinitions -> f UploadEntityDefinitions
uploadEntityDefinitions_document = (UploadEntityDefinitions -> Maybe DefinitionDocument)
-> (UploadEntityDefinitions
-> Maybe DefinitionDocument -> UploadEntityDefinitions)
-> Lens
UploadEntityDefinitions
UploadEntityDefinitions
(Maybe DefinitionDocument)
(Maybe DefinitionDocument)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UploadEntityDefinitions' {Maybe DefinitionDocument
document :: Maybe DefinitionDocument
$sel:document:UploadEntityDefinitions' :: UploadEntityDefinitions -> Maybe DefinitionDocument
document} -> Maybe DefinitionDocument
document) (\s :: UploadEntityDefinitions
s@UploadEntityDefinitions' {} Maybe DefinitionDocument
a -> UploadEntityDefinitions
s {$sel:document:UploadEntityDefinitions' :: Maybe DefinitionDocument
document = Maybe DefinitionDocument
a} :: UploadEntityDefinitions)
instance Core.AWSRequest UploadEntityDefinitions where
type
AWSResponse UploadEntityDefinitions =
UploadEntityDefinitionsResponse
request :: UploadEntityDefinitions -> Request UploadEntityDefinitions
request = Service
-> UploadEntityDefinitions -> Request UploadEntityDefinitions
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UploadEntityDefinitions
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UploadEntityDefinitions)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse UploadEntityDefinitions))
-> Logger
-> Service
-> Proxy UploadEntityDefinitions
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UploadEntityDefinitions)))
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 -> Text -> UploadEntityDefinitionsResponse
UploadEntityDefinitionsResponse'
(Int -> Text -> UploadEntityDefinitionsResponse)
-> Either String Int
-> Either String (Text -> UploadEntityDefinitionsResponse)
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 (Text -> UploadEntityDefinitionsResponse)
-> Either String Text
-> Either String UploadEntityDefinitionsResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Text
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"uploadId")
)
instance Prelude.Hashable UploadEntityDefinitions
instance Prelude.NFData UploadEntityDefinitions
instance Core.ToHeaders UploadEntityDefinitions where
toHeaders :: UploadEntityDefinitions -> ResponseHeaders
toHeaders =
ResponseHeaders -> UploadEntityDefinitions -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"IotThingsGraphFrontEndService.UploadEntityDefinitions" ::
Prelude.ByteString
),
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 UploadEntityDefinitions where
toJSON :: UploadEntityDefinitions -> Value
toJSON UploadEntityDefinitions' {Maybe Bool
Maybe DefinitionDocument
document :: Maybe DefinitionDocument
deprecateExistingEntities :: Maybe Bool
syncWithPublicNamespace :: Maybe Bool
$sel:document:UploadEntityDefinitions' :: UploadEntityDefinitions -> Maybe DefinitionDocument
$sel:deprecateExistingEntities:UploadEntityDefinitions' :: UploadEntityDefinitions -> Maybe Bool
$sel:syncWithPublicNamespace:UploadEntityDefinitions' :: UploadEntityDefinitions -> Maybe Bool
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"syncWithPublicNamespace" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
syncWithPublicNamespace,
(Text
"deprecateExistingEntities" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
deprecateExistingEntities,
(Text
"document" Text -> DefinitionDocument -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (DefinitionDocument -> Pair)
-> Maybe DefinitionDocument -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe DefinitionDocument
document
]
)
instance Core.ToPath UploadEntityDefinitions where
toPath :: UploadEntityDefinitions -> ByteString
toPath = ByteString -> UploadEntityDefinitions -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery UploadEntityDefinitions where
toQuery :: UploadEntityDefinitions -> QueryString
toQuery = QueryString -> UploadEntityDefinitions -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data UploadEntityDefinitionsResponse = UploadEntityDefinitionsResponse'
{
UploadEntityDefinitionsResponse -> Int
httpStatus :: Prelude.Int,
UploadEntityDefinitionsResponse -> Text
uploadId :: Prelude.Text
}
deriving (UploadEntityDefinitionsResponse
-> UploadEntityDefinitionsResponse -> Bool
(UploadEntityDefinitionsResponse
-> UploadEntityDefinitionsResponse -> Bool)
-> (UploadEntityDefinitionsResponse
-> UploadEntityDefinitionsResponse -> Bool)
-> Eq UploadEntityDefinitionsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UploadEntityDefinitionsResponse
-> UploadEntityDefinitionsResponse -> Bool
$c/= :: UploadEntityDefinitionsResponse
-> UploadEntityDefinitionsResponse -> Bool
== :: UploadEntityDefinitionsResponse
-> UploadEntityDefinitionsResponse -> Bool
$c== :: UploadEntityDefinitionsResponse
-> UploadEntityDefinitionsResponse -> Bool
Prelude.Eq, ReadPrec [UploadEntityDefinitionsResponse]
ReadPrec UploadEntityDefinitionsResponse
Int -> ReadS UploadEntityDefinitionsResponse
ReadS [UploadEntityDefinitionsResponse]
(Int -> ReadS UploadEntityDefinitionsResponse)
-> ReadS [UploadEntityDefinitionsResponse]
-> ReadPrec UploadEntityDefinitionsResponse
-> ReadPrec [UploadEntityDefinitionsResponse]
-> Read UploadEntityDefinitionsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UploadEntityDefinitionsResponse]
$creadListPrec :: ReadPrec [UploadEntityDefinitionsResponse]
readPrec :: ReadPrec UploadEntityDefinitionsResponse
$creadPrec :: ReadPrec UploadEntityDefinitionsResponse
readList :: ReadS [UploadEntityDefinitionsResponse]
$creadList :: ReadS [UploadEntityDefinitionsResponse]
readsPrec :: Int -> ReadS UploadEntityDefinitionsResponse
$creadsPrec :: Int -> ReadS UploadEntityDefinitionsResponse
Prelude.Read, Int -> UploadEntityDefinitionsResponse -> ShowS
[UploadEntityDefinitionsResponse] -> ShowS
UploadEntityDefinitionsResponse -> String
(Int -> UploadEntityDefinitionsResponse -> ShowS)
-> (UploadEntityDefinitionsResponse -> String)
-> ([UploadEntityDefinitionsResponse] -> ShowS)
-> Show UploadEntityDefinitionsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UploadEntityDefinitionsResponse] -> ShowS
$cshowList :: [UploadEntityDefinitionsResponse] -> ShowS
show :: UploadEntityDefinitionsResponse -> String
$cshow :: UploadEntityDefinitionsResponse -> String
showsPrec :: Int -> UploadEntityDefinitionsResponse -> ShowS
$cshowsPrec :: Int -> UploadEntityDefinitionsResponse -> ShowS
Prelude.Show, (forall x.
UploadEntityDefinitionsResponse
-> Rep UploadEntityDefinitionsResponse x)
-> (forall x.
Rep UploadEntityDefinitionsResponse x
-> UploadEntityDefinitionsResponse)
-> Generic UploadEntityDefinitionsResponse
forall x.
Rep UploadEntityDefinitionsResponse x
-> UploadEntityDefinitionsResponse
forall x.
UploadEntityDefinitionsResponse
-> Rep UploadEntityDefinitionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UploadEntityDefinitionsResponse x
-> UploadEntityDefinitionsResponse
$cfrom :: forall x.
UploadEntityDefinitionsResponse
-> Rep UploadEntityDefinitionsResponse x
Prelude.Generic)
newUploadEntityDefinitionsResponse ::
Prelude.Int ->
Prelude.Text ->
UploadEntityDefinitionsResponse
newUploadEntityDefinitionsResponse :: Int -> Text -> UploadEntityDefinitionsResponse
newUploadEntityDefinitionsResponse
Int
pHttpStatus_
Text
pUploadId_ =
UploadEntityDefinitionsResponse' :: Int -> Text -> UploadEntityDefinitionsResponse
UploadEntityDefinitionsResponse'
{ $sel:httpStatus:UploadEntityDefinitionsResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:uploadId:UploadEntityDefinitionsResponse' :: Text
uploadId = Text
pUploadId_
}
uploadEntityDefinitionsResponse_httpStatus :: Lens.Lens' UploadEntityDefinitionsResponse Prelude.Int
uploadEntityDefinitionsResponse_httpStatus :: (Int -> f Int)
-> UploadEntityDefinitionsResponse
-> f UploadEntityDefinitionsResponse
uploadEntityDefinitionsResponse_httpStatus = (UploadEntityDefinitionsResponse -> Int)
-> (UploadEntityDefinitionsResponse
-> Int -> UploadEntityDefinitionsResponse)
-> Lens
UploadEntityDefinitionsResponse
UploadEntityDefinitionsResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UploadEntityDefinitionsResponse' {Int
httpStatus :: Int
$sel:httpStatus:UploadEntityDefinitionsResponse' :: UploadEntityDefinitionsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UploadEntityDefinitionsResponse
s@UploadEntityDefinitionsResponse' {} Int
a -> UploadEntityDefinitionsResponse
s {$sel:httpStatus:UploadEntityDefinitionsResponse' :: Int
httpStatus = Int
a} :: UploadEntityDefinitionsResponse)
uploadEntityDefinitionsResponse_uploadId :: Lens.Lens' UploadEntityDefinitionsResponse Prelude.Text
uploadEntityDefinitionsResponse_uploadId :: (Text -> f Text)
-> UploadEntityDefinitionsResponse
-> f UploadEntityDefinitionsResponse
uploadEntityDefinitionsResponse_uploadId = (UploadEntityDefinitionsResponse -> Text)
-> (UploadEntityDefinitionsResponse
-> Text -> UploadEntityDefinitionsResponse)
-> Lens
UploadEntityDefinitionsResponse
UploadEntityDefinitionsResponse
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UploadEntityDefinitionsResponse' {Text
uploadId :: Text
$sel:uploadId:UploadEntityDefinitionsResponse' :: UploadEntityDefinitionsResponse -> Text
uploadId} -> Text
uploadId) (\s :: UploadEntityDefinitionsResponse
s@UploadEntityDefinitionsResponse' {} Text
a -> UploadEntityDefinitionsResponse
s {$sel:uploadId:UploadEntityDefinitionsResponse' :: Text
uploadId = Text
a} :: UploadEntityDefinitionsResponse)
instance
Prelude.NFData
UploadEntityDefinitionsResponse