-
Notifications
You must be signed in to change notification settings - Fork 22
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 #26 from evanwong/release/0.4.0
Release/0.4.0
- Loading branch information
Showing
18 changed files
with
403 additions
and
28 deletions.
There are no files selected for viewing
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
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
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
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
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
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
40 changes: 40 additions & 0 deletions
40
src/main/java/io/evanwong/oss/hipchat/v2/rooms/SetTopicRequest.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,40 @@ | ||
package io.evanwong.oss.hipchat.v2.rooms; | ||
|
||
import io.evanwong.oss.hipchat.v2.commons.NoContent; | ||
import io.evanwong.oss.hipchat.v2.commons.PutRequest; | ||
import org.apache.http.client.HttpClient; | ||
|
||
import java.util.Collections; | ||
import java.util.Map; | ||
import java.util.concurrent.ExecutorService; | ||
|
||
public class SetTopicRequest extends PutRequest<NoContent> { | ||
|
||
private String roomIdOrName; | ||
private String topic; | ||
|
||
public SetTopicRequest(String idOrName, String topic, String accessToken, HttpClient httpClient, ExecutorService executorService) { | ||
super(accessToken, httpClient, executorService); | ||
this.roomIdOrName = idOrName; | ||
this.topic = topic; | ||
} | ||
|
||
public String getRoomIdOrName() { | ||
return roomIdOrName; | ||
} | ||
|
||
public String getTopic() { | ||
return topic; | ||
} | ||
|
||
@Override | ||
protected String getPath() { | ||
return "/room/" + this.roomIdOrName + "/topic"; | ||
} | ||
|
||
@Override | ||
protected Map<String, Object> toQueryMap() { | ||
return Collections.singletonMap("topic", this.topic); | ||
} | ||
|
||
} |
29 changes: 29 additions & 0 deletions
29
src/main/java/io/evanwong/oss/hipchat/v2/rooms/SetTopicRequestBuilder.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,29 @@ | ||
package io.evanwong.oss.hipchat.v2.rooms; | ||
|
||
import io.evanwong.oss.hipchat.v2.commons.RequestBuilder; | ||
import org.apache.http.client.HttpClient; | ||
|
||
import java.util.concurrent.ExecutorService; | ||
|
||
public class SetTopicRequestBuilder extends RequestBuilder<SetTopicRequest> { | ||
|
||
private String roomIdOrName; | ||
private String topic; | ||
|
||
public SetTopicRequestBuilder(String idOrName, String topic, String accessToken, HttpClient httpClient, ExecutorService executorService) { | ||
super(accessToken, httpClient, executorService); | ||
this.roomIdOrName = idOrName; | ||
this.topic = topic; | ||
} | ||
|
||
@Override | ||
public SetTopicRequest build() { | ||
if (topic == null) { | ||
throw new IllegalArgumentException("topic is required."); | ||
} | ||
if (roomIdOrName == null) { | ||
throw new IllegalArgumentException("idOrName is required."); | ||
} | ||
return new SetTopicRequest(roomIdOrName, topic, accessToken, httpClient, executorService); | ||
} | ||
} |
Oops, something went wrong.