Skip to content

Commit

Permalink
Search March 2024 Preview (#38998)
Browse files Browse the repository at this point in the history
* March Preview Regen

* Regenerating swagger

* Adding `stored` SearchField annotation to FieldBuilder

* Include suppression files

* Updating Service Version Preview and test re-recordings

* Adding Support for Int16 and SByte

* Updating FieldBuilderTests and re-recording tests

* re-recording tests

* re-recording tests

* re-recording tests and fixing test failure

* re-recording tests

* updating code coverage requirements
  • Loading branch information
jairmyree authored and drielenr committed Mar 28, 2024
1 parent 6fb90c4 commit 0ecc7ef
Show file tree
Hide file tree
Showing 43 changed files with 1,905 additions and 442 deletions.
2 changes: 1 addition & 1 deletion sdk/search/azure-search-documents/assets.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"AssetsRepo": "Azure/azure-sdk-assets",
"AssetsRepoPrefixPath": "java",
"TagPrefix": "java/search/azure-search-documents",
"Tag": "java/search/azure-search-documents_134672a8ec"
"Tag": "java/search/azure-search-documents_68da41c6ed"
}
2 changes: 1 addition & 1 deletion sdk/search/azure-search-documents/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<!-- Coverage used to be higher but between additional, unused generated client APIs and unused models' JSON serialization it has been lowered. -->
<!-- In the future this will be cleaned up and coverage should be increased again. -->
<jacoco.min.linecoverage>0.59</jacoco.min.linecoverage>
<jacoco.min.linecoverage>0.56</jacoco.min.linecoverage>
<jacoco.min.branchcoverage>0.47</jacoco.min.branchcoverage>
<!-- Configures the Java 9+ run to perform the required module exports, opens, and reads that are necessary for testing but shouldn't be part of the module-info. -->
<javaModulesSurefireArgLine>
Expand Down
8 changes: 3 additions & 5 deletions sdk/search/azure-search-documents/spotbugs-exclude.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
<Bug pattern="EI_EXPOSE_REP" />
<Or>
<Class name="com.azure.search.documents.GeographyPointTests$SimpleDocument" />
<Class name="com.azure.search.documents.implementation.models.ErrorDetail" />
<Class name="com.azure.search.documents.implementation.models.IndexAction" />
<Class name="com.azure.search.documents.implementation.models.IndexBatch" />
<Class name="com.azure.search.documents.implementation.models.SearchDocumentsResult" />
Expand All @@ -36,6 +37,7 @@
<Class name="com.azure.search.documents.indexes.implementation.models.DocumentKeysOrIds" />
<Class name="com.azure.search.documents.indexes.implementation.models.EntityRecognitionSkillV1" />
<Class name="com.azure.search.documents.indexes.implementation.models.EntityRecognitionSkillV3" />
<Class name="com.azure.search.documents.indexes.implementation.models.ErrorDetail" />
<Class name="com.azure.search.documents.indexes.implementation.models.ListAliasesResult" />
<Class name="com.azure.search.documents.indexes.implementation.models.ListDataSourcesResult" />
<Class name="com.azure.search.documents.indexes.implementation.models.ListIndexersResult" />
Expand Down Expand Up @@ -130,8 +132,8 @@
<Match>
<Bug pattern="EI_EXPOSE_REP2" />
<Or>
<Class name="com.azure.search.documents.SearchClientBuilder" />
<Class name="com.azure.search.documents.GeographyPointTests$SimpleDocument" />
<Class name="com.azure.search.documents.SearchClientBuilder" />
<Class name="com.azure.search.documents.implementation.models.IndexAction" />
<Class name="com.azure.search.documents.implementation.models.IndexBatch" />
<Class name="com.azure.search.documents.implementation.models.SearchDocumentsResult" />
Expand Down Expand Up @@ -243,10 +245,6 @@
<Bug pattern="NP_BOOLEAN_RETURN_NULL" />
<Class name="com.azure.search.documents.indexes.models.EntityRecognitionSkill" />
</Match>
<Match>
<Bug pattern="SIC_INNER_SHOULD_BE_STATIC" />
<Class name="com.azure.search.documents.ReadmeSamples$Hotel" />
</Match>
<Match>
<Bug pattern="SS_SHOULD_BE_STATIC" />
<Or>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ public enum SearchServiceVersion implements ServiceVersion {
V2023_11_01("2023-11-01"),

/**
* {@code 2023-10-01-preview} service version.
* {@code 2024-03-01-preview} service version.
*/
V2023_10_01_PREVIEW("2023-10-01-preview");
V2024_03_01_PREVIEW("2024-03-01-preview");

private final String version;

Expand All @@ -44,6 +44,6 @@ public String getVersion() {
* @return The latest version supported by this client library.
*/
public static SearchServiceVersion getLatest() {
return V2023_10_01_PREVIEW;
return V2024_03_01_PREVIEW;
}
}

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.

package com.azure.search.documents.implementation.models;

import com.azure.core.annotation.Immutable;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import java.io.IOException;

/**
* The resource management error additional info.
*/
@Immutable
public final class ErrorAdditionalInfo implements JsonSerializable<ErrorAdditionalInfo> {
/*
* The additional info type.
*/
private String type;

/*
* The additional info.
*/
private Object info;

/**
* Creates an instance of ErrorAdditionalInfo class.
*/
public ErrorAdditionalInfo() {
}

/**
* Get the type property: The additional info type.
*
* @return the type value.
*/
public String getType() {
return this.type;
}

/**
* Get the info property: The additional info.
*
* @return the info value.
*/
public Object getInfo() {
return this.info;
}

@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
return jsonWriter.writeEndObject();
}

/**
* Reads an instance of ErrorAdditionalInfo from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of ErrorAdditionalInfo if the JsonReader was pointing to an instance of it, or null if it was
* pointing to JSON null.
* @throws IOException If an error occurs while reading the ErrorAdditionalInfo.
*/
public static ErrorAdditionalInfo fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
ErrorAdditionalInfo deserializedErrorAdditionalInfo = new ErrorAdditionalInfo();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();

if ("type".equals(fieldName)) {
deserializedErrorAdditionalInfo.type = reader.getString();
} else if ("info".equals(fieldName)) {
deserializedErrorAdditionalInfo.info = reader.readUntyped();
} else {
reader.skipChildren();
}
}

return deserializedErrorAdditionalInfo;
});
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.

package com.azure.search.documents.implementation.models;

import com.azure.core.annotation.Immutable;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import java.io.IOException;
import java.util.List;

/**
* The error detail.
*/
@Immutable
public final class ErrorDetail implements JsonSerializable<ErrorDetail> {
/*
* The error code.
*/
private String code;

/*
* The error message.
*/
private String message;

/*
* The error target.
*/
private String target;

/*
* The error details.
*/
private List<ErrorDetail> details;

/*
* The error additional info.
*/
private List<ErrorAdditionalInfo> additionalInfo;

/**
* Creates an instance of ErrorDetail class.
*/
public ErrorDetail() {
}

/**
* Get the code property: The error code.
*
* @return the code value.
*/
public String getCode() {
return this.code;
}

/**
* Get the message property: The error message.
*
* @return the message value.
*/
public String getMessage() {
return this.message;
}

/**
* Get the target property: The error target.
*
* @return the target value.
*/
public String getTarget() {
return this.target;
}

/**
* Get the details property: The error details.
*
* @return the details value.
*/
public List<ErrorDetail> getDetails() {
return this.details;
}

/**
* Get the additionalInfo property: The error additional info.
*
* @return the additionalInfo value.
*/
public List<ErrorAdditionalInfo> getAdditionalInfo() {
return this.additionalInfo;
}

@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
return jsonWriter.writeEndObject();
}

/**
* Reads an instance of ErrorDetail from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of ErrorDetail if the JsonReader was pointing to an instance of it, or null if it was
* pointing to JSON null.
* @throws IOException If an error occurs while reading the ErrorDetail.
*/
public static ErrorDetail fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
ErrorDetail deserializedErrorDetail = new ErrorDetail();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();

if ("code".equals(fieldName)) {
deserializedErrorDetail.code = reader.getString();
} else if ("message".equals(fieldName)) {
deserializedErrorDetail.message = reader.getString();
} else if ("target".equals(fieldName)) {
deserializedErrorDetail.target = reader.getString();
} else if ("details".equals(fieldName)) {
List<ErrorDetail> details = reader.readArray(reader1 -> ErrorDetail.fromJson(reader1));
deserializedErrorDetail.details = details;
} else if ("additionalInfo".equals(fieldName)) {
List<ErrorAdditionalInfo> additionalInfo
= reader.readArray(reader1 -> ErrorAdditionalInfo.fromJson(reader1));
deserializedErrorDetail.additionalInfo = additionalInfo;
} else {
reader.skipChildren();
}
}

return deserializedErrorDetail;
});
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.

package com.azure.search.documents.implementation.models;

import com.azure.core.annotation.Fluent;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import java.io.IOException;

/**
* Error response
*
* Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also
* follows the OData error response format.).
*/
@Fluent
public final class ErrorResponse implements JsonSerializable<ErrorResponse> {
/*
* The error object.
*/
private ErrorDetail error;

/**
* Creates an instance of ErrorResponse class.
*/
public ErrorResponse() {
}

/**
* Get the error property: The error object.
*
* @return the error value.
*/
public ErrorDetail getError() {
return this.error;
}

/**
* Set the error property: The error object.
*
* @param error the error value to set.
* @return the ErrorResponse object itself.
*/
public ErrorResponse setError(ErrorDetail error) {
this.error = error;
return this;
}

@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeJsonField("error", this.error);
return jsonWriter.writeEndObject();
}

/**
* Reads an instance of ErrorResponse from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of ErrorResponse if the JsonReader was pointing to an instance of it, or null if it was
* pointing to JSON null.
* @throws IOException If an error occurs while reading the ErrorResponse.
*/
public static ErrorResponse fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
ErrorResponse deserializedErrorResponse = new ErrorResponse();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();

if ("error".equals(fieldName)) {
deserializedErrorResponse.error = ErrorDetail.fromJson(reader);
} else {
reader.skipChildren();
}
}

return deserializedErrorResponse;
});
}
}
Loading

0 comments on commit 0ecc7ef

Please sign in to comment.