odata.msgraph.client.entity.IosCustomConfiguration Maven / Gradle / Ivy
Show all versions of odata-client-msgraph Show documentation
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.Integer;
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.List;
import java.util.Optional;
/**
* “This topic provides descriptions of the declared methods, properties and
* relationships exposed by the iosCustomConfiguration resource.”
*/@JsonPropertyOrder({
"@odata.type",
"payload",
"payloadFileName",
"payloadName"})
@JsonInclude(Include.NON_NULL)
public class IosCustomConfiguration extends DeviceConfiguration implements ODataEntityType {
@Override
public String odataTypeName() {
return "microsoft.graph.iosCustomConfiguration";
}
@JsonProperty("payload")
protected byte[] payload;
@JsonProperty("payloadFileName")
protected String payloadFileName;
@JsonProperty("payloadName")
protected String payloadName;
protected IosCustomConfiguration() {
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 builderIosCustomConfiguration() {
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 List assignments;
private List deviceSettingStateSummaries;
private List deviceStatuses;
private DeviceConfigurationDeviceOverview deviceStatusOverview;
private List userStatuses;
private DeviceConfigurationUserOverview userStatusOverview;
private byte[] payload;
private String payloadFileName;
private String payloadName;
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;
}
public Builder assignments(List assignments) {
this.assignments = assignments;
this.changedFields = changedFields.add("assignments");
return this;
}
public Builder assignments(DeviceConfigurationAssignment... assignments) {
return assignments(Arrays.asList(assignments));
}
public Builder deviceSettingStateSummaries(List deviceSettingStateSummaries) {
this.deviceSettingStateSummaries = deviceSettingStateSummaries;
this.changedFields = changedFields.add("deviceSettingStateSummaries");
return this;
}
public Builder deviceSettingStateSummaries(SettingStateDeviceSummary... deviceSettingStateSummaries) {
return deviceSettingStateSummaries(Arrays.asList(deviceSettingStateSummaries));
}
public Builder deviceStatuses(List deviceStatuses) {
this.deviceStatuses = deviceStatuses;
this.changedFields = changedFields.add("deviceStatuses");
return this;
}
public Builder deviceStatuses(DeviceConfigurationDeviceStatus... deviceStatuses) {
return deviceStatuses(Arrays.asList(deviceStatuses));
}
public Builder deviceStatusOverview(DeviceConfigurationDeviceOverview deviceStatusOverview) {
this.deviceStatusOverview = deviceStatusOverview;
this.changedFields = changedFields.add("deviceStatusOverview");
return this;
}
public Builder userStatuses(List userStatuses) {
this.userStatuses = userStatuses;
this.changedFields = changedFields.add("userStatuses");
return this;
}
public Builder userStatuses(DeviceConfigurationUserStatus... userStatuses) {
return userStatuses(Arrays.asList(userStatuses));
}
public Builder userStatusOverview(DeviceConfigurationUserOverview userStatusOverview) {
this.userStatusOverview = userStatusOverview;
this.changedFields = changedFields.add("userStatusOverview");
return this;
}
/**
* “Payload. (UTF8 encoded byte array)”
*
* @param payload
* value of {@code payload} property (as defined in service metadata)
* @return {@code this} (for method chaining)
*/
public Builder payload(byte[] payload) {
this.payload = payload;
this.changedFields = changedFields.add("payload");
return this;
}
/**
* “Payload file name (*.mobileconfig | *.xml).”
*
* @param payloadFileName
* value of {@code payloadFileName} property (as defined in service metadata)
* @return {@code this} (for method chaining)
*/
public Builder payloadFileName(String payloadFileName) {
this.payloadFileName = payloadFileName;
this.changedFields = changedFields.add("payloadFileName");
return this;
}
/**
* “Name that is displayed to the user.”
*
* @param payloadName
* value of {@code payloadName} property (as defined in service metadata)
* @return {@code this} (for method chaining)
*/
public Builder payloadName(String payloadName) {
this.payloadName = payloadName;
this.changedFields = changedFields.add("payloadName");
return this;
}
public IosCustomConfiguration build() {
IosCustomConfiguration _x = new IosCustomConfiguration();
_x.contextPath = null;
_x.changedFields = changedFields;
_x.unmappedFields = new UnmappedFieldsImpl();
_x.odataType = "microsoft.graph.iosCustomConfiguration";
_x.id = id;
_x.createdDateTime = createdDateTime;
_x.description = description;
_x.displayName = displayName;
_x.lastModifiedDateTime = lastModifiedDateTime;
_x.version = version;
_x.assignments = assignments;
_x.deviceSettingStateSummaries = deviceSettingStateSummaries;
_x.deviceStatuses = deviceStatuses;
_x.deviceStatusOverview = deviceStatusOverview;
_x.userStatuses = userStatuses;
_x.userStatusOverview = userStatusOverview;
_x.payload = payload;
_x.payloadFileName = payloadFileName;
_x.payloadName = payloadName;
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, String.class));
}
}
/**
* “Payload. (UTF8 encoded byte array)”
*
* @return property payload
*/
@Property(name="payload")
@JsonIgnore
public Optional getPayload() {
return Optional.ofNullable(payload);
}
/**
* Returns an immutable copy of {@code this} with just the {@code payload} 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.
*
* “Payload. (UTF8 encoded byte array)”
*
* @param payload
* new value of {@code payload} field (as defined in service metadata)
* @return immutable copy of {@code this} with just the {@code payload} field changed
*/
public IosCustomConfiguration withPayload(byte[] payload) {
IosCustomConfiguration _x = _copy();
_x.changedFields = changedFields.add("payload");
_x.odataType = Util.nvl(odataType, "microsoft.graph.iosCustomConfiguration");
_x.payload = payload;
return _x;
}
/**
* “Payload file name (*.mobileconfig | *.xml).”
*
* @return property payloadFileName
*/
@Property(name="payloadFileName")
@JsonIgnore
public Optional getPayloadFileName() {
return Optional.ofNullable(payloadFileName);
}
/**
* Returns an immutable copy of {@code this} with just the {@code payloadFileName}
* 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.
*
* “Payload file name (*.mobileconfig | *.xml).”
*
* @param payloadFileName
* new value of {@code payloadFileName} field (as defined in service metadata)
* @return immutable copy of {@code this} with just the {@code payloadFileName} field changed
*/
public IosCustomConfiguration withPayloadFileName(String payloadFileName) {
IosCustomConfiguration _x = _copy();
_x.changedFields = changedFields.add("payloadFileName");
_x.odataType = Util.nvl(odataType, "microsoft.graph.iosCustomConfiguration");
_x.payloadFileName = payloadFileName;
return _x;
}
/**
* “Name that is displayed to the user.”
*
* @return property payloadName
*/
@Property(name="payloadName")
@JsonIgnore
public Optional getPayloadName() {
return Optional.ofNullable(payloadName);
}
/**
* Returns an immutable copy of {@code this} with just the {@code payloadName}
* 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.
*
* “Name that is displayed to the user.”
*
* @param payloadName
* new value of {@code payloadName} field (as defined in service metadata)
* @return immutable copy of {@code this} with just the {@code payloadName} field changed
*/
public IosCustomConfiguration withPayloadName(String payloadName) {
IosCustomConfiguration _x = _copy();
_x.changedFields = changedFields.add("payloadName");
_x.odataType = Util.nvl(odataType, "microsoft.graph.iosCustomConfiguration");
_x.payloadName = payloadName;
return _x;
}
public IosCustomConfiguration withUnmappedField(String name, Object value) {
IosCustomConfiguration _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 IosCustomConfiguration patch() {
RequestHelper.patch(this, contextPath, RequestOptions.EMPTY);
IosCustomConfiguration _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 IosCustomConfiguration put() {
RequestHelper.put(this, contextPath, RequestOptions.EMPTY);
IosCustomConfiguration _x = _copy();
_x.changedFields = null;
return _x;
}
private IosCustomConfiguration _copy() {
IosCustomConfiguration _x = new IosCustomConfiguration();
_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.assignments = assignments;
_x.deviceSettingStateSummaries = deviceSettingStateSummaries;
_x.deviceStatuses = deviceStatuses;
_x.deviceStatusOverview = deviceStatusOverview;
_x.userStatuses = userStatuses;
_x.userStatusOverview = userStatusOverview;
_x.payload = payload;
_x.payloadFileName = payloadFileName;
_x.payloadName = payloadName;
return _x;
}
@Override
public String toString() {
StringBuilder b = new StringBuilder();
b.append("IosCustomConfiguration[");
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("assignments=");
b.append(this.assignments);
b.append(", ");
b.append("deviceSettingStateSummaries=");
b.append(this.deviceSettingStateSummaries);
b.append(", ");
b.append("deviceStatuses=");
b.append(this.deviceStatuses);
b.append(", ");
b.append("deviceStatusOverview=");
b.append(this.deviceStatusOverview);
b.append(", ");
b.append("userStatuses=");
b.append(this.userStatuses);
b.append(", ");
b.append("userStatusOverview=");
b.append(this.userStatusOverview);
b.append(", ");
b.append("payload=");
b.append(this.payload);
b.append(", ");
b.append("payloadFileName=");
b.append(this.payloadFileName);
b.append(", ");
b.append("payloadName=");
b.append(this.payloadName);
b.append("]");
b.append(",unmappedFields=");
b.append(unmappedFields);
b.append(",odataType=");
b.append(odataType);
return b.toString();
}
}