(changes())
Changes represent a change in state of an environment. They are analagous to a pending pull request in git, enabling you to test changes before they are applied to your environment and atomically apply them when you are ready.
https://docs.novu.co/platform/environments#promoting-pending-changes-to-production
Apply change
package hello.world;
import co.novu.co.novu.sdk.Novu;
import co.novu.co.novu.sdk.models.components.*;
import co.novu.co.novu.sdk.models.components.Security;
import co.novu.co.novu.sdk.models.operations.*;
import co.novu.co.novu.sdk.utils.EventStream;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.time.LocalDate;
import java.time.OffsetDateTime;
import java.util.Optional;
import org.openapitools.jackson.nullable.JsonNullable;
import static java.util.Map.entry;
public class Application {
public static void main(String[] args) throws Exception {
try {
Novu sdk = Novu.builder()
.apiKey("<YOUR_API_KEY_HERE>")
.build();
ChangesControllerApplyDiffResponse res = sdk.changes().apply()
.changeId("<value>")
.call();
if (res.changeResponseDtos().isPresent()) {
// handle response
}
} catch (co.novu.co.novu.sdk.models.errors.SDKError e) {
// handle exception
throw e;
} catch (Exception e) {
// handle exception
throw e;
}
}
}
Parameter | Type | Required | Description |
---|---|---|---|
changeId |
String | ✔️ | N/A |
Optional<? extends co.novu.co.novu.sdk.models.operations.ChangesControllerApplyDiffResponse>
Error Object | Status Code | Content Type |
---|---|---|
models/errors/SDKError | 4xx-5xx | / |
Apply changes
package hello.world;
import co.novu.co.novu.sdk.Novu;
import co.novu.co.novu.sdk.models.components.*;
import co.novu.co.novu.sdk.models.components.Security;
import co.novu.co.novu.sdk.models.operations.*;
import co.novu.co.novu.sdk.utils.EventStream;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.time.LocalDate;
import java.time.OffsetDateTime;
import java.util.Optional;
import org.openapitools.jackson.nullable.JsonNullable;
import static java.util.Map.entry;
public class Application {
public static void main(String[] args) throws Exception {
try {
Novu sdk = Novu.builder()
.apiKey("<YOUR_API_KEY_HERE>")
.build();
BulkApplyChangeDto req = BulkApplyChangeDto.builder()
.changeIds(java.util.List.of(
"<value>"))
.build();
ChangesControllerBulkApplyDiffResponse res = sdk.changes().applyBulk()
.request(req)
.call();
if (res.changeResponseDtos().isPresent()) {
// handle response
}
} catch (co.novu.co.novu.sdk.models.errors.SDKError e) {
// handle exception
throw e;
} catch (Exception e) {
// handle exception
throw e;
}
}
}
Parameter | Type | Required | Description |
---|---|---|---|
request |
co.novu.co.novu.sdk.models.components.BulkApplyChangeDto | ✔️ | The request object to use for the request. |
Optional<? extends co.novu.co.novu.sdk.models.operations.ChangesControllerBulkApplyDiffResponse>
Error Object | Status Code | Content Type |
---|---|---|
models/errors/SDKError | 4xx-5xx | / |
Get changes count
package hello.world;
import co.novu.co.novu.sdk.Novu;
import co.novu.co.novu.sdk.models.components.*;
import co.novu.co.novu.sdk.models.components.Security;
import co.novu.co.novu.sdk.models.operations.*;
import co.novu.co.novu.sdk.utils.EventStream;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.time.LocalDate;
import java.time.OffsetDateTime;
import java.util.Optional;
import org.openapitools.jackson.nullable.JsonNullable;
import static java.util.Map.entry;
public class Application {
public static void main(String[] args) throws Exception {
try {
Novu sdk = Novu.builder()
.apiKey("<YOUR_API_KEY_HERE>")
.build();
ChangesControllerGetChangesCountResponse res = sdk.changes().count()
.call();
if (res.dataNumberDto().isPresent()) {
// handle response
}
} catch (co.novu.co.novu.sdk.models.errors.SDKError e) {
// handle exception
throw e;
} catch (Exception e) {
// handle exception
throw e;
}
}
}
Optional<? extends co.novu.co.novu.sdk.models.operations.ChangesControllerGetChangesCountResponse>
Error Object | Status Code | Content Type |
---|---|---|
models/errors/SDKError | 4xx-5xx | / |
Get changes
package hello.world;
import co.novu.co.novu.sdk.Novu;
import co.novu.co.novu.sdk.models.components.*;
import co.novu.co.novu.sdk.models.components.Security;
import co.novu.co.novu.sdk.models.operations.*;
import co.novu.co.novu.sdk.utils.EventStream;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.time.LocalDate;
import java.time.OffsetDateTime;
import java.util.Optional;
import org.openapitools.jackson.nullable.JsonNullable;
import static java.util.Map.entry;
public class Application {
public static void main(String[] args) throws Exception {
try {
Novu sdk = Novu.builder()
.apiKey("<YOUR_API_KEY_HERE>")
.build();
ChangesControllerGetChangesRequest req = ChangesControllerGetChangesRequest.builder()
.promoted("<value>")
.build();
ChangesControllerGetChangesResponse res = sdk.changes().retrieve()
.request(req)
.call();
if (res.changesResponseDto().isPresent()) {
// handle response
}
} catch (co.novu.co.novu.sdk.models.errors.SDKError e) {
// handle exception
throw e;
} catch (Exception e) {
// handle exception
throw e;
}
}
}
Parameter | Type | Required | Description |
---|---|---|---|
request |
co.novu.co.novu.sdk.models.operations.ChangesControllerGetChangesRequest | ✔️ | The request object to use for the request. |
Optional<? extends co.novu.co.novu.sdk.models.operations.ChangesControllerGetChangesResponse>
Error Object | Status Code | Content Type |
---|---|---|
models/errors/SDKError | 4xx-5xx | / |