Skip to content

Commit

Permalink
fix(generated): missed additional params in go postPartitionExplain e…
Browse files Browse the repository at this point in the history
…xample

Generated SDK source code using:
- Generator version 3.96.0
- Specification version 1.0.0-dev0.1.18
- Automation (cloudant-sdks) version 30afc34
  • Loading branch information
cloudant-sdks-automation authored and eiri committed Oct 17, 2024
1 parent 0fc667e commit 781adbd
Show file tree
Hide file tree
Showing 29 changed files with 186 additions and 148 deletions.
156 changes: 82 additions & 74 deletions examples/README.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions examples/snippets/deleteAttachment/example_request.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
DeleteAttachmentOptions attachmentOptions =
new DeleteAttachmentOptions.Builder()
.db("products")
.docId("small-appliances:100001")
.docId("1000042")
.attachmentName("product_details.txt")
.rev("4-1a0d1cd6f40472509e9aac646183736a")
.build();
Expand All @@ -19,4 +19,4 @@

System.out.println(response);
// section: markdown
// This example requires the `product_details.txt` attachment in `small-appliances:100001` document to exist. To create the attachment, see [Create or modify an attachment.](#putattachment)
// This example requires the `product_details.txt` attachment in `1000042` document to exist. To create the attachment, see [Create or modify an attachment.](#putattachment)
6 changes: 3 additions & 3 deletions examples/snippets/deleteDocument/example_request.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

DeleteDocumentOptions documentOptions =
new DeleteDocumentOptions.Builder()
.db("events")
.docId("0007241142412418284")
.rev("2-9a0d1cd9f40472509e9aac6461837367")
.db("orders")
.docId("order00058")
.rev("1-99b02e08da151943c2dcb40090160bb8")
.build();

DocumentResult response =
Expand Down
4 changes: 2 additions & 2 deletions examples/snippets/getAttachment/example_request.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
GetAttachmentOptions attachmentOptions =
new GetAttachmentOptions.Builder()
.db("products")
.docId("small-appliances:100001")
.docId("1000042")
.attachmentName("product_details.txt")
.build();

Expand All @@ -27,4 +27,4 @@
}

// section: markdown
// This example requires the `product_details.txt` attachment in `small-appliances:100001` document to exist. To create the attachment, see [Create or modify an attachment.](#putattachment)
// This example requires the `product_details.txt` attachment in `1000042` document to exist. To create the attachment, see [Create or modify an attachment.](#putattachment)
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

GetDesignDocumentInformationOptions informationOptions =
new GetDesignDocumentInformationOptions.Builder()
.db("stores")
.db("products")
.ddoc("appliances")
.build();

Expand Down
2 changes: 1 addition & 1 deletion examples/snippets/getDocument/example_request.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
GetDocumentOptions documentOptions =
new GetDocumentOptions.Builder()
.db("products")
.docId("small-appliances:1000042")
.docId("1000042")
.build();

Document response =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
GetDocumentShardsInfoOptions shardsInfoOptions =
new GetDocumentShardsInfoOptions.Builder()
.db("products")
.docId("small-appliances:1000042")
.docId("1000042")
.build();

DocumentShardInfo response =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

GetPartitionInformationOptions informationOptions =
new GetPartitionInformationOptions.Builder()
.db("products")
.partitionKey("small-appliances")
.db("events")
.partitionKey("ns1HJS13AMkK")
.build();

PartitionInformation response =
Expand Down
8 changes: 4 additions & 4 deletions examples/snippets/getSearchInfo/example_request.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

GetSearchInfoOptions infoOptions =
new GetSearchInfoOptions.Builder()
.db("products")
.ddoc("appliances")
.index("findByPrice")
.db("events")
.ddoc("checkout")
.index("findByDate")
.build();

SearchInfoResult response =
Expand All @@ -18,4 +18,4 @@

System.out.println(response);
// section: markdown
// This example requires the `findByPrice` Cloudant Search partitioned index to exist. To create the design document with this index, see [Create or modify a design document.](#putdesigndocument)
// This example requires the `findByDate` Cloudant Search partitioned index to exist. To create the design document with this index, see [Create or modify a design document.](#putdesigndocument)
4 changes: 2 additions & 2 deletions examples/snippets/headAttachment/example_request.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
HeadAttachmentOptions attachmentOptions =
new HeadAttachmentOptions.Builder()
.db("products")
.docId("small-appliances:100001")
.docId("1000042")
.attachmentName("product_details.txt")
.build();

Expand All @@ -25,4 +25,4 @@
System.out.println(headers.values("Content-Length"));
System.out.println(headers.values("Content-Type"));
// section: markdown
// This example requires the `product_details.txt` attachment in `small-appliances:100001` document to exist. To create the attachment, see [Create or modify an attachment.](#putattachment)
// This example requires the `product_details.txt` attachment in `1000042` document to exist. To create the attachment, see [Create or modify an attachment.](#putattachment)
4 changes: 2 additions & 2 deletions examples/snippets/headDesignDocument/example_request.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

HeadDesignDocumentOptions designDocumentOptions =
new HeadDesignDocumentOptions.Builder()
.db("products")
.ddoc("appliances")
.db("events")
.ddoc("checkout")
.build();

int statusCode =
Expand Down
4 changes: 2 additions & 2 deletions examples/snippets/headDocument/example_request.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
Cloudant service = Cloudant.newInstance();
HeadDocumentOptions documentOptions =
new HeadDocumentOptions.Builder()
.db("events")
.docId("0007741142412418284")
.db("orders")
.docId("order00058")
.build();

int statusCode =
Expand Down
4 changes: 2 additions & 2 deletions examples/snippets/postAllDocsQueries/example_request.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
Cloudant service = Cloudant.newInstance();

AllDocsQuery query1 = new AllDocsQuery.Builder()
.keys(Arrays.asList("small-appliances:1000042",
"small-appliances:1000043"))
.keys(Arrays.asList("1000042",
"1000043"))
.build();

AllDocsQuery query2 = new AllDocsQuery.Builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,17 @@
{
"docs": [
{
"_id": "0007241142412418284",
"_id": "ns1HJS13AMkK:0007241142412418284",
"type": "event",
"userid": "abc123",
"userId": "abc123",
"eventType": "addedToBasket",
"productId": "1000042",
"date": "2019-01-28T10:44:22.000Z"
},
{
"_id": "0007241142412418285",
"_id": "H8tDIwfadxp9:0007241142412418285",
"type": "event",
"userid": "abc123",
"userId": "abc234",
"eventType": "addedToBasket",
"productId": "1000050",
"date": "2019-01-25T20:00:00.000Z"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@
Cloudant service = Cloudant.newInstance();

Document eventDoc1 = new Document();
eventDoc1.setId("0007241142412418284");
eventDoc1.setId("ns1HJS13AMkK:0007241142412418284");
eventDoc1.put("type", "event");
eventDoc1.put("userid", "abc123");
eventDoc1.put("userId", "abc123");
eventDoc1.put("eventType", "addedToBasket");
eventDoc1.put("productId", "1000042");
eventDoc1.put("date", "2019-01-28T10:44:22.000Z");

Document eventDoc2 = new Document();
eventDoc2.setId("0007241142412418285");
eventDoc2.setId("H8tDIwfadxp9:0007241142412418285");
eventDoc2.put("type", "event");
eventDoc2.put("userid", "abc234");
eventDoc2.put("userId", "abc234");
eventDoc2.put("eventType", "addedToBasket");
eventDoc2.put("productId", "1000050");
eventDoc2.put("date", "2019-01-28T10:44:22.000Z");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
Cloudant service = Cloudant.newInstance();

Document eventDoc1 = new Document();
eventDoc1.setId("0007241142412418284");
eventDoc1.setId("ns1HJS13AMkK:0007241142412418284");
eventDoc1.setRev("1-5005d65514fe9e90f8eccf174af5dd64");
eventDoc1.setDeleted(true);

Document eventDoc2 = new Document();
eventDoc2.setId("0007241142412418285");
eventDoc2.setId("H8tDIwfadxp9:0007241142412418285");
eventDoc1.setRev("1-2d7810b054babeda4812b3924428d6d6");
eventDoc1.setDeleted(true);

Expand Down
6 changes: 3 additions & 3 deletions examples/snippets/postDocument/example_request.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
Cloudant service = Cloudant.newInstance();

Document productsDocument = new Document();
productsDocument.setId("small-appliances:1000042");
productsDocument.setId("1000042");
productsDocument.put("type", "product");
productsDocument.put("productid", "1000042");
productsDocument.put("productId", "1000042");
productsDocument.put("brand", "Salter");
productsDocument.put("name", "Digital Kitchen Scales");
productsDocument.put("description", "Slim Colourful Design Electronic"
+ "Cooking Appliance for Home/Kitchen, Weigh up to 5kg + Aquatronic"
+ "Cooking Appliance for Home / Kitchen, Weigh up to 5kg + Aquatronic"
+ "for Liquids ml + fl. oz. 15Yr Guarantee - Green");
productsDocument.put("price", 14.99);
productsDocument.put("image", "assets/img/0gmsnghhew.jpg");
Expand Down
4 changes: 2 additions & 2 deletions examples/snippets/postPartitionAllDocs/example_request.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

PostPartitionAllDocsOptions allDocsOptions =
new PostPartitionAllDocsOptions.Builder()
.db("products")
.partitionKey("small-appliances")
.db("events")
.partitionKey("ns1HJS13AMkK")
.includeDocs(true)
.build();

Expand Down
28 changes: 28 additions & 0 deletions examples/snippets/postPartitionExplain/example_request.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// section: code imports
import com.ibm.cloud.cloudant.v1.Cloudant;
import com.ibm.cloud.cloudant.v1.model.ExplainResult;
import com.ibm.cloud.cloudant.v1.model.PostPartitionExplainOptions;

import java.util.Collections;
import java.util.Map;
// section: code
Cloudant service = Cloudant.newInstance();

Map<String, Object> selector = Collections.singletonMap(
"userId",
Collections.singletonMap("$eq", "abc123"));

PostPartitionExplainOptions explainOptions =
new PostPartitionExplainOptions.Builder()
.db("events")
.executionStats(true)
.limit(10)
.partitionKey("ns1HJS13AMkK")
.selector(selector)
.build();

ExplainResult response =
service.postPartitionExplain(explainOptions).execute()
.getResult();

System.out.println(response);
10 changes: 5 additions & 5 deletions examples/snippets/postPartitionFind/example_request.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@
Cloudant service = Cloudant.newInstance();

Map<String, String> typeEqualsProduct = new HashMap<>();
typeEqualsProduct.put("$eq", "product");
typeEqualsProduct.put("$eq", "abc123");

Map<String, Object> selector = new HashMap<>();
selector.put("type", typeEqualsProduct);
selector.put("userId", typeEqualsProduct);

PostPartitionFindOptions findOptions =
new PostPartitionFindOptions.Builder()
.db("products")
.partitionKey("small-appliances")
.fields(Arrays.asList("productid", "name", "description"))
.db("events")
.partitionKey("ns1HJS13AMkK")
.fields(Arrays.asList("productId", "eventType", "date"))
.selector(selector)
.build();

Expand Down
12 changes: 6 additions & 6 deletions examples/snippets/postPartitionSearch/example_request.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@

PostPartitionSearchOptions searchOptions =
new PostPartitionSearchOptions.Builder()
.db("products")
.partitionKey("small-appliances")
.ddoc("appliances")
.index("findByPrice")
.query("price:[14 TO 20]")
.db("events")
.partitionKey("ns1HJS13AMkK")
.ddoc("checkout")
.index("findByDate")
.query("date:[2019-01-01T12:00:00.000Z TO 2019-01-31T12:00:00.000Z]")
.build();

SearchResult response =
Expand All @@ -20,4 +20,4 @@

System.out.println(response);
// section: markdown
// This example requires the `findByPrice` Cloudant Search partitioned index to exist. To create the design document with this index, see [Create or modify a design document.](#putdesigndocument)
// This example requires the `findByDate` Cloudant Search partitioned index to exist. To create the design document with this index, see [Create or modify a design document.](#putdesigndocument)
10 changes: 5 additions & 5 deletions examples/snippets/postPartitionView/example_request.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@

PostPartitionViewOptions viewOptions =
new PostPartitionViewOptions.Builder()
.db("products")
.ddoc("appliances")
.db("events")
.ddoc("checkout")
.includeDocs(true)
.limit(10)
.partitionKey("small-appliances")
.view("byApplianceProdId")
.partitionKey("ns1HJS13AMkK")
.view("byProductId")
.build();

ViewResult response =
Expand All @@ -21,4 +21,4 @@

System.out.println(response);
// section: markdown
// This example requires the `byApplianceProdId` partitioned view to exist. To create the design document with this view, see [Create or modify a design document.](#putdesigndocument)
// This example requires the `byProductId` partitioned view to exist. To create the design document with this view, see [Create or modify a design document.](#putdesigndocument)
4 changes: 3 additions & 1 deletion examples/snippets/postRevsDiff/example_request.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
Cloudant service = Cloudant.newInstance();

Map<String, List<String>> docRevisions =
Collections.singletonMap("prder00077", Arrays.asList("<1-missing-revision>",
Collections.singletonMap("order00077", Arrays.asList("<1-missing-revision>",
"<2-missing-revision>", "<3-possible-ancestor-revision>"));

PostRevsDiffOptions revsDiffOptions =
Expand All @@ -25,3 +25,5 @@
.getResult();

System.out.println(response);
// section: markdown
// This example requires the example revisions in the POST body to be replaced with valid revisions.
2 changes: 1 addition & 1 deletion examples/snippets/putAttachment/example_request.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
PutAttachmentOptions attachmentOptions =
new PutAttachmentOptions.Builder()
.db("products")
.docId("small-appliances:100001")
.docId("1000042")
.attachmentName("product_details.txt")
.attachment(detailedDescriptionStream)
.contentType("text/plain")
Expand Down
2 changes: 1 addition & 1 deletion examples/snippets/putDatabase/example_request.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
Cloudant service = Cloudant.newInstance();

PutDatabaseOptions databaseOptions = new PutDatabaseOptions.Builder()
.db("products")
.db("events")
.partitioned(true)
.build();

Expand Down
Loading

0 comments on commit 781adbd

Please sign in to comment.