{-# 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.CreateProvisioningTemplateVersion
-- 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 new version of 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 CreateProvisioningTemplateVersion>
-- action.
module Amazonka.IoT.CreateProvisioningTemplateVersion
  ( -- * Creating a Request
    CreateProvisioningTemplateVersion (..),
    newCreateProvisioningTemplateVersion,

    -- * Request Lenses
    createProvisioningTemplateVersion_setAsDefault,
    createProvisioningTemplateVersion_templateName,
    createProvisioningTemplateVersion_templateBody,

    -- * Destructuring the Response
    CreateProvisioningTemplateVersionResponse (..),
    newCreateProvisioningTemplateVersionResponse,

    -- * Response Lenses
    createProvisioningTemplateVersionResponse_versionId,
    createProvisioningTemplateVersionResponse_templateName,
    createProvisioningTemplateVersionResponse_templateArn,
    createProvisioningTemplateVersionResponse_isDefaultVersion,
    createProvisioningTemplateVersionResponse_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:/ 'newCreateProvisioningTemplateVersion' smart constructor.
data CreateProvisioningTemplateVersion = CreateProvisioningTemplateVersion'
  { -- | Sets a fleet provision template version as the default version.
    CreateProvisioningTemplateVersion -> Maybe Bool
setAsDefault :: Prelude.Maybe Prelude.Bool,
    -- | The name of the fleet provisioning template.
    CreateProvisioningTemplateVersion -> Text
templateName :: Prelude.Text,
    -- | The JSON formatted contents of the fleet provisioning template.
    CreateProvisioningTemplateVersion -> Text
templateBody :: Prelude.Text
  }
  deriving (CreateProvisioningTemplateVersion
-> CreateProvisioningTemplateVersion -> Bool
(CreateProvisioningTemplateVersion
 -> CreateProvisioningTemplateVersion -> Bool)
-> (CreateProvisioningTemplateVersion
    -> CreateProvisioningTemplateVersion -> Bool)
-> Eq CreateProvisioningTemplateVersion
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateProvisioningTemplateVersion
-> CreateProvisioningTemplateVersion -> Bool
$c/= :: CreateProvisioningTemplateVersion
-> CreateProvisioningTemplateVersion -> Bool
== :: CreateProvisioningTemplateVersion
-> CreateProvisioningTemplateVersion -> Bool
$c== :: CreateProvisioningTemplateVersion
-> CreateProvisioningTemplateVersion -> Bool
Prelude.Eq, ReadPrec [CreateProvisioningTemplateVersion]
ReadPrec CreateProvisioningTemplateVersion
Int -> ReadS CreateProvisioningTemplateVersion
ReadS [CreateProvisioningTemplateVersion]
(Int -> ReadS CreateProvisioningTemplateVersion)
-> ReadS [CreateProvisioningTemplateVersion]
-> ReadPrec CreateProvisioningTemplateVersion
-> ReadPrec [CreateProvisioningTemplateVersion]
-> Read CreateProvisioningTemplateVersion
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateProvisioningTemplateVersion]
$creadListPrec :: ReadPrec [CreateProvisioningTemplateVersion]
readPrec :: ReadPrec CreateProvisioningTemplateVersion
$creadPrec :: ReadPrec CreateProvisioningTemplateVersion
readList :: ReadS [CreateProvisioningTemplateVersion]
$creadList :: ReadS [CreateProvisioningTemplateVersion]
readsPrec :: Int -> ReadS CreateProvisioningTemplateVersion
$creadsPrec :: Int -> ReadS CreateProvisioningTemplateVersion
Prelude.Read, Int -> CreateProvisioningTemplateVersion -> ShowS
[CreateProvisioningTemplateVersion] -> ShowS
CreateProvisioningTemplateVersion -> String
(Int -> CreateProvisioningTemplateVersion -> ShowS)
-> (CreateProvisioningTemplateVersion -> String)
-> ([CreateProvisioningTemplateVersion] -> ShowS)
-> Show CreateProvisioningTemplateVersion
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateProvisioningTemplateVersion] -> ShowS
$cshowList :: [CreateProvisioningTemplateVersion] -> ShowS
show :: CreateProvisioningTemplateVersion -> String
$cshow :: CreateProvisioningTemplateVersion -> String
showsPrec :: Int -> CreateProvisioningTemplateVersion -> ShowS
$cshowsPrec :: Int -> CreateProvisioningTemplateVersion -> ShowS
Prelude.Show, (forall x.
 CreateProvisioningTemplateVersion
 -> Rep CreateProvisioningTemplateVersion x)
-> (forall x.
    Rep CreateProvisioningTemplateVersion x
    -> CreateProvisioningTemplateVersion)
-> Generic CreateProvisioningTemplateVersion
forall x.
Rep CreateProvisioningTemplateVersion x
-> CreateProvisioningTemplateVersion
forall x.
CreateProvisioningTemplateVersion
-> Rep CreateProvisioningTemplateVersion x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateProvisioningTemplateVersion x
-> CreateProvisioningTemplateVersion
$cfrom :: forall x.
CreateProvisioningTemplateVersion
-> Rep CreateProvisioningTemplateVersion x
Prelude.Generic)

-- |
-- Create a value of 'CreateProvisioningTemplateVersion' 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:
--
-- 'setAsDefault', 'createProvisioningTemplateVersion_setAsDefault' - Sets a fleet provision template version as the default version.
--
-- 'templateName', 'createProvisioningTemplateVersion_templateName' - The name of the fleet provisioning template.
--
-- 'templateBody', 'createProvisioningTemplateVersion_templateBody' - The JSON formatted contents of the fleet provisioning template.
newCreateProvisioningTemplateVersion ::
  -- | 'templateName'
  Prelude.Text ->
  -- | 'templateBody'
  Prelude.Text ->
  CreateProvisioningTemplateVersion
newCreateProvisioningTemplateVersion :: Text -> Text -> CreateProvisioningTemplateVersion
newCreateProvisioningTemplateVersion
  Text
pTemplateName_
  Text
pTemplateBody_ =
    CreateProvisioningTemplateVersion' :: Maybe Bool -> Text -> Text -> CreateProvisioningTemplateVersion
CreateProvisioningTemplateVersion'
      { $sel:setAsDefault:CreateProvisioningTemplateVersion' :: Maybe Bool
setAsDefault =
          Maybe Bool
forall a. Maybe a
Prelude.Nothing,
        $sel:templateName:CreateProvisioningTemplateVersion' :: Text
templateName = Text
pTemplateName_,
        $sel:templateBody:CreateProvisioningTemplateVersion' :: Text
templateBody = Text
pTemplateBody_
      }

-- | Sets a fleet provision template version as the default version.
createProvisioningTemplateVersion_setAsDefault :: Lens.Lens' CreateProvisioningTemplateVersion (Prelude.Maybe Prelude.Bool)
createProvisioningTemplateVersion_setAsDefault :: (Maybe Bool -> f (Maybe Bool))
-> CreateProvisioningTemplateVersion
-> f CreateProvisioningTemplateVersion
createProvisioningTemplateVersion_setAsDefault = (CreateProvisioningTemplateVersion -> Maybe Bool)
-> (CreateProvisioningTemplateVersion
    -> Maybe Bool -> CreateProvisioningTemplateVersion)
-> Lens
     CreateProvisioningTemplateVersion
     CreateProvisioningTemplateVersion
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateProvisioningTemplateVersion' {Maybe Bool
setAsDefault :: Maybe Bool
$sel:setAsDefault:CreateProvisioningTemplateVersion' :: CreateProvisioningTemplateVersion -> Maybe Bool
setAsDefault} -> Maybe Bool
setAsDefault) (\s :: CreateProvisioningTemplateVersion
s@CreateProvisioningTemplateVersion' {} Maybe Bool
a -> CreateProvisioningTemplateVersion
s {$sel:setAsDefault:CreateProvisioningTemplateVersion' :: Maybe Bool
setAsDefault = Maybe Bool
a} :: CreateProvisioningTemplateVersion)

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

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

instance
  Core.AWSRequest
    CreateProvisioningTemplateVersion
  where
  type
    AWSResponse CreateProvisioningTemplateVersion =
      CreateProvisioningTemplateVersionResponse
  request :: CreateProvisioningTemplateVersion
-> Request CreateProvisioningTemplateVersion
request = Service
-> CreateProvisioningTemplateVersion
-> Request CreateProvisioningTemplateVersion
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateProvisioningTemplateVersion
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse CreateProvisioningTemplateVersion)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateProvisioningTemplateVersion))
-> Logger
-> Service
-> Proxy CreateProvisioningTemplateVersion
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse CreateProvisioningTemplateVersion)))
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 Int
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Int
-> CreateProvisioningTemplateVersionResponse
CreateProvisioningTemplateVersionResponse'
            (Maybe Int
 -> Maybe Text
 -> Maybe Text
 -> Maybe Bool
 -> Int
 -> CreateProvisioningTemplateVersionResponse)
-> Either String (Maybe Int)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Int
      -> CreateProvisioningTemplateVersionResponse)
forall (f :: * -> *) a b. Functor 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
"versionId")
              Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Int
   -> CreateProvisioningTemplateVersionResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Bool -> Int -> CreateProvisioningTemplateVersionResponse)
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 Text
   -> Maybe Bool -> Int -> CreateProvisioningTemplateVersionResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Bool -> Int -> CreateProvisioningTemplateVersionResponse)
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 Bool -> Int -> CreateProvisioningTemplateVersionResponse)
-> Either String (Maybe Bool)
-> Either String (Int -> CreateProvisioningTemplateVersionResponse)
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
"isDefaultVersion")
              Either String (Int -> CreateProvisioningTemplateVersionResponse)
-> Either String Int
-> Either String CreateProvisioningTemplateVersionResponse
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
    CreateProvisioningTemplateVersion

instance
  Prelude.NFData
    CreateProvisioningTemplateVersion

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

instance
  Core.ToJSON
    CreateProvisioningTemplateVersion
  where
  toJSON :: CreateProvisioningTemplateVersion -> Value
toJSON CreateProvisioningTemplateVersion' {Maybe Bool
Text
templateBody :: Text
templateName :: Text
setAsDefault :: Maybe Bool
$sel:templateBody:CreateProvisioningTemplateVersion' :: CreateProvisioningTemplateVersion -> Text
$sel:templateName:CreateProvisioningTemplateVersion' :: CreateProvisioningTemplateVersion -> Text
$sel:setAsDefault:CreateProvisioningTemplateVersion' :: CreateProvisioningTemplateVersion -> Maybe Bool
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"templateBody" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
templateBody)]
      )

instance
  Core.ToPath
    CreateProvisioningTemplateVersion
  where
  toPath :: CreateProvisioningTemplateVersion -> ByteString
toPath CreateProvisioningTemplateVersion' {Maybe Bool
Text
templateBody :: Text
templateName :: Text
setAsDefault :: Maybe Bool
$sel:templateBody:CreateProvisioningTemplateVersion' :: CreateProvisioningTemplateVersion -> Text
$sel:templateName:CreateProvisioningTemplateVersion' :: CreateProvisioningTemplateVersion -> Text
$sel:setAsDefault:CreateProvisioningTemplateVersion' :: CreateProvisioningTemplateVersion -> Maybe Bool
..} =
    [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,
        ByteString
"/versions"
      ]

instance
  Core.ToQuery
    CreateProvisioningTemplateVersion
  where
  toQuery :: CreateProvisioningTemplateVersion -> QueryString
toQuery CreateProvisioningTemplateVersion' {Maybe Bool
Text
templateBody :: Text
templateName :: Text
setAsDefault :: Maybe Bool
$sel:templateBody:CreateProvisioningTemplateVersion' :: CreateProvisioningTemplateVersion -> Text
$sel:templateName:CreateProvisioningTemplateVersion' :: CreateProvisioningTemplateVersion -> Text
$sel:setAsDefault:CreateProvisioningTemplateVersion' :: CreateProvisioningTemplateVersion -> Maybe Bool
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"setAsDefault" ByteString -> Maybe Bool -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Bool
setAsDefault]

-- | /See:/ 'newCreateProvisioningTemplateVersionResponse' smart constructor.
data CreateProvisioningTemplateVersionResponse = CreateProvisioningTemplateVersionResponse'
  { -- | The version of the fleet provisioning template.
    CreateProvisioningTemplateVersionResponse -> Maybe Int
versionId :: Prelude.Maybe Prelude.Int,
    -- | The name of the fleet provisioning template.
    CreateProvisioningTemplateVersionResponse -> Maybe Text
templateName :: Prelude.Maybe Prelude.Text,
    -- | The ARN that identifies the provisioning template.
    CreateProvisioningTemplateVersionResponse -> Maybe Text
templateArn :: Prelude.Maybe Prelude.Text,
    -- | True if the fleet provisioning template version is the default version,
    -- otherwise false.
    CreateProvisioningTemplateVersionResponse -> Maybe Bool
isDefaultVersion :: Prelude.Maybe Prelude.Bool,
    -- | The response's http status code.
    CreateProvisioningTemplateVersionResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateProvisioningTemplateVersionResponse
-> CreateProvisioningTemplateVersionResponse -> Bool
(CreateProvisioningTemplateVersionResponse
 -> CreateProvisioningTemplateVersionResponse -> Bool)
-> (CreateProvisioningTemplateVersionResponse
    -> CreateProvisioningTemplateVersionResponse -> Bool)
-> Eq CreateProvisioningTemplateVersionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateProvisioningTemplateVersionResponse
-> CreateProvisioningTemplateVersionResponse -> Bool
$c/= :: CreateProvisioningTemplateVersionResponse
-> CreateProvisioningTemplateVersionResponse -> Bool
== :: CreateProvisioningTemplateVersionResponse
-> CreateProvisioningTemplateVersionResponse -> Bool
$c== :: CreateProvisioningTemplateVersionResponse
-> CreateProvisioningTemplateVersionResponse -> Bool
Prelude.Eq, ReadPrec [CreateProvisioningTemplateVersionResponse]
ReadPrec CreateProvisioningTemplateVersionResponse
Int -> ReadS CreateProvisioningTemplateVersionResponse
ReadS [CreateProvisioningTemplateVersionResponse]
(Int -> ReadS CreateProvisioningTemplateVersionResponse)
-> ReadS [CreateProvisioningTemplateVersionResponse]
-> ReadPrec CreateProvisioningTemplateVersionResponse
-> ReadPrec [CreateProvisioningTemplateVersionResponse]
-> Read CreateProvisioningTemplateVersionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateProvisioningTemplateVersionResponse]
$creadListPrec :: ReadPrec [CreateProvisioningTemplateVersionResponse]
readPrec :: ReadPrec CreateProvisioningTemplateVersionResponse
$creadPrec :: ReadPrec CreateProvisioningTemplateVersionResponse
readList :: ReadS [CreateProvisioningTemplateVersionResponse]
$creadList :: ReadS [CreateProvisioningTemplateVersionResponse]
readsPrec :: Int -> ReadS CreateProvisioningTemplateVersionResponse
$creadsPrec :: Int -> ReadS CreateProvisioningTemplateVersionResponse
Prelude.Read, Int -> CreateProvisioningTemplateVersionResponse -> ShowS
[CreateProvisioningTemplateVersionResponse] -> ShowS
CreateProvisioningTemplateVersionResponse -> String
(Int -> CreateProvisioningTemplateVersionResponse -> ShowS)
-> (CreateProvisioningTemplateVersionResponse -> String)
-> ([CreateProvisioningTemplateVersionResponse] -> ShowS)
-> Show CreateProvisioningTemplateVersionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateProvisioningTemplateVersionResponse] -> ShowS
$cshowList :: [CreateProvisioningTemplateVersionResponse] -> ShowS
show :: CreateProvisioningTemplateVersionResponse -> String
$cshow :: CreateProvisioningTemplateVersionResponse -> String
showsPrec :: Int -> CreateProvisioningTemplateVersionResponse -> ShowS
$cshowsPrec :: Int -> CreateProvisioningTemplateVersionResponse -> ShowS
Prelude.Show, (forall x.
 CreateProvisioningTemplateVersionResponse
 -> Rep CreateProvisioningTemplateVersionResponse x)
-> (forall x.
    Rep CreateProvisioningTemplateVersionResponse x
    -> CreateProvisioningTemplateVersionResponse)
-> Generic CreateProvisioningTemplateVersionResponse
forall x.
Rep CreateProvisioningTemplateVersionResponse x
-> CreateProvisioningTemplateVersionResponse
forall x.
CreateProvisioningTemplateVersionResponse
-> Rep CreateProvisioningTemplateVersionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateProvisioningTemplateVersionResponse x
-> CreateProvisioningTemplateVersionResponse
$cfrom :: forall x.
CreateProvisioningTemplateVersionResponse
-> Rep CreateProvisioningTemplateVersionResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateProvisioningTemplateVersionResponse' 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:
--
-- 'versionId', 'createProvisioningTemplateVersionResponse_versionId' - The version of the fleet provisioning template.
--
-- 'templateName', 'createProvisioningTemplateVersionResponse_templateName' - The name of the fleet provisioning template.
--
-- 'templateArn', 'createProvisioningTemplateVersionResponse_templateArn' - The ARN that identifies the provisioning template.
--
-- 'isDefaultVersion', 'createProvisioningTemplateVersionResponse_isDefaultVersion' - True if the fleet provisioning template version is the default version,
-- otherwise false.
--
-- 'httpStatus', 'createProvisioningTemplateVersionResponse_httpStatus' - The response's http status code.
newCreateProvisioningTemplateVersionResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateProvisioningTemplateVersionResponse
newCreateProvisioningTemplateVersionResponse :: Int -> CreateProvisioningTemplateVersionResponse
newCreateProvisioningTemplateVersionResponse
  Int
pHttpStatus_ =
    CreateProvisioningTemplateVersionResponse' :: Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Int
-> CreateProvisioningTemplateVersionResponse
CreateProvisioningTemplateVersionResponse'
      { $sel:versionId:CreateProvisioningTemplateVersionResponse' :: Maybe Int
versionId =
          Maybe Int
forall a. Maybe a
Prelude.Nothing,
        $sel:templateName:CreateProvisioningTemplateVersionResponse' :: Maybe Text
templateName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:templateArn:CreateProvisioningTemplateVersionResponse' :: Maybe Text
templateArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:isDefaultVersion:CreateProvisioningTemplateVersionResponse' :: Maybe Bool
isDefaultVersion =
          Maybe Bool
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:CreateProvisioningTemplateVersionResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | The version of the fleet provisioning template.
createProvisioningTemplateVersionResponse_versionId :: Lens.Lens' CreateProvisioningTemplateVersionResponse (Prelude.Maybe Prelude.Int)
createProvisioningTemplateVersionResponse_versionId :: (Maybe Int -> f (Maybe Int))
-> CreateProvisioningTemplateVersionResponse
-> f CreateProvisioningTemplateVersionResponse
createProvisioningTemplateVersionResponse_versionId = (CreateProvisioningTemplateVersionResponse -> Maybe Int)
-> (CreateProvisioningTemplateVersionResponse
    -> Maybe Int -> CreateProvisioningTemplateVersionResponse)
-> Lens
     CreateProvisioningTemplateVersionResponse
     CreateProvisioningTemplateVersionResponse
     (Maybe Int)
     (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateProvisioningTemplateVersionResponse' {Maybe Int
versionId :: Maybe Int
$sel:versionId:CreateProvisioningTemplateVersionResponse' :: CreateProvisioningTemplateVersionResponse -> Maybe Int
versionId} -> Maybe Int
versionId) (\s :: CreateProvisioningTemplateVersionResponse
s@CreateProvisioningTemplateVersionResponse' {} Maybe Int
a -> CreateProvisioningTemplateVersionResponse
s {$sel:versionId:CreateProvisioningTemplateVersionResponse' :: Maybe Int
versionId = Maybe Int
a} :: CreateProvisioningTemplateVersionResponse)

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

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

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

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

instance
  Prelude.NFData
    CreateProvisioningTemplateVersionResponse