Skip to content

Commit 285f957

Browse files
authored
Added missing fields in LogEventClass (#698)
1 parent 31216ec commit 285f957

2 files changed

Lines changed: 108 additions & 2 deletions

File tree

src/main/java/com/auth0/json/mgmt/logevents/LogEvent.java

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,24 @@ public class LogEvent {
4949
private String hostname;
5050
@JsonProperty("audience")
5151
private String audience;
52+
@JsonProperty("scope")
53+
private String scope;
54+
@JsonProperty("strategy")
55+
private String strategy;
56+
@JsonProperty("strategy_type")
57+
private String strategyType;
58+
@JsonProperty("isMobile")
59+
private boolean isMobile;
60+
@JsonProperty("user_agent")
61+
private String userAgent;
62+
@JsonProperty("organization_id")
63+
private String organizationId;
64+
@JsonProperty("organization_name")
65+
private String organizationName;
66+
@JsonProperty("tenant_name")
67+
private String tenantName;
68+
@JsonProperty("$event_schema")
69+
private Object eventSchema;
5270

5371
/**
5472
* Getter for the id of this event.
@@ -131,6 +149,51 @@ public String getUserId() {
131149
return userId;
132150
}
133151

152+
/**
153+
* Getter for the scope of this event.
154+
* @return the scope.
155+
*/
156+
@JsonProperty("scope")
157+
public String getScope() {
158+
return scope;
159+
}
160+
161+
/**
162+
* Getter for the strategy of this event.
163+
* @return the strategy.
164+
*/
165+
@JsonProperty("strategy")
166+
public String getStrategy() {
167+
return strategy;
168+
}
169+
170+
/**
171+
* Getter for the strategy type of this event.
172+
* @return the strategy type.
173+
*/
174+
@JsonProperty("strategy_type")
175+
public String getStrategyType() {
176+
return strategyType;
177+
}
178+
179+
/**
180+
* Getter for the isMobile flag of this event.
181+
* @return the isMobile flag.
182+
*/
183+
@JsonProperty("isMobile")
184+
public boolean isMobile() {
185+
return isMobile;
186+
}
187+
188+
/**
189+
* Getter for the user agent related to this event.
190+
* @return the user agent.
191+
*/
192+
@JsonProperty("user_agent")
193+
public String getUserAgent() {
194+
return userAgent;
195+
}
196+
134197
/**
135198
* Getter for the user name related to this event.
136199
*
@@ -195,4 +258,33 @@ public String getHostname() {
195258
public String getAudience() {
196259
return audience;
197260
}
261+
262+
/**
263+
* @return the organization ID.
264+
*/
265+
public String getOrganizationId() {
266+
return organizationId;
267+
}
268+
269+
/**
270+
* @return the organization name.
271+
*/
272+
public String getOrganizationName() {
273+
return organizationName;
274+
}
275+
276+
/**
277+
* @return the tenant name.
278+
*/
279+
public String getTenantName() {
280+
return tenantName;
281+
}
282+
283+
/**
284+
* Getter for the event schema object.
285+
* @return the event schema object.
286+
*/
287+
public Object getEventSchema() {
288+
return eventSchema;
289+
}
198290
}

src/test/java/com/auth0/json/mgmt/logevents/LogEventTest.java

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,16 @@ public class LogEventTest extends JsonTest<LogEvent> {
2525
" \"connection_id\": \"connectionId\",\n" +
2626
" \"description\": \"description\",\n" +
2727
" \"hostname\": \"hostname\",\n" +
28-
" \"audience\": \"audience\"\n" +
28+
" \"audience\": \"audience\",\n" +
29+
" \"organization_id\": \"org_1\",\n" +
30+
" \"organization_name\": \"org2\",\n" +
31+
" \"$event_schema\": {\n" +
32+
" \"version\": \"1.0.0\"\n" +
33+
" },\n" +
34+
" \"tenant_name\": \"paid-testing\",\n" +
35+
" \"audience\": \"audience\",\n" +
36+
" \"isMobile\": \"false\",\n" +
37+
" \"user_agent\": \"okhttp 4.11.0 / Other 0.0.0\"\n" +
2938
"}";
3039

3140
@Test
@@ -49,6 +58,11 @@ public void shouldDeserialize() throws Exception {
4958
assertThat(logEvent.getConnectionId(), is("connectionId"));
5059
assertThat(logEvent.getHostname(), is("hostname"));
5160
assertThat(logEvent.getDescription(), is("description"));
52-
61+
assertThat(logEvent.isMobile(), is(false));
62+
assertThat(logEvent.getUserAgent(), is("okhttp 4.11.0 / Other 0.0.0"));
63+
assertThat(logEvent.getOrganizationId(), is("org_1"));
64+
assertThat(logEvent.getOrganizationName(), is("org2"));
65+
assertThat(logEvent.getTenantName(), is("paid-testing"));
66+
assertThat(logEvent.getEventSchema(), is(notNullValue()));
5367
}
5468
}

0 commit comments

Comments
 (0)