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

odata.msgraph.client.entity.RbacApplication 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.NavigationProperty;
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.Object;
import java.lang.Override;
import java.lang.String;
import java.lang.StringBuilder;
import java.util.Arrays;
import java.util.List;
import java.util.Optional;

import odata.msgraph.client.entity.collection.request.UnifiedRbacResourceNamespaceCollectionRequest;
import odata.msgraph.client.entity.collection.request.UnifiedRoleAssignmentCollectionRequest;
import odata.msgraph.client.entity.collection.request.UnifiedRoleAssignmentScheduleCollectionRequest;
import odata.msgraph.client.entity.collection.request.UnifiedRoleAssignmentScheduleInstanceCollectionRequest;
import odata.msgraph.client.entity.collection.request.UnifiedRoleAssignmentScheduleRequestCollectionRequest;
import odata.msgraph.client.entity.collection.request.UnifiedRoleDefinitionCollectionRequest;
import odata.msgraph.client.entity.collection.request.UnifiedRoleEligibilityScheduleCollectionRequest;
import odata.msgraph.client.entity.collection.request.UnifiedRoleEligibilityScheduleInstanceCollectionRequest;
import odata.msgraph.client.entity.collection.request.UnifiedRoleEligibilityScheduleRequestCollectionRequest;

@JsonPropertyOrder({
    "@odata.type", 
    "resourceNamespaces", 
    "roleAssignments", 
    "roleDefinitions", 
    "roleAssignmentScheduleInstances", 
    "roleAssignmentScheduleRequests", 
    "roleAssignmentSchedules", 
    "roleEligibilityScheduleInstances", 
    "roleEligibilityScheduleRequests", 
    "roleEligibilitySchedules"})
@JsonInclude(Include.NON_NULL)
public class RbacApplication extends Entity implements ODataEntityType {

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

    @JsonProperty("resourceNamespaces")
    protected List resourceNamespaces;

    @JsonProperty("roleAssignments")
    protected List roleAssignments;

    @JsonProperty("roleDefinitions")
    protected List roleDefinitions;

    @JsonProperty("roleAssignmentScheduleInstances")
    protected List roleAssignmentScheduleInstances;

    @JsonProperty("roleAssignmentScheduleRequests")
    protected List roleAssignmentScheduleRequests;

    @JsonProperty("roleAssignmentSchedules")
    protected List roleAssignmentSchedules;

    @JsonProperty("roleEligibilityScheduleInstances")
    protected List roleEligibilityScheduleInstances;

    @JsonProperty("roleEligibilityScheduleRequests")
    protected List roleEligibilityScheduleRequests;

    @JsonProperty("roleEligibilitySchedules")
    protected List roleEligibilitySchedules;

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

    public static final class Builder {
        private String id;
        private List resourceNamespaces;
        private List roleAssignments;
        private List roleDefinitions;
        private List roleAssignmentScheduleInstances;
        private List roleAssignmentScheduleRequests;
        private List roleAssignmentSchedules;
        private List roleEligibilityScheduleInstances;
        private List roleEligibilityScheduleRequests;
        private List roleEligibilitySchedules;
        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 resourceNamespaces(List resourceNamespaces) {
            this.resourceNamespaces = resourceNamespaces;
            this.changedFields = changedFields.add("resourceNamespaces");
            return this;
        }

        public Builder resourceNamespaces(UnifiedRbacResourceNamespace... resourceNamespaces) {
            return resourceNamespaces(Arrays.asList(resourceNamespaces));
        }

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

        public Builder roleAssignments(UnifiedRoleAssignment... roleAssignments) {
            return roleAssignments(Arrays.asList(roleAssignments));
        }

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

        public Builder roleDefinitions(UnifiedRoleDefinition... roleDefinitions) {
            return roleDefinitions(Arrays.asList(roleDefinitions));
        }

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

        public Builder roleAssignmentScheduleInstances(UnifiedRoleAssignmentScheduleInstance... roleAssignmentScheduleInstances) {
            return roleAssignmentScheduleInstances(Arrays.asList(roleAssignmentScheduleInstances));
        }

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

