package io.delphi.qa.auto.awsmfrw.models.aws.cw;

import com.google.gson.annotations.Expose;
import io.delphi.qa.auto.awsmfrw.common_baby.IsaCommonMethods;
import lombok.AllArgsConstructor;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.ToString;
import org.aeonbits.owner.util.Collections;

import java.util.List;
import java.util.UUID;

@Getter
@ToString
@EqualsAndHashCode
@AllArgsConstructor
public class MlCwEventReprocessing {

  public MlCwEventReprocessing() {
      this.account = "{{account-id}}";
      this.detail = new Detail();
      this.detailType = "Scheduled Event";
      this.optionalConfig = new OptionalConfig();
      this.id = UUID.randomUUID().toString();
      this.region = IsaCommonMethods.getAwsProfileRegion();
      this.resources = Collections.list("arn:aws:events:us-east-1:123456789012:rule/ExampleRule");
      this.source = "aws.events";
      this.time = "yyyy-MM-dd'T'HH:mm:ss";
  }

  @Expose private String account;
  @Expose private Detail detail;

  private String detailType;

  private OptionalConfig optionalConfig;

  @Expose private String id;

  @Expose private String region;
  @Expose private List<Reprocessing> reprocessing;

  @Expose private List<String> resources;

  private String source;
  @Expose private String time;

  public MlCwEventReprocessing withOptionalConfig(OptionalConfig xOptionalConfig) {
    this.optionalConfig = xOptionalConfig;
    return this;
  }

  public MlCwEventReprocessing withTime(String xTime) {
    this.time = xTime;
    return this;
  }

  public MlCwEventReprocessing withReprocessing(List<Reprocessing> xReprocessing) {
    this.reprocessing = xReprocessing;
    return this;
  }
}
