package im.actor.core.api.rpc; /* * Generated by the Actor API Scheme generator. DO NOT EDIT! */ import im.actor.runtime.bser.*; import im.actor.runtime.collections.*; import static im.actor.runtime.bser.Utils.*; import im.actor.core.network.parser.*; import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.NotNull; import com.google.j2objc.annotations.ObjectiveCName; import java.io.IOException; import java.util.List; import java.util.ArrayList; import im.actor.core.api.*; public class RequestUploadSharedBlob extends Request<ResponseUploadSharedBlob> { public static final int HEADER = 0xa64; public static RequestUploadSharedBlob fromBytes(byte[] data) throws IOException { return Bser.parse(new RequestUploadSharedBlob(), data); } private ApiUserOutPeer destPeer; private String bucket; private byte[] blob; private long randomId; public RequestUploadSharedBlob(@NotNull ApiUserOutPeer destPeer, @NotNull String bucket, @NotNull byte[] blob, long randomId) { this.destPeer = destPeer; this.bucket = bucket; this.blob = blob; this.randomId = randomId; } public RequestUploadSharedBlob() { } @NotNull public ApiUserOutPeer getDestPeer() { return this.destPeer; } @NotNull public String getBucket() { return this.bucket; } @NotNull public byte[] getBlob() { return this.blob; } public long getRandomId() { return this.randomId; } @Override public void parse(BserValues values) throws IOException { this.destPeer = values.getObj(1, new ApiUserOutPeer()); this.bucket = values.getString(2); this.blob = values.getBytes(3); this.randomId = values.getLong(4); } @Override public void serialize(BserWriter writer) throws IOException { if (this.destPeer == null) { throw new IOException(); } writer.writeObject(1, this.destPeer); if (this.bucket == null) { throw new IOException(); } writer.writeString(2, this.bucket); if (this.blob == null) { throw new IOException(); } writer.writeBytes(3, this.blob); writer.writeLong(4, this.randomId); } @Override public String toString() { String res = "rpc UploadSharedBlob{"; res += "destPeer=" + this.destPeer; res += ", bucket=" + this.bucket; res += ", blob=" + byteArrayToString(this.blob); res += ", randomId=" + this.randomId; res += "}"; return res; } @Override public int getHeaderKey() { return HEADER; } }