{-# 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.Proton.Types.CompatibleEnvironmentTemplate
-- 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.Proton.Types.CompatibleEnvironmentTemplate where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Compatible environment template data.
--
-- /See:/ 'newCompatibleEnvironmentTemplate' smart constructor.
data CompatibleEnvironmentTemplate = CompatibleEnvironmentTemplate'
  { -- | The major version of the compatible environment template.
    CompatibleEnvironmentTemplate -> Text
majorVersion :: Prelude.Text,
    -- | The compatible environment template name.
    CompatibleEnvironmentTemplate -> Text
templateName :: Prelude.Text
  }
  deriving (CompatibleEnvironmentTemplate
-> CompatibleEnvironmentTemplate -> Bool
(CompatibleEnvironmentTemplate
 -> CompatibleEnvironmentTemplate -> Bool)
-> (CompatibleEnvironmentTemplate
    -> CompatibleEnvironmentTemplate -> Bool)
-> Eq CompatibleEnvironmentTemplate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CompatibleEnvironmentTemplate
-> CompatibleEnvironmentTemplate -> Bool
$c/= :: CompatibleEnvironmentTemplate
-> CompatibleEnvironmentTemplate -> Bool
== :: CompatibleEnvironmentTemplate
-> CompatibleEnvironmentTemplate -> Bool
$c== :: CompatibleEnvironmentTemplate
-> CompatibleEnvironmentTemplate -> Bool
Prelude.Eq, ReadPrec [CompatibleEnvironmentTemplate]
ReadPrec CompatibleEnvironmentTemplate
Int -> ReadS CompatibleEnvironmentTemplate
ReadS [CompatibleEnvironmentTemplate]
(Int -> ReadS CompatibleEnvironmentTemplate)
-> ReadS [CompatibleEnvironmentTemplate]
-> ReadPrec CompatibleEnvironmentTemplate
-> ReadPrec [CompatibleEnvironmentTemplate]
-> Read CompatibleEnvironmentTemplate
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CompatibleEnvironmentTemplate]
$creadListPrec :: ReadPrec [CompatibleEnvironmentTemplate]
readPrec :: ReadPrec CompatibleEnvironmentTemplate
$creadPrec :: ReadPrec CompatibleEnvironmentTemplate
readList :: ReadS [CompatibleEnvironmentTemplate]
$creadList :: ReadS [CompatibleEnvironmentTemplate]
readsPrec :: Int -> ReadS CompatibleEnvironmentTemplate
$creadsPrec :: Int -> ReadS CompatibleEnvironmentTemplate
Prelude.Read, Int -> CompatibleEnvironmentTemplate -> ShowS
[CompatibleEnvironmentTemplate] -> ShowS
CompatibleEnvironmentTemplate -> String
(Int -> CompatibleEnvironmentTemplate -> ShowS)
-> (CompatibleEnvironmentTemplate -> String)
-> ([CompatibleEnvironmentTemplate] -> ShowS)
-> Show CompatibleEnvironmentTemplate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CompatibleEnvironmentTemplate] -> ShowS
$cshowList :: [CompatibleEnvironmentTemplate] -> ShowS
show :: CompatibleEnvironmentTemplate -> String
$cshow :: CompatibleEnvironmentTemplate -> String
showsPrec :: Int -> CompatibleEnvironmentTemplate -> ShowS
$cshowsPrec :: Int -> CompatibleEnvironmentTemplate -> ShowS
Prelude.Show, (forall x.
 CompatibleEnvironmentTemplate
 -> Rep CompatibleEnvironmentTemplate x)
-> (forall x.
    Rep CompatibleEnvironmentTemplate x
    -> CompatibleEnvironmentTemplate)
-> Generic CompatibleEnvironmentTemplate
forall x.
Rep CompatibleEnvironmentTemplate x
-> CompatibleEnvironmentTemplate
forall x.
CompatibleEnvironmentTemplate
-> Rep CompatibleEnvironmentTemplate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CompatibleEnvironmentTemplate x
-> CompatibleEnvironmentTemplate
$cfrom :: forall x.
CompatibleEnvironmentTemplate
-> Rep CompatibleEnvironmentTemplate x
Prelude.Generic)

