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

export interface HomeDirectoryMappingsArgs extends core.SchemaArgs {
  entry: string | core.StringOut;

  target: string | core.StringOut;
}

export class HomeDirectoryMappings extends core.Schema<HomeDirectoryMappingsArgs> {
  @core.attr(String)
  public entry!: string | core.StringOut;

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

export interface PosixProfileArgs extends core.SchemaArgs {
  gid: number | core.NumberOut;

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

  uid: number | core.NumberOut;
}

export class PosixProfile extends core.Schema<PosixProfileArgs> {
  @core.attr(Number)
  public gid!: number | core.NumberOut;

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

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

export interface AccessArgs extends core.ResourceArgs {
  externalId: string | core.StringOut;

  homeDirectory?: string | core.StringOut;

  homeDirectoryMappings?:
    | core.Array<HomeDirectoryMappings>
    | core.ArrayOut<HomeDirectoryMappings>;

  homeDirectoryType?: string | core.StringOut;

  policy?: string | core.StringOut;

  posixProfile?: PosixProfile;

  role?: string | core.StringOut;

  serverId: string | core.StringOut;
}

export class Access extends core.Resource<AccessArgs> {
  @core.attr(String)
  public externalId!: string | core.StringOut;

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

  @core.attr(HomeDirectoryMappings, { kind: "array" })
  public homeDirectoryMappings?:
    | core.Array<HomeDirectoryMappings>
    | core.ArrayOut<HomeDirectoryMappings>;

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

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

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

  @core.attr(PosixProfile)
  public posixProfile?: PosixProfile;

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

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

  constructor(name: string, args?: AccessArgs) {
    super(name, "aws_transfer_access", args);
  }

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