
odata.msgraph.client.entity.WindowsDefenderAdvancedThreatProtectionConfiguration Maven / Gradle / Ivy
package odata.msgraph.client.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.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.Boolean;
import java.lang.Integer;
import java.lang.Object;
import java.lang.Override;
import java.lang.String;
import java.lang.StringBuilder;
import java.time.OffsetDateTime;
import java.util.Optional;
/**
* “Windows Defender AdvancedThreatProtection Configuration.”
*/@JsonPropertyOrder({
"@odata.type",
"allowSampleSharing",
"enableExpeditedTelemetryReporting"})
@JsonInclude(Include.NON_NULL)
public class WindowsDefenderAdvancedThreatProtectionConfiguration extends DeviceConfiguration implements ODataEntityType {
@Override
public String odataTypeName() {
return "microsoft.graph.windowsDefenderAdvancedThreatProtectionConfiguration";
}
@JsonProperty("allowSampleSharing")
protected Boolean allowSampleSharing;
@JsonProperty("enableExpeditedTelemetryReporting")
protected Boolean enableExpeditedTelemetryReporting;
protected WindowsDefenderAdvancedThreatProtectionConfiguration() {
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 builderWindowsDefenderAdvancedThreatProtectionConfiguration() {
return new Builder();
}
public static final class Builder {
private String id;
private OffsetDateTime createdDateTime;
private String description;
private String displayName;
private OffsetDateTime lastModifiedDateTime;
private Integer version;
private Boolean allowSampleSharing;
private Boolean enableExpeditedTelemetryReporting;
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 lastModifiedDateTime(OffsetDateTime lastModifiedDateTime) {
this.lastModifiedDateTime = lastModifiedDateTime;
this.changedFields = changedFields.add("lastModifiedDateTime");
return this;
}
public Builder version(Integer version) {
this.version = version;
this.changedFields = changedFields.add("version");
return this;
}
/**
* “Windows Defender AdvancedThreatProtection "Allow Sample Sharing" Rule”
*
* @param allowSampleSharing
* value of {@code allowSampleSharing} property (as defined in service metadata)
* @return {@code this} (for method chaining)
*/
public Builder allowSampleSharing(Boolean allowSampleSharing) {
this.allowSampleSharing = allowSampleSharing;
this.changedFields = changedFields.add("allowSampleSharing");
return this;
}
/**
* “Expedite Windows Defender Advanced Threat Protection telemetry reporting
* frequency.”
*
* @param enableExpeditedTelemetryReporting
* value of {@code enableExpeditedTelemetryReporting} property (as defined in service metadata)
* @return {@code this} (for method chaining)
*/
public Builder enableExpeditedTelemetryReporting(Boolean enableExpeditedTelemetryReporting) {
this.enableExpeditedTelemetryReporting = enableExpeditedTelemetryReporting;
this.changedFields = changedFields.add("enableExpeditedTelemetryReporting");
return this;
}
public WindowsDefenderAdvancedThreatProtectionConfiguration build() {
WindowsDefenderAdvancedThreatProtectionConfiguration _x = new WindowsDefenderAdvancedThreatProtectionConfiguration();
_x.contextPath = null;
_x.changedFields = changedFields;
_x.unmappedFields = new UnmappedFieldsImpl();
_x.odataType = "microsoft.graph.windowsDefenderAdvancedThreatProtectionConfiguration";
_x.id = id;
_x.createdDateTime = createdDateTime;
_x.description = description;
_x.displayName = displayName;
_x.lastModifiedDateTime = lastModifiedDateTime;
_x.version = version;
_x.allowSampleSharing = allowSampleSharing;
_x.enableExpeditedTelemetryReporting = enableExpeditedTelemetryReporting;
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()));
}
}
/**
* “Windows Defender AdvancedThreatProtection "Allow Sample Sharing" Rule”
*
* @return property allowSampleSharing
*/
@Property(name="allowSampleSharing")
@JsonIgnore
public Optional getAllowSampleSharing() {
return Optional.ofNullable(allowSampleSharing);
}
/**
* Returns an immutable copy of {@code this} with just the {@code
* allowSampleSharing} field changed. Field description below. The field name is
* also added to an internal map of changed fields in the returned object so that
* when {@code this.patch()} is called (if available)on the returned object only
* the changed fields are submitted.
*
* “Windows Defender AdvancedThreatProtection "Allow Sample Sharing" Rule”
*
* @param allowSampleSharing
* new value of {@code allowSampleSharing} field (as defined in service metadata)
* @return immutable copy of {@code this} with just the {@code allowSampleSharing} field changed
*/
public WindowsDefenderAdvancedThreatProtectionConfiguration withAllowSampleSharing(Boolean allowSampleSharing) {
WindowsDefenderAdvancedThreatProtectionConfiguration _x = _copy();
_x.changedFields = changedFields.add("allowSampleSharing");
_x.odataType = Util.nvl(odataType, "microsoft.graph.windowsDefenderAdvancedThreatProtectionConfiguration");
_x.allowSampleSharing = allowSampleSharing;
return _x;
}
/**
* “Expedite Windows Defender Advanced Threat Protection telemetry reporting
* frequency.”
*
* @return property enableExpeditedTelemetryReporting
*/
@Property(name="enableExpeditedTelemetryReporting")
@JsonIgnore
public Optional getEnableExpeditedTelemetryReporting() {
return Optional.ofNullable(enableExpeditedTelemetryReporting);
}
/**
* Returns an immutable copy of {@code this} with just the {@code
* enableExpeditedTelemetryReporting} field changed. Field description below. The
* field name is also added to an internal map of changed fields in the returned
* object so that when {@code this.patch()} is called (if available)on the returned
* object only the changed fields are submitted.
*
* “Expedite Windows Defender Advanced Threat Protection telemetry reporting
* frequency.”
*
* @param enableExpeditedTelemetryReporting
* new value of {@code enableExpeditedTelemetryReporting} field (as defined in service metadata)
* @return immutable copy of {@code this} with just the {@code enableExpeditedTelemetryReporting} field changed
*/
public WindowsDefenderAdvancedThreatProtectionConfiguration withEnableExpeditedTelemetryReporting(Boolean enableExpeditedTelemetryReporting) {
WindowsDefenderAdvancedThreatProtectionConfiguration _x = _copy();
_x.changedFields = changedFields.add("enableExpeditedTelemetryReporting");
_x.odataType = Util.nvl(odataType, "microsoft.graph.windowsDefenderAdvancedThreatProtectionConfiguration");
_x.enableExpeditedTelemetryReporting = enableExpeditedTelemetryReporting;
return _x;
}
public WindowsDefenderAdvancedThreatProtectionConfiguration withUnmappedField(String name, String value) {
WindowsDefenderAdvancedThreatProtectionConfiguration _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 WindowsDefenderAdvancedThreatProtectionConfiguration patch() {
RequestHelper.patch(this, contextPath, RequestOptions.EMPTY);
WindowsDefenderAdvancedThreatProtectionConfiguration _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 WindowsDefenderAdvancedThreatProtectionConfiguration put() {
RequestHelper.put(this, contextPath, RequestOptions.EMPTY);
WindowsDefenderAdvancedThreatProtectionConfiguration _x = _copy();
_x.changedFields = null;
return _x;
}
private WindowsDefenderAdvancedThreatProtectionConfiguration _copy() {
WindowsDefenderAdvancedThreatProtectionConfiguration _x = new WindowsDefenderAdvancedThreatProtectionConfiguration();
_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.lastModifiedDateTime = lastModifiedDateTime;
_x.version = version;
_x.allowSampleSharing = allowSampleSharing;
_x.enableExpeditedTelemetryReporting = enableExpeditedTelemetryReporting;
return _x;
}
@Override
public String toString() {
StringBuilder b = new StringBuilder();
b.append("WindowsDefenderAdvancedThreatProtectionConfiguration[");
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("lastModifiedDateTime=");
b.append(this.lastModifiedDateTime);
b.append(", ");
b.append("version=");
b.append(this.version);
b.append(", ");
b.append("allowSampleSharing=");
b.append(this.allowSampleSharing);
b.append(", ");
b.append("enableExpeditedTelemetryReporting=");
b.append(this.enableExpeditedTelemetryReporting);
b.append("]");
b.append(",unmappedFields=");
b.append(unmappedFields);
b.append(",odataType=");
b.append(odataType);
return b.toString();
}
}