diff --git a/musen.woocommerce.iml b/musen.woocommerce.iml new file mode 100644 index 0000000..68d54a6 --- /dev/null +++ b/musen.woocommerce.iml @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pom.xml b/pom.xml index 2e0f22c..99bd633 100644 --- a/pom.xml +++ b/pom.xml @@ -1,4 +1,17 @@ + + + + + + + + + ]> @@ -45,6 +58,12 @@ 1.4.9 + + + com.google.code.gson + gson + 2.6 + diff --git a/src/main/java/musen/woocommerce/Client.java b/src/main/java/com/g360/woocommerce/client/Client.java similarity index 89% rename from src/main/java/musen/woocommerce/Client.java rename to src/main/java/com/g360/woocommerce/client/Client.java index 350a0b1..d600f42 100644 --- a/src/main/java/musen/woocommerce/Client.java +++ b/src/main/java/com/g360/woocommerce/client/Client.java @@ -1,16 +1,13 @@ -package musen.woocommerce; +package com.g360.woocommerce.client; import com.mashape.unirest.http.exceptions.UnirestException; -import musen.woocommerce.httpclient.HttpClient; -import musen.woocommerce.httpclient.Options; +import com.g360.woocommerce.client.httpclient.HttpClient; +import com.g360.woocommerce.client.httpclient.Options; import java.io.UnsupportedEncodingException; import java.security.InvalidKeyException; import java.security.NoSuchAlgorithmException; -/** - * Created by Muluneh on 8/15/2016. - */ public class Client { public static final String VERSION = "1.0.0"; diff --git a/src/main/java/com/g360/woocommerce/client/WooCommerceClient.java b/src/main/java/com/g360/woocommerce/client/WooCommerceClient.java new file mode 100644 index 0000000..0038b47 --- /dev/null +++ b/src/main/java/com/g360/woocommerce/client/WooCommerceClient.java @@ -0,0 +1,86 @@ +package com.g360.woocommerce.client; + +import com.g360.woocommerce.client.domain.order.Order; +import com.g360.woocommerce.client.domain.order.OrdersContainer; +import com.g360.woocommerce.client.domain.product.Product; +import com.g360.woocommerce.client.domain.product.ProductsContainer; +import com.g360.woocommerce.client.httpclient.Options; +import com.google.gson.Gson; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; + +public class WooCommerceClient { + + private static final String PRODUCTS_END_POINT = "products"; + private static final String ORDERS_END_POINT = "orders"; + private Client client; + private Gson gson; + + public static void main(String[] args) { + WooCommerceClient wooCommerceClient = new WooCommerceClient(); + System.out.println(wooCommerceClient.getProducts()); + } + + public WooCommerceClient() { + HashMap arguments = new HashMap(); + Options options = new Options(arguments); + gson = new Gson(); + + client = new Client( + "http://localhost/lomistore", + "ck_a8f3dd9e2a73caaaf7b6dd3131d46fae70e6b462", + "cs_84924f2f2f58bb0df2d4ad0ed58967865eeb30ca", + options + ); + } + + public List getOrders() { + + List orders = new ArrayList(); + + String jsonString = ""; + + try { + + jsonString = this.client.get(ORDERS_END_POINT); + + OrdersContainer ordersContainer = gson.fromJson(jsonString, OrdersContainer.class); + + orders = ordersContainer.getOrders(); + + } catch(Exception e) { + + System.out.println("Error getting orders"); + + System.out.println(e.getMessage()); + } + + return orders; + } + + public List getProducts() { + + List products = new ArrayList(); + + String jsonString = ""; + + try { + + jsonString = this.client.get(PRODUCTS_END_POINT); + + ProductsContainer productsContainer = gson.fromJson(jsonString, ProductsContainer.class); + + products = productsContainer.getProducts(); + + } catch(Exception e) { + + System.out.println("Error getting products"); + + System.out.println(e.getMessage()); + } + + return products; + } +} diff --git a/src/main/java/com/g360/woocommerce/client/domain/custom/Book.java b/src/main/java/com/g360/woocommerce/client/domain/custom/Book.java new file mode 100644 index 0000000..2582c50 --- /dev/null +++ b/src/main/java/com/g360/woocommerce/client/domain/custom/Book.java @@ -0,0 +1,83 @@ +package com.g360.woocommerce.client.domain.custom; + +import com.g360.woocommerce.client.domain.product.Download; +import com.g360.woocommerce.client.domain.product.Product; +import com.google.gson.Gson; + +import java.net.URI; +import java.util.ArrayList; +import java.util.List; +import java.util.Date; + +public class Book extends Product { + + public String getBookTitle() { + return this.getTitle(); + } + + public String getBookPreview() { + return this.getDescription(); + } + + public String getBookDownloadLink() { + // validate payment + Download download = this.getDownloads().get(0); + return download.getFile(); + } + + public List getBookSearchResults() { + List books = new ArrayList(); + books.add(new Book()); + + return books; + } + + public static List getAllBooks() { + List books = new ArrayList(); + books.add(new Book()); + + return books; + } + + public static List getBooksByCategory() { + List books = new ArrayList(); + books.add(new Book()); + + return books; + } + + public static List getFeaturedBooks() { + List books = new ArrayList(); + books.add(new Book()); + + return books; + } + + public static List getPopularBooks() { + List books = new ArrayList(); + books.add(new Book()); + + return books; + } + + public static List getRecommendedBooks() { + List books = new ArrayList(); + books.add(new Book()); + + return books; + } + + public static List getLomiMonthSelectBooks() { + List books = new ArrayList(); + books.add(new Book()); + + return books; + } + + public static List getTopSellerBooks() { + List books = new ArrayList(); + books.add(new Book()); + + return books; + } +} diff --git a/src/main/java/com/g360/woocommerce/client/domain/order/BillingAddress.java b/src/main/java/com/g360/woocommerce/client/domain/order/BillingAddress.java new file mode 100644 index 0000000..5e162e9 --- /dev/null +++ b/src/main/java/com/g360/woocommerce/client/domain/order/BillingAddress.java @@ -0,0 +1,242 @@ +package com.g360.woocommerce.client.domain.order; + +import javax.annotation.Generated; +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; + +@Generated("org.jsonschema2pojo") +public class BillingAddress { + + @SerializedName("first_name") + @Expose + private String firstName; + @SerializedName("last_name") + @Expose + private String lastName; + @SerializedName("company") + @Expose + private String company; + @SerializedName("address_1") + @Expose + private String address1; + @SerializedName("address_2") + @Expose + private String address2; + @SerializedName("city") + @Expose + private String city; + @SerializedName("state") + @Expose + private String state; + @SerializedName("postcode") + @Expose + private String postcode; + @SerializedName("country") + @Expose + private String country; + @SerializedName("email") + @Expose + private String email; + @SerializedName("phone") + @Expose + private String phone; + + /** + * + * @return + * The firstName + */ + public String getFirstName() { + return firstName; + } + + /** + * + * @param firstName + * The first_name + */ + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + /** + * + * @return + * The lastName + */ + public String getLastName() { + return lastName; + } + + /** + * + * @param lastName + * The last_name + */ + public void setLastName(String lastName) { + this.lastName = lastName; + } + + /** + * + * @return + * The company + */ + public String getCompany() { + return company; + } + + /** + * + * @param company + * The company + */ + public void setCompany(String company) { + this.company = company; + } + + /** + * + * @return + * The address1 + */ + public String getAddress1() { + return address1; + } + + /** + * + * @param address1 + * The address_1 + */ + public void setAddress1(String address1) { + this.address1 = address1; + } + + /** + * + * @return + * The address2 + */ + public String getAddress2() { + return address2; + } + + /** + * + * @param address2 + * The address_2 + */ + public void setAddress2(String address2) { + this.address2 = address2; + } + + /** + * + * @return + * The city + */ + public String getCity() { + return city; + } + + /** + * + * @param city + * The city + */ + public void setCity(String city) { + this.city = city; + } + + /** + * + * @return + * The state + */ + public String getState() { + return state; + } + + /** + * + * @param state + * The state + */ + public void setState(String state) { + this.state = state; + } + + /** + * + * @return + * The postcode + */ + public String getPostcode() { + return postcode; + } + + /** + * + * @param postcode + * The postcode + */ + public void setPostcode(String postcode) { + this.postcode = postcode; + } + + /** + * + * @return + * The country + */ + public String getCountry() { + return country; + } + + /** + * + * @param country + * The country + */ + public void setCountry(String country) { + this.country = country; + } + + /** + * + * @return + * The email + */ + public String getEmail() { + return email; + } + + /** + * + * @param email + * The email + */ + public void setEmail(String email) { + this.email = email; + } + + /** + * + * @return + * The phone + */ + public String getPhone() { + return phone; + } + + /** + * + * @param phone + * The phone + */ + public void setPhone(String phone) { + this.phone = phone; + } + +} \ No newline at end of file diff --git a/src/main/java/com/g360/woocommerce/client/domain/order/BillingAddress_.java b/src/main/java/com/g360/woocommerce/client/domain/order/BillingAddress_.java new file mode 100644 index 0000000..ed32de5 --- /dev/null +++ b/src/main/java/com/g360/woocommerce/client/domain/order/BillingAddress_.java @@ -0,0 +1,242 @@ +package com.g360.woocommerce.client.domain.order; + +import javax.annotation.Generated; +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; + +@Generated("org.jsonschema2pojo") +public class BillingAddress_ { + + @SerializedName("first_name") + @Expose + private String firstName; + @SerializedName("last_name") + @Expose + private String lastName; + @SerializedName("company") + @Expose + private String company; + @SerializedName("address_1") + @Expose + private String address1; + @SerializedName("address_2") + @Expose + private String address2; + @SerializedName("city") + @Expose + private String city; + @SerializedName("state") + @Expose + private String state; + @SerializedName("postcode") + @Expose + private String postcode; + @SerializedName("country") + @Expose + private String country; + @SerializedName("email") + @Expose + private String email; + @SerializedName("phone") + @Expose + private String phone; + + /** + * + * @return + * The firstName + */ + public String getFirstName() { + return firstName; + } + + /** + * + * @param firstName + * The first_name + */ + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + /** + * + * @return + * The lastName + */ + public String getLastName() { + return lastName; + } + + /** + * + * @param lastName + * The last_name + */ + public void setLastName(String lastName) { + this.lastName = lastName; + } + + /** + * + * @return + * The company + */ + public String getCompany() { + return company; + } + + /** + * + * @param company + * The company + */ + public void setCompany(String company) { + this.company = company; + } + + /** + * + * @return + * The address1 + */ + public String getAddress1() { + return address1; + } + + /** + * + * @param address1 + * The address_1 + */ + public void setAddress1(String address1) { + this.address1 = address1; + } + + /** + * + * @return + * The address2 + */ + public String getAddress2() { + return address2; + } + + /** + * + * @param address2 + * The address_2 + */ + public void setAddress2(String address2) { + this.address2 = address2; + } + + /** + * + * @return + * The city + */ + public String getCity() { + return city; + } + + /** + * + * @param city + * The city + */ + public void setCity(String city) { + this.city = city; + } + + /** + * + * @return + * The state + */ + public String getState() { + return state; + } + + /** + * + * @param state + * The state + */ + public void setState(String state) { + this.state = state; + } + + /** + * + * @return + * The postcode + */ + public String getPostcode() { + return postcode; + } + + /** + * + * @param postcode + * The postcode + */ + public void setPostcode(String postcode) { + this.postcode = postcode; + } + + /** + * + * @return + * The country + */ + public String getCountry() { + return country; + } + + /** + * + * @param country + * The country + */ + public void setCountry(String country) { + this.country = country; + } + + /** + * + * @return + * The email + */ + public String getEmail() { + return email; + } + + /** + * + * @param email + * The email + */ + public void setEmail(String email) { + this.email = email; + } + + /** + * + * @return + * The phone + */ + public String getPhone() { + return phone; + } + + /** + * + * @param phone + * The phone + */ + public void setPhone(String phone) { + this.phone = phone; + } + +} \ No newline at end of file diff --git a/src/main/java/com/g360/woocommerce/client/domain/order/Customer.java b/src/main/java/com/g360/woocommerce/client/domain/order/Customer.java new file mode 100644 index 0000000..af7cd54 --- /dev/null +++ b/src/main/java/com/g360/woocommerce/client/domain/order/Customer.java @@ -0,0 +1,137 @@ +package com.g360.woocommerce.client.domain.order; + +import javax.annotation.Generated; +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; + +@Generated("org.jsonschema2pojo") +public class Customer { + + @SerializedName("id") + @Expose + private Integer id; + @SerializedName("email") + @Expose + private String email; + @SerializedName("first_name") + @Expose + private String firstName; + @SerializedName("last_name") + @Expose + private String lastName; + @SerializedName("billing_address") + @Expose + private BillingAddress_ billingAddress; + @SerializedName("shipping_address") + @Expose + private ShippingAddress_ shippingAddress; + + /** + * + * @return + * The id + */ + public Integer getId() { + return id; + } + + /** + * + * @param id + * The id + */ + public void setId(Integer id) { + this.id = id; + } + + /** + * + * @return + * The email + */ + public String getEmail() { + return email; + } + + /** + * + * @param email + * The email + */ + public void setEmail(String email) { + this.email = email; + } + + /** + * + * @return + * The firstName + */ + public String getFirstName() { + return firstName; + } + + /** + * + * @param firstName + * The first_name + */ + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + /** + * + * @return + * The lastName + */ + public String getLastName() { + return lastName; + } + + /** + * + * @param lastName + * The last_name + */ + public void setLastName(String lastName) { + this.lastName = lastName; + } + + /** + * + * @return + * The billingAddress + */ + public BillingAddress_ getBillingAddress() { + return billingAddress; + } + + /** + * + * @param billingAddress + * The billing_address + */ + public void setBillingAddress(BillingAddress_ billingAddress) { + this.billingAddress = billingAddress; + } + + /** + * + * @return + * The shippingAddress + */ + public ShippingAddress_ getShippingAddress() { + return shippingAddress; + } + + /** + * + * @param shippingAddress + * The shipping_address + */ + public void setShippingAddress(ShippingAddress_ shippingAddress) { + this.shippingAddress = shippingAddress; + } + +} \ No newline at end of file diff --git a/src/main/java/com/g360/woocommerce/client/domain/order/Order.java b/src/main/java/com/g360/woocommerce/client/domain/order/Order.java new file mode 100644 index 0000000..c60f710 --- /dev/null +++ b/src/main/java/com/g360/woocommerce/client/domain/order/Order.java @@ -0,0 +1,685 @@ +package com.g360.woocommerce.client.domain.order; + +import java.util.ArrayList; +import java.util.List; +import javax.annotation.Generated; +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; + +@Generated("org.jsonschema2pojo") +public class Order { + + @SerializedName("id") + @Expose + private Integer id; + @SerializedName("order_number") + @Expose + private Integer orderNumber; + @SerializedName("order_key") + @Expose + private String orderKey; + @SerializedName("created_at") + @Expose + private String createdAt; + @SerializedName("updated_at") + @Expose + private String updatedAt; + @SerializedName("completed_at") + @Expose + private String completedAt; + @SerializedName("status") + @Expose + private String status; + @SerializedName("currency") + @Expose + private String currency; + @SerializedName("total") + @Expose + private String total; + @SerializedName("subtotal") + @Expose + private String subtotal; + @SerializedName("total_line_items_quantity") + @Expose + private Integer totalLineItemsQuantity; + @SerializedName("total_tax") + @Expose + private String totalTax; + @SerializedName("total_shipping") + @Expose + private String totalShipping; + @SerializedName("cart_tax") + @Expose + private String cartTax; + @SerializedName("shipping_tax") + @Expose + private String shippingTax; + @SerializedName("total_discount") + @Expose + private String totalDiscount; + @SerializedName("shipping_methods") + @Expose + private String shippingMethods; + @SerializedName("payment_details") + @Expose + private PaymentDetails paymentDetails; + @SerializedName("billing_address") + @Expose + private BillingAddress billingAddress; + @SerializedName("shipping_address") + @Expose + private ShippingAddress shippingAddress; + @SerializedName("note") + @Expose + private String note; + @SerializedName("customer_ip") + @Expose + private String customerIp; + @SerializedName("customer_user_agent") + @Expose + private String customerUserAgent; + @SerializedName("customer_id") + @Expose + private Integer customerId; + @SerializedName("view_order_url") + @Expose + private String viewOrderUrl; + @SerializedName("line_items") + @Expose + private List lineItems = new ArrayList(); + @SerializedName("shipping_lines") + @Expose + private List shippingLines = new ArrayList(); + @SerializedName("tax_lines") + @Expose + private List taxLines = new ArrayList(); + @SerializedName("fee_lines") + @Expose + private List feeLines = new ArrayList(); + @SerializedName("coupon_lines") + @Expose + private List couponLines = new ArrayList(); + @SerializedName("is_vat_exempt") + @Expose + private Boolean isVatExempt; + @SerializedName("customer") + @Expose + private Customer customer; + + /** + * + * @return + * The id + */ + public Integer getId() { + return id; + } + + /** + * + * @param id + * The id + */ + public void setId(Integer id) { + this.id = id; + } + + /** + * + * @return + * The orderNumber + */ + public Integer getOrderNumber() { + return orderNumber; + } + + /** + * + * @param orderNumber + * The order_number + */ + public void setOrderNumber(Integer orderNumber) { + this.orderNumber = orderNumber; + } + + /** + * + * @return + * The orderKey + */ + public String getOrderKey() { + return orderKey; + } + + /** + * + * @param orderKey + * The order_key + */ + public void setOrderKey(String orderKey) { + this.orderKey = orderKey; + } + + /** + * + * @return + * The createdAt + */ + public String getCreatedAt() { + return createdAt; + } + + /** + * + * @param createdAt + * The created_at + */ + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } + + /** + * + * @return + * The updatedAt + */ + public String getUpdatedAt() { + return updatedAt; + } + + /** + * + * @param updatedAt + * The updated_at + */ + public void setUpdatedAt(String updatedAt) { + this.updatedAt = updatedAt; + } + + /** + * + * @return + * The completedAt + */ + public String getCompletedAt() { + return completedAt; + } + + /** + * + * @param completedAt + * The completed_at + */ + public void setCompletedAt(String completedAt) { + this.completedAt = completedAt; + } + + /** + * + * @return + * The status + */ + public String getStatus() { + return status; + } + + /** + * + * @param status + * The status + */ + public void setStatus(String status) { + this.status = status; + } + + /** + * + * @return + * The currency + */ + public String getCurrency() { + return currency; + } + + /** + * + * @param currency + * The currency + */ + public void setCurrency(String currency) { + this.currency = currency; + } + + /** + * + * @return + * The total + */ + public String getTotal() { + return total; + } + + /** + * + * @param total + * The total + */ + public void setTotal(String total) { + this.total = total; + } + + /** + * + * @return + * The subtotal + */ + public String getSubtotal() { + return subtotal; + } + + /** + * + * @param subtotal + * The subtotal + */ + public void setSubtotal(String subtotal) { + this.subtotal = subtotal; + } + + /** + * + * @return + * The totalLineItemsQuantity + */ + public Integer getTotalLineItemsQuantity() { + return totalLineItemsQuantity; + } + + /** + * + * @param totalLineItemsQuantity + * The total_line_items_quantity + */ + public void setTotalLineItemsQuantity(Integer totalLineItemsQuantity) { + this.totalLineItemsQuantity = totalLineItemsQuantity; + } + + /** + * + * @return + * The totalTax + */ + public String getTotalTax() { + return totalTax; + } + + /** + * + * @param totalTax + * The total_tax + */ + public void setTotalTax(String totalTax) { + this.totalTax = totalTax; + } + + /** + * + * @return + * The totalShipping + */ + public String getTotalShipping() { + return totalShipping; + } + + /** + * + * @param totalShipping + * The total_shipping + */ + public void setTotalShipping(String totalShipping) { + this.totalShipping = totalShipping; + } + + /** + * + * @return + * The cartTax + */ + public String getCartTax() { + return cartTax; + } + + /** + * + * @param cartTax + * The cart_tax + */ + public void setCartTax(String cartTax) { + this.cartTax = cartTax; + } + + /** + * + * @return + * The shippingTax + */ + public String getShippingTax() { + return shippingTax; + } + + /** + * + * @param shippingTax + * The shipping_tax + */ + public void setShippingTax(String shippingTax) { + this.shippingTax = shippingTax; + } + + /** + * + * @return + * The totalDiscount + */ + public String getTotalDiscount() { + return totalDiscount; + } + + /** + * + * @param totalDiscount + * The total_discount + */ + public void setTotalDiscount(String totalDiscount) { + this.totalDiscount = totalDiscount; + } + + /** + * + * @return + * The shippingMethods + */ + public String getShippingMethods() { + return shippingMethods; + } + + /** + * + * @param shippingMethods + * The shipping_methods + */ + public void setShippingMethods(String shippingMethods) { + this.shippingMethods = shippingMethods; + } + + /** + * + * @return + * The paymentDetails + */ + public PaymentDetails getPaymentDetails() { + return paymentDetails; + } + + /** + * + * @param paymentDetails + * The payment_details + */ + public void setPaymentDetails(PaymentDetails paymentDetails) { + this.paymentDetails = paymentDetails; + } + + /** + * + * @return + * The billingAddress + */ + public BillingAddress getBillingAddress() { + return billingAddress; + } + + /** + * + * @param billingAddress + * The billing_address + */ + public void setBillingAddress(BillingAddress billingAddress) { + this.billingAddress = billingAddress; + } + + /** + * + * @return + * The shippingAddress + */ + public ShippingAddress getShippingAddress() { + return shippingAddress; + } + + /** + * + * @param shippingAddress + * The shipping_address + */ + public void setShippingAddress(ShippingAddress shippingAddress) { + this.shippingAddress = shippingAddress; + } + + /** + * + * @return + * The note + */ + public String getNote() { + return note; + } + + /** + * + * @param note + * The note + */ + public void setNote(String note) { + this.note = note; + } + + /** + * + * @return + * The customerIp + */ + public String getCustomerIp() { + return customerIp; + } + + /** + * + * @param customerIp + * The customer_ip + */ + public void setCustomerIp(String customerIp) { + this.customerIp = customerIp; + } + + /** + * + * @return + * The customerUserAgent + */ + public String getCustomerUserAgent() { + return customerUserAgent; + } + + /** + * + * @param customerUserAgent + * The customer_user_agent + */ + public void setCustomerUserAgent(String customerUserAgent) { + this.customerUserAgent = customerUserAgent; + } + + /** + * + * @return + * The customerId + */ + public Integer getCustomerId() { + return customerId; + } + + /** + * + * @param customerId + * The customer_id + */ + public void setCustomerId(Integer customerId) { + this.customerId = customerId; + } + + /** + * + * @return + * The viewOrderUrl + */ + public String getViewOrderUrl() { + return viewOrderUrl; + } + + /** + * + * @param viewOrderUrl + * The view_order_url + */ + public void setViewOrderUrl(String viewOrderUrl) { + this.viewOrderUrl = viewOrderUrl; + } + + /** + * + * @return + * The lineItems + */ + public List getLineItems() { + return lineItems; + } + + /** + * + * @param lineItems + * The line_items + */ + public void setLineItems(List lineItems) { + this.lineItems = lineItems; + } + + /** + * + * @return + * The shippingLines + */ + public List getShippingLines() { + return shippingLines; + } + + /** + * + * @param shippingLines + * The shipping_lines + */ + public void setShippingLines(List shippingLines) { + this.shippingLines = shippingLines; + } + + /** + * + * @return + * The taxLines + */ + public List getTaxLines() { + return taxLines; + } + + /** + * + * @param taxLines + * The tax_lines + */ + public void setTaxLines(List taxLines) { + this.taxLines = taxLines; + } + + /** + * + * @return + * The feeLines + */ + public List getFeeLines() { + return feeLines; + } + + /** + * + * @param feeLines + * The fee_lines + */ + public void setFeeLines(List feeLines) { + this.feeLines = feeLines; + } + + /** + * + * @return + * The couponLines + */ + public List getCouponLines() { + return couponLines; + } + + /** + * + * @param couponLines + * The coupon_lines + */ + public void setCouponLines(List couponLines) { + this.couponLines = couponLines; + } + + /** + * + * @return + * The isVatExempt + */ + public Boolean getIsVatExempt() { + return isVatExempt; + } + + /** + * + * @param isVatExempt + * The is_vat_exempt + */ + public void setIsVatExempt(Boolean isVatExempt) { + this.isVatExempt = isVatExempt; + } + + /** + * + * @return + * The customer + */ + public Customer getCustomer() { + return customer; + } + + /** + * + * @param customer + * The customer + */ + public void setCustomer(Customer customer) { + this.customer = customer; + } + +} \ No newline at end of file diff --git a/src/main/java/com/g360/woocommerce/client/domain/order/OrdersContainer.java b/src/main/java/com/g360/woocommerce/client/domain/order/OrdersContainer.java new file mode 100644 index 0000000..a28b65f --- /dev/null +++ b/src/main/java/com/g360/woocommerce/client/domain/order/OrdersContainer.java @@ -0,0 +1,17 @@ +package com.g360.woocommerce.client.domain.order; + +import java.util.ArrayList; +import java.util.List; + +public class OrdersContainer { + + private List orders; + + public List getOrders() { + return orders; + } + + public void setOrders(List orders) { + this.orders = orders; + } +} \ No newline at end of file diff --git a/src/main/java/com/g360/woocommerce/client/domain/order/PaymentDetails.java b/src/main/java/com/g360/woocommerce/client/domain/order/PaymentDetails.java new file mode 100644 index 0000000..1627478 --- /dev/null +++ b/src/main/java/com/g360/woocommerce/client/domain/order/PaymentDetails.java @@ -0,0 +1,74 @@ +package com.g360.woocommerce.client.domain.order; + +import javax.annotation.Generated; +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; + +@Generated("org.jsonschema2pojo") +public class PaymentDetails { + + @SerializedName("method_id") + @Expose + private String methodId; + @SerializedName("method_title") + @Expose + private String methodTitle; + @SerializedName("paid") + @Expose + private Boolean paid; + + /** + * + * @return + * The methodId + */ + public String getMethodId() { + return methodId; + } + + /** + * + * @param methodId + * The method_id + */ + public void setMethodId(String methodId) { + this.methodId = methodId; + } + + /** + * + * @return + * The methodTitle + */ + public String getMethodTitle() { + return methodTitle; + } + + /** + * + * @param methodTitle + * The method_title + */ + public void setMethodTitle(String methodTitle) { + this.methodTitle = methodTitle; + } + + /** + * + * @return + * The paid + */ + public Boolean getPaid() { + return paid; + } + + /** + * + * @param paid + * The paid + */ + public void setPaid(Boolean paid) { + this.paid = paid; + } + +} \ No newline at end of file diff --git a/src/main/java/com/g360/woocommerce/client/domain/order/ShippingAddress.java b/src/main/java/com/g360/woocommerce/client/domain/order/ShippingAddress.java new file mode 100644 index 0000000..adac976 --- /dev/null +++ b/src/main/java/com/g360/woocommerce/client/domain/order/ShippingAddress.java @@ -0,0 +1,200 @@ +package com.g360.woocommerce.client.domain.order; + +import javax.annotation.Generated; +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; + +@Generated("org.jsonschema2pojo") +public class ShippingAddress { + + @SerializedName("first_name") + @Expose + private String firstName; + @SerializedName("last_name") + @Expose + private String lastName; + @SerializedName("company") + @Expose + private String company; + @SerializedName("address_1") + @Expose + private String address1; + @SerializedName("address_2") + @Expose + private String address2; + @SerializedName("city") + @Expose + private String city; + @SerializedName("state") + @Expose + private String state; + @SerializedName("postcode") + @Expose + private String postcode; + @SerializedName("country") + @Expose + private String country; + + /** + * + * @return + * The firstName + */ + public String getFirstName() { + return firstName; + } + + /** + * + * @param firstName + * The first_name + */ + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + /** + * + * @return + * The lastName + */ + public String getLastName() { + return lastName; + } + + /** + * + * @param lastName + * The last_name + */ + public void setLastName(String lastName) { + this.lastName = lastName; + } + + /** + * + * @return + * The company + */ + public String getCompany() { + return company; + } + + /** + * + * @param company + * The company + */ + public void setCompany(String company) { + this.company = company; + } + + /** + * + * @return + * The address1 + */ + public String getAddress1() { + return address1; + } + + /** + * + * @param address1 + * The address_1 + */ + public void setAddress1(String address1) { + this.address1 = address1; + } + + /** + * + * @return + * The address2 + */ + public String getAddress2() { + return address2; + } + + /** + * + * @param address2 + * The address_2 + */ + public void setAddress2(String address2) { + this.address2 = address2; + } + + /** + * + * @return + * The city + */ + public String getCity() { + return city; + } + + /** + * + * @param city + * The city + */ + public void setCity(String city) { + this.city = city; + } + + /** + * + * @return + * The state + */ + public String getState() { + return state; + } + + /** + * + * @param state + * The state + */ + public void setState(String state) { + this.state = state; + } + + /** + * + * @return + * The postcode + */ + public String getPostcode() { + return postcode; + } + + /** + * + * @param postcode + * The postcode + */ + public void setPostcode(String postcode) { + this.postcode = postcode; + } + + /** + * + * @return + * The country + */ + public String getCountry() { + return country; + } + + /** + * + * @param country + * The country + */ + public void setCountry(String country) { + this.country = country; + } + +} \ No newline at end of file diff --git a/src/main/java/com/g360/woocommerce/client/domain/order/ShippingAddress_.java b/src/main/java/com/g360/woocommerce/client/domain/order/ShippingAddress_.java new file mode 100644 index 0000000..29385bb --- /dev/null +++ b/src/main/java/com/g360/woocommerce/client/domain/order/ShippingAddress_.java @@ -0,0 +1,200 @@ +package com.g360.woocommerce.client.domain.order; + +import javax.annotation.Generated; +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; + +@Generated("org.jsonschema2pojo") +public class ShippingAddress_ { + + @SerializedName("first_name") + @Expose + private String firstName; + @SerializedName("last_name") + @Expose + private String lastName; + @SerializedName("company") + @Expose + private String company; + @SerializedName("address_1") + @Expose + private String address1; + @SerializedName("address_2") + @Expose + private String address2; + @SerializedName("city") + @Expose + private String city; + @SerializedName("state") + @Expose + private String state; + @SerializedName("postcode") + @Expose + private String postcode; + @SerializedName("country") + @Expose + private String country; + + /** + * + * @return + * The firstName + */ + public String getFirstName() { + return firstName; + } + + /** + * + * @param firstName + * The first_name + */ + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + /** + * + * @return + * The lastName + */ + public String getLastName() { + return lastName; + } + + /** + * + * @param lastName + * The last_name + */ + public void setLastName(String lastName) { + this.lastName = lastName; + } + + /** + * + * @return + * The company + */ + public String getCompany() { + return company; + } + + /** + * + * @param company + * The company + */ + public void setCompany(String company) { + this.company = company; + } + + /** + * + * @return + * The address1 + */ + public String getAddress1() { + return address1; + } + + /** + * + * @param address1 + * The address_1 + */ + public void setAddress1(String address1) { + this.address1 = address1; + } + + /** + * + * @return + * The address2 + */ + public String getAddress2() { + return address2; + } + + /** + * + * @param address2 + * The address_2 + */ + public void setAddress2(String address2) { + this.address2 = address2; + } + + /** + * + * @return + * The city + */ + public String getCity() { + return city; + } + + /** + * + * @param city + * The city + */ + public void setCity(String city) { + this.city = city; + } + + /** + * + * @return + * The state + */ + public String getState() { + return state; + } + + /** + * + * @param state + * The state + */ + public void setState(String state) { + this.state = state; + } + + /** + * + * @return + * The postcode + */ + public String getPostcode() { + return postcode; + } + + /** + * + * @param postcode + * The postcode + */ + public void setPostcode(String postcode) { + this.postcode = postcode; + } + + /** + * + * @return + * The country + */ + public String getCountry() { + return country; + } + + /** + * + * @param country + * The country + */ + public void setCountry(String country) { + this.country = country; + } + +} \ No newline at end of file diff --git a/src/main/java/com/g360/woocommerce/client/domain/product/Attribute.java b/src/main/java/com/g360/woocommerce/client/domain/product/Attribute.java new file mode 100644 index 0000000..f34c688 --- /dev/null +++ b/src/main/java/com/g360/woocommerce/client/domain/product/Attribute.java @@ -0,0 +1,139 @@ +package com.g360.woocommerce.client.domain.product; + +import java.util.ArrayList; +import java.util.List; +import javax.annotation.Generated; +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; + +@Generated("org.jsonschema2pojo") +public class Attribute { + + @SerializedName("name") + @Expose + private String name; + @SerializedName("slug") + @Expose + private String slug; + @SerializedName("position") + @Expose + private Integer position; + @SerializedName("visible") + @Expose + private Boolean visible; + @SerializedName("variation") + @Expose + private Boolean variation; + @SerializedName("options") + @Expose + private List options = new ArrayList(); + + /** + * + * @return + * The name + */ + public String getName() { + return name; + } + + /** + * + * @param name + * The name + */ + public void setName(String name) { + this.name = name; + } + + /** + * + * @return + * The slug + */ + public String getSlug() { + return slug; + } + + /** + * + * @param slug + * The slug + */ + public void setSlug(String slug) { + this.slug = slug; + } + + /** + * + * @return + * The position + */ + public Integer getPosition() { + return position; + } + + /** + * + * @param position + * The position + */ + public void setPosition(Integer position) { + this.position = position; + } + + /** + * + * @return + * The visible + */ + public Boolean getVisible() { + return visible; + } + + /** + * + * @param visible + * The visible + */ + public void setVisible(Boolean visible) { + this.visible = visible; + } + + /** + * + * @return + * The variation + */ + public Boolean getVariation() { + return variation; + } + + /** + * + * @param variation + * The variation + */ + public void setVariation(Boolean variation) { + this.variation = variation; + } + + /** + * + * @return + * The options + */ + public List getOptions() { + return options; + } + + /** + * + * @param options + * The options + */ + public void setOptions(List options) { + this.options = options; + } + +} \ No newline at end of file diff --git a/src/main/java/com/g360/woocommerce/client/domain/product/Dimensions.java b/src/main/java/com/g360/woocommerce/client/domain/product/Dimensions.java new file mode 100644 index 0000000..e4f38a0 --- /dev/null +++ b/src/main/java/com/g360/woocommerce/client/domain/product/Dimensions.java @@ -0,0 +1,95 @@ +package com.g360.woocommerce.client.domain.product; + +import javax.annotation.Generated; +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; + +@Generated("org.jsonschema2pojo") +public class Dimensions { + + @SerializedName("length") + @Expose + private String length; + @SerializedName("width") + @Expose + private String width; + @SerializedName("height") + @Expose + private String height; + @SerializedName("unit") + @Expose + private String unit; + + /** + * + * @return + * The length + */ + public String getLength() { + return length; + } + + /** + * + * @param length + * The length + */ + public void setLength(String length) { + this.length = length; + } + + /** + * + * @return + * The width + */ + public String getWidth() { + return width; + } + + /** + * + * @param width + * The width + */ + public void setWidth(String width) { + this.width = width; + } + + /** + * + * @return + * The height + */ + public String getHeight() { + return height; + } + + /** + * + * @param height + * The height + */ + public void setHeight(String height) { + this.height = height; + } + + /** + * + * @return + * The unit + */ + public String getUnit() { + return unit; + } + + /** + * + * @param unit + * The unit + */ + public void setUnit(String unit) { + this.unit = unit; + } + +} \ No newline at end of file diff --git a/src/main/java/com/g360/woocommerce/client/domain/product/Download.java b/src/main/java/com/g360/woocommerce/client/domain/product/Download.java new file mode 100644 index 0000000..931e869 --- /dev/null +++ b/src/main/java/com/g360/woocommerce/client/domain/product/Download.java @@ -0,0 +1,74 @@ +package com.g360.woocommerce.client.domain.product; + +import javax.annotation.Generated; +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; + +@Generated("org.jsonschema2pojo") +public class Download { + + @SerializedName("id") + @Expose + private String id; + @SerializedName("name") + @Expose + private String name; + @SerializedName("file") + @Expose + private String file; + + /** + * + * @return + * The id + */ + public String getId() { + return id; + } + + /** + * + * @param id + * The id + */ + public void setId(String id) { + this.id = id; + } + + /** + * + * @return + * The name + */ + public String getName() { + return name; + } + + /** + * + * @param name + * The name + */ + public void setName(String name) { + this.name = name; + } + + /** + * + * @return + * The file + */ + public String getFile() { + return file; + } + + /** + * + * @param file + * The file + */ + public void setFile(String file) { + this.file = file; + } + +} \ No newline at end of file diff --git a/src/main/java/com/g360/woocommerce/client/domain/product/Image.java b/src/main/java/com/g360/woocommerce/client/domain/product/Image.java new file mode 100644 index 0000000..81d4177 --- /dev/null +++ b/src/main/java/com/g360/woocommerce/client/domain/product/Image.java @@ -0,0 +1,158 @@ +package com.g360.woocommerce.client.domain.product; + +import javax.annotation.Generated; +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; + +@Generated("org.jsonschema2pojo") +public class Image { + + @SerializedName("id") + @Expose + private Integer id; + @SerializedName("created_at") + @Expose + private String createdAt; + @SerializedName("updated_at") + @Expose + private String updatedAt; + @SerializedName("src") + @Expose + private String src; + @SerializedName("title") + @Expose + private String title; + @SerializedName("alt") + @Expose + private String alt; + @SerializedName("position") + @Expose + private Integer position; + + /** + * + * @return + * The id + */ + public Integer getId() { + return id; + } + + /** + * + * @param id + * The id + */ + public void setId(Integer id) { + this.id = id; + } + + /** + * + * @return + * The createdAt + */ + public String getCreatedAt() { + return createdAt; + } + + /** + * + * @param createdAt + * The created_at + */ + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } + + /** + * + * @return + * The updatedAt + */ + public String getUpdatedAt() { + return updatedAt; + } + + /** + * + * @param updatedAt + * The updated_at + */ + public void setUpdatedAt(String updatedAt) { + this.updatedAt = updatedAt; + } + + /** + * + * @return + * The src + */ + public String getSrc() { + return src; + } + + /** + * + * @param src + * The src + */ + public void setSrc(String src) { + this.src = src; + } + + /** + * + * @return + * The title + */ + public String getTitle() { + return title; + } + + /** + * + * @param title + * The title + */ + public void setTitle(String title) { + this.title = title; + } + + /** + * + * @return + * The alt + */ + public String getAlt() { + return alt; + } + + /** + * + * @param alt + * The alt + */ + public void setAlt(String alt) { + this.alt = alt; + } + + /** + * + * @return + * The position + */ + public Integer getPosition() { + return position; + } + + /** + * + * @param position + * The position + */ + public void setPosition(Integer position) { + this.position = position; + } + +} \ No newline at end of file diff --git a/src/main/java/com/g360/woocommerce/client/domain/product/Product.java b/src/main/java/com/g360/woocommerce/client/domain/product/Product.java new file mode 100644 index 0000000..4835422 --- /dev/null +++ b/src/main/java/com/g360/woocommerce/client/domain/product/Product.java @@ -0,0 +1,1273 @@ +package com.g360.woocommerce.client.domain.product; + +import java.util.ArrayList; +import java.util.List; +import javax.annotation.Generated; +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; + +@Generated("org.jsonschema2pojo") +public class Product { + + @SerializedName("title") + @Expose + private String title; + @SerializedName("id") + @Expose + private Integer id; + @SerializedName("created_at") + @Expose + private String createdAt; + @SerializedName("updated_at") + @Expose + private String updatedAt; + @SerializedName("type") + @Expose + private String type; + @SerializedName("status") + @Expose + private String status; + @SerializedName("downloadable") + @Expose + private Boolean downloadable; + @SerializedName("virtual") + @Expose + private Boolean virtual; + @SerializedName("permalink") + @Expose + private String permalink; + @SerializedName("sku") + @Expose + private String sku; + @SerializedName("price") + @Expose + private String price; + @SerializedName("regular_price") + @Expose + private String regularPrice; + @SerializedName("sale_price") + @Expose + private Object salePrice; + @SerializedName("price_html") + @Expose + private String priceHtml; + @SerializedName("taxable") + @Expose + private Boolean taxable; + @SerializedName("tax_status") + @Expose + private String taxStatus; + @SerializedName("tax_class") + @Expose + private String taxClass; + @SerializedName("managing_stock") + @Expose + private Boolean managingStock; + @SerializedName("stock_quantity") + @Expose + private Object stockQuantity; + @SerializedName("in_stock") + @Expose + private Boolean inStock; + @SerializedName("backorders_allowed") + @Expose + private Boolean backordersAllowed; + @SerializedName("backordered") + @Expose + private Boolean backordered; + @SerializedName("sold_individually") + @Expose + private Boolean soldIndividually; + @SerializedName("purchaseable") + @Expose + private Boolean purchaseable; + @SerializedName("featured") + @Expose + private Boolean featured; + @SerializedName("visible") + @Expose + private Boolean visible; + @SerializedName("catalog_visibility") + @Expose + private String catalogVisibility; + @SerializedName("on_sale") + @Expose + private Boolean onSale; + @SerializedName("product_url") + @Expose + private String productUrl; + @SerializedName("button_text") + @Expose + private String buttonText; + @SerializedName("weight") + @Expose + private Object weight; + @SerializedName("dimensions") + @Expose + private Dimensions dimensions; + @SerializedName("shipping_required") + @Expose + private Boolean shippingRequired; + @SerializedName("shipping_taxable") + @Expose + private Boolean shippingTaxable; + @SerializedName("shipping_class") + @Expose + private String shippingClass; + @SerializedName("shipping_class_id") + @Expose + private Object shippingClassId; + @SerializedName("description") + @Expose + private String description; + @SerializedName("short_description") + @Expose + private String shortDescription; + @SerializedName("reviews_allowed") + @Expose + private Boolean reviewsAllowed; + @SerializedName("average_rating") + @Expose + private String averageRating; + @SerializedName("rating_count") + @Expose + private Integer ratingCount; + @SerializedName("related_ids") + @Expose + private List relatedIds = new ArrayList(); + @SerializedName("upsell_ids") + @Expose + private List upsellIds = new ArrayList(); + @SerializedName("cross_sell_ids") + @Expose + private List crossSellIds = new ArrayList(); + @SerializedName("parent_id") + @Expose + private Integer parentId; + @SerializedName("categories") + @Expose + private List categories = new ArrayList(); + @SerializedName("tags") + @Expose + private List tags = new ArrayList(); + @SerializedName("images") + @Expose + private List images = new ArrayList(); + @SerializedName("featured_src") + @Expose + private String featuredSrc; + @SerializedName("attributes") + @Expose + private List attributes = new ArrayList(); + @SerializedName("downloads") + @Expose + private List downloads = new ArrayList(); + @SerializedName("download_limit") + @Expose + private Integer downloadLimit; + @SerializedName("download_expiry") + @Expose + private Integer downloadExpiry; + @SerializedName("download_type") + @Expose + private String downloadType; + @SerializedName("purchase_note") + @Expose + private String purchaseNote; + @SerializedName("total_sales") + @Expose + private Integer totalSales; + @SerializedName("variations") + @Expose + private List variations = new ArrayList(); + @SerializedName("parent") + @Expose + private List parent = new ArrayList(); + @SerializedName("grouped_products") + @Expose + private List groupedProducts = new ArrayList(); + @SerializedName("menu_order") + @Expose + private Integer menuOrder; + + /** + * + * @return + * The title + */ + public String getTitle() { + return title; + } + + /** + * + * @param title + * The title + */ + public void setTitle(String title) { + this.title = title; + } + + /** + * + * @return + * The id + */ + public Integer getId() { + return id; + } + + /** + * + * @param id + * The id + */ + public void setId(Integer id) { + this.id = id; + } + + /** + * + * @return + * The createdAt + */ + public String getCreatedAt() { + return createdAt; + } + + /** + * + * @param createdAt + * The created_at + */ + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } + + /** + * + * @return + * The updatedAt + */ + public String getUpdatedAt() { + return updatedAt; + } + + /** + * + * @param updatedAt + * The updated_at + */ + public void setUpdatedAt(String updatedAt) { + this.updatedAt = updatedAt; + } + + /** + * + * @return + * The type + */ + public String getType() { + return type; + } + + /** + * + * @param type + * The type + */ + public void setType(String type) { + this.type = type; + } + + /** + * + * @return + * The status + */ + public String getStatus() { + return status; + } + + /** + * + * @param status + * The status + */ + public void setStatus(String status) { + this.status = status; + } + + /** + * + * @return + * The downloadable + */ + public Boolean getDownloadable() { + return downloadable; + } + + /** + * + * @param downloadable + * The downloadable + */ + public void setDownloadable(Boolean downloadable) { + this.downloadable = downloadable; + } + + /** + * + * @return + * The virtual + */ + public Boolean getVirtual() { + return virtual; + } + + /** + * + * @param virtual + * The virtual + */ + public void setVirtual(Boolean virtual) { + this.virtual = virtual; + } + + /** + * + * @return + * The permalink + */ + public String getPermalink() { + return permalink; + } + + /** + * + * @param permalink + * The permalink + */ + public void setPermalink(String permalink) { + this.permalink = permalink; + } + + /** + * + * @return + * The sku + */ + public String getSku() { + return sku; + } + + /** + * + * @param sku + * The sku + */ + public void setSku(String sku) { + this.sku = sku; + } + + /** + * + * @return + * The price + */ + public String getPrice() { + return price; + } + + /** + * + * @param price + * The price + */ + public void setPrice(String price) { + this.price = price; + } + + /** + * + * @return + * The regularPrice + */ + public String getRegularPrice() { + return regularPrice; + } + + /** + * + * @param regularPrice + * The regular_price + */ + public void setRegularPrice(String regularPrice) { + this.regularPrice = regularPrice; + } + + /** + * + * @return + * The salePrice + */ + public Object getSalePrice() { + return salePrice; + } + + /** + * + * @param salePrice + * The sale_price + */ + public void setSalePrice(Object salePrice) { + this.salePrice = salePrice; + } + + /** + * + * @return + * The priceHtml + */ + public String getPriceHtml() { + return priceHtml; + } + + /** + * + * @param priceHtml + * The price_html + */ + public void setPriceHtml(String priceHtml) { + this.priceHtml = priceHtml; + } + + /** + * + * @return + * The taxable + */ + public Boolean getTaxable() { + return taxable; + } + + /** + * + * @param taxable + * The taxable + */ + public void setTaxable(Boolean taxable) { + this.taxable = taxable; + } + + /** + * + * @return + * The taxStatus + */ + public String getTaxStatus() { + return taxStatus; + } + + /** + * + * @param taxStatus + * The tax_status + */ + public void setTaxStatus(String taxStatus) { + this.taxStatus = taxStatus; + } + + /** + * + * @return + * The taxClass + */ + public String getTaxClass() { + return taxClass; + } + + /** + * + * @param taxClass + * The tax_class + */ + public void setTaxClass(String taxClass) { + this.taxClass = taxClass; + } + + /** + * + * @return + * The managingStock + */ + public Boolean getManagingStock() { + return managingStock; + } + + /** + * + * @param managingStock + * The managing_stock + */ + public void setManagingStock(Boolean managingStock) { + this.managingStock = managingStock; + } + + /** + * + * @return + * The stockQuantity + */ + public Object getStockQuantity() { + return stockQuantity; + } + + /** + * + * @param stockQuantity + * The stock_quantity + */ + public void setStockQuantity(Object stockQuantity) { + this.stockQuantity = stockQuantity; + } + + /** + * + * @return + * The inStock + */ + public Boolean getInStock() { + return inStock; + } + + /** + * + * @param inStock + * The in_stock + */ + public void setInStock(Boolean inStock) { + this.inStock = inStock; + } + + /** + * + * @return + * The backordersAllowed + */ + public Boolean getBackordersAllowed() { + return backordersAllowed; + } + + /** + * + * @param backordersAllowed + * The backorders_allowed + */ + public void setBackordersAllowed(Boolean backordersAllowed) { + this.backordersAllowed = backordersAllowed; + } + + /** + * + * @return + * The backordered + */ + public Boolean getBackordered() { + return backordered; + } + + /** + * + * @param backordered + * The backordered + */ + public void setBackordered(Boolean backordered) { + this.backordered = backordered; + } + + /** + * + * @return + * The soldIndividually + */ + public Boolean getSoldIndividually() { + return soldIndividually; + } + + /** + * + * @param soldIndividually + * The sold_individually + */ + public void setSoldIndividually(Boolean soldIndividually) { + this.soldIndividually = soldIndividually; + } + + /** + * + * @return + * The purchaseable + */ + public Boolean getPurchaseable() { + return purchaseable; + } + + /** + * + * @param purchaseable + * The purchaseable + */ + public void setPurchaseable(Boolean purchaseable) { + this.purchaseable = purchaseable; + } + + /** + * + * @return + * The featured + */ + public Boolean getFeatured() { + return featured; + } + + /** + * + * @param featured + * The featured + */ + public void setFeatured(Boolean featured) { + this.featured = featured; + } + + /** + * + * @return + * The visible + */ + public Boolean getVisible() { + return visible; + } + + /** + * + * @param visible + * The visible + */ + public void setVisible(Boolean visible) { + this.visible = visible; + } + + /** + * + * @return + * The catalogVisibility + */ + public String getCatalogVisibility() { + return catalogVisibility; + } + + /** + * + * @param catalogVisibility + * The catalog_visibility + */ + public void setCatalogVisibility(String catalogVisibility) { + this.catalogVisibility = catalogVisibility; + } + + /** + * + * @return + * The onSale + */ + public Boolean getOnSale() { + return onSale; + } + + /** + * + * @param onSale + * The on_sale + */ + public void setOnSale(Boolean onSale) { + this.onSale = onSale; + } + + /** + * + * @return + * The productUrl + */ + public String getProductUrl() { + return productUrl; + } + + /** + * + * @param productUrl + * The product_url + */ + public void setProductUrl(String productUrl) { + this.productUrl = productUrl; + } + + /** + * + * @return + * The buttonText + */ + public String getButtonText() { + return buttonText; + } + + /** + * + * @param buttonText + * The button_text + */ + public void setButtonText(String buttonText) { + this.buttonText = buttonText; + } + + /** + * + * @return + * The weight + */ + public Object getWeight() { + return weight; + } + + /** + * + * @param weight + * The weight + */ + public void setWeight(Object weight) { + this.weight = weight; + } + + /** + * + * @return + * The dimensions + */ + public Dimensions getDimensions() { + return dimensions; + } + + /** + * + * @param dimensions + * The dimensions + */ + public void setDimensions(Dimensions dimensions) { + this.dimensions = dimensions; + } + + /** + * + * @return + * The shippingRequired + */ + public Boolean getShippingRequired() { + return shippingRequired; + } + + /** + * + * @param shippingRequired + * The shipping_required + */ + public void setShippingRequired(Boolean shippingRequired) { + this.shippingRequired = shippingRequired; + } + + /** + * + * @return + * The shippingTaxable + */ + public Boolean getShippingTaxable() { + return shippingTaxable; + } + + /** + * + * @param shippingTaxable + * The shipping_taxable + */ + public void setShippingTaxable(Boolean shippingTaxable) { + this.shippingTaxable = shippingTaxable; + } + + /** + * + * @return + * The shippingClass + */ + public String getShippingClass() { + return shippingClass; + } + + /** + * + * @param shippingClass + * The shipping_class + */ + public void setShippingClass(String shippingClass) { + this.shippingClass = shippingClass; + } + + /** + * + * @return + * The shippingClassId + */ + public Object getShippingClassId() { + return shippingClassId; + } + + /** + * + * @param shippingClassId + * The shipping_class_id + */ + public void setShippingClassId(Object shippingClassId) { + this.shippingClassId = shippingClassId; + } + + /** + * + * @return + * The description + */ + public String getDescription() { + return description; + } + + /** + * + * @param description + * The description + */ + public void setDescription(String description) { + this.description = description; + } + + /** + * + * @return + * The shortDescription + */ + public String getShortDescription() { + return shortDescription; + } + + /** + * + * @param shortDescription + * The short_description + */ + public void setShortDescription(String shortDescription) { + this.shortDescription = shortDescription; + } + + /** + * + * @return + * The reviewsAllowed + */ + public Boolean getReviewsAllowed() { + return reviewsAllowed; + } + + /** + * + * @param reviewsAllowed + * The reviews_allowed + */ + public void setReviewsAllowed(Boolean reviewsAllowed) { + this.reviewsAllowed = reviewsAllowed; + } + + /** + * + * @return + * The averageRating + */ + public String getAverageRating() { + return averageRating; + } + + /** + * + * @param averageRating + * The average_rating + */ + public void setAverageRating(String averageRating) { + this.averageRating = averageRating; + } + + /** + * + * @return + * The ratingCount + */ + public Integer getRatingCount() { + return ratingCount; + } + + /** + * + * @param ratingCount + * The rating_count + */ + public void setRatingCount(Integer ratingCount) { + this.ratingCount = ratingCount; + } + + /** + * + * @return + * The relatedIds + */ + public List getRelatedIds() { + return relatedIds; + } + + /** + * + * @param relatedIds + * The related_ids + */ + public void setRelatedIds(List relatedIds) { + this.relatedIds = relatedIds; + } + + /** + * + * @return + * The upsellIds + */ + public List getUpsellIds() { + return upsellIds; + } + + /** + * + * @param upsellIds + * The upsell_ids + */ + public void setUpsellIds(List upsellIds) { + this.upsellIds = upsellIds; + } + + /** + * + * @return + * The crossSellIds + */ + public List getCrossSellIds() { + return crossSellIds; + } + + /** + * + * @param crossSellIds + * The cross_sell_ids + */ + public void setCrossSellIds(List crossSellIds) { + this.crossSellIds = crossSellIds; + } + + /** + * + * @return + * The parentId + */ + public Integer getParentId() { + return parentId; + } + + /** + * + * @param parentId + * The parent_id + */ + public void setParentId(Integer parentId) { + this.parentId = parentId; + } + + /** + * + * @return + * The categories + */ + public List getCategories() { + return categories; + } + + /** + * + * @param categories + * The categories + */ + public void setCategories(List categories) { + this.categories = categories; + } + + /** + * + * @return + * The tags + */ + public List getTags() { + return tags; + } + + /** + * + * @param tags + * The tags + */ + public void setTags(List tags) { + this.tags = tags; + } + + /** + * + * @return + * The images + */ + public List getImages() { + return images; + } + + /** + * + * @param images + * The images + */ + public void setImages(List images) { + this.images = images; + } + + /** + * + * @return + * The featuredSrc + */ + public String getFeaturedSrc() { + return featuredSrc; + } + + /** + * + * @param featuredSrc + * The featured_src + */ + public void setFeaturedSrc(String featuredSrc) { + this.featuredSrc = featuredSrc; + } + + /** + * + * @return + * The attributes + */ + public List getAttributes() { + return attributes; + } + + /** + * + * @param attributes + * The attributes + */ + public void setAttributes(List attributes) { + this.attributes = attributes; + } + + /** + * + * @return + * The downloads + */ + public List getDownloads() { + return downloads; + } + + /** + * + * @param downloads + * The downloads + */ + public void setDownloads(List downloads) { + this.downloads = downloads; + } + + /** + * + * @return + * The downloadLimit + */ + public Integer getDownloadLimit() { + return downloadLimit; + } + + /** + * + * @param downloadLimit + * The download_limit + */ + public void setDownloadLimit(Integer downloadLimit) { + this.downloadLimit = downloadLimit; + } + + /** + * + * @return + * The downloadExpiry + */ + public Integer getDownloadExpiry() { + return downloadExpiry; + } + + /** + * + * @param downloadExpiry + * The download_expiry + */ + public void setDownloadExpiry(Integer downloadExpiry) { + this.downloadExpiry = downloadExpiry; + } + + /** + * + * @return + * The downloadType + */ + public String getDownloadType() { + return downloadType; + } + + /** + * + * @param downloadType + * The download_type + */ + public void setDownloadType(String downloadType) { + this.downloadType = downloadType; + } + + /** + * + * @return + * The purchaseNote + */ + public String getPurchaseNote() { + return purchaseNote; + } + + /** + * + * @param purchaseNote + * The purchase_note + */ + public void setPurchaseNote(String purchaseNote) { + this.purchaseNote = purchaseNote; + } + + /** + * + * @return + * The totalSales + */ + public Integer getTotalSales() { + return totalSales; + } + + /** + * + * @param totalSales + * The total_sales + */ + public void setTotalSales(Integer totalSales) { + this.totalSales = totalSales; + } + + /** + * + * @return + * The variations + */ + public List getVariations() { + return variations; + } + + /** + * + * @param variations + * The variations + */ + public void setVariations(List variations) { + this.variations = variations; + } + + /** + * + * @return + * The parent + */ + public List getParent() { + return parent; + } + + /** + * + * @param parent + * The parent + */ + public void setParent(List parent) { + this.parent = parent; + } + + /** + * + * @return + * The groupedProducts + */ + public List getGroupedProducts() { + return groupedProducts; + } + + /** + * + * @param groupedProducts + * The grouped_products + */ + public void setGroupedProducts(List groupedProducts) { + this.groupedProducts = groupedProducts; + } + + /** + * + * @return + * The menuOrder + */ + public Integer getMenuOrder() { + return menuOrder; + } + + /** + * + * @param menuOrder + * The menu_order + */ + public void setMenuOrder(Integer menuOrder) { + this.menuOrder = menuOrder; + } + +} \ No newline at end of file diff --git a/src/main/java/com/g360/woocommerce/client/domain/product/ProductsContainer.java b/src/main/java/com/g360/woocommerce/client/domain/product/ProductsContainer.java new file mode 100644 index 0000000..ce7783c --- /dev/null +++ b/src/main/java/com/g360/woocommerce/client/domain/product/ProductsContainer.java @@ -0,0 +1,32 @@ +package com.g360.woocommerce.client.domain.product; + +import com.google.gson.Gson; + +import java.util.ArrayList; +import java.util.List; + +/** + * The json is not only an array. The array is preceded by + * a key "product" + * + * That caused a problem on the gson.fromJson function + * Therefore the json string is mapped to ProductsContainer + * instead of Product + */ +public class ProductsContainer { + + private List products; + private Gson gson; + + public ProductsContainer() { + gson = new Gson(); + } + + public List getProducts() { + return products; + } + + public void setProducts(List products) { + this.products = products; + } +} \ No newline at end of file diff --git a/src/main/java/musen/woocommerce/httpclient/BasicAuth.java b/src/main/java/com/g360/woocommerce/client/httpclient/BasicAuth.java similarity index 60% rename from src/main/java/musen/woocommerce/httpclient/BasicAuth.java rename to src/main/java/com/g360/woocommerce/client/httpclient/BasicAuth.java index 78117d3..ef09eee 100644 --- a/src/main/java/musen/woocommerce/httpclient/BasicAuth.java +++ b/src/main/java/com/g360/woocommerce/client/httpclient/BasicAuth.java @@ -1,4 +1,4 @@ -package musen.woocommerce.httpclient; +package com.g360.woocommerce.client.httpclient; /** * Created by Muluneh on 8/15/2016. diff --git a/src/main/java/musen/woocommerce/httpclient/HttpClient.java b/src/main/java/com/g360/woocommerce/client/httpclient/HttpClient.java similarity index 98% rename from src/main/java/musen/woocommerce/httpclient/HttpClient.java rename to src/main/java/com/g360/woocommerce/client/httpclient/HttpClient.java index f599bfb..9a5e172 100644 --- a/src/main/java/musen/woocommerce/httpclient/HttpClient.java +++ b/src/main/java/com/g360/woocommerce/client/httpclient/HttpClient.java @@ -1,10 +1,10 @@ -package musen.woocommerce.httpclient; +package com.g360.woocommerce.client.httpclient; import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.JsonNode; import com.mashape.unirest.http.Unirest; import com.mashape.unirest.http.exceptions.UnirestException; -import musen.woocommerce.Client; +import com.g360.woocommerce.client.Client; import java.io.UnsupportedEncodingException; import java.security.InvalidKeyException; diff --git a/src/main/java/musen/woocommerce/httpclient/OAuth.java b/src/main/java/com/g360/woocommerce/client/httpclient/OAuth.java similarity index 98% rename from src/main/java/musen/woocommerce/httpclient/OAuth.java rename to src/main/java/com/g360/woocommerce/client/httpclient/OAuth.java index 39df991..2d75f86 100644 --- a/src/main/java/musen/woocommerce/httpclient/OAuth.java +++ b/src/main/java/com/g360/woocommerce/client/httpclient/OAuth.java @@ -1,4 +1,4 @@ -package musen.woocommerce.httpclient; +package com.g360.woocommerce.client.httpclient; import org.apache.commons.lang3.StringUtils; import org.apache.commons.codec.binary.Base64; diff --git a/src/main/java/musen/woocommerce/httpclient/Options.java b/src/main/java/com/g360/woocommerce/client/httpclient/Options.java similarity index 96% rename from src/main/java/musen/woocommerce/httpclient/Options.java rename to src/main/java/com/g360/woocommerce/client/httpclient/Options.java index 523f206..0fa7829 100644 --- a/src/main/java/musen/woocommerce/httpclient/Options.java +++ b/src/main/java/com/g360/woocommerce/client/httpclient/Options.java @@ -1,4 +1,4 @@ -package musen.woocommerce.httpclient; +package com.g360.woocommerce.client.httpclient; import java.util.Map; diff --git a/src/main/java/musen/woocommerce/httpclient/QueryStringBuilder.java b/src/main/java/com/g360/woocommerce/client/httpclient/QueryStringBuilder.java similarity index 97% rename from src/main/java/musen/woocommerce/httpclient/QueryStringBuilder.java rename to src/main/java/com/g360/woocommerce/client/httpclient/QueryStringBuilder.java index 5245f0d..04e357c 100644 --- a/src/main/java/musen/woocommerce/httpclient/QueryStringBuilder.java +++ b/src/main/java/com/g360/woocommerce/client/httpclient/QueryStringBuilder.java @@ -1,4 +1,4 @@ -package musen.woocommerce.httpclient; +package com.g360.woocommerce.client.httpclient; import java.io.UnsupportedEncodingException; import java.net.MalformedURLException; diff --git a/src/main/java/musen/woocommerce/httpclient/Request.java b/src/main/java/com/g360/woocommerce/client/httpclient/Request.java similarity index 96% rename from src/main/java/musen/woocommerce/httpclient/Request.java rename to src/main/java/com/g360/woocommerce/client/httpclient/Request.java index 484c321..a7291f0 100644 --- a/src/main/java/musen/woocommerce/httpclient/Request.java +++ b/src/main/java/com/g360/woocommerce/client/httpclient/Request.java @@ -1,4 +1,4 @@ -package musen.woocommerce.httpclient; +package com.g360.woocommerce.client.httpclient; import java.util.Map; diff --git a/src/main/java/musen/woocommerce/httpclient/Response.java b/src/main/java/com/g360/woocommerce/client/httpclient/Response.java similarity index 94% rename from src/main/java/musen/woocommerce/httpclient/Response.java rename to src/main/java/com/g360/woocommerce/client/httpclient/Response.java index 0c0fb9a..86a20ff 100644 --- a/src/main/java/musen/woocommerce/httpclient/Response.java +++ b/src/main/java/com/g360/woocommerce/client/httpclient/Response.java @@ -1,4 +1,4 @@ -package musen.woocommerce.httpclient; +package com.g360.woocommerce.client.httpclient; import java.util.Map;