{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.Panorama.CreateNodeFromTemplateJob
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Creates a camera stream node.
module Amazonka.Panorama.CreateNodeFromTemplateJob
  ( -- * Creating a Request
    CreateNodeFromTemplateJob (..),
    newCreateNodeFromTemplateJob,

    -- * Request Lenses
    createNodeFromTemplateJob_jobTags,
    createNodeFromTemplateJob_nodeDescription,
    createNodeFromTemplateJob_templateType,
    createNodeFromTemplateJob_outputPackageName,
    createNodeFromTemplateJob_outputPackageVersion,
    createNodeFromTemplateJob_nodeName,
    createNodeFromTemplateJob_templateParameters,

    -- * Destructuring the Response
    CreateNodeFromTemplateJobResponse (..),
    newCreateNodeFromTemplateJobResponse,

    -- * Response Lenses
    createNodeFromTemplateJobResponse_httpStatus,
    createNodeFromTemplateJobResponse_jobId,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Panorama.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newCreateNodeFromTemplateJob' smart constructor.
data CreateNodeFromTemplateJob = CreateNodeFromTemplateJob'
  { -- | Tags for the job.
    CreateNodeFromTemplateJob -> Maybe [JobResourceTags]
jobTags :: Prelude.Maybe [JobResourceTags],
    -- | A description for the node.
    CreateNodeFromTemplateJob -> Maybe Text
nodeDescription :: Prelude.Maybe Prelude.Text,
    -- | The type of node.
    CreateNodeFromTemplateJob -> TemplateType
templateType :: TemplateType,
    -- | An output package name for the node.
    CreateNodeFromTemplateJob -> Text
outputPackageName :: Prelude.Text,
    -- | An output package version for the node.
    CreateNodeFromTemplateJob -> Text
outputPackageVersion :: Prelude.Text,
    -- | A name for the node.
    CreateNodeFromTemplateJob -> Text
nodeName :: Prelude.Text,
    -- | Template parameters for the node.
    CreateNodeFromTemplateJob -> HashMap Text (Sensitive Text)
templateParameters :: Prelude.HashMap Prelude.Text (Core.Sensitive Prelude.Text)
  }
  deriving (CreateNodeFromTemplateJob -> CreateNodeFromTemplateJob -> Bool
(CreateNodeFromTemplateJob -> CreateNodeFromTemplateJob -> Bool)
-> (CreateNodeFromTemplateJob -> CreateNodeFromTemplateJob -> Bool)
-> Eq CreateNodeFromTemplateJob
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateNodeFromTemplateJob -> CreateNodeFromTemplateJob -> Bool
$c/= :: CreateNodeFromTemplateJob -> CreateNodeFromTemplateJob -> Bool
== :: CreateNodeFromTemplateJob -> CreateNodeFromTemplateJob -> Bool
$c== :: CreateNodeFromTemplateJob -> CreateNodeFromTemplateJob -> Bool
Prelude.Eq, Int -> CreateNodeFromTemplateJob -> ShowS
[CreateNodeFromTemplateJob] -> ShowS
CreateNodeFromTemplateJob -> String
(Int -> CreateNodeFromTemplateJob -> ShowS)
-> (CreateNodeFromTemplateJob -> String)
-> ([CreateNodeFromTemplateJob] -> ShowS)
-> Show CreateNodeFromTemplateJob
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateNodeFromTemplateJob] -> ShowS
$cshowList :: [CreateNodeFromTemplateJob] -> ShowS
show :: CreateNodeFromTemplateJob -> String
$cshow :: CreateNodeFromTemplateJob -> String
showsPrec :: Int -> CreateNodeFromTemplateJob -> ShowS
$cshowsPrec :: Int -> CreateNodeFromTemplateJob -> ShowS
Prelude.Show, (forall x.
 CreateNodeFromTemplateJob -> Rep CreateNodeFromTemplateJob x)
-> (forall x.
    Rep CreateNodeFromTemplateJob x -> CreateNodeFromTemplateJob)
-> Generic CreateNodeFromTemplateJob
forall x.
Rep CreateNodeFromTemplateJob x -> CreateNodeFromTemplateJob
forall x.
CreateNodeFromTemplateJob -> Rep CreateNodeFromTemplateJob x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateNodeFromTemplateJob x -> CreateNodeFromTemplateJob
$cfrom :: forall x.
CreateNodeFromTemplateJob -> Rep CreateNodeFromTemplateJob x
Prelude.Generic)

-- |
-- Create a value of 'CreateNodeFromTemplateJob' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'jobTags', 'createNodeFromTemplateJob_jobTags' - Tags for the job.
--
-- 'nodeDescription', 'createNodeFromTemplateJob_nodeDescription' - A description for the node.
--
-- 'templateType', 'createNodeFromTemplateJob_templateType' - The type of node.
--
-- 'outputPackageName', 'createNodeFromTemplateJob_outputPackageName' - An output package name for the node.
--
-- 'outputPackageVersion', 'createNodeFromTemplateJob_outputPackageVersion' - An output package version for the node.
--
-- 'nodeName', 'createNodeFromTemplateJob_nodeName' - A name for the node.
--
-- 'templateParameters', 'createNodeFromTemplateJob_templateParameters' - Template parameters for the node.
newCreateNodeFromTemplateJob ::
  -- | 'templateType'
  TemplateType ->
  -- | 'outputPackageName'
  Prelude.Text ->
  -- | 'outputPackageVersion'
  Prelude.Text ->
  -- | 'nodeName'
  Prelude.Text ->
  CreateNodeFromTemplateJob
newCreateNodeFromTemplateJob :: TemplateType -> Text -> Text -> Text -> CreateNodeFromTemplateJob
newCreateNodeFromTemplateJob
  TemplateType
pTemplateType_
  Text
pOutputPackageName_
  Text
pOutputPackageVersion_
  Text
pNodeName_ =
    CreateNodeFromTemplateJob' :: Maybe [JobResourceTags]
-> Maybe Text
-> TemplateType
-> Text
-> Text
-> Text
-> HashMap Text (Sensitive Text)
-> CreateNodeFromTemplateJob
CreateNodeFromTemplateJob'
      { $sel:jobTags:CreateNodeFromTemplateJob' :: Maybe [JobResourceTags]
jobTags =
          Maybe [JobResourceTags]
forall a. Maybe a
Prelude.Nothing,
        $sel:nodeDescription:CreateNodeFromTemplateJob' :: Maybe Text
nodeDescription = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:templateType:CreateNodeFromTemplateJob' :: TemplateType
templateType = TemplateType
pTemplateType_,
        $sel:outputPackageName:CreateNodeFromTemplateJob' :: Text
outputPackageName = Text
pOutputPackageName_,
        $sel:outputPackageVersion:CreateNodeFromTemplateJob' :: Text
outputPackageVersion = Text
pOutputPackageVersion_,
        $sel:nodeName:CreateNodeFromTemplateJob' :: Text
nodeName = Text
pNodeName_,
        $sel:templateParameters:CreateNodeFromTemplateJob' :: HashMap Text (Sensitive Text)
templateParameters = HashMap Text (Sensitive Text)
forall a. Monoid a => a
Prelude.mempty
      }

-- | Tags for the job.
createNodeFromTemplateJob_jobTags :: Lens.Lens' CreateNodeFromTemplateJob (Prelude.Maybe [JobResourceTags])
createNodeFromTemplateJob_jobTags :: (Maybe [JobResourceTags] -> f (Maybe [JobResourceTags]))
-> CreateNodeFromTemplateJob -> f CreateNodeFromTemplateJob
createNodeFromTemplateJob_jobTags = (CreateNodeFromTemplateJob -> Maybe [JobResourceTags])
-> (CreateNodeFromTemplateJob
    -> Maybe [JobResourceTags] -> CreateNodeFromTemplateJob)
-> Lens
     CreateNodeFromTemplateJob
     CreateNodeFromTemplateJob
     (Maybe [JobResourceTags])
     (Maybe [JobResourceTags])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateNodeFromTemplateJob' {Maybe [JobResourceTags]
jobTags :: Maybe [JobResourceTags]
$sel:jobTags:CreateNodeFromTemplateJob' :: CreateNodeFromTemplateJob -> Maybe [JobResourceTags]
jobTags} -> Maybe [JobResourceTags]
jobTags) (\s :: CreateNodeFromTemplateJob
s@CreateNodeFromTemplateJob' {} Maybe [JobResourceTags]
a -> CreateNodeFromTemplateJob
s {$sel:jobTags:CreateNodeFromTemplateJob' :: Maybe [JobResourceTags]
jobTags = Maybe [JobResourceTags]
a} :: CreateNodeFromTemplateJob) ((Maybe [JobResourceTags] -> f (Maybe [JobResourceTags]))
 -> CreateNodeFromTemplateJob -> f CreateNodeFromTemplateJob)
