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

import qualified Amazonka.Core as Core
import Amazonka.EKS.Types.ConnectorConfigProvider
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | The configuration sent to a cluster for configuration.
--
-- /See:/ 'newConnectorConfigRequest' smart constructor.
data ConnectorConfigRequest = ConnectorConfigRequest'
  { -- | The Amazon Resource Name (ARN) of the role that is authorized to request
    -- the connector configuration.
    ConnectorConfigRequest -> Text
roleArn :: Prelude.Text,
    -- | The cloud provider for the target cluster to connect.
    ConnectorConfigRequest -> ConnectorConfigProvider
provider :: ConnectorConfigProvider
  }
  deriving (ConnectorConfigRequest -> ConnectorConfigRequest -> Bool
(ConnectorConfigRequest -> ConnectorConfigRequest -> Bool)
-> (ConnectorConfigRequest -> ConnectorConfigRequest -> Bool)
-> Eq ConnectorConfigRequest
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ConnectorConfigRequest -> ConnectorConfigRequest -> Bool
$c/= :: ConnectorConfigRequest -> ConnectorConfigRequest -> Bool
== :: ConnectorConfigRequest -> ConnectorConfigRequest -> Bool
$c== :: ConnectorConfigRequest -> ConnectorConfigRequest -> Bool
Prelude.Eq, ReadPrec [ConnectorConfigRequest]
ReadPrec ConnectorConfigRequest
Int -> ReadS ConnectorConfigRequest
ReadS [ConnectorConfigRequest]
(Int -> ReadS ConnectorConfigRequest)
-> ReadS [ConnectorConfigRequest]
-> ReadPrec ConnectorConfigRequest
-> ReadPrec [ConnectorConfigRequest]
-> Read ConnectorConfigRequest
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ConnectorConfigRequest]
$creadListPrec :: ReadPrec [ConnectorConfigRequest]
readPrec :: ReadPrec ConnectorConfigRequest
$creadPrec :: ReadPrec ConnectorConfigRequest
readList :: ReadS [ConnectorConfigRequest]
$creadList :: ReadS [ConnectorConfigRequest]
readsPrec :: Int -> ReadS ConnectorConfigRequest
$creadsPrec :: Int -> ReadS ConnectorConfigRequest
Prelude.Read, Int -> ConnectorConfigRequest -> ShowS
[ConnectorConfigRequest] -> ShowS
ConnectorConfigRequest -> String
(Int -> ConnectorConfigRequest -> ShowS)
-> (ConnectorConfigRequest -> String)
-> ([ConnectorConfigRequest] -> ShowS)
-> Show ConnectorConfigRequest
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ConnectorConfigRequest] -> ShowS
$cshowList :: [ConnectorConfigRequest] -> ShowS
show :: ConnectorConfigRequest -> String
$cshow :: ConnectorConfigRequest -> String
showsPrec :: Int -> ConnectorConfigRequest -> ShowS
$cshowsPrec :: Int -> ConnectorConfigRequest -> ShowS
Prelude.Show, (forall x. ConnectorConfigRequest -> Rep ConnectorConfigRequest x)
-> (forall x.
    Rep ConnectorConfigRequest x -> ConnectorConfigRequest)
-> Generic ConnectorConfigRequest
forall x. Rep ConnectorConfigRequest x -> ConnectorConfigRequest
forall x. ConnectorConfigRequest -> Rep ConnectorConfigRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ConnectorConfigRequest x -> ConnectorConfigRequest
$cfrom :: forall x. ConnectorConfigRequest -> Rep ConnectorConfigRequest x
Prelude.Generic)

-- |
-- Create a value of 'ConnectorConfigRequest' 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:
--
-- 'roleArn', 'connectorConfigRequest_roleArn' - The Amazon Resource Name (ARN) of the role that is authorized to request
-- the connector configuration.
--
-- 'provider', 'connectorConfigRequest_provider' - The cloud provider for the target cluster to connect.
newConnectorConfigRequest ::
  -- | 'roleArn'
  Prelude.Text ->
  -- | 'provider'
  ConnectorConfigProvider ->
  ConnectorConfigRequest
newConnectorConfigRequest :: Text -> ConnectorConfigProvider -> ConnectorConfigRequest
newConnectorConfigRequest Text
pRoleArn_ ConnectorConfigProvider
pProvider_ =
  ConnectorConfigRequest' :: Text -> ConnectorConfigProvider -> ConnectorConfigRequest
ConnectorConfigRequest'
    { $sel:roleArn:ConnectorConfigRequest' :: Text
roleArn = Text
pRoleArn_,
      $sel:provider:ConnectorConfigRequest' :: ConnectorConfigProvider
provider = ConnectorConfigProvider
pProvider_
    }

-- | The Amazon Resource Name (ARN) of the role that is authorized to request
-- the connector configuration.
connectorConfigRequest_roleArn :: Lens.Lens' ConnectorConfigRequest Prelude.Text
connectorConfigRequest_roleArn :: (Text -> f Text)
-> ConnectorConfigRequest -> f ConnectorConfigRequest
connectorConfigRequest_roleArn = (ConnectorConfigRequest -> Text)
-> (ConnectorConfigRequest -> Text -> ConnectorConfigRequest)
-> Lens ConnectorConfigRequest ConnectorConfigRequest Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConnectorConfigRequest' {Text
roleArn :: Text
$sel:roleArn:ConnectorConfigRequest' :: ConnectorConfigRequest -> Text
roleArn} -> Text
roleArn) (\s :: ConnectorConfigRequest
s@ConnectorConfigRequest' {} Text
a -> ConnectorConfigRequest
s {$sel:roleArn:ConnectorConfigRequest' :: Text
roleArn = Text
a} :: ConnectorConfigRequest)

-- | The cloud provider for the target cluster to connect.
connectorConfigRequest_provider :: Lens.Lens' ConnectorConfigRequest ConnectorConfigProvider
connectorConfigRequest_provider :: (ConnectorConfigProvider -> f ConnectorConfigProvider)
-> ConnectorConfigRequest -> f ConnectorConfigRequest
connectorConfigRequest_provider = (ConnectorConfigRequest -> ConnectorConfigProvider)
-> (ConnectorConfigRequest
    -> ConnectorConfigProvider -> ConnectorConfigRequest)
-> Lens
     ConnectorConfigRequest
     ConnectorConfigRequest
     ConnectorConfigProvider
     ConnectorConfigProvider
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConnectorConfigRequest' {ConnectorConfigProvider
provider :: ConnectorConfigProvider
$sel:provider:ConnectorConfigRequest' :: ConnectorConfigRequest -> ConnectorConfigProvider
provider} -> ConnectorConfigProvider
provider) (\s :: ConnectorConfigRequest
s@ConnectorConfigRequest' {} ConnectorConfigProvider
a -> ConnectorConfigRequest
s {$sel:provider:ConnectorConfigRequest' :: ConnectorConfigProvider
provider = ConnectorConfigProvider
a} :: ConnectorConfigRequest)

instance Prelude.Hashable ConnectorConfigRequest

instance Prelude.NFData ConnectorConfigRequest

instance Core.ToJSON ConnectorConfigRequest where
  toJSON :: ConnectorConfigRequest -> Value
toJSON ConnectorConfigRequest' {Text
ConnectorConfigProvider
provider :: ConnectorConfigProvider
roleArn :: Text
$sel:provider:ConnectorConfigRequest' :: ConnectorConfigRequest -> ConnectorConfigProvider
$sel:roleArn:ConnectorConfigRequest' :: ConnectorConfigRequest -> Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"roleArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
roleArn),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"provider" Text -> ConnectorConfigProvider -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ConnectorConfigProvider
provider)
          ]
      )