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 ApiPublicGroup extends BserObject {
private int id;
private long accessHash;
private String title;
private ApiAvatar avatar;
private int membersCount;
private int friendsCount;
private String description;
public ApiPublicGroup(int id, long accessHash, @NotNull String title, @Nullable ApiAvatar avatar, int membersCount, int friendsCount, @NotNull String description) {
this.id = id;
this.accessHash = accessHash;
this.title = title;
this.avatar = avatar;
this.membersCount = membersCount;
this.friendsCount = friendsCount;
this.description = description;
}
public ApiPublicGroup() {
}
public int getId() {
return this.id;
}
public long getAccessHash() {
return this.accessHash;
}
@NotNull
public String getTitle() {
return this.title;
}
@Nullable
public ApiAvatar getAvatar() {
return this.avatar;
}
public int getMembersCount() {
return this.membersCount;
}
public int getFriendsCount() {
return this.friendsCount;
}
@NotNull
public String getDescription() {
return this.description;
}
@Override
public void parse(BserValues values) throws IOException {
this.id = values.getInt(1);
this.accessHash = values.getLong(2);
this.title = values.getString(3);
this.avatar = values.optObj(7, new ApiAvatar());
this.membersCount = values.getInt(4);
this.friendsCount = values.getInt(5);
this.description = values.getString(6);
}
@Override
public void serialize(BserWriter writer) throws IOException {
writer.writeInt(1, this.id);
writer.writeLong(2, this.accessHash);
if (this.title == null) {
throw new IOException();
}
writer.writeString(3, this.title);
if (this.avatar != null) {
writer.writeObject(7, this.avatar);
}
writer.writeInt(4, this.membersCount);
writer.writeInt(5, this.friendsCount);
if (this.description == null) {
throw new IOException();
}
writer.writeString(6, this.description);
}
@Override
public String toString() {
String res = "struct PublicGroup{";
res += "id=" + this.id;
res += ", title=" + this.title;
res += ", avatar=" + this.avatar;
res += ", membersCount=" + this.membersCount;
res += ", friendsCount=" + this.friendsCount;
res += ", description=" + this.description;
res += "}";
return res;
}
}