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

microsoft.dynamics.crm.entity.collection.request.SavedqueryCollectionRequest Maven / Gradle / Ivy

There is a newer version: 0.2.2
Show newest version
package microsoft.dynamics.crm.entity.collection.request;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.github.davidmoten.guavamini.Preconditions;
import com.github.davidmoten.odata.client.ActionRequestNoReturn;
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.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.util.Map;

import microsoft.dynamics.crm.entity.Savedquery;
import microsoft.dynamics.crm.entity.request.AsyncoperationRequest;
import microsoft.dynamics.crm.entity.request.BulkdeletefailureRequest;
import microsoft.dynamics.crm.entity.request.MobileofflineprofileitemRequest;
import microsoft.dynamics.crm.entity.request.SavedqueryRequest;
import microsoft.dynamics.crm.entity.request.SyncerrorRequest;
import microsoft.dynamics.crm.schema.SchemaInfo;

public class SavedqueryCollectionRequest extends CollectionPageEntityRequest{

    protected ContextPath contextPath;

    public SavedqueryCollectionRequest(ContextPath contextPath) {
        super(contextPath, Savedquery.class, cp -> new SavedqueryRequest(cp), SchemaInfo.INSTANCE);
        this.contextPath = contextPath;
    }

    public SyncerrorCollectionRequest savedQuery_SyncErrors() {
        return new SyncerrorCollectionRequest(contextPath.addSegment("SavedQuery_SyncErrors"));
    }

    public SyncerrorRequest savedQuery_SyncErrors(String syncerrorid) {
        return new SyncerrorRequest(contextPath.addSegment("SavedQuery_SyncErrors").addKeys(new NameValue(syncerrorid.toString())));
    }

    public AsyncoperationCollectionRequest savedQuery_AsyncOperations() {
        return new AsyncoperationCollectionRequest(contextPath.addSegment("SavedQuery_AsyncOperations"));
    }

    public AsyncoperationRequest savedQuery_AsyncOperations(String asyncoperationid) {
        return new AsyncoperationRequest(contextPath.addSegment("SavedQuery_AsyncOperations").addKeys(new NameValue(asyncoperationid.toString())));
    }

    public BulkdeletefailureCollectionRequest savedQuery_BulkDeleteFailures() {
        return new BulkdeletefailureCollectionRequest(contextPath.addSegment("SavedQuery_BulkDeleteFailures"));
    }

    public BulkdeletefailureRequest savedQuery_BulkDeleteFailures(String bulkdeletefailureid) {
        return new BulkdeletefailureRequest(contextPath.addSegment("SavedQuery_BulkDeleteFailures").addKeys(new NameValue(bulkdeletefailureid.toString())));
    }

    public MobileofflineprofileitemCollectionRequest lk_mobileofflineprofileitem_savedquery() {
        return new MobileofflineprofileitemCollectionRequest(contextPath.addSegment("lk_mobileofflineprofileitem_savedquery"));
    }

    public MobileofflineprofileitemRequest lk_mobileofflineprofileitem_savedquery(String mobileofflineprofileitemid) {
        return new MobileofflineprofileitemRequest(contextPath.addSegment("lk_mobileofflineprofileitem_savedquery").addKeys(new NameValue(mobileofflineprofileitemid.toString())));
    }

    @Action(name = "ValidateSavedQuery")
    @JsonIgnore
    public ActionRequestNoReturn validateSavedQuery(String fetchXml, Integer queryType) {
        Preconditions.checkNotNull(fetchXml, "fetchXml cannot be null");
        Preconditions.checkNotNull(queryType, "queryType cannot be null");
        Map _parameters = ParameterMap
            .put("FetchXml", "Edm.String", Checks.checkIsAscii(fetchXml))
            .put("QueryType", "Edm.Int32", queryType)
            .build();
        return new ActionRequestNoReturn(this.contextPath.addActionOrFunctionSegment("Microsoft.Dynamics.CRM.ValidateSavedQuery"), _parameters);
    }

    @Function(name = "RetrieveUnpublishedMultiple")
    @JsonIgnore
    public CollectionPageNonEntityRequest retrieveUnpublishedMultiple() {
        Map _parameters = ParameterMap.empty();
        return CollectionPageNonEntityRequest.forFunction(this.contextPath.addActionOrFunctionSegment("Microsoft.Dynamics.CRM.RetrieveUnpublishedMultiple"), Savedquery.class, _parameters, microsoft.dynamics.crm.schema.SchemaInfo.INSTANCE);
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy