Skip to content

Commit

Permalink
client library sync
Browse files Browse the repository at this point in the history
  • Loading branch information
robotdan committed Apr 19, 2024
1 parent 9e9e892 commit 5351513
Showing 1 changed file with 85 additions and 2 deletions.
87 changes: 85 additions & 2 deletions lib/fusionauth/fusionauth_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
require 'fusionauth/rest_client'

#
# Copyright (c) 2018-2024, FusionAuth, All Rights Reserved
# Copyright (c) 2018-2023, FusionAuth, All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -557,6 +557,24 @@ def create_messenger(messenger_id, request)
.go()
end

#
# Creates a new custom OAuth scope for an application. You must specify the Id of the application you are creating the scope for.
# You can optionally specify an Id for the OAuth scope on the URL, if not provided one will be generated.
#
# @param application_id [string] The Id of the application to create the OAuth scope on.
# @param scope_id [string] (Optional) The Id of the OAuth scope. If not provided a secure random UUID will be generated.
# @param request [OpenStruct, Hash] The request object that contains all the information used to create the OAuth OAuth scope.
# @return [FusionAuth::ClientResponse] The ClientResponse object.
def create_o_auth_scope(application_id, scope_id, request)
start.uri('/api/application')
.url_segment(application_id)
.url_segment("scope")
.url_segment(scope_id)
.body_handler(FusionAuth::JSONBodyHandler.new(request))
.post()
.go()
end

#
# Creates a tenant. You can optionally specify an Id for the tenant, if not provided one will be generated.
#
Expand Down Expand Up @@ -776,7 +794,7 @@ def delete_application(application_id)
# Hard deletes an application role. This is a dangerous operation and should not be used in most circumstances. This
# permanently removes the given role from all users that had it.
#
# @param application_id [string] The Id of the application to deactivate.
# @param application_id [string] The Id of the application that the role belongs to.
# @param role_id [string] The Id of the role to delete.
# @return [FusionAuth::ClientResponse] The ClientResponse object.
def delete_application_role(application_id, role_id)
Expand Down Expand Up @@ -1001,6 +1019,22 @@ def delete_messenger(messenger_id)
.go()
end

#
# Hard deletes a custom OAuth scope.
# OAuth workflows that are still requesting the deleted OAuth scope may fail depending on the application's unknown scope policy.
#
# @param application_id [string] The Id of the application that the OAuth scope belongs to.
# @param scope_id [string] The Id of the OAuth scope to delete.
# @return [FusionAuth::ClientResponse] The ClientResponse object.
def delete_o_auth_scope(application_id, scope_id)
start.uri('/api/application')
.url_segment(application_id)
.url_segment("scope")
.url_segment(scope_id)
.delete()
.go()
end

#
# Deletes the user registration for the given user and application.
#
Expand Down Expand Up @@ -1902,6 +1936,23 @@ def patch_messenger(messenger_id, request)
.go()
end

#
# Updates, via PATCH, the custom OAuth scope with the given Id for the application.
#
# @param application_id [string] The Id of the application that the OAuth scope belongs to.
# @param scope_id [string] The Id of the OAuth scope to update.
# @param request [OpenStruct, Hash] The request that contains just the new OAuth scope information.
# @return [FusionAuth::ClientResponse] The ClientResponse object.
def patch_o_auth_scope(application_id, scope_id, request)
start.uri('/api/application')
.url_segment(application_id)
.url_segment("scope")
.url_segment(scope_id)
.body_handler(FusionAuth::JSONBodyHandler.new(request))
.patch()
.go()
end

#
# Updates, via PATCH, the registration for the user with the given Id and the application defined in the request.
#
Expand Down Expand Up @@ -2820,6 +2871,21 @@ def retrieve_monthly_active_report(application_id, start, _end)
.go()
end

#
# Retrieves a custom OAuth scope.
#
# @param application_id [string] The Id of the application that the OAuth scope belongs to.
# @param scope_id [string] The Id of the OAuth scope to retrieve.
# @return [FusionAuth::ClientResponse] The ClientResponse object.
def retrieve_o_auth_scope(application_id, scope_id)
start.uri('/api/application')
.url_segment(application_id)
.url_segment("scope")
.url_segment(scope_id)
.get()
.go()
end

#
# Retrieves the Oauth2 configuration for the application for the given Application Id.
#
Expand Down Expand Up @@ -4322,6 +4388,23 @@ def update_messenger(messenger_id, request)
.go()
end

#
# Updates the OAuth scope with the given Id for the application.
#
# @param application_id [string] The Id of the application that the OAuth scope belongs to.
# @param scope_id [string] The Id of the OAuth scope to update.
# @param request [OpenStruct, Hash] The request that contains all the new OAuth scope information.
# @return [FusionAuth::ClientResponse] The ClientResponse object.
def update_o_auth_scope(application_id, scope_id, request)
start.uri('/api/application')
.url_segment(application_id)
.url_segment("scope")
.url_segment(scope_id)
.body_handler(FusionAuth::JSONBodyHandler.new(request))
.put()
.go()
end

#
# Updates the registration for the user with the given Id and the application defined in the request.
#
Expand Down

0 comments on commit 5351513

Please sign in to comment.