{-# 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.IoT.UpdateProvisioningTemplate
-- 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)
--
-- Updates a fleet provisioning template.
--
-- Requires permission to access the
-- <https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions UpdateProvisioningTemplate>
-- action.
module Amazonka.IoT.UpdateProvisioningTemplate
  ( -- * Creating a Request
    UpdateProvisioningTemplate (..),
    newUpdateProvisioningTemplate,

    -- * Request Lenses
    updateProvisioningTemplate_preProvisioningHook,
    updateProvisioningTemplate_enabled,
    updateProvisioningTemplate_provisioningRoleArn,
    updateProvisioningTemplate_defaultVersionId,
    updateProvisioningTemplate_removePreProvisioningHook,
    updateProvisioningTemplate_description,
    updateProvisioningTemplate_templateName,

    -- * Destructuring the Response
    UpdateProvisioningTemplateResponse (..),
    newUpdateProvisioningTemplateResponse,

    -- * Response Lenses
    updateProvisioningTemplateResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.IoT.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

-- | /See:/ 'newUpdateProvisioningTemplate' smart constructor.
data UpdateProvisioningTemplate = UpdateProvisioningTemplate'
  { -- | Updates the pre-provisioning hook template.
    UpdateProvisioningTemplate -> Maybe ProvisioningHook
preProvisioningHook :: Prelude.Maybe ProvisioningHook,
    -- | True to enable the fleet provisioning template, otherwise false.
    UpdateProvisioningTemplate -> Maybe Bool
enabled :: Prelude.Maybe Prelude.Bool,
    -- | The ARN of the role associated with the provisioning template. This IoT
    -- role grants permission to provision a device.
    UpdateProvisioningTemplate -> Maybe Text
provisioningRoleArn :: Prelude.Maybe Prelude.Text,
    -- | The ID of the default provisioning template version.
    UpdateProvisioningTemplate -> Maybe Int
defaultVersionId :: Prelude.Maybe Prelude.Int,
    -- | Removes pre-provisioning hook template.
    UpdateProvisioningTemplate -> Maybe Bool
removePreProvisioningHook :: Prelude.Maybe Prelude.Bool,
    -- | The description of the fleet provisioning template.
    UpdateProvisioningTemplate -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The name of the fleet provisioning template.
    UpdateProvisioningTemplate -> Text
templateName :: Prelude.Text
  }
  deriving (UpdateProvisioningTemplate -> UpdateProvisioningTemplate -> Bool
(UpdateProvisioningTemplate -> UpdateProvisioningTemplate -> Bool)
-> (UpdateProvisioningTemplate
    -> UpdateProvisioningTemplate -> Bool)
-> Eq UpdateProvisioningTemplate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateProvisioningTemplate -> UpdateProvisioningTemplate -> Bool
$c/= :: UpdateProvisioningTemplate -> UpdateProvisioningTemplate -> Bool
== :: UpdateProvisioningTemplate -> UpdateProvisioningTemplate -> Bool
$c== :: UpdateProvisioningTemplate -> UpdateProvisioningTemplate -> Bool
Prelude.Eq, ReadPrec [UpdateProvisioningTemplate]
ReadPrec UpdateProvisioningTemplate
Int -> ReadS UpdateProvisioningTemplate
ReadS [UpdateProvisioningTemplate]
(Int -> ReadS UpdateProvisioningTemplate)
-> ReadS [UpdateProvisioningTemplate]
-> ReadPrec UpdateProvisioningTemplate
-> ReadPrec [UpdateProvisioningTemplate]
-> Read UpdateProvisioningTemplate
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateProvisioningTemplate]
$creadListPrec :: ReadPrec [UpdateProvisioningTemplate]
readPrec :: ReadPrec UpdateProvisioningTemplate
$creadPrec :: ReadPrec UpdateProvisioningTemplate
readList :: ReadS [UpdateProvisioningTemplate]
$creadList :: ReadS [UpdateProvisioningTemplate]
readsPrec :: Int -> ReadS UpdateProvisioningTemplate
$creadsPrec :: Int -> ReadS UpdateProvisioningTemplate
Prelude.Read, Int -> UpdateProvisioningTemplate -> ShowS
[UpdateProvisioningTemplate] -> ShowS
UpdateProvisioningTemplate -> String
(Int -> UpdateProvisioningTemplate -> ShowS)
-> (UpdateProvisioningTemplate -> String)
-> ([UpdateProvisioningTemplate] -> ShowS)
-> Show UpdateProvisioningTemplate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateProvisioningTemplate] -> ShowS
$cshowList :: [UpdateProvisioningTemplate] -> ShowS
show :: UpdateProvisioningTemplate -> String
$cshow :: UpdateProvisioningTemplate -> String
showsPrec :: Int -> UpdateProvisioningTemplate -> ShowS
$cshowsPrec :: Int -> UpdateProvisioningTemplate -> ShowS
Prelude.Show, (forall x.
 UpdateProvisioningTemplate -> Rep UpdateProvisioningTemplate x)
