{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# 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.AssociateIdentityProviderConfig
-- 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)
--
-- Associate an identity provider configuration to a cluster.
--
-- If you want to authenticate identities using an identity provider, you
-- can create an identity provider configuration and associate it to your
-- cluster. After configuring authentication to your cluster you can create
-- Kubernetes @roles@ and @clusterroles@ to assign permissions to the
-- roles, and then bind the roles to the identities using Kubernetes
-- @rolebindings@ and @clusterrolebindings@. For more information see
-- <https://kubernetes.io/docs/reference/access-authn-authz/rbac/ Using RBAC Authorization>
-- in the Kubernetes documentation.
module Amazonka.EKS.AssociateIdentityProviderConfig
  ( -- * Creating a Request
    AssociateIdentityProviderConfig (..),
    newAssociateIdentityProviderConfig,

    -- * Request Lenses
    associateIdentityProviderConfig_clientRequestToken,
    associateIdentityProviderConfig_tags,
    associateIdentityProviderConfig_clusterName,
    associateIdentityProviderConfig_oidc,

    -- * Destructuring the Response
    AssociateIdentityProviderConfigResponse (..),
    newAssociateIdentityProviderConfigResponse,

    -- * Response Lenses
    associateIdentityProviderConfigResponse_update,
    associateIdentityProviderConfigResponse_tags,
    associateIdentityProviderConfigResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.EKS.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newAssociateIdentityProviderConfig' smart constructor.
data AssociateIdentityProviderConfig = AssociateIdentityProviderConfig'
  { -- | Unique, case-sensitive identifier that you provide to ensure the
    -- idempotency of the request.
    AssociateIdentityProviderConfig -> Maybe Text
clientRequestToken :: Prelude.Maybe Prelude.Text,
    -- | The metadata to apply to the configuration to assist with categorization
    -- and organization. Each tag consists of a key and an optional value, both
    -- of which you define.
    AssociateIdentityProviderConfig -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The name of the cluster to associate the configuration to.
    AssociateIdentityProviderConfig -> Text
clusterName :: Prelude.Text,
    -- | An object that represents an OpenID Connect (OIDC) identity provider
    -- configuration.
    AssociateIdentityProviderConfig
-> OidcIdentityProviderConfigRequest
oidc :: OidcIdentityProviderConfigRequest
  }
  deriving (AssociateIdentityProviderConfig
-> AssociateIdentityProviderConfig -> Bool
(AssociateIdentityProviderConfig
 -> AssociateIdentityProviderConfig -> Bool)
-> (AssociateIdentityProviderConfig
    -> AssociateIdentityProviderConfig -> Bool)
-> Eq AssociateIdentityProviderConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AssociateIdentityProviderConfig
-> AssociateIdentityProviderConfig -> Bool
$c/= :: AssociateIdentityProviderConfig
-> AssociateIdentityProviderConfig -> Bool
== :: AssociateIdentityProviderConfig
-> AssociateIdentityProviderConfig -> Bool
$c== :: AssociateIdentityProviderConfig
-> AssociateIdentityProviderConfig -> Bool
Prelude.Eq, ReadPrec [AssociateIdentityProviderConfig]
ReadPrec AssociateIdentityProviderConfig
Int -> ReadS AssociateIdentityProviderConfig
ReadS [AssociateIdentityProviderConfig]
(Int -> ReadS AssociateIdentityProviderConfig)
-> ReadS [AssociateIdentityProviderConfig]
-> ReadPrec AssociateIdentityProviderConfig
-> ReadPrec [AssociateIdentityProviderConfig]
-> Read AssociateIdentityProviderConfig
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AssociateIdentityProviderConfig]
$creadListPrec :: ReadPrec [AssociateIdentityProviderConfig]
readPrec :: ReadPrec AssociateIdentityProviderConfig
$creadPrec :: ReadPrec AssociateIdentityProviderConfig
readList :: ReadS [AssociateIdentityProviderConfig]
$creadList :: ReadS [AssociateIdentityProviderConfig]
readsPrec :: Int -> ReadS AssociateIdentityProviderConfig
$creadsPrec :: Int -> ReadS AssociateIdentityProviderConfig
Prelude.Read, Int -> AssociateIdentityProviderConfig -> ShowS
[AssociateIdentityProviderConfig] -> ShowS
AssociateIdentityProviderConfig -> String
(Int -> AssociateIdentityProviderConfig -> ShowS)
-> (AssociateIdentityProviderConfig -> String)
-> ([AssociateIdentityProviderConfig] -> ShowS)
-> Show AssociateIdentityProviderConfig
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AssociateIdentityProviderConfig] -> ShowS
$cshowList :: [AssociateIdentityProviderConfig] -> ShowS
show :: AssociateIdentityProviderConfig -> String
$cshow :: AssociateIdentityProviderConfig -> String
showsPrec :: Int -> AssociateIdentityProviderConfig -> ShowS
$cshowsPrec :: Int -> AssociateIdentityProviderConfig -> ShowS
Prelude.Show, (forall x.
 AssociateIdentityProviderConfig
 -> Rep AssociateIdentityProviderConfig x)
-> (forall x.
    Rep AssociateIdentityProviderConfig x
    -> AssociateIdentityProviderConfig)
-> Generic AssociateIdentityProviderConfig
forall x.
Rep AssociateIdentityProviderConfig x
-> AssociateIdentityProviderConfig
forall x.
AssociateIdentityProviderConfig
-> Rep AssociateIdentityProviderConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AssociateIdentityProviderConfig x
-> AssociateIdentityProviderConfig
$cfrom :: forall x.
AssociateIdentityProviderConfig
-> Rep AssociateIdentityProviderConfig x
Prelude.Generic)

-- |
-- Create a value of 'AssociateIdentityProviderConfig' 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:
--
-- 'clientRequestToken', 'associateIdentityProviderConfig_clientRequestToken' - Unique, case-sensitive identifier that you provide to ensure the
-- idempotency of the request.
--
-- 'tags', 'associateIdentityProviderConfig_tags' - The metadata to apply to the configuration to assist with categorization
-- and organization. Each tag consists of a key and an optional value, both
-- of which you define.
--
-- 'clusterName', 'associateIdentityProviderConfig_clusterName' - The name of the cluster to associate the configuration to.
--
-- 'oidc', 'associateIdentityProviderConfig_oidc' - An object that represents an OpenID Connect (OIDC) identity provider
-- configuration.
newAssociateIdentityProviderConfig ::
  -- | 'clusterName'
  Prelude.Text ->
  -- | 'oidc'
  OidcIdentityProviderConfigRequest ->
  AssociateIdentityProviderConfig
newAssociateIdentityProviderConfig :: Text
-> OidcIdentityProviderConfigRequest
-> AssociateIdentityProviderConfig
newAssociateIdentityProviderConfig
  Text
pClusterName_
  OidcIdentityProviderConfigRequest
pOidc_ =
    AssociateIdentityProviderConfig' :: Maybe Text
-> Maybe (HashMap Text Text)
-> Text
-> OidcIdentityProviderConfigRequest
-> AssociateIdentityProviderConfig
AssociateIdentityProviderConfig'
      { $sel:clientRequestToken:AssociateIdentityProviderConfig' :: Maybe Text
clientRequestToken =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:tags:AssociateIdentityProviderConfig' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:clusterName:AssociateIdentityProviderConfig' :: Text
clusterName = Text
pClusterName_,
        $sel:oidc:AssociateIdentityProviderConfig' :: OidcIdentityProviderConfigRequest
oidc = OidcIdentityProviderConfigRequest
pOidc_
      }

-- | Unique, case-sensitive identifier that you provide to ensure the
-- idempotency of the request.
associateIdentityProviderConfig_clientRequestToken :: Lens.Lens' AssociateIdentityProviderConfig (Prelude.Maybe Prelude.Text)
associateIdentityProviderConfig_clientRequestToken :: (Maybe Text -> f (Maybe Text))
-> AssociateIdentityProviderConfig
-> f AssociateIdentityProviderConfig
associateIdentityProviderConfig_clientRequestToken = (AssociateIdentityProviderConfig -> Maybe Text)
-> (AssociateIdentityProviderConfig
    -> Maybe Text -> AssociateIdentityProviderConfig)
-> Lens
     AssociateIdentityProviderConfig
     AssociateIdentityProviderConfig
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateIdentityProviderConfig' {Maybe Text
clientRequestToken :: Maybe Text
$sel:clientRequestToken:AssociateIdentityProviderConfig' :: AssociateIdentityProviderConfig -> Maybe Text
clientRequestToken} -> Maybe Text
clientRequestToken) (\s :: AssociateIdentityProviderConfig
s@AssociateIdentityProviderConfig' {} Maybe Text
a -> AssociateIdentityProviderConfig
s {$sel:clientRequestToken:AssociateIdentityProviderConfig' :: Maybe Text
clientRequestToken = Maybe Text
a} :: AssociateIdentityProviderConfig)

-- | The metadata to apply to the configuration to assist with categorization
-- and organization. Each tag consists of a key and an optional value, both
-- of which you define.
associateIdentityProviderConfig_tags :: Lens.Lens' AssociateIdentityProviderConfig (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
associateIdentityProviderConfig_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> AssociateIdentityProviderConfig
-> f AssociateIdentityProviderConfig
associateIdentityProviderConfig_tags = (AssociateIdentityProviderConfig -> Maybe (HashMap Text Text))
-> (AssociateIdentityProviderConfig
    -> Maybe (HashMap Text Text) -> AssociateIdentityProviderConfig)
-> Lens
     AssociateIdentityProviderConfig
     AssociateIdentityProviderConfig
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateIdentityProviderConfig' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:AssociateIdentityProviderConfig' :: AssociateIdentityProviderConfig -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: AssociateIdentityProviderConfig
s@AssociateIdentityProviderConfig' {} Maybe (HashMap Text Text)
a -> AssociateIdentityProviderConfig
s {$sel:tags:AssociateIdentityProviderConfig' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: AssociateIdentityProviderConfig) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> AssociateIdentityProviderConfig
 -> f AssociateIdentityProviderConfig)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> AssociateIdentityProviderConfig
-> f AssociateIdentityProviderConfig
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
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
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The name of the cluster to associate the configuration to.
associateIdentityProviderConfig_clusterName :: Lens.Lens' AssociateIdentityProviderConfig Prelude.Text
associateIdentityProviderConfig_clusterName :: (Text -> f Text)
-> AssociateIdentityProviderConfig
-> f AssociateIdentityProviderConfig
associateIdentityProviderConfig_clusterName = (AssociateIdentityProviderConfig -> Text)
-> (AssociateIdentityProviderConfig
    -> Text -> AssociateIdentityProviderConfig)
-> Lens
     AssociateIdentityProviderConfig
     AssociateIdentityProviderConfig
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateIdentityProviderConfig' {Text
clusterName :: Text
$sel:clusterName:AssociateIdentityProviderConfig' :: AssociateIdentityProviderConfig -> Text
clusterName} -> Text
clusterName) (\s :: AssociateIdentityProviderConfig
s@AssociateIdentityProviderConfig' {} Text
a -> AssociateIdentityProviderConfig
s {$sel:clusterName:AssociateIdentityProviderConfig' :: Text
clusterName = Text
a} :: AssociateIdentityProviderConfig)

-- | An object that represents an OpenID Connect (OIDC) identity provider
-- configuration.
associateIdentityProviderConfig_oidc :: Lens.Lens' AssociateIdentityProviderConfig OidcIdentityProviderConfigRequest
associateIdentityProviderConfig_oidc :: (OidcIdentityProviderConfigRequest
 -> f OidcIdentityProviderConfigRequest)
-> AssociateIdentityProviderConfig
-> f AssociateIdentityProviderConfig
associateIdentityProviderConfig_oidc = (AssociateIdentityProviderConfig
 -> OidcIdentityProviderConfigRequest)
-> (AssociateIdentityProviderConfig
    -> OidcIdentityProviderConfigRequest
    -> AssociateIdentityProviderConfig)
-> Lens
     AssociateIdentityProviderConfig
     AssociateIdentityProviderConfig
     OidcIdentityProviderConfigRequest
     OidcIdentityProviderConfigRequest
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateIdentityProviderConfig' {OidcIdentityProviderConfigRequest
oidc :: OidcIdentityProviderConfigRequest
$sel:oidc:AssociateIdentityProviderConfig' :: AssociateIdentityProviderConfig
-> OidcIdentityProviderConfigRequest
oidc} -> OidcIdentityProviderConfigRequest
oidc) (\s :: AssociateIdentityProviderConfig
s@AssociateIdentityProviderConfig' {} OidcIdentityProviderConfigRequest
a -> AssociateIdentityProviderConfig
s {$sel:oidc:AssociateIdentityProviderConfig' :: OidcIdentityProviderConfigRequest
oidc = OidcIdentityProviderConfigRequest
a} :: AssociateIdentityProviderConfig)

instance
  Core.AWSRequest
    AssociateIdentityProviderConfig
  where
  type
    AWSResponse AssociateIdentityProviderConfig =
      AssociateIdentityProviderConfigResponse
  request :: AssociateIdentityProviderConfig
-> Request AssociateIdentityProviderConfig
request = Service
-> AssociateIdentityProviderConfig
-> Request AssociateIdentityProviderConfig
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy AssociateIdentityProviderConfig
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse AssociateIdentityProviderConfig)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse AssociateIdentityProviderConfig))
-> Logger
-> Service
-> Proxy AssociateIdentityProviderConfig
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse AssociateIdentityProviderConfig)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Update
-> Maybe (HashMap Text Text)
-> Int
-> AssociateIdentityProviderConfigResponse
AssociateIdentityProviderConfigResponse'
            (Maybe Update
 -> Maybe (HashMap Text Text)
 -> Int
 -> AssociateIdentityProviderConfigResponse)
-> Either String (Maybe Update)
-> Either
     String
     (Maybe (HashMap Text Text)
      -> Int -> AssociateIdentityProviderConfigResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Update)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"update")
            Either
  String
  (Maybe (HashMap Text Text)
   -> Int -> AssociateIdentityProviderConfigResponse)
-> Either String (Maybe (HashMap Text Text))
-> Either String (Int -> AssociateIdentityProviderConfigResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"tags" Either String (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text)
-> Either String (Maybe (HashMap Text Text))
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
            Either String (Int -> AssociateIdentityProviderConfigResponse)
-> Either String Int
-> Either String AssociateIdentityProviderConfigResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance
  Prelude.Hashable
    AssociateIdentityProviderConfig

instance
  Prelude.NFData
    AssociateIdentityProviderConfig

instance
  Core.ToHeaders
    AssociateIdentityProviderConfig
  where
  toHeaders :: AssociateIdentityProviderConfig -> ResponseHeaders
toHeaders =
    ResponseHeaders
-> AssociateIdentityProviderConfig -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON AssociateIdentityProviderConfig where
  toJSON :: AssociateIdentityProviderConfig -> Value
toJSON AssociateIdentityProviderConfig' {Maybe Text
Maybe (HashMap Text Text)
Text
OidcIdentityProviderConfigRequest
oidc :: OidcIdentityProviderConfigRequest
clusterName :: Text
tags :: Maybe (HashMap Text Text)
clientRequestToken :: Maybe Text
$sel:oidc:AssociateIdentityProviderConfig' :: AssociateIdentityProviderConfig
-> OidcIdentityProviderConfigRequest
$sel:clusterName:AssociateIdentityProviderConfig' :: AssociateIdentityProviderConfig -> Text
$sel:tags:AssociateIdentityProviderConfig' :: AssociateIdentityProviderConfig -> Maybe (HashMap Text Text)
$sel:clientRequestToken:AssociateIdentityProviderConfig' :: AssociateIdentityProviderConfig -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"clientRequestToken" 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
clientRequestToken,
            (Text
"tags" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
tags,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"oidc" Text -> OidcIdentityProviderConfigRequest -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= OidcIdentityProviderConfigRequest
oidc)
          ]
      )

instance Core.ToPath AssociateIdentityProviderConfig where
  toPath :: AssociateIdentityProviderConfig -> ByteString
toPath AssociateIdentityProviderConfig' {Maybe Text
Maybe (HashMap Text Text)
Text
OidcIdentityProviderConfigRequest
oidc :: OidcIdentityProviderConfigRequest
clusterName :: Text
tags :: Maybe (HashMap Text Text)
clientRequestToken :: Maybe Text
$sel:oidc:AssociateIdentityProviderConfig' :: AssociateIdentityProviderConfig
-> OidcIdentityProviderConfigRequest
$sel:clusterName:AssociateIdentityProviderConfig' :: AssociateIdentityProviderConfig -> Text
$sel:tags:AssociateIdentityProviderConfig' :: AssociateIdentityProviderConfig -> Maybe (HashMap Text Text)
$sel:clientRequestToken:AssociateIdentityProviderConfig' :: AssociateIdentityProviderConfig -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/clusters/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
clusterName,
        ByteString
"/identity-provider-configs/associate"
      ]

instance Core.ToQuery AssociateIdentityProviderConfig where
  toQuery :: AssociateIdentityProviderConfig -> QueryString
toQuery = QueryString -> AssociateIdentityProviderConfig -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newAssociateIdentityProviderConfigResponse' smart constructor.
data AssociateIdentityProviderConfigResponse = AssociateIdentityProviderConfigResponse'
  { AssociateIdentityProviderConfigResponse -> Maybe Update
update :: Prelude.Maybe Update,
    -- | The tags for the resource.
    AssociateIdentityProviderConfigResponse
-> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The response's http status code.
    AssociateIdentityProviderConfigResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (AssociateIdentityProviderConfigResponse
-> AssociateIdentityProviderConfigResponse -> Bool
(AssociateIdentityProviderConfigResponse
 -> AssociateIdentityProviderConfigResponse -> Bool)
-> (AssociateIdentityProviderConfigResponse
    -> AssociateIdentityProviderConfigResponse -> Bool)
-> Eq AssociateIdentityProviderConfigResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AssociateIdentityProviderConfigResponse
-> AssociateIdentityProviderConfigResponse -> Bool
$c/= :: AssociateIdentityProviderConfigResponse
-> AssociateIdentityProviderConfigResponse -> Bool
== :: AssociateIdentityProviderConfigResponse
-> AssociateIdentityProviderConfigResponse -> Bool
$c== :: AssociateIdentityProviderConfigResponse
-> AssociateIdentityProviderConfigResponse -> Bool
Prelude.Eq, ReadPrec [AssociateIdentityProviderConfigResponse]
ReadPrec AssociateIdentityProviderConfigResponse
Int -> ReadS AssociateIdentityProviderConfigResponse
ReadS [AssociateIdentityProviderConfigResponse]
(Int -> ReadS AssociateIdentityProviderConfigResponse)
-> ReadS [AssociateIdentityProviderConfigResponse]
-> ReadPrec AssociateIdentityProviderConfigResponse
-> ReadPrec [AssociateIdentityProviderConfigResponse]
-> Read AssociateIdentityProviderConfigResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AssociateIdentityProviderConfigResponse]
$creadListPrec :: ReadPrec [AssociateIdentityProviderConfigResponse]
readPrec :: ReadPrec AssociateIdentityProviderConfigResponse
$creadPrec :: ReadPrec AssociateIdentityProviderConfigResponse
readList :: ReadS [AssociateIdentityProviderConfigResponse]
$creadList :: ReadS [AssociateIdentityProviderConfigResponse]
readsPrec :: Int -> ReadS AssociateIdentityProviderConfigResponse
$creadsPrec :: Int -> ReadS AssociateIdentityProviderConfigResponse
Prelude.Read, Int -> AssociateIdentityProviderConfigResponse -> ShowS
[AssociateIdentityProviderConfigResponse] -> ShowS
AssociateIdentityProviderConfigResponse -> String
(Int -> AssociateIdentityProviderConfigResponse -> ShowS)
-> (AssociateIdentityProviderConfigResponse -> String)
-> ([AssociateIdentityProviderConfigResponse] -> ShowS)
-> Show AssociateIdentityProviderConfigResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AssociateIdentityProviderConfigResponse] -> ShowS
$cshowList :: [AssociateIdentityProviderConfigResponse] -> ShowS
show :: AssociateIdentityProviderConfigResponse -> String
$cshow :: AssociateIdentityProviderConfigResponse -> String
showsPrec :: Int -> AssociateIdentityProviderConfigResponse -> ShowS
$cshowsPrec :: Int -> AssociateIdentityProviderConfigResponse -> ShowS
Prelude.Show, (forall x.
 AssociateIdentityProviderConfigResponse
 -> Rep AssociateIdentityProviderConfigResponse x)
-> (forall x.
    Rep AssociateIdentityProviderConfigResponse x
    -> AssociateIdentityProviderConfigResponse)
-> Generic AssociateIdentityProviderConfigResponse
forall x.
Rep AssociateIdentityProviderConfigResponse x
-> AssociateIdentityProviderConfigResponse
forall x.
AssociateIdentityProviderConfigResponse
-> Rep AssociateIdentityProviderConfigResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AssociateIdentityProviderConfigResponse x
-> AssociateIdentityProviderConfigResponse
$cfrom :: forall x.
AssociateIdentityProviderConfigResponse
-> Rep AssociateIdentityProviderConfigResponse x
Prelude.Generic)

-- |
-- Create a value of 'AssociateIdentityProviderConfigResponse' 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:
--
-- 'update', 'associateIdentityProviderConfigResponse_update' - Undocumented member.
--
-- 'tags', 'associateIdentityProviderConfigResponse_tags' - The tags for the resource.
--
-- 'httpStatus', 'associateIdentityProviderConfigResponse_httpStatus' - The response's http status code.
newAssociateIdentityProviderConfigResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  AssociateIdentityProviderConfigResponse
newAssociateIdentityProviderConfigResponse :: Int -> AssociateIdentityProviderConfigResponse
newAssociateIdentityProviderConfigResponse
  Int
pHttpStatus_ =
    AssociateIdentityProviderConfigResponse' :: Maybe Update
-> Maybe (HashMap Text Text)
-> Int
-> AssociateIdentityProviderConfigResponse
AssociateIdentityProviderConfigResponse'
      { $sel:update:AssociateIdentityProviderConfigResponse' :: Maybe Update
update =
          Maybe Update
forall a. Maybe a
Prelude.Nothing,
        $sel:tags:AssociateIdentityProviderConfigResponse' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:AssociateIdentityProviderConfigResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | Undocumented member.
associateIdentityProviderConfigResponse_update :: Lens.Lens' AssociateIdentityProviderConfigResponse (Prelude.Maybe Update)
associateIdentityProviderConfigResponse_update :: (Maybe Update -> f (Maybe Update))
-> AssociateIdentityProviderConfigResponse
-> f AssociateIdentityProviderConfigResponse
associateIdentityProviderConfigResponse_update = (AssociateIdentityProviderConfigResponse -> Maybe Update)
-> (AssociateIdentityProviderConfigResponse
    -> Maybe Update -> AssociateIdentityProviderConfigResponse)
-> Lens
     AssociateIdentityProviderConfigResponse
     AssociateIdentityProviderConfigResponse
     (Maybe Update)
     (Maybe Update)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateIdentityProviderConfigResponse' {Maybe Update
update :: Maybe Update
$sel:update:AssociateIdentityProviderConfigResponse' :: AssociateIdentityProviderConfigResponse -> Maybe Update
update} -> Maybe Update
update) (\s :: AssociateIdentityProviderConfigResponse
s@AssociateIdentityProviderConfigResponse' {} Maybe Update
a -> AssociateIdentityProviderConfigResponse
s {$sel:update:AssociateIdentityProviderConfigResponse' :: Maybe Update
update = Maybe Update
a} :: AssociateIdentityProviderConfigResponse)

-- | The tags for the resource.
associateIdentityProviderConfigResponse_tags :: Lens.Lens' AssociateIdentityProviderConfigResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
associateIdentityProviderConfigResponse_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> AssociateIdentityProviderConfigResponse
-> f AssociateIdentityProviderConfigResponse
associateIdentityProviderConfigResponse_tags = (AssociateIdentityProviderConfigResponse
 -> Maybe (HashMap Text Text))
-> (AssociateIdentityProviderConfigResponse
    -> Maybe (HashMap Text Text)
    -> AssociateIdentityProviderConfigResponse)
-> Lens
     AssociateIdentityProviderConfigResponse
     AssociateIdentityProviderConfigResponse
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateIdentityProviderConfigResponse' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:AssociateIdentityProviderConfigResponse' :: AssociateIdentityProviderConfigResponse
-> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: AssociateIdentityProviderConfigResponse
s@AssociateIdentityProviderConfigResponse' {} Maybe (HashMap Text Text)
a -> AssociateIdentityProviderConfigResponse
s {$sel:tags:AssociateIdentityProviderConfigResponse' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: AssociateIdentityProviderConfigResponse) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> AssociateIdentityProviderConfigResponse
 -> f AssociateIdentityProviderConfigResponse)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> AssociateIdentityProviderConfigResponse
-> f AssociateIdentityProviderConfigResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
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
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The response's http status code.
associateIdentityProviderConfigResponse_httpStatus :: Lens.Lens' AssociateIdentityProviderConfigResponse Prelude.Int
associateIdentityProviderConfigResponse_httpStatus :: (Int -> f Int)
-> AssociateIdentityProviderConfigResponse
-> f AssociateIdentityProviderConfigResponse
associateIdentityProviderConfigResponse_httpStatus = (AssociateIdentityProviderConfigResponse -> Int)
-> (AssociateIdentityProviderConfigResponse
    -> Int -> AssociateIdentityProviderConfigResponse)
-> Lens
     AssociateIdentityProviderConfigResponse
     AssociateIdentityProviderConfigResponse
     Int
     Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateIdentityProviderConfigResponse' {Int
httpStatus :: Int
$sel:httpStatus:AssociateIdentityProviderConfigResponse' :: AssociateIdentityProviderConfigResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: AssociateIdentityProviderConfigResponse
s@AssociateIdentityProviderConfigResponse' {} Int
a -> AssociateIdentityProviderConfigResponse
s {$sel:httpStatus:AssociateIdentityProviderConfigResponse' :: Int
httpStatus = Int
a} :: AssociateIdentityProviderConfigResponse)

instance
  Prelude.NFData
    AssociateIdentityProviderConfigResponse