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

export interface SdsArgs extends core.SchemaArgs {
  secretName: string | core.StringOut;
}

export class Sds extends core.Schema<SdsArgs> {
  @core.attr(String)
  public secretName!: string | core.StringOut;
}

export interface ClientPolicyTlsCertificateFileArgs extends core.SchemaArgs {
  certificateChain: string | core.StringOut;

  privateKey: string | core.StringOut;
}

export class ClientPolicyTlsCertificateFile extends core.Schema<ClientPolicyTlsCertificateFileArgs> {
  @core.attr(String)
  public certificateChain!: string | core.StringOut;

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

export interface ClientPolicyTlsCertificateArgs extends core.SchemaArgs {
  file?: ClientPolicyTlsCertificateFile;

  sds?: Sds;
}

export class ClientPolicyTlsCertificate extends core.Schema<ClientPolicyTlsCertificateArgs> {
  @core.attr(ClientPolicyTlsCertificateFile)
  public file?: ClientPolicyTlsCertificateFile;

  @core.attr(Sds)
  public sds?: Sds;
}

export interface MatchArgs extends core.SchemaArgs {
  exact: core.Array<string> | core.ArrayOut<core.StringOut>;
}

export class Match extends core.Schema<MatchArgs> {
  @core.attr(String, { kind: "array" })
  public exact!: core.Array<string> | core.ArrayOut<core.StringOut>;
}

export interface SubjectAlternativeNamesArgs extends core.SchemaArgs {
  match: Match;
}

export class SubjectAlternativeNames extends core.Schema<SubjectAlternativeNamesArgs> {
  @core.attr(Match)
  public match!: Match;
}

export interface ClientPolicyTlsValidationTrustFileArgs
  extends core.SchemaArgs {
  certificateChain: string | core.StringOut;
}

export class ClientPolicyTlsValidationTrustFile extends core.Schema<ClientPolicyTlsValidationTrustFileArgs> {
  @core.attr(String)
  public certificateChain!: string | core.StringOut;
}

export interface ClientPolicyTlsValidationTrustAcmArgs extends core.SchemaArgs {
  certificateAuthorityArns: core.Array<string> | core.ArrayOut<core.StringOut>;
}

export class ClientPolicyTlsValidationTrustAcm extends core.Schema<ClientPolicyTlsValidationTrustAcmArgs> {
  @core.attr(String, { kind: "array" })
  public certificateAuthorityArns!:
    | core.Array<string>
    | core.ArrayOut<core.StringOut>;
}

export interface ClientPolicyTlsValidationTrustArgs extends core.SchemaArgs {
  acm?: ClientPolicyTlsValidationTrustAcm;

  file?: ClientPolicyTlsValidationTrustFile;

  sds?: Sds;
}

export class ClientPolicyTlsValidationTrust extends core.Schema<ClientPolicyTlsValidationTrustArgs> {
  @core.attr(ClientPolicyTlsValidationTrustAcm)
  public acm?: ClientPolicyTlsValidationTrustAcm;

  @core.attr(ClientPolicyTlsValidationTrustFile)
  public file?: ClientPolicyTlsValidationTrustFile;

  @core.attr(Sds)
  public sds?: Sds;
}

export interface ClientPolicyTlsValidationArgs extends core.SchemaArgs {
  subjectAlternativeNames?: SubjectAlternativeNames;

  trust: ClientPolicyTlsValidationTrust;
}

export class ClientPolicyTlsValidation extends core.Schema<ClientPolicyTlsValidationArgs> {
  @core.attr(SubjectAlternativeNames)
  public subjectAlternativeNames?: SubjectAlternativeNames;

  @core.attr(ClientPolicyTlsValidationTrust)
  public trust!: ClientPolicyTlsValidationTrust;
}

export interface ClientPolicyTlsArgs extends core.SchemaArgs {
  certificate?: ClientPolicyTlsCertificate;

  enforce?: boolean | core.BooleanOut;

  ports?: core.Array<number> | core.ArrayOut<core.NumberOut>;

  validation: ClientPolicyTlsValidation;
}

export class ClientPolicyTls extends core.Schema<ClientPolicyTlsArgs> {
  @core.attr(ClientPolicyTlsCertificate)
  public certificate?: ClientPolicyTlsCertificate;

  @core.attr(Boolean)
  public enforce?: boolean | core.BooleanOut;

  @core.attr(Number, { kind: "array" })
  public ports?: core.Array<number> | core.ArrayOut<core.NumberOut>;

  @core.attr(ClientPolicyTlsValidation)
  public validation!: ClientPolicyTlsValidation;
}

export interface ClientPolicyArgs extends core.SchemaArgs {
  tls?: ClientPolicyTls;
}

export class ClientPolicy extends core.Schema<ClientPolicyArgs> {
  @core.attr(ClientPolicyTls)
  public tls?: ClientPolicyTls;
}

export interface VirtualServiceArgs extends core.SchemaArgs {
  clientPolicy?: ClientPolicy;

  virtualServiceName: string | core.StringOut;
}

export class VirtualService extends core.Schema<VirtualServiceArgs> {
  @core.attr(ClientPolicy)
  public clientPolicy?: ClientPolicy;

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

export interface BackendArgs extends core.SchemaArgs {
  virtualService: VirtualService;
}

export class Backend extends core.Schema<BackendArgs> {
  @core.attr(VirtualService)
  public virtualService!: VirtualService;
}

export interface BackendDefaultsArgs extends core.SchemaArgs {
  clientPolicy?: ClientPolicy;
}

export class BackendDefaults extends core.Schema<BackendDefaultsArgs> {
  @core.attr(ClientPolicy)
  public clientPolicy?: ClientPolicy;
}

export interface PerRequestArgs extends core.SchemaArgs {
  unit: string | core.StringOut;

  value: number | core.NumberOut;
}

export class PerRequest extends core.Schema<PerRequestArgs> {
  @core.attr(String)
  public unit!: string | core.StringOut;

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

export interface IdleArgs extends core.SchemaArgs {
  unit: string | core.StringOut;

  value: number | core.NumberOut;
}

export class Idle extends core.Schema<IdleArgs> {
  @core.attr(String)
  public unit!: string | core.StringOut;

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

export interface TimeoutGrpcArgs extends core.SchemaArgs {
  idle?: Idle;

  perRequest?: PerRequest;
}

export class TimeoutGrpc extends core.Schema<TimeoutGrpcArgs> {
  @core.attr(Idle)
  public idle?: Idle;

  @core.attr(PerRequest)
  public perRequest?: PerRequest;
}

export interface TimeoutHttpArgs extends core.SchemaArgs {
  idle?: Idle;

  perRequest?: PerRequest;
}

export class TimeoutHttp extends core.Schema<TimeoutHttpArgs> {
  @core.attr(Idle)
  public idle?: Idle;

  @core.attr(PerRequest)
  public perRequest?: PerRequest;
}

export interface TimeoutHttp2Args extends core.SchemaArgs {
  idle?: Idle;

  perRequest?: PerRequest;
}

export class TimeoutHttp2 extends core.Schema<TimeoutHttp2Args> {
  @core.attr(Idle)
  public idle?: Idle;

  @core.attr(PerRequest)
  public perRequest?: PerRequest;
}

export interface TimeoutTcpArgs extends core.SchemaArgs {
  idle?: Idle;
}

export class TimeoutTcp extends core.Schema<TimeoutTcpArgs> {
  @core.attr(Idle)
  public idle?: Idle;
}

export interface TimeoutArgs extends core.SchemaArgs {
  grpc?: TimeoutGrpc;

  http?: TimeoutHttp;

  http2?: TimeoutHttp2;

  tcp?: TimeoutTcp;
}

export class Timeout extends core.Schema<TimeoutArgs> {
  @core.attr(TimeoutGrpc)
  public grpc?: TimeoutGrpc;

  @core.attr(TimeoutHttp)
  public http?: TimeoutHttp;

  @core.attr(TimeoutHttp2)
  public http2?: TimeoutHttp2;

  @core.attr(TimeoutTcp)
  public tcp?: TimeoutTcp;
}

export interface ListenerTlsCertificateAcmArgs extends core.SchemaArgs {
  certificateArn: string | core.StringOut;
}

export class ListenerTlsCertificateAcm extends core.Schema<ListenerTlsCertificateAcmArgs> {
  @core.attr(String)
  public certificateArn!: string | core.StringOut;
}

export interface ListenerTlsCertificateArgs extends core.SchemaArgs {
  acm?: ListenerTlsCertificateAcm;

  file?: ClientPolicyTlsCertificateFile;

  sds?: Sds;
}

export class ListenerTlsCertificate extends core.Schema<ListenerTlsCertificateArgs> {
  @core.attr(ListenerTlsCertificateAcm)
  public acm?: ListenerTlsCertificateAcm;

