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

export interface PolicyDetailsParametersArgs extends core.SchemaArgs {
  excludeBootVolume?: boolean | core.BooleanOut;

  noReboot?: boolean | core.BooleanOut;
}

export class PolicyDetailsParameters extends core.Schema<PolicyDetailsParametersArgs> {
  @core.attr(Boolean)
  public excludeBootVolume?: boolean | core.BooleanOut;

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

export interface FastRestoreRuleArgs extends core.SchemaArgs {
  availabilityZones: core.Array<string> | core.ArrayOut<core.StringOut>;

  count?: number | core.NumberOut;

  interval?: number | core.NumberOut;

  intervalUnit?: string | core.StringOut;
}

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

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

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

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

export interface ScheduleRetainRuleArgs extends core.SchemaArgs {
  count?: number | core.NumberOut;

  interval?: number | core.NumberOut;

  intervalUnit?: string | core.StringOut;
}

export class ScheduleRetainRule extends core.Schema<ScheduleRetainRuleArgs> {
  @core.attr(Number)
  public count?: number | core.NumberOut;

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

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

export interface ShareRuleArgs extends core.SchemaArgs {
  targetAccounts: core.Array<string> | core.ArrayOut<core.StringOut>;

  unshareInterval?: number | core.NumberOut;

  unshareIntervalUnit?: string | core.StringOut;
}

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

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

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

export interface CreateRuleArgs extends core.SchemaArgs {
  cronExpression?: string | core.StringOut;

  interval?: number | core.NumberOut;

  intervalUnit?: string | core.StringOut;

  location?: string | core.StringOut;

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

export class CreateRule extends core.Schema<CreateRuleArgs> {
  @core.attr(String)
  public cronExpression?: string | core.StringOut;

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

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

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

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

export interface ScheduleDeprecateRuleArgs extends core.SchemaArgs {
  count?: number | core.NumberOut;

  interval?: number | core.NumberOut;

  intervalUnit?: string | core.StringOut;
}

export class ScheduleDeprecateRule extends core.Schema<ScheduleDeprecateRuleArgs> {
  @core.attr(Number)
  public count?: number | core.NumberOut;

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

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

export interface CrossRegionCopyRuleDeprecateRuleArgs extends core.SchemaArgs {
  interval: number | core.NumberOut;

  intervalUnit: string | core.StringOut;
}

export class CrossRegionCopyRuleDeprecateRule extends core.Schema<CrossRegionCopyRuleDeprecateRuleArgs> {
  @core.attr(Number)
  public interval!: number | core.NumberOut;

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

export interface CrossRegionCopyRuleRetainRuleArgs extends core.SchemaArgs {
  interval: number | core.NumberOut;

  intervalUnit: string | core.StringOut;
}

export class CrossRegionCopyRuleRetainRule extends core.Schema<CrossRegionCopyRuleRetainRuleArgs> {
  @core.attr(Number)
  public interval!: number | core.NumberOut;

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

export interface CrossRegionCopyRuleArgs extends core.SchemaArgs {
  cmkArn?: string | core.StringOut;

  copyTags?: boolean | core.BooleanOut;

  deprecateRule?: CrossRegionCopyRuleDeprecateRule;

  encrypted: boolean | core.BooleanOut;

  retainRule?: CrossRegionCopyRuleRetainRule;

  target: string | core.StringOut;
}

export class CrossRegionCopyRule extends core.Schema<CrossRegionCopyRuleArgs> {
  @core.attr(String)
  public cmkArn?: string | core.StringOut;

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

  @core.attr(CrossRegionCopyRuleDeprecateRule)
  public deprecateRule?: CrossRegionCopyRuleDeprecateRule;

  @core.attr(Boolean)
  public encrypted!: boolean | core.BooleanOut;

  @core.attr(CrossRegionCopyRuleRetainRule)
  public retainRule?: CrossRegionCopyRuleRetainRule;

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

export interface ScheduleArgs extends core.SchemaArgs {
  copyTags?: boolean | core.BooleanOut;

  createRule: CreateRule;

  crossRegionCopyRule?:
    | core.Array<CrossRegionCopyRule>
    | core.ArrayOut<CrossRegionCopyRule>;

  deprecateRule?: ScheduleDeprecateRule;

  fastRestoreRule?: FastRestoreRule;

  name: string | core.StringOut;

  retainRule: ScheduleRetainRule;

  shareRule?: ShareRule;

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

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

export class Schedule extends core.Schema<ScheduleArgs> {
  @core.attr(Boolean, { computed: true })
  public copyTags?: boolean | core.BooleanOut;

  @core.attr(CreateRule)
  public createRule!: CreateRule;

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

  @core.attr(ScheduleDeprecateRule)
  public deprecateRule?: ScheduleDeprecateRule;

  @core.attr(FastRestoreRule)
  public fastRestoreRule?: FastRestoreRule;

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

  @core.attr(ScheduleRetainRule)
  public retainRule!: ScheduleRetainRule;

  @core.attr(ShareRule)
  public shareRule?: ShareRule;

  @core.attr(String, { kind: "map" })
  public tagsToAdd?: core.Map<string, string> | core.MapOut<core.StringOut>;

  @core.attr(String, { kind: "map" })
  public variableTags?: core.Map<string, string> | core.MapOut<core.StringOut>;
}

export interface EncryptionConfigurationArgs extends core.SchemaArgs {
  cmkArn?: string | core.StringOut;

  encrypted?: boolean | core.BooleanOut;
}

export class EncryptionConfiguration extends core.Schema<EncryptionConfigurationArgs> {
  @core.attr(String)
  public cmkArn?: string | core.StringOut;

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

export interface CrossRegionCopyArgs extends core.SchemaArgs {
  encryptionConfiguration: EncryptionConfiguration;

