From 4a02f680735e8825c74c62221bb4d48c9ea46869 Mon Sep 17 00:00:00 2001 From: linsm Date: Sat, 27 Feb 2021 12:22:44 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0result=20report=20xsd?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../model/result/AmazonEnvelope.java | 109 +++++++++ .../model/result/ProcessingReport.java | 210 ++++++++++++++++++ 2 files changed, 319 insertions(+) create mode 100644 src/main/java/com/amazon/SellingPartnerAPI/model/result/AmazonEnvelope.java create mode 100644 src/main/java/com/amazon/SellingPartnerAPI/model/result/ProcessingReport.java diff --git a/src/main/java/com/amazon/SellingPartnerAPI/model/result/AmazonEnvelope.java b/src/main/java/com/amazon/SellingPartnerAPI/model/result/AmazonEnvelope.java new file mode 100644 index 0000000..bb47787 --- /dev/null +++ b/src/main/java/com/amazon/SellingPartnerAPI/model/result/AmazonEnvelope.java @@ -0,0 +1,109 @@ +package com.amazon.SellingPartnerAPI.model.result; + +import com.amazon.SellingPartnerAPI.model.feeds.Header; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import java.math.BigInteger; +import java.util.ArrayList; +import java.util.List; + +/** + * @author linsm + * @date 2021-02-27 12:12 + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "header", + "messageType", + "message" +}) +@XmlRootElement(name = "AmazonEnvelope") +public class AmazonEnvelope { + + @XmlElement(name = "Header", required = true) + protected Header header; + + @XmlElement(name = "MessageType", required = true) + protected String messageType; + + @XmlElement(name = "Message", required = true) + protected List message; + + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "messageID", + "processingReport" + }) + public static class Message { + @XmlElement(name = "MessageID", required = true) + @XmlSchemaType(name = "positiveInteger") + protected BigInteger messageID; + + @XmlElement(name = "ProcessingReport") + protected ProcessingReport processingReport; + + public BigInteger getMessageID() { + return messageID; + } + + public void setMessageID(BigInteger messageID) { + this.messageID = messageID; + } + + public ProcessingReport getProcessingReport() { + return processingReport; + } + + public void setProcessingReport(ProcessingReport processingReport) { + this.processingReport = processingReport; + } + } + + public Header getHeader() { + return header; + } + + public void setHeader(Header header) { + this.header = header; + } + + public String getMessageType() { + return messageType; + } + + public void setMessageType(String messageType) { + this.messageType = messageType; + } + + /** + * Gets the value of the message property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the message property. + * + *

+ * For example, to add a new item, do as follows: + *

+   *    getMessage().add(newItem);
+   * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link com.amazon.SellingPartnerAPI.model.feeds.AmazonEnvelope.Message } + */ + public List getMessage() { + if (message == null) { + message = new ArrayList(); + } + return this.message; + } +} diff --git a/src/main/java/com/amazon/SellingPartnerAPI/model/result/ProcessingReport.java b/src/main/java/com/amazon/SellingPartnerAPI/model/result/ProcessingReport.java new file mode 100644 index 0000000..40d186e --- /dev/null +++ b/src/main/java/com/amazon/SellingPartnerAPI/model/result/ProcessingReport.java @@ -0,0 +1,210 @@ +package com.amazon.SellingPartnerAPI.model.result; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.adapters.NormalizedStringAdapter; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; +import java.math.BigInteger; + +/** + * GetFeedDocumentResponse Result Report + * @author linsm + * @date 2021-02-27 11:57 + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = {"documentTransactionID", "statusCode", "processingSummary", "result"}) +@XmlRootElement(name = "ProcessingReport") +public class ProcessingReport { + @XmlElement(name = "DocumentTransactionID", required = true) + @XmlJavaTypeAdapter(NormalizedStringAdapter.class) + @XmlSchemaType(name = "normalizedString") + protected String documentTransactionID; + + @XmlElement(name = "StatusCode") + @XmlJavaTypeAdapter(NormalizedStringAdapter.class) + @XmlSchemaType(name = "normalizedString") + protected String statusCode; + + @XmlElement(name = "ProcessingSummary") + protected ProcessingSummary processingSummary; + + @XmlElement(name = "Result") + protected Result result; + + + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = {"messagesProcessed", "messagesSuccessful", "messagesWithError", + "messagesWithWarning"}) + public static class ProcessingSummary { + @XmlElement(name = "MessagesProcessed") + @XmlSchemaType(name = "nonNegativeInteger") + protected BigInteger messagesProcessed; + + @XmlElement(name = "MessagesSuccessful") + @XmlSchemaType(name = "nonNegativeInteger") + protected BigInteger messagesSuccessful; + + @XmlElement(name = "MessagesWithError") + @XmlSchemaType(name = "nonNegativeInteger") + protected BigInteger messagesWithError; + + @XmlElement(name = "MessagesWithWarning") + @XmlSchemaType(name = "nonNegativeInteger") + protected BigInteger messagesWithWarning; + + public BigInteger getMessagesProcessed() { + return messagesProcessed; + } + + public void setMessagesProcessed(BigInteger messagesProcessed) { + this.messagesProcessed = messagesProcessed; + } + + public BigInteger getMessagesSuccessful() { + return messagesSuccessful; + } + + public void setMessagesSuccessful(BigInteger messagesSuccessful) { + this.messagesSuccessful = messagesSuccessful; + } + + public BigInteger getMessagesWithError() { + return messagesWithError; + } + + public void setMessagesWithError(BigInteger messagesWithError) { + this.messagesWithError = messagesWithError; + } + + public BigInteger getMessagesWithWarning() { + return messagesWithWarning; + } + + public void setMessagesWithWarning(BigInteger messagesWithWarning) { + this.messagesWithWarning = messagesWithWarning; + } + } + + + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = {"messageID", "resultCode", "resultMessageCode", "resultDescription", + "additionalInfo"}) + public static class Result { + + @XmlElement(name = "MessageID", required = true) + @XmlJavaTypeAdapter(NormalizedStringAdapter.class) + @XmlSchemaType(name = "normalizedString") + protected String messageID; + + @XmlElement(name = "ResultCode") + @XmlJavaTypeAdapter(NormalizedStringAdapter.class) + @XmlSchemaType(name = "normalizedString") + protected String resultCode; + + @XmlElement(name = "ResultMessageCode", required = true) + @XmlJavaTypeAdapter(NormalizedStringAdapter.class) + @XmlSchemaType(name = "normalizedString") + protected String resultMessageCode; + + @XmlElement(name = "ResultDescription") + @XmlJavaTypeAdapter(NormalizedStringAdapter.class) + @XmlSchemaType(name = "normalizedString") + protected String resultDescription; + + @XmlElement(name = "AdditionalInfo") + protected AdditionalInfo additionalInfo; + + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = {"sku"}) + public static class AdditionalInfo { + @XmlElement(name = "SKU", required = true) + @XmlJavaTypeAdapter(NormalizedStringAdapter.class) + @XmlSchemaType(name = "normalizedString") + private String sku; + + public String getSku() { + return sku; + } + + public void setSku(String sku) { + this.sku = sku; + } + } + + public String getMessageID() { + return messageID; + } + + public void setMessageID(String messageID) { + this.messageID = messageID; + } + + public String getResultCode() { + return resultCode; + } + + public void setResultCode(String resultCode) { + this.resultCode = resultCode; + } + + public String getResultMessageCode() { + return resultMessageCode; + } + + public void setResultMessageCode(String resultMessageCode) { + this.resultMessageCode = resultMessageCode; + } + + public String getResultDescription() { + return resultDescription; + } + + public void setResultDescription(String resultDescription) { + this.resultDescription = resultDescription; + } + + public AdditionalInfo getAdditionalInfo() { + return additionalInfo; + } + + public void setAdditionalInfo(AdditionalInfo additionalInfo) { + this.additionalInfo = additionalInfo; + } + } + + public String getDocumentTransactionID() { + return documentTransactionID; + } + + public void setDocumentTransactionID(String documentTransactionID) { + this.documentTransactionID = documentTransactionID; + } + + public String getStatusCode() { + return statusCode; + } + + public void setStatusCode(String statusCode) { + this.statusCode = statusCode; + } + + public ProcessingSummary getProcessingSummary() { + return processingSummary; + } + + public void setProcessingSummary(ProcessingSummary processingSummary) { + this.processingSummary = processingSummary; + } + + public Result getResult() { + return result; + } + + public void setResult(Result result) { + this.result = result; + } +}