package im.actor.core.api;
/*
* 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;
public class ApiFullUser extends BserObject {
private int id;
private List<ApiContactRecord> contactInfo;
private String about;
private List<String> preferredLanguages;
private String timeZone;
private List<ApiBotCommand> botCommands;
private ApiMapValue ext;
private Boolean isBlocked;
public ApiFullUser(int id, @NotNull List<ApiContactRecord> contactInfo, @Nullable String about, @NotNull List<String> preferredLanguages, @Nullable String timeZone, @NotNull List<ApiBotCommand> botCommands, @Nullable ApiMapValue ext, @Nullable Boolean isBlocked) {
this.id = id;
this.contactInfo = contactInfo;
this.about = about;
this.preferredLanguages = preferredLanguages;
this.timeZone = timeZone;
this.botCommands = botCommands;
this.ext = ext;
this.isBlocked = isBlocked;
}
public ApiFullUser() {
}
public int getId() {
return this.id;
}
@NotNull
public List<ApiContactRecord> getContactInfo() {
return this.contactInfo;
}
@Nullable
public String getAbout() {
return this.about;
}
@NotNull
public List<String> getPreferredLanguages() {
return this.preferredLanguages;
}
@Nullable
public String getTimeZone() {
return this.timeZone;
}
@NotNull
public List<ApiBotCommand> getBotCommands() {
return this.botCommands;
}
@Nullable
public ApiMapValue getExt() {
return this.ext;
}
@Nullable
public Boolean isBlocked() {
return this.isBlocked;
}
@Override
public void parse(BserValues values) throws IOException {
this.id = values.getInt(1);
List<ApiContactRecord> _contactInfo = new ArrayList<ApiContactRecord>();
for (int i = 0; i < values.getRepeatedCount(2); i ++) {
_contactInfo.add(new ApiContactRecord());
}
this.contactInfo = values.getRepeatedObj(2, _contactInfo);
this.about = values.optString(3);
this.preferredLanguages = values.getRepeatedString(4);
this.timeZone = values.optString(5);
List<ApiBotCommand> _botCommands = new ArrayList<ApiBotCommand>();
for (int i = 0; i < values.getRepeatedCount(6); i ++) {
_botCommands.add(new ApiBotCommand());
}
this.botCommands = values.getRepeatedObj(6, _botCommands);
this.ext = values.optObj(7, new ApiMapValue());
this.isBlocked = values.optBool(8);
if (values.hasRemaining()) {
setUnmappedObjects(values.buildRemaining());
}
}
@Override
public void serialize(BserWriter writer) throws IOException {
writer.writeInt(1, this.id);
writer.writeRepeatedObj(2, this.contactInfo);
if (this.about != null) {
writer.writeString(3, this.about);
}
writer.writeRepeatedString(4, this.preferredLanguages);
if (this.timeZone != null) {
writer.writeString(5, this.timeZone);
}
writer.writeRepeatedObj(6, this.botCommands);
if (this.ext != null) {
writer.writeObject(7, this.ext);
}
if (this.isBlocked != null) {
writer.writeBool(8, this.isBlocked);
}
if (this.getUnmappedObjects() != null) {
SparseArray<Object> unmapped = this.getUnmappedObjects();
for (int i = 0; i < unmapped.size(); i++) {
int key = unmapped.keyAt(i);
writer.writeUnmapped(key, unmapped.get(key));
}
}
}
@Override
public String toString() {
String res = "struct FullUser{";
res += "id=" + this.id;
res += ", contactInfo=" + this.contactInfo.size();
res += ", about=" + this.about;
res += ", preferredLanguages=" + this.preferredLanguages;
res += ", timeZone=" + this.timeZone;
res += ", botCommands=" + this.botCommands;
res += ", ext=" + this.ext;
res += ", isBlocked=" + this.isBlocked;
res += "}";
return res;
}
}