com.github.dikhan.pagerduty.client.events.domain.AcknowledgeIncident Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pagerduty-client Show documentation
Show all versions of pagerduty-client Show documentation
Simple Java PagerDuty client with full integration with PagerDuty Events APIs
package com.github.dikhan.pagerduty.client.events.domain;
import org.apache.commons.lang3.StringUtils;
public class AcknowledgeIncident extends Incident {
private AcknowledgeIncident(IncidentBuilder builder) {
super(builder);
}
public static class AcknowledgeIncidentBuilder extends Incident.IncidentBuilder {
private AcknowledgeIncidentBuilder(String routingKey, String dedupKey) {
super(routingKey, EventAction.ACKNOWLEDGE);
if (StringUtils.isBlank(dedupKey)) {
throw new IllegalArgumentException("dedupKey must not be null, it is a mandatory param");
}
super.setDedupKey(dedupKey);
}
/**
* Method to newBuilder a new incident of type acknowledge
*
* @param routingKey The GUID of one of your "Generic API" services. This is the "Integration Key" listed on a
* Generic API's service detail page.
* @param dedupKey Identifies the incident to acknowledge
* @return Incident builder to be able to keep populating the instance with other properties
*/
public static AcknowledgeIncidentBuilder newBuilder(String routingKey, String dedupKey) {
return new AcknowledgeIncidentBuilder(routingKey, dedupKey);
}
@Override
public AcknowledgeIncident build() {
if (getPayload() == null) {
setPayload(Payload.Builder.createEmpty());
}
return new AcknowledgeIncident(this);
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy