Skip to content

Commit 5b0d876

Browse files
authored
Add domain to team.info API parameters (#958)
1 parent 71bd169 commit 5b0d876

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

slack-api-client/src/main/java/com/slack/api/methods/RequestFormBuilder.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2177,6 +2177,7 @@ public static FormBody.Builder toForm(TeamBillableInfoRequest req) {
21772177
public static FormBody.Builder toForm(TeamInfoRequest req) {
21782178
FormBody.Builder form = new FormBody.Builder();
21792179
setIfNotNull("team", req.getTeam(), form);
2180+
setIfNotNull("domain", req.getDomain(), form);
21802181
return form;
21812182
}
21822183

slack-api-client/src/main/java/com/slack/api/methods/request/team/TeamInfoRequest.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,9 @@ public class TeamInfoRequest implements SlackApiRequest {
2121
*/
2222
private String team;
2323

24+
/**
25+
* Query by domain instead of team (only when team is null). This only works for domains in the same enterprise as the querying team token. This also expects the domain to belong to a team and not the enterprise itself.
26+
*/
27+
private String domain;
28+
2429
}

slack-api-client/src/test/java/test_with_remote_apis/methods/team_Test.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package test_with_remote_apis.methods;
22

33
import com.slack.api.Slack;
4+
import com.slack.api.methods.MethodsClient;
45
import com.slack.api.methods.request.team.TeamBillingInfoRequest;
56
import com.slack.api.methods.response.team.*;
67
import com.slack.api.methods.response.team.profile.TeamProfileGetResponse;
@@ -106,6 +107,18 @@ public void teamInfo() throws Exception {
106107
assertThat(response.isOk(), is(true));
107108
}
108109

110+
@Test
111+
public void teamInfo_EnterpriseGrid() throws Exception {
112+
MethodsClient client = slack.methods(gridWorkspaceUserToken);
113+
TeamInfoResponse response = client.teamInfo(r -> r);
114+
assertThat(response.getError(), is(nullValue()));
115+
116+
TeamInfoResponse domainResponse = client.teamInfo(r -> r
117+
.domain(response.getTeam().getDomain())
118+
);
119+
assertThat(domainResponse.getError(), is(nullValue()));
120+
}
121+
109122
@Test
110123
public void teamInfo_Grid_Workspace() throws Exception {
111124
if (gridWorkspaceUserToken != null) {

0 commit comments

Comments
 (0)