Skip to content

Commit

Permalink
User Management support (#212)
Browse files Browse the repository at this point in the history
* Add Beta SDKs section in README.md (#213)

* Add Beta SDKs section in README.md

* Nit/typo

* Nit in section about Beta releases in the README.md (#214)

* Nit in section about Beta releases in the README.md

* Improvement to README.md

* Update README.md

* User Management support
  • Loading branch information
amadeo-workos committed Apr 25, 2024
1 parent 18f1ba2 commit 1bf461f
Show file tree
Hide file tree
Showing 68 changed files with 4,225 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

# Ignore IntelliJ projects
.idea
.settings/org.eclipse.jdt.core.prefs

# Ignore Eclipse projects
.project
Expand Down
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ WorkOS workos = new WorkOS("WORKOS_API_KEY");
// workos.passwordless
// workos.portal
// workos.sso
// workos.userManagement
// workos.webhooks
```

Expand All @@ -62,9 +63,23 @@ For our SDKs WorkOS follows a Semantic Versioning ([SemVer](https://semver.org/)

See full examples at https://github.com/workos-inc/java-example-applications.

## Beta Releases

WorkOS has features in Beta that can be accessed via Beta releases. We would love for you to try these
and share feedback with us before these features reach general availability (GA). To install a Beta version,
please follow the [installation steps](#installation) above using the Beta release version.

> Note: there can be breaking changes between Beta versions. Therefore, we recommend pinning the package version to a
> specific version. This way you can install the same version each time without breaking changes unless you are
> intentionally looking for the latest Beta version.
We highly recommend keeping an eye on when the Beta feature you are interested in goes from Beta to stable so that you
can move to using the stable version.

## More Information

- [Single Sign-On Guide](https://workos.com/docs/sso/guide)
- [Directory Sync Guide](https://workos.com/docs/directory-sync/guide)
- [User Management](https://workos.com/docs/user-management/guide)
- [Admin Portal Guide](https://workos.com/docs/admin-portal/guide)
- [Magic Link Guide](https://workos.com/docs/magic-link/guide)
11 changes: 11 additions & 0 deletions src/main/kotlin/com/workos/WorkOS.kt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import com.workos.organizations.OrganizationsApi
import com.workos.passwordless.PasswordlessApi
import com.workos.portal.PortalApi
import com.workos.sso.SsoApi
import com.workos.usermanagement.UserManagementApi
import com.workos.webhooks.WebhooksApi
import org.apache.http.client.utils.URIBuilder
import java.lang.IllegalArgumentException
Expand Down Expand Up @@ -95,6 +96,12 @@ class WorkOS(
@JvmField
val mfa = MfaApi(this)

/**
* Module for interacting with the User Management API.
*/
@JvmField
val userManagement = UserManagementApi(this)

/**
* Module for interacting with the Webhooks API.
*/
Expand Down Expand Up @@ -255,17 +262,21 @@ class WorkOS(
val responseData = mapper.readValue(payload, BadRequestExceptionResponse::class.java)
throw BadRequestException(responseData.message, responseData.code, responseData.errors, requestId)
}

401 -> {
val responseData = mapper.readValue(payload, GenericErrorResponse::class.java)
throw UnauthorizedException(responseData.message, requestId)
}

404 -> {
throw NotFoundException(response.url.path, requestId)
}

422 -> {
val unprocessableEntityException = mapper.readValue(payload, UnprocessableEntityExceptionResponse::class.java)
throw UnprocessableEntityException(unprocessableEntityException.message, unprocessableEntityException.code, unprocessableEntityException.errors, requestId)
}

else -> {
val responseData = mapper.readValue(payload, GenericErrorResponse::class.java)
throw GenericServerException(responseData.message, status, requestId)
Expand Down
Loading

0 comments on commit 1bf461f

Please sign in to comment.