package com.avg.zaap.crashlibrary.publish.cap.http;

/**
 * A structure which holds CAP HTTP response data.
 * <p/>
 * Created by marek.osvald on 7.6.2016.
 */
public class CapResponse {

    public final int httpCode;
    public final String httpMessage;
    public final int capCode;
    public final String capMessage;

    /**
     * Parametric constructor. Sets HTTP code and message and CAP code and message.
     *
     * @param httpCode    HTTP response code
     * @param httpMessage HTTP response message
     * @param capCode     CAP response code
     * @param capMessage  CAP response message
     */
    public CapResponse(int httpCode, String httpMessage, int capCode, String capMessage) {
        this.httpCode = httpCode;
        this.httpMessage = httpMessage;
        this.capCode = capCode;
        this.capMessage = capMessage;
    }

    @Override
    public String toString() {
        return String.format("{ HTTP code: %d, HTTP message: %s, CAP code: %d, CAP message: %s }", httpCode, httpMessage, capCode, capMessage);
    }

}