  @core.attr(ClientPolicyTlsCertificateFile)
  public file?: ClientPolicyTlsCertificateFile;

  @core.attr(Sds)
  public sds?: Sds;
}

export interface ListenerTlsValidationTrustArgs extends core.SchemaArgs {
  file?: ClientPolicyTlsValidationTrustFile;

  sds?: Sds;
}

export class ListenerTlsValidationTrust extends core.Schema<ListenerTlsValidationTrustArgs> {
  @core.attr(ClientPolicyTlsValidationTrustFile)
  public file?: ClientPolicyTlsValidationTrustFile;

  @core.attr(Sds)
  public sds?: Sds;
}

export interface ListenerTlsValidationArgs extends core.SchemaArgs {
  subjectAlternativeNames?: SubjectAlternativeNames;

  trust: ListenerTlsValidationTrust;
}

export class ListenerTlsValidation extends core.Schema<ListenerTlsValidationArgs> {
  @core.attr(SubjectAlternativeNames)
  public subjectAlternativeNames?: SubjectAlternativeNames;

  @core.attr(ListenerTlsValidationTrust)
  public trust!: ListenerTlsValidationTrust;
}

export interface ListenerTlsArgs extends core.SchemaArgs {
  certificate: ListenerTlsCertificate;

  mode: string | core.StringOut;

  validation?: ListenerTlsValidation;
}

export class ListenerTls extends core.Schema<ListenerTlsArgs> {
  @core.attr(ListenerTlsCertificate)
  public certificate!: ListenerTlsCertificate;

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

  @core.attr(ListenerTlsValidation)
  public validation?: ListenerTlsValidation;
}

export interface ConnectionPoolTcpArgs extends core.SchemaArgs {
  maxConnections: number | core.NumberOut;
}

export class ConnectionPoolTcp extends core.Schema<ConnectionPoolTcpArgs> {
  @core.attr(Number)
  public maxConnections!: number | core.NumberOut;
}

export interface ConnectionPoolGrpcArgs extends core.SchemaArgs {
  maxRequests: number | core.NumberOut;
}

export class ConnectionPoolGrpc extends core.Schema<ConnectionPoolGrpcArgs> {
  @core.attr(Number)
  public maxRequests!: number | core.NumberOut;
}

export interface ConnectionPoolHttpArgs extends core.SchemaArgs {
  maxConnections: number | core.NumberOut;

  maxPendingRequests?: number | core.NumberOut;
}

export class ConnectionPoolHttp extends core.Schema<ConnectionPoolHttpArgs> {
  @core.attr(Number)
  public maxConnections!: number | core.NumberOut;

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

export interface ConnectionPoolHttp2Args extends core.SchemaArgs {
  maxRequests: number | core.NumberOut;
}

export class ConnectionPoolHttp2 extends core.Schema<ConnectionPoolHttp2Args> {
  @core.attr(Number)
  public maxRequests!: number | core.NumberOut;
}

export interface ConnectionPoolArgs extends core.SchemaArgs {
  grpc?: ConnectionPoolGrpc;

  http?: ConnectionPoolHttp;

  http2?: ConnectionPoolHttp2;

  tcp?: ConnectionPoolTcp;
}

export class ConnectionPool extends core.Schema<ConnectionPoolArgs> {
  @core.attr(ConnectionPoolGrpc)
  public grpc?: ConnectionPoolGrpc;

  @core.attr(ConnectionPoolHttp)
  public http?: ConnectionPoolHttp;

  @core.attr(ConnectionPoolHttp2)
  public http2?: ConnectionPoolHttp2;

  @core.attr(ConnectionPoolTcp)
  public tcp?: ConnectionPoolTcp;
}

export interface HealthCheckArgs extends core.SchemaArgs {
  healthyThreshold: number | core.NumberOut;

  intervalMillis: number | core.NumberOut;

  path?: string | core.StringOut;

  port?: number | core.NumberOut;

  protocol: string | core.StringOut;

  timeoutMillis: number | core.NumberOut;

  unhealthyThreshold: number | core.NumberOut;
}

export class HealthCheck extends core.Schema<HealthCheckArgs> {
  @core.attr(Number)
  public healthyThreshold!: number | core.NumberOut;

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

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

  @core.attr(Number, { computed: true })
  public port?: number | core.NumberOut;

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

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

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

export interface BaseEjectionDurationArgs extends core.SchemaArgs {
  unit: string | core.StringOut;

