{-# 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.DescribeProvisioningTemplate
-- 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)
--
-- Returns information about 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 DescribeProvisioningTemplate>
-- action.
module Amazonka.IoT.DescribeProvisioningTemplate
  ( -- * Creating a Request
    DescribeProvisioningTemplate (..),
    newDescribeProvisioningTemplate,

    -- * Request Lenses
    describeProvisioningTemplate_templateName,

    -- * Destructuring the Response
    DescribeProvisioningTemplateResponse (..),
    newDescribeProvisioningTemplateResponse,

    -- * Response Lenses
    describeProvisioningTemplateResponse_lastModifiedDate,
    describeProvisioningTemplateResponse_templateName,
    describeProvisioningTemplateResponse_preProvisioningHook,
    describeProvisioningTemplateResponse_enabled,
    describeProvisioningTemplateResponse_provisioningRoleArn,
    describeProvisioningTemplateResponse_defaultVersionId,
    describeProvisioningTemplateResponse_creationDate,
    describeProvisioningTemplateResponse_templateArn,
    describeProvisioningTemplateResponse_templateBody,
    describeProvisioningTemplateResponse_description,
    describeProvisioningTemplateResponse_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:/ 'newDescribeProvisioningTemplate' smart constructor.
data DescribeProvisioningTemplate = DescribeProvisioningTemplate'
  { -- | The name of the fleet provisioning template.
    DescribeProvisioningTemplate -> Text
templateName :: Prelude.Text
  }
  deriving (DescribeProvisioningTemplate
-> DescribeProvisioningTemplate -> Bool
(DescribeProvisioningTemplate
 -> DescribeProvisioningTemplate -> Bool)
-> (DescribeProvisioningTemplate
    -> DescribeProvisioningTemplate -> Bool)
-> Eq DescribeProvisioningTemplate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeProvisioningTemplate
-> DescribeProvisioningTemplate -> Bool
$c/= :: DescribeProvisioningTemplate
-> DescribeProvisioningTemplate -> Bool
== :: DescribeProvisioningTemplate
-> DescribeProvisioningTemplate -> Bool
$c== :: DescribeProvisioningTemplate
-> DescribeProvisioningTemplate -> Bool
Prelude.Eq, ReadPrec [DescribeProvisioningTemplate]
ReadPrec DescribeProvisioningTemplate
Int -> ReadS DescribeProvisioningTemplate
ReadS [DescribeProvisioningTemplate]
(Int -> ReadS DescribeProvisioningTemplate)
-> ReadS [DescribeProvisioningTemplate]
-> ReadPrec DescribeProvisioningTemplate
-> ReadPrec [DescribeProvisioningTemplate]
-> Read DescribeProvisioningTemplate
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeProvisioningTemplate]
$creadListPrec :: ReadPrec [DescribeProvisioningTemplate]
readPrec :: ReadPrec DescribeProvisioningTemplate
$creadPrec :: ReadPrec DescribeProvisioningTemplate
readList :: ReadS [DescribeProvisioningTemplate]
$creadList :: ReadS [DescribeProvisioningTemplate]
readsPrec :: Int -> ReadS DescribeProvisioningTemplate
$creadsPrec :: Int -> ReadS DescribeProvisioningTemplate
Prelude.Read, Int -> DescribeProvisioningTemplate -> ShowS
[DescribeProvisioningTemplate] -> ShowS
DescribeProvisioningTemplate -> String
(Int -> DescribeProvisioningTemplate -> ShowS)
-> (DescribeProvisioningTemplate -> String)
-> ([DescribeProvisioningTemplate] -> ShowS)
-> Show DescribeProvisioningTemplate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeProvisioningTemplate] -> ShowS
$cshowList :: [DescribeProvisioningTemplate] -> ShowS
show :: DescribeProvisioningTemplate -> String
$cshow :: DescribeProvisioningTemplate -> String
showsPrec :: Int -> DescribeProvisioningTemplate -> ShowS
$cshowsPrec :: Int -> DescribeProvisioningTemplate -> ShowS
Prelude.Show, (forall x.
 DescribeProvisioningTemplate -> Rep DescribeProvisioningTemplate x)
