All Downloads are FREE. Search and download functionalities are using the official Maven repository.

odata.msgraph.client.entity.DeviceCompliancePolicySettingStateSummary 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.NavigationProperty;
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.util.Optional;

import odata.msgraph.client.entity.collection.request.DeviceComplianceSettingStateCollectionRequest;
import odata.msgraph.client.enums.PolicyPlatformType;


/**
 * “Device Compilance Policy Setting State summary across the account.”
 */@JsonPropertyOrder({
    "@odata.type", 
    "compliantDeviceCount", 
    "conflictDeviceCount", 
    "errorDeviceCount", 
    "nonCompliantDeviceCount", 
    "notApplicableDeviceCount", 
    "platformType", 
    "remediatedDeviceCount", 
    "setting", 
    "settingName", 
    "unknownDeviceCount"})
@JsonInclude(Include.NON_NULL)
public class DeviceCompliancePolicySettingStateSummary extends Entity implements ODataEntityType {

    @Override
    public String odataTypeName() {
        return "microsoft.graph.deviceCompliancePolicySettingStateSummary";
    }

    @JsonProperty("compliantDeviceCount")
    protected Integer compliantDeviceCount;

    @JsonProperty("conflictDeviceCount")
    protected Integer conflictDeviceCount;

    @JsonProperty("errorDeviceCount")
    protected Integer errorDeviceCount;

    @JsonProperty("nonCompliantDeviceCount")
    protected Integer nonCompliantDeviceCount;

    @JsonProperty("notApplicableDeviceCount")
    protected Integer notApplicableDeviceCount;

    @JsonProperty("platformType")
    protected PolicyPlatformType platformType;

    @JsonProperty("remediatedDeviceCount")
    protected Integer remediatedDeviceCount;

    @JsonProperty("setting")
    protected String setting;

    @JsonProperty("settingName")
    protected String settingName;

    @JsonProperty("unknownDeviceCount")
    protected Integer unknownDeviceCount;

