{-# 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-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.EMRContainers.Types.EksInfo where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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
(EksInfo -> EksInfo -> Bool)
-> (EksInfo -> EksInfo -> Bool) -> Eq EksInfo
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]
(Int -> ReadS EksInfo)
-> ReadS [EksInfo]
-> ReadPrec EksInfo
-> ReadPrec [EksInfo]
-> Read 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
(Int -> EksInfo -> ShowS)
-> (EksInfo -> String) -> ([EksInfo] -> ShowS) -> Show EksInfo
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. EksInfo -> Rep EksInfo x)
-> (forall x. Rep EksInfo x -> EksInfo) -> Generic EksInfo
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' :: Maybe Text -> EksInfo
EksInfo' {$sel:namespace:EksInfo' :: Maybe Text
namespace = Maybe Text
forall a. Maybe a
Prelude.Nothing}

-- | The namespaces of the EKS cluster.
eksInfo_namespace :: Lens.Lens' EksInfo (Prelude.Maybe Prelude.Text)
eksInfo_namespace :: (Maybe Text -> f (Maybe Text)) -> EksInfo -> f EksInfo
eksInfo_namespace = (EksInfo -> Maybe Text)
-> (EksInfo -> Maybe Text -> EksInfo)
-> Lens EksInfo EksInfo (Maybe Text) (Maybe Text)
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 Core.FromJSON EksInfo where
  parseJSON :: Value -> Parser EksInfo
parseJSON =
    String -> (Object -> Parser EksInfo) -> Value -> Parser EksInfo
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"EksInfo"
      ( \Object
x ->
          Maybe Text -> EksInfo
EksInfo' (Maybe Text -> EksInfo) -> Parser (Maybe Text) -> Parser EksInfo
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
"namespace")
      )

instance Prelude.Hashable EksInfo

instance Prelude.NFData EksInfo

instance Core.ToJSON EksInfo where
  toJSON :: EksInfo -> Value
toJSON EksInfo' {Maybe Text
namespace :: Maybe Text
$sel:namespace:EksInfo' :: EksInfo -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [(Text
"namespace" 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
namespace]
      )