{-# 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.EKS.Types.KubernetesNetworkConfigResponse
-- 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.EKS.Types.KubernetesNetworkConfigResponse where

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

-- | The Kubernetes network configuration for the cluster.
--
-- /See:/ 'newKubernetesNetworkConfigResponse' smart constructor.
data KubernetesNetworkConfigResponse = KubernetesNetworkConfigResponse'
  { -- | The CIDR block that Kubernetes service IP addresses are assigned from.
    -- If you didn\'t specify a CIDR block when you created the cluster, then
    -- Kubernetes assigns addresses from either the 10.100.0.0\/16 or
    -- 172.20.0.0\/16 CIDR blocks. If this was specified, then it was specified
    -- when the cluster was created and it cannot be changed.
    KubernetesNetworkConfigResponse -> Maybe Text
serviceIpv4Cidr :: Prelude.Maybe Prelude.Text
  }
  deriving (KubernetesNetworkConfigResponse
-> KubernetesNetworkConfigResponse -> Bool
(KubernetesNetworkConfigResponse
 -> KubernetesNetworkConfigResponse -> Bool)
-> (KubernetesNetworkConfigResponse
    -> KubernetesNetworkConfigResponse -> Bool)
-> Eq KubernetesNetworkConfigResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: KubernetesNetworkConfigResponse
-> KubernetesNetworkConfigResponse -> Bool
$c/= :: KubernetesNetworkConfigResponse
-> KubernetesNetworkConfigResponse -> Bool
== :: KubernetesNetworkConfigResponse
-> KubernetesNetworkConfigResponse -> Bool
$c== :: KubernetesNetworkConfigResponse
-> KubernetesNetworkConfigResponse -> Bool
Prelude.Eq, ReadPrec [KubernetesNetworkConfigResponse]
ReadPrec KubernetesNetworkConfigResponse
Int -> ReadS KubernetesNetworkConfigResponse
ReadS [KubernetesNetworkConfigResponse]
(Int -> ReadS KubernetesNetworkConfigResponse)
-> ReadS [KubernetesNetworkConfigResponse]
-> ReadPrec KubernetesNetworkConfigResponse
-> ReadPrec [KubernetesNetworkConfigResponse]
-> Read KubernetesNetworkConfigResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [KubernetesNetworkConfigResponse]
$creadListPrec :: ReadPrec [KubernetesNetworkConfigResponse]
readPrec :: ReadPrec KubernetesNetworkConfigResponse
$creadPrec :: ReadPrec KubernetesNetworkConfigResponse
readList :: ReadS [KubernetesNetworkConfigResponse]
$creadList :: ReadS [KubernetesNetworkConfigResponse]
readsPrec :: Int -> ReadS KubernetesNetworkConfigResponse
$creadsPrec :: Int -> ReadS KubernetesNetworkConfigResponse
Prelude.Read, Int -> KubernetesNetworkConfigResponse -> ShowS
[KubernetesNetworkConfigResponse] -> ShowS
KubernetesNetworkConfigResponse -> String
(Int -> KubernetesNetworkConfigResponse -> ShowS)
-> (KubernetesNetworkConfigResponse -> String)
-> ([KubernetesNetworkConfigResponse] -> ShowS)
-> Show KubernetesNetworkConfigResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [KubernetesNetworkConfigResponse] -> ShowS
$cshowList :: [KubernetesNetworkConfigResponse] -> ShowS
show :: KubernetesNetworkConfigResponse -> String
$cshow :: KubernetesNetworkConfigResponse -> String
showsPrec :: Int -> KubernetesNetworkConfigResponse -> ShowS
$cshowsPrec :: Int -> KubernetesNetworkConfigResponse -> ShowS
Prelude.Show, (forall x.
 KubernetesNetworkConfigResponse
 -> Rep KubernetesNetworkConfigResponse x)
-> (forall x.
    Rep KubernetesNetworkConfigResponse x
    -> KubernetesNetworkConfigResponse)
-> Generic KubernetesNetworkConfigResponse
forall x.
Rep KubernetesNetworkConfigResponse x
-> KubernetesNetworkConfigResponse
forall x.
KubernetesNetworkConfigResponse
-> Rep KubernetesNetworkConfigResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep KubernetesNetworkConfigResponse x
-> KubernetesNetworkConfigResponse
$cfrom :: forall x.
KubernetesNetworkConfigResponse
-> Rep KubernetesNetworkConfigResponse x
Prelude.Generic)

-- |
-- Create a value of 'KubernetesNetworkConfigResponse' 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:
--
-- 'serviceIpv4Cidr', 'kubernetesNetworkConfigResponse_serviceIpv4Cidr' - The CIDR block that Kubernetes service IP addresses are assigned from.
-- If you didn\'t specify a CIDR block when you created the cluster, then
-- Kubernetes assigns addresses from either the 10.100.0.0\/16 or
-- 172.20.0.0\/16 CIDR blocks. If this was specified, then it was specified
-- when the cluster was created and it cannot be changed.
newKubernetesNetworkConfigResponse ::
  KubernetesNetworkConfigResponse
newKubernetesNetworkConfigResponse :: KubernetesNetworkConfigResponse
newKubernetesNetworkConfigResponse =
  KubernetesNetworkConfigResponse' :: Maybe Text -> KubernetesNetworkConfigResponse
KubernetesNetworkConfigResponse'
    { $sel:serviceIpv4Cidr:KubernetesNetworkConfigResponse' :: Maybe Text
serviceIpv4Cidr =
        Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The CIDR block that Kubernetes service IP addresses are assigned from.
-- If you didn\'t specify a CIDR block when you created the cluster, then
-- Kubernetes assigns addresses from either the 10.100.0.0\/16 or
-- 172.20.0.0\/16 CIDR blocks. If this was specified, then it was specified
-- when the cluster was created and it cannot be changed.
kubernetesNetworkConfigResponse_serviceIpv4Cidr :: Lens.Lens' KubernetesNetworkConfigResponse (Prelude.Maybe Prelude.Text)
kubernetesNetworkConfigResponse_serviceIpv4Cidr :: (Maybe Text -> f (Maybe Text))
-> KubernetesNetworkConfigResponse
-> f KubernetesNetworkConfigResponse
kubernetesNetworkConfigResponse_serviceIpv4Cidr = (KubernetesNetworkConfigResponse -> Maybe Text)
-> (KubernetesNetworkConfigResponse
    -> Maybe Text -> KubernetesNetworkConfigResponse)
-> Lens
     KubernetesNetworkConfigResponse
     KubernetesNetworkConfigResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KubernetesNetworkConfigResponse' {Maybe Text
serviceIpv4Cidr :: Maybe Text
$sel:serviceIpv4Cidr:KubernetesNetworkConfigResponse' :: KubernetesNetworkConfigResponse -> Maybe Text
serviceIpv4Cidr} -> Maybe Text
serviceIpv4Cidr) (\s :: KubernetesNetworkConfigResponse
s@KubernetesNetworkConfigResponse' {} Maybe Text
a -> KubernetesNetworkConfigResponse
s {$sel:serviceIpv4Cidr:KubernetesNetworkConfigResponse' :: Maybe Text
serviceIpv4Cidr = Maybe Text
a} :: KubernetesNetworkConfigResponse)

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

instance
  Prelude.Hashable
    KubernetesNetworkConfigResponse

instance
  Prelude.NFData
    KubernetesNetworkConfigResponse