Skip to content

add the application-tenant api and move it out of the application object #39

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: feature/unification
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 93 additions & 0 deletions lib/fusionauth/fusionauth_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -620,6 +620,23 @@ def create_theme(theme_id, request)
.go
end

#
# Adds the application tenants for universal applications.
#
# @param application_id [string] The Id of the application that the universal application tenant belongs to.
# @param universal_application_tenant_id [string] (Optional) The Id of the universal application tenant.
# @param request [OpenStruct, Hash] The request object that contains all the information used to create the UniversalApplicationTenants.
# @return [FusionAuth::ClientResponse] The ClientResponse object.
def create_universal_application_tenant(application_id, universal_application_tenant_id, request)
start.uri('/api/application')
.url_segment(application_id)
.url_segment("universal-application-tenant")
.url_segment(universal_application_tenant_id)
.body_handler(FusionAuth::JSONBodyHandler.new(request))
.post
.go
end

#
# Creates a user. You can optionally specify an Id for the user, if not provided one will be generated.
#
Expand Down Expand Up @@ -1136,6 +1153,36 @@ def delete_theme(theme_id)
.go
end

#
# Deletes the universal application tenant.
#
# @param application_id [string] The Id of the application that the UniversalApplicationTenant belongs to.
# @param universal_application_tenant_id [string] The Id of the UniversalApplicationTenant to delete.
# @return [FusionAuth::ClientResponse] The ClientResponse object.
def delete_universal_application_tenant(application_id, universal_application_tenant_id)
start.uri('/api/application')
.url_segment(application_id)
.url_segment("universal-application-tenant")
.url_segment(universal_application_tenant_id)
.delete
.go
end

#
# Removes the specified tenants from the universal application tenants list.
#
# @param application_id [string] The Id of the universal application that the tenants are linked to.
# @param tenant_ids [Array] The Ids of the tenants to delete from the universal application tenants list.
# @return [FusionAuth::ClientResponse] The ClientResponse object.
def delete_universal_application_tenants(application_id, tenant_ids)
start.uri('/api/application')
.url_segment(application_id)
.url_segment("application-tenant")
.url_parameter('tenantIds', tenant_ids)
.delete
.go
end

#
# Deletes the user for the given Id. This permanently deletes all information, metrics, reports and data associated
# with the user.
Expand Down Expand Up @@ -3292,6 +3339,21 @@ def retrieve_two_factor_status(user_id, application_id, two_factor_trust_id)
.go
end

#
# Retrieves the universal application tenant.
#
# @param application_id [string] The Id of the universal application that tenant is mapped to
# @param universal_application_tenant_id [string] The Id of the universal application tenant.
# @return [FusionAuth::ClientResponse] The ClientResponse object.
def retrieve_universal_application_tenant(application_id, universal_application_tenant_id)
start.uri('/api/application')
.url_segment(application_id)
.url_segment("application-tenant")
.url_segment(universal_application_tenant_id)
.get
.go
end

#
# Retrieves the user for the given Id.
#
Expand Down Expand Up @@ -4018,6 +4080,20 @@ def search_themes(request)
.go
end

#
# Searches universal application tenants for the specified applicationId and with the specified criteria and pagination.
#
# @param request [OpenStruct, Hash] The search criteria and pagination information.
# @return [FusionAuth::ClientResponse] The ClientResponse object.
def search_universal_application_tenants(request)
start.uri('/api/application')
.url_segment("universal-application-tenant")
.url_segment("search")
.body_handler(FusionAuth::JSONBodyHandler.new(request))
.post
.go
end

#
# Searches user comments with the specified criteria and pagination.
#
Expand Down Expand Up @@ -4643,6 +4719,23 @@ def update_theme(theme_id, request)
.go
end

#
# Adds the application tenants for universal applications.
#
# @param application_id [string] The Id of the application that the UniversalApplicationTenant belongs to.
# @param universal_application_tenant_id [string] The Id of the universal application tenant.
# @param request [OpenStruct, Hash] The request object that contains all the information used to create the UniversalApplicationTenant.
# @return [FusionAuth::ClientResponse] The ClientResponse object.
def update_universal_application_tenant(application_id, universal_application_tenant_id, request)
start.uri('/api/application')
.url_segment(application_id)
.url_segment("universal-application-tenant")
.url_segment(universal_application_tenant_id)
.body_handler(FusionAuth::JSONBodyHandler.new(request))
.put
.go
end

#
# Updates the user with the given Id.
#
Expand Down