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 RequestSignInObsolete extends Request<ResponseAuth> {
public static final int HEADER = 0x3;
public static RequestSignInObsolete fromBytes(byte[] data) throws IOException {
return Bser.parse(new RequestSignInObsolete(), data);
}
private long phoneNumber;
private String smsHash;
private String smsCode;
private byte[] deviceHash;
private String deviceTitle;
private int appId;
private String appKey;
public RequestSignInObsolete(long phoneNumber, @NotNull String smsHash, @NotNull String smsCode, @NotNull byte[] deviceHash, @NotNull String deviceTitle, int appId, @NotNull String appKey) {
this.phoneNumber = phoneNumber;
this.smsHash = smsHash;
this.smsCode = smsCode;
this.deviceHash = deviceHash;
this.deviceTitle = deviceTitle;
this.appId = appId;
this.appKey = appKey;
}
public RequestSignInObsolete() {
}
public long getPhoneNumber() {
return this.phoneNumber;
}
@NotNull
public String getSmsHash() {
return this.smsHash;
}
@NotNull
public String getSmsCode() {
return this.smsCode;
}
@NotNull
public byte[] getDeviceHash() {
return this.deviceHash;
}
@NotNull
public String getDeviceTitle() {
return this.deviceTitle;
}
public int getAppId() {
return this.appId;
}
@NotNull
public String getAppKey() {
return this.appKey;
}
@Override
public void parse(BserValues values) throws IOException {
this.phoneNumber = values.getLong(1);
this.smsHash = values.getString(2);
this.smsCode = values.getString(3);
this.deviceHash = values.getBytes(5);
this.deviceTitle = values.getString(6);
this.appId = values.getInt(7);
this.appKey = values.getString(8);
}
@Override
public void serialize(BserWriter writer) throws IOException {
writer.writeLong(1, this.phoneNumber);
if (this.smsHash == null) {
throw new IOException();
}
writer.writeString(2, this.smsHash);
if (this.smsCode == null) {
throw new IOException();
}
writer.writeString(3, this.smsCode);
if (this.deviceHash == null) {
throw new IOException();
}
writer.writeBytes(5, this.deviceHash);
if (this.deviceTitle == null) {
throw new IOException();
}
writer.writeString(6, this.deviceTitle);
writer.writeInt(7, this.appId);
if (this.appKey == null) {
throw new IOException();
}
writer.writeString(8, this.appKey);
}
@Override
public String toString() {
String res = "rpc SignInObsolete{";
res += "deviceHash=" + byteArrayToString(this.deviceHash);
res += ", deviceTitle=" + this.deviceTitle;
res += "}";
return res;
}
@Override
public int getHeaderKey() {
return HEADER;
}
}