{-# 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.EMRContainers.Types.EksInfo
-- 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.EMRContainers.Types.EksInfo 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 information about the EKS cluster.
--
-- /See:/ 'newEksInfo' smart constructor.
data EksInfo = EksInfo'
  { -- | The namespaces of the EKS cluster.
    EksInfo -> Maybe Text
namespace :: Prelude.Maybe Prelude.Text
  }
  deriving (EksInfo -> EksInfo -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EksInfo -> EksInfo -> Bool
$c/= :: EksInfo -> EksInfo -> Bool
== :: EksInfo -> EksInfo -> Bool
$c== :: EksInfo -> EksInfo -> Bool
Prelude.Eq, ReadPrec [EksInfo]
ReadPrec EksInfo
Int -> ReadS EksInfo
ReadS [EksInfo]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EksInfo]
$creadListPrec :: ReadPrec [EksInfo]
readPrec :: ReadPrec EksInfo
$creadPrec :: ReadPrec EksInfo
readList :: ReadS [EksInfo]
$creadList :: ReadS [EksInfo]
readsPrec :: Int -> ReadS EksInfo
$creadsPrec :: Int -> ReadS EksInfo
Prelude.Read, Int -> EksInfo -> ShowS
[EksInfo] -> ShowS
EksInfo -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EksInfo] -> ShowS
$cshowList :: [EksInfo] -> ShowS
show :: EksInfo -> String
$cshow :: EksInfo -> String
showsPrec :: Int -> EksInfo -> ShowS
$cshowsPrec :: Int -> EksInfo -> ShowS
Prelude.Show, forall x. Rep EksInfo x -> EksInfo
forall x. EksInfo -> Rep EksInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EksInfo x -> EksInfo
$cfrom :: forall x. EksInfo -> Rep EksInfo x
Prelude.Generic)

-- |
-- Create a value of 'EksInfo' 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:
--
-- 'namespace', 'eksInfo_namespace' - The namespaces of the EKS cluster.
newEksInfo ::
  EksInfo
newEksInfo :: EksInfo
newEksInfo = EksInfo' {$sel:namespace:EksInfo' :: Maybe Text
namespace = forall a. Maybe a
Prelude.Nothing}

-- | The namespaces of the EKS cluster.
eksInfo_namespace :: Lens.Lens' EksInfo (Prelude.Maybe Prelude.Text)
eksInfo_namespace :: Lens' EksInfo (Maybe Text)
eksInfo_namespace = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EksInfo' {Maybe Text
namespace :: Maybe Text
$sel:namespace:EksInfo' :: EksInfo -> Maybe Text
namespace} -> Maybe Text
namespace) (\s :: EksInfo
s@EksInfo' {} Maybe Text
a -> EksInfo
s {$sel:namespace:EksInfo' :: Maybe Text
namespace = Maybe Text
a} :: EksInfo)

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

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

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

instance Data.ToJSON EksInfo where
  toJSON :: EksInfo -> Value
toJSON EksInfo' {Maybe Text
namespace :: Maybe Text
$sel:namespace:EksInfo' :: EksInfo -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [(Key
"namespace" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
namespace]
      )