Skip to content

Commit

Permalink
synonym maps client method overloads (Azure#261)
Browse files Browse the repository at this point in the history
  • Loading branch information
Humoiz authored Nov 14, 2019
1 parent 941cbe7 commit d6d6869
Show file tree
Hide file tree
Showing 23 changed files with 602 additions and 930 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1294,7 +1294,8 @@ Mono<Response<Boolean>> skillsetExistsWithResponse(String skillsetName,
* @return the created {@link SynonymMap}.
*/
public Mono<SynonymMap> createSynonymMap(SynonymMap synonymMap) {
return this.createSynonymMapWithResponse(synonymMap, null).map(Response::getValue);
return this.createSynonymMapWithResponse(synonymMap, null)
.map(Response::getValue);
}

/**
Expand All @@ -1306,7 +1307,8 @@ public Mono<SynonymMap> createSynonymMap(SynonymMap synonymMap) {
* @return the created {@link SynonymMap}.
*/
public Mono<SynonymMap> createSynonymMap(SynonymMap synonymMap, RequestOptions requestOptions) {
return this.createSynonymMapWithResponse(synonymMap, requestOptions).map(Response::getValue);
return this.createSynonymMapWithResponse(synonymMap, requestOptions)
.map(Response::getValue);
}

/**
Expand All @@ -1319,7 +1321,7 @@ public Mono<SynonymMap> createSynonymMap(SynonymMap synonymMap, RequestOptions r
*/
public Mono<Response<SynonymMap>> createSynonymMapWithResponse(SynonymMap synonymMap,
RequestOptions requestOptions) {
return withContext(context -> createSynonymMapWithResponse(synonymMap,
return withContext(context -> this.createSynonymMapWithResponse(synonymMap,
requestOptions,
context));
}
Expand Down Expand Up @@ -1367,7 +1369,7 @@ public Mono<SynonymMap> getSynonymMap(String synonymMapName, RequestOptions requ
*/
public Mono<Response<SynonymMap>> getSynonymMapWithResponse(String synonymMapName,
RequestOptions requestOptions) {
return withContext(context -> getSynonymMapWithResponse(synonymMapName, requestOptions, context));
return withContext(context -> this.getSynonymMapWithResponse(synonymMapName, requestOptions, context));
}

Mono<Response<SynonymMap>> getSynonymMapWithResponse(String synonymMapName,
Expand All @@ -1388,18 +1390,6 @@ public PagedFlux<SynonymMap> listSynonymMaps() {
return this.listSynonymMaps(null, null);
}

/**
* Lists all synonym maps available for an Azure Cognitive Search service.
*
* @param select selects which top-level properties of the synonym maps to retrieve.
* Specified as a comma-separated list of JSON property names, or '*' for all properties.
* The default is all properties
* @return a reactive response emitting the list of synonym maps.
*/
public PagedFlux<SynonymMap> listSynonymMaps(String select) {
return this.listSynonymMaps(select, null);
}

/**
* Lists all synonym maps available for an Azure Cognitive Search service.
*
Expand All @@ -1416,12 +1406,6 @@ public PagedFlux<SynonymMap> listSynonymMaps(String select, RequestOptions reque
nextLink -> Mono.empty());
}

PagedFlux<SynonymMap> listSynonymMaps(String select, RequestOptions requestOptions, Context context) {
return new PagedFlux<>(
() -> this.listSynonymMapsWithResponse(select, requestOptions, context),
nextLink -> Mono.empty());
}

/**
* Lists all synonym maps available for an Azure Cognitive Search service.
*
Expand Down Expand Up @@ -1463,19 +1447,6 @@ public Mono<SynonymMap> createOrUpdateSynonymMap(SynonymMap synonymMap) {
.map(Response::getValue);
}

/**
* Creates a new Azure Cognitive Search synonym map or updates a synonym map if it already exists.
*
* @param synonymMap the definition of the synonym map to create or update
* @param accessCondition the condition where the operation will be performed if the ETag on the server matches or
* doesn't match specified values
* @return the synonym map that was created or updated.
*/
public Mono<SynonymMap> createOrUpdateSynonymMap(SynonymMap synonymMap, AccessCondition accessCondition) {
return this.createOrUpdateSynonymMapWithResponse(synonymMap, accessCondition, null)
.map(Response::getValue);
}

/**
* Creates a new Azure Cognitive Search synonym map or updates a synonym map if it already exists.
*
Expand Down Expand Up @@ -1506,10 +1477,8 @@ public Mono<SynonymMap> createOrUpdateSynonymMap(SynonymMap synonymMap,
public Mono<Response<SynonymMap>> createOrUpdateSynonymMapWithResponse(SynonymMap synonymMap,
AccessCondition accessCondition,
RequestOptions requestOptions) {
return withContext(context -> createOrUpdateSynonymMapWithResponse(synonymMap,
accessCondition,
requestOptions,
context));
return withContext(context -> this.createOrUpdateSynonymMapWithResponse(synonymMap,
accessCondition, requestOptions, context));
}

Mono<Response<SynonymMap>> createOrUpdateSynonymMapWithResponse(SynonymMap synonymMap,
Expand All @@ -1536,18 +1505,6 @@ public Mono<Void> deleteSynonymMap(String synonymMapName) {
return this.deleteSynonymMap(synonymMapName, null, null);
}

/**
* Deletes an Azure Cognitive Search synonym map.
*
* @param synonymMapName the name of the synonym map to delete
* @param accessCondition the condition where the operation will be performed if the ETag on the server matches or
* doesn't match specified values
* @return a response signalling completion.
*/
public Mono<Void> deleteSynonymMap(String synonymMapName, AccessCondition accessCondition) {
return this.deleteSynonymMap(synonymMapName, accessCondition, null);
}

/**
* Deletes an Azure Cognitive Search synonym map.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1158,19 +1158,6 @@ public SynonymMap createSynonymMap(SynonymMap synonymMap, RequestOptions request
return asyncClient.createSynonymMap(synonymMap, requestOptions).block();
}

/**
* Creates a new Azure Cognitive Search synonym map.
*
* @param synonymMap the definition of the synonym map to create
* @param requestOptions additional parameters for the operation.
* Contains the tracking ID sent with the request to help with debugging
* @param context additional context that is passed through the HTTP pipeline during the service call
* @return the created {@link SynonymMap}.
*/
public SynonymMap createSynonymMap(SynonymMap synonymMap, RequestOptions requestOptions, Context context) {
return this.createSynonymMapWithResponse(synonymMap, requestOptions, context).getValue();
}

/**
* Creates a new Azure Cognitive Search synonym map.
*
Expand All @@ -1183,9 +1170,7 @@ public SynonymMap createSynonymMap(SynonymMap synonymMap, RequestOptions request
public Response<SynonymMap> createSynonymMapWithResponse(SynonymMap synonymMap,
RequestOptions requestOptions,
Context context) {
return asyncClient.createSynonymMapWithResponse(synonymMap,
requestOptions,
context).block();
return asyncClient.createSynonymMapWithResponse(synonymMap, requestOptions, context).block();
}

/**
Expand All @@ -1210,21 +1195,6 @@ public SynonymMap getSynonymMap(String synonymMapName, RequestOptions requestOpt
return asyncClient.getSynonymMap(synonymMapName, requestOptions).block();
}

/**
* Retrieves a synonym map definition.
*
* @param synonymMapName name of the synonym map to retrieve
* @param requestOptions additional parameters for the operation.
* Contains the tracking ID sent with the request to help with debugging
* @param context a context that is passed through the HTTP pipeline during the service call
* @return the {@link SynonymMap} definition.
*/
public SynonymMap getSynonymMap(String synonymMapName,
RequestOptions requestOptions,
Context context) {
return this.getSynonymMapWithResponse(synonymMapName, requestOptions, context).getValue();
}

/**
* Retrieves a synonym map definition.
*
Expand All @@ -1249,18 +1219,6 @@ public PagedIterable<SynonymMap> listSynonymMaps() {
return new PagedIterable<>(asyncClient.listSynonymMaps());
}

/**
* Lists all synonym maps available for an Azure Cognitive Search service.
*
* @param select selects which top-level properties of the index definitions to retrieve.
* Specified as a comma-separated list of JSON property names, or '*' for all properties.
* The default is all properties
* @return the list of synonym maps.
*/
public PagedIterable<SynonymMap> listSynonymMaps(String select) {
return new PagedIterable<>(asyncClient.listSynonymMaps(select));
}

/**
* Lists all synonym maps available for an Azure Cognitive Search service.
*
Expand All @@ -1275,21 +1233,6 @@ public PagedIterable<SynonymMap> listSynonymMaps(String select, RequestOptions r
return new PagedIterable<>(asyncClient.listSynonymMaps(select, requestOptions));
}

/**
* Lists all synonym maps available for an Azure Cognitive Search service.
*
* @param select selects which top-level properties of the index definitions to retrieve.
* Specified as a comma-separated list of JSON property names, or '*' for all properties.
* The default is all properties
* @param requestOptions additional parameters for the operation.
* Contains the tracking ID sent with the request to help with debugging
* @param context additional context that is passed through the HTTP pipeline during the service call
* @return the list of synonym maps.
*/
public PagedIterable<SynonymMap> listSynonymMaps(String select, RequestOptions requestOptions, Context context) {
return new PagedIterable<>(asyncClient.listSynonymMaps(select, requestOptions, context));
}

/**
* Lists all synonym maps available for an Azure Cognitive Search service.
*
Expand All @@ -1316,18 +1259,6 @@ public SynonymMap createOrUpdateSynonymMap(SynonymMap synonymMap) {
return asyncClient.createOrUpdateSynonymMap(synonymMap).block();
}

/**
* Creates a new Azure Cognitive Search synonym map or updates a synonym map if it already exists.
*
* @param synonymMap the definition of the synonym map to create or update
* @param accessCondition the condition where the operation will be performed if the ETag on the server matches or
* doesn't match specified values
* @return the synonym map that was created or updated.
*/
public SynonymMap createOrUpdateSynonymMap(SynonymMap synonymMap, AccessCondition accessCondition) {
return asyncClient.createOrUpdateSynonymMap(synonymMap, accessCondition).block();
}

/**
* Creates a new Azure Cognitive Search synonym map or updates a synonym map if it already exists.
*
Expand All @@ -1341,30 +1272,7 @@ public SynonymMap createOrUpdateSynonymMap(SynonymMap synonymMap, AccessConditio
public SynonymMap createOrUpdateSynonymMap(SynonymMap synonymMap,
AccessCondition accessCondition,
RequestOptions requestOptions) {
return asyncClient.createOrUpdateSynonymMap(synonymMap,
accessCondition,
requestOptions).block();
}

/**
* Creates a new Azure Cognitive Search synonym map or updates a synonym map if it already exists.
*
* @param synonymMap the definition of the synonym map to create or update
* @param accessCondition the condition where the operation will be performed if the ETag on the server matches or
* doesn't match specified values
* @param requestOptions additional parameters for the operation.
* Contains the tracking ID sent with the request to help with debugging
* @param context additional context that is passed through the HTTP pipeline during the service call
* @return the synonym map that was created or updated.
*/
public SynonymMap createOrUpdateSynonymMap(SynonymMap synonymMap,
AccessCondition accessCondition,
RequestOptions requestOptions,
Context context) {
return this.createOrUpdateSynonymMapWithResponse(synonymMap,
accessCondition,
requestOptions,
context).getValue();
return asyncClient.createOrUpdateSynonymMap(synonymMap, accessCondition, requestOptions).block();
}

/**
Expand All @@ -1383,9 +1291,7 @@ public Response<SynonymMap> createOrUpdateSynonymMapWithResponse(SynonymMap syno
RequestOptions requestOptions,
Context context) {
return asyncClient.createOrUpdateSynonymMapWithResponse(synonymMap,
accessCondition,
requestOptions,
context).block();
accessCondition, requestOptions, context).block();
}

/**
Expand All @@ -1397,17 +1303,6 @@ public void deleteSynonymMap(String synonymMapName) {
asyncClient.deleteSynonymMap(synonymMapName).block();
}

/**
* Deletes an Azure Cognitive Search synonym map.
*
* @param synonymMapName the name of the synonym map to delete
* @param accessCondition the condition where the operation will be performed if the ETag on the server matches or
* doesn't match specified values
*/
public void deleteSynonymMap(String synonymMapName, AccessCondition accessCondition) {
asyncClient.deleteSynonymMap(synonymMapName, accessCondition).block();
}

/**
* Deletes an Azure Cognitive Search synonym map.
*
Expand All @@ -1423,27 +1318,6 @@ public void deleteSynonymMap(String synonymMapName,
asyncClient.deleteSynonymMap(synonymMapName, accessCondition, requestOptions).block();
}

/**
* Deletes an Azure Cognitive Search synonym map.
*
* @param synonymMapName the name of the synonym map to delete
* @param accessCondition the condition where the operation will be performed if the ETag on the server matches or
* doesn't match specified values
* @param requestOptions additional parameters for the operation.
* Contains the tracking ID sent with the request to help with debugging
* @param context additional context that is passed through the Http pipeline during the service call
* Contains the tracking ID sent with the request to help with debugging
*/
public void deleteSynonymMap(String synonymMapName,
AccessCondition accessCondition,
RequestOptions requestOptions,
Context context) {
this.deleteSynonymMapWithResponse(synonymMapName,
accessCondition,
requestOptions,
context);
}

/**
* Deletes an Azure Cognitive Search synonym map.
*
Expand All @@ -1460,9 +1334,7 @@ public Response<Void> deleteSynonymMapWithResponse(String synonymMapName,
RequestOptions requestOptions,
Context context) {
return asyncClient.deleteSynonymMapWithResponse(synonymMapName,
accessCondition,
requestOptions,
context).block();
accessCondition, requestOptions, context).block();
}

/**
Expand All @@ -1487,20 +1359,6 @@ public Boolean synonymMapExists(String synonymMapName, RequestOptions requestOpt
return asyncClient.synonymMapExists(synonymMapName, requestOptions).block();
}

/**
* Determines whether or not the given synonym map exists.
*
* @param synonymMapName the name of the synonym map
* @param requestOptions additional parameters for the operation.
* Contains the tracking ID sent with the request to help with debugging
* @param context additional context that is passed through the HTTP pipeline during the service call
* @return true if the synonym map exists; false otherwise.
*/
public Boolean synonymMapExists(String synonymMapName, RequestOptions requestOptions, Context context) {
return this.synonymMapExistsWithResponse(synonymMapName, requestOptions, context)
.getValue();
}

/**
* Determines whether or not the given synonym map exists.
*
Expand All @@ -1514,7 +1372,6 @@ public Response<Boolean> synonymMapExistsWithResponse(String synonymMapName,
RequestOptions requestOptions,
Context context) {
return asyncClient
.synonymMapExistsWithResponse(synonymMapName, requestOptions, context)
.block();
.synonymMapExistsWithResponse(synonymMapName, requestOptions, context).block();
}
}
Loading

0 comments on commit d6d6869

Please sign in to comment.