4
4
import com .github .instagram4j .instagram4j .models .user .Profile ;
5
5
import com .github .instagram4j .instagram4j .models .user .User ;
6
6
import com .github .instagram4j .instagram4j .requests .direct .DirectThreadsBroadcastRequest ;
7
+ import com .github .instagram4j .instagram4j .requests .feed .FeedUserStoryRequest ;
7
8
import com .github .instagram4j .instagram4j .requests .friendships .FriendshipsActionRequest ;
8
9
import com .github .instagram4j .instagram4j .requests .friendships .FriendshipsPendingRequest ;
9
10
import com .github .instagram4j .instagram4j .responses .IGResponse ;
10
11
import com .github .instagram4j .instagram4j .responses .accounts .LoginResponse ;
12
+ import com .github .instagram4j .instagram4j .responses .feed .FeedUserStoryResponse ;
11
13
import com .github .instagram4j .instagram4j .responses .feed .FeedUsersResponse ;
12
14
import com .github .instagram4j .instagram4j .responses .media .MediaResponse ;
13
15
import com .github .instagram4j .instagram4j .utils .IGChallengeUtils ;
@@ -256,7 +258,7 @@ public Task<String> removeFollower(@NotNull String username) {
256
258
* @param caption Caption for the post
257
259
* @return A {@link Task} holding response of the request.
258
260
*/
259
- public Task <String > postPhoto (@ NotNull File photo , @ Nullable String caption ) {
261
+ public Task <String > postPhoto (@ NotNull File photo , String caption ) {
260
262
if (photo .getName ().endsWith (".mp4" ))
261
263
throw new InstagramException ("Uploading or sending video is not currently supported" ,Reasons .UNSUPPORTED_FILE_FORMAT );
262
264
@@ -405,7 +407,7 @@ public Void apply(Throwable throwable) {
405
407
* @param username The username of the account.
406
408
* @return A {@link Task} holding bio of the user.
407
409
*/
408
- public @ Nullable Task <String > getBio (@ NotNull String username ) {
410
+ public Task <String > getBio (@ NotNull String username ) {
409
411
Object object = utils .getProfileMetadata (client .actions ().users ().findByUsername (username ),"bio" );
410
412
Task <String > task = new Task <>();
411
413
@@ -421,10 +423,9 @@ public Void apply(Throwable throwable) {
421
423
/**
422
424
* Gets the profile photo link of the account associated with the username provided.
423
425
* @param username The username of the account.
424
- * @param callback Callback that shows the success or failure of the request. This is optional (Nullable)
425
426
* @return A {@link Task} holding profile picture of the user.
426
427
*/
427
- public @ Nullable Task <String > getProfilePicUrl (@ NotNull String username ) {
428
+ public Task <String > getProfilePicUrl (@ NotNull String username ) {
428
429
Object object = utils .getProfileMetadata (client .actions ().users ().findByUsername (username ),"dp" );
429
430
Task <String > task = new Task <>();
430
431
@@ -476,7 +477,7 @@ public Task<Integer> getFollowingsCount(@NotNull String username) {
476
477
/**
477
478
* Gets the post count of the account associated with the username provided.
478
479
* @param username The username of the account.
479
- * @param callback Callback that shows the success or failure of the request. This is optional (Nullable)
480
+
480
481
* @return A {@link Task} holding number of posts of the user.
481
482
*/
482
483
public Task <Integer > getPostCount (@ NotNull String username ) {
@@ -490,9 +491,3 @@ public Task<Integer> getPostCount(@NotNull String username) {
490
491
491
492
return task ;
492
493
}
493
-
494
- public static void main (String [] args ) {
495
- Instagram instagram = null ;
496
- instagram .getProfilePicUrl ("username" ,);
497
- }
498
- }
0 commit comments