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

microsoft.dynamics.crm.entity.Relationshipattribute Maven / Gradle / Ivy

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

import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.github.davidmoten.odata.client.ClientException;
import com.github.davidmoten.odata.client.NameValue;
import com.github.davidmoten.odata.client.ODataEntityType;
import com.github.davidmoten.odata.client.RequestOptions;
import com.github.davidmoten.odata.client.Util;
import com.github.davidmoten.odata.client.annotation.NavigationProperty;
import com.github.davidmoten.odata.client.annotation.Property;
import com.github.davidmoten.odata.client.internal.ChangedFields;
import com.github.davidmoten.odata.client.internal.Checks;
import com.github.davidmoten.odata.client.internal.RequestHelper;
import com.github.davidmoten.odata.client.internal.UnmappedFields;

import java.time.OffsetDateTime;
import java.util.Optional;

import microsoft.dynamics.crm.complex.BooleanManagedProperty;
import microsoft.dynamics.crm.entity.collection.request.AsyncoperationCollectionRequest;
import microsoft.dynamics.crm.entity.collection.request.BulkdeletefailureCollectionRequest;
import microsoft.dynamics.crm.entity.collection.request.MailboxtrackingfolderCollectionRequest;
import microsoft.dynamics.crm.entity.collection.request.PrincipalobjectattributeaccessCollectionRequest;
import microsoft.dynamics.crm.entity.collection.request.SyncerrorCollectionRequest;
import microsoft.dynamics.crm.entity.request.AttributeRequest;
import microsoft.dynamics.crm.entity.request.RelationshipRequest;

@JsonPropertyOrder({
    "@odata.type", 
    "componentstate", 
    "ismanaged", 
    "_referencedattributeid_value", 
    "name", 
    "overwritetime", 
    "relationshipattributeid", 
    "iscustomizable", 
    "componentidunique", 
    "solutionid", 
    "_relationshipid_value", 
    "_referencingattributeid_value"})
@JsonInclude(Include.NON_NULL)
public class Relationshipattribute extends Crmbaseentity implements ODataEntityType {

    @Override
    public String odataTypeName() {
        return "Microsoft.Dynamics.CRM.relationshipattribute";
    }

    @JsonProperty("componentstate")
    protected Integer componentstate;

    @JsonProperty("ismanaged")
    protected Boolean ismanaged;

    @JsonProperty("_referencedattributeid_value")
    protected String _referencedattributeid_value;

    @JsonProperty("name")
    protected String name;

    @JsonProperty("overwritetime")
    protected OffsetDateTime overwritetime;

    @JsonProperty("relationshipattributeid")
    protected String relationshipattributeid;

    @JsonProperty("iscustomizable")
    protected BooleanManagedProperty iscustomizable;

    @JsonProperty("componentidunique")
    protected String componentidunique;

    @JsonProperty("solutionid")
    protected String solutionid;

    @JsonProperty("_relationshipid_value")
    protected String _relationshipid_value;

    @JsonProperty("_referencingattributeid_value")
    protected String _referencingattributeid_value;

    protected Relationshipattribute() {
        super();
    }

    /**
     * Returns a builder which is used to create a new
     * instance of this class (given that this class is immutable).
     *
     * @return a new Builder for this class
     */
    // Suffix used on builder factory method to differentiate the method
    // from static builder methods on superclasses
    public static Builder builderRelationshipattribute() {
        return new Builder();
    }

    public static final class Builder {
        private Integer componentstate;
        private Boolean ismanaged;
        private String _referencedattributeid_value;
        private String name;
        private OffsetDateTime overwritetime;
        private String relationshipattributeid;
        private BooleanManagedProperty iscustomizable;
        private String componentidunique;
        private String solutionid;
        private String _relationshipid_value;
        private String _referencingattributeid_value;
        private ChangedFields changedFields = new ChangedFields();

        Builder() {
            // prevent instantiation
        }

        public Builder componentstate(Integer componentstate) {
            this.componentstate = componentstate;
            this.changedFields = changedFields.add("componentstate");
            return this;
        }

        public Builder ismanaged(Boolean ismanaged) {
            this.ismanaged = ismanaged;
            this.changedFields = changedFields.add("ismanaged");
            return this;
        }

        public Builder _referencedattributeid_value(String _referencedattributeid_value) {
            this._referencedattributeid_value = _referencedattributeid_value;
            this.changedFields = changedFields.add("_referencedattributeid_value");
            return this;
        }

        public Builder name(String name) {
            this.name = name;
            this.changedFields = changedFields.add("name");
            return this;
        }

        public Builder overwritetime(OffsetDateTime overwritetime) {
            this.overwritetime = overwritetime;
            this.changedFields = changedFields.add("overwritetime");
            return this;
        }

        public Builder relationshipattributeid(String relationshipattributeid) {
            this.relationshipattributeid = relationshipattributeid;
            this.changedFields = changedFields.add("relationshipattributeid");
            return this;
        }

        public Builder iscustomizable(BooleanManagedProperty iscustomizable) {
            this.iscustomizable = iscustomizable;
            this.changedFields = changedFields.add("iscustomizable");
            return this;
        }

        public Builder componentidunique(String componentidunique) {
            this.componentidunique = componentidunique;
            this.changedFields = changedFields.add("componentidunique");
            return this;
        }

        public Builder solutionid(String solutionid) {
            this.solutionid = solutionid;
            this.changedFields = changedFields.add("solutionid");
            return this;
        }

        public Builder _relationshipid_value(String _relationshipid_value) {
            this._relationshipid_value = _relationshipid_value;
            this.changedFields = changedFields.add("_relationshipid_value");
            return this;
        }

        public Builder _referencingattributeid_value(String _referencingattributeid_value) {
            this._referencingattributeid_value = _referencingattributeid_value;
            this.changedFields = changedFields.add("_referencingattributeid_value");
            return this;
        }

        public Relationshipattribute build() {
            Relationshipattribute _x = new Relationshipattribute();
            _x.contextPath = null;
            _x.changedFields = changedFields;
            _x.unmappedFields = new UnmappedFields();
            _x.odataType = "Microsoft.Dynamics.CRM.relationshipattribute";
            _x.componentstate = componentstate;
            _x.ismanaged = ismanaged;
            _x._referencedattributeid_value = _referencedattributeid_value;
            _x.name = name;
            _x.overwritetime = overwritetime;
            _x.relationshipattributeid = relationshipattributeid;
            _x.iscustomizable = iscustomizable;
            _x.componentidunique = componentidunique;
            _x.solutionid = solutionid;
            _x._relationshipid_value = _relationshipid_value;
            _x._referencingattributeid_value = _referencingattributeid_value;
            return _x;
        }
    }

    @Override
    @JsonIgnore
    public ChangedFields getChangedFields() {
        return changedFields;
    }

    @Override
    public void postInject(boolean addKeysToContextPath) {
        if (addKeysToContextPath && relationshipattributeid != null) {
            contextPath = contextPath.clearQueries().addKeys(new NameValue(relationshipattributeid.toString()));
        }
    }

    @Property(name="componentstate")
    @JsonIgnore
    public Optional getComponentstate() {
        return Optional.ofNullable(componentstate);
    }

    public Relationshipattribute withComponentstate(Integer componentstate) {
        Relationshipattribute _x = _copy();
        _x.changedFields = changedFields.add("componentstate");
        _x.odataType = Util.nvl(odataType, "Microsoft.Dynamics.CRM.relationshipattribute");
        _x.componentstate = componentstate;
        return _x;
    }

    @Property(name="ismanaged")
    @JsonIgnore
    public Optional getIsmanaged() {
        return Optional.ofNullable(ismanaged);
    }

    public Relationshipattribute withIsmanaged(Boolean ismanaged) {
        Relationshipattribute _x = _copy();
        _x.changedFields = changedFields.add("ismanaged");
        _x.odataType = Util.nvl(odataType, "Microsoft.Dynamics.CRM.relationshipattribute");
        _x.ismanaged = ismanaged;
        return _x;
    }

    @Property(name="_referencedattributeid_value")
    @JsonIgnore
    public Optional get_referencedattributeid_value() {
        return Optional.ofNullable(_referencedattributeid_value);
    }

    public Relationshipattribute with_referencedattributeid_value(String _referencedattributeid_value) {
        Relationshipattribute _x = _copy();
        _x.changedFields = changedFields.add("_referencedattributeid_value");
        _x.odataType = Util.nvl(odataType, "Microsoft.Dynamics.CRM.relationshipattribute");
        _x._referencedattributeid_value = _referencedattributeid_value;
        return _x;
    }

    @Property(name="name")
    @JsonIgnore
    public Optional getName() {
        return Optional.ofNullable(name);
    }

    public Relationshipattribute withName(String name) {
        Checks.checkIsAscii(name);
        Relationshipattribute _x = _copy();
        _x.changedFields = changedFields.add("name");
        _x.odataType = Util.nvl(odataType, "Microsoft.Dynamics.CRM.relationshipattribute");
        _x.name = name;
        return _x;
    }

    @Property(name="overwritetime")
    @JsonIgnore
    public Optional getOverwritetime() {
        return Optional.ofNullable(overwritetime);
    }

    public Relationshipattribute withOverwritetime(OffsetDateTime overwritetime) {
        Relationshipattribute _x = _copy();
        _x.changedFields = changedFields.add("overwritetime");
        _x.odataType = Util.nvl(odataType, "Microsoft.Dynamics.CRM.relationshipattribute");
        _x.overwritetime = overwritetime;
        return _x;
    }

    @Property(name="relationshipattributeid")
    @JsonIgnore
    public Optional getRelationshipattributeid() {
        return Optional.ofNullable(relationshipattributeid);
    }

    public Relationshipattribute withRelationshipattributeid(String relationshipattributeid) {
        Relationshipattribute _x = _copy();
        _x.changedFields = changedFields.add("relationshipattributeid");
        _x.odataType = Util.nvl(odataType, "Microsoft.Dynamics.CRM.relationshipattribute");
        _x.relationshipattributeid = relationshipattributeid;
        return _x;
    }

    @Property(name="iscustomizable")
    @JsonIgnore
    public Optional getIscustomizable() {
        return Optional.ofNullable(iscustomizable);
    }

    public Relationshipattribute withIscustomizable(BooleanManagedProperty iscustomizable) {
        Relationshipattribute _x = _copy();
        _x.changedFields = changedFields.add("iscustomizable");
        _x.odataType = Util.nvl(odataType, "Microsoft.Dynamics.CRM.relationshipattribute");
        _x.iscustomizable = iscustomizable;
        return _x;
    }

    @Property(name="componentidunique")
    @JsonIgnore
    public Optional getComponentidunique() {
        return Optional.ofNullable(componentidunique);
    }

    public Relationshipattribute withComponentidunique(String componentidunique) {
        Relationshipattribute _x = _copy();
        _x.changedFields = changedFields.add("componentidunique");
        _x.odataType = Util.nvl(odataType, "Microsoft.Dynamics.CRM.relationshipattribute");
        _x.componentidunique = componentidunique;
        return _x;
    }

    @Property(name="solutionid")
    @JsonIgnore
    public Optional getSolutionid() {
        return Optional.ofNullable(solutionid);
    }

    public Relationshipattribute withSolutionid(String solutionid) {
        Relationshipattribute _x = _copy();
        _x.changedFields = changedFields.add("solutionid");
        _x.odataType = Util.nvl(odataType, "Microsoft.Dynamics.CRM.relationshipattribute");
        _x.solutionid = solutionid;
        return _x;
    }

    @Property(name="_relationshipid_value")
    @JsonIgnore
    public Optional get_relationshipid_value() {
        return Optional.ofNullable(_relationshipid_value);
    }

    public Relationshipattribute with_relationshipid_value(String _relationshipid_value) {
        Relationshipattribute _x = _copy();
        _x.changedFields = changedFields.add("_relationshipid_value");
        _x.odataType = Util.nvl(odataType, "Microsoft.Dynamics.CRM.relationshipattribute");
        _x._relationshipid_value = _relationshipid_value;
        return _x;
    }

    @Property(name="_referencingattributeid_value")
    @JsonIgnore
    public Optional get_referencingattributeid_value() {
        return Optional.ofNullable(_referencingattributeid_value);
    }

    public Relationshipattribute with_referencingattributeid_value(String _referencingattributeid_value) {
        Relationshipattribute _x = _copy();
        _x.changedFields = changedFields.add("_referencingattributeid_value");
        _x.odataType = Util.nvl(odataType, "Microsoft.Dynamics.CRM.relationshipattribute");
        _x._referencingattributeid_value = _referencingattributeid_value;
        return _x;
    }

    @NavigationProperty(name="relationshipattribute_SyncErrors")
    @JsonIgnore
    public SyncerrorCollectionRequest getRelationshipattribute_SyncErrors() {
        return new SyncerrorCollectionRequest(
                        contextPath.addSegment("relationshipattribute_SyncErrors"));
    }

    @NavigationProperty(name="relationshipattribute_AsyncOperations")
    @JsonIgnore
    public AsyncoperationCollectionRequest getRelationshipattribute_AsyncOperations() {
        return new AsyncoperationCollectionRequest(
                        contextPath.addSegment("relationshipattribute_AsyncOperations"));
    }

    @NavigationProperty(name="relationshipattribute_MailboxTrackingFolders")
    @JsonIgnore
    public MailboxtrackingfolderCollectionRequest getRelationshipattribute_MailboxTrackingFolders() {
        return new MailboxtrackingfolderCollectionRequest(
                        contextPath.addSegment("relationshipattribute_MailboxTrackingFolders"));
    }

    @NavigationProperty(name="relationshipattribute_BulkDeleteFailures")
    @JsonIgnore
    public BulkdeletefailureCollectionRequest getRelationshipattribute_BulkDeleteFailures() {
        return new BulkdeletefailureCollectionRequest(
                        contextPath.addSegment("relationshipattribute_BulkDeleteFailures"));
    }

    @NavigationProperty(name="relationshipattribute_PrincipalObjectAttributeAccesses")
    @JsonIgnore
    public PrincipalobjectattributeaccessCollectionRequest getRelationshipattribute_PrincipalObjectAttributeAccesses() {
        return new PrincipalobjectattributeaccessCollectionRequest(
                        contextPath.addSegment("relationshipattribute_PrincipalObjectAttributeAccesses"));
    }

    @NavigationProperty(name="referencingattributeid_relationshipattribute")
    @JsonIgnore
    public AttributeRequest getReferencingattributeid_relationshipattribute() {
        return new AttributeRequest(contextPath.addSegment("referencingattributeid_relationshipattribute"));
    }

    @NavigationProperty(name="referencedattributeid_relationshipattribute")
    @JsonIgnore
    public AttributeRequest getReferencedattributeid_relationshipattribute() {
        return new AttributeRequest(contextPath.addSegment("referencedattributeid_relationshipattribute"));
    }

    @NavigationProperty(name="relationshipid_relationshipattribute")
    @JsonIgnore
    public RelationshipRequest getRelationshipid_relationshipattribute() {
        return new RelationshipRequest(contextPath.addSegment("relationshipid_relationshipattribute"));
    }

    @JsonAnySetter
    private void setUnmappedField(String name, Object value) {
        if (unmappedFields == null) {
            unmappedFields = new UnmappedFields();
        }
        unmappedFields.put(name, value);
    }

    @Override
    @JsonIgnore
    public UnmappedFields getUnmappedFields() {
        return unmappedFields == null ? new UnmappedFields() : unmappedFields;
    }

    /**
     * Submits only changed fields for update and returns an 
     * immutable copy of {@code this} with changed fields reset.
     *
     * @return a copy of {@code this} with changed fields reset
     * @throws ClientException if HTTP response is not as expected
     */
    public Relationshipattribute patch() {
        RequestHelper.patch(this, contextPath, RequestOptions.EMPTY);
        Relationshipattribute _x = _copy();
        _x.changedFields = null;
        return _x;
    }

    /**
     * Submits all fields for update and returns an immutable copy of {@code this}
     * with changed fields reset (they were ignored anyway).
     *
     * @return a copy of {@code this} with changed fields reset
     * @throws ClientException if HTTP response is not as expected
     */
    public Relationshipattribute put() {
        RequestHelper.put(this, contextPath, RequestOptions.EMPTY);
        Relationshipattribute _x = _copy();
        _x.changedFields = null;
        return _x;
    }

    private Relationshipattribute _copy() {
        Relationshipattribute _x = new Relationshipattribute();
        _x.contextPath = contextPath;
        _x.changedFields = changedFields;
        _x.unmappedFields = unmappedFields;
        _x.odataType = odataType;
        _x.componentstate = componentstate;
        _x.ismanaged = ismanaged;
        _x._referencedattributeid_value = _referencedattributeid_value;
        _x.name = name;
        _x.overwritetime = overwritetime;
        _x.relationshipattributeid = relationshipattributeid;
        _x.iscustomizable = iscustomizable;
        _x.componentidunique = componentidunique;
        _x.solutionid = solutionid;
        _x._relationshipid_value = _relationshipid_value;
        _x._referencingattributeid_value = _referencingattributeid_value;
        return _x;
    }

    @Override
    public String toString() {
        StringBuilder b = new StringBuilder();
        b.append("Relationshipattribute[");
        b.append("componentstate=");
        b.append(this.componentstate);
        b.append(", ");
        b.append("ismanaged=");
        b.append(this.ismanaged);
        b.append(", ");
        b.append("_referencedattributeid_value=");
        b.append(this._referencedattributeid_value);
        b.append(", ");
        b.append("name=");
        b.append(this.name);
        b.append(", ");
        b.append("overwritetime=");
        b.append(this.overwritetime);
        b.append(", ");
        b.append("relationshipattributeid=");
        b.append(this.relationshipattributeid);
        b.append(", ");
        b.append("iscustomizable=");
        b.append(this.iscustomizable);
        b.append(", ");
        b.append("componentidunique=");
        b.append(this.componentidunique);
        b.append(", ");
        b.append("solutionid=");
        b.append(this.solutionid);
        b.append(", ");
        b.append("_relationshipid_value=");
        b.append(this._relationshipid_value);
        b.append(", ");
        b.append("_referencingattributeid_value=");
        b.append(this._referencingattributeid_value);
        b.append("]");
        b.append(",unmappedFields=");
        b.append(unmappedFields);
        b.append(",odataType=");
        b.append(odataType);
        return b.toString();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy