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

export interface ResourceCreationLimitPolicyArgs extends core.SchemaArgs {
  newGameSessionsPerCreator?: number | core.NumberOut;

  policyPeriodInMinutes?: number | core.NumberOut;
}

export class ResourceCreationLimitPolicy extends core.Schema<ResourceCreationLimitPolicyArgs> {
  @core.attr(Number)
  public newGameSessionsPerCreator?: number | core.NumberOut;

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

export interface ServerProcessArgs extends core.SchemaArgs {
  concurrentExecutions: number | core.NumberOut;

  launchPath: string | core.StringOut;

  parameters?: string | core.StringOut;
}

export class ServerProcess extends core.Schema<ServerProcessArgs> {
  @core.attr(Number)
  public concurrentExecutions!: number | core.NumberOut;

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

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

export interface RuntimeConfigurationArgs extends core.SchemaArgs {
  gameSessionActivationTimeoutSeconds?: number | core.NumberOut;

  maxConcurrentGameSessionActivations?: number | core.NumberOut;

  serverProcess?: core.Array<ServerProcess> | core.ArrayOut<ServerProcess>;
}

export class RuntimeConfiguration extends core.Schema<RuntimeConfigurationArgs> {
  @core.attr(Number)
  public gameSessionActivationTimeoutSeconds?: number | core.NumberOut;

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

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

export interface CertificateConfigurationArgs extends core.SchemaArgs {
  certificateType?: string | core.StringOut;
}

export class CertificateConfiguration extends core.Schema<CertificateConfigurationArgs> {
  @core.attr(String)
  public certificateType?: string | core.StringOut;
}

export interface Ec2InboundPermissionArgs extends core.SchemaArgs {
  fromPort: number | core.NumberOut;

  ipRange: string | core.StringOut;

  protocol: string | core.StringOut;

  toPort: number | core.NumberOut;
}

export class Ec2InboundPermission extends core.Schema<Ec2InboundPermissionArgs> {
  @core.attr(Number)
  public fromPort!: number | core.NumberOut;

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

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

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

export interface FleetArgs extends core.ResourceArgs {
  buildId?: string | core.StringOut;

  certificateConfiguration?: CertificateConfiguration;

  description?: string | core.StringOut;

  ec2InboundPermission?:
    | core.Array<Ec2InboundPermission>
    | core.ArrayOut<Ec2InboundPermission>;

  ec2InstanceType: string | core.StringOut;

  fleetType?: string | core.StringOut;

  instanceRoleArn?: string | core.StringOut;

  metricGroups?: core.Array<string> | core.ArrayOut<core.StringOut>;

  name: string | core.StringOut;

  newGameSessionProtectionPolicy?: string | core.StringOut;

  resourceCreationLimitPolicy?: ResourceCreationLimitPolicy;

  runtimeConfiguration?: RuntimeConfiguration;

  scriptId?: string | core.StringOut;

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

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

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

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

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

  @core.attr(CertificateConfiguration, { computed: true })
  public certificateConfiguration?: CertificateConfiguration;

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

  @core.attr(Ec2InboundPermission, { computed: true, kind: "array" })
  public ec2InboundPermission?:
    | core.Array<Ec2InboundPermission>
    | core.ArrayOut<Ec2InboundPermission>;

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

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

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

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

  @core.attr(String, { computed: true, kind: "array" })
  public logPaths!: core.Array<string> | core.ArrayOut<core.StringOut>;

  @core.attr(String, { computed: true, kind: "array" })
  public metricGroups?: core.Array<string> | core.ArrayOut<core.StringOut>;

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

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

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

  @core.attr(ResourceCreationLimitPolicy)
  public resourceCreationLimitPolicy?: ResourceCreationLimitPolicy;

  @core.attr(RuntimeConfiguration)
  public runtimeConfiguration?: RuntimeConfiguration;

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

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

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

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