Skip to content

Commit

Permalink
Added missing fields in LogEventClass (#698)
Browse files Browse the repository at this point in the history
  • Loading branch information
tanya732 authored Feb 19, 2025
1 parent 31216ec commit 285f957
Show file tree
Hide file tree
Showing 2 changed files with 108 additions and 2 deletions.
92 changes: 92 additions & 0 deletions src/main/java/com/auth0/json/mgmt/logevents/LogEvent.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,24 @@ public class LogEvent {
private String hostname;
@JsonProperty("audience")
private String audience;
@JsonProperty("scope")
private String scope;
@JsonProperty("strategy")
private String strategy;
@JsonProperty("strategy_type")
private String strategyType;
@JsonProperty("isMobile")
private boolean isMobile;
@JsonProperty("user_agent")
private String userAgent;
@JsonProperty("organization_id")
private String organizationId;
@JsonProperty("organization_name")
private String organizationName;
@JsonProperty("tenant_name")
private String tenantName;
@JsonProperty("$event_schema")
private Object eventSchema;

/**
* Getter for the id of this event.
Expand Down Expand Up @@ -131,6 +149,51 @@ public String getUserId() {
return userId;
}

/**
* Getter for the scope of this event.
* @return the scope.
*/
@JsonProperty("scope")
public String getScope() {
return scope;
}

/**
* Getter for the strategy of this event.
* @return the strategy.
*/
@JsonProperty("strategy")
public String getStrategy() {
return strategy;
}

/**
* Getter for the strategy type of this event.
* @return the strategy type.
*/
@JsonProperty("strategy_type")
public String getStrategyType() {
return strategyType;
}

/**
* Getter for the isMobile flag of this event.
* @return the isMobile flag.
*/
@JsonProperty("isMobile")
public boolean isMobile() {
return isMobile;
}

/**
* Getter for the user agent related to this event.
* @return the user agent.
*/
@JsonProperty("user_agent")
public String getUserAgent() {
return userAgent;
}

/**
* Getter for the user name related to this event.
*
Expand Down Expand Up @@ -195,4 +258,33 @@ public String getHostname() {
public String getAudience() {
return audience;
}

/**
* @return the organization ID.
*/
public String getOrganizationId() {
return organizationId;
}

/**
* @return the organization name.
*/
public String getOrganizationName() {
return organizationName;
}

/**
* @return the tenant name.
*/
public String getTenantName() {
return tenantName;
}

/**
* Getter for the event schema object.
* @return the event schema object.
*/
public Object getEventSchema() {
return eventSchema;
}
}
18 changes: 16 additions & 2 deletions src/test/java/com/auth0/json/mgmt/logevents/LogEventTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,16 @@ public class LogEventTest extends JsonTest<LogEvent> {
" \"connection_id\": \"connectionId\",\n" +
" \"description\": \"description\",\n" +
" \"hostname\": \"hostname\",\n" +
" \"audience\": \"audience\"\n" +
" \"audience\": \"audience\",\n" +
" \"organization_id\": \"org_1\",\n" +
" \"organization_name\": \"org2\",\n" +
" \"$event_schema\": {\n" +
" \"version\": \"1.0.0\"\n" +
" },\n" +
" \"tenant_name\": \"paid-testing\",\n" +
" \"audience\": \"audience\",\n" +
" \"isMobile\": \"false\",\n" +
" \"user_agent\": \"okhttp 4.11.0 / Other 0.0.0\"\n" +
"}";

@Test
Expand All @@ -49,6 +58,11 @@ public void shouldDeserialize() throws Exception {
assertThat(logEvent.getConnectionId(), is("connectionId"));
assertThat(logEvent.getHostname(), is("hostname"));
assertThat(logEvent.getDescription(), is("description"));

assertThat(logEvent.isMobile(), is(false));
assertThat(logEvent.getUserAgent(), is("okhttp 4.11.0 / Other 0.0.0"));
assertThat(logEvent.getOrganizationId(), is("org_1"));
assertThat(logEvent.getOrganizationName(), is("org2"));
assertThat(logEvent.getTenantName(), is("paid-testing"));
assertThat(logEvent.getEventSchema(), is(notNullValue()));
}
}

0 comments on commit 285f957

Please sign in to comment.