  retainRule?: CrossRegionCopyRuleRetainRule;

  target: string | core.StringOut;
}

export class CrossRegionCopy extends core.Schema<CrossRegionCopyArgs> {
  @core.attr(EncryptionConfiguration)
  public encryptionConfiguration!: EncryptionConfiguration;

  @core.attr(CrossRegionCopyRuleRetainRule)
  public retainRule?: CrossRegionCopyRuleRetainRule;

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

export interface ActionArgs extends core.SchemaArgs {
  crossRegionCopy: core.Array<CrossRegionCopy> | core.ArrayOut<CrossRegionCopy>;

  name: string | core.StringOut;
}

export class Action extends core.Schema<ActionArgs> {
  @core.attr(CrossRegionCopy, { kind: "array" })
  public crossRegionCopy!:
    | core.Array<CrossRegionCopy>
    | core.ArrayOut<CrossRegionCopy>;

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

export interface EventSourceParametersArgs extends core.SchemaArgs {
  descriptionRegex: string | core.StringOut;

  eventType: string | core.StringOut;

  snapshotOwner: core.Array<string> | core.ArrayOut<core.StringOut>;
}

export class EventSourceParameters extends core.Schema<EventSourceParametersArgs> {
  @core.attr(String)
  public descriptionRegex!: string | core.StringOut;

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

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

export interface EventSourceArgs extends core.SchemaArgs {
  parameters: EventSourceParameters;

  type: string | core.StringOut;
}

export class EventSource extends core.Schema<EventSourceArgs> {
  @core.attr(EventSourceParameters)
  public parameters!: EventSourceParameters;

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

export interface PolicyDetailsArgs extends core.SchemaArgs {
  action?: Action;

  eventSource?: EventSource;

  parameters?: PolicyDetailsParameters;

  policyType?: string | core.StringOut;

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

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

  schedule?: core.Array<Schedule> | core.ArrayOut<Schedule>;

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

export class PolicyDetails extends core.Schema<PolicyDetailsArgs> {
  @core.attr(Action)
  public action?: Action;

  @core.attr(EventSource)
  public eventSource?: EventSource;

  @core.attr(PolicyDetailsParameters)
  public parameters?: PolicyDetailsParameters;

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

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

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

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

  @core.attr(String, { kind: "map" })
  public targetTags?: core.Map<string, string> | core.MapOut<core.StringOut>;
}

export interface LifecyclePolicyArgs extends core.ResourceArgs {
  /**
   * (Required) A description for the DLM lifecycle policy.
   */
  description: string | core.StringOut;

  /**
   * (Required) The ARN of an IAM role that is able to be assumed by the DLM service.
   */
  executionRoleArn: string | core.StringOut;

  /**
   * (Required) See the [`policy_details` configuration](#policy-details-arguments) block. Max of 1.
   */
  policyDetails: PolicyDetails;

  /**
   * (Optional) Whether the lifecycle policy should be enabled or disabled. `ENABLED` or `DISABLED` are v
   * alid values. Defaults to `ENABLED`.
   */
  state?: string | core.StringOut;

  /**
   * (Optional) Key-value map of resource tags. If configured with a provider [`default_tags` configurati
   * on block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configurati
   * on-block) present, tags with matching keys will overwrite those defined at the provider-level.
   */
  tags?: core.Map<string, string> | core.MapOut<core.StringOut>;

  /**
   * A map of tags assigned to the resource, including those inherited from the provider [`default_tags`
   * configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-
   * configuration-block).
   */
  tagsAll?: core.Map<string, string> | core.MapOut<core.StringOut>;
}

export class LifecyclePolicy extends core.Resource<LifecyclePolicyArgs> {
  /**
   * Amazon Resource Name (ARN) of the DLM Lifecycle Policy.
   */
  @core.attr(String, { computed: true })
  public arn!: string | core.StringOut;

  /**
   * (Required) A description for the DLM lifecycle policy.
   */
  @core.attr(String)
  public description!: string | core.StringOut;

  /**
   * (Required) The ARN of an IAM role that is able to be assumed by the DLM service.
   */
  @core.attr(String)
  public executionRoleArn!: string | core.StringOut;

  /**
   * Identifier of the DLM Lifecycle Policy.
   */
  @core.attr(String, { computed: true })
  public id!: string | core.StringOut;

  /**
   * (Required) See the [`policy_details` configuration](#policy-details-arguments) block. Max of 1.
   */
  @core.attr(PolicyDetails)
  public policyDetails!: PolicyDetails;

  /**
   * (Optional) Whether the lifecycle policy should be enabled or disabled. `ENABLED` or `DISABLED` are v
   * alid values. Defaults to `ENABLED`.
   */
  @core.attr(String)
  public state?: string | core.StringOut;

  /**
   * (Optional) Key-value map of resource tags. If configured with a provider [`default_tags` configurati
   * on block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configurati
   * on-block) present, tags with matching keys will overwrite those defined at the provider-level.
   */
  @core.attr(String, { kind: "map" })
  public tags?: core.Map<string, string> | core.MapOut<core.StringOut>;

  /**
   * A map of tags assigned to the resource, including those inherited from the provider [`default_tags`
   * configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-
   * configuration-block).
   */
  @core.attr(String, { computed: true, kind: "map" })
  public tagsAll?: core.Map<string, string> | core.MapOut<core.StringOut>;

  constructor(name: string, args?: LifecyclePolicyArgs) {
    super(name, "aws_dlm_lifecycle_policy", args);
  }

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