odata.msgraph.client.beta.entity.DirectoryAudit Maven / Gradle / Ivy
Show all versions of odata-client-msgraph-beta Show documentation
package odata.msgraph.client.beta.entity;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.github.davidmoten.odata.client.ClientException;
import com.github.davidmoten.odata.client.CollectionPage;
import com.github.davidmoten.odata.client.HttpRequestOptions;
import com.github.davidmoten.odata.client.NameValue;
import com.github.davidmoten.odata.client.ODataEntityType;
import com.github.davidmoten.odata.client.RequestOptions;
import com.github.davidmoten.odata.client.UnmappedFields;
import com.github.davidmoten.odata.client.Util;
import com.github.davidmoten.odata.client.annotation.Property;
import com.github.davidmoten.odata.client.internal.ChangedFields;
import com.github.davidmoten.odata.client.internal.RequestHelper;
import com.github.davidmoten.odata.client.internal.UnmappedFieldsImpl;
import java.lang.Object;
import java.lang.Override;
import java.lang.String;
import java.lang.StringBuilder;
import java.time.OffsetDateTime;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
import odata.msgraph.client.beta.complex.AuditActivityInitiator;
import odata.msgraph.client.beta.complex.KeyValue;
import odata.msgraph.client.beta.complex.TargetResource;
import odata.msgraph.client.beta.enums.OperationResult;
/**
*
* Org.OData.Capabilities.V1.CountRestrictions
*
* Countable = false
*
* Org.OData.Capabilities.V1.FilterRestrictions
*
* Filterable = true
*
* Org.OData.Capabilities.V1.SkipSupported
*
* false
*
* Org.OData.Capabilities.V1.TopSupported
*
* true
*/@JsonPropertyOrder({
"@odata.type",
"activityDateTime",
"activityDisplayName",
"additionalDetails",
"category",
"correlationId",
"initiatedBy",
"loggedByService",
"operationType",
"result",
"resultReason",
"targetResources"})
@JsonInclude(Include.NON_NULL)
public class DirectoryAudit extends Entity implements ODataEntityType {
@Override
public String odataTypeName() {
return "microsoft.graph.directoryAudit";
}
@JsonProperty("activityDateTime")
protected OffsetDateTime activityDateTime;
@JsonProperty("activityDisplayName")
protected String activityDisplayName;
@JsonProperty("additionalDetails")
protected List additionalDetails;
@JsonProperty("additionalDetails@nextLink")
protected String additionalDetailsNextLink;
@JsonProperty("category")
protected String category;
@JsonProperty("correlationId")
protected String correlationId;
@JsonProperty("initiatedBy")
protected AuditActivityInitiator initiatedBy;
@JsonProperty("loggedByService")
protected String loggedByService;
@JsonProperty("operationType")
protected String operationType;
@JsonProperty("result")
protected OperationResult result;
@JsonProperty("resultReason")
protected String resultReason;
@JsonProperty("targetResources")
protected List targetResources;
@JsonProperty("targetResources@nextLink")
protected String targetResourcesNextLink;
protected DirectoryAudit() {
super();
}
/**
* Returns a builder which is used to create a new
* instance of this class (given that this class is immutable).
*
* @return a new Builder for this class
*/
// Suffix used on builder factory method to differentiate the method
// from static builder methods on superclasses
public static Builder builderDirectoryAudit() {
return new Builder();
}
public static final class Builder {
private String id;
private OffsetDateTime activityDateTime;
private String activityDisplayName;
private List additionalDetails;
private String additionalDetailsNextLink;
private String category;
private String correlationId;
private AuditActivityInitiator initiatedBy;
private String loggedByService;
private String operationType;
private OperationResult result;
private String resultReason;
private List targetResources;
private String targetResourcesNextLink;
private ChangedFields changedFields = ChangedFields.EMPTY;
Builder() {
// prevent instantiation
}
public Builder id(String id) {
this.id = id;
this.changedFields = changedFields.add("id");
return this;
}
public Builder activityDateTime(OffsetDateTime activityDateTime) {
this.activityDateTime = activityDateTime;
this.changedFields = changedFields.add("activityDateTime");
return this;
}
public Builder activityDisplayName(String activityDisplayName) {
this.activityDisplayName = activityDisplayName;
this.changedFields = changedFields.add("activityDisplayName");
return this;
}
public Builder additionalDetails(List additionalDetails) {
this.additionalDetails = additionalDetails;
this.changedFields = changedFields.add("additionalDetails");
return this;
}
public Builder additionalDetails(KeyValue... additionalDetails) {
return additionalDetails(Arrays.asList(additionalDetails));
}
public Builder additionalDetailsNextLink(String additionalDetailsNextLink) {
this.additionalDetailsNextLink = additionalDetailsNextLink;
this.changedFields = changedFields.add("additionalDetails");
return this;
}
public Builder category(String category) {
this.category = category;
this.changedFields = changedFields.add("category");
return this;
}
public Builder correlationId(String correlationId) {
this.correlationId = correlationId;
this.changedFields = changedFields.add("correlationId");
return this;
}
public Builder initiatedBy(AuditActivityInitiator initiatedBy) {
this.initiatedBy = initiatedBy;
this.changedFields = changedFields.add("initiatedBy");
return this;
}
public Builder loggedByService(String loggedByService) {
this.loggedByService = loggedByService;
this.changedFields = changedFields.add("loggedByService");
return this;
}
public Builder operationType(String operationType) {
this.operationType = operationType;
this.changedFields = changedFields.add("operationType");
return this;
}
public Builder result(OperationResult result) {
this.result = result;
this.changedFields = changedFields.add("result");
return this;
}
public Builder resultReason(String resultReason) {
this.resultReason = resultReason;
this.changedFields = changedFields.add("resultReason");
return this;
}
public Builder targetResources(List targetResources) {
this.targetResources = targetResources;
this.changedFields = changedFields.add("targetResources");
return this;
}
public Builder targetResources(TargetResource... targetResources) {
return targetResources(Arrays.asList(targetResources));
}
public Builder targetResourcesNextLink(String targetResourcesNextLink) {
this.targetResourcesNextLink = targetResourcesNextLink;
this.changedFields = changedFields.add("targetResources");
return this;
}
public DirectoryAudit build() {
DirectoryAudit _x = new DirectoryAudit();
_x.contextPath = null;
_x.changedFields = changedFields;
_x.unmappedFields = new UnmappedFieldsImpl();
_x.odataType = "microsoft.graph.directoryAudit";
_x.id = id;
_x.activityDateTime = activityDateTime;
_x.activityDisplayName = activityDisplayName;
_x.additionalDetails = additionalDetails;
_x.additionalDetailsNextLink = additionalDetailsNextLink;
_x.category = category;
_x.correlationId = correlationId;
_x.initiatedBy = initiatedBy;
_x.loggedByService = loggedByService;
_x.operationType = operationType;
_x.result = result;
_x.resultReason = resultReason;
_x.targetResources = targetResources;
_x.targetResourcesNextLink = targetResourcesNextLink;
return _x;
}
}
@Override
@JsonIgnore
public ChangedFields getChangedFields() {
return changedFields;
}
@Override
public void postInject(boolean addKeysToContextPath) {
if (addKeysToContextPath && id != null) {
contextPath = contextPath.clearQueries().addKeys(new NameValue(id.toString()));
}
}
@Property(name="activityDateTime")
@JsonIgnore
public Optional getActivityDateTime() {
return Optional.ofNullable(activityDateTime);
}
public DirectoryAudit withActivityDateTime(OffsetDateTime activityDateTime) {
DirectoryAudit _x = _copy();
_x.changedFields = changedFields.add("activityDateTime");
_x.odataType = Util.nvl(odataType, "microsoft.graph.directoryAudit");
_x.activityDateTime = activityDateTime;
return _x;
}
@Property(name="activityDisplayName")
@JsonIgnore
public Optional getActivityDisplayName() {
return Optional.ofNullable(activityDisplayName);
}
public DirectoryAudit withActivityDisplayName(String activityDisplayName) {
DirectoryAudit _x = _copy();
_x.changedFields = changedFields.add("activityDisplayName");
_x.odataType = Util.nvl(odataType, "microsoft.graph.directoryAudit");
_x.activityDisplayName = activityDisplayName;
return _x;
}
@Property(name="additionalDetails")
@JsonIgnore
public CollectionPage getAdditionalDetails() {
return new CollectionPage(contextPath, KeyValue.class, this.additionalDetails, Optional.ofNullable(additionalDetailsNextLink), Collections.emptyList(), HttpRequestOptions.EMPTY);
}
public DirectoryAudit withAdditionalDetails(List additionalDetails) {
DirectoryAudit _x = _copy();
_x.changedFields = changedFields.add("additionalDetails");
_x.odataType = Util.nvl(odataType, "microsoft.graph.directoryAudit");
_x.additionalDetails = additionalDetails;
return _x;
}
@Property(name="additionalDetails")
@JsonIgnore
public CollectionPage getAdditionalDetails(HttpRequestOptions options) {
return new CollectionPage(contextPath, KeyValue.class, this.additionalDetails, Optional.ofNullable(additionalDetailsNextLink), Collections.emptyList(), options);
}
@Property(name="category")
@JsonIgnore
public Optional getCategory() {
return Optional.ofNullable(category);
}
public DirectoryAudit withCategory(String category) {
DirectoryAudit _x = _copy();
_x.changedFields = changedFields.add("category");
_x.odataType = Util.nvl(odataType, "microsoft.graph.directoryAudit");
_x.category = category;
return _x;
}
@Property(name="correlationId")
@JsonIgnore
public Optional getCorrelationId() {
return Optional.ofNullable(correlationId);
}
public DirectoryAudit withCorrelationId(String correlationId) {
DirectoryAudit _x = _copy();
_x.changedFields = changedFields.add("correlationId");
_x.odataType = Util.nvl(odataType, "microsoft.graph.directoryAudit");
_x.correlationId = correlationId;
return _x;
}
@Property(name="initiatedBy")
@JsonIgnore
public Optional getInitiatedBy() {
return Optional.ofNullable(initiatedBy);
}
public DirectoryAudit withInitiatedBy(AuditActivityInitiator initiatedBy) {
DirectoryAudit _x = _copy();
_x.changedFields = changedFields.add("initiatedBy");
_x.odataType = Util.nvl(odataType, "microsoft.graph.directoryAudit");
_x.initiatedBy = initiatedBy;
return _x;
}
@Property(name="loggedByService")
@JsonIgnore
public Optional getLoggedByService() {
return Optional.ofNullable(loggedByService);
}
public DirectoryAudit withLoggedByService(String loggedByService) {
DirectoryAudit _x = _copy();
_x.changedFields = changedFields.add("loggedByService");
_x.odataType = Util.nvl(odataType, "microsoft.graph.directoryAudit");
_x.loggedByService = loggedByService;
return _x;
}
@Property(name="operationType")
@JsonIgnore
public Optional getOperationType() {
return Optional.ofNullable(operationType);
}
public DirectoryAudit withOperationType(String operationType) {
DirectoryAudit _x = _copy();
_x.changedFields = changedFields.add("operationType");
_x.odataType = Util.nvl(odataType, "microsoft.graph.directoryAudit");
_x.operationType = operationType;
return _x;
}
@Property(name="result")
@JsonIgnore
public Optional getResult() {
return Optional.ofNullable(result);
}
public DirectoryAudit withResult(OperationResult result) {
DirectoryAudit _x = _copy();
_x.changedFields = changedFields.add("result");
_x.odataType = Util.nvl(odataType, "microsoft.graph.directoryAudit");
_x.result = result;
return _x;
}
@Property(name="resultReason")
@JsonIgnore
public Optional getResultReason() {
return Optional.ofNullable(resultReason);
}
public DirectoryAudit withResultReason(String resultReason) {
DirectoryAudit _x = _copy();
_x.changedFields = changedFields.add("resultReason");
_x.odataType = Util.nvl(odataType, "microsoft.graph.directoryAudit");
_x.resultReason = resultReason;
return _x;
}
@Property(name="targetResources")
@JsonIgnore
public CollectionPage getTargetResources() {
return new CollectionPage(contextPath, TargetResource.class, this.targetResources, Optional.ofNullable(targetResourcesNextLink), Collections.emptyList(), HttpRequestOptions.EMPTY);
}
public DirectoryAudit withTargetResources(List targetResources) {
DirectoryAudit _x = _copy();
_x.changedFields = changedFields.add("targetResources");
_x.odataType = Util.nvl(odataType, "microsoft.graph.directoryAudit");
_x.targetResources = targetResources;
return _x;
}
@Property(name="targetResources")
@JsonIgnore
public CollectionPage getTargetResources(HttpRequestOptions options) {
return new CollectionPage(contextPath, TargetResource.class, this.targetResources, Optional.ofNullable(targetResourcesNextLink), Collections.emptyList(), options);
}
public DirectoryAudit withUnmappedField(String name, String value) {
DirectoryAudit _x = _copy();
_x.setUnmappedField(name, value);
return _x;
}
@JsonAnySetter
private void setUnmappedField(String name, Object value) {
if (unmappedFields == null) {
unmappedFields = new UnmappedFieldsImpl();
}
unmappedFields.put(name, value);
}
@JsonAnyGetter
private UnmappedFieldsImpl unmappedFields() {
return unmappedFields == null ? UnmappedFieldsImpl.EMPTY : unmappedFields;
}
@Override
public UnmappedFields getUnmappedFields() {
return unmappedFields();
}
/**
* Submits only changed fields for update and returns an
* immutable copy of {@code this} with changed fields reset.
*
* @return a copy of {@code this} with changed fields reset
* @throws ClientException if HTTP response is not as expected
*/
public DirectoryAudit patch() {
RequestHelper.patch(this, contextPath, RequestOptions.EMPTY);
DirectoryAudit _x = _copy();
_x.changedFields = null;
return _x;
}
/**
* Submits all fields for update and returns an immutable copy of {@code this}
* with changed fields reset (they were ignored anyway).
*
* @return a copy of {@code this} with changed fields reset
* @throws ClientException if HTTP response is not as expected
*/
public DirectoryAudit put() {
RequestHelper.put(this, contextPath, RequestOptions.EMPTY);
DirectoryAudit _x = _copy();
_x.changedFields = null;
return _x;
}
private DirectoryAudit _copy() {
DirectoryAudit _x = new DirectoryAudit();
_x.contextPath = contextPath;
_x.changedFields = changedFields;
_x.unmappedFields = unmappedFields.copy();
_x.odataType = odataType;
_x.id = id;
_x.activityDateTime = activityDateTime;
_x.activityDisplayName = activityDisplayName;
_x.additionalDetails = additionalDetails;
_x.category = category;
_x.correlationId = correlationId;
_x.initiatedBy = initiatedBy;
_x.loggedByService = loggedByService;
_x.operationType = operationType;
_x.result = result;
_x.resultReason = resultReason;
_x.targetResources = targetResources;
return _x;
}
@Override
public String toString() {
StringBuilder b = new StringBuilder();
b.append("DirectoryAudit[");
b.append("id=");
b.append(this.id);
b.append(", ");
b.append("activityDateTime=");
b.append(this.activityDateTime);
b.append(", ");
b.append("activityDisplayName=");
b.append(this.activityDisplayName);
b.append(", ");
b.append("additionalDetails=");
b.append(this.additionalDetails);
b.append(", ");
b.append("category=");
b.append(this.category);
b.append(", ");
b.append("correlationId=");
b.append(this.correlationId);
b.append(", ");
b.append("initiatedBy=");
b.append(this.initiatedBy);
b.append(", ");
b.append("loggedByService=");
b.append(this.loggedByService);
b.append(", ");
b.append("operationType=");
b.append(this.operationType);
b.append(", ");
b.append("result=");
b.append(this.result);
b.append(", ");
b.append("resultReason=");
b.append(this.resultReason);
b.append(", ");
b.append("targetResources=");
b.append(this.targetResources);
b.append("]");
b.append(",unmappedFields=");
b.append(unmappedFields);
b.append(",odataType=");
b.append(odataType);
return b.toString();
}
}