lib/fusionauth/fusionauth_client.rb in fusionauth_client-1.27.2 vs lib/fusionauth/fusionauth_client.rb in fusionauth_client-1.28.0
- old
+ new
@@ -498,10 +498,22 @@
.post()
.go()
end
#
+ # Link an external user from a 3rd party identity provider to a FusionAuth user.
+ #
+ # @param request [OpenStruct, Hash] The request object that contains all of the information used to link the FusionAuth user.
+ # @return [FusionAuth::ClientResponse] The ClientResponse object.
+ def create_user_link(request)
+ start.uri('/api/identity-provider/link')
+ .body_handler(FusionAuth::JSONBodyHandler.new(request))
+ .post()
+ .go()
+ end
+
+ #
# Creates a webhook. You can optionally specify an Id for the webhook, if not provided one will be generated.
#
# @param webhook_id [string] (Optional) The Id for the webhook. If not provided a secure random UUID will be generated.
# @param request [OpenStruct, Hash] The request object that contains all of the information used to create the webhook.
# @return [FusionAuth::ClientResponse] The ClientResponse object.
@@ -924,10 +936,26 @@
.delete()
.go()
end
#
+ # Remove an existing link that has been made from a 3rd party identity provider to a FusionAuth user.
+ #
+ # @param identity_provider_id [string] The unique Id of the identity provider.
+ # @param identity_provider_user_id [string] The unique Id of the user in the 3rd party identity provider to unlink.
+ # @param user_id [string] The unique Id of the FusionAuth user to unlink.
+ # @return [FusionAuth::ClientResponse] The ClientResponse object.
+ def delete_user_link(identity_provider_id, identity_provider_user_id, user_id)
+ start.uri('/api/identity-provider/link')
+ .url_parameter('identityProviderId', identity_provider_id)
+ .url_parameter('identityProviderUserId', identity_provider_user_id)
+ .url_parameter('userId', user_id)
+ .delete()
+ .go()
+ end
+
+ #
# Deletes the users with the given ids, or users matching the provided JSON query or queryString.
# The order of preference is ids, query and then queryString, it is recommended to only provide one of the three for the request.
#
# This method can be used to deactivate or permanently delete (hard-delete) users based upon the hardDelete boolean in the request body.
# Using the dryRun parameter you may also request the result of the action without actually deleting or deactivating any users.
@@ -1800,10 +1828,26 @@
.post()
.go()
end
#
+ # Requests Elasticsearch to delete and rebuild the index for FusionAuth users or entities. Be very careful when running this request as it will
+ # increase the CPU and I/O load on your database until the operation completes. Generally speaking you do not ever need to run this operation unless
+ # instructed by FusionAuth support, or if you are migrating a database another system and you are not brining along the Elasticsearch index.
+ #
+ # You have been warned.
+ #
+ # @param request [OpenStruct, Hash] The request that contains the index name.
+ # @return [FusionAuth::ClientResponse] The ClientResponse object.
+ def reindex(request)
+ start.uri('/api/system/reindex')
+ .body_handler(FusionAuth::JSONBodyHandler.new(request))
+ .post()
+ .go()
+ end
+
+ #
# Removes a user from the family with the given id.
#
# @param family_id [string] The id of the family to remove the user from.
# @param user_id [string] The id of the user to remove from the family.
# @return [FusionAuth::ClientResponse] The ClientResponse object.
@@ -2616,10 +2660,21 @@
.get()
.go()
end
#
+ # Retrieve the status of a re-index process. A status code of 200 indicates the re-index is in progress, a status code of
+ # 404 indicates no re-index is in progress.
+ #
+ # @return [FusionAuth::ClientResponse] The ClientResponse object.
+ def retrieve_reindex_status()
+ start.uri('/api/system/reindex')
+ .get()
+ .go()
+ end
+
+ #
# Retrieves the system configuration.
#
# @return [FusionAuth::ClientResponse] The ClientResponse object.
def retrieve_system_configuration()
start.uri('/api/system-configuration')
@@ -2856,9 +2911,39 @@
# @param encoded_jwt [string] The encoded JWT (access token).
# @return [FusionAuth::ClientResponse] The ClientResponse object.
def retrieve_user_info_from_access_token(encoded_jwt)
startAnonymous.uri('/oauth2/userinfo')
.authorization('Bearer ' + encoded_jwt)
+ .get()
+ .go()
+ end
+
+ #
+ # Retrieve a single Identity Provider user (link).
+ #
+ # @param identity_provider_id [string] The unique Id of the identity provider.
+ # @param identity_provider_user_id [string] The unique Id of the user in the 3rd party identity provider.
+ # @param user_id [string] The unique Id of the FusionAuth user.
+ # @return [FusionAuth::ClientResponse] The ClientResponse object.
+ def retrieve_user_link(identity_provider_id, identity_provider_user_id, user_id)
+ start.uri('/api/identity-provider/link')
+ .url_parameter('identityProviderId', identity_provider_id)
+ .url_parameter('identityProviderUserId', identity_provider_user_id)
+ .url_parameter('userId', user_id)
+ .get()
+ .go()
+ end
+
+ #
+ # Retrieve all Identity Provider users (links) for the user. Specify the optional identityProviderId to retrieve links for a particular IdP.
+ #
+ # @param identity_provider_id [string] (Optional) The unique Id of the identity provider. Specify this value to reduce the links returned to those for a particular IdP.
+ # @param user_id [string] The unique Id of the user.
+ # @return [FusionAuth::ClientResponse] The ClientResponse object.
+ def retrieve_user_links_by_user_id(identity_provider_id, user_id)
+ start.uri('/api/identity-provider/link')
+ .url_parameter('identityProviderId', identity_provider_id)
+ .url_parameter('userId', user_id)
.get()
.go()
end
#