  value: number | core.NumberOut;
}

export class BaseEjectionDuration extends core.Schema<BaseEjectionDurationArgs> {
  @core.attr(String)
  public unit!: string | core.StringOut;

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

export interface IntervalArgs extends core.SchemaArgs {
  unit: string | core.StringOut;

  value: number | core.NumberOut;
}

export class Interval extends core.Schema<IntervalArgs> {
  @core.attr(String)
  public unit!: string | core.StringOut;

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

export interface OutlierDetectionArgs extends core.SchemaArgs {
  baseEjectionDuration: BaseEjectionDuration;

  interval: Interval;

  maxEjectionPercent: number | core.NumberOut;

  maxServerErrors: number | core.NumberOut;
}

export class OutlierDetection extends core.Schema<OutlierDetectionArgs> {
  @core.attr(BaseEjectionDuration)
  public baseEjectionDuration!: BaseEjectionDuration;

  @core.attr(Interval)
  public interval!: Interval;

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

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

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 {
  connectionPool?: ConnectionPool;

  healthCheck?: HealthCheck;

  outlierDetection?: OutlierDetection;

  portMapping: PortMapping;

  timeout?: Timeout;

  tls?: ListenerTls;
}

export class Listener extends core.Schema<ListenerArgs> {
  @core.attr(ConnectionPool)
  public connectionPool?: ConnectionPool;

  @core.attr(HealthCheck)
  public healthCheck?: HealthCheck;

  @core.attr(OutlierDetection)
  public outlierDetection?: OutlierDetection;

  @core.attr(PortMapping)
  public portMapping!: PortMapping;

  @core.attr(Timeout)
  public timeout?: Timeout;

  @core.attr(ListenerTls)
  public tls?: ListenerTls;
}

export interface AccessLogFileArgs extends core.SchemaArgs {
  path: string | core.StringOut;
}

export class AccessLogFile extends core.Schema<AccessLogFileArgs> {
  @core.attr(String)
  public path!: string | core.StringOut;
}

export interface AccessLogArgs extends core.SchemaArgs {
  file?: AccessLogFile;
}

export class AccessLog extends core.Schema<AccessLogArgs> {
  @core.attr(AccessLogFile)
  public file?: AccessLogFile;
}

export interface LoggingArgs extends core.SchemaArgs {
  accessLog?: AccessLog;
}

export class Logging extends core.Schema<LoggingArgs> {
  @core.attr(AccessLog)
  public accessLog?: AccessLog;
}

export interface AwsCloudMapArgs extends core.SchemaArgs {
  attributes?: core.Map<string, string> | core.MapOut<core.StringOut>;

  namespaceName: string | core.StringOut;

  serviceName: string | core.StringOut;
}

export class AwsCloudMap extends core.Schema<AwsCloudMapArgs> {
  @core.attr(String, { kind: "map" })
  public attributes?: core.Map<string, string> | core.MapOut<core.StringOut>;

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

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

export interface DnsArgs extends core.SchemaArgs {
  hostname: string | core.StringOut;
}

export class Dns extends core.Schema<DnsArgs> {
  @core.attr(String)
  public hostname!: string | core.StringOut;
}

export interface ServiceDiscoveryArgs extends core.SchemaArgs {
  awsCloudMap?: AwsCloudMap;

  dns?: Dns;
}

export class ServiceDiscovery extends core.Schema<ServiceDiscoveryArgs> {
  @core.attr(AwsCloudMap)
  public awsCloudMap?: AwsCloudMap;

  @core.attr(Dns)
  public dns?: Dns;
}

export interface SpecArgs extends core.SchemaArgs {
  backend?: core.Array<Backend> | core.ArrayOut<Backend>;

  backendDefaults?: BackendDefaults;

  listener?: Listener;

  logging?: Logging;

  serviceDiscovery?: ServiceDiscovery;
}

export class Spec extends core.Schema<SpecArgs> {
  @core.attr(Backend, { kind: "array" })
  public backend?: core.Array<Backend> | core.ArrayOut<Backend>;

  @core.attr(BackendDefaults)
  public backendDefaults?: BackendDefaults;

  @core.attr(Listener)
  public listener?: Listener;

  @core.attr(Logging)
  public logging?: Logging;

  @core.attr(ServiceDiscovery)
  public serviceDiscovery?: ServiceDiscovery;
}

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

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