Required role: | Admin | Required permissions: | CanAccess, CanAdd |
POST | /sync/products/batch |
---|
import java.math.*;
import java.util.*;
import net.servicestack.client.*;
import com.google.gson.annotations.*;
import com.google.gson.reflect.*;
public class dtos
{
/**
* Represents a service request to register one or more products in a batch operation.
*/
@Api(Description="Represents a service request to register one or more products in a batch operation.")
public static class BatchRegisterProducts extends BatchRegisterProductsBase
{
/**
* The products to register.
*/
@ApiMember(Description="The products to register.", IsRequired=true)
public ArrayList<Product> products = null;
public ArrayList<Product> getProducts() { return products; }
public BatchRegisterProducts setProducts(ArrayList<Product> value) { this.products = value; return this; }
}
/**
* Specifies a base service request to register one or more products in a batch operation.
*/
@Api(Description="Specifies a base service request to register one or more products in a batch operation.")
public static class BatchRegisterProductsBase implements IPost
{
/**
* The products to register.
*/
@ApiMember(Description="The products to register.", IsRequired=true)
public ArrayList<Product> products = null;
public ArrayList<Product> getProducts() { return products; }
public BatchRegisterProductsBase setProducts(ArrayList<Product> value) { this.products = value; return this; }
}
/**
* Represents a product.
*/
@Api(Description="Represents a product.")
public static class Product implements IHasName
{
/**
* The unique identifier of the product.
*/
@ApiMember(Description="The unique identifier of the product.", IsRequired=true)
public Integer id = null;
/**
* The position of this instance in a collection of 'Product' instances
*/
@ApiMember(Description="The position of this instance in a collection of 'Product' instances", IsRequired=true)
public Integer index = null;
/**
* The name of the product.
*/
@ApiMember(Description="The name of the product.", IsRequired=true)
@Validate(Validator="NotEmpty")
public String name = null;
/**
* The version of the product.
*/
@ApiMember(Description="The version of the product.", IsRequired=true)
@Validate(Validator="NotEmpty")
public String version = null;
/**
* The version of the product.
*/
@ApiMember(Description="The version of the product.")
public String description = null;
/**
* Tags associated with the product.
*/
@ApiMember(Description="Tags associated with the product.")
public ArrayList<String> tags = null;
public Integer getId() { return id; }
public Product setId(Integer value) { this.id = value; return this; }
public Integer getIndex() { return index; }
public Product setIndex(Integer value) { this.index = value; return this; }
public String getName() { return name; }
public Product setName(String value) { this.name = value; return this; }
public String getVersion() { return version; }
public Product setVersion(String value) { this.version = value; return this; }
public String getDescription() { return description; }
public Product setDescription(String value) { this.description = value; return this; }
public ArrayList<String> getTags() { return tags; }
public Product setTags(ArrayList<String> value) { this.tags = value; return this; }
}
}
Java BatchRegisterProducts DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json
To embed the response in a jsonp callback, append ?callback=myCallback
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /sync/products/batch HTTP/1.1
Host: taxfiling.staging.pwc.de
Accept: application/json
Content-Type: application/json
Content-Length: length
{"products":[{"id":0,"index":0,"name":"String","version":"String","description":"String","tags":["String"]}]}
HTTP/1.1 200 OK Content-Type: application/json Content-Length: length [{"product":{"id":0,"index":0,"name":"String","version":"String","description":"String","tags":["String"]},"orders":[{"id":0,"productId":0,"accountId":0,"name":"String","serviceName":"String","requestTimestamp":"\/Date(-62135596800000-0000)\/","responseTimestamp":"\/Date(-62135596800000-0000)\/","requestUri":"String","requestHttpMethod":"String","requestDuration":"PT0S","responseStatusCode":"Continue","clientIPAddress":"String","unitOfMeasurement":"String","processType":"String","dataType":"String","dataName":"String","creationDate":"\/Date(-62135596800000-0000)\/","expiryDate":"\/Date(-62135596800000-0000)\/","isTest":false}],"responseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}}}]