{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# 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.Types.ProvisioningTemplateSummary
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.IoT.Types.ProvisioningTemplateSummary where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.IoT.Types.TemplateType
import qualified Amazonka.Prelude as Prelude

-- | A summary of information about a provisioning template.
--
-- /See:/ 'newProvisioningTemplateSummary' smart constructor.
data ProvisioningTemplateSummary = ProvisioningTemplateSummary'
  { -- | The date when the provisioning template summary was created.
    ProvisioningTemplateSummary -> Maybe POSIX
creationDate :: Prelude.Maybe Data.POSIX,
    -- | The description of the provisioning template.
    ProvisioningTemplateSummary -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | True if the fleet provision template is enabled, otherwise false.
    ProvisioningTemplateSummary -> Maybe Bool
enabled :: Prelude.Maybe Prelude.Bool,
    -- | The date when the provisioning template summary was last modified.
    ProvisioningTemplateSummary -> Maybe POSIX
lastModifiedDate :: Prelude.Maybe Data.POSIX,
    -- | The ARN of the provisioning template.
    ProvisioningTemplateSummary -> Maybe Text
templateArn :: Prelude.Maybe Prelude.Text,
    -- | The name of the provisioning template.
    ProvisioningTemplateSummary -> Maybe Text
templateName :: Prelude.Maybe Prelude.Text,
    -- | The type you define in a provisioning template. You can create a
    -- template with only one type. You can\'t change the template type after
    -- its creation. The default value is @FLEET_PROVISIONING@. For more
    -- information about provisioning template, see:
    -- <https://docs.aws.amazon.com/iot/latest/developerguide/provision-template.html Provisioning template>.
    ProvisioningTemplateSummary -> Maybe TemplateType
type' :: Prelude.Maybe TemplateType
  }
  deriving (ProvisioningTemplateSummary -> ProvisioningTemplateSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ProvisioningTemplateSummary -> ProvisioningTemplateSummary -> Bool
$c/= :: ProvisioningTemplateSummary -> ProvisioningTemplateSummary -> Bool
== :: ProvisioningTemplateSummary -> ProvisioningTemplateSummary -> Bool
$c== :: ProvisioningTemplateSummary -> ProvisioningTemplateSummary -> Bool
Prelude.Eq, ReadPrec [ProvisioningTemplateSummary]
ReadPrec ProvisioningTemplateSummary
Int -> ReadS ProvisioningTemplateSummary
ReadS [ProvisioningTemplateSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ProvisioningTemplateSummary]
$creadListPrec :: ReadPrec [ProvisioningTemplateSummary]
readPrec :: ReadPrec ProvisioningTemplateSummary
$creadPrec :: ReadPrec ProvisioningTemplateSummary
readList :: ReadS [ProvisioningTemplateSummary]
$creadList :: ReadS [ProvisioningTemplateSummary]
readsPrec :: Int -> ReadS ProvisioningTemplateSummary
$creadsPrec :: Int -> ReadS ProvisioningTemplateSummary
Prelude.Read, Int -> ProvisioningTemplateSummary -> ShowS
[ProvisioningTemplateSummary] -> ShowS
ProvisioningTemplateSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ProvisioningTemplateSummary] -> ShowS
$cshowList :: [ProvisioningTemplateSummary] -> ShowS
show :: ProvisioningTemplateSummary -> String
$cshow :: ProvisioningTemplateSummary -> String
showsPrec :: Int -> ProvisioningTemplateSummary -> ShowS
$cshowsPrec :: Int -> ProvisioningTemplateSummary -> ShowS
Prelude.Show, forall x.
Rep ProvisioningTemplateSummary x -> ProvisioningTemplateSummary
forall x.
ProvisioningTemplateSummary -> Rep ProvisioningTemplateSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ProvisioningTemplateSummary x -> ProvisioningTemplateSummary
$cfrom :: forall x.
ProvisioningTemplateSummary -> Rep ProvisioningTemplateSummary x
Prelude.Generic)

-- |
-- Create a value of 'ProvisioningTemplateSummary' 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:
--
-- 'creationDate', 'provisioningTemplateSummary_creationDate' - The date when the provisioning template summary was created.
--
-- 'description', 'provisioningTemplateSummary_description' - The description of the provisioning template.
--
-- 'enabled', 'provisioningTemplateSummary_enabled' - True if the fleet provision template is enabled, otherwise false.
--
-- 'lastModifiedDate', 'provisioningTemplateSummary_lastModifiedDate' - The date when the provisioning template summary was last modified.
--
-- 'templateArn', 'provisioningTemplateSummary_templateArn' - The ARN of the provisioning template.
--
-- 'templateName', 'provisioningTemplateSummary_templateName' - The name of the provisioning template.
--
-- 'type'', 'provisioningTemplateSummary_type' - The type you define in a provisioning template. You can create a
-- template with only one type. You can\'t change the template type after
-- its creation. The default value is @FLEET_PROVISIONING@. For more
-- information about provisioning template, see:
-- <https://docs.aws.amazon.com/iot/latest/developerguide/provision-template.html Provisioning template>.
newProvisioningTemplateSummary ::
  ProvisioningTemplateSummary
