{-# 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.DeploySystemInstance
(
DeploySystemInstance (..),
newDeploySystemInstance,
deploySystemInstance_id,
DeploySystemInstanceResponse (..),
newDeploySystemInstanceResponse,
deploySystemInstanceResponse_greengrassDeploymentId,
deploySystemInstanceResponse_httpStatus,
deploySystemInstanceResponse_summary,
)
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 DeploySystemInstance = DeploySystemInstance'
{
DeploySystemInstance -> Maybe Text
id :: Prelude.Maybe Prelude.Text
}
deriving (DeploySystemInstance -> DeploySystemInstance -> Bool
(DeploySystemInstance -> DeploySystemInstance -> Bool)
-> (DeploySystemInstance -> DeploySystemInstance -> Bool)
-> Eq DeploySystemInstance
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeploySystemInstance -> DeploySystemInstance -> Bool
$c/= :: DeploySystemInstance -> DeploySystemInstance -> Bool
== :: DeploySystemInstance -> DeploySystemInstance -> Bool
$c== :: DeploySystemInstance -> DeploySystemInstance -> Bool
Prelude.Eq, ReadPrec [DeploySystemInstance]
ReadPrec DeploySystemInstance
Int -> ReadS DeploySystemInstance
ReadS [DeploySystemInstance]
(Int -> ReadS DeploySystemInstance)
-> ReadS [DeploySystemInstance]
-> ReadPrec DeploySystemInstance
-> ReadPrec [DeploySystemInstance]
-> Read DeploySystemInstance
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeploySystemInstance]
$creadListPrec :: ReadPrec [DeploySystemInstance]
readPrec :: ReadPrec DeploySystemInstance
$creadPrec :: ReadPrec DeploySystemInstance
readList :: ReadS [DeploySystemInstance]
$creadList :: ReadS [DeploySystemInstance]
readsPrec :: Int -> ReadS DeploySystemInstance
$creadsPrec :: Int -> ReadS DeploySystemInstance
Prelude.Read, Int -> DeploySystemInstance -> ShowS
[DeploySystemInstance] -> ShowS
DeploySystemInstance -> String
(Int -> DeploySystemInstance -> ShowS)
-> (DeploySystemInstance -> String)
-> ([DeploySystemInstance] -> ShowS)
-> Show DeploySystemInstance
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeploySystemInstance] -> ShowS
$cshowList :: [DeploySystemInstance] -> ShowS
show :: DeploySystemInstance -> String
$cshow :: DeploySystemInstance -> String
showsPrec :: Int -> DeploySystemInstance -> ShowS
$cshowsPrec :: Int -> DeploySystemInstance -> ShowS
Prelude.Show, (forall x. DeploySystemInstance -> Rep DeploySystemInstance x)
-> (forall x. Rep DeploySystemInstance x -> DeploySystemInstance)
-> Generic DeploySystemInstance
forall x. Rep DeploySystemInstance x -> DeploySystemInstance
forall x. DeploySystemInstance -> Rep DeploySystemInstance x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeploySystemInstance x -> DeploySystemInstance
$cfrom :: forall x. DeploySystemInstance -> Rep DeploySystemInstance x
Prelude.Generic)
newDeploySystemInstance ::
DeploySystemInstance
newDeploySystemInstance :: DeploySystemInstance
newDeploySystemInstance =
DeploySystemInstance' :: Maybe Text -> DeploySystemInstance
DeploySystemInstance' {$sel:id:DeploySystemInstance' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing}
deploySystemInstance_id :: Lens.Lens' DeploySystemInstance (Prelude.Maybe Prelude.Text)
deploySystemInstance_id :: (Maybe Text -> f (Maybe Text))
-> DeploySystemInstance -> f DeploySystemInstance
deploySystemInstance_id = (DeploySystemInstance -> Maybe Text)
-> (DeploySystemInstance -> Maybe Text -> DeploySystemInstance)
-> Lens
DeploySystemInstance DeploySystemInstance (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeploySystemInstance' {Maybe Text
id :: Maybe Text
$sel:id:DeploySystemInstance' :: DeploySystemInstance -> Maybe Text
id} -> Maybe Text
id) (\s :: DeploySystemInstance
s@DeploySystemInstance' {} Maybe Text
a -> DeploySystemInstance
s {$sel:id:DeploySystemInstance' :: Maybe Text
id = Maybe Text
a} :: DeploySystemInstance)
instance Core.AWSRequest DeploySystemInstance where
type
AWSResponse DeploySystemInstance =
DeploySystemInstanceResponse
request :: DeploySystemInstance -> Request DeploySystemInstance
request = Service -> DeploySystemInstance -> Request DeploySystemInstance
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DeploySystemInstance
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeploySystemInstance)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DeploySystemInstance))
-> Logger
-> Service
-> Proxy DeploySystemInstance
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeploySystemInstance)))
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 Text
-> Int -> SystemInstanceSummary -> DeploySystemInstanceResponse
DeploySystemInstanceResponse'
(Maybe Text
-> Int -> SystemInstanceSummary -> DeploySystemInstanceResponse)
-> Either String (Maybe Text)
-> Either
String
(Int -> SystemInstanceSummary -> DeploySystemInstanceResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"greengrassDeploymentId")
Either
String
(Int -> SystemInstanceSummary -> DeploySystemInstanceResponse)
-> Either String Int
-> Either
String (SystemInstanceSummary -> DeploySystemInstanceResponse)
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))
Either
String (SystemInstanceSummary -> DeploySystemInstanceResponse)
-> Either String SystemInstanceSummary
-> Either String DeploySystemInstanceResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String SystemInstanceSummary
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"summary")
)
instance Prelude.Hashable DeploySystemInstance
instance Prelude.NFData DeploySystemInstance
instance Core.ToHeaders DeploySystemInstance where
toHeaders :: DeploySystemInstance -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeploySystemInstance -> 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.DeploySystemInstance" ::
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 DeploySystemInstance where
toJSON :: DeploySystemInstance -> Value
toJSON DeploySystemInstance' {Maybe Text
id :: Maybe Text
$sel:id:DeploySystemInstance' :: DeploySystemInstance -> Maybe Text
..} =
[Pair] -> Value
Core.object
([Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes [(Text
"id" 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
id])
instance Core.ToPath DeploySystemInstance where
toPath :: DeploySystemInstance -> ByteString
toPath = ByteString -> DeploySystemInstance -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DeploySystemInstance where
toQuery :: DeploySystemInstance -> QueryString
toQuery = QueryString -> DeploySystemInstance -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeploySystemInstanceResponse = DeploySystemInstanceResponse'
{
DeploySystemInstanceResponse -> Maybe Text
greengrassDeploymentId :: Prelude.Maybe Prelude.Text,
DeploySystemInstanceResponse -> Int
httpStatus :: Prelude.Int,
DeploySystemInstanceResponse -> SystemInstanceSummary
summary :: SystemInstanceSummary
}
deriving (DeploySystemInstanceResponse
-> DeploySystemInstanceResponse -> Bool
(DeploySystemInstanceResponse
-> DeploySystemInstanceResponse -> Bool)
-> (DeploySystemInstanceResponse
-> DeploySystemInstanceResponse -> Bool)
-> Eq DeploySystemInstanceResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeploySystemInstanceResponse
-> DeploySystemInstanceResponse -> Bool
$c/= :: DeploySystemInstanceResponse
-> DeploySystemInstanceResponse -> Bool
== :: DeploySystemInstanceResponse
-> DeploySystemInstanceResponse -> Bool
$c== :: DeploySystemInstanceResponse
-> DeploySystemInstanceResponse -> Bool
Prelude.Eq, ReadPrec [DeploySystemInstanceResponse]
ReadPrec DeploySystemInstanceResponse
Int -> ReadS DeploySystemInstanceResponse
ReadS [DeploySystemInstanceResponse]
(Int -> ReadS DeploySystemInstanceResponse)
-> ReadS [DeploySystemInstanceResponse]
-> ReadPrec DeploySystemInstanceResponse
-> ReadPrec [DeploySystemInstanceResponse]
-> Read DeploySystemInstanceResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeploySystemInstanceResponse]
$creadListPrec :: ReadPrec [DeploySystemInstanceResponse]
readPrec :: ReadPrec DeploySystemInstanceResponse
$creadPrec :: ReadPrec DeploySystemInstanceResponse
readList :: ReadS [DeploySystemInstanceResponse]
$creadList :: ReadS [DeploySystemInstanceResponse]
readsPrec :: Int -> ReadS DeploySystemInstanceResponse
$creadsPrec :: Int -> ReadS DeploySystemInstanceResponse
Prelude.Read, Int -> DeploySystemInstanceResponse -> ShowS
[DeploySystemInstanceResponse] -> ShowS
DeploySystemInstanceResponse -> String
(Int -> DeploySystemInstanceResponse -> ShowS)
-> (DeploySystemInstanceResponse -> String)
-> ([DeploySystemInstanceResponse] -> ShowS)
-> Show DeploySystemInstanceResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeploySystemInstanceResponse] -> ShowS
$cshowList :: [DeploySystemInstanceResponse] -> ShowS
show :: DeploySystemInstanceResponse -> String
$cshow :: DeploySystemInstanceResponse -> String
showsPrec :: Int -> DeploySystemInstanceResponse -> ShowS
$cshowsPrec :: Int -> DeploySystemInstanceResponse -> ShowS
Prelude.Show, (forall x.
DeploySystemInstanceResponse -> Rep DeploySystemInstanceResponse x)
-> (forall x.
Rep DeploySystemInstanceResponse x -> DeploySystemInstanceResponse)
-> Generic DeploySystemInstanceResponse
forall x.
Rep DeploySystemInstanceResponse x -> DeploySystemInstanceResponse
forall x.
DeploySystemInstanceResponse -> Rep DeploySystemInstanceResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeploySystemInstanceResponse x -> DeploySystemInstanceResponse
$cfrom :: forall x.
DeploySystemInstanceResponse -> Rep DeploySystemInstanceResponse x
Prelude.Generic)
newDeploySystemInstanceResponse ::
Prelude.Int ->
SystemInstanceSummary ->
DeploySystemInstanceResponse
newDeploySystemInstanceResponse :: Int -> SystemInstanceSummary -> DeploySystemInstanceResponse
newDeploySystemInstanceResponse
Int
pHttpStatus_
SystemInstanceSummary
pSummary_ =
DeploySystemInstanceResponse' :: Maybe Text
-> Int -> SystemInstanceSummary -> DeploySystemInstanceResponse
DeploySystemInstanceResponse'
{ $sel:greengrassDeploymentId:DeploySystemInstanceResponse' :: Maybe Text
greengrassDeploymentId =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DeploySystemInstanceResponse' :: Int
httpStatus = Int
pHttpStatus_,
$sel:summary:DeploySystemInstanceResponse' :: SystemInstanceSummary
summary = SystemInstanceSummary
pSummary_
}
deploySystemInstanceResponse_greengrassDeploymentId :: Lens.Lens' DeploySystemInstanceResponse (Prelude.Maybe Prelude.Text)
deploySystemInstanceResponse_greengrassDeploymentId :: (Maybe Text -> f (Maybe Text))
-> DeploySystemInstanceResponse -> f DeploySystemInstanceResponse
deploySystemInstanceResponse_greengrassDeploymentId = (DeploySystemInstanceResponse -> Maybe Text)
-> (DeploySystemInstanceResponse
-> Maybe Text -> DeploySystemInstanceResponse)
-> Lens
DeploySystemInstanceResponse
DeploySystemInstanceResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeploySystemInstanceResponse' {Maybe Text
greengrassDeploymentId :: Maybe Text
$sel:greengrassDeploymentId:DeploySystemInstanceResponse' :: DeploySystemInstanceResponse -> Maybe Text
greengrassDeploymentId} -> Maybe Text
greengrassDeploymentId) (\s :: DeploySystemInstanceResponse
s@DeploySystemInstanceResponse' {} Maybe Text
a -> DeploySystemInstanceResponse
s {$sel:greengrassDeploymentId:DeploySystemInstanceResponse' :: Maybe Text
greengrassDeploymentId = Maybe Text
a} :: DeploySystemInstanceResponse)
deploySystemInstanceResponse_httpStatus :: Lens.Lens' DeploySystemInstanceResponse Prelude.Int
deploySystemInstanceResponse_httpStatus :: (Int -> f Int)
-> DeploySystemInstanceResponse -> f DeploySystemInstanceResponse
deploySystemInstanceResponse_httpStatus = (DeploySystemInstanceResponse -> Int)
-> (DeploySystemInstanceResponse
-> Int -> DeploySystemInstanceResponse)
-> Lens
DeploySystemInstanceResponse DeploySystemInstanceResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeploySystemInstanceResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeploySystemInstanceResponse' :: DeploySystemInstanceResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeploySystemInstanceResponse
s@DeploySystemInstanceResponse' {} Int
a -> DeploySystemInstanceResponse
s {$sel:httpStatus:DeploySystemInstanceResponse' :: Int
httpStatus = Int
a} :: DeploySystemInstanceResponse)
deploySystemInstanceResponse_summary :: Lens.Lens' DeploySystemInstanceResponse SystemInstanceSummary
deploySystemInstanceResponse_summary :: (SystemInstanceSummary -> f SystemInstanceSummary)
-> DeploySystemInstanceResponse -> f DeploySystemInstanceResponse
deploySystemInstanceResponse_summary = (DeploySystemInstanceResponse -> SystemInstanceSummary)
-> (DeploySystemInstanceResponse
-> SystemInstanceSummary -> DeploySystemInstanceResponse)
-> Lens
DeploySystemInstanceResponse
DeploySystemInstanceResponse
SystemInstanceSummary
SystemInstanceSummary
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeploySystemInstanceResponse' {SystemInstanceSummary
summary :: SystemInstanceSummary
$sel:summary:DeploySystemInstanceResponse' :: DeploySystemInstanceResponse -> SystemInstanceSummary
summary} -> SystemInstanceSummary
summary) (\s :: DeploySystemInstanceResponse
s@DeploySystemInstanceResponse' {} SystemInstanceSummary
a -> DeploySystemInstanceResponse
s {$sel:summary:DeploySystemInstanceResponse' :: SystemInstanceSummary
summary = SystemInstanceSummary
a} :: DeploySystemInstanceResponse)
instance Prelude.NFData DeploySystemInstanceResponse