![JAR search and dependency download from the Maven repository](/logo.png)
com.finbourne.insights.model.AccessEvaluationLog Maven / Gradle / Ivy
/*
* FINBOURNE Insights API
*
* Contact: [email protected]
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package com.finbourne.insights.model;
import java.util.Objects;
import com.finbourne.insights.model.Link;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import java.io.IOException;
import java.time.OffsetDateTime;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.openapitools.jackson.nullable.JsonNullable;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import com.google.gson.TypeAdapter;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import java.io.IOException;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import com.finbourne.insights.JSON;
/**
* Holds logged information about an access check performed on an API.
*/
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class AccessEvaluationLog {
public static final String SERIALIZED_NAME_TIMESTAMP = "timestamp";
@SerializedName(SERIALIZED_NAME_TIMESTAMP)
private OffsetDateTime timestamp;
public static final String SERIALIZED_NAME_APPLICATION = "application";
@SerializedName(SERIALIZED_NAME_APPLICATION)
private String application;
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
private String id;
public static final String SERIALIZED_NAME_REQUEST_ID = "requestId";
@SerializedName(SERIALIZED_NAME_REQUEST_ID)
private String requestId;
public static final String SERIALIZED_NAME_SESSION_ID = "sessionId";
@SerializedName(SERIALIZED_NAME_SESSION_ID)
private String sessionId;
public static final String SERIALIZED_NAME_USER = "user";
@SerializedName(SERIALIZED_NAME_USER)
private String user;
public static final String SERIALIZED_NAME_USER_TYPE = "userType";
@SerializedName(SERIALIZED_NAME_USER_TYPE)
private String userType;
public static final String SERIALIZED_NAME_DURATION = "duration";
@SerializedName(SERIALIZED_NAME_DURATION)
private java.math.BigDecimal duration;
public static final String SERIALIZED_NAME_RESULT = "result";
@SerializedName(SERIALIZED_NAME_RESULT)
private String result;
public static final String SERIALIZED_NAME_AUTHORITATIVE_ROLE_ID = "authoritativeRoleId";
@SerializedName(SERIALIZED_NAME_AUTHORITATIVE_ROLE_ID)
private String authoritativeRoleId;
public static final String SERIALIZED_NAME_AUTHORITATIVE_POLICY_ID = "authoritativePolicyId";
@SerializedName(SERIALIZED_NAME_AUTHORITATIVE_POLICY_ID)
private String authoritativePolicyId;
public static final String SERIALIZED_NAME_AUTHORITATIVE_SELECTOR = "authoritativeSelector";
@SerializedName(SERIALIZED_NAME_AUTHORITATIVE_SELECTOR)
private String authoritativeSelector;
public static final String SERIALIZED_NAME_RESOURCE_TYPE = "resourceType";
@SerializedName(SERIALIZED_NAME_RESOURCE_TYPE)
private String resourceType;
public static final String SERIALIZED_NAME_ACTION = "action";
@SerializedName(SERIALIZED_NAME_ACTION)
private String action;
public static final String SERIALIZED_NAME_RESOURCE = "resource";
@SerializedName(SERIALIZED_NAME_RESOURCE)
private Map resource;
public static final String SERIALIZED_NAME_RESOURCE_FROM_EFFECTIVE_DATE = "resourceFromEffectiveDate";
@SerializedName(SERIALIZED_NAME_RESOURCE_FROM_EFFECTIVE_DATE)
private String resourceFromEffectiveDate;
public static final String SERIALIZED_NAME_RESOURCE_TO_EFFECTIVE_DATE = "resourceToEffectiveDate";
@SerializedName(SERIALIZED_NAME_RESOURCE_TO_EFFECTIVE_DATE)
private String resourceToEffectiveDate;
public static final String SERIALIZED_NAME_RESOURCE_FROM_AS_AT = "resourceFromAsAt";
@SerializedName(SERIALIZED_NAME_RESOURCE_FROM_AS_AT)
private String resourceFromAsAt;
public static final String SERIALIZED_NAME_RESOURCE_TO_AS_AT = "resourceToAsAt";
@SerializedName(SERIALIZED_NAME_RESOURCE_TO_AS_AT)
private String resourceToAsAt;
public static final String SERIALIZED_NAME_ACCESS_EXECUTION_TIME = "accessExecutionTime";
@SerializedName(SERIALIZED_NAME_ACCESS_EXECUTION_TIME)
private String accessExecutionTime;
public static final String SERIALIZED_NAME_ACCESS_AS_AT_TIME = "accessAsAtTime";
@SerializedName(SERIALIZED_NAME_ACCESS_AS_AT_TIME)
private String accessAsAtTime;
public static final String SERIALIZED_NAME_REQUIRED_LICENCE_POLICY_ID = "requiredLicencePolicyId";
@SerializedName(SERIALIZED_NAME_REQUIRED_LICENCE_POLICY_ID)
private String requiredLicencePolicyId;
public static final String SERIALIZED_NAME_LINKS = "links";
@SerializedName(SERIALIZED_NAME_LINKS)
private List links;
public AccessEvaluationLog() {
}
public AccessEvaluationLog timestamp(OffsetDateTime timestamp) {
this.timestamp = timestamp;
return this;
}
/**
* The timestamp of the access evaluation.
* @return timestamp
**/
@jakarta.annotation.Nonnull
public OffsetDateTime getTimestamp() {
return timestamp;
}
public void setTimestamp(OffsetDateTime timestamp) {
this.timestamp = timestamp;
}
public AccessEvaluationLog application(String application) {
this.application = application;
return this;
}
/**
* The name of the application that the request was made from.
* @return application
**/
@jakarta.annotation.Nonnull
public String getApplication() {
return application;
}
public void setApplication(String application) {
this.application = application;
}
public AccessEvaluationLog id(String id) {
this.id = id;
return this;
}
/**
* The ID of the access evaluation.
* @return id
**/
@jakarta.annotation.Nonnull
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public AccessEvaluationLog requestId(String requestId) {
this.requestId = requestId;
return this;
}
/**
* The identifier of the request.
* @return requestId
**/
@jakarta.annotation.Nullable
public String getRequestId() {
return requestId;
}
public void setRequestId(String requestId) {
this.requestId = requestId;
}
public AccessEvaluationLog sessionId(String sessionId) {
this.sessionId = sessionId;
return this;
}
/**
* The identifier of the session that the request was made in.
* @return sessionId
**/
@jakarta.annotation.Nullable
public String getSessionId() {
return sessionId;
}
public void setSessionId(String sessionId) {
this.sessionId = sessionId;
}
public AccessEvaluationLog user(String user) {
this.user = user;
return this;
}
/**
* The user who made the request.
* @return user
**/
@jakarta.annotation.Nonnull
public String getUser() {
return user;
}
public void setUser(String user) {
this.user = user;
}
public AccessEvaluationLog userType(String userType) {
this.userType = userType;
return this;
}
/**
* The type of the user who made the request.
* @return userType
**/
@jakarta.annotation.Nullable
public String getUserType() {
return userType;
}
public void setUserType(String userType) {
this.userType = userType;
}
public AccessEvaluationLog duration(java.math.BigDecimal duration) {
this.duration = duration;
return this;
}
/**
* The duration of the access evaluation.
* @return duration
**/
@jakarta.annotation.Nonnull
public java.math.BigDecimal getDuration() {
return duration;
}
public void setDuration(java.math.BigDecimal duration) {
this.duration = duration;
}
public AccessEvaluationLog result(String result) {
this.result = result;
return this;
}
/**
* The result of the access evaluation.
* @return result
**/
@jakarta.annotation.Nullable
public String getResult() {
return result;
}
public void setResult(String result) {
this.result = result;
}
public AccessEvaluationLog authoritativeRoleId(String authoritativeRoleId) {
this.authoritativeRoleId = authoritativeRoleId;
return this;
}
/**
* The role that matched the access evaluation to provide a result.
* @return authoritativeRoleId
**/
@jakarta.annotation.Nullable
public String getAuthoritativeRoleId() {
return authoritativeRoleId;
}
public void setAuthoritativeRoleId(String authoritativeRoleId) {
this.authoritativeRoleId = authoritativeRoleId;
}
public AccessEvaluationLog authoritativePolicyId(String authoritativePolicyId) {
this.authoritativePolicyId = authoritativePolicyId;
return this;
}
/**
* The policy that matched the access evaluation to provide a result.
* @return authoritativePolicyId
**/
@jakarta.annotation.Nullable
public String getAuthoritativePolicyId() {
return authoritativePolicyId;
}
public void setAuthoritativePolicyId(String authoritativePolicyId) {
this.authoritativePolicyId = authoritativePolicyId;
}
public AccessEvaluationLog authoritativeSelector(String authoritativeSelector) {
this.authoritativeSelector = authoritativeSelector;
return this;
}
/**
* The selector that matched the access evaluation to provide a result.
* @return authoritativeSelector
**/
@jakarta.annotation.Nullable
public String getAuthoritativeSelector() {
return authoritativeSelector;
}
public void setAuthoritativeSelector(String authoritativeSelector) {
this.authoritativeSelector = authoritativeSelector;
}
public AccessEvaluationLog resourceType(String resourceType) {
this.resourceType = resourceType;
return this;
}
/**
* The type of the resource that the access evaluation is for.
* @return resourceType
**/
@jakarta.annotation.Nullable
public String getResourceType() {
return resourceType;
}
public void setResourceType(String resourceType) {
this.resourceType = resourceType;
}
public AccessEvaluationLog action(String action) {
this.action = action;
return this;
}
/**
* The action key of the access evaluation.
* @return action
**/
@jakarta.annotation.Nullable
public String getAction() {
return action;
}
public void setAction(String action) {
this.action = action;
}
public AccessEvaluationLog resource(Map resource) {
this.resource = resource;
return this;
}
public AccessEvaluationLog putResourceItem(String key, String resourceItem) {
if (this.resource == null) {
this.resource = new HashMap<>();
}
this.resource.put(key, resourceItem);
return this;
}
/**
* The ID of the resource that the access evaluation is for. If the ResourceID could not be converted to a dictionary, it will return a single-value dictionary with the key \"resourceId\".
* @return resource
**/
@jakarta.annotation.Nullable
public Map getResource() {
return resource;
}
public void setResource(Map resource) {
this.resource = resource;
}
public AccessEvaluationLog resourceFromEffectiveDate(String resourceFromEffectiveDate) {
this.resourceFromEffectiveDate = resourceFromEffectiveDate;
return this;
}
/**
* The From effective date of the resource.
* @return resourceFromEffectiveDate
**/
@jakarta.annotation.Nullable
public String getResourceFromEffectiveDate() {
return resourceFromEffectiveDate;
}
public void setResourceFromEffectiveDate(String resourceFromEffectiveDate) {
this.resourceFromEffectiveDate = resourceFromEffectiveDate;
}
public AccessEvaluationLog resourceToEffectiveDate(String resourceToEffectiveDate) {
this.resourceToEffectiveDate = resourceToEffectiveDate;
return this;
}
/**
* The To effective date of the resource.
* @return resourceToEffectiveDate
**/
@jakarta.annotation.Nullable
public String getResourceToEffectiveDate() {
return resourceToEffectiveDate;
}
public void setResourceToEffectiveDate(String resourceToEffectiveDate) {
this.resourceToEffectiveDate = resourceToEffectiveDate;
}
public AccessEvaluationLog resourceFromAsAt(String resourceFromAsAt) {
this.resourceFromAsAt = resourceFromAsAt;
return this;
}
/**
* The From AsAt date of the resource.
* @return resourceFromAsAt
**/
@jakarta.annotation.Nullable
public String getResourceFromAsAt() {
return resourceFromAsAt;
}
public void setResourceFromAsAt(String resourceFromAsAt) {
this.resourceFromAsAt = resourceFromAsAt;
}
public AccessEvaluationLog resourceToAsAt(String resourceToAsAt) {
this.resourceToAsAt = resourceToAsAt;
return this;
}
/**
* The To AsAt date of the resource.
* @return resourceToAsAt
**/
@jakarta.annotation.Nullable
public String getResourceToAsAt() {
return resourceToAsAt;
}
public void setResourceToAsAt(String resourceToAsAt) {
this.resourceToAsAt = resourceToAsAt;
}
public AccessEvaluationLog accessExecutionTime(String accessExecutionTime) {
this.accessExecutionTime = accessExecutionTime;
return this;
}
/**
* The execution time of the entitlement.
* @return accessExecutionTime
**/
@jakarta.annotation.Nullable
public String getAccessExecutionTime() {
return accessExecutionTime;
}
public void setAccessExecutionTime(String accessExecutionTime) {
this.accessExecutionTime = accessExecutionTime;
}
public AccessEvaluationLog accessAsAtTime(String accessAsAtTime) {
this.accessAsAtTime = accessAsAtTime;
return this;
}
/**
* The AsAt time of the entitlement.
* @return accessAsAtTime
**/
@jakarta.annotation.Nullable
public String getAccessAsAtTime() {
return accessAsAtTime;
}
public void setAccessAsAtTime(String accessAsAtTime) {
this.accessAsAtTime = accessAsAtTime;
}
public AccessEvaluationLog requiredLicencePolicyId(String requiredLicencePolicyId) {
this.requiredLicencePolicyId = requiredLicencePolicyId;
return this;
}
/**
* ID of the required licence policy.
* @return requiredLicencePolicyId
**/
@jakarta.annotation.Nullable
public String getRequiredLicencePolicyId() {
return requiredLicencePolicyId;
}
public void setRequiredLicencePolicyId(String requiredLicencePolicyId) {
this.requiredLicencePolicyId = requiredLicencePolicyId;
}
public AccessEvaluationLog links(List links) {
this.links = links;
return this;
}
public AccessEvaluationLog addLinksItem(Link linksItem) {
if (this.links == null) {
this.links = new ArrayList<>();
}
this.links.add(linksItem);
return this;
}
/**
* Get links
* @return links
**/
@jakarta.annotation.Nullable
public List getLinks() {
return links;
}
public void setLinks(List links) {
this.links = links;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
AccessEvaluationLog accessEvaluationLog = (AccessEvaluationLog) o;
return Objects.equals(this.timestamp, accessEvaluationLog.timestamp) &&
Objects.equals(this.application, accessEvaluationLog.application) &&
Objects.equals(this.id, accessEvaluationLog.id) &&
Objects.equals(this.requestId, accessEvaluationLog.requestId) &&
Objects.equals(this.sessionId, accessEvaluationLog.sessionId) &&
Objects.equals(this.user, accessEvaluationLog.user) &&
Objects.equals(this.userType, accessEvaluationLog.userType) &&
(this.duration.compareTo(accessEvaluationLog.getDuration()) == 0) &&
Objects.equals(this.result, accessEvaluationLog.result) &&
Objects.equals(this.authoritativeRoleId, accessEvaluationLog.authoritativeRoleId) &&
Objects.equals(this.authoritativePolicyId, accessEvaluationLog.authoritativePolicyId) &&
Objects.equals(this.authoritativeSelector, accessEvaluationLog.authoritativeSelector) &&
Objects.equals(this.resourceType, accessEvaluationLog.resourceType) &&
Objects.equals(this.action, accessEvaluationLog.action) &&
Objects.equals(this.resource, accessEvaluationLog.resource) &&
Objects.equals(this.resourceFromEffectiveDate, accessEvaluationLog.resourceFromEffectiveDate) &&
Objects.equals(this.resourceToEffectiveDate, accessEvaluationLog.resourceToEffectiveDate) &&
Objects.equals(this.resourceFromAsAt, accessEvaluationLog.resourceFromAsAt) &&
Objects.equals(this.resourceToAsAt, accessEvaluationLog.resourceToAsAt) &&
Objects.equals(this.accessExecutionTime, accessEvaluationLog.accessExecutionTime) &&
Objects.equals(this.accessAsAtTime, accessEvaluationLog.accessAsAtTime) &&
Objects.equals(this.requiredLicencePolicyId, accessEvaluationLog.requiredLicencePolicyId) &&
Objects.equals(this.links, accessEvaluationLog.links);
}
private static boolean equalsNullable(JsonNullable a, JsonNullable b) {
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
}
@Override
public int hashCode() {
return Objects.hash(timestamp, application, id, requestId, sessionId, user, userType, duration, result, authoritativeRoleId, authoritativePolicyId, authoritativeSelector, resourceType, action, resource, resourceFromEffectiveDate, resourceToEffectiveDate, resourceFromAsAt, resourceToAsAt, accessExecutionTime, accessAsAtTime, requiredLicencePolicyId, links);
}
private static int hashCodeNullable(JsonNullable a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class AccessEvaluationLog {\n");
sb.append(" timestamp: ").append(toIndentedString(timestamp)).append("\n");
sb.append(" application: ").append(toIndentedString(application)).append("\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" requestId: ").append(toIndentedString(requestId)).append("\n");
sb.append(" sessionId: ").append(toIndentedString(sessionId)).append("\n");
sb.append(" user: ").append(toIndentedString(user)).append("\n");
sb.append(" userType: ").append(toIndentedString(userType)).append("\n");
sb.append(" duration: ").append(toIndentedString(duration)).append("\n");
sb.append(" result: ").append(toIndentedString(result)).append("\n");
sb.append(" authoritativeRoleId: ").append(toIndentedString(authoritativeRoleId)).append("\n");
sb.append(" authoritativePolicyId: ").append(toIndentedString(authoritativePolicyId)).append("\n");
sb.append(" authoritativeSelector: ").append(toIndentedString(authoritativeSelector)).append("\n");
sb.append(" resourceType: ").append(toIndentedString(resourceType)).append("\n");
sb.append(" action: ").append(toIndentedString(action)).append("\n");
sb.append(" resource: ").append(toIndentedString(resource)).append("\n");
sb.append(" resourceFromEffectiveDate: ").append(toIndentedString(resourceFromEffectiveDate)).append("\n");
sb.append(" resourceToEffectiveDate: ").append(toIndentedString(resourceToEffectiveDate)).append("\n");
sb.append(" resourceFromAsAt: ").append(toIndentedString(resourceFromAsAt)).append("\n");
sb.append(" resourceToAsAt: ").append(toIndentedString(resourceToAsAt)).append("\n");
sb.append(" accessExecutionTime: ").append(toIndentedString(accessExecutionTime)).append("\n");
sb.append(" accessAsAtTime: ").append(toIndentedString(accessAsAtTime)).append("\n");
sb.append(" requiredLicencePolicyId: ").append(toIndentedString(requiredLicencePolicyId)).append("\n");
sb.append(" links: ").append(toIndentedString(links)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
public static HashSet openapiFields;
public static HashSet openapiRequiredFields;
static {
// a set of all properties/fields (JSON key names)
openapiFields = new HashSet();
openapiFields.add("timestamp");
openapiFields.add("application");
openapiFields.add("id");
openapiFields.add("requestId");
openapiFields.add("sessionId");
openapiFields.add("user");
openapiFields.add("userType");
openapiFields.add("duration");
openapiFields.add("result");
openapiFields.add("authoritativeRoleId");
openapiFields.add("authoritativePolicyId");
openapiFields.add("authoritativeSelector");
openapiFields.add("resourceType");
openapiFields.add("action");
openapiFields.add("resource");
openapiFields.add("resourceFromEffectiveDate");
openapiFields.add("resourceToEffectiveDate");
openapiFields.add("resourceFromAsAt");
openapiFields.add("resourceToAsAt");
openapiFields.add("accessExecutionTime");
openapiFields.add("accessAsAtTime");
openapiFields.add("requiredLicencePolicyId");
openapiFields.add("links");
// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet();
openapiRequiredFields.add("timestamp");
openapiRequiredFields.add("application");
openapiRequiredFields.add("id");
openapiRequiredFields.add("user");
openapiRequiredFields.add("duration");
}
/**
* Validates the JSON Element and throws an exception if issues found
*
* @param jsonElement JSON Element
* @throws IOException if the JSON Element is invalid with respect to AccessEvaluationLog
*/
public static void validateJsonElement(JsonElement jsonElement) throws IOException {
if (jsonElement == null) {
if (!AccessEvaluationLog.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null
throw new IllegalArgumentException(String.format("The required field(s) %s in AccessEvaluationLog is not found in the empty JSON string", AccessEvaluationLog.openapiRequiredFields.toString()));
}
}
// check to make sure all required properties/fields are present in the JSON string
for (String requiredField : AccessEvaluationLog.openapiRequiredFields) {
if (jsonElement.getAsJsonObject().get(requiredField) == null) {
throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString()));
}
}
JsonObject jsonObj = jsonElement.getAsJsonObject();
if (!jsonObj.get("application").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `application` to be a primitive type in the JSON string but got `%s`", jsonObj.get("application").toString()));
}
if (!jsonObj.get("id").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString()));
}
if ((jsonObj.get("requestId") != null && !jsonObj.get("requestId").isJsonNull()) && !jsonObj.get("requestId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `requestId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestId").toString()));
}
if ((jsonObj.get("sessionId") != null && !jsonObj.get("sessionId").isJsonNull()) && !jsonObj.get("sessionId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `sessionId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sessionId").toString()));
}
if (!jsonObj.get("user").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `user` to be a primitive type in the JSON string but got `%s`", jsonObj.get("user").toString()));
}
if ((jsonObj.get("userType") != null && !jsonObj.get("userType").isJsonNull()) && !jsonObj.get("userType").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `userType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userType").toString()));
}
if ((jsonObj.get("result") != null && !jsonObj.get("result").isJsonNull()) && !jsonObj.get("result").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `result` to be a primitive type in the JSON string but got `%s`", jsonObj.get("result").toString()));
}
if ((jsonObj.get("authoritativeRoleId") != null && !jsonObj.get("authoritativeRoleId").isJsonNull()) && !jsonObj.get("authoritativeRoleId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `authoritativeRoleId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("authoritativeRoleId").toString()));
}
if ((jsonObj.get("authoritativePolicyId") != null && !jsonObj.get("authoritativePolicyId").isJsonNull()) && !jsonObj.get("authoritativePolicyId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `authoritativePolicyId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("authoritativePolicyId").toString()));
}
if ((jsonObj.get("authoritativeSelector") != null && !jsonObj.get("authoritativeSelector").isJsonNull()) && !jsonObj.get("authoritativeSelector").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `authoritativeSelector` to be a primitive type in the JSON string but got `%s`", jsonObj.get("authoritativeSelector").toString()));
}
if ((jsonObj.get("resourceType") != null && !jsonObj.get("resourceType").isJsonNull()) && !jsonObj.get("resourceType").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `resourceType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("resourceType").toString()));
}
if ((jsonObj.get("action") != null && !jsonObj.get("action").isJsonNull()) && !jsonObj.get("action").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `action` to be a primitive type in the JSON string but got `%s`", jsonObj.get("action").toString()));
}
if ((jsonObj.get("resourceFromEffectiveDate") != null && !jsonObj.get("resourceFromEffectiveDate").isJsonNull()) && !jsonObj.get("resourceFromEffectiveDate").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `resourceFromEffectiveDate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("resourceFromEffectiveDate").toString()));
}
if ((jsonObj.get("resourceToEffectiveDate") != null && !jsonObj.get("resourceToEffectiveDate").isJsonNull()) && !jsonObj.get("resourceToEffectiveDate").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `resourceToEffectiveDate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("resourceToEffectiveDate").toString()));
}
if ((jsonObj.get("resourceFromAsAt") != null && !jsonObj.get("resourceFromAsAt").isJsonNull()) && !jsonObj.get("resourceFromAsAt").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `resourceFromAsAt` to be a primitive type in the JSON string but got `%s`", jsonObj.get("resourceFromAsAt").toString()));
}
if ((jsonObj.get("resourceToAsAt") != null && !jsonObj.get("resourceToAsAt").isJsonNull()) && !jsonObj.get("resourceToAsAt").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `resourceToAsAt` to be a primitive type in the JSON string but got `%s`", jsonObj.get("resourceToAsAt").toString()));
}
if ((jsonObj.get("accessExecutionTime") != null && !jsonObj.get("accessExecutionTime").isJsonNull()) && !jsonObj.get("accessExecutionTime").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `accessExecutionTime` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accessExecutionTime").toString()));
}
if ((jsonObj.get("accessAsAtTime") != null && !jsonObj.get("accessAsAtTime").isJsonNull()) && !jsonObj.get("accessAsAtTime").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `accessAsAtTime` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accessAsAtTime").toString()));
}
if ((jsonObj.get("requiredLicencePolicyId") != null && !jsonObj.get("requiredLicencePolicyId").isJsonNull()) && !jsonObj.get("requiredLicencePolicyId").isJsonPrimitive()) {
throw new IllegalArgumentException(String.format("Expected the field `requiredLicencePolicyId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requiredLicencePolicyId").toString()));
}
if (jsonObj.get("links") != null && !jsonObj.get("links").isJsonNull()) {
JsonArray jsonArraylinks = jsonObj.getAsJsonArray("links");
if (jsonArraylinks != null) {
// ensure the json data is an array
if (!jsonObj.get("links").isJsonArray()) {
throw new IllegalArgumentException(String.format("Expected the field `links` to be an array in the JSON string but got `%s`", jsonObj.get("links").toString()));
}
// validate the optional field `links` (array)
for (int i = 0; i < jsonArraylinks.size(); i++) {
Link.validateJsonElement(jsonArraylinks.get(i));
};
}
}
}
public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public TypeAdapter create(Gson gson, TypeToken type) {
if (!AccessEvaluationLog.class.isAssignableFrom(type.getRawType())) {
return null; // this class only serializes 'AccessEvaluationLog' and its subtypes
}
final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class);
final TypeAdapter thisAdapter
= gson.getDelegateAdapter(this, TypeToken.get(AccessEvaluationLog.class));
return (TypeAdapter) new TypeAdapter() {
@Override
public void write(JsonWriter out, AccessEvaluationLog value) throws IOException {
JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
elementAdapter.write(out, obj);
}
@Override
public AccessEvaluationLog read(JsonReader in) throws IOException {
JsonElement jsonElement = elementAdapter.read(in);
validateJsonElement(jsonElement);
return thisAdapter.fromJsonTree(jsonElement);
}
}.nullSafe();
}
}
/**
* Create an instance of AccessEvaluationLog given an JSON string
*
* @param jsonString JSON string
* @return An instance of AccessEvaluationLog
* @throws IOException if the JSON string is invalid with respect to AccessEvaluationLog
*/
public static AccessEvaluationLog fromJson(String jsonString) throws IOException {
return JSON.getGson().fromJson(jsonString, AccessEvaluationLog.class);
}
/**
* Convert an instance of AccessEvaluationLog to an JSON string
*
* @return JSON string
*/
public String toJson() {
return JSON.getGson().toJson(this);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy