Skip to content

Latest commit

 

History

History
276 lines (212 loc) · 10.6 KB

README.md

File metadata and controls

276 lines (212 loc) · 10.6 KB

Changes

(changes())

Overview

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

Available Operations

apply

Apply change

Example Usage

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;
        }
    }
}

Parameters

Parameter Type Required Description
changeId String ✔️ N/A

Response

Optional<? extends co.novu.co.novu.sdk.models.operations.ChangesControllerApplyDiffResponse>

Errors

Error Object Status Code Content Type
models/errors/SDKError 4xx-5xx /

applyBulk

Apply changes

Example Usage

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;
        }
    }
}

Parameters

Parameter Type Required Description
request co.novu.co.novu.sdk.models.components.BulkApplyChangeDto ✔️ The request object to use for the request.

Response

Optional<? extends co.novu.co.novu.sdk.models.operations.ChangesControllerBulkApplyDiffResponse>

Errors

Error Object Status Code Content Type
models/errors/SDKError 4xx-5xx /

count

Get changes count

Example Usage

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;
        }
    }
}

Response

Optional<? extends co.novu.co.novu.sdk.models.operations.ChangesControllerGetChangesCountResponse>

Errors

Error Object Status Code Content Type
models/errors/SDKError 4xx-5xx /

retrieve

Get changes

Example Usage

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;
        }
    }
}

Parameters

Parameter Type Required Description
request co.novu.co.novu.sdk.models.operations.ChangesControllerGetChangesRequest ✔️ The request object to use for the request.

Response

Optional<? extends co.novu.co.novu.sdk.models.operations.ChangesControllerGetChangesResponse>

Errors

Error Object Status Code Content Type
models/errors/SDKError 4xx-5xx /