{-# 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.GreengrassV2.CreateDeployment
(
CreateDeployment (..),
newCreateDeployment,
createDeployment_components,
createDeployment_clientToken,
createDeployment_deploymentPolicies,
createDeployment_iotJobConfiguration,
createDeployment_deploymentName,
createDeployment_tags,
createDeployment_targetArn,
CreateDeploymentResponse (..),
newCreateDeploymentResponse,
createDeploymentResponse_deploymentId,
createDeploymentResponse_iotJobId,
createDeploymentResponse_iotJobArn,
createDeploymentResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.GreengrassV2.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 CreateDeployment = CreateDeployment'
{
CreateDeployment
-> Maybe (HashMap Text ComponentDeploymentSpecification)
components :: Prelude.Maybe (Prelude.HashMap Prelude.Text ComponentDeploymentSpecification),
CreateDeployment -> Maybe Text
clientToken :: Prelude.Maybe Prelude.Text,
CreateDeployment -> Maybe DeploymentPolicies
deploymentPolicies :: Prelude.Maybe DeploymentPolicies,
CreateDeployment -> Maybe DeploymentIoTJobConfiguration
iotJobConfiguration :: Prelude.Maybe DeploymentIoTJobConfiguration,
CreateDeployment -> Maybe Text
deploymentName :: Prelude.Maybe Prelude.Text,
CreateDeployment -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
CreateDeployment -> Text
targetArn :: Prelude.Text
}
deriving (CreateDeployment -> CreateDeployment -> Bool
(CreateDeployment -> CreateDeployment -> Bool)
-> (CreateDeployment -> CreateDeployment -> Bool)
-> Eq CreateDeployment
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateDeployment -> CreateDeployment -> Bool
$c/= :: CreateDeployment -> CreateDeployment -> Bool
== :: CreateDeployment -> CreateDeployment -> Bool
$c== :: CreateDeployment -> CreateDeployment -> Bool
Prelude.Eq, ReadPrec [CreateDeployment]
ReadPrec CreateDeployment
Int -> ReadS CreateDeployment
ReadS [CreateDeployment]
(Int -> ReadS CreateDeployment)
-> ReadS [CreateDeployment]
-> ReadPrec CreateDeployment
-> ReadPrec [CreateDeployment]
-> Read CreateDeployment
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateDeployment]
$creadListPrec :: ReadPrec [CreateDeployment]
readPrec :: ReadPrec CreateDeployment
$creadPrec :: ReadPrec CreateDeployment
readList :: ReadS [CreateDeployment]
$creadList :: ReadS [CreateDeployment]
readsPrec :: Int -> ReadS CreateDeployment
$creadsPrec :: Int -> ReadS CreateDeployment
Prelude.Read, Int -> CreateDeployment -> ShowS
[CreateDeployment] -> ShowS
CreateDeployment -> String
(Int -> CreateDeployment -> ShowS)
-> (CreateDeployment -> String)
-> ([CreateDeployment] -> ShowS)
-> Show CreateDeployment
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateDeployment] -> ShowS
$cshowList :: [CreateDeployment] -> ShowS
show :: CreateDeployment -> String
$cshow :: CreateDeployment -> String
showsPrec :: Int -> CreateDeployment -> ShowS
$cshowsPrec :: Int -> CreateDeployment -> ShowS
Prelude.Show, (forall x. CreateDeployment -> Rep CreateDeployment x)
-> (forall x. Rep CreateDeployment x -> CreateDeployment)
-> Generic CreateDeployment
forall x. Rep CreateDeployment x -> CreateDeployment
forall x. CreateDeployment -> Rep CreateDeployment x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateDeployment x -> CreateDeployment
$cfrom :: forall x. CreateDeployment -> Rep CreateDeployment x
Prelude.Generic)
newCreateDeployment ::
Prelude.Text ->
CreateDeployment
newCreateDeployment :: Text -> CreateDeployment
newCreateDeployment Text
pTargetArn_ =
CreateDeployment' :: Maybe (HashMap Text ComponentDeploymentSpecification)
-> Maybe Text
-> Maybe DeploymentPolicies
-> Maybe DeploymentIoTJobConfiguration
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Text
-> CreateDeployment
CreateDeployment'
{ $sel:components:CreateDeployment' :: Maybe (HashMap Text ComponentDeploymentSpecification)
components = Maybe (HashMap Text ComponentDeploymentSpecification)
forall a. Maybe a
Prelude.Nothing,
$sel:clientToken:CreateDeployment' :: Maybe Text
clientToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:deploymentPolicies:CreateDeployment' :: Maybe DeploymentPolicies
deploymentPolicies = Maybe DeploymentPolicies
forall a. Maybe a
Prelude.Nothing,
$sel:iotJobConfiguration:CreateDeployment' :: Maybe DeploymentIoTJobConfiguration
iotJobConfiguration = Maybe DeploymentIoTJobConfiguration
forall a. Maybe a
Prelude.Nothing,
$sel:deploymentName:CreateDeployment' :: Maybe Text
deploymentName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:tags:CreateDeployment' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
$sel:targetArn:CreateDeployment' :: Text
targetArn = Text
pTargetArn_
}
createDeployment_components :: Lens.Lens' CreateDeployment (Prelude.Maybe (Prelude.HashMap Prelude.Text ComponentDeploymentSpecification))
createDeployment_components :: (Maybe (HashMap Text ComponentDeploymentSpecification)
-> f (Maybe (HashMap Text ComponentDeploymentSpecification)))
-> CreateDeployment -> f CreateDeployment
createDeployment_components = (CreateDeployment
-> Maybe (HashMap Text ComponentDeploymentSpecification))
-> (CreateDeployment
-> Maybe (HashMap Text ComponentDeploymentSpecification)
-> CreateDeployment)
-> Lens
CreateDeployment
CreateDeployment
(Maybe (HashMap Text ComponentDeploymentSpecification))
(Maybe (HashMap Text ComponentDeploymentSpecification))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDeployment' {Maybe (HashMap Text ComponentDeploymentSpecification)
components :: Maybe (HashMap Text ComponentDeploymentSpecification)
$sel:components:CreateDeployment' :: CreateDeployment
-> Maybe (HashMap Text ComponentDeploymentSpecification)
components} -> Maybe (HashMap Text ComponentDeploymentSpecification)
components) (\s :: CreateDeployment
s@CreateDeployment' {} Maybe (HashMap Text ComponentDeploymentSpecification)
a -> CreateDeployment
s {$sel:components:CreateDeployment' :: Maybe (HashMap Text ComponentDeploymentSpecification)
components = Maybe (HashMap Text ComponentDeploymentSpecification)
a} :: CreateDeployment) ((Maybe (HashMap Text ComponentDeploymentSpecification)
-> f (Maybe (HashMap Text ComponentDeploymentSpecification)))
-> CreateDeployment -> f CreateDeployment)
-> ((Maybe (HashMap Text ComponentDeploymentSpecification)
-> f (Maybe (HashMap Text ComponentDeploymentSpecification)))
-> Maybe (HashMap Text ComponentDeploymentSpecification)
-> f (Maybe (HashMap Text ComponentDeploymentSpecification)))
-> (Maybe (HashMap Text ComponentDeploymentSpecification)
-> f (Maybe (HashMap Text ComponentDeploymentSpecification)))
-> CreateDeployment
-> f CreateDeployment
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(HashMap Text ComponentDeploymentSpecification)
(HashMap Text ComponentDeploymentSpecification)
(HashMap Text ComponentDeploymentSpecification)
(HashMap Text ComponentDeploymentSpecification)
-> Iso
(Maybe (HashMap Text ComponentDeploymentSpecification))
(Maybe (HashMap Text ComponentDeploymentSpecification))
(Maybe (HashMap Text ComponentDeploymentSpecification))
(Maybe (HashMap Text ComponentDeploymentSpecification))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
(HashMap Text ComponentDeploymentSpecification)
(HashMap Text ComponentDeploymentSpecification)
(HashMap Text ComponentDeploymentSpecification)
(HashMap Text ComponentDeploymentSpecification)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
createDeployment_clientToken :: Lens.Lens' CreateDeployment (Prelude.Maybe Prelude.Text)
createDeployment_clientToken :: (Maybe Text -> f (Maybe Text))
-> CreateDeployment -> f CreateDeployment
createDeployment_clientToken = (CreateDeployment -> Maybe Text)
-> (CreateDeployment -> Maybe Text -> CreateDeployment)
-> Lens CreateDeployment CreateDeployment (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDeployment' {Maybe Text
clientToken :: Maybe Text
$sel:clientToken:CreateDeployment' :: CreateDeployment -> Maybe Text
clientToken} -> Maybe Text
clientToken) (\s :: CreateDeployment
s@CreateDeployment' {} Maybe Text
a -> CreateDeployment
s {$sel:clientToken:CreateDeployment' :: Maybe Text
clientToken = Maybe Text
a} :: CreateDeployment)
createDeployment_deploymentPolicies :: Lens.Lens' CreateDeployment (Prelude.Maybe DeploymentPolicies)
createDeployment_deploymentPolicies :: (Maybe DeploymentPolicies -> f (Maybe DeploymentPolicies))
-> CreateDeployment -> f CreateDeployment
createDeployment_deploymentPolicies = (CreateDeployment -> Maybe DeploymentPolicies)
-> (CreateDeployment
-> Maybe DeploymentPolicies -> CreateDeployment)
-> Lens
CreateDeployment
CreateDeployment
(Maybe DeploymentPolicies)
(Maybe DeploymentPolicies)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDeployment' {Maybe DeploymentPolicies
deploymentPolicies :: Maybe DeploymentPolicies
$sel:deploymentPolicies:CreateDeployment' :: CreateDeployment -> Maybe DeploymentPolicies
deploymentPolicies} -> Maybe DeploymentPolicies
deploymentPolicies) (\s :: CreateDeployment
s@CreateDeployment' {} Maybe DeploymentPolicies
a -> CreateDeployment
s {$sel:deploymentPolicies:CreateDeployment' :: Maybe DeploymentPolicies
deploymentPolicies = Maybe DeploymentPolicies
a} :: CreateDeployment)
createDeployment_iotJobConfiguration :: Lens.Lens' CreateDeployment (Prelude.Maybe DeploymentIoTJobConfiguration)
createDeployment_iotJobConfiguration :: (Maybe DeploymentIoTJobConfiguration
-> f (Maybe DeploymentIoTJobConfiguration))
-> CreateDeployment -> f CreateDeployment
createDeployment_iotJobConfiguration = (CreateDeployment -> Maybe DeploymentIoTJobConfiguration)
-> (CreateDeployment
-> Maybe DeploymentIoTJobConfiguration -> CreateDeployment)
-> Lens
CreateDeployment
CreateDeployment
(Maybe DeploymentIoTJobConfiguration)
(Maybe DeploymentIoTJobConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDeployment' {Maybe DeploymentIoTJobConfiguration
iotJobConfiguration :: Maybe DeploymentIoTJobConfiguration
$sel:iotJobConfiguration:CreateDeployment' :: CreateDeployment -> Maybe DeploymentIoTJobConfiguration
iotJobConfiguration} -> Maybe DeploymentIoTJobConfiguration
iotJobConfiguration) (\s :: CreateDeployment
s@CreateDeployment' {} Maybe DeploymentIoTJobConfiguration
a -> CreateDeployment
s {$sel:iotJobConfiguration:CreateDeployment' :: Maybe DeploymentIoTJobConfiguration
iotJobConfiguration = Maybe DeploymentIoTJobConfiguration
a} :: CreateDeployment)
createDeployment_deploymentName :: Lens.Lens' CreateDeployment (Prelude.Maybe Prelude.Text)
createDeployment_deploymentName :: (Maybe Text -> f (Maybe Text))
-> CreateDeployment -> f CreateDeployment
createDeployment_deploymentName = (CreateDeployment -> Maybe Text)
-> (CreateDeployment -> Maybe Text -> CreateDeployment)
-> Lens CreateDeployment CreateDeployment (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDeployment' {Maybe Text
deploymentName :: Maybe Text
$sel:deploymentName:CreateDeployment' :: CreateDeployment -> Maybe Text
deploymentName} -> Maybe Text
deploymentName) (\s :: CreateDeployment
s@CreateDeployment' {} Maybe Text
a -> CreateDeployment
s {$sel:deploymentName:CreateDeployment' :: Maybe Text
deploymentName = Maybe Text
a} :: CreateDeployment)
createDeployment_tags :: Lens.Lens' CreateDeployment (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createDeployment_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateDeployment -> f CreateDeployment
createDeployment_tags = (CreateDeployment -> Maybe (HashMap Text Text))
-> (CreateDeployment
-> Maybe (HashMap Text Text) -> CreateDeployment)
-> Lens
CreateDeployment
CreateDeployment
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDeployment' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:CreateDeployment' :: CreateDeployment -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: CreateDeployment
s@CreateDeployment' {} Maybe (HashMap Text Text)
a -> CreateDeployment
s {$sel:tags:CreateDeployment' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: CreateDeployment) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateDeployment -> f CreateDeployment)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateDeployment
-> f CreateDeployment
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
-> Iso
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
createDeployment_targetArn :: Lens.Lens' CreateDeployment Prelude.Text
createDeployment_targetArn :: (Text -> f Text) -> CreateDeployment -> f CreateDeployment
createDeployment_targetArn = (CreateDeployment -> Text)
-> (CreateDeployment -> Text -> CreateDeployment)
-> Lens CreateDeployment CreateDeployment Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDeployment' {Text
targetArn :: Text
$sel:targetArn:CreateDeployment' :: CreateDeployment -> Text
targetArn} -> Text
targetArn) (\s :: CreateDeployment
s@CreateDeployment' {} Text
a -> CreateDeployment
s {$sel:targetArn:CreateDeployment' :: Text
targetArn = Text
a} :: CreateDeployment)
instance Core.AWSRequest CreateDeployment where
type
AWSResponse CreateDeployment =
CreateDeploymentResponse
request :: CreateDeployment -> Request CreateDeployment
request = Service -> CreateDeployment -> Request CreateDeployment
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy CreateDeployment
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateDeployment)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse CreateDeployment))
-> Logger
-> Service
-> Proxy CreateDeployment
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateDeployment)))
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
-> Maybe Text -> Maybe Text -> Int -> CreateDeploymentResponse
CreateDeploymentResponse'
(Maybe Text
-> Maybe Text -> Maybe Text -> Int -> CreateDeploymentResponse)
-> Either String (Maybe Text)
-> Either
String
(Maybe Text -> Maybe Text -> Int -> CreateDeploymentResponse)
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
"deploymentId")
Either
String
(Maybe Text -> Maybe Text -> Int -> CreateDeploymentResponse)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> Int -> CreateDeploymentResponse)
forall (f :: * -> *) a b. Applicative f => 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
"iotJobId")
Either String (Maybe Text -> Int -> CreateDeploymentResponse)
-> Either String (Maybe Text)
-> Either String (Int -> CreateDeploymentResponse)
forall (f :: * -> *) a b. Applicative f => 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
"iotJobArn")
Either String (Int -> CreateDeploymentResponse)
-> Either String Int -> Either String CreateDeploymentResponse
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 CreateDeployment
instance Prelude.NFData CreateDeployment
instance Core.ToHeaders CreateDeployment where
toHeaders :: CreateDeployment -> ResponseHeaders
toHeaders =
ResponseHeaders -> CreateDeployment -> 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 CreateDeployment where
toJSON :: CreateDeployment -> Value
toJSON CreateDeployment' {Maybe Text
Maybe (HashMap Text Text)
Maybe (HashMap Text ComponentDeploymentSpecification)
Maybe DeploymentPolicies
Maybe DeploymentIoTJobConfiguration
Text
targetArn :: Text
tags :: Maybe (HashMap Text Text)
deploymentName :: Maybe Text
iotJobConfiguration :: Maybe DeploymentIoTJobConfiguration
deploymentPolicies :: Maybe DeploymentPolicies
clientToken :: Maybe Text
components :: Maybe (HashMap Text ComponentDeploymentSpecification)
$sel:targetArn:CreateDeployment' :: CreateDeployment -> Text
$sel:tags:CreateDeployment' :: CreateDeployment -> Maybe (HashMap Text Text)
$sel:deploymentName:CreateDeployment' :: CreateDeployment -> Maybe Text
$sel:iotJobConfiguration:CreateDeployment' :: CreateDeployment -> Maybe DeploymentIoTJobConfiguration
$sel:deploymentPolicies:CreateDeployment' :: CreateDeployment -> Maybe DeploymentPolicies
$sel:clientToken:CreateDeployment' :: CreateDeployment -> Maybe Text
$sel:components:CreateDeployment' :: CreateDeployment
-> Maybe (HashMap Text ComponentDeploymentSpecification)
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"components" Text -> HashMap Text ComponentDeploymentSpecification -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text ComponentDeploymentSpecification -> Pair)
-> Maybe (HashMap Text ComponentDeploymentSpecification)
-> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text ComponentDeploymentSpecification)
components,
(Text
"clientToken" 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
clientToken,
(Text
"deploymentPolicies" Text -> DeploymentPolicies -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(DeploymentPolicies -> Pair)
-> Maybe DeploymentPolicies -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe DeploymentPolicies
deploymentPolicies,
(Text
"iotJobConfiguration" Text -> DeploymentIoTJobConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(DeploymentIoTJobConfiguration -> Pair)
-> Maybe DeploymentIoTJobConfiguration -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe DeploymentIoTJobConfiguration
iotJobConfiguration,
(Text
"deploymentName" 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
deploymentName,
(Text
"tags" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
tags,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"targetArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
targetArn)
]
)
instance Core.ToPath CreateDeployment where
toPath :: CreateDeployment -> ByteString
toPath = ByteString -> CreateDeployment -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/greengrass/v2/deployments"
instance Core.ToQuery CreateDeployment where
toQuery :: CreateDeployment -> QueryString
toQuery = QueryString -> CreateDeployment -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data CreateDeploymentResponse = CreateDeploymentResponse'
{
CreateDeploymentResponse -> Maybe Text
deploymentId :: Prelude.Maybe Prelude.Text,
CreateDeploymentResponse -> Maybe Text
iotJobId :: Prelude.Maybe Prelude.Text,
CreateDeploymentResponse -> Maybe Text
iotJobArn :: Prelude.Maybe Prelude.Text,
CreateDeploymentResponse -> Int
httpStatus :: Prelude.Int
}
deriving (CreateDeploymentResponse -> CreateDeploymentResponse -> Bool
(CreateDeploymentResponse -> CreateDeploymentResponse -> Bool)
-> (CreateDeploymentResponse -> CreateDeploymentResponse -> Bool)
-> Eq CreateDeploymentResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateDeploymentResponse -> CreateDeploymentResponse -> Bool
$c/= :: CreateDeploymentResponse -> CreateDeploymentResponse -> Bool
== :: CreateDeploymentResponse -> CreateDeploymentResponse -> Bool
$c== :: CreateDeploymentResponse -> CreateDeploymentResponse -> Bool
Prelude.Eq, ReadPrec [CreateDeploymentResponse]
ReadPrec CreateDeploymentResponse
Int -> ReadS CreateDeploymentResponse
ReadS [CreateDeploymentResponse]
(Int -> ReadS CreateDeploymentResponse)
-> ReadS [CreateDeploymentResponse]
-> ReadPrec CreateDeploymentResponse
-> ReadPrec [CreateDeploymentResponse]
-> Read CreateDeploymentResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateDeploymentResponse]
$creadListPrec :: ReadPrec [CreateDeploymentResponse]
readPrec :: ReadPrec CreateDeploymentResponse
$creadPrec :: ReadPrec CreateDeploymentResponse
readList :: ReadS [CreateDeploymentResponse]
$creadList :: ReadS [CreateDeploymentResponse]
readsPrec :: Int -> ReadS CreateDeploymentResponse
$creadsPrec :: Int -> ReadS CreateDeploymentResponse
Prelude.Read, Int -> CreateDeploymentResponse -> ShowS
[CreateDeploymentResponse] -> ShowS
CreateDeploymentResponse -> String
(Int -> CreateDeploymentResponse -> ShowS)
-> (CreateDeploymentResponse -> String)
-> ([CreateDeploymentResponse] -> ShowS)
-> Show CreateDeploymentResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateDeploymentResponse] -> ShowS
$cshowList :: [CreateDeploymentResponse] -> ShowS
show :: CreateDeploymentResponse -> String
$cshow :: CreateDeploymentResponse -> String
showsPrec :: Int -> CreateDeploymentResponse -> ShowS
$cshowsPrec :: Int -> CreateDeploymentResponse -> ShowS
Prelude.Show, (forall x.
CreateDeploymentResponse -> Rep CreateDeploymentResponse x)
-> (forall x.
Rep CreateDeploymentResponse x -> CreateDeploymentResponse)
-> Generic CreateDeploymentResponse
forall x.
Rep CreateDeploymentResponse x -> CreateDeploymentResponse
forall x.
CreateDeploymentResponse -> Rep CreateDeploymentResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateDeploymentResponse x -> CreateDeploymentResponse
$cfrom :: forall x.
CreateDeploymentResponse -> Rep CreateDeploymentResponse x
Prelude.Generic)
newCreateDeploymentResponse ::
Prelude.Int ->
CreateDeploymentResponse
newCreateDeploymentResponse :: Int -> CreateDeploymentResponse
newCreateDeploymentResponse Int
pHttpStatus_ =
CreateDeploymentResponse' :: Maybe Text
-> Maybe Text -> Maybe Text -> Int -> CreateDeploymentResponse
CreateDeploymentResponse'
{ $sel:deploymentId:CreateDeploymentResponse' :: Maybe Text
deploymentId =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:iotJobId:CreateDeploymentResponse' :: Maybe Text
iotJobId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:iotJobArn:CreateDeploymentResponse' :: Maybe Text
iotJobArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:CreateDeploymentResponse' :: Int
httpStatus = Int
pHttpStatus_
}
createDeploymentResponse_deploymentId :: Lens.Lens' CreateDeploymentResponse (Prelude.Maybe Prelude.Text)
createDeploymentResponse_deploymentId :: (Maybe Text -> f (Maybe Text))
-> CreateDeploymentResponse -> f CreateDeploymentResponse
createDeploymentResponse_deploymentId = (CreateDeploymentResponse -> Maybe Text)
-> (CreateDeploymentResponse
-> Maybe Text -> CreateDeploymentResponse)
-> Lens
CreateDeploymentResponse
CreateDeploymentResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDeploymentResponse' {Maybe Text
deploymentId :: Maybe Text
$sel:deploymentId:CreateDeploymentResponse' :: CreateDeploymentResponse -> Maybe Text
deploymentId} -> Maybe Text
deploymentId) (\s :: CreateDeploymentResponse
s@CreateDeploymentResponse' {} Maybe Text
a -> CreateDeploymentResponse
s {$sel:deploymentId:CreateDeploymentResponse' :: Maybe Text
deploymentId = Maybe Text
a} :: CreateDeploymentResponse)
createDeploymentResponse_iotJobId :: Lens.Lens' CreateDeploymentResponse (Prelude.Maybe Prelude.Text)
createDeploymentResponse_iotJobId :: (Maybe Text -> f (Maybe Text))
-> CreateDeploymentResponse -> f CreateDeploymentResponse
createDeploymentResponse_iotJobId = (CreateDeploymentResponse -> Maybe Text)
-> (CreateDeploymentResponse
-> Maybe Text -> CreateDeploymentResponse)
-> Lens
CreateDeploymentResponse
CreateDeploymentResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDeploymentResponse' {Maybe Text
iotJobId :: Maybe Text
$sel:iotJobId:CreateDeploymentResponse' :: CreateDeploymentResponse -> Maybe Text
iotJobId} -> Maybe Text
iotJobId) (\s :: CreateDeploymentResponse
s@CreateDeploymentResponse' {} Maybe Text
a -> CreateDeploymentResponse
s {$sel:iotJobId:CreateDeploymentResponse' :: Maybe Text
iotJobId = Maybe Text
a} :: CreateDeploymentResponse)
createDeploymentResponse_iotJobArn :: Lens.Lens' CreateDeploymentResponse (Prelude.Maybe Prelude.Text)
createDeploymentResponse_iotJobArn :: (Maybe Text -> f (Maybe Text))
-> CreateDeploymentResponse -> f CreateDeploymentResponse
createDeploymentResponse_iotJobArn = (CreateDeploymentResponse -> Maybe Text)
-> (CreateDeploymentResponse
-> Maybe Text -> CreateDeploymentResponse)
-> Lens
CreateDeploymentResponse
CreateDeploymentResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDeploymentResponse' {Maybe Text
iotJobArn :: Maybe Text
$sel:iotJobArn:CreateDeploymentResponse' :: CreateDeploymentResponse -> Maybe Text
iotJobArn} -> Maybe Text
iotJobArn) (\s :: CreateDeploymentResponse
s@CreateDeploymentResponse' {} Maybe Text
a -> CreateDeploymentResponse
s {$sel:iotJobArn:CreateDeploymentResponse' :: Maybe Text
iotJobArn = Maybe Text
a} :: CreateDeploymentResponse)
createDeploymentResponse_httpStatus :: Lens.Lens' CreateDeploymentResponse Prelude.Int
createDeploymentResponse_httpStatus :: (Int -> f Int)
-> CreateDeploymentResponse -> f CreateDeploymentResponse
createDeploymentResponse_httpStatus = (CreateDeploymentResponse -> Int)
-> (CreateDeploymentResponse -> Int -> CreateDeploymentResponse)
-> Lens CreateDeploymentResponse CreateDeploymentResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDeploymentResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateDeploymentResponse' :: CreateDeploymentResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateDeploymentResponse
s@CreateDeploymentResponse' {} Int
a -> CreateDeploymentResponse
s {$sel:httpStatus:CreateDeploymentResponse' :: Int
httpStatus = Int
a} :: CreateDeploymentResponse)
instance Prelude.NFData CreateDeploymentResponse