| 1 | package edu.ucsb.cs156.frontiers.models; | |
| 2 | ||
| 3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | |
| 4 | import com.fasterxml.jackson.annotation.JsonProperty; | |
| 5 | import java.util.List; | |
| 6 | import lombok.AllArgsConstructor; | |
| 7 | import lombok.Builder; | |
| 8 | import lombok.Data; | |
| 9 | import lombok.NoArgsConstructor; | |
| 10 | ||
| 11 | /** | |
| 12 | * One page of the response from the Slack <code>users.list</code> method. | |
| 13 | * | |
| 14 | * @see <a href="https://docs.slack.dev/reference/methods/users.list">users.list</a> | |
| 15 | */ | |
| 16 | @Data | |
| 17 | @AllArgsConstructor | |
| 18 | @NoArgsConstructor | |
| 19 | @Builder | |
| 20 | @JsonIgnoreProperties(ignoreUnknown = true) | |
| 21 | public class SlackUsersListResponse { | |
| 22 | private boolean ok; | |
| 23 | private String error; | |
| 24 | private List<SlackUser> members; | |
| 25 | ||
| 26 | @JsonProperty("response_metadata") | |
| 27 | private ResponseMetadata responseMetadata; | |
| 28 | ||
| 29 | @Data | |
| 30 | @AllArgsConstructor | |
| 31 | @NoArgsConstructor | |
| 32 | @Builder | |
| 33 | @JsonIgnoreProperties(ignoreUnknown = true) | |
| 34 | public static class ResponseMetadata { | |
| 35 | @JsonProperty("next_cursor") | |
| 36 | private String nextCursor; | |
| 37 | } | |
| 38 | ||
| 39 | /** | |
| 40 | * @return the cursor for the next page, or an empty string if this is the last page | |
| 41 | */ | |
| 42 | public String nextCursor() { | |
| 43 |
2
1. nextCursor : negated conditional → KILLED 2. nextCursor : negated conditional → KILLED |
if (responseMetadata == null || responseMetadata.getNextCursor() == null) { |
| 44 | return ""; | |
| 45 | } | |
| 46 |
1
1. nextCursor : replaced return value with "" for edu/ucsb/cs156/frontiers/models/SlackUsersListResponse::nextCursor → KILLED |
return responseMetadata.getNextCursor(); |
| 47 | } | |
| 48 | } | |
Mutations | ||
| 43 |
1.1 2.2 |
|
| 46 |
1.1 |