        public Builder roleAssignmentScheduleRequests(UnifiedRoleAssignmentScheduleRequest... roleAssignmentScheduleRequests) {
            return roleAssignmentScheduleRequests(Arrays.asList(roleAssignmentScheduleRequests));
        }

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

        public Builder roleAssignmentSchedules(UnifiedRoleAssignmentSchedule... roleAssignmentSchedules) {
            return roleAssignmentSchedules(Arrays.asList(roleAssignmentSchedules));
        }

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

        public Builder roleEligibilityScheduleInstances(UnifiedRoleEligibilityScheduleInstance... roleEligibilityScheduleInstances) {
            return roleEligibilityScheduleInstances(Arrays.asList(roleEligibilityScheduleInstances));
        }

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

        public Builder roleEligibilityScheduleRequests(UnifiedRoleEligibilityScheduleRequest... roleEligibilityScheduleRequests) {
            return roleEligibilityScheduleRequests(Arrays.asList(roleEligibilityScheduleRequests));
        }

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

        public Builder roleEligibilitySchedules(UnifiedRoleEligibilitySchedule... roleEligibilitySchedules) {
            return roleEligibilitySchedules(Arrays.asList(roleEligibilitySchedules));
        }

        public RbacApplication build() {
            RbacApplication _x = new RbacApplication();
            _x.contextPath = null;
            _x.changedFields = changedFields;
            _x.unmappedFields = new UnmappedFieldsImpl();
            _x.odataType = "microsoft.graph.rbacApplication";
            _x.id = id;
            _x.resourceNamespaces = resourceNamespaces;
            _x.roleAssignments = roleAssignments;
            _x.roleDefinitions = roleDefinitions;
            _x.roleAssignmentScheduleInstances = roleAssignmentScheduleInstances;
            _x.roleAssignmentScheduleRequests = roleAssignmentScheduleRequests;
            _x.roleAssignmentSchedules = roleAssignmentSchedules;
            _x.roleEligibilityScheduleInstances = roleEligibilityScheduleInstances;
            _x.roleEligibilityScheduleRequests = roleEligibilityScheduleRequests;
            _x.roleEligibilitySchedules = roleEligibilitySchedules;
            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));
        }
    }

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

    @NavigationProperty(name="resourceNamespaces")
    @JsonIgnore
    public UnifiedRbacResourceNamespaceCollectionRequest getResourceNamespaces() {
        return new UnifiedRbacResourceNamespaceCollectionRequest(
                        contextPath.addSegment("resourceNamespaces"), Optional.ofNullable(resourceNamespaces));
    }

    @NavigationProperty(name="roleAssignments")
    @JsonIgnore
    public UnifiedRoleAssignmentCollectionRequest getRoleAssignments() {
        return new UnifiedRoleAssignmentCollectionRequest(
                        contextPath.addSegment("roleAssignments"), Optional.ofNullable(roleAssignments));
    }

    @NavigationProperty(name="roleDefinitions")
    @JsonIgnore
    public UnifiedRoleDefinitionCollectionRequest getRoleDefinitions() {
        return new UnifiedRoleDefinitionCollectionRequest(
                        contextPath.addSegment("roleDefinitions"), Optional.ofNullable(roleDefinitions));
    }

    @NavigationProperty(name="roleAssignmentScheduleInstances")
    @JsonIgnore
    public UnifiedRoleAssignmentScheduleInstanceCollectionRequest getRoleAssignmentScheduleInstances() {
        return new UnifiedRoleAssignmentScheduleInstanceCollectionRequest(
                        contextPath.addSegment("roleAssignmentScheduleInstances"), Optional.ofNullable(roleAssignmentScheduleInstances));
    }

    @NavigationProperty(name="roleAssignmentScheduleRequests")
    @JsonIgnore
    public UnifiedRoleAssignmentScheduleRequestCollectionRequest getRoleAssignmentScheduleRequests() {
        return new UnifiedRoleAssignmentScheduleRequestCollectionRequest(
                        contextPath.addSegment("roleAssignmentScheduleRequests"), Optional.ofNullable(roleAssignmentScheduleRequests));
    }

    @NavigationProperty(name="roleAssignmentSchedules")
    @JsonIgnore
    public UnifiedRoleAssignmentScheduleCollectionRequest getRoleAssignmentSchedules() {
        return new UnifiedRoleAssignmentScheduleCollectionRequest(
                        contextPath.addSegment("roleAssignmentSchedules"), Optional.ofNullable(roleAssignmentSchedules));
    }

    @NavigationProperty(name="roleEligibilityScheduleInstances")
    @JsonIgnore
    public UnifiedRoleEligibilityScheduleInstanceCollectionRequest getRoleEligibilityScheduleInstances() {
        return new UnifiedRoleEligibilityScheduleInstanceCollectionRequest(
                        contextPath.addSegment("roleEligibilityScheduleInstances"), Optional.ofNullable(roleEligibilityScheduleInstances));
    }

    @NavigationProperty(name="roleEligibilityScheduleRequests")
    @JsonIgnore
    public UnifiedRoleEligibilityScheduleRequestCollectionRequest getRoleEligibilityScheduleRequests() {
        return new UnifiedRoleEligibilityScheduleRequestCollectionRequest(
                        contextPath.addSegment("roleEligibilityScheduleRequests"), Optional.ofNullable(roleEligibilityScheduleRequests));
    }

    @NavigationProperty(name="roleEligibilitySchedules")
    @JsonIgnore
    public UnifiedRoleEligibilityScheduleCollectionRequest getRoleEligibilitySchedules() {
        return new UnifiedRoleEligibilityScheduleCollectionRequest(
                        contextPath.addSegment("roleEligibilitySchedules"), Optional.ofNullable(roleEligibilitySchedules));
    }

    public RbacApplication withResourceNamespaces(List resourceNamespaces) {
        RbacApplication _x = _copy();
        _x.changedFields = changedFields.add("resourceNamespaces");
        _x.odataType = Util.nvl(odataType, "microsoft.graph.rbacApplication");
        _x.resourceNamespaces = resourceNamespaces;
        return _x;
    }

    public RbacApplication withRoleAssignments(List roleAssignments) {
        RbacApplication _x = _copy();
        _x.changedFields = changedFields.add("roleAssignments");
        _x.odataType = Util.nvl(odataType, "microsoft.graph.rbacApplication");
        _x.roleAssignments = roleAssignments;
        return _x;
    }

    public RbacApplication withRoleDefinitions(List roleDefinitions) {
        RbacApplication _x = _copy();
        _x.changedFields = changedFields.add("roleDefinitions");
        _x.odataType = Util.nvl(odataType, "microsoft.graph.rbacApplication");
        _x.roleDefinitions = roleDefinitions;
        return _x;
    }

    public RbacApplication withRoleAssignmentScheduleInstances(List roleAssignmentScheduleInstances) {
        RbacApplication _x = _copy();
        _x.changedFields = changedFields.add("roleAssignmentScheduleInstances");
        _x.odataType = Util.nvl(odataType, "microsoft.graph.rbacApplication");
        _x.roleAssignmentScheduleInstances = roleAssignmentScheduleInstances;
        return _x;
    }

    public RbacApplication withRoleAssignmentScheduleRequests(List roleAssignmentScheduleRequests) {
        RbacApplication _x = _copy();
        _x.changedFields = changedFields.add("roleAssignmentScheduleRequests");
        _x.odataType = Util.nvl(odataType, "microsoft.graph.rbacApplication");
        _x.roleAssignmentScheduleRequests = roleAssignmentScheduleRequests;
        return _x;
    }

    public RbacApplication withRoleAssignmentSchedules(List roleAssignmentSchedules) {
        RbacApplication _x = _copy();
        _x.changedFields = changedFields.add("roleAssignmentSchedules");
        _x.odataType = Util.nvl(odataType, "microsoft.graph.rbacApplication");
        _x.roleAssignmentSchedules = roleAssignmentSchedules;
        return _x;
    }

    public RbacApplication withRoleEligibilityScheduleInstances(List roleEligibilityScheduleInstances) {
        RbacApplication _x = _copy();
        _x.changedFields = changedFields.add("roleEligibilityScheduleInstances");
        _x.odataType = Util.nvl(odataType, "microsoft.graph.rbacApplication");
        _x.roleEligibilityScheduleInstances = roleEligibilityScheduleInstances;
        return _x;
    }

    public RbacApplication withRoleEligibilityScheduleRequests(List roleEligibilityScheduleRequests) {
        RbacApplication _x = _copy();
        _x.changedFields = changedFields.add("roleEligibilityScheduleRequests");
        _x.odataType = Util.nvl(odataType, "microsoft.graph.rbacApplication");
        _x.roleEligibilityScheduleRequests = roleEligibilityScheduleRequests;
        return _x;
    }

    public RbacApplication withRoleEligibilitySchedules(List roleEligibilitySchedules) {
        RbacApplication _x = _copy();
        _x.changedFields = changedFields.add("roleEligibilitySchedules");
        _x.odataType = Util.nvl(odataType, "microsoft.graph.rbacApplication");
        _x.roleEligibilitySchedules = roleEligibilitySchedules;
        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 RbacApplication patch() {
        RequestHelper.patch(this, contextPath, RequestOptions.EMPTY);
        RbacApplication _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 RbacApplication put() {
        RequestHelper.put(this, contextPath, RequestOptions.EMPTY);
        RbacApplication _x = _copy();
        _x.changedFields = null;
        return _x;
    }

    private RbacApplication _copy() {
        RbacApplication _x = new RbacApplication();
        _x.contextPath = contextPath;
        _x.changedFields = changedFields;
        _x.unmappedFields = unmappedFields.copy();
        _x.odataType = odataType;
        _x.id = id;
        _x.resourceNamespaces = resourceNamespaces;
        _x.roleAssignments = roleAssignments;
        _x.roleDefinitions = roleDefinitions;
        _x.roleAssignmentScheduleInstances = roleAssignmentScheduleInstances;
        _x.roleAssignmentScheduleRequests = roleAssignmentScheduleRequests;
        _x.roleAssignmentSchedules = roleAssignmentSchedules;
        _x.roleEligibilityScheduleInstances = roleEligibilityScheduleInstances;
        _x.roleEligibilityScheduleRequests = roleEligibilityScheduleRequests;
        _x.roleEligibilitySchedules = roleEligibilitySchedules;
        return _x;
    }

    @Override
    public String toString() {
        StringBuilder b = new StringBuilder();
        b.append("RbacApplication[");
        b.append("id=");
        b.append(this.id);
        b.append(", ");
        b.append("resourceNamespaces=");
        b.append(this.resourceNamespaces);
        b.append(", ");
        b.append("roleAssignments=");
        b.append(this.roleAssignments);
        b.append(", ");
        b.append("roleDefinitions=");
        b.append(this.roleDefinitions);
        b.append(", ");
        b.append("roleAssignmentScheduleInstances=");
        b.append(this.roleAssignmentScheduleInstances);
        b.append(", ");
        b.append("roleAssignmentScheduleRequests=");
        b.append(this.roleAssignmentScheduleRequests);
        b.append(", ");
        b.append("roleAssignmentSchedules=");
        b.append(this.roleAssignmentSchedules);
        b.append(", ");
        b.append("roleEligibilityScheduleInstances=");
        b.append(this.roleEligibilityScheduleInstances);
        b.append(", ");
        b.append("roleEligibilityScheduleRequests=");
        b.append(this.roleEligibilityScheduleRequests);
        b.append(", ");
        b.append("roleEligibilitySchedules=");
        b.append(this.roleEligibilitySchedules);
        b.append("]");
        b.append(",unmappedFields=");
        b.append(unmappedFields);
        b.append(",odataType=");
        b.append(odataType);
        return b.toString();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy