Skip to content
This repository has been archived by the owner on Apr 11, 2021. It is now read-only.

Release v0.3.0 #26

Merged
merged 28 commits into from
Nov 29, 2018
Merged

Release v0.3.0 #26

merged 28 commits into from
Nov 29, 2018

Conversation

stachu540
Copy link
Collaborator

No description provided.

Damian Staszewski added 28 commits November 22, 2018 02:26
…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();
Copy link

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();
Copy link

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()
Copy link

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();
Copy link

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();
Copy link

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.

@codeclimate
Copy link

codeclimate bot commented Nov 29, 2018

Code Climate has analyzed commit b65befb and detected 32 issues on this pull request.

Here's the issue category breakdown:

Category Count
Complexity 10
Duplication 15
Clarity 7

Note: there are 7 critical issues.

View more on Code Climate.

@stachu540 stachu540 self-assigned this Nov 29, 2018
@stachu540 stachu540 added the feature: kraken New feature or request label Nov 29, 2018
@stachu540 stachu540 added this to the v1 milestone Nov 29, 2018
@stachu540 stachu540 merged commit 7e09934 into master Nov 29, 2018
@stachu540 stachu540 removed this from the v1.0.0 milestone Jul 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature: kraken New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant