Skip to content

Commit

Permalink
Commonize response_metadata holding message strings for error patterns
Browse files Browse the repository at this point in the history
  • Loading branch information
seratch committed Dec 14, 2019
1 parent 8dbe45c commit 9242528
Show file tree
Hide file tree
Showing 14 changed files with 37 additions and 110 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
package com.github.seratch.jslack.api.methods.response.admin.teams;

import com.github.seratch.jslack.api.methods.SlackApiResponse;
import com.github.seratch.jslack.api.model.ErrorResponseMetadata;
import lombok.Data;

import java.util.List;

@Data
public class AdminTeamsCreateResponse implements SlackApiResponse {

Expand All @@ -15,11 +14,6 @@ public class AdminTeamsCreateResponse implements SlackApiResponse {
private String provided;

private String team; // created team id
private ResponseMetadata responseMetadata;

@Data
public static class ResponseMetadata {
private List<String> messages;
}

private ErrorResponseMetadata responseMetadata;
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
package com.github.seratch.jslack.api.methods.response.admin.users;

import com.github.seratch.jslack.api.methods.SlackApiResponse;
import com.github.seratch.jslack.api.model.ErrorResponseMetadata;
import lombok.Data;

import java.util.List;

@Data
public class AdminUsersAssignResponse implements SlackApiResponse {

Expand All @@ -14,10 +13,5 @@ public class AdminUsersAssignResponse implements SlackApiResponse {
private String needed;
private String provided;

private ResponseMetadata responseMetadata;

@Data
public static class ResponseMetadata {
private List<String> messages;
}
private ErrorResponseMetadata responseMetadata;
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
package com.github.seratch.jslack.api.methods.response.admin.users;

import com.github.seratch.jslack.api.methods.SlackApiResponse;
import com.github.seratch.jslack.api.model.ErrorResponseMetadata;
import lombok.Data;

import java.util.List;

@Data
public class AdminUsersInviteResponse implements SlackApiResponse {

Expand All @@ -14,11 +13,5 @@ public class AdminUsersInviteResponse implements SlackApiResponse {
private String needed;
private String provided;

private ResponseMetadata responseMetadata;

@Data
public static class ResponseMetadata {
private List<String> messages;
}

private ErrorResponseMetadata responseMetadata;
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
package com.github.seratch.jslack.api.methods.response.admin.users;

import com.github.seratch.jslack.api.methods.SlackApiResponse;
import com.github.seratch.jslack.api.model.ErrorResponseMetadata;
import lombok.Data;

import java.util.List;

@Data
public class AdminUsersRemoveResponse implements SlackApiResponse {

Expand All @@ -14,11 +13,5 @@ public class AdminUsersRemoveResponse implements SlackApiResponse {
private String needed;
private String provided;

private ResponseMetadata responseMetadata;

@Data
public static class ResponseMetadata {
private List<String> messages;
}

private ErrorResponseMetadata responseMetadata;
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
package com.github.seratch.jslack.api.methods.response.admin.users;

import com.github.seratch.jslack.api.methods.SlackApiResponse;
import com.github.seratch.jslack.api.model.ErrorResponseMetadata;
import lombok.Data;

import java.util.List;

@Data
public class AdminUsersSetAdminResponse implements SlackApiResponse {

Expand All @@ -14,11 +13,5 @@ public class AdminUsersSetAdminResponse implements SlackApiResponse {
private String needed;
private String provided;

private ResponseMetadata responseMetadata;

@Data
public static class ResponseMetadata {
private List<String> messages;
}

private ErrorResponseMetadata responseMetadata;
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
package com.github.seratch.jslack.api.methods.response.admin.users;

import com.github.seratch.jslack.api.methods.SlackApiResponse;
import com.github.seratch.jslack.api.model.ErrorResponseMetadata;
import lombok.Data;

import java.util.List;

@Data
public class AdminUsersSetOwnerResponse implements SlackApiResponse {

Expand All @@ -14,11 +13,5 @@ public class AdminUsersSetOwnerResponse implements SlackApiResponse {
private String needed;
private String provided;

private ResponseMetadata responseMetadata;

@Data
public static class ResponseMetadata {
private List<String> messages;
}

private ErrorResponseMetadata responseMetadata;
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
package com.github.seratch.jslack.api.methods.response.admin.users;

import com.github.seratch.jslack.api.methods.SlackApiResponse;
import com.github.seratch.jslack.api.model.ErrorResponseMetadata;
import lombok.Data;

import java.util.List;

@Data
public class AdminUsersSetRegularResponse implements SlackApiResponse {

Expand All @@ -14,11 +13,5 @@ public class AdminUsersSetRegularResponse implements SlackApiResponse {
private String needed;
private String provided;

private ResponseMetadata responseMetadata;

@Data
public static class ResponseMetadata {
private List<String> messages;
}

private ErrorResponseMetadata responseMetadata;
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
package com.github.seratch.jslack.api.methods.response.chat;

import com.github.seratch.jslack.api.methods.SlackApiResponse;
import com.github.seratch.jslack.api.model.ErrorResponseMetadata;
import com.github.seratch.jslack.api.model.Message;
import lombok.Data;

import java.util.List;

@Data
public class ChatPostMessageResponse implements SlackApiResponse {

Expand All @@ -15,12 +14,7 @@ public class ChatPostMessageResponse implements SlackApiResponse {
private String needed;
private String provided;

private ResponseMetadata responseMetadata;

@Data
public static class ResponseMetadata {
private List<String> messages;
}
private ErrorResponseMetadata responseMetadata;

private String channel;
private String ts;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
package com.github.seratch.jslack.api.methods.response.pins;

import com.github.seratch.jslack.api.methods.SlackApiResponse;
import com.github.seratch.jslack.api.model.ErrorResponseMetadata;
import lombok.Data;

import java.util.List;

@Data
public class PinsAddResponse implements SlackApiResponse {

Expand All @@ -14,11 +13,5 @@ public class PinsAddResponse implements SlackApiResponse {
private String needed;
private String provided;

private ResponseMetadata responseMetadata;

@Data
public static class ResponseMetadata {
private List<String> messages;
}

private ErrorResponseMetadata responseMetadata;
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
package com.github.seratch.jslack.api.methods.response.views;

import com.github.seratch.jslack.api.methods.SlackApiResponse;
import com.github.seratch.jslack.api.model.ErrorResponseMetadata;
import com.github.seratch.jslack.api.model.view.View;
import lombok.Data;

import java.util.List;

@Data
public class ViewsOpenResponse implements SlackApiResponse {

Expand All @@ -17,10 +16,5 @@ public class ViewsOpenResponse implements SlackApiResponse {

private View view;

private ResponseMetadata responseMetadata;

@Data
public static class ResponseMetadata {
private List<String> messages;
}
private ErrorResponseMetadata responseMetadata;
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
package com.github.seratch.jslack.api.methods.response.views;

import com.github.seratch.jslack.api.methods.SlackApiResponse;
import com.github.seratch.jslack.api.model.ErrorResponseMetadata;
import com.github.seratch.jslack.api.model.view.View;
import lombok.Data;

import java.util.List;

@Data
public class ViewsPublishResponse implements SlackApiResponse {

Expand All @@ -17,10 +16,5 @@ public class ViewsPublishResponse implements SlackApiResponse {

private View view;

private ResponseMetadata responseMetadata;

@Data
public static class ResponseMetadata {
private List<String> messages;
}
private ErrorResponseMetadata responseMetadata;
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
package com.github.seratch.jslack.api.methods.response.views;

import com.github.seratch.jslack.api.methods.SlackApiResponse;
import com.github.seratch.jslack.api.model.ErrorResponseMetadata;
import com.github.seratch.jslack.api.model.view.View;
import lombok.Data;

import java.util.List;

@Data
public class ViewsPushResponse implements SlackApiResponse {

Expand All @@ -17,10 +16,5 @@ public class ViewsPushResponse implements SlackApiResponse {

private View view;

private ResponseMetadata responseMetadata;

@Data
public static class ResponseMetadata {
private List<String> messages;
}
private ErrorResponseMetadata responseMetadata;
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
package com.github.seratch.jslack.api.methods.response.views;

import com.github.seratch.jslack.api.methods.SlackApiResponse;
import com.github.seratch.jslack.api.model.ErrorResponseMetadata;
import com.github.seratch.jslack.api.model.view.View;
import lombok.Data;

import java.util.List;

@Data
public class ViewsUpdateResponse implements SlackApiResponse {

Expand All @@ -17,10 +16,5 @@ public class ViewsUpdateResponse implements SlackApiResponse {

private View view;

private ResponseMetadata responseMetadata;

@Data
public static class ResponseMetadata {
private List<String> messages;
}
private ErrorResponseMetadata responseMetadata;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package com.github.seratch.jslack.api.model;

import lombok.Data;

import java.util.List;

@Data
public class ErrorResponseMetadata {

private List<String> messages;
}

0 comments on commit 9242528

Please sign in to comment.