Skip to content

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

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
117 changes: 117 additions & 0 deletions src/FusionAuth/FusionAuthClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -802,6 +802,27 @@ public function createTheme($themeId, $request)
->go();
}

/**
* Adds the application tenants for universal applications.
*
* @param string $applicationId The Id of the application that the universal application tenant belongs to.
* @param string $universalApplicationTenantId (Optional) The Id of the universal application tenant.
* @param array $request The request object that contains all the information used to create the UniversalApplicationTenants.
*
* @return ClientResponse The ClientResponse.
* @throws \Exception
*/
public function createUniversalApplicationTenant($applicationId, $universalApplicationTenantId, $request)
{
return $this->start()->uri("/api/application")
->urlSegment($applicationId)
->urlSegment("universal-application-tenant")
->urlSegment($universalApplicationTenantId)
->bodyHandler(new JSONBodyHandler($request))
->post()
->go();
}

/**
* Creates a user. You can optionally specify an Id for the user, if not provided one will be generated.
*
Expand Down Expand Up @@ -1474,6 +1495,44 @@ public function deleteTheme($themeId)
->go();
}

/**
* Deletes the universal application tenant.
*
* @param string $applicationId The Id of the application that the UniversalApplicationTenant belongs to.
* @param string $universalApplicationTenantId The Id of the UniversalApplicationTenant to delete.
*
* @return ClientResponse The ClientResponse.
* @throws \Exception
*/
public function deleteUniversalApplicationTenant($applicationId, $universalApplicationTenantId)
{
return $this->start()->uri("/api/application")
->urlSegment($applicationId)
->urlSegment("universal-application-tenant")
->urlSegment($universalApplicationTenantId)
->delete()
->go();
}

/**
* Removes the specified tenants from the universal application tenants list.
*
* @param string $applicationId The Id of the universal application that the tenants are linked to.
* @param array $tenantIds The Ids of the tenants to delete from the universal application tenants list.
*
* @return ClientResponse The ClientResponse.
* @throws \Exception
*/
public function deleteUniversalApplicationTenants($applicationId, $tenantIds)
{
return $this->start()->uri("/api/application")
->urlSegment($applicationId)
->urlSegment("application-tenant")
->urlParameter("tenantIds", $tenantIds)
->delete()
->go();
}

/**
* Deletes the user for the given Id. This permanently deletes all information, metrics, reports and data associated
* with the user.
Expand Down Expand Up @@ -4270,6 +4329,25 @@ public function retrieveTwoFactorStatus($userId, $applicationId, $twoFactorTrust
->go();
}

/**
* Retrieves the universal application tenant.
*
* @param string $applicationId The Id of the universal application that tenant is mapped to
* @param string $universalApplicationTenantId The Id of the universal application tenant.
*
* @return ClientResponse The ClientResponse.
* @throws \Exception
*/
public function retrieveUniversalApplicationTenant($applicationId, $universalApplicationTenantId)
{
return $this->start()->uri("/api/application")
->urlSegment($applicationId)
->urlSegment("application-tenant")
->urlSegment($universalApplicationTenantId)
->get()
->go();
}

/**
* Retrieves the user for the given Id.
*
Expand Down Expand Up @@ -5216,6 +5294,24 @@ public function searchThemes($request)
->go();
}

/**
* Searches universal application tenants for the specified applicationId and with the specified criteria and pagination.
*
* @param array $request The search criteria and pagination information.
*
* @return ClientResponse The ClientResponse.
* @throws \Exception
*/
public function searchUniversalApplicationTenants($request)
{
return $this->start()->uri("/api/application")
->urlSegment("universal-application-tenant")
->urlSegment("search")
->bodyHandler(new JSONBodyHandler($request))
->post()
->go();
}

/**
* Searches user comments with the specified criteria and pagination.
*
Expand Down Expand Up @@ -6025,6 +6121,27 @@ public function updateTheme($themeId, $request)
->go();
}

/**
* Adds the application tenants for universal applications.
*
* @param string $applicationId The Id of the application that the UniversalApplicationTenant belongs to.
* @param string $universalApplicationTenantId The Id of the universal application tenant.
* @param array $request The request object that contains all the information used to create the UniversalApplicationTenant.
*
* @return ClientResponse The ClientResponse.
* @throws \Exception
*/
public function updateUniversalApplicationTenant($applicationId, $universalApplicationTenantId, $request)
{
return $this->start()->uri("/api/application")
->urlSegment($applicationId)
->urlSegment("universal-application-tenant")
->urlSegment($universalApplicationTenantId)
->bodyHandler(new JSONBodyHandler($request))
->put()
->go();
}

/**
* Updates the user with the given Id.
*
Expand Down