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, { computed: true })
  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, { computed: true })
  public virtualRouterName!: string | core.StringOut;
}

export interface ProviderArgs extends core.SchemaArgs {
  virtualNode: core.Array<VirtualNode> | core.ArrayOut<VirtualNode>;

  virtualRouter: core.Array<VirtualRouter> | core.ArrayOut<VirtualRouter>;
}

export class Provider extends core.Schema<ProviderArgs> {
  @core.attr(VirtualNode, { computed: true, kind: "array" })
  public virtualNode!: core.Array<VirtualNode> | core.ArrayOut<VirtualNode>;

  @core.attr(VirtualRouter, { computed: true, kind: "array" })
  public virtualRouter!:
    | core.Array<VirtualRouter>
    | core.ArrayOut<VirtualRouter>;
}

export interface SpecArgs extends core.SchemaArgs {
  provider: core.Array<Provider> | core.ArrayOut<Provider>;
}

export class Spec extends core.Schema<SpecArgs> {
  @core.attr(Provider, { computed: true, kind: "array" })
  public provider!: core.Array<Provider> | core.ArrayOut<Provider>;
}

export interface DsVirtualServiceArgs {
  meshName: string | core.StringOut;

  meshOwner?: string | core.StringOut;

  name: string | core.StringOut;

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

export class DsVirtualService extends core.Data<DsVirtualServiceArgs> {
  @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, { computed: true, kind: "array" })
  public spec!: core.Array<Spec> | core.ArrayOut<Spec>;

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

  constructor(name: string, args?: DsVirtualServiceArgs) {
    super(name, "aws_appmesh_virtual_service", args);
  }

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