Skip to content

Commit 4681c34

Browse files
author
Ed Fricker
committed
Ed: removing staging reference
1 parent df4f877 commit 4681c34

File tree

7 files changed

+255
-260
lines changed

7 files changed

+255
-260
lines changed

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
version=2.0.1
2-
mavendir=
1+
version=2.0.1
2+
mavendir=
Lines changed: 60 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,60 @@
1-
package com.creatubbles.api.core;
2-
3-
import java.util.HashMap;
4-
5-
import jersey.repackaged.com.google.common.collect.Maps;
6-
import lombok.AccessLevel;
7-
import lombok.EqualsAndHashCode;
8-
import lombok.Getter;
9-
import lombok.ToString;
10-
11-
import com.google.gson.annotations.SerializedName;
12-
13-
@ToString(callSuper = true)
14-
@EqualsAndHashCode
15-
@Getter
16-
public class Creation extends CreatubblesObject {
17-
18-
private String name;
19-
@SerializedName("created_at")
20-
private String createdDate;
21-
@SerializedName("created_at_age")
22-
private String createdAge;
23-
24-
@Getter(value = AccessLevel.NONE)
25-
@SerializedName("created_at_age_per_creator")
26-
private HashMap<String, String> creatorToAgeMap = Maps.newHashMap();
27-
28-
public String getCreatedAge(String creatorId) {
29-
return creatorToAgeMap.get(creatorId);
30-
}
31-
32-
public String getCreatedAge(User creator) {
33-
return getCreatedAge(creator.getId());
34-
}
35-
36-
@SerializedName("created_at_month")
37-
private int createdMonth;
38-
@SerializedName("created_at_year")
39-
private int createdYear;
40-
@SerializedName("comments_count")
41-
private int commentCount;
42-
@SerializedName("bubble_count")
43-
private int bubbleCount;
44-
@SerializedName("views_count")
45-
private int viewCount;
46-
47-
@SerializedName("last_bubbled_at")
48-
private String lastBubbleDate;
49-
@SerializedName("last_commented_at")
50-
private String lastCommentDate;
51-
@SerializedName("last_submitted_at")
52-
private String lastSubmitDate;
53-
54-
private Image image;
55-
56-
@SerializedName("short_url")
57-
private String shortUrl;
58-
59-
private boolean approved;
60-
}
1+
package com.creatubbles.api.core;
2+
3+
import java.util.HashMap;
4+
5+
import jersey.repackaged.com.google.common.collect.Maps;
6+
import lombok.AccessLevel;
7+
import lombok.EqualsAndHashCode;
8+
import lombok.Getter;
9+
import lombok.ToString;
10+
11+
import com.google.gson.annotations.SerializedName;
12+
13+
@ToString(callSuper = true)
14+
@EqualsAndHashCode
15+
@Getter
16+
public class Creation extends CreatubblesObject {
17+
18+
private String name;
19+
@SerializedName("created_at")
20+
private String createdDate;
21+
@SerializedName("created_at_age")
22+
private String createdAge;
23+
24+
@Getter(value = AccessLevel.NONE)
25+
@SerializedName("created_at_age_per_creator")
26+
private HashMap<String, String> creatorToAgeMap = Maps.newHashMap();
27+
28+
public String getCreatedAge(String creatorId) {
29+
return creatorToAgeMap.get(creatorId);
30+
}
31+
32+
public String getCreatedAge(User creator) {
33+
return getCreatedAge(creator.getId());
34+
}
35+
36+
@SerializedName("created_at_month")
37+
private int createdMonth;
38+
@SerializedName("created_at_year")
39+
private int createdYear;
40+
@SerializedName("comments_count")
41+
private int commentCount;
42+
@SerializedName("bubble_count")
43+
private int bubbleCount;
44+
@SerializedName("views_count")
45+
private int viewCount;
46+
47+
@SerializedName("last_bubbled_at")
48+
private String lastBubbleDate;
49+
@SerializedName("last_commented_at")
50+
private String lastCommentDate;
51+
@SerializedName("last_submitted_at")
52+
private String lastSubmitDate;
53+
54+
private Image image;
55+
56+
@SerializedName("short_url")
57+
private String shortUrl;
58+
59+
private boolean approved;
60+
}

src/main/java/com/creatubbles/api/core/CreatubblesRequest.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -261,11 +261,6 @@ public CreatubblesRequest<T> execute() {
261261
}
262262
}
263263

264-
if (CreatubblesAPI.stagingModeEnabled()) {
265-
HttpAuthenticationFeature basicAuth = HttpAuthenticationFeature.basic("c", "c");
266-
webTarget.register(basicAuth);
267-
}
268-
269264
Invocation.Builder invocationBuilder = webTarget.request(APPLICATION_VND_API_JSON).accept(APPLICATION_VND_API_JSON);
270265

271266
if (acceptLanguage != null && acceptLanguage.length() == 2) {
Lines changed: 72 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,72 @@
1-
package com.creatubbles.api.core;
2-
3-
import java.lang.reflect.Type;
4-
5-
import lombok.Builder;
6-
import lombok.EqualsAndHashCode;
7-
import lombok.Getter;
8-
import lombok.ToString;
9-
10-
import com.google.gson.JsonElement;
11-
import com.google.gson.JsonObject;
12-
import com.google.gson.JsonSerializationContext;
13-
import com.google.gson.JsonSerializer;
14-
import com.google.gson.annotations.SerializedName;
15-
16-
@ToString(callSuper = true)
17-
@EqualsAndHashCode
18-
@Builder
19-
@Getter
20-
public class Gallery {
21-
22-
private int id;
23-
private String name, description;
24-
25-
@SerializedName("type")
26-
private String type;
27-
@SerializedName("created_at")
28-
private String createdDate;
29-
private Image banner;
30-
31-
@SerializedName("open_for_all")
32-
private boolean openForAll;
33-
34-
@SerializedName("owner_id")
35-
private int ownerId;
36-
@SerializedName("owner_type")
37-
private String ownerType;
38-
39-
public static class Serializer implements JsonSerializer<Gallery> {
40-
41-
@Override
42-
public JsonElement serialize(Gallery src, Type typeOfSrc, JsonSerializationContext context) {
43-
44-
JsonObject root = new JsonObject();
45-
46-
JsonObject data = new JsonObject();
47-
data.addProperty("type", src.type);
48-
49-
JsonObject attributes = new JsonObject();
50-
attributes.addProperty("name", src.name);
51-
attributes.addProperty("descrtiption", src.description);
52-
attributes.addProperty("open_for_all", src.openForAll ? 1 : 0);
53-
54-
JsonObject relationships = new JsonObject();
55-
56-
JsonObject owner = new JsonObject();
57-
JsonObject ownerdata = new JsonObject();
58-
ownerdata.addProperty("type", src.ownerType);
59-
ownerdata.addProperty("id", src.ownerId);
60-
owner.add("data", ownerdata);
61-
62-
relationships.add("owner", owner);
63-
64-
data.add("attributes", attributes);
65-
data.add("relationships", relationships);
66-
67-
root.add("data", data);
68-
return root;
69-
}
70-
}
71-
72-
}
1+
package com.creatubbles.api.core;
2+
3+
import java.lang.reflect.Type;
4+
5+
import lombok.Builder;
6+
import lombok.EqualsAndHashCode;
7+
import lombok.Getter;
8+
import lombok.ToString;
9+
10+
import com.google.gson.JsonElement;
11+
import com.google.gson.JsonObject;
12+
import com.google.gson.JsonSerializationContext;
13+
import com.google.gson.JsonSerializer;
14+
import com.google.gson.annotations.SerializedName;
15+
16+
@ToString(callSuper = true)
17+
@EqualsAndHashCode
18+
@Builder
19+
@Getter
20+
public class Gallery {
21+
22+
private int id;
23+
private String name, description;
24+
25+
@SerializedName("type")
26+
private String type;
27+
@SerializedName("created_at")
28+
private String createdDate;
29+
private Image banner;
30+
31+
@SerializedName("open_for_all")
32+
private boolean openForAll;
33+
34+
@SerializedName("owner_id")
35+
private int ownerId;
36+
@SerializedName("owner_type")
37+
private String ownerType;
38+
39+
public static class Serializer implements JsonSerializer<Gallery> {
40+
41+
@Override
42+
public JsonElement serialize(Gallery src, Type typeOfSrc, JsonSerializationContext context) {
43+
44+
JsonObject root = new JsonObject();
45+
46+
JsonObject data = new JsonObject();
47+
data.addProperty("type", src.type);
48+
49+
JsonObject attributes = new JsonObject();
50+
attributes.addProperty("name", src.name);
51+
attributes.addProperty("descrtiption", src.description);
52+
attributes.addProperty("open_for_all", src.openForAll ? 1 : 0);
53+
54+
JsonObject relationships = new JsonObject();
55+
56+
JsonObject owner = new JsonObject();
57+
JsonObject ownerdata = new JsonObject();
58+
ownerdata.addProperty("type", src.ownerType);
59+
ownerdata.addProperty("id", src.ownerId);
60+
owner.add("data", ownerdata);
61+
62+
relationships.add("owner", owner);
63+
64+
data.add("attributes", attributes);
65+
data.add("relationships", relationships);
66+
67+
root.add("data", data);
68+
return root;
69+
}
70+
}
71+
72+
}
Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
1-
package com.creatubbles.api.core;
2-
3-
import java.util.Map;
4-
5-
import lombok.EqualsAndHashCode;
6-
import lombok.Getter;
7-
import lombok.ToString;
8-
9-
@ToString
10-
@EqualsAndHashCode
11-
@Getter
12-
public class Image {
13-
14-
private Map<ImageType, String> links;
15-
16-
public String getUrl(ImageType type) {
17-
return links.get(type);
18-
}
19-
20-
public enum ImageType {
21-
original,
22-
full_view,
23-
list_view_retina,
24-
list_view,
25-
matrix_view_retina,
26-
matrix_view,
27-
gallery_mobile,
28-
explore_mobile,
29-
share;
30-
}
31-
}
1+
package com.creatubbles.api.core;
2+
3+
import java.util.Map;
4+
5+
import lombok.EqualsAndHashCode;
6+
import lombok.Getter;
7+
import lombok.ToString;
8+
9+
@ToString
10+
@EqualsAndHashCode
11+
@Getter
12+
public class Image {
13+
14+
private Map<ImageType, String> links;
15+
16+
public String getUrl(ImageType type) {
17+
return links.get(type);
18+
}
19+
20+
public enum ImageType {
21+
original,
22+
full_view,
23+
list_view_retina,
24+
list_view,
25+
matrix_view_retina,
26+
matrix_view,
27+
gallery_mobile,
28+
explore_mobile,
29+
share;
30+
}
31+
}

0 commit comments

Comments
 (0)