package epson.print.copy.Component.eremoteoperation;

import org.json.JSONObject;

import java.util.ArrayList;

public class ERemoteCombo extends ERemoteOperation {

    public interface IRemoteComboOptionsParameter extends ERemoteOperation.IRemoteOperationParameter {
        boolean default_as_fixed();

        ArrayList<ERemoteOperation.ERemoteParam> fixed_parameters();

        ERemoteOperation.ERemoteParam frame();

        ERemoteOperation.ERemoteParam layout();

        ArrayList<ERemoteOperation.ERemoteParam> preferred_parameters();

        ERemoteOperation.ERemoteParam print_media_size();

        ERemoteOperation.ERemoteParam print_media_type();

        ArrayList<ERemoteOperation.ERemoteParam> priority_order();
    }

    public interface IRemoteComboPrintTemplateParameter extends ERemoteOperation.IRemoteOperationParameter {
        ERemoteOperation.ERemoteParam frame();

        ERemoteOperation.ERemoteParam layout();

        ERemoteOperation.ERemoteParam print_media_size();

        ERemoteOperation.ERemoteParam print_media_type();
    }

    public interface IRemoteComboStatusParameter extends ERemoteOperation.IRemoteOperationParameter {
        ERemoteOperation.ERemoteParam job_token();

        ArrayList<ERemoteOperation.ERemoteParam> keys();
    }

    public interface IRemoteComboWaitTemplateParameter extends ERemoteOperation.IRemoteOperationParameter {
    }

    public class ERemoteComboOptionsResult extends ERemoteOperation.ERemoteReasonResult {
        public ERemoteComboOptionsResult(JSONObject jSONObject) {
            super(jSONObject);
        }

        public ArrayList<ERemoteOperation.ERemoteParam> parameter_options(ERemoteOperation.ERemoteParam eRemoteParam) {
            return getOptionsValueOf(eRemoteParam);
        }

        public ERemoteOperation.ERemoteParam parameter_default(ERemoteOperation.ERemoteParam eRemoteParam) {
            return getDefaultValueOf(eRemoteParam);
        }
    }

    public class ERemoteComboPrintTemplateResult extends ERemoteOperation.ERemoteReasonResult {
        public ERemoteComboPrintTemplateResult(JSONObject jSONObject) {
            super(jSONObject);
        }
    }

    public class ERemoteComboWaitTemplateResult extends ERemoteOperation.ERemoteReasonResult {
        public ERemoteComboWaitTemplateResult(JSONObject jSONObject) {
            super(jSONObject);
        }
    }

    public class ERemoteComboStatusResult extends ERemoteOperation.ERemoteReasonResult {
        public ERemoteComboStatusResult(JSONObject jSONObject) {
            super(jSONObject);
        }

        public ERemoteOperation.ERemoteParam print_x_disc_tray_state() {
            return getParamValueOf(ERemoteOperation.ERemoteParam.print_x_disc_tray_state);
        }

        public ERemoteOperation.ERemoteParam printer_state() {
            return getParamValueOf(ERemoteOperation.ERemoteParam.printer_state);
        }

        public ERemoteOperation.ERemoteParam printer_state_reasons() {
            return getParamValueOf(ERemoteOperation.ERemoteParam.printer_state_reasons);
        }

        public boolean document_on_adf() {
            return getBooleanValueOf(ERemoteOperation.ERemoteParam.document_on_adf);
        }

        public ERemoteOperation.ERemoteParam scanner_state() {
            return getParamValueOf(ERemoteOperation.ERemoteParam.scanner_state);
        }

        public ERemoteOperation.ERemoteParam scanner_state_reasons() {
            return getParamValueOf(ERemoteOperation.ERemoteParam.scanner_state_reasons);
        }

        public ERemoteOperation.ERemoteParam job_state() {
            return getParamValueOf(ERemoteOperation.ERemoteParam.job_state);
        }

        public ERemoteOperation.ERemoteParam job_result() {
            return getParamValueOf(ERemoteOperation.ERemoteParam.job_result);
        }

        public ArrayList<String> job_tokens() {
            return getStringsValueOf(ERemoteOperation.ERemoteParam.job_tokens);
        }

        public int job_print_total_pages() {
            return getIntValueOf(ERemoteOperation.ERemoteParam.job_print_total_pages);
        }

        public int job_print_current_pages() {
            return getIntValueOf(ERemoteOperation.ERemoteParam.job_print_current_pages);
        }

        public int job_image_post_url() {
            return getIntValueOf(ERemoteOperation.ERemoteParam.job_image_post_url);
        }
    }

    public ERemoteComboOptionsResult getOptions(IRemoteComboOptionsParameter iRemoteComboOptionsParameter) {
        ERemoteOperation.ERemoteRequestBuilder requestCombo = ERemoteOperation.ERemoteRequestBuilder.requestCombo(this.hostIP, ERemoteOperation.RequestParam.get_options, getRequestConnectionTimeout());
        requestCombo.add(ERemoteOperation.ERemoteParam.client_id, iRemoteComboOptionsParameter.client_id());
        requestCombo.add(ERemoteOperation.ERemoteParam.layout, iRemoteComboOptionsParameter.layout());
        requestCombo.add(ERemoteOperation.ERemoteParam.print_media_type, iRemoteComboOptionsParameter.print_media_type());
        requestCombo.add(ERemoteOperation.ERemoteParam.print_media_size, iRemoteComboOptionsParameter.print_media_size());
        requestCombo.add(ERemoteOperation.ERemoteParam.frame, iRemoteComboOptionsParameter.frame());
        requestCombo.add(ERemoteOperation.ERemoteParam.fixed_parameters, iRemoteComboOptionsParameter.fixed_parameters());
        requestCombo.add(ERemoteOperation.ERemoteParam.priority_order, iRemoteComboOptionsParameter.priority_order());
        requestCombo.add(ERemoteOperation.ERemoteParam.default_as_fixed, iRemoteComboOptionsParameter.default_as_fixed());
        ERemoteComboOptionsResult eRemoteComboOptionsResult = new ERemoteComboOptionsResult(requestCombo.getRemoteRequest().execute());
        eRemoteComboOptionsResult.setRemoteRequestBuilder(requestCombo);
        return eRemoteComboOptionsResult;
    }

    public ERemoteComboOptionsResult getSelectableOptions() {
        ArrayList arrayList = new ArrayList();
        arrayList.add(ERemoteOperation.ERemoteParam.layout);
        arrayList.add(ERemoteOperation.ERemoteParam.print_media_size);
        arrayList.add(ERemoteOperation.ERemoteParam.print_media_type);
        arrayList.add(ERemoteOperation.ERemoteParam.frame);
        ERemoteOperation.ERemoteRequestBuilder requestCombo = ERemoteOperation.ERemoteRequestBuilder.requestCombo(this.hostIP, ERemoteOperation.RequestParam.get_options, getRequestConnectionTimeout());
        requestCombo.add(ERemoteOperation.ERemoteParam.client_id, ERemoteOperation.ERemoteParam.x_null.string);
        requestCombo.add(ERemoteOperation.ERemoteParam.layout, ERemoteOperation.ERemoteParam.x_null);
        requestCombo.add(ERemoteOperation.ERemoteParam.print_media_type, ERemoteOperation.ERemoteParam.x_null);
        requestCombo.add(ERemoteOperation.ERemoteParam.print_media_size, ERemoteOperation.ERemoteParam.x_null);
        requestCombo.add(ERemoteOperation.ERemoteParam.frame, ERemoteOperation.ERemoteParam.x_null);
        requestCombo.add(ERemoteOperation.ERemoteParam.fixed_parameters, (ArrayList<ERemoteOperation.ERemoteParam>) new ArrayList());
        requestCombo.add(ERemoteOperation.ERemoteParam.priority_order, (ArrayList<ERemoteOperation.ERemoteParam>) arrayList);
        requestCombo.add(ERemoteOperation.ERemoteParam.default_as_fixed, false);
        ERemoteComboOptionsResult eRemoteComboOptionsResult = new ERemoteComboOptionsResult(requestCombo.getRemoteRequest().execute());
        eRemoteComboOptionsResult.setRemoteRequestBuilder(requestCombo);
        return eRemoteComboOptionsResult;
    }

    public ERemoteComboPrintTemplateResult printTemplate(IRemoteComboPrintTemplateParameter iRemoteComboPrintTemplateParameter) {
        ERemoteOperation.ERemoteRequestBuilder requestCombo = ERemoteOperation.ERemoteRequestBuilder.requestCombo(this.hostIP, ERemoteOperation.RequestParam.get_options, getRequestConnectionTimeout());
        requestCombo.add(ERemoteOperation.ERemoteParam.client_id, iRemoteComboPrintTemplateParameter.client_id());
        requestCombo.add(ERemoteOperation.ERemoteParam.layout, iRemoteComboPrintTemplateParameter.layout());
        requestCombo.add(ERemoteOperation.ERemoteParam.print_media_type, iRemoteComboPrintTemplateParameter.print_media_type());
        requestCombo.add(ERemoteOperation.ERemoteParam.print_media_size, iRemoteComboPrintTemplateParameter.print_media_size());
        requestCombo.add(ERemoteOperation.ERemoteParam.frame, iRemoteComboPrintTemplateParameter.frame());
        ERemoteComboPrintTemplateResult eRemoteComboPrintTemplateResult = new ERemoteComboPrintTemplateResult(requestCombo.getRemoteRequest().execute());
        eRemoteComboPrintTemplateResult.setRemoteRequestBuilder(requestCombo);
        return eRemoteComboPrintTemplateResult;
    }

    public ERemoteComboWaitTemplateResult waitTemplate(IRemoteComboWaitTemplateParameter iRemoteComboWaitTemplateParameter) {
        ERemoteOperation.ERemoteRequestBuilder requestCombo = ERemoteOperation.ERemoteRequestBuilder.requestCombo(this.hostIP, ERemoteOperation.RequestParam.get_options, getRequestConnectionTimeout());
        requestCombo.add(ERemoteOperation.ERemoteParam.client_id, iRemoteComboWaitTemplateParameter.client_id());
        ERemoteComboWaitTemplateResult eRemoteComboWaitTemplateResult = new ERemoteComboWaitTemplateResult(requestCombo.getRemoteRequest().execute());
        eRemoteComboWaitTemplateResult.setRemoteRequestBuilder(requestCombo);
        return eRemoteComboWaitTemplateResult;
    }

    public ERemoteComboStatusResult getStatus(IRemoteComboStatusParameter iRemoteComboStatusParameter) {
        ERemoteOperation.ERemoteRequestBuilder requestCombo = ERemoteOperation.ERemoteRequestBuilder.requestCombo(this.hostIP, ERemoteOperation.RequestParam.get_options, getRequestConnectionTimeout());
        requestCombo.add(ERemoteOperation.ERemoteParam.client_id, iRemoteComboStatusParameter.client_id());
        requestCombo.add(ERemoteOperation.ERemoteParam.keys, iRemoteComboStatusParameter.keys());
        requestCombo.add(ERemoteOperation.ERemoteParam.job_token, iRemoteComboStatusParameter.job_token());
        ERemoteComboStatusResult eRemoteComboStatusResult = new ERemoteComboStatusResult(requestCombo.getRemoteRequest().execute());
        eRemoteComboStatusResult.setRemoteRequestBuilder(requestCombo);
        return eRemoteComboStatusResult;
    }
}
