Comments (3)
Hey @AlainODea!
We are not likely to implement the Events API in the new SDKs as this endpoint is being replaced by the Logs API. It will be a while before this effect any apps in production (See the noticed on https://developer.okta.com/docs/api/resources/events):
However, the workaround looks something like this
client.getDataStore().getResource("/api/v1/events", EventsList.class).stream()
.forEach(event -> {
System.out.println(event);
});
and your resource classes:
public class Event extends AbstractResource {
public Event(InternalDataStore dataStore) {
super(dataStore);
}
public Event(InternalDataStore dataStore, Map<String, Object> properties) {
super(dataStore, properties);
}
@Override
public Map<String, Property> getPropertyDescriptors() {
return createPropertyDescriptorMap();
}
}
public class EventsList extends AbstractCollectionResource<Event> {
private static final ArrayProperty<Event> ITEMS = new ArrayProperty<>("items", Event.class);
public EventsList(InternalDataStore dataStore) {
super(dataStore);
}
public EventsList(InternalDataStore dataStore, Map<String, Object> properties) {
super(dataStore, properties);
}
public EventsList(InternalDataStore dataStore, Map<String, Object> properties, Map<String, Object> queryParams) {
super(dataStore, properties, queryParams);
}
@Override
public Map<String, Property> getPropertyDescriptors() {
return createPropertyDescriptorMap(ITEMS);
}
@Override
protected Class<Event> getItemType() {
return Event.class;
}
}
Since, many of the current endpoints were generated, we didn't notice there is some code that could be be moved up into a parent class (getItemType
, getPropertyDescriptors
of the CollectionResource) opened: #183
One downside is this requires a compile dependency on the okta-sdk-impl
module (not the end of the world, but worth pointing out)
And in my example the Event
Object must be treated as a map, this was done to keep the example brief, but you could implement typed getters for the values you expected.
I'm going to close this issue, but your feedback is welcome on this suggestion!
from okta-sdk-java.
@bdemers this is the logging API we are using in production. We can't migrate to the new style of SDK until this is in it.
from okta-sdk-java.
Thank you very much for the detailed workaround, @bdemers. I’ll give that a shot!
from okta-sdk-java.
Related Issues (20)
- Cannot update profile with array properties returned by user API HOT 7
- Add a way to get a PasswordPolicy without calling invokeApi manually. HOT 4
- Set Application Visibility is not functioning HOT 2
- Make openapi-generator deps as an Optional HOT 2
- Auto pagination causes throttling & memory problems for large result sets HOT 2
- GetFactorType() returning IllegalArgumentException HOT 10
- setCity method in the UserBuilder API sets the employeeNumber HOT 1
- Cannot get application subclass using ApplicationApi in 10.3 HOT 8
- GroupApi listGroupsWithPaginationInfo fails when q is specified HOT 2
- PolicyAPI listPolicies is not returning the conditions and settings attributes HOT 3
- DefaultClientBuilder can not be initialised if proxy does not have username HOT 1
- Support PRIVATE_KEY authorization mode with external JWT signing HOT 2
- ApiClient does not get a new access token when it expired. HOT 1
- Bring back Pagination in v11.0.0 HOT 3
- AccessTokenRetrieverServiceImpl.getOAuth2AccessToken throws "IllegalArgumentException: Illegal character in query" when more than one scope is present HOT 4
- Exceptions should be unchecked in v11 and return a structured Error HOT 3
- Auto-refresh authentication when working with private key HOT 2
- Make ApiClient's http client more customizable
- Cannot get "after" value from paginated response in v11. HOT 2
- Make model objects implement `java.io.Serializable`. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from okta-sdk-java.