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

export interface HeadersArgs extends core.SchemaArgs {
  items?: core.Array<string> | core.ArrayOut<core.StringOut>;
}

export class Headers extends core.Schema<HeadersArgs> {
  @core.attr(String, { kind: "array" })
  public items?: core.Array<string> | core.ArrayOut<core.StringOut>;
}

export interface HeadersConfigArgs extends core.SchemaArgs {
  headerBehavior?: string | core.StringOut;

  headers?: Headers;
}

export class HeadersConfig extends core.Schema<HeadersConfigArgs> {
  @core.attr(String)
  public headerBehavior?: string | core.StringOut;

  @core.attr(Headers)
  public headers?: Headers;
}

export interface QueryStringsArgs extends core.SchemaArgs {
  items?: core.Array<string> | core.ArrayOut<core.StringOut>;
}

export class QueryStrings extends core.Schema<QueryStringsArgs> {
  @core.attr(String, { kind: "array" })
  public items?: core.Array<string> | core.ArrayOut<core.StringOut>;
}

export interface QueryStringsConfigArgs extends core.SchemaArgs {
  queryStringBehavior: string | core.StringOut;

  queryStrings?: QueryStrings;
}

export class QueryStringsConfig extends core.Schema<QueryStringsConfigArgs> {
  @core.attr(String)
  public queryStringBehavior!: string | core.StringOut;

  @core.attr(QueryStrings)
  public queryStrings?: QueryStrings;
}

export interface CookiesArgs extends core.SchemaArgs {
  items?: core.Array<string> | core.ArrayOut<core.StringOut>;
}

export class Cookies extends core.Schema<CookiesArgs> {
  @core.attr(String, { kind: "array" })
  public items?: core.Array<string> | core.ArrayOut<core.StringOut>;
}

export interface CookiesConfigArgs extends core.SchemaArgs {
  cookieBehavior: string | core.StringOut;

  cookies?: Cookies;
}

export class CookiesConfig extends core.Schema<CookiesConfigArgs> {
  @core.attr(String)
  public cookieBehavior!: string | core.StringOut;

  @core.attr(Cookies)
  public cookies?: Cookies;
}

export interface ParametersInCacheKeyAndForwardedToOriginArgs
  extends core.SchemaArgs {
  cookiesConfig: CookiesConfig;

  enableAcceptEncodingBrotli?: boolean | core.BooleanOut;

  enableAcceptEncodingGzip?: boolean | core.BooleanOut;

  headersConfig: HeadersConfig;

  queryStringsConfig: QueryStringsConfig;
}

export class ParametersInCacheKeyAndForwardedToOrigin extends core.Schema<ParametersInCacheKeyAndForwardedToOriginArgs> {
  @core.attr(CookiesConfig)
  public cookiesConfig!: CookiesConfig;

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

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

  @core.attr(HeadersConfig)
  public headersConfig!: HeadersConfig;

  @core.attr(QueryStringsConfig)
  public queryStringsConfig!: QueryStringsConfig;
}

export interface CachePolicyArgs extends core.ResourceArgs {
  comment?: string | core.StringOut;

  defaultTtl?: number | core.NumberOut;

  maxTtl?: number | core.NumberOut;

  minTtl?: number | core.NumberOut;

  name: string | core.StringOut;

  parametersInCacheKeyAndForwardedToOrigin: ParametersInCacheKeyAndForwardedToOrigin;
}

export class CachePolicy extends core.Resource<CachePolicyArgs> {
  @core.attr(String)
  public comment?: string | core.StringOut;

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

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

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

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

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

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

  @core.attr(ParametersInCacheKeyAndForwardedToOrigin)
  public parametersInCacheKeyAndForwardedToOrigin!: ParametersInCacheKeyAndForwardedToOrigin;

  constructor(name: string, args?: CachePolicyArgs) {
    super(name, "aws_cloudfront_cache_policy", args);
  }

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