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

odata.msgraph.client.beta.entity.request.DeviceManagementResourceAccessProfileBaseRequest 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.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.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.entity.DeviceManagementResourceAccessProfileAssignment;
import odata.msgraph.client.beta.entity.DeviceManagementResourceAccessProfileBase;
import odata.msgraph.client.beta.entity.collection.request.DeviceManagementResourceAccessProfileAssignmentCollectionRequest;

@JsonIgnoreType
public class DeviceManagementResourceAccessProfileBaseRequest extends EntityRequest {

    public DeviceManagementResourceAccessProfileBaseRequest(ContextPath contextPath, Optional value) {
        super(DeviceManagementResourceAccessProfileBase.class, contextPath, value, false);
    }

    public DeviceManagementResourceAccessProfileAssignmentCollectionRequest assignments() {
        return new DeviceManagementResourceAccessProfileAssignmentCollectionRequest(
                        contextPath.addSegment("assignments"), Optional.empty());
    }

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

    @Action(name = "assign")
    @JsonIgnore
    public CollectionPageNonEntityRequest assign(List assignments) {
        Map _parameters = ParameterMap
            .put("assignments", "Collection(microsoft.graph.deviceManagementResourceAccessProfileAssignment)", assignments)
            .build();
        return CollectionPageNonEntityRequest.forAction(this.contextPath.addActionOrFunctionSegment("microsoft.graph.assign"), DeviceManagementResourceAccessProfileAssignment.class, _parameters);
    }

}