-> ((Maybe [JobResourceTags] -> f (Maybe [JobResourceTags]))
    -> Maybe [JobResourceTags] -> f (Maybe [JobResourceTags]))
-> (Maybe [JobResourceTags] -> f (Maybe [JobResourceTags]))
-> CreateNodeFromTemplateJob
-> f CreateNodeFromTemplateJob
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [JobResourceTags]
  [JobResourceTags]
  [JobResourceTags]
  [JobResourceTags]
-> Iso
     (Maybe [JobResourceTags])
     (Maybe [JobResourceTags])
     (Maybe [JobResourceTags])
     (Maybe [JobResourceTags])
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
  [JobResourceTags]
  [JobResourceTags]
  [JobResourceTags]
  [JobResourceTags]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A description for the node.
createNodeFromTemplateJob_nodeDescription :: Lens.Lens' CreateNodeFromTemplateJob (Prelude.Maybe Prelude.Text)
createNodeFromTemplateJob_nodeDescription :: (Maybe Text -> f (Maybe Text))
-> CreateNodeFromTemplateJob -> f CreateNodeFromTemplateJob
createNodeFromTemplateJob_nodeDescription = (CreateNodeFromTemplateJob -> Maybe Text)
-> (CreateNodeFromTemplateJob
    -> Maybe Text -> CreateNodeFromTemplateJob)
