Ammar Githam
4 years ago
11 changed files with 81 additions and 286 deletions
-
2app/src/main/java/awais/instagrabber/managers/InboxManager.java
-
18app/src/main/java/awais/instagrabber/managers/ThreadManager.java
-
114app/src/main/java/awais/instagrabber/repositories/requests/UploadFinishOptions.java
-
27app/src/main/java/awais/instagrabber/repositories/requests/UploadFinishOptions.kt
-
31app/src/main/java/awais/instagrabber/repositories/responses/directmessages/DirectBadgeCount.java
-
8app/src/main/java/awais/instagrabber/repositories/responses/directmessages/DirectBadgeCount.kt
-
62app/src/main/java/awais/instagrabber/repositories/responses/directmessages/DirectInbox.java
-
15app/src/main/java/awais/instagrabber/repositories/responses/directmessages/DirectInbox.kt
-
64app/src/main/java/awais/instagrabber/repositories/responses/directmessages/DirectInboxResponse.java
-
14app/src/main/java/awais/instagrabber/repositories/responses/directmessages/DirectInboxResponse.kt
-
12app/src/main/java/awais/instagrabber/webservices/MediaService.java
@ -1,114 +0,0 @@ |
|||||
package awais.instagrabber.repositories.requests; |
|
||||
|
|
||||
import com.google.common.collect.ImmutableMap; |
|
||||
|
|
||||
import java.util.List; |
|
||||
import java.util.Map; |
|
||||
|
|
||||
public class UploadFinishOptions { |
|
||||
private String uploadId; |
|
||||
private String sourceType; |
|
||||
private VideoOptions videoOptions; |
|
||||
|
|
||||
public String getUploadId() { |
|
||||
return uploadId; |
|
||||
} |
|
||||
|
|
||||
public UploadFinishOptions setUploadId(final String uploadId) { |
|
||||
this.uploadId = uploadId; |
|
||||
return this; |
|
||||
} |
|
||||
|
|
||||
public String getSourceType() { |
|
||||
return sourceType; |
|
||||
} |
|
||||
|
|
||||
public UploadFinishOptions setSourceType(final String sourceType) { |
|
||||
this.sourceType = sourceType; |
|
||||
return this; |
|
||||
} |
|
||||
|
|
||||
public VideoOptions getVideoOptions() { |
|
||||
return videoOptions; |
|
||||
} |
|
||||
|
|
||||
public UploadFinishOptions setVideoOptions(final VideoOptions videoOptions) { |
|
||||
this.videoOptions = videoOptions; |
|
||||
return this; |
|
||||
} |
|
||||
|
|
||||
public static class VideoOptions { |
|
||||
private float length; |
|
||||
private List<Clip> clips; |
|
||||
private int posterFrameIndex; |
|
||||
private boolean audioMuted; |
|
||||
|
|
||||
public float getLength() { |
|
||||
return length; |
|
||||
} |
|
||||
|
|
||||
public VideoOptions setLength(final float length) { |
|
||||
this.length = length; |
|
||||
return this; |
|
||||
} |
|
||||
|
|
||||
public List<Clip> getClips() { |
|
||||
return clips; |
|
||||
} |
|
||||
|
|
||||
public VideoOptions setClips(final List<Clip> clips) { |
|
||||
this.clips = clips; |
|
||||
return this; |
|
||||
} |
|
||||
|
|
||||
public int getPosterFrameIndex() { |
|
||||
return posterFrameIndex; |
|
||||
} |
|
||||
|
|
||||
public VideoOptions setPosterFrameIndex(final int posterFrameIndex) { |
|
||||
this.posterFrameIndex = posterFrameIndex; |
|
||||
return this; |
|
||||
} |
|
||||
|
|
||||
public boolean isAudioMuted() { |
|
||||
return audioMuted; |
|
||||
} |
|
||||
|
|
||||
public VideoOptions setAudioMuted(final boolean audioMuted) { |
|
||||
this.audioMuted = audioMuted; |
|
||||
return this; |
|
||||
} |
|
||||
|
|
||||
public Map<String, Object> getMap() { |
|
||||
return ImmutableMap.of( |
|
||||
"length", length, |
|
||||
"clips", clips, |
|
||||
"poster_frame_index", posterFrameIndex, |
|
||||
"audio_muted", audioMuted |
|
||||
); |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
public static class Clip { |
|
||||
private float length; |
|
||||
private String sourceType; |
|
||||
|
|
||||
public float getLength() { |
|
||||
return length; |
|
||||
} |
|
||||
|
|
||||
public Clip setLength(final float length) { |
|
||||
this.length = length; |
|
||||
return this; |
|
||||
} |
|
||||
|
|
||||
public String getSourceType() { |
|
||||
return sourceType; |
|
||||
} |
|
||||
|
|
||||
public Clip setSourceType(final String sourceType) { |
|
||||
this.sourceType = sourceType; |
|
||||
return this; |
|
||||
} |
|
||||
} |
|
||||
} |
|
@ -0,0 +1,27 @@ |
|||||
|
package awais.instagrabber.repositories.requests |
||||
|
|
||||
|
data class UploadFinishOptions( |
||||
|
val uploadId: String, |
||||
|
val sourceType: String, |
||||
|
val videoOptions: VideoOptions? = null |
||||
|
) |
||||
|
|
||||
|
data class VideoOptions( |
||||
|
val length: Float = 0f, |
||||
|
var clips: List<Clip> = emptyList(), |
||||
|
val posterFrameIndex: Int = 0, |
||||
|
val isAudioMuted: Boolean = false |
||||
|
) { |
||||
|
val map: Map<String, Any> |
||||
|
get() = mapOf( |
||||
|
"length" to length, |
||||
|
"clips" to clips, |
||||
|
"poster_frame_index" to posterFrameIndex, |
||||
|
"audio_muted" to isAudioMuted |
||||
|
) |
||||
|
} |
||||
|
|
||||
|
data class Clip( |
||||
|
val length: Float = 0f, |
||||
|
val sourceType: String |
||||
|
) |
@ -1,31 +0,0 @@ |
|||||
package awais.instagrabber.repositories.responses.directmessages; |
|
||||
|
|
||||
public class DirectBadgeCount { |
|
||||
private final long userId; |
|
||||
private final int badgeCount; |
|
||||
private final long badgeCountAtMs; |
|
||||
private final String status; |
|
||||
|
|
||||
public DirectBadgeCount(final long userId, final int badgeCount, final long badgeCountAtMs, final String status) { |
|
||||
this.userId = userId; |
|
||||
this.badgeCount = badgeCount; |
|
||||
this.badgeCountAtMs = badgeCountAtMs; |
|
||||
this.status = status; |
|
||||
} |
|
||||
|
|
||||
public long getUserId() { |
|
||||
return userId; |
|
||||
} |
|
||||
|
|
||||
public int getBadgeCount() { |
|
||||
return badgeCount; |
|
||||
} |
|
||||
|
|
||||
public long getBadgeCountAtMs() { |
|
||||
return badgeCountAtMs; |
|
||||
} |
|
||||
|
|
||||
public String getStatus() { |
|
||||
return status; |
|
||||
} |
|
||||
} |
|
@ -0,0 +1,8 @@ |
|||||
|
package awais.instagrabber.repositories.responses.directmessages |
||||
|
|
||||
|
data class DirectBadgeCount( |
||||
|
val userId: Long = 0, |
||||
|
val badgeCount: Int = 0, |
||||
|
val badgeCountAtMs: Long = 0, |
||||
|
val status: String? = null |
||||
|
) |
@ -1,62 +0,0 @@ |
|||||
package awais.instagrabber.repositories.responses.directmessages; |
|
||||
|
|
||||
import androidx.annotation.NonNull; |
|
||||
|
|
||||
import java.util.List; |
|
||||
|
|
||||
public class DirectInbox implements Cloneable { |
|
||||
private List<DirectThread> threads; |
|
||||
private final boolean hasOlder; |
|
||||
private final int unseenCount; |
|
||||
private final String unseenCountTs; |
|
||||
private final String oldestCursor; |
|
||||
private final boolean blendedInboxEnabled; |
|
||||
|
|
||||
public DirectInbox(final List<DirectThread> threads, |
|
||||
final boolean hasOlder, |
|
||||
final int unseenCount, |
|
||||
final String unseenCountTs, |
|
||||
final String oldestCursor, |
|
||||
final boolean blendedInboxEnabled) { |
|
||||
this.threads = threads; |
|
||||
this.hasOlder = hasOlder; |
|
||||
this.unseenCount = unseenCount; |
|
||||
this.unseenCountTs = unseenCountTs; |
|
||||
this.oldestCursor = oldestCursor; |
|
||||
this.blendedInboxEnabled = blendedInboxEnabled; |
|
||||
} |
|
||||
|
|
||||
public List<DirectThread> getThreads() { |
|
||||
return threads; |
|
||||
} |
|
||||
|
|
||||
public void setThreads(final List<DirectThread> threads) { |
|
||||
this.threads = threads; |
|
||||
} |
|
||||
|
|
||||
public boolean hasOlder() { |
|
||||
return hasOlder; |
|
||||
} |
|
||||
|
|
||||
public int getUnseenCount() { |
|
||||
return unseenCount; |
|
||||
} |
|
||||
|
|
||||
public String getUnseenCountTs() { |
|
||||
return unseenCountTs; |
|
||||
} |
|
||||
|
|
||||
public String getOldestCursor() { |
|
||||
return oldestCursor; |
|
||||
} |
|
||||
|
|
||||
public boolean isBlendedInboxEnabled() { |
|
||||
return blendedInboxEnabled; |
|
||||
} |
|
||||
|
|
||||
@NonNull |
|
||||
@Override |
|
||||
public Object clone() throws CloneNotSupportedException { |
|
||||
return super.clone(); |
|
||||
} |
|
||||
} |
|
@ -0,0 +1,15 @@ |
|||||
|
package awais.instagrabber.repositories.responses.directmessages |
||||
|
|
||||
|
data class DirectInbox( |
||||
|
var threads: List<DirectThread>? = emptyList(), |
||||
|
val hasOlder: Boolean = false, |
||||
|
val unseenCount: Int = 0, |
||||
|
val unseenCountTs: String? = null, |
||||
|
val oldestCursor: String? = null, |
||||
|
val blendedInboxEnabled: Boolean |
||||
|
) : Cloneable { |
||||
|
@Throws(CloneNotSupportedException::class) |
||||
|
public override fun clone(): Any { |
||||
|
return super.clone() |
||||
|
} |
||||
|
} |
@ -1,64 +0,0 @@ |
|||||
package awais.instagrabber.repositories.responses.directmessages; |
|
||||
|
|
||||
import awais.instagrabber.repositories.responses.User; |
|
||||
|
|
||||
public class DirectInboxResponse { |
|
||||
private final User viewer; |
|
||||
private final DirectInbox inbox; |
|
||||
private final long seqId; |
|
||||
private final long snapshotAtMs; |
|
||||
private final int pendingRequestsTotal; |
|
||||
private final boolean hasPendingTopRequests; |
|
||||
private final User mostRecentInviter; |
|
||||
private final String status; |
|
||||
|
|
||||
public DirectInboxResponse(final User viewer, |
|
||||
final DirectInbox inbox, |
|
||||
final long seqId, |
|
||||
final long snapshotAtMs, |
|
||||
final int pendingRequestsTotal, |
|
||||
final boolean hasPendingTopRequests, |
|
||||
final User mostRecentInviter, |
|
||||
final String status) { |
|
||||
this.viewer = viewer; |
|
||||
this.inbox = inbox; |
|
||||
this.seqId = seqId; |
|
||||
this.snapshotAtMs = snapshotAtMs; |
|
||||
this.pendingRequestsTotal = pendingRequestsTotal; |
|
||||
this.hasPendingTopRequests = hasPendingTopRequests; |
|
||||
this.mostRecentInviter = mostRecentInviter; |
|
||||
this.status = status; |
|
||||
} |
|
||||
|
|
||||
public User getViewer() { |
|
||||
return viewer; |
|
||||
} |
|
||||
|
|
||||
public DirectInbox getInbox() { |
|
||||
return inbox; |
|
||||
} |
|
||||
|
|
||||
public long getSeqId() { |
|
||||
return seqId; |
|
||||
} |
|
||||
|
|
||||
public long getSnapshotAtMs() { |
|
||||
return snapshotAtMs; |
|
||||
} |
|
||||
|
|
||||
public int getPendingRequestsTotal() { |
|
||||
return pendingRequestsTotal; |
|
||||
} |
|
||||
|
|
||||
public boolean hasPendingTopRequests() { |
|
||||
return hasPendingTopRequests; |
|
||||
} |
|
||||
|
|
||||
public User getMostRecentInviter() { |
|
||||
return mostRecentInviter; |
|
||||
} |
|
||||
|
|
||||
public String getStatus() { |
|
||||
return status; |
|
||||
} |
|
||||
} |
|
@ -0,0 +1,14 @@ |
|||||
|
package awais.instagrabber.repositories.responses.directmessages |
||||
|
|
||||
|
import awais.instagrabber.repositories.responses.User |
||||
|
|
||||
|
data class DirectInboxResponse( |
||||
|
val viewer: User? = null, |
||||
|
val inbox: DirectInbox? = null, |
||||
|
val seqId: Long = 0, |
||||
|
val snapshotAtMs: Long = 0, |
||||
|
val pendingRequestsTotal: Int = 0, |
||||
|
val hasPendingTopRequests: Boolean = false, |
||||
|
val mostRecentInviter: User? = null, |
||||
|
val status: String? = null, |
||||
|
) |
Write
Preview
Loading…
Cancel
Save
Reference in new issue