{-# 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.ConnectorConfigResponse
-- 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.ConnectorConfigResponse where

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

-- | The full description of your connected cluster.
--
-- /See:/ 'newConnectorConfigResponse' smart constructor.
data ConnectorConfigResponse = ConnectorConfigResponse'
  { -- | A unique code associated with the cluster for registration purposes.
    ConnectorConfigResponse -> Maybe Text
activationCode :: Prelude.Maybe Prelude.Text,
    -- | A unique ID associated with the cluster for registration purposes.
    ConnectorConfigResponse -> Maybe Text
activationId :: Prelude.Maybe Prelude.Text,
    -- | The expiration time of the connected cluster. The cluster\'s YAML file
    -- must be applied through the native provider.
    ConnectorConfigResponse -> Maybe POSIX
activationExpiry :: Prelude.Maybe Core.POSIX,
    -- | The cluster\'s cloud service provider.
    ConnectorConfigResponse -> Maybe Text
provider :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the role that is used by the EKS
    -- connector to communicate with AWS services from the connected Kubernetes
    -- cluster.
    ConnectorConfigResponse -> Maybe Text
roleArn :: Prelude.Maybe Prelude.Text
  }
  deriving (ConnectorConfigResponse -> ConnectorConfigResponse -> Bool
(ConnectorConfigResponse -> ConnectorConfigResponse -> Bool)
-> (ConnectorConfigResponse -> ConnectorConfigResponse -> Bool)
-> Eq ConnectorConfigResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ConnectorConfigResponse -> ConnectorConfigResponse -> Bool
$c/= :: ConnectorConfigResponse -> ConnectorConfigResponse -> Bool
== :: ConnectorConfigResponse -> ConnectorConfigResponse -> Bool
$c== :: ConnectorConfigResponse -> ConnectorConfigResponse -> Bool
Prelude.Eq, ReadPrec [ConnectorConfigResponse]
ReadPrec ConnectorConfigResponse
Int -> ReadS ConnectorConfigResponse
ReadS [ConnectorConfigResponse]
(Int -> ReadS ConnectorConfigResponse)
-> ReadS [ConnectorConfigResponse]
-> ReadPrec ConnectorConfigResponse
-> ReadPrec [ConnectorConfigResponse]
-> Read ConnectorConfigResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ConnectorConfigResponse]
$creadListPrec :: ReadPrec [ConnectorConfigResponse]
readPrec :: ReadPrec ConnectorConfigResponse
$creadPrec :: ReadPrec ConnectorConfigResponse
readList :: ReadS [ConnectorConfigResponse]
$creadList :: ReadS [ConnectorConfigResponse]
readsPrec :: Int -> ReadS ConnectorConfigResponse
$creadsPrec :: Int -> ReadS ConnectorConfigResponse
Prelude.Read, Int -> ConnectorConfigResponse -> ShowS
[ConnectorConfigResponse] -> ShowS
ConnectorConfigResponse -> String
(Int -> ConnectorConfigResponse -> ShowS)
-> (ConnectorConfigResponse -> String)
-> ([ConnectorConfigResponse] -> ShowS)
-> Show ConnectorConfigResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ConnectorConfigResponse] -> ShowS
$cshowList :: [ConnectorConfigResponse] -> ShowS
show :: ConnectorConfigResponse -> String
$cshow :: ConnectorConfigResponse -> String
showsPrec :: Int -> ConnectorConfigResponse -> ShowS
$cshowsPrec :: Int -> ConnectorConfigResponse -> ShowS
Prelude.Show, (forall x.
 ConnectorConfigResponse -> Rep ConnectorConfigResponse x)
-> (forall x.
    Rep ConnectorConfigResponse x -> ConnectorConfigResponse)
-> Generic ConnectorConfigResponse
forall x. Rep ConnectorConfigResponse x -> ConnectorConfigResponse
forall x. ConnectorConfigResponse -> Rep ConnectorConfigResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ConnectorConfigResponse x -> ConnectorConfigResponse
$cfrom :: forall x. ConnectorConfigResponse -> Rep ConnectorConfigResponse x
Prelude.Generic)

