Skip to content

Commit

Permalink
feat(generated): consume openapi definition 1.0.0-dev0.1.6
Browse files Browse the repository at this point in the history
Generated SDK source code using:
- Generator version 3.85.0
- Specification version 1.0.0-dev0.1.6
- Automation (cloudant-sdks) version 649772b

Signed-off-by: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com>
  • Loading branch information
cloudant-sdks-automation authored and mojito317 committed Feb 12, 2024
1 parent fbd6062 commit f73186f
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -406,12 +406,18 @@ public ServiceCall<DbUpdates> getDbUpdates(GetDbUpdatesOptions getDbUpdatesOptio
builder.header(header.getKey(), header.getValue());
}
builder.header("Accept", "application/json");
if (getDbUpdatesOptions.descending() != null) {
builder.query("descending", String.valueOf(getDbUpdatesOptions.descending()));
}
if (getDbUpdatesOptions.feed() != null) {
builder.query("feed", String.valueOf(getDbUpdatesOptions.feed()));
}
if (getDbUpdatesOptions.heartbeat() != null) {
builder.query("heartbeat", String.valueOf(getDbUpdatesOptions.heartbeat()));
}
if (getDbUpdatesOptions.limit() != null) {
builder.query("limit", String.valueOf(getDbUpdatesOptions.limit()));
}
if (getDbUpdatesOptions.timeout() != null) {
builder.query("timeout", String.valueOf(getDbUpdatesOptions.timeout()));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,21 @@ public interface Feed {
String NORMAL = "normal";
}

protected Boolean descending;
protected String feed;
protected Long heartbeat;
protected Long limit;
protected Long timeout;
protected String since;

/**
* Builder.
*/
public static class Builder {
private Boolean descending;
private String feed;
private Long heartbeat;
private Long limit;
private Long timeout;
private String since;

Expand All @@ -53,8 +57,10 @@ public static class Builder {
* @param getDbUpdatesOptions the instance to initialize the Builder with
*/
private Builder(GetDbUpdatesOptions getDbUpdatesOptions) {
this.descending = getDbUpdatesOptions.descending;
this.feed = getDbUpdatesOptions.feed;
this.heartbeat = getDbUpdatesOptions.heartbeat;
this.limit = getDbUpdatesOptions.limit;
this.timeout = getDbUpdatesOptions.timeout;
this.since = getDbUpdatesOptions.since;
}
Expand All @@ -74,6 +80,17 @@ public GetDbUpdatesOptions build() {
return new GetDbUpdatesOptions(this);
}

/**
* Set the descending.
*
* @param descending the descending
* @return the GetDbUpdatesOptions builder
*/
public Builder descending(Boolean descending) {
this.descending = descending;
return this;
}

/**
* Set the feed.
*
Expand All @@ -96,6 +113,17 @@ public Builder heartbeat(long heartbeat) {
return this;
}

/**
* Set the limit.
*
* @param limit the limit
* @return the GetDbUpdatesOptions builder
*/
public Builder limit(long limit) {
this.limit = limit;
return this;
}

/**
* Set the timeout.
*
Expand All @@ -122,8 +150,10 @@ public Builder since(String since) {
protected GetDbUpdatesOptions() { }

protected GetDbUpdatesOptions(Builder builder) {
descending = builder.descending;
feed = builder.feed;
heartbeat = builder.heartbeat;
limit = builder.limit;
timeout = builder.timeout;
since = builder.since;
}
Expand All @@ -137,6 +167,17 @@ public Builder newBuilder() {
return new Builder(this);
}

/**
* Gets the descending.
*
* Query parameter to specify whether to return the documents in descending by key order.
*
* @return the descending
*/
public Boolean descending() {
return descending;
}

/**
* Gets the feed.
*
Expand Down Expand Up @@ -170,6 +211,17 @@ public Long heartbeat() {
return heartbeat;
}

/**
* Gets the limit.
*
* Query parameter to specify the number of returned documents to limit the result to.
*
* @return the limit
*/
public Long limit() {
return limit;
}

/**
* Gets the timeout.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -351,8 +351,10 @@ public void testPutCapacityThroughputConfiguration() throws Exception {
public void testGetDbUpdates() throws Exception {
try {
GetDbUpdatesOptions getDbUpdatesOptions = new GetDbUpdatesOptions.Builder()
.descending(false)
.feed("normal")
.heartbeat(Long.valueOf("0"))
.limit(Long.valueOf("0"))
.timeout(Long.valueOf("60000"))
.since("0")
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -462,8 +462,10 @@ public void testGetDbUpdatesWOptions() throws Throwable {

// Construct an instance of the GetDbUpdatesOptions model
GetDbUpdatesOptions getDbUpdatesOptionsModel = new GetDbUpdatesOptions.Builder()
.descending(false)
.feed("normal")
.heartbeat(Long.valueOf("0"))
.limit(Long.valueOf("0"))
.timeout(Long.valueOf("60000"))
.since("0")
.build();
Expand All @@ -484,8 +486,10 @@ public void testGetDbUpdatesWOptions() throws Throwable {
// Verify query params
Map<String, String> query = TestUtilities.parseQueryString(request);
assertNotNull(query);
assertEquals(Boolean.valueOf(query.get("descending")), Boolean.valueOf(false));
assertEquals(query.get("feed"), "normal");
assertEquals(Long.valueOf(query.get("heartbeat")), Long.valueOf("0"));
assertEquals(Long.valueOf(query.get("limit")), Long.valueOf("0"));
assertEquals(Long.valueOf(query.get("timeout")), Long.valueOf("60000"));
assertEquals(query.get("since"), "0");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,17 @@ public class GetDbUpdatesOptionsTest {
@Test
public void testGetDbUpdatesOptions() throws Throwable {
GetDbUpdatesOptions getDbUpdatesOptionsModel = new GetDbUpdatesOptions.Builder()
.descending(false)
.feed("normal")
.heartbeat(Long.valueOf("0"))
.limit(Long.valueOf("0"))
.timeout(Long.valueOf("60000"))
.since("0")
.build();
assertEquals(getDbUpdatesOptionsModel.descending(), Boolean.valueOf(false));
assertEquals(getDbUpdatesOptionsModel.feed(), "normal");
assertEquals(getDbUpdatesOptionsModel.heartbeat(), Long.valueOf("0"));
assertEquals(getDbUpdatesOptionsModel.limit(), Long.valueOf("0"));
assertEquals(getDbUpdatesOptionsModel.timeout(), Long.valueOf("60000"));
assertEquals(getDbUpdatesOptionsModel.since(), "0");
}
Expand Down

0 comments on commit f73186f

Please sign in to comment.