-- |
-- Create a value of 'CompatibleEnvironmentTemplate' 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:
--
-- 'majorVersion', 'compatibleEnvironmentTemplate_majorVersion' - The major version of the compatible environment template.
--
-- 'templateName', 'compatibleEnvironmentTemplate_templateName' - The compatible environment template name.
newCompatibleEnvironmentTemplate ::
  -- | 'majorVersion'
  Prelude.Text ->
  -- | 'templateName'
  Prelude.Text ->
  CompatibleEnvironmentTemplate
newCompatibleEnvironmentTemplate :: Text -> Text -> CompatibleEnvironmentTemplate
newCompatibleEnvironmentTemplate
  Text
pMajorVersion_
  Text
pTemplateName_ =
    CompatibleEnvironmentTemplate' :: Text -> Text -> CompatibleEnvironmentTemplate
CompatibleEnvironmentTemplate'
      { $sel:majorVersion:CompatibleEnvironmentTemplate' :: Text
majorVersion =
          Text
pMajorVersion_,
        $sel:templateName:CompatibleEnvironmentTemplate' :: Text
templateName = Text
pTemplateName_
      }

-- | The major version of the compatible environment template.
compatibleEnvironmentTemplate_majorVersion :: Lens.Lens' CompatibleEnvironmentTemplate Prelude.Text
compatibleEnvironmentTemplate_majorVersion :: (Text -> f Text)
-> CompatibleEnvironmentTemplate -> f CompatibleEnvironmentTemplate
compatibleEnvironmentTemplate_majorVersion = (CompatibleEnvironmentTemplate -> Text)
-> (CompatibleEnvironmentTemplate
    -> Text -> CompatibleEnvironmentTemplate)
-> Lens
     CompatibleEnvironmentTemplate
     CompatibleEnvironmentTemplate
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CompatibleEnvironmentTemplate' {Text
majorVersion :: Text
$sel:majorVersion:CompatibleEnvironmentTemplate' :: CompatibleEnvironmentTemplate -> Text
majorVersion} -> Text
majorVersion) (\s :: CompatibleEnvironmentTemplate
s@CompatibleEnvironmentTemplate' {} Text
a -> CompatibleEnvironmentTemplate
s {$sel:majorVersion:CompatibleEnvironmentTemplate' :: Text
majorVersion = Text
a} :: CompatibleEnvironmentTemplate)

-- | The compatible environment template name.
compatibleEnvironmentTemplate_templateName :: Lens.Lens' CompatibleEnvironmentTemplate Prelude.Text
compatibleEnvironmentTemplate_templateName :: (Text -> f Text)
-> CompatibleEnvironmentTemplate -> f CompatibleEnvironmentTemplate
compatibleEnvironmentTemplate_templateName = (CompatibleEnvironmentTemplate -> Text)
-> (CompatibleEnvironmentTemplate
    -> Text -> CompatibleEnvironmentTemplate)
-> Lens
     CompatibleEnvironmentTemplate
     CompatibleEnvironmentTemplate
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CompatibleEnvironmentTemplate' {Text
templateName :: Text
$sel:templateName:CompatibleEnvironmentTemplate' :: CompatibleEnvironmentTemplate -> Text
templateName} -> Text
templateName) (\s :: CompatibleEnvironmentTemplate
s@CompatibleEnvironmentTemplate' {} Text
a -> CompatibleEnvironmentTemplate
s {$sel:templateName:CompatibleEnvironmentTemplate' :: Text
templateName = Text
a} :: CompatibleEnvironmentTemplate)

instance Core.FromJSON CompatibleEnvironmentTemplate where
  parseJSON :: Value -> Parser CompatibleEnvironmentTemplate
parseJSON =
    String
-> (Object -> Parser CompatibleEnvironmentTemplate)
-> Value
-> Parser CompatibleEnvironmentTemplate
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"CompatibleEnvironmentTemplate"
      ( \Object
x ->
          Text -> Text -> CompatibleEnvironmentTemplate
CompatibleEnvironmentTemplate'
            (Text -> Text -> CompatibleEnvironmentTemplate)
-> Parser Text -> Parser (Text -> CompatibleEnvironmentTemplate)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"majorVersion")
            Parser (Text -> CompatibleEnvironmentTemplate)
-> Parser Text -> Parser CompatibleEnvironmentTemplate
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"templateName")
      )

instance
  Prelude.Hashable
    CompatibleEnvironmentTemplate

instance Prelude.NFData CompatibleEnvironmentTemplate