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

odata.msgraph.client.beta.entity.request.DeviceManagementTemplateRequest Maven / Gradle / Ivy

There is a newer version: 0.2.2
Show newest version
package odata.msgraph.client.beta.entity.request;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreType;
import com.github.davidmoten.guavamini.Preconditions;
import com.github.davidmoten.odata.client.ActionRequestReturningNonCollectionUnwrapped;
import com.github.davidmoten.odata.client.CollectionPageNonEntityRequest;
import com.github.davidmoten.odata.client.ContextPath;
import com.github.davidmoten.odata.client.EntityRequest;
import com.github.davidmoten.odata.client.NameValue;
import com.github.davidmoten.odata.client.annotation.Action;
import com.github.davidmoten.odata.client.annotation.Function;
import com.github.davidmoten.odata.client.internal.Checks;
import com.github.davidmoten.odata.client.internal.ParameterMap;
import com.github.davidmoten.odata.client.internal.TypedObject;

import java.lang.Object;
import java.lang.String;
import java.util.List;
import java.util.Map;
import java.util.Optional;

import odata.msgraph.client.beta.complex.DeviceManagementSettingComparison;
import odata.msgraph.client.beta.entity.DeviceManagementIntent;
import odata.msgraph.client.beta.entity.DeviceManagementSettingInstance;
import odata.msgraph.client.beta.entity.DeviceManagementTemplate;
import odata.msgraph.client.beta.entity.collection.request.DeviceManagementSettingInstanceCollectionRequest;
import odata.msgraph.client.beta.entity.collection.request.DeviceManagementTemplateCollectionRequest;
import odata.msgraph.client.beta.entity.collection.request.DeviceManagementTemplateSettingCategoryCollectionRequest;

@JsonIgnoreType
public class DeviceManagementTemplateRequest extends EntityRequest {

    public DeviceManagementTemplateRequest(ContextPath contextPath, Optional value) {
        super(DeviceManagementTemplate.class, contextPath, value, false);
    }

    public DeviceManagementTemplateSettingCategoryCollectionRequest categories() {
        return new DeviceManagementTemplateSettingCategoryCollectionRequest(
                        contextPath.addSegment("categories"), Optional.empty());
    }

    public DeviceManagementTemplateSettingCategoryRequest categories(String id) {
        return new DeviceManagementTemplateSettingCategoryRequest(contextPath.addSegment("categories").addKeys(new NameValue(id.toString())), Optional.empty());
    }

    public DeviceManagementTemplateCollectionRequest migratableTo() {
        return new DeviceManagementTemplateCollectionRequest(
                        contextPath.addSegment("migratableTo"), Optional.empty());
    }

    public DeviceManagementTemplateRequest migratableTo(String id) {
        return new DeviceManagementTemplateRequest(contextPath.addSegment("migratableTo").addKeys(new NameValue(id.toString())), Optional.empty());
    }

    public DeviceManagementSettingInstanceCollectionRequest settings() {
        return new DeviceManagementSettingInstanceCollectionRequest(
                        contextPath.addSegment("settings"), Optional.empty());
    }

    public DeviceManagementSettingInstanceRequest settings(String id) {
        return new DeviceManagementSettingInstanceRequest(contextPath.addSegment("settings").addKeys(new NameValue(id.toString())), Optional.empty());
    }

    @Action(name = "createInstance")
    @JsonIgnore
    public ActionRequestReturningNonCollectionUnwrapped createInstance(String displayName, String description, List settingsDelta, List roleScopeTagIds) {
        Map _parameters = ParameterMap
            .put("displayName", "Edm.String", Checks.checkIsAscii(displayName))
            .put("description", "Edm.String", Checks.checkIsAscii(description))
            .put("settingsDelta", "Collection(microsoft.graph.deviceManagementSettingInstance)", settingsDelta)
            .put("roleScopeTagIds", "Collection(Edm.String)", Checks.checkIsAscii(roleScopeTagIds))
            .build();
        return new ActionRequestReturningNonCollectionUnwrapped(this.contextPath.addActionOrFunctionSegment("microsoft.graph.createInstance"), DeviceManagementIntent.class, _parameters);
    }

    @Function(name = "compare")
    @JsonIgnore
    public CollectionPageNonEntityRequest compare(String templateId) {
        Preconditions.checkNotNull(templateId, "templateId cannot be null");
        Map _parameters = ParameterMap
            .put("templateId", "Edm.String", Checks.checkIsAscii(templateId))
            .build();
        return CollectionPageNonEntityRequest.forFunction(this.contextPath.addActionOrFunctionSegment("microsoft.graph.compare"), DeviceManagementSettingComparison.class, _parameters);
    }

}