{-# 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.CognitoIdentityProvider.UpdateIdentityProvider
-- 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)
--
-- Updates identity provider information for a user pool.
module Amazonka.CognitoIdentityProvider.UpdateIdentityProvider
  ( -- * Creating a Request
    UpdateIdentityProvider (..),
    newUpdateIdentityProvider,

    -- * Request Lenses
    updateIdentityProvider_idpIdentifiers,
    updateIdentityProvider_attributeMapping,
    updateIdentityProvider_providerDetails,
    updateIdentityProvider_userPoolId,
    updateIdentityProvider_providerName,

    -- * Destructuring the Response
    UpdateIdentityProviderResponse (..),
    newUpdateIdentityProviderResponse,

    -- * Response Lenses
    updateIdentityProviderResponse_httpStatus,
    updateIdentityProviderResponse_identityProvider,
  )
where

import Amazonka.CognitoIdentityProvider.Types
import qualified Amazonka.Core as Core
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:/ 'newUpdateIdentityProvider' smart constructor.
data UpdateIdentityProvider = UpdateIdentityProvider'
  { -- | A list of identity provider identifiers.
    UpdateIdentityProvider -> Maybe [Text]
idpIdentifiers :: Prelude.Maybe [Prelude.Text],
    -- | The identity provider attribute mapping to be changed.
    UpdateIdentityProvider -> Maybe (HashMap Text Text)
attributeMapping :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The identity provider details to be updated, such as @MetadataURL@ and
    -- @MetadataFile@.
    UpdateIdentityProvider -> Maybe (HashMap Text Text)
providerDetails :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The user pool ID.
    UpdateIdentityProvider -> Text
userPoolId :: Prelude.Text,
    -- | The identity provider name.
    UpdateIdentityProvider -> Text
providerName :: Prelude.Text
  }
  deriving (UpdateIdentityProvider -> UpdateIdentityProvider -> Bool
(UpdateIdentityProvider -> UpdateIdentityProvider -> Bool)
-> (UpdateIdentityProvider -> UpdateIdentityProvider -> Bool)
-> Eq UpdateIdentityProvider
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateIdentityProvider -> UpdateIdentityProvider -> Bool
$c/= :: UpdateIdentityProvider -> UpdateIdentityProvider -> Bool
== :: UpdateIdentityProvider -> UpdateIdentityProvider -> Bool
$c== :: UpdateIdentityProvider -> UpdateIdentityProvider -> Bool
Prelude.Eq, ReadPrec [UpdateIdentityProvider]
ReadPrec UpdateIdentityProvider
Int -> ReadS UpdateIdentityProvider
ReadS [UpdateIdentityProvider]
(Int -> ReadS UpdateIdentityProvider)
-> ReadS [UpdateIdentityProvider]
-> ReadPrec UpdateIdentityProvider
-> ReadPrec [UpdateIdentityProvider]
-> Read UpdateIdentityProvider
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateIdentityProvider]
$creadListPrec :: ReadPrec [UpdateIdentityProvider]
readPrec :: ReadPrec UpdateIdentityProvider
$creadPrec :: ReadPrec UpdateIdentityProvider
readList :: ReadS [UpdateIdentityProvider]
$creadList :: ReadS [UpdateIdentityProvider]
readsPrec :: Int -> ReadS UpdateIdentityProvider
$creadsPrec :: Int -> ReadS UpdateIdentityProvider
Prelude.Read, Int -> UpdateIdentityProvider -> ShowS
[UpdateIdentityProvider] -> ShowS
UpdateIdentityProvider -> String
(Int -> UpdateIdentityProvider -> ShowS)
-> (UpdateIdentityProvider -> String)
-> ([UpdateIdentityProvider] -> ShowS)
-> Show UpdateIdentityProvider
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateIdentityProvider] -> ShowS
$cshowList :: [UpdateIdentityProvider] -> ShowS
show :: UpdateIdentityProvider -> String
$cshow :: UpdateIdentityProvider -> String
showsPrec :: Int -> UpdateIdentityProvider -> ShowS
$cshowsPrec :: Int -> UpdateIdentityProvider -> ShowS
Prelude.Show, (forall x. UpdateIdentityProvider -> Rep UpdateIdentityProvider x)
-> (forall x.
    Rep UpdateIdentityProvider x -> UpdateIdentityProvider)
-> Generic UpdateIdentityProvider
forall x. Rep UpdateIdentityProvider x -> UpdateIdentityProvider
forall x. UpdateIdentityProvider -> Rep UpdateIdentityProvider x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateIdentityProvider x -> UpdateIdentityProvider
$cfrom :: forall x. UpdateIdentityProvider -> Rep UpdateIdentityProvider x
Prelude.Generic)

-- |
-- Create a value of 'UpdateIdentityProvider' 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:
--
-- 'idpIdentifiers', 'updateIdentityProvider_idpIdentifiers' - A list of identity provider identifiers.
--
-- 'attributeMapping', 'updateIdentityProvider_attributeMapping' - The identity provider attribute mapping to be changed.
--
-- 'providerDetails', 'updateIdentityProvider_providerDetails' - The identity provider details to be updated, such as @MetadataURL@ and
-- @MetadataFile@.
--
-- 'userPoolId', 'updateIdentityProvider_userPoolId' - The user pool ID.
--
-- 'providerName', 'updateIdentityProvider_providerName' - The identity provider name.
newUpdateIdentityProvider ::
  -- | 'userPoolId'
  Prelude.Text ->
  -- | 'providerName'
  Prelude.Text ->
  UpdateIdentityProvider
newUpdateIdentityProvider :: Text -> Text -> UpdateIdentityProvider
newUpdateIdentityProvider Text
pUserPoolId_ Text
pProviderName_ =
  UpdateIdentityProvider' :: Maybe [Text]
-> Maybe (HashMap Text Text)
-> Maybe (HashMap Text Text)
-> Text
-> Text
-> UpdateIdentityProvider
UpdateIdentityProvider'
    { $sel:idpIdentifiers:UpdateIdentityProvider' :: Maybe [Text]
idpIdentifiers =
        Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:attributeMapping:UpdateIdentityProvider' :: Maybe (HashMap Text Text)
attributeMapping = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:providerDetails:UpdateIdentityProvider' :: Maybe (HashMap Text Text)
providerDetails = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:userPoolId:UpdateIdentityProvider' :: Text
userPoolId = Text
pUserPoolId_,
      $sel:providerName:UpdateIdentityProvider' :: Text
providerName = Text
pProviderName_
    }

-- | A list of identity provider identifiers.
updateIdentityProvider_idpIdentifiers :: Lens.Lens' UpdateIdentityProvider (Prelude.Maybe [Prelude.Text])
updateIdentityProvider_idpIdentifiers :: (Maybe [Text] -> f (Maybe [Text]))
-> UpdateIdentityProvider -> f UpdateIdentityProvider
updateIdentityProvider_idpIdentifiers = (UpdateIdentityProvider -> Maybe [Text])
-> (UpdateIdentityProvider
    -> Maybe [Text] -> UpdateIdentityProvider)
-> Lens
     UpdateIdentityProvider
     UpdateIdentityProvider
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateIdentityProvider' {Maybe [Text]
idpIdentifiers :: Maybe [Text]
$sel:idpIdentifiers:UpdateIdentityProvider' :: UpdateIdentityProvider -> Maybe [Text]
idpIdentifiers} -> Maybe [Text]
idpIdentifiers) (\s :: UpdateIdentityProvider
s@UpdateIdentityProvider' {} Maybe [Text]
a -> UpdateIdentityProvider
s {$sel:idpIdentifiers:UpdateIdentityProvider' :: Maybe [Text]
idpIdentifiers = Maybe [Text]
a} :: UpdateIdentityProvider) ((Maybe [Text] -> f (Maybe [Text]))
 -> UpdateIdentityProvider -> f UpdateIdentityProvider)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> UpdateIdentityProvider
-> f UpdateIdentityProvider
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The identity provider attribute mapping to be changed.
updateIdentityProvider_attributeMapping :: Lens.Lens' UpdateIdentityProvider (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
updateIdentityProvider_attributeMapping :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> UpdateIdentityProvider -> f UpdateIdentityProvider
updateIdentityProvider_attributeMapping = (UpdateIdentityProvider -> Maybe (HashMap Text Text))
-> (UpdateIdentityProvider
    -> Maybe (HashMap Text Text) -> UpdateIdentityProvider)
-> Lens
     UpdateIdentityProvider
     UpdateIdentityProvider
     (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 (\UpdateIdentityProvider' {Maybe (HashMap Text Text)
attributeMapping :: Maybe (HashMap Text Text)
$sel:attributeMapping:UpdateIdentityProvider' :: UpdateIdentityProvider -> Maybe (HashMap Text Text)
attributeMapping} -> Maybe (HashMap Text Text)
attributeMapping) (\s :: UpdateIdentityProvider
s@UpdateIdentityProvider' {} Maybe (HashMap Text Text)
a -> UpdateIdentityProvider
s {$sel:attributeMapping:UpdateIdentityProvider' :: Maybe (HashMap Text Text)
attributeMapping = Maybe (HashMap Text Text)
a} :: UpdateIdentityProvider) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> UpdateIdentityProvider -> f UpdateIdentityProvider)
-> ((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)))
-> UpdateIdentityProvider
-> f UpdateIdentityProvider
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 identity provider details to be updated, such as @MetadataURL@ and
-- @MetadataFile@.
updateIdentityProvider_providerDetails :: Lens.Lens' UpdateIdentityProvider (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
updateIdentityProvider_providerDetails :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> UpdateIdentityProvider -> f UpdateIdentityProvider
updateIdentityProvider_providerDetails = (UpdateIdentityProvider -> Maybe (HashMap Text Text))
-> (UpdateIdentityProvider
    -> Maybe (HashMap Text Text) -> UpdateIdentityProvider)
-> Lens
     UpdateIdentityProvider
     UpdateIdentityProvider
     (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 (\UpdateIdentityProvider' {Maybe (HashMap Text Text)
providerDetails :: Maybe (HashMap Text Text)
$sel:providerDetails:UpdateIdentityProvider' :: UpdateIdentityProvider -> Maybe (HashMap Text Text)
providerDetails} -> Maybe (HashMap Text Text)
providerDetails) (\s :: UpdateIdentityProvider
s@UpdateIdentityProvider' {} Maybe (HashMap Text Text)
a -> UpdateIdentityProvider
s {$sel:providerDetails:UpdateIdentityProvider' :: Maybe (HashMap Text Text)
providerDetails = Maybe (HashMap Text Text)
a} :: UpdateIdentityProvider) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> UpdateIdentityProvider -> f UpdateIdentityProvider)
-> ((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)))
-> UpdateIdentityProvider
-> f UpdateIdentityProvider
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 user pool ID.
updateIdentityProvider_userPoolId :: Lens.Lens' UpdateIdentityProvider Prelude.Text
updateIdentityProvider_userPoolId :: (Text -> f Text)
-> UpdateIdentityProvider -> f UpdateIdentityProvider
updateIdentityProvider_userPoolId = (UpdateIdentityProvider -> Text)
-> (UpdateIdentityProvider -> Text -> UpdateIdentityProvider)
-> Lens UpdateIdentityProvider UpdateIdentityProvider Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateIdentityProvider' {Text
userPoolId :: Text
$sel:userPoolId:UpdateIdentityProvider' :: UpdateIdentityProvider -> Text
userPoolId} -> Text
userPoolId) (\s :: UpdateIdentityProvider
s@UpdateIdentityProvider' {} Text
a -> UpdateIdentityProvider
s {$sel:userPoolId:UpdateIdentityProvider' :: Text
userPoolId = Text
a} :: UpdateIdentityProvider)

-- | The identity provider name.
updateIdentityProvider_providerName :: Lens.Lens' UpdateIdentityProvider Prelude.Text
updateIdentityProvider_providerName :: (Text -> f Text)
-> UpdateIdentityProvider -> f UpdateIdentityProvider
updateIdentityProvider_providerName = (UpdateIdentityProvider -> Text)
-> (UpdateIdentityProvider -> Text -> UpdateIdentityProvider)
-> Lens UpdateIdentityProvider UpdateIdentityProvider Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateIdentityProvider' {Text
providerName :: Text
$sel:providerName:UpdateIdentityProvider' :: UpdateIdentityProvider -> Text
providerName} -> Text
providerName) (\s :: UpdateIdentityProvider
s@UpdateIdentityProvider' {} Text
a -> UpdateIdentityProvider
s {$sel:providerName:UpdateIdentityProvider' :: Text
providerName = Text
a} :: UpdateIdentityProvider)

instance Core.AWSRequest UpdateIdentityProvider where
  type
    AWSResponse UpdateIdentityProvider =
      UpdateIdentityProviderResponse
  request :: UpdateIdentityProvider -> Request UpdateIdentityProvider
request = Service -> UpdateIdentityProvider -> Request UpdateIdentityProvider
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdateIdentityProvider
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateIdentityProvider)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse UpdateIdentityProvider))
-> Logger
-> Service
-> Proxy UpdateIdentityProvider
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateIdentityProvider)))
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 ->
          Int -> IdentityProviderType -> UpdateIdentityProviderResponse
UpdateIdentityProviderResponse'
            (Int -> IdentityProviderType -> UpdateIdentityProviderResponse)
-> Either String Int
-> Either
     String (IdentityProviderType -> UpdateIdentityProviderResponse)
forall (f :: * -> *) a b. Functor 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))
            Either
  String (IdentityProviderType -> UpdateIdentityProviderResponse)
-> Either String IdentityProviderType
-> Either String UpdateIdentityProviderResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String IdentityProviderType
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"IdentityProvider")
      )

instance Prelude.Hashable UpdateIdentityProvider

instance Prelude.NFData UpdateIdentityProvider

instance Core.ToHeaders UpdateIdentityProvider where
  toHeaders :: UpdateIdentityProvider -> ResponseHeaders
toHeaders =
    ResponseHeaders -> UpdateIdentityProvider -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"AWSCognitoIdentityProviderService.UpdateIdentityProvider" ::
                          Prelude.ByteString
                      ),
            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 UpdateIdentityProvider where
  toJSON :: UpdateIdentityProvider -> Value
toJSON UpdateIdentityProvider' {Maybe [Text]
Maybe (HashMap Text Text)
Text
providerName :: Text
userPoolId :: Text
providerDetails :: Maybe (HashMap Text Text)
attributeMapping :: Maybe (HashMap Text Text)
idpIdentifiers :: Maybe [Text]
$sel:providerName:UpdateIdentityProvider' :: UpdateIdentityProvider -> Text
$sel:userPoolId:UpdateIdentityProvider' :: UpdateIdentityProvider -> Text
$sel:providerDetails:UpdateIdentityProvider' :: UpdateIdentityProvider -> Maybe (HashMap Text Text)
$sel:attributeMapping:UpdateIdentityProvider' :: UpdateIdentityProvider -> Maybe (HashMap Text Text)
$sel:idpIdentifiers:UpdateIdentityProvider' :: UpdateIdentityProvider -> Maybe [Text]
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"IdpIdentifiers" 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]
idpIdentifiers,
            (Text
"AttributeMapping" 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)
attributeMapping,
            (Text
"ProviderDetails" 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)
providerDetails,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"UserPoolId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
userPoolId),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ProviderName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
providerName)
          ]
      )

instance Core.ToPath UpdateIdentityProvider where
  toPath :: UpdateIdentityProvider -> ByteString
toPath = ByteString -> UpdateIdentityProvider -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

-- | /See:/ 'newUpdateIdentityProviderResponse' smart constructor.
data UpdateIdentityProviderResponse = UpdateIdentityProviderResponse'
  { -- | The response's http status code.
    UpdateIdentityProviderResponse -> Int
httpStatus :: Prelude.Int,
    -- | The identity provider object.
    UpdateIdentityProviderResponse -> IdentityProviderType
identityProvider :: IdentityProviderType
  }
  deriving (UpdateIdentityProviderResponse
-> UpdateIdentityProviderResponse -> Bool
(UpdateIdentityProviderResponse
 -> UpdateIdentityProviderResponse -> Bool)
-> (UpdateIdentityProviderResponse
    -> UpdateIdentityProviderResponse -> Bool)
-> Eq UpdateIdentityProviderResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateIdentityProviderResponse
-> UpdateIdentityProviderResponse -> Bool
$c/= :: UpdateIdentityProviderResponse
-> UpdateIdentityProviderResponse -> Bool
== :: UpdateIdentityProviderResponse
-> UpdateIdentityProviderResponse -> Bool
$c== :: UpdateIdentityProviderResponse
-> UpdateIdentityProviderResponse -> Bool
Prelude.Eq, ReadPrec [UpdateIdentityProviderResponse]
ReadPrec UpdateIdentityProviderResponse
Int -> ReadS UpdateIdentityProviderResponse
ReadS [UpdateIdentityProviderResponse]
(Int -> ReadS UpdateIdentityProviderResponse)
-> ReadS [UpdateIdentityProviderResponse]
-> ReadPrec UpdateIdentityProviderResponse
-> ReadPrec [UpdateIdentityProviderResponse]
-> Read UpdateIdentityProviderResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateIdentityProviderResponse]
$creadListPrec :: ReadPrec [UpdateIdentityProviderResponse]
readPrec :: ReadPrec UpdateIdentityProviderResponse
$creadPrec :: ReadPrec UpdateIdentityProviderResponse
readList :: ReadS [UpdateIdentityProviderResponse]
$creadList :: ReadS [UpdateIdentityProviderResponse]
readsPrec :: Int -> ReadS UpdateIdentityProviderResponse
$creadsPrec :: Int -> ReadS UpdateIdentityProviderResponse
Prelude.Read, Int -> UpdateIdentityProviderResponse -> ShowS
[UpdateIdentityProviderResponse] -> ShowS
UpdateIdentityProviderResponse -> String
(Int -> UpdateIdentityProviderResponse -> ShowS)
-> (UpdateIdentityProviderResponse -> String)
-> ([UpdateIdentityProviderResponse] -> ShowS)
-> Show UpdateIdentityProviderResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateIdentityProviderResponse] -> ShowS
$cshowList :: [UpdateIdentityProviderResponse] -> ShowS
show :: UpdateIdentityProviderResponse -> String
$cshow :: UpdateIdentityProviderResponse -> String
showsPrec :: Int -> UpdateIdentityProviderResponse -> ShowS
$cshowsPrec :: Int -> UpdateIdentityProviderResponse -> ShowS
Prelude.Show, (forall x.
 UpdateIdentityProviderResponse
 -> Rep UpdateIdentityProviderResponse x)
