/*
 * Copyright 2014 Open mHealth
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * 	http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.openmhealth.shim;

import java.time.OffsetDateTime;


/**
 * A wrapper for encapsulating data requests sent to shims. Prevents from having long method signatures.
 *
 * @author Danilo Bonilla
 */
public class ShimDataRequest {

    /**
     * Identifier for the type of data being retrieved
     */
    private String dataTypeKey;
    /**
     * parameters required for acessing data, this will likely be oauth token + any extras or some kind of trusted
     * access.
     */
    private AccessParameters accessParameters;

    /**
     * // TODO replace this with filters on effective time, using the Data Point API The start date for the data being
     * retrieved
     */
    private OffsetDateTime startDateTime;

    /**
     * The end date for the data being retrieved
     */
    private OffsetDateTime endDateTime;

    /**
     * The starting row for the data (for pagination purposes)
     */
    private Long numToSkip;

    /**
     * Number of rows to return
     */
    private Long numToReturn;

    /**
     * If true, returns normalized results from the external data provider, otherwise returns raw data.
     */
    private boolean normalize = true;

    public ShimDataRequest() {
    }

    public ShimDataRequest(String dataTypeKey,
            AccessParameters accessParameters,
            OffsetDateTime startDateTime,
            OffsetDateTime endDateTime,
            Long numToSkip,
            Long numToReturn,
            boolean normalize) {
        this.dataTypeKey = dataTypeKey;
        this.accessParameters = accessParameters;
        this.startDateTime = startDateTime;
        this.endDateTime = endDateTime;
        this.numToSkip = numToSkip;
        this.numToReturn = numToReturn;
        this.normalize = normalize;
    }

    public void setDataTypeKey(String dataTypeKey) {
        this.dataTypeKey = dataTypeKey;
    }

    public void setAccessParameters(AccessParameters accessParameters) {
        this.accessParameters = accessParameters;
    }

    public OffsetDateTime getStartDateTime() {
        return startDateTime;
    }

    public void setStartDateTime(OffsetDateTime startDateTime) {
        this.startDateTime = startDateTime;
    }

    public OffsetDateTime getEndDateTime() {
        return endDateTime;
    }

    public void setEndDateTime(OffsetDateTime endDateTime) {
        this.endDateTime = endDateTime;
    }

    public void setNumToReturn(Long numToReturn) {
        this.numToReturn = numToReturn;
    }

    public String getDataTypeKey() {
        return dataTypeKey;
    }

    public AccessParameters getAccessParameters() {
        return accessParameters;
    }

    public Long getNumToReturn() {
        return numToReturn;
    }

    public boolean getNormalize() {
        return normalize;
    }

    public void setNormalize(boolean normalize) {
        this.normalize = normalize;
    }
}

@@ -1429,116 +1429,8 @@
 e;%0A%0A
-    /**%0A     * The starting row for the data (for pagination purposes)%0A     */%0A    private Long numToSkip;%0A%0A
     
@@ -1667,605 +1667,8 @@
 e;%0A%0A
-    public ShimDataRequest() %7B%0A    %7D%0A%0A    public ShimDataRequest(String dataTypeKey,%0A            AccessParameters accessParameters,%0A            OffsetDateTime startDateTime,%0A            OffsetDateTime endDateTime,%0A            Long numToSkip,%0A            Long numToReturn,%0A            boolean normalize) %7B%0A        this.dataTypeKey = dataTypeKey;%0A        this.accessParameters = accessParameters;%0A        this.startDateTime = startDateTime;%0A        this.endDateTime = endDateTime;%0A        this.numToSkip = numToSkip;%0A        this.numToReturn = numToReturn;%0A        this.normalize = normalize;%0A    %7D%0A
 %0A   

Remove unused data retrieval DTO fields