
odata.msgraph.client.security.entity.EdiscoveryCase Maven / Gradle / Ivy
package odata.msgraph.client.security.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.ActionRequestNoReturn;
import com.github.davidmoten.odata.client.ClientException;
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.Action;
import com.github.davidmoten.odata.client.annotation.NavigationProperty;
import com.github.davidmoten.odata.client.annotation.Property;
import com.github.davidmoten.odata.client.internal.ChangedFields;
import com.github.davidmoten.odata.client.internal.ParameterMap;
import com.github.davidmoten.odata.client.internal.RequestHelper;
import com.github.davidmoten.odata.client.internal.TypedObject;
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.Map;
import java.util.Optional;
import odata.msgraph.client.complex.IdentitySet;
import odata.msgraph.client.security.entity.collection.request.CaseOperationCollectionRequest;
import odata.msgraph.client.security.entity.collection.request.EdiscoveryCustodianCollectionRequest;
import odata.msgraph.client.security.entity.collection.request.EdiscoveryNoncustodialDataSourceCollectionRequest;
import odata.msgraph.client.security.entity.collection.request.EdiscoveryReviewSetCollectionRequest;
import odata.msgraph.client.security.entity.collection.request.EdiscoveryReviewTagCollectionRequest;
import odata.msgraph.client.security.entity.collection.request.EdiscoverySearchCollectionRequest;
import odata.msgraph.client.security.entity.request.EdiscoveryCaseSettingsRequest;
import odata.msgraph.client.security.enums.CaseStatus;
@JsonPropertyOrder({
"@odata.type",
"closedBy",
"closedDateTime",
"externalId"})
@JsonInclude(Include.NON_NULL)
public class EdiscoveryCase extends Case implements ODataEntityType {
@Override
public String odataTypeName() {
return "microsoft.graph.security.ediscoveryCase";
}
@JsonProperty("closedBy")
protected IdentitySet closedBy;
@JsonProperty("closedDateTime")
protected OffsetDateTime closedDateTime;
@JsonProperty("externalId")
protected String externalId;
protected EdiscoveryCase() {
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 builderEdiscoveryCase() {
return new Builder();
}
public static final class Builder {
private String id;
private OffsetDateTime createdDateTime;
private String description;
private String displayName;
private IdentitySet lastModifiedBy;
private OffsetDateTime lastModifiedDateTime;
private CaseStatus status;
private IdentitySet closedBy;
private OffsetDateTime closedDateTime;
private String externalId;
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 createdDateTime(OffsetDateTime createdDateTime) {
this.createdDateTime = createdDateTime;
this.changedFields = changedFields.add("createdDateTime");
return this;
}
public Builder description(String description) {
this.description = description;
this.changedFields = changedFields.add("description");
return this;
}
public Builder displayName(String displayName) {
this.displayName = displayName;
this.changedFields = changedFields.add("displayName");
return this;
}
public Builder lastModifiedBy(IdentitySet lastModifiedBy) {
this.lastModifiedBy = lastModifiedBy;
this.changedFields = changedFields.add("lastModifiedBy");
return this;
}
public Builder lastModifiedDateTime(OffsetDateTime lastModifiedDateTime) {
this.lastModifiedDateTime = lastModifiedDateTime;
this.changedFields = changedFields.add("lastModifiedDateTime");
return this;
}
public Builder status(CaseStatus status) {
this.status = status;
this.changedFields = changedFields.add("status");
return this;
}
public Builder closedBy(IdentitySet closedBy) {
this.closedBy = closedBy;
this.changedFields = changedFields.add("closedBy");
return this;
}
public Builder closedDateTime(OffsetDateTime closedDateTime) {
this.closedDateTime = closedDateTime;
this.changedFields = changedFields.add("closedDateTime");
return this;
}
public Builder externalId(String externalId) {
this.externalId = externalId;
this.changedFields = changedFields.add("externalId");
return this;
}
public EdiscoveryCase build() {
EdiscoveryCase _x = new EdiscoveryCase();
_x.contextPath = null;
_x.changedFields = changedFields;
_x.unmappedFields = new UnmappedFieldsImpl();
_x.odataType = "microsoft.graph.security.ediscoveryCase";
_x.id = id;
_x.createdDateTime = createdDateTime;
_x.description = description;
_x.displayName = displayName;
_x.lastModifiedBy = lastModifiedBy;
_x.lastModifiedDateTime = lastModifiedDateTime;
_x.status = status;
_x.closedBy = closedBy;
_x.closedDateTime = closedDateTime;
_x.externalId = externalId;
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="closedBy")
@JsonIgnore
public Optional getClosedBy() {
return Optional.ofNullable(closedBy);
}
public EdiscoveryCase withClosedBy(IdentitySet closedBy) {
EdiscoveryCase _x = _copy();
_x.changedFields = changedFields.add("closedBy");
_x.odataType = Util.nvl(odataType, "microsoft.graph.security.ediscoveryCase");
_x.closedBy = closedBy;
return _x;
}
@Property(name="closedDateTime")
@JsonIgnore
public Optional getClosedDateTime() {
return Optional.ofNullable(closedDateTime);
}
public EdiscoveryCase withClosedDateTime(OffsetDateTime closedDateTime) {
EdiscoveryCase _x = _copy();
_x.changedFields = changedFields.add("closedDateTime");
_x.odataType = Util.nvl(odataType, "microsoft.graph.security.ediscoveryCase");
_x.closedDateTime = closedDateTime;
return _x;
}
@Property(name="externalId")
@JsonIgnore
public Optional getExternalId() {
return Optional.ofNullable(externalId);
}
public EdiscoveryCase withExternalId(String externalId) {
EdiscoveryCase _x = _copy();
_x.changedFields = changedFields.add("externalId");
_x.odataType = Util.nvl(odataType, "microsoft.graph.security.ediscoveryCase");
_x.externalId = externalId;
return _x;
}
public EdiscoveryCase withUnmappedField(String name, String value) {
EdiscoveryCase _x = _copy();
_x.setUnmappedField(name, value);
return _x;
}
@NavigationProperty(name="custodians")
@JsonIgnore
public EdiscoveryCustodianCollectionRequest getCustodians() {
return new EdiscoveryCustodianCollectionRequest(
contextPath.addSegment("custodians"), RequestHelper.getValue(unmappedFields, "custodians"));
}
@NavigationProperty(name="noncustodialDataSources")
@JsonIgnore
public EdiscoveryNoncustodialDataSourceCollectionRequest getNoncustodialDataSources() {
return new EdiscoveryNoncustodialDataSourceCollectionRequest(
contextPath.addSegment("noncustodialDataSources"), RequestHelper.getValue(unmappedFields, "noncustodialDataSources"));
}
@NavigationProperty(name="operations")
@JsonIgnore
public CaseOperationCollectionRequest getOperations() {
return new CaseOperationCollectionRequest(
contextPath.addSegment("operations"), RequestHelper.getValue(unmappedFields, "operations"));
}
@NavigationProperty(name="reviewSets")
@JsonIgnore
public EdiscoveryReviewSetCollectionRequest getReviewSets() {
return new EdiscoveryReviewSetCollectionRequest(
contextPath.addSegment("reviewSets"), RequestHelper.getValue(unmappedFields, "reviewSets"));
}
@NavigationProperty(name="searches")
@JsonIgnore
public EdiscoverySearchCollectionRequest getSearches() {
return new EdiscoverySearchCollectionRequest(
contextPath.addSegment("searches"), RequestHelper.getValue(unmappedFields, "searches"));
}
@NavigationProperty(name="settings")
@JsonIgnore
public EdiscoveryCaseSettingsRequest getSettings() {
return new EdiscoveryCaseSettingsRequest(contextPath.addSegment("settings"), RequestHelper.getValue(unmappedFields, "settings"));
}
@NavigationProperty(name="tags")
@JsonIgnore
public EdiscoveryReviewTagCollectionRequest getTags() {
return new EdiscoveryReviewTagCollectionRequest(
contextPath.addSegment("tags"), RequestHelper.getValue(unmappedFields, "tags"));
}
@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 EdiscoveryCase patch() {
RequestHelper.patch(this, contextPath, RequestOptions.EMPTY);
EdiscoveryCase _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 EdiscoveryCase put() {
RequestHelper.put(this, contextPath, RequestOptions.EMPTY);
EdiscoveryCase _x = _copy();
_x.changedFields = null;
return _x;
}
private EdiscoveryCase _copy() {
EdiscoveryCase _x = new EdiscoveryCase();
_x.contextPath = contextPath;
_x.changedFields = changedFields;
_x.unmappedFields = unmappedFields.copy();
_x.odataType = odataType;
_x.id = id;
_x.createdDateTime = createdDateTime;
_x.description = description;
_x.displayName = displayName;
_x.lastModifiedBy = lastModifiedBy;
_x.lastModifiedDateTime = lastModifiedDateTime;
_x.status = status;
_x.closedBy = closedBy;
_x.closedDateTime = closedDateTime;
_x.externalId = externalId;
return _x;
}
@Action(name = "close")
@JsonIgnore
public ActionRequestNoReturn close() {
Map _parameters = ParameterMap.empty();
return new ActionRequestNoReturn(this.contextPath.addActionOrFunctionSegment("microsoft.graph.security.close"), _parameters);
}
@Action(name = "reopen")
@JsonIgnore
public ActionRequestNoReturn reopen() {
Map _parameters = ParameterMap.empty();
return new ActionRequestNoReturn(this.contextPath.addActionOrFunctionSegment("microsoft.graph.security.reopen"), _parameters);
}
@Override
public String toString() {
StringBuilder b = new StringBuilder();
b.append("EdiscoveryCase[");
b.append("id=");
b.append(this.id);
b.append(", ");
b.append("createdDateTime=");
b.append(this.createdDateTime);
b.append(", ");
b.append("description=");
b.append(this.description);
b.append(", ");
b.append("displayName=");
b.append(this.displayName);
b.append(", ");
b.append("lastModifiedBy=");
b.append(this.lastModifiedBy);
b.append(", ");
b.append("lastModifiedDateTime=");
b.append(this.lastModifiedDateTime);
b.append(", ");
b.append("status=");
b.append(this.status);
b.append(", ");
b.append("closedBy=");
b.append(this.closedBy);
b.append(", ");
b.append("closedDateTime=");
b.append(this.closedDateTime);
b.append(", ");
b.append("externalId=");
b.append(this.externalId);
b.append("]");
b.append(",unmappedFields=");
b.append(unmappedFields);
b.append(",odataType=");
b.append(odataType);
return b.toString();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy