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

odata.msgraph.client.entity.ResellerDelegatedAdminRelationship Maven / Gradle / Ivy

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

import com.fasterxml.jackson.annotation.JsonAnyGetter;
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.UnmappedFields;
import com.github.davidmoten.odata.client.Util;
import com.github.davidmoten.odata.client.annotation.Property;
import com.github.davidmoten.odata.client.internal.ChangedFields;
import com.github.davidmoten.odata.client.internal.RequestHelper;
import com.github.davidmoten.odata.client.internal.UnmappedFieldsImpl;

import java.lang.Boolean;
import java.lang.Object;
import java.lang.Override;
import java.lang.String;
import java.lang.StringBuilder;
import java.time.Duration;
import java.time.OffsetDateTime;
import java.util.Arrays;
import java.util.List;
import java.util.Optional;

import odata.msgraph.client.complex.DelegatedAdminAccessDetails;
import odata.msgraph.client.complex.DelegatedAdminRelationshipCustomerParticipant;
import odata.msgraph.client.enums.DelegatedAdminRelationshipStatus;

@JsonPropertyOrder({
    "@odata.type", 
    "indirectProviderTenantId", 
    "isPartnerConsentPending"})
@JsonInclude(Include.NON_NULL)
public class ResellerDelegatedAdminRelationship extends DelegatedAdminRelationship implements ODataEntityType {

    @Override
    public String odataTypeName() {
        return "microsoft.graph.resellerDelegatedAdminRelationship";
    }

    @JsonProperty("indirectProviderTenantId")
    protected String indirectProviderTenantId;

    @JsonProperty("isPartnerConsentPending")
    protected Boolean isPartnerConsentPending;

    protected ResellerDelegatedAdminRelationship() {
        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 builderResellerDelegatedAdminRelationship() {
        return new Builder();
    }

    public static final class Builder {
        private String id;
        private DelegatedAdminAccessDetails accessDetails;
        private OffsetDateTime activatedDateTime;
        private Duration autoExtendDuration;
        private OffsetDateTime createdDateTime;
        private DelegatedAdminRelationshipCustomerParticipant customer;
        private String displayName;
        private Duration duration;
        private OffsetDateTime endDateTime;
        private OffsetDateTime lastModifiedDateTime;
        private DelegatedAdminRelationshipStatus status;
        private List accessAssignments;
        private List operations;
        private List requests;
        private String indirectProviderTenantId;
        private Boolean isPartnerConsentPending;
        private ChangedFields changedFields = ChangedFields.EMPTY;

        Builder() {
            // prevent instantiation
        }

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

        public Builder accessDetails(DelegatedAdminAccessDetails accessDetails) {
            this.accessDetails = accessDetails;
            this.changedFields = changedFields.add("accessDetails");
            return this;
        }

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

        public Builder autoExtendDuration(Duration autoExtendDuration) {
            this.autoExtendDuration = autoExtendDuration;
            this.changedFields = changedFields.add("autoExtendDuration");
            return this;
        }

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

        public Builder customer(DelegatedAdminRelationshipCustomerParticipant customer) {
            this.customer = customer;
            this.changedFields = changedFields.add("customer");
            return this;
        }

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

        public Builder duration(Duration duration) {
            this.duration = duration;
            this.changedFields = changedFields.add("duration");
            return this;
        }

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

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

        public Builder status(DelegatedAdminRelationshipStatus status) {
            this.status = status;
            this.changedFields = changedFields.add("status");
            return this;
        }

        public Builder accessAssignments(List accessAssignments) {
            this.accessAssignments = accessAssignments;
            this.changedFields = changedFields.add("accessAssignments");
            return this;
        }

        public Builder accessAssignments(DelegatedAdminAccessAssignment... accessAssignments) {
            return accessAssignments(Arrays.asList(accessAssignments));
        }

        public Builder operations(List operations) {
            this.operations = operations;
            this.changedFields = changedFields.add("operations");
            return this;
        }

        public Builder operations(DelegatedAdminRelationshipOperation... operations) {
            return operations(Arrays.asList(operations));
        }

        public Builder requests(List requests) {
            this.requests = requests;
            this.changedFields = changedFields.add("requests");
            return this;
        }

        public Builder requests(DelegatedAdminRelationshipRequest... requests) {
            return requests(Arrays.asList(requests));
        }

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

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

        public ResellerDelegatedAdminRelationship build() {
            ResellerDelegatedAdminRelationship _x = new ResellerDelegatedAdminRelationship();
            _x.contextPath = null;
            _x.changedFields = changedFields;
            _x.unmappedFields = new UnmappedFieldsImpl();
            _x.odataType = "microsoft.graph.resellerDelegatedAdminRelationship";
            _x.id = id;
            _x.accessDetails = accessDetails;
            _x.activatedDateTime = activatedDateTime;
            _x.autoExtendDuration = autoExtendDuration;
            _x.createdDateTime = createdDateTime;
            _x.customer = customer;
            _x.displayName = displayName;
            _x.duration = duration;
            _x.endDateTime = endDateTime;
            _x.lastModifiedDateTime = lastModifiedDateTime;
            _x.status = status;
            _x.accessAssignments = accessAssignments;
            _x.operations = operations;
            _x.requests = requests;
            _x.indirectProviderTenantId = indirectProviderTenantId;
            _x.isPartnerConsentPending = isPartnerConsentPending;
            return _x;
        }
    }

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

    @Override
    public void postInject(boolean addKeysToContextPath) {
        if (addKeysToContextPath && id != null) {
            contextPath = contextPath.clearQueries().addKeys(new NameValue(id, String.class));
        }
    }

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

    public ResellerDelegatedAdminRelationship withIndirectProviderTenantId(String indirectProviderTenantId) {
        ResellerDelegatedAdminRelationship _x = _copy();
        _x.changedFields = changedFields.add("indirectProviderTenantId");
        _x.odataType = Util.nvl(odataType, "microsoft.graph.resellerDelegatedAdminRelationship");
        _x.indirectProviderTenantId = indirectProviderTenantId;
        return _x;
    }

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

    public ResellerDelegatedAdminRelationship withIsPartnerConsentPending(Boolean isPartnerConsentPending) {
        ResellerDelegatedAdminRelationship _x = _copy();
        _x.changedFields = changedFields.add("isPartnerConsentPending");
        _x.odataType = Util.nvl(odataType, "microsoft.graph.resellerDelegatedAdminRelationship");
        _x.isPartnerConsentPending = isPartnerConsentPending;
        return _x;
    }

    public ResellerDelegatedAdminRelationship withUnmappedField(String name, Object value) {
        ResellerDelegatedAdminRelationship _x = _copy();
        _x.setUnmappedField(name, value);
        return _x;
    }

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

    @JsonAnyGetter
    private UnmappedFieldsImpl unmappedFields() {
        return unmappedFields == null ? UnmappedFieldsImpl.EMPTY : unmappedFields;
    }

    @Override
    public UnmappedFields getUnmappedFields() {
        return 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 ResellerDelegatedAdminRelationship patch() {
        RequestHelper.patch(this, contextPath, RequestOptions.EMPTY);
        ResellerDelegatedAdminRelationship _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 ResellerDelegatedAdminRelationship put() {
        RequestHelper.put(this, contextPath, RequestOptions.EMPTY);
        ResellerDelegatedAdminRelationship _x = _copy();
        _x.changedFields = null;
        return _x;
    }

    private ResellerDelegatedAdminRelationship _copy() {
        ResellerDelegatedAdminRelationship _x = new ResellerDelegatedAdminRelationship();
        _x.contextPath = contextPath;
        _x.changedFields = changedFields;
        _x.unmappedFields = unmappedFields.copy();
        _x.odataType = odataType;
        _x.id = id;
        _x.accessDetails = accessDetails;
        _x.activatedDateTime = activatedDateTime;
        _x.autoExtendDuration = autoExtendDuration;
        _x.createdDateTime = createdDateTime;
        _x.customer = customer;
        _x.displayName = displayName;
        _x.duration = duration;
        _x.endDateTime = endDateTime;
        _x.lastModifiedDateTime = lastModifiedDateTime;
        _x.status = status;
        _x.accessAssignments = accessAssignments;
        _x.operations = operations;
        _x.requests = requests;
        _x.indirectProviderTenantId = indirectProviderTenantId;
        _x.isPartnerConsentPending = isPartnerConsentPending;
        return _x;
    }

    @Override
    public String toString() {
        StringBuilder b = new StringBuilder();
        b.append("ResellerDelegatedAdminRelationship[");
        b.append("id=");
        b.append(this.id);
        b.append(", ");
        b.append("accessDetails=");
        b.append(this.accessDetails);
        b.append(", ");
        b.append("activatedDateTime=");
        b.append(this.activatedDateTime);
        b.append(", ");
        b.append("autoExtendDuration=");
        b.append(this.autoExtendDuration);
        b.append(", ");
        b.append("createdDateTime=");
        b.append(this.createdDateTime);
        b.append(", ");
        b.append("customer=");
        b.append(this.customer);
        b.append(", ");
        b.append("displayName=");
        b.append(this.displayName);
        b.append(", ");
        b.append("duration=");
        b.append(this.duration);
        b.append(", ");
        b.append("endDateTime=");
        b.append(this.endDateTime);
        b.append(", ");
        b.append("lastModifiedDateTime=");
        b.append(this.lastModifiedDateTime);
        b.append(", ");
        b.append("status=");
        b.append(this.status);
        b.append(", ");
        b.append("accessAssignments=");
        b.append(this.accessAssignments);
        b.append(", ");
        b.append("operations=");
        b.append(this.operations);
        b.append(", ");
        b.append("requests=");
        b.append(this.requests);
        b.append(", ");
        b.append("indirectProviderTenantId=");
        b.append(this.indirectProviderTenantId);
        b.append(", ");
        b.append("isPartnerConsentPending=");
        b.append(this.isPartnerConsentPending);
        b.append("]");
        b.append(",unmappedFields=");
        b.append(unmappedFields);
        b.append(",odataType=");
        b.append(odataType);
        return b.toString();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy