{-# 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.CloudFormation.Types.TypeVersionSummary
-- 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.CloudFormation.Types.TypeVersionSummary where

import Amazonka.CloudFormation.Types.RegistryType
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude

-- | Contains summary information about a specific version of a
-- CloudFormation extension.
--
-- /See:/ 'newTypeVersionSummary' smart constructor.
data TypeVersionSummary = TypeVersionSummary'
  { -- | The Amazon Resource Name (ARN) of the extension version.
    TypeVersionSummary -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The description of the extension version.
    TypeVersionSummary -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | Whether the specified extension version is set as the default version.
    --
    -- This applies only to private extensions you have registered in your
    -- account, and extensions published by Amazon. For public third-party
    -- extensions, CloudFormation returns @null@.
    TypeVersionSummary -> Maybe Bool
isDefaultVersion :: Prelude.Maybe Prelude.Bool,
    -- | For public extensions that have been activated for this account and
    -- region, the version of the public extension to be used for
    -- CloudFormation operations in this account and region. For any extensions
    -- other than activated third-arty extensions, CloudFormation returns
    -- @null@.
    --
    -- How you specified @AutoUpdate@ when enabling the extension affects
    -- whether CloudFormation automatically updates the extension in this
    -- account and region when a new version is released. For more information,
    -- see
    -- <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/registry-public.html#registry-public-enable-auto Setting CloudFormation to automatically use new versions of extensions>
    -- in the /CloudFormation User Guide/.
    TypeVersionSummary -> Maybe Text
publicVersionNumber :: Prelude.Maybe Prelude.Text,
    -- | When the version was registered.
    TypeVersionSummary -> Maybe ISO8601
timeCreated :: Prelude.Maybe Data.ISO8601,
    -- | The kind of extension.
    TypeVersionSummary -> Maybe RegistryType
type' :: Prelude.Maybe RegistryType,
    -- | The name of the extension.
    TypeVersionSummary -> Maybe Text
typeName :: Prelude.Maybe Prelude.Text,
    -- | The ID of a specific version of the extension. The version ID is the
    -- value at the end of the Amazon Resource Name (ARN) assigned to the
    -- extension version when it\'s registered.
    TypeVersionSummary -> Maybe Text
versionId :: Prelude.Maybe Prelude.Text
  }
  deriving (TypeVersionSummary -> TypeVersionSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TypeVersionSummary -> TypeVersionSummary -> Bool
$c/= :: TypeVersionSummary -> TypeVersionSummary -> Bool
== :: TypeVersionSummary -> TypeVersionSummary -> Bool
$c== :: TypeVersionSummary -> TypeVersionSummary -> Bool
Prelude.Eq, ReadPrec [TypeVersionSummary]
ReadPrec TypeVersionSummary
Int -> ReadS TypeVersionSummary
ReadS [TypeVersionSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TypeVersionSummary]
$creadListPrec :: ReadPrec [TypeVersionSummary]
readPrec :: ReadPrec TypeVersionSummary
$creadPrec :: ReadPrec TypeVersionSummary
readList :: ReadS [TypeVersionSummary]
$creadList :: ReadS [TypeVersionSummary]
readsPrec :: Int -> ReadS TypeVersionSummary
$creadsPrec :: Int -> ReadS TypeVersionSummary
Prelude.Read, Int -> TypeVersionSummary -> ShowS
[TypeVersionSummary] -> ShowS
TypeVersionSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TypeVersionSummary] -> ShowS
$cshowList :: [TypeVersionSummary] -> ShowS
show :: TypeVersionSummary -> String
$cshow :: TypeVersionSummary -> String
showsPrec :: Int -> TypeVersionSummary -> ShowS
$cshowsPrec :: Int -> TypeVersionSummary -> ShowS
Prelude.Show, forall x. Rep TypeVersionSummary x -> TypeVersionSummary
forall x. TypeVersionSummary -> Rep TypeVersionSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TypeVersionSummary x -> TypeVersionSummary
$cfrom :: forall x. TypeVersionSummary -> Rep TypeVersionSummary x
Prelude.Generic)

-- |
-- Create a value of 'TypeVersionSummary' 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:
--
-- 'arn', 'typeVersionSummary_arn' - The Amazon Resource Name (ARN) of the extension version.
--
-- 'description', 'typeVersionSummary_description' - The description of the extension version.
--
-- 'isDefaultVersion', 'typeVersionSummary_isDefaultVersion' - Whether the specified extension version is set as the default version.
--
-- This applies only to private extensions you have registered in your
-- account, and extensions published by Amazon. For public third-party
-- extensions, CloudFormation returns @null@.
--
-- 'publicVersionNumber', 'typeVersionSummary_publicVersionNumber' - For public extensions that have been activated for this account and
-- region, the version of the public extension to be used for
-- CloudFormation operations in this account and region. For any extensions
-- other than activated third-arty extensions, CloudFormation returns
-- @null@.
--
-- How you specified @AutoUpdate@ when enabling the extension affects
-- whether CloudFormation automatically updates the extension in this
-- account and region when a new version is released. For more information,
-- see
-- <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/registry-public.html#registry-public-enable-auto Setting CloudFormation to automatically use new versions of extensions>
-- in the /CloudFormation User Guide/.
--
-- 'timeCreated', 'typeVersionSummary_timeCreated' - When the version was registered.
--
-- 'type'', 'typeVersionSummary_type' - The kind of extension.
--
-- 'typeName', 'typeVersionSummary_typeName' - The name of the extension.
--
-- 'versionId', 'typeVersionSummary_versionId' - The ID of a specific version of the extension. The version ID is the
-- value at the end of the Amazon Resource Name (ARN) assigned to the
-- extension version when it\'s registered.
newTypeVersionSummary ::
  TypeVersionSummary
newTypeVersionSummary :: TypeVersionSummary
newTypeVersionSummary =
  TypeVersionSummary'
    { $sel:arn:TypeVersionSummary' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
      $sel:description:TypeVersionSummary' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
      $sel:isDefaultVersion:TypeVersionSummary' :: Maybe Bool
isDefaultVersion = forall a. Maybe a
Prelude.Nothing,
      $sel:publicVersionNumber:TypeVersionSummary' :: Maybe Text
publicVersionNumber = forall a. Maybe a
Prelude.Nothing,
      $sel:timeCreated:TypeVersionSummary' :: Maybe ISO8601
timeCreated = forall a. Maybe a
Prelude.Nothing,
      $sel:type':TypeVersionSummary' :: Maybe RegistryType
type' = forall a. Maybe a
Prelude.Nothing,
      $sel:typeName:TypeVersionSummary' :: Maybe Text
typeName = forall a. Maybe a
Prelude.Nothing,
      $sel:versionId:TypeVersionSummary' :: Maybe Text
versionId = forall a. Maybe a
Prelude.Nothing
    }

-- | The Amazon Resource Name (ARN) of the extension version.
typeVersionSummary_arn :: Lens.Lens' TypeVersionSummary (Prelude.Maybe Prelude.Text)
typeVersionSummary_arn :: Lens' TypeVersionSummary (Maybe Text)
typeVersionSummary_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TypeVersionSummary' {Maybe Text
arn :: Maybe Text
$sel:arn:TypeVersionSummary' :: TypeVersionSummary -> Maybe Text
arn} -> Maybe Text
arn) (\s :: TypeVersionSummary
s@TypeVersionSummary' {} Maybe Text
a -> TypeVersionSummary
s {$sel:arn:TypeVersionSummary' :: Maybe Text
arn = Maybe Text
a} :: TypeVersionSummary)

-- | The description of the extension version.
typeVersionSummary_description :: Lens.Lens' TypeVersionSummary (Prelude.Maybe Prelude.Text)
typeVersionSummary_description :: Lens' TypeVersionSummary (Maybe Text)
typeVersionSummary_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TypeVersionSummary' {Maybe Text
description :: Maybe Text
$sel:description:TypeVersionSummary' :: TypeVersionSummary -> Maybe Text
description} -> Maybe Text
description) (\s :: TypeVersionSummary
s@TypeVersionSummary' {} Maybe Text
a -> TypeVersionSummary
s {$sel:description:TypeVersionSummary' :: Maybe Text
description = Maybe Text
a} :: TypeVersionSummary)

-- | Whether the specified extension version is set as the default version.
--
-- This applies only to private extensions you have registered in your
-- account, and extensions published by Amazon. For public third-party
-- extensions, CloudFormation returns @null@.
typeVersionSummary_isDefaultVersion :: Lens.Lens' TypeVersionSummary (Prelude.Maybe Prelude.Bool)
typeVersionSummary_isDefaultVersion :: Lens' TypeVersionSummary (Maybe Bool)
typeVersionSummary_isDefaultVersion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TypeVersionSummary' {Maybe Bool
isDefaultVersion :: Maybe Bool
$sel:isDefaultVersion:TypeVersionSummary' :: TypeVersionSummary -> Maybe Bool
isDefaultVersion} -> Maybe Bool
isDefaultVersion) (\s :: TypeVersionSummary
s@TypeVersionSummary' {} Maybe Bool
a -> TypeVersionSummary
s {$sel:isDefaultVersion:TypeVersionSummary' :: Maybe Bool
isDefaultVersion = Maybe Bool
a} :: TypeVersionSummary)

-- | For public extensions that have been activated for this account and
-- region, the version of the public extension to be used for
-- CloudFormation operations in this account and region. For any extensions
-- other than activated third-arty extensions, CloudFormation returns
-- @null@.
--
-- How you specified @AutoUpdate@ when enabling the extension affects
-- whether CloudFormation automatically updates the extension in this
-- account and region when a new version is released. For more information,
-- see
-- <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/registry-public.html#registry-public-enable-auto Setting CloudFormation to automatically use new versions of extensions>
-- in the /CloudFormation User Guide/.
typeVersionSummary_publicVersionNumber :: Lens.Lens' TypeVersionSummary (Prelude.Maybe Prelude.Text)
typeVersionSummary_publicVersionNumber :: Lens' TypeVersionSummary (Maybe Text)
typeVersionSummary_publicVersionNumber = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TypeVersionSummary' {Maybe Text
publicVersionNumber :: Maybe Text
$sel:publicVersionNumber:TypeVersionSummary' :: TypeVersionSummary -> Maybe Text
publicVersionNumber} -> Maybe Text
publicVersionNumber) (\s :: TypeVersionSummary
s@TypeVersionSummary' {} Maybe Text
a -> TypeVersionSummary
s {$sel:publicVersionNumber:TypeVersionSummary' :: Maybe Text
publicVersionNumber = Maybe Text
a} :: TypeVersionSummary)

-- | When the version was registered.
typeVersionSummary_timeCreated :: Lens.Lens' TypeVersionSummary (Prelude.Maybe Prelude.UTCTime)
typeVersionSummary_timeCreated :: Lens' TypeVersionSummary (Maybe UTCTime)
typeVersionSummary_timeCreated = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TypeVersionSummary' {Maybe ISO8601
timeCreated :: Maybe ISO8601
$sel:timeCreated:TypeVersionSummary' :: TypeVersionSummary -> Maybe ISO8601
timeCreated} -> Maybe ISO8601
timeCreated) (\s :: TypeVersionSummary
s@TypeVersionSummary' {} Maybe ISO8601
a -> TypeVersionSummary
s {$sel:timeCreated:TypeVersionSummary' :: Maybe ISO8601
timeCreated = Maybe ISO8601
a} :: TypeVersionSummary) 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 kind of extension.
typeVersionSummary_type :: Lens.Lens' TypeVersionSummary (Prelude.Maybe RegistryType)
typeVersionSummary_type :: Lens' TypeVersionSummary (Maybe RegistryType)
typeVersionSummary_type = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TypeVersionSummary' {Maybe RegistryType
type' :: Maybe RegistryType
$sel:type':TypeVersionSummary' :: TypeVersionSummary -> Maybe RegistryType
type'} -> Maybe RegistryType
type') (\s :: TypeVersionSummary
s@TypeVersionSummary' {} Maybe RegistryType
a -> TypeVersionSummary
s {$sel:type':TypeVersionSummary' :: Maybe RegistryType
type' = Maybe RegistryType
a} :: TypeVersionSummary)

-- | The name of the extension.
typeVersionSummary_typeName :: Lens.Lens' TypeVersionSummary (Prelude.Maybe Prelude.Text)
typeVersionSummary_typeName :: Lens' TypeVersionSummary (Maybe Text)
typeVersionSummary_typeName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TypeVersionSummary' {Maybe Text
typeName :: Maybe Text
$sel:typeName:TypeVersionSummary' :: TypeVersionSummary -> Maybe Text
typeName} -> Maybe Text
typeName) (\s :: TypeVersionSummary
s@TypeVersionSummary' {} Maybe Text
a -> TypeVersionSummary
s {$sel:typeName:TypeVersionSummary' :: Maybe Text
typeName = Maybe Text
a} :: TypeVersionSummary)

