{-# 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.TypeConfigurationIdentifier
-- 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)
module Amazonka.CloudFormation.Types.TypeConfigurationIdentifier where

import Amazonka.CloudFormation.Types.ThirdPartyType
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Identifying information for the configuration of a CloudFormation
-- extension.
--
-- /See:/ 'newTypeConfigurationIdentifier' smart constructor.
data TypeConfigurationIdentifier = TypeConfigurationIdentifier'
  { -- | The name of the extension type to which this configuration applies.
    TypeConfigurationIdentifier -> Maybe Text
typeName :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) for the configuration, in this account
    -- and region.
    TypeConfigurationIdentifier -> Maybe Text
typeConfigurationArn :: Prelude.Maybe Prelude.Text,
    -- | The alias specified for this configuration, if one was specified when
    -- the configuration was set.
    TypeConfigurationIdentifier -> Maybe Text
typeConfigurationAlias :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) for the extension, in this account and
    -- region.
    --
    -- For public extensions, this will be the ARN assigned when you
    -- <https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_ActivateType.html activate the type>
    -- in this account and region. For private extensions, this will be the ARN
    -- assigned when you
    -- <https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_RegisterType.html register the type>
    -- in this account and region.
    TypeConfigurationIdentifier -> Maybe Text
typeArn :: Prelude.Maybe Prelude.Text,
    -- | The type of extension.
    TypeConfigurationIdentifier -> Maybe ThirdPartyType
type' :: Prelude.Maybe ThirdPartyType
  }
  deriving (TypeConfigurationIdentifier -> TypeConfigurationIdentifier -> Bool
(TypeConfigurationIdentifier
 -> TypeConfigurationIdentifier -> Bool)
-> (TypeConfigurationIdentifier
    -> TypeConfigurationIdentifier -> Bool)
-> Eq TypeConfigurationIdentifier
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TypeConfigurationIdentifier -> TypeConfigurationIdentifier -> Bool
$c/= :: TypeConfigurationIdentifier -> TypeConfigurationIdentifier -> Bool
== :: TypeConfigurationIdentifier -> TypeConfigurationIdentifier -> Bool
$c== :: TypeConfigurationIdentifier -> TypeConfigurationIdentifier -> Bool
Prelude.Eq, ReadPrec [TypeConfigurationIdentifier]
ReadPrec TypeConfigurationIdentifier
Int -> ReadS TypeConfigurationIdentifier
ReadS [TypeConfigurationIdentifier]
(Int -> ReadS TypeConfigurationIdentifier)
-> ReadS [TypeConfigurationIdentifier]
-> ReadPrec TypeConfigurationIdentifier
-> ReadPrec [TypeConfigurationIdentifier]
-> Read TypeConfigurationIdentifier
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TypeConfigurationIdentifier]
$creadListPrec :: ReadPrec [TypeConfigurationIdentifier]
readPrec :: ReadPrec TypeConfigurationIdentifier
$creadPrec :: ReadPrec TypeConfigurationIdentifier
readList :: ReadS [TypeConfigurationIdentifier]
$creadList :: ReadS [TypeConfigurationIdentifier]
readsPrec :: Int -> ReadS TypeConfigurationIdentifier
$creadsPrec :: Int -> ReadS TypeConfigurationIdentifier
Prelude.Read, Int -> TypeConfigurationIdentifier -> ShowS
[TypeConfigurationIdentifier] -> ShowS
TypeConfigurationIdentifier -> String
(Int -> TypeConfigurationIdentifier -> ShowS)
-> (TypeConfigurationIdentifier -> String)
-> ([TypeConfigurationIdentifier] -> ShowS)
-> Show TypeConfigurationIdentifier
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TypeConfigurationIdentifier] -> ShowS
$cshowList :: [TypeConfigurationIdentifier] -> ShowS
show :: TypeConfigurationIdentifier -> String
$cshow :: TypeConfigurationIdentifier -> String
showsPrec :: Int -> TypeConfigurationIdentifier -> ShowS
$cshowsPrec :: Int -> TypeConfigurationIdentifier -> ShowS
Prelude.Show, (forall x.
 TypeConfigurationIdentifier -> Rep TypeConfigurationIdentifier x)
-> (forall x.
    Rep TypeConfigurationIdentifier x -> TypeConfigurationIdentifier)
-> Generic TypeConfigurationIdentifier
forall x.
Rep TypeConfigurationIdentifier x -> TypeConfigurationIdentifier
forall x.
TypeConfigurationIdentifier -> Rep TypeConfigurationIdentifier x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep TypeConfigurationIdentifier x -> TypeConfigurationIdentifier
$cfrom :: forall x.
TypeConfigurationIdentifier -> Rep TypeConfigurationIdentifier x
Prelude.Generic)

-- |
-- Create a value of 'TypeConfigurationIdentifier' 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:
--
-- 'typeName', 'typeConfigurationIdentifier_typeName' - The name of the extension type to which this configuration applies.
--
-- 'typeConfigurationArn', 'typeConfigurationIdentifier_typeConfigurationArn' - The Amazon Resource Name (ARN) for the configuration, in this account
-- and region.
--
-- 'typeConfigurationAlias', 'typeConfigurationIdentifier_typeConfigurationAlias' - The alias specified for this configuration, if one was specified when
-- the configuration was set.
--
-- 'typeArn', 'typeConfigurationIdentifier_typeArn' - The Amazon Resource Name (ARN) for the extension, in this account and
-- region.
--
-- For public extensions, this will be the ARN assigned when you
-- <https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_ActivateType.html activate the type>
-- in this account and region. For private extensions, this will be the ARN
-- assigned when you
-- <https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_RegisterType.html register the type>
-- in this account and region.
--
-- 'type'', 'typeConfigurationIdentifier_type' - The type of extension.
newTypeConfigurationIdentifier ::
  TypeConfigurationIdentifier
newTypeConfigurationIdentifier :: TypeConfigurationIdentifier
newTypeConfigurationIdentifier =
  TypeConfigurationIdentifier' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe ThirdPartyType
-> TypeConfigurationIdentifier
TypeConfigurationIdentifier'
    { $sel:typeName:TypeConfigurationIdentifier' :: Maybe Text
typeName =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:typeConfigurationArn:TypeConfigurationIdentifier' :: Maybe Text
typeConfigurationArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:typeConfigurationAlias:TypeConfigurationIdentifier' :: Maybe Text
typeConfigurationAlias = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:typeArn:TypeConfigurationIdentifier' :: Maybe Text
typeArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:type':TypeConfigurationIdentifier' :: Maybe ThirdPartyType
type' = Maybe ThirdPartyType
forall a. Maybe a
Prelude.Nothing
    }

-- | The name of the extension type to which this configuration applies.
typeConfigurationIdentifier_typeName :: Lens.Lens' TypeConfigurationIdentifier (Prelude.Maybe Prelude.Text)
typeConfigurationIdentifier_typeName :: (Maybe Text -> f (Maybe Text))
-> TypeConfigurationIdentifier -> f TypeConfigurationIdentifier
typeConfigurationIdentifier_typeName = (TypeConfigurationIdentifier -> Maybe Text)
-> (TypeConfigurationIdentifier
    -> Maybe Text -> TypeConfigurationIdentifier)
-> Lens
     TypeConfigurationIdentifier
     TypeConfigurationIdentifier
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TypeConfigurationIdentifier' {Maybe Text
typeName :: Maybe Text
$sel:typeName:TypeConfigurationIdentifier' :: TypeConfigurationIdentifier -> Maybe Text
typeName} -> Maybe Text
typeName) (\s :: TypeConfigurationIdentifier
s@TypeConfigurationIdentifier' {} Maybe Text
a -> TypeConfigurationIdentifier
s {$sel:typeName:TypeConfigurationIdentifier' :: Maybe Text
typeName = Maybe Text
a} :: TypeConfigurationIdentifier)

-- | The Amazon Resource Name (ARN) for the configuration, in this account
-- and region.
typeConfigurationIdentifier_typeConfigurationArn :: Lens.Lens' TypeConfigurationIdentifier (Prelude.Maybe Prelude.Text)
typeConfigurationIdentifier_typeConfigurationArn :: (Maybe Text -> f (Maybe Text))
-> TypeConfigurationIdentifier -> f TypeConfigurationIdentifier
typeConfigurationIdentifier_typeConfigurationArn = (TypeConfigurationIdentifier -> Maybe Text)
-> (TypeConfigurationIdentifier
    -> Maybe Text -> TypeConfigurationIdentifier)
-> Lens
     TypeConfigurationIdentifier
     TypeConfigurationIdentifier
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TypeConfigurationIdentifier' {Maybe Text
typeConfigurationArn :: Maybe Text
$sel:typeConfigurationArn:TypeConfigurationIdentifier' :: TypeConfigurationIdentifier -> Maybe Text
typeConfigurationArn} -> Maybe Text
typeConfigurationArn) (\s :: TypeConfigurationIdentifier
s@TypeConfigurationIdentifier' {} Maybe Text
a -> TypeConfigurationIdentifier
s {$sel:typeConfigurationArn:TypeConfigurationIdentifier' :: Maybe Text
typeConfigurationArn = Maybe Text
a} :: TypeConfigurationIdentifier)

-- | The alias specified for this configuration, if one was specified when
-- the configuration was set.
typeConfigurationIdentifier_typeConfigurationAlias :: Lens.Lens' TypeConfigurationIdentifier (Prelude.Maybe Prelude.Text)
typeConfigurationIdentifier_typeConfigurationAlias :: (Maybe Text -> f (Maybe Text))
-> TypeConfigurationIdentifier -> f TypeConfigurationIdentifier
typeConfigurationIdentifier_typeConfigurationAlias = (TypeConfigurationIdentifier -> Maybe Text)
-> (TypeConfigurationIdentifier
    -> Maybe Text -> TypeConfigurationIdentifier)
-> Lens
     TypeConfigurationIdentifier
     TypeConfigurationIdentifier
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TypeConfigurationIdentifier' {Maybe Text
typeConfigurationAlias :: Maybe Text
$sel:typeConfigurationAlias:TypeConfigurationIdentifier' :: TypeConfigurationIdentifier -> Maybe Text
typeConfigurationAlias} -> Maybe Text
typeConfigurationAlias) (\s :: TypeConfigurationIdentifier
s@TypeConfigurationIdentifier' {} Maybe Text
a -> TypeConfigurationIdentifier
s {$sel:typeConfigurationAlias:TypeConfigurationIdentifier' :: Maybe Text
typeConfigurationAlias = Maybe Text
a} :: TypeConfigurationIdentifier)

-- | The Amazon Resource Name (ARN) for the extension, in this account and
-- region.
--
-- For public extensions, this will be the ARN assigned when you
-- <https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_ActivateType.html activate the type>
-- in this account and region. For private extensions, this will be the ARN
-- assigned when you
-- <https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_RegisterType.html register the type>
-- in this account and region.
typeConfigurationIdentifier_typeArn :: Lens.Lens' TypeConfigurationIdentifier (Prelude.Maybe Prelude.Text)
typeConfigurationIdentifier_typeArn :: (Maybe Text -> f (Maybe Text))
-> TypeConfigurationIdentifier -> f TypeConfigurationIdentifier
typeConfigurationIdentifier_typeArn = (TypeConfigurationIdentifier -> Maybe Text)
-> (TypeConfigurationIdentifier
    -> Maybe Text -> TypeConfigurationIdentifier)
-> Lens
     TypeConfigurationIdentifier
     TypeConfigurationIdentifier
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TypeConfigurationIdentifier' {Maybe Text
typeArn :: Maybe Text
$sel:typeArn:TypeConfigurationIdentifier' :: TypeConfigurationIdentifier -> Maybe Text
typeArn} -> Maybe Text
typeArn) (\s :: TypeConfigurationIdentifier
s@TypeConfigurationIdentifier' {} Maybe Text
a -> TypeConfigurationIdentifier
s {$sel:typeArn:TypeConfigurationIdentifier' :: Maybe Text
typeArn = Maybe Text
a} :: TypeConfigurationIdentifier)

-- | The type of extension.
typeConfigurationIdentifier_type :: Lens.Lens' TypeConfigurationIdentifier (Prelude.Maybe ThirdPartyType)
typeConfigurationIdentifier_type :: (Maybe ThirdPartyType -> f (Maybe ThirdPartyType))
-> TypeConfigurationIdentifier -> f TypeConfigurationIdentifier
typeConfigurationIdentifier_type = (TypeConfigurationIdentifier -> Maybe ThirdPartyType)
-> (TypeConfigurationIdentifier
    -> Maybe ThirdPartyType -> TypeConfigurationIdentifier)
-> Lens
     TypeConfigurationIdentifier
     TypeConfigurationIdentifier
     (Maybe ThirdPartyType)
     (Maybe ThirdPartyType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TypeConfigurationIdentifier' {Maybe ThirdPartyType
type' :: Maybe ThirdPartyType
$sel:type':TypeConfigurationIdentifier' :: TypeConfigurationIdentifier -> Maybe ThirdPartyType
type'} -> Maybe ThirdPartyType
type') (\s :: TypeConfigurationIdentifier
s@TypeConfigurationIdentifier' {} Maybe ThirdPartyType
a -> TypeConfigurationIdentifier
s {$sel:type':TypeConfigurationIdentifier' :: Maybe ThirdPartyType
type' = Maybe ThirdPartyType
a} :: TypeConfigurationIdentifier)

instance Core.FromXML TypeConfigurationIdentifier where
  parseXML :: [Node] -> Either String TypeConfigurationIdentifier
parseXML [Node]
x =
    Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe ThirdPartyType
-> TypeConfigurationIdentifier
TypeConfigurationIdentifier'
      (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe ThirdPartyType
 -> TypeConfigurationIdentifier)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe ThirdPartyType
      -> TypeConfigurationIdentifier)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"TypeName")
      Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe ThirdPartyType
   -> TypeConfigurationIdentifier)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe ThirdPartyType
      -> TypeConfigurationIdentifier)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"TypeConfigurationArn")
      Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe ThirdPartyType
   -> TypeConfigurationIdentifier)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text -> Maybe ThirdPartyType -> TypeConfigurationIdentifier)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"TypeConfigurationAlias")
      Either
  String
  (Maybe Text -> Maybe ThirdPartyType -> TypeConfigurationIdentifier)
-> Either String (Maybe Text)
-> Either
     String (Maybe ThirdPartyType -> TypeConfigurationIdentifier)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"TypeArn")
      Either String (Maybe ThirdPartyType -> TypeConfigurationIdentifier)
-> Either String (Maybe ThirdPartyType)
-> Either String TypeConfigurationIdentifier
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe ThirdPartyType)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Type")

instance Prelude.Hashable TypeConfigurationIdentifier

instance Prelude.NFData TypeConfigurationIdentifier

instance Core.ToQuery TypeConfigurationIdentifier where
  toQuery :: TypeConfigurationIdentifier -> QueryString
toQuery TypeConfigurationIdentifier' {Maybe Text
Maybe ThirdPartyType
type' :: Maybe ThirdPartyType
typeArn :: Maybe Text
typeConfigurationAlias :: Maybe Text
typeConfigurationArn :: Maybe Text
typeName :: Maybe Text
$sel:type':TypeConfigurationIdentifier' :: TypeConfigurationIdentifier -> Maybe ThirdPartyType
$sel:typeArn:TypeConfigurationIdentifier' :: TypeConfigurationIdentifier -> Maybe Text
$sel:typeConfigurationAlias:TypeConfigurationIdentifier' :: TypeConfigurationIdentifier -> Maybe Text
$sel:typeConfigurationArn:TypeConfigurationIdentifier' :: TypeConfigurationIdentifier -> Maybe Text
$sel:typeName:TypeConfigurationIdentifier' :: TypeConfigurationIdentifier -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"TypeName" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
typeName,
        ByteString
"TypeConfigurationArn" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
typeConfigurationArn,
        ByteString
"TypeConfigurationAlias"
          ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
typeConfigurationAlias,
        ByteString
"TypeArn" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
typeArn,
        ByteString
"Type" ByteString -> Maybe ThirdPartyType -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe ThirdPartyType
type'
      ]