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

export interface PortMappingArgs extends core.SchemaArgs {
  port: number | core.NumberOut;

  protocol: string | core.StringOut;
}

export class PortMapping extends core.Schema<PortMappingArgs> {
  @core.attr(Number)
  public port!: number | core.NumberOut;

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

export interface ListenerArgs extends core.SchemaArgs {
  portMapping: PortMapping;
}

export class Listener extends core.Schema<ListenerArgs> {
  @core.attr(PortMapping)
  public portMapping!: PortMapping;
}

export interface SpecArgs extends core.SchemaArgs {
  listener: Listener;
}

export class Spec extends core.Schema<SpecArgs> {
  @core.attr(Listener)
  public listener!: Listener;
}

export interface VirtualRouterArgs extends core.ResourceArgs {
  meshName: string | core.StringOut;

  meshOwner?: string | core.StringOut;

  name: string | core.StringOut;

  spec: Spec;

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

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

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

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

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

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

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

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

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

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

  @core.attr(Spec)
  public spec!: Spec;

  @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>;

  constructor(name: string, args?: VirtualRouterArgs) {
    super(name, "aws_appmesh_virtual_router", args);
  }

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