-
Notifications
You must be signed in to change notification settings - Fork 399
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 #154 from dvkolesnikov/feature/invite_by_phone_num
Implement invitation by phone number
- Loading branch information
Showing
5 changed files
with
144 additions
and
3 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
Houseclub/src/main/java/me/grishka/houseclub/api/methods/InviteToApp.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,25 @@ | ||
package me.grishka.houseclub.api.methods; | ||
|
||
import me.grishka.houseclub.api.BaseResponse; | ||
import me.grishka.houseclub.api.ClubhouseAPIRequest; | ||
|
||
public class InviteToApp extends ClubhouseAPIRequest<BaseResponse> { | ||
|
||
public InviteToApp(String name, String phone_number, String message) { | ||
super("POST", "invite_to_app", BaseResponse.class); | ||
requestBody = new InviteToApp.Body(name, phone_number, message); | ||
} | ||
|
||
private static class Body { | ||
public String name; | ||
public String phone_number; | ||
public String message; | ||
|
||
public Body(String name, String phone_number, String message) { | ||
this.name = name; | ||
this.phone_number = phone_number; | ||
this.message = message; | ||
} | ||
} | ||
|
||
} |
28 changes: 28 additions & 0 deletions
28
Houseclub/src/main/java/me/grishka/houseclub/api/methods/Me.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,28 @@ | ||
package me.grishka.houseclub.api.methods; | ||
|
||
import java.util.TimeZone; | ||
|
||
import me.grishka.houseclub.api.ClubhouseAPIRequest; | ||
|
||
public class Me extends ClubhouseAPIRequest<Me.Response> { | ||
public Me() { | ||
super("POST", "me", Response.class); | ||
requestBody = new Body(); | ||
} | ||
|
||
private static class Body { | ||
public boolean return_blocked_ids; | ||
public String timezone_identifier; | ||
public boolean return_following_ids; | ||
|
||
public Body() { | ||
this.return_blocked_ids = true; | ||
this.return_following_ids = true; | ||
this.timezone_identifier = TimeZone.getDefault().getDisplayName(); | ||
} | ||
} | ||
|
||
public static class Response { | ||
public int num_invites; | ||
} | ||
} |
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
7f7879b
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.
OK