-
Notifications
You must be signed in to change notification settings - Fork 3
Release v0.3.0 #26
Release v0.3.0 #26
Conversation
…ients now we can use build() - with possibly throws or buildAsync() - which returns Mono response
- adding missing javadoc in #checkRequiredScope() - adding #handleScopeMissng() to handling ScopeIsMissingException after scopes checks - docing #handleScopeMissng() aswell
- adds CursorList for cursors - size will get default from #getData().size();
- Gradle -> 5.0 - net.ltgt.apt -> 0.19 - reactor-bom -> Californium-SR3 - okhttp3 -> 3.12.0 - guava -> 27.0.1-jre - removed `enableFeaturePreview('STABLE_PUBLISHING')`
- request body is now a Builders - EmoteSets now is a list of Emote
|
||
public class VideoService extends AbstractHttpService { | ||
public VideoService(GlitchKraken rest) { | ||
super(rest.getClient(), rest.getHttpClient()); | ||
} | ||
|
||
public Mono<Video> getVideo(Long id) { | ||
return exchange(get(String.format("/videos/%s", id), Video.class)).toMono(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Define a constant instead of duplicating this literal "/videos/%s" 3 times.
public Mono<AuthorizedUser> getUsers(Credential credential) { | ||
return Mono.just(checkRequiredScope(credential.getScopes(), Scope.USER_READ)).flatMap(b -> { | ||
if (b) { | ||
return exchange(get("/user", AuthorizedUser.class).header("Authorization", "OAuth " + credential.getAccessToken())).toMono(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Define a constant instead of duplicating this literal "Authorization" 5 times.
} | ||
|
||
public Mono<ChannelFollow> getFollow(User user, Channel channel) { | ||
return exchange(get(String.format("/users/%s/follows/channels/%s", user.getId(), channel.getId()), ChannelFollow.class)).toMono() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Define a constant instead of duplicating this literal "/users/%s/follows/channels/%s" 3 times.
public Mono<AuthorizedUser> getUsers(Credential credential) { | ||
return Mono.just(checkRequiredScope(credential.getScopes(), Scope.USER_READ)).flatMap(b -> { | ||
if (b) { | ||
return exchange(get("/user", AuthorizedUser.class).header("Authorization", "OAuth " + credential.getAccessToken())).toMono(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Define a constant instead of duplicating this literal "OAuth " 5 times.
return Mono.just(checkRequiredScope(credential.getScopes(), Scope.CHANNEL_READ)).flatMap(b -> { | ||
if (b) { | ||
return exchange(get("/channel", AuthorizedChannel.class) | ||
.header("Authorization", "OAuth " + credential.getAccessToken())).toMono(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Define a constant instead of duplicating this literal "Authorization" 7 times.
Code Climate has analyzed commit b65befb and detected 32 issues on this pull request. Here's the issue category breakdown:
Note: there are 7 critical issues. View more on Code Climate. |
No description provided.