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

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

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

  uid: number | core.NumberOut;
}

export class PosixUser extends core.Schema<PosixUserArgs> {
  @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 CreationInfoArgs extends core.SchemaArgs {
  ownerGid: number | core.NumberOut;

  ownerUid: number | core.NumberOut;

  permissions: string | core.StringOut;
}

export class CreationInfo extends core.Schema<CreationInfoArgs> {
  @core.attr(Number)
  public ownerGid!: number | core.NumberOut;

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

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

export interface RootDirectoryArgs extends core.SchemaArgs {
  creationInfo?: CreationInfo;

  path?: string | core.StringOut;
}

export class RootDirectory extends core.Schema<RootDirectoryArgs> {
  @core.attr(CreationInfo, { computed: true })
  public creationInfo?: CreationInfo;

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

export interface AccessPointArgs extends core.ResourceArgs {
  fileSystemId: string | core.StringOut;

  posixUser?: PosixUser;

  rootDirectory?: RootDirectory;

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

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

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

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

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

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

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

  @core.attr(PosixUser)
  public posixUser?: PosixUser;

  @core.attr(RootDirectory, { computed: true })
  public rootDirectory?: RootDirectory;

  @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?: AccessPointArgs) {
    super(name, "aws_efs_access_point", args);
  }

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