#Qiita4j Qiita API の Java ラッパーライブラリです。
QiitaClient client = new QiitaClient();
TokenInfo tokenInfo = client.authorize(new AuthRequest(<ユーザー名>, <パスワード>));
System.out.println(tokenInfo.getToken());
QiitaClient client = new QiitaClient(<トークン>);
または
QiitaClient client = new QiitaClient();
client.setToken(<トークン>);
QiitaClient のメソッドを使用して実行します。
RateLimit rateLimit = client.getRateLimit();
UserInfo ownInfo = client.getOwnInfo();
UserInfo userInfo = client.getUserInfo(<ユーザー名>);
PageableResponse<ItemInfo> userItemsPage = client.getUserItems(<ユーザー名>);
ItemInfo[] userItems = userItemsPage.getContents();
PageableResponse<ItemInfo> userStockItemsPage = client.getUserStocks(<ユーザー名>);
ItemInfo[] userStockItems = userStockItemsPage.getContents();
PageableResponse<User> followingUsersPage = client.getFollowingUsers(<ユーザー名>);
User[] followingUsers = followingUsersPage.getContents();
PageableResponse<TagInfo> followingTagsPage = client.getFollowingTags(<ユーザー名>);
TagInfo[] followingTags = followingTagsPage.getContents();
PageableResponse<ItemInfo> tagItemsPage = client.getTagItems(<タグ名>);
ItemInfo[] tagItems = tagItemsPage.getContents();
PageableResponse<TagInfo> tagsPage = client.getTags();
TagInfo[] tags = tagsPage.getContents();
PageableResponse<ItemInfo> searchResultItemsPage = client.searchItems(new SearchRequest(<検索文字列(複数指定可)>));
ItemInfo[] searchResultItems = searchResultItemsPage.getContents();
PageableResponse<ItemInfo> newItemsPage = client.getNewItems();
ItemInfo[] newItems = newItemsPage.getContents();
PageableResponse<ItemInfo> ownStockItemsPage = client.getOwnStocks();
ItemInfo[] ownStockItems = ownStockItemsPage.getContents();
ItemRequest createItem = new ItemRequest();
ItemInfo createResult = client.createItem(createItem);
ItemRequest updateItem = new ItemRequest();
ItemInfo updateResult = client.updateItem(<UUID>, updateItem);
client.deleteItem(<UUID>);
ItemDetail detail = client.getSpecificItem(<UUID>);
client.stockItem(<UUID>);
client.unstockItem(<UUID>);
client.setPerPage(50);
PageableResponse<ItemInfo> userItemsPage = client.getUserItems(<ユーザー名>);
PageableResponse<ItemInfo> firstPage = userItemsPage.getFirst();
ItemInfo[] firstItems = firstPage.getContents();
PageableResponse<ItemInfo> prevPage = userItemsPage.getPrev();
ItemInfo[] prevItems = prevPage.getContents();
PageableResponse<ItemInfo> nextPage = userItemsPage.getNext();
ItemInfo[] nextItems = nextPage.getContents();
PageableResponse<ItemInfo> lastPage = userItemsPage.getLast();
ItemInfo[] lastItems = lastPage.getContents();
<repositories>
<repository>
<id>com.zaneli</id>
<name>Zaneli Repository</name>
<url>http://www.zaneli.com/repositories/snapshots/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.zaneli</groupId>
<artifactId>qiita4j</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
</dependencies>