{-# 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.SecurityHub.Types.AwsElasticBeanstalkEnvironmentTier
-- 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.SecurityHub.Types.AwsElasticBeanstalkEnvironmentTier where

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

-- | Contains information about the tier of the environment.
--
-- /See:/ 'newAwsElasticBeanstalkEnvironmentTier' smart constructor.
data AwsElasticBeanstalkEnvironmentTier = AwsElasticBeanstalkEnvironmentTier'
  { -- | The name of the environment tier.
    AwsElasticBeanstalkEnvironmentTier -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The version of the environment tier.
    AwsElasticBeanstalkEnvironmentTier -> Maybe Text
version :: Prelude.Maybe Prelude.Text,
    -- | The type of environment tier.
    AwsElasticBeanstalkEnvironmentTier -> Maybe Text
type' :: Prelude.Maybe Prelude.Text
  }
  deriving (AwsElasticBeanstalkEnvironmentTier
-> AwsElasticBeanstalkEnvironmentTier -> Bool
(AwsElasticBeanstalkEnvironmentTier
 -> AwsElasticBeanstalkEnvironmentTier -> Bool)
-> (AwsElasticBeanstalkEnvironmentTier
    -> AwsElasticBeanstalkEnvironmentTier -> Bool)
-> Eq AwsElasticBeanstalkEnvironmentTier
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AwsElasticBeanstalkEnvironmentTier
-> AwsElasticBeanstalkEnvironmentTier -> Bool
$c/= :: AwsElasticBeanstalkEnvironmentTier
-> AwsElasticBeanstalkEnvironmentTier -> Bool
== :: AwsElasticBeanstalkEnvironmentTier
-> AwsElasticBeanstalkEnvironmentTier -> Bool
$c== :: AwsElasticBeanstalkEnvironmentTier
-> AwsElasticBeanstalkEnvironmentTier -> Bool
Prelude.Eq, ReadPrec [AwsElasticBeanstalkEnvironmentTier]
ReadPrec AwsElasticBeanstalkEnvironmentTier
Int -> ReadS AwsElasticBeanstalkEnvironmentTier
ReadS [AwsElasticBeanstalkEnvironmentTier]
(Int -> ReadS AwsElasticBeanstalkEnvironmentTier)
-> ReadS [AwsElasticBeanstalkEnvironmentTier]
-> ReadPrec AwsElasticBeanstalkEnvironmentTier
-> ReadPrec [AwsElasticBeanstalkEnvironmentTier]
-> Read AwsElasticBeanstalkEnvironmentTier
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AwsElasticBeanstalkEnvironmentTier]
$creadListPrec :: ReadPrec [AwsElasticBeanstalkEnvironmentTier]
readPrec :: ReadPrec AwsElasticBeanstalkEnvironmentTier
$creadPrec :: ReadPrec AwsElasticBeanstalkEnvironmentTier
readList :: ReadS [AwsElasticBeanstalkEnvironmentTier]
$creadList :: ReadS [AwsElasticBeanstalkEnvironmentTier]
readsPrec :: Int -> ReadS AwsElasticBeanstalkEnvironmentTier
$creadsPrec :: Int -> ReadS AwsElasticBeanstalkEnvironmentTier
Prelude.Read, Int -> AwsElasticBeanstalkEnvironmentTier -> ShowS
[AwsElasticBeanstalkEnvironmentTier] -> ShowS
AwsElasticBeanstalkEnvironmentTier -> String
(Int -> AwsElasticBeanstalkEnvironmentTier -> ShowS)
-> (AwsElasticBeanstalkEnvironmentTier -> String)
-> ([AwsElasticBeanstalkEnvironmentTier] -> ShowS)
-> Show AwsElasticBeanstalkEnvironmentTier
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AwsElasticBeanstalkEnvironmentTier] -> ShowS
$cshowList :: [AwsElasticBeanstalkEnvironmentTier] -> ShowS
show :: AwsElasticBeanstalkEnvironmentTier -> String
$cshow :: AwsElasticBeanstalkEnvironmentTier -> String
showsPrec :: Int -> AwsElasticBeanstalkEnvironmentTier -> ShowS
$cshowsPrec :: Int -> AwsElasticBeanstalkEnvironmentTier -> ShowS
Prelude.Show, (forall x.
 AwsElasticBeanstalkEnvironmentTier
 -> Rep AwsElasticBeanstalkEnvironmentTier x)
-> (forall x.
    Rep AwsElasticBeanstalkEnvironmentTier x
    -> AwsElasticBeanstalkEnvironmentTier)
-> Generic AwsElasticBeanstalkEnvironmentTier
forall x.
Rep AwsElasticBeanstalkEnvironmentTier x
-> AwsElasticBeanstalkEnvironmentTier
forall x.
AwsElasticBeanstalkEnvironmentTier
-> Rep AwsElasticBeanstalkEnvironmentTier x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AwsElasticBeanstalkEnvironmentTier x
-> AwsElasticBeanstalkEnvironmentTier
$cfrom :: forall x.
AwsElasticBeanstalkEnvironmentTier
-> Rep AwsElasticBeanstalkEnvironmentTier x
Prelude.Generic)

-- |
-- Create a value of 'AwsElasticBeanstalkEnvironmentTier' 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:
--
-- 'name', 'awsElasticBeanstalkEnvironmentTier_name' - The name of the environment tier.
--
-- 'version', 'awsElasticBeanstalkEnvironmentTier_version' - The version of the environment tier.
--
-- 'type'', 'awsElasticBeanstalkEnvironmentTier_type' - The type of environment tier.
newAwsElasticBeanstalkEnvironmentTier ::
  AwsElasticBeanstalkEnvironmentTier
newAwsElasticBeanstalkEnvironmentTier :: AwsElasticBeanstalkEnvironmentTier
newAwsElasticBeanstalkEnvironmentTier =
  AwsElasticBeanstalkEnvironmentTier' :: Maybe Text
-> Maybe Text -> Maybe Text -> AwsElasticBeanstalkEnvironmentTier
AwsElasticBeanstalkEnvironmentTier'
    { $sel:name:AwsElasticBeanstalkEnvironmentTier' :: Maybe Text
name =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:version:AwsElasticBeanstalkEnvironmentTier' :: Maybe Text
version = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:type':AwsElasticBeanstalkEnvironmentTier' :: Maybe Text
type' = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The name of the environment tier.
awsElasticBeanstalkEnvironmentTier_name :: Lens.Lens' AwsElasticBeanstalkEnvironmentTier (Prelude.Maybe Prelude.Text)
awsElasticBeanstalkEnvironmentTier_name :: (Maybe Text -> f (Maybe Text))
-> AwsElasticBeanstalkEnvironmentTier
-> f AwsElasticBeanstalkEnvironmentTier
awsElasticBeanstalkEnvironmentTier_name = (AwsElasticBeanstalkEnvironmentTier -> Maybe Text)
-> (AwsElasticBeanstalkEnvironmentTier
    -> Maybe Text -> AwsElasticBeanstalkEnvironmentTier)
-> Lens
     AwsElasticBeanstalkEnvironmentTier
     AwsElasticBeanstalkEnvironmentTier
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsElasticBeanstalkEnvironmentTier' {Maybe Text
name :: Maybe Text
$sel:name:AwsElasticBeanstalkEnvironmentTier' :: AwsElasticBeanstalkEnvironmentTier -> Maybe Text
name} -> Maybe Text
name) (\s :: AwsElasticBeanstalkEnvironmentTier
s@AwsElasticBeanstalkEnvironmentTier' {} Maybe Text
a -> AwsElasticBeanstalkEnvironmentTier
s {$sel:name:AwsElasticBeanstalkEnvironmentTier' :: Maybe Text
name = Maybe Text
a} :: AwsElasticBeanstalkEnvironmentTier)

-- | The version of the environment tier.
awsElasticBeanstalkEnvironmentTier_version :: Lens.Lens' AwsElasticBeanstalkEnvironmentTier (Prelude.Maybe Prelude.Text)
awsElasticBeanstalkEnvironmentTier_version :: (Maybe Text -> f (Maybe Text))
-> AwsElasticBeanstalkEnvironmentTier
-> f AwsElasticBeanstalkEnvironmentTier
awsElasticBeanstalkEnvironmentTier_version = (AwsElasticBeanstalkEnvironmentTier -> Maybe Text)
-> (AwsElasticBeanstalkEnvironmentTier
    -> Maybe Text -> AwsElasticBeanstalkEnvironmentTier)