    protected DeviceCompliancePolicySettingStateSummary() {
        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 builderDeviceCompliancePolicySettingStateSummary() {
        return new Builder();
    }

    public static final class Builder {
        private String id;
        private Integer compliantDeviceCount;
        private Integer conflictDeviceCount;
        private Integer errorDeviceCount;
        private Integer nonCompliantDeviceCount;
        private Integer notApplicableDeviceCount;
        private PolicyPlatformType platformType;
        private Integer remediatedDeviceCount;
        private String setting;
        private String settingName;
        private Integer unknownDeviceCount;
        private ChangedFields changedFields = ChangedFields.EMPTY;

        Builder() {
            // prevent instantiation
        }

        public Builder id(String id) {
            this.id = id;
            this.changedFields = changedFields.add("id");
            return this;
        }

        /**
         * “Number of compliant devices”
         * 
         * @param compliantDeviceCount
         *            value of {@code compliantDeviceCount} property (as defined in service metadata)
         * @return {@code this} (for method chaining)
         */
        public Builder compliantDeviceCount(Integer compliantDeviceCount) {
            this.compliantDeviceCount = compliantDeviceCount;
            this.changedFields = changedFields.add("compliantDeviceCount");
            return this;
        }

        /**
         * “Number of conflict devices”
         * 
         * @param conflictDeviceCount
         *            value of {@code conflictDeviceCount} property (as defined in service metadata)
         * @return {@code this} (for method chaining)
         */
        public Builder conflictDeviceCount(Integer conflictDeviceCount) {
            this.conflictDeviceCount = conflictDeviceCount;
            this.changedFields = changedFields.add("conflictDeviceCount");
            return this;
        }

        /**
         * “Number of error devices”
         * 
         * @param errorDeviceCount
         *            value of {@code errorDeviceCount} property (as defined in service metadata)
         * @return {@code this} (for method chaining)
         */
        public Builder errorDeviceCount(Integer errorDeviceCount) {
            this.errorDeviceCount = errorDeviceCount;
            this.changedFields = changedFields.add("errorDeviceCount");
            return this;
        }

        /**
         * “Number of NonCompliant devices”
         * 
         * @param nonCompliantDeviceCount
         *            value of {@code nonCompliantDeviceCount} property (as defined in service metadata)
         * @return {@code this} (for method chaining)
         */
        public Builder nonCompliantDeviceCount(Integer nonCompliantDeviceCount) {
            this.nonCompliantDeviceCount = nonCompliantDeviceCount;
            this.changedFields = changedFields.add("nonCompliantDeviceCount");
            return this;
        }

        /**
         * “Number of not applicable devices”
         * 
         * @param notApplicableDeviceCount
         *            value of {@code notApplicableDeviceCount} property (as defined in service metadata)
         * @return {@code this} (for method chaining)
         */
        public Builder notApplicableDeviceCount(Integer notApplicableDeviceCount) {
            this.notApplicableDeviceCount = notApplicableDeviceCount;
            this.changedFields = changedFields.add("notApplicableDeviceCount");
            return this;
        }

        /**
         * “Setting platform”
         * 
         * @param platformType
         *            value of {@code platformType} property (as defined in service metadata)
         * @return {@code this} (for method chaining)
         */
        public Builder platformType(PolicyPlatformType platformType) {
            this.platformType = platformType;
            this.changedFields = changedFields.add("platformType");
            return this;
        }

        /**
         * “Number of remediated devices”
         * 
         * @param remediatedDeviceCount
         *            value of {@code remediatedDeviceCount} property (as defined in service metadata)
         * @return {@code this} (for method chaining)
         */
        public Builder remediatedDeviceCount(Integer remediatedDeviceCount) {
            this.remediatedDeviceCount = remediatedDeviceCount;
            this.changedFields = changedFields.add("remediatedDeviceCount");
            return this;
        }

        /**
         * “The setting class name and property name.”
         * 
         * @param setting
         *            value of {@code setting} property (as defined in service metadata)
         * @return {@code this} (for method chaining)
         */
        public Builder setting(String setting) {
            this.setting = setting;
            this.changedFields = changedFields.add("setting");
            return this;
        }

        /**
         * “Name of the setting.”
         * 
         * @param settingName
         *            value of {@code settingName} property (as defined in service metadata)
         * @return {@code this} (for method chaining)
         */
        public Builder settingName(String settingName) {
            this.settingName = settingName;
            this.changedFields = changedFields.add("settingName");
            return this;
        }

        /**
         * “Number of unknown devices”
         * 
         * @param unknownDeviceCount
         *            value of {@code unknownDeviceCount} property (as defined in service metadata)
         * @return {@code this} (for method chaining)
         */
        public Builder unknownDeviceCount(Integer unknownDeviceCount) {
            this.unknownDeviceCount = unknownDeviceCount;
            this.changedFields = changedFields.add("unknownDeviceCount");
            return this;
        }

        public DeviceCompliancePolicySettingStateSummary build() {
            DeviceCompliancePolicySettingStateSummary _x = new DeviceCompliancePolicySettingStateSummary();
            _x.contextPath = null;
            _x.changedFields = changedFields;
            _x.unmappedFields = new UnmappedFieldsImpl();
            _x.odataType = "microsoft.graph.deviceCompliancePolicySettingStateSummary";
            _x.id = id;
            _x.compliantDeviceCount = compliantDeviceCount;
            _x.conflictDeviceCount = conflictDeviceCount;
            _x.errorDeviceCount = errorDeviceCount;
            _x.nonCompliantDeviceCount = nonCompliantDeviceCount;
            _x.notApplicableDeviceCount = notApplicableDeviceCount;
            _x.platformType = platformType;
            _x.remediatedDeviceCount = remediatedDeviceCount;
            _x.setting = setting;
            _x.settingName = settingName;
            _x.unknownDeviceCount = unknownDeviceCount;
            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()));
        }
    }

    /**
     * “Number of compliant devices”
     * 
     * @return property compliantDeviceCount
     */
    @Property(name="compliantDeviceCount")
    @JsonIgnore
    public Optional getCompliantDeviceCount() {
        return Optional.ofNullable(compliantDeviceCount);
    }

    /**
     * Returns an immutable copy of {@code this} with just the {@code
     * compliantDeviceCount} 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.
     * 

* “Number of compliant devices” * * @param compliantDeviceCount * new value of {@code compliantDeviceCount} field (as defined in service metadata) * @return immutable copy of {@code this} with just the {@code compliantDeviceCount} field changed */ public DeviceCompliancePolicySettingStateSummary withCompliantDeviceCount(Integer compliantDeviceCount) { DeviceCompliancePolicySettingStateSummary _x = _copy(); _x.changedFields = changedFields.add("compliantDeviceCount"); _x.odataType = Util.nvl(odataType, "microsoft.graph.deviceCompliancePolicySettingStateSummary"); _x.compliantDeviceCount = compliantDeviceCount; return _x; } /** * “Number of conflict devices” * * @return property conflictDeviceCount */ @Property(name="conflictDeviceCount") @JsonIgnore public Optional getConflictDeviceCount() { return Optional.ofNullable(conflictDeviceCount); } /** * Returns an immutable copy of {@code this} with just the {@code * conflictDeviceCount} 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. *

* “Number of conflict devices” * * @param conflictDeviceCount * new value of {@code conflictDeviceCount} field (as defined in service metadata) * @return immutable copy of {@code this} with just the {@code conflictDeviceCount} field changed */ public DeviceCompliancePolicySettingStateSummary withConflictDeviceCount(Integer conflictDeviceCount) { DeviceCompliancePolicySettingStateSummary _x = _copy(); _x.changedFields = changedFields.add("conflictDeviceCount"); _x.odataType = Util.nvl(odataType, "microsoft.graph.deviceCompliancePolicySettingStateSummary"); _x.conflictDeviceCount = conflictDeviceCount; return _x; } /** * “Number of error devices” * * @return property errorDeviceCount */ @Property(name="errorDeviceCount") @JsonIgnore public Optional getErrorDeviceCount() { return Optional.ofNullable(errorDeviceCount); } /** * Returns an immutable copy of {@code this} with just the {@code errorDeviceCount} * 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. *

* “Number of error devices” * * @param errorDeviceCount * new value of {@code errorDeviceCount} field (as defined in service metadata) * @return immutable copy of {@code this} with just the {@code errorDeviceCount} field changed */ public DeviceCompliancePolicySettingStateSummary withErrorDeviceCount(Integer errorDeviceCount) { DeviceCompliancePolicySettingStateSummary _x = _copy(); _x.changedFields = changedFields.add("errorDeviceCount"); _x.odataType = Util.nvl(odataType, "microsoft.graph.deviceCompliancePolicySettingStateSummary"); _x.errorDeviceCount = errorDeviceCount; return _x; } /** * “Number of NonCompliant devices” * * @return property nonCompliantDeviceCount */ @Property(name="nonCompliantDeviceCount") @JsonIgnore public Optional getNonCompliantDeviceCount() { return Optional.ofNullable(nonCompliantDeviceCount); } /** * Returns an immutable copy of {@code this} with just the {@code * nonCompliantDeviceCount} 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. *

* “Number of NonCompliant devices” * * @param nonCompliantDeviceCount * new value of {@code nonCompliantDeviceCount} field (as defined in service metadata) * @return immutable copy of {@code this} with just the {@code nonCompliantDeviceCount} field changed */ public DeviceCompliancePolicySettingStateSummary withNonCompliantDeviceCount(Integer nonCompliantDeviceCount) { DeviceCompliancePolicySettingStateSummary _x = _copy(); _x.changedFields = changedFields.add("nonCompliantDeviceCount"); _x.odataType = Util.nvl(odataType, "microsoft.graph.deviceCompliancePolicySettingStateSummary"); _x.nonCompliantDeviceCount = nonCompliantDeviceCount; return _x; } /** * “Number of not applicable devices” * * @return property notApplicableDeviceCount */ @Property(name="notApplicableDeviceCount") @JsonIgnore public Optional getNotApplicableDeviceCount() { return Optional.ofNullable(notApplicableDeviceCount); } /** * Returns an immutable copy of {@code this} with just the {@code * notApplicableDeviceCount} 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. *

* “Number of not applicable devices” * * @param notApplicableDeviceCount * new value of {@code notApplicableDeviceCount} field (as defined in service metadata) * @return immutable copy of {@code this} with just the {@code notApplicableDeviceCount} field changed */ public DeviceCompliancePolicySettingStateSummary withNotApplicableDeviceCount(Integer notApplicableDeviceCount) { DeviceCompliancePolicySettingStateSummary _x = _copy(); _x.changedFields = changedFields.add("notApplicableDeviceCount"); _x.odataType = Util.nvl(odataType, "microsoft.graph.deviceCompliancePolicySettingStateSummary"); _x.notApplicableDeviceCount = notApplicableDeviceCount; return _x; } /** * “Setting platform” * * @return property platformType */ @Property(name="platformType") @JsonIgnore public Optional getPlatformType() { return Optional.ofNullable(platformType); } /** * Returns an immutable copy of {@code this} with just the {@code platformType} * 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. *

* “Setting platform” * * @param platformType * new value of {@code platformType} field (as defined in service metadata) * @return immutable copy of {@code this} with just the {@code platformType} field changed */ public DeviceCompliancePolicySettingStateSummary withPlatformType(PolicyPlatformType platformType) { DeviceCompliancePolicySettingStateSummary _x = _copy(); _x.changedFields = changedFields.add("platformType"); _x.odataType = Util.nvl(odataType, "microsoft.graph.deviceCompliancePolicySettingStateSummary"); _x.platformType = platformType; return _x; } /** * “Number of remediated devices” * * @return property remediatedDeviceCount */ @Property(name="remediatedDeviceCount") @JsonIgnore public Optional getRemediatedDeviceCount() { return Optional.ofNullable(remediatedDeviceCount); } /** * Returns an immutable copy of {@code this} with just the {@code * remediatedDeviceCount} 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. *

* “Number of remediated devices” * * @param remediatedDeviceCount * new value of {@code remediatedDeviceCount} field (as defined in service metadata) * @return immutable copy of {@code this} with just the {@code remediatedDeviceCount} field changed */ public DeviceCompliancePolicySettingStateSummary withRemediatedDeviceCount(Integer remediatedDeviceCount) { DeviceCompliancePolicySettingStateSummary _x = _copy(); _x.changedFields = changedFields.add("remediatedDeviceCount"); _x.odataType = Util.nvl(odataType, "microsoft.graph.deviceCompliancePolicySettingStateSummary"); _x.remediatedDeviceCount = remediatedDeviceCount; return _x; } /** * “The setting class name and property name.” * * @return property setting */ @Property(name="setting") @JsonIgnore public Optional getSetting() { return Optional.ofNullable(setting); } /** * Returns an immutable copy of {@code this} with just the {@code setting} 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. *

* “The setting class name and property name.” * * @param setting * new value of {@code setting} field (as defined in service metadata) * @return immutable copy of {@code this} with just the {@code setting} field changed */ public DeviceCompliancePolicySettingStateSummary withSetting(String setting) { DeviceCompliancePolicySettingStateSummary _x = _copy(); _x.changedFields = changedFields.add("setting"); _x.odataType = Util.nvl(odataType, "microsoft.graph.deviceCompliancePolicySettingStateSummary"); _x.setting = setting; return _x; } /** * “Name of the setting.” * * @return property settingName */ @Property(name="settingName") @JsonIgnore public Optional getSettingName() { return Optional.ofNullable(settingName); } /** * Returns an immutable copy of {@code this} with just the {@code settingName} * 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 of the setting.” * * @param settingName * new value of {@code settingName} field (as defined in service metadata) * @return immutable copy of {@code this} with just the {@code settingName} field changed */ public DeviceCompliancePolicySettingStateSummary withSettingName(String settingName) { DeviceCompliancePolicySettingStateSummary _x = _copy(); _x.changedFields = changedFields.add("settingName"); _x.odataType = Util.nvl(odataType, "microsoft.graph.deviceCompliancePolicySettingStateSummary"); _x.settingName = settingName; return _x; } /** * “Number of unknown devices” * * @return property unknownDeviceCount */ @Property(name="unknownDeviceCount") @JsonIgnore public Optional getUnknownDeviceCount() { return Optional.ofNullable(unknownDeviceCount); } /** * Returns an immutable copy of {@code this} with just the {@code * unknownDeviceCount} 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. *

* “Number of unknown devices” * * @param unknownDeviceCount * new value of {@code unknownDeviceCount} field (as defined in service metadata) * @return immutable copy of {@code this} with just the {@code unknownDeviceCount} field changed */ public DeviceCompliancePolicySettingStateSummary withUnknownDeviceCount(Integer unknownDeviceCount) { DeviceCompliancePolicySettingStateSummary _x = _copy(); _x.changedFields = changedFields.add("unknownDeviceCount"); _x.odataType = Util.nvl(odataType, "microsoft.graph.deviceCompliancePolicySettingStateSummary"); _x.unknownDeviceCount = unknownDeviceCount; return _x; } public DeviceCompliancePolicySettingStateSummary withUnmappedField(String name, String value) { DeviceCompliancePolicySettingStateSummary _x = _copy(); _x.setUnmappedField(name, value); return _x; } @NavigationProperty(name="deviceComplianceSettingStates") @JsonIgnore public DeviceComplianceSettingStateCollectionRequest getDeviceComplianceSettingStates() { return new DeviceComplianceSettingStateCollectionRequest( contextPath.addSegment("deviceComplianceSettingStates"), RequestHelper.getValue(unmappedFields, "deviceComplianceSettingStates")); } @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 DeviceCompliancePolicySettingStateSummary patch() { RequestHelper.patch(this, contextPath, RequestOptions.EMPTY); DeviceCompliancePolicySettingStateSummary _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 DeviceCompliancePolicySettingStateSummary put() { RequestHelper.put(this, contextPath, RequestOptions.EMPTY); DeviceCompliancePolicySettingStateSummary _x = _copy(); _x.changedFields = null; return _x; } private DeviceCompliancePolicySettingStateSummary _copy() { DeviceCompliancePolicySettingStateSummary _x = new DeviceCompliancePolicySettingStateSummary(); _x.contextPath = contextPath; _x.changedFields = changedFields; _x.unmappedFields = unmappedFields.copy(); _x.odataType = odataType; _x.id = id; _x.compliantDeviceCount = compliantDeviceCount; _x.conflictDeviceCount = conflictDeviceCount; _x.errorDeviceCount = errorDeviceCount; _x.nonCompliantDeviceCount = nonCompliantDeviceCount; _x.notApplicableDeviceCount = notApplicableDeviceCount; _x.platformType = platformType; _x.remediatedDeviceCount = remediatedDeviceCount; _x.setting = setting; _x.settingName = settingName; _x.unknownDeviceCount = unknownDeviceCount; return _x; } @Override public String toString() { StringBuilder b = new StringBuilder(); b.append("DeviceCompliancePolicySettingStateSummary["); b.append("id="); b.append(this.id); b.append(", "); b.append("compliantDeviceCount="); b.append(this.compliantDeviceCount); b.append(", "); b.append("conflictDeviceCount="); b.append(this.conflictDeviceCount); b.append(", "); b.append("errorDeviceCount="); b.append(this.errorDeviceCount); b.append(", "); b.append("nonCompliantDeviceCount="); b.append(this.nonCompliantDeviceCount); b.append(", "); b.append("notApplicableDeviceCount="); b.append(this.notApplicableDeviceCount); b.append(", "); b.append("platformType="); b.append(this.platformType); b.append(", "); b.append("remediatedDeviceCount="); b.append(this.remediatedDeviceCount); b.append(", "); b.append("setting="); b.append(this.setting); b.append(", "); b.append("settingName="); b.append(this.settingName); b.append(", "); b.append("unknownDeviceCount="); b.append(this.unknownDeviceCount); b.append("]"); b.append(",unmappedFields="); b.append(unmappedFields); b.append(",odataType="); b.append(odataType); return b.toString(); } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy