Skip to content

Commit e2f9f9c

Browse files
committed
Merge branch 'release/2.0.0'
2 parents b314a18 + 8b02329 commit e2f9f9c

16 files changed

+1723
-865
lines changed

.travis.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ addons:
99
secure: t/ptO2JeFG41R8Udic/Rh4wXuEi3cDPXG6KLKhikZXmr5A4PdEJ8B/J66Pq8b0TAROc8elm0xGY6AbVSB0NHC3IxiMke+3doRw9r1tzDT08RQKca7CijAZp9RJHzQ2AeWq31sTKQbc8EcN/I7sKOO8imDyQb14p75nalWE/82hlA0sCzx+/YAF5mpzZ6bjptm0zIES8qXUl3wee6+OZ9NmwvLRqz7QVZKncA0vq2tVV04TrvHXpYaBjXliJPdxSKWIkeeF7JY+fI5OJXBsPNmcBkgWyBMflEu7Jh/gjmySFvnzYe+o/nX6wcYv9RHCfFQnjH4suuU/oeo03SzC8NUgqhh6ZK9fvzeQNRkxoJdKkDWZ8+PSIkKm1gbAAZKjNXb6Z86WAGn4wz2cy5m0ppHi5FFpJSsc1W1qopMUKMBVmnG64rNw1NK7rFRfX09TEoU2t7up9osqKF71qfyGcTgYyOL1fz1EWOdZHrRhm9YyEDl++ukBlwvmyxqQOgnzo94PSnvE2AnuLq3xLHL7c9r1M3VYAo0/0vOmiLO03v8YSXxWCiq7J4PamK+eezfnwcql4Y/DWIpDSNRC4NjOQaoMnZQNgHF3nWXFR7EpfJWF3IiDQyhi79iQjFYj3YkvIuPvGOhpLOIIKWmw4cVpJ5RylsiHA//zPeGsFd/lWq4I0=
1010
jdk:
1111
- oraclejdk8
12+
- openjdk11
1213
script:
1314
- if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then mvn clean install; fi
1415
- if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then mvn --settings .travis/settings.xml
@@ -26,18 +27,21 @@ deploy:
2627
on:
2728
tags: true
2829
repo: ChannelApe/shopify-sdk
29-
jdk: oraclejdk8
30+
jdk:
31+
- openjdk11
3032
- provider: script
3133
script: ".travis/deploy.sh"
3234
skip_cleanup: true
3335
on:
3436
branch: master
3537
repo: ChannelApe/shopify-sdk
36-
jdk: oraclejdk8
38+
jdk:
39+
- openjdk11
3740
- provider: script
3841
script: ".travis/deploy.sh"
3942
skip_cleanup: true
4043
on:
4144
branch: develop
4245
repo: ChannelApe/shopify-sdk
43-
jdk: oraclejdk8
46+
jdk:
47+
- openjdk11

pom.xml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<modelVersion>4.0.0</modelVersion>
55
<groupId>com.channelape</groupId>
66
<artifactId>shopify-sdk</artifactId>
7-
<version>1.7.0</version>
7+
<version>2.0.0</version>
88

99
<name>Shopify SDK</name>
1010
<description>Java SDK for Shopify REST API.</description>
@@ -119,6 +119,26 @@
119119
<artifactId>guava-retrying</artifactId>
120120
<version>2.0.0</version>
121121
</dependency>
122+
<dependency>
123+
<groupId>javax.xml.bind</groupId>
124+
<artifactId>jaxb-api</artifactId>
125+
<version>2.3.0</version>
126+
</dependency>
127+
<dependency>
128+
<groupId>com.sun.xml.bind</groupId>
129+
<artifactId>jaxb-core</artifactId>
130+
<version>2.3.0</version>
131+
</dependency>
132+
<dependency>
133+
<groupId>com.sun.xml.bind</groupId>
134+
<artifactId>jaxb-impl</artifactId>
135+
<version>2.3.0</version>
136+
</dependency>
137+
<dependency>
138+
<groupId>javax.activation</groupId>
139+
<artifactId>activation</artifactId>
140+
<version>1.1.1</version>
141+
</dependency>
122142
<!-- test dependencies -->
123143
<dependency>
124144
<groupId>junit</groupId>
@@ -171,6 +191,7 @@
171191
<outputFormat>HTML</outputFormat>
172192
<outputFormat>XML</outputFormat>
173193
</outputFormats>
194+
<timeoutConstant>2000</timeoutConstant>
174195
<historyInputFile>src/test/resources/pitestHistory</historyInputFile>
175196
<historyOutputFile>src/test/resources/pitestHistory</historyOutputFile>
176197
</configuration>
@@ -246,6 +267,7 @@
246267
<artifactId>maven-javadoc-plugin</artifactId>
247268
<configuration>
248269
<additionalparam>-Xdoclint:none</additionalparam>
270+
<source>8</source>
249271
</configuration>
250272
<executions>
251273
<execution>

src/main/java/com/shopify/ShopifySdk.java

Lines changed: 176 additions & 101 deletions
Large diffs are not rendered by default.
Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
package com.shopify.model;
2+
3+
import com.shopify.model.adapters.DateTimeAdapter;
4+
import org.joda.time.DateTime;
5+
6+
import javax.xml.bind.annotation.XmlAccessType;
7+
import javax.xml.bind.annotation.XmlAccessorType;
8+
import javax.xml.bind.annotation.XmlElement;
9+
import javax.xml.bind.annotation.XmlRootElement;
10+
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
11+
12+
@XmlRootElement
13+
@XmlAccessorType(XmlAccessType.FIELD)
14+
public class ShopifyCustomCollection {
15+
16+
private String id;
17+
private String title;
18+
private String handle;
19+
private boolean published;
20+
21+
@XmlElement(name = "body_html")
22+
private String bodyHtml;
23+
24+
@XmlElement(name = "published_scope")
25+
private String publishedScope;
26+
27+
@XmlElement(name = "sort_order")
28+
private String sortOrder;
29+
30+
@XmlElement(name = "template_suffix")
31+
private String templateSuffix;
32+
33+
@XmlElement(name = "published_at")
34+
@XmlJavaTypeAdapter(DateTimeAdapter.class)
35+
private DateTime publishedAt;
36+
37+
@XmlElement(name = "updated_at")
38+
@XmlJavaTypeAdapter(DateTimeAdapter.class)
39+
private DateTime updatedAt;
40+
41+
@XmlElement(name = "admin_graphql_api_id")
42+
private String adminGraphqlApiId;
43+
44+
45+
public String getAdminGraphqlApiId() {
46+
return adminGraphqlApiId;
47+
}
48+
49+
public String getBodyHtml() {
50+
return bodyHtml;
51+
}
52+
53+
public String getHandle() {
54+
return handle;
55+
}
56+
57+
public String getId() {
58+
return id;
59+
}
60+
61+
public DateTime getPublishedAt() {
62+
return publishedAt;
63+
}
64+
65+
public String getPublishedScope() {
66+
return publishedScope;
67+
}
68+
69+
public String getSortOrder() {
70+
return sortOrder;
71+
}
72+
73+
public String getTemplateSuffix() {
74+
return templateSuffix;
75+
}
76+
77+
public String getTitle() {
78+
return title;
79+
}
80+
81+
public DateTime getUpdatedAt() {
82+
return updatedAt;
83+
}
84+
85+
86+
public void setId(String id) {
87+
this.id = id;
88+
}
89+
90+
public void setTitle(String title) {
91+
this.title = title;
92+
}
93+
94+
public void setHandle(String handle) {
95+
this.handle = handle;
96+
}
97+
98+
public boolean isPublished() {
99+
return published;
100+
}
101+
102+
public void setPublished(boolean published) {
103+
this.published = published;
104+
}
105+
106+
public void setBodyHtml(String bodyHtml) {
107+
this.bodyHtml = bodyHtml;
108+
}
109+
110+
public void setPublishedScope(String publishedScope) {
111+
this.publishedScope = publishedScope;
112+
}
113+
114+
public void setSortOrder(String sortOrder) {
115+
this.sortOrder = sortOrder;
116+
}
117+
118+
public void setTemplateSuffix(String templateSuffix) {
119+
this.templateSuffix = templateSuffix;
120+
}
121+
122+
public void setPublishedAt(DateTime publishedAt) {
123+
this.publishedAt = publishedAt;
124+
}
125+
126+
public void setUpdatedAt(DateTime updatedAt) {
127+
this.updatedAt = updatedAt;
128+
}
129+
130+
public void setAdminGraphqlApiId(String adminGraphqlApiId) {
131+
this.adminGraphqlApiId = adminGraphqlApiId;
132+
}
133+
}
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
package com.shopify.model;
2+
3+
public class ShopifyCustomCollectionCreationRequest {
4+
5+
6+
7+
private final ShopifyCustomCollection request;
8+
9+
public static interface OptionalsStep {
10+
OptionalsStep withBodyHtml(final String bodyHtml);
11+
OptionalsStep withHandle(final String handle);
12+
OptionalsStep isPublished(final boolean published);
13+
OptionalsStep withSortOrder(final String sortOrder);
14+
OptionalsStep withTemplateSuffix(final String templateSuffix);
15+
OptionalsStep withPublishedScope(final String publishedScope);
16+
17+
ShopifyCustomCollectionCreationRequest build();
18+
}
19+
20+
21+
public static interface MandatoryStep {
22+
OptionalsStep withTitle(final String title);
23+
}
24+
25+
26+
27+
28+
public static MandatoryStep newBuilder() {
29+
return new Steps();
30+
}
31+
32+
public ShopifyCustomCollection getRequest() {
33+
return request;
34+
}
35+
36+
private ShopifyCustomCollectionCreationRequest(final ShopifyCustomCollection request) {
37+
this.request = request;
38+
}
39+
40+
private static class Steps implements MandatoryStep, OptionalsStep {
41+
42+
private final ShopifyCustomCollection request = new ShopifyCustomCollection();
43+
44+
@Override
45+
public ShopifyCustomCollectionCreationRequest build() {
46+
return new ShopifyCustomCollectionCreationRequest(request);
47+
}
48+
49+
@Override
50+
public OptionalsStep withTitle(final String title) {
51+
this.request.setTitle(title);
52+
return this;
53+
}
54+
55+
@Override
56+
public OptionalsStep withBodyHtml(String bodyHtml) {
57+
request.setBodyHtml(bodyHtml);
58+
return this;
59+
}
60+
61+
@Override
62+
public OptionalsStep withHandle(String handle) {
63+
request.setHandle(handle);
64+
return this;
65+
}
66+
67+
@Override
68+
public OptionalsStep isPublished(boolean published) {
69+
request.setPublished(published);
70+
return this;
71+
}
72+
73+
@Override
74+
public OptionalsStep withSortOrder(String sortOrder) {
75+
request.setSortOrder(sortOrder);
76+
return this;
77+
}
78+
79+
@Override
80+
public OptionalsStep withTemplateSuffix(String templateSuffix) {
81+
request.setTemplateSuffix(templateSuffix);
82+
return this;
83+
}
84+
85+
@Override
86+
public OptionalsStep withPublishedScope(String publishedScope) {
87+
request.setPublishedScope(publishedScope);
88+
return this;
89+
}
90+
}
91+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package com.shopify.model;
2+
3+
import javax.xml.bind.annotation.XmlElement;
4+
import javax.xml.bind.annotation.XmlRootElement;
5+
6+
@XmlRootElement
7+
public class ShopifyCustomCollectionRoot {
8+
9+
@XmlElement(name = "custom_collection")
10+
private ShopifyCustomCollection customCollection;
11+
12+
public ShopifyCustomCollection getCustomCollection() {
13+
return customCollection;
14+
}
15+
16+
public void setCustomCollection(ShopifyCustomCollection customCollection) {
17+
this.customCollection = customCollection;
18+
}
19+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package com.shopify.model;
2+
3+
import javax.xml.bind.annotation.XmlElement;
4+
import javax.xml.bind.annotation.XmlRootElement;
5+
import java.util.LinkedList;
6+
import java.util.List;
7+
8+
@XmlRootElement
9+
public class ShopifyCustomCollectionsRoot {
10+
11+
@XmlElement(name = "custom_collections")
12+
private List<ShopifyCustomCollection> customCollections = new LinkedList<ShopifyCustomCollection>();
13+
14+
public List<ShopifyCustomCollection> getCustomCollections() {
15+
return customCollections;
16+
}
17+
18+
public void setCustomCollections(List<ShopifyCustomCollection> customCollections) {
19+
this.customCollections = customCollections;
20+
}
21+
}

0 commit comments

Comments
 (0)