-> (forall x.
    Rep UpdateProvisioningTemplate x -> UpdateProvisioningTemplate)
-> Generic UpdateProvisioningTemplate
forall x.
Rep UpdateProvisioningTemplate x -> UpdateProvisioningTemplate
forall x.
UpdateProvisioningTemplate -> Rep UpdateProvisioningTemplate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateProvisioningTemplate x -> UpdateProvisioningTemplate
$cfrom :: forall x.
UpdateProvisioningTemplate -> Rep UpdateProvisioningTemplate x
Prelude.Generic)

-- |
-- Create a value of 'UpdateProvisioningTemplate' 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:
--
-- 'preProvisioningHook', 'updateProvisioningTemplate_preProvisioningHook' - Updates the pre-provisioning hook template.
--
-- 'enabled', 'updateProvisioningTemplate_enabled' - True to enable the fleet provisioning template, otherwise false.
--
-- 'provisioningRoleArn', 'updateProvisioningTemplate_provisioningRoleArn' - The ARN of the role associated with the provisioning template. This IoT
-- role grants permission to provision a device.
--
-- 'defaultVersionId', 'updateProvisioningTemplate_defaultVersionId' - The ID of the default provisioning template version.
--
-- 'removePreProvisioningHook', 'updateProvisioningTemplate_removePreProvisioningHook' - Removes pre-provisioning hook template.
--
-- 'description', 'updateProvisioningTemplate_description' - The description of the fleet provisioning template.
--
-- 'templateName', 'updateProvisioningTemplate_templateName' - The name of the fleet provisioning template.
newUpdateProvisioningTemplate ::
  -- | 'templateName'
  Prelude.Text ->
  UpdateProvisioningTemplate
newUpdateProvisioningTemplate :: Text -> UpdateProvisioningTemplate
newUpdateProvisioningTemplate Text
pTemplateName_ =
  UpdateProvisioningTemplate' :: Maybe ProvisioningHook
-> Maybe Bool
-> Maybe Text
-> Maybe Int
-> Maybe Bool
-> Maybe Text
-> Text
-> UpdateProvisioningTemplate
UpdateProvisioningTemplate'
    { $sel:preProvisioningHook:UpdateProvisioningTemplate' :: Maybe ProvisioningHook
preProvisioningHook =
        Maybe ProvisioningHook
forall a. Maybe a
Prelude.Nothing,
      $sel:enabled:UpdateProvisioningTemplate' :: Maybe Bool
enabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:provisioningRoleArn:UpdateProvisioningTemplate' :: Maybe Text
provisioningRoleArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:defaultVersionId:UpdateProvisioningTemplate' :: Maybe Int
defaultVersionId = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:removePreProvisioningHook:UpdateProvisioningTemplate' :: Maybe Bool
removePreProvisioningHook = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:description:UpdateProvisioningTemplate' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:templateName:UpdateProvisioningTemplate' :: Text
templateName = Text
pTemplateName_
    }

-- | Updates the pre-provisioning hook template.
updateProvisioningTemplate_preProvisioningHook :: Lens.Lens' UpdateProvisioningTemplate (Prelude.Maybe ProvisioningHook)
updateProvisioningTemplate_preProvisioningHook :: (Maybe ProvisioningHook -> f (Maybe ProvisioningHook))
-> UpdateProvisioningTemplate -> f UpdateProvisioningTemplate
updateProvisioningTemplate_preProvisioningHook = (UpdateProvisioningTemplate -> Maybe ProvisioningHook)
-> (UpdateProvisioningTemplate
    -> Maybe ProvisioningHook -> UpdateProvisioningTemplate)
-> Lens
     UpdateProvisioningTemplate
     UpdateProvisioningTemplate
     (Maybe ProvisioningHook)
     (Maybe ProvisioningHook)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateProvisioningTemplate' {Maybe ProvisioningHook
