import * as core from "@terrascript/core";

export interface PlayerLatencyPolicyArgs extends core.SchemaArgs {
  maximumIndividualPlayerLatencyMilliseconds: number | core.NumberOut;

  policyDurationSeconds?: number | core.NumberOut;
}

export class PlayerLatencyPolicy extends core.Schema<PlayerLatencyPolicyArgs> {
  @core.attr(Number)
  public maximumIndividualPlayerLatencyMilliseconds!: number | core.NumberOut;

  @core.attr(Number)
  public policyDurationSeconds?: number | core.NumberOut;
}

export interface GameSessionQueueArgs extends core.ResourceArgs {
  destinations?: core.Array<string> | core.ArrayOut<core.StringOut>;

  name: string | core.StringOut;

  notificationTarget?: string | core.StringOut;

  playerLatencyPolicy?:
    | core.Array<PlayerLatencyPolicy>
    | core.ArrayOut<PlayerLatencyPolicy>;

  tags?: core.Map<string, string> | core.MapOut<core.StringOut>;

  tagsAll?: core.Map<string, string> | core.MapOut<core.StringOut>;

  timeoutInSeconds?: number | core.NumberOut;
}

export class GameSessionQueue extends core.Resource<GameSessionQueueArgs> {
  @core.attr(String, { computed: true })
  public arn!: string | core.StringOut;

  @core.attr(String, { kind: "array" })
  public destinations?: core.Array<string> | core.ArrayOut<core.StringOut>;

  @core.attr(String, { computed: true })
  public id!: string | core.StringOut;

  @core.attr(String)
  public name!: string | core.StringOut;

  @core.attr(String)
  public notificationTarget?: string | core.StringOut;

  @core.attr(PlayerLatencyPolicy, { kind: "array" })
  public playerLatencyPolicy?:
    | core.Array<PlayerLatencyPolicy>
    | core.ArrayOut<PlayerLatencyPolicy>;

  @core.attr(String, { kind: "map" })
  public tags?: core.Map<string, string> | core.MapOut<core.StringOut>;

  @core.attr(String, { computed: true, kind: "map" })
  public tagsAll?: core.Map<string, string> | core.MapOut<core.StringOut>;

  @core.attr(Number)
  public timeoutInSeconds?: number | core.NumberOut;

  constructor(name: string, args?: GameSessionQueueArgs) {
    super(name, "aws_gamelift_game_session_queue", args);
  }

  public override getNamespace(): string {
    return "aws_gamelift";
  }
}
