// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.

import {
  TypedMap,
  Entity,
  Value,
  ValueKind,
  store,
  Bytes,
  BigInt,
  BigDecimal
} from "@graphprotocol/graph-ts";

export class Authentication extends Entity {
  constructor(id: string) {
    super();
    this.set("id", Value.fromString(id));
  }

  save(): void {
    let id = this.get("id");
    assert(id != null, "Cannot save Authentication entity without an ID");
    if (id) {
      assert(
        id.kind == ValueKind.STRING,
        `Entities of type Authentication must have an ID of type String but the id '${id.displayData()}' is of type ${id.displayKind()}`
      );
      store.set("Authentication", id.toString(), this);
    }
  }

  static load(id: string): Authentication | null {
    return changetype<Authentication | null>(store.get("Authentication", id));
  }

  get id(): string {
    let value = this.get("id");
    return value!.toString();
  }

  set id(value: string) {
    this.set("id", Value.fromString(value));
  }

  get requestId(): BigInt {
    let value = this.get("requestId");
    return value!.toBigInt();
  }

  set requestId(value: BigInt) {
    this.set("requestId", Value.fromBigInt(value));
  }

  get requestor(): string {
    let value = this.get("requestor");
    return value!.toString();
  }

  set requestor(value: string) {
    this.set("requestor", Value.fromString(value));
  }

  get requestee(): string {
    let value = this.get("requestee");
    return value!.toString();
  }

  set requestee(value: string) {
    this.set("requestee", Value.fromString(value));
  }

  get authData(): string | null {
    let value = this.get("authData");
    if (!value || value.kind == ValueKind.NULL) {
      return null;
    } else {
      return value.toString();
    }
  }

  set authData(value: string | null) {
    if (!value) {
      this.unset("authData");
    } else {
      this.set("authData", Value.fromString(<string>value));
    }
  }

  get status(): string | null {
    let value = this.get("status");
    if (!value || value.kind == ValueKind.NULL) {
      return null;
    } else {
      return value.toString();
    }
  }

  set status(value: string | null) {
    if (!value) {
      this.unset("status");
    } else {
      this.set("status", Value.fromString(<string>value));
    }
  }

  get created(): string {
    let value = this.get("created");
    return value!.toString();
  }

  set created(value: string) {
    this.set("created", Value.fromString(value));
  }
}

export class AuthData extends Entity {
  constructor(id: string) {
    super();
    this.set("id", Value.fromString(id));
  }

  save(): void {
    let id = this.get("id");
    assert(id != null, "Cannot save AuthData entity without an ID");
    if (id) {
      assert(
        id.kind == ValueKind.STRING,
        `Entities of type AuthData must have an ID of type String but the id '${id.displayData()}' is of type ${id.displayKind()}`
      );
      store.set("AuthData", id.toString(), this);
    }
  }

  static load(id: string): AuthData | null {
    return changetype<AuthData | null>(store.get("AuthData", id));
  }

  get id(): string {
    let value = this.get("id");
    return value!.toString();
  }

  set id(value: string) {
    this.set("id", Value.fromString(value));
  }

  get authentication(): string {
    let value = this.get("authentication");
    return value!.toString();
  }

  set authentication(value: string) {
    this.set("authentication", Value.fromString(value));
  }

  get totp5(): BigInt {
    let value = this.get("totp5");
    return value!.toBigInt();
  }

  set totp5(value: BigInt) {
    this.set("totp5", Value.fromBigInt(value));
  }

  get totp6Hash(): Bytes {
    let value = this.get("totp6Hash");
    return value!.toBytes();
  }

  set totp6Hash(value: Bytes) {
    this.set("totp6Hash", Value.fromBytes(value));
  }

  get genTime(): BigInt {
    let value = this.get("genTime");
    return value!.toBigInt();
  }

  set genTime(value: BigInt) {
    this.set("genTime", Value.fromBigInt(value));
  }

  get created(): string {
    let value = this.get("created");
    return value!.toString();
  }

  set created(value: string) {
    this.set("created", Value.fromString(value));
  }
}

export class AuthStatus extends Entity {
  constructor(id: string) {
    super();
    this.set("id", Value.fromString(id));
  }

  save(): void {
    let id = this.get("id");
    assert(id != null, "Cannot save AuthStatus entity without an ID");
    if (id) {
      assert(
        id.kind == ValueKind.STRING,
        `Entities of type AuthStatus must have an ID of type String but the id '${id.displayData()}' is of type ${id.displayKind()}`
      );
      store.set("AuthStatus", id.toString(), this);
    }
  }

  static load(id: string): AuthStatus | null {
    return changetype<AuthStatus | null>(store.get("AuthStatus", id));
  }

  get id(): string {
    let value = this.get("id");
    return value!.toString();
  }

  set id(value: string) {
    this.set("id", Value.fromString(value));
  }

  get authentication(): string {
    let value = this.get("authentication");
    return value!.toString();
  }

  set authentication(value: string) {
    this.set("authentication", Value.fromString(value));
  }

  get hasResponse(): boolean {
    let value = this.get("hasResponse");
    return value!.toBoolean();
  }

  set hasResponse(value: boolean) {
    this.set("hasResponse", Value.fromBoolean(value));
  }

  get isValid(): boolean {
    let value = this.get("isValid");
    return value!.toBoolean();
  }

  set isValid(value: boolean) {
    this.set("isValid", Value.fromBoolean(value));
  }

  get validationTime(): string | null {
    let value = this.get("validationTime");
    if (!value || value.kind == ValueKind.NULL) {
      return null;
    } else {
      return value.toString();
    }
  }

  set validationTime(value: string | null) {
    if (!value) {
      this.unset("validationTime");
    } else {
      this.set("validationTime", Value.fromString(<string>value));
    }
  }
}

export class Address extends Entity {
  constructor(id: string) {
    super();
    this.set("id", Value.fromString(id));
  }

  save(): void {
    let id = this.get("id");
    assert(id != null, "Cannot save Address entity without an ID");
    if (id) {
      assert(
        id.kind == ValueKind.STRING,
        `Entities of type Address must have an ID of type String but the id '${id.displayData()}' is of type ${id.displayKind()}`
      );
      store.set("Address", id.toString(), this);
    }
  }

  static load(id: string): Address | null {
    return changetype<Address | null>(store.get("Address", id));
  }

  get id(): string {
    let value = this.get("id");
    return value!.toString();
  }

  set id(value: string) {
    this.set("id", Value.fromString(value));
  }

  get address(): Bytes {
    let value = this.get("address");
    return value!.toBytes();
  }

  set address(value: Bytes) {
    this.set("address", Value.fromBytes(value));
  }

  get authOutgoing(): Array<string> | null {
    let value = this.get("authOutgoing");
    if (!value || value.kind == ValueKind.NULL) {
      return null;
    } else {
      return value.toStringArray();
    }
  }

  set authOutgoing(value: Array<string> | null) {
    if (!value) {
      this.unset("authOutgoing");
    } else {
      this.set("authOutgoing", Value.fromStringArray(<Array<string>>value));
    }
  }

  get authIncoming(): Array<string> | null {
    let value = this.get("authIncoming");
    if (!value || value.kind == ValueKind.NULL) {
      return null;
    } else {
      return value.toStringArray();
    }
  }

  set authIncoming(value: Array<string> | null) {
    if (!value) {
      this.unset("authIncoming");
    } else {
      this.set("authIncoming", Value.fromStringArray(<Array<string>>value));
    }
  }
}
