{-# 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.OSRelease
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.EMR.Types.OSRelease where

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

-- | The Amazon Linux release specified for a cluster in the RunJobFlow
-- request.
--
-- /See:/ 'newOSRelease' smart constructor.
data OSRelease = OSRelease'
  { -- | The Amazon Linux release specified for a cluster in the RunJobFlow
    -- request. The format is as shown in
    -- <https://docs.aws.amazon.com/AL2/latest/relnotes/relnotes-20220218.html Amazon Linux 2 Release Notes>
    -- . For example, 2.0.20220218.1.
    OSRelease -> Maybe Text
label :: Prelude.Maybe Prelude.Text
  }
  deriving (OSRelease -> OSRelease -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: OSRelease -> OSRelease -> Bool
$c/= :: OSRelease -> OSRelease -> Bool
== :: OSRelease -> OSRelease -> Bool
$c== :: OSRelease -> OSRelease -> Bool
Prelude.Eq, ReadPrec [OSRelease]
ReadPrec OSRelease
Int -> ReadS OSRelease
ReadS [OSRelease]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [OSRelease]
$creadListPrec :: ReadPrec [OSRelease]
readPrec :: ReadPrec OSRelease
$creadPrec :: ReadPrec OSRelease
readList :: ReadS [OSRelease]
$creadList :: ReadS [OSRelease]
readsPrec :: Int -> ReadS OSRelease
$creadsPrec :: Int -> ReadS OSRelease
Prelude.Read, Int -> OSRelease -> ShowS
[OSRelease] -> ShowS
OSRelease -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [OSRelease] -> ShowS
$cshowList :: [OSRelease] -> ShowS
show :: OSRelease -> String
$cshow :: OSRelease -> String
showsPrec :: Int -> OSRelease -> ShowS
$cshowsPrec :: Int -> OSRelease -> ShowS
Prelude.Show, forall x. Rep OSRelease x -> OSRelease
forall x. OSRelease -> Rep OSRelease x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep OSRelease x -> OSRelease
$cfrom :: forall x. OSRelease -> Rep OSRelease x
Prelude.Generic)

-- |
-- Create a value of 'OSRelease' 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:
--
-- 'label', 'oSRelease_label' - The Amazon Linux release specified for a cluster in the RunJobFlow
-- request. The format is as shown in
-- <https://docs.aws.amazon.com/AL2/latest/relnotes/relnotes-20220218.html Amazon Linux 2 Release Notes>
-- . For example, 2.0.20220218.1.
newOSRelease ::
  OSRelease
newOSRelease :: OSRelease
newOSRelease = OSRelease' {$sel:label:OSRelease' :: Maybe Text
label = forall a. Maybe a
Prelude.Nothing}

-- | The Amazon Linux release specified for a cluster in the RunJobFlow
-- request. The format is as shown in
-- <https://docs.aws.amazon.com/AL2/latest/relnotes/relnotes-20220218.html Amazon Linux 2 Release Notes>
-- . For example, 2.0.20220218.1.
oSRelease_label :: Lens.Lens' OSRelease (Prelude.Maybe Prelude.Text)
oSRelease_label :: Lens' OSRelease (Maybe Text)
oSRelease_label = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OSRelease' {Maybe Text
label :: Maybe Text
$sel:label:OSRelease' :: OSRelease -> Maybe Text
label} -> Maybe Text
label) (\s :: OSRelease
s@OSRelease' {} Maybe Text
a -> OSRelease
s {$sel:label:OSRelease' :: Maybe Text
label = Maybe Text
a} :: OSRelease)

instance Data.FromJSON OSRelease where
  parseJSON :: Value -> Parser OSRelease
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"OSRelease"
      (\Object
x -> Maybe Text -> OSRelease
OSRelease' forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Label"))

instance Prelude.Hashable OSRelease where
  hashWithSalt :: Int -> OSRelease -> Int
hashWithSalt Int
_salt OSRelease' {Maybe Text
label :: Maybe Text
$sel:label:OSRelease' :: OSRelease -> Maybe Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
label

instance Prelude.NFData OSRelease where
  rnf :: OSRelease -> ()
rnf OSRelease' {Maybe Text
label :: Maybe Text
$sel:label:OSRelease' :: OSRelease -> Maybe Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
label