Skip to content

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

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 1 commit 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
58 changes: 58 additions & 0 deletions src/main/python/fusionauth/fusionauth_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -615,6 +615,21 @@ def create_theme(self, request, theme_id=None):
.post() \
.go()

def create_universal_application_tenants(self, application_id, request):
"""
Adds the application tenants for universal applications.

Attributes:
application_id: The Id of the application that the role belongs to.
request: The request object that contains all the information used to create the Entity.
"""
return self.start().uri('/api/application') \
.url_segment(application_id) \
.url_segment("application-tenant") \
.body_handler(JSONBodyHandler(request)) \
.post() \
.go()

def create_user(self, request, user_id=None):
"""
Creates a user. You can optionally specify an Id for the user, if not provided one will be generated.
Expand Down Expand Up @@ -1131,6 +1146,36 @@ def delete_theme(self, theme_id):
.delete() \
.go()

def delete_universal_application_tenant(self, application_id, tenant_id):
"""
Removes the specified tenant from the universal application tenants list.

Attributes:
application_id: The Id of the application that the role belongs to.
tenant_id: The Id of the tenant to delete from the universal application tenants list.
"""
return self.start().uri('/api/application') \
.url_segment(application_id) \
.url_segment("application-tenant") \
.url_segment(tenant_id) \
.delete() \
.go()

def delete_universal_application_tenants(self, application_id, tenant_ids):
"""
Removes the specified tenants from the universal application tenants list.

Attributes:
application_id: The Id of the universal application that the tenants are linked to.
tenant_ids: The Ids of the tenants to delete from the universal application tenants list.
"""
return self.start().uri('/api/application') \
.url_segment(application_id) \
.url_segment("application-tenant") \
.url_parameter('tenantIds', self.convert_true_false(tenant_ids)) \
.delete() \
.go()

def delete_user(self, user_id):
"""
Deletes the user for the given Id. This permanently deletes all information, metrics, reports and data associated
Expand Down Expand Up @@ -3287,6 +3332,19 @@ def retrieve_two_factor_status(self, user_id, application_id, two_factor_trust_i
.get() \
.go()

def retrieve_universal_application_tenants(self, application_id):
"""
Retrieves the application tenants for universal applications.

Attributes:
application_id: The Id of the application that the role belongs to.
"""
return self.start().uri('/api/application') \
.url_segment(application_id) \
.url_segment("application-tenant") \
.get() \
.go()

def retrieve_user(self, user_id):
"""
Retrieves the user for the given Id.
Expand Down