From eb3750181d4c38d680a33449acd2e0fa9eac900d Mon Sep 17 00:00:00 2001 From: Mark Yao Date: Fri, 2 Feb 2018 17:09:20 -0800 Subject: [PATCH] add target fields to stories --- src/main/java/com/asana/models/Attachment.java | 3 +-- src/main/java/com/asana/models/CustomField.java | 3 +-- src/main/java/com/asana/models/CustomFieldSetting.java | 3 +-- src/main/java/com/asana/models/Event.java | 3 +-- src/main/java/com/asana/models/Project.java | 3 +-- src/main/java/com/asana/models/Resource.java | 5 +++++ src/main/java/com/asana/models/Story.java | 5 +++-- src/main/java/com/asana/models/Tag.java | 3 +-- src/main/java/com/asana/models/Task.java | 3 +-- src/main/java/com/asana/models/Team.java | 3 +-- src/main/java/com/asana/models/User.java | 3 +-- src/main/java/com/asana/models/Webhook.java | 3 +-- src/main/java/com/asana/models/Workspace.java | 3 +-- 13 files changed, 19 insertions(+), 24 deletions(-) create mode 100644 src/main/java/com/asana/models/Resource.java diff --git a/src/main/java/com/asana/models/Attachment.java b/src/main/java/com/asana/models/Attachment.java index 55c2368..522d3bf 100644 --- a/src/main/java/com/asana/models/Attachment.java +++ b/src/main/java/com/asana/models/Attachment.java @@ -1,6 +1,5 @@ package com.asana.models; -public class Attachment { - public String id; +public class Attachment extends Resource { public String name; } diff --git a/src/main/java/com/asana/models/CustomField.java b/src/main/java/com/asana/models/CustomField.java index 71b4526..0cbd01d 100644 --- a/src/main/java/com/asana/models/CustomField.java +++ b/src/main/java/com/asana/models/CustomField.java @@ -4,7 +4,7 @@ import java.util.Collection; -public class CustomField { +public class CustomField extends Resource { public static class EnumOption { public String id; @@ -14,7 +14,6 @@ public static class EnumOption { } - public String id; public String name; public String type; diff --git a/src/main/java/com/asana/models/CustomFieldSetting.java b/src/main/java/com/asana/models/CustomFieldSetting.java index 64b8ffa..3aefb30 100644 --- a/src/main/java/com/asana/models/CustomFieldSetting.java +++ b/src/main/java/com/asana/models/CustomFieldSetting.java @@ -4,9 +4,8 @@ import java.util.Collection; -public class CustomFieldSetting { +public class CustomFieldSetting extends Resource { - public String id; @SerializedName("is_important") public Boolean isImportant; diff --git a/src/main/java/com/asana/models/Event.java b/src/main/java/com/asana/models/Event.java index 2c0ece3..b5a5e08 100644 --- a/src/main/java/com/asana/models/Event.java +++ b/src/main/java/com/asana/models/Event.java @@ -5,8 +5,7 @@ import com.google.api.client.util.DateTime; public class Event { - public class Entity { - public String id; + public class Entity extends Resource { public String name; } diff --git a/src/main/java/com/asana/models/Project.java b/src/main/java/com/asana/models/Project.java index b8e6d13..016a342 100644 --- a/src/main/java/com/asana/models/Project.java +++ b/src/main/java/com/asana/models/Project.java @@ -5,8 +5,7 @@ import java.util.Collection; import com.google.api.client.util.DateTime; -public class Project { - public String id; +public class Project extends Resource { public String name; public String notes; diff --git a/src/main/java/com/asana/models/Resource.java b/src/main/java/com/asana/models/Resource.java new file mode 100644 index 0000000..d87225a --- /dev/null +++ b/src/main/java/com/asana/models/Resource.java @@ -0,0 +1,5 @@ +package com.asana.models; + +public class Resource { + public String id; +} diff --git a/src/main/java/com/asana/models/Story.java b/src/main/java/com/asana/models/Story.java index 18ce992..c75a823 100644 --- a/src/main/java/com/asana/models/Story.java +++ b/src/main/java/com/asana/models/Story.java @@ -4,11 +4,12 @@ import com.google.api.client.util.DateTime; -public class Story { - public String id; +public class Story extends Resource { public String text; public String type; + public Resource target; + @SerializedName("created_by") public User createdBy; @SerializedName("created_at") diff --git a/src/main/java/com/asana/models/Tag.java b/src/main/java/com/asana/models/Tag.java index 4515fc7..6c13a28 100644 --- a/src/main/java/com/asana/models/Tag.java +++ b/src/main/java/com/asana/models/Tag.java @@ -5,8 +5,7 @@ import java.util.Collection; import com.google.api.client.util.DateTime; -public class Tag { - public String id; +public class Tag extends Resource { public String name; public String notes; diff --git a/src/main/java/com/asana/models/Task.java b/src/main/java/com/asana/models/Task.java index 6fe0ac4..60a41f2 100644 --- a/src/main/java/com/asana/models/Task.java +++ b/src/main/java/com/asana/models/Task.java @@ -5,7 +5,7 @@ import java.util.Collection; -public class Task { +public class Task extends Resource { public static class Membership { public Project project; public Task section; @@ -16,7 +16,6 @@ public static class Heart { public User user; } - public String id; public String name; public String notes; diff --git a/src/main/java/com/asana/models/Team.java b/src/main/java/com/asana/models/Team.java index 015f555..8618920 100644 --- a/src/main/java/com/asana/models/Team.java +++ b/src/main/java/com/asana/models/Team.java @@ -1,7 +1,6 @@ package com.asana.models; -public class Team { - public String id; +public class Team extends Resource { public String name; public Workspace organization; diff --git a/src/main/java/com/asana/models/User.java b/src/main/java/com/asana/models/User.java index 5d897f9..ae6b10d 100644 --- a/src/main/java/com/asana/models/User.java +++ b/src/main/java/com/asana/models/User.java @@ -2,7 +2,7 @@ import java.util.Collection; -public class User { +public class User extends Resource { public static class Photo { public String image_128x128; public String image_21x21; @@ -11,7 +11,6 @@ public static class Photo { public String image_60x60; } - public String id; public String name; public String email; diff --git a/src/main/java/com/asana/models/Webhook.java b/src/main/java/com/asana/models/Webhook.java index 596c05a..90794fc 100644 --- a/src/main/java/com/asana/models/Webhook.java +++ b/src/main/java/com/asana/models/Webhook.java @@ -4,8 +4,7 @@ import com.google.api.client.util.DateTime; -public class Webhook { - public String id; +public class Webhook extends Resource { public Event.Entity resource; public String target; public boolean active; diff --git a/src/main/java/com/asana/models/Workspace.java b/src/main/java/com/asana/models/Workspace.java index 58e8b06..b26f7c5 100644 --- a/src/main/java/com/asana/models/Workspace.java +++ b/src/main/java/com/asana/models/Workspace.java @@ -4,8 +4,7 @@ import java.util.Collection; -public class Workspace { - public String id; +public class Workspace extends Resource { public String name; @SerializedName("email_domains")