{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.EKS.Types.ConnectorConfigResponse 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 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,
    -- | 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 Data.POSIX,
    -- | A unique ID associated with the cluster for registration purposes.
    ConnectorConfigResponse -> Maybe Text
activationId :: Prelude.Maybe Prelude.Text,
    -- | The cluster\'s cloud service provider.
    ConnectorConfigResponse -> Maybe Text
provider :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the role to communicate with services
    -- from the connected Kubernetes cluster.
    ConnectorConfigResponse -> Maybe Text
roleArn :: Prelude.Maybe Prelude.Text
  }
  deriving (ConnectorConfigResponse -> ConnectorConfigResponse -> Bool
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]
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
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. 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.
--
-- 'activationExpiry', 'connectorConfigResponse_activationExpiry' - The expiration time of the connected cluster. The cluster\'s YAML file
-- must be applied through the native provider.
--
-- 'activationId', 'connectorConfigResponse_activationId' - A unique ID associated with the cluster for registration purposes.
--
-- 'provider', 'connectorConfigResponse_provider' - The cluster\'s cloud service provider.
--
-- 'roleArn', 'connectorConfigResponse_roleArn' - The Amazon Resource Name (ARN) of the role to communicate with services
-- from the connected Kubernetes cluster.
newConnectorConfigResponse ::
  ConnectorConfigResponse
newConnectorConfigResponse :: ConnectorConfigResponse
newConnectorConfigResponse =
  ConnectorConfigResponse'
    { $sel:activationCode:ConnectorConfigResponse' :: Maybe Text
activationCode =
        forall a. Maybe a
Prelude.Nothing,
      $sel:activationExpiry:ConnectorConfigResponse' :: Maybe POSIX
activationExpiry = forall a. Maybe a
Prelude.Nothing,
      $sel:activationId:ConnectorConfigResponse' :: Maybe Text
activationId = forall a. Maybe a
Prelude.Nothing,
      $sel:provider:ConnectorConfigResponse' :: Maybe Text
provider = forall a. Maybe a
Prelude.Nothing,
      $sel:roleArn:ConnectorConfigResponse' :: Maybe Text
roleArn = 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 :: Lens' ConnectorConfigResponse (Maybe Text)
connectorConfigResponse_activationCode = 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)

-- | 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 :: Lens' ConnectorConfigResponse (Maybe UTCTime)
connectorConfigResponse_activationExpiry = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | A unique ID associated with the cluster for registration purposes.
connectorConfigResponse_activationId :: Lens.Lens' ConnectorConfigResponse (Prelude.Maybe Prelude.Text)
connectorConfigResponse_activationId :: Lens' ConnectorConfigResponse (Maybe Text)
connectorConfigResponse_activationId = 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 cluster\'s cloud service provider.
connectorConfigResponse_provider :: Lens.Lens' ConnectorConfigResponse (Prelude.Maybe Prelude.Text)
connectorConfigResponse_provider :: Lens' ConnectorConfigResponse (Maybe Text)
connectorConfigResponse_provider = 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 to communicate with services
-- from the connected Kubernetes cluster.
connectorConfigResponse_roleArn :: Lens.Lens' ConnectorConfigResponse (Prelude.Maybe Prelude.Text)
connectorConfigResponse_roleArn :: Lens' ConnectorConfigResponse (Maybe Text)
connectorConfigResponse_roleArn = 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 Data.FromJSON ConnectorConfigResponse where
  parseJSON :: Value -> Parser ConnectorConfigResponse
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ConnectorConfigResponse"
      ( \Object
x ->
          Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> ConnectorConfigResponse
ConnectorConfigResponse'
            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
"activationCode")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"activationExpiry")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"activationId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"provider")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"roleArn")
      )

instance Prelude.Hashable ConnectorConfigResponse where
  hashWithSalt :: Int -> ConnectorConfigResponse -> Int
hashWithSalt Int
_salt ConnectorConfigResponse' {Maybe Text
Maybe POSIX
roleArn :: Maybe Text
provider :: Maybe Text
activationId :: Maybe Text
activationExpiry :: Maybe POSIX
activationCode :: Maybe Text
$sel:roleArn:ConnectorConfigResponse' :: ConnectorConfigResponse -> Maybe Text
$sel:provider:ConnectorConfigResponse' :: ConnectorConfigResponse -> Maybe Text
$sel:activationId:ConnectorConfigResponse' :: ConnectorConfigResponse -> Maybe Text
$sel:activationExpiry:ConnectorConfigResponse' :: ConnectorConfigResponse -> Maybe POSIX
$sel:activationCode:ConnectorConfigResponse' :: ConnectorConfigResponse -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
activationCode
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
activationExpiry
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
activationId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
provider
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
roleArn

instance Prelude.NFData ConnectorConfigResponse where
  rnf :: ConnectorConfigResponse -> ()
rnf ConnectorConfigResponse' {Maybe Text
Maybe POSIX
roleArn :: Maybe Text
provider :: Maybe Text
activationId :: Maybe Text
activationExpiry :: Maybe POSIX
activationCode :: Maybe Text
$sel:roleArn:ConnectorConfigResponse' :: ConnectorConfigResponse -> Maybe Text
$sel:provider:ConnectorConfigResponse' :: ConnectorConfigResponse -> Maybe Text
$sel:activationId:ConnectorConfigResponse' :: ConnectorConfigResponse -> Maybe Text
$sel:activationExpiry:ConnectorConfigResponse' :: ConnectorConfigResponse -> Maybe POSIX
$sel:activationCode:ConnectorConfigResponse' :: ConnectorConfigResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
activationCode
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
activationExpiry
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
activationId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
provider
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
roleArn