Skip to content

Commit 7d4fac7

Browse files
committed
fix: stricter typing for list schemas
1 parent cec73db commit 7d4fac7

16 files changed

+352
-323
lines changed

slack-api-client/src/main/java/com/slack/api/methods/impl/MethodsClientImpl.java

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -3209,42 +3209,6 @@ public SearchFilesResponse searchFiles(RequestConfigurator<SearchFilesRequest.Se
32093209
return searchFiles(req.configure(SearchFilesRequest.builder()).build());
32103210
}
32113211

3212-
@Override
3213-
@Deprecated // https://docs.slack.dev/changelog/2023-07-its-later-already-for-stars-and-reminders
3214-
public StarsAddResponse starsAdd(StarsAddRequest req) throws IOException, SlackApiException {
3215-
return postFormWithTokenAndParseResponse(toForm(req), Methods.STARS_ADD, getToken(req), StarsAddResponse.class);
3216-
}
3217-
3218-
@Override
3219-
@Deprecated // https://docs.slack.dev/changelog/2023-07-its-later-already-for-stars-and-reminders
3220-
public StarsAddResponse starsAdd(RequestConfigurator<StarsAddRequest.StarsAddRequestBuilder> req) throws IOException, SlackApiException {
3221-
return starsAdd(req.configure(StarsAddRequest.builder()).build());
3222-
}
3223-
3224-
@Override
3225-
@Deprecated // https://docs.slack.dev/changelog/2023-07-its-later-already-for-stars-and-reminders
3226-
public StarsListResponse starsList(StarsListRequest req) throws IOException, SlackApiException {
3227-
return postFormWithTokenAndParseResponse(toForm(req), Methods.STARS_LIST, getToken(req), StarsListResponse.class);
3228-
}
3229-
3230-
@Override
3231-
@Deprecated // https://docs.slack.dev/changelog/2023-07-its-later-already-for-stars-and-reminders
3232-
public StarsListResponse starsList(RequestConfigurator<StarsListRequest.StarsListRequestBuilder> req) throws IOException, SlackApiException {
3233-
return starsList(req.configure(StarsListRequest.builder()).build());
3234-
}
3235-
3236-
@Override
3237-
@Deprecated // https://docs.slack.dev/changelog/2023-07-its-later-already-for-stars-and-reminders
3238-
public StarsRemoveResponse starsRemove(StarsRemoveRequest req) throws IOException, SlackApiException {
3239-
return postFormWithTokenAndParseResponse(toForm(req), Methods.STARS_REMOVE, getToken(req), StarsRemoveResponse.class);
3240-
}
3241-
3242-
@Override
3243-
@Deprecated // https://docs.slack.dev/changelog/2023-07-its-later-already-for-stars-and-reminders
3244-
public StarsRemoveResponse starsRemove(RequestConfigurator<StarsRemoveRequest.StarsRemoveRequestBuilder> req) throws IOException, SlackApiException {
3245-
return starsRemove(req.configure(StarsRemoveRequest.builder()).build());
3246-
}
3247-
32483212
@Override
32493213
public SlackListsAccessDeleteResponse slackListsAccessDelete(SlackListsAccessDeleteRequest req) throws IOException, SlackApiException {
32503214
return postFormWithTokenAndParseResponse(toForm(req), Methods.SLACKLISTS_ACCESS_DELETE, getToken(req), SlackListsAccessDeleteResponse.class);
@@ -3365,6 +3329,42 @@ public SlackListsUpdateResponse slackListsUpdate(RequestConfigurator<SlackListsU
33653329
return slackListsUpdate(req.configure(SlackListsUpdateRequest.builder()).build());
33663330
}
33673331

3332+
@Override
3333+
@Deprecated // https://docs.slack.dev/changelog/2023-07-its-later-already-for-stars-and-reminders
3334+
public StarsAddResponse starsAdd(StarsAddRequest req) throws IOException, SlackApiException {
3335+
return postFormWithTokenAndParseResponse(toForm(req), Methods.STARS_ADD, getToken(req), StarsAddResponse.class);
3336+
}
3337+
3338+
@Override
3339+
@Deprecated // https://docs.slack.dev/changelog/2023-07-its-later-already-for-stars-and-reminders
3340+
public StarsAddResponse starsAdd(RequestConfigurator<StarsAddRequest.StarsAddRequestBuilder> req) throws IOException, SlackApiException {
3341+
return starsAdd(req.configure(StarsAddRequest.builder()).build());
3342+
}
3343+
3344+
@Override
3345+
@Deprecated // https://docs.slack.dev/changelog/2023-07-its-later-already-for-stars-and-reminders
3346+
public StarsListResponse starsList(StarsListRequest req) throws IOException, SlackApiException {
3347+
return postFormWithTokenAndParseResponse(toForm(req), Methods.STARS_LIST, getToken(req), StarsListResponse.class);
3348+
}
3349+
3350+
@Override
3351+
@Deprecated // https://docs.slack.dev/changelog/2023-07-its-later-already-for-stars-and-reminders
3352+
public StarsListResponse starsList(RequestConfigurator<StarsListRequest.StarsListRequestBuilder> req) throws IOException, SlackApiException {
3353+
return starsList(req.configure(StarsListRequest.builder()).build());
3354+
}
3355+
3356+
@Override
3357+
@Deprecated // https://docs.slack.dev/changelog/2023-07-its-later-already-for-stars-and-reminders
3358+
public StarsRemoveResponse starsRemove(StarsRemoveRequest req) throws IOException, SlackApiException {
3359+
return postFormWithTokenAndParseResponse(toForm(req), Methods.STARS_REMOVE, getToken(req), StarsRemoveResponse.class);
3360+
}
3361+
3362+
@Override
3363+
@Deprecated // https://docs.slack.dev/changelog/2023-07-its-later-already-for-stars-and-reminders
3364+
public StarsRemoveResponse starsRemove(RequestConfigurator<StarsRemoveRequest.StarsRemoveRequestBuilder> req) throws IOException, SlackApiException {
3365+
return starsRemove(req.configure(StarsRemoveRequest.builder()).build());
3366+
}
3367+
33683368
@Override
33693369
public TeamAccessLogsResponse teamAccessLogs(TeamAccessLogsRequest req) throws IOException, SlackApiException {
33703370
this.teamId.ifPresent(currentTeamId -> {

slack-api-client/src/main/java/com/slack/api/methods/request/slack_lists/SlackListsAccessDeleteRequest.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package com.slack.api.methods.request.slack_lists;
22

3-
import com.google.gson.annotations.SerializedName;
43
import com.slack.api.methods.SlackApiRequest;
54
import java.util.List;
65
import lombok.Builder;
@@ -21,19 +20,16 @@ public class SlackListsAccessDeleteRequest implements SlackApiRequest {
2120
/**
2221
* Encoded ID of the List.
2322
*/
24-
@SerializedName("list_id")
2523
private String listId;
2624

2725
/**
2826
* List of channels you wish to update access for. Can only be used if user_ids is not provided. (Optional)
2927
*/
30-
@SerializedName("channel_ids")
3128
private List<String> channelIds;
3229

3330
/**
3431
* List of users you wish to update access for. Can only be used if channel_ids is not provided. (Optional)
3532
*/
36-
@SerializedName("user_ids")
3733
private List<String> userIds;
3834
}
3935

slack-api-client/src/main/java/com/slack/api/methods/request/slack_lists/SlackListsAccessSetRequest.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package com.slack.api.methods.request.slack_lists;
22

3-
import com.google.gson.annotations.SerializedName;
43
import com.slack.api.methods.SlackApiRequest;
54
import java.util.List;
65
import lombok.Builder;
@@ -21,25 +20,21 @@ public class SlackListsAccessSetRequest implements SlackApiRequest {
2120
/**
2221
* Encoded ID of the List.
2322
*/
24-
@SerializedName("list_id")
2523
private String listId;
2624

2725
/**
2826
* Desired level of access.
2927
*/
30-
@SerializedName("access_level")
3128
private String accessLevel;
3229

3330
/**
3431
* List of channels you wish to update access for. Can only be used if user_ids is not provided. (Optional)
3532
*/
36-
@SerializedName("channel_ids")
3733
private List<String> channelIds;
3834

3935
/**
4036
* List of users you wish to update access for. Can only be used if channel_ids is not provided. (Optional)
4137
*/
42-
@SerializedName("user_ids")
4338
private List<String> userIds;
4439
}
4540

slack-api-client/src/main/java/com/slack/api/methods/request/slack_lists/SlackListsCreateRequest.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import com.google.gson.annotations.SerializedName;
44
import com.slack.api.methods.SlackApiRequest;
55
import com.slack.api.model.block.RichTextBlock;
6+
import com.slack.api.model.list.ListColumn;
67

78
import java.util.List;
89
import java.util.Map;
@@ -30,13 +31,12 @@ public class SlackListsCreateRequest implements SlackApiRequest {
3031
/**
3132
* A rich text description of the List. (Optional)
3233
*/
33-
@SerializedName("description_blocks")
3434
private List<RichTextBlock> descriptionBlocks;
3535

3636
/**
3737
* Column definition for the List. (Optional)
3838
*/
39-
private List<Map<String, Object>> schema;
39+
private List<ListColumn> schema;
4040

4141
/**
4242
* ID of the List to copy. (Optional)
@@ -53,6 +53,5 @@ public class SlackListsCreateRequest implements SlackApiRequest {
5353
/**
5454
* Boolean indicating whether the List should be used to track todo tasks. (Optional)
5555
*/
56-
@SerializedName("todo_mode")
5756
private Boolean todoMode;
5857
}

slack-api-client/src/main/java/com/slack/api/methods/request/slack_lists/SlackListsDownloadGetRequest.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package com.slack.api.methods.request.slack_lists;
22

3-
import com.google.gson.annotations.SerializedName;
43
import com.slack.api.methods.SlackApiRequest;
54
import lombok.Builder;
65
import lombok.Data;
@@ -20,12 +19,10 @@ public class SlackListsDownloadGetRequest implements SlackApiRequest {
2019
/**
2120
* ID of the List to export.
2221
*/
23-
@SerializedName("list_id")
2422
private String listId;
2523

2624
/**
2725
* The ID of the recently started job to export the List.
2826
*/
29-
@SerializedName("job_id")
3027
private String jobId;
3128
}

slack-api-client/src/main/java/com/slack/api/methods/request/slack_lists/SlackListsDownloadStartRequest.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package com.slack.api.methods.request.slack_lists;
22

3-
import com.google.gson.annotations.SerializedName;
43
import com.slack.api.methods.SlackApiRequest;
54
import lombok.Builder;
65
import lombok.Data;
@@ -20,12 +19,10 @@ public class SlackListsDownloadStartRequest implements SlackApiRequest {
2019
/**
2120
* ID of the List to export.
2221
*/
23-
@SerializedName("list_id")
2422
private String listId;
2523

2624
/**
2725
* Include archived rows. (Optional)
2826
*/
29-
@SerializedName("include_archived")
3027
private Boolean includeArchived;
3128
}

slack-api-client/src/main/java/com/slack/api/methods/request/slack_lists/SlackListsItemsCreateRequest.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
import com.google.gson.annotations.SerializedName;
44
import com.slack.api.methods.SlackApiRequest;
5+
import com.slack.api.model.list.ListRecord;
56

67
import java.util.List;
7-
import java.util.Map;
88

99
import lombok.Builder;
1010
import lombok.Data;
@@ -24,7 +24,6 @@ public class SlackListsItemsCreateRequest implements SlackApiRequest {
2424
/**
2525
* ID of the List containing the items.
2626
*/
27-
@SerializedName("list_id")
2827
private String listId;
2928

3029
/**
@@ -42,6 +41,5 @@ public class SlackListsItemsCreateRequest implements SlackApiRequest {
4241
/**
4342
* Initial item data. (Optional)
4443
*/
45-
@SerializedName("initial_fields")
46-
private List<Map<String, Object>> initialFields;
44+
private List<ListRecord.Field> initialFields;
4745
}

slack-api-client/src/main/java/com/slack/api/methods/request/slack_lists/SlackListsItemsDeleteMultipleRequest.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package com.slack.api.methods.request.slack_lists;
22

3-
import com.google.gson.annotations.SerializedName;
43
import com.slack.api.methods.SlackApiRequest;
54
import java.util.List;
65
import lombok.Builder;
@@ -21,7 +20,6 @@ public class SlackListsItemsDeleteMultipleRequest implements SlackApiRequest {
2120
/**
2221
* ID of the List containing the items.
2322
*/
24-
@SerializedName("list_id")
2523
private String listId;
2624

2725
/**

slack-api-client/src/main/java/com/slack/api/methods/request/slack_lists/SlackListsItemsDeleteRequest.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package com.slack.api.methods.request.slack_lists;
22

3-
import com.google.gson.annotations.SerializedName;
43
import com.slack.api.methods.SlackApiRequest;
54
import lombok.Builder;
65
import lombok.Data;
@@ -20,7 +19,6 @@ public class SlackListsItemsDeleteRequest implements SlackApiRequest {
2019
/**
2120
* ID of the List containing the items.
2221
*/
23-
@SerializedName("list_id")
2422
private String listId;
2523

2624
/**

slack-api-client/src/main/java/com/slack/api/methods/request/slack_lists/SlackListsItemsInfoRequest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ public class SlackListsItemsInfoRequest implements SlackApiRequest {
2020
/**
2121
* ID of the List containing the items.
2222
*/
23-
@SerializedName("list_id")
2423
private String listId;
2524

2625
/**
@@ -31,7 +30,7 @@ public class SlackListsItemsInfoRequest implements SlackApiRequest {
3130
/**
3231
* Set to true to include is_subscribed data for the returned List row. (Optional)
3332
*/
34-
@SerializedName("include_is_subscribed")
33+
//@SerializedName("include_is_subscribed")
3534
@Builder.Default
3635
private Boolean includeIsSubscribed = false;
3736
}

0 commit comments

Comments
 (0)