diff --git a/pom.xml b/pom.xml
index 4363d975..d8ebcf9c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -58,7 +58,7 @@
1.8
4.13.1
1.7.22
- 2.25.1
+ 2.33
1.4.3
0.8.2
@@ -74,10 +74,15 @@
jersey-client
${jersey.version}
+
+ org.glassfish.jersey.inject
+ jersey-hk2
+ ${jersey.version}
+
com.fasterxml.jackson.jaxrs
jackson-jaxrs-json-provider
- 2.4.0
+ 2.12.1
org.glassfish.jersey.media
diff --git a/src/main/java/com/shopify/ShopifySdk.java b/src/main/java/com/shopify/ShopifySdk.java
index dff77ff1..856f9fd1 100644
--- a/src/main/java/com/shopify/ShopifySdk.java
+++ b/src/main/java/com/shopify/ShopifySdk.java
@@ -1,5 +1,8 @@
package com.shopify;
+import com.shopify.mappers.ObjectMapperProvider;
+import com.shopify.model.*;
+
import java.net.URI;
import java.util.Arrays;
import java.util.LinkedList;
@@ -42,73 +45,6 @@
import com.shopify.mappers.LegacyToFulfillmentOrderMapping;
import com.shopify.mappers.ResponseEntityToStringMapper;
import com.shopify.mappers.ShopifySdkObjectMapper;
-import com.shopify.model.Count;
-import com.shopify.model.Image;
-import com.shopify.model.ImageAltTextCreationRequest;
-import com.shopify.model.Metafield;
-import com.shopify.model.MetafieldRoot;
-import com.shopify.model.MetafieldsRoot;
-import com.shopify.model.Shop;
-import com.shopify.model.ShopifyAccessTokenRoot;
-import com.shopify.model.ShopifyCancelOrderRequest;
-import com.shopify.model.ShopifyCustomCollection;
-import com.shopify.model.ShopifyCustomCollectionCreationRequest;
-import com.shopify.model.ShopifyCustomCollectionRoot;
-import com.shopify.model.ShopifyCustomCollectionsRoot;
-import com.shopify.model.ShopifyCustomer;
-import com.shopify.model.ShopifyCustomerRoot;
-import com.shopify.model.ShopifyCustomerUpdateRequest;
-import com.shopify.model.ShopifyCustomerUpdateRoot;
-import com.shopify.model.ShopifyCustomersRoot;
-import com.shopify.model.ShopifyFulfillment;
-import com.shopify.model.ShopifyFulfillmentCreationRequest;
-import com.shopify.model.ShopifyFulfillmentOrder;
-import com.shopify.model.ShopifyFulfillmentOrderMoveRequestRoot;
-import com.shopify.model.ShopifyFulfillmentOrderMoveResponseRoot;
-import com.shopify.model.ShopifyFulfillmentOrdersRoot;
-import com.shopify.model.ShopifyFulfillmentPayloadRoot;
-import com.shopify.model.ShopifyFulfillmentRoot;
-import com.shopify.model.ShopifyFulfillmentUpdateRequest;
-import com.shopify.model.ShopifyGetCustomersRequest;
-import com.shopify.model.ShopifyGiftCard;
-import com.shopify.model.ShopifyGiftCardCreationRequest;
-import com.shopify.model.ShopifyGiftCardRoot;
-import com.shopify.model.ShopifyImageRoot;
-import com.shopify.model.ShopifyInventoryLevel;
-import com.shopify.model.ShopifyInventoryLevelRoot;
-import com.shopify.model.ShopifyLocation;
-import com.shopify.model.ShopifyLocationsRoot;
-import com.shopify.model.ShopifyOrder;
-import com.shopify.model.ShopifyOrderCreationRequest;
-import com.shopify.model.ShopifyOrderRisk;
-import com.shopify.model.ShopifyOrderRisksRoot;
-import com.shopify.model.ShopifyOrderRoot;
-import com.shopify.model.ShopifyOrderShippingAddressUpdateRequest;
-import com.shopify.model.ShopifyOrderUpdateRoot;
-import com.shopify.model.ShopifyOrdersRoot;
-import com.shopify.model.ShopifyPage;
-import com.shopify.model.ShopifyProduct;
-import com.shopify.model.ShopifyProductCreationRequest;
-import com.shopify.model.ShopifyProductMetafieldCreationRequest;
-import com.shopify.model.ShopifyProductRequest;
-import com.shopify.model.ShopifyProductRoot;
-import com.shopify.model.ShopifyProductUpdateRequest;
-import com.shopify.model.ShopifyProducts;
-import com.shopify.model.ShopifyProductsRoot;
-import com.shopify.model.ShopifyRecurringApplicationCharge;
-import com.shopify.model.ShopifyRecurringApplicationChargeCreationRequest;
-import com.shopify.model.ShopifyRecurringApplicationChargeRoot;
-import com.shopify.model.ShopifyRefund;
-import com.shopify.model.ShopifyRefundCreationRequest;
-import com.shopify.model.ShopifyRefundRoot;
-import com.shopify.model.ShopifyShop;
-import com.shopify.model.ShopifyTransaction;
-import com.shopify.model.ShopifyTransactionsRoot;
-import com.shopify.model.ShopifyUpdateFulfillmentPayloadRoot;
-import com.shopify.model.ShopifyVariant;
-import com.shopify.model.ShopifyVariantMetafieldCreationRequest;
-import com.shopify.model.ShopifyVariantRoot;
-import com.shopify.model.ShopifyVariantUpdateRequest;
public class ShopifySdk {
@@ -133,6 +69,9 @@ public class ShopifySdk {
static final String REVOKE = "revoke";
static final String ACCESS_TOKEN = "access_token";
static final String PRODUCTS = "products";
+ static final String THEMES = "themes";
+ static final String ASSETS = "assets";
+ static final String WEBHOOKS = "webhooks";
static final String VARIANTS = "variants";
static final String CUSTOM_COLLECTIONS = "custom_collections";
static final String RECURRING_APPLICATION_CHARGES = "recurring_application_charges";
@@ -153,6 +92,7 @@ public class ShopifySdk {
static final String INVENTORY_LEVELS = "inventory_levels";
static final String JSON = ".json";
static final String LIMIT_QUERY_PARAMETER = "limit";
+ static final String ASSET_KEY_PARAMETER="asset[key]";
static final String PAGE_INFO_QUERY_PARAMETER = "page_info";
static final String STATUS_QUERY_PARAMETER = "status";
static final String ANY_STATUSES = "any";
@@ -175,6 +115,7 @@ public class ShopifySdk {
private static final String AUTHORIZATION_CODE = "code";
private static final int DEFAULT_REQUEST_LIMIT = 50;
+ private static final int MAX_REQUEST_LIMIT = 250;
private static final int TOO_MANY_REQUESTS_STATUS_CODE = 429;
private static final int UNPROCESSABLE_ENTITY_STATUS_CODE = 422;
private static final int LOCKED_STATUS_CODE = 423;
@@ -481,7 +422,105 @@ public ShopifyProducts getProducts() {
}
return new ShopifyProducts(shopifyProducts);
}
+ public List getThemes() {
+ final List shopifyThemes = new LinkedList<>();
+ ShopifyPage shopifyThemesPage = getThemes(MAX_REQUEST_LIMIT);
+ LOGGER.info("Retrieved {} themes from first page", shopifyThemesPage.size());
+ shopifyThemes.addAll(shopifyThemesPage);
+ while (shopifyThemesPage.getNextPageInfo() != null) {
+ shopifyThemesPage = getThemes(shopifyThemesPage.getNextPageInfo(), MAX_REQUEST_LIMIT);
+ LOGGER.info("Retrieved {} themes from page {}", shopifyThemesPage.size(),
+ shopifyThemesPage.getNextPageInfo());
+ shopifyThemes.addAll(shopifyThemesPage);
+ }
+ return shopifyThemes;
+ }
+ public ShopifyPage getThemes(final int pageSize) {
+ return this.getThemes(null, pageSize);
+ }
+ public ShopifyPage getThemes(final String pageInfo, final int pageSize) {
+ final Response response = get(getWebTarget().path(THEMES).queryParam(LIMIT_QUERY_PARAMETER, pageSize)
+ .queryParam(PAGE_INFO_QUERY_PARAMETER, pageInfo));
+ final ShopifyThemesRoot shopifyThemesRoot = response.readEntity(ShopifyThemesRoot.class);
+ return mapPagedResponse(shopifyThemesRoot.getThemes(), response);
+ }
+ public ShopifyAsset getAsset(String themeId, String assetKey) {
+ final Response response = get(getWebTarget().path(THEMES).path(themeId).path(ASSETS).queryParam(ASSET_KEY_PARAMETER,assetKey));
+ final ShopifyAssetRoot shopifyAssetRootResponse = response.readEntity(ShopifyAssetRoot.class);
+ return shopifyAssetRootResponse.getAsset();
+ }
+ public List getAssets(String themeId) {
+ final List shopifyAssets = new LinkedList<>();
+ ShopifyPage shopifyAssetsPage = getAssets(MAX_REQUEST_LIMIT, themeId);
+ LOGGER.info("Retrieved {} assets from first page", shopifyAssetsPage.size());
+ shopifyAssets.addAll(shopifyAssetsPage);
+ while (shopifyAssetsPage.getNextPageInfo() != null) {
+ shopifyAssetsPage = getAssets(shopifyAssetsPage.getNextPageInfo(), MAX_REQUEST_LIMIT, themeId);
+ LOGGER.info("Retrieved {} assets from page {}", shopifyAssetsPage.size(),
+ shopifyAssetsPage.getNextPageInfo());
+ shopifyAssets.addAll(shopifyAssetsPage);
+ }
+ return shopifyAssets;
+ }
+ public ShopifyPage getAssets(final String pageInfo, final int pageSize, String themeId) {
+ final Response response = get(getWebTarget().path(THEMES).path(themeId).path(ASSETS).queryParam(LIMIT_QUERY_PARAMETER, pageSize)
+ .queryParam(PAGE_INFO_QUERY_PARAMETER, pageInfo));
+ final ShopifyAssertsRoot shopifyAsseRoot = response.readEntity(ShopifyAssertsRoot.class);
+ return mapPagedResponse(shopifyAsseRoot.getAssets(), response);
+ }
+ public ShopifyPage getAssets(final int pageSize, String themeId) {
+ return this.getAssets(null, pageSize, themeId);
+ }
+ public ShopifyTheme createTheme(ShopifyTheme request) {
+ final ShopifyThemeRoot themeRoot = new ShopifyThemeRoot();
+ themeRoot.setTheme(request);
+ final Response response = post(getWebTarget().path(THEMES), themeRoot);
+ final ShopifyThemeRoot result = response.readEntity(ShopifyThemeRoot.class);
+ return result.getTheme();
+ }
+ public boolean deleteTheme(final String themeId) {
+ final Response response = delete(getWebTarget().path(THEMES).path(themeId));
+ return Status.OK.getStatusCode() == response.getStatus();
+ }
+ public ShopifyWebhook createWebhook(ShopifyWebhook request) {
+ final ShopifyWebhookRoot webhookRoot = new ShopifyWebhookRoot();
+ webhookRoot.setWebhook(request);
+ final Response response = post(getWebTarget().path(WEBHOOKS), webhookRoot);
+ final ShopifyWebhookRoot result = response.readEntity(ShopifyWebhookRoot.class);
+ return result.getWebhook();
+ }
+ public ShopifyWebhook getWebhook(String webhookId) {
+ final Response response = get(getWebTarget().path(WEBHOOKS).path(webhookId));
+ final ShopifyWebhookRoot result = response.readEntity(ShopifyWebhookRoot.class);
+ return result.getWebhook();
+ }
+ public boolean deleteWebhook(final String webhookId) {
+ final Response response = delete(getWebTarget().path(WEBHOOKS).path(webhookId));
+ return Status.OK.getStatusCode() == response.getStatus();
+ }
+ public List getWebhooks() {
+ final List shopifyWebhooks = new LinkedList<>();
+ ShopifyPage shopifyWebhooksPage = getWebhooks(MAX_REQUEST_LIMIT);
+ LOGGER.info("Retrieved {} Webhooks from first page", shopifyWebhooksPage.size());
+ shopifyWebhooks.addAll(shopifyWebhooksPage);
+ while (shopifyWebhooksPage.getNextPageInfo() != null) {
+ shopifyWebhooksPage = getWebhooks(shopifyWebhooksPage.getNextPageInfo(), MAX_REQUEST_LIMIT);
+ LOGGER.info("Retrieved {} Webhooks from page {}", shopifyWebhooksPage.size(),
+ shopifyWebhooksPage.getNextPageInfo());
+ shopifyWebhooks.addAll(shopifyWebhooksPage);
+ }
+ return shopifyWebhooks;
+ }
+ public ShopifyPage getWebhooks(final String pageInfo, final int pageSize) {
+ final Response response = get(getWebTarget().path(WEBHOOKS).queryParam(LIMIT_QUERY_PARAMETER, pageSize)
+ .queryParam(PAGE_INFO_QUERY_PARAMETER, pageInfo));
+ final ShopifyWebhooksRoot shopifyWebhooksRoot = response.readEntity(ShopifyWebhooksRoot.class);
+ return mapPagedResponse(shopifyWebhooksRoot.getWebhooks(), response);
+ }
+ public ShopifyPage getWebhooks(final int pageSize) {
+ return this.getWebhooks(null, pageSize);
+ }
public int getProductCount() {
final Response response = get(getWebTarget().path(PRODUCTS).path(COUNT));
final Count count = response.readEntity(Count.class);
@@ -606,6 +645,11 @@ public ShopifyRecurringApplicationCharge createRecurringApplicationCharge(
return shopifyRecurringApplicationChargeRootResponse.getRecurringApplicationCharge();
}
+ public boolean deleteCharge(final String chargeId) {
+ final Response response = delete(getWebTarget().path(RECURRING_APPLICATION_CHARGES).path(chargeId));
+ return Status.OK.getStatusCode() == response.getStatus();
+ }
+
public ShopifyRecurringApplicationCharge getRecurringApplicationCharge(final String chargeId) {
final Response response = get(getWebTarget().path(RECURRING_APPLICATION_CHARGES).path(chargeId));
final ShopifyRecurringApplicationChargeRoot shopifyRecurringApplicationChargeRootResponse = response
@@ -1141,11 +1185,7 @@ private WebTarget getWebTarget() {
}
private static Client buildClient() {
- final ObjectMapper mapper = ShopifySdkObjectMapper.buildMapper();
- final JacksonJaxbJsonProvider provider = new JacksonJaxbJsonProvider();
- provider.setMapper(mapper);
-
- return ClientBuilder.newClient().register(JacksonFeature.class).register(provider);
+ return ClientBuilder.newClient().register(JacksonFeature.class).register(ObjectMapperProvider.class);
}
public class ShopifySdkRetryListener implements RetryListener {
diff --git a/src/main/java/com/shopify/mappers/ObjectMapperProvider.java b/src/main/java/com/shopify/mappers/ObjectMapperProvider.java
new file mode 100644
index 00000000..aa4e5b3e
--- /dev/null
+++ b/src/main/java/com/shopify/mappers/ObjectMapperProvider.java
@@ -0,0 +1,19 @@
+package com.shopify.mappers;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import javax.ws.rs.ext.ContextResolver;
+import javax.ws.rs.ext.Provider;
+
+@Provider
+public class ObjectMapperProvider implements ContextResolver {
+ private final ObjectMapper objectMapper;
+
+ public ObjectMapperProvider() {
+ objectMapper = ShopifySdkObjectMapper.buildMapper();
+ }
+
+ @Override
+ public ObjectMapper getContext(Class> aClass) {
+ return objectMapper;
+ }
+}
diff --git a/src/main/java/com/shopify/model/ShopifyAssertsRoot.java b/src/main/java/com/shopify/model/ShopifyAssertsRoot.java
new file mode 100644
index 00000000..ed9c67f3
--- /dev/null
+++ b/src/main/java/com/shopify/model/ShopifyAssertsRoot.java
@@ -0,0 +1,20 @@
+package com.shopify.model;
+
+import java.util.LinkedList;
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement
+public class ShopifyAssertsRoot {
+
+ private List assets = new LinkedList<>();
+
+ public List getAssets() {
+ return assets;
+ }
+
+ public void setAssets(List assets) {
+ this.assets = assets;
+ }
+}
diff --git a/src/main/java/com/shopify/model/ShopifyAsset.java b/src/main/java/com/shopify/model/ShopifyAsset.java
new file mode 100644
index 00000000..aafaffb6
--- /dev/null
+++ b/src/main/java/com/shopify/model/ShopifyAsset.java
@@ -0,0 +1,112 @@
+package com.shopify.model;
+
+import com.shopify.model.adapters.DateTimeAdapter;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+import org.joda.time.DateTime;
+
+@XmlRootElement
+@XmlAccessorType(XmlAccessType.FIELD)
+public class ShopifyAsset {
+ private String attachment;
+ private String checksum;
+ @XmlElement(name = "content_type")
+ private String contentType;
+ @XmlElement(name = "created_at")
+ @XmlJavaTypeAdapter(DateTimeAdapter.class)
+ private DateTime createdAt;
+ private String key;
+ @XmlElement(name = "public_url")
+ private String publicUrl;
+ private Long size;
+ @XmlElement(name = "theme_id")
+ private Long themeId;
+ @XmlElement(name = "updated_at")
+ @XmlJavaTypeAdapter(DateTimeAdapter.class)
+ private DateTime updatedAt;
+ private String value;
+
+ public String getAttachment() {
+ return attachment;
+ }
+
+ public void setAttachment(String attachment) {
+ this.attachment = attachment;
+ }
+
+ public String getChecksum() {
+ return checksum;
+ }
+
+ public void setChecksum(String checksum) {
+ this.checksum = checksum;
+ }
+
+ public String getContentType() {
+ return contentType;
+ }
+
+ public void setContentType(String contentType) {
+ this.contentType = contentType;
+ }
+
+
+ public String getKey() {
+ return key;
+ }
+
+ public void setKey(String key) {
+ this.key = key;
+ }
+
+ public String getPublicUrl() {
+ return publicUrl;
+ }
+
+ public void setPublicUrl(String publicUrl) {
+ this.publicUrl = publicUrl;
+ }
+
+ public Long getSize() {
+ return size;
+ }
+
+ public void setSize(Long size) {
+ this.size = size;
+ }
+
+ public Long getThemeId() {
+ return themeId;
+ }
+
+ public void setThemeId(Long themeId) {
+ this.themeId = themeId;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+ public DateTime getCreatedAt() {
+ return createdAt;
+ }
+
+ public void setCreatedAt(DateTime createdAt) {
+ this.createdAt = createdAt;
+ }
+
+ public DateTime getUpdatedAt() {
+ return updatedAt;
+ }
+
+ public void setUpdatedAt(DateTime updatedAt) {
+ this.updatedAt = updatedAt;
+ }
+}
diff --git a/src/main/java/com/shopify/model/ShopifyAssetRoot.java b/src/main/java/com/shopify/model/ShopifyAssetRoot.java
new file mode 100644
index 00000000..6f6cbb85
--- /dev/null
+++ b/src/main/java/com/shopify/model/ShopifyAssetRoot.java
@@ -0,0 +1,14 @@
+package com.shopify.model;
+
+public class ShopifyAssetRoot {
+
+ private ShopifyAsset asset;
+
+ public ShopifyAsset getAsset() {
+ return asset;
+ }
+
+ public void setAsset(ShopifyAsset asset) {
+ this.asset = asset;
+ }
+}
diff --git a/src/main/java/com/shopify/model/ShopifyTheme.java b/src/main/java/com/shopify/model/ShopifyTheme.java
new file mode 100644
index 00000000..a8b25c2d
--- /dev/null
+++ b/src/main/java/com/shopify/model/ShopifyTheme.java
@@ -0,0 +1,107 @@
+package com.shopify.model;
+
+import com.shopify.model.adapters.DateTimeAdapter;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+import org.joda.time.DateTime;
+
+@XmlRootElement
+public class ShopifyTheme {
+ @XmlElement(name = "created_at")
+ @XmlJavaTypeAdapter(DateTimeAdapter.class)
+ private DateTime createdAt;
+ private String id;
+ private String name;
+ private boolean previewable;
+ private boolean processing;
+ private String role;
+ private String src;
+ @XmlElement(name = "theme_store_id")
+ private String themeStoreId;
+ @XmlElement(name = "updated_at")
+ @XmlJavaTypeAdapter(DateTimeAdapter.class)
+ private DateTime updatedAt;
+ @XmlElement(name = "admin_graphql_api_id")
+ private String adminGraphqlApiId;
+
+ public DateTime getCreatedAt() {
+ return createdAt;
+ }
+
+ public void setCreatedAt(DateTime createdAt) {
+ this.createdAt = createdAt;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public boolean isPreviewable() {
+ return previewable;
+ }
+
+ public void setPreviewable(boolean previewable) {
+ this.previewable = previewable;
+ }
+
+ public boolean isProcessing() {
+ return processing;
+ }
+
+ public void setProcessing(boolean processing) {
+ this.processing = processing;
+ }
+
+ public String getRole() {
+ return role;
+ }
+
+ public void setRole(String role) {
+ this.role = role;
+ }
+
+ public String getSrc() {
+ return src;
+ }
+
+ public void setSrc(String src) {
+ this.src = src;
+ }
+
+ public String getThemeStoreId() {
+ return themeStoreId;
+ }
+
+ public void setThemeStoreId(String themeStoreId) {
+ this.themeStoreId = themeStoreId;
+ }
+
+ public DateTime getUpdatedAt() {
+ return updatedAt;
+ }
+
+ public void setUpdatedAt(DateTime updatedAt) {
+ this.updatedAt = updatedAt;
+ }
+
+ public String getAdminGraphqlApiId() {
+ return adminGraphqlApiId;
+ }
+
+ public void setAdminGraphqlApiId(String adminGraphqlApiId) {
+ this.adminGraphqlApiId = adminGraphqlApiId;
+ }
+}
diff --git a/src/main/java/com/shopify/model/ShopifyThemeRoot.java b/src/main/java/com/shopify/model/ShopifyThemeRoot.java
new file mode 100644
index 00000000..d1ecfd94
--- /dev/null
+++ b/src/main/java/com/shopify/model/ShopifyThemeRoot.java
@@ -0,0 +1,14 @@
+package com.shopify.model;
+
+public class ShopifyThemeRoot {
+
+ private ShopifyTheme theme;
+
+ public ShopifyTheme getTheme() {
+ return theme;
+ }
+
+ public void setTheme(ShopifyTheme theme) {
+ this.theme = theme;
+ }
+}
diff --git a/src/main/java/com/shopify/model/ShopifyThemesRoot.java b/src/main/java/com/shopify/model/ShopifyThemesRoot.java
new file mode 100644
index 00000000..5721c932
--- /dev/null
+++ b/src/main/java/com/shopify/model/ShopifyThemesRoot.java
@@ -0,0 +1,16 @@
+package com.shopify.model;
+
+import java.util.List;
+
+public class ShopifyThemesRoot {
+
+ private List themes;
+
+ public List getThemes() {
+ return themes;
+ }
+
+ public void setThemes(List themes) {
+ this.themes = themes;
+ }
+}
diff --git a/src/main/java/com/shopify/model/ShopifyWebhook.java b/src/main/java/com/shopify/model/ShopifyWebhook.java
new file mode 100644
index 00000000..77453698
--- /dev/null
+++ b/src/main/java/com/shopify/model/ShopifyWebhook.java
@@ -0,0 +1,116 @@
+package com.shopify.model;
+
+import com.shopify.model.adapters.DateTimeAdapter;
+import java.math.BigDecimal;
+
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlTransient;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
+import com.shopify.model.adapters.EscapedStringAdapter;
+import com.shopify.model.adapters.InventoryPolicyAdapter;
+import org.joda.time.DateTime;
+
+@XmlRootElement
+@XmlAccessorType(XmlAccessType.FIELD)
+public class ShopifyWebhook {
+
+ private String id;
+ private String address;
+ private String topic;
+ private String api_version;
+ private String created_at;
+ private List fields;
+ private String format;
+ @XmlElement(name = "metafield_namespaces")
+ private List metafieldNamespaces;
+ @XmlElement(name = "private_metafield_namespaces")
+ private List privateMetafieldNamespaces;
+ @XmlElement(name = "updated_at")
+ @XmlJavaTypeAdapter(DateTimeAdapter.class)
+ private DateTime updatedAt;
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getAddress() {
+ return address;
+ }
+
+ public void setAddress(String address) {
+ this.address = address;
+ }
+
+ public String getTopic() {
+ return topic;
+ }
+
+ public void setTopic(String topic) {
+ this.topic = topic;
+ }
+
+ public String getApi_version() {
+ return api_version;
+ }
+
+ public void setApi_version(String api_version) {
+ this.api_version = api_version;
+ }
+
+ public String getCreated_at() {
+ return created_at;
+ }
+
+ public void setCreated_at(String created_at) {
+ this.created_at = created_at;
+ }
+
+ public List getFields() {
+ return fields;
+ }
+
+ public void setFields(List fields) {
+ this.fields = fields;
+ }
+
+ public String getFormat() {
+ return format;
+ }
+
+ public void setFormat(String format) {
+ this.format = format;
+ }
+
+ public List getMetafieldNamespaces() {
+ return metafieldNamespaces;
+ }
+
+ public void setMetafieldNamespaces(List metafieldNamespaces) {
+ this.metafieldNamespaces = metafieldNamespaces;
+ }
+
+ public List getPrivateMetafieldNamespaces() {
+ return privateMetafieldNamespaces;
+ }
+
+ public void setPrivateMetafieldNamespaces(List privateMetafieldNamespaces) {
+ this.privateMetafieldNamespaces = privateMetafieldNamespaces;
+ }
+
+ public DateTime getUpdatedAt() {
+ return updatedAt;
+ }
+
+ public void setUpdatedAt(DateTime updatedAt) {
+ this.updatedAt = updatedAt;
+ }
+}
diff --git a/src/main/java/com/shopify/model/ShopifyWebhookRoot.java b/src/main/java/com/shopify/model/ShopifyWebhookRoot.java
new file mode 100644
index 00000000..d549c418
--- /dev/null
+++ b/src/main/java/com/shopify/model/ShopifyWebhookRoot.java
@@ -0,0 +1,17 @@
+package com.shopify.model;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement
+public class ShopifyWebhookRoot {
+
+ private ShopifyWebhook webhook;
+
+ public ShopifyWebhook getWebhook() {
+ return webhook;
+ }
+
+ public void setWebhook(ShopifyWebhook webhook) {
+ this.webhook = webhook;
+ }
+}
diff --git a/src/main/java/com/shopify/model/ShopifyWebhooksRoot.java b/src/main/java/com/shopify/model/ShopifyWebhooksRoot.java
new file mode 100644
index 00000000..1e2345bc
--- /dev/null
+++ b/src/main/java/com/shopify/model/ShopifyWebhooksRoot.java
@@ -0,0 +1,18 @@
+package com.shopify.model;
+
+import java.util.List;
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement
+public class ShopifyWebhooksRoot {
+
+ private List webhooks;
+
+ public List getWebhooks() {
+ return webhooks;
+ }
+
+ public void setWebhooks(List webhooks) {
+ this.webhooks = webhooks;
+ }
+}