-> (forall x.
    Rep DescribeProvisioningTemplate x -> DescribeProvisioningTemplate)
-> Generic DescribeProvisioningTemplate
forall x.
Rep DescribeProvisioningTemplate x -> DescribeProvisioningTemplate
forall x.
DescribeProvisioningTemplate -> Rep DescribeProvisioningTemplate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeProvisioningTemplate x -> DescribeProvisioningTemplate
$cfrom :: forall x.
DescribeProvisioningTemplate -> Rep DescribeProvisioningTemplate x
Prelude.Generic)

-- |
-- Create a value of 'DescribeProvisioningTemplate' 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:
--
-- 'templateName', 'describeProvisioningTemplate_templateName' - The name of the fleet provisioning template.
newDescribeProvisioningTemplate ::
  -- | 'templateName'
  Prelude.Text ->
  DescribeProvisioningTemplate
newDescribeProvisioningTemplate :: Text -> DescribeProvisioningTemplate
newDescribeProvisioningTemplate Text
pTemplateName_ =
  DescribeProvisioningTemplate' :: Text -> DescribeProvisioningTemplate
DescribeProvisioningTemplate'
    { $sel:templateName:DescribeProvisioningTemplate' :: Text
templateName =
        Text
pTemplateName_
    }

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

instance Core.AWSRequest DescribeProvisioningTemplate where
  type
    AWSResponse DescribeProvisioningTemplate =
      DescribeProvisioningTemplateResponse
  request :: DescribeProvisioningTemplate
-> Request DescribeProvisioningTemplate
request = Service
-> DescribeProvisioningTemplate
-> Request DescribeProvisioningTemplate
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy DescribeProvisioningTemplate
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeProvisioningTemplate)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse DescribeProvisioningTemplate))
-> Logger
-> Service
-> Proxy DescribeProvisioningTemplate
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeProvisioningTemplate)))
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 POSIX
-> Maybe Text
-> Maybe ProvisioningHook
-> Maybe Bool
-> Maybe Text
-> Maybe Int
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Int
-> DescribeProvisioningTemplateResponse
DescribeProvisioningTemplateResponse'
            (Maybe POSIX
 -> Maybe Text
 -> Maybe ProvisioningHook
 -> Maybe Bool
 -> Maybe Text
 -> Maybe Int
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Int
 -> DescribeProvisioningTemplateResponse)
-> Either String (Maybe POSIX)
-> Either
     String
     (Maybe Text
      -> Maybe ProvisioningHook
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Int
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> DescribeProvisioningTemplateResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"lastModifiedDate")
            Either
  String
  (Maybe Text
   -> Maybe ProvisioningHook
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Int
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> DescribeProvisioningTemplateResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe ProvisioningHook
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Int
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> DescribeProvisioningTemplateResponse)
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
"templateName")
            Either
  String
  (Maybe ProvisioningHook
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Int
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> DescribeProvisioningTemplateResponse)
-> Either String (Maybe ProvisioningHook)
-> Either
     String
     (Maybe Bool
      -> Maybe Text
      -> Maybe Int
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> DescribeProvisioningTemplateResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe ProvisioningHook)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"preProvisioningHook")
            Either
  String
  (Maybe Bool
   -> Maybe Text
   -> Maybe Int
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> DescribeProvisioningTemplateResponse)
-> Either String (Maybe Bool)
-> Either
     String
     (Maybe Text
      -> Maybe Int
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> DescribeProvisioningTemplateResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"enabled")
            Either
  String
  (Maybe Text
   -> Maybe Int
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> DescribeProvisioningTemplateResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Int
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> DescribeProvisioningTemplateResponse)
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
"provisioningRoleArn")
            Either
  String
  (Maybe Int
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> DescribeProvisioningTemplateResponse)
-> Either String (Maybe Int)
-> Either
     String
     (Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> DescribeProvisioningTemplateResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Int)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"defaultVersionId")
            Either
  String
  (Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> DescribeProvisioningTemplateResponse)
