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

def create_universal_application_tenant(self, application_id, request, universal_application_tenant_id=None):
"""
Adds the application tenants for universal applications.

Attributes:
application_id: The Id of the application that the universal application tenant belongs to.
universal_application_tenant_id: (Optional) The Id of the universal application tenant.
request: The request object that contains all the information used to create the UniversalApplicationTenants.
"""
return self.start().uri('/api/application') \
.url_segment(application_id) \
.url_segment("universal-application-tenant") \
.url_segment(universal_application_tenant_id) \
.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 +1148,36 @@ def delete_theme(self, theme_id):
.delete() \
.go()

def delete_universal_application_tenant(self, application_id, universal_application_tenant_id):
"""
Deletes the universal application tenant.

Attributes:
application_id: The Id of the application that the UniversalApplicationTenant belongs to.
universal_application_tenant_id: The Id of the UniversalApplicationTenant to delete.
"""
return self.start().uri('/api/application') \
.url_segment(application_id) \
.url_segment("universal-application-tenant") \
.url_segment(universal_application_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 +3334,21 @@ def retrieve_two_factor_status(self, user_id, application_id, two_factor_trust_i
.get() \
.go()

def retrieve_universal_application_tenant(self, application_id, universal_application_tenant_id):
"""
Retrieves the universal application tenant.

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

def retrieve_user(self, user_id):
"""
Retrieves the user for the given Id.
Expand Down Expand Up @@ -4013,6 +4075,20 @@ def search_themes(self, request):
.post() \
.go()

def search_universal_application_tenants(self, request):
"""
Searches universal application tenants for the specified applicationId and with the specified criteria and pagination.

Attributes:
request: The search criteria and pagination information.
"""
return self.start().uri('/api/application') \
.url_segment("universal-application-tenant") \
.url_segment("search") \
.body_handler(JSONBodyHandler(request)) \
.post() \
.go()

def search_user_comments(self, request):
"""
Searches user comments with the specified criteria and pagination.
Expand Down Expand Up @@ -4638,6 +4714,23 @@ def update_theme(self, theme_id, request):
.put() \
.go()

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

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

def update_user(self, user_id, request):
"""
Updates the user with the given Id.
Expand Down