preProvisioningHook :: Maybe ProvisioningHook
$sel:preProvisioningHook:UpdateProvisioningTemplate' :: UpdateProvisioningTemplate -> Maybe ProvisioningHook
preProvisioningHook} -> Maybe ProvisioningHook
preProvisioningHook) (\s :: UpdateProvisioningTemplate
s@UpdateProvisioningTemplate' {} Maybe ProvisioningHook
a -> UpdateProvisioningTemplate
s {$sel:preProvisioningHook:UpdateProvisioningTemplate' :: Maybe ProvisioningHook
preProvisioningHook = Maybe ProvisioningHook
a} :: UpdateProvisioningTemplate)

-- | True to enable the fleet provisioning template, otherwise false.
updateProvisioningTemplate_enabled :: Lens.Lens' UpdateProvisioningTemplate (Prelude.Maybe Prelude.Bool)
updateProvisioningTemplate_enabled :: (Maybe Bool -> f (Maybe Bool))
-> UpdateProvisioningTemplate -> f UpdateProvisioningTemplate
updateProvisioningTemplate_enabled = (UpdateProvisioningTemplate -> Maybe Bool)
-> (UpdateProvisioningTemplate
    -> Maybe Bool -> UpdateProvisioningTemplate)
-> Lens
     UpdateProvisioningTemplate
     UpdateProvisioningTemplate
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateProvisioningTemplate' {Maybe Bool
enabled :: Maybe Bool
$sel:enabled:UpdateProvisioningTemplate' :: UpdateProvisioningTemplate -> Maybe Bool
enabled} -> Maybe Bool
enabled) (\s :: UpdateProvisioningTemplate
s@UpdateProvisioningTemplate' {} Maybe Bool
a -> UpdateProvisioningTemplate
s {$sel:enabled:UpdateProvisioningTemplate' :: Maybe Bool
enabled = Maybe Bool
a} :: UpdateProvisioningTemplate)

-- | The ARN of the role associated with the provisioning template. This IoT
-- role grants permission to provision a device.
updateProvisioningTemplate_provisioningRoleArn :: Lens.Lens' UpdateProvisioningTemplate (Prelude.Maybe Prelude.Text)
updateProvisioningTemplate_provisioningRoleArn :: (Maybe Text -> f (Maybe Text))
-> UpdateProvisioningTemplate -> f UpdateProvisioningTemplate
updateProvisioningTemplate_provisioningRoleArn = (UpdateProvisioningTemplate -> Maybe Text)
-> (UpdateProvisioningTemplate
    -> Maybe Text -> UpdateProvisioningTemplate)
-> Lens
     UpdateProvisioningTemplate
     UpdateProvisioningTemplate
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateProvisioningTemplate' {Maybe Text
provisioningRoleArn :: Maybe Text
$sel:provisioningRoleArn:UpdateProvisioningTemplate' :: UpdateProvisioningTemplate -> Maybe Text
provisioningRoleArn} -> Maybe Text
provisioningRoleArn) (\s :: UpdateProvisioningTemplate
s@UpdateProvisioningTemplate' {} Maybe Text
a -> UpdateProvisioningTemplate
s {$sel:provisioningRoleArn:UpdateProvisioningTemplate' :: Maybe Text
provisioningRoleArn = Maybe Text
a} :: UpdateProvisioningTemplate)

-- | The ID of the default provisioning template version.
updateProvisioningTemplate_defaultVersionId :: Lens.Lens' UpdateProvisioningTemplate (Prelude.Maybe Prelude.Int)
updateProvisioningTemplate_defaultVersionId :: (Maybe Int -> f (Maybe Int))
-> UpdateProvisioningTemplate -> f UpdateProvisioningTemplate
updateProvisioningTemplate_defaultVersionId = (UpdateProvisioningTemplate -> Maybe Int)
-> (UpdateProvisioningTemplate
    -> Maybe Int -> UpdateProvisioningTemplate)
-> Lens
     UpdateProvisioningTemplate
     UpdateProvisioningTemplate
     (Maybe Int)
     (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateProvisioningTemplate' {Maybe Int
defaultVersionId :: Maybe Int
$sel:defaultVersionId:UpdateProvisioningTemplate' :: UpdateProvisioningTemplate -> Maybe Int
defaultVersionId} -> Maybe Int
defaultVersionId) (\s :: UpdateProvisioningTemplate
s@UpdateProvisioningTemplate' {} Maybe Int
a -> UpdateProvisioningTemplate
s {$sel:defaultVersionId:UpdateProvisioningTemplate' :: Maybe Int
defaultVersionId = Maybe Int
a} :: UpdateProvisioningTemplate)