-- | The ID of a specific version of the extension. The version ID is the
-- value at the end of the Amazon Resource Name (ARN) assigned to the
-- extension version when it\'s registered.
typeVersionSummary_versionId :: Lens.Lens' TypeVersionSummary (Prelude.Maybe Prelude.Text)
typeVersionSummary_versionId :: Lens' TypeVersionSummary (Maybe Text)
typeVersionSummary_versionId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TypeVersionSummary' {Maybe Text
versionId :: Maybe Text
$sel:versionId:TypeVersionSummary' :: TypeVersionSummary -> Maybe Text
versionId} -> Maybe Text
versionId) (\s :: TypeVersionSummary
s@TypeVersionSummary' {} Maybe Text
a -> TypeVersionSummary
s {$sel:versionId:TypeVersionSummary' :: Maybe Text
versionId = Maybe Text
a} :: TypeVersionSummary)

instance Data.FromXML TypeVersionSummary where
  parseXML :: [Node] -> Either String TypeVersionSummary
parseXML [Node]
x =
    Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe ISO8601
-> Maybe RegistryType
-> Maybe Text
-> Maybe Text
-> TypeVersionSummary
TypeVersionSummary'
      forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"Arn")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"Description")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"IsDefaultVersion")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"PublicVersionNumber")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"TimeCreated")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"Type")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"TypeName")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"VersionId")

instance Prelude.Hashable TypeVersionSummary where
  hashWithSalt :: Int -> TypeVersionSummary -> Int
hashWithSalt Int
_salt TypeVersionSummary' {Maybe Bool
Maybe Text
Maybe ISO8601
Maybe RegistryType
versionId :: Maybe Text
typeName :: Maybe Text
type' :: Maybe RegistryType
timeCreated :: Maybe ISO8601
publicVersionNumber :: Maybe Text
isDefaultVersion :: Maybe Bool
description :: Maybe Text
arn :: Maybe Text
$sel:versionId:TypeVersionSummary' :: TypeVersionSummary -> Maybe Text
$sel:typeName:TypeVersionSummary' :: TypeVersionSummary -> Maybe Text
$sel:type':TypeVersionSummary' :: TypeVersionSummary -> Maybe RegistryType
$sel:timeCreated:TypeVersionSummary' :: TypeVersionSummary -> Maybe ISO8601
$sel:publicVersionNumber:TypeVersionSummary' :: TypeVersionSummary -> Maybe Text
$sel:isDefaultVersion:TypeVersionSummary' :: TypeVersionSummary -> Maybe Bool
$sel:description:TypeVersionSummary' :: TypeVersionSummary -> Maybe Text
$sel:arn:TypeVersionSummary' :: TypeVersionSummary -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
arn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
isDefaultVersion
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
publicVersionNumber
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ISO8601
timeCreated
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe RegistryType
type'
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
typeName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
versionId

instance Prelude.NFData TypeVersionSummary where
  rnf :: TypeVersionSummary -> ()
rnf TypeVersionSummary' {Maybe Bool
Maybe Text
Maybe ISO8601
Maybe RegistryType
versionId :: Maybe Text
typeName :: Maybe Text
type' :: Maybe RegistryType
timeCreated :: Maybe ISO8601
publicVersionNumber :: Maybe Text
isDefaultVersion :: Maybe Bool
description :: Maybe Text
arn :: Maybe Text
$sel:versionId:TypeVersionSummary' :: TypeVersionSummary -> Maybe Text
$sel:typeName:TypeVersionSummary' :: TypeVersionSummary -> Maybe Text
$sel:type':TypeVersionSummary' :: TypeVersionSummary -> Maybe RegistryType
$sel:timeCreated:TypeVersionSummary' :: TypeVersionSummary -> Maybe ISO8601
$sel:publicVersionNumber:TypeVersionSummary' :: TypeVersionSummary -> Maybe Text
$sel:isDefaultVersion:TypeVersionSummary' :: TypeVersionSummary -> Maybe Bool
$sel:description:TypeVersionSummary' :: TypeVersionSummary -> Maybe Text
$sel:arn:TypeVersionSummary' :: TypeVersionSummary -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
arn
      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
isDefaultVersion
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
publicVersionNumber
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ISO8601
timeCreated
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe RegistryType
type'
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
typeName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
versionId