diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/AMLParameters.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/AzureMachineLearningParameters.java similarity index 79% rename from sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/AMLParameters.java rename to sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/AzureMachineLearningParameters.java index bce09e0d1505..a27e14a17c3f 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/AMLParameters.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/AzureMachineLearningParameters.java @@ -19,7 +19,7 @@ * Specifies the properties for connecting to an AML vectorizer. */ @Fluent -public final class AMLParameters implements JsonSerializable { +public final class AzureMachineLearningParameters implements JsonSerializable { /* * (Required for no authentication or key authentication) The scoring URI of the AML service to which the JSON * payload will be sent. Only the https URI scheme is allowed. @@ -55,11 +55,11 @@ public final class AMLParameters implements JsonSerializable { private AIStudioModelCatalogName modelName; /** - * Creates an instance of AMLParameters class. + * Creates an instance of AzureMachineLearningParameters class. * * @param scoringUri the scoringUri value to set. */ - public AMLParameters(String scoringUri) { + public AzureMachineLearningParameters(String scoringUri) { this.scoringUri = scoringUri; } @@ -86,9 +86,9 @@ public String getAuthenticationKey() { * Set the authenticationKey property: (Required for key authentication) The key for the AML service. * * @param authenticationKey the authenticationKey value to set. - * @return the AMLParameters object itself. + * @return the AzureMachineLearningParameters object itself. */ - public AMLParameters setAuthenticationKey(String authenticationKey) { + public AzureMachineLearningParameters setAuthenticationKey(String authenticationKey) { this.authenticationKey = authenticationKey; return this; } @@ -110,9 +110,9 @@ public String getResourceId() { * subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.MachineLearningServices/workspaces/{workspace-name}/services/{service_name}. * * @param resourceId the resourceId value to set. - * @return the AMLParameters object itself. + * @return the AzureMachineLearningParameters object itself. */ - public AMLParameters setResourceId(String resourceId) { + public AzureMachineLearningParameters setResourceId(String resourceId) { this.resourceId = resourceId; return this; } @@ -132,9 +132,9 @@ public Duration getTimeout() { * call. * * @param timeout the timeout value to set. - * @return the AMLParameters object itself. + * @return the AzureMachineLearningParameters object itself. */ - public AMLParameters setTimeout(Duration timeout) { + public AzureMachineLearningParameters setTimeout(Duration timeout) { this.timeout = timeout; return this; } @@ -152,9 +152,9 @@ public String getRegion() { * Set the region property: (Optional for token authentication). The region the AML service is deployed in. * * @param region the region value to set. - * @return the AMLParameters object itself. + * @return the AzureMachineLearningParameters object itself. */ - public AMLParameters setRegion(String region) { + public AzureMachineLearningParameters setRegion(String region) { this.region = region; return this; } @@ -174,9 +174,9 @@ public AIStudioModelCatalogName getModelName() { * the provided endpoint. * * @param modelName the modelName value to set. - * @return the AMLParameters object itself. + * @return the AzureMachineLearningParameters object itself. */ - public AMLParameters setModelName(AIStudioModelCatalogName modelName) { + public AzureMachineLearningParameters setModelName(AIStudioModelCatalogName modelName) { this.modelName = modelName; return this; } @@ -194,15 +194,15 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { } /** - * Reads an instance of AMLParameters from the JsonReader. + * Reads an instance of AzureMachineLearningParameters from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of AMLParameters if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. + * @return An instance of AzureMachineLearningParameters if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the AMLParameters. + * @throws IOException If an error occurs while reading the AzureMachineLearningParameters. */ - public static AMLParameters fromJson(JsonReader jsonReader) throws IOException { + public static AzureMachineLearningParameters fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { boolean scoringUriFound = false; String scoringUri = null; @@ -233,14 +233,15 @@ public static AMLParameters fromJson(JsonReader jsonReader) throws IOException { } } if (scoringUriFound) { - AMLParameters deserializedAMLParameters = new AMLParameters(scoringUri); - deserializedAMLParameters.authenticationKey = authenticationKey; - deserializedAMLParameters.resourceId = resourceId; - deserializedAMLParameters.timeout = timeout; - deserializedAMLParameters.region = region; - deserializedAMLParameters.modelName = modelName; - - return deserializedAMLParameters; + AzureMachineLearningParameters deserializedAzureMachineLearningParameters + = new AzureMachineLearningParameters(scoringUri); + deserializedAzureMachineLearningParameters.authenticationKey = authenticationKey; + deserializedAzureMachineLearningParameters.resourceId = resourceId; + deserializedAzureMachineLearningParameters.timeout = timeout; + deserializedAzureMachineLearningParameters.region = region; + deserializedAzureMachineLearningParameters.modelName = modelName; + + return deserializedAzureMachineLearningParameters; } throw new IllegalStateException("Missing required property: uri"); }); diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/AMLVectorizer.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/AzureMachineLearningVectorizer.java similarity index 69% rename from sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/AMLVectorizer.java rename to sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/AzureMachineLearningVectorizer.java index 505a34a8d926..301ad886d438 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/AMLVectorizer.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/AzureMachineLearningVectorizer.java @@ -17,18 +17,18 @@ * vector embedding of a query string. */ @Fluent -public final class AMLVectorizer extends VectorSearchVectorizer { +public final class AzureMachineLearningVectorizer extends VectorSearchVectorizer { /* * Specifies the properties of the AML vectorizer. */ - private AMLParameters aMLParameters; + private AzureMachineLearningParameters aMLParameters; /** - * Creates an instance of AMLVectorizer class. + * Creates an instance of AzureMachineLearningVectorizer class. * * @param name the name value to set. */ - public AMLVectorizer(String name) { + public AzureMachineLearningVectorizer(String name) { super(name); } @@ -37,7 +37,7 @@ public AMLVectorizer(String name) { * * @return the aMLParameters value. */ - public AMLParameters getAMLParameters() { + public AzureMachineLearningParameters getAMLParameters() { return this.aMLParameters; } @@ -45,9 +45,9 @@ public AMLParameters getAMLParameters() { * Set the aMLParameters property: Specifies the properties of the AML vectorizer. * * @param aMLParameters the aMLParameters value to set. - * @return the AMLVectorizer object itself. + * @return the AzureMachineLearningVectorizer object itself. */ - public AMLVectorizer setAMLParameters(AMLParameters aMLParameters) { + public AzureMachineLearningVectorizer setAMLParameters(AzureMachineLearningParameters aMLParameters) { this.aMLParameters = aMLParameters; return this; } @@ -63,20 +63,20 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { } /** - * Reads an instance of AMLVectorizer from the JsonReader. + * Reads an instance of AzureMachineLearningVectorizer from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of AMLVectorizer if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. + * @return An instance of AzureMachineLearningVectorizer if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. * @throws IllegalStateException If the deserialized JSON object was missing any required properties or the * polymorphic discriminator. - * @throws IOException If an error occurs while reading the AMLVectorizer. + * @throws IOException If an error occurs while reading the AzureMachineLearningVectorizer. */ - public static AMLVectorizer fromJson(JsonReader jsonReader) throws IOException { + public static AzureMachineLearningVectorizer fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { boolean nameFound = false; String name = null; - AMLParameters aMLParameters = null; + AzureMachineLearningParameters aMLParameters = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); @@ -92,16 +92,17 @@ public static AMLVectorizer fromJson(JsonReader jsonReader) throws IOException { name = reader.getString(); nameFound = true; } else if ("amlParameters".equals(fieldName)) { - aMLParameters = AMLParameters.fromJson(reader); + aMLParameters = AzureMachineLearningParameters.fromJson(reader); } else { reader.skipChildren(); } } if (nameFound) { - AMLVectorizer deserializedAMLVectorizer = new AMLVectorizer(name); - deserializedAMLVectorizer.aMLParameters = aMLParameters; + AzureMachineLearningVectorizer deserializedAzureMachineLearningVectorizer + = new AzureMachineLearningVectorizer(name); + deserializedAzureMachineLearningVectorizer.aMLParameters = aMLParameters; - return deserializedAMLVectorizer; + return deserializedAzureMachineLearningVectorizer; } throw new IllegalStateException("Missing required property: name"); }); diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchServiceLimits.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchServiceLimits.java index 1a7bd1686be1..56ed0ebb3253 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchServiceLimits.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchServiceLimits.java @@ -165,7 +165,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeNumberField("maxComplexCollectionFieldsPerIndex", this.maxComplexCollectionFieldsPerIndex); jsonWriter.writeNumberField("maxComplexObjectsInCollectionsPerDocument", this.maxComplexObjectsInCollectionsPerDocument); - jsonWriter.writeNumberField("maxStoragePerIndexInBytes", this.maxStoragePerIndexInBytes); + jsonWriter.writeNumberField("maxStoragePerIndex", this.maxStoragePerIndexInBytes); return jsonWriter.writeEndObject(); } @@ -195,7 +195,7 @@ public static SearchServiceLimits fromJson(JsonReader jsonReader) throws IOExcep } else if ("maxComplexObjectsInCollectionsPerDocument".equals(fieldName)) { deserializedSearchServiceLimits.maxComplexObjectsInCollectionsPerDocument = reader.getNullable(JsonReader::getInt); - } else if ("maxStoragePerIndexInBytes".equals(fieldName)) { + } else if ("maxStoragePerIndex".equals(fieldName)) { deserializedSearchServiceLimits.maxStoragePerIndexInBytes = reader.getNullable(JsonReader::getLong); } else { reader.skipChildren(); diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/VectorSearchVectorizer.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/VectorSearchVectorizer.java index 092234212721..eda331029689 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/VectorSearchVectorizer.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/VectorSearchVectorizer.java @@ -82,7 +82,7 @@ public static VectorSearchVectorizer fromJson(JsonReader jsonReader) throws IOEx } else if ("aiServicesVision".equals(discriminatorValue)) { return AIServicesVisionVectorizer.fromJson(readerToUse.reset()); } else if ("aml".equals(discriminatorValue)) { - return AMLVectorizer.fromJson(readerToUse.reset()); + return AzureMachineLearningVectorizer.fromJson(readerToUse.reset()); } else { return fromJsonKnownDiscriminator(readerToUse.reset()); } diff --git a/sdk/search/azure-search-documents/swagger/README.md b/sdk/search/azure-search-documents/swagger/README.md index 9be65913d502..243c95197879 100644 --- a/sdk/search/azure-search-documents/swagger/README.md +++ b/sdk/search/azure-search-documents/swagger/README.md @@ -216,17 +216,6 @@ directive: return $; ``` -### Rename `maxStoragePerIndex` property to `maxStoragePerIndexInBytes` in ServiceLimits - -``` yaml $(tag) == 'searchservice' -directive: - - from: swagger-document - where: $.definitions.ServiceLimits.properties - transform: > - $.maxStoragePerIndexInBytes = $.maxStoragePerIndex; - delete $.maxStoragePerIndex; -``` - ### Set `hybridSearch` property to be type `HybridSearch` in SearchRequest ``` yaml $(tag) == 'searchindex' @@ -264,6 +253,7 @@ directive: transform: > $.ServiceCounters["x-ms-client-name"] = "SearchServiceCounters"; $.ServiceLimits["x-ms-client-name"] = "SearchServiceLimits"; + $.ServiceLimits.properties.maxStoragePerIndex["x-ms-client-name"] = "maxStoragePerIndexInBytes"; $.ServiceStatistics["x-ms-client-name"] = "SearchServiceStatistics"; ``` @@ -438,3 +428,21 @@ directive: where: $.definitions.VectorQuery.properties.k transform: $["x-ms-client-name"] = "KNearestNeighborsCount"; ``` + +### Rename `AMLVectorizer` to `AzureMachineLearningVectorizer` + +```yaml $(tag) == 'searchservice' +directive: +- from: swagger-document + where: $.definitions.AMLVectorizer + transform: $["x-ms-client-name"] = "AzureMachineLearningVectorizer"; +``` + +### Rename `AMLParameters` to `AzureMachineLearningParameters` + +```yaml $(tag) == 'searchservice' +directive: +- from: swagger-document + where: $.definitions.AMLParameters + transform: $["x-ms-client-name"] = "AzureMachineLearningParameters"; +```