package com.amazonaws.a2s.model;

import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;


/**
 <p>Java class for SellerListingLookupRequest complex type.
 
 <p>The following schema fragment specifies the expected content contained within this class.
 
 <pre>
 * &lt;complexType name="SellerListingLookupRequest">
 *   &lt;complexContent>
 *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       &lt;sequence>
 *         &lt;element name="Id" type="{http://www.w3.org/2001/XMLSchema}string"/>
 *         &lt;element name="SellerId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
 *         &lt;element name="IdType">
 *           &lt;simpleType>
 *             &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
 *               &lt;enumeration value="Exchange"/>
 *               &lt;enumeration value="Listing"/>
 *               &lt;enumeration value="ASIN"/>
 *               &lt;enumeration value="SKU"/>
 *             &lt;/restriction>
 *           &lt;/simpleType>
 *         &lt;/element>
 *         &lt;element name="ResponseGroup" maxOccurs="unbounded" minOccurs="0">
 *           &lt;simpleType>
 *             &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
 *               &lt;enumeration value="Request"/>
 *               &lt;enumeration value="SellerListing"/>
 *             &lt;/restriction>
 *           &lt;/simpleType>
 *         &lt;/element>
 *       &lt;/sequence>
 *     &lt;/restriction>
 *   &lt;/complexContent>
 * &lt;/complexType>
 </pre>
 * Generated by AWS Code Generator
 <p/>
 * Thu Jan 10 05:27:59 PST 2008
 
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "SellerListingLookupRequest", propOrder = {
    "id",
    "sellerId",
    "idType",
    "responseGroup"
})
public class SellerListingLookupRequest {

    @XmlElement(name = "Id", required = true)
    protected String id;
    @XmlElement(name = "SellerId")
    protected String sellerId;
    @XmlElement(name = "IdType", required = true)
    protected String idType;
    @XmlElement(name = "ResponseGroup")
    protected List<String> responseGroup;

    /**
     * Gets the value of the id property.
     
     @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getId() {
        return id;
    }

    /**
     * Sets the value of the id property.
     
     @param value
     *     allowed object is
     *     {@link String }
     *     
     */
    public void setId(String value) {
        this.id = value;
    }

    public boolean isSetId() {
        return (this.id!= null);
    }

    /**
     * Gets the value of the sellerId property.
     
     @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getSellerId() {
        return sellerId;
    }

    /**
     * Sets the value of the sellerId property.
     
     @param value
     *     allowed object is
     *     {@link String }
     *     
     */
    public void setSellerId(String value) {
        this.sellerId = value;
    }

    public boolean isSetSellerId() {
        return (this.sellerId!= null);
    }

    /**
     * Gets the value of the idType property.
     
     @return
     *     possible object is
     *     {@link String }
     *     
     */
    public String getIdType() {
        return idType;
    }

    /**
     * Sets the value of the idType property.
     
     @param value
     *     allowed object is
     *     {@link String }
     *     
     */
    public void setIdType(String value) {
        this.idType = value;
    }

    public boolean isSetIdType() {
        return (this.idType!= null);
    }

    /**
     * Gets the value of the responseGroup property.
     
     <p>
     * 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 <CODE>set</CODE> method for the responseGroup property.
     
     <p>
     * For example, to add a new item, do as follows:
     <pre>
     *    getResponseGroup().add(newItem);
     </pre>
     
     
     <p>
     * Objects of the following type(s) are allowed in the list
     {@link String }
     
     
     */
    public List<String> getResponseGroup() {
        if (responseGroup == null) {
            responseGroup = new ArrayList<String>();
        }
        return this.responseGroup;
    }

    public boolean isSetResponseGroup() {
        return ((this.responseGroup!= null)&&(!this.responseGroup.isEmpty()));
    }

    public void unsetResponseGroup() {
        this.responseGroup = null;
    }

    /**
     * Sets the value of the Id property.
     
     @param value
     @return
     *     this instance
     */
    public SellerListingLookupRequest withId(String value) {
        setId(value);
        return this;
    }

    /**
     * Sets the value of the SellerId property.
     
     @param value
     @return
     *     this instance
     */
    public SellerListingLookupRequest withSellerId(String value) {
        setSellerId(value);
        return this;
    }

    /**
     * Sets the value of the IdType property.
     
     @param value
     @return
     *     this instance
     */
    public SellerListingLookupRequest withIdType(String value) {
        setIdType(value);
        return this;
    }

    /**
     * Sets the value of the ResponseGroup property.
     
     @param values
     @return
     *     this instance
     */
    public SellerListingLookupRequest withResponseGroup(String... values) {
        for (String value: values) {
            getResponseGroup().add(value);
        }
        return this;
    }

    /**
     * Sets the value of the responseGroup property.
     
     @param responseGroup
     *     allowed object is
     *     {@link String }
     *     
     */
    public void setResponseGroup(List<String> responseGroup) {
        this.responseGroup = responseGroup;
    }
    

    /**
     
     * XML fragment representation of this object
     
     @return XML fragment for this object. Name for outer
     * tag expected to be set by calling method. This fragment
     * returns inner properties representation only
     */
    protected String toXMLFragment() {
        StringBuffer xml = new StringBuffer();
        if (isSetId()) {
            xml.append("<Id>");
            xml.append(escapeXML(getId()));
            xml.append("</Id>");
        }
        if (isSetSellerId()) {
            xml.append("<SellerId>");
            xml.append(escapeXML(getSellerId()));
            xml.append("</SellerId>");
        }
        if (isSetIdType()) {
            xml.append("<IdType>");
            xml.append(getIdType() "");
            xml.append("</IdType>");
        }
        java.util.List<String> responseGroupList  =  getResponseGroup();
        for (String responseGroup : responseGroupList) { 
            xml.append("<ResponseGroup>");
            xml.append(responseGroup + "");
            xml.append("</ResponseGroup>");
        }  
        return xml.toString();
    }

    /**
     
     * Escape XML special characters
     */
    private String escapeXML(String string) {
        StringBuffer sb = new StringBuffer();
        int length = string.length();
        for (int i = 0; i < length; ++i) {
            char c = string.charAt(i);
            switch (c) {
            case '&':
                sb.append("&amp;");
                break;
            case '<':
                sb.append("&lt;");
                break;
            case '>':
                sb.append("&gt;");
                break;
            case '\'':
                sb.append("&#039;");
                break;
            case '"':
                sb.append("&quot;");
                break;
            default:
                sb.append(c);
            }
        }
        return sb.toString();
    }


}