Skip to content

Commit

Permalink
Add change event example to README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
jpe42 committed Sep 21, 2023
1 parent 9b70c31 commit eaa5ced
Showing 1 changed file with 33 additions and 5 deletions.
38 changes: 33 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ var client=PagerDutyEventClient.build()
.authToken("AUTH_TOKEN")
.create();

var payload=PagerDutyEventPayload.build()
var payload=PagerDutyEventPayload.build()
.summary("summary")
.source("source")
.severity(PagerDutySeverity.critical)
Expand All @@ -34,11 +34,39 @@ var client=PagerDutyEventClient.build()
.create())
.create();

var triggerResponse=client.triggerDefaultRouteEvent(payload).join();
System.out.println(triggerResponse);
var triggerResponse=client.triggerDefaultRouteEvent(payload).join();
System.out.println(triggerResponse);

var resolveResponse=client.resolveEvent(triggerResponse.getDedupeKey()).join();
System.out.println(resolveResponse);
var resolveResponse=client.resolveEvent(triggerResponse.getDedupeKey()).join();
System.out.println(resolveResponse);
```

## Hello Change Event

```java
var client = PagerDutyEventClient.build()
.defaultClientName("CLIENT_NAME")
.defaultRoutingKey("INTEGRATION_KEY")
.authToken("AUTH_TOKEN")
.create();

var payload = PagerDutyChangeEventPayload.build()
.summary("test-summary")
.source("test-source")
.timestamp(ZonedDateTime.now(UTC))
.customDetails("test-num-metric", 1)
.customDetails("test-boolean", false)
.customDetails("test-string", "val")
.customDetails("test-json", "{\"test\": \"json\"}")
.link(PagerDutyLinkRef.build()
.href("https://github.com/comodal/pagerduty-client")
.text("Github pagerduty-client")
.create())
.create();


var changeEventResponse = client.defaultRouteChangeEvent(payload).join();
System.out.println(changeEventResponse);
```

## Library Layout
Expand Down

0 comments on commit eaa5ced

Please sign in to comment.