-> Either String (Maybe POSIX)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> DescribeProvisioningTemplateResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"creationDate")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> DescribeProvisioningTemplateResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text -> Int -> DescribeProvisioningTemplateResponse)
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
"templateArn")
            Either
  String
  (Maybe Text
   -> Maybe Text -> Int -> DescribeProvisioningTemplateResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe Text -> Int -> DescribeProvisioningTemplateResponse)
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
"templateBody")
            Either
  String (Maybe Text -> Int -> DescribeProvisioningTemplateResponse)
-> Either String (Maybe Text)
-> Either String (Int -> DescribeProvisioningTemplateResponse)
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
"description")
            Either String (Int -> DescribeProvisioningTemplateResponse)
-> Either String Int
-> Either String DescribeProvisioningTemplateResponse
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
    DescribeProvisioningTemplate

instance Prelude.NFData DescribeProvisioningTemplate

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

instance Core.ToPath DescribeProvisioningTemplate where
  toPath :: DescribeProvisioningTemplate -> ByteString
toPath DescribeProvisioningTemplate' {Text
templateName :: Text
$sel:templateName:DescribeProvisioningTemplate' :: DescribeProvisioningTemplate -> Text
..} =
    [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 DescribeProvisioningTemplate where
  toQuery :: DescribeProvisioningTemplate -> QueryString
toQuery = QueryString -> DescribeProvisioningTemplate -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newDescribeProvisioningTemplateResponse' smart constructor.
data DescribeProvisioningTemplateResponse = DescribeProvisioningTemplateResponse'
  { -- | The date when the fleet provisioning template was last modified.
    DescribeProvisioningTemplateResponse -> Maybe POSIX
lastModifiedDate :: Prelude.Maybe Core.POSIX,
    -- | The name of the fleet provisioning template.
    DescribeProvisioningTemplateResponse -> Maybe Text
templateName :: Prelude.Maybe Prelude.Text,
    -- | Gets information about a pre-provisioned hook.
    DescribeProvisioningTemplateResponse -> Maybe ProvisioningHook
preProvisioningHook :: Prelude.Maybe ProvisioningHook,
    -- | True if the fleet provisioning template is enabled, otherwise false.
    DescribeProvisioningTemplateResponse -> 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.
    DescribeProvisioningTemplateResponse -> Maybe Text
provisioningRoleArn :: Prelude.Maybe Prelude.Text,
    -- | The default fleet template version ID.
    DescribeProvisioningTemplateResponse -> Maybe Int
defaultVersionId :: Prelude.Maybe Prelude.Int,
    -- | The date when the fleet provisioning template was created.
    DescribeProvisioningTemplateResponse -> Maybe POSIX
creationDate :: Prelude.Maybe Core.POSIX,
    -- | The ARN of the fleet provisioning template.
    DescribeProvisioningTemplateResponse -> Maybe Text
templateArn :: Prelude.Maybe Prelude.Text,
    -- | The JSON formatted contents of the fleet provisioning template.
    DescribeProvisioningTemplateResponse -> Maybe Text
templateBody :: Prelude.Maybe Prelude.Text,
    -- | The description of the fleet provisioning template.
    DescribeProvisioningTemplateResponse -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    DescribeProvisioningTemplateResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeProvisioningTemplateResponse
-> DescribeProvisioningTemplateResponse -> Bool
(DescribeProvisioningTemplateResponse
 -> DescribeProvisioningTemplateResponse -> Bool)
-> (DescribeProvisioningTemplateResponse
    -> DescribeProvisioningTemplateResponse -> Bool)
-> Eq DescribeProvisioningTemplateResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeProvisioningTemplateResponse
-> DescribeProvisioningTemplateResponse -> Bool
$c/= :: DescribeProvisioningTemplateResponse
-> DescribeProvisioningTemplateResponse -> Bool
== :: DescribeProvisioningTemplateResponse
-> DescribeProvisioningTemplateResponse -> Bool
$c== :: DescribeProvisioningTemplateResponse
-> DescribeProvisioningTemplateResponse -> Bool
Prelude.Eq, ReadPrec [DescribeProvisioningTemplateResponse]
ReadPrec DescribeProvisioningTemplateResponse
Int -> ReadS DescribeProvisioningTemplateResponse
ReadS [DescribeProvisioningTemplateResponse]
(Int -> ReadS DescribeProvisioningTemplateResponse)
-> ReadS [DescribeProvisioningTemplateResponse]
-> ReadPrec DescribeProvisioningTemplateResponse
-> ReadPrec [DescribeProvisioningTemplateResponse]
-> Read DescribeProvisioningTemplateResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeProvisioningTemplateResponse]
$creadListPrec :: ReadPrec [DescribeProvisioningTemplateResponse]
readPrec :: ReadPrec DescribeProvisioningTemplateResponse
$creadPrec :: ReadPrec DescribeProvisioningTemplateResponse
readList :: ReadS [DescribeProvisioningTemplateResponse]
$creadList :: ReadS [DescribeProvisioningTemplateResponse]
readsPrec :: Int -> ReadS DescribeProvisioningTemplateResponse
$creadsPrec :: Int -> ReadS DescribeProvisioningTemplateResponse
Prelude.Read, Int -> DescribeProvisioningTemplateResponse -> ShowS
[DescribeProvisioningTemplateResponse] -> ShowS
DescribeProvisioningTemplateResponse -> String
(Int -> DescribeProvisioningTemplateResponse -> ShowS)
-> (DescribeProvisioningTemplateResponse -> String)
-> ([DescribeProvisioningTemplateResponse] -> ShowS)
-> Show DescribeProvisioningTemplateResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeProvisioningTemplateResponse] -> ShowS
$cshowList :: [DescribeProvisioningTemplateResponse] -> ShowS
show :: DescribeProvisioningTemplateResponse -> String
$cshow :: DescribeProvisioningTemplateResponse -> String
showsPrec :: Int -> DescribeProvisioningTemplateResponse -> ShowS
$cshowsPrec :: Int -> DescribeProvisioningTemplateResponse -> ShowS
Prelude.Show, (forall x.
 DescribeProvisioningTemplateResponse
 -> Rep DescribeProvisioningTemplateResponse x)
-> (forall x.
    Rep DescribeProvisioningTemplateResponse x
    -> DescribeProvisioningTemplateResponse)
-> Generic DescribeProvisioningTemplateResponse
forall x.
Rep DescribeProvisioningTemplateResponse x
-> DescribeProvisioningTemplateResponse
forall x.
DescribeProvisioningTemplateResponse
-> Rep DescribeProvisioningTemplateResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeProvisioningTemplateResponse x
-> DescribeProvisioningTemplateResponse
$cfrom :: forall x.
DescribeProvisioningTemplateResponse
-> Rep DescribeProvisioningTemplateResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeProvisioningTemplateResponse' 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:
--
-- 'lastModifiedDate', 'describeProvisioningTemplateResponse_lastModifiedDate' - The date when the fleet provisioning template was last modified.
--
-- 'templateName', 'describeProvisioningTemplateResponse_templateName' - The name of the fleet provisioning template.
--
-- 'preProvisioningHook', 'describeProvisioningTemplateResponse_preProvisioningHook' - Gets information about a pre-provisioned hook.
--
-- 'enabled', 'describeProvisioningTemplateResponse_enabled' - True if the fleet provisioning template is enabled, otherwise false.
--
-- 'provisioningRoleArn', 'describeProvisioningTemplateResponse_provisioningRoleArn' - The ARN of the role associated with the provisioning template. This IoT
-- role grants permission to provision a device.
--
-- 'defaultVersionId', 'describeProvisioningTemplateResponse_defaultVersionId' - The default fleet template version ID.
--
-- 'creationDate', 'describeProvisioningTemplateResponse_creationDate' - The date when the fleet provisioning template was created.
--
-- 'templateArn', 'describeProvisioningTemplateResponse_templateArn' - The ARN of the fleet provisioning template.
--
-- 'templateBody', 'describeProvisioningTemplateResponse_templateBody' - The JSON formatted contents of the fleet provisioning template.
--
-- 'description', 'describeProvisioningTemplateResponse_description' - The description of the fleet provisioning template.
--
-- 'httpStatus', 'describeProvisioningTemplateResponse_httpStatus' - The response's http status code.
newDescribeProvisioningTemplateResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeProvisioningTemplateResponse
newDescribeProvisioningTemplateResponse :: Int -> DescribeProvisioningTemplateResponse
newDescribeProvisioningTemplateResponse Int
pHttpStatus_ =
  DescribeProvisioningTemplateResponse' :: Maybe POSIX
-> Maybe Text
-> Maybe ProvisioningHook
-> Maybe Bool
-> Maybe Text
-> Maybe Int
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Int
-> DescribeProvisioningTemplateResponse
DescribeProvisioningTemplateResponse'
    { $sel:lastModifiedDate:DescribeProvisioningTemplateResponse' :: Maybe POSIX
lastModifiedDate =
        Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:templateName:DescribeProvisioningTemplateResponse' :: Maybe Text
templateName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:preProvisioningHook:DescribeProvisioningTemplateResponse' :: Maybe ProvisioningHook
preProvisioningHook = Maybe ProvisioningHook
forall a. Maybe a
Prelude.Nothing,
      $sel:enabled:DescribeProvisioningTemplateResponse' :: Maybe Bool
enabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:provisioningRoleArn:DescribeProvisioningTemplateResponse' :: Maybe Text
provisioningRoleArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:defaultVersionId:DescribeProvisioningTemplateResponse' :: Maybe Int
defaultVersionId = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:creationDate:DescribeProvisioningTemplateResponse' :: Maybe POSIX
creationDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:templateArn:DescribeProvisioningTemplateResponse' :: Maybe Text
templateArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:templateBody:DescribeProvisioningTemplateResponse' :: Maybe Text
templateBody = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:description:DescribeProvisioningTemplateResponse' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeProvisioningTemplateResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The date when the fleet provisioning template was last modified.
describeProvisioningTemplateResponse_lastModifiedDate :: Lens.Lens' DescribeProvisioningTemplateResponse (Prelude.Maybe Prelude.UTCTime)
describeProvisioningTemplateResponse_lastModifiedDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> DescribeProvisioningTemplateResponse
-> f DescribeProvisioningTemplateResponse
describeProvisioningTemplateResponse_lastModifiedDate = (DescribeProvisioningTemplateResponse -> Maybe POSIX)
-> (DescribeProvisioningTemplateResponse
    -> Maybe POSIX -> DescribeProvisioningTemplateResponse)
-> Lens
     DescribeProvisioningTemplateResponse
     DescribeProvisioningTemplateResponse
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeProvisioningTemplateResponse' {Maybe POSIX
lastModifiedDate :: Maybe POSIX
$sel:lastModifiedDate:DescribeProvisioningTemplateResponse' :: DescribeProvisioningTemplateResponse -> Maybe POSIX
lastModifiedDate} -> Maybe POSIX
lastModifiedDate) (\s :: DescribeProvisioningTemplateResponse
s@DescribeProvisioningTemplateResponse' {} Maybe POSIX
a -> DescribeProvisioningTemplateResponse
s {$sel:lastModifiedDate:DescribeProvisioningTemplateResponse' :: Maybe POSIX
lastModifiedDate = Maybe POSIX
a} :: DescribeProvisioningTemplateResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> DescribeProvisioningTemplateResponse
 -> f DescribeProvisioningTemplateResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> DescribeProvisioningTemplateResponse
-> f DescribeProvisioningTemplateResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

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

-- | Gets information about a pre-provisioned hook.
describeProvisioningTemplateResponse_preProvisioningHook :: Lens.Lens' DescribeProvisioningTemplateResponse (Prelude.Maybe ProvisioningHook)
describeProvisioningTemplateResponse_preProvisioningHook :: (Maybe ProvisioningHook -> f (Maybe ProvisioningHook))
-> DescribeProvisioningTemplateResponse
-> f DescribeProvisioningTemplateResponse
describeProvisioningTemplateResponse_preProvisioningHook = (DescribeProvisioningTemplateResponse -> Maybe ProvisioningHook)
-> (DescribeProvisioningTemplateResponse
    -> Maybe ProvisioningHook -> DescribeProvisioningTemplateResponse)
-> Lens
     DescribeProvisioningTemplateResponse
     DescribeProvisioningTemplateResponse
     (Maybe ProvisioningHook)
     (Maybe ProvisioningHook)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeProvisioningTemplateResponse' {Maybe ProvisioningHook
preProvisioningHook :: Maybe ProvisioningHook
$sel:preProvisioningHook:DescribeProvisioningTemplateResponse' :: DescribeProvisioningTemplateResponse -> Maybe ProvisioningHook
preProvisioningHook} -> Maybe ProvisioningHook
preProvisioningHook) (\s :: DescribeProvisioningTemplateResponse
s@DescribeProvisioningTemplateResponse' {} Maybe ProvisioningHook
a -> DescribeProvisioningTemplateResponse
s {$sel:preProvisioningHook:DescribeProvisioningTemplateResponse' :: Maybe ProvisioningHook
preProvisioningHook = Maybe ProvisioningHook
a} :: DescribeProvisioningTemplateResponse)

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

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

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

