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

odata.msgraph.client.beta.entity.collection.request.PolicySetCollectionRequest Maven / Gradle / Ivy

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

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.github.davidmoten.odata.client.CollectionPageEntityRequest;
import com.github.davidmoten.odata.client.CollectionPageNonEntityRequest;
import com.github.davidmoten.odata.client.ContextPath;
import com.github.davidmoten.odata.client.NameValue;
import com.github.davidmoten.odata.client.annotation.Action;
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.entity.PolicySet;
import odata.msgraph.client.beta.entity.request.PolicySetAssignmentRequest;
import odata.msgraph.client.beta.entity.request.PolicySetItemRequest;
import odata.msgraph.client.beta.entity.request.PolicySetRequest;

public class PolicySetCollectionRequest extends CollectionPageEntityRequest{

    protected ContextPath contextPath;

    public PolicySetCollectionRequest(ContextPath contextPath, Optional value) {
        super(contextPath, PolicySet.class, cp -> new PolicySetRequest(cp, Optional.empty()), value);
        this.contextPath = contextPath;
    }

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

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

    public PolicySetItemCollectionRequest items() {
        return new PolicySetItemCollectionRequest(contextPath.addSegment("items"), Optional.empty());
    }

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

    @Action(name = "getPolicySets")
    @JsonIgnore
    public CollectionPageNonEntityRequest getPolicySets(List policySetIds) {
        Map _parameters = ParameterMap
            .put("policySetIds", "Collection(Edm.String)", Checks.checkIsAscii(policySetIds))
            .build();
        return CollectionPageNonEntityRequest.forAction(this.contextPath.addActionOrFunctionSegment("microsoft.graph.getPolicySets"), PolicySet.class, _parameters);
    }

}