newProvisioningTemplateSummary :: ProvisioningTemplateSummary
newProvisioningTemplateSummary =
  ProvisioningTemplateSummary'
    { $sel:creationDate:ProvisioningTemplateSummary' :: Maybe POSIX
creationDate =
        forall a. Maybe a
Prelude.Nothing,
      $sel:description:ProvisioningTemplateSummary' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
      $sel:enabled:ProvisioningTemplateSummary' :: Maybe Bool
enabled = forall a. Maybe a
Prelude.Nothing,
      $sel:lastModifiedDate:ProvisioningTemplateSummary' :: Maybe POSIX
lastModifiedDate = forall a. Maybe a
Prelude.Nothing,
      $sel:templateArn:ProvisioningTemplateSummary' :: Maybe Text
templateArn = forall a. Maybe a
Prelude.Nothing,
      $sel:templateName:ProvisioningTemplateSummary' :: Maybe Text
templateName = forall a. Maybe a
Prelude.Nothing,
      $sel:type':ProvisioningTemplateSummary' :: Maybe TemplateType
type' = forall a. Maybe a
Prelude.Nothing
    }

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

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

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

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

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

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

-- | The type you define in a provisioning template. You can create a
-- template with only one type. You can\'t change the template type after
-- its creation. The default value is @FLEET_PROVISIONING@. For more
-- information about provisioning template, see:
-- <https://docs.aws.amazon.com/iot/latest/developerguide/provision-template.html Provisioning template>.
provisioningTemplateSummary_type :: Lens.Lens' ProvisioningTemplateSummary (Prelude.Maybe TemplateType)
provisioningTemplateSummary_type :: Lens' ProvisioningTemplateSummary (Maybe TemplateType)
provisioningTemplateSummary_type = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProvisioningTemplateSummary' {Maybe TemplateType
type' :: Maybe TemplateType
$sel:type':ProvisioningTemplateSummary' :: ProvisioningTemplateSummary -> Maybe TemplateType
type'} -> Maybe TemplateType
type') (\s :: ProvisioningTemplateSummary
s@ProvisioningTemplateSummary' {} Maybe TemplateType
a -> ProvisioningTemplateSummary
s {$sel:type':ProvisioningTemplateSummary' :: Maybe TemplateType
type' = Maybe TemplateType
a} :: ProvisioningTemplateSummary)

instance Data.FromJSON ProvisioningTemplateSummary where
  parseJSON :: Value -> Parser ProvisioningTemplateSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ProvisioningTemplateSummary"
      ( \Object
x ->
          Maybe POSIX
-> Maybe Text
-> Maybe Bool
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe TemplateType
-> ProvisioningTemplateSummary
ProvisioningTemplateSummary'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"creationDate")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"description")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"enabled")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"lastModifiedDate")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"templateArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"templateName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"type")
      )

instance Prelude.Hashable ProvisioningTemplateSummary where
  hashWithSalt :: Int -> ProvisioningTemplateSummary -> Int
hashWithSalt Int
_salt ProvisioningTemplateSummary' {Maybe Bool
Maybe Text
Maybe POSIX
Maybe TemplateType
type' :: Maybe TemplateType
templateName :: Maybe Text
templateArn :: Maybe Text
lastModifiedDate :: Maybe POSIX
enabled :: Maybe Bool
description :: Maybe Text
creationDate :: Maybe POSIX
$sel:type':ProvisioningTemplateSummary' :: ProvisioningTemplateSummary -> Maybe TemplateType
$sel:templateName:ProvisioningTemplateSummary' :: ProvisioningTemplateSummary -> Maybe Text
$sel:templateArn:ProvisioningTemplateSummary' :: ProvisioningTemplateSummary -> Maybe Text
$sel:lastModifiedDate:ProvisioningTemplateSummary' :: ProvisioningTemplateSummary -> Maybe POSIX
$sel:enabled:ProvisioningTemplateSummary' :: ProvisioningTemplateSummary -> Maybe Bool
$sel:description:ProvisioningTemplateSummary' :: ProvisioningTemplateSummary -> Maybe Text
$sel:creationDate:ProvisioningTemplateSummary' :: ProvisioningTemplateSummary -> Maybe POSIX
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
creationDate
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
enabled
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
lastModifiedDate
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
templateArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
templateName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe TemplateType
type'

instance Prelude.NFData ProvisioningTemplateSummary where
  rnf :: ProvisioningTemplateSummary -> ()
rnf ProvisioningTemplateSummary' {Maybe Bool
Maybe Text
Maybe POSIX
Maybe TemplateType
type' :: Maybe TemplateType
templateName :: Maybe Text
templateArn :: Maybe Text
lastModifiedDate :: Maybe POSIX
enabled :: Maybe Bool
description :: Maybe Text
creationDate :: Maybe POSIX
$sel:type':ProvisioningTemplateSummary' :: ProvisioningTemplateSummary -> Maybe TemplateType
$sel:templateName:ProvisioningTemplateSummary' :: ProvisioningTemplateSummary -> Maybe Text
$sel:templateArn:ProvisioningTemplateSummary' :: ProvisioningTemplateSummary -> Maybe Text
$sel:lastModifiedDate:ProvisioningTemplateSummary' :: ProvisioningTemplateSummary -> Maybe POSIX
$sel:enabled:ProvisioningTemplateSummary' :: ProvisioningTemplateSummary -> Maybe Bool
$sel:description:ProvisioningTemplateSummary' :: ProvisioningTemplateSummary -> Maybe Text
$sel:creationDate:ProvisioningTemplateSummary' :: ProvisioningTemplateSummary -> Maybe POSIX
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
creationDate
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
enabled
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
lastModifiedDate
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
templateArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
templateName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe TemplateType
type'