-- | Removes pre-provisioning hook template.
updateProvisioningTemplate_removePreProvisioningHook :: Lens.Lens' UpdateProvisioningTemplate (Prelude.Maybe Prelude.Bool)
updateProvisioningTemplate_removePreProvisioningHook :: (Maybe Bool -> f (Maybe Bool))
-> UpdateProvisioningTemplate -> f UpdateProvisioningTemplate
updateProvisioningTemplate_removePreProvisioningHook = (UpdateProvisioningTemplate -> Maybe Bool)
-> (UpdateProvisioningTemplate
    -> Maybe Bool -> UpdateProvisioningTemplate)
-> Lens
     UpdateProvisioningTemplate
     UpdateProvisioningTemplate
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateProvisioningTemplate' {Maybe Bool
removePreProvisioningHook :: Maybe Bool
$sel:removePreProvisioningHook:UpdateProvisioningTemplate' :: UpdateProvisioningTemplate -> Maybe Bool
removePreProvisioningHook} -> Maybe Bool
removePreProvisioningHook) (\s :: UpdateProvisioningTemplate
s@UpdateProvisioningTemplate' {} Maybe Bool
a -> UpdateProvisioningTemplate
s {$sel:removePreProvisioningHook:UpdateProvisioningTemplate' :: Maybe Bool
removePreProvisioningHook = Maybe Bool
a} :: UpdateProvisioningTemplate)

-- | The description of the fleet provisioning template.
updateProvisioningTemplate_description :: Lens.Lens' UpdateProvisioningTemplate (Prelude.Maybe Prelude.Text)
updateProvisioningTemplate_description :: (Maybe Text -> f (Maybe Text))
-> UpdateProvisioningTemplate -> f UpdateProvisioningTemplate
updateProvisioningTemplate_description = (UpdateProvisioningTemplate -> Maybe Text)
-> (UpdateProvisioningTemplate
    -> Maybe Text -> UpdateProvisioningTemplate)
-> Lens
     UpdateProvisioningTemplate
     UpdateProvisioningTemplate
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateProvisioningTemplate' {Maybe Text
description :: Maybe Text
$sel:description:UpdateProvisioningTemplate' :: UpdateProvisioningTemplate -> Maybe Text
description} -> Maybe Text
description) (\s :: UpdateProvisioningTemplate
s@UpdateProvisioningTemplate' {} Maybe Text
a -> UpdateProvisioningTemplate
s {$sel:description:UpdateProvisioningTemplate' :: Maybe Text
description = Maybe Text
a} :: UpdateProvisioningTemplate)

-- | The name of the fleet provisioning template.
updateProvisioningTemplate_templateName :: Lens.Lens' UpdateProvisioningTemplate Prelude.Text
updateProvisioningTemplate_templateName :: (Text -> f Text)
-> UpdateProvisioningTemplate -> f UpdateProvisioningTemplate
updateProvisioningTemplate_templateName = (UpdateProvisioningTemplate -> Text)
-> (UpdateProvisioningTemplate
    -> Text -> UpdateProvisioningTemplate)
-> Lens
     UpdateProvisioningTemplate UpdateProvisioningTemplate Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateProvisioningTemplate' {Text
templateName :: Text
$sel:templateName:UpdateProvisioningTemplate' :: UpdateProvisioningTemplate -> Text
templateName} -> Text
templateName) (\s :: UpdateProvisioningTemplate
s@UpdateProvisioningTemplate' {} Text
a -> UpdateProvisioningTemplate
s {$sel:templateName:UpdateProvisioningTemplate' :: Text
templateName = Text
a} :: UpdateProvisioningTemplate)

instance Core.AWSRequest UpdateProvisioningTemplate where
  type
    AWSResponse UpdateProvisioningTemplate =
      UpdateProvisioningTemplateResponse
  request :: UpdateProvisioningTemplate -> Request UpdateProvisioningTemplate
request = Service
-> UpdateProvisioningTemplate -> Request UpdateProvisioningTemplate
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.patchJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdateProvisioningTemplate
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateProvisioningTemplate)))
response =
    (Int
 -> ResponseHeaders
 -> ()
 -> Either String (AWSResponse UpdateProvisioningTemplate))
-> Logger
-> Service
-> Proxy UpdateProvisioningTemplate
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateProvisioningTemplate)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
      ( \Int
s ResponseHeaders
h ()
x ->
          Int -> UpdateProvisioningTemplateResponse
UpdateProvisioningTemplateResponse'
            (Int -> UpdateProvisioningTemplateResponse)
-> Either String Int
-> Either String UpdateProvisioningTemplateResponse
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))
      )

