-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #251 from HubSpot/add_method_for_conversation_kick…
…_api Add method for conversation kick api.
- Loading branch information
Showing
8 changed files
with
96 additions
and
0 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
.../java/com/hubspot/slack/client/methods/params/conversations/ConversationKickParamsIF.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.hubspot.slack.client.methods.params.conversations; | ||
|
||
import org.immutables.value.Value; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import com.hubspot.immutables.style.HubSpotStyle; | ||
import com.hubspot.slack.client.methods.interceptor.HasChannel; | ||
|
||
@Value.Immutable | ||
@HubSpotStyle | ||
public interface ConversationKickParamsIF extends HasChannel { | ||
@Override | ||
@JsonProperty("channel") | ||
String getChannelId(); | ||
|
||
@JsonProperty("user") | ||
String getUserId(); | ||
} |
11 changes: 11 additions & 0 deletions
11
...va/com/hubspot/slack/client/models/response/conversations/ConversationKickResponseIF.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package com.hubspot.slack.client.models.response.conversations; | ||
|
||
import org.immutables.value.Value; | ||
|
||
import com.hubspot.immutables.style.HubSpotStyle; | ||
import com.hubspot.slack.client.models.response.SlackResponse; | ||
|
||
@Value.Immutable | ||
@HubSpotStyle | ||
public interface ConversationKickResponseIF extends SlackResponse { | ||
} |
15 changes: 15 additions & 0 deletions
15
...pot/slack/client/methods/params/conversation/ConversationKickParamsSerializationTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package com.hubspot.slack.client.methods.params.conversation; | ||
|
||
import java.io.IOException; | ||
|
||
import org.junit.Test; | ||
|
||
import com.hubspot.slack.client.SerializationTestBase; | ||
import com.hubspot.slack.client.methods.params.conversations.ConversationKickParams; | ||
|
||
public class ConversationKickParamsSerializationTest extends SerializationTestBase { | ||
@Test | ||
public void itSerializesConversationKickParams() throws IOException { | ||
testSerialization("conversation_kick_params.json", ConversationKickParams.class); | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
...ubspot/slack/client/models/conversations/ConversationKickResponseDeserializationTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package com.hubspot.slack.client.models.conversations; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
import java.io.IOException; | ||
|
||
import org.junit.Test; | ||
|
||
import com.hubspot.slack.client.jackson.ObjectMapperUtils; | ||
import com.hubspot.slack.client.models.JsonLoader; | ||
import com.hubspot.slack.client.models.response.conversations.ConversationKickResponse; | ||
|
||
public class ConversationKickResponseDeserializationTest { | ||
@Test | ||
public void itDeserializesChatScheduledMessagesListResponse() throws IOException { | ||
ConversationKickResponse conversationKickResponse = | ||
fetchAndDeserializeConversationKickResponse("conversation_kick_response.json"); | ||
|
||
assertThat(conversationKickResponse.isOk()).isTrue(); | ||
} | ||
|
||
private ConversationKickResponse fetchAndDeserializeConversationKickResponse(String jsonFileName) throws IOException { | ||
String rawJson = JsonLoader.loadJsonFromFile(jsonFileName); | ||
return ObjectMapperUtils.mapper().readValue(rawJson, ConversationKickResponse.class); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"channel": "D0LAN2Q65", | ||
"user": "U061F7AUR" | ||
} |
6 changes: 6 additions & 0 deletions
6
slack-base/src/test/resources/conversation_kick_response.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"ok": true, | ||
"response_metadata": { | ||
"next_cursor": "" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters