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

export interface RouteArgs extends core.SchemaArgs {
  host: string | core.StringOut;

  port?: number | core.NumberOut;

  priority: number | core.NumberOut;

  protocol: string | core.StringOut;

  weight: number | core.NumberOut;
}

export class Route extends core.Schema<RouteArgs> {
  @core.attr(String)
  public host!: string | core.StringOut;

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

  @core.attr(Number)
  public priority!: number | core.NumberOut;

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

  @core.attr(Number)
  public weight!: number | core.NumberOut;
}

export interface VoiceConnectorOriginationArgs extends core.ResourceArgs {
  disabled?: boolean | core.BooleanOut;

  route: core.Array<Route> | core.ArrayOut<Route>;

  voiceConnectorId: string | core.StringOut;
}

export class VoiceConnectorOrigination extends core.Resource<VoiceConnectorOriginationArgs> {
  @core.attr(Boolean)
  public disabled?: boolean | core.BooleanOut;

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

  @core.attr(Route, { kind: "array" })
  public route!: core.Array<Route> | core.ArrayOut<Route>;

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

  constructor(name: string, args?: VoiceConnectorOriginationArgs) {
    super(name, "aws_chime_voice_connector_origination", args);
  }

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