-- |
-- Create a value of 'ConnectorConfigResponse' 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:
--
-- 'activationCode', 'connectorConfigResponse_activationCode' - A unique code associated with the cluster for registration purposes.
--
-- 'activationId', 'connectorConfigResponse_activationId' - A unique ID associated with the cluster for registration purposes.
--
-- 'activationExpiry', 'connectorConfigResponse_activationExpiry' - The expiration time of the connected cluster. The cluster\'s YAML file
-- must be applied through the native provider.
--
-- 'provider', 'connectorConfigResponse_provider' - The cluster\'s cloud service provider.
--
-- 'roleArn', 'connectorConfigResponse_roleArn' - The Amazon Resource Name (ARN) of the role that is used by the EKS
-- connector to communicate with AWS services from the connected Kubernetes
-- cluster.
newConnectorConfigResponse ::
  ConnectorConfigResponse
newConnectorConfigResponse :: ConnectorConfigResponse
newConnectorConfigResponse =
  ConnectorConfigResponse' :: Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> ConnectorConfigResponse
ConnectorConfigResponse'
    { $sel:activationCode:ConnectorConfigResponse' :: Maybe Text
activationCode =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:activationId:ConnectorConfigResponse' :: Maybe Text
activationId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:activationExpiry:ConnectorConfigResponse' :: Maybe POSIX
activationExpiry = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:provider:ConnectorConfigResponse' :: Maybe Text
provider = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:roleArn:ConnectorConfigResponse' :: Maybe Text
roleArn = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | A unique code associated with the cluster for registration purposes.
connectorConfigResponse_activationCode :: Lens.Lens' ConnectorConfigResponse (Prelude.Maybe Prelude.Text)
connectorConfigResponse_activationCode :: (Maybe Text -> f (Maybe Text))
-> ConnectorConfigResponse -> f ConnectorConfigResponse
connectorConfigResponse_activationCode = (ConnectorConfigResponse -> Maybe Text)
-> (ConnectorConfigResponse
    -> Maybe Text -> ConnectorConfigResponse)
-> Lens
     ConnectorConfigResponse
     ConnectorConfigResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConnectorConfigResponse' {Maybe Text
activationCode :: Maybe Text
$sel:activationCode:ConnectorConfigResponse' :: ConnectorConfigResponse -> Maybe Text
activationCode} -> Maybe Text
activationCode) (\s :: ConnectorConfigResponse
s@ConnectorConfigResponse' {} Maybe Text
a -> ConnectorConfigResponse
s {$sel:activationCode:ConnectorConfigResponse' :: Maybe Text
activationCode = Maybe Text
a} :: ConnectorConfigResponse)

-- | A unique ID associated with the cluster for registration purposes.
connectorConfigResponse_activationId :: Lens.Lens' ConnectorConfigResponse (Prelude.Maybe Prelude.Text)
connectorConfigResponse_activationId :: (Maybe Text -> f (Maybe Text))
-> ConnectorConfigResponse -> f ConnectorConfigResponse
connectorConfigResponse_activationId = (ConnectorConfigResponse -> Maybe Text)
-> (ConnectorConfigResponse
    -> Maybe Text -> ConnectorConfigResponse)
-> Lens
     ConnectorConfigResponse
     ConnectorConfigResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConnectorConfigResponse' {Maybe Text
activationId :: Maybe Text
$sel:activationId:ConnectorConfigResponse' :: ConnectorConfigResponse -> Maybe Text
activationId} -> Maybe Text
activationId) (\s :: ConnectorConfigResponse
s@ConnectorConfigResponse' {} Maybe Text
a -> ConnectorConfigResponse
s {$sel:activationId:ConnectorConfigResponse' :: Maybe Text
activationId = Maybe Text
a} :: ConnectorConfigResponse)

-- | The expiration time of the connected cluster. The cluster\'s YAML file
-- must be applied through the native provider.
connectorConfigResponse_activationExpiry :: Lens.Lens' ConnectorConfigResponse (Prelude.Maybe Prelude.UTCTime)
connectorConfigResponse_activationExpiry :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ConnectorConfigResponse -> f ConnectorConfigResponse
connectorConfigResponse_activationExpiry = (ConnectorConfigResponse -> Maybe POSIX)
-> (ConnectorConfigResponse
    -> Maybe POSIX -> ConnectorConfigResponse)