-> Lens
     CreateNodeFromTemplateJob
     CreateNodeFromTemplateJob
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateNodeFromTemplateJob' {Maybe Text
nodeDescription :: Maybe Text
$sel:nodeDescription:CreateNodeFromTemplateJob' :: CreateNodeFromTemplateJob -> Maybe Text
nodeDescription} -> Maybe Text
nodeDescription) (\s :: CreateNodeFromTemplateJob
s@CreateNodeFromTemplateJob' {} Maybe Text
a -> CreateNodeFromTemplateJob
s {$sel:nodeDescription:CreateNodeFromTemplateJob' :: Maybe Text
nodeDescription = Maybe Text
a} :: CreateNodeFromTemplateJob)

-- | The type of node.
createNodeFromTemplateJob_templateType :: Lens.Lens' CreateNodeFromTemplateJob TemplateType
createNodeFromTemplateJob_templateType :: (TemplateType -> f TemplateType)
-> CreateNodeFromTemplateJob -> f CreateNodeFromTemplateJob
createNodeFromTemplateJob_templateType = (CreateNodeFromTemplateJob -> TemplateType)
-> (CreateNodeFromTemplateJob
    -> TemplateType -> CreateNodeFromTemplateJob)
-> Lens
     CreateNodeFromTemplateJob
     CreateNodeFromTemplateJob
     TemplateType
     TemplateType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateNodeFromTemplateJob' {TemplateType
templateType :: TemplateType
$sel:templateType:CreateNodeFromTemplateJob' :: CreateNodeFromTemplateJob -> TemplateType
templateType} -> TemplateType
templateType) (\s :: CreateNodeFromTemplateJob
s@CreateNodeFromTemplateJob' {} TemplateType
a -> CreateNodeFromTemplateJob
s {$sel:templateType:CreateNodeFromTemplateJob' :: TemplateType
templateType = TemplateType
a} :: CreateNodeFromTemplateJob)

-- | An output package name for the node.
createNodeFromTemplateJob_outputPackageName :: Lens.Lens' CreateNodeFromTemplateJob Prelude.Text
createNodeFromTemplateJob_outputPackageName :: (Text -> f Text)
-> CreateNodeFromTemplateJob -> f CreateNodeFromTemplateJob
createNodeFromTemplateJob_outputPackageName = (CreateNodeFromTemplateJob -> Text)
-> (CreateNodeFromTemplateJob -> Text -> CreateNodeFromTemplateJob)
-> Lens
     CreateNodeFromTemplateJob CreateNodeFromTemplateJob Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateNodeFromTemplateJob' {Text
outputPackageName :: Text
$sel:outputPackageName:CreateNodeFromTemplateJob' :: CreateNodeFromTemplateJob -> Text
outputPackageName} -> Text
outputPackageName) (\s :: CreateNodeFromTemplateJob
s@CreateNodeFromTemplateJob' {} Text
a -> CreateNodeFromTemplateJob
s {$sel:outputPackageName:CreateNodeFromTemplateJob' :: Text
outputPackageName = Text
a} :: CreateNodeFromTemplateJob)

-- | An output package version for the node.
createNodeFromTemplateJob_outputPackageVersion :: Lens.Lens' CreateNodeFromTemplateJob Prelude.Text
createNodeFromTemplateJob_outputPackageVersion :: (Text -> f Text)
-> CreateNodeFromTemplateJob -> f CreateNodeFromTemplateJob
createNodeFromTemplateJob_outputPackageVersion = (CreateNodeFromTemplateJob -> Text)
-> (CreateNodeFromTemplateJob -> Text -> CreateNodeFromTemplateJob)
-> Lens
     CreateNodeFromTemplateJob CreateNodeFromTemplateJob Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateNodeFromTemplateJob' {Text
outputPackageVersion :: Text
$sel:outputPackageVersion:CreateNodeFromTemplateJob' :: CreateNodeFromTemplateJob -> Text
outputPackageVersion} -> Text
outputPackageVersion) (\s :: CreateNodeFromTemplateJob
s@CreateNodeFromTemplateJob' {} Text
a -> CreateNodeFromTemplateJob
s {$sel:outputPackageVersion:CreateNodeFromTemplateJob' :: Text
outputPackageVersion = Text
a} :: CreateNodeFromTemplateJob)

-- | A name for the node.
createNodeFromTemplateJob_nodeName :: Lens.Lens' CreateNodeFromTemplateJob Prelude.Text
createNodeFromTemplateJob_nodeName :: (Text -> f Text)
-> CreateNodeFromTemplateJob -> f CreateNodeFromTemplateJob
createNodeFromTemplateJob_nodeName = (CreateNodeFromTemplateJob -> Text)
-> (CreateNodeFromTemplateJob -> Text -> CreateNodeFromTemplateJob)
-> Lens
     CreateNodeFromTemplateJob CreateNodeFromTemplateJob Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateNodeFromTemplateJob' {Text
nodeName :: Text
$sel:nodeName:CreateNodeFromTemplateJob' :: CreateNodeFromTemplateJob -> Text
nodeName} -> Text
nodeName) (\s :: CreateNodeFromTemplateJob
s@CreateNodeFromTemplateJob' {} Text
a -> CreateNodeFromTemplateJob
s {$sel:nodeName:CreateNodeFromTemplateJob' :: Text
nodeName = Text
a} :: CreateNodeFromTemplateJob)

-- | Template parameters for the node.
createNodeFromTemplateJob_templateParameters :: Lens.Lens' CreateNodeFromTemplateJob (Prelude.HashMap Prelude.Text Prelude.Text)
createNodeFromTemplateJob_templateParameters :: (HashMap Text Text -> f (HashMap Text Text))
-> CreateNodeFromTemplateJob -> f CreateNodeFromTemplateJob
createNodeFromTemplateJob_templateParameters = (CreateNodeFromTemplateJob -> HashMap Text (Sensitive Text))
-> (CreateNodeFromTemplateJob
    -> HashMap Text (Sensitive Text) -> CreateNodeFromTemplateJob)
-> Lens
     CreateNodeFromTemplateJob
     CreateNodeFromTemplateJob
     (HashMap Text (Sensitive Text))
     (HashMap Text (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateNodeFromTemplateJob' {HashMap Text (Sensitive Text)
templateParameters :: HashMap Text (Sensitive Text)
$sel:templateParameters:CreateNodeFromTemplateJob' :: CreateNodeFromTemplateJob -> HashMap Text (Sensitive Text)
templateParameters} -> HashMap Text (Sensitive Text)
templateParameters) (\s :: CreateNodeFromTemplateJob
s@CreateNodeFromTemplateJob' {} HashMap Text (Sensitive Text)
a -> CreateNodeFromTemplateJob
s {$sel:templateParameters:CreateNodeFromTemplateJob' :: HashMap Text (Sensitive Text)
templateParameters = HashMap Text (Sensitive Text)
a} :: CreateNodeFromTemplateJob) ((HashMap Text (Sensitive Text)
  -> f (HashMap Text (Sensitive Text)))
 -> CreateNodeFromTemplateJob -> f CreateNodeFromTemplateJob)
-> ((HashMap Text Text -> f (HashMap Text Text))
    -> HashMap Text (Sensitive Text)
    -> f (HashMap Text (Sensitive Text)))
-> (HashMap Text Text -> f (HashMap Text Text))
-> CreateNodeFromTemplateJob
-> f CreateNodeFromTemplateJob
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (HashMap Text Text -> f (HashMap Text Text))
-> HashMap Text (Sensitive Text)
-> f (HashMap Text (Sensitive Text))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.AWSRequest CreateNodeFromTemplateJob where
  type
    AWSResponse CreateNodeFromTemplateJob =
      CreateNodeFromTemplateJobResponse
  request :: CreateNodeFromTemplateJob -> Request CreateNodeFromTemplateJob
request = Service
-> CreateNodeFromTemplateJob -> Request CreateNodeFromTemplateJob
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateNodeFromTemplateJob
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateNodeFromTemplateJob)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateNodeFromTemplateJob))
-> Logger
-> Service
-> Proxy CreateNodeFromTemplateJob
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateNodeFromTemplateJob)))
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 -> CreateNodeFromTemplateJobResponse
CreateNodeFromTemplateJobResponse'
            (Int -> Text -> CreateNodeFromTemplateJobResponse)
-> Either String Int
-> Either String (Text -> CreateNodeFromTemplateJobResponse)
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 -> CreateNodeFromTemplateJobResponse)
-> Either String Text
-> Either String CreateNodeFromTemplateJobResponse
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
"JobId")
      )

instance Prelude.Hashable CreateNodeFromTemplateJob

instance Prelude.NFData CreateNodeFromTemplateJob

instance Core.ToHeaders CreateNodeFromTemplateJob where
  toHeaders :: CreateNodeFromTemplateJob -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateNodeFromTemplateJob -> 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 CreateNodeFromTemplateJob where
  toJSON :: CreateNodeFromTemplateJob -> Value
toJSON CreateNodeFromTemplateJob' {Maybe [JobResourceTags]
Maybe Text
Text
HashMap Text (Sensitive Text)
TemplateType
templateParameters :: HashMap Text (Sensitive Text)
nodeName :: Text
outputPackageVersion :: Text
outputPackageName :: Text
templateType :: TemplateType
nodeDescription :: Maybe Text
jobTags :: Maybe [JobResourceTags]
$sel:templateParameters:CreateNodeFromTemplateJob' :: CreateNodeFromTemplateJob -> HashMap Text (Sensitive Text)
$sel:nodeName:CreateNodeFromTemplateJob' :: CreateNodeFromTemplateJob -> Text
$sel:outputPackageVersion:CreateNodeFromTemplateJob' :: CreateNodeFromTemplateJob -> Text
$sel:outputPackageName:CreateNodeFromTemplateJob' :: CreateNodeFromTemplateJob -> Text
$sel:templateType:CreateNodeFromTemplateJob' :: CreateNodeFromTemplateJob -> TemplateType
$sel:nodeDescription:CreateNodeFromTemplateJob' :: CreateNodeFromTemplateJob -> Maybe Text
$sel:jobTags:CreateNodeFromTemplateJob' :: CreateNodeFromTemplateJob -> Maybe [JobResourceTags]
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"JobTags" Text -> [JobResourceTags] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([JobResourceTags] -> Pair)
-> Maybe [JobResourceTags] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [JobResourceTags]
jobTags,
            (Text
"NodeDescription" 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
nodeDescription,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"TemplateType" Text -> TemplateType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= TemplateType
templateType),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"OutputPackageName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
outputPackageName),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              ( Text
"OutputPackageVersion"
                  Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
outputPackageVersion
              ),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"NodeName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
nodeName),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"TemplateParameters" Text -> HashMap Text (Sensitive Text) -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= HashMap Text (Sensitive Text)
templateParameters)
          ]
      )

instance Core.ToPath CreateNodeFromTemplateJob where
  toPath :: CreateNodeFromTemplateJob -> ByteString
toPath = ByteString -> CreateNodeFromTemplateJob -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/packages/template-job"

instance Core.ToQuery CreateNodeFromTemplateJob where
  toQuery :: CreateNodeFromTemplateJob -> QueryString
toQuery = QueryString -> CreateNodeFromTemplateJob -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newCreateNodeFromTemplateJobResponse' smart constructor.
data CreateNodeFromTemplateJobResponse = CreateNodeFromTemplateJobResponse'
  { -- | The response's http status code.
    CreateNodeFromTemplateJobResponse -> Int
httpStatus :: Prelude.Int,
    -- | The job\'s ID.
    CreateNodeFromTemplateJobResponse -> Text
jobId :: Prelude.Text
  }
  deriving (CreateNodeFromTemplateJobResponse
-> CreateNodeFromTemplateJobResponse -> Bool
(CreateNodeFromTemplateJobResponse
 -> CreateNodeFromTemplateJobResponse -> Bool)
-> (CreateNodeFromTemplateJobResponse
    -> CreateNodeFromTemplateJobResponse -> Bool)
-> Eq CreateNodeFromTemplateJobResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateNodeFromTemplateJobResponse
-> CreateNodeFromTemplateJobResponse -> Bool
$c/= :: CreateNodeFromTemplateJobResponse
-> CreateNodeFromTemplateJobResponse -> Bool
== :: CreateNodeFromTemplateJobResponse
-> CreateNodeFromTemplateJobResponse -> Bool
$c== :: CreateNodeFromTemplateJobResponse
-> CreateNodeFromTemplateJobResponse -> Bool
Prelude.Eq, ReadPrec [CreateNodeFromTemplateJobResponse]
ReadPrec CreateNodeFromTemplateJobResponse
Int -> ReadS CreateNodeFromTemplateJobResponse
ReadS [CreateNodeFromTemplateJobResponse]
(Int -> ReadS CreateNodeFromTemplateJobResponse)
-> ReadS [CreateNodeFromTemplateJobResponse]
-> ReadPrec CreateNodeFromTemplateJobResponse
-> ReadPrec [CreateNodeFromTemplateJobResponse]
-> Read CreateNodeFromTemplateJobResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateNodeFromTemplateJobResponse]
$creadListPrec :: ReadPrec [CreateNodeFromTemplateJobResponse]
readPrec :: ReadPrec CreateNodeFromTemplateJobResponse
$creadPrec :: ReadPrec CreateNodeFromTemplateJobResponse
readList :: ReadS [CreateNodeFromTemplateJobResponse]
$creadList :: ReadS [CreateNodeFromTemplateJobResponse]
readsPrec :: Int -> ReadS CreateNodeFromTemplateJobResponse
$creadsPrec :: Int -> ReadS CreateNodeFromTemplateJobResponse
Prelude.Read, Int -> CreateNodeFromTemplateJobResponse -> ShowS
[CreateNodeFromTemplateJobResponse] -> ShowS
CreateNodeFromTemplateJobResponse -> String
(Int -> CreateNodeFromTemplateJobResponse -> ShowS)
-> (CreateNodeFromTemplateJobResponse -> String)
-> ([CreateNodeFromTemplateJobResponse] -> ShowS)
-> Show CreateNodeFromTemplateJobResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateNodeFromTemplateJobResponse] -> ShowS
$cshowList :: [CreateNodeFromTemplateJobResponse] -> ShowS
show :: CreateNodeFromTemplateJobResponse -> String
$cshow :: CreateNodeFromTemplateJobResponse -> String
showsPrec :: Int -> CreateNodeFromTemplateJobResponse -> ShowS
$cshowsPrec :: Int -> CreateNodeFromTemplateJobResponse -> ShowS
Prelude.Show, (forall x.
 CreateNodeFromTemplateJobResponse
 -> Rep CreateNodeFromTemplateJobResponse x)
-> (forall x.
    Rep CreateNodeFromTemplateJobResponse x
    -> CreateNodeFromTemplateJobResponse)
-> Generic CreateNodeFromTemplateJobResponse
forall x.
Rep CreateNodeFromTemplateJobResponse x
-> CreateNodeFromTemplateJobResponse
forall x.
CreateNodeFromTemplateJobResponse
-> Rep CreateNodeFromTemplateJobResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateNodeFromTemplateJobResponse x
-> CreateNodeFromTemplateJobResponse
$cfrom :: forall x.
CreateNodeFromTemplateJobResponse
-> Rep CreateNodeFromTemplateJobResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateNodeFromTemplateJobResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'httpStatus', 'createNodeFromTemplateJobResponse_httpStatus' - The response's http status code.
--
-- 'jobId', 'createNodeFromTemplateJobResponse_jobId' - The job\'s ID.
newCreateNodeFromTemplateJobResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'jobId'
  Prelude.Text ->
  CreateNodeFromTemplateJobResponse
newCreateNodeFromTemplateJobResponse :: Int -> Text -> CreateNodeFromTemplateJobResponse
newCreateNodeFromTemplateJobResponse
  Int
pHttpStatus_
  Text
pJobId_ =
    CreateNodeFromTemplateJobResponse' :: Int -> Text -> CreateNodeFromTemplateJobResponse
CreateNodeFromTemplateJobResponse'
      { $sel:httpStatus:CreateNodeFromTemplateJobResponse' :: Int
httpStatus =
          Int
pHttpStatus_,
        $sel:jobId:CreateNodeFromTemplateJobResponse' :: Text
jobId = Text
pJobId_
      }

-- | The response's http status code.
createNodeFromTemplateJobResponse_httpStatus :: Lens.Lens' CreateNodeFromTemplateJobResponse Prelude.Int
createNodeFromTemplateJobResponse_httpStatus :: (Int -> f Int)
-> CreateNodeFromTemplateJobResponse
-> f CreateNodeFromTemplateJobResponse
createNodeFromTemplateJobResponse_httpStatus = (CreateNodeFromTemplateJobResponse -> Int)
-> (CreateNodeFromTemplateJobResponse
    -> Int -> CreateNodeFromTemplateJobResponse)
-> Lens
     CreateNodeFromTemplateJobResponse
     CreateNodeFromTemplateJobResponse
     Int
     Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateNodeFromTemplateJobResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateNodeFromTemplateJobResponse' :: CreateNodeFromTemplateJobResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateNodeFromTemplateJobResponse
s@CreateNodeFromTemplateJobResponse' {} Int
a -> CreateNodeFromTemplateJobResponse
s {$sel:httpStatus:CreateNodeFromTemplateJobResponse' :: Int
httpStatus = Int
a} :: CreateNodeFromTemplateJobResponse)

-- | The job\'s ID.
createNodeFromTemplateJobResponse_jobId :: Lens.Lens' CreateNodeFromTemplateJobResponse Prelude.Text
createNodeFromTemplateJobResponse_jobId :: (Text -> f Text)
-> CreateNodeFromTemplateJobResponse
-> f CreateNodeFromTemplateJobResponse
createNodeFromTemplateJobResponse_jobId = (CreateNodeFromTemplateJobResponse -> Text)
-> (CreateNodeFromTemplateJobResponse
    -> Text -> CreateNodeFromTemplateJobResponse)
-> Lens
     CreateNodeFromTemplateJobResponse
     CreateNodeFromTemplateJobResponse
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateNodeFromTemplateJobResponse' {Text
jobId :: Text
$sel:jobId:CreateNodeFromTemplateJobResponse' :: CreateNodeFromTemplateJobResponse -> Text
jobId} -> Text
jobId) (\s :: CreateNodeFromTemplateJobResponse
s@CreateNodeFromTemplateJobResponse' {} Text
a -> CreateNodeFromTemplateJobResponse
s {$sel:jobId:CreateNodeFromTemplateJobResponse' :: Text
jobId = Text
a} :: CreateNodeFromTemplateJobResponse)

instance
  Prelude.NFData
    CreateNodeFromTemplateJobResponse