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

export interface VirtualNodeArgs extends core.SchemaArgs {
  virtualNodeName: string | core.StringOut;
}

export class VirtualNode extends core.Schema<VirtualNodeArgs> {
  @core.attr(String)
  public virtualNodeName!: string | core.StringOut;
}

export interface VirtualRouterArgs extends core.SchemaArgs {
  virtualRouterName: string | core.StringOut;
}

export class VirtualRouter extends core.Schema<VirtualRouterArgs> {
  @core.attr(String)
  public virtualRouterName!: string | core.StringOut;
}

export interface ProviderArgs extends core.SchemaArgs {
  virtualNode?: VirtualNode;

  virtualRouter?: VirtualRouter;
}

export class Provider extends core.Schema<ProviderArgs> {
  @core.attr(VirtualNode)
  public virtualNode?: VirtualNode;

  @core.attr(VirtualRouter)
  public virtualRouter?: VirtualRouter;
}

export interface SpecArgs extends core.SchemaArgs {
  provider?: Provider;
}

export class Spec extends core.Schema<SpecArgs> {
  @core.attr(Provider)
  public provider?: Provider;
}

export interface VirtualServiceArgs 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 VirtualService extends core.Resource<VirtualServiceArgs> {
  @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?: VirtualServiceArgs) {
    super(name, "aws_appmesh_virtual_service", args);
  }

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