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

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

The newest version!
package microsoft.dynamics.crm.entity.collection.request;

import com.github.davidmoten.odata.client.CollectionPageEntityRequest;
import com.github.davidmoten.odata.client.ContextPath;
import com.github.davidmoten.odata.client.NameValue;

import java.lang.Object;
import java.util.Optional;
import java.util.UUID;

import microsoft.dynamics.crm.entity.EntityMetadata;
import microsoft.dynamics.crm.entity.request.AttributeMetadataRequest;
import microsoft.dynamics.crm.entity.request.EntityKeyMetadataRequest;
import microsoft.dynamics.crm.entity.request.EntityMetadataRequest;
import microsoft.dynamics.crm.entity.request.ManyToManyRelationshipMetadataRequest;
import microsoft.dynamics.crm.entity.request.OneToManyRelationshipMetadataRequest;

public class EntityMetadataCollectionRequest extends CollectionPageEntityRequest{

    protected ContextPath contextPath;

    public EntityMetadataCollectionRequest(ContextPath contextPath, Optional value) {
        super(contextPath, EntityMetadata.class, cp -> new EntityMetadataRequest(cp, Optional.empty()), value);
        this.contextPath = contextPath;
    }

    public AttributeMetadataRequest attributes(UUID metadataId) {
        return new AttributeMetadataRequest(contextPath.addSegment("Attributes").addKeys(new NameValue(metadataId, UUID.class)), Optional.empty());
    }

    public AttributeMetadataCollectionRequest attributes() {
        return new AttributeMetadataCollectionRequest(contextPath.addSegment("Attributes"), Optional.empty());
    }

    public ManyToManyRelationshipMetadataRequest manyToManyRelationships2(UUID metadataId) {
        return new ManyToManyRelationshipMetadataRequest(contextPath.addSegment("ManyToManyRelationships2").addKeys(new NameValue(metadataId, UUID.class)), Optional.empty());
    }

    public ManyToManyRelationshipMetadataCollectionRequest manyToManyRelationships2() {
        return new ManyToManyRelationshipMetadataCollectionRequest(contextPath.addSegment("ManyToManyRelationships2"), Optional.empty());
    }

    public OneToManyRelationshipMetadataRequest manyToOneRelationships2(UUID metadataId) {
        return new OneToManyRelationshipMetadataRequest(contextPath.addSegment("ManyToOneRelationships2").addKeys(new NameValue(metadataId, UUID.class)), Optional.empty());
    }

    public OneToManyRelationshipMetadataCollectionRequest manyToOneRelationships2() {
        return new OneToManyRelationshipMetadataCollectionRequest(contextPath.addSegment("ManyToOneRelationships2"), Optional.empty());
    }

    public OneToManyRelationshipMetadataRequest oneToManyRelationships2(UUID metadataId) {
        return new OneToManyRelationshipMetadataRequest(contextPath.addSegment("OneToManyRelationships2").addKeys(new NameValue(metadataId, UUID.class)), Optional.empty());
    }

    public OneToManyRelationshipMetadataCollectionRequest oneToManyRelationships2() {
        return new OneToManyRelationshipMetadataCollectionRequest(contextPath.addSegment("OneToManyRelationships2"), Optional.empty());
    }

    public EntityKeyMetadataRequest keys(UUID metadataId) {
        return new EntityKeyMetadataRequest(contextPath.addSegment("Keys").addKeys(new NameValue(metadataId, UUID.class)), Optional.empty());
    }

    public EntityKeyMetadataCollectionRequest keys() {
        return new EntityKeyMetadataCollectionRequest(contextPath.addSegment("Keys"), Optional.empty());
    }

}