-- | The date when the fleet provisioning template was created.
describeProvisioningTemplateResponse_creationDate :: Lens.Lens' DescribeProvisioningTemplateResponse (Prelude.Maybe Prelude.UTCTime)
describeProvisioningTemplateResponse_creationDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> DescribeProvisioningTemplateResponse
-> f DescribeProvisioningTemplateResponse
describeProvisioningTemplateResponse_creationDate = (DescribeProvisioningTemplateResponse -> Maybe POSIX)
-> (DescribeProvisioningTemplateResponse
    -> Maybe POSIX -> DescribeProvisioningTemplateResponse)
-> Lens
     DescribeProvisioningTemplateResponse
     DescribeProvisioningTemplateResponse
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeProvisioningTemplateResponse' {Maybe POSIX
creationDate :: Maybe POSIX
$sel:creationDate:DescribeProvisioningTemplateResponse' :: DescribeProvisioningTemplateResponse -> Maybe POSIX
creationDate} -> Maybe POSIX
creationDate) (\s :: DescribeProvisioningTemplateResponse
s@DescribeProvisioningTemplateResponse' {} Maybe POSIX
a -> DescribeProvisioningTemplateResponse
s {$sel:creationDate:DescribeProvisioningTemplateResponse' :: Maybe POSIX
creationDate = Maybe POSIX
a} :: DescribeProvisioningTemplateResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> DescribeProvisioningTemplateResponse
 -> f DescribeProvisioningTemplateResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> DescribeProvisioningTemplateResponse
-> f DescribeProvisioningTemplateResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

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

-- | The JSON formatted contents of the fleet provisioning template.
describeProvisioningTemplateResponse_templateBody :: Lens.Lens' DescribeProvisioningTemplateResponse (Prelude.Maybe Prelude.Text)
describeProvisioningTemplateResponse_templateBody :: (Maybe Text -> f (Maybe Text))
-> DescribeProvisioningTemplateResponse
-> f DescribeProvisioningTemplateResponse
describeProvisioningTemplateResponse_templateBody = (DescribeProvisioningTemplateResponse -> Maybe Text)
-> (DescribeProvisioningTemplateResponse
    -> Maybe Text -> DescribeProvisioningTemplateResponse)
-> Lens
     DescribeProvisioningTemplateResponse
     DescribeProvisioningTemplateResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeProvisioningTemplateResponse' {Maybe Text
templateBody :: Maybe Text
$sel:templateBody:DescribeProvisioningTemplateResponse' :: DescribeProvisioningTemplateResponse -> Maybe Text
templateBody} -> Maybe Text
templateBody) (\s :: DescribeProvisioningTemplateResponse
s@DescribeProvisioningTemplateResponse' {} Maybe Text
a -> DescribeProvisioningTemplateResponse
s {$sel:templateBody:DescribeProvisioningTemplateResponse' :: Maybe Text
templateBody = Maybe Text
a} :: DescribeProvisioningTemplateResponse)

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

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

instance
  Prelude.NFData
    DescribeProvisioningTemplateResponse