Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added missing fields in LogEventClass #698

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 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,16 @@ 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;

/**
* Getter for the id of this event.
Expand Down Expand Up @@ -131,6 +141,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
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ public class LogEventTest extends JsonTest<LogEvent> {
" \"connection_id\": \"connectionId\",\n" +
" \"description\": \"description\",\n" +
" \"hostname\": \"hostname\",\n" +
" \"audience\": \"audience\"\n" +
" \"audience\": \"audience\",\n" +
" \"isMobile\": \"false\",\n" +
" \"user_agent\": \"okhttp 4.11.0 / Other 0.0.0\"\n" +
"}";

@Test
Expand All @@ -49,6 +51,7 @@ 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"));
}
}
Loading