package com.github.dockerjava.api.model;

import java.io.Serializable;

import javax.annotation.CheckForNull;

import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;

/**
 * Represents a pull response stream item
 */
@JsonIgnoreProperties(ignoreUnknown = true)
public class ResponseItem implements Serializable {

    private static final long serialVersionUID = -5187169652557467828L;

    @JsonProperty("stream")
    private String stream;

    @JsonProperty("status")
    private String status;

    @JsonProperty("progressDetail")
    private ProgressDetail progressDetail;

    @Deprecated
    @JsonProperty("progress")
    private String progress;

    @JsonProperty("id")
    private String id;

    @JsonProperty("from")
    private String from;

    @JsonProperty("time")
    private Long time;

    @JsonProperty("errorDetail")
    private ErrorDetail errorDetail;

    @Deprecated
    @JsonProperty("error")
    private String error;

    @CheckForNull
    public String getStream() {
        return stream;
    }

    @CheckForNull
    public String getStatus() {
        return status;
    }

    @CheckForNull
    public ProgressDetail getProgressDetail() {
        return progressDetail;
    }

    @CheckForNull
    @Deprecated
    public String getProgress() {
        return progress;
    }

    @CheckForNull
    public String getId() {
        return id;
    }

    @CheckForNull
    public String getFrom() {
        return from;
    }

    @CheckForNull
    public Long getTime() {
        return time;
    }

    @CheckForNull
    public ErrorDetail getErrorDetail() {
        return errorDetail;
    }

    @Deprecated
    public String getError() {
        return error;
    }

    /**
     * Returns whether the error field indicates an error
     *
     * @returns true: the error field indicates an error, false: the error field doesn't indicate an error
     */
    @JsonIgnore
    public boolean isErrorIndicated() {
        // check both the deprecated and current error fields, just in case
        return getError() != null || getErrorDetail() != null;
    }

    @JsonIgnoreProperties(ignoreUnknown = true)
    public static class ProgressDetail implements Serializable {
        private static final long serialVersionUID = -1954994695645715264L;

        @JsonProperty("current")
        Long current;

        @JsonProperty("total")
        Long total;

        @JsonProperty("start")
        Long start;

        @CheckForNull
        public Long getCurrent() {
            return current;
        }

        @CheckForNull
        public Long getTotal() {
            return total;
        }

        @CheckForNull
        public Long getStart() {
            return start;
        }

        @Override
        public String toString() {
            return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE).toString();
        }
    }

    @JsonIgnoreProperties(ignoreUnknown = true)
    public static class ErrorDetail implements Serializable {
        private static final long serialVersionUID = -9136704865403084083L;

        @JsonProperty("code")
        Integer code;

        @JsonProperty("message")
        String message;

        @CheckForNull
        public Integer getCode() {
            return code;
        }

        @CheckForNull
        public String getMessage() {
            return message;
        }

        @Override
        public String toString() {
            return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE).toString();
        }
    }

    @Override
    public String toString() {
        return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE).toString();
    }
}

@@ -46,347 +46,397 @@
 ort 
-java.io.Serializable;%0A%0Aimport javax.annotation.CheckForNull;%0A%0Aimport org.apache.commons.lang.builder.ToStringBuilder;%0Aimport org.apache.commons.lang.builder.ToStringStyle;%0A%0Aimport com.fasterxml.jackson.annotation.JsonIgnore;%0Aimport com.fasterxml.jackson.annotation.JsonIgnoreProperties;%0Aimport com.fasterxml.jackson.annotation.JsonProperty
+com.fasterxml.jackson.annotation.JsonIgnore;%0Aimport com.fasterxml.jackson.annotation.JsonIgnoreProperties;%0Aimport com.fasterxml.jackson.annotation.JsonProperty;%0Aimport com.github.dockerjava.core.RemoteApiVersion;%0Aimport org.apache.commons.lang.builder.ToStringBuilder;%0Aimport org.apache.commons.lang.builder.ToStringStyle;%0A%0Aimport javax.annotation.CheckForNull;%0Aimport java.io.Serializable
 ;%0A%0A/
@@ -1213,16 +1213,137 @@
 error;%0A%0A
+    /**%0A     * @since %7B@link RemoteApiVersion#VERSION_1_22%7D%0A     */%0A    @JsonProperty(%22aux%22)%0A    private AuxDetail aux;%0A%0A
     @Che
@@ -2087,24 +2087,134 @@
 ror;%0A    %7D%0A%0A
+    /**%0A     * @see #aux%0A     */%0A    @CheckForNull%0A    public AuxDetail getAux() %7B%0A        return aux;%0A    %7D%0A%0A
     /**%0A    
@@ -3363,35 +3363,24 @@
 REFIX_STYLE)
-.toString()
 ;%0A        %7D%0A
@@ -4017,35 +4017,24 @@
 REFIX_STYLE)
-.toString()
 ;%0A        %7D%0A
@@ -4029,31 +4029,663 @@
 ;%0A        %7D%0A
+    %7D%0A%0A    @JsonIgnoreProperties(ignoreUnknown = true)%0A    public static class AuxDetail implements Serializable %7B%0A        private static final long serialVersionUID = 1L;%0A%0A        @JsonProperty(%22Size%22)%0A        private Integer size;%0A%0A        @JsonProperty(%22Tag%22)%0A        private String tag;%0A%0A        @JsonProperty(%22Digest%22)%0A        private String digest;%0A%0A        @CheckForNull%0A        public Integer getSize() %7B%0A            return size;%0A        %7D%0A%0A        @CheckForNull%0A        public String getTag() %7B%0A            return tag;%0A        %7D%0A%0A        @CheckForNull%0A        public String getDigest() %7B%0A            return digest;%0A    
     %7D%0A%0A
+    
     @Overrid
@@ -4682,24 +4682,28 @@
   @Override%0A
+    
     public S
@@ -4721,32 +4721,36 @@
 ing() %7B%0A        
+  
+  
 return ToStringB
@@ -4818,18 +4818,160 @@
 YLE)
-.toString(
+;%0A        %7D%0A    %7D%0A%0A    @Override%0A    public String toString() %7B%0A        return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE
 );%0A 

Add aux to ResponseItem for API 1.22