API Documentation ----------------- The documentation for the SwiftyRx can be found at https://acme.swiftyrx.dev/api/ui/ Client Installation ------------------- The clients are not yet published to Maven. They will be soon. Example Usage ------------- Authorization ~~~~~~~~~~~~~ .. code-block:: java :linenos: :caption: SwiftyOAuthApiWrapper.java import com.rxfoundry.clients.swifty_oauth.ApiClient; import com.rxfoundry.clients.swifty_oauth.ApiException; import com.rxfoundry.clients.swifty_oauth.Configuration; import com.rxfoundry.clients.swifty_oauth.api.OAuthApi; import com.rxfoundry.clients.swifty_oauth.model.GetTokenRequest; import com.rxfoundry.clients.swifty_oauth.model.TokenResponse; public class SwiftyOAuthApiWrapper { String host; String scheme; String port; public SwiftyOAuthApiWrapper(String host, String scheme, String port) { this.host = host; this.scheme = scheme; this.port = port; } public TokenResponse getAuthorizationToken(String username, String password){ // getting Authorization Token ApiClient defaultClient = Configuration.getDefaultApiClient(); try { defaultClient.setHost(this.host); defaultClient.setPort(Integer.parseInt(this.port)); defaultClient.setScheme(this.scheme); OAuthApi apiInstance = new OAuthApi(defaultClient); GetTokenRequest getTokenRequest = new GetTokenRequest().username(username).password(password).grantType("password"); TokenResponse result = apiInstance.getToken(getTokenRequest); System.out.println(result); return result; } catch (ApiException e) { System.err.println("Exception when calling OAuthApi#getToken"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); throw new RuntimeException("Failed to authorize to API", e); } catch (NumberFormatException e) { throw new RuntimeException("Port needs to be a valid integer", e); } } } Full Example ~~~~~~~~~~~~ A more complete example of using the Java SDK is forthcoming.