|
| 1 | +// Edit degradation update returns "OK" response |
| 2 | + |
| 3 | +import com.datadog.api.client.ApiClient; |
| 4 | +import com.datadog.api.client.ApiException; |
| 5 | +import com.datadog.api.client.v2.api.StatusPagesApi; |
| 6 | +import com.datadog.api.client.v2.model.DegradationUpdate; |
| 7 | +import com.datadog.api.client.v2.model.PatchDegradationUpdateRequest; |
| 8 | +import com.datadog.api.client.v2.model.PatchDegradationUpdateRequestData; |
| 9 | +import com.datadog.api.client.v2.model.PatchDegradationUpdateRequestDataAttributes; |
| 10 | +import com.datadog.api.client.v2.model.PatchDegradationUpdateRequestDataAttributesStatus; |
| 11 | +import com.datadog.api.client.v2.model.PatchDegradationUpdateRequestDataType; |
| 12 | +import java.util.UUID; |
| 13 | + |
| 14 | +public class Example { |
| 15 | + public static void main(String[] args) { |
| 16 | + ApiClient defaultClient = ApiClient.getDefaultApiClient(); |
| 17 | + StatusPagesApi apiInstance = new StatusPagesApi(defaultClient); |
| 18 | + |
| 19 | + PatchDegradationUpdateRequest body = |
| 20 | + new PatchDegradationUpdateRequest() |
| 21 | + .data( |
| 22 | + new PatchDegradationUpdateRequestData() |
| 23 | + .attributes( |
| 24 | + new PatchDegradationUpdateRequestDataAttributes() |
| 25 | + .description( |
| 26 | + "We've identified the source of the latency increase and are" |
| 27 | + + " deploying a fix.") |
| 28 | + .status(PatchDegradationUpdateRequestDataAttributesStatus.IDENTIFIED)) |
| 29 | + .id("00000000-0000-0000-0000-000000000000") |
| 30 | + .type(PatchDegradationUpdateRequestDataType.DEGRADATION_UPDATES)); |
| 31 | + |
| 32 | + try { |
| 33 | + DegradationUpdate result = |
| 34 | + apiInstance.editDegradationUpdate( |
| 35 | + UUID.fromString("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"), |
| 36 | + UUID.fromString("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"), |
| 37 | + UUID.fromString("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"), |
| 38 | + body); |
| 39 | + System.out.println(result); |
| 40 | + } catch (ApiException e) { |
| 41 | + System.err.println("Exception when calling StatusPagesApi#editDegradationUpdate"); |
| 42 | + System.err.println("Status code: " + e.getCode()); |
| 43 | + System.err.println("Reason: " + e.getResponseBody()); |
| 44 | + System.err.println("Response headers: " + e.getResponseHeaders()); |
| 45 | + e.printStackTrace(); |
| 46 | + } |
| 47 | + } |
| 48 | +} |
0 commit comments