-> Lens
     AwsElasticBeanstalkEnvironmentTier
     AwsElasticBeanstalkEnvironmentTier
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsElasticBeanstalkEnvironmentTier' {Maybe Text
version :: Maybe Text
$sel:version:AwsElasticBeanstalkEnvironmentTier' :: AwsElasticBeanstalkEnvironmentTier -> Maybe Text
version} -> Maybe Text
version) (\s :: AwsElasticBeanstalkEnvironmentTier
s@AwsElasticBeanstalkEnvironmentTier' {} Maybe Text
a -> AwsElasticBeanstalkEnvironmentTier
s {$sel:version:AwsElasticBeanstalkEnvironmentTier' :: Maybe Text
version = Maybe Text
a} :: AwsElasticBeanstalkEnvironmentTier)

-- | The type of environment tier.
awsElasticBeanstalkEnvironmentTier_type :: Lens.Lens' AwsElasticBeanstalkEnvironmentTier (Prelude.Maybe Prelude.Text)
awsElasticBeanstalkEnvironmentTier_type :: (Maybe Text -> f (Maybe Text))
-> AwsElasticBeanstalkEnvironmentTier
-> f AwsElasticBeanstalkEnvironmentTier
awsElasticBeanstalkEnvironmentTier_type = (AwsElasticBeanstalkEnvironmentTier -> Maybe Text)
-> (AwsElasticBeanstalkEnvironmentTier
    -> Maybe Text -> AwsElasticBeanstalkEnvironmentTier)
-> Lens
     AwsElasticBeanstalkEnvironmentTier
     AwsElasticBeanstalkEnvironmentTier
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsElasticBeanstalkEnvironmentTier' {Maybe Text
type' :: Maybe Text
$sel:type':AwsElasticBeanstalkEnvironmentTier' :: AwsElasticBeanstalkEnvironmentTier -> Maybe Text
type'} -> Maybe Text
type') (\s :: AwsElasticBeanstalkEnvironmentTier
s@AwsElasticBeanstalkEnvironmentTier' {} Maybe Text
a -> AwsElasticBeanstalkEnvironmentTier
s {$sel:type':AwsElasticBeanstalkEnvironmentTier' :: Maybe Text
type' = Maybe Text
a} :: AwsElasticBeanstalkEnvironmentTier)

instance
  Core.FromJSON
    AwsElasticBeanstalkEnvironmentTier
  where
  parseJSON :: Value -> Parser AwsElasticBeanstalkEnvironmentTier
parseJSON =
    String
-> (Object -> Parser AwsElasticBeanstalkEnvironmentTier)
-> Value
-> Parser AwsElasticBeanstalkEnvironmentTier
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AwsElasticBeanstalkEnvironmentTier"
      ( \Object
x ->
          Maybe Text
-> Maybe Text -> Maybe Text -> AwsElasticBeanstalkEnvironmentTier
AwsElasticBeanstalkEnvironmentTier'
            (Maybe Text
 -> Maybe Text -> Maybe Text -> AwsElasticBeanstalkEnvironmentTier)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text -> Maybe Text -> AwsElasticBeanstalkEnvironmentTier)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Name")
            Parser
  (Maybe Text -> Maybe Text -> AwsElasticBeanstalkEnvironmentTier)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> AwsElasticBeanstalkEnvironmentTier)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Version")
            Parser (Maybe Text -> AwsElasticBeanstalkEnvironmentTier)
-> Parser (Maybe Text) -> Parser AwsElasticBeanstalkEnvironmentTier
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Type")
      )

instance
  Prelude.Hashable
    AwsElasticBeanstalkEnvironmentTier

instance
  Prelude.NFData
    AwsElasticBeanstalkEnvironmentTier

instance
  Core.ToJSON
    AwsElasticBeanstalkEnvironmentTier
  where
  toJSON :: AwsElasticBeanstalkEnvironmentTier -> Value
toJSON AwsElasticBeanstalkEnvironmentTier' {Maybe Text
type' :: Maybe Text
version :: Maybe Text
name :: Maybe Text
$sel:type':AwsElasticBeanstalkEnvironmentTier' :: AwsElasticBeanstalkEnvironmentTier -> Maybe Text
$sel:version:AwsElasticBeanstalkEnvironmentTier' :: AwsElasticBeanstalkEnvironmentTier -> Maybe Text
$sel:name:AwsElasticBeanstalkEnvironmentTier' :: AwsElasticBeanstalkEnvironmentTier -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"Name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
name,
            (Text
"Version" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
version,
            (Text
"Type" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
type'
          ]
      )