Added more API classes
This commit is contained in:
parent
8a4133733c
commit
075d42e1a8
@ -0,0 +1,36 @@
|
|||||||
|
package me.gilo.woodroid.data;
|
||||||
|
|
||||||
|
|
||||||
|
import me.gilo.woodroid.models.Attribute;
|
||||||
|
import me.gilo.woodroid.models.Coupon;
|
||||||
|
import retrofit2.Call;
|
||||||
|
import retrofit2.http.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface AttributeAPI {
|
||||||
|
|
||||||
|
@Headers("Content-Type: application/json")
|
||||||
|
@POST("products/attributes")
|
||||||
|
Call<Attribute> create(@Body Attribute body);
|
||||||
|
|
||||||
|
@GET("products/attributes/{id}")
|
||||||
|
Call<Attribute> view(@Path("id") int id);
|
||||||
|
|
||||||
|
@GET("products/attributes")
|
||||||
|
Call<List<Attribute>> list();
|
||||||
|
|
||||||
|
@Headers("Content-Type: application/json")
|
||||||
|
@PUT("products/attributes/{id}")
|
||||||
|
Call<Attribute> update(@Path("id") int id, @Body Attribute body);
|
||||||
|
|
||||||
|
@DELETE("products/attributes/{id}")
|
||||||
|
Call<Attribute> delete(@Path("id") int id);
|
||||||
|
|
||||||
|
@DELETE("products/attributes/{id}")
|
||||||
|
Call<Attribute> delete(@Path("id") int id, @Query("force") boolean force);
|
||||||
|
|
||||||
|
@POST("products/attributes/batch")
|
||||||
|
Call<String> batch(@Body Attribute body);
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,36 @@
|
|||||||
|
package me.gilo.woodroid.data;
|
||||||
|
|
||||||
|
|
||||||
|
import me.gilo.woodroid.models.Attribute;
|
||||||
|
import me.gilo.woodroid.models.AttributeTerm;
|
||||||
|
import retrofit2.Call;
|
||||||
|
import retrofit2.http.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface AttributeTermAPI {
|
||||||
|
|
||||||
|
@Headers("Content-Type: application/json")
|
||||||
|
@POST("products/attributes/{id}/terms")
|
||||||
|
Call<AttributeTerm> create(@Body AttributeTerm body);
|
||||||
|
|
||||||
|
@GET("products/attributes/{id}/terms/[term_id]")
|
||||||
|
Call<AttributeTerm> view(@Path("id") int attribute_id, @Path("term_id") int term_id);
|
||||||
|
|
||||||
|
@GET("products/attributes/{id}/terms")
|
||||||
|
Call<List<AttributeTerm>> list(@Path("id") int attribute_id);
|
||||||
|
|
||||||
|
@Headers("Content-Type: application/json")
|
||||||
|
@PUT("products/attributes/{id}/terms/[term_id]")
|
||||||
|
Call<AttributeTerm> update(@Path("id") int attribute_id, @Path("term_id") int term_id, @Body AttributeTerm body);
|
||||||
|
|
||||||
|
@DELETE("products/attributes/{id}/terms/[term_id]")
|
||||||
|
Call<AttributeTerm> delete(@Path("id") int attribute_id, @Path("term_id") int term_id);
|
||||||
|
|
||||||
|
@DELETE("products/attributes/{id}/terms/[term_id]")
|
||||||
|
Call<AttributeTerm> delete(@Path("id") int attribute_id, @Path("term_id") int term_id, @Query("force") boolean force);
|
||||||
|
|
||||||
|
@POST("products/attributes/batch")
|
||||||
|
Call<String> batch(@Body AttributeTerm body);
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,36 @@
|
|||||||
|
package me.gilo.woodroid.data;
|
||||||
|
|
||||||
|
|
||||||
|
import me.gilo.woodroid.models.Category;
|
||||||
|
import me.gilo.woodroid.models.Coupon;
|
||||||
|
import retrofit2.Call;
|
||||||
|
import retrofit2.http.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface CategoryAPI {
|
||||||
|
|
||||||
|
@Headers("Content-Type: application/json")
|
||||||
|
@POST("products/categories")
|
||||||
|
Call<Category> create(@Body Category body);
|
||||||
|
|
||||||
|
@GET("products/categories/{id}")
|
||||||
|
Call<Category> view(@Path("id") int id);
|
||||||
|
|
||||||
|
@GET("products/categories")
|
||||||
|
Call<List<Category>> list();
|
||||||
|
|
||||||
|
@Headers("Content-Type: application/json")
|
||||||
|
@PUT("products/categories/{id}")
|
||||||
|
Call<Category> update(@Path("id") int id, @Body Category body);
|
||||||
|
|
||||||
|
@DELETE("products/categories/{id}")
|
||||||
|
Call<Category> delete(@Path("id") int id);
|
||||||
|
|
||||||
|
@DELETE("products/categories/{id}")
|
||||||
|
Call<Category> delete(@Path("id") int id, @Query("force") boolean force);
|
||||||
|
|
||||||
|
@POST("products/categories/batch")
|
||||||
|
Call<String> batch(@Body Category body);
|
||||||
|
|
||||||
|
}
|
||||||
@ -9,16 +9,6 @@ import java.util.List;
|
|||||||
|
|
||||||
public interface CouponAPI{
|
public interface CouponAPI{
|
||||||
|
|
||||||
/** Coupons
|
|
||||||
The coupons API allows you to
|
|
||||||
1. create,
|
|
||||||
2. view,
|
|
||||||
3. update
|
|
||||||
4. delete
|
|
||||||
individual, or a batch, of coupon codes.
|
|
||||||
|
|
||||||
**/
|
|
||||||
|
|
||||||
@Headers("Content-Type: application/json")
|
@Headers("Content-Type: application/json")
|
||||||
@POST("coupons")
|
@POST("coupons")
|
||||||
Call<Coupon> create(@Body Coupon body);
|
Call<Coupon> create(@Body Coupon body);
|
||||||
|
|||||||
@ -0,0 +1,40 @@
|
|||||||
|
package me.gilo.woodroid.data;
|
||||||
|
|
||||||
|
|
||||||
|
import me.gilo.woodroid.models.Coupon;
|
||||||
|
import me.gilo.woodroid.models.Customer;
|
||||||
|
import me.gilo.woodroid.models.Download;
|
||||||
|
import retrofit2.Call;
|
||||||
|
import retrofit2.http.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface CustomerAPI {
|
||||||
|
|
||||||
|
@Headers("Content-Type: application/json")
|
||||||
|
@POST("customers")
|
||||||
|
Call<Customer> create(@Body Customer body);
|
||||||
|
|
||||||
|
@GET("customers/{id}")
|
||||||
|
Call<Customer> view(@Path("id") int id);
|
||||||
|
|
||||||
|
@GET("customers")
|
||||||
|
Call<List<Customer>> list();
|
||||||
|
|
||||||
|
@Headers("Content-Type: application/json")
|
||||||
|
@PUT("customers/{id}")
|
||||||
|
Call<Customer> update(@Path("id") int id, @Body Customer body);
|
||||||
|
|
||||||
|
@DELETE("customers/{id}")
|
||||||
|
Call<Customer> delete(@Path("id") int id);
|
||||||
|
|
||||||
|
@DELETE("customers/{id}")
|
||||||
|
Call<Customer> delete(@Path("id") int id, @Query("force") boolean force);
|
||||||
|
|
||||||
|
@POST("customers/batch")
|
||||||
|
Call<String> batch(@Body Customer body);
|
||||||
|
|
||||||
|
@POST("customers/{id}/downloads")
|
||||||
|
Call<List<Download>> downloads(@Path("id") int id);
|
||||||
|
|
||||||
|
}
|
||||||
36
woodroid/src/main/java/me/gilo/woodroid/data/OrderAPI.java
Normal file
36
woodroid/src/main/java/me/gilo/woodroid/data/OrderAPI.java
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
package me.gilo.woodroid.data;
|
||||||
|
|
||||||
|
|
||||||
|
import me.gilo.woodroid.models.Coupon;
|
||||||
|
import me.gilo.woodroid.models.Order;
|
||||||
|
import retrofit2.Call;
|
||||||
|
import retrofit2.http.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface OrderAPI {
|
||||||
|
|
||||||
|
@Headers("Content-Type: application/json")
|
||||||
|
@POST("orders")
|
||||||
|
Call<Order> create(@Body Coupon body);
|
||||||
|
|
||||||
|
@GET("orders/{id}")
|
||||||
|
Call<Order> view(@Path("id") int id);
|
||||||
|
|
||||||
|
@GET("orders")
|
||||||
|
Call<List<Order>> list();
|
||||||
|
|
||||||
|
@Headers("Content-Type: application/json")
|
||||||
|
@PUT("orders/{id}")
|
||||||
|
Call<Order> update(@Path("id") int id, @Body Order body);
|
||||||
|
|
||||||
|
@DELETE("orders/{id}")
|
||||||
|
Call<Order> delete(@Path("id") int id);
|
||||||
|
|
||||||
|
@DELETE("orders/{id}")
|
||||||
|
Call<Order> delete(@Path("id") int id, @Query("force") boolean force);
|
||||||
|
|
||||||
|
@POST("orders/batch")
|
||||||
|
Call<String> batch(@Body Order body);
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,30 @@
|
|||||||
|
package me.gilo.woodroid.data;
|
||||||
|
|
||||||
|
|
||||||
|
import me.gilo.woodroid.models.Coupon;
|
||||||
|
import me.gilo.woodroid.models.Order;
|
||||||
|
import me.gilo.woodroid.models.OrderNote;
|
||||||
|
import retrofit2.Call;
|
||||||
|
import retrofit2.http.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface OrderNoteAPI {
|
||||||
|
|
||||||
|
@Headers("Content-Type: application/json")
|
||||||
|
@POST("orders/{id}/notes")
|
||||||
|
Call<OrderNote> create(@Body Coupon body);
|
||||||
|
|
||||||
|
@GET("orders/{id}/notes/{note_id}")
|
||||||
|
Call<OrderNote> view(@Path("id") int order_id, @Path("note_id") int note_id);
|
||||||
|
|
||||||
|
@GET("orders/{id}/notes")
|
||||||
|
Call<List<OrderNote>> list(@Path("id") int order_id);
|
||||||
|
|
||||||
|
@DELETE("orders/{id}/notes/{note_id}")
|
||||||
|
Call<OrderNote> delete(@Path("id") int order_id, @Path("note_id") int note_id);
|
||||||
|
|
||||||
|
@DELETE("orders/{id}/notes/{note_id}")
|
||||||
|
Call<OrderNote> delete(@Path("id") int order_id, @Path("note_id") int note_id, @Query("force") boolean force);
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,37 @@
|
|||||||
|
package me.gilo.woodroid.data;
|
||||||
|
|
||||||
|
|
||||||
|
import me.gilo.woodroid.data.callbacks.ReviewsData;
|
||||||
|
import me.gilo.woodroid.models.Coupon;
|
||||||
|
import me.gilo.woodroid.models.ProductReview;
|
||||||
|
import retrofit2.Call;
|
||||||
|
import retrofit2.http.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface ProductReviewAPI {
|
||||||
|
|
||||||
|
@Headers("Content-Type: application/json")
|
||||||
|
@POST("products/reviews")
|
||||||
|
Call<ProductReview> create(@Body ProductReview body);
|
||||||
|
|
||||||
|
@GET("products/reviews/{id}")
|
||||||
|
Call<ProductReview> view(@Path("id") int id);
|
||||||
|
|
||||||
|
@GET("products/reviews")
|
||||||
|
Call<List<ProductReview>> list();
|
||||||
|
|
||||||
|
@Headers("Content-Type: application/json")
|
||||||
|
@PUT("products/reviews/{id}")
|
||||||
|
Call<ProductReview> update(@Path("id") int id, @Body ProductReview body);
|
||||||
|
|
||||||
|
@DELETE("products/reviews/{id}")
|
||||||
|
Call<ProductReview> delete(@Path("id") int id);
|
||||||
|
|
||||||
|
@DELETE("products/reviews/{id}")
|
||||||
|
Call<ProductReview> delete(@Path("id") int id, @Query("force") boolean force);
|
||||||
|
|
||||||
|
@POST("products/reviews/batch")
|
||||||
|
Call<String> batch(@Body ProductReview body);
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,40 @@
|
|||||||
|
package me.gilo.woodroid.data;
|
||||||
|
|
||||||
|
|
||||||
|
import me.gilo.woodroid.models.Coupon;
|
||||||
|
import me.gilo.woodroid.models.OrderNote;
|
||||||
|
import me.gilo.woodroid.models.Product;
|
||||||
|
import retrofit2.Call;
|
||||||
|
import retrofit2.http.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface ProductVariationAPI {
|
||||||
|
|
||||||
|
@Headers("Content-Type: application/json")
|
||||||
|
@POST("products/{id}/variations")
|
||||||
|
Call<Product> create(@Body Product body);
|
||||||
|
|
||||||
|
@GET("products/{id}/variations/{variation_id}")
|
||||||
|
Call<Product> view(@Path("id") int product_id, @Path("note_id") int note_id);
|
||||||
|
|
||||||
|
@GET("products/{id}/variations")
|
||||||
|
Call<List<Product>> list(@Path("id") int product);
|
||||||
|
|
||||||
|
@Headers("Content-Type: application/json")
|
||||||
|
@PUT("products/{id}/variations/{variation_id}")
|
||||||
|
Call<Product> update(@Path("id") int product_id, @Path("variation_id") int variation_id, @Body Product body);
|
||||||
|
|
||||||
|
@DELETE("products/{id}/variations/{variation_id}")
|
||||||
|
Call<Product> delete(@Path("id") int product_id, @Path("variation_id") int variation_id);
|
||||||
|
|
||||||
|
@DELETE("products/{id}/variations/{variation_id}")
|
||||||
|
Call<Product> delete(@Path("id") int product_id, @Path("variation_id") int variation_id, @Query("force") boolean force);
|
||||||
|
|
||||||
|
@Headers("Content-Type: application/json")
|
||||||
|
@PUT("products/{id}/variations/{variation_id}")
|
||||||
|
Call<Product> batch(@Path("id") int product_id, @Path("variation_id") int variation_id, @Body Product body);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
30
woodroid/src/main/java/me/gilo/woodroid/data/RefundAPI.java
Normal file
30
woodroid/src/main/java/me/gilo/woodroid/data/RefundAPI.java
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
package me.gilo.woodroid.data;
|
||||||
|
|
||||||
|
|
||||||
|
import me.gilo.woodroid.models.Coupon;
|
||||||
|
import me.gilo.woodroid.models.OrderNote;
|
||||||
|
import me.gilo.woodroid.models.Refund;
|
||||||
|
import retrofit2.Call;
|
||||||
|
import retrofit2.http.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface RefundAPI {
|
||||||
|
|
||||||
|
@Headers("Content-Type: application/json")
|
||||||
|
@POST("orders/{id}/refunds")
|
||||||
|
Call<Refund> create(@Body Refund body);
|
||||||
|
|
||||||
|
@GET("orders/{id}/refunds/{refund_id}")
|
||||||
|
Call<Refund> view(@Path("id") int order_id, @Path("refund_id") int refund_id);
|
||||||
|
|
||||||
|
@GET("orders/{id}/refunds")
|
||||||
|
Call<List<Refund>> list(@Path("id") int order_id);
|
||||||
|
|
||||||
|
@DELETE("orders/{id}/refunds/{refund_id}")
|
||||||
|
Call<Refund> delete(@Path("id") int order_id, @Path("refund_id") int refund_id);
|
||||||
|
|
||||||
|
@DELETE("orders/{id}/refunds/{refund_id}")
|
||||||
|
Call<Refund> delete(@Path("id") int order_id, @Path("refund_id") int refund_id, @Query("force") boolean force);
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,35 @@
|
|||||||
|
package me.gilo.woodroid.data;
|
||||||
|
|
||||||
|
|
||||||
|
import me.gilo.woodroid.models.Coupon;
|
||||||
|
import retrofit2.Call;
|
||||||
|
import retrofit2.http.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface ShippingAPI {
|
||||||
|
|
||||||
|
@Headers("Content-Type: application/json")
|
||||||
|
@POST("coupons")
|
||||||
|
Call<Coupon> create(@Body Coupon body);
|
||||||
|
|
||||||
|
@GET("coupons/{id}")
|
||||||
|
Call<Coupon> view(@Path("id") int id);
|
||||||
|
|
||||||
|
@GET("coupons")
|
||||||
|
Call<List<Coupon>> list();
|
||||||
|
|
||||||
|
@Headers("Content-Type: application/json")
|
||||||
|
@PUT("coupons/{id}")
|
||||||
|
Call<Coupon> update(@Path("id") int id, @Body Coupon body);
|
||||||
|
|
||||||
|
@DELETE("coupons/{id}")
|
||||||
|
Call<Coupon> delete(@Path("id") int id);
|
||||||
|
|
||||||
|
@DELETE("coupons/{id}")
|
||||||
|
Call<Coupon> delete(@Path("id") int id, @Query("force") boolean force);
|
||||||
|
|
||||||
|
@POST("coupons/batch")
|
||||||
|
Call<String> batch(@Body Coupon body);
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,36 @@
|
|||||||
|
package me.gilo.woodroid.data;
|
||||||
|
|
||||||
|
|
||||||
|
import me.gilo.woodroid.models.Coupon;
|
||||||
|
import me.gilo.woodroid.models.ShippingClass;
|
||||||
|
import retrofit2.Call;
|
||||||
|
import retrofit2.http.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface ShippingClassAPI {
|
||||||
|
|
||||||
|
@Headers("Content-Type: application/json")
|
||||||
|
@POST("products/shipping_classes")
|
||||||
|
Call<ShippingClass> create(@Body ShippingClass body);
|
||||||
|
|
||||||
|
@GET("products/shipping_classes/{id}")
|
||||||
|
Call<ShippingClass> view(@Path("id") int id);
|
||||||
|
|
||||||
|
@GET("products/shipping_classes")
|
||||||
|
Call<List<ShippingClass>> list();
|
||||||
|
|
||||||
|
@Headers("Content-Type: application/json")
|
||||||
|
@PUT("products/shipping_classes/{id}")
|
||||||
|
Call<ShippingClass> update(@Path("id") int id, @Body ShippingClass body);
|
||||||
|
|
||||||
|
@DELETE("products/shipping_classes/{id}")
|
||||||
|
Call<ShippingClass> delete(@Path("id") int id);
|
||||||
|
|
||||||
|
@DELETE("products/shipping_classes/{id}")
|
||||||
|
Call<ShippingClass> delete(@Path("id") int id, @Query("force") boolean force);
|
||||||
|
|
||||||
|
@POST("products/shipping_classes/batch")
|
||||||
|
Call<String> batch(@Body ShippingClass body);
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,35 @@
|
|||||||
|
package me.gilo.woodroid.data;
|
||||||
|
|
||||||
|
|
||||||
|
import me.gilo.woodroid.models.Coupon;
|
||||||
|
import retrofit2.Call;
|
||||||
|
import retrofit2.http.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface ShippingZoneAPI {
|
||||||
|
|
||||||
|
@Headers("Content-Type: application/json")
|
||||||
|
@POST("coupons")
|
||||||
|
Call<Coupon> create(@Body Coupon body);
|
||||||
|
|
||||||
|
@GET("coupons/{id}")
|
||||||
|
Call<Coupon> view(@Path("id") int id);
|
||||||
|
|
||||||
|
@GET("coupons")
|
||||||
|
Call<List<Coupon>> list();
|
||||||
|
|
||||||
|
@Headers("Content-Type: application/json")
|
||||||
|
@PUT("coupons/{id}")
|
||||||
|
Call<Coupon> update(@Path("id") int id, @Body Coupon body);
|
||||||
|
|
||||||
|
@DELETE("coupons/{id}")
|
||||||
|
Call<Coupon> delete(@Path("id") int id);
|
||||||
|
|
||||||
|
@DELETE("coupons/{id}")
|
||||||
|
Call<Coupon> delete(@Path("id") int id, @Query("force") boolean force);
|
||||||
|
|
||||||
|
@POST("coupons/batch")
|
||||||
|
Call<String> batch(@Body Coupon body);
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,35 @@
|
|||||||
|
package me.gilo.woodroid.data;
|
||||||
|
|
||||||
|
|
||||||
|
import me.gilo.woodroid.models.Coupon;
|
||||||
|
import retrofit2.Call;
|
||||||
|
import retrofit2.http.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface ShippingZoneLocationAPI {
|
||||||
|
|
||||||
|
@Headers("Content-Type: application/json")
|
||||||
|
@POST("coupons")
|
||||||
|
Call<Coupon> create(@Body Coupon body);
|
||||||
|
|
||||||
|
@GET("coupons/{id}")
|
||||||
|
Call<Coupon> view(@Path("id") int id);
|
||||||
|
|
||||||
|
@GET("coupons")
|
||||||
|
Call<List<Coupon>> list();
|
||||||
|
|
||||||
|
@Headers("Content-Type: application/json")
|
||||||
|
@PUT("coupons/{id}")
|
||||||
|
Call<Coupon> update(@Path("id") int id, @Body Coupon body);
|
||||||
|
|
||||||
|
@DELETE("coupons/{id}")
|
||||||
|
Call<Coupon> delete(@Path("id") int id);
|
||||||
|
|
||||||
|
@DELETE("coupons/{id}")
|
||||||
|
Call<Coupon> delete(@Path("id") int id, @Query("force") boolean force);
|
||||||
|
|
||||||
|
@POST("coupons/batch")
|
||||||
|
Call<String> batch(@Body Coupon body);
|
||||||
|
|
||||||
|
}
|
||||||
36
woodroid/src/main/java/me/gilo/woodroid/data/TagAPI.java
Normal file
36
woodroid/src/main/java/me/gilo/woodroid/data/TagAPI.java
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
package me.gilo.woodroid.data;
|
||||||
|
|
||||||
|
|
||||||
|
import me.gilo.woodroid.models.Coupon;
|
||||||
|
import me.gilo.woodroid.models.Tag;
|
||||||
|
import retrofit2.Call;
|
||||||
|
import retrofit2.http.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface TagAPI {
|
||||||
|
|
||||||
|
@Headers("Content-Type: application/json")
|
||||||
|
@POST("products/tags")
|
||||||
|
Call<Tag> create(@Body Tag body);
|
||||||
|
|
||||||
|
@GET("products/tags/{id}")
|
||||||
|
Call<Tag> view(@Path("id") int id);
|
||||||
|
|
||||||
|
@GET("products/tags")
|
||||||
|
Call<List<Tag>> list();
|
||||||
|
|
||||||
|
@Headers("Content-Type: application/json")
|
||||||
|
@PUT("products/tags/{id}")
|
||||||
|
Call<Tag> update(@Path("id") int id, @Body Tag body);
|
||||||
|
|
||||||
|
@DELETE("products/tags/{id}")
|
||||||
|
Call<Tag> delete(@Path("id") int id);
|
||||||
|
|
||||||
|
@DELETE("products/tags/{id}")
|
||||||
|
Call<Tag> delete(@Path("id") int id, @Query("force") boolean force);
|
||||||
|
|
||||||
|
@POST("products/tags/batch")
|
||||||
|
Call<String> batch(@Body Tag body);
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,26 @@
|
|||||||
|
package me.gilo.woodroid.data;
|
||||||
|
|
||||||
|
|
||||||
|
import me.gilo.woodroid.models.Coupon;
|
||||||
|
import me.gilo.woodroid.models.TaxClass;
|
||||||
|
import retrofit2.Call;
|
||||||
|
import retrofit2.http.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface TaxClassAPI {
|
||||||
|
|
||||||
|
@Headers("Content-Type: application/json")
|
||||||
|
@POST("taxes/classes")
|
||||||
|
Call<TaxClass> create(@Body TaxClass body);
|
||||||
|
|
||||||
|
@GET("taxes/classes")
|
||||||
|
Call<List<TaxClass>> list();
|
||||||
|
|
||||||
|
@DELETE("taxes/classes/{id}")
|
||||||
|
Call<TaxClass> delete(@Path("id") int id);
|
||||||
|
|
||||||
|
@DELETE("taxes/classes/{id}")
|
||||||
|
Call<TaxClass> delete(@Path("id") int id, @Query("force") boolean force);
|
||||||
|
|
||||||
|
}
|
||||||
36
woodroid/src/main/java/me/gilo/woodroid/data/TaxRateAPI.java
Normal file
36
woodroid/src/main/java/me/gilo/woodroid/data/TaxRateAPI.java
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
package me.gilo.woodroid.data;
|
||||||
|
|
||||||
|
|
||||||
|
import me.gilo.woodroid.models.Coupon;
|
||||||
|
import me.gilo.woodroid.models.TaxRate;
|
||||||
|
import retrofit2.Call;
|
||||||
|
import retrofit2.http.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface TaxRateAPI {
|
||||||
|
|
||||||
|
@Headers("Content-Type: application/json")
|
||||||
|
@POST("taxes")
|
||||||
|
Call<TaxRate> create(@Body TaxRate body);
|
||||||
|
|
||||||
|
@GET("taxes/{id}")
|
||||||
|
Call<TaxRate> view(@Path("id") int id);
|
||||||
|
|
||||||
|
@GET("taxes")
|
||||||
|
Call<List<TaxRate>> list();
|
||||||
|
|
||||||
|
@Headers("Content-Type: application/json")
|
||||||
|
@PUT("taxes/{id}")
|
||||||
|
Call<TaxRate> update(@Path("id") int id, @Body TaxRate body);
|
||||||
|
|
||||||
|
@DELETE("taxes/{id}")
|
||||||
|
Call<TaxRate> delete(@Path("id") int id);
|
||||||
|
|
||||||
|
@DELETE("taxes/{id}")
|
||||||
|
Call<TaxRate> delete(@Path("id") int id, @Query("force") boolean force);
|
||||||
|
|
||||||
|
@POST("taxes/batch")
|
||||||
|
Call<String> batch(@Body TaxRate body);
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,65 @@
|
|||||||
|
package me.gilo.woodroid.models;
|
||||||
|
|
||||||
|
import android.os.Parcel;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Aron on 11/26/2015.
|
||||||
|
*/
|
||||||
|
public class AttributeTerm implements Serializable {
|
||||||
|
int id;
|
||||||
|
private String name;
|
||||||
|
private String slug;
|
||||||
|
String description;
|
||||||
|
int menu_order;
|
||||||
|
int count;
|
||||||
|
|
||||||
|
public int getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(int id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSlug() {
|
||||||
|
return slug;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSlug(String slug) {
|
||||||
|
this.slug = slug;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescription() {
|
||||||
|
return description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDescription(String description) {
|
||||||
|
this.description = description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getMenu_order() {
|
||||||
|
return menu_order;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMenu_order(int menu_order) {
|
||||||
|
this.menu_order = menu_order;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getCount() {
|
||||||
|
return count;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCount(int count) {
|
||||||
|
this.count = count;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,66 @@
|
|||||||
|
package me.gilo.woodroid.models;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Aron on 12/7/2015.
|
||||||
|
*/
|
||||||
|
public class OrderNote {
|
||||||
|
int id;
|
||||||
|
String author;
|
||||||
|
String date_created;
|
||||||
|
String date_created_gmt;
|
||||||
|
String note;
|
||||||
|
boolean customer_note;
|
||||||
|
|
||||||
|
public int getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(int id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAuthor() {
|
||||||
|
return author;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAuthor(String author) {
|
||||||
|
this.author = author;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDate_created() {
|
||||||
|
return date_created;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDate_created(String date_created) {
|
||||||
|
this.date_created = date_created;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDate_created_gmt() {
|
||||||
|
return date_created_gmt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDate_created_gmt(String date_created_gmt) {
|
||||||
|
this.date_created_gmt = date_created_gmt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNote() {
|
||||||
|
return note;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNote(String note) {
|
||||||
|
this.note = note;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isCustomer_note() {
|
||||||
|
return customer_note;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCustomer_note(boolean customer_note) {
|
||||||
|
this.customer_note = customer_note;
|
||||||
|
}
|
||||||
|
}
|
||||||
90
woodroid/src/main/java/me/gilo/woodroid/models/Refund.java
Normal file
90
woodroid/src/main/java/me/gilo/woodroid/models/Refund.java
Normal file
@ -0,0 +1,90 @@
|
|||||||
|
package me.gilo.woodroid.models;
|
||||||
|
|
||||||
|
public class Refund {
|
||||||
|
|
||||||
|
private String refunded_by;
|
||||||
|
private String reason;
|
||||||
|
private String amount;
|
||||||
|
private String date_created;
|
||||||
|
private Metadata[] meta_data;
|
||||||
|
private String date_created_gmt;
|
||||||
|
private String id;
|
||||||
|
private Line_item[] line_items;
|
||||||
|
private String refunded_payment;
|
||||||
|
|
||||||
|
public String getRefunded_by() {
|
||||||
|
return refunded_by;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRefunded_by(String refunded_by) {
|
||||||
|
this.refunded_by = refunded_by;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getReason() {
|
||||||
|
return reason;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setReason(String reason) {
|
||||||
|
this.reason = reason;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAmount() {
|
||||||
|
return amount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAmount(String amount) {
|
||||||
|
this.amount = amount;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getDate_created() {
|
||||||
|
return date_created;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDate_created(String date_created) {
|
||||||
|
this.date_created = date_created;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Metadata[] getMeta_data() {
|
||||||
|
return meta_data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMeta_data(Metadata[] meta_data) {
|
||||||
|
this.meta_data = meta_data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDate_created_gmt() {
|
||||||
|
return date_created_gmt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDate_created_gmt(String date_created_gmt) {
|
||||||
|
this.date_created_gmt = date_created_gmt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(String id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRefunded_payment() {
|
||||||
|
return refunded_payment;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRefunded_payment(String refunded_payment) {
|
||||||
|
this.refunded_payment = refunded_payment;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Line_item[] getLine_items() {
|
||||||
|
return line_items;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLine_items(Line_item[] line_items) {
|
||||||
|
this.line_items = line_items;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -0,0 +1,54 @@
|
|||||||
|
package me.gilo.woodroid.models;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Aron on 12/7/2015.
|
||||||
|
*/
|
||||||
|
public class ShippingClass {
|
||||||
|
public int id;
|
||||||
|
String name;
|
||||||
|
String slug;
|
||||||
|
String description;
|
||||||
|
int count;
|
||||||
|
|
||||||
|
public int getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(int id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSlug() {
|
||||||
|
return slug;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSlug(String slug) {
|
||||||
|
this.slug = slug;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescription() {
|
||||||
|
return description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDescription(String description) {
|
||||||
|
this.description = description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getCount() {
|
||||||
|
return count;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCount(int count) {
|
||||||
|
this.count = count;
|
||||||
|
}
|
||||||
|
}
|
||||||
25
woodroid/src/main/java/me/gilo/woodroid/models/TaxClass.java
Normal file
25
woodroid/src/main/java/me/gilo/woodroid/models/TaxClass.java
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
package me.gilo.woodroid.models;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Aron on 12/8/2015.
|
||||||
|
*/
|
||||||
|
public class TaxClass {
|
||||||
|
String slug;
|
||||||
|
String name;
|
||||||
|
|
||||||
|
public String getSlug() {
|
||||||
|
return slug;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSlug(String slug) {
|
||||||
|
this.slug = slug;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
}
|
||||||
106
woodroid/src/main/java/me/gilo/woodroid/models/TaxRate.java
Normal file
106
woodroid/src/main/java/me/gilo/woodroid/models/TaxRate.java
Normal file
@ -0,0 +1,106 @@
|
|||||||
|
package me.gilo.woodroid.models;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Aron on 12/8/2015.
|
||||||
|
*/
|
||||||
|
public class TaxRate {
|
||||||
|
private int id;
|
||||||
|
private String country;
|
||||||
|
private String city;
|
||||||
|
private String postcode;
|
||||||
|
private int priority;
|
||||||
|
private boolean compound;
|
||||||
|
private boolean shipping;
|
||||||
|
private String rate;
|
||||||
|
private String name;
|
||||||
|
private String state;
|
||||||
|
private int order;
|
||||||
|
|
||||||
|
public int getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(int id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCountry() {
|
||||||
|
return country;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCountry(String country) {
|
||||||
|
this.country = country;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCity() {
|
||||||
|
return city;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCity(String city) {
|
||||||
|
this.city = city;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPostcode() {
|
||||||
|
return postcode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPostcode(String postcode) {
|
||||||
|
this.postcode = postcode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getPriority() {
|
||||||
|
return priority;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPriority(int priority) {
|
||||||
|
this.priority = priority;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isCompound() {
|
||||||
|
return compound;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCompound(boolean compound) {
|
||||||
|
this.compound = compound;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isShipping() {
|
||||||
|
return shipping;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setShipping(boolean shipping) {
|
||||||
|
this.shipping = shipping;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRate() {
|
||||||
|
return rate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRate(String rate) {
|
||||||
|
this.rate = rate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getState() {
|
||||||
|
return state;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setState(String state) {
|
||||||
|
this.state = state;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getOrder() {
|
||||||
|
return order;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOrder(int order) {
|
||||||
|
this.order = order;
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user