-> Lens
     ConnectorConfigResponse
     ConnectorConfigResponse
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConnectorConfigResponse' {Maybe POSIX
activationExpiry :: Maybe POSIX
$sel:activationExpiry:ConnectorConfigResponse' :: ConnectorConfigResponse -> Maybe POSIX
activationExpiry} -> Maybe POSIX
activationExpiry) (\s :: ConnectorConfigResponse
s@ConnectorConfigResponse' {} Maybe POSIX
a -> ConnectorConfigResponse
s {$sel:activationExpiry:ConnectorConfigResponse' :: Maybe POSIX
activationExpiry = Maybe POSIX
a} :: ConnectorConfigResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> ConnectorConfigResponse -> f ConnectorConfigResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ConnectorConfigResponse
-> f ConnectorConfigResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The cluster\'s cloud service provider.
connectorConfigResponse_provider :: Lens.Lens' ConnectorConfigResponse (Prelude.Maybe Prelude.Text)
connectorConfigResponse_provider :: (Maybe Text -> f (Maybe Text))
-> ConnectorConfigResponse -> f ConnectorConfigResponse
connectorConfigResponse_provider = (ConnectorConfigResponse -> Maybe Text)
-> (ConnectorConfigResponse
    -> Maybe Text -> ConnectorConfigResponse)
-> Lens
     ConnectorConfigResponse
     ConnectorConfigResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConnectorConfigResponse' {Maybe Text
provider :: Maybe Text
$sel:provider:ConnectorConfigResponse' :: ConnectorConfigResponse -> Maybe Text
provider} -> Maybe Text
provider) (\s :: ConnectorConfigResponse
s@ConnectorConfigResponse' {} Maybe Text
a -> ConnectorConfigResponse
s {$sel:provider:ConnectorConfigResponse' :: Maybe Text
provider = Maybe Text
a} :: ConnectorConfigResponse)

-- | The Amazon Resource Name (ARN) of the role that is used by the EKS
-- connector to communicate with AWS services from the connected Kubernetes
-- cluster.
connectorConfigResponse_roleArn :: Lens.Lens' ConnectorConfigResponse (Prelude.Maybe Prelude.Text)
connectorConfigResponse_roleArn :: (Maybe Text -> f (Maybe Text))
-> ConnectorConfigResponse -> f ConnectorConfigResponse
connectorConfigResponse_roleArn = (ConnectorConfigResponse -> Maybe Text)
-> (ConnectorConfigResponse
    -> Maybe Text -> ConnectorConfigResponse)
-> Lens
     ConnectorConfigResponse
     ConnectorConfigResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConnectorConfigResponse' {Maybe Text
roleArn :: Maybe Text
$sel:roleArn:ConnectorConfigResponse' :: ConnectorConfigResponse -> Maybe Text
roleArn} -> Maybe Text
roleArn) (\s :: ConnectorConfigResponse
s@ConnectorConfigResponse' {} Maybe Text
a -> ConnectorConfigResponse
s {$sel:roleArn:ConnectorConfigResponse' :: Maybe Text
roleArn = Maybe Text
a} :: ConnectorConfigResponse)

instance Core.FromJSON ConnectorConfigResponse where
  parseJSON :: Value -> Parser ConnectorConfigResponse
parseJSON =
    String
-> (Object -> Parser ConnectorConfigResponse)
-> Value
-> Parser ConnectorConfigResponse
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ConnectorConfigResponse"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> ConnectorConfigResponse
ConnectorConfigResponse'
            (Maybe Text
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe Text
 -> ConnectorConfigResponse)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> ConnectorConfigResponse)
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
"activationCode")
            Parser
  (Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> ConnectorConfigResponse)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX
      -> Maybe Text -> Maybe Text -> ConnectorConfigResponse)
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
"activationId")
            Parser
  (Maybe POSIX
   -> Maybe Text -> Maybe Text -> ConnectorConfigResponse)
-> Parser (Maybe POSIX)
-> Parser (Maybe Text -> Maybe Text -> ConnectorConfigResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"activationExpiry")
            Parser (Maybe Text -> Maybe Text -> ConnectorConfigResponse)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> ConnectorConfigResponse)
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
"provider")
            Parser (Maybe Text -> ConnectorConfigResponse)
-> Parser (Maybe Text) -> Parser ConnectorConfigResponse
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
"roleArn")
      )

instance Prelude.Hashable ConnectorConfigResponse

instance Prelude.NFData ConnectorConfigResponse