2021-09-28 06:58:43 +00:00
|
|
|
// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
|
|
|
|
|
|
|
import {
|
|
|
|
TypedMap,
|
|
|
|
Entity,
|
|
|
|
Value,
|
|
|
|
ValueKind,
|
|
|
|
store,
|
|
|
|
Address,
|
|
|
|
Bytes,
|
|
|
|
BigInt,
|
|
|
|
BigDecimal
|
|
|
|
} from "@graphprotocol/graph-ts";
|
|
|
|
|
2021-11-17 11:31:09 +00:00
|
|
|
export class RelatedEntity extends Entity {
|
|
|
|
constructor(id: string) {
|
|
|
|
super();
|
|
|
|
this.set("id", Value.fromString(id));
|
|
|
|
|
|
|
|
this.set("paramBigInt", Value.fromBigInt(BigInt.zero()));
|
|
|
|
this.set("bigIntArray", Value.fromBigIntArray(new Array(0)));
|
|
|
|
}
|
|
|
|
|
|
|
|
save(): void {
|
|
|
|
let id = this.get("id");
|
|
|
|
assert(id != null, "Cannot save RelatedEntity entity without an ID");
|
|
|
|
if (id) {
|
|
|
|
assert(
|
|
|
|
id.kind == ValueKind.STRING,
|
|
|
|
"Cannot save RelatedEntity entity with non-string ID. " +
|
|
|
|
'Considering using .toHex() to convert the "id" to a string.'
|
|
|
|
);
|
|
|
|
store.set("RelatedEntity", id.toString(), this);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static load(id: string): RelatedEntity | null {
|
|
|
|
return changetype<RelatedEntity | null>(store.get("RelatedEntity", id));
|
|
|
|
}
|
|
|
|
|
|
|
|
get id(): string {
|
|
|
|
let value = this.get("id");
|
|
|
|
return value!.toString();
|
|
|
|
}
|
|
|
|
|
|
|
|
set id(value: string) {
|
|
|
|
this.set("id", Value.fromString(value));
|
|
|
|
}
|
|
|
|
|
|
|
|
get paramBigInt(): BigInt {
|
|
|
|
let value = this.get("paramBigInt");
|
|
|
|
return value!.toBigInt();
|
|
|
|
}
|
|
|
|
|
|
|
|
set paramBigInt(value: BigInt) {
|
|
|
|
this.set("paramBigInt", Value.fromBigInt(value));
|
|
|
|
}
|
|
|
|
|
|
|
|
get bigIntArray(): Array<BigInt> {
|
|
|
|
let value = this.get("bigIntArray");
|
|
|
|
return value!.toBigIntArray();
|
|
|
|
}
|
|
|
|
|
|
|
|
set bigIntArray(value: Array<BigInt>) {
|
|
|
|
this.set("bigIntArray", Value.fromBigIntArray(value));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-09-28 06:58:43 +00:00
|
|
|
export class ExampleEntity extends Entity {
|
|
|
|
constructor(id: string) {
|
|
|
|
super();
|
|
|
|
this.set("id", Value.fromString(id));
|
|
|
|
|
|
|
|
this.set("count", Value.fromBigInt(BigInt.zero()));
|
2021-11-16 07:35:05 +00:00
|
|
|
this.set("paramString", Value.fromString(""));
|
|
|
|
this.set("paramInt", Value.fromI32(0));
|
|
|
|
this.set("paramBoolean", Value.fromBoolean(false));
|
|
|
|
this.set("paramBytes", Value.fromBytes(Bytes.empty()));
|
|
|
|
this.set("paramEnum", Value.fromString(""));
|
|
|
|
this.set("paramBigDecimal", Value.fromBigDecimal(BigDecimal.zero()));
|
2021-11-17 11:31:09 +00:00
|
|
|
this.set("related", Value.fromString(""));
|
2021-11-22 10:16:29 +00:00
|
|
|
this.set("manyRelated", Value.fromStringArray(new Array(0)));
|
2021-09-28 06:58:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
save(): void {
|
|
|
|
let id = this.get("id");
|
|
|
|
assert(id != null, "Cannot save ExampleEntity entity without an ID");
|
|
|
|
if (id) {
|
|
|
|
assert(
|
|
|
|
id.kind == ValueKind.STRING,
|
|
|
|
"Cannot save ExampleEntity entity with non-string ID. " +
|
|
|
|
'Considering using .toHex() to convert the "id" to a string.'
|
|
|
|
);
|
|
|
|
store.set("ExampleEntity", id.toString(), this);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static load(id: string): ExampleEntity | null {
|
|
|
|
return changetype<ExampleEntity | null>(store.get("ExampleEntity", id));
|
|
|
|
}
|
|
|
|
|
|
|
|
get id(): string {
|
|
|
|
let value = this.get("id");
|
|
|
|
return value!.toString();
|
|
|
|
}
|
|
|
|
|
|
|
|
set id(value: string) {
|
|
|
|
this.set("id", Value.fromString(value));
|
|
|
|
}
|
|
|
|
|
|
|
|
get count(): BigInt {
|
|
|
|
let value = this.get("count");
|
|
|
|
return value!.toBigInt();
|
|
|
|
}
|
|
|
|
|
|
|
|
set count(value: BigInt) {
|
|
|
|
this.set("count", Value.fromBigInt(value));
|
|
|
|
}
|
|
|
|
|
2021-11-16 07:35:05 +00:00
|
|
|
get paramString(): string {
|
|
|
|
let value = this.get("paramString");
|
2021-09-28 06:58:43 +00:00
|
|
|
return value!.toString();
|
|
|
|
}
|
|
|
|
|
2021-11-16 07:35:05 +00:00
|
|
|
set paramString(value: string) {
|
|
|
|
this.set("paramString", Value.fromString(value));
|
2021-09-28 06:58:43 +00:00
|
|
|
}
|
|
|
|
|
2021-11-16 07:35:05 +00:00
|
|
|
get paramInt(): i32 {
|
|
|
|
let value = this.get("paramInt");
|
2021-11-01 09:43:22 +00:00
|
|
|
return value!.toI32();
|
2021-09-28 06:58:43 +00:00
|
|
|
}
|
|
|
|
|
2021-11-16 07:35:05 +00:00
|
|
|
set paramInt(value: i32) {
|
|
|
|
this.set("paramInt", Value.fromI32(value));
|
|
|
|
}
|
|
|
|
|
|
|
|
get paramBoolean(): boolean {
|
|
|
|
let value = this.get("paramBoolean");
|
|
|
|
return value!.toBoolean();
|
|
|
|
}
|
|
|
|
|
|
|
|
set paramBoolean(value: boolean) {
|
|
|
|
this.set("paramBoolean", Value.fromBoolean(value));
|
|
|
|
}
|
|
|
|
|
|
|
|
get paramBytes(): Bytes {
|
|
|
|
let value = this.get("paramBytes");
|
|
|
|
return value!.toBytes();
|
|
|
|
}
|
|
|
|
|
|
|
|
set paramBytes(value: Bytes) {
|
|
|
|
this.set("paramBytes", Value.fromBytes(value));
|
|
|
|
}
|
|
|
|
|
|
|
|
get paramEnum(): string {
|
|
|
|
let value = this.get("paramEnum");
|
|
|
|
return value!.toString();
|
|
|
|
}
|
|
|
|
|
|
|
|
set paramEnum(value: string) {
|
|
|
|
this.set("paramEnum", Value.fromString(value));
|
|
|
|
}
|
|
|
|
|
|
|
|
get paramBigDecimal(): BigDecimal {
|
|
|
|
let value = this.get("paramBigDecimal");
|
|
|
|
return value!.toBigDecimal();
|
|
|
|
}
|
|
|
|
|
|
|
|
set paramBigDecimal(value: BigDecimal) {
|
|
|
|
this.set("paramBigDecimal", Value.fromBigDecimal(value));
|
2021-09-28 06:58:43 +00:00
|
|
|
}
|
2021-11-17 11:31:09 +00:00
|
|
|
|
|
|
|
get related(): string {
|
|
|
|
let value = this.get("related");
|
|
|
|
return value!.toString();
|
|
|
|
}
|
|
|
|
|
|
|
|
set related(value: string) {
|
|
|
|
this.set("related", Value.fromString(value));
|
|
|
|
}
|
2021-11-22 10:16:29 +00:00
|
|
|
|
|
|
|
get manyRelated(): Array<string> {
|
|
|
|
let value = this.get("manyRelated");
|
|
|
|
return value!.toStringArray();
|
|
|
|
}
|
|
|
|
|
|
|
|
set manyRelated(value: Array<string>) {
|
|
|
|
this.set("manyRelated", Value.fromStringArray(value));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export class ManyRelatedEntity extends Entity {
|
|
|
|
constructor(id: string) {
|
|
|
|
super();
|
|
|
|
this.set("id", Value.fromString(id));
|
|
|
|
|
|
|
|
this.set("count", Value.fromBigInt(BigInt.zero()));
|
|
|
|
}
|
|
|
|
|
|
|
|
save(): void {
|
|
|
|
let id = this.get("id");
|
|
|
|
assert(id != null, "Cannot save ManyRelatedEntity entity without an ID");
|
|
|
|
if (id) {
|
|
|
|
assert(
|
|
|
|
id.kind == ValueKind.STRING,
|
|
|
|
"Cannot save ManyRelatedEntity entity with non-string ID. " +
|
|
|
|
'Considering using .toHex() to convert the "id" to a string.'
|
|
|
|
);
|
|
|
|
store.set("ManyRelatedEntity", id.toString(), this);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static load(id: string): ManyRelatedEntity | null {
|
|
|
|
return changetype<ManyRelatedEntity | null>(
|
|
|
|
store.get("ManyRelatedEntity", id)
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
get id(): string {
|
|
|
|
let value = this.get("id");
|
|
|
|
return value!.toString();
|
|
|
|
}
|
|
|
|
|
|
|
|
set id(value: string) {
|
|
|
|
this.set("id", Value.fromString(value));
|
|
|
|
}
|
|
|
|
|
|
|
|
get count(): BigInt {
|
|
|
|
let value = this.get("count");
|
|
|
|
return value!.toBigInt();
|
|
|
|
}
|
|
|
|
|
|
|
|
set count(value: BigInt) {
|
|
|
|
this.set("count", Value.fromBigInt(value));
|
|
|
|
}
|
2021-09-28 06:58:43 +00:00
|
|
|
}
|