{-# 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.CompatibleEnvironmentTemplateInput
-- 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.CompatibleEnvironmentTemplateInput where

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

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

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

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

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

instance
  Prelude.Hashable
    CompatibleEnvironmentTemplateInput

instance
  Prelude.NFData
    CompatibleEnvironmentTemplateInput

instance
  Core.ToJSON
    CompatibleEnvironmentTemplateInput
  where
  toJSON :: CompatibleEnvironmentTemplateInput -> Value
toJSON CompatibleEnvironmentTemplateInput' {Text
templateName :: Text
majorVersion :: Text
$sel:templateName:CompatibleEnvironmentTemplateInput' :: CompatibleEnvironmentTemplateInput -> Text
$sel:majorVersion:CompatibleEnvironmentTemplateInput' :: CompatibleEnvironmentTemplateInput -> Text
..} =
    [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
"majorVersion" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
majorVersion),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"templateName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
templateName)
          ]
      )