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

odata.msgraph.client.entity.request.WorkbookWorksheetRequest Maven / Gradle / Ivy

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

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreType;
import com.github.davidmoten.guavamini.Preconditions;
import com.github.davidmoten.odata.client.ContextPath;
import com.github.davidmoten.odata.client.EntityRequest;
import com.github.davidmoten.odata.client.FunctionRequestReturningNonCollectionUnwrapped;
import com.github.davidmoten.odata.client.NameValue;
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.lang.Boolean;
import java.lang.Integer;
import java.lang.Object;
import java.lang.String;
import java.util.Map;
import java.util.Optional;

import odata.msgraph.client.entity.WorkbookRange;
import odata.msgraph.client.entity.WorkbookWorksheet;
import odata.msgraph.client.entity.collection.request.WorkbookChartCollectionRequest;
import odata.msgraph.client.entity.collection.request.WorkbookNamedItemCollectionRequest;
import odata.msgraph.client.entity.collection.request.WorkbookPivotTableCollectionRequest;
import odata.msgraph.client.entity.collection.request.WorkbookTableCollectionRequest;

@JsonIgnoreType
public class WorkbookWorksheetRequest extends EntityRequest {

    public WorkbookWorksheetRequest(ContextPath contextPath, Optional value) {
        super(WorkbookWorksheet.class, contextPath, value, false);
    }

    public WorkbookChartRequest charts(String id) {
        return new WorkbookChartRequest(contextPath.addSegment("charts").addKeys(new NameValue(id, String.class)), Optional.empty());
    }

    public WorkbookChartCollectionRequest charts() {
        return new WorkbookChartCollectionRequest(
                        contextPath.addSegment("charts"), Optional.empty());
    }

    public WorkbookNamedItemRequest names(String id) {
        return new WorkbookNamedItemRequest(contextPath.addSegment("names").addKeys(new NameValue(id, String.class)), Optional.empty());
    }

    public WorkbookNamedItemCollectionRequest names() {
        return new WorkbookNamedItemCollectionRequest(
                        contextPath.addSegment("names"), Optional.empty());
    }

    public WorkbookPivotTableRequest pivotTables(String id) {
        return new WorkbookPivotTableRequest(contextPath.addSegment("pivotTables").addKeys(new NameValue(id, String.class)), Optional.empty());
    }

    public WorkbookPivotTableCollectionRequest pivotTables() {
        return new WorkbookPivotTableCollectionRequest(
                        contextPath.addSegment("pivotTables"), Optional.empty());
    }

    public WorkbookWorksheetProtectionRequest protection() {
        return new WorkbookWorksheetProtectionRequest(contextPath.addSegment("protection"), Optional.empty());
    }

    public WorkbookTableRequest tables(String id) {
        return new WorkbookTableRequest(contextPath.addSegment("tables").addKeys(new NameValue(id, String.class)), Optional.empty());
    }

    public WorkbookTableCollectionRequest tables() {
        return new WorkbookTableCollectionRequest(
                        contextPath.addSegment("tables"), Optional.empty());
    }

    @Function(name = "cell")
    @JsonIgnore
    public FunctionRequestReturningNonCollectionUnwrapped cell(Integer row, Integer column) {
        Preconditions.checkNotNull(row, "row cannot be null");
        Preconditions.checkNotNull(column, "column cannot be null");
        Map _parameters = ParameterMap
            .put("row", "Edm.Int32", row)
            .put("column", "Edm.Int32", column)
            .build();
        return new FunctionRequestReturningNonCollectionUnwrapped(this.contextPath.addActionOrFunctionSegment("microsoft.graph.cell"), WorkbookRange.class, _parameters);
    }

    @Function(name = "usedRange")
    @JsonIgnore
    public FunctionRequestReturningNonCollectionUnwrapped usedRange() {
        Map _parameters = ParameterMap.empty();
        return new FunctionRequestReturningNonCollectionUnwrapped(this.contextPath.addActionOrFunctionSegment("microsoft.graph.usedRange"), WorkbookRange.class, _parameters);
    }

    @Function(name = "usedRange")
    @JsonIgnore
    public FunctionRequestReturningNonCollectionUnwrapped usedRange_Function(Boolean valuesOnly) {
        Preconditions.checkNotNull(valuesOnly, "valuesOnly cannot be null");
        Map _parameters = ParameterMap
            .put("valuesOnly", "Edm.Boolean", valuesOnly)
            .build();
        return new FunctionRequestReturningNonCollectionUnwrapped(this.contextPath.addActionOrFunctionSegment("microsoft.graph.usedRange"), WorkbookRange.class, _parameters);
    }

    @Function(name = "range")
    @JsonIgnore
    public FunctionRequestReturningNonCollectionUnwrapped range() {
        Map _parameters = ParameterMap.empty();
        return new FunctionRequestReturningNonCollectionUnwrapped(this.contextPath.addActionOrFunctionSegment("microsoft.graph.range"), WorkbookRange.class, _parameters);
    }

    @Function(name = "range")
    @JsonIgnore
    public FunctionRequestReturningNonCollectionUnwrapped range_Function(String address) {
        Preconditions.checkNotNull(address, "address cannot be null");
        Map _parameters = ParameterMap
            .put("address", "Edm.String", Checks.checkIsAscii(address))
            .build();
        return new FunctionRequestReturningNonCollectionUnwrapped(this.contextPath.addActionOrFunctionSegment("microsoft.graph.range"), WorkbookRange.class, _parameters);
    }

}