Skip to content

Commit

Permalink
regenerate clients
Browse files Browse the repository at this point in the history
  • Loading branch information
shortcuts committed Jan 17, 2022
1 parent 534bf72 commit ba7b470
Show file tree
Hide file tree
Showing 13 changed files with 45 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
/**
* To update an attribute without pushing the entire record, you can use these built-in operations.
*/
public class BuildInOperation {
public class BuiltInOperation {

/** The operation to apply on the attribute. */
@JsonAdapter(OperationEnum.Adapter.class)
Expand Down Expand Up @@ -79,7 +79,7 @@ public OperationEnum read(final JsonReader jsonReader)
@SerializedName("value")
private String value;

public BuildInOperation operation(OperationEnum operation) {
public BuiltInOperation operation(OperationEnum operation) {
this.operation = operation;
return this;
}
Expand All @@ -98,7 +98,7 @@ public void setOperation(OperationEnum operation) {
this.operation = operation;
}

public BuildInOperation value(String value) {
public BuiltInOperation value(String value) {
this.value = value;
return this;
}
Expand Down Expand Up @@ -126,10 +126,10 @@ public boolean equals(Object o) {
if (o == null || getClass() != o.getClass()) {
return false;
}
BuildInOperation buildInOperation = (BuildInOperation) o;
BuiltInOperation builtInOperation = (BuiltInOperation) o;
return (
Objects.equals(this.operation, buildInOperation.operation) &&
Objects.equals(this.value, buildInOperation.value)
Objects.equals(this.operation, builtInOperation.operation) &&
Objects.equals(this.value, builtInOperation.value)
);
}

Expand All @@ -141,7 +141,7 @@ public int hashCode() {
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class BuildInOperation {\n");
sb.append("class BuiltInOperation {\n");
sb
.append(" operation: ")
.append(toIndentedString(operation))
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package com.algolia.model;

public class OneOfstringbuiltInOperation {}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
import com.algolia.model.MultipleBatchResponse;
import com.algolia.model.MultipleQueriesObject;
import com.algolia.model.MultipleQueriesResponse;
import com.algolia.model.OneOfstringbuildInOperation;
import com.algolia.model.OneOfstringbuiltInOperation;
import com.algolia.model.OperationIndexObject;
import com.algolia.model.RemoveUserIdResponse;
import com.algolia.model.ReplaceSourceResponse;
Expand Down Expand Up @@ -3994,7 +3994,7 @@ public Call operationIndexAsync(
*
* @param indexName The index in which to perform the request. (required)
* @param objectID Unique identifier of an object. (required)
* @param oneOfstringbuildInOperation List of attributes to update. (required)
* @param oneOfstringbuiltInOperation List of attributes to update. (required)
* @param createIfNotExists Creates the record if it does not exist yet. (optional, default to
* true)
* @param _callback Callback for upload/download progress
Expand All @@ -4004,11 +4004,11 @@ public Call operationIndexAsync(
private Call partialUpdateObjectCall(
String indexName,
String objectID,
List<Map<String, OneOfstringbuildInOperation>> oneOfstringbuildInOperation,
List<Map<String, OneOfstringbuiltInOperation>> oneOfstringbuiltInOperation,
Boolean createIfNotExists,
final ApiCallback _callback
) throws ApiException {
Object bodyObj = oneOfstringbuildInOperation;
Object bodyObj = oneOfstringbuiltInOperation;

// create path and map variables
String path =
Expand Down Expand Up @@ -4047,7 +4047,7 @@ private Call partialUpdateObjectCall(
private Call partialUpdateObjectValidateBeforeCall(
String indexName,
String objectID,
List<Map<String, OneOfstringbuildInOperation>> oneOfstringbuildInOperation,
List<Map<String, OneOfstringbuiltInOperation>> oneOfstringbuiltInOperation,
Boolean createIfNotExists,
final ApiCallback _callback
) throws ApiException {
Expand All @@ -4065,18 +4065,18 @@ private Call partialUpdateObjectValidateBeforeCall(
);
}

// verify the required parameter 'oneOfstringbuildInOperation' is set
if (oneOfstringbuildInOperation == null) {
// verify the required parameter 'oneOfstringbuiltInOperation' is set
if (oneOfstringbuiltInOperation == null) {
throw new ApiException(
"Missing the required parameter 'oneOfstringbuildInOperation' when calling" +
"Missing the required parameter 'oneOfstringbuiltInOperation' when calling" +
" partialUpdateObject(Async)"
);
}

return partialUpdateObjectCall(
indexName,
objectID,
oneOfstringbuildInOperation,
oneOfstringbuiltInOperation,
createIfNotExists,
_callback
);
Expand All @@ -4090,7 +4090,7 @@ private Call partialUpdateObjectValidateBeforeCall(
*
* @param indexName The index in which to perform the request. (required)
* @param objectID Unique identifier of an object. (required)
* @param oneOfstringbuildInOperation List of attributes to update. (required)
* @param oneOfstringbuiltInOperation List of attributes to update. (required)
* @param createIfNotExists Creates the record if it does not exist yet. (optional, default to
* true)
* @return UpdatedAtWithObjectIdResponse
Expand All @@ -4100,13 +4100,13 @@ private Call partialUpdateObjectValidateBeforeCall(
public UpdatedAtWithObjectIdResponse partialUpdateObject(
String indexName,
String objectID,
List<Map<String, OneOfstringbuildInOperation>> oneOfstringbuildInOperation,
List<Map<String, OneOfstringbuiltInOperation>> oneOfstringbuiltInOperation,
Boolean createIfNotExists
) throws ApiException {
Call call = partialUpdateObjectValidateBeforeCall(
indexName,
objectID,
oneOfstringbuildInOperation,
oneOfstringbuiltInOperation,
createIfNotExists,
null
);
Expand All @@ -4126,7 +4126,7 @@ public UpdatedAtWithObjectIdResponse partialUpdateObject(
*
* @param indexName The index in which to perform the request. (required)
* @param objectID Unique identifier of an object. (required)
* @param oneOfstringbuildInOperation List of attributes to update. (required)
* @param oneOfstringbuiltInOperation List of attributes to update. (required)
* @param createIfNotExists Creates the record if it does not exist yet. (optional, default to
* true)
* @param _callback The callback to be executed when the API call finishes
Expand All @@ -4136,14 +4136,14 @@ public UpdatedAtWithObjectIdResponse partialUpdateObject(
public Call partialUpdateObjectAsync(
String indexName,
String objectID,
List<Map<String, OneOfstringbuildInOperation>> oneOfstringbuildInOperation,
List<Map<String, OneOfstringbuiltInOperation>> oneOfstringbuiltInOperation,
Boolean createIfNotExists,
final ApiCallback<UpdatedAtWithObjectIdResponse> _callback
) throws ApiException {
Call call = partialUpdateObjectValidateBeforeCall(
indexName,
objectID,
oneOfstringbuildInOperation,
oneOfstringbuiltInOperation,
createIfNotExists,
_callback
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
/**
* To update an attribute without pushing the entire record, you can use these built-in operations.
*/
export type BuildInOperation = {
export type BuiltInOperation = {
/**
* The operation to apply on the attribute.
*/
_operation: BuildInOperationOperation;
_operation: BuiltInOperationOperation;
/**
* The right-hand side argument to the operation, for example, increment or decrement step, value to add or remove.
*/
value: string;
};

export type BuildInOperationOperation =
export type BuiltInOperationOperation =
| 'Add'
| 'AddUnique'
| 'Decrement'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import type { BatchResponse } from '../model/batchResponse';
import type { BatchWriteObject } from '../model/batchWriteObject';
import type { BrowseRequest } from '../model/browseRequest';
import type { BrowseResponse } from '../model/browseResponse';
import type { BuildInOperation } from '../model/buildInOperation';
import type { BuiltInOperation } from '../model/builtInOperation';
import type { CreatedAtResponse } from '../model/createdAtResponse';
import type { DeleteApiKeyResponse } from '../model/deleteApiKeyResponse';
import type { DeleteSourceResponse } from '../model/deleteSourceResponse';
Expand Down Expand Up @@ -1684,13 +1684,13 @@ export class SearchApi {
* @param partialUpdateObject - The partialUpdateObject object.
* @param partialUpdateObject.indexName - The index in which to perform the request.
* @param partialUpdateObject.objectID - Unique identifier of an object.
* @param partialUpdateObject.stringBuildInOperation - List of attributes to update.
* @param partialUpdateObject.stringBuiltInOperation - List of attributes to update.
* @param partialUpdateObject.createIfNotExists - Creates the record if it does not exist yet.
*/
partialUpdateObject({
indexName,
objectID,
stringBuildInOperation,
stringBuiltInOperation,
createIfNotExists,
}: PartialUpdateObjectProps): Promise<UpdatedAtWithObjectIdResponse> {
const path = '/1/indexes/{indexName}/{objectID}/partial'
Expand All @@ -1712,11 +1712,11 @@ export class SearchApi {
}

if (
stringBuildInOperation === null ||
stringBuildInOperation === undefined
stringBuiltInOperation === null ||
stringBuiltInOperation === undefined
) {
throw new Error(
'Required parameter stringBuildInOperation was null or undefined when calling partialUpdateObject.'
'Required parameter stringBuiltInOperation was null or undefined when calling partialUpdateObject.'
);
}

Expand All @@ -1727,7 +1727,7 @@ export class SearchApi {
const request: Request = {
method: 'POST',
path,
data: stringBuildInOperation,
data: stringBuiltInOperation,
};

const requestOptions: RequestOptions = {
Expand Down Expand Up @@ -2808,7 +2808,7 @@ export type PartialUpdateObjectProps = {
/**
* List of attributes to update.
*/
stringBuildInOperation: Array<{ [key: string]: BuildInOperation | string }>;
stringBuiltInOperation: Array<{ [key: string]: BuiltInOperation | string }>;
/**
* Creates the record if it does not exist yet.
*/
Expand Down
4 changes: 4 additions & 0 deletions scripts/generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ run_post_gen() {
fi
}

if [[ ! $CI ]]; then
build_spec
fi

run_pre_gen
generate_client
run_post_gen
2 changes: 1 addition & 1 deletion scripts/post-gen/java.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ find "$CLIENT" -type f -name "*.java" | xargs sed -i -e 's~= {}~= new Object()~g

# Create a special class for the OneOf integer string (not complete yet, juste here for compilation)
echo "package com.algolia.model;public class OneOfintegerstring {}" > $CLIENT/algoliasearch-core/com/algolia/model/OneOfintegerstring.java
echo "package com.algolia.model;public class OneOfstringbuildInOperation {}" > $CLIENT/algoliasearch-core/com/algolia/model/OneOfstringbuildInOperation.java
echo "package com.algolia.model;public class OneOfstringbuiltInOperation {}" > $CLIENT/algoliasearch-core/com/algolia/model/OneOfstringbuiltInOperation.java

format_client() {
echo "> Formatting $GENERATOR..."
Expand Down
2 changes: 1 addition & 1 deletion specs/search/paths/objects/common/schemas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ attribute:
type: string
description: Value of the attribute to be updated.

buildInOperation:
builtInOperation:
type: object
description: To update an attribute without pushing the entire record, you can use these built-in operations.
additionalProperties: false
Expand Down
2 changes: 1 addition & 1 deletion specs/search/paths/objects/partialUpdate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ post:
additionalProperties:
oneOf:
- $ref: 'common/schemas.yml#/attribute'
- $ref: 'common/schemas.yml#/buildInOperation'
- $ref: 'common/schemas.yml#/builtInOperation'
responses:
'200':
$ref: ../../../common/responses/UpdatedAtWithObjectId.yml
Expand Down
2 changes: 1 addition & 1 deletion tests/CTS/methods/requests/search/partialUpdateObject.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"parameters": {
"indexName": "theIndexName",
"objectID": "uniqueID",
"stringBuildInOperation": [
"stringBuiltInOperation": [
{
"id1": "test",
"id2": {
Expand Down
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -758,7 +758,7 @@ describe('partialUpdateObject', () => {
const req = (await client.partialUpdateObject({
indexName: 'theIndexName',
objectID: 'uniqueID',
stringBuildInOperation: [
stringBuiltInOperation: [
{ id1: 'test', id2: { _operation: 'AddUnique', value: 'test2' } },
],
createIfNotExists: true,
Expand Down

0 comments on commit ba7b470

Please sign in to comment.