-> (forall x.
    Rep UpdateIdentityProviderResponse x
    -> UpdateIdentityProviderResponse)
-> Generic UpdateIdentityProviderResponse
forall x.
Rep UpdateIdentityProviderResponse x
-> UpdateIdentityProviderResponse
forall x.
UpdateIdentityProviderResponse
-> Rep UpdateIdentityProviderResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateIdentityProviderResponse x
-> UpdateIdentityProviderResponse
$cfrom :: forall x.
UpdateIdentityProviderResponse
-> Rep UpdateIdentityProviderResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateIdentityProviderResponse' 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:
--
-- 'httpStatus', 'updateIdentityProviderResponse_httpStatus' - The response's http status code.
--
-- 'identityProvider', 'updateIdentityProviderResponse_identityProvider' - The identity provider object.
newUpdateIdentityProviderResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'identityProvider'
  IdentityProviderType ->
  UpdateIdentityProviderResponse
newUpdateIdentityProviderResponse :: Int -> IdentityProviderType -> UpdateIdentityProviderResponse
newUpdateIdentityProviderResponse
  Int
pHttpStatus_
  IdentityProviderType
pIdentityProvider_ =
    UpdateIdentityProviderResponse' :: Int -> IdentityProviderType -> UpdateIdentityProviderResponse
UpdateIdentityProviderResponse'
      { $sel:httpStatus:UpdateIdentityProviderResponse' :: Int
httpStatus =
          Int
pHttpStatus_,
        $sel:identityProvider:UpdateIdentityProviderResponse' :: IdentityProviderType
identityProvider = IdentityProviderType
pIdentityProvider_
      }

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

-- | The identity provider object.
updateIdentityProviderResponse_identityProvider :: Lens.Lens' UpdateIdentityProviderResponse IdentityProviderType
updateIdentityProviderResponse_identityProvider :: (IdentityProviderType -> f IdentityProviderType)
-> UpdateIdentityProviderResponse
-> f UpdateIdentityProviderResponse
updateIdentityProviderResponse_identityProvider = (UpdateIdentityProviderResponse -> IdentityProviderType)
-> (UpdateIdentityProviderResponse
    -> IdentityProviderType -> UpdateIdentityProviderResponse)
-> Lens
     UpdateIdentityProviderResponse
     UpdateIdentityProviderResponse
     IdentityProviderType
     IdentityProviderType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateIdentityProviderResponse' {IdentityProviderType
identityProvider :: IdentityProviderType
$sel:identityProvider:UpdateIdentityProviderResponse' :: UpdateIdentityProviderResponse -> IdentityProviderType
identityProvider} -> IdentityProviderType
identityProvider) (\s :: UpdateIdentityProviderResponse
s@UpdateIdentityProviderResponse' {} IdentityProviderType
a -> UpdateIdentityProviderResponse
s {$sel:identityProvider:UpdateIdentityProviderResponse' :: IdentityProviderType
identityProvider = IdentityProviderType
a} :: UpdateIdentityProviderResponse)

instance
  Prelude.NFData
    UpdateIdentityProviderResponse