{-# 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.EMR.Types.SimplifiedApplication
-- 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.EMR.Types.SimplifiedApplication where

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

-- | The returned release label application names or versions.
--
-- /See:/ 'newSimplifiedApplication' smart constructor.
data SimplifiedApplication = SimplifiedApplication'
  { -- | The returned release label application name. For example, @hadoop@.
    SimplifiedApplication -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The returned release label application version. For example, @3.2.1@.
    SimplifiedApplication -> Maybe Text
version :: Prelude.Maybe Prelude.Text
  }
  deriving (SimplifiedApplication -> SimplifiedApplication -> Bool
(SimplifiedApplication -> SimplifiedApplication -> Bool)
-> (SimplifiedApplication -> SimplifiedApplication -> Bool)
-> Eq SimplifiedApplication
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SimplifiedApplication -> SimplifiedApplication -> Bool
$c/= :: SimplifiedApplication -> SimplifiedApplication -> Bool
== :: SimplifiedApplication -> SimplifiedApplication -> Bool
$c== :: SimplifiedApplication -> SimplifiedApplication -> Bool
Prelude.Eq, ReadPrec [SimplifiedApplication]
ReadPrec SimplifiedApplication
Int -> ReadS SimplifiedApplication
ReadS [SimplifiedApplication]
(Int -> ReadS SimplifiedApplication)
-> ReadS [SimplifiedApplication]
-> ReadPrec SimplifiedApplication
-> ReadPrec [SimplifiedApplication]
-> Read SimplifiedApplication
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SimplifiedApplication]
$creadListPrec :: ReadPrec [SimplifiedApplication]
readPrec :: ReadPrec SimplifiedApplication
$creadPrec :: ReadPrec SimplifiedApplication
readList :: ReadS [SimplifiedApplication]
$creadList :: ReadS [SimplifiedApplication]
readsPrec :: Int -> ReadS SimplifiedApplication
$creadsPrec :: Int -> ReadS SimplifiedApplication
Prelude.Read, Int -> SimplifiedApplication -> ShowS
[SimplifiedApplication] -> ShowS
SimplifiedApplication -> String
(Int -> SimplifiedApplication -> ShowS)
-> (SimplifiedApplication -> String)
-> ([SimplifiedApplication] -> ShowS)
-> Show SimplifiedApplication
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SimplifiedApplication] -> ShowS
$cshowList :: [SimplifiedApplication] -> ShowS
show :: SimplifiedApplication -> String
$cshow :: SimplifiedApplication -> String
showsPrec :: Int -> SimplifiedApplication -> ShowS
$cshowsPrec :: Int -> SimplifiedApplication -> ShowS
Prelude.Show, (forall x. SimplifiedApplication -> Rep SimplifiedApplication x)
-> (forall x. Rep SimplifiedApplication x -> SimplifiedApplication)
-> Generic SimplifiedApplication
forall x. Rep SimplifiedApplication x -> SimplifiedApplication
forall x. SimplifiedApplication -> Rep SimplifiedApplication x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SimplifiedApplication x -> SimplifiedApplication
$cfrom :: forall x. SimplifiedApplication -> Rep SimplifiedApplication x
Prelude.Generic)

-- |
-- Create a value of 'SimplifiedApplication' 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', 'simplifiedApplication_name' - The returned release label application name. For example, @hadoop@.
--
-- 'version', 'simplifiedApplication_version' - The returned release label application version. For example, @3.2.1@.
newSimplifiedApplication ::
  SimplifiedApplication
newSimplifiedApplication :: SimplifiedApplication
newSimplifiedApplication =
  SimplifiedApplication' :: Maybe Text -> Maybe Text -> SimplifiedApplication
SimplifiedApplication'
    { $sel:name:SimplifiedApplication' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:version:SimplifiedApplication' :: Maybe Text
version = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The returned release label application name. For example, @hadoop@.
simplifiedApplication_name :: Lens.Lens' SimplifiedApplication (Prelude.Maybe Prelude.Text)
simplifiedApplication_name :: (Maybe Text -> f (Maybe Text))
-> SimplifiedApplication -> f SimplifiedApplication
simplifiedApplication_name = (SimplifiedApplication -> Maybe Text)
-> (SimplifiedApplication -> Maybe Text -> SimplifiedApplication)
-> Lens
     SimplifiedApplication
     SimplifiedApplication
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SimplifiedApplication' {Maybe Text
name :: Maybe Text
$sel:name:SimplifiedApplication' :: SimplifiedApplication -> Maybe Text
name} -> Maybe Text
name) (\s :: SimplifiedApplication
s@SimplifiedApplication' {} Maybe Text
a -> SimplifiedApplication
s {$sel:name:SimplifiedApplication' :: Maybe Text
name = Maybe Text
a} :: SimplifiedApplication)

-- | The returned release label application version. For example, @3.2.1@.
simplifiedApplication_version :: Lens.Lens' SimplifiedApplication (Prelude.Maybe Prelude.Text)
simplifiedApplication_version :: (Maybe Text -> f (Maybe Text))
-> SimplifiedApplication -> f SimplifiedApplication
simplifiedApplication_version = (SimplifiedApplication -> Maybe Text)
-> (SimplifiedApplication -> Maybe Text -> SimplifiedApplication)
-> Lens
     SimplifiedApplication
     SimplifiedApplication
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SimplifiedApplication' {Maybe Text
version :: Maybe Text
$sel:version:SimplifiedApplication' :: SimplifiedApplication -> Maybe Text
version} -> Maybe Text
version) (\s :: SimplifiedApplication
s@SimplifiedApplication' {} Maybe Text
a -> SimplifiedApplication
s {$sel:version:SimplifiedApplication' :: Maybe Text
version = Maybe Text
a} :: SimplifiedApplication)

instance Core.FromJSON SimplifiedApplication where
  parseJSON :: Value -> Parser SimplifiedApplication
parseJSON =
    String
-> (Object -> Parser SimplifiedApplication)
-> Value
-> Parser SimplifiedApplication
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"SimplifiedApplication"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> SimplifiedApplication
SimplifiedApplication'
            (Maybe Text -> Maybe Text -> SimplifiedApplication)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> SimplifiedApplication)
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 -> SimplifiedApplication)
-> Parser (Maybe Text) -> Parser SimplifiedApplication
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")
      )

instance Prelude.Hashable SimplifiedApplication

instance Prelude.NFData SimplifiedApplication