instance Prelude.Hashable UpdateProvisioningTemplate

instance Prelude.NFData UpdateProvisioningTemplate

instance Core.ToHeaders UpdateProvisioningTemplate where
  toHeaders :: UpdateProvisioningTemplate -> ResponseHeaders
toHeaders = ResponseHeaders -> UpdateProvisioningTemplate -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty

instance Core.ToJSON UpdateProvisioningTemplate where
  toJSON :: UpdateProvisioningTemplate -> Value
toJSON UpdateProvisioningTemplate' {Maybe Bool
Maybe Int
Maybe Text
Maybe ProvisioningHook
Text
templateName :: Text
description :: Maybe Text
removePreProvisioningHook :: Maybe Bool
defaultVersionId :: Maybe Int
provisioningRoleArn :: Maybe Text
enabled :: Maybe Bool
preProvisioningHook :: Maybe ProvisioningHook
$sel:templateName:UpdateProvisioningTemplate' :: UpdateProvisioningTemplate -> Text
$sel:description:UpdateProvisioningTemplate' :: UpdateProvisioningTemplate -> Maybe Text
$sel:removePreProvisioningHook:UpdateProvisioningTemplate' :: UpdateProvisioningTemplate -> Maybe Bool
$sel:defaultVersionId:UpdateProvisioningTemplate' :: UpdateProvisioningTemplate -> Maybe Int
$sel:provisioningRoleArn:UpdateProvisioningTemplate' :: UpdateProvisioningTemplate -> Maybe Text
$sel:enabled:UpdateProvisioningTemplate' :: UpdateProvisioningTemplate -> Maybe Bool
$sel:preProvisioningHook:UpdateProvisioningTemplate' :: UpdateProvisioningTemplate -> Maybe ProvisioningHook
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"preProvisioningHook" Text -> ProvisioningHook -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (ProvisioningHook -> Pair) -> Maybe ProvisioningHook -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ProvisioningHook
preProvisioningHook,
            (Text
"enabled" 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
enabled,
            (Text
"provisioningRoleArn" 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
provisioningRoleArn,
            (Text
"defaultVersionId" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
defaultVersionId,
            (Text
"removePreProvisioningHook" 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
removePreProvisioningHook,
            (Text
"description" 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
description
          ]
      )

instance Core.ToPath UpdateProvisioningTemplate where
  toPath :: UpdateProvisioningTemplate -> ByteString
toPath UpdateProvisioningTemplate' {Maybe Bool
Maybe Int
Maybe Text
Maybe ProvisioningHook
Text
templateName :: Text
description :: Maybe Text
removePreProvisioningHook :: Maybe Bool
defaultVersionId :: Maybe Int
provisioningRoleArn :: Maybe Text
enabled :: Maybe Bool
preProvisioningHook :: Maybe ProvisioningHook
$sel:templateName:UpdateProvisioningTemplate' :: UpdateProvisioningTemplate -> Text
$sel:description:UpdateProvisioningTemplate' :: UpdateProvisioningTemplate -> Maybe Text
$sel:removePreProvisioningHook:UpdateProvisioningTemplate' :: UpdateProvisioningTemplate -> Maybe Bool
$sel:defaultVersionId:UpdateProvisioningTemplate' :: UpdateProvisioningTemplate -> Maybe Int
$sel:provisioningRoleArn:UpdateProvisioningTemplate' :: UpdateProvisioningTemplate -> Maybe Text
$sel:enabled:UpdateProvisioningTemplate' :: UpdateProvisioningTemplate -> Maybe Bool
$sel:preProvisioningHook:UpdateProvisioningTemplate' :: UpdateProvisioningTemplate -> Maybe ProvisioningHook
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/provisioning-templates/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
templateName]

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

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

-- |
-- Create a value of 'UpdateProvisioningTemplateResponse' 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', 'updateProvisioningTemplateResponse_httpStatus' - The response's http status code.
newUpdateProvisioningTemplateResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateProvisioningTemplateResponse
newUpdateProvisioningTemplateResponse :: Int -> UpdateProvisioningTemplateResponse
newUpdateProvisioningTemplateResponse Int
pHttpStatus_ =
  UpdateProvisioningTemplateResponse' :: Int -> UpdateProvisioningTemplateResponse
UpdateProvisioningTemplateResponse'
    { $sel:httpStatus:UpdateProvisioningTemplateResponse' :: Int
httpStatus =
        Int
pHttpStatus_
    }

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

instance
  Prelude.NFData
    UpdateProvisioningTemplateResponse