# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.

# Painless definition of classes used by alerting plugin

class com.amazon.opendistroforelasticsearch.alerting.script.TriggerScript {
    Map getParams()
    boolean execute(TriggerExecutionContext)
    String[] PARAMETERS
}

class com.amazon.opendistroforelasticsearch.alerting.script.TriggerScript$Factory {
    TriggerScript newInstance(Map)
}

class com.amazon.opendistroforelasticsearch.alerting.script.TriggerExecutionContext {
    Monitor getMonitor()
    Trigger getTrigger()
    List getResults()
    java.time.Instant getPeriodStart()
    java.time.Instant getPeriodEnd()
    Alert getAlert()
    Exception getError()
}

class com.amazon.opendistroforelasticsearch.alerting.model.Monitor {
    String getId()
    long getVersion()
    String getName()
    boolean getEnabled()
}

class com.amazon.opendistroforelasticsearch.alerting.model.Trigger {
    String getId()
    String getName()
    String getSeverity()
    List getActions()
}

class com.amazon.opendistroforelasticsearch.alerting.model.action.Action {
    String getName()
}

class com.amazon.opendistroforelasticsearch.alerting.model.Alert {
    String getId()
    long getVersion()
    boolean isAcknowledged()
}