}
+ * (JSON Merge Patch), where each property can be in 3 states: not set (unchanged), null
+ * (removed), or set to a value. The Java emitter intentionally does not generate flattened
+ * convenience methods for merge-patch requests because method parameters can only represent
+ * 2 states (value or null). See:
+ * https://azure.github.io/typespec-azure/docs/howtos/generate-client-libraries/04method/#spread-cases
+ *
+ * We suppress the emitter's convenience API via {@code @@convenientAPI(false, "java")} in
+ * client.tsp and add our own here instead. This is safe for ContentUnderstandingDefaults because
+ * {@code modelDeployments} is the only property, and users always want to set it (never remove
+ * it), so the 3-state limitation does not apply.
+ *
+ *
If ContentUnderstandingDefaults gains additional properties in the future, revisit whether
+ * this simplified approach is still appropriate.
+ */
+ private void addUpdateDefaultsConvenienceMethods(LibraryCustomization customization, Logger logger) {
+ logger.info("Adding updateDefaults convenience methods");
+
+ // Add to sync client
+ customization.getClass(PACKAGE_NAME, "ContentUnderstandingClient").customizeAst(ast -> {
+ ast.addImport("com.azure.ai.contentunderstanding.models.ContentUnderstandingDefaults");
+ ast.addImport("com.azure.core.annotation.ReturnType");
+ ast.addImport("com.azure.core.annotation.ServiceMethod");
+ ast.addImport("com.azure.core.util.BinaryData");
+ ast.addImport("java.util.Map");
+
+ ast.getClassByName("ContentUnderstandingClient").ifPresent(clazz -> {
+ // Add updateDefaults convenience method with Map parameter - returns ContentUnderstandingDefaults directly
+ clazz.addMethod("updateDefaults", Modifier.Keyword.PUBLIC)
+ .addAnnotation(StaticJavaParser.parseAnnotation("@ServiceMethod(returns = ReturnType.SINGLE)"))
+ .setType("ContentUnderstandingDefaults")
+ .addParameter("Map", "modelDeployments")
+ .setJavadocComment(new Javadoc(JavadocDescription.parseText(
+ "Update default model deployment settings.\n\n"
+ + "This is the recommended public API for updating default model deployment settings. "
+ + "This method provides a simpler API that accepts a Map of model names to deployment names."))
+ .addBlockTag("param", "modelDeployments Mapping of model names to deployment names. "
+ + "For example: { \"gpt-4.1\": \"myGpt41Deployment\", \"text-embedding-3-large\": \"myTextEmbedding3LargeDeployment\" }.")
+ .addBlockTag("return", "the updated ContentUnderstandingDefaults.")
+ .addBlockTag("throws", "IllegalArgumentException thrown if parameters fail the validation.")
+ .addBlockTag("throws", "HttpResponseException thrown if the request is rejected by server."))
+ .setBody(StaticJavaParser.parseBlock("{"
+ + "ContentUnderstandingDefaults defaults = new ContentUnderstandingDefaults(modelDeployments);"
+ + "Response response = updateDefaultsWithResponse(BinaryData.fromObject(defaults), null);"
+ + "return response.getValue().toObject(ContentUnderstandingDefaults.class); }"));
+
+ // Add updateDefaults convenience method with ContentUnderstandingDefaults parameter
+ clazz.addMethod("updateDefaults", Modifier.Keyword.PUBLIC)
+ .addAnnotation(StaticJavaParser.parseAnnotation("@ServiceMethod(returns = ReturnType.SINGLE)"))
+ .setType("ContentUnderstandingDefaults")
+ .addParameter("ContentUnderstandingDefaults", "defaults")
+ .setJavadocComment(new Javadoc(JavadocDescription.parseText(
+ "Update default model deployment settings.\n\n"
+ + "This is a convenience method that accepts a ContentUnderstandingDefaults object."))
+ .addBlockTag("param", "defaults The ContentUnderstandingDefaults instance with settings to update.")
+ .addBlockTag("return", "the updated ContentUnderstandingDefaults.")
+ .addBlockTag("throws", "IllegalArgumentException thrown if parameters fail the validation.")
+ .addBlockTag("throws", "HttpResponseException thrown if the request is rejected by server."))
+ .setBody(StaticJavaParser.parseBlock("{"
+ + "Response response = updateDefaultsWithResponse(BinaryData.fromObject(defaults), null);"
+ + "return response.getValue().toObject(ContentUnderstandingDefaults.class); }"));
+ });
+ });
+
+ // Add to async client
+ customization.getClass(PACKAGE_NAME, "ContentUnderstandingAsyncClient").customizeAst(ast -> {
+ ast.addImport("com.azure.ai.contentunderstanding.models.ContentUnderstandingDefaults");
+ ast.addImport("com.azure.core.annotation.ReturnType");
+ ast.addImport("com.azure.core.annotation.ServiceMethod");
+ ast.addImport("com.azure.core.util.BinaryData");
+ ast.addImport("java.util.Map");
+
+ ast.getClassByName("ContentUnderstandingAsyncClient").ifPresent(clazz -> {
+ // Add updateDefaults convenience method with Map parameter - returns Mono
+ clazz.addMethod("updateDefaults", Modifier.Keyword.PUBLIC)
+ .addAnnotation(StaticJavaParser.parseAnnotation("@ServiceMethod(returns = ReturnType.SINGLE)"))
+ .setType("Mono")
+ .addParameter("Map", "modelDeployments")
+ .setJavadocComment(new Javadoc(JavadocDescription.parseText(
+ "Update default model deployment settings.\n\n"
+ + "This is the recommended public API for updating default model deployment settings. "
+ + "This method provides a simpler API that accepts a Map of model names to deployment names."))
+ .addBlockTag("param", "modelDeployments Mapping of model names to deployment names. "
+ + "For example: { \"gpt-4.1\": \"myGpt41Deployment\", \"text-embedding-3-large\": \"myTextEmbedding3LargeDeployment\" }.")
+ .addBlockTag("return", "the updated ContentUnderstandingDefaults on successful completion of {@link Mono}.")
+ .addBlockTag("throws", "IllegalArgumentException thrown if parameters fail the validation.")
+ .addBlockTag("throws", "HttpResponseException thrown if the request is rejected by server."))
+ .setBody(StaticJavaParser.parseBlock("{"
+ + "ContentUnderstandingDefaults defaults = new ContentUnderstandingDefaults(modelDeployments);"
+ + "return updateDefaultsWithResponse(BinaryData.fromObject(defaults), null)"
+ + ".map(response -> response.getValue().toObject(ContentUnderstandingDefaults.class)); }"));
+
+ // Add updateDefaults convenience method with ContentUnderstandingDefaults parameter
+ clazz.addMethod("updateDefaults", Modifier.Keyword.PUBLIC)
+ .addAnnotation(StaticJavaParser.parseAnnotation("@ServiceMethod(returns = ReturnType.SINGLE)"))
+ .setType("Mono")
+ .addParameter("ContentUnderstandingDefaults", "defaults")
+ .setJavadocComment(new Javadoc(JavadocDescription.parseText(
+ "Update default model deployment settings.\n\n"
+ + "This is a convenience method that accepts a ContentUnderstandingDefaults object."))
+ .addBlockTag("param", "defaults The ContentUnderstandingDefaults instance with settings to update.")
+ .addBlockTag("return", "the updated ContentUnderstandingDefaults on successful completion of {@link Mono}.")
+ .addBlockTag("throws", "IllegalArgumentException thrown if parameters fail the validation.")
+ .addBlockTag("throws", "HttpResponseException thrown if the request is rejected by server."))
+ .setBody(StaticJavaParser.parseBlock("{"
+ + "return updateDefaultsWithResponse(BinaryData.fromObject(defaults), null)"
+ + ".map(response -> response.getValue().toObject(ContentUnderstandingDefaults.class)); }"));
+ });
+ });
+ }
+
+ /**
+ * Add beginAnalyzeBinary 2-param convenience overloads without stringEncoding.
+ * 2-param overloads delegate to the ContentRange overload (added by addContentRangeOverloads).
+ */
+ private void addBeginAnalyzeBinaryConvenienceOverloads(LibraryCustomization customization, Logger logger) {
+ logger.info("Adding beginAnalyzeBinary convenience overloads (2 param)");
+
+ // Sync client
+ customization.getClass(PACKAGE_NAME, "ContentUnderstandingClient").customizeAst(ast -> {
+ ast.addImport("com.azure.ai.contentunderstanding.models.ContentRange");
+ ast.getClassByName("ContentUnderstandingClient").ifPresent(clazz -> {
+ // 2-param: analyzerId, binaryInput
+ clazz.addMethod("beginAnalyzeBinary", Modifier.Keyword.PUBLIC)
+ .setType("SyncPoller")
+ .addParameter("String", "analyzerId")
+ .addParameter("BinaryData", "binaryInput")
+ .addAnnotation(StaticJavaParser.parseAnnotation("@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)"))
+ .setJavadocComment(new Javadoc(JavadocDescription.parseText(
+ "Extract content and fields from binary input. Uses default content type (application/octet-stream), "
+ + "default string encoding (utf16), and service default processing location."))
+ .addBlockTag("param", "analyzerId The unique identifier of the analyzer.")
+ .addBlockTag("param", "binaryInput The binary content of the document to analyze.")
+ .addBlockTag("return", "the {@link SyncPoller} for polling of the analyze operation.")
+ .addBlockTag("throws", "IllegalArgumentException thrown if parameters fail the validation.")
+ .addBlockTag("throws", "HttpResponseException thrown if the request is rejected by server."))
+ .setBody(StaticJavaParser.parseBlock("{"
+ + "return beginAnalyzeBinary(analyzerId, binaryInput, (ContentRange) null, \"application/octet-stream\", null); }"));
+ });
+ });
+
+ // Async client
+ customization.getClass(PACKAGE_NAME, "ContentUnderstandingAsyncClient").customizeAst(ast -> {
+ ast.addImport("com.azure.ai.contentunderstanding.models.ContentRange");
+ ast.getClassByName("ContentUnderstandingAsyncClient").ifPresent(clazz -> {
+ // 2-param: analyzerId, binaryInput
+ clazz.addMethod("beginAnalyzeBinary", Modifier.Keyword.PUBLIC)
+ .setType("PollerFlux")
+ .addParameter("String", "analyzerId")
+ .addParameter("BinaryData", "binaryInput")
+ .addAnnotation(StaticJavaParser.parseAnnotation("@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)"))
+ .setJavadocComment(new Javadoc(JavadocDescription.parseText(
+ "Extract content and fields from binary input. Uses default content type (application/octet-stream), "
+ + "default string encoding (utf16), and service default processing location."))
+ .addBlockTag("param", "analyzerId The unique identifier of the analyzer.")
+ .addBlockTag("param", "binaryInput The binary content of the document to analyze.")
+ .addBlockTag("return", "the {@link PollerFlux} for polling of the analyze operation.")
+ .addBlockTag("throws", "IllegalArgumentException thrown if parameters fail the validation.")
+ .addBlockTag("throws", "HttpResponseException thrown if the request is rejected by server."))
+ .setBody(StaticJavaParser.parseBlock("{"
+ + "return beginAnalyzeBinary(analyzerId, binaryInput, (ContentRange) null, \"application/octet-stream\", null); }"));
+ });
+ });
+ }
+
+ /**
+ * Add beginAnalyzeBinary overload accepting ContentRange for a self-documenting range API.
+ * This is the primary convenience overload — the 2-param overload delegates here.
+ * Adds to both sync and async clients.
+ */
+ private void addContentRangeOverloads(LibraryCustomization customization, Logger logger) {
+ logger.info("Adding ContentRange overloads for beginAnalyzeBinary");
+
+ // Sync client
+ customization.getClass(PACKAGE_NAME, "ContentUnderstandingClient").customizeAst(ast -> {
+ ast.addImport("com.azure.ai.contentunderstanding.models.ContentRange");
+ ast.addImport("java.time.Duration");
+ ast.getClassByName("ContentUnderstandingClient").ifPresent(clazz -> {
+ clazz.addMethod("beginAnalyzeBinary", Modifier.Keyword.PUBLIC)
+ .setType("SyncPoller")
+ .addParameter("String", "analyzerId")
+ .addParameter("BinaryData", "binaryInput")
+ .addParameter("ContentRange", "contentRange")
+ .addParameter("String", "contentType")
+ .addParameter("ProcessingLocation", "processingLocation")
+ .addAnnotation(StaticJavaParser.parseAnnotation("@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)"))
+ .setJavadocComment(new Javadoc(JavadocDescription.parseText(
+ "Extract content and fields from binary input. Uses default string encoding (utf16).\n\n"
+ + "Use factory methods such as {@link ContentRange#pages(int, int)}, "
+ + "{@link ContentRange#timeRange(long, long)}, or "
+ + "{@link ContentRange#combine(ContentRange...)} to build the range."))
+ .addBlockTag("param", "analyzerId The unique identifier of the analyzer.")
+ .addBlockTag("param", "binaryInput The binary content of the document to analyze.")
+ .addBlockTag("param", "contentRange Range of the input to analyze. Use ContentRange factory methods to build the range, or null to skip.")
+ .addBlockTag("param", "contentType Request content type.")
+ .addBlockTag("param", "processingLocation The location where the data may be processed. Set to null for service default.")
+ .addBlockTag("return", "the {@link SyncPoller} for polling of the analyze operation.")
+ .addBlockTag("throws", "IllegalArgumentException thrown if parameters fail the validation.")
+ .addBlockTag("throws", "HttpResponseException thrown if the request is rejected by server."))
+ .setBody(StaticJavaParser.parseBlock("{"
+ + "RequestOptions requestOptions = new RequestOptions();"
+ + "if (contentRange != null) { requestOptions.addQueryParam(\"range\", contentRange.toString(), false); }"
+ + "if (processingLocation != null) { requestOptions.addQueryParam(\"processingLocation\", processingLocation.toString(), false); }"
+ + "requestOptions.addQueryParam(\"stringEncoding\", \"utf16\", false);"
+ + "return serviceClient.beginAnalyzeBinaryWithModel(analyzerId, contentType, binaryInput, requestOptions)"
+ + ".setPollInterval(Duration.ofSeconds(3)); }"));
+ });
+ });
+
+ // Async client
+ customization.getClass(PACKAGE_NAME, "ContentUnderstandingAsyncClient").customizeAst(ast -> {
+ ast.addImport("com.azure.ai.contentunderstanding.models.ContentRange");
+ ast.addImport("java.time.Duration");
+ ast.getClassByName("ContentUnderstandingAsyncClient").ifPresent(clazz -> {
+ clazz.addMethod("beginAnalyzeBinary", Modifier.Keyword.PUBLIC)
+ .setType("PollerFlux")
+ .addParameter("String", "analyzerId")
+ .addParameter("BinaryData", "binaryInput")
+ .addParameter("ContentRange", "contentRange")
+ .addParameter("String", "contentType")
+ .addParameter("ProcessingLocation", "processingLocation")
+ .addAnnotation(StaticJavaParser.parseAnnotation("@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)"))
+ .setJavadocComment(new Javadoc(JavadocDescription.parseText(
+ "Extract content and fields from binary input. Uses default string encoding (utf16).\n\n"
+ + "Use factory methods such as {@link ContentRange#pages(int, int)}, "
+ + "{@link ContentRange#timeRange(long, long)}, or "
+ + "{@link ContentRange#combine(ContentRange...)} to build the range."))
+ .addBlockTag("param", "analyzerId The unique identifier of the analyzer.")
+ .addBlockTag("param", "binaryInput The binary content of the document to analyze.")
+ .addBlockTag("param", "contentRange Range of the input to analyze. Use ContentRange factory methods to build the range, or null to skip.")
+ .addBlockTag("param", "contentType Request content type.")
+ .addBlockTag("param", "processingLocation The location where the data may be processed. Set to null for service default.")
+ .addBlockTag("return", "the {@link PollerFlux} for polling of the analyze operation.")
+ .addBlockTag("throws", "IllegalArgumentException thrown if parameters fail the validation.")
+ .addBlockTag("throws", "HttpResponseException thrown if the request is rejected by server."))
+ .setBody(StaticJavaParser.parseBlock("{"
+ + "RequestOptions requestOptions = new RequestOptions();"
+ + "if (contentRange != null) { requestOptions.addQueryParam(\"range\", contentRange.toString(), false); }"
+ + "if (processingLocation != null) { requestOptions.addQueryParam(\"processingLocation\", processingLocation.toString(), false); }"
+ + "requestOptions.addQueryParam(\"stringEncoding\", \"utf16\", false);"
+ + "return serviceClient.beginAnalyzeBinaryWithModelAsync(analyzerId, contentType, binaryInput, requestOptions)"
+ + ".setPollInterval(Duration.ofSeconds(3)); }"));
+ });
+ });
+ }
+
+ /**
+ * Add setContentRange(ContentRange) overload to AnalysisInput and hide raw String accessors.
+ * The typed overload replaces the String-based getter/setter for a self-documenting API.
+ */
+ private void addContentRangeSetterToAnalyzeInput(LibraryCustomization customization, Logger logger) {
+ logger.info("Adding setContentRange(ContentRange) overload and hiding String accessors on AnalysisInput");
+
+ customization.getClass(MODELS_PACKAGE, "AnalysisInput").customizeAst(ast -> {
+ ast.addImport("com.azure.ai.contentunderstanding.models.ContentRange");
+ ast.getClassByName("AnalysisInput").ifPresent(clazz -> {
+ // Hide getContentRange() returning String — make package-private
+ clazz.getMethodsByName("getContentRange").forEach(m -> {
+ if (m.getType().asString().equals("String")) {
+ m.removeModifier(Modifier.Keyword.PUBLIC);
+ }
+ });
+
+ // Hide setContentRange(String) — make package-private
+ clazz.getMethodsByName("setContentRange").forEach(m -> {
+ if (m.getParameters().size() == 1
+ && m.getParameter(0).getType().asString().equals("String")) {
+ m.removeModifier(Modifier.Keyword.PUBLIC);
+ }
+ });
+
+ // Add typed setContentRange(ContentRange)
+ clazz.addMethod("setContentRange", Modifier.Keyword.PUBLIC)
+ .setType("AnalysisInput")
+ .addParameter("ContentRange", "contentRange")
+ .setJavadocComment(new Javadoc(JavadocDescription.parseText(
+ "Set the contentRange property using a {@link ContentRange} for a self-documenting API.\n\n"
+ + "Use factory methods such as {@link ContentRange#pages(int, int)}, "
+ + "{@link ContentRange#timeRange(long, long)}, or "
+ + "{@link ContentRange#combine(ContentRange...)} to build the range."))
+ .addBlockTag("param", "contentRange the range value to set, or null to clear.")
+ .addBlockTag("return", "the AnalysisInput object itself."))
+ .setBody(StaticJavaParser.parseBlock("{"
+ + "this.contentRange = contentRange != null ? contentRange.toString() : null;"
+ + "return this; }"));
+ });
+ });
+ }
+
+ /**
+ * Add beginAnalyze convenience overloads without stringEncoding.
+ * Adds 2-param and 4-param overloads that default utf16.
+ */
+ private void addBeginAnalyzeConvenienceOverloads(LibraryCustomization customization, Logger logger) {
+ logger.info("Adding beginAnalyze convenience overloads (2/4 param)");
+
+ // Sync client
+ customization.getClass(PACKAGE_NAME, "ContentUnderstandingClient").customizeAst(ast -> {
+ ast.addImport("com.azure.ai.contentunderstanding.implementation.models.AnalyzeRequest1");
+ ast.addImport("com.azure.core.util.BinaryData");
+ ast.addImport("java.time.Duration");
+ ast.getClassByName("ContentUnderstandingClient").ifPresent(clazz -> {
+ // 2-param: analyzerId, inputs
+ clazz.addMethod("beginAnalyze", Modifier.Keyword.PUBLIC)
+ .setType("SyncPoller")
+ .addParameter("String", "analyzerId")
+ .addParameter("List", "inputs")
+ .addAnnotation(StaticJavaParser.parseAnnotation("@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)"))
+ .setJavadocComment(new Javadoc(JavadocDescription.parseText(
+ "Extract content and fields from inputs. Uses default string encoding (utf16), "
+ + "service default model deployments, and global processing location."))
+ .addBlockTag("param", "analyzerId The unique identifier of the analyzer.")
+ .addBlockTag("param", "inputs The inputs to analyze.")
+ .addBlockTag("return", "the {@link SyncPoller} for polling of the analyze operation.")
+ .addBlockTag("throws", "IllegalArgumentException thrown if parameters fail the validation.")
+ .addBlockTag("throws", "HttpResponseException thrown if the request is rejected by server."))
+ .setBody(StaticJavaParser.parseBlock("{"
+ + "return beginAnalyze(analyzerId, inputs, null, null); }"));
+
+ // 4-param: analyzerId, inputs, modelDeployments, processingLocation
+ clazz.addMethod("beginAnalyze", Modifier.Keyword.PUBLIC)
+ .setType("SyncPoller")
+ .addParameter("String", "analyzerId")
+ .addParameter("List", "inputs")
+ .addParameter("Map", "modelDeployments")
+ .addParameter("ProcessingLocation", "processingLocation")
+ .addAnnotation(StaticJavaParser.parseAnnotation("@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)"))
+ .setJavadocComment(new Javadoc(JavadocDescription.parseText(
+ "Extract content and fields from inputs. Uses default string encoding (utf16)."))
+ .addBlockTag("param", "analyzerId The unique identifier of the analyzer.")
+ .addBlockTag("param", "inputs The inputs to analyze.")
+ .addBlockTag("param", "modelDeployments Custom model deployment mappings. Set to null to use service defaults.")
+ .addBlockTag("param", "processingLocation The processing location for the analysis. Set to null to use the service default.")
+ .addBlockTag("return", "the {@link SyncPoller} for polling of the analyze operation.")
+ .addBlockTag("throws", "IllegalArgumentException thrown if parameters fail the validation.")
+ .addBlockTag("throws", "HttpResponseException thrown if the request is rejected by server."))
+ .setBody(StaticJavaParser.parseBlock("{"
+ + "RequestOptions requestOptions = new RequestOptions();"
+ + "if (processingLocation != null) { requestOptions.addQueryParam(\"processingLocation\", processingLocation.toString(), false); }"
+ + "requestOptions.addQueryParam(\"stringEncoding\", \"utf16\", false);"
+ + "AnalyzeRequest1 analyzeRequest1Obj = new AnalyzeRequest1(inputs).setModelDeployments(modelDeployments);"
+ + "BinaryData analyzeRequest1 = BinaryData.fromObject(analyzeRequest1Obj);"
+ + "return serviceClient.beginAnalyzeWithModel(analyzerId, analyzeRequest1, requestOptions)"
+ + ".setPollInterval(Duration.ofSeconds(3)); }"));
+ });
+ });
+
+ // Async client
+ customization.getClass(PACKAGE_NAME, "ContentUnderstandingAsyncClient").customizeAst(ast -> {
+ ast.addImport("com.azure.ai.contentunderstanding.implementation.models.AnalyzeRequest1");
+ ast.addImport("com.azure.core.util.BinaryData");
+ ast.addImport("java.time.Duration");
+ ast.getClassByName("ContentUnderstandingAsyncClient").ifPresent(clazz -> {
+ // 2-param: analyzerId, inputs
+ clazz.addMethod("beginAnalyze", Modifier.Keyword.PUBLIC)
+ .setType("PollerFlux")
+ .addParameter("String", "analyzerId")
+ .addParameter("List", "inputs")
+ .addAnnotation(StaticJavaParser.parseAnnotation("@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)"))
+ .setJavadocComment(new Javadoc(JavadocDescription.parseText(
+ "Extract content and fields from inputs. Uses default string encoding (utf16), "
+ + "service default model deployments, and global processing location."))
+ .addBlockTag("param", "analyzerId The unique identifier of the analyzer.")
+ .addBlockTag("param", "inputs The inputs to analyze.")
+ .addBlockTag("return", "the {@link PollerFlux} for polling of the analyze operation.")
+ .addBlockTag("throws", "IllegalArgumentException thrown if parameters fail the validation.")
+ .addBlockTag("throws", "HttpResponseException thrown if the request is rejected by server."))
+ .setBody(StaticJavaParser.parseBlock("{"
+ + "return beginAnalyze(analyzerId, inputs, null, null); }"));
+
+ // 4-param: analyzerId, inputs, modelDeployments, processingLocation
+ clazz.addMethod("beginAnalyze", Modifier.Keyword.PUBLIC)
+ .setType("PollerFlux")
+ .addParameter("String", "analyzerId")
+ .addParameter("List", "inputs")
+ .addParameter("Map", "modelDeployments")
+ .addParameter("ProcessingLocation", "processingLocation")
+ .addAnnotation(StaticJavaParser.parseAnnotation("@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)"))
+ .setJavadocComment(new Javadoc(JavadocDescription.parseText(
+ "Extract content and fields from inputs. Uses default string encoding (utf16)."))
+ .addBlockTag("param", "analyzerId The unique identifier of the analyzer.")
+ .addBlockTag("param", "inputs The inputs to analyze.")
+ .addBlockTag("param", "modelDeployments Custom model deployment mappings. Set to null to use service defaults.")
+ .addBlockTag("param", "processingLocation The processing location for the analysis. Set to null to use the service default.")
+ .addBlockTag("return", "the {@link PollerFlux} for polling of the analyze operation.")
+ .addBlockTag("throws", "IllegalArgumentException thrown if parameters fail the validation.")
+ .addBlockTag("throws", "HttpResponseException thrown if the request is rejected by server."))
+ .setBody(StaticJavaParser.parseBlock("{"
+ + "RequestOptions requestOptions = new RequestOptions();"
+ + "if (processingLocation != null) { requestOptions.addQueryParam(\"processingLocation\", processingLocation.toString(), false); }"
+ + "requestOptions.addQueryParam(\"stringEncoding\", \"utf16\", false);"
+ + "AnalyzeRequest1 analyzeRequest1Obj = new AnalyzeRequest1(inputs).setModelDeployments(modelDeployments);"
+ + "BinaryData analyzeRequest1 = BinaryData.fromObject(analyzeRequest1Obj);"
+ + "return serviceClient.beginAnalyzeWithModelAsync(analyzerId, analyzeRequest1, requestOptions)"
+ + ".setPollInterval(Duration.ofSeconds(3)); }"));
+ });
+ });
+ }
+
+ /**
+ * Add typed getValue() override to each ContentField subclass and hide the verbose getters
+ * (e.g., getValueString, getValueNumber) by removing their PUBLIC modifier.
+ *
+ * Each subclass's getValue() returns the covariant return type (e.g., String for ContentStringField)
+ * and delegates to the now-package-private verbose getter.
+ */
+ private void customizeFieldValueAccessors(LibraryCustomization customization, Logger logger) {
+ logger.info("Adding typed getValue() to ContentField subclasses and hiding verbose getters");
+
+ // ContentStringField: getValue() -> String, hide getValueString()
+ addTypedGetValueAndHideVerbose(customization, "ContentStringField", "String", "getValueString",
+ "getValueString()", logger);
+
+ // ContentNumberField: getValue() -> Double, hide getValueNumber()
+ addTypedGetValueAndHideVerbose(customization, "ContentNumberField", "Double", "getValueNumber",
+ "getValueNumber()", logger);
+
+ // ContentIntegerField: getValue() -> Long, hide getValueInteger()
+ addTypedGetValueAndHideVerbose(customization, "ContentIntegerField", "Long", "getValueInteger",
+ "getValueInteger()", logger);
+
+ // ContentDateField: getValue() -> LocalDate, hide getValueDate()
+ addTypedGetValueAndHideVerbose(customization, "ContentDateField", "LocalDate", "getValueDate",
+ "getValueDate()", logger);
+
+ // ContentTimeField: getValue() -> String, hide getValueTime()
+ addTypedGetValueAndHideVerbose(customization, "ContentTimeField", "String", "getValueTime",
+ "getValueTime()", logger);
+
+ // ContentBooleanField: getValue() -> Boolean, hide isValueBoolean()
+ addTypedGetValueAndHideVerbose(customization, "ContentBooleanField", "Boolean", "isValueBoolean",
+ "isValueBoolean()", logger);
+
+ // ContentObjectField: getValue() -> Map, hide getValueObject()
+ addTypedGetValueAndHideVerbose(customization, "ContentObjectField", "Map", "getValueObject",
+ "getValueObject()", logger);
+
+ // ContentArrayField: getValue() -> List, hide getValueArray()
+ addTypedGetValueAndHideVerbose(customization, "ContentArrayField", "List", "getValueArray",
+ "getValueArray()", logger);
+
+ // ContentJsonField: getValue() -> BinaryData, hide getValueJson()
+ addTypedGetValueAndHideVerbose(customization, "ContentJsonField", "BinaryData", "getValueJson",
+ "getValueJson()", logger);
+ }
+
+ /**
+ * Helper: adds a typed getValue() override to a ContentField subclass and hides the verbose getter.
+ */
+ private void addTypedGetValueAndHideVerbose(LibraryCustomization customization, String className,
+ String returnType, String verboseMethodName, String delegateCall, Logger logger) {
+ customization.getClass(MODELS_PACKAGE, className).customizeAst(ast ->
+ ast.getClassByName(className).ifPresent(clazz -> {
+ // Hide the verbose getter by removing PUBLIC modifier
+ clazz.getMethodsByName(verboseMethodName).forEach(method ->
+ method.removeModifier(Modifier.Keyword.PUBLIC));
+
+ // Add typed getValue() override
+ clazz.addMethod("getValue", Modifier.Keyword.PUBLIC)
+ .setType(returnType)
+ .addMarkerAnnotation(Override.class)
+ .setJavadocComment(new Javadoc(JavadocDescription.parseText(
+ "Gets the strongly-typed value of this field."))
+ .addBlockTag("return", "the field value, or null if not available."))
+ .setBody(StaticJavaParser.parseBlock("{ return " + delegateCall + "; }"));
+ }));
+ }
+
+ // =================== Duration property customizations ===================
+
+ /**
+ * Add Duration-returning getters to time-based models and hide the raw *Ms() getters
+ * (make them package-private) so the public API exposes Duration instead of raw milliseconds.
+ *
+ * Models and properties affected:
+ *
+ * - AudioVisualContent: startTimeMs, endTimeMs, cameraShotTimesMs (list), keyFrameTimesMs (list)
+ * - AudioVisualContentSegment: startTimeMs, endTimeMs
+ * - TranscriptPhrase: startTimeMs, endTimeMs
+ * - TranscriptWord: startTimeMs, endTimeMs
+ *
+ */
+ private void customizeDurationProperties(LibraryCustomization customization, Logger logger) {
+ logger.info("Adding Duration getters and hiding *Ms() getters on time-based models");
+
+ // AudioVisualContent: scalar + list properties
+ customization.getClass(MODELS_PACKAGE, "AudioVisualContent").customizeAst(ast -> {
+ ast.addImport("java.time.Duration");
+ ast.addImport("java.util.stream.Collectors");
+ ast.getClassByName("AudioVisualContent").ifPresent(clazz -> {
+ hideMsGetterAndAddDuration(clazz, "getStartTimeMs", "getStartTime", "startTimeMs", false);
+ hideMsGetterAndAddDuration(clazz, "getEndTimeMs", "getEndTime", "endTimeMs", false);
+ hideMsGetterAndAddDuration(clazz, "getCameraShotTimesMs", "getCameraShotTimes",
+ "cameraShotTimesMs", true);
+ hideMsGetterAndAddDuration(clazz, "getKeyFrameTimesMs", "getKeyFrameTimes",
+ "keyFrameTimesMs", true);
+ });
+ });
+
+ // AudioVisualContentSegment: scalar properties
+ customization.getClass(MODELS_PACKAGE, "AudioVisualContentSegment").customizeAst(ast -> {
+ ast.addImport("java.time.Duration");
+ ast.getClassByName("AudioVisualContentSegment").ifPresent(clazz -> {
+ hideMsGetterAndAddDuration(clazz, "getStartTimeMs", "getStartTime", "startTimeMs", false);
+ hideMsGetterAndAddDuration(clazz, "getEndTimeMs", "getEndTime", "endTimeMs", false);
+ });
+ });
+
+ // TranscriptPhrase: scalar properties
+ customization.getClass(MODELS_PACKAGE, "TranscriptPhrase").customizeAst(ast -> {
+ ast.addImport("java.time.Duration");
+ ast.getClassByName("TranscriptPhrase").ifPresent(clazz -> {
+ hideMsGetterAndAddDuration(clazz, "getStartTimeMs", "getStartTime", "startTimeMs", false);
+ hideMsGetterAndAddDuration(clazz, "getEndTimeMs", "getEndTime", "endTimeMs", false);
+ });
+ });
+
+ // TranscriptWord: scalar properties
+ customization.getClass(MODELS_PACKAGE, "TranscriptWord").customizeAst(ast -> {
+ ast.addImport("java.time.Duration");
+ ast.getClassByName("TranscriptWord").ifPresent(clazz -> {
+ hideMsGetterAndAddDuration(clazz, "getStartTimeMs", "getStartTime", "startTimeMs", false);
+ hideMsGetterAndAddDuration(clazz, "getEndTimeMs", "getEndTime", "endTimeMs", false);
+ });
+ });
+ }
+
+ /**
+ * Helper: hides a generated *Ms() getter (removes PUBLIC modifier) and adds a Duration-returning getter.
+ *
+ * @param clazz the class declaration to modify
+ * @param msMethodName the generated getter name (e.g., "getStartTimeMs")
+ * @param durationMethodName the new Duration getter name (e.g., "getStartTime")
+ * @param fieldName the backing field name (e.g., "startTimeMs")
+ * @param isList true if the property is List<Long> (returns List<Duration>)
+ */
+ private void hideMsGetterAndAddDuration(ClassOrInterfaceDeclaration clazz, String msMethodName,
+ String durationMethodName, String fieldName, boolean isList) {
+ // Hide the *Ms() getter by removing PUBLIC modifier
+ clazz.getMethodsByName(msMethodName).forEach(method ->
+ method.removeModifier(Modifier.Keyword.PUBLIC));
+
+ if (isList) {
+ // List -> List
+ clazz.addMethod(durationMethodName, Modifier.Keyword.PUBLIC)
+ .setType("List")
+ .setJavadocComment(new Javadoc(JavadocDescription.parseText(
+ "Gets the " + fieldName.replace("Ms", "") + " as a list of Duration values."))
+ .addBlockTag("return", "the durations, or null if not available."))
+ .setBody(StaticJavaParser.parseBlock(
+ "{ if (this." + fieldName + " == null) { return null; } "
+ + "return this." + fieldName + ".stream()"
+ + ".map(Duration::ofMillis)"
+ + ".collect(Collectors.toList()); }"));
+ } else {
+ // long -> Duration
+ clazz.addMethod(durationMethodName, Modifier.Keyword.PUBLIC)
+ .setType("Duration")
+ .setJavadocComment(new Javadoc(JavadocDescription.parseText(
+ "Gets the " + fieldName.replace("Ms", "") + " as a Duration."))
+ .addBlockTag("return", "the duration."))
+ .setBody(StaticJavaParser.parseBlock(
+ "{ return Duration.ofMillis(this." + fieldName + "); }"));
+ }
+ }
+
+ // =================== ContentSource class hierarchy ===================
+
+ private static final String SRC_MODELS = "src/main/java/com/azure/ai/contentunderstanding/models/";
+
+ /**
+ * Add ContentSource, DocumentSource, AudioVisualSource, and geometry types
+ * (PointF, RectangleF, Rectangle) as custom files via the raw editor.
+ */
+ private void addContentSourceAndGeometryTypes(LibraryCustomization customization, Logger logger) {
+ logger.info("Adding ContentSource class hierarchy and geometry types");
+
+ customization.getRawEditor().addFile(SRC_MODELS + "PointF.java", POINT_F_CONTENT);
+ customization.getRawEditor().addFile(SRC_MODELS + "RectangleF.java", RECTANGLE_F_CONTENT);
+ customization.getRawEditor().addFile(SRC_MODELS + "Rectangle.java", RECTANGLE_CONTENT);
+ customization.getRawEditor().addFile(SRC_MODELS + "ContentSource.java", CONTENT_SOURCE_CONTENT);
+ customization.getRawEditor().addFile(SRC_MODELS + "DocumentSource.java", DOCUMENT_SOURCE_CONTENT);
+ customization.getRawEditor().addFile(SRC_MODELS + "AudioVisualSource.java", AUDIO_VISUAL_SOURCE_CONTENT);
+ }
+
+ /**
+ * Hide getSource() and add getSources() method to ContentField via AST customization.
+ */
+ private void addSourcesMethod(LibraryCustomization customization, Logger logger) {
+ logger.info("Adding getSources() and hiding getSource() on ContentField");
+
+ customization.getClass(MODELS_PACKAGE, "ContentField").customizeAst(ast ->
+ ast.getClassByName("ContentField").ifPresent(clazz -> {
+ // Hide getSource() — users should use getSources() for typed access
+ clazz.getMethodsByName("getSource").forEach(m -> m.removeModifier(Modifier.Keyword.PUBLIC));
+ ast.addImport("java.util.List");
+ clazz.addMethod("getSources", Modifier.Keyword.PUBLIC)
+ .setType("List")
+ .setJavadocComment(new Javadoc(JavadocDescription.parseText(
+ "Parses the encoded source string into typed content sources.\n\n"
+ + "The returned list contains {@link DocumentSource} or {@link AudioVisualSource} "
+ + "instances depending on the wire format.\n"
+ + "Returns {@code null} if the source string is null or empty."))
+ .addBlockTag("return", "an unmodifiable list of {@link ContentSource} instances, or null if no source is available.")
+ .addBlockTag("see", "DocumentSource#parse(String)")
+ .addBlockTag("see", "AudioVisualSource#parse(String)"))
+ .setBody(StaticJavaParser.parseBlock("{"
+ + "String src = this.source;"
+ + "return (src == null || src.isEmpty()) ? null : ContentSource.parseAll(src); }"));
+ }));
+ }
+
+ // =================== ContentSource file contents ===================
+ // These string constants are emitted as-is to src/main/java/.../models/ via addFile().
+ // For easier reading, review the generated output files directly:
+ // - models/PointF.java
+ // - models/RectangleF.java
+ // - models/Rectangle.java
+ // - models/ContentSource.java
+ // - models/DocumentSource.java
+ // - models/AudioVisualSource.java
+
+ private static final String POINT_F_CONTENT =
+ "// Copyright (c) Microsoft Corporation. All rights reserved.\n"
+ + "// Licensed under the MIT License.\n\n"
+ + "package com.azure.ai.contentunderstanding.models;\n\n"
+ + "import com.azure.core.annotation.Immutable;\n\n"
+ + "import java.util.Objects;\n\n"
+ + "/**\n"
+ + " * Represents a point with float-precision x and y coordinates.\n"
+ + " * Used by {@link DocumentSource} to define polygon vertices in document coordinate space.\n"
+ + " */\n"
+ + "@Immutable\n"
+ + "public final class PointF {\n"
+ + " private final float x;\n"
+ + " private final float y;\n\n"
+ + " /**\n"
+ + " * Creates a new {@link PointF}.\n"
+ + " *\n"
+ + " * @param x The x-coordinate.\n"
+ + " * @param y The y-coordinate.\n"
+ + " */\n"
+ + " public PointF(float x, float y) {\n"
+ + " this.x = x;\n"
+ + " this.y = y;\n"
+ + " }\n\n"
+ + " /**\n"
+ + " * Gets the x-coordinate.\n"
+ + " *\n"
+ + " * @return The x-coordinate.\n"
+ + " */\n"
+ + " public float getX() {\n"
+ + " return x;\n"
+ + " }\n\n"
+ + " /**\n"
+ + " * Gets the y-coordinate.\n"
+ + " *\n"
+ + " * @return The y-coordinate.\n"
+ + " */\n"
+ + " public float getY() {\n"
+ + " return y;\n"
+ + " }\n\n"
+ + " @Override\n"
+ + " public String toString() {\n"
+ + " return \"(\" + x + \", \" + y + \")\";\n"
+ + " }\n\n"
+ + " @Override\n"
+ + " public boolean equals(Object obj) {\n"
+ + " if (this == obj) {\n"
+ + " return true;\n"
+ + " }\n"
+ + " if (!(obj instanceof PointF)) {\n"
+ + " return false;\n"
+ + " }\n"
+ + " PointF other = (PointF) obj;\n"
+ + " return Float.compare(x, other.x) == 0 && Float.compare(y, other.y) == 0;\n"
+ + " }\n\n"
+ + " @Override\n"
+ + " public int hashCode() {\n"
+ + " return Objects.hash(x, y);\n"
+ + " }\n"
+ + "}\n";
+
+ private static final String RECTANGLE_F_CONTENT =
+ "// Copyright (c) Microsoft Corporation. All rights reserved.\n"
+ + "// Licensed under the MIT License.\n\n"
+ + "package com.azure.ai.contentunderstanding.models;\n\n"
+ + "import com.azure.core.annotation.Immutable;\n\n"
+ + "import java.util.Objects;\n\n"
+ + "/**\n"
+ + " * Represents an axis-aligned rectangle with float-precision coordinates.\n"
+ + " * Used by {@link DocumentSource} as the bounding box computed from polygon coordinates.\n"
+ + " */\n"
+ + "@Immutable\n"
+ + "public final class RectangleF {\n"
+ + " private final float x;\n"
+ + " private final float y;\n"
+ + " private final float width;\n"
+ + " private final float height;\n\n"
+ + " /**\n"
+ + " * Creates a new {@link RectangleF}.\n"
+ + " *\n"
+ + " * @param x The x-coordinate of the top-left corner.\n"
+ + " * @param y The y-coordinate of the top-left corner.\n"
+ + " * @param width The width of the rectangle.\n"
+ + " * @param height The height of the rectangle.\n"
+ + " */\n"
+ + " public RectangleF(float x, float y, float width, float height) {\n"
+ + " this.x = x;\n"
+ + " this.y = y;\n"
+ + " this.width = width;\n"
+ + " this.height = height;\n"
+ + " }\n\n"
+ + " /**\n"
+ + " * Gets the x-coordinate of the top-left corner.\n"
+ + " *\n"
+ + " * @return The x-coordinate.\n"
+ + " */\n"
+ + " public float getX() {\n"
+ + " return x;\n"
+ + " }\n\n"
+ + " /**\n"
+ + " * Gets the y-coordinate of the top-left corner.\n"
+ + " *\n"
+ + " * @return The y-coordinate.\n"
+ + " */\n"
+ + " public float getY() {\n"
+ + " return y;\n"
+ + " }\n\n"
+ + " /**\n"
+ + " * Gets the width of the rectangle.\n"
+ + " *\n"
+ + " * @return The width.\n"
+ + " */\n"
+ + " public float getWidth() {\n"
+ + " return width;\n"
+ + " }\n\n"
+ + " /**\n"
+ + " * Gets the height of the rectangle.\n"
+ + " *\n"
+ + " * @return The height.\n"
+ + " */\n"
+ + " public float getHeight() {\n"
+ + " return height;\n"
+ + " }\n\n"
+ + " @Override\n"
+ + " public String toString() {\n"
+ + " return \"[x=\" + x + \", y=\" + y + \", width=\" + width + \", height=\" + height + \"]\";\n"
+ + " }\n\n"
+ + " @Override\n"
+ + " public boolean equals(Object obj) {\n"
+ + " if (this == obj) {\n"
+ + " return true;\n"
+ + " }\n"
+ + " if (!(obj instanceof RectangleF)) {\n"
+ + " return false;\n"
+ + " }\n"
+ + " RectangleF other = (RectangleF) obj;\n"
+ + " return Float.compare(x, other.x) == 0\n"
+ + " && Float.compare(y, other.y) == 0\n"
+ + " && Float.compare(width, other.width) == 0\n"
+ + " && Float.compare(height, other.height) == 0;\n"
+ + " }\n\n"
+ + " @Override\n"
+ + " public int hashCode() {\n"
+ + " return Objects.hash(x, y, width, height);\n"
+ + " }\n"
+ + "}\n";
+
+ private static final String RECTANGLE_CONTENT =
+ "// Copyright (c) Microsoft Corporation. All rights reserved.\n"
+ + "// Licensed under the MIT License.\n\n"
+ + "package com.azure.ai.contentunderstanding.models;\n\n"
+ + "import com.azure.core.annotation.Immutable;\n\n"
+ + "import java.util.Objects;\n\n"
+ + "/**\n"
+ + " * Represents an axis-aligned rectangle with integer coordinates.\n"
+ + " * Used by {@link AudioVisualSource} as the bounding box for spatial information (e.g., face detection).\n"
+ + " */\n"
+ + "@Immutable\n"
+ + "public final class Rectangle {\n"
+ + " private final int x;\n"
+ + " private final int y;\n"
+ + " private final int width;\n"
+ + " private final int height;\n\n"
+ + " /**\n"
+ + " * Creates a new {@link Rectangle}.\n"
+ + " *\n"
+ + " * @param x The x-coordinate of the top-left corner.\n"
+ + " * @param y The y-coordinate of the top-left corner.\n"
+ + " * @param width The width of the rectangle.\n"
+ + " * @param height The height of the rectangle.\n"
+ + " */\n"
+ + " public Rectangle(int x, int y, int width, int height) {\n"
+ + " this.x = x;\n"
+ + " this.y = y;\n"
+ + " this.width = width;\n"
+ + " this.height = height;\n"
+ + " }\n\n"
+ + " /**\n"
+ + " * Gets the x-coordinate of the top-left corner.\n"
+ + " *\n"
+ + " * @return The x-coordinate.\n"
+ + " */\n"
+ + " public int getX() {\n"
+ + " return x;\n"
+ + " }\n\n"
+ + " /**\n"
+ + " * Gets the y-coordinate of the top-left corner.\n"
+ + " *\n"
+ + " * @return The y-coordinate.\n"
+ + " */\n"
+ + " public int getY() {\n"
+ + " return y;\n"
+ + " }\n\n"
+ + " /**\n"
+ + " * Gets the width of the rectangle.\n"
+ + " *\n"
+ + " * @return The width.\n"
+ + " */\n"
+ + " public int getWidth() {\n"
+ + " return width;\n"
+ + " }\n\n"
+ + " /**\n"
+ + " * Gets the height of the rectangle.\n"
+ + " *\n"
+ + " * @return The height.\n"
+ + " */\n"
+ + " public int getHeight() {\n"
+ + " return height;\n"
+ + " }\n\n"
+ + " @Override\n"
+ + " public String toString() {\n"
+ + " return \"[x=\" + x + \", y=\" + y + \", width=\" + width + \", height=\" + height + \"]\";\n"
+ + " }\n\n"
+ + " @Override\n"
+ + " public boolean equals(Object obj) {\n"
+ + " if (this == obj) {\n"
+ + " return true;\n"
+ + " }\n"
+ + " if (!(obj instanceof Rectangle)) {\n"
+ + " return false;\n"
+ + " }\n"
+ + " Rectangle other = (Rectangle) obj;\n"
+ + " return x == other.x && y == other.y && width == other.width && height == other.height;\n"
+ + " }\n\n"
+ + " @Override\n"
+ + " public int hashCode() {\n"
+ + " return Objects.hash(x, y, width, height);\n"
+ + " }\n"
+ + "}\n";
+
+ private static final String CONTENT_SOURCE_CONTENT =
+ "// Copyright (c) Microsoft Corporation. All rights reserved.\n"
+ + "// Licensed under the MIT License.\n\n"
+ + "package com.azure.ai.contentunderstanding.models;\n\n"
+ + "import com.azure.core.annotation.Immutable;\n"
+ + "import com.azure.core.util.logging.ClientLogger;\n"
+ + "import java.util.ArrayList;\n"
+ + "import java.util.Collections;\n"
+ + "import java.util.List;\n"
+ + "import java.util.Objects;\n\n"
+ + "/**\n"
+ + " * Abstract base class for parsed grounding sources returned by Content Understanding.\n"
+ + " *\n"
+ + " * The service encodes source positions as compact strings in the {@link ContentField#getSources()} property.\n"
+ + " * This class hierarchy parses those strings into strongly-typed objects:
\n"
+ + " * \n"
+ + " * - {@link DocumentSource} — {@code D(page,x1,y1,x2,y2,x3,y3,x4,y4)}
\n"
+ + " * - {@link AudioVisualSource} — {@code AV(time[,x,y,w,h])}
\n"
+ + " *
\n"
+ + " *\n"
+ + " * Use {@link DocumentSource#parse(String)} or {@link AudioVisualSource#parse(String)} to parse\n"
+ + " * a semicolon-delimited string containing one or more segments.
\n"
+ + " *\n"
+ + " * @see ContentField#getSources()\n"
+ + " */\n"
+ + "@Immutable\n"
+ + "public abstract class ContentSource {\n"
+ + " private static final ClientLogger LOGGER = new ClientLogger(ContentSource.class);\n\n"
+ + " private final String rawValue;\n\n"
+ + " /**\n"
+ + " * Initializes a new instance of {@link ContentSource}.\n"
+ + " *\n"
+ + " * @param rawValue The raw wire-format source string.\n"
+ + " */\n"
+ + " protected ContentSource(String rawValue) {\n"
+ + " this.rawValue = Objects.requireNonNull(rawValue, \"'rawValue' cannot be null.\");\n"
+ + " }\n\n"
+ + " /**\n"
+ + " * Gets the original wire-format source string.\n"
+ + " *\n"
+ + " * @return The raw source string.\n"
+ + " */\n"
+ + " public String getRawValue() {\n"
+ + " return rawValue;\n"
+ + " }\n\n"
+ + " /**\n"
+ + " * Parses a single source segment, automatically detecting the source type.\n"
+ + " *\n"
+ + " * @param source The source string to parse.\n"
+ + " * @return A {@link ContentSource} subclass instance.\n"
+ + " * @throws NullPointerException if {@code source} is null.\n"
+ + " * @throws IllegalArgumentException if {@code source} is empty or has an unrecognized format.\n"
+ + " */\n"
+ + " static ContentSource parseSingle(String source) {\n"
+ + " Objects.requireNonNull(source, \"'source' cannot be null.\");\n"
+ + " if (source.isEmpty()) {\n"
+ + " throw LOGGER.logExceptionAsError(new IllegalArgumentException(\"'source' cannot be empty.\"));\n"
+ + " }\n"
+ + " if (source.startsWith(\"D(\")) {\n"
+ + " return DocumentSource.parseSingle(source);\n"
+ + " }\n"
+ + " if (source.startsWith(\"AV(\")) {\n"
+ + " return AudioVisualSource.parseSingle(source);\n"
+ + " }\n"
+ + " throw LOGGER.logExceptionAsError(new IllegalArgumentException(\"Unrecognized source format: '\" + source + \"'.\"));\n"
+ + " }\n\n"
+ + " /**\n"
+ + " * Parses a semicolon-delimited string containing one or more source segments.\n"
+ + " *\n"
+ + " * Each segment is parsed individually, detecting the source type automatically.
\n"
+ + " *\n"
+ + " * @param source The source string (may contain {@code ;} delimiters).\n"
+ + " * @return An unmodifiable list of {@link ContentSource} instances.\n"
+ + " * @throws NullPointerException if {@code source} is null.\n"
+ + " * @throws IllegalArgumentException if {@code source} is empty or any segment has an unrecognized format.\n"
+ + " */\n"
+ + " public static List parseAll(String source) {\n"
+ + " Objects.requireNonNull(source, \"'source' cannot be null.\");\n"
+ + " if (source.isEmpty()) {\n"
+ + " throw LOGGER.logExceptionAsError(new IllegalArgumentException(\"'source' cannot be empty.\"));\n"
+ + " }\n"
+ + " String[] segments = source.split(\";\");\n"
+ + " List results = new ArrayList<>(segments.length);\n"
+ + " for (String segment : segments) {\n"
+ + " String trimmed = segment.trim();\n"
+ + " if (!trimmed.isEmpty()) {\n"
+ + " results.add(parseSingle(trimmed));\n"
+ + " }\n"
+ + " }\n"
+ + " return Collections.unmodifiableList(results);\n"
+ + " }\n\n"
+ + " /**\n"
+ + " * Reconstructs the wire-format source string by joining each element's\n"
+ + " * {@link #getRawValue()} with semicolons.\n"
+ + " *\n"
+ + " * @param sources The content source list.\n"
+ + " * @return A semicolon-delimited string of raw source values.\n"
+ + " * @throws NullPointerException if {@code sources} is null.\n"
+ + " */\n"
+ + " public static String toRawString(List extends ContentSource> sources) {\n"
+ + " Objects.requireNonNull(sources, \"'sources' cannot be null.\");\n"
+ + " StringBuilder sb = new StringBuilder();\n"
+ + " for (int i = 0; i < sources.size(); i++) {\n"
+ + " if (i > 0) {\n"
+ + " sb.append(';');\n"
+ + " }\n"
+ + " sb.append(sources.get(i).getRawValue());\n"
+ + " }\n"
+ + " return sb.toString();\n"
+ + " }\n\n"
+ + " /**\n"
+ + " * Returns the wire-format string representation of this source.\n"
+ + " *\n"
+ + " * @return The raw source string.\n"
+ + " */\n"
+ + " @Override\n"
+ + " public String toString() {\n"
+ + " return rawValue;\n"
+ + " }\n\n"
+ + " @Override\n"
+ + " public boolean equals(Object obj) {\n"
+ + " if (this == obj) {\n"
+ + " return true;\n"
+ + " }\n"
+ + " if (!(obj instanceof ContentSource)) {\n"
+ + " return false;\n"
+ + " }\n"
+ + " ContentSource other = (ContentSource) obj;\n"
+ + " return Objects.equals(rawValue, other.rawValue);\n"
+ + " }\n\n"
+ + " @Override\n"
+ + " public int hashCode() {\n"
+ + " return Objects.hashCode(rawValue);\n"
+ + " }\n"
+ + "}\n";
+
+ private static final String DOCUMENT_SOURCE_CONTENT =
+ "// Copyright (c) Microsoft Corporation. All rights reserved.\n"
+ + "// Licensed under the MIT License.\n\n"
+ + "package com.azure.ai.contentunderstanding.models;\n\n"
+ + "import com.azure.core.annotation.Immutable;\n"
+ + "import com.azure.core.util.logging.ClientLogger;\n\n"
+ + "import java.util.ArrayList;\n"
+ + "import java.util.Collections;\n"
+ + "import java.util.List;\n"
+ + "import java.util.Objects;\n\n"
+ + "/**\n"
+ + " * Represents a parsed document grounding source in the format {@code D(page,x1,y1,x2,y2,x3,y3,x4,y4)}.\n"
+ + " *\n"
+ + " * The page number is 1-based. The polygon is a quadrilateral defined by four points\n"
+ + " * with coordinates in the document's coordinate space.
\n"
+ + " *\n"
+ + " * @see ContentSource\n"
+ + " */\n"
+ + "@Immutable\n"
+ + "public final class DocumentSource extends ContentSource {\n"
+ + " private static final ClientLogger LOGGER = new ClientLogger(DocumentSource.class);\n"
+ + " private static final String PREFIX = \"D(\";\n"
+ + " private static final int EXPECTED_PARAM_COUNT = 9;\n\n"
+ + " private final int pageNumber;\n"
+ + " private final List polygon;\n"
+ + " private final RectangleF boundingBox;\n\n"
+ + " private DocumentSource(String source) {\n"
+ + " super(source);\n"
+ + " if (!source.startsWith(PREFIX) || !source.endsWith(\")\")) {\n"
+ + " throw LOGGER.logExceptionAsError(\n"
+ + " new IllegalArgumentException(\"Document source must start with '\" + PREFIX + \"' and end with ')': '\" + source + \"'.\"));\n"
+ + " }\n"
+ + " String inner = source.substring(PREFIX.length(), source.length() - 1);\n"
+ + " String[] parts = inner.split(\",\");\n"
+ + " if (parts.length != EXPECTED_PARAM_COUNT) {\n"
+ + " throw LOGGER.logExceptionAsError(\n"
+ + " new IllegalArgumentException(\"Document source expected \" + EXPECTED_PARAM_COUNT\n"
+ + " + \" parameters (page + 8 coordinates), got \" + parts.length + \": '\" + source + \"'.\"));\n"
+ + " }\n"
+ + " try {\n"
+ + " this.pageNumber = Integer.parseInt(parts[0].trim());\n"
+ + " } catch (NumberFormatException e) {\n"
+ + " throw LOGGER.logExceptionAsError(\n"
+ + " new IllegalArgumentException(\"Invalid page number in document source: '\" + parts[0] + \"'.\", e));\n"
+ + " }\n"
+ + " if (this.pageNumber < 1) {\n"
+ + " throw LOGGER.logExceptionAsError(\n"
+ + " new IllegalArgumentException(\"Page number must be >= 1, got \" + this.pageNumber + \".\"));\n"
+ + " }\n"
+ + " List points = new ArrayList<>(4);\n"
+ + " float minX = Float.MAX_VALUE, minY = Float.MAX_VALUE;\n"
+ + " float maxX = -Float.MAX_VALUE, maxY = -Float.MAX_VALUE;\n"
+ + " for (int i = 0; i < 4; i++) {\n"
+ + " int xIndex = 1 + (i * 2);\n"
+ + " int yIndex = 2 + (i * 2);\n"
+ + " float x, y;\n"
+ + " try {\n"
+ + " x = Float.parseFloat(parts[xIndex].trim());\n"
+ + " } catch (NumberFormatException e) {\n"
+ + " throw LOGGER.logExceptionAsError(\n"
+ + " new IllegalArgumentException(\"Invalid x-coordinate at index \" + xIndex + \": '\" + parts[xIndex] + \"'.\", e));\n"
+ + " }\n"
+ + " try {\n"
+ + " y = Float.parseFloat(parts[yIndex].trim());\n"
+ + " } catch (NumberFormatException e) {\n"
+ + " throw LOGGER.logExceptionAsError(\n"
+ + " new IllegalArgumentException(\"Invalid y-coordinate at index \" + yIndex + \": '\" + parts[yIndex] + \"'.\", e));\n"
+ + " }\n"
+ + " points.add(new PointF(x, y));\n"
+ + " minX = Math.min(minX, x);\n"
+ + " minY = Math.min(minY, y);\n"
+ + " maxX = Math.max(maxX, x);\n"
+ + " maxY = Math.max(maxY, y);\n"
+ + " }\n"
+ + " this.polygon = Collections.unmodifiableList(points);\n"
+ + " this.boundingBox = new RectangleF(minX, minY, maxX - minX, maxY - minY);\n"
+ + " }\n\n"
+ + " /**\n"
+ + " * Gets the 1-based page number.\n"
+ + " *\n"
+ + " * @return The page number.\n"
+ + " */\n"
+ + " public int getPageNumber() {\n"
+ + " return pageNumber;\n"
+ + " }\n\n"
+ + " /**\n"
+ + " * Gets the polygon coordinates as four points defining a quadrilateral region.\n"
+ + " *\n"
+ + " * @return An unmodifiable list of four {@link PointF} values.\n"
+ + " */\n"
+ + " public List getPolygon() {\n"
+ + " return polygon;\n"
+ + " }\n\n"
+ + " /**\n"
+ + " * Gets the axis-aligned bounding rectangle computed from the polygon coordinates.\n"
+ + " * Useful for drawing highlight rectangles over extracted fields.\n"
+ + " *\n"
+ + " * @return The bounding box.\n"
+ + " */\n"
+ + " public RectangleF getBoundingBox() {\n"
+ + " return boundingBox;\n"
+ + " }\n\n"
+ + " /**\n"
+ + " * Parses a single document source segment.\n"
+ + " *\n"
+ + " * @param source The source string in the format {@code D(page,x1,y1,...,x4,y4)}.\n"
+ + " * @return A new {@link DocumentSource}.\n"
+ + " * @throws NullPointerException if {@code source} is null.\n"
+ + " * @throws IllegalArgumentException if the source string is not in the expected format.\n"
+ + " */\n"
+ + " static DocumentSource parseSingle(String source) {\n"
+ + " Objects.requireNonNull(source, \"'source' cannot be null.\");\n"
+ + " if (source.isEmpty()) {\n"
+ + " throw LOGGER.logExceptionAsError(new IllegalArgumentException(\"'source' cannot be empty.\"));\n"
+ + " }\n"
+ + " return new DocumentSource(source);\n"
+ + " }\n\n"
+ + " /**\n"
+ + " * Parses a source string containing one or more document source segments separated by {@code ;}.\n"
+ + " *\n"
+ + " * @param source The source string (may contain {@code ;} delimiters).\n"
+ + " * @return An unmodifiable list of {@link DocumentSource} instances.\n"
+ + " * @throws NullPointerException if {@code source} is null.\n"
+ + " * @throws IllegalArgumentException if any segment is not in the expected format.\n"
+ + " */\n"
+ + " public static List parse(String source) {\n"
+ + " Objects.requireNonNull(source, \"'source' cannot be null.\");\n"
+ + " if (source.isEmpty()) {\n"
+ + " throw LOGGER.logExceptionAsError(new IllegalArgumentException(\"'source' cannot be empty.\"));\n"
+ + " }\n"
+ + " String[] segments = source.split(\";\");\n"
+ + " List results = new ArrayList<>(segments.length);\n"
+ + " for (String segment : segments) {\n"
+ + " String trimmed = segment.trim();\n"
+ + " if (!trimmed.isEmpty()) {\n"
+ + " results.add(new DocumentSource(trimmed));\n"
+ + " }\n"
+ + " }\n"
+ + " return Collections.unmodifiableList(results);\n"
+ + " }\n"
+ + "}\n";
+
+ private static final String AUDIO_VISUAL_SOURCE_CONTENT =
+ "// Copyright (c) Microsoft Corporation. All rights reserved.\n"
+ + "// Licensed under the MIT License.\n\n"
+ + "package com.azure.ai.contentunderstanding.models;\n\n"
+ + "import com.azure.core.annotation.Immutable;\n"
+ + "import com.azure.core.util.logging.ClientLogger;\n"
+ + "import java.time.Duration;\n"
+ + "import java.util.ArrayList;\n"
+ + "import java.util.Collections;\n"
+ + "import java.util.List;\n"
+ + "import java.util.Objects;\n\n"
+ + "/**\n"
+ + " * Represents a parsed audio/visual grounding source in the format {@code AV(time[,x,y,w,h])}.\n"
+ + " *\n"
+ + " * The time is in milliseconds. The bounding box (x, y, width, height) is optional and\n"
+ + " * present only when spatial information is available (e.g., face detection).
\n"
+ + " *\n"
+ + " * @see ContentSource\n"
+ + " */\n"
+ + "@Immutable\n"
+ + "public final class AudioVisualSource extends ContentSource {\n"
+ + " private static final ClientLogger LOGGER = new ClientLogger(AudioVisualSource.class);\n"
+ + " private static final String PREFIX = \"AV(\";\n\n"
+ + " private final int timeMs;\n"
+ + " private final Rectangle boundingBox;\n\n"
+ + " AudioVisualSource(String source) {\n"
+ + " super(source);\n"
+ + " if (!source.startsWith(PREFIX) || !source.endsWith(\")\")) {\n"
+ + " throw LOGGER.logExceptionAsError(\n"
+ + " new IllegalArgumentException(\"Audio/visual source must start with '\" + PREFIX + \"' and end with ')': '\" + source + \"'.\"));\n"
+ + " }\n"
+ + " String inner = source.substring(PREFIX.length(), source.length() - 1);\n"
+ + " String[] parts = inner.split(\",\");\n"
+ + " if (parts.length != 1 && parts.length != 5) {\n"
+ + " throw LOGGER.logExceptionAsError(\n"
+ + " new IllegalArgumentException(\"Audio/visual source expected 1 or 5 parameters, got \" + parts.length + \": '\" + source + \"'.\"));\n"
+ + " }\n"
+ + " try {\n"
+ + " this.timeMs = Integer.parseInt(parts[0].trim());\n"
+ + " } catch (NumberFormatException e) {\n"
+ + " throw LOGGER.logExceptionAsError(\n"
+ + " new IllegalArgumentException(\"Invalid time value in audio/visual source: '\" + parts[0] + \"'.\", e));\n"
+ + " }\n"
+ + " if (parts.length == 5) {\n"
+ + " int xVal, yVal, wVal, hVal;\n"
+ + " try { xVal = Integer.parseInt(parts[1].trim()); }\n"
+ + " catch (NumberFormatException e) { throw LOGGER.logExceptionAsError(new IllegalArgumentException(\"Invalid x value: '\" + parts[1] + \"'.\", e)); }\n"
+ + " try { yVal = Integer.parseInt(parts[2].trim()); }\n"
+ + " catch (NumberFormatException e) { throw LOGGER.logExceptionAsError(new IllegalArgumentException(\"Invalid y value: '\" + parts[2] + \"'.\", e)); }\n"
+ + " try { wVal = Integer.parseInt(parts[3].trim()); }\n"
+ + " catch (NumberFormatException e) { throw LOGGER.logExceptionAsError(new IllegalArgumentException(\"Invalid width value: '\" + parts[3] + \"'.\", e)); }\n"
+ + " try { hVal = Integer.parseInt(parts[4].trim()); }\n"
+ + " catch (NumberFormatException e) { throw LOGGER.logExceptionAsError(new IllegalArgumentException(\"Invalid height value: '\" + parts[4] + \"'.\", e)); }\n"
+ + " this.boundingBox = new Rectangle(xVal, yVal, wVal, hVal);\n"
+ + " } else {\n"
+ + " this.boundingBox = null;\n"
+ + " }\n"
+ + " }\n\n"
+ + " /**\n"
+ + " * Gets the time as a Duration.\n"
+ + " *\n"
+ + " * @return The time as a Duration.\n"
+ + " */\n"
+ + " public Duration getTime() {\n"
+ + " return Duration.ofMillis(timeMs);\n"
+ + " }\n\n"
+ + " /**\n"
+ + " * Gets the bounding box in pixel coordinates, or {@code null} if no spatial information\n"
+ + " * is available (e.g., audio-only).\n"
+ + " *\n"
+ + " * @return The bounding box, or {@code null}.\n"
+ + " */\n"
+ + " public Rectangle getBoundingBox() {\n"
+ + " return boundingBox;\n"
+ + " }\n\n"
+ + " /**\n"
+ + " * Parses a single audio/visual source segment.\n"
+ + " *\n"
+ + " * @param source The source string in the format {@code AV(time[,x,y,w,h])}.\n"
+ + " * @return A new {@link AudioVisualSource}.\n"
+ + " * @throws NullPointerException if {@code source} is null.\n"
+ + " * @throws IllegalArgumentException if the source string is not in the expected format.\n"
+ + " */\n"
+ + " static AudioVisualSource parseSingle(String source) {\n"
+ + " Objects.requireNonNull(source, \"'source' cannot be null.\");\n"
+ + " if (source.isEmpty()) {\n"
+ + " throw LOGGER.logExceptionAsError(new IllegalArgumentException(\"'source' cannot be empty.\"));\n"
+ + " }\n"
+ + " return new AudioVisualSource(source);\n"
+ + " }\n\n"
+ + " /**\n"
+ + " * Parses a source string containing one or more audio/visual source segments separated by {@code ;}.\n"
+ + " *\n"
+ + " * @param source The source string (may contain {@code ;} delimiters).\n"
+ + " * @return An unmodifiable list of {@link AudioVisualSource} instances.\n"
+ + " * @throws NullPointerException if {@code source} is null.\n"
+ + " * @throws IllegalArgumentException if any segment is not in the expected format.\n"
+ + " */\n"
+ + " public static List parse(String source) {\n"
+ + " Objects.requireNonNull(source, \"'source' cannot be null.\");\n"
+ + " if (source.isEmpty()) {\n"
+ + " throw LOGGER.logExceptionAsError(new IllegalArgumentException(\"'source' cannot be empty.\"));\n"
+ + " }\n"
+ + " String[] segments = source.split(\";\");\n"
+ + " List results = new ArrayList<>(segments.length);\n"
+ + " for (String segment : segments) {\n"
+ + " String trimmed = segment.trim();\n"
+ + " if (!trimmed.isEmpty()) {\n"
+ + " results.add(new AudioVisualSource(trimmed));\n"
+ + " }\n"
+ + " }\n"
+ + " return Collections.unmodifiableList(results);\n"
+ + " }\n"
+ + "}\n";
+
+ /**
+ * Rename protocol method parameters that have emitter-generated numeric suffixes.
+ * The emitter appends "1" when a spread/wrapped body model name collides with the original TypeSpec model name,
+ * e.g., analyzeRequest1, grantCopyAuthorizationRequest1. This strips the suffix from public API parameters.
+ */
+ private void renameRequestParameters(LibraryCustomization customization, Logger logger) {
+ PackageCustomization pkg = customization.getPackage("com.azure.ai.contentunderstanding");
+ String[] clientClasses = { "ContentUnderstandingClient", "ContentUnderstandingAsyncClient" };
+
+ for (String className : clientClasses) {
+ ClassCustomization classCustomization = pkg.getClass(className);
+ classCustomization.customizeAst(compilationUnit -> {
+ compilationUnit.getClassByName(className).ifPresent(clazz -> {
+ for (MethodDeclaration method : clazz.getMethods()) {
+ for (Parameter param : method.getParameters()) {
+ String name = param.getNameAsString();
+ // Match parameters ending with a digit suffix (emitter disambiguation)
+ if (name.matches(".*Request\\d+$")) {
+ String newName = name.replaceAll("\\d+$", "");
+ // Rename parameter
+ param.setName(newName);
+ // Update all references in the method body
+ method.getBody().ifPresent(body -> {
+ String bodyStr = body.toString();
+ bodyStr = bodyStr.replace(name, newName);
+ method.setBody(StaticJavaParser.parseBlock(bodyStr));
+ });
+ // Update Javadoc @param tag
+ method.getJavadoc().ifPresent(javadoc -> {
+ String javadocStr = javadoc.toText();
+ if (javadocStr.contains("@param " + name)) {
+ javadocStr = javadocStr.replace(
+ "@param " + name + " The " + name + " parameter.",
+ "@param " + newName + " The " + newName + " parameter.");
+ method.setJavadocComment(javadocStr);
+ }
+ });
+ logger.info("Renamed parameter '{}' -> '{}' in {}.{}", name, newName,
+ className, method.getNameAsString());
+ }
+ }
+ }
+ });
+ });
+ }
+ }
+
+ /**
+ * Default the LRO polling interval to 3 seconds for all Content Understanding operations.
+ * The generated code uses Duration.ofSeconds(1) as the default polling interval for
+ * PollerFlux.create() and SyncPoller.createPoller() calls. Content Understanding operations
+ * typically take several seconds, so polling every 1 second is unnecessarily aggressive.
+ * This customization replaces Duration.ofSeconds(1) with Duration.ofSeconds(3) in
+ * ContentUnderstandingClientImpl to reduce unnecessary polling traffic.
+ */
+ private void customizePollingInterval(LibraryCustomization customization, Logger logger) {
+ logger.info("Customizing default LRO polling interval to 3 seconds");
+
+ customization.getClass(IMPLEMENTATION_PACKAGE, "ContentUnderstandingClientImpl").customizeAst(ast ->
+ ast.getClassByName("ContentUnderstandingClientImpl").ifPresent(clazz -> {
+ int count = 0;
+ for (MethodDeclaration method : clazz.getMethods()) {
+ method.getBody().ifPresent(body -> {
+ String bodyStr = body.toString();
+ if (bodyStr.contains("Duration.ofSeconds(1)")) {
+ String updated = bodyStr.replace("Duration.ofSeconds(1)", "Duration.ofSeconds(3)");
+ method.setBody(StaticJavaParser.parseBlock(updated));
+ }
+ });
+ }
+ logger.info("Updated polling interval from 1s to 3s in ContentUnderstandingClientImpl");
+ }));
+ }
+
+}
diff --git a/sdk/contentunderstanding/azure-ai-contentunderstanding/pom.xml b/sdk/contentunderstanding/azure-ai-contentunderstanding/pom.xml
new file mode 100644
index 000000000000..d98a98c9f1ff
--- /dev/null
+++ b/sdk/contentunderstanding/azure-ai-contentunderstanding/pom.xml
@@ -0,0 +1,73 @@
+
+
+ 4.0.0
+
+ com.azure
+ azure-client-sdk-parent
+ 1.7.0
+ ../../parents/azure-client-sdk-parent
+
+
+ com.azure
+ azure-ai-contentunderstanding
+ 1.0.0
+ jar
+
+ Microsoft Azure client library for Azure Content Understanding in Foundry Tools
+ This package contains the Microsoft Azure Content Understanding in Foundry Tools client library.
+ https://github.com/Azure/azure-sdk-for-java
+
+
+
+ The MIT License (MIT)
+ http://opensource.org/licenses/MIT
+ repo
+
+
+
+
+ https://github.com/Azure/azure-sdk-for-java
+ scm:git:git@github.com:Azure/azure-sdk-for-java.git
+ scm:git:git@github.com:Azure/azure-sdk-for-java.git
+ HEAD
+
+
+
+ microsoft
+ Microsoft
+
+
+
+ UTF-8
+
+ **/generated/Sample*.java,**/samples/Sample*.java
+
+
+
+ com.azure
+ azure-core
+ 1.57.1
+
+
+ com.azure
+ azure-core-http-netty
+ 1.16.3
+
+
+ com.azure
+ azure-core-test
+ 1.27.0-beta.14
+ test
+
+
+ com.azure
+ azure-identity
+ 1.18.2
+
+
+
+
diff --git a/sdk/contentunderstanding/azure-ai-contentunderstanding/src/main/java/com/azure/ai/contentunderstanding/ContentUnderstandingAsyncClient.java b/sdk/contentunderstanding/azure-ai-contentunderstanding/src/main/java/com/azure/ai/contentunderstanding/ContentUnderstandingAsyncClient.java
new file mode 100644
index 000000000000..69a47300e3ab
--- /dev/null
+++ b/sdk/contentunderstanding/azure-ai-contentunderstanding/src/main/java/com/azure/ai/contentunderstanding/ContentUnderstandingAsyncClient.java
@@ -0,0 +1,2144 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+package com.azure.ai.contentunderstanding;
+
+import com.azure.ai.contentunderstanding.implementation.ContentUnderstandingClientImpl;
+import com.azure.ai.contentunderstanding.implementation.JsonMergePatchHelper;
+import com.azure.ai.contentunderstanding.implementation.models.AnalyzeRequest1;
+import com.azure.ai.contentunderstanding.implementation.models.CopyAnalyzerRequest;
+import com.azure.ai.contentunderstanding.implementation.models.GrantCopyAuthorizationRequest1;
+import com.azure.ai.contentunderstanding.models.AnalysisInput;
+import com.azure.ai.contentunderstanding.models.AnalysisResult;
+import com.azure.ai.contentunderstanding.models.ContentAnalyzer;
+import com.azure.ai.contentunderstanding.models.ContentAnalyzerAnalyzeOperationStatus;
+import com.azure.ai.contentunderstanding.models.ContentAnalyzerOperationStatus;
+import com.azure.ai.contentunderstanding.models.ContentRange;
+import com.azure.ai.contentunderstanding.models.ContentUnderstandingDefaults;
+import com.azure.ai.contentunderstanding.models.CopyAuthorization;
+import com.azure.ai.contentunderstanding.models.ProcessingLocation;
+import com.azure.core.annotation.Generated;
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceClient;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.exception.ClientAuthenticationException;
+import com.azure.core.exception.HttpResponseException;
+import com.azure.core.exception.ResourceModifiedException;
+import com.azure.core.exception.ResourceNotFoundException;
+import com.azure.core.http.rest.PagedFlux;
+import com.azure.core.http.rest.PagedResponse;
+import com.azure.core.http.rest.PagedResponseBase;
+import com.azure.core.http.rest.RequestOptions;
+import com.azure.core.http.rest.Response;
+import com.azure.core.util.BinaryData;
+import com.azure.core.util.FluxUtil;
+import com.azure.core.util.polling.PollerFlux;
+import java.time.Duration;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+import reactor.core.publisher.Flux;
+import reactor.core.publisher.Mono;
+
+/**
+ * Initializes a new instance of the asynchronous ContentUnderstandingClient type.
+ */
+@ServiceClient(builder = ContentUnderstandingClientBuilder.class, isAsync = true)
+public final class ContentUnderstandingAsyncClient {
+
+ @Generated
+ private final ContentUnderstandingClientImpl serviceClient;
+
+ /**
+ * Initializes an instance of ContentUnderstandingAsyncClient class.
+ *
+ * @param serviceClient the service client implementation.
+ */
+ @Generated
+ ContentUnderstandingAsyncClient(ContentUnderstandingClientImpl serviceClient) {
+ this.serviceClient = serviceClient;
+ }
+
+ /**
+ * Extract content and fields from input.
+ * Query Parameters
+ *
+ * Query Parameters
+ * | Name | Type | Required | Description |
+ * | stringEncoding | String | No | The string encoding format for content spans in the
+ * response.
+ * Possible values are 'codePoint', 'utf16', and `utf8`. Default is `codePoint`.") |
+ * | processingLocation | String | No | The location where the data may be processed.
+ * Defaults to global. Allowed values: "geography", "dataZone", "global". |
+ *
+ * You can add these to a request with {@link RequestOptions#addQueryParam}
+ * Request Body Schema
+ *
+ *
+ * {@code
+ * {
+ * inputs (Required): [
+ * (Required){
+ * url: String (Optional)
+ * data: byte[] (Optional)
+ * name: String (Optional)
+ * mimeType: String (Optional)
+ * range: String (Optional)
+ * }
+ * ]
+ * modelDeployments (Optional): {
+ * String: String (Required)
+ * }
+ * }
+ * }
+ *
+ *
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * id: String (Required)
+ * status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+ * error (Optional): {
+ * code: String (Required)
+ * message: String (Required)
+ * target: String (Optional)
+ * details (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * innererror (Optional): {
+ * code: String (Optional)
+ * innererror (Optional): (recursive schema, see innererror above)
+ * }
+ * }
+ * result (Optional): {
+ * analyzerId: String (Optional)
+ * apiVersion: String (Optional)
+ * createdAt: OffsetDateTime (Optional)
+ * warnings (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * stringEncoding: String (Optional)
+ * contents (Required): [
+ * (Required){
+ * kind: String(document/audioVisual) (Required)
+ * mimeType: String (Required)
+ * analyzerId: String (Optional)
+ * category: String (Optional)
+ * path: String (Optional)
+ * markdown: String (Optional)
+ * fields (Optional): {
+ * String (Required): {
+ * type: String(string/date/time/number/integer/boolean/array/object/json) (Required)
+ * spans (Optional): [
+ * (Optional){
+ * offset: int (Required)
+ * length: int (Required)
+ * }
+ * ]
+ * confidence: Double (Optional)
+ * source: String (Optional)
+ * }
+ * }
+ * }
+ * ]
+ * }
+ * usage (Optional): {
+ * documentPagesMinimal: Integer (Optional)
+ * documentPagesBasic: Integer (Optional)
+ * documentPagesStandard: Integer (Optional)
+ * audioHours: Double (Optional)
+ * videoHours: Double (Optional)
+ * contextualizationTokens: Integer (Optional)
+ * tokens (Optional): {
+ * String: int (Required)
+ * }
+ * }
+ * }
+ * }
+ *
+ *
+ * @param analyzerId The unique identifier of the analyzer.
+ * @param analyzeRequest The analyzeRequest parameter.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return the {@link PollerFlux} for polling of provides status details for analyze operations.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public PollerFlux beginAnalyze(String analyzerId, BinaryData analyzeRequest,
+ RequestOptions requestOptions) {
+ return this.serviceClient.beginAnalyzeAsync(analyzerId, analyzeRequest, requestOptions);
+ }
+
+ /**
+ * Extract content and fields from input.
+ * Query Parameters
+ *
+ * Query Parameters
+ * | Name | Type | Required | Description |
+ * | stringEncoding | String | No | The string encoding format for content spans in the
+ * response.
+ * Possible values are 'codePoint', 'utf16', and `utf8`. Default is `codePoint`.") |
+ * | processingLocation | String | No | The location where the data may be processed.
+ * Defaults to global. Allowed values: "geography", "dataZone", "global". |
+ * | range | String | No | Range of the input to analyze (ex. `1-3,5,9-`). Document content
+ * uses 1-based page numbers, while audio visual content uses integer milliseconds. |
+ *
+ * You can add these to a request with {@link RequestOptions#addQueryParam}
+ * Request Body Schema
+ *
+ *
+ * {@code
+ * BinaryData
+ * }
+ *
+ *
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * id: String (Required)
+ * status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+ * error (Optional): {
+ * code: String (Required)
+ * message: String (Required)
+ * target: String (Optional)
+ * details (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * innererror (Optional): {
+ * code: String (Optional)
+ * innererror (Optional): (recursive schema, see innererror above)
+ * }
+ * }
+ * result (Optional): {
+ * analyzerId: String (Optional)
+ * apiVersion: String (Optional)
+ * createdAt: OffsetDateTime (Optional)
+ * warnings (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * stringEncoding: String (Optional)
+ * contents (Required): [
+ * (Required){
+ * kind: String(document/audioVisual) (Required)
+ * mimeType: String (Required)
+ * analyzerId: String (Optional)
+ * category: String (Optional)
+ * path: String (Optional)
+ * markdown: String (Optional)
+ * fields (Optional): {
+ * String (Required): {
+ * type: String(string/date/time/number/integer/boolean/array/object/json) (Required)
+ * spans (Optional): [
+ * (Optional){
+ * offset: int (Required)
+ * length: int (Required)
+ * }
+ * ]
+ * confidence: Double (Optional)
+ * source: String (Optional)
+ * }
+ * }
+ * }
+ * ]
+ * }
+ * usage (Optional): {
+ * documentPagesMinimal: Integer (Optional)
+ * documentPagesBasic: Integer (Optional)
+ * documentPagesStandard: Integer (Optional)
+ * audioHours: Double (Optional)
+ * videoHours: Double (Optional)
+ * contextualizationTokens: Integer (Optional)
+ * tokens (Optional): {
+ * String: int (Required)
+ * }
+ * }
+ * }
+ * }
+ *
+ *
+ * @param analyzerId The unique identifier of the analyzer.
+ * @param contentType Request content type.
+ * @param binaryInput The binary content of the document to analyze.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return the {@link PollerFlux} for polling of provides status details for analyze operations.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public PollerFlux beginAnalyzeBinary(String analyzerId, String contentType,
+ BinaryData binaryInput, RequestOptions requestOptions) {
+ return this.serviceClient.beginAnalyzeBinaryAsync(analyzerId, contentType, binaryInput, requestOptions);
+ }
+
+ /**
+ * Create a copy of the source analyzer to the current location.
+ * Query Parameters
+ *
+ * Query Parameters
+ * | Name | Type | Required | Description |
+ * | allowReplace | Boolean | No | Allow the operation to replace an existing
+ * resource. |
+ *
+ * You can add these to a request with {@link RequestOptions#addQueryParam}
+ * Request Body Schema
+ *
+ *
+ * {@code
+ * {
+ * sourceAzureResourceId: String (Optional)
+ * sourceRegion: String (Optional)
+ * sourceAnalyzerId: String (Required)
+ * }
+ * }
+ *
+ *
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * analyzerId: String (Required)
+ * description: String (Optional)
+ * tags (Optional): {
+ * String: String (Required)
+ * }
+ * status: String(creating/ready/deleting/failed) (Required)
+ * createdAt: OffsetDateTime (Required)
+ * lastModifiedAt: OffsetDateTime (Required)
+ * warnings (Optional): [
+ * (Optional){
+ * code: String (Required)
+ * message: String (Required)
+ * target: String (Optional)
+ * details (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * innererror (Optional): {
+ * code: String (Optional)
+ * innererror (Optional): (recursive schema, see innererror above)
+ * }
+ * }
+ * ]
+ * baseAnalyzerId: String (Optional)
+ * config (Optional): {
+ * returnDetails: Boolean (Optional)
+ * locales (Optional): [
+ * String (Optional)
+ * ]
+ * enableOcr: Boolean (Optional)
+ * enableLayout: Boolean (Optional)
+ * enableFigureDescription: Boolean (Optional)
+ * enableFigureAnalysis: Boolean (Optional)
+ * enableFormula: Boolean (Optional)
+ * tableFormat: String(html/markdown) (Optional)
+ * chartFormat: String(chartJs/markdown) (Optional)
+ * annotationFormat: String(none/markdown) (Optional)
+ * disableFaceBlurring: Boolean (Optional)
+ * estimateFieldSourceAndConfidence: Boolean (Optional)
+ * contentCategories (Optional): {
+ * String (Required): {
+ * description: String (Optional)
+ * analyzerId: String (Optional)
+ * analyzer (Optional): (recursive schema, see analyzer above)
+ * }
+ * }
+ * enableSegment: Boolean (Optional)
+ * segmentPerPage: Boolean (Optional)
+ * omitContent: Boolean (Optional)
+ * }
+ * fieldSchema (Optional): {
+ * name: String (Optional)
+ * description: String (Optional)
+ * fields (Optional, Required on create): {
+ * String (Required): {
+ * method: String(generate/extract/classify) (Optional)
+ * type: String(string/date/time/number/integer/boolean/array/object/json) (Optional)
+ * description: String (Optional)
+ * items (Optional): (recursive schema, see items above)
+ * properties (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * examples (Optional): [
+ * String (Optional)
+ * ]
+ * enum (Optional): [
+ * String (Optional)
+ * ]
+ * enumDescriptions (Optional): {
+ * String: String (Required)
+ * }
+ * $ref: String (Optional)
+ * estimateSourceAndConfidence: Boolean (Optional)
+ * }
+ * }
+ * definitions (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * }
+ * dynamicFieldSchema: Boolean (Optional)
+ * processingLocation: String(geography/dataZone/global) (Optional)
+ * knowledgeSources (Optional): [
+ * (Optional){
+ * kind: String(labeledData) (Required)
+ * }
+ * ]
+ * models (Optional): {
+ * String: String (Required)
+ * }
+ * supportedModels (Optional): {
+ * completion (Optional): [
+ * String (Optional)
+ * ]
+ * embedding (Optional): [
+ * String (Optional)
+ * ]
+ * }
+ * }
+ * }
+ *
+ *
+ * @param analyzerId The unique identifier of the analyzer.
+ * @param copyAnalyzerRequest The copyAnalyzerRequest parameter.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return the {@link PollerFlux} for polling of analyzer that extracts content and fields from multimodal
+ * documents.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public PollerFlux beginCopyAnalyzer(String analyzerId, BinaryData copyAnalyzerRequest,
+ RequestOptions requestOptions) {
+ return this.serviceClient.beginCopyAnalyzerAsync(analyzerId, copyAnalyzerRequest, requestOptions);
+ }
+
+ /**
+ * Create a new analyzer asynchronously.
+ * Query Parameters
+ *
+ * Query Parameters
+ * | Name | Type | Required | Description |
+ * | allowReplace | Boolean | No | Allow the operation to replace an existing
+ * resource. |
+ *
+ * You can add these to a request with {@link RequestOptions#addQueryParam}
+ * Request Body Schema
+ *
+ *
+ * {@code
+ * {
+ * analyzerId: String (Required)
+ * description: String (Optional)
+ * tags (Optional): {
+ * String: String (Required)
+ * }
+ * status: String(creating/ready/deleting/failed) (Required)
+ * createdAt: OffsetDateTime (Required)
+ * lastModifiedAt: OffsetDateTime (Required)
+ * warnings (Optional): [
+ * (Optional){
+ * code: String (Required)
+ * message: String (Required)
+ * target: String (Optional)
+ * details (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * innererror (Optional): {
+ * code: String (Optional)
+ * innererror (Optional): (recursive schema, see innererror above)
+ * }
+ * }
+ * ]
+ * baseAnalyzerId: String (Optional)
+ * config (Optional): {
+ * returnDetails: Boolean (Optional)
+ * locales (Optional): [
+ * String (Optional)
+ * ]
+ * enableOcr: Boolean (Optional)
+ * enableLayout: Boolean (Optional)
+ * enableFigureDescription: Boolean (Optional)
+ * enableFigureAnalysis: Boolean (Optional)
+ * enableFormula: Boolean (Optional)
+ * tableFormat: String(html/markdown) (Optional)
+ * chartFormat: String(chartJs/markdown) (Optional)
+ * annotationFormat: String(none/markdown) (Optional)
+ * disableFaceBlurring: Boolean (Optional)
+ * estimateFieldSourceAndConfidence: Boolean (Optional)
+ * contentCategories (Optional): {
+ * String (Required): {
+ * description: String (Optional)
+ * analyzerId: String (Optional)
+ * analyzer (Optional): (recursive schema, see analyzer above)
+ * }
+ * }
+ * enableSegment: Boolean (Optional)
+ * segmentPerPage: Boolean (Optional)
+ * omitContent: Boolean (Optional)
+ * }
+ * fieldSchema (Optional): {
+ * name: String (Optional)
+ * description: String (Optional)
+ * fields (Optional, Required on create): {
+ * String (Required): {
+ * method: String(generate/extract/classify) (Optional)
+ * type: String(string/date/time/number/integer/boolean/array/object/json) (Optional)
+ * description: String (Optional)
+ * items (Optional): (recursive schema, see items above)
+ * properties (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * examples (Optional): [
+ * String (Optional)
+ * ]
+ * enum (Optional): [
+ * String (Optional)
+ * ]
+ * enumDescriptions (Optional): {
+ * String: String (Required)
+ * }
+ * $ref: String (Optional)
+ * estimateSourceAndConfidence: Boolean (Optional)
+ * }
+ * }
+ * definitions (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * }
+ * dynamicFieldSchema: Boolean (Optional)
+ * processingLocation: String(geography/dataZone/global) (Optional)
+ * knowledgeSources (Optional): [
+ * (Optional){
+ * kind: String(labeledData) (Required)
+ * }
+ * ]
+ * models (Optional): {
+ * String: String (Required)
+ * }
+ * supportedModels (Optional): {
+ * completion (Optional): [
+ * String (Optional)
+ * ]
+ * embedding (Optional): [
+ * String (Optional)
+ * ]
+ * }
+ * }
+ * }
+ *
+ *
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * analyzerId: String (Required)
+ * description: String (Optional)
+ * tags (Optional): {
+ * String: String (Required)
+ * }
+ * status: String(creating/ready/deleting/failed) (Required)
+ * createdAt: OffsetDateTime (Required)
+ * lastModifiedAt: OffsetDateTime (Required)
+ * warnings (Optional): [
+ * (Optional){
+ * code: String (Required)
+ * message: String (Required)
+ * target: String (Optional)
+ * details (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * innererror (Optional): {
+ * code: String (Optional)
+ * innererror (Optional): (recursive schema, see innererror above)
+ * }
+ * }
+ * ]
+ * baseAnalyzerId: String (Optional)
+ * config (Optional): {
+ * returnDetails: Boolean (Optional)
+ * locales (Optional): [
+ * String (Optional)
+ * ]
+ * enableOcr: Boolean (Optional)
+ * enableLayout: Boolean (Optional)
+ * enableFigureDescription: Boolean (Optional)
+ * enableFigureAnalysis: Boolean (Optional)
+ * enableFormula: Boolean (Optional)
+ * tableFormat: String(html/markdown) (Optional)
+ * chartFormat: String(chartJs/markdown) (Optional)
+ * annotationFormat: String(none/markdown) (Optional)
+ * disableFaceBlurring: Boolean (Optional)
+ * estimateFieldSourceAndConfidence: Boolean (Optional)
+ * contentCategories (Optional): {
+ * String (Required): {
+ * description: String (Optional)
+ * analyzerId: String (Optional)
+ * analyzer (Optional): (recursive schema, see analyzer above)
+ * }
+ * }
+ * enableSegment: Boolean (Optional)
+ * segmentPerPage: Boolean (Optional)
+ * omitContent: Boolean (Optional)
+ * }
+ * fieldSchema (Optional): {
+ * name: String (Optional)
+ * description: String (Optional)
+ * fields (Optional, Required on create): {
+ * String (Required): {
+ * method: String(generate/extract/classify) (Optional)
+ * type: String(string/date/time/number/integer/boolean/array/object/json) (Optional)
+ * description: String (Optional)
+ * items (Optional): (recursive schema, see items above)
+ * properties (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * examples (Optional): [
+ * String (Optional)
+ * ]
+ * enum (Optional): [
+ * String (Optional)
+ * ]
+ * enumDescriptions (Optional): {
+ * String: String (Required)
+ * }
+ * $ref: String (Optional)
+ * estimateSourceAndConfidence: Boolean (Optional)
+ * }
+ * }
+ * definitions (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * }
+ * dynamicFieldSchema: Boolean (Optional)
+ * processingLocation: String(geography/dataZone/global) (Optional)
+ * knowledgeSources (Optional): [
+ * (Optional){
+ * kind: String(labeledData) (Required)
+ * }
+ * ]
+ * models (Optional): {
+ * String: String (Required)
+ * }
+ * supportedModels (Optional): {
+ * completion (Optional): [
+ * String (Optional)
+ * ]
+ * embedding (Optional): [
+ * String (Optional)
+ * ]
+ * }
+ * }
+ * }
+ *
+ *
+ * @param analyzerId The unique identifier of the analyzer.
+ * @param resource The resource instance.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return the {@link PollerFlux} for polling of analyzer that extracts content and fields from multimodal
+ * documents.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public PollerFlux beginCreateAnalyzer(String analyzerId, BinaryData resource,
+ RequestOptions requestOptions) {
+ return this.serviceClient.beginCreateAnalyzerAsync(analyzerId, resource, requestOptions);
+ }
+
+ /**
+ * Delete analyzer.
+ *
+ * @param analyzerId The unique identifier of the analyzer.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> deleteAnalyzerWithResponse(String analyzerId, RequestOptions requestOptions) {
+ return this.serviceClient.deleteAnalyzerWithResponseAsync(analyzerId, requestOptions);
+ }
+
+ /**
+ * Mark the result of an analysis operation for deletion.
+ *
+ * @param operationId Operation identifier.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> deleteResultWithResponse(String operationId, RequestOptions requestOptions) {
+ return this.serviceClient.deleteResultWithResponseAsync(operationId, requestOptions);
+ }
+
+ /**
+ * Get analyzer properties.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * analyzerId: String (Required)
+ * description: String (Optional)
+ * tags (Optional): {
+ * String: String (Required)
+ * }
+ * status: String(creating/ready/deleting/failed) (Required)
+ * createdAt: OffsetDateTime (Required)
+ * lastModifiedAt: OffsetDateTime (Required)
+ * warnings (Optional): [
+ * (Optional){
+ * code: String (Required)
+ * message: String (Required)
+ * target: String (Optional)
+ * details (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * innererror (Optional): {
+ * code: String (Optional)
+ * innererror (Optional): (recursive schema, see innererror above)
+ * }
+ * }
+ * ]
+ * baseAnalyzerId: String (Optional)
+ * config (Optional): {
+ * returnDetails: Boolean (Optional)
+ * locales (Optional): [
+ * String (Optional)
+ * ]
+ * enableOcr: Boolean (Optional)
+ * enableLayout: Boolean (Optional)
+ * enableFigureDescription: Boolean (Optional)
+ * enableFigureAnalysis: Boolean (Optional)
+ * enableFormula: Boolean (Optional)
+ * tableFormat: String(html/markdown) (Optional)
+ * chartFormat: String(chartJs/markdown) (Optional)
+ * annotationFormat: String(none/markdown) (Optional)
+ * disableFaceBlurring: Boolean (Optional)
+ * estimateFieldSourceAndConfidence: Boolean (Optional)
+ * contentCategories (Optional): {
+ * String (Required): {
+ * description: String (Optional)
+ * analyzerId: String (Optional)
+ * analyzer (Optional): (recursive schema, see analyzer above)
+ * }
+ * }
+ * enableSegment: Boolean (Optional)
+ * segmentPerPage: Boolean (Optional)
+ * omitContent: Boolean (Optional)
+ * }
+ * fieldSchema (Optional): {
+ * name: String (Optional)
+ * description: String (Optional)
+ * fields (Optional, Required on create): {
+ * String (Required): {
+ * method: String(generate/extract/classify) (Optional)
+ * type: String(string/date/time/number/integer/boolean/array/object/json) (Optional)
+ * description: String (Optional)
+ * items (Optional): (recursive schema, see items above)
+ * properties (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * examples (Optional): [
+ * String (Optional)
+ * ]
+ * enum (Optional): [
+ * String (Optional)
+ * ]
+ * enumDescriptions (Optional): {
+ * String: String (Required)
+ * }
+ * $ref: String (Optional)
+ * estimateSourceAndConfidence: Boolean (Optional)
+ * }
+ * }
+ * definitions (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * }
+ * dynamicFieldSchema: Boolean (Optional)
+ * processingLocation: String(geography/dataZone/global) (Optional)
+ * knowledgeSources (Optional): [
+ * (Optional){
+ * kind: String(labeledData) (Required)
+ * }
+ * ]
+ * models (Optional): {
+ * String: String (Required)
+ * }
+ * supportedModels (Optional): {
+ * completion (Optional): [
+ * String (Optional)
+ * ]
+ * embedding (Optional): [
+ * String (Optional)
+ * ]
+ * }
+ * }
+ * }
+ *
+ *
+ * @param analyzerId The unique identifier of the analyzer.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return analyzer properties along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> getAnalyzerWithResponse(String analyzerId, RequestOptions requestOptions) {
+ return this.serviceClient.getAnalyzerWithResponseAsync(analyzerId, requestOptions);
+ }
+
+ /**
+ * Return default settings for this Content Understanding resource.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * modelDeployments (Required): {
+ * String: String (Required)
+ * }
+ * }
+ * }
+ *
+ *
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return default settings for this Content Understanding resource along with {@link Response} on successful
+ * completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> getDefaultsWithResponse(RequestOptions requestOptions) {
+ return this.serviceClient.getDefaultsWithResponseAsync(requestOptions);
+ }
+
+ /**
+ * Get the status of an analyzer creation operation.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * id: String (Required)
+ * status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+ * error (Optional): {
+ * code: String (Required)
+ * message: String (Required)
+ * target: String (Optional)
+ * details (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * innererror (Optional): {
+ * code: String (Optional)
+ * innererror (Optional): (recursive schema, see innererror above)
+ * }
+ * }
+ * result (Optional): {
+ * analyzerId: String (Required)
+ * description: String (Optional)
+ * tags (Optional): {
+ * String: String (Required)
+ * }
+ * status: String(creating/ready/deleting/failed) (Required)
+ * createdAt: OffsetDateTime (Required)
+ * lastModifiedAt: OffsetDateTime (Required)
+ * warnings (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * baseAnalyzerId: String (Optional)
+ * config (Optional): {
+ * returnDetails: Boolean (Optional)
+ * locales (Optional): [
+ * String (Optional)
+ * ]
+ * enableOcr: Boolean (Optional)
+ * enableLayout: Boolean (Optional)
+ * enableFigureDescription: Boolean (Optional)
+ * enableFigureAnalysis: Boolean (Optional)
+ * enableFormula: Boolean (Optional)
+ * tableFormat: String(html/markdown) (Optional)
+ * chartFormat: String(chartJs/markdown) (Optional)
+ * annotationFormat: String(none/markdown) (Optional)
+ * disableFaceBlurring: Boolean (Optional)
+ * estimateFieldSourceAndConfidence: Boolean (Optional)
+ * contentCategories (Optional): {
+ * String (Required): {
+ * description: String (Optional)
+ * analyzerId: String (Optional)
+ * analyzer (Optional): (recursive schema, see analyzer above)
+ * }
+ * }
+ * enableSegment: Boolean (Optional)
+ * segmentPerPage: Boolean (Optional)
+ * omitContent: Boolean (Optional)
+ * }
+ * fieldSchema (Optional): {
+ * name: String (Optional)
+ * description: String (Optional)
+ * fields (Optional, Required on create): {
+ * String (Required): {
+ * method: String(generate/extract/classify) (Optional)
+ * type: String(string/date/time/number/integer/boolean/array/object/json) (Optional)
+ * description: String (Optional)
+ * items (Optional): (recursive schema, see items above)
+ * properties (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * examples (Optional): [
+ * String (Optional)
+ * ]
+ * enum (Optional): [
+ * String (Optional)
+ * ]
+ * enumDescriptions (Optional): {
+ * String: String (Required)
+ * }
+ * $ref: String (Optional)
+ * estimateSourceAndConfidence: Boolean (Optional)
+ * }
+ * }
+ * definitions (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * }
+ * dynamicFieldSchema: Boolean (Optional)
+ * processingLocation: String(geography/dataZone/global) (Optional)
+ * knowledgeSources (Optional): [
+ * (Optional){
+ * kind: String(labeledData) (Required)
+ * }
+ * ]
+ * models (Optional): {
+ * String: String (Required)
+ * }
+ * supportedModels (Optional): {
+ * completion (Optional): [
+ * String (Optional)
+ * ]
+ * embedding (Optional): [
+ * String (Optional)
+ * ]
+ * }
+ * }
+ * usage (Optional): {
+ * documentPagesMinimal: Integer (Optional)
+ * documentPagesBasic: Integer (Optional)
+ * documentPagesStandard: Integer (Optional)
+ * audioHours: Double (Optional)
+ * videoHours: Double (Optional)
+ * contextualizationTokens: Integer (Optional)
+ * tokens (Optional): {
+ * String: int (Required)
+ * }
+ * }
+ * }
+ * }
+ *
+ *
+ * @param analyzerId The unique identifier of the analyzer.
+ * @param operationId The unique ID of the operation.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return the status of an analyzer creation operation along with {@link Response} on successful completion of
+ * {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Mono> getOperationStatusWithResponse(String analyzerId, String operationId,
+ RequestOptions requestOptions) {
+ return this.serviceClient.getOperationStatusWithResponseAsync(analyzerId, operationId, requestOptions);
+ }
+
+ /**
+ * Get the result of an analysis operation.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * id: String (Required)
+ * status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+ * error (Optional): {
+ * code: String (Required)
+ * message: String (Required)
+ * target: String (Optional)
+ * details (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * innererror (Optional): {
+ * code: String (Optional)
+ * innererror (Optional): (recursive schema, see innererror above)
+ * }
+ * }
+ * result (Optional): {
+ * analyzerId: String (Optional)
+ * apiVersion: String (Optional)
+ * createdAt: OffsetDateTime (Optional)
+ * warnings (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * stringEncoding: String (Optional)
+ * contents (Required): [
+ * (Required){
+ * kind: String(document/audioVisual) (Required)
+ * mimeType: String (Required)
+ * analyzerId: String (Optional)
+ * category: String (Optional)
+ * path: String (Optional)
+ * markdown: String (Optional)
+ * fields (Optional): {
+ * String (Required): {
+ * type: String(string/date/time/number/integer/boolean/array/object/json) (Required)
+ * spans (Optional): [
+ * (Optional){
+ * offset: int (Required)
+ * length: int (Required)
+ * }
+ * ]
+ * confidence: Double (Optional)
+ * source: String (Optional)
+ * }
+ * }
+ * }
+ * ]
+ * }
+ * usage (Optional): {
+ * documentPagesMinimal: Integer (Optional)
+ * documentPagesBasic: Integer (Optional)
+ * documentPagesStandard: Integer (Optional)
+ * audioHours: Double (Optional)
+ * videoHours: Double (Optional)
+ * contextualizationTokens: Integer (Optional)
+ * tokens (Optional): {
+ * String: int (Required)
+ * }
+ * }
+ * }
+ * }
+ *
+ *
+ * @param operationId The unique ID of the operation.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return the result of an analysis operation along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Mono> getResultWithResponse(String operationId, RequestOptions requestOptions) {
+ return this.serviceClient.getResultWithResponseAsync(operationId, requestOptions);
+ }
+
+ /**
+ * Get a file associated with the result of an analysis operation.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * BinaryData
+ * }
+ *
+ *
+ * @param operationId Operation identifier.
+ * @param path File path.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return a file associated with the result of an analysis operation along with {@link Response} on successful
+ * completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> getResultFileWithResponse(String operationId, String path,
+ RequestOptions requestOptions) {
+ return this.serviceClient.getResultFileWithResponseAsync(operationId, path, requestOptions);
+ }
+
+ /**
+ * Get authorization for copying this analyzer to another location.
+ * Request Body Schema
+ *
+ *
+ * {@code
+ * {
+ * targetAzureResourceId: String (Required)
+ * targetRegion: String (Optional)
+ * }
+ * }
+ *
+ *
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * source: String (Required)
+ * targetAzureResourceId: String (Required)
+ * expiresAt: OffsetDateTime (Required)
+ * }
+ * }
+ *
+ *
+ * @param analyzerId The unique identifier of the analyzer.
+ * @param grantCopyAuthorizationRequest The grantCopyAuthorizationRequest parameter.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return authorization for copying this analyzer to another location along with {@link Response} on successful
+ * completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> grantCopyAuthorizationWithResponse(String analyzerId,
+ BinaryData grantCopyAuthorizationRequest, RequestOptions requestOptions) {
+ return this.serviceClient.grantCopyAuthorizationWithResponseAsync(analyzerId, grantCopyAuthorizationRequest,
+ requestOptions);
+ }
+
+ /**
+ * List analyzers.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * analyzerId: String (Required)
+ * description: String (Optional)
+ * tags (Optional): {
+ * String: String (Required)
+ * }
+ * status: String(creating/ready/deleting/failed) (Required)
+ * createdAt: OffsetDateTime (Required)
+ * lastModifiedAt: OffsetDateTime (Required)
+ * warnings (Optional): [
+ * (Optional){
+ * code: String (Required)
+ * message: String (Required)
+ * target: String (Optional)
+ * details (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * innererror (Optional): {
+ * code: String (Optional)
+ * innererror (Optional): (recursive schema, see innererror above)
+ * }
+ * }
+ * ]
+ * baseAnalyzerId: String (Optional)
+ * config (Optional): {
+ * returnDetails: Boolean (Optional)
+ * locales (Optional): [
+ * String (Optional)
+ * ]
+ * enableOcr: Boolean (Optional)
+ * enableLayout: Boolean (Optional)
+ * enableFigureDescription: Boolean (Optional)
+ * enableFigureAnalysis: Boolean (Optional)
+ * enableFormula: Boolean (Optional)
+ * tableFormat: String(html/markdown) (Optional)
+ * chartFormat: String(chartJs/markdown) (Optional)
+ * annotationFormat: String(none/markdown) (Optional)
+ * disableFaceBlurring: Boolean (Optional)
+ * estimateFieldSourceAndConfidence: Boolean (Optional)
+ * contentCategories (Optional): {
+ * String (Required): {
+ * description: String (Optional)
+ * analyzerId: String (Optional)
+ * analyzer (Optional): (recursive schema, see analyzer above)
+ * }
+ * }
+ * enableSegment: Boolean (Optional)
+ * segmentPerPage: Boolean (Optional)
+ * omitContent: Boolean (Optional)
+ * }
+ * fieldSchema (Optional): {
+ * name: String (Optional)
+ * description: String (Optional)
+ * fields (Optional, Required on create): {
+ * String (Required): {
+ * method: String(generate/extract/classify) (Optional)
+ * type: String(string/date/time/number/integer/boolean/array/object/json) (Optional)
+ * description: String (Optional)
+ * items (Optional): (recursive schema, see items above)
+ * properties (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * examples (Optional): [
+ * String (Optional)
+ * ]
+ * enum (Optional): [
+ * String (Optional)
+ * ]
+ * enumDescriptions (Optional): {
+ * String: String (Required)
+ * }
+ * $ref: String (Optional)
+ * estimateSourceAndConfidence: Boolean (Optional)
+ * }
+ * }
+ * definitions (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * }
+ * dynamicFieldSchema: Boolean (Optional)
+ * processingLocation: String(geography/dataZone/global) (Optional)
+ * knowledgeSources (Optional): [
+ * (Optional){
+ * kind: String(labeledData) (Required)
+ * }
+ * ]
+ * models (Optional): {
+ * String: String (Required)
+ * }
+ * supportedModels (Optional): {
+ * completion (Optional): [
+ * String (Optional)
+ * ]
+ * embedding (Optional): [
+ * String (Optional)
+ * ]
+ * }
+ * }
+ * }
+ *
+ *
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return paged collection of ContentAnalyzer items as paginated response with {@link PagedFlux}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedFlux listAnalyzers(RequestOptions requestOptions) {
+ return this.serviceClient.listAnalyzersAsync(requestOptions);
+ }
+
+ /**
+ * Update analyzer properties.
+ * Request Body Schema
+ *
+ *
+ * {@code
+ * {
+ * analyzerId: String (Required)
+ * description: String (Optional)
+ * tags (Optional): {
+ * String: String (Required)
+ * }
+ * status: String(creating/ready/deleting/failed) (Required)
+ * createdAt: OffsetDateTime (Required)
+ * lastModifiedAt: OffsetDateTime (Required)
+ * warnings (Optional): [
+ * (Optional){
+ * code: String (Required)
+ * message: String (Required)
+ * target: String (Optional)
+ * details (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * innererror (Optional): {
+ * code: String (Optional)
+ * innererror (Optional): (recursive schema, see innererror above)
+ * }
+ * }
+ * ]
+ * baseAnalyzerId: String (Optional)
+ * config (Optional): {
+ * returnDetails: Boolean (Optional)
+ * locales (Optional): [
+ * String (Optional)
+ * ]
+ * enableOcr: Boolean (Optional)
+ * enableLayout: Boolean (Optional)
+ * enableFigureDescription: Boolean (Optional)
+ * enableFigureAnalysis: Boolean (Optional)
+ * enableFormula: Boolean (Optional)
+ * tableFormat: String(html/markdown) (Optional)
+ * chartFormat: String(chartJs/markdown) (Optional)
+ * annotationFormat: String(none/markdown) (Optional)
+ * disableFaceBlurring: Boolean (Optional)
+ * estimateFieldSourceAndConfidence: Boolean (Optional)
+ * contentCategories (Optional): {
+ * String (Required): {
+ * description: String (Optional)
+ * analyzerId: String (Optional)
+ * analyzer (Optional): (recursive schema, see analyzer above)
+ * }
+ * }
+ * enableSegment: Boolean (Optional)
+ * segmentPerPage: Boolean (Optional)
+ * omitContent: Boolean (Optional)
+ * }
+ * fieldSchema (Optional): {
+ * name: String (Optional)
+ * description: String (Optional)
+ * fields (Optional, Required on create): {
+ * String (Required): {
+ * method: String(generate/extract/classify) (Optional)
+ * type: String(string/date/time/number/integer/boolean/array/object/json) (Optional)
+ * description: String (Optional)
+ * items (Optional): (recursive schema, see items above)
+ * properties (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * examples (Optional): [
+ * String (Optional)
+ * ]
+ * enum (Optional): [
+ * String (Optional)
+ * ]
+ * enumDescriptions (Optional): {
+ * String: String (Required)
+ * }
+ * $ref: String (Optional)
+ * estimateSourceAndConfidence: Boolean (Optional)
+ * }
+ * }
+ * definitions (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * }
+ * dynamicFieldSchema: Boolean (Optional)
+ * processingLocation: String(geography/dataZone/global) (Optional)
+ * knowledgeSources (Optional): [
+ * (Optional){
+ * kind: String(labeledData) (Required)
+ * }
+ * ]
+ * models (Optional): {
+ * String: String (Required)
+ * }
+ * supportedModels (Optional): {
+ * completion (Optional): [
+ * String (Optional)
+ * ]
+ * embedding (Optional): [
+ * String (Optional)
+ * ]
+ * }
+ * }
+ * }
+ *
+ *
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * analyzerId: String (Required)
+ * description: String (Optional)
+ * tags (Optional): {
+ * String: String (Required)
+ * }
+ * status: String(creating/ready/deleting/failed) (Required)
+ * createdAt: OffsetDateTime (Required)
+ * lastModifiedAt: OffsetDateTime (Required)
+ * warnings (Optional): [
+ * (Optional){
+ * code: String (Required)
+ * message: String (Required)
+ * target: String (Optional)
+ * details (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * innererror (Optional): {
+ * code: String (Optional)
+ * innererror (Optional): (recursive schema, see innererror above)
+ * }
+ * }
+ * ]
+ * baseAnalyzerId: String (Optional)
+ * config (Optional): {
+ * returnDetails: Boolean (Optional)
+ * locales (Optional): [
+ * String (Optional)
+ * ]
+ * enableOcr: Boolean (Optional)
+ * enableLayout: Boolean (Optional)
+ * enableFigureDescription: Boolean (Optional)
+ * enableFigureAnalysis: Boolean (Optional)
+ * enableFormula: Boolean (Optional)
+ * tableFormat: String(html/markdown) (Optional)
+ * chartFormat: String(chartJs/markdown) (Optional)
+ * annotationFormat: String(none/markdown) (Optional)
+ * disableFaceBlurring: Boolean (Optional)
+ * estimateFieldSourceAndConfidence: Boolean (Optional)
+ * contentCategories (Optional): {
+ * String (Required): {
+ * description: String (Optional)
+ * analyzerId: String (Optional)
+ * analyzer (Optional): (recursive schema, see analyzer above)
+ * }
+ * }
+ * enableSegment: Boolean (Optional)
+ * segmentPerPage: Boolean (Optional)
+ * omitContent: Boolean (Optional)
+ * }
+ * fieldSchema (Optional): {
+ * name: String (Optional)
+ * description: String (Optional)
+ * fields (Optional, Required on create): {
+ * String (Required): {
+ * method: String(generate/extract/classify) (Optional)
+ * type: String(string/date/time/number/integer/boolean/array/object/json) (Optional)
+ * description: String (Optional)
+ * items (Optional): (recursive schema, see items above)
+ * properties (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * examples (Optional): [
+ * String (Optional)
+ * ]
+ * enum (Optional): [
+ * String (Optional)
+ * ]
+ * enumDescriptions (Optional): {
+ * String: String (Required)
+ * }
+ * $ref: String (Optional)
+ * estimateSourceAndConfidence: Boolean (Optional)
+ * }
+ * }
+ * definitions (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * }
+ * dynamicFieldSchema: Boolean (Optional)
+ * processingLocation: String(geography/dataZone/global) (Optional)
+ * knowledgeSources (Optional): [
+ * (Optional){
+ * kind: String(labeledData) (Required)
+ * }
+ * ]
+ * models (Optional): {
+ * String: String (Required)
+ * }
+ * supportedModels (Optional): {
+ * completion (Optional): [
+ * String (Optional)
+ * ]
+ * embedding (Optional): [
+ * String (Optional)
+ * ]
+ * }
+ * }
+ * }
+ *
+ *
+ * @param analyzerId The unique identifier of the analyzer.
+ * @param resource The resource instance.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return analyzer that extracts content and fields from multimodal documents along with {@link Response} on
+ * successful completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> updateAnalyzerWithResponse(String analyzerId, BinaryData resource,
+ RequestOptions requestOptions) {
+ return this.serviceClient.updateAnalyzerWithResponseAsync(analyzerId, resource, requestOptions);
+ }
+
+ /**
+ * Update default settings for this Content Understanding resource.
+ * Request Body Schema
+ *
+ *
+ * {@code
+ * {
+ * modelDeployments (Optional): {
+ * (Optional): {
+ * String: String (Required)
+ * }
+ * }
+ * }
+ * }
+ *
+ *
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * modelDeployments (Required): {
+ * String: String (Required)
+ * }
+ * }
+ * }
+ *
+ *
+ * @param updateDefaultsRequest The updateDefaultsRequest parameter.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return default settings for this Content Understanding resource along with {@link Response} on successful
+ * completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> updateDefaultsWithResponse(BinaryData updateDefaultsRequest,
+ RequestOptions requestOptions) {
+ return this.serviceClient.updateDefaultsWithResponseAsync(updateDefaultsRequest, requestOptions);
+ }
+
+ /**
+ * Extract content and fields from input.
+ *
+ * @param analyzerId The unique identifier of the analyzer.
+ * @param inputs Inputs to analyze. Currently, only pro mode supports multiple inputs.
+ * @param stringEncoding The string encoding format for content spans in the response.
+ * Possible values are 'codePoint', 'utf16', and `utf8`. Default is `codePoint`.").
+ * @param modelDeployments Specify the default mapping of model names to LLM/embedding deployments in Microsoft
+ * Foundry. For details and current semantics, see https://aka.ms/cudoc-quickstart-rest.
+ * @param processingLocation The location where the data may be processed. Defaults to global.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link PollerFlux} for polling of provides status details for analyze operations.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ PollerFlux beginAnalyze(String analyzerId,
+ List inputs, String stringEncoding, Map modelDeployments,
+ ProcessingLocation processingLocation) {
+ // Generated convenience method for beginAnalyzeWithModel
+ RequestOptions requestOptions = new RequestOptions();
+ AnalyzeRequest1 analyzeRequest1Obj = new AnalyzeRequest1(inputs).setModelDeployments(modelDeployments);
+ BinaryData analyzeRequest1 = BinaryData.fromObject(analyzeRequest1Obj);
+ requestOptions.addQueryParam("stringEncoding", stringEncoding, false);
+ if (processingLocation != null) {
+ requestOptions.addQueryParam("processingLocation", processingLocation.toString(), false);
+ }
+ return serviceClient.beginAnalyzeWithModelAsync(analyzerId, analyzeRequest1, requestOptions);
+ }
+
+ /**
+ * Extract content and fields from input.
+ *
+ * @param analyzerId The unique identifier of the analyzer.
+ * @param inputs Inputs to analyze. Currently, only pro mode supports multiple inputs.
+ * @param stringEncoding The string encoding format for content spans in the response.
+ * Possible values are 'codePoint', 'utf16', and `utf8`. Default is `codePoint`.").
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link PollerFlux} for polling of provides status details for analyze operations.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ PollerFlux beginAnalyze(String analyzerId,
+ List inputs, String stringEncoding) {
+ // Generated convenience method for beginAnalyzeWithModel
+ RequestOptions requestOptions = new RequestOptions();
+ AnalyzeRequest1 analyzeRequest1Obj = new AnalyzeRequest1(inputs);
+ BinaryData analyzeRequest1 = BinaryData.fromObject(analyzeRequest1Obj);
+ requestOptions.addQueryParam("stringEncoding", stringEncoding, false);
+ return serviceClient.beginAnalyzeWithModelAsync(analyzerId, analyzeRequest1, requestOptions);
+ }
+
+ /**
+ * Extract content and fields from input.
+ *
+ * @param analyzerId The unique identifier of the analyzer.
+ * @param binaryInput The binary content of the document to analyze.
+ * @param stringEncoding The string encoding format for content spans in the response.
+ * Possible values are 'codePoint', 'utf16', and `utf8`. Default is `codePoint`.").
+ * @param contentType Request content type.
+ * @param contentRange Range of the input to analyze (ex. `1-3,5,9-`). Document content uses 1-based page numbers,
+ * while audio visual content uses integer milliseconds.
+ * @param processingLocation The location where the data may be processed. Defaults to global.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link PollerFlux} for polling of provides status details for analyze operations.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ PollerFlux beginAnalyzeBinary(String analyzerId,
+ BinaryData binaryInput, String stringEncoding, String contentType, String contentRange,
+ ProcessingLocation processingLocation) {
+ // Generated convenience method for beginAnalyzeBinaryWithModel
+ RequestOptions requestOptions = new RequestOptions();
+ requestOptions.addQueryParam("stringEncoding", stringEncoding, false);
+ if (contentRange != null) {
+ requestOptions.addQueryParam("range", contentRange, false);
+ }
+ if (processingLocation != null) {
+ requestOptions.addQueryParam("processingLocation", processingLocation.toString(), false);
+ }
+ return serviceClient.beginAnalyzeBinaryWithModelAsync(analyzerId, contentType, binaryInput, requestOptions);
+ }
+
+ /**
+ * Extract content and fields from input.
+ *
+ * @param analyzerId The unique identifier of the analyzer.
+ * @param binaryInput The binary content of the document to analyze.
+ * @param stringEncoding The string encoding format for content spans in the response.
+ * Possible values are 'codePoint', 'utf16', and `utf8`. Default is `codePoint`.").
+ * @param contentType Request content type.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link PollerFlux} for polling of provides status details for analyze operations.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ PollerFlux beginAnalyzeBinary(String analyzerId,
+ BinaryData binaryInput, String stringEncoding, String contentType) {
+ // Generated convenience method for beginAnalyzeBinaryWithModel
+ RequestOptions requestOptions = new RequestOptions();
+ requestOptions.addQueryParam("stringEncoding", stringEncoding, false);
+ return serviceClient.beginAnalyzeBinaryWithModelAsync(analyzerId, contentType, binaryInput, requestOptions);
+ }
+
+ /**
+ * Create a copy of the source analyzer to the current location.
+ *
+ * @param analyzerId The unique identifier of the analyzer.
+ * @param sourceAnalyzerId Source analyzer ID.
+ * @param allowReplace Allow the operation to replace an existing resource.
+ * @param sourceAzureResourceId Azure resource ID of the source analyzer location. Defaults to the current resource.
+ * @param sourceRegion Azure region of the source analyzer location. Defaults to current region.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link PollerFlux} for polling of analyzer that extracts content and fields from multimodal
+ * documents.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public PollerFlux beginCopyAnalyzer(String analyzerId,
+ String sourceAnalyzerId, Boolean allowReplace, String sourceAzureResourceId, String sourceRegion) {
+ // Generated convenience method for beginCopyAnalyzerWithModel
+ RequestOptions requestOptions = new RequestOptions();
+ CopyAnalyzerRequest copyAnalyzerRequestObj
+ = new CopyAnalyzerRequest(sourceAnalyzerId).setSourceAzureResourceId(sourceAzureResourceId)
+ .setSourceRegion(sourceRegion);
+ BinaryData copyAnalyzerRequest = BinaryData.fromObject(copyAnalyzerRequestObj);
+ if (allowReplace != null) {
+ requestOptions.addQueryParam("allowReplace", String.valueOf(allowReplace), false);
+ }
+ return serviceClient.beginCopyAnalyzerWithModelAsync(analyzerId, copyAnalyzerRequest, requestOptions);
+ }
+
+ /**
+ * Create a copy of the source analyzer to the current location.
+ *
+ * @param analyzerId The unique identifier of the analyzer.
+ * @param sourceAnalyzerId Source analyzer ID.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link PollerFlux} for polling of analyzer that extracts content and fields from multimodal
+ * documents.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public PollerFlux beginCopyAnalyzer(String analyzerId,
+ String sourceAnalyzerId) {
+ // Generated convenience method for beginCopyAnalyzerWithModel
+ RequestOptions requestOptions = new RequestOptions();
+ CopyAnalyzerRequest copyAnalyzerRequestObj = new CopyAnalyzerRequest(sourceAnalyzerId);
+ BinaryData copyAnalyzerRequest = BinaryData.fromObject(copyAnalyzerRequestObj);
+ return serviceClient.beginCopyAnalyzerWithModelAsync(analyzerId, copyAnalyzerRequest, requestOptions);
+ }
+
+ /**
+ * Create a new analyzer asynchronously.
+ *
+ * @param analyzerId The unique identifier of the analyzer.
+ * @param resource The resource instance.
+ * @param allowReplace Allow the operation to replace an existing resource.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link PollerFlux} for polling of analyzer that extracts content and fields from multimodal
+ * documents.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public PollerFlux beginCreateAnalyzer(String analyzerId,
+ ContentAnalyzer resource, Boolean allowReplace) {
+ // Generated convenience method for beginCreateAnalyzerWithModel
+ RequestOptions requestOptions = new RequestOptions();
+ if (allowReplace != null) {
+ requestOptions.addQueryParam("allowReplace", String.valueOf(allowReplace), false);
+ }
+ return serviceClient.beginCreateAnalyzerWithModelAsync(analyzerId, BinaryData.fromObject(resource),
+ requestOptions);
+ }
+
+ /**
+ * Create a new analyzer asynchronously.
+ *
+ * @param analyzerId The unique identifier of the analyzer.
+ * @param resource The resource instance.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link PollerFlux} for polling of analyzer that extracts content and fields from multimodal
+ * documents.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public PollerFlux beginCreateAnalyzer(String analyzerId,
+ ContentAnalyzer resource) {
+ // Generated convenience method for beginCreateAnalyzerWithModel
+ RequestOptions requestOptions = new RequestOptions();
+ return serviceClient.beginCreateAnalyzerWithModelAsync(analyzerId, BinaryData.fromObject(resource),
+ requestOptions);
+ }
+
+ /**
+ * Delete analyzer.
+ *
+ * @param analyzerId The unique identifier of the analyzer.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return A {@link Mono} that completes when a successful response is received.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono deleteAnalyzer(String analyzerId) {
+ // Generated convenience method for deleteAnalyzerWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ return deleteAnalyzerWithResponse(analyzerId, requestOptions).flatMap(FluxUtil::toMono);
+ }
+
+ /**
+ * Mark the result of an analysis operation for deletion.
+ *
+ * @param operationId Operation identifier.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return A {@link Mono} that completes when a successful response is received.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono deleteResult(String operationId) {
+ // Generated convenience method for deleteResultWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ return deleteResultWithResponse(operationId, requestOptions).flatMap(FluxUtil::toMono);
+ }
+
+ /**
+ * Get analyzer properties.
+ *
+ * @param analyzerId The unique identifier of the analyzer.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return analyzer properties on successful completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono getAnalyzer(String analyzerId) {
+ // Generated convenience method for getAnalyzerWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ return getAnalyzerWithResponse(analyzerId, requestOptions).flatMap(FluxUtil::toMono)
+ .map(protocolMethodData -> protocolMethodData.toObject(ContentAnalyzer.class));
+ }
+
+ /**
+ * Return default settings for this Content Understanding resource.
+ *
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return default settings for this Content Understanding resource on successful completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono getDefaults() {
+ // Generated convenience method for getDefaultsWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ return getDefaultsWithResponse(requestOptions).flatMap(FluxUtil::toMono)
+ .map(protocolMethodData -> protocolMethodData.toObject(ContentUnderstandingDefaults.class));
+ }
+
+ /**
+ * Get the status of an analyzer creation operation.
+ *
+ * @param analyzerId The unique identifier of the analyzer.
+ * @param operationId The unique ID of the operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the status of an analyzer creation operation on successful completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Mono getOperationStatus(String analyzerId, String operationId) {
+ // Generated convenience method for getOperationStatusWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ return getOperationStatusWithResponse(analyzerId, operationId, requestOptions).flatMap(FluxUtil::toMono)
+ .map(protocolMethodData -> protocolMethodData.toObject(ContentAnalyzerOperationStatus.class));
+ }
+
+ /**
+ * Get the result of an analysis operation.
+ *
+ * @param operationId The unique ID of the operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the result of an analysis operation on successful completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Mono getResult(String operationId) {
+ // Generated convenience method for getResultWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ return getResultWithResponse(operationId, requestOptions).flatMap(FluxUtil::toMono)
+ .map(protocolMethodData -> protocolMethodData.toObject(ContentAnalyzerAnalyzeOperationStatus.class));
+ }
+
+ /**
+ * Get a file associated with the result of an analysis operation.
+ *
+ * @param operationId Operation identifier.
+ * @param path File path.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a file associated with the result of an analysis operation on successful completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono getResultFile(String operationId, String path) {
+ // Generated convenience method for getResultFileWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ return getResultFileWithResponse(operationId, path, requestOptions).flatMap(FluxUtil::toMono);
+ }
+
+ /**
+ * Get authorization for copying this analyzer to another location.
+ *
+ * @param analyzerId The unique identifier of the analyzer.
+ * @param targetAzureResourceId Azure resource ID of the target analyzer location.
+ * @param targetRegion Azure region of the target analyzer location. Defaults to current region.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return authorization for copying this analyzer to another location on successful completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono grantCopyAuthorization(String analyzerId, String targetAzureResourceId,
+ String targetRegion) {
+ // Generated convenience method for grantCopyAuthorizationWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ GrantCopyAuthorizationRequest1 grantCopyAuthorizationRequest1Obj
+ = new GrantCopyAuthorizationRequest1(targetAzureResourceId).setTargetRegion(targetRegion);
+ BinaryData grantCopyAuthorizationRequest1 = BinaryData.fromObject(grantCopyAuthorizationRequest1Obj);
+ return grantCopyAuthorizationWithResponse(analyzerId, grantCopyAuthorizationRequest1, requestOptions)
+ .flatMap(FluxUtil::toMono)
+ .map(protocolMethodData -> protocolMethodData.toObject(CopyAuthorization.class));
+ }
+
+ /**
+ * Get authorization for copying this analyzer to another location.
+ *
+ * @param analyzerId The unique identifier of the analyzer.
+ * @param targetAzureResourceId Azure resource ID of the target analyzer location.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return authorization for copying this analyzer to another location on successful completion of {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono grantCopyAuthorization(String analyzerId, String targetAzureResourceId) {
+ // Generated convenience method for grantCopyAuthorizationWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ GrantCopyAuthorizationRequest1 grantCopyAuthorizationRequest1Obj
+ = new GrantCopyAuthorizationRequest1(targetAzureResourceId);
+ BinaryData grantCopyAuthorizationRequest1 = BinaryData.fromObject(grantCopyAuthorizationRequest1Obj);
+ return grantCopyAuthorizationWithResponse(analyzerId, grantCopyAuthorizationRequest1, requestOptions)
+ .flatMap(FluxUtil::toMono)
+ .map(protocolMethodData -> protocolMethodData.toObject(CopyAuthorization.class));
+ }
+
+ /**
+ * List analyzers.
+ *
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return paged collection of ContentAnalyzer items as paginated response with {@link PagedFlux}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedFlux listAnalyzers() {
+ // Generated convenience method for listAnalyzers
+ RequestOptions requestOptions = new RequestOptions();
+ PagedFlux pagedFluxResponse = listAnalyzers(requestOptions);
+ return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> {
+ Flux> flux = (continuationTokenParam == null)
+ ? pagedFluxResponse.byPage().take(1)
+ : pagedFluxResponse.byPage(continuationTokenParam).take(1);
+ return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(),
+ pagedResponse.getStatusCode(), pagedResponse.getHeaders(),
+ pagedResponse.getValue()
+ .stream()
+ .map(protocolMethodData -> protocolMethodData.toObject(ContentAnalyzer.class))
+ .collect(Collectors.toList()),
+ pagedResponse.getContinuationToken(), null));
+ });
+ }
+
+ /**
+ * Update analyzer properties.
+ *
+ * @param analyzerId The unique identifier of the analyzer.
+ * @param resource The resource instance.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return analyzer that extracts content and fields from multimodal documents on successful completion of
+ * {@link Mono}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono updateAnalyzer(String analyzerId, ContentAnalyzer resource) {
+ // Generated convenience method for updateAnalyzerWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ JsonMergePatchHelper.getContentAnalyzerAccessor().prepareModelForJsonMergePatch(resource, true);
+ BinaryData resourceInBinaryData = BinaryData.fromObject(resource);
+ // BinaryData.fromObject() will not fire serialization, use getLength() to fire serialization.
+ resourceInBinaryData.getLength();
+ JsonMergePatchHelper.getContentAnalyzerAccessor().prepareModelForJsonMergePatch(resource, false);
+ return updateAnalyzerWithResponse(analyzerId, resourceInBinaryData, requestOptions).flatMap(FluxUtil::toMono)
+ .map(protocolMethodData -> protocolMethodData.toObject(ContentAnalyzer.class));
+ }
+
+ /**
+ * Update default model deployment settings.
+ *
+ * This is the recommended public API for updating default model deployment settings. This method provides a simpler
+ * API that accepts a Map of model names to deployment names.
+ *
+ * @param modelDeployments Mapping of model names to deployment names. For example: { "gpt-4.1":
+ * "myGpt41Deployment", "text-embedding-3-large": "myTextEmbedding3LargeDeployment" }.
+ * @return the updated ContentUnderstandingDefaults on successful completion of {@link Mono}.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono updateDefaults(Map modelDeployments) {
+ ContentUnderstandingDefaults defaults = new ContentUnderstandingDefaults(modelDeployments);
+ return updateDefaultsWithResponse(BinaryData.fromObject(defaults), null)
+ .map(response -> response.getValue().toObject(ContentUnderstandingDefaults.class));
+ }
+
+ /**
+ * Update default model deployment settings.
+ *
+ * This is a convenience method that accepts a ContentUnderstandingDefaults object.
+ *
+ * @param defaults The ContentUnderstandingDefaults instance with settings to update.
+ * @return the updated ContentUnderstandingDefaults on successful completion of {@link Mono}.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono updateDefaults(ContentUnderstandingDefaults defaults) {
+ return updateDefaultsWithResponse(BinaryData.fromObject(defaults), null)
+ .map(response -> response.getValue().toObject(ContentUnderstandingDefaults.class));
+ }
+
+ /**
+ * Extract content and fields from binary input. Uses default content type (application/octet-stream), default
+ * string encoding (utf16), and service default processing location.
+ *
+ * @param analyzerId The unique identifier of the analyzer.
+ * @param binaryInput The binary content of the document to analyze.
+ * @return the {@link PollerFlux} for polling of the analyze operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public PollerFlux beginAnalyzeBinary(String analyzerId,
+ BinaryData binaryInput) {
+ return beginAnalyzeBinary(analyzerId, binaryInput, (ContentRange) null, "application/octet-stream", null);
+ }
+
+ /**
+ * Extract content and fields from binary input. Uses default string encoding (utf16).
+ *
+ * Use factory methods such as {@link ContentRange#pages(int, int)}, {@link ContentRange#timeRange(long, long)}, or
+ * {@link ContentRange#combine(ContentRange...)} to build the range.
+ *
+ * @param analyzerId The unique identifier of the analyzer.
+ * @param binaryInput The binary content of the document to analyze.
+ * @param contentRange Range of the input to analyze. Use ContentRange factory methods to build the range, or null
+ * to skip.
+ * @param contentType Request content type.
+ * @param processingLocation The location where the data may be processed. Set to null for service default.
+ * @return the {@link PollerFlux} for polling of the analyze operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public PollerFlux beginAnalyzeBinary(String analyzerId,
+ BinaryData binaryInput, ContentRange contentRange, String contentType, ProcessingLocation processingLocation) {
+ RequestOptions requestOptions = new RequestOptions();
+ if (contentRange != null) {
+ requestOptions.addQueryParam("range", contentRange.toString(), false);
+ }
+ if (processingLocation != null) {
+ requestOptions.addQueryParam("processingLocation", processingLocation.toString(), false);
+ }
+ requestOptions.addQueryParam("stringEncoding", "utf16", false);
+ return serviceClient.beginAnalyzeBinaryWithModelAsync(analyzerId, contentType, binaryInput, requestOptions)
+ .setPollInterval(Duration.ofSeconds(3));
+ }
+
+ /**
+ * Extract content and fields from inputs. Uses default string encoding (utf16), service default model deployments,
+ * and global processing location.
+ *
+ * @param analyzerId The unique identifier of the analyzer.
+ * @param inputs The inputs to analyze.
+ * @return the {@link PollerFlux} for polling of the analyze operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public PollerFlux beginAnalyze(String analyzerId,
+ List inputs) {
+ return beginAnalyze(analyzerId, inputs, null, null);
+ }
+
+ /**
+ * Extract content and fields from inputs. Uses default string encoding (utf16).
+ *
+ * @param analyzerId The unique identifier of the analyzer.
+ * @param inputs The inputs to analyze.
+ * @param modelDeployments Custom model deployment mappings. Set to null to use service defaults.
+ * @param processingLocation The processing location for the analysis. Set to null to use the service default.
+ * @return the {@link PollerFlux} for polling of the analyze operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public PollerFlux beginAnalyze(String analyzerId,
+ List inputs, Map modelDeployments, ProcessingLocation processingLocation) {
+ RequestOptions requestOptions = new RequestOptions();
+ if (processingLocation != null) {
+ requestOptions.addQueryParam("processingLocation", processingLocation.toString(), false);
+ }
+ requestOptions.addQueryParam("stringEncoding", "utf16", false);
+ AnalyzeRequest1 analyzeRequest1Obj = new AnalyzeRequest1(inputs).setModelDeployments(modelDeployments);
+ BinaryData analyzeRequest1 = BinaryData.fromObject(analyzeRequest1Obj);
+ return serviceClient.beginAnalyzeWithModelAsync(analyzerId, analyzeRequest1, requestOptions)
+ .setPollInterval(Duration.ofSeconds(3));
+ }
+}
diff --git a/sdk/contentunderstanding/azure-ai-contentunderstanding/src/main/java/com/azure/ai/contentunderstanding/ContentUnderstandingClient.java b/sdk/contentunderstanding/azure-ai-contentunderstanding/src/main/java/com/azure/ai/contentunderstanding/ContentUnderstandingClient.java
new file mode 100644
index 000000000000..22b9b4cf574b
--- /dev/null
+++ b/sdk/contentunderstanding/azure-ai-contentunderstanding/src/main/java/com/azure/ai/contentunderstanding/ContentUnderstandingClient.java
@@ -0,0 +1,2112 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+package com.azure.ai.contentunderstanding;
+
+import com.azure.ai.contentunderstanding.implementation.ContentUnderstandingClientImpl;
+import com.azure.ai.contentunderstanding.implementation.JsonMergePatchHelper;
+import com.azure.ai.contentunderstanding.implementation.models.AnalyzeRequest1;
+import com.azure.ai.contentunderstanding.implementation.models.CopyAnalyzerRequest;
+import com.azure.ai.contentunderstanding.implementation.models.GrantCopyAuthorizationRequest1;
+import com.azure.ai.contentunderstanding.models.AnalysisInput;
+import com.azure.ai.contentunderstanding.models.AnalysisResult;
+import com.azure.ai.contentunderstanding.models.ContentAnalyzer;
+import com.azure.ai.contentunderstanding.models.ContentAnalyzerAnalyzeOperationStatus;
+import com.azure.ai.contentunderstanding.models.ContentAnalyzerOperationStatus;
+import com.azure.ai.contentunderstanding.models.ContentRange;
+import com.azure.ai.contentunderstanding.models.ContentUnderstandingDefaults;
+import com.azure.ai.contentunderstanding.models.CopyAuthorization;
+import com.azure.ai.contentunderstanding.models.ProcessingLocation;
+import com.azure.core.annotation.Generated;
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceClient;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.exception.ClientAuthenticationException;
+import com.azure.core.exception.HttpResponseException;
+import com.azure.core.exception.ResourceModifiedException;
+import com.azure.core.exception.ResourceNotFoundException;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.RequestOptions;
+import com.azure.core.http.rest.Response;
+import com.azure.core.util.BinaryData;
+import com.azure.core.util.polling.SyncPoller;
+import java.time.Duration;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Initializes a new instance of the synchronous ContentUnderstandingClient type.
+ */
+@ServiceClient(builder = ContentUnderstandingClientBuilder.class)
+public final class ContentUnderstandingClient {
+
+ @Generated
+ private final ContentUnderstandingClientImpl serviceClient;
+
+ /**
+ * Initializes an instance of ContentUnderstandingClient class.
+ *
+ * @param serviceClient the service client implementation.
+ */
+ @Generated
+ ContentUnderstandingClient(ContentUnderstandingClientImpl serviceClient) {
+ this.serviceClient = serviceClient;
+ }
+
+ /**
+ * Extract content and fields from input.
+ * Query Parameters
+ *
+ * Query Parameters
+ * | Name | Type | Required | Description |
+ * | stringEncoding | String | No | The string encoding format for content spans in the
+ * response.
+ * Possible values are 'codePoint', 'utf16', and `utf8`. Default is `codePoint`.") |
+ * | processingLocation | String | No | The location where the data may be processed.
+ * Defaults to global. Allowed values: "geography", "dataZone", "global". |
+ *
+ * You can add these to a request with {@link RequestOptions#addQueryParam}
+ * Request Body Schema
+ *
+ *
+ * {@code
+ * {
+ * inputs (Required): [
+ * (Required){
+ * url: String (Optional)
+ * data: byte[] (Optional)
+ * name: String (Optional)
+ * mimeType: String (Optional)
+ * range: String (Optional)
+ * }
+ * ]
+ * modelDeployments (Optional): {
+ * String: String (Required)
+ * }
+ * }
+ * }
+ *
+ *
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * id: String (Required)
+ * status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+ * error (Optional): {
+ * code: String (Required)
+ * message: String (Required)
+ * target: String (Optional)
+ * details (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * innererror (Optional): {
+ * code: String (Optional)
+ * innererror (Optional): (recursive schema, see innererror above)
+ * }
+ * }
+ * result (Optional): {
+ * analyzerId: String (Optional)
+ * apiVersion: String (Optional)
+ * createdAt: OffsetDateTime (Optional)
+ * warnings (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * stringEncoding: String (Optional)
+ * contents (Required): [
+ * (Required){
+ * kind: String(document/audioVisual) (Required)
+ * mimeType: String (Required)
+ * analyzerId: String (Optional)
+ * category: String (Optional)
+ * path: String (Optional)
+ * markdown: String (Optional)
+ * fields (Optional): {
+ * String (Required): {
+ * type: String(string/date/time/number/integer/boolean/array/object/json) (Required)
+ * spans (Optional): [
+ * (Optional){
+ * offset: int (Required)
+ * length: int (Required)
+ * }
+ * ]
+ * confidence: Double (Optional)
+ * source: String (Optional)
+ * }
+ * }
+ * }
+ * ]
+ * }
+ * usage (Optional): {
+ * documentPagesMinimal: Integer (Optional)
+ * documentPagesBasic: Integer (Optional)
+ * documentPagesStandard: Integer (Optional)
+ * audioHours: Double (Optional)
+ * videoHours: Double (Optional)
+ * contextualizationTokens: Integer (Optional)
+ * tokens (Optional): {
+ * String: int (Required)
+ * }
+ * }
+ * }
+ * }
+ *
+ *
+ * @param analyzerId The unique identifier of the analyzer.
+ * @param analyzeRequest The analyzeRequest parameter.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return the {@link SyncPoller} for polling of provides status details for analyze operations.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller beginAnalyze(String analyzerId, BinaryData analyzeRequest,
+ RequestOptions requestOptions) {
+ return this.serviceClient.beginAnalyze(analyzerId, analyzeRequest, requestOptions);
+ }
+
+ /**
+ * Extract content and fields from input.
+ * Query Parameters
+ *
+ * Query Parameters
+ * | Name | Type | Required | Description |
+ * | stringEncoding | String | No | The string encoding format for content spans in the
+ * response.
+ * Possible values are 'codePoint', 'utf16', and `utf8`. Default is `codePoint`.") |
+ * | processingLocation | String | No | The location where the data may be processed.
+ * Defaults to global. Allowed values: "geography", "dataZone", "global". |
+ * | range | String | No | Range of the input to analyze (ex. `1-3,5,9-`). Document content
+ * uses 1-based page numbers, while audio visual content uses integer milliseconds. |
+ *
+ * You can add these to a request with {@link RequestOptions#addQueryParam}
+ * Request Body Schema
+ *
+ *
+ * {@code
+ * BinaryData
+ * }
+ *
+ *
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * id: String (Required)
+ * status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+ * error (Optional): {
+ * code: String (Required)
+ * message: String (Required)
+ * target: String (Optional)
+ * details (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * innererror (Optional): {
+ * code: String (Optional)
+ * innererror (Optional): (recursive schema, see innererror above)
+ * }
+ * }
+ * result (Optional): {
+ * analyzerId: String (Optional)
+ * apiVersion: String (Optional)
+ * createdAt: OffsetDateTime (Optional)
+ * warnings (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * stringEncoding: String (Optional)
+ * contents (Required): [
+ * (Required){
+ * kind: String(document/audioVisual) (Required)
+ * mimeType: String (Required)
+ * analyzerId: String (Optional)
+ * category: String (Optional)
+ * path: String (Optional)
+ * markdown: String (Optional)
+ * fields (Optional): {
+ * String (Required): {
+ * type: String(string/date/time/number/integer/boolean/array/object/json) (Required)
+ * spans (Optional): [
+ * (Optional){
+ * offset: int (Required)
+ * length: int (Required)
+ * }
+ * ]
+ * confidence: Double (Optional)
+ * source: String (Optional)
+ * }
+ * }
+ * }
+ * ]
+ * }
+ * usage (Optional): {
+ * documentPagesMinimal: Integer (Optional)
+ * documentPagesBasic: Integer (Optional)
+ * documentPagesStandard: Integer (Optional)
+ * audioHours: Double (Optional)
+ * videoHours: Double (Optional)
+ * contextualizationTokens: Integer (Optional)
+ * tokens (Optional): {
+ * String: int (Required)
+ * }
+ * }
+ * }
+ * }
+ *
+ *
+ * @param analyzerId The unique identifier of the analyzer.
+ * @param contentType Request content type.
+ * @param binaryInput The binary content of the document to analyze.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return the {@link SyncPoller} for polling of provides status details for analyze operations.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller beginAnalyzeBinary(String analyzerId, String contentType,
+ BinaryData binaryInput, RequestOptions requestOptions) {
+ return this.serviceClient.beginAnalyzeBinary(analyzerId, contentType, binaryInput, requestOptions);
+ }
+
+ /**
+ * Create a copy of the source analyzer to the current location.
+ * Query Parameters
+ *
+ * Query Parameters
+ * | Name | Type | Required | Description |
+ * | allowReplace | Boolean | No | Allow the operation to replace an existing
+ * resource. |
+ *
+ * You can add these to a request with {@link RequestOptions#addQueryParam}
+ * Request Body Schema
+ *
+ *
+ * {@code
+ * {
+ * sourceAzureResourceId: String (Optional)
+ * sourceRegion: String (Optional)
+ * sourceAnalyzerId: String (Required)
+ * }
+ * }
+ *
+ *
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * analyzerId: String (Required)
+ * description: String (Optional)
+ * tags (Optional): {
+ * String: String (Required)
+ * }
+ * status: String(creating/ready/deleting/failed) (Required)
+ * createdAt: OffsetDateTime (Required)
+ * lastModifiedAt: OffsetDateTime (Required)
+ * warnings (Optional): [
+ * (Optional){
+ * code: String (Required)
+ * message: String (Required)
+ * target: String (Optional)
+ * details (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * innererror (Optional): {
+ * code: String (Optional)
+ * innererror (Optional): (recursive schema, see innererror above)
+ * }
+ * }
+ * ]
+ * baseAnalyzerId: String (Optional)
+ * config (Optional): {
+ * returnDetails: Boolean (Optional)
+ * locales (Optional): [
+ * String (Optional)
+ * ]
+ * enableOcr: Boolean (Optional)
+ * enableLayout: Boolean (Optional)
+ * enableFigureDescription: Boolean (Optional)
+ * enableFigureAnalysis: Boolean (Optional)
+ * enableFormula: Boolean (Optional)
+ * tableFormat: String(html/markdown) (Optional)
+ * chartFormat: String(chartJs/markdown) (Optional)
+ * annotationFormat: String(none/markdown) (Optional)
+ * disableFaceBlurring: Boolean (Optional)
+ * estimateFieldSourceAndConfidence: Boolean (Optional)
+ * contentCategories (Optional): {
+ * String (Required): {
+ * description: String (Optional)
+ * analyzerId: String (Optional)
+ * analyzer (Optional): (recursive schema, see analyzer above)
+ * }
+ * }
+ * enableSegment: Boolean (Optional)
+ * segmentPerPage: Boolean (Optional)
+ * omitContent: Boolean (Optional)
+ * }
+ * fieldSchema (Optional): {
+ * name: String (Optional)
+ * description: String (Optional)
+ * fields (Optional, Required on create): {
+ * String (Required): {
+ * method: String(generate/extract/classify) (Optional)
+ * type: String(string/date/time/number/integer/boolean/array/object/json) (Optional)
+ * description: String (Optional)
+ * items (Optional): (recursive schema, see items above)
+ * properties (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * examples (Optional): [
+ * String (Optional)
+ * ]
+ * enum (Optional): [
+ * String (Optional)
+ * ]
+ * enumDescriptions (Optional): {
+ * String: String (Required)
+ * }
+ * $ref: String (Optional)
+ * estimateSourceAndConfidence: Boolean (Optional)
+ * }
+ * }
+ * definitions (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * }
+ * dynamicFieldSchema: Boolean (Optional)
+ * processingLocation: String(geography/dataZone/global) (Optional)
+ * knowledgeSources (Optional): [
+ * (Optional){
+ * kind: String(labeledData) (Required)
+ * }
+ * ]
+ * models (Optional): {
+ * String: String (Required)
+ * }
+ * supportedModels (Optional): {
+ * completion (Optional): [
+ * String (Optional)
+ * ]
+ * embedding (Optional): [
+ * String (Optional)
+ * ]
+ * }
+ * }
+ * }
+ *
+ *
+ * @param analyzerId The unique identifier of the analyzer.
+ * @param copyAnalyzerRequest The copyAnalyzerRequest parameter.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return the {@link SyncPoller} for polling of analyzer that extracts content and fields from multimodal
+ * documents.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller beginCopyAnalyzer(String analyzerId, BinaryData copyAnalyzerRequest,
+ RequestOptions requestOptions) {
+ return this.serviceClient.beginCopyAnalyzer(analyzerId, copyAnalyzerRequest, requestOptions);
+ }
+
+ /**
+ * Create a new analyzer asynchronously.
+ * Query Parameters
+ *
+ * Query Parameters
+ * | Name | Type | Required | Description |
+ * | allowReplace | Boolean | No | Allow the operation to replace an existing
+ * resource. |
+ *
+ * You can add these to a request with {@link RequestOptions#addQueryParam}
+ * Request Body Schema
+ *
+ *
+ * {@code
+ * {
+ * analyzerId: String (Required)
+ * description: String (Optional)
+ * tags (Optional): {
+ * String: String (Required)
+ * }
+ * status: String(creating/ready/deleting/failed) (Required)
+ * createdAt: OffsetDateTime (Required)
+ * lastModifiedAt: OffsetDateTime (Required)
+ * warnings (Optional): [
+ * (Optional){
+ * code: String (Required)
+ * message: String (Required)
+ * target: String (Optional)
+ * details (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * innererror (Optional): {
+ * code: String (Optional)
+ * innererror (Optional): (recursive schema, see innererror above)
+ * }
+ * }
+ * ]
+ * baseAnalyzerId: String (Optional)
+ * config (Optional): {
+ * returnDetails: Boolean (Optional)
+ * locales (Optional): [
+ * String (Optional)
+ * ]
+ * enableOcr: Boolean (Optional)
+ * enableLayout: Boolean (Optional)
+ * enableFigureDescription: Boolean (Optional)
+ * enableFigureAnalysis: Boolean (Optional)
+ * enableFormula: Boolean (Optional)
+ * tableFormat: String(html/markdown) (Optional)
+ * chartFormat: String(chartJs/markdown) (Optional)
+ * annotationFormat: String(none/markdown) (Optional)
+ * disableFaceBlurring: Boolean (Optional)
+ * estimateFieldSourceAndConfidence: Boolean (Optional)
+ * contentCategories (Optional): {
+ * String (Required): {
+ * description: String (Optional)
+ * analyzerId: String (Optional)
+ * analyzer (Optional): (recursive schema, see analyzer above)
+ * }
+ * }
+ * enableSegment: Boolean (Optional)
+ * segmentPerPage: Boolean (Optional)
+ * omitContent: Boolean (Optional)
+ * }
+ * fieldSchema (Optional): {
+ * name: String (Optional)
+ * description: String (Optional)
+ * fields (Optional, Required on create): {
+ * String (Required): {
+ * method: String(generate/extract/classify) (Optional)
+ * type: String(string/date/time/number/integer/boolean/array/object/json) (Optional)
+ * description: String (Optional)
+ * items (Optional): (recursive schema, see items above)
+ * properties (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * examples (Optional): [
+ * String (Optional)
+ * ]
+ * enum (Optional): [
+ * String (Optional)
+ * ]
+ * enumDescriptions (Optional): {
+ * String: String (Required)
+ * }
+ * $ref: String (Optional)
+ * estimateSourceAndConfidence: Boolean (Optional)
+ * }
+ * }
+ * definitions (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * }
+ * dynamicFieldSchema: Boolean (Optional)
+ * processingLocation: String(geography/dataZone/global) (Optional)
+ * knowledgeSources (Optional): [
+ * (Optional){
+ * kind: String(labeledData) (Required)
+ * }
+ * ]
+ * models (Optional): {
+ * String: String (Required)
+ * }
+ * supportedModels (Optional): {
+ * completion (Optional): [
+ * String (Optional)
+ * ]
+ * embedding (Optional): [
+ * String (Optional)
+ * ]
+ * }
+ * }
+ * }
+ *
+ *
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * analyzerId: String (Required)
+ * description: String (Optional)
+ * tags (Optional): {
+ * String: String (Required)
+ * }
+ * status: String(creating/ready/deleting/failed) (Required)
+ * createdAt: OffsetDateTime (Required)
+ * lastModifiedAt: OffsetDateTime (Required)
+ * warnings (Optional): [
+ * (Optional){
+ * code: String (Required)
+ * message: String (Required)
+ * target: String (Optional)
+ * details (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * innererror (Optional): {
+ * code: String (Optional)
+ * innererror (Optional): (recursive schema, see innererror above)
+ * }
+ * }
+ * ]
+ * baseAnalyzerId: String (Optional)
+ * config (Optional): {
+ * returnDetails: Boolean (Optional)
+ * locales (Optional): [
+ * String (Optional)
+ * ]
+ * enableOcr: Boolean (Optional)
+ * enableLayout: Boolean (Optional)
+ * enableFigureDescription: Boolean (Optional)
+ * enableFigureAnalysis: Boolean (Optional)
+ * enableFormula: Boolean (Optional)
+ * tableFormat: String(html/markdown) (Optional)
+ * chartFormat: String(chartJs/markdown) (Optional)
+ * annotationFormat: String(none/markdown) (Optional)
+ * disableFaceBlurring: Boolean (Optional)
+ * estimateFieldSourceAndConfidence: Boolean (Optional)
+ * contentCategories (Optional): {
+ * String (Required): {
+ * description: String (Optional)
+ * analyzerId: String (Optional)
+ * analyzer (Optional): (recursive schema, see analyzer above)
+ * }
+ * }
+ * enableSegment: Boolean (Optional)
+ * segmentPerPage: Boolean (Optional)
+ * omitContent: Boolean (Optional)
+ * }
+ * fieldSchema (Optional): {
+ * name: String (Optional)
+ * description: String (Optional)
+ * fields (Optional, Required on create): {
+ * String (Required): {
+ * method: String(generate/extract/classify) (Optional)
+ * type: String(string/date/time/number/integer/boolean/array/object/json) (Optional)
+ * description: String (Optional)
+ * items (Optional): (recursive schema, see items above)
+ * properties (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * examples (Optional): [
+ * String (Optional)
+ * ]
+ * enum (Optional): [
+ * String (Optional)
+ * ]
+ * enumDescriptions (Optional): {
+ * String: String (Required)
+ * }
+ * $ref: String (Optional)
+ * estimateSourceAndConfidence: Boolean (Optional)
+ * }
+ * }
+ * definitions (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * }
+ * dynamicFieldSchema: Boolean (Optional)
+ * processingLocation: String(geography/dataZone/global) (Optional)
+ * knowledgeSources (Optional): [
+ * (Optional){
+ * kind: String(labeledData) (Required)
+ * }
+ * ]
+ * models (Optional): {
+ * String: String (Required)
+ * }
+ * supportedModels (Optional): {
+ * completion (Optional): [
+ * String (Optional)
+ * ]
+ * embedding (Optional): [
+ * String (Optional)
+ * ]
+ * }
+ * }
+ * }
+ *
+ *
+ * @param analyzerId The unique identifier of the analyzer.
+ * @param resource The resource instance.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return the {@link SyncPoller} for polling of analyzer that extracts content and fields from multimodal
+ * documents.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller beginCreateAnalyzer(String analyzerId, BinaryData resource,
+ RequestOptions requestOptions) {
+ return this.serviceClient.beginCreateAnalyzer(analyzerId, resource, requestOptions);
+ }
+
+ /**
+ * Delete analyzer.
+ *
+ * @param analyzerId The unique identifier of the analyzer.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return the {@link Response}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response deleteAnalyzerWithResponse(String analyzerId, RequestOptions requestOptions) {
+ return this.serviceClient.deleteAnalyzerWithResponse(analyzerId, requestOptions);
+ }
+
+ /**
+ * Mark the result of an analysis operation for deletion.
+ *
+ * @param operationId Operation identifier.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return the {@link Response}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response deleteResultWithResponse(String operationId, RequestOptions requestOptions) {
+ return this.serviceClient.deleteResultWithResponse(operationId, requestOptions);
+ }
+
+ /**
+ * Get analyzer properties.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * analyzerId: String (Required)
+ * description: String (Optional)
+ * tags (Optional): {
+ * String: String (Required)
+ * }
+ * status: String(creating/ready/deleting/failed) (Required)
+ * createdAt: OffsetDateTime (Required)
+ * lastModifiedAt: OffsetDateTime (Required)
+ * warnings (Optional): [
+ * (Optional){
+ * code: String (Required)
+ * message: String (Required)
+ * target: String (Optional)
+ * details (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * innererror (Optional): {
+ * code: String (Optional)
+ * innererror (Optional): (recursive schema, see innererror above)
+ * }
+ * }
+ * ]
+ * baseAnalyzerId: String (Optional)
+ * config (Optional): {
+ * returnDetails: Boolean (Optional)
+ * locales (Optional): [
+ * String (Optional)
+ * ]
+ * enableOcr: Boolean (Optional)
+ * enableLayout: Boolean (Optional)
+ * enableFigureDescription: Boolean (Optional)
+ * enableFigureAnalysis: Boolean (Optional)
+ * enableFormula: Boolean (Optional)
+ * tableFormat: String(html/markdown) (Optional)
+ * chartFormat: String(chartJs/markdown) (Optional)
+ * annotationFormat: String(none/markdown) (Optional)
+ * disableFaceBlurring: Boolean (Optional)
+ * estimateFieldSourceAndConfidence: Boolean (Optional)
+ * contentCategories (Optional): {
+ * String (Required): {
+ * description: String (Optional)
+ * analyzerId: String (Optional)
+ * analyzer (Optional): (recursive schema, see analyzer above)
+ * }
+ * }
+ * enableSegment: Boolean (Optional)
+ * segmentPerPage: Boolean (Optional)
+ * omitContent: Boolean (Optional)
+ * }
+ * fieldSchema (Optional): {
+ * name: String (Optional)
+ * description: String (Optional)
+ * fields (Optional, Required on create): {
+ * String (Required): {
+ * method: String(generate/extract/classify) (Optional)
+ * type: String(string/date/time/number/integer/boolean/array/object/json) (Optional)
+ * description: String (Optional)
+ * items (Optional): (recursive schema, see items above)
+ * properties (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * examples (Optional): [
+ * String (Optional)
+ * ]
+ * enum (Optional): [
+ * String (Optional)
+ * ]
+ * enumDescriptions (Optional): {
+ * String: String (Required)
+ * }
+ * $ref: String (Optional)
+ * estimateSourceAndConfidence: Boolean (Optional)
+ * }
+ * }
+ * definitions (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * }
+ * dynamicFieldSchema: Boolean (Optional)
+ * processingLocation: String(geography/dataZone/global) (Optional)
+ * knowledgeSources (Optional): [
+ * (Optional){
+ * kind: String(labeledData) (Required)
+ * }
+ * ]
+ * models (Optional): {
+ * String: String (Required)
+ * }
+ * supportedModels (Optional): {
+ * completion (Optional): [
+ * String (Optional)
+ * ]
+ * embedding (Optional): [
+ * String (Optional)
+ * ]
+ * }
+ * }
+ * }
+ *
+ *
+ * @param analyzerId The unique identifier of the analyzer.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return analyzer properties along with {@link Response}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response getAnalyzerWithResponse(String analyzerId, RequestOptions requestOptions) {
+ return this.serviceClient.getAnalyzerWithResponse(analyzerId, requestOptions);
+ }
+
+ /**
+ * Return default settings for this Content Understanding resource.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * modelDeployments (Required): {
+ * String: String (Required)
+ * }
+ * }
+ * }
+ *
+ *
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return default settings for this Content Understanding resource along with {@link Response}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response getDefaultsWithResponse(RequestOptions requestOptions) {
+ return this.serviceClient.getDefaultsWithResponse(requestOptions);
+ }
+
+ /**
+ * Get the status of an analyzer creation operation.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * id: String (Required)
+ * status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+ * error (Optional): {
+ * code: String (Required)
+ * message: String (Required)
+ * target: String (Optional)
+ * details (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * innererror (Optional): {
+ * code: String (Optional)
+ * innererror (Optional): (recursive schema, see innererror above)
+ * }
+ * }
+ * result (Optional): {
+ * analyzerId: String (Required)
+ * description: String (Optional)
+ * tags (Optional): {
+ * String: String (Required)
+ * }
+ * status: String(creating/ready/deleting/failed) (Required)
+ * createdAt: OffsetDateTime (Required)
+ * lastModifiedAt: OffsetDateTime (Required)
+ * warnings (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * baseAnalyzerId: String (Optional)
+ * config (Optional): {
+ * returnDetails: Boolean (Optional)
+ * locales (Optional): [
+ * String (Optional)
+ * ]
+ * enableOcr: Boolean (Optional)
+ * enableLayout: Boolean (Optional)
+ * enableFigureDescription: Boolean (Optional)
+ * enableFigureAnalysis: Boolean (Optional)
+ * enableFormula: Boolean (Optional)
+ * tableFormat: String(html/markdown) (Optional)
+ * chartFormat: String(chartJs/markdown) (Optional)
+ * annotationFormat: String(none/markdown) (Optional)
+ * disableFaceBlurring: Boolean (Optional)
+ * estimateFieldSourceAndConfidence: Boolean (Optional)
+ * contentCategories (Optional): {
+ * String (Required): {
+ * description: String (Optional)
+ * analyzerId: String (Optional)
+ * analyzer (Optional): (recursive schema, see analyzer above)
+ * }
+ * }
+ * enableSegment: Boolean (Optional)
+ * segmentPerPage: Boolean (Optional)
+ * omitContent: Boolean (Optional)
+ * }
+ * fieldSchema (Optional): {
+ * name: String (Optional)
+ * description: String (Optional)
+ * fields (Optional, Required on create): {
+ * String (Required): {
+ * method: String(generate/extract/classify) (Optional)
+ * type: String(string/date/time/number/integer/boolean/array/object/json) (Optional)
+ * description: String (Optional)
+ * items (Optional): (recursive schema, see items above)
+ * properties (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * examples (Optional): [
+ * String (Optional)
+ * ]
+ * enum (Optional): [
+ * String (Optional)
+ * ]
+ * enumDescriptions (Optional): {
+ * String: String (Required)
+ * }
+ * $ref: String (Optional)
+ * estimateSourceAndConfidence: Boolean (Optional)
+ * }
+ * }
+ * definitions (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * }
+ * dynamicFieldSchema: Boolean (Optional)
+ * processingLocation: String(geography/dataZone/global) (Optional)
+ * knowledgeSources (Optional): [
+ * (Optional){
+ * kind: String(labeledData) (Required)
+ * }
+ * ]
+ * models (Optional): {
+ * String: String (Required)
+ * }
+ * supportedModels (Optional): {
+ * completion (Optional): [
+ * String (Optional)
+ * ]
+ * embedding (Optional): [
+ * String (Optional)
+ * ]
+ * }
+ * }
+ * usage (Optional): {
+ * documentPagesMinimal: Integer (Optional)
+ * documentPagesBasic: Integer (Optional)
+ * documentPagesStandard: Integer (Optional)
+ * audioHours: Double (Optional)
+ * videoHours: Double (Optional)
+ * contextualizationTokens: Integer (Optional)
+ * tokens (Optional): {
+ * String: int (Required)
+ * }
+ * }
+ * }
+ * }
+ *
+ *
+ * @param analyzerId The unique identifier of the analyzer.
+ * @param operationId The unique ID of the operation.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return the status of an analyzer creation operation along with {@link Response}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getOperationStatusWithResponse(String analyzerId, String operationId,
+ RequestOptions requestOptions) {
+ return this.serviceClient.getOperationStatusWithResponse(analyzerId, operationId, requestOptions);
+ }
+
+ /**
+ * Get the result of an analysis operation.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * id: String (Required)
+ * status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+ * error (Optional): {
+ * code: String (Required)
+ * message: String (Required)
+ * target: String (Optional)
+ * details (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * innererror (Optional): {
+ * code: String (Optional)
+ * innererror (Optional): (recursive schema, see innererror above)
+ * }
+ * }
+ * result (Optional): {
+ * analyzerId: String (Optional)
+ * apiVersion: String (Optional)
+ * createdAt: OffsetDateTime (Optional)
+ * warnings (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * stringEncoding: String (Optional)
+ * contents (Required): [
+ * (Required){
+ * kind: String(document/audioVisual) (Required)
+ * mimeType: String (Required)
+ * analyzerId: String (Optional)
+ * category: String (Optional)
+ * path: String (Optional)
+ * markdown: String (Optional)
+ * fields (Optional): {
+ * String (Required): {
+ * type: String(string/date/time/number/integer/boolean/array/object/json) (Required)
+ * spans (Optional): [
+ * (Optional){
+ * offset: int (Required)
+ * length: int (Required)
+ * }
+ * ]
+ * confidence: Double (Optional)
+ * source: String (Optional)
+ * }
+ * }
+ * }
+ * ]
+ * }
+ * usage (Optional): {
+ * documentPagesMinimal: Integer (Optional)
+ * documentPagesBasic: Integer (Optional)
+ * documentPagesStandard: Integer (Optional)
+ * audioHours: Double (Optional)
+ * videoHours: Double (Optional)
+ * contextualizationTokens: Integer (Optional)
+ * tokens (Optional): {
+ * String: int (Required)
+ * }
+ * }
+ * }
+ * }
+ *
+ *
+ * @param operationId The unique ID of the operation.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return the result of an analysis operation along with {@link Response}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getResultWithResponse(String operationId, RequestOptions requestOptions) {
+ return this.serviceClient.getResultWithResponse(operationId, requestOptions);
+ }
+
+ /**
+ * Get a file associated with the result of an analysis operation.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * BinaryData
+ * }
+ *
+ *
+ * @param operationId Operation identifier.
+ * @param path File path.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return a file associated with the result of an analysis operation along with {@link Response}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response getResultFileWithResponse(String operationId, String path,
+ RequestOptions requestOptions) {
+ return this.serviceClient.getResultFileWithResponse(operationId, path, requestOptions);
+ }
+
+ /**
+ * Get authorization for copying this analyzer to another location.
+ * Request Body Schema
+ *
+ *
+ * {@code
+ * {
+ * targetAzureResourceId: String (Required)
+ * targetRegion: String (Optional)
+ * }
+ * }
+ *
+ *
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * source: String (Required)
+ * targetAzureResourceId: String (Required)
+ * expiresAt: OffsetDateTime (Required)
+ * }
+ * }
+ *
+ *
+ * @param analyzerId The unique identifier of the analyzer.
+ * @param grantCopyAuthorizationRequest The grantCopyAuthorizationRequest parameter.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return authorization for copying this analyzer to another location along with {@link Response}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response grantCopyAuthorizationWithResponse(String analyzerId,
+ BinaryData grantCopyAuthorizationRequest, RequestOptions requestOptions) {
+ return this.serviceClient.grantCopyAuthorizationWithResponse(analyzerId, grantCopyAuthorizationRequest,
+ requestOptions);
+ }
+
+ /**
+ * List analyzers.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * analyzerId: String (Required)
+ * description: String (Optional)
+ * tags (Optional): {
+ * String: String (Required)
+ * }
+ * status: String(creating/ready/deleting/failed) (Required)
+ * createdAt: OffsetDateTime (Required)
+ * lastModifiedAt: OffsetDateTime (Required)
+ * warnings (Optional): [
+ * (Optional){
+ * code: String (Required)
+ * message: String (Required)
+ * target: String (Optional)
+ * details (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * innererror (Optional): {
+ * code: String (Optional)
+ * innererror (Optional): (recursive schema, see innererror above)
+ * }
+ * }
+ * ]
+ * baseAnalyzerId: String (Optional)
+ * config (Optional): {
+ * returnDetails: Boolean (Optional)
+ * locales (Optional): [
+ * String (Optional)
+ * ]
+ * enableOcr: Boolean (Optional)
+ * enableLayout: Boolean (Optional)
+ * enableFigureDescription: Boolean (Optional)
+ * enableFigureAnalysis: Boolean (Optional)
+ * enableFormula: Boolean (Optional)
+ * tableFormat: String(html/markdown) (Optional)
+ * chartFormat: String(chartJs/markdown) (Optional)
+ * annotationFormat: String(none/markdown) (Optional)
+ * disableFaceBlurring: Boolean (Optional)
+ * estimateFieldSourceAndConfidence: Boolean (Optional)
+ * contentCategories (Optional): {
+ * String (Required): {
+ * description: String (Optional)
+ * analyzerId: String (Optional)
+ * analyzer (Optional): (recursive schema, see analyzer above)
+ * }
+ * }
+ * enableSegment: Boolean (Optional)
+ * segmentPerPage: Boolean (Optional)
+ * omitContent: Boolean (Optional)
+ * }
+ * fieldSchema (Optional): {
+ * name: String (Optional)
+ * description: String (Optional)
+ * fields (Optional, Required on create): {
+ * String (Required): {
+ * method: String(generate/extract/classify) (Optional)
+ * type: String(string/date/time/number/integer/boolean/array/object/json) (Optional)
+ * description: String (Optional)
+ * items (Optional): (recursive schema, see items above)
+ * properties (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * examples (Optional): [
+ * String (Optional)
+ * ]
+ * enum (Optional): [
+ * String (Optional)
+ * ]
+ * enumDescriptions (Optional): {
+ * String: String (Required)
+ * }
+ * $ref: String (Optional)
+ * estimateSourceAndConfidence: Boolean (Optional)
+ * }
+ * }
+ * definitions (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * }
+ * dynamicFieldSchema: Boolean (Optional)
+ * processingLocation: String(geography/dataZone/global) (Optional)
+ * knowledgeSources (Optional): [
+ * (Optional){
+ * kind: String(labeledData) (Required)
+ * }
+ * ]
+ * models (Optional): {
+ * String: String (Required)
+ * }
+ * supportedModels (Optional): {
+ * completion (Optional): [
+ * String (Optional)
+ * ]
+ * embedding (Optional): [
+ * String (Optional)
+ * ]
+ * }
+ * }
+ * }
+ *
+ *
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return paged collection of ContentAnalyzer items as paginated response with {@link PagedIterable}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listAnalyzers(RequestOptions requestOptions) {
+ return this.serviceClient.listAnalyzers(requestOptions);
+ }
+
+ /**
+ * Update analyzer properties.
+ * Request Body Schema
+ *
+ *
+ * {@code
+ * {
+ * analyzerId: String (Required)
+ * description: String (Optional)
+ * tags (Optional): {
+ * String: String (Required)
+ * }
+ * status: String(creating/ready/deleting/failed) (Required)
+ * createdAt: OffsetDateTime (Required)
+ * lastModifiedAt: OffsetDateTime (Required)
+ * warnings (Optional): [
+ * (Optional){
+ * code: String (Required)
+ * message: String (Required)
+ * target: String (Optional)
+ * details (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * innererror (Optional): {
+ * code: String (Optional)
+ * innererror (Optional): (recursive schema, see innererror above)
+ * }
+ * }
+ * ]
+ * baseAnalyzerId: String (Optional)
+ * config (Optional): {
+ * returnDetails: Boolean (Optional)
+ * locales (Optional): [
+ * String (Optional)
+ * ]
+ * enableOcr: Boolean (Optional)
+ * enableLayout: Boolean (Optional)
+ * enableFigureDescription: Boolean (Optional)
+ * enableFigureAnalysis: Boolean (Optional)
+ * enableFormula: Boolean (Optional)
+ * tableFormat: String(html/markdown) (Optional)
+ * chartFormat: String(chartJs/markdown) (Optional)
+ * annotationFormat: String(none/markdown) (Optional)
+ * disableFaceBlurring: Boolean (Optional)
+ * estimateFieldSourceAndConfidence: Boolean (Optional)
+ * contentCategories (Optional): {
+ * String (Required): {
+ * description: String (Optional)
+ * analyzerId: String (Optional)
+ * analyzer (Optional): (recursive schema, see analyzer above)
+ * }
+ * }
+ * enableSegment: Boolean (Optional)
+ * segmentPerPage: Boolean (Optional)
+ * omitContent: Boolean (Optional)
+ * }
+ * fieldSchema (Optional): {
+ * name: String (Optional)
+ * description: String (Optional)
+ * fields (Optional, Required on create): {
+ * String (Required): {
+ * method: String(generate/extract/classify) (Optional)
+ * type: String(string/date/time/number/integer/boolean/array/object/json) (Optional)
+ * description: String (Optional)
+ * items (Optional): (recursive schema, see items above)
+ * properties (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * examples (Optional): [
+ * String (Optional)
+ * ]
+ * enum (Optional): [
+ * String (Optional)
+ * ]
+ * enumDescriptions (Optional): {
+ * String: String (Required)
+ * }
+ * $ref: String (Optional)
+ * estimateSourceAndConfidence: Boolean (Optional)
+ * }
+ * }
+ * definitions (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * }
+ * dynamicFieldSchema: Boolean (Optional)
+ * processingLocation: String(geography/dataZone/global) (Optional)
+ * knowledgeSources (Optional): [
+ * (Optional){
+ * kind: String(labeledData) (Required)
+ * }
+ * ]
+ * models (Optional): {
+ * String: String (Required)
+ * }
+ * supportedModels (Optional): {
+ * completion (Optional): [
+ * String (Optional)
+ * ]
+ * embedding (Optional): [
+ * String (Optional)
+ * ]
+ * }
+ * }
+ * }
+ *
+ *
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * analyzerId: String (Required)
+ * description: String (Optional)
+ * tags (Optional): {
+ * String: String (Required)
+ * }
+ * status: String(creating/ready/deleting/failed) (Required)
+ * createdAt: OffsetDateTime (Required)
+ * lastModifiedAt: OffsetDateTime (Required)
+ * warnings (Optional): [
+ * (Optional){
+ * code: String (Required)
+ * message: String (Required)
+ * target: String (Optional)
+ * details (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * innererror (Optional): {
+ * code: String (Optional)
+ * innererror (Optional): (recursive schema, see innererror above)
+ * }
+ * }
+ * ]
+ * baseAnalyzerId: String (Optional)
+ * config (Optional): {
+ * returnDetails: Boolean (Optional)
+ * locales (Optional): [
+ * String (Optional)
+ * ]
+ * enableOcr: Boolean (Optional)
+ * enableLayout: Boolean (Optional)
+ * enableFigureDescription: Boolean (Optional)
+ * enableFigureAnalysis: Boolean (Optional)
+ * enableFormula: Boolean (Optional)
+ * tableFormat: String(html/markdown) (Optional)
+ * chartFormat: String(chartJs/markdown) (Optional)
+ * annotationFormat: String(none/markdown) (Optional)
+ * disableFaceBlurring: Boolean (Optional)
+ * estimateFieldSourceAndConfidence: Boolean (Optional)
+ * contentCategories (Optional): {
+ * String (Required): {
+ * description: String (Optional)
+ * analyzerId: String (Optional)
+ * analyzer (Optional): (recursive schema, see analyzer above)
+ * }
+ * }
+ * enableSegment: Boolean (Optional)
+ * segmentPerPage: Boolean (Optional)
+ * omitContent: Boolean (Optional)
+ * }
+ * fieldSchema (Optional): {
+ * name: String (Optional)
+ * description: String (Optional)
+ * fields (Optional, Required on create): {
+ * String (Required): {
+ * method: String(generate/extract/classify) (Optional)
+ * type: String(string/date/time/number/integer/boolean/array/object/json) (Optional)
+ * description: String (Optional)
+ * items (Optional): (recursive schema, see items above)
+ * properties (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * examples (Optional): [
+ * String (Optional)
+ * ]
+ * enum (Optional): [
+ * String (Optional)
+ * ]
+ * enumDescriptions (Optional): {
+ * String: String (Required)
+ * }
+ * $ref: String (Optional)
+ * estimateSourceAndConfidence: Boolean (Optional)
+ * }
+ * }
+ * definitions (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * }
+ * dynamicFieldSchema: Boolean (Optional)
+ * processingLocation: String(geography/dataZone/global) (Optional)
+ * knowledgeSources (Optional): [
+ * (Optional){
+ * kind: String(labeledData) (Required)
+ * }
+ * ]
+ * models (Optional): {
+ * String: String (Required)
+ * }
+ * supportedModels (Optional): {
+ * completion (Optional): [
+ * String (Optional)
+ * ]
+ * embedding (Optional): [
+ * String (Optional)
+ * ]
+ * }
+ * }
+ * }
+ *
+ *
+ * @param analyzerId The unique identifier of the analyzer.
+ * @param resource The resource instance.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return analyzer that extracts content and fields from multimodal documents along with {@link Response}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response updateAnalyzerWithResponse(String analyzerId, BinaryData resource,
+ RequestOptions requestOptions) {
+ return this.serviceClient.updateAnalyzerWithResponse(analyzerId, resource, requestOptions);
+ }
+
+ /**
+ * Update default settings for this Content Understanding resource.
+ * Request Body Schema
+ *
+ *
+ * {@code
+ * {
+ * modelDeployments (Optional): {
+ * (Optional): {
+ * String: String (Required)
+ * }
+ * }
+ * }
+ * }
+ *
+ *
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * modelDeployments (Required): {
+ * String: String (Required)
+ * }
+ * }
+ * }
+ *
+ *
+ * @param updateDefaultsRequest The updateDefaultsRequest parameter.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return default settings for this Content Understanding resource along with {@link Response}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response updateDefaultsWithResponse(BinaryData updateDefaultsRequest,
+ RequestOptions requestOptions) {
+ return this.serviceClient.updateDefaultsWithResponse(updateDefaultsRequest, requestOptions);
+ }
+
+ /**
+ * Extract content and fields from input.
+ *
+ * @param analyzerId The unique identifier of the analyzer.
+ * @param inputs Inputs to analyze. Currently, only pro mode supports multiple inputs.
+ * @param stringEncoding The string encoding format for content spans in the response.
+ * Possible values are 'codePoint', 'utf16', and `utf8`. Default is `codePoint`.").
+ * @param modelDeployments Specify the default mapping of model names to LLM/embedding deployments in Microsoft
+ * Foundry. For details and current semantics, see https://aka.ms/cudoc-quickstart-rest.
+ * @param processingLocation The location where the data may be processed. Defaults to global.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of provides status details for analyze operations.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller beginAnalyze(String analyzerId,
+ List inputs, String stringEncoding, Map modelDeployments,
+ ProcessingLocation processingLocation) {
+ // Generated convenience method for beginAnalyzeWithModel
+ RequestOptions requestOptions = new RequestOptions();
+ AnalyzeRequest1 analyzeRequest1Obj = new AnalyzeRequest1(inputs).setModelDeployments(modelDeployments);
+ BinaryData analyzeRequest1 = BinaryData.fromObject(analyzeRequest1Obj);
+ requestOptions.addQueryParam("stringEncoding", stringEncoding, false);
+ if (processingLocation != null) {
+ requestOptions.addQueryParam("processingLocation", processingLocation.toString(), false);
+ }
+ return serviceClient.beginAnalyzeWithModel(analyzerId, analyzeRequest1, requestOptions);
+ }
+
+ /**
+ * Extract content and fields from input.
+ *
+ * @param analyzerId The unique identifier of the analyzer.
+ * @param inputs Inputs to analyze. Currently, only pro mode supports multiple inputs.
+ * @param stringEncoding The string encoding format for content spans in the response.
+ * Possible values are 'codePoint', 'utf16', and `utf8`. Default is `codePoint`.").
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of provides status details for analyze operations.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller beginAnalyze(String analyzerId,
+ List inputs, String stringEncoding) {
+ // Generated convenience method for beginAnalyzeWithModel
+ RequestOptions requestOptions = new RequestOptions();
+ AnalyzeRequest1 analyzeRequest1Obj = new AnalyzeRequest1(inputs);
+ BinaryData analyzeRequest1 = BinaryData.fromObject(analyzeRequest1Obj);
+ requestOptions.addQueryParam("stringEncoding", stringEncoding, false);
+ return serviceClient.beginAnalyzeWithModel(analyzerId, analyzeRequest1, requestOptions);
+ }
+
+ /**
+ * Extract content and fields from input.
+ *
+ * @param analyzerId The unique identifier of the analyzer.
+ * @param binaryInput The binary content of the document to analyze.
+ * @param stringEncoding The string encoding format for content spans in the response.
+ * Possible values are 'codePoint', 'utf16', and `utf8`. Default is `codePoint`.").
+ * @param contentType Request content type.
+ * @param contentRange Range of the input to analyze (ex. `1-3,5,9-`). Document content uses 1-based page numbers,
+ * while audio visual content uses integer milliseconds.
+ * @param processingLocation The location where the data may be processed. Defaults to global.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of provides status details for analyze operations.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller beginAnalyzeBinary(String analyzerId,
+ BinaryData binaryInput, String stringEncoding, String contentType, String contentRange,
+ ProcessingLocation processingLocation) {
+ // Generated convenience method for beginAnalyzeBinaryWithModel
+ RequestOptions requestOptions = new RequestOptions();
+ requestOptions.addQueryParam("stringEncoding", stringEncoding, false);
+ if (contentRange != null) {
+ requestOptions.addQueryParam("range", contentRange, false);
+ }
+ if (processingLocation != null) {
+ requestOptions.addQueryParam("processingLocation", processingLocation.toString(), false);
+ }
+ return serviceClient.beginAnalyzeBinaryWithModel(analyzerId, contentType, binaryInput, requestOptions);
+ }
+
+ /**
+ * Extract content and fields from input.
+ *
+ * @param analyzerId The unique identifier of the analyzer.
+ * @param binaryInput The binary content of the document to analyze.
+ * @param stringEncoding The string encoding format for content spans in the response.
+ * Possible values are 'codePoint', 'utf16', and `utf8`. Default is `codePoint`.").
+ * @param contentType Request content type.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of provides status details for analyze operations.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller beginAnalyzeBinary(String analyzerId,
+ BinaryData binaryInput, String stringEncoding, String contentType) {
+ // Generated convenience method for beginAnalyzeBinaryWithModel
+ RequestOptions requestOptions = new RequestOptions();
+ requestOptions.addQueryParam("stringEncoding", stringEncoding, false);
+ return serviceClient.beginAnalyzeBinaryWithModel(analyzerId, contentType, binaryInput, requestOptions);
+ }
+
+ /**
+ * Create a copy of the source analyzer to the current location.
+ *
+ * @param analyzerId The unique identifier of the analyzer.
+ * @param sourceAnalyzerId Source analyzer ID.
+ * @param allowReplace Allow the operation to replace an existing resource.
+ * @param sourceAzureResourceId Azure resource ID of the source analyzer location. Defaults to the current resource.
+ * @param sourceRegion Azure region of the source analyzer location. Defaults to current region.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of analyzer that extracts content and fields from multimodal
+ * documents.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller beginCopyAnalyzer(String analyzerId,
+ String sourceAnalyzerId, Boolean allowReplace, String sourceAzureResourceId, String sourceRegion) {
+ // Generated convenience method for beginCopyAnalyzerWithModel
+ RequestOptions requestOptions = new RequestOptions();
+ CopyAnalyzerRequest copyAnalyzerRequestObj
+ = new CopyAnalyzerRequest(sourceAnalyzerId).setSourceAzureResourceId(sourceAzureResourceId)
+ .setSourceRegion(sourceRegion);
+ BinaryData copyAnalyzerRequest = BinaryData.fromObject(copyAnalyzerRequestObj);
+ if (allowReplace != null) {
+ requestOptions.addQueryParam("allowReplace", String.valueOf(allowReplace), false);
+ }
+ return serviceClient.beginCopyAnalyzerWithModel(analyzerId, copyAnalyzerRequest, requestOptions);
+ }
+
+ /**
+ * Create a copy of the source analyzer to the current location.
+ *
+ * @param analyzerId The unique identifier of the analyzer.
+ * @param sourceAnalyzerId Source analyzer ID.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of analyzer that extracts content and fields from multimodal
+ * documents.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller beginCopyAnalyzer(String analyzerId,
+ String sourceAnalyzerId) {
+ // Generated convenience method for beginCopyAnalyzerWithModel
+ RequestOptions requestOptions = new RequestOptions();
+ CopyAnalyzerRequest copyAnalyzerRequestObj = new CopyAnalyzerRequest(sourceAnalyzerId);
+ BinaryData copyAnalyzerRequest = BinaryData.fromObject(copyAnalyzerRequestObj);
+ return serviceClient.beginCopyAnalyzerWithModel(analyzerId, copyAnalyzerRequest, requestOptions);
+ }
+
+ /**
+ * Create a new analyzer asynchronously.
+ *
+ * @param analyzerId The unique identifier of the analyzer.
+ * @param resource The resource instance.
+ * @param allowReplace Allow the operation to replace an existing resource.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of analyzer that extracts content and fields from multimodal
+ * documents.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller beginCreateAnalyzer(String analyzerId,
+ ContentAnalyzer resource, Boolean allowReplace) {
+ // Generated convenience method for beginCreateAnalyzerWithModel
+ RequestOptions requestOptions = new RequestOptions();
+ if (allowReplace != null) {
+ requestOptions.addQueryParam("allowReplace", String.valueOf(allowReplace), false);
+ }
+ return serviceClient.beginCreateAnalyzerWithModel(analyzerId, BinaryData.fromObject(resource), requestOptions);
+ }
+
+ /**
+ * Create a new analyzer asynchronously.
+ *
+ * @param analyzerId The unique identifier of the analyzer.
+ * @param resource The resource instance.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of analyzer that extracts content and fields from multimodal
+ * documents.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller beginCreateAnalyzer(String analyzerId,
+ ContentAnalyzer resource) {
+ // Generated convenience method for beginCreateAnalyzerWithModel
+ RequestOptions requestOptions = new RequestOptions();
+ return serviceClient.beginCreateAnalyzerWithModel(analyzerId, BinaryData.fromObject(resource), requestOptions);
+ }
+
+ /**
+ * Delete analyzer.
+ *
+ * @param analyzerId The unique identifier of the analyzer.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public void deleteAnalyzer(String analyzerId) {
+ // Generated convenience method for deleteAnalyzerWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ deleteAnalyzerWithResponse(analyzerId, requestOptions).getValue();
+ }
+
+ /**
+ * Mark the result of an analysis operation for deletion.
+ *
+ * @param operationId Operation identifier.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public void deleteResult(String operationId) {
+ // Generated convenience method for deleteResultWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ deleteResultWithResponse(operationId, requestOptions).getValue();
+ }
+
+ /**
+ * Get analyzer properties.
+ *
+ * @param analyzerId The unique identifier of the analyzer.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return analyzer properties.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public ContentAnalyzer getAnalyzer(String analyzerId) {
+ // Generated convenience method for getAnalyzerWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ return getAnalyzerWithResponse(analyzerId, requestOptions).getValue().toObject(ContentAnalyzer.class);
+ }
+
+ /**
+ * Return default settings for this Content Understanding resource.
+ *
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return default settings for this Content Understanding resource.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public ContentUnderstandingDefaults getDefaults() {
+ // Generated convenience method for getDefaultsWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ return getDefaultsWithResponse(requestOptions).getValue().toObject(ContentUnderstandingDefaults.class);
+ }
+
+ /**
+ * Get the status of an analyzer creation operation.
+ *
+ * @param analyzerId The unique identifier of the analyzer.
+ * @param operationId The unique ID of the operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the status of an analyzer creation operation.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ ContentAnalyzerOperationStatus getOperationStatus(String analyzerId, String operationId) {
+ // Generated convenience method for getOperationStatusWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ return getOperationStatusWithResponse(analyzerId, operationId, requestOptions).getValue()
+ .toObject(ContentAnalyzerOperationStatus.class);
+ }
+
+ /**
+ * Get the result of an analysis operation.
+ *
+ * @param operationId The unique ID of the operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the result of an analysis operation.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ ContentAnalyzerAnalyzeOperationStatus getResult(String operationId) {
+ // Generated convenience method for getResultWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ return getResultWithResponse(operationId, requestOptions).getValue()
+ .toObject(ContentAnalyzerAnalyzeOperationStatus.class);
+ }
+
+ /**
+ * Get a file associated with the result of an analysis operation.
+ *
+ * @param operationId Operation identifier.
+ * @param path File path.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a file associated with the result of an analysis operation.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public BinaryData getResultFile(String operationId, String path) {
+ // Generated convenience method for getResultFileWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ return getResultFileWithResponse(operationId, path, requestOptions).getValue();
+ }
+
+ /**
+ * Get authorization for copying this analyzer to another location.
+ *
+ * @param analyzerId The unique identifier of the analyzer.
+ * @param targetAzureResourceId Azure resource ID of the target analyzer location.
+ * @param targetRegion Azure region of the target analyzer location. Defaults to current region.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return authorization for copying this analyzer to another location.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public CopyAuthorization grantCopyAuthorization(String analyzerId, String targetAzureResourceId,
+ String targetRegion) {
+ // Generated convenience method for grantCopyAuthorizationWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ GrantCopyAuthorizationRequest1 grantCopyAuthorizationRequest1Obj
+ = new GrantCopyAuthorizationRequest1(targetAzureResourceId).setTargetRegion(targetRegion);
+ BinaryData grantCopyAuthorizationRequest1 = BinaryData.fromObject(grantCopyAuthorizationRequest1Obj);
+ return grantCopyAuthorizationWithResponse(analyzerId, grantCopyAuthorizationRequest1, requestOptions).getValue()
+ .toObject(CopyAuthorization.class);
+ }
+
+ /**
+ * Get authorization for copying this analyzer to another location.
+ *
+ * @param analyzerId The unique identifier of the analyzer.
+ * @param targetAzureResourceId Azure resource ID of the target analyzer location.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return authorization for copying this analyzer to another location.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public CopyAuthorization grantCopyAuthorization(String analyzerId, String targetAzureResourceId) {
+ // Generated convenience method for grantCopyAuthorizationWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ GrantCopyAuthorizationRequest1 grantCopyAuthorizationRequest1Obj
+ = new GrantCopyAuthorizationRequest1(targetAzureResourceId);
+ BinaryData grantCopyAuthorizationRequest1 = BinaryData.fromObject(grantCopyAuthorizationRequest1Obj);
+ return grantCopyAuthorizationWithResponse(analyzerId, grantCopyAuthorizationRequest1, requestOptions).getValue()
+ .toObject(CopyAuthorization.class);
+ }
+
+ /**
+ * List analyzers.
+ *
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return paged collection of ContentAnalyzer items as paginated response with {@link PagedIterable}.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listAnalyzers() {
+ // Generated convenience method for listAnalyzers
+ RequestOptions requestOptions = new RequestOptions();
+ return serviceClient.listAnalyzers(requestOptions)
+ .mapPage(bodyItemValue -> bodyItemValue.toObject(ContentAnalyzer.class));
+ }
+
+ /**
+ * Update analyzer properties.
+ *
+ * @param analyzerId The unique identifier of the analyzer.
+ * @param resource The resource instance.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return analyzer that extracts content and fields from multimodal documents.
+ */
+ @Generated
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public ContentAnalyzer updateAnalyzer(String analyzerId, ContentAnalyzer resource) {
+ // Generated convenience method for updateAnalyzerWithResponse
+ RequestOptions requestOptions = new RequestOptions();
+ JsonMergePatchHelper.getContentAnalyzerAccessor().prepareModelForJsonMergePatch(resource, true);
+ BinaryData resourceInBinaryData = BinaryData.fromObject(resource);
+ // BinaryData.fromObject() will not fire serialization, use getLength() to fire serialization.
+ resourceInBinaryData.getLength();
+ JsonMergePatchHelper.getContentAnalyzerAccessor().prepareModelForJsonMergePatch(resource, false);
+ return updateAnalyzerWithResponse(analyzerId, resourceInBinaryData, requestOptions).getValue()
+ .toObject(ContentAnalyzer.class);
+ }
+
+ /**
+ * Update default model deployment settings.
+ *
+ * This is the recommended public API for updating default model deployment settings. This method provides a simpler
+ * API that accepts a Map of model names to deployment names.
+ *
+ * @param modelDeployments Mapping of model names to deployment names. For example: { "gpt-4.1":
+ * "myGpt41Deployment", "text-embedding-3-large": "myTextEmbedding3LargeDeployment" }.
+ * @return the updated ContentUnderstandingDefaults.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public ContentUnderstandingDefaults updateDefaults(Map modelDeployments) {
+ ContentUnderstandingDefaults defaults = new ContentUnderstandingDefaults(modelDeployments);
+ Response response = updateDefaultsWithResponse(BinaryData.fromObject(defaults), null);
+ return response.getValue().toObject(ContentUnderstandingDefaults.class);
+ }
+
+ /**
+ * Update default model deployment settings.
+ *
+ * This is a convenience method that accepts a ContentUnderstandingDefaults object.
+ *
+ * @param defaults The ContentUnderstandingDefaults instance with settings to update.
+ * @return the updated ContentUnderstandingDefaults.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public ContentUnderstandingDefaults updateDefaults(ContentUnderstandingDefaults defaults) {
+ Response response = updateDefaultsWithResponse(BinaryData.fromObject(defaults), null);
+ return response.getValue().toObject(ContentUnderstandingDefaults.class);
+ }
+
+ /**
+ * Extract content and fields from binary input. Uses default content type (application/octet-stream), default
+ * string encoding (utf16), and service default processing location.
+ *
+ * @param analyzerId The unique identifier of the analyzer.
+ * @param binaryInput The binary content of the document to analyze.
+ * @return the {@link SyncPoller} for polling of the analyze operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller beginAnalyzeBinary(String analyzerId,
+ BinaryData binaryInput) {
+ return beginAnalyzeBinary(analyzerId, binaryInput, (ContentRange) null, "application/octet-stream", null);
+ }
+
+ /**
+ * Extract content and fields from binary input. Uses default string encoding (utf16).
+ *
+ * Use factory methods such as {@link ContentRange#pages(int, int)}, {@link ContentRange#timeRange(long, long)}, or
+ * {@link ContentRange#combine(ContentRange...)} to build the range.
+ *
+ * @param analyzerId The unique identifier of the analyzer.
+ * @param binaryInput The binary content of the document to analyze.
+ * @param contentRange Range of the input to analyze. Use ContentRange factory methods to build the range, or null
+ * to skip.
+ * @param contentType Request content type.
+ * @param processingLocation The location where the data may be processed. Set to null for service default.
+ * @return the {@link SyncPoller} for polling of the analyze operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller beginAnalyzeBinary(String analyzerId,
+ BinaryData binaryInput, ContentRange contentRange, String contentType, ProcessingLocation processingLocation) {
+ RequestOptions requestOptions = new RequestOptions();
+ if (contentRange != null) {
+ requestOptions.addQueryParam("range", contentRange.toString(), false);
+ }
+ if (processingLocation != null) {
+ requestOptions.addQueryParam("processingLocation", processingLocation.toString(), false);
+ }
+ requestOptions.addQueryParam("stringEncoding", "utf16", false);
+ return serviceClient.beginAnalyzeBinaryWithModel(analyzerId, contentType, binaryInput, requestOptions)
+ .setPollInterval(Duration.ofSeconds(3));
+ }
+
+ /**
+ * Extract content and fields from inputs. Uses default string encoding (utf16), service default model deployments,
+ * and global processing location.
+ *
+ * @param analyzerId The unique identifier of the analyzer.
+ * @param inputs The inputs to analyze.
+ * @return the {@link SyncPoller} for polling of the analyze operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller beginAnalyze(String analyzerId,
+ List inputs) {
+ return beginAnalyze(analyzerId, inputs, null, null);
+ }
+
+ /**
+ * Extract content and fields from inputs. Uses default string encoding (utf16).
+ *
+ * @param analyzerId The unique identifier of the analyzer.
+ * @param inputs The inputs to analyze.
+ * @param modelDeployments Custom model deployment mappings. Set to null to use service defaults.
+ * @param processingLocation The processing location for the analysis. Set to null to use the service default.
+ * @return the {@link SyncPoller} for polling of the analyze operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller beginAnalyze(String analyzerId,
+ List inputs, Map modelDeployments, ProcessingLocation processingLocation) {
+ RequestOptions requestOptions = new RequestOptions();
+ if (processingLocation != null) {
+ requestOptions.addQueryParam("processingLocation", processingLocation.toString(), false);
+ }
+ requestOptions.addQueryParam("stringEncoding", "utf16", false);
+ AnalyzeRequest1 analyzeRequest1Obj = new AnalyzeRequest1(inputs).setModelDeployments(modelDeployments);
+ BinaryData analyzeRequest1 = BinaryData.fromObject(analyzeRequest1Obj);
+ return serviceClient.beginAnalyzeWithModel(analyzerId, analyzeRequest1, requestOptions)
+ .setPollInterval(Duration.ofSeconds(3));
+ }
+}
diff --git a/sdk/contentunderstanding/azure-ai-contentunderstanding/src/main/java/com/azure/ai/contentunderstanding/ContentUnderstandingClientBuilder.java b/sdk/contentunderstanding/azure-ai-contentunderstanding/src/main/java/com/azure/ai/contentunderstanding/ContentUnderstandingClientBuilder.java
new file mode 100644
index 000000000000..ba2679ff465c
--- /dev/null
+++ b/sdk/contentunderstanding/azure-ai-contentunderstanding/src/main/java/com/azure/ai/contentunderstanding/ContentUnderstandingClientBuilder.java
@@ -0,0 +1,356 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.ai.contentunderstanding;
+
+import com.azure.ai.contentunderstanding.implementation.ContentUnderstandingClientImpl;
+import com.azure.core.annotation.Generated;
+import com.azure.core.annotation.ServiceClientBuilder;
+import com.azure.core.client.traits.ConfigurationTrait;
+import com.azure.core.client.traits.EndpointTrait;
+import com.azure.core.client.traits.HttpTrait;
+import com.azure.core.client.traits.KeyCredentialTrait;
+import com.azure.core.client.traits.TokenCredentialTrait;
+import com.azure.core.credential.KeyCredential;
+import com.azure.core.credential.TokenCredential;
+import com.azure.core.http.HttpClient;
+import com.azure.core.http.HttpHeaders;
+import com.azure.core.http.HttpPipeline;
+import com.azure.core.http.HttpPipelineBuilder;
+import com.azure.core.http.HttpPipelinePosition;
+import com.azure.core.http.policy.AddDatePolicy;
+import com.azure.core.http.policy.AddHeadersFromContextPolicy;
+import com.azure.core.http.policy.AddHeadersPolicy;
+import com.azure.core.http.policy.BearerTokenAuthenticationPolicy;
+import com.azure.core.http.policy.HttpLogOptions;
+import com.azure.core.http.policy.HttpLoggingPolicy;
+import com.azure.core.http.policy.HttpPipelinePolicy;
+import com.azure.core.http.policy.HttpPolicyProviders;
+import com.azure.core.http.policy.KeyCredentialPolicy;
+import com.azure.core.http.policy.RequestIdPolicy;
+import com.azure.core.http.policy.RetryOptions;
+import com.azure.core.http.policy.RetryPolicy;
+import com.azure.core.http.policy.UserAgentPolicy;
+import com.azure.core.util.ClientOptions;
+import com.azure.core.util.Configuration;
+import com.azure.core.util.CoreUtils;
+import com.azure.core.util.builder.ClientBuilderUtil;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.core.util.serializer.JacksonAdapter;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+
+/**
+ * A builder for creating a new instance of the ContentUnderstandingClient type.
+ */
+@ServiceClientBuilder(serviceClients = { ContentUnderstandingClient.class, ContentUnderstandingAsyncClient.class })
+public final class ContentUnderstandingClientBuilder implements HttpTrait,
+ ConfigurationTrait, TokenCredentialTrait,
+ KeyCredentialTrait, EndpointTrait {
+ @Generated
+ private static final String SDK_NAME = "name";
+
+ @Generated
+ private static final String SDK_VERSION = "version";
+
+ @Generated
+ private static final String[] DEFAULT_SCOPES = new String[] { "https://cognitiveservices.azure.com/.default" };
+
+ @Generated
+ private static final Map PROPERTIES
+ = CoreUtils.getProperties("azure-ai-contentunderstanding.properties");
+
+ @Generated
+ private final List pipelinePolicies;
+
+ /**
+ * Create an instance of the ContentUnderstandingClientBuilder.
+ */
+ @Generated
+ public ContentUnderstandingClientBuilder() {
+ this.pipelinePolicies = new ArrayList<>();
+ }
+
+ /*
+ * The HTTP client used to send the request.
+ */
+ @Generated
+ private HttpClient httpClient;
+
+ /**
+ * {@inheritDoc}.
+ */
+ @Generated
+ @Override
+ public ContentUnderstandingClientBuilder httpClient(HttpClient httpClient) {
+ this.httpClient = httpClient;
+ return this;
+ }
+
+ /*
+ * The HTTP pipeline to send requests through.
+ */
+ @Generated
+ private HttpPipeline pipeline;
+
+ /**
+ * {@inheritDoc}.
+ */
+ @Generated
+ @Override
+ public ContentUnderstandingClientBuilder pipeline(HttpPipeline pipeline) {
+ if (this.pipeline != null && pipeline == null) {
+ LOGGER.atInfo().log("HttpPipeline is being set to 'null' when it was previously configured.");
+ }
+ this.pipeline = pipeline;
+ return this;
+ }
+
+ /*
+ * The logging configuration for HTTP requests and responses.
+ */
+ @Generated
+ private HttpLogOptions httpLogOptions;
+
+ /**
+ * {@inheritDoc}.
+ */
+ @Generated
+ @Override
+ public ContentUnderstandingClientBuilder httpLogOptions(HttpLogOptions httpLogOptions) {
+ this.httpLogOptions = httpLogOptions;
+ return this;
+ }
+
+ /*
+ * The client options such as application ID and custom headers to set on a request.
+ */
+ @Generated
+ private ClientOptions clientOptions;
+
+ /**
+ * {@inheritDoc}.
+ */
+ @Generated
+ @Override
+ public ContentUnderstandingClientBuilder clientOptions(ClientOptions clientOptions) {
+ this.clientOptions = clientOptions;
+ return this;
+ }
+
+ /*
+ * The retry options to configure retry policy for failed requests.
+ */
+ @Generated
+ private RetryOptions retryOptions;
+
+ /**
+ * {@inheritDoc}.
+ */
+ @Generated
+ @Override
+ public ContentUnderstandingClientBuilder retryOptions(RetryOptions retryOptions) {
+ this.retryOptions = retryOptions;
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}.
+ */
+ @Generated
+ @Override
+ public ContentUnderstandingClientBuilder addPolicy(HttpPipelinePolicy customPolicy) {
+ Objects.requireNonNull(customPolicy, "'customPolicy' cannot be null.");
+ pipelinePolicies.add(customPolicy);
+ return this;
+ }
+
+ /*
+ * The configuration store that is used during construction of the service client.
+ */
+ @Generated
+ private Configuration configuration;
+
+ /**
+ * {@inheritDoc}.
+ */
+ @Generated
+ @Override
+ public ContentUnderstandingClientBuilder configuration(Configuration configuration) {
+ this.configuration = configuration;
+ return this;
+ }
+
+ /*
+ * The TokenCredential used for authentication.
+ */
+ @Generated
+ private TokenCredential tokenCredential;
+
+ /**
+ * {@inheritDoc}.
+ */
+ @Generated
+ @Override
+ public ContentUnderstandingClientBuilder credential(TokenCredential tokenCredential) {
+ this.tokenCredential = tokenCredential;
+ return this;
+ }
+
+ /*
+ * The KeyCredential used for authentication.
+ */
+ @Generated
+ private KeyCredential keyCredential;
+
+ /**
+ * {@inheritDoc}.
+ */
+ @Generated
+ @Override
+ public ContentUnderstandingClientBuilder credential(KeyCredential keyCredential) {
+ this.keyCredential = keyCredential;
+ return this;
+ }
+
+ /*
+ * The service endpoint
+ */
+ @Generated
+ private String endpoint;
+
+ /**
+ * {@inheritDoc}.
+ */
+ @Generated
+ @Override
+ public ContentUnderstandingClientBuilder endpoint(String endpoint) {
+ this.endpoint = endpoint;
+ return this;
+ }
+
+ /*
+ * Service version
+ */
+ @Generated
+ private ContentUnderstandingServiceVersion serviceVersion;
+
+ /**
+ * Sets Service version.
+ *
+ * @param serviceVersion the serviceVersion value.
+ * @return the ContentUnderstandingClientBuilder.
+ */
+ @Generated
+ public ContentUnderstandingClientBuilder serviceVersion(ContentUnderstandingServiceVersion serviceVersion) {
+ this.serviceVersion = serviceVersion;
+ return this;
+ }
+
+ /*
+ * The retry policy that will attempt to retry failed requests, if applicable.
+ */
+ @Generated
+ private RetryPolicy retryPolicy;
+
+ /**
+ * Sets The retry policy that will attempt to retry failed requests, if applicable.
+ *
+ * @param retryPolicy the retryPolicy value.
+ * @return the ContentUnderstandingClientBuilder.
+ */
+ @Generated
+ public ContentUnderstandingClientBuilder retryPolicy(RetryPolicy retryPolicy) {
+ this.retryPolicy = retryPolicy;
+ return this;
+ }
+
+ /**
+ * Builds an instance of ContentUnderstandingClientImpl with the provided parameters.
+ *
+ * @return an instance of ContentUnderstandingClientImpl.
+ */
+ @Generated
+ private ContentUnderstandingClientImpl buildInnerClient() {
+ this.validateClient();
+ HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline();
+ ContentUnderstandingServiceVersion localServiceVersion
+ = (serviceVersion != null) ? serviceVersion : ContentUnderstandingServiceVersion.getLatest();
+ ContentUnderstandingClientImpl client = new ContentUnderstandingClientImpl(localPipeline,
+ JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint, localServiceVersion);
+ return client;
+ }
+
+ @Generated
+ private void validateClient() {
+ // This method is invoked from 'buildInnerClient'/'buildClient' method.
+ // Developer can customize this method, to validate that the necessary conditions are met for the new client.
+ Objects.requireNonNull(endpoint, "'endpoint' cannot be null.");
+ }
+
+ @Generated
+ private HttpPipeline createHttpPipeline() {
+ Configuration buildConfiguration
+ = (configuration == null) ? Configuration.getGlobalConfiguration() : configuration;
+ HttpLogOptions localHttpLogOptions = this.httpLogOptions == null ? new HttpLogOptions() : this.httpLogOptions;
+ ClientOptions localClientOptions = this.clientOptions == null ? new ClientOptions() : this.clientOptions;
+ List policies = new ArrayList<>();
+ String clientName = PROPERTIES.getOrDefault(SDK_NAME, "UnknownName");
+ String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion");
+ String applicationId = CoreUtils.getApplicationId(localClientOptions, localHttpLogOptions);
+ policies.add(new UserAgentPolicy(applicationId, clientName, clientVersion, buildConfiguration));
+ policies.add(new RequestIdPolicy());
+ policies.add(new AddHeadersFromContextPolicy());
+ HttpHeaders headers = CoreUtils.createHttpHeadersFromClientOptions(localClientOptions);
+ if (headers != null) {
+ policies.add(new AddHeadersPolicy(headers));
+ }
+ this.pipelinePolicies.stream()
+ .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL)
+ .forEach(p -> policies.add(p));
+ HttpPolicyProviders.addBeforeRetryPolicies(policies);
+ policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions, new RetryPolicy()));
+ policies.add(new AddDatePolicy());
+ if (keyCredential != null) {
+ policies.add(new KeyCredentialPolicy("Ocp-Apim-Subscription-Key", keyCredential));
+ }
+ if (tokenCredential != null) {
+ policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, DEFAULT_SCOPES));
+ }
+ this.pipelinePolicies.stream()
+ .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY)
+ .forEach(p -> policies.add(p));
+ HttpPolicyProviders.addAfterRetryPolicies(policies);
+ policies.add(new HttpLoggingPolicy(localHttpLogOptions));
+ HttpPipeline httpPipeline = new HttpPipelineBuilder().policies(policies.toArray(new HttpPipelinePolicy[0]))
+ .httpClient(httpClient)
+ .clientOptions(localClientOptions)
+ .build();
+ return httpPipeline;
+ }
+
+ /**
+ * Builds an instance of ContentUnderstandingAsyncClient class.
+ *
+ * @return an instance of ContentUnderstandingAsyncClient.
+ */
+ @Generated
+ public ContentUnderstandingAsyncClient buildAsyncClient() {
+ return new ContentUnderstandingAsyncClient(buildInnerClient());
+ }
+
+ /**
+ * Builds an instance of ContentUnderstandingClient class.
+ *
+ * @return an instance of ContentUnderstandingClient.
+ */
+ @Generated
+ public ContentUnderstandingClient buildClient() {
+ return new ContentUnderstandingClient(buildInnerClient());
+ }
+
+ private static final ClientLogger LOGGER = new ClientLogger(ContentUnderstandingClientBuilder.class);
+}
diff --git a/sdk/contentunderstanding/azure-ai-contentunderstanding/src/main/java/com/azure/ai/contentunderstanding/ContentUnderstandingServiceVersion.java b/sdk/contentunderstanding/azure-ai-contentunderstanding/src/main/java/com/azure/ai/contentunderstanding/ContentUnderstandingServiceVersion.java
new file mode 100644
index 000000000000..5020caf9beb7
--- /dev/null
+++ b/sdk/contentunderstanding/azure-ai-contentunderstanding/src/main/java/com/azure/ai/contentunderstanding/ContentUnderstandingServiceVersion.java
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.ai.contentunderstanding;
+
+import com.azure.core.util.ServiceVersion;
+
+/**
+ * Service version of ContentUnderstandingClient.
+ */
+public enum ContentUnderstandingServiceVersion implements ServiceVersion {
+ /**
+ * Enum value 2025-11-01.
+ */
+ V2025_11_01("2025-11-01");
+
+ private final String version;
+
+ ContentUnderstandingServiceVersion(String version) {
+ this.version = version;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public String getVersion() {
+ return this.version;
+ }
+
+ /**
+ * Gets the latest service version supported by this client library.
+ *
+ * @return The latest {@link ContentUnderstandingServiceVersion}.
+ */
+ public static ContentUnderstandingServiceVersion getLatest() {
+ return V2025_11_01;
+ }
+}
diff --git a/sdk/contentunderstanding/azure-ai-contentunderstanding/src/main/java/com/azure/ai/contentunderstanding/implementation/ContentUnderstandingClientImpl.java b/sdk/contentunderstanding/azure-ai-contentunderstanding/src/main/java/com/azure/ai/contentunderstanding/implementation/ContentUnderstandingClientImpl.java
new file mode 100644
index 000000000000..35ea32a8239d
--- /dev/null
+++ b/sdk/contentunderstanding/azure-ai-contentunderstanding/src/main/java/com/azure/ai/contentunderstanding/implementation/ContentUnderstandingClientImpl.java
@@ -0,0 +1,6575 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+package com.azure.ai.contentunderstanding.implementation;
+
+import com.azure.ai.contentunderstanding.ContentUnderstandingServiceVersion;
+import com.azure.ai.contentunderstanding.models.AnalysisResult;
+import com.azure.ai.contentunderstanding.models.ContentAnalyzer;
+import com.azure.ai.contentunderstanding.models.ContentAnalyzerAnalyzeOperationStatus;
+import com.azure.ai.contentunderstanding.models.ContentAnalyzerOperationStatus;
+import com.azure.core.annotation.BodyParam;
+import com.azure.core.annotation.Delete;
+import com.azure.core.annotation.ExpectedResponses;
+import com.azure.core.annotation.Get;
+import com.azure.core.annotation.HeaderParam;
+import com.azure.core.annotation.Host;
+import com.azure.core.annotation.HostParam;
+import com.azure.core.annotation.Patch;
+import com.azure.core.annotation.PathParam;
+import com.azure.core.annotation.Post;
+import com.azure.core.annotation.Put;
+import com.azure.core.annotation.QueryParam;
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceInterface;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.annotation.UnexpectedResponseExceptionType;
+import com.azure.core.exception.ClientAuthenticationException;
+import com.azure.core.exception.HttpResponseException;
+import com.azure.core.exception.ResourceModifiedException;
+import com.azure.core.exception.ResourceNotFoundException;
+import com.azure.core.http.HttpPipeline;
+import com.azure.core.http.HttpPipelineBuilder;
+import com.azure.core.http.policy.RetryPolicy;
+import com.azure.core.http.policy.UserAgentPolicy;
+import com.azure.core.http.rest.PagedFlux;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.PagedResponse;
+import com.azure.core.http.rest.PagedResponseBase;
+import com.azure.core.http.rest.RequestOptions;
+import com.azure.core.http.rest.Response;
+import com.azure.core.http.rest.RestProxy;
+import com.azure.core.util.BinaryData;
+import com.azure.core.util.Context;
+import com.azure.core.util.FluxUtil;
+import com.azure.core.util.polling.DefaultPollingStrategy;
+import com.azure.core.util.polling.PollerFlux;
+import com.azure.core.util.polling.PollingStrategyOptions;
+import com.azure.core.util.polling.SyncDefaultPollingStrategy;
+import com.azure.core.util.polling.SyncPoller;
+import com.azure.core.util.serializer.JacksonAdapter;
+import com.azure.core.util.serializer.SerializerAdapter;
+import com.azure.core.util.serializer.TypeReference;
+import java.time.Duration;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+import reactor.core.publisher.Mono;
+
+/**
+ * Initializes a new instance of the ContentUnderstandingClient type.
+ */
+public final class ContentUnderstandingClientImpl {
+
+ /**
+ * The proxy service used to perform REST calls.
+ */
+ private final ContentUnderstandingClientService service;
+
+ /**
+ * Content Understanding service endpoint.
+ */
+ private final String endpoint;
+
+ /**
+ * Gets Content Understanding service endpoint.
+ *
+ * @return the endpoint value.
+ */
+ public String getEndpoint() {
+ return this.endpoint;
+ }
+
+ /**
+ * Service version.
+ */
+ private final ContentUnderstandingServiceVersion serviceVersion;
+
+ /**
+ * Gets Service version.
+ *
+ * @return the serviceVersion value.
+ */
+ public ContentUnderstandingServiceVersion getServiceVersion() {
+ return this.serviceVersion;
+ }
+
+ /**
+ * The HTTP pipeline to send requests through.
+ */
+ private final HttpPipeline httpPipeline;
+
+ /**
+ * Gets The HTTP pipeline to send requests through.
+ *
+ * @return the httpPipeline value.
+ */
+ public HttpPipeline getHttpPipeline() {
+ return this.httpPipeline;
+ }
+
+ /**
+ * The serializer to serialize an object into a string.
+ */
+ private final SerializerAdapter serializerAdapter;
+
+ /**
+ * Gets The serializer to serialize an object into a string.
+ *
+ * @return the serializerAdapter value.
+ */
+ public SerializerAdapter getSerializerAdapter() {
+ return this.serializerAdapter;
+ }
+
+ /**
+ * Initializes an instance of ContentUnderstandingClient client.
+ *
+ * @param endpoint Content Understanding service endpoint.
+ * @param serviceVersion Service version.
+ */
+ public ContentUnderstandingClientImpl(String endpoint, ContentUnderstandingServiceVersion serviceVersion) {
+ this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(),
+ JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion);
+ }
+
+ /**
+ * Initializes an instance of ContentUnderstandingClient client.
+ *
+ * @param httpPipeline The HTTP pipeline to send requests through.
+ * @param endpoint Content Understanding service endpoint.
+ * @param serviceVersion Service version.
+ */
+ public ContentUnderstandingClientImpl(HttpPipeline httpPipeline, String endpoint,
+ ContentUnderstandingServiceVersion serviceVersion) {
+ this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion);
+ }
+
+ /**
+ * Initializes an instance of ContentUnderstandingClient client.
+ *
+ * @param httpPipeline The HTTP pipeline to send requests through.
+ * @param serializerAdapter The serializer to serialize an object into a string.
+ * @param endpoint Content Understanding service endpoint.
+ * @param serviceVersion Service version.
+ */
+ public ContentUnderstandingClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter,
+ String endpoint, ContentUnderstandingServiceVersion serviceVersion) {
+ this.httpPipeline = httpPipeline;
+ this.serializerAdapter = serializerAdapter;
+ this.endpoint = endpoint;
+ this.serviceVersion = serviceVersion;
+ this.service
+ = RestProxy.create(ContentUnderstandingClientService.class, this.httpPipeline, this.getSerializerAdapter());
+ }
+
+ /**
+ * The interface defining all the services for ContentUnderstandingClient to be used by the proxy service to perform
+ * REST calls.
+ */
+ @Host("{endpoint}/contentunderstanding")
+ @ServiceInterface(name = "ContentUnderstandingClient")
+ public interface ContentUnderstandingClientService {
+
+ @Post("/analyzers/{analyzerId}:analyze")
+ @ExpectedResponses({ 202 })
+ @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
+ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
+ @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
+ @UnexpectedResponseExceptionType(HttpResponseException.class)
+ Mono> analyze(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("analyzerId") String analyzerId,
+ @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept,
+ @BodyParam("application/json") BinaryData analyzeRequest1, RequestOptions requestOptions, Context context);
+
+ @Post("/analyzers/{analyzerId}:analyze")
+ @ExpectedResponses({ 202 })
+ @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
+ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
+ @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
+ @UnexpectedResponseExceptionType(HttpResponseException.class)
+ Response analyzeSync(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("analyzerId") String analyzerId,
+ @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept,
+ @BodyParam("application/json") BinaryData analyzeRequest1, RequestOptions requestOptions, Context context);
+
+ @Post("/analyzers/{analyzerId}:analyzeBinary")
+ @ExpectedResponses({ 202 })
+ @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
+ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
+ @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
+ @UnexpectedResponseExceptionType(HttpResponseException.class)
+ Mono> analyzeBinary(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("analyzerId") String analyzerId,
+ @HeaderParam("content-type") String contentType, @HeaderParam("Accept") String accept,
+ @BodyParam("*/*") BinaryData binaryInput, RequestOptions requestOptions, Context context);
+
+ @Post("/analyzers/{analyzerId}:analyzeBinary")
+ @ExpectedResponses({ 202 })
+ @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
+ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
+ @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
+ @UnexpectedResponseExceptionType(HttpResponseException.class)
+ Response analyzeBinarySync(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("analyzerId") String analyzerId,
+ @HeaderParam("content-type") String contentType, @HeaderParam("Accept") String accept,
+ @BodyParam("*/*") BinaryData binaryInput, RequestOptions requestOptions, Context context);
+
+ @Post("/analyzers/{analyzerId}:copy")
+ @ExpectedResponses({ 200, 201 })
+ @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
+ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
+ @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
+ @UnexpectedResponseExceptionType(HttpResponseException.class)
+ Mono> copyAnalyzer(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("analyzerId") String analyzerId,
+ @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept,
+ @BodyParam("application/json") BinaryData copyAnalyzerRequest, RequestOptions requestOptions,
+ Context context);
+
+ @Post("/analyzers/{analyzerId}:copy")
+ @ExpectedResponses({ 200, 201 })
+ @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
+ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
+ @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
+ @UnexpectedResponseExceptionType(HttpResponseException.class)
+ Response copyAnalyzerSync(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("analyzerId") String analyzerId,
+ @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept,
+ @BodyParam("application/json") BinaryData copyAnalyzerRequest, RequestOptions requestOptions,
+ Context context);
+
+ @Put("/analyzers/{analyzerId}")
+ @ExpectedResponses({ 200, 201 })
+ @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
+ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
+ @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
+ @UnexpectedResponseExceptionType(HttpResponseException.class)
+ Mono> createAnalyzer(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("analyzerId") String analyzerId,
+ @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept,
+ @BodyParam("application/json") BinaryData resource, RequestOptions requestOptions, Context context);
+
+ @Put("/analyzers/{analyzerId}")
+ @ExpectedResponses({ 200, 201 })
+ @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
+ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
+ @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
+ @UnexpectedResponseExceptionType(HttpResponseException.class)
+ Response createAnalyzerSync(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("analyzerId") String analyzerId,
+ @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept,
+ @BodyParam("application/json") BinaryData resource, RequestOptions requestOptions, Context context);
+
+ @Delete("/analyzers/{analyzerId}")
+ @ExpectedResponses({ 204 })
+ @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
+ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
+ @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
+ @UnexpectedResponseExceptionType(HttpResponseException.class)
+ Mono> deleteAnalyzer(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("analyzerId") String analyzerId,
+ RequestOptions requestOptions, Context context);
+
+ @Delete("/analyzers/{analyzerId}")
+ @ExpectedResponses({ 204 })
+ @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
+ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
+ @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
+ @UnexpectedResponseExceptionType(HttpResponseException.class)
+ Response deleteAnalyzerSync(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("analyzerId") String analyzerId,
+ RequestOptions requestOptions, Context context);
+
+ @Delete("/analyzerResults/{operationId}")
+ @ExpectedResponses({ 204 })
+ @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
+ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
+ @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
+ @UnexpectedResponseExceptionType(HttpResponseException.class)
+ Mono> deleteResult(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("operationId") String operationId,
+ RequestOptions requestOptions, Context context);
+
+ @Delete("/analyzerResults/{operationId}")
+ @ExpectedResponses({ 204 })
+ @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
+ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
+ @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
+ @UnexpectedResponseExceptionType(HttpResponseException.class)
+ Response deleteResultSync(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("operationId") String operationId,
+ RequestOptions requestOptions, Context context);
+
+ @Get("/analyzers/{analyzerId}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
+ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
+ @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
+ @UnexpectedResponseExceptionType(HttpResponseException.class)
+ Mono> getAnalyzer(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("analyzerId") String analyzerId,
+ @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
+
+ @Get("/analyzers/{analyzerId}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
+ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
+ @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
+ @UnexpectedResponseExceptionType(HttpResponseException.class)
+ Response getAnalyzerSync(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("analyzerId") String analyzerId,
+ @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
+
+ @Get("/defaults")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
+ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
+ @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
+ @UnexpectedResponseExceptionType(HttpResponseException.class)
+ Mono> getDefaults(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept,
+ RequestOptions requestOptions, Context context);
+
+ @Get("/defaults")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
+ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
+ @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
+ @UnexpectedResponseExceptionType(HttpResponseException.class)
+ Response getDefaultsSync(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept,
+ RequestOptions requestOptions, Context context);
+
+ @Get("/analyzers/{analyzerId}/operations/{operationId}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
+ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
+ @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
+ @UnexpectedResponseExceptionType(HttpResponseException.class)
+ Mono> getOperationStatus(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("analyzerId") String analyzerId,
+ @PathParam("operationId") String operationId, @HeaderParam("Accept") String accept,
+ RequestOptions requestOptions, Context context);
+
+ @Get("/analyzers/{analyzerId}/operations/{operationId}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
+ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
+ @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
+ @UnexpectedResponseExceptionType(HttpResponseException.class)
+ Response getOperationStatusSync(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("analyzerId") String analyzerId,
+ @PathParam("operationId") String operationId, @HeaderParam("Accept") String accept,
+ RequestOptions requestOptions, Context context);
+
+ @Get("/analyzerResults/{operationId}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
+ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
+ @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
+ @UnexpectedResponseExceptionType(HttpResponseException.class)
+ Mono> getResult(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("operationId") String operationId,
+ @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
+
+ @Get("/analyzerResults/{operationId}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
+ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
+ @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
+ @UnexpectedResponseExceptionType(HttpResponseException.class)
+ Response getResultSync(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("operationId") String operationId,
+ @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
+
+ @Get("/analyzerResults/{operationId}/files/{path}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
+ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
+ @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
+ @UnexpectedResponseExceptionType(HttpResponseException.class)
+ Mono> getResultFile(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("operationId") String operationId,
+ @PathParam(value = "path", encoded = true) String path, @HeaderParam("Accept") String accept,
+ RequestOptions requestOptions, Context context);
+
+ @Get("/analyzerResults/{operationId}/files/{path}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
+ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
+ @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
+ @UnexpectedResponseExceptionType(HttpResponseException.class)
+ Response getResultFileSync(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("operationId") String operationId,
+ @PathParam(value = "path", encoded = true) String path, @HeaderParam("Accept") String accept,
+ RequestOptions requestOptions, Context context);
+
+ @Post("/analyzers/{analyzerId}:grantCopyAuthorization")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
+ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
+ @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
+ @UnexpectedResponseExceptionType(HttpResponseException.class)
+ Mono> grantCopyAuthorization(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("analyzerId") String analyzerId,
+ @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept,
+ @BodyParam("application/json") BinaryData grantCopyAuthorizationRequest1, RequestOptions requestOptions,
+ Context context);
+
+ @Post("/analyzers/{analyzerId}:grantCopyAuthorization")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
+ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
+ @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
+ @UnexpectedResponseExceptionType(HttpResponseException.class)
+ Response grantCopyAuthorizationSync(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("analyzerId") String analyzerId,
+ @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept,
+ @BodyParam("application/json") BinaryData grantCopyAuthorizationRequest1, RequestOptions requestOptions,
+ Context context);
+
+ @Get("/analyzers")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
+ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
+ @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
+ @UnexpectedResponseExceptionType(HttpResponseException.class)
+ Mono> listAnalyzers(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept,
+ RequestOptions requestOptions, Context context);
+
+ @Get("/analyzers")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
+ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
+ @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
+ @UnexpectedResponseExceptionType(HttpResponseException.class)
+ Response listAnalyzersSync(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept,
+ RequestOptions requestOptions, Context context);
+
+ @Patch("/analyzers/{analyzerId}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
+ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
+ @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
+ @UnexpectedResponseExceptionType(HttpResponseException.class)
+ Mono> updateAnalyzer(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("analyzerId") String analyzerId,
+ @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept,
+ @BodyParam("application/merge-patch+json") BinaryData resource, RequestOptions requestOptions,
+ Context context);
+
+ @Patch("/analyzers/{analyzerId}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
+ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
+ @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
+ @UnexpectedResponseExceptionType(HttpResponseException.class)
+ Response updateAnalyzerSync(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("analyzerId") String analyzerId,
+ @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept,
+ @BodyParam("application/merge-patch+json") BinaryData resource, RequestOptions requestOptions,
+ Context context);
+
+ @Patch("/defaults")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
+ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
+ @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
+ @UnexpectedResponseExceptionType(HttpResponseException.class)
+ Mono> updateDefaults(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType,
+ @HeaderParam("Accept") String accept,
+ @BodyParam("application/merge-patch+json") BinaryData updateDefaultsRequest, RequestOptions requestOptions,
+ Context context);
+
+ @Patch("/defaults")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
+ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
+ @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
+ @UnexpectedResponseExceptionType(HttpResponseException.class)
+ Response updateDefaultsSync(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType,
+ @HeaderParam("Accept") String accept,
+ @BodyParam("application/merge-patch+json") BinaryData updateDefaultsRequest, RequestOptions requestOptions,
+ Context context);
+
+ @Get("{nextLink}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
+ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
+ @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
+ @UnexpectedResponseExceptionType(HttpResponseException.class)
+ Mono> listAnalyzersNext(@PathParam(value = "nextLink", encoded = true) String nextLink,
+ @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions,
+ Context context);
+
+ @Get("{nextLink}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
+ @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
+ @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
+ @UnexpectedResponseExceptionType(HttpResponseException.class)
+ Response listAnalyzersNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink,
+ @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions,
+ Context context);
+ }
+
+ /**
+ * Extract content and fields from input.
+ * Query Parameters
+ *
+ * Query Parameters
+ * | Name | Type | Required | Description |
+ * | stringEncoding | String | No | The string encoding format for content spans in the
+ * response.
+ * Possible values are 'codePoint', 'utf16', and `utf8`. Default is `codePoint`.") |
+ * | processingLocation | String | No | The location where the data may be processed.
+ * Defaults to global. Allowed values: "geography", "dataZone", "global". |
+ *
+ * You can add these to a request with {@link RequestOptions#addQueryParam}
+ * Request Body Schema
+ *
+ *
+ * {@code
+ * {
+ * inputs (Required): [
+ * (Required){
+ * url: String (Optional)
+ * data: byte[] (Optional)
+ * name: String (Optional)
+ * mimeType: String (Optional)
+ * range: String (Optional)
+ * }
+ * ]
+ * modelDeployments (Optional): {
+ * String: String (Required)
+ * }
+ * }
+ * }
+ *
+ *
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * id: String (Required)
+ * status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+ * error (Optional): {
+ * code: String (Required)
+ * message: String (Required)
+ * target: String (Optional)
+ * details (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * innererror (Optional): {
+ * code: String (Optional)
+ * innererror (Optional): (recursive schema, see innererror above)
+ * }
+ * }
+ * result (Optional): {
+ * analyzerId: String (Optional)
+ * apiVersion: String (Optional)
+ * createdAt: OffsetDateTime (Optional)
+ * warnings (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * stringEncoding: String (Optional)
+ * contents (Required): [
+ * (Required){
+ * kind: String(document/audioVisual) (Required)
+ * mimeType: String (Required)
+ * analyzerId: String (Optional)
+ * category: String (Optional)
+ * path: String (Optional)
+ * markdown: String (Optional)
+ * fields (Optional): {
+ * String (Required): {
+ * type: String(string/date/time/number/integer/boolean/array/object/json) (Required)
+ * spans (Optional): [
+ * (Optional){
+ * offset: int (Required)
+ * length: int (Required)
+ * }
+ * ]
+ * confidence: Double (Optional)
+ * source: String (Optional)
+ * }
+ * }
+ * }
+ * ]
+ * }
+ * usage (Optional): {
+ * documentPagesMinimal: Integer (Optional)
+ * documentPagesBasic: Integer (Optional)
+ * documentPagesStandard: Integer (Optional)
+ * audioHours: Double (Optional)
+ * videoHours: Double (Optional)
+ * contextualizationTokens: Integer (Optional)
+ * tokens (Optional): {
+ * String: int (Required)
+ * }
+ * }
+ * }
+ * }
+ *
+ *
+ * @param analyzerId The unique identifier of the analyzer.
+ * @param analyzeRequest1 The analyzeRequest1 parameter.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return provides status details for analyze operations along with {@link Response} on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> analyzeWithResponseAsync(String analyzerId, BinaryData analyzeRequest1,
+ RequestOptions requestOptions) {
+ final String contentType = "application/json";
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.analyze(this.getEndpoint(), this.getServiceVersion().getVersion(),
+ analyzerId, contentType, accept, analyzeRequest1, requestOptions, context));
+ }
+
+ /**
+ * Extract content and fields from input.
+ * Query Parameters
+ *
+ * Query Parameters
+ * | Name | Type | Required | Description |
+ * | stringEncoding | String | No | The string encoding format for content spans in the
+ * response.
+ * Possible values are 'codePoint', 'utf16', and `utf8`. Default is `codePoint`.") |
+ * | processingLocation | String | No | The location where the data may be processed.
+ * Defaults to global. Allowed values: "geography", "dataZone", "global". |
+ *
+ * You can add these to a request with {@link RequestOptions#addQueryParam}
+ * Request Body Schema
+ *
+ *
+ * {@code
+ * {
+ * inputs (Required): [
+ * (Required){
+ * url: String (Optional)
+ * data: byte[] (Optional)
+ * name: String (Optional)
+ * mimeType: String (Optional)
+ * range: String (Optional)
+ * }
+ * ]
+ * modelDeployments (Optional): {
+ * String: String (Required)
+ * }
+ * }
+ * }
+ *
+ *
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * id: String (Required)
+ * status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+ * error (Optional): {
+ * code: String (Required)
+ * message: String (Required)
+ * target: String (Optional)
+ * details (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * innererror (Optional): {
+ * code: String (Optional)
+ * innererror (Optional): (recursive schema, see innererror above)
+ * }
+ * }
+ * result (Optional): {
+ * analyzerId: String (Optional)
+ * apiVersion: String (Optional)
+ * createdAt: OffsetDateTime (Optional)
+ * warnings (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * stringEncoding: String (Optional)
+ * contents (Required): [
+ * (Required){
+ * kind: String(document/audioVisual) (Required)
+ * mimeType: String (Required)
+ * analyzerId: String (Optional)
+ * category: String (Optional)
+ * path: String (Optional)
+ * markdown: String (Optional)
+ * fields (Optional): {
+ * String (Required): {
+ * type: String(string/date/time/number/integer/boolean/array/object/json) (Required)
+ * spans (Optional): [
+ * (Optional){
+ * offset: int (Required)
+ * length: int (Required)
+ * }
+ * ]
+ * confidence: Double (Optional)
+ * source: String (Optional)
+ * }
+ * }
+ * }
+ * ]
+ * }
+ * usage (Optional): {
+ * documentPagesMinimal: Integer (Optional)
+ * documentPagesBasic: Integer (Optional)
+ * documentPagesStandard: Integer (Optional)
+ * audioHours: Double (Optional)
+ * videoHours: Double (Optional)
+ * contextualizationTokens: Integer (Optional)
+ * tokens (Optional): {
+ * String: int (Required)
+ * }
+ * }
+ * }
+ * }
+ *
+ *
+ * @param analyzerId The unique identifier of the analyzer.
+ * @param analyzeRequest1 The analyzeRequest1 parameter.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return provides status details for analyze operations along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Response analyzeWithResponse(String analyzerId, BinaryData analyzeRequest1,
+ RequestOptions requestOptions) {
+ final String contentType = "application/json";
+ final String accept = "application/json";
+ return service.analyzeSync(this.getEndpoint(), this.getServiceVersion().getVersion(), analyzerId, contentType,
+ accept, analyzeRequest1, requestOptions, Context.NONE);
+ }
+
+ /**
+ * Extract content and fields from input.
+ * Query Parameters
+ *
+ * Query Parameters
+ * | Name | Type | Required | Description |
+ * | stringEncoding | String | No | The string encoding format for content spans in the
+ * response.
+ * Possible values are 'codePoint', 'utf16', and `utf8`. Default is `codePoint`.") |
+ * | processingLocation | String | No | The location where the data may be processed.
+ * Defaults to global. Allowed values: "geography", "dataZone", "global". |
+ *
+ * You can add these to a request with {@link RequestOptions#addQueryParam}
+ * Request Body Schema
+ *
+ *
+ * {@code
+ * {
+ * inputs (Required): [
+ * (Required){
+ * url: String (Optional)
+ * data: byte[] (Optional)
+ * name: String (Optional)
+ * mimeType: String (Optional)
+ * range: String (Optional)
+ * }
+ * ]
+ * modelDeployments (Optional): {
+ * String: String (Required)
+ * }
+ * }
+ * }
+ *
+ *
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * id: String (Required)
+ * status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+ * error (Optional): {
+ * code: String (Required)
+ * message: String (Required)
+ * target: String (Optional)
+ * details (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * innererror (Optional): {
+ * code: String (Optional)
+ * innererror (Optional): (recursive schema, see innererror above)
+ * }
+ * }
+ * result (Optional): {
+ * analyzerId: String (Optional)
+ * apiVersion: String (Optional)
+ * createdAt: OffsetDateTime (Optional)
+ * warnings (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * stringEncoding: String (Optional)
+ * contents (Required): [
+ * (Required){
+ * kind: String(document/audioVisual) (Required)
+ * mimeType: String (Required)
+ * analyzerId: String (Optional)
+ * category: String (Optional)
+ * path: String (Optional)
+ * markdown: String (Optional)
+ * fields (Optional): {
+ * String (Required): {
+ * type: String(string/date/time/number/integer/boolean/array/object/json) (Required)
+ * spans (Optional): [
+ * (Optional){
+ * offset: int (Required)
+ * length: int (Required)
+ * }
+ * ]
+ * confidence: Double (Optional)
+ * source: String (Optional)
+ * }
+ * }
+ * }
+ * ]
+ * }
+ * usage (Optional): {
+ * documentPagesMinimal: Integer (Optional)
+ * documentPagesBasic: Integer (Optional)
+ * documentPagesStandard: Integer (Optional)
+ * audioHours: Double (Optional)
+ * videoHours: Double (Optional)
+ * contextualizationTokens: Integer (Optional)
+ * tokens (Optional): {
+ * String: int (Required)
+ * }
+ * }
+ * }
+ * }
+ *
+ *
+ * @param analyzerId The unique identifier of the analyzer.
+ * @param analyzeRequest1 The analyzeRequest1 parameter.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return the {@link PollerFlux} for polling of provides status details for analyze operations.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public PollerFlux
+ beginAnalyzeWithModelAsync(String analyzerId, BinaryData analyzeRequest1, RequestOptions requestOptions) {
+ return PollerFlux.create(Duration.ofSeconds(3),
+ () -> this.analyzeWithResponseAsync(analyzerId, analyzeRequest1, requestOptions),
+ new com.azure.ai.contentunderstanding.implementation.OperationLocationPollingStrategy<>(
+ new PollingStrategyOptions(this.getHttpPipeline())
+ .setEndpoint("{endpoint}/contentunderstanding".replace("{endpoint}", this.getEndpoint()))
+ .setContext(requestOptions != null && requestOptions.getContext() != null
+ ? requestOptions.getContext()
+ : Context.NONE)
+ .setServiceVersion(this.getServiceVersion().getVersion()),
+ "result"),
+ TypeReference.createInstance(ContentAnalyzerAnalyzeOperationStatus.class),
+ TypeReference.createInstance(AnalysisResult.class));
+ }
+
+ /**
+ * Extract content and fields from input.
+ * Query Parameters
+ *
+ * Query Parameters
+ * | Name | Type | Required | Description |
+ * | stringEncoding | String | No | The string encoding format for content spans in the
+ * response.
+ * Possible values are 'codePoint', 'utf16', and `utf8`. Default is `codePoint`.") |
+ * | processingLocation | String | No | The location where the data may be processed.
+ * Defaults to global. Allowed values: "geography", "dataZone", "global". |
+ *
+ * You can add these to a request with {@link RequestOptions#addQueryParam}
+ * Request Body Schema
+ *
+ *
+ * {@code
+ * {
+ * inputs (Required): [
+ * (Required){
+ * url: String (Optional)
+ * data: byte[] (Optional)
+ * name: String (Optional)
+ * mimeType: String (Optional)
+ * range: String (Optional)
+ * }
+ * ]
+ * modelDeployments (Optional): {
+ * String: String (Required)
+ * }
+ * }
+ * }
+ *
+ *
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * id: String (Required)
+ * status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+ * error (Optional): {
+ * code: String (Required)
+ * message: String (Required)
+ * target: String (Optional)
+ * details (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * innererror (Optional): {
+ * code: String (Optional)
+ * innererror (Optional): (recursive schema, see innererror above)
+ * }
+ * }
+ * result (Optional): {
+ * analyzerId: String (Optional)
+ * apiVersion: String (Optional)
+ * createdAt: OffsetDateTime (Optional)
+ * warnings (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * stringEncoding: String (Optional)
+ * contents (Required): [
+ * (Required){
+ * kind: String(document/audioVisual) (Required)
+ * mimeType: String (Required)
+ * analyzerId: String (Optional)
+ * category: String (Optional)
+ * path: String (Optional)
+ * markdown: String (Optional)
+ * fields (Optional): {
+ * String (Required): {
+ * type: String(string/date/time/number/integer/boolean/array/object/json) (Required)
+ * spans (Optional): [
+ * (Optional){
+ * offset: int (Required)
+ * length: int (Required)
+ * }
+ * ]
+ * confidence: Double (Optional)
+ * source: String (Optional)
+ * }
+ * }
+ * }
+ * ]
+ * }
+ * usage (Optional): {
+ * documentPagesMinimal: Integer (Optional)
+ * documentPagesBasic: Integer (Optional)
+ * documentPagesStandard: Integer (Optional)
+ * audioHours: Double (Optional)
+ * videoHours: Double (Optional)
+ * contextualizationTokens: Integer (Optional)
+ * tokens (Optional): {
+ * String: int (Required)
+ * }
+ * }
+ * }
+ * }
+ *
+ *
+ * @param analyzerId The unique identifier of the analyzer.
+ * @param analyzeRequest1 The analyzeRequest1 parameter.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return the {@link SyncPoller} for polling of provides status details for analyze operations.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller beginAnalyzeWithModel(String analyzerId,
+ BinaryData analyzeRequest1, RequestOptions requestOptions) {
+ return SyncPoller.createPoller(Duration.ofSeconds(3),
+ () -> this.analyzeWithResponse(analyzerId, analyzeRequest1, requestOptions),
+ new com.azure.ai.contentunderstanding.implementation.SyncOperationLocationPollingStrategy<>(
+ new PollingStrategyOptions(this.getHttpPipeline())
+ .setEndpoint("{endpoint}/contentunderstanding".replace("{endpoint}", this.getEndpoint()))
+ .setContext(requestOptions != null && requestOptions.getContext() != null
+ ? requestOptions.getContext()
+ : Context.NONE)
+ .setServiceVersion(this.getServiceVersion().getVersion()),
+ "result"),
+ TypeReference.createInstance(ContentAnalyzerAnalyzeOperationStatus.class),
+ TypeReference.createInstance(AnalysisResult.class));
+ }
+
+ /**
+ * Extract content and fields from input.
+ * Query Parameters
+ *
+ * Query Parameters
+ * | Name | Type | Required | Description |
+ * | stringEncoding | String | No | The string encoding format for content spans in the
+ * response.
+ * Possible values are 'codePoint', 'utf16', and `utf8`. Default is `codePoint`.") |
+ * | processingLocation | String | No | The location where the data may be processed.
+ * Defaults to global. Allowed values: "geography", "dataZone", "global". |
+ *
+ * You can add these to a request with {@link RequestOptions#addQueryParam}
+ * Request Body Schema
+ *
+ *
+ * {@code
+ * {
+ * inputs (Required): [
+ * (Required){
+ * url: String (Optional)
+ * data: byte[] (Optional)
+ * name: String (Optional)
+ * mimeType: String (Optional)
+ * range: String (Optional)
+ * }
+ * ]
+ * modelDeployments (Optional): {
+ * String: String (Required)
+ * }
+ * }
+ * }
+ *
+ *
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * id: String (Required)
+ * status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+ * error (Optional): {
+ * code: String (Required)
+ * message: String (Required)
+ * target: String (Optional)
+ * details (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * innererror (Optional): {
+ * code: String (Optional)
+ * innererror (Optional): (recursive schema, see innererror above)
+ * }
+ * }
+ * result (Optional): {
+ * analyzerId: String (Optional)
+ * apiVersion: String (Optional)
+ * createdAt: OffsetDateTime (Optional)
+ * warnings (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * stringEncoding: String (Optional)
+ * contents (Required): [
+ * (Required){
+ * kind: String(document/audioVisual) (Required)
+ * mimeType: String (Required)
+ * analyzerId: String (Optional)
+ * category: String (Optional)
+ * path: String (Optional)
+ * markdown: String (Optional)
+ * fields (Optional): {
+ * String (Required): {
+ * type: String(string/date/time/number/integer/boolean/array/object/json) (Required)
+ * spans (Optional): [
+ * (Optional){
+ * offset: int (Required)
+ * length: int (Required)
+ * }
+ * ]
+ * confidence: Double (Optional)
+ * source: String (Optional)
+ * }
+ * }
+ * }
+ * ]
+ * }
+ * usage (Optional): {
+ * documentPagesMinimal: Integer (Optional)
+ * documentPagesBasic: Integer (Optional)
+ * documentPagesStandard: Integer (Optional)
+ * audioHours: Double (Optional)
+ * videoHours: Double (Optional)
+ * contextualizationTokens: Integer (Optional)
+ * tokens (Optional): {
+ * String: int (Required)
+ * }
+ * }
+ * }
+ * }
+ *
+ *
+ * @param analyzerId The unique identifier of the analyzer.
+ * @param analyzeRequest1 The analyzeRequest1 parameter.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return the {@link PollerFlux} for polling of provides status details for analyze operations.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public PollerFlux beginAnalyzeAsync(String analyzerId, BinaryData analyzeRequest1,
+ RequestOptions requestOptions) {
+ return PollerFlux.create(Duration.ofSeconds(3),
+ () -> this.analyzeWithResponseAsync(analyzerId, analyzeRequest1, requestOptions),
+ new com.azure.ai.contentunderstanding.implementation.OperationLocationPollingStrategy<>(
+ new PollingStrategyOptions(this.getHttpPipeline())
+ .setEndpoint("{endpoint}/contentunderstanding".replace("{endpoint}", this.getEndpoint()))
+ .setContext(requestOptions != null && requestOptions.getContext() != null
+ ? requestOptions.getContext()
+ : Context.NONE)
+ .setServiceVersion(this.getServiceVersion().getVersion()),
+ "result"),
+ TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class));
+ }
+
+ /**
+ * Extract content and fields from input.
+ * Query Parameters
+ *
+ * Query Parameters
+ * | Name | Type | Required | Description |
+ * | stringEncoding | String | No | The string encoding format for content spans in the
+ * response.
+ * Possible values are 'codePoint', 'utf16', and `utf8`. Default is `codePoint`.") |
+ * | processingLocation | String | No | The location where the data may be processed.
+ * Defaults to global. Allowed values: "geography", "dataZone", "global". |
+ *
+ * You can add these to a request with {@link RequestOptions#addQueryParam}
+ * Request Body Schema
+ *
+ *
+ * {@code
+ * {
+ * inputs (Required): [
+ * (Required){
+ * url: String (Optional)
+ * data: byte[] (Optional)
+ * name: String (Optional)
+ * mimeType: String (Optional)
+ * range: String (Optional)
+ * }
+ * ]
+ * modelDeployments (Optional): {
+ * String: String (Required)
+ * }
+ * }
+ * }
+ *
+ *
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * id: String (Required)
+ * status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+ * error (Optional): {
+ * code: String (Required)
+ * message: String (Required)
+ * target: String (Optional)
+ * details (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * innererror (Optional): {
+ * code: String (Optional)
+ * innererror (Optional): (recursive schema, see innererror above)
+ * }
+ * }
+ * result (Optional): {
+ * analyzerId: String (Optional)
+ * apiVersion: String (Optional)
+ * createdAt: OffsetDateTime (Optional)
+ * warnings (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * stringEncoding: String (Optional)
+ * contents (Required): [
+ * (Required){
+ * kind: String(document/audioVisual) (Required)
+ * mimeType: String (Required)
+ * analyzerId: String (Optional)
+ * category: String (Optional)
+ * path: String (Optional)
+ * markdown: String (Optional)
+ * fields (Optional): {
+ * String (Required): {
+ * type: String(string/date/time/number/integer/boolean/array/object/json) (Required)
+ * spans (Optional): [
+ * (Optional){
+ * offset: int (Required)
+ * length: int (Required)
+ * }
+ * ]
+ * confidence: Double (Optional)
+ * source: String (Optional)
+ * }
+ * }
+ * }
+ * ]
+ * }
+ * usage (Optional): {
+ * documentPagesMinimal: Integer (Optional)
+ * documentPagesBasic: Integer (Optional)
+ * documentPagesStandard: Integer (Optional)
+ * audioHours: Double (Optional)
+ * videoHours: Double (Optional)
+ * contextualizationTokens: Integer (Optional)
+ * tokens (Optional): {
+ * String: int (Required)
+ * }
+ * }
+ * }
+ * }
+ *
+ *
+ * @param analyzerId The unique identifier of the analyzer.
+ * @param analyzeRequest1 The analyzeRequest1 parameter.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return the {@link SyncPoller} for polling of provides status details for analyze operations.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller beginAnalyze(String analyzerId, BinaryData analyzeRequest1,
+ RequestOptions requestOptions) {
+ return SyncPoller.createPoller(Duration.ofSeconds(3),
+ () -> this.analyzeWithResponse(analyzerId, analyzeRequest1, requestOptions),
+ new com.azure.ai.contentunderstanding.implementation.SyncOperationLocationPollingStrategy<>(
+ new PollingStrategyOptions(this.getHttpPipeline())
+ .setEndpoint("{endpoint}/contentunderstanding".replace("{endpoint}", this.getEndpoint()))
+ .setContext(requestOptions != null && requestOptions.getContext() != null
+ ? requestOptions.getContext()
+ : Context.NONE)
+ .setServiceVersion(this.getServiceVersion().getVersion()),
+ "result"),
+ TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class));
+ }
+
+ /**
+ * Extract content and fields from input.
+ * Query Parameters
+ *
+ * Query Parameters
+ * | Name | Type | Required | Description |
+ * | stringEncoding | String | No | The string encoding format for content spans in the
+ * response.
+ * Possible values are 'codePoint', 'utf16', and `utf8`. Default is `codePoint`.") |
+ * | processingLocation | String | No | The location where the data may be processed.
+ * Defaults to global. Allowed values: "geography", "dataZone", "global". |
+ * | range | String | No | Range of the input to analyze (ex. `1-3,5,9-`). Document content
+ * uses 1-based page numbers, while audio visual content uses integer milliseconds. |
+ *
+ * You can add these to a request with {@link RequestOptions#addQueryParam}
+ * Request Body Schema
+ *
+ *
+ * {@code
+ * BinaryData
+ * }
+ *
+ *
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * id: String (Required)
+ * status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+ * error (Optional): {
+ * code: String (Required)
+ * message: String (Required)
+ * target: String (Optional)
+ * details (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * innererror (Optional): {
+ * code: String (Optional)
+ * innererror (Optional): (recursive schema, see innererror above)
+ * }
+ * }
+ * result (Optional): {
+ * analyzerId: String (Optional)
+ * apiVersion: String (Optional)
+ * createdAt: OffsetDateTime (Optional)
+ * warnings (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * stringEncoding: String (Optional)
+ * contents (Required): [
+ * (Required){
+ * kind: String(document/audioVisual) (Required)
+ * mimeType: String (Required)
+ * analyzerId: String (Optional)
+ * category: String (Optional)
+ * path: String (Optional)
+ * markdown: String (Optional)
+ * fields (Optional): {
+ * String (Required): {
+ * type: String(string/date/time/number/integer/boolean/array/object/json) (Required)
+ * spans (Optional): [
+ * (Optional){
+ * offset: int (Required)
+ * length: int (Required)
+ * }
+ * ]
+ * confidence: Double (Optional)
+ * source: String (Optional)
+ * }
+ * }
+ * }
+ * ]
+ * }
+ * usage (Optional): {
+ * documentPagesMinimal: Integer (Optional)
+ * documentPagesBasic: Integer (Optional)
+ * documentPagesStandard: Integer (Optional)
+ * audioHours: Double (Optional)
+ * videoHours: Double (Optional)
+ * contextualizationTokens: Integer (Optional)
+ * tokens (Optional): {
+ * String: int (Required)
+ * }
+ * }
+ * }
+ * }
+ *
+ *
+ * @param analyzerId The unique identifier of the analyzer.
+ * @param contentType Request content type.
+ * @param binaryInput The binary content of the document to analyze.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return provides status details for analyze operations along with {@link Response} on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> analyzeBinaryWithResponseAsync(String analyzerId, String contentType,
+ BinaryData binaryInput, RequestOptions requestOptions) {
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.analyzeBinary(this.getEndpoint(), this.getServiceVersion().getVersion(),
+ analyzerId, contentType, accept, binaryInput, requestOptions, context));
+ }
+
+ /**
+ * Extract content and fields from input.
+ * Query Parameters
+ *
+ * Query Parameters
+ * | Name | Type | Required | Description |
+ * | stringEncoding | String | No | The string encoding format for content spans in the
+ * response.
+ * Possible values are 'codePoint', 'utf16', and `utf8`. Default is `codePoint`.") |
+ * | processingLocation | String | No | The location where the data may be processed.
+ * Defaults to global. Allowed values: "geography", "dataZone", "global". |
+ * | range | String | No | Range of the input to analyze (ex. `1-3,5,9-`). Document content
+ * uses 1-based page numbers, while audio visual content uses integer milliseconds. |
+ *
+ * You can add these to a request with {@link RequestOptions#addQueryParam}
+ * Request Body Schema
+ *
+ *
+ * {@code
+ * BinaryData
+ * }
+ *
+ *
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * id: String (Required)
+ * status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+ * error (Optional): {
+ * code: String (Required)
+ * message: String (Required)
+ * target: String (Optional)
+ * details (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * innererror (Optional): {
+ * code: String (Optional)
+ * innererror (Optional): (recursive schema, see innererror above)
+ * }
+ * }
+ * result (Optional): {
+ * analyzerId: String (Optional)
+ * apiVersion: String (Optional)
+ * createdAt: OffsetDateTime (Optional)
+ * warnings (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * stringEncoding: String (Optional)
+ * contents (Required): [
+ * (Required){
+ * kind: String(document/audioVisual) (Required)
+ * mimeType: String (Required)
+ * analyzerId: String (Optional)
+ * category: String (Optional)
+ * path: String (Optional)
+ * markdown: String (Optional)
+ * fields (Optional): {
+ * String (Required): {
+ * type: String(string/date/time/number/integer/boolean/array/object/json) (Required)
+ * spans (Optional): [
+ * (Optional){
+ * offset: int (Required)
+ * length: int (Required)
+ * }
+ * ]
+ * confidence: Double (Optional)
+ * source: String (Optional)
+ * }
+ * }
+ * }
+ * ]
+ * }
+ * usage (Optional): {
+ * documentPagesMinimal: Integer (Optional)
+ * documentPagesBasic: Integer (Optional)
+ * documentPagesStandard: Integer (Optional)
+ * audioHours: Double (Optional)
+ * videoHours: Double (Optional)
+ * contextualizationTokens: Integer (Optional)
+ * tokens (Optional): {
+ * String: int (Required)
+ * }
+ * }
+ * }
+ * }
+ *
+ *
+ * @param analyzerId The unique identifier of the analyzer.
+ * @param contentType Request content type.
+ * @param binaryInput The binary content of the document to analyze.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return provides status details for analyze operations along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Response analyzeBinaryWithResponse(String analyzerId, String contentType,
+ BinaryData binaryInput, RequestOptions requestOptions) {
+ final String accept = "application/json";
+ return service.analyzeBinarySync(this.getEndpoint(), this.getServiceVersion().getVersion(), analyzerId,
+ contentType, accept, binaryInput, requestOptions, Context.NONE);
+ }
+
+ /**
+ * Extract content and fields from input.
+ * Query Parameters
+ *
+ * Query Parameters
+ * | Name | Type | Required | Description |
+ * | stringEncoding | String | No | The string encoding format for content spans in the
+ * response.
+ * Possible values are 'codePoint', 'utf16', and `utf8`. Default is `codePoint`.") |
+ * | processingLocation | String | No | The location where the data may be processed.
+ * Defaults to global. Allowed values: "geography", "dataZone", "global". |
+ * | range | String | No | Range of the input to analyze (ex. `1-3,5,9-`). Document content
+ * uses 1-based page numbers, while audio visual content uses integer milliseconds. |
+ *
+ * You can add these to a request with {@link RequestOptions#addQueryParam}
+ * Request Body Schema
+ *
+ *
+ * {@code
+ * BinaryData
+ * }
+ *
+ *
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * id: String (Required)
+ * status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+ * error (Optional): {
+ * code: String (Required)
+ * message: String (Required)
+ * target: String (Optional)
+ * details (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * innererror (Optional): {
+ * code: String (Optional)
+ * innererror (Optional): (recursive schema, see innererror above)
+ * }
+ * }
+ * result (Optional): {
+ * analyzerId: String (Optional)
+ * apiVersion: String (Optional)
+ * createdAt: OffsetDateTime (Optional)
+ * warnings (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * stringEncoding: String (Optional)
+ * contents (Required): [
+ * (Required){
+ * kind: String(document/audioVisual) (Required)
+ * mimeType: String (Required)
+ * analyzerId: String (Optional)
+ * category: String (Optional)
+ * path: String (Optional)
+ * markdown: String (Optional)
+ * fields (Optional): {
+ * String (Required): {
+ * type: String(string/date/time/number/integer/boolean/array/object/json) (Required)
+ * spans (Optional): [
+ * (Optional){
+ * offset: int (Required)
+ * length: int (Required)
+ * }
+ * ]
+ * confidence: Double (Optional)
+ * source: String (Optional)
+ * }
+ * }
+ * }
+ * ]
+ * }
+ * usage (Optional): {
+ * documentPagesMinimal: Integer (Optional)
+ * documentPagesBasic: Integer (Optional)
+ * documentPagesStandard: Integer (Optional)
+ * audioHours: Double (Optional)
+ * videoHours: Double (Optional)
+ * contextualizationTokens: Integer (Optional)
+ * tokens (Optional): {
+ * String: int (Required)
+ * }
+ * }
+ * }
+ * }
+ *
+ *
+ * @param analyzerId The unique identifier of the analyzer.
+ * @param contentType Request content type.
+ * @param binaryInput The binary content of the document to analyze.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return the {@link PollerFlux} for polling of provides status details for analyze operations.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public PollerFlux beginAnalyzeBinaryWithModelAsync(
+ String analyzerId, String contentType, BinaryData binaryInput, RequestOptions requestOptions) {
+ return PollerFlux.create(Duration.ofSeconds(3),
+ () -> this.analyzeBinaryWithResponseAsync(analyzerId, contentType, binaryInput, requestOptions),
+ new com.azure.ai.contentunderstanding.implementation.OperationLocationPollingStrategy<>(
+ new PollingStrategyOptions(this.getHttpPipeline())
+ .setEndpoint("{endpoint}/contentunderstanding".replace("{endpoint}", this.getEndpoint()))
+ .setContext(requestOptions != null && requestOptions.getContext() != null
+ ? requestOptions.getContext()
+ : Context.NONE)
+ .setServiceVersion(this.getServiceVersion().getVersion()),
+ "result"),
+ TypeReference.createInstance(ContentAnalyzerAnalyzeOperationStatus.class),
+ TypeReference.createInstance(AnalysisResult.class));
+ }
+
+ /**
+ * Extract content and fields from input.
+ * Query Parameters
+ *
+ * Query Parameters
+ * | Name | Type | Required | Description |
+ * | stringEncoding | String | No | The string encoding format for content spans in the
+ * response.
+ * Possible values are 'codePoint', 'utf16', and `utf8`. Default is `codePoint`.") |
+ * | processingLocation | String | No | The location where the data may be processed.
+ * Defaults to global. Allowed values: "geography", "dataZone", "global". |
+ * | range | String | No | Range of the input to analyze (ex. `1-3,5,9-`). Document content
+ * uses 1-based page numbers, while audio visual content uses integer milliseconds. |
+ *
+ * You can add these to a request with {@link RequestOptions#addQueryParam}
+ * Request Body Schema
+ *
+ *
+ * {@code
+ * BinaryData
+ * }
+ *
+ *
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * id: String (Required)
+ * status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+ * error (Optional): {
+ * code: String (Required)
+ * message: String (Required)
+ * target: String (Optional)
+ * details (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * innererror (Optional): {
+ * code: String (Optional)
+ * innererror (Optional): (recursive schema, see innererror above)
+ * }
+ * }
+ * result (Optional): {
+ * analyzerId: String (Optional)
+ * apiVersion: String (Optional)
+ * createdAt: OffsetDateTime (Optional)
+ * warnings (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * stringEncoding: String (Optional)
+ * contents (Required): [
+ * (Required){
+ * kind: String(document/audioVisual) (Required)
+ * mimeType: String (Required)
+ * analyzerId: String (Optional)
+ * category: String (Optional)
+ * path: String (Optional)
+ * markdown: String (Optional)
+ * fields (Optional): {
+ * String (Required): {
+ * type: String(string/date/time/number/integer/boolean/array/object/json) (Required)
+ * spans (Optional): [
+ * (Optional){
+ * offset: int (Required)
+ * length: int (Required)
+ * }
+ * ]
+ * confidence: Double (Optional)
+ * source: String (Optional)
+ * }
+ * }
+ * }
+ * ]
+ * }
+ * usage (Optional): {
+ * documentPagesMinimal: Integer (Optional)
+ * documentPagesBasic: Integer (Optional)
+ * documentPagesStandard: Integer (Optional)
+ * audioHours: Double (Optional)
+ * videoHours: Double (Optional)
+ * contextualizationTokens: Integer (Optional)
+ * tokens (Optional): {
+ * String: int (Required)
+ * }
+ * }
+ * }
+ * }
+ *
+ *
+ * @param analyzerId The unique identifier of the analyzer.
+ * @param contentType Request content type.
+ * @param binaryInput The binary content of the document to analyze.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return the {@link SyncPoller} for polling of provides status details for analyze operations.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller beginAnalyzeBinaryWithModel(
+ String analyzerId, String contentType, BinaryData binaryInput, RequestOptions requestOptions) {
+ return SyncPoller.createPoller(Duration.ofSeconds(3),
+ () -> this.analyzeBinaryWithResponse(analyzerId, contentType, binaryInput, requestOptions),
+ new com.azure.ai.contentunderstanding.implementation.SyncOperationLocationPollingStrategy<>(
+ new PollingStrategyOptions(this.getHttpPipeline())
+ .setEndpoint("{endpoint}/contentunderstanding".replace("{endpoint}", this.getEndpoint()))
+ .setContext(requestOptions != null && requestOptions.getContext() != null
+ ? requestOptions.getContext()
+ : Context.NONE)
+ .setServiceVersion(this.getServiceVersion().getVersion()),
+ "result"),
+ TypeReference.createInstance(ContentAnalyzerAnalyzeOperationStatus.class),
+ TypeReference.createInstance(AnalysisResult.class));
+ }
+
+ /**
+ * Extract content and fields from input.
+ * Query Parameters
+ *
+ * Query Parameters
+ * | Name | Type | Required | Description |
+ * | stringEncoding | String | No | The string encoding format for content spans in the
+ * response.
+ * Possible values are 'codePoint', 'utf16', and `utf8`. Default is `codePoint`.") |
+ * | processingLocation | String | No | The location where the data may be processed.
+ * Defaults to global. Allowed values: "geography", "dataZone", "global". |
+ * | range | String | No | Range of the input to analyze (ex. `1-3,5,9-`). Document content
+ * uses 1-based page numbers, while audio visual content uses integer milliseconds. |
+ *
+ * You can add these to a request with {@link RequestOptions#addQueryParam}
+ * Request Body Schema
+ *
+ *
+ * {@code
+ * BinaryData
+ * }
+ *
+ *
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * id: String (Required)
+ * status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+ * error (Optional): {
+ * code: String (Required)
+ * message: String (Required)
+ * target: String (Optional)
+ * details (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * innererror (Optional): {
+ * code: String (Optional)
+ * innererror (Optional): (recursive schema, see innererror above)
+ * }
+ * }
+ * result (Optional): {
+ * analyzerId: String (Optional)
+ * apiVersion: String (Optional)
+ * createdAt: OffsetDateTime (Optional)
+ * warnings (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * stringEncoding: String (Optional)
+ * contents (Required): [
+ * (Required){
+ * kind: String(document/audioVisual) (Required)
+ * mimeType: String (Required)
+ * analyzerId: String (Optional)
+ * category: String (Optional)
+ * path: String (Optional)
+ * markdown: String (Optional)
+ * fields (Optional): {
+ * String (Required): {
+ * type: String(string/date/time/number/integer/boolean/array/object/json) (Required)
+ * spans (Optional): [
+ * (Optional){
+ * offset: int (Required)
+ * length: int (Required)
+ * }
+ * ]
+ * confidence: Double (Optional)
+ * source: String (Optional)
+ * }
+ * }
+ * }
+ * ]
+ * }
+ * usage (Optional): {
+ * documentPagesMinimal: Integer (Optional)
+ * documentPagesBasic: Integer (Optional)
+ * documentPagesStandard: Integer (Optional)
+ * audioHours: Double (Optional)
+ * videoHours: Double (Optional)
+ * contextualizationTokens: Integer (Optional)
+ * tokens (Optional): {
+ * String: int (Required)
+ * }
+ * }
+ * }
+ * }
+ *
+ *
+ * @param analyzerId The unique identifier of the analyzer.
+ * @param contentType Request content type.
+ * @param binaryInput The binary content of the document to analyze.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return the {@link PollerFlux} for polling of provides status details for analyze operations.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public PollerFlux beginAnalyzeBinaryAsync(String analyzerId, String contentType,
+ BinaryData binaryInput, RequestOptions requestOptions) {
+ return PollerFlux.create(Duration.ofSeconds(3),
+ () -> this.analyzeBinaryWithResponseAsync(analyzerId, contentType, binaryInput, requestOptions),
+ new com.azure.ai.contentunderstanding.implementation.OperationLocationPollingStrategy<>(
+ new PollingStrategyOptions(this.getHttpPipeline())
+ .setEndpoint("{endpoint}/contentunderstanding".replace("{endpoint}", this.getEndpoint()))
+ .setContext(requestOptions != null && requestOptions.getContext() != null
+ ? requestOptions.getContext()
+ : Context.NONE)
+ .setServiceVersion(this.getServiceVersion().getVersion()),
+ "result"),
+ TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class));
+ }
+
+ /**
+ * Extract content and fields from input.
+ * Query Parameters
+ *
+ * Query Parameters
+ * | Name | Type | Required | Description |
+ * | stringEncoding | String | No | The string encoding format for content spans in the
+ * response.
+ * Possible values are 'codePoint', 'utf16', and `utf8`. Default is `codePoint`.") |
+ * | processingLocation | String | No | The location where the data may be processed.
+ * Defaults to global. Allowed values: "geography", "dataZone", "global". |
+ * | range | String | No | Range of the input to analyze (ex. `1-3,5,9-`). Document content
+ * uses 1-based page numbers, while audio visual content uses integer milliseconds. |
+ *
+ * You can add these to a request with {@link RequestOptions#addQueryParam}
+ * Request Body Schema
+ *
+ *
+ * {@code
+ * BinaryData
+ * }
+ *
+ *
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * id: String (Required)
+ * status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+ * error (Optional): {
+ * code: String (Required)
+ * message: String (Required)
+ * target: String (Optional)
+ * details (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * innererror (Optional): {
+ * code: String (Optional)
+ * innererror (Optional): (recursive schema, see innererror above)
+ * }
+ * }
+ * result (Optional): {
+ * analyzerId: String (Optional)
+ * apiVersion: String (Optional)
+ * createdAt: OffsetDateTime (Optional)
+ * warnings (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * stringEncoding: String (Optional)
+ * contents (Required): [
+ * (Required){
+ * kind: String(document/audioVisual) (Required)
+ * mimeType: String (Required)
+ * analyzerId: String (Optional)
+ * category: String (Optional)
+ * path: String (Optional)
+ * markdown: String (Optional)
+ * fields (Optional): {
+ * String (Required): {
+ * type: String(string/date/time/number/integer/boolean/array/object/json) (Required)
+ * spans (Optional): [
+ * (Optional){
+ * offset: int (Required)
+ * length: int (Required)
+ * }
+ * ]
+ * confidence: Double (Optional)
+ * source: String (Optional)
+ * }
+ * }
+ * }
+ * ]
+ * }
+ * usage (Optional): {
+ * documentPagesMinimal: Integer (Optional)
+ * documentPagesBasic: Integer (Optional)
+ * documentPagesStandard: Integer (Optional)
+ * audioHours: Double (Optional)
+ * videoHours: Double (Optional)
+ * contextualizationTokens: Integer (Optional)
+ * tokens (Optional): {
+ * String: int (Required)
+ * }
+ * }
+ * }
+ * }
+ *
+ *
+ * @param analyzerId The unique identifier of the analyzer.
+ * @param contentType Request content type.
+ * @param binaryInput The binary content of the document to analyze.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return the {@link SyncPoller} for polling of provides status details for analyze operations.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller beginAnalyzeBinary(String analyzerId, String contentType,
+ BinaryData binaryInput, RequestOptions requestOptions) {
+ return SyncPoller.createPoller(Duration.ofSeconds(3),
+ () -> this.analyzeBinaryWithResponse(analyzerId, contentType, binaryInput, requestOptions),
+ new com.azure.ai.contentunderstanding.implementation.SyncOperationLocationPollingStrategy<>(
+ new PollingStrategyOptions(this.getHttpPipeline())
+ .setEndpoint("{endpoint}/contentunderstanding".replace("{endpoint}", this.getEndpoint()))
+ .setContext(requestOptions != null && requestOptions.getContext() != null
+ ? requestOptions.getContext()
+ : Context.NONE)
+ .setServiceVersion(this.getServiceVersion().getVersion()),
+ "result"),
+ TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class));
+ }
+
+ /**
+ * Create a copy of the source analyzer to the current location.
+ * Query Parameters
+ *
+ * Query Parameters
+ * | Name | Type | Required | Description |
+ * | allowReplace | Boolean | No | Allow the operation to replace an existing
+ * resource. |
+ *
+ * You can add these to a request with {@link RequestOptions#addQueryParam}
+ * Request Body Schema
+ *
+ *
+ * {@code
+ * {
+ * sourceAzureResourceId: String (Optional)
+ * sourceRegion: String (Optional)
+ * sourceAnalyzerId: String (Required)
+ * }
+ * }
+ *
+ *
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * analyzerId: String (Required)
+ * description: String (Optional)
+ * tags (Optional): {
+ * String: String (Required)
+ * }
+ * status: String(creating/ready/deleting/failed) (Required)
+ * createdAt: OffsetDateTime (Required)
+ * lastModifiedAt: OffsetDateTime (Required)
+ * warnings (Optional): [
+ * (Optional){
+ * code: String (Required)
+ * message: String (Required)
+ * target: String (Optional)
+ * details (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * innererror (Optional): {
+ * code: String (Optional)
+ * innererror (Optional): (recursive schema, see innererror above)
+ * }
+ * }
+ * ]
+ * baseAnalyzerId: String (Optional)
+ * config (Optional): {
+ * returnDetails: Boolean (Optional)
+ * locales (Optional): [
+ * String (Optional)
+ * ]
+ * enableOcr: Boolean (Optional)
+ * enableLayout: Boolean (Optional)
+ * enableFigureDescription: Boolean (Optional)
+ * enableFigureAnalysis: Boolean (Optional)
+ * enableFormula: Boolean (Optional)
+ * tableFormat: String(html/markdown) (Optional)
+ * chartFormat: String(chartJs/markdown) (Optional)
+ * annotationFormat: String(none/markdown) (Optional)
+ * disableFaceBlurring: Boolean (Optional)
+ * estimateFieldSourceAndConfidence: Boolean (Optional)
+ * contentCategories (Optional): {
+ * String (Required): {
+ * description: String (Optional)
+ * analyzerId: String (Optional)
+ * analyzer (Optional): (recursive schema, see analyzer above)
+ * }
+ * }
+ * enableSegment: Boolean (Optional)
+ * segmentPerPage: Boolean (Optional)
+ * omitContent: Boolean (Optional)
+ * }
+ * fieldSchema (Optional): {
+ * name: String (Optional)
+ * description: String (Optional)
+ * fields (Optional, Required on create): {
+ * String (Required): {
+ * method: String(generate/extract/classify) (Optional)
+ * type: String(string/date/time/number/integer/boolean/array/object/json) (Optional)
+ * description: String (Optional)
+ * items (Optional): (recursive schema, see items above)
+ * properties (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * examples (Optional): [
+ * String (Optional)
+ * ]
+ * enum (Optional): [
+ * String (Optional)
+ * ]
+ * enumDescriptions (Optional): {
+ * String: String (Required)
+ * }
+ * $ref: String (Optional)
+ * estimateSourceAndConfidence: Boolean (Optional)
+ * }
+ * }
+ * definitions (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * }
+ * dynamicFieldSchema: Boolean (Optional)
+ * processingLocation: String(geography/dataZone/global) (Optional)
+ * knowledgeSources (Optional): [
+ * (Optional){
+ * kind: String(labeledData) (Required)
+ * }
+ * ]
+ * models (Optional): {
+ * String: String (Required)
+ * }
+ * supportedModels (Optional): {
+ * completion (Optional): [
+ * String (Optional)
+ * ]
+ * embedding (Optional): [
+ * String (Optional)
+ * ]
+ * }
+ * }
+ * }
+ *
+ *
+ * @param analyzerId The unique identifier of the analyzer.
+ * @param copyAnalyzerRequest The copyAnalyzerRequest parameter.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return analyzer that extracts content and fields from multimodal documents along with {@link Response} on
+ * successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> copyAnalyzerWithResponseAsync(String analyzerId, BinaryData copyAnalyzerRequest,
+ RequestOptions requestOptions) {
+ final String contentType = "application/json";
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.copyAnalyzer(this.getEndpoint(), this.getServiceVersion().getVersion(),
+ analyzerId, contentType, accept, copyAnalyzerRequest, requestOptions, context));
+ }
+
+ /**
+ * Create a copy of the source analyzer to the current location.
+ * Query Parameters
+ *
+ * Query Parameters
+ * | Name | Type | Required | Description |
+ * | allowReplace | Boolean | No | Allow the operation to replace an existing
+ * resource. |
+ *
+ * You can add these to a request with {@link RequestOptions#addQueryParam}
+ * Request Body Schema
+ *
+ *
+ * {@code
+ * {
+ * sourceAzureResourceId: String (Optional)
+ * sourceRegion: String (Optional)
+ * sourceAnalyzerId: String (Required)
+ * }
+ * }
+ *
+ *
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * analyzerId: String (Required)
+ * description: String (Optional)
+ * tags (Optional): {
+ * String: String (Required)
+ * }
+ * status: String(creating/ready/deleting/failed) (Required)
+ * createdAt: OffsetDateTime (Required)
+ * lastModifiedAt: OffsetDateTime (Required)
+ * warnings (Optional): [
+ * (Optional){
+ * code: String (Required)
+ * message: String (Required)
+ * target: String (Optional)
+ * details (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * innererror (Optional): {
+ * code: String (Optional)
+ * innererror (Optional): (recursive schema, see innererror above)
+ * }
+ * }
+ * ]
+ * baseAnalyzerId: String (Optional)
+ * config (Optional): {
+ * returnDetails: Boolean (Optional)
+ * locales (Optional): [
+ * String (Optional)
+ * ]
+ * enableOcr: Boolean (Optional)
+ * enableLayout: Boolean (Optional)
+ * enableFigureDescription: Boolean (Optional)
+ * enableFigureAnalysis: Boolean (Optional)
+ * enableFormula: Boolean (Optional)
+ * tableFormat: String(html/markdown) (Optional)
+ * chartFormat: String(chartJs/markdown) (Optional)
+ * annotationFormat: String(none/markdown) (Optional)
+ * disableFaceBlurring: Boolean (Optional)
+ * estimateFieldSourceAndConfidence: Boolean (Optional)
+ * contentCategories (Optional): {
+ * String (Required): {
+ * description: String (Optional)
+ * analyzerId: String (Optional)
+ * analyzer (Optional): (recursive schema, see analyzer above)
+ * }
+ * }
+ * enableSegment: Boolean (Optional)
+ * segmentPerPage: Boolean (Optional)
+ * omitContent: Boolean (Optional)
+ * }
+ * fieldSchema (Optional): {
+ * name: String (Optional)
+ * description: String (Optional)
+ * fields (Optional, Required on create): {
+ * String (Required): {
+ * method: String(generate/extract/classify) (Optional)
+ * type: String(string/date/time/number/integer/boolean/array/object/json) (Optional)
+ * description: String (Optional)
+ * items (Optional): (recursive schema, see items above)
+ * properties (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * examples (Optional): [
+ * String (Optional)
+ * ]
+ * enum (Optional): [
+ * String (Optional)
+ * ]
+ * enumDescriptions (Optional): {
+ * String: String (Required)
+ * }
+ * $ref: String (Optional)
+ * estimateSourceAndConfidence: Boolean (Optional)
+ * }
+ * }
+ * definitions (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * }
+ * dynamicFieldSchema: Boolean (Optional)
+ * processingLocation: String(geography/dataZone/global) (Optional)
+ * knowledgeSources (Optional): [
+ * (Optional){
+ * kind: String(labeledData) (Required)
+ * }
+ * ]
+ * models (Optional): {
+ * String: String (Required)
+ * }
+ * supportedModels (Optional): {
+ * completion (Optional): [
+ * String (Optional)
+ * ]
+ * embedding (Optional): [
+ * String (Optional)
+ * ]
+ * }
+ * }
+ * }
+ *
+ *
+ * @param analyzerId The unique identifier of the analyzer.
+ * @param copyAnalyzerRequest The copyAnalyzerRequest parameter.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return analyzer that extracts content and fields from multimodal documents along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Response copyAnalyzerWithResponse(String analyzerId, BinaryData copyAnalyzerRequest,
+ RequestOptions requestOptions) {
+ final String contentType = "application/json";
+ final String accept = "application/json";
+ return service.copyAnalyzerSync(this.getEndpoint(), this.getServiceVersion().getVersion(), analyzerId,
+ contentType, accept, copyAnalyzerRequest, requestOptions, Context.NONE);
+ }
+
+ /**
+ * Create a copy of the source analyzer to the current location.
+ * Query Parameters
+ *
+ * Query Parameters
+ * | Name | Type | Required | Description |
+ * | allowReplace | Boolean | No | Allow the operation to replace an existing
+ * resource. |
+ *
+ * You can add these to a request with {@link RequestOptions#addQueryParam}
+ * Request Body Schema
+ *
+ *
+ * {@code
+ * {
+ * sourceAzureResourceId: String (Optional)
+ * sourceRegion: String (Optional)
+ * sourceAnalyzerId: String (Required)
+ * }
+ * }
+ *
+ *
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * analyzerId: String (Required)
+ * description: String (Optional)
+ * tags (Optional): {
+ * String: String (Required)
+ * }
+ * status: String(creating/ready/deleting/failed) (Required)
+ * createdAt: OffsetDateTime (Required)
+ * lastModifiedAt: OffsetDateTime (Required)
+ * warnings (Optional): [
+ * (Optional){
+ * code: String (Required)
+ * message: String (Required)
+ * target: String (Optional)
+ * details (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * innererror (Optional): {
+ * code: String (Optional)
+ * innererror (Optional): (recursive schema, see innererror above)
+ * }
+ * }
+ * ]
+ * baseAnalyzerId: String (Optional)
+ * config (Optional): {
+ * returnDetails: Boolean (Optional)
+ * locales (Optional): [
+ * String (Optional)
+ * ]
+ * enableOcr: Boolean (Optional)
+ * enableLayout: Boolean (Optional)
+ * enableFigureDescription: Boolean (Optional)
+ * enableFigureAnalysis: Boolean (Optional)
+ * enableFormula: Boolean (Optional)
+ * tableFormat: String(html/markdown) (Optional)
+ * chartFormat: String(chartJs/markdown) (Optional)
+ * annotationFormat: String(none/markdown) (Optional)
+ * disableFaceBlurring: Boolean (Optional)
+ * estimateFieldSourceAndConfidence: Boolean (Optional)
+ * contentCategories (Optional): {
+ * String (Required): {
+ * description: String (Optional)
+ * analyzerId: String (Optional)
+ * analyzer (Optional): (recursive schema, see analyzer above)
+ * }
+ * }
+ * enableSegment: Boolean (Optional)
+ * segmentPerPage: Boolean (Optional)
+ * omitContent: Boolean (Optional)
+ * }
+ * fieldSchema (Optional): {
+ * name: String (Optional)
+ * description: String (Optional)
+ * fields (Optional, Required on create): {
+ * String (Required): {
+ * method: String(generate/extract/classify) (Optional)
+ * type: String(string/date/time/number/integer/boolean/array/object/json) (Optional)
+ * description: String (Optional)
+ * items (Optional): (recursive schema, see items above)
+ * properties (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * examples (Optional): [
+ * String (Optional)
+ * ]
+ * enum (Optional): [
+ * String (Optional)
+ * ]
+ * enumDescriptions (Optional): {
+ * String: String (Required)
+ * }
+ * $ref: String (Optional)
+ * estimateSourceAndConfidence: Boolean (Optional)
+ * }
+ * }
+ * definitions (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * }
+ * dynamicFieldSchema: Boolean (Optional)
+ * processingLocation: String(geography/dataZone/global) (Optional)
+ * knowledgeSources (Optional): [
+ * (Optional){
+ * kind: String(labeledData) (Required)
+ * }
+ * ]
+ * models (Optional): {
+ * String: String (Required)
+ * }
+ * supportedModels (Optional): {
+ * completion (Optional): [
+ * String (Optional)
+ * ]
+ * embedding (Optional): [
+ * String (Optional)
+ * ]
+ * }
+ * }
+ * }
+ *
+ *
+ * @param analyzerId The unique identifier of the analyzer.
+ * @param copyAnalyzerRequest The copyAnalyzerRequest parameter.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return the {@link PollerFlux} for polling of analyzer that extracts content and fields from multimodal
+ * documents.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public PollerFlux beginCopyAnalyzerWithModelAsync(
+ String analyzerId, BinaryData copyAnalyzerRequest, RequestOptions requestOptions) {
+ return PollerFlux.create(Duration.ofSeconds(3),
+ () -> this.copyAnalyzerWithResponseAsync(analyzerId, copyAnalyzerRequest, requestOptions),
+ new com.azure.ai.contentunderstanding.implementation.OperationLocationPollingStrategy<>(
+ new PollingStrategyOptions(this.getHttpPipeline())
+ .setEndpoint("{endpoint}/contentunderstanding".replace("{endpoint}", this.getEndpoint()))
+ .setContext(requestOptions != null && requestOptions.getContext() != null
+ ? requestOptions.getContext()
+ : Context.NONE)
+ .setServiceVersion(this.getServiceVersion().getVersion()),
+ "result"),
+ TypeReference.createInstance(ContentAnalyzerOperationStatus.class),
+ TypeReference.createInstance(ContentAnalyzer.class));
+ }
+
+ /**
+ * Create a copy of the source analyzer to the current location.
+ * Query Parameters
+ *
+ * Query Parameters
+ * | Name | Type | Required | Description |
+ * | allowReplace | Boolean | No | Allow the operation to replace an existing
+ * resource. |
+ *
+ * You can add these to a request with {@link RequestOptions#addQueryParam}
+ * Request Body Schema
+ *
+ *
+ * {@code
+ * {
+ * sourceAzureResourceId: String (Optional)
+ * sourceRegion: String (Optional)
+ * sourceAnalyzerId: String (Required)
+ * }
+ * }
+ *
+ *
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * analyzerId: String (Required)
+ * description: String (Optional)
+ * tags (Optional): {
+ * String: String (Required)
+ * }
+ * status: String(creating/ready/deleting/failed) (Required)
+ * createdAt: OffsetDateTime (Required)
+ * lastModifiedAt: OffsetDateTime (Required)
+ * warnings (Optional): [
+ * (Optional){
+ * code: String (Required)
+ * message: String (Required)
+ * target: String (Optional)
+ * details (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * innererror (Optional): {
+ * code: String (Optional)
+ * innererror (Optional): (recursive schema, see innererror above)
+ * }
+ * }
+ * ]
+ * baseAnalyzerId: String (Optional)
+ * config (Optional): {
+ * returnDetails: Boolean (Optional)
+ * locales (Optional): [
+ * String (Optional)
+ * ]
+ * enableOcr: Boolean (Optional)
+ * enableLayout: Boolean (Optional)
+ * enableFigureDescription: Boolean (Optional)
+ * enableFigureAnalysis: Boolean (Optional)
+ * enableFormula: Boolean (Optional)
+ * tableFormat: String(html/markdown) (Optional)
+ * chartFormat: String(chartJs/markdown) (Optional)
+ * annotationFormat: String(none/markdown) (Optional)
+ * disableFaceBlurring: Boolean (Optional)
+ * estimateFieldSourceAndConfidence: Boolean (Optional)
+ * contentCategories (Optional): {
+ * String (Required): {
+ * description: String (Optional)
+ * analyzerId: String (Optional)
+ * analyzer (Optional): (recursive schema, see analyzer above)
+ * }
+ * }
+ * enableSegment: Boolean (Optional)
+ * segmentPerPage: Boolean (Optional)
+ * omitContent: Boolean (Optional)
+ * }
+ * fieldSchema (Optional): {
+ * name: String (Optional)
+ * description: String (Optional)
+ * fields (Optional, Required on create): {
+ * String (Required): {
+ * method: String(generate/extract/classify) (Optional)
+ * type: String(string/date/time/number/integer/boolean/array/object/json) (Optional)
+ * description: String (Optional)
+ * items (Optional): (recursive schema, see items above)
+ * properties (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * examples (Optional): [
+ * String (Optional)
+ * ]
+ * enum (Optional): [
+ * String (Optional)
+ * ]
+ * enumDescriptions (Optional): {
+ * String: String (Required)
+ * }
+ * $ref: String (Optional)
+ * estimateSourceAndConfidence: Boolean (Optional)
+ * }
+ * }
+ * definitions (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * }
+ * dynamicFieldSchema: Boolean (Optional)
+ * processingLocation: String(geography/dataZone/global) (Optional)
+ * knowledgeSources (Optional): [
+ * (Optional){
+ * kind: String(labeledData) (Required)
+ * }
+ * ]
+ * models (Optional): {
+ * String: String (Required)
+ * }
+ * supportedModels (Optional): {
+ * completion (Optional): [
+ * String (Optional)
+ * ]
+ * embedding (Optional): [
+ * String (Optional)
+ * ]
+ * }
+ * }
+ * }
+ *
+ *
+ * @param analyzerId The unique identifier of the analyzer.
+ * @param copyAnalyzerRequest The copyAnalyzerRequest parameter.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return the {@link SyncPoller} for polling of analyzer that extracts content and fields from multimodal
+ * documents.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller beginCopyAnalyzerWithModel(String analyzerId,
+ BinaryData copyAnalyzerRequest, RequestOptions requestOptions) {
+ return SyncPoller.createPoller(Duration.ofSeconds(3),
+ () -> this.copyAnalyzerWithResponse(analyzerId, copyAnalyzerRequest, requestOptions),
+ new com.azure.ai.contentunderstanding.implementation.SyncOperationLocationPollingStrategy<>(
+ new PollingStrategyOptions(this.getHttpPipeline())
+ .setEndpoint("{endpoint}/contentunderstanding".replace("{endpoint}", this.getEndpoint()))
+ .setContext(requestOptions != null && requestOptions.getContext() != null
+ ? requestOptions.getContext()
+ : Context.NONE)
+ .setServiceVersion(this.getServiceVersion().getVersion()),
+ "result"),
+ TypeReference.createInstance(ContentAnalyzerOperationStatus.class),
+ TypeReference.createInstance(ContentAnalyzer.class));
+ }
+
+ /**
+ * Create a copy of the source analyzer to the current location.
+ * Query Parameters
+ *
+ * Query Parameters
+ * | Name | Type | Required | Description |
+ * | allowReplace | Boolean | No | Allow the operation to replace an existing
+ * resource. |
+ *
+ * You can add these to a request with {@link RequestOptions#addQueryParam}
+ * Request Body Schema
+ *
+ *
+ * {@code
+ * {
+ * sourceAzureResourceId: String (Optional)
+ * sourceRegion: String (Optional)
+ * sourceAnalyzerId: String (Required)
+ * }
+ * }
+ *
+ *
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * analyzerId: String (Required)
+ * description: String (Optional)
+ * tags (Optional): {
+ * String: String (Required)
+ * }
+ * status: String(creating/ready/deleting/failed) (Required)
+ * createdAt: OffsetDateTime (Required)
+ * lastModifiedAt: OffsetDateTime (Required)
+ * warnings (Optional): [
+ * (Optional){
+ * code: String (Required)
+ * message: String (Required)
+ * target: String (Optional)
+ * details (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * innererror (Optional): {
+ * code: String (Optional)
+ * innererror (Optional): (recursive schema, see innererror above)
+ * }
+ * }
+ * ]
+ * baseAnalyzerId: String (Optional)
+ * config (Optional): {
+ * returnDetails: Boolean (Optional)
+ * locales (Optional): [
+ * String (Optional)
+ * ]
+ * enableOcr: Boolean (Optional)
+ * enableLayout: Boolean (Optional)
+ * enableFigureDescription: Boolean (Optional)
+ * enableFigureAnalysis: Boolean (Optional)
+ * enableFormula: Boolean (Optional)
+ * tableFormat: String(html/markdown) (Optional)
+ * chartFormat: String(chartJs/markdown) (Optional)
+ * annotationFormat: String(none/markdown) (Optional)
+ * disableFaceBlurring: Boolean (Optional)
+ * estimateFieldSourceAndConfidence: Boolean (Optional)
+ * contentCategories (Optional): {
+ * String (Required): {
+ * description: String (Optional)
+ * analyzerId: String (Optional)
+ * analyzer (Optional): (recursive schema, see analyzer above)
+ * }
+ * }
+ * enableSegment: Boolean (Optional)
+ * segmentPerPage: Boolean (Optional)
+ * omitContent: Boolean (Optional)
+ * }
+ * fieldSchema (Optional): {
+ * name: String (Optional)
+ * description: String (Optional)
+ * fields (Optional, Required on create): {
+ * String (Required): {
+ * method: String(generate/extract/classify) (Optional)
+ * type: String(string/date/time/number/integer/boolean/array/object/json) (Optional)
+ * description: String (Optional)
+ * items (Optional): (recursive schema, see items above)
+ * properties (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * examples (Optional): [
+ * String (Optional)
+ * ]
+ * enum (Optional): [
+ * String (Optional)
+ * ]
+ * enumDescriptions (Optional): {
+ * String: String (Required)
+ * }
+ * $ref: String (Optional)
+ * estimateSourceAndConfidence: Boolean (Optional)
+ * }
+ * }
+ * definitions (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * }
+ * dynamicFieldSchema: Boolean (Optional)
+ * processingLocation: String(geography/dataZone/global) (Optional)
+ * knowledgeSources (Optional): [
+ * (Optional){
+ * kind: String(labeledData) (Required)
+ * }
+ * ]
+ * models (Optional): {
+ * String: String (Required)
+ * }
+ * supportedModels (Optional): {
+ * completion (Optional): [
+ * String (Optional)
+ * ]
+ * embedding (Optional): [
+ * String (Optional)
+ * ]
+ * }
+ * }
+ * }
+ *
+ *
+ * @param analyzerId The unique identifier of the analyzer.
+ * @param copyAnalyzerRequest The copyAnalyzerRequest parameter.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return the {@link PollerFlux} for polling of analyzer that extracts content and fields from multimodal
+ * documents.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public PollerFlux beginCopyAnalyzerAsync(String analyzerId, BinaryData copyAnalyzerRequest,
+ RequestOptions requestOptions) {
+ return PollerFlux.create(Duration.ofSeconds(3),
+ () -> this.copyAnalyzerWithResponseAsync(analyzerId, copyAnalyzerRequest, requestOptions),
+ new com.azure.ai.contentunderstanding.implementation.OperationLocationPollingStrategy<>(
+ new PollingStrategyOptions(this.getHttpPipeline())
+ .setEndpoint("{endpoint}/contentunderstanding".replace("{endpoint}", this.getEndpoint()))
+ .setContext(requestOptions != null && requestOptions.getContext() != null
+ ? requestOptions.getContext()
+ : Context.NONE)
+ .setServiceVersion(this.getServiceVersion().getVersion()),
+ "result"),
+ TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class));
+ }
+
+ /**
+ * Create a copy of the source analyzer to the current location.
+ * Query Parameters
+ *
+ * Query Parameters
+ * | Name | Type | Required | Description |
+ * | allowReplace | Boolean | No | Allow the operation to replace an existing
+ * resource. |
+ *
+ * You can add these to a request with {@link RequestOptions#addQueryParam}
+ * Request Body Schema
+ *
+ *
+ * {@code
+ * {
+ * sourceAzureResourceId: String (Optional)
+ * sourceRegion: String (Optional)
+ * sourceAnalyzerId: String (Required)
+ * }
+ * }
+ *
+ *
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * analyzerId: String (Required)
+ * description: String (Optional)
+ * tags (Optional): {
+ * String: String (Required)
+ * }
+ * status: String(creating/ready/deleting/failed) (Required)
+ * createdAt: OffsetDateTime (Required)
+ * lastModifiedAt: OffsetDateTime (Required)
+ * warnings (Optional): [
+ * (Optional){
+ * code: String (Required)
+ * message: String (Required)
+ * target: String (Optional)
+ * details (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * innererror (Optional): {
+ * code: String (Optional)
+ * innererror (Optional): (recursive schema, see innererror above)
+ * }
+ * }
+ * ]
+ * baseAnalyzerId: String (Optional)
+ * config (Optional): {
+ * returnDetails: Boolean (Optional)
+ * locales (Optional): [
+ * String (Optional)
+ * ]
+ * enableOcr: Boolean (Optional)
+ * enableLayout: Boolean (Optional)
+ * enableFigureDescription: Boolean (Optional)
+ * enableFigureAnalysis: Boolean (Optional)
+ * enableFormula: Boolean (Optional)
+ * tableFormat: String(html/markdown) (Optional)
+ * chartFormat: String(chartJs/markdown) (Optional)
+ * annotationFormat: String(none/markdown) (Optional)
+ * disableFaceBlurring: Boolean (Optional)
+ * estimateFieldSourceAndConfidence: Boolean (Optional)
+ * contentCategories (Optional): {
+ * String (Required): {
+ * description: String (Optional)
+ * analyzerId: String (Optional)
+ * analyzer (Optional): (recursive schema, see analyzer above)
+ * }
+ * }
+ * enableSegment: Boolean (Optional)
+ * segmentPerPage: Boolean (Optional)
+ * omitContent: Boolean (Optional)
+ * }
+ * fieldSchema (Optional): {
+ * name: String (Optional)
+ * description: String (Optional)
+ * fields (Optional, Required on create): {
+ * String (Required): {
+ * method: String(generate/extract/classify) (Optional)
+ * type: String(string/date/time/number/integer/boolean/array/object/json) (Optional)
+ * description: String (Optional)
+ * items (Optional): (recursive schema, see items above)
+ * properties (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * examples (Optional): [
+ * String (Optional)
+ * ]
+ * enum (Optional): [
+ * String (Optional)
+ * ]
+ * enumDescriptions (Optional): {
+ * String: String (Required)
+ * }
+ * $ref: String (Optional)
+ * estimateSourceAndConfidence: Boolean (Optional)
+ * }
+ * }
+ * definitions (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * }
+ * dynamicFieldSchema: Boolean (Optional)
+ * processingLocation: String(geography/dataZone/global) (Optional)
+ * knowledgeSources (Optional): [
+ * (Optional){
+ * kind: String(labeledData) (Required)
+ * }
+ * ]
+ * models (Optional): {
+ * String: String (Required)
+ * }
+ * supportedModels (Optional): {
+ * completion (Optional): [
+ * String (Optional)
+ * ]
+ * embedding (Optional): [
+ * String (Optional)
+ * ]
+ * }
+ * }
+ * }
+ *
+ *
+ * @param analyzerId The unique identifier of the analyzer.
+ * @param copyAnalyzerRequest The copyAnalyzerRequest parameter.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return the {@link SyncPoller} for polling of analyzer that extracts content and fields from multimodal
+ * documents.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller beginCopyAnalyzer(String analyzerId, BinaryData copyAnalyzerRequest,
+ RequestOptions requestOptions) {
+ return SyncPoller.createPoller(Duration.ofSeconds(3),
+ () -> this.copyAnalyzerWithResponse(analyzerId, copyAnalyzerRequest, requestOptions),
+ new com.azure.ai.contentunderstanding.implementation.SyncOperationLocationPollingStrategy<>(
+ new PollingStrategyOptions(this.getHttpPipeline())
+ .setEndpoint("{endpoint}/contentunderstanding".replace("{endpoint}", this.getEndpoint()))
+ .setContext(requestOptions != null && requestOptions.getContext() != null
+ ? requestOptions.getContext()
+ : Context.NONE)
+ .setServiceVersion(this.getServiceVersion().getVersion()),
+ "result"),
+ TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class));
+ }
+
+ /**
+ * Create a new analyzer asynchronously.
+ * Query Parameters
+ *
+ * Query Parameters
+ * | Name | Type | Required | Description |
+ * | allowReplace | Boolean | No | Allow the operation to replace an existing
+ * resource. |
+ *
+ * You can add these to a request with {@link RequestOptions#addQueryParam}
+ * Request Body Schema
+ *
+ *
+ * {@code
+ * {
+ * analyzerId: String (Required)
+ * description: String (Optional)
+ * tags (Optional): {
+ * String: String (Required)
+ * }
+ * status: String(creating/ready/deleting/failed) (Required)
+ * createdAt: OffsetDateTime (Required)
+ * lastModifiedAt: OffsetDateTime (Required)
+ * warnings (Optional): [
+ * (Optional){
+ * code: String (Required)
+ * message: String (Required)
+ * target: String (Optional)
+ * details (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * innererror (Optional): {
+ * code: String (Optional)
+ * innererror (Optional): (recursive schema, see innererror above)
+ * }
+ * }
+ * ]
+ * baseAnalyzerId: String (Optional)
+ * config (Optional): {
+ * returnDetails: Boolean (Optional)
+ * locales (Optional): [
+ * String (Optional)
+ * ]
+ * enableOcr: Boolean (Optional)
+ * enableLayout: Boolean (Optional)
+ * enableFigureDescription: Boolean (Optional)
+ * enableFigureAnalysis: Boolean (Optional)
+ * enableFormula: Boolean (Optional)
+ * tableFormat: String(html/markdown) (Optional)
+ * chartFormat: String(chartJs/markdown) (Optional)
+ * annotationFormat: String(none/markdown) (Optional)
+ * disableFaceBlurring: Boolean (Optional)
+ * estimateFieldSourceAndConfidence: Boolean (Optional)
+ * contentCategories (Optional): {
+ * String (Required): {
+ * description: String (Optional)
+ * analyzerId: String (Optional)
+ * analyzer (Optional): (recursive schema, see analyzer above)
+ * }
+ * }
+ * enableSegment: Boolean (Optional)
+ * segmentPerPage: Boolean (Optional)
+ * omitContent: Boolean (Optional)
+ * }
+ * fieldSchema (Optional): {
+ * name: String (Optional)
+ * description: String (Optional)
+ * fields (Optional, Required on create): {
+ * String (Required): {
+ * method: String(generate/extract/classify) (Optional)
+ * type: String(string/date/time/number/integer/boolean/array/object/json) (Optional)
+ * description: String (Optional)
+ * items (Optional): (recursive schema, see items above)
+ * properties (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * examples (Optional): [
+ * String (Optional)
+ * ]
+ * enum (Optional): [
+ * String (Optional)
+ * ]
+ * enumDescriptions (Optional): {
+ * String: String (Required)
+ * }
+ * $ref: String (Optional)
+ * estimateSourceAndConfidence: Boolean (Optional)
+ * }
+ * }
+ * definitions (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * }
+ * dynamicFieldSchema: Boolean (Optional)
+ * processingLocation: String(geography/dataZone/global) (Optional)
+ * knowledgeSources (Optional): [
+ * (Optional){
+ * kind: String(labeledData) (Required)
+ * }
+ * ]
+ * models (Optional): {
+ * String: String (Required)
+ * }
+ * supportedModels (Optional): {
+ * completion (Optional): [
+ * String (Optional)
+ * ]
+ * embedding (Optional): [
+ * String (Optional)
+ * ]
+ * }
+ * }
+ * }
+ *
+ *
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * analyzerId: String (Required)
+ * description: String (Optional)
+ * tags (Optional): {
+ * String: String (Required)
+ * }
+ * status: String(creating/ready/deleting/failed) (Required)
+ * createdAt: OffsetDateTime (Required)
+ * lastModifiedAt: OffsetDateTime (Required)
+ * warnings (Optional): [
+ * (Optional){
+ * code: String (Required)
+ * message: String (Required)
+ * target: String (Optional)
+ * details (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * innererror (Optional): {
+ * code: String (Optional)
+ * innererror (Optional): (recursive schema, see innererror above)
+ * }
+ * }
+ * ]
+ * baseAnalyzerId: String (Optional)
+ * config (Optional): {
+ * returnDetails: Boolean (Optional)
+ * locales (Optional): [
+ * String (Optional)
+ * ]
+ * enableOcr: Boolean (Optional)
+ * enableLayout: Boolean (Optional)
+ * enableFigureDescription: Boolean (Optional)
+ * enableFigureAnalysis: Boolean (Optional)
+ * enableFormula: Boolean (Optional)
+ * tableFormat: String(html/markdown) (Optional)
+ * chartFormat: String(chartJs/markdown) (Optional)
+ * annotationFormat: String(none/markdown) (Optional)
+ * disableFaceBlurring: Boolean (Optional)
+ * estimateFieldSourceAndConfidence: Boolean (Optional)
+ * contentCategories (Optional): {
+ * String (Required): {
+ * description: String (Optional)
+ * analyzerId: String (Optional)
+ * analyzer (Optional): (recursive schema, see analyzer above)
+ * }
+ * }
+ * enableSegment: Boolean (Optional)
+ * segmentPerPage: Boolean (Optional)
+ * omitContent: Boolean (Optional)
+ * }
+ * fieldSchema (Optional): {
+ * name: String (Optional)
+ * description: String (Optional)
+ * fields (Optional, Required on create): {
+ * String (Required): {
+ * method: String(generate/extract/classify) (Optional)
+ * type: String(string/date/time/number/integer/boolean/array/object/json) (Optional)
+ * description: String (Optional)
+ * items (Optional): (recursive schema, see items above)
+ * properties (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * examples (Optional): [
+ * String (Optional)
+ * ]
+ * enum (Optional): [
+ * String (Optional)
+ * ]
+ * enumDescriptions (Optional): {
+ * String: String (Required)
+ * }
+ * $ref: String (Optional)
+ * estimateSourceAndConfidence: Boolean (Optional)
+ * }
+ * }
+ * definitions (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * }
+ * dynamicFieldSchema: Boolean (Optional)
+ * processingLocation: String(geography/dataZone/global) (Optional)
+ * knowledgeSources (Optional): [
+ * (Optional){
+ * kind: String(labeledData) (Required)
+ * }
+ * ]
+ * models (Optional): {
+ * String: String (Required)
+ * }
+ * supportedModels (Optional): {
+ * completion (Optional): [
+ * String (Optional)
+ * ]
+ * embedding (Optional): [
+ * String (Optional)
+ * ]
+ * }
+ * }
+ * }
+ *
+ *
+ * @param analyzerId The unique identifier of the analyzer.
+ * @param resource The resource instance.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return analyzer that extracts content and fields from multimodal documents along with {@link Response} on
+ * successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> createAnalyzerWithResponseAsync(String analyzerId, BinaryData resource,
+ RequestOptions requestOptions) {
+ final String contentType = "application/json";
+ final String accept = "application/json";
+ return FluxUtil.withContext(context -> service.createAnalyzer(this.getEndpoint(),
+ this.getServiceVersion().getVersion(), analyzerId, contentType, accept, resource, requestOptions, context));
+ }
+
+ /**
+ * Create a new analyzer asynchronously.
+ * Query Parameters
+ *
+ * Query Parameters
+ * | Name | Type | Required | Description |
+ * | allowReplace | Boolean | No | Allow the operation to replace an existing
+ * resource. |
+ *
+ * You can add these to a request with {@link RequestOptions#addQueryParam}
+ * Request Body Schema
+ *
+ *
+ * {@code
+ * {
+ * analyzerId: String (Required)
+ * description: String (Optional)
+ * tags (Optional): {
+ * String: String (Required)
+ * }
+ * status: String(creating/ready/deleting/failed) (Required)
+ * createdAt: OffsetDateTime (Required)
+ * lastModifiedAt: OffsetDateTime (Required)
+ * warnings (Optional): [
+ * (Optional){
+ * code: String (Required)
+ * message: String (Required)
+ * target: String (Optional)
+ * details (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * innererror (Optional): {
+ * code: String (Optional)
+ * innererror (Optional): (recursive schema, see innererror above)
+ * }
+ * }
+ * ]
+ * baseAnalyzerId: String (Optional)
+ * config (Optional): {
+ * returnDetails: Boolean (Optional)
+ * locales (Optional): [
+ * String (Optional)
+ * ]
+ * enableOcr: Boolean (Optional)
+ * enableLayout: Boolean (Optional)
+ * enableFigureDescription: Boolean (Optional)
+ * enableFigureAnalysis: Boolean (Optional)
+ * enableFormula: Boolean (Optional)
+ * tableFormat: String(html/markdown) (Optional)
+ * chartFormat: String(chartJs/markdown) (Optional)
+ * annotationFormat: String(none/markdown) (Optional)
+ * disableFaceBlurring: Boolean (Optional)
+ * estimateFieldSourceAndConfidence: Boolean (Optional)
+ * contentCategories (Optional): {
+ * String (Required): {
+ * description: String (Optional)
+ * analyzerId: String (Optional)
+ * analyzer (Optional): (recursive schema, see analyzer above)
+ * }
+ * }
+ * enableSegment: Boolean (Optional)
+ * segmentPerPage: Boolean (Optional)
+ * omitContent: Boolean (Optional)
+ * }
+ * fieldSchema (Optional): {
+ * name: String (Optional)
+ * description: String (Optional)
+ * fields (Optional, Required on create): {
+ * String (Required): {
+ * method: String(generate/extract/classify) (Optional)
+ * type: String(string/date/time/number/integer/boolean/array/object/json) (Optional)
+ * description: String (Optional)
+ * items (Optional): (recursive schema, see items above)
+ * properties (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * examples (Optional): [
+ * String (Optional)
+ * ]
+ * enum (Optional): [
+ * String (Optional)
+ * ]
+ * enumDescriptions (Optional): {
+ * String: String (Required)
+ * }
+ * $ref: String (Optional)
+ * estimateSourceAndConfidence: Boolean (Optional)
+ * }
+ * }
+ * definitions (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * }
+ * dynamicFieldSchema: Boolean (Optional)
+ * processingLocation: String(geography/dataZone/global) (Optional)
+ * knowledgeSources (Optional): [
+ * (Optional){
+ * kind: String(labeledData) (Required)
+ * }
+ * ]
+ * models (Optional): {
+ * String: String (Required)
+ * }
+ * supportedModels (Optional): {
+ * completion (Optional): [
+ * String (Optional)
+ * ]
+ * embedding (Optional): [
+ * String (Optional)
+ * ]
+ * }
+ * }
+ * }
+ *
+ *
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * analyzerId: String (Required)
+ * description: String (Optional)
+ * tags (Optional): {
+ * String: String (Required)
+ * }
+ * status: String(creating/ready/deleting/failed) (Required)
+ * createdAt: OffsetDateTime (Required)
+ * lastModifiedAt: OffsetDateTime (Required)
+ * warnings (Optional): [
+ * (Optional){
+ * code: String (Required)
+ * message: String (Required)
+ * target: String (Optional)
+ * details (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * innererror (Optional): {
+ * code: String (Optional)
+ * innererror (Optional): (recursive schema, see innererror above)
+ * }
+ * }
+ * ]
+ * baseAnalyzerId: String (Optional)
+ * config (Optional): {
+ * returnDetails: Boolean (Optional)
+ * locales (Optional): [
+ * String (Optional)
+ * ]
+ * enableOcr: Boolean (Optional)
+ * enableLayout: Boolean (Optional)
+ * enableFigureDescription: Boolean (Optional)
+ * enableFigureAnalysis: Boolean (Optional)
+ * enableFormula: Boolean (Optional)
+ * tableFormat: String(html/markdown) (Optional)
+ * chartFormat: String(chartJs/markdown) (Optional)
+ * annotationFormat: String(none/markdown) (Optional)
+ * disableFaceBlurring: Boolean (Optional)
+ * estimateFieldSourceAndConfidence: Boolean (Optional)
+ * contentCategories (Optional): {
+ * String (Required): {
+ * description: String (Optional)
+ * analyzerId: String (Optional)
+ * analyzer (Optional): (recursive schema, see analyzer above)
+ * }
+ * }
+ * enableSegment: Boolean (Optional)
+ * segmentPerPage: Boolean (Optional)
+ * omitContent: Boolean (Optional)
+ * }
+ * fieldSchema (Optional): {
+ * name: String (Optional)
+ * description: String (Optional)
+ * fields (Optional, Required on create): {
+ * String (Required): {
+ * method: String(generate/extract/classify) (Optional)
+ * type: String(string/date/time/number/integer/boolean/array/object/json) (Optional)
+ * description: String (Optional)
+ * items (Optional): (recursive schema, see items above)
+ * properties (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * examples (Optional): [
+ * String (Optional)
+ * ]
+ * enum (Optional): [
+ * String (Optional)
+ * ]
+ * enumDescriptions (Optional): {
+ * String: String (Required)
+ * }
+ * $ref: String (Optional)
+ * estimateSourceAndConfidence: Boolean (Optional)
+ * }
+ * }
+ * definitions (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * }
+ * dynamicFieldSchema: Boolean (Optional)
+ * processingLocation: String(geography/dataZone/global) (Optional)
+ * knowledgeSources (Optional): [
+ * (Optional){
+ * kind: String(labeledData) (Required)
+ * }
+ * ]
+ * models (Optional): {
+ * String: String (Required)
+ * }
+ * supportedModels (Optional): {
+ * completion (Optional): [
+ * String (Optional)
+ * ]
+ * embedding (Optional): [
+ * String (Optional)
+ * ]
+ * }
+ * }
+ * }
+ *
+ *
+ * @param analyzerId The unique identifier of the analyzer.
+ * @param resource The resource instance.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return analyzer that extracts content and fields from multimodal documents along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Response createAnalyzerWithResponse(String analyzerId, BinaryData resource,
+ RequestOptions requestOptions) {
+ final String contentType = "application/json";
+ final String accept = "application/json";
+ return service.createAnalyzerSync(this.getEndpoint(), this.getServiceVersion().getVersion(), analyzerId,
+ contentType, accept, resource, requestOptions, Context.NONE);
+ }
+
+ /**
+ * Create a new analyzer asynchronously.
+ * Query Parameters
+ *
+ * Query Parameters
+ * | Name | Type | Required | Description |
+ * | allowReplace | Boolean | No | Allow the operation to replace an existing
+ * resource. |
+ *
+ * You can add these to a request with {@link RequestOptions#addQueryParam}
+ * Request Body Schema
+ *
+ *
+ * {@code
+ * {
+ * analyzerId: String (Required)
+ * description: String (Optional)
+ * tags (Optional): {
+ * String: String (Required)
+ * }
+ * status: String(creating/ready/deleting/failed) (Required)
+ * createdAt: OffsetDateTime (Required)
+ * lastModifiedAt: OffsetDateTime (Required)
+ * warnings (Optional): [
+ * (Optional){
+ * code: String (Required)
+ * message: String (Required)
+ * target: String (Optional)
+ * details (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * innererror (Optional): {
+ * code: String (Optional)
+ * innererror (Optional): (recursive schema, see innererror above)
+ * }
+ * }
+ * ]
+ * baseAnalyzerId: String (Optional)
+ * config (Optional): {
+ * returnDetails: Boolean (Optional)
+ * locales (Optional): [
+ * String (Optional)
+ * ]
+ * enableOcr: Boolean (Optional)
+ * enableLayout: Boolean (Optional)
+ * enableFigureDescription: Boolean (Optional)
+ * enableFigureAnalysis: Boolean (Optional)
+ * enableFormula: Boolean (Optional)
+ * tableFormat: String(html/markdown) (Optional)
+ * chartFormat: String(chartJs/markdown) (Optional)
+ * annotationFormat: String(none/markdown) (Optional)
+ * disableFaceBlurring: Boolean (Optional)
+ * estimateFieldSourceAndConfidence: Boolean (Optional)
+ * contentCategories (Optional): {
+ * String (Required): {
+ * description: String (Optional)
+ * analyzerId: String (Optional)
+ * analyzer (Optional): (recursive schema, see analyzer above)
+ * }
+ * }
+ * enableSegment: Boolean (Optional)
+ * segmentPerPage: Boolean (Optional)
+ * omitContent: Boolean (Optional)
+ * }
+ * fieldSchema (Optional): {
+ * name: String (Optional)
+ * description: String (Optional)
+ * fields (Optional, Required on create): {
+ * String (Required): {
+ * method: String(generate/extract/classify) (Optional)
+ * type: String(string/date/time/number/integer/boolean/array/object/json) (Optional)
+ * description: String (Optional)
+ * items (Optional): (recursive schema, see items above)
+ * properties (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * examples (Optional): [
+ * String (Optional)
+ * ]
+ * enum (Optional): [
+ * String (Optional)
+ * ]
+ * enumDescriptions (Optional): {
+ * String: String (Required)
+ * }
+ * $ref: String (Optional)
+ * estimateSourceAndConfidence: Boolean (Optional)
+ * }
+ * }
+ * definitions (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * }
+ * dynamicFieldSchema: Boolean (Optional)
+ * processingLocation: String(geography/dataZone/global) (Optional)
+ * knowledgeSources (Optional): [
+ * (Optional){
+ * kind: String(labeledData) (Required)
+ * }
+ * ]
+ * models (Optional): {
+ * String: String (Required)
+ * }
+ * supportedModels (Optional): {
+ * completion (Optional): [
+ * String (Optional)
+ * ]
+ * embedding (Optional): [
+ * String (Optional)
+ * ]
+ * }
+ * }
+ * }
+ *
+ *
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * analyzerId: String (Required)
+ * description: String (Optional)
+ * tags (Optional): {
+ * String: String (Required)
+ * }
+ * status: String(creating/ready/deleting/failed) (Required)
+ * createdAt: OffsetDateTime (Required)
+ * lastModifiedAt: OffsetDateTime (Required)
+ * warnings (Optional): [
+ * (Optional){
+ * code: String (Required)
+ * message: String (Required)
+ * target: String (Optional)
+ * details (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * innererror (Optional): {
+ * code: String (Optional)
+ * innererror (Optional): (recursive schema, see innererror above)
+ * }
+ * }
+ * ]
+ * baseAnalyzerId: String (Optional)
+ * config (Optional): {
+ * returnDetails: Boolean (Optional)
+ * locales (Optional): [
+ * String (Optional)
+ * ]
+ * enableOcr: Boolean (Optional)
+ * enableLayout: Boolean (Optional)
+ * enableFigureDescription: Boolean (Optional)
+ * enableFigureAnalysis: Boolean (Optional)
+ * enableFormula: Boolean (Optional)
+ * tableFormat: String(html/markdown) (Optional)
+ * chartFormat: String(chartJs/markdown) (Optional)
+ * annotationFormat: String(none/markdown) (Optional)
+ * disableFaceBlurring: Boolean (Optional)
+ * estimateFieldSourceAndConfidence: Boolean (Optional)
+ * contentCategories (Optional): {
+ * String (Required): {
+ * description: String (Optional)
+ * analyzerId: String (Optional)
+ * analyzer (Optional): (recursive schema, see analyzer above)
+ * }
+ * }
+ * enableSegment: Boolean (Optional)
+ * segmentPerPage: Boolean (Optional)
+ * omitContent: Boolean (Optional)
+ * }
+ * fieldSchema (Optional): {
+ * name: String (Optional)
+ * description: String (Optional)
+ * fields (Optional, Required on create): {
+ * String (Required): {
+ * method: String(generate/extract/classify) (Optional)
+ * type: String(string/date/time/number/integer/boolean/array/object/json) (Optional)
+ * description: String (Optional)
+ * items (Optional): (recursive schema, see items above)
+ * properties (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * examples (Optional): [
+ * String (Optional)
+ * ]
+ * enum (Optional): [
+ * String (Optional)
+ * ]
+ * enumDescriptions (Optional): {
+ * String: String (Required)
+ * }
+ * $ref: String (Optional)
+ * estimateSourceAndConfidence: Boolean (Optional)
+ * }
+ * }
+ * definitions (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * }
+ * dynamicFieldSchema: Boolean (Optional)
+ * processingLocation: String(geography/dataZone/global) (Optional)
+ * knowledgeSources (Optional): [
+ * (Optional){
+ * kind: String(labeledData) (Required)
+ * }
+ * ]
+ * models (Optional): {
+ * String: String (Required)
+ * }
+ * supportedModels (Optional): {
+ * completion (Optional): [
+ * String (Optional)
+ * ]
+ * embedding (Optional): [
+ * String (Optional)
+ * ]
+ * }
+ * }
+ * }
+ *
+ *
+ * @param analyzerId The unique identifier of the analyzer.
+ * @param resource The resource instance.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return the {@link PollerFlux} for polling of analyzer that extracts content and fields from multimodal
+ * documents.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public PollerFlux
+ beginCreateAnalyzerWithModelAsync(String analyzerId, BinaryData resource, RequestOptions requestOptions) {
+ return PollerFlux.create(Duration.ofSeconds(3),
+ () -> this.createAnalyzerWithResponseAsync(analyzerId, resource, requestOptions),
+ new DefaultPollingStrategy<>(new PollingStrategyOptions(this.getHttpPipeline())
+ .setEndpoint("{endpoint}/contentunderstanding".replace("{endpoint}", this.getEndpoint()))
+ .setContext(requestOptions != null && requestOptions.getContext() != null
+ ? requestOptions.getContext()
+ : Context.NONE)
+ .setServiceVersion(this.getServiceVersion().getVersion())),
+ TypeReference.createInstance(ContentAnalyzerOperationStatus.class),
+ TypeReference.createInstance(ContentAnalyzer.class));
+ }
+
+ /**
+ * Create a new analyzer asynchronously.
+ * Query Parameters
+ *
+ * Query Parameters
+ * | Name | Type | Required | Description |
+ * | allowReplace | Boolean | No | Allow the operation to replace an existing
+ * resource. |
+ *
+ * You can add these to a request with {@link RequestOptions#addQueryParam}
+ * Request Body Schema
+ *
+ *
+ * {@code
+ * {
+ * analyzerId: String (Required)
+ * description: String (Optional)
+ * tags (Optional): {
+ * String: String (Required)
+ * }
+ * status: String(creating/ready/deleting/failed) (Required)
+ * createdAt: OffsetDateTime (Required)
+ * lastModifiedAt: OffsetDateTime (Required)
+ * warnings (Optional): [
+ * (Optional){
+ * code: String (Required)
+ * message: String (Required)
+ * target: String (Optional)
+ * details (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * innererror (Optional): {
+ * code: String (Optional)
+ * innererror (Optional): (recursive schema, see innererror above)
+ * }
+ * }
+ * ]
+ * baseAnalyzerId: String (Optional)
+ * config (Optional): {
+ * returnDetails: Boolean (Optional)
+ * locales (Optional): [
+ * String (Optional)
+ * ]
+ * enableOcr: Boolean (Optional)
+ * enableLayout: Boolean (Optional)
+ * enableFigureDescription: Boolean (Optional)
+ * enableFigureAnalysis: Boolean (Optional)
+ * enableFormula: Boolean (Optional)
+ * tableFormat: String(html/markdown) (Optional)
+ * chartFormat: String(chartJs/markdown) (Optional)
+ * annotationFormat: String(none/markdown) (Optional)
+ * disableFaceBlurring: Boolean (Optional)
+ * estimateFieldSourceAndConfidence: Boolean (Optional)
+ * contentCategories (Optional): {
+ * String (Required): {
+ * description: String (Optional)
+ * analyzerId: String (Optional)
+ * analyzer (Optional): (recursive schema, see analyzer above)
+ * }
+ * }
+ * enableSegment: Boolean (Optional)
+ * segmentPerPage: Boolean (Optional)
+ * omitContent: Boolean (Optional)
+ * }
+ * fieldSchema (Optional): {
+ * name: String (Optional)
+ * description: String (Optional)
+ * fields (Optional, Required on create): {
+ * String (Required): {
+ * method: String(generate/extract/classify) (Optional)
+ * type: String(string/date/time/number/integer/boolean/array/object/json) (Optional)
+ * description: String (Optional)
+ * items (Optional): (recursive schema, see items above)
+ * properties (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * examples (Optional): [
+ * String (Optional)
+ * ]
+ * enum (Optional): [
+ * String (Optional)
+ * ]
+ * enumDescriptions (Optional): {
+ * String: String (Required)
+ * }
+ * $ref: String (Optional)
+ * estimateSourceAndConfidence: Boolean (Optional)
+ * }
+ * }
+ * definitions (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * }
+ * dynamicFieldSchema: Boolean (Optional)
+ * processingLocation: String(geography/dataZone/global) (Optional)
+ * knowledgeSources (Optional): [
+ * (Optional){
+ * kind: String(labeledData) (Required)
+ * }
+ * ]
+ * models (Optional): {
+ * String: String (Required)
+ * }
+ * supportedModels (Optional): {
+ * completion (Optional): [
+ * String (Optional)
+ * ]
+ * embedding (Optional): [
+ * String (Optional)
+ * ]
+ * }
+ * }
+ * }
+ *
+ *
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * analyzerId: String (Required)
+ * description: String (Optional)
+ * tags (Optional): {
+ * String: String (Required)
+ * }
+ * status: String(creating/ready/deleting/failed) (Required)
+ * createdAt: OffsetDateTime (Required)
+ * lastModifiedAt: OffsetDateTime (Required)
+ * warnings (Optional): [
+ * (Optional){
+ * code: String (Required)
+ * message: String (Required)
+ * target: String (Optional)
+ * details (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * innererror (Optional): {
+ * code: String (Optional)
+ * innererror (Optional): (recursive schema, see innererror above)
+ * }
+ * }
+ * ]
+ * baseAnalyzerId: String (Optional)
+ * config (Optional): {
+ * returnDetails: Boolean (Optional)
+ * locales (Optional): [
+ * String (Optional)
+ * ]
+ * enableOcr: Boolean (Optional)
+ * enableLayout: Boolean (Optional)
+ * enableFigureDescription: Boolean (Optional)
+ * enableFigureAnalysis: Boolean (Optional)
+ * enableFormula: Boolean (Optional)
+ * tableFormat: String(html/markdown) (Optional)
+ * chartFormat: String(chartJs/markdown) (Optional)
+ * annotationFormat: String(none/markdown) (Optional)
+ * disableFaceBlurring: Boolean (Optional)
+ * estimateFieldSourceAndConfidence: Boolean (Optional)
+ * contentCategories (Optional): {
+ * String (Required): {
+ * description: String (Optional)
+ * analyzerId: String (Optional)
+ * analyzer (Optional): (recursive schema, see analyzer above)
+ * }
+ * }
+ * enableSegment: Boolean (Optional)
+ * segmentPerPage: Boolean (Optional)
+ * omitContent: Boolean (Optional)
+ * }
+ * fieldSchema (Optional): {
+ * name: String (Optional)
+ * description: String (Optional)
+ * fields (Optional, Required on create): {
+ * String (Required): {
+ * method: String(generate/extract/classify) (Optional)
+ * type: String(string/date/time/number/integer/boolean/array/object/json) (Optional)
+ * description: String (Optional)
+ * items (Optional): (recursive schema, see items above)
+ * properties (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * examples (Optional): [
+ * String (Optional)
+ * ]
+ * enum (Optional): [
+ * String (Optional)
+ * ]
+ * enumDescriptions (Optional): {
+ * String: String (Required)
+ * }
+ * $ref: String (Optional)
+ * estimateSourceAndConfidence: Boolean (Optional)
+ * }
+ * }
+ * definitions (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * }
+ * dynamicFieldSchema: Boolean (Optional)
+ * processingLocation: String(geography/dataZone/global) (Optional)
+ * knowledgeSources (Optional): [
+ * (Optional){
+ * kind: String(labeledData) (Required)
+ * }
+ * ]
+ * models (Optional): {
+ * String: String (Required)
+ * }
+ * supportedModels (Optional): {
+ * completion (Optional): [
+ * String (Optional)
+ * ]
+ * embedding (Optional): [
+ * String (Optional)
+ * ]
+ * }
+ * }
+ * }
+ *
+ *
+ * @param analyzerId The unique identifier of the analyzer.
+ * @param resource The resource instance.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return the {@link SyncPoller} for polling of analyzer that extracts content and fields from multimodal
+ * documents.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller beginCreateAnalyzerWithModel(String analyzerId,
+ BinaryData resource, RequestOptions requestOptions) {
+ return SyncPoller.createPoller(Duration.ofSeconds(3),
+ () -> this.createAnalyzerWithResponse(analyzerId, resource, requestOptions),
+ new SyncDefaultPollingStrategy<>(new PollingStrategyOptions(this.getHttpPipeline())
+ .setEndpoint("{endpoint}/contentunderstanding".replace("{endpoint}", this.getEndpoint()))
+ .setContext(requestOptions != null && requestOptions.getContext() != null
+ ? requestOptions.getContext()
+ : Context.NONE)
+ .setServiceVersion(this.getServiceVersion().getVersion())),
+ TypeReference.createInstance(ContentAnalyzerOperationStatus.class),
+ TypeReference.createInstance(ContentAnalyzer.class));
+ }
+
+ /**
+ * Create a new analyzer asynchronously.
+ * Query Parameters
+ *
+ * Query Parameters
+ * | Name | Type | Required | Description |
+ * | allowReplace | Boolean | No | Allow the operation to replace an existing
+ * resource. |
+ *
+ * You can add these to a request with {@link RequestOptions#addQueryParam}
+ * Request Body Schema
+ *
+ *
+ * {@code
+ * {
+ * analyzerId: String (Required)
+ * description: String (Optional)
+ * tags (Optional): {
+ * String: String (Required)
+ * }
+ * status: String(creating/ready/deleting/failed) (Required)
+ * createdAt: OffsetDateTime (Required)
+ * lastModifiedAt: OffsetDateTime (Required)
+ * warnings (Optional): [
+ * (Optional){
+ * code: String (Required)
+ * message: String (Required)
+ * target: String (Optional)
+ * details (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * innererror (Optional): {
+ * code: String (Optional)
+ * innererror (Optional): (recursive schema, see innererror above)
+ * }
+ * }
+ * ]
+ * baseAnalyzerId: String (Optional)
+ * config (Optional): {
+ * returnDetails: Boolean (Optional)
+ * locales (Optional): [
+ * String (Optional)
+ * ]
+ * enableOcr: Boolean (Optional)
+ * enableLayout: Boolean (Optional)
+ * enableFigureDescription: Boolean (Optional)
+ * enableFigureAnalysis: Boolean (Optional)
+ * enableFormula: Boolean (Optional)
+ * tableFormat: String(html/markdown) (Optional)
+ * chartFormat: String(chartJs/markdown) (Optional)
+ * annotationFormat: String(none/markdown) (Optional)
+ * disableFaceBlurring: Boolean (Optional)
+ * estimateFieldSourceAndConfidence: Boolean (Optional)
+ * contentCategories (Optional): {
+ * String (Required): {
+ * description: String (Optional)
+ * analyzerId: String (Optional)
+ * analyzer (Optional): (recursive schema, see analyzer above)
+ * }
+ * }
+ * enableSegment: Boolean (Optional)
+ * segmentPerPage: Boolean (Optional)
+ * omitContent: Boolean (Optional)
+ * }
+ * fieldSchema (Optional): {
+ * name: String (Optional)
+ * description: String (Optional)
+ * fields (Optional, Required on create): {
+ * String (Required): {
+ * method: String(generate/extract/classify) (Optional)
+ * type: String(string/date/time/number/integer/boolean/array/object/json) (Optional)
+ * description: String (Optional)
+ * items (Optional): (recursive schema, see items above)
+ * properties (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * examples (Optional): [
+ * String (Optional)
+ * ]
+ * enum (Optional): [
+ * String (Optional)
+ * ]
+ * enumDescriptions (Optional): {
+ * String: String (Required)
+ * }
+ * $ref: String (Optional)
+ * estimateSourceAndConfidence: Boolean (Optional)
+ * }
+ * }
+ * definitions (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * }
+ * dynamicFieldSchema: Boolean (Optional)
+ * processingLocation: String(geography/dataZone/global) (Optional)
+ * knowledgeSources (Optional): [
+ * (Optional){
+ * kind: String(labeledData) (Required)
+ * }
+ * ]
+ * models (Optional): {
+ * String: String (Required)
+ * }
+ * supportedModels (Optional): {
+ * completion (Optional): [
+ * String (Optional)
+ * ]
+ * embedding (Optional): [
+ * String (Optional)
+ * ]
+ * }
+ * }
+ * }
+ *
+ *
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * analyzerId: String (Required)
+ * description: String (Optional)
+ * tags (Optional): {
+ * String: String (Required)
+ * }
+ * status: String(creating/ready/deleting/failed) (Required)
+ * createdAt: OffsetDateTime (Required)
+ * lastModifiedAt: OffsetDateTime (Required)
+ * warnings (Optional): [
+ * (Optional){
+ * code: String (Required)
+ * message: String (Required)
+ * target: String (Optional)
+ * details (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * innererror (Optional): {
+ * code: String (Optional)
+ * innererror (Optional): (recursive schema, see innererror above)
+ * }
+ * }
+ * ]
+ * baseAnalyzerId: String (Optional)
+ * config (Optional): {
+ * returnDetails: Boolean (Optional)
+ * locales (Optional): [
+ * String (Optional)
+ * ]
+ * enableOcr: Boolean (Optional)
+ * enableLayout: Boolean (Optional)
+ * enableFigureDescription: Boolean (Optional)
+ * enableFigureAnalysis: Boolean (Optional)
+ * enableFormula: Boolean (Optional)
+ * tableFormat: String(html/markdown) (Optional)
+ * chartFormat: String(chartJs/markdown) (Optional)
+ * annotationFormat: String(none/markdown) (Optional)
+ * disableFaceBlurring: Boolean (Optional)
+ * estimateFieldSourceAndConfidence: Boolean (Optional)
+ * contentCategories (Optional): {
+ * String (Required): {
+ * description: String (Optional)
+ * analyzerId: String (Optional)
+ * analyzer (Optional): (recursive schema, see analyzer above)
+ * }
+ * }
+ * enableSegment: Boolean (Optional)
+ * segmentPerPage: Boolean (Optional)
+ * omitContent: Boolean (Optional)
+ * }
+ * fieldSchema (Optional): {
+ * name: String (Optional)
+ * description: String (Optional)
+ * fields (Optional, Required on create): {
+ * String (Required): {
+ * method: String(generate/extract/classify) (Optional)
+ * type: String(string/date/time/number/integer/boolean/array/object/json) (Optional)
+ * description: String (Optional)
+ * items (Optional): (recursive schema, see items above)
+ * properties (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * examples (Optional): [
+ * String (Optional)
+ * ]
+ * enum (Optional): [
+ * String (Optional)
+ * ]
+ * enumDescriptions (Optional): {
+ * String: String (Required)
+ * }
+ * $ref: String (Optional)
+ * estimateSourceAndConfidence: Boolean (Optional)
+ * }
+ * }
+ * definitions (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * }
+ * dynamicFieldSchema: Boolean (Optional)
+ * processingLocation: String(geography/dataZone/global) (Optional)
+ * knowledgeSources (Optional): [
+ * (Optional){
+ * kind: String(labeledData) (Required)
+ * }
+ * ]
+ * models (Optional): {
+ * String: String (Required)
+ * }
+ * supportedModels (Optional): {
+ * completion (Optional): [
+ * String (Optional)
+ * ]
+ * embedding (Optional): [
+ * String (Optional)
+ * ]
+ * }
+ * }
+ * }
+ *
+ *
+ * @param analyzerId The unique identifier of the analyzer.
+ * @param resource The resource instance.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return the {@link PollerFlux} for polling of analyzer that extracts content and fields from multimodal
+ * documents.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public PollerFlux beginCreateAnalyzerAsync(String analyzerId, BinaryData resource,
+ RequestOptions requestOptions) {
+ return PollerFlux.create(Duration.ofSeconds(3),
+ () -> this.createAnalyzerWithResponseAsync(analyzerId, resource, requestOptions),
+ new DefaultPollingStrategy<>(new PollingStrategyOptions(this.getHttpPipeline())
+ .setEndpoint("{endpoint}/contentunderstanding".replace("{endpoint}", this.getEndpoint()))
+ .setContext(requestOptions != null && requestOptions.getContext() != null
+ ? requestOptions.getContext()
+ : Context.NONE)
+ .setServiceVersion(this.getServiceVersion().getVersion())),
+ TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class));
+ }
+
+ /**
+ * Create a new analyzer asynchronously.
+ * Query Parameters
+ *
+ * Query Parameters
+ * | Name | Type | Required | Description |
+ * | allowReplace | Boolean | No | Allow the operation to replace an existing
+ * resource. |
+ *
+ * You can add these to a request with {@link RequestOptions#addQueryParam}
+ * Request Body Schema
+ *
+ *
+ * {@code
+ * {
+ * analyzerId: String (Required)
+ * description: String (Optional)
+ * tags (Optional): {
+ * String: String (Required)
+ * }
+ * status: String(creating/ready/deleting/failed) (Required)
+ * createdAt: OffsetDateTime (Required)
+ * lastModifiedAt: OffsetDateTime (Required)
+ * warnings (Optional): [
+ * (Optional){
+ * code: String (Required)
+ * message: String (Required)
+ * target: String (Optional)
+ * details (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * innererror (Optional): {
+ * code: String (Optional)
+ * innererror (Optional): (recursive schema, see innererror above)
+ * }
+ * }
+ * ]
+ * baseAnalyzerId: String (Optional)
+ * config (Optional): {
+ * returnDetails: Boolean (Optional)
+ * locales (Optional): [
+ * String (Optional)
+ * ]
+ * enableOcr: Boolean (Optional)
+ * enableLayout: Boolean (Optional)
+ * enableFigureDescription: Boolean (Optional)
+ * enableFigureAnalysis: Boolean (Optional)
+ * enableFormula: Boolean (Optional)
+ * tableFormat: String(html/markdown) (Optional)
+ * chartFormat: String(chartJs/markdown) (Optional)
+ * annotationFormat: String(none/markdown) (Optional)
+ * disableFaceBlurring: Boolean (Optional)
+ * estimateFieldSourceAndConfidence: Boolean (Optional)
+ * contentCategories (Optional): {
+ * String (Required): {
+ * description: String (Optional)
+ * analyzerId: String (Optional)
+ * analyzer (Optional): (recursive schema, see analyzer above)
+ * }
+ * }
+ * enableSegment: Boolean (Optional)
+ * segmentPerPage: Boolean (Optional)
+ * omitContent: Boolean (Optional)
+ * }
+ * fieldSchema (Optional): {
+ * name: String (Optional)
+ * description: String (Optional)
+ * fields (Optional, Required on create): {
+ * String (Required): {
+ * method: String(generate/extract/classify) (Optional)
+ * type: String(string/date/time/number/integer/boolean/array/object/json) (Optional)
+ * description: String (Optional)
+ * items (Optional): (recursive schema, see items above)
+ * properties (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * examples (Optional): [
+ * String (Optional)
+ * ]
+ * enum (Optional): [
+ * String (Optional)
+ * ]
+ * enumDescriptions (Optional): {
+ * String: String (Required)
+ * }
+ * $ref: String (Optional)
+ * estimateSourceAndConfidence: Boolean (Optional)
+ * }
+ * }
+ * definitions (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * }
+ * dynamicFieldSchema: Boolean (Optional)
+ * processingLocation: String(geography/dataZone/global) (Optional)
+ * knowledgeSources (Optional): [
+ * (Optional){
+ * kind: String(labeledData) (Required)
+ * }
+ * ]
+ * models (Optional): {
+ * String: String (Required)
+ * }
+ * supportedModels (Optional): {
+ * completion (Optional): [
+ * String (Optional)
+ * ]
+ * embedding (Optional): [
+ * String (Optional)
+ * ]
+ * }
+ * }
+ * }
+ *
+ *
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * analyzerId: String (Required)
+ * description: String (Optional)
+ * tags (Optional): {
+ * String: String (Required)
+ * }
+ * status: String(creating/ready/deleting/failed) (Required)
+ * createdAt: OffsetDateTime (Required)
+ * lastModifiedAt: OffsetDateTime (Required)
+ * warnings (Optional): [
+ * (Optional){
+ * code: String (Required)
+ * message: String (Required)
+ * target: String (Optional)
+ * details (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * innererror (Optional): {
+ * code: String (Optional)
+ * innererror (Optional): (recursive schema, see innererror above)
+ * }
+ * }
+ * ]
+ * baseAnalyzerId: String (Optional)
+ * config (Optional): {
+ * returnDetails: Boolean (Optional)
+ * locales (Optional): [
+ * String (Optional)
+ * ]
+ * enableOcr: Boolean (Optional)
+ * enableLayout: Boolean (Optional)
+ * enableFigureDescription: Boolean (Optional)
+ * enableFigureAnalysis: Boolean (Optional)
+ * enableFormula: Boolean (Optional)
+ * tableFormat: String(html/markdown) (Optional)
+ * chartFormat: String(chartJs/markdown) (Optional)
+ * annotationFormat: String(none/markdown) (Optional)
+ * disableFaceBlurring: Boolean (Optional)
+ * estimateFieldSourceAndConfidence: Boolean (Optional)
+ * contentCategories (Optional): {
+ * String (Required): {
+ * description: String (Optional)
+ * analyzerId: String (Optional)
+ * analyzer (Optional): (recursive schema, see analyzer above)
+ * }
+ * }
+ * enableSegment: Boolean (Optional)
+ * segmentPerPage: Boolean (Optional)
+ * omitContent: Boolean (Optional)
+ * }
+ * fieldSchema (Optional): {
+ * name: String (Optional)
+ * description: String (Optional)
+ * fields (Optional, Required on create): {
+ * String (Required): {
+ * method: String(generate/extract/classify) (Optional)
+ * type: String(string/date/time/number/integer/boolean/array/object/json) (Optional)
+ * description: String (Optional)
+ * items (Optional): (recursive schema, see items above)
+ * properties (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * examples (Optional): [
+ * String (Optional)
+ * ]
+ * enum (Optional): [
+ * String (Optional)
+ * ]
+ * enumDescriptions (Optional): {
+ * String: String (Required)
+ * }
+ * $ref: String (Optional)
+ * estimateSourceAndConfidence: Boolean (Optional)
+ * }
+ * }
+ * definitions (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * }
+ * dynamicFieldSchema: Boolean (Optional)
+ * processingLocation: String(geography/dataZone/global) (Optional)
+ * knowledgeSources (Optional): [
+ * (Optional){
+ * kind: String(labeledData) (Required)
+ * }
+ * ]
+ * models (Optional): {
+ * String: String (Required)
+ * }
+ * supportedModels (Optional): {
+ * completion (Optional): [
+ * String (Optional)
+ * ]
+ * embedding (Optional): [
+ * String (Optional)
+ * ]
+ * }
+ * }
+ * }
+ *
+ *
+ * @param analyzerId The unique identifier of the analyzer.
+ * @param resource The resource instance.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return the {@link SyncPoller} for polling of analyzer that extracts content and fields from multimodal
+ * documents.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller beginCreateAnalyzer(String analyzerId, BinaryData resource,
+ RequestOptions requestOptions) {
+ return SyncPoller.createPoller(Duration.ofSeconds(3),
+ () -> this.createAnalyzerWithResponse(analyzerId, resource, requestOptions),
+ new SyncDefaultPollingStrategy<>(new PollingStrategyOptions(this.getHttpPipeline())
+ .setEndpoint("{endpoint}/contentunderstanding".replace("{endpoint}", this.getEndpoint()))
+ .setContext(requestOptions != null && requestOptions.getContext() != null
+ ? requestOptions.getContext()
+ : Context.NONE)
+ .setServiceVersion(this.getServiceVersion().getVersion())),
+ TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class));
+ }
+
+ /**
+ * Delete analyzer.
+ *
+ * @param analyzerId The unique identifier of the analyzer.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> deleteAnalyzerWithResponseAsync(String analyzerId, RequestOptions requestOptions) {
+ return FluxUtil.withContext(context -> service.deleteAnalyzer(this.getEndpoint(),
+ this.getServiceVersion().getVersion(), analyzerId, requestOptions, context));
+ }
+
+ /**
+ * Delete analyzer.
+ *
+ * @param analyzerId The unique identifier of the analyzer.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return the {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response deleteAnalyzerWithResponse(String analyzerId, RequestOptions requestOptions) {
+ return service.deleteAnalyzerSync(this.getEndpoint(), this.getServiceVersion().getVersion(), analyzerId,
+ requestOptions, Context.NONE);
+ }
+
+ /**
+ * Mark the result of an analysis operation for deletion.
+ *
+ * @param operationId Operation identifier.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> deleteResultWithResponseAsync(String operationId, RequestOptions requestOptions) {
+ return FluxUtil.withContext(context -> service.deleteResult(this.getEndpoint(),
+ this.getServiceVersion().getVersion(), operationId, requestOptions, context));
+ }
+
+ /**
+ * Mark the result of an analysis operation for deletion.
+ *
+ * @param operationId Operation identifier.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return the {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response deleteResultWithResponse(String operationId, RequestOptions requestOptions) {
+ return service.deleteResultSync(this.getEndpoint(), this.getServiceVersion().getVersion(), operationId,
+ requestOptions, Context.NONE);
+ }
+
+ /**
+ * Get analyzer properties.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * analyzerId: String (Required)
+ * description: String (Optional)
+ * tags (Optional): {
+ * String: String (Required)
+ * }
+ * status: String(creating/ready/deleting/failed) (Required)
+ * createdAt: OffsetDateTime (Required)
+ * lastModifiedAt: OffsetDateTime (Required)
+ * warnings (Optional): [
+ * (Optional){
+ * code: String (Required)
+ * message: String (Required)
+ * target: String (Optional)
+ * details (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * innererror (Optional): {
+ * code: String (Optional)
+ * innererror (Optional): (recursive schema, see innererror above)
+ * }
+ * }
+ * ]
+ * baseAnalyzerId: String (Optional)
+ * config (Optional): {
+ * returnDetails: Boolean (Optional)
+ * locales (Optional): [
+ * String (Optional)
+ * ]
+ * enableOcr: Boolean (Optional)
+ * enableLayout: Boolean (Optional)
+ * enableFigureDescription: Boolean (Optional)
+ * enableFigureAnalysis: Boolean (Optional)
+ * enableFormula: Boolean (Optional)
+ * tableFormat: String(html/markdown) (Optional)
+ * chartFormat: String(chartJs/markdown) (Optional)
+ * annotationFormat: String(none/markdown) (Optional)
+ * disableFaceBlurring: Boolean (Optional)
+ * estimateFieldSourceAndConfidence: Boolean (Optional)
+ * contentCategories (Optional): {
+ * String (Required): {
+ * description: String (Optional)
+ * analyzerId: String (Optional)
+ * analyzer (Optional): (recursive schema, see analyzer above)
+ * }
+ * }
+ * enableSegment: Boolean (Optional)
+ * segmentPerPage: Boolean (Optional)
+ * omitContent: Boolean (Optional)
+ * }
+ * fieldSchema (Optional): {
+ * name: String (Optional)
+ * description: String (Optional)
+ * fields (Optional, Required on create): {
+ * String (Required): {
+ * method: String(generate/extract/classify) (Optional)
+ * type: String(string/date/time/number/integer/boolean/array/object/json) (Optional)
+ * description: String (Optional)
+ * items (Optional): (recursive schema, see items above)
+ * properties (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * examples (Optional): [
+ * String (Optional)
+ * ]
+ * enum (Optional): [
+ * String (Optional)
+ * ]
+ * enumDescriptions (Optional): {
+ * String: String (Required)
+ * }
+ * $ref: String (Optional)
+ * estimateSourceAndConfidence: Boolean (Optional)
+ * }
+ * }
+ * definitions (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * }
+ * dynamicFieldSchema: Boolean (Optional)
+ * processingLocation: String(geography/dataZone/global) (Optional)
+ * knowledgeSources (Optional): [
+ * (Optional){
+ * kind: String(labeledData) (Required)
+ * }
+ * ]
+ * models (Optional): {
+ * String: String (Required)
+ * }
+ * supportedModels (Optional): {
+ * completion (Optional): [
+ * String (Optional)
+ * ]
+ * embedding (Optional): [
+ * String (Optional)
+ * ]
+ * }
+ * }
+ * }
+ *
+ *
+ * @param analyzerId The unique identifier of the analyzer.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return analyzer properties along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> getAnalyzerWithResponseAsync(String analyzerId, RequestOptions requestOptions) {
+ final String accept = "application/json";
+ return FluxUtil.withContext(context -> service.getAnalyzer(this.getEndpoint(),
+ this.getServiceVersion().getVersion(), analyzerId, accept, requestOptions, context));
+ }
+
+ /**
+ * Get analyzer properties.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * analyzerId: String (Required)
+ * description: String (Optional)
+ * tags (Optional): {
+ * String: String (Required)
+ * }
+ * status: String(creating/ready/deleting/failed) (Required)
+ * createdAt: OffsetDateTime (Required)
+ * lastModifiedAt: OffsetDateTime (Required)
+ * warnings (Optional): [
+ * (Optional){
+ * code: String (Required)
+ * message: String (Required)
+ * target: String (Optional)
+ * details (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * innererror (Optional): {
+ * code: String (Optional)
+ * innererror (Optional): (recursive schema, see innererror above)
+ * }
+ * }
+ * ]
+ * baseAnalyzerId: String (Optional)
+ * config (Optional): {
+ * returnDetails: Boolean (Optional)
+ * locales (Optional): [
+ * String (Optional)
+ * ]
+ * enableOcr: Boolean (Optional)
+ * enableLayout: Boolean (Optional)
+ * enableFigureDescription: Boolean (Optional)
+ * enableFigureAnalysis: Boolean (Optional)
+ * enableFormula: Boolean (Optional)
+ * tableFormat: String(html/markdown) (Optional)
+ * chartFormat: String(chartJs/markdown) (Optional)
+ * annotationFormat: String(none/markdown) (Optional)
+ * disableFaceBlurring: Boolean (Optional)
+ * estimateFieldSourceAndConfidence: Boolean (Optional)
+ * contentCategories (Optional): {
+ * String (Required): {
+ * description: String (Optional)
+ * analyzerId: String (Optional)
+ * analyzer (Optional): (recursive schema, see analyzer above)
+ * }
+ * }
+ * enableSegment: Boolean (Optional)
+ * segmentPerPage: Boolean (Optional)
+ * omitContent: Boolean (Optional)
+ * }
+ * fieldSchema (Optional): {
+ * name: String (Optional)
+ * description: String (Optional)
+ * fields (Optional, Required on create): {
+ * String (Required): {
+ * method: String(generate/extract/classify) (Optional)
+ * type: String(string/date/time/number/integer/boolean/array/object/json) (Optional)
+ * description: String (Optional)
+ * items (Optional): (recursive schema, see items above)
+ * properties (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * examples (Optional): [
+ * String (Optional)
+ * ]
+ * enum (Optional): [
+ * String (Optional)
+ * ]
+ * enumDescriptions (Optional): {
+ * String: String (Required)
+ * }
+ * $ref: String (Optional)
+ * estimateSourceAndConfidence: Boolean (Optional)
+ * }
+ * }
+ * definitions (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * }
+ * dynamicFieldSchema: Boolean (Optional)
+ * processingLocation: String(geography/dataZone/global) (Optional)
+ * knowledgeSources (Optional): [
+ * (Optional){
+ * kind: String(labeledData) (Required)
+ * }
+ * ]
+ * models (Optional): {
+ * String: String (Required)
+ * }
+ * supportedModels (Optional): {
+ * completion (Optional): [
+ * String (Optional)
+ * ]
+ * embedding (Optional): [
+ * String (Optional)
+ * ]
+ * }
+ * }
+ * }
+ *
+ *
+ * @param analyzerId The unique identifier of the analyzer.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return analyzer properties along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response getAnalyzerWithResponse(String analyzerId, RequestOptions requestOptions) {
+ final String accept = "application/json";
+ return service.getAnalyzerSync(this.getEndpoint(), this.getServiceVersion().getVersion(), analyzerId, accept,
+ requestOptions, Context.NONE);
+ }
+
+ /**
+ * Return default settings for this Content Understanding resource.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * modelDeployments (Required): {
+ * String: String (Required)
+ * }
+ * }
+ * }
+ *
+ *
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return default settings for this Content Understanding resource along with {@link Response} on successful
+ * completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> getDefaultsWithResponseAsync(RequestOptions requestOptions) {
+ final String accept = "application/json";
+ return FluxUtil.withContext(context -> service.getDefaults(this.getEndpoint(),
+ this.getServiceVersion().getVersion(), accept, requestOptions, context));
+ }
+
+ /**
+ * Return default settings for this Content Understanding resource.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * modelDeployments (Required): {
+ * String: String (Required)
+ * }
+ * }
+ * }
+ *
+ *
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return default settings for this Content Understanding resource along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response getDefaultsWithResponse(RequestOptions requestOptions) {
+ final String accept = "application/json";
+ return service.getDefaultsSync(this.getEndpoint(), this.getServiceVersion().getVersion(), accept,
+ requestOptions, Context.NONE);
+ }
+
+ /**
+ * Get the status of an analyzer creation operation.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * id: String (Required)
+ * status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+ * error (Optional): {
+ * code: String (Required)
+ * message: String (Required)
+ * target: String (Optional)
+ * details (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * innererror (Optional): {
+ * code: String (Optional)
+ * innererror (Optional): (recursive schema, see innererror above)
+ * }
+ * }
+ * result (Optional): {
+ * analyzerId: String (Required)
+ * description: String (Optional)
+ * tags (Optional): {
+ * String: String (Required)
+ * }
+ * status: String(creating/ready/deleting/failed) (Required)
+ * createdAt: OffsetDateTime (Required)
+ * lastModifiedAt: OffsetDateTime (Required)
+ * warnings (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * baseAnalyzerId: String (Optional)
+ * config (Optional): {
+ * returnDetails: Boolean (Optional)
+ * locales (Optional): [
+ * String (Optional)
+ * ]
+ * enableOcr: Boolean (Optional)
+ * enableLayout: Boolean (Optional)
+ * enableFigureDescription: Boolean (Optional)
+ * enableFigureAnalysis: Boolean (Optional)
+ * enableFormula: Boolean (Optional)
+ * tableFormat: String(html/markdown) (Optional)
+ * chartFormat: String(chartJs/markdown) (Optional)
+ * annotationFormat: String(none/markdown) (Optional)
+ * disableFaceBlurring: Boolean (Optional)
+ * estimateFieldSourceAndConfidence: Boolean (Optional)
+ * contentCategories (Optional): {
+ * String (Required): {
+ * description: String (Optional)
+ * analyzerId: String (Optional)
+ * analyzer (Optional): (recursive schema, see analyzer above)
+ * }
+ * }
+ * enableSegment: Boolean (Optional)
+ * segmentPerPage: Boolean (Optional)
+ * omitContent: Boolean (Optional)
+ * }
+ * fieldSchema (Optional): {
+ * name: String (Optional)
+ * description: String (Optional)
+ * fields (Optional, Required on create): {
+ * String (Required): {
+ * method: String(generate/extract/classify) (Optional)
+ * type: String(string/date/time/number/integer/boolean/array/object/json) (Optional)
+ * description: String (Optional)
+ * items (Optional): (recursive schema, see items above)
+ * properties (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * examples (Optional): [
+ * String (Optional)
+ * ]
+ * enum (Optional): [
+ * String (Optional)
+ * ]
+ * enumDescriptions (Optional): {
+ * String: String (Required)
+ * }
+ * $ref: String (Optional)
+ * estimateSourceAndConfidence: Boolean (Optional)
+ * }
+ * }
+ * definitions (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * }
+ * dynamicFieldSchema: Boolean (Optional)
+ * processingLocation: String(geography/dataZone/global) (Optional)
+ * knowledgeSources (Optional): [
+ * (Optional){
+ * kind: String(labeledData) (Required)
+ * }
+ * ]
+ * models (Optional): {
+ * String: String (Required)
+ * }
+ * supportedModels (Optional): {
+ * completion (Optional): [
+ * String (Optional)
+ * ]
+ * embedding (Optional): [
+ * String (Optional)
+ * ]
+ * }
+ * }
+ * usage (Optional): {
+ * documentPagesMinimal: Integer (Optional)
+ * documentPagesBasic: Integer (Optional)
+ * documentPagesStandard: Integer (Optional)
+ * audioHours: Double (Optional)
+ * videoHours: Double (Optional)
+ * contextualizationTokens: Integer (Optional)
+ * tokens (Optional): {
+ * String: int (Required)
+ * }
+ * }
+ * }
+ * }
+ *
+ *
+ * @param analyzerId The unique identifier of the analyzer.
+ * @param operationId The unique ID of the operation.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return the status of an analyzer creation operation along with {@link Response} on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> getOperationStatusWithResponseAsync(String analyzerId, String operationId,
+ RequestOptions requestOptions) {
+ final String accept = "application/json";
+ return FluxUtil.withContext(context -> service.getOperationStatus(this.getEndpoint(),
+ this.getServiceVersion().getVersion(), analyzerId, operationId, accept, requestOptions, context));
+ }
+
+ /**
+ * Get the status of an analyzer creation operation.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * id: String (Required)
+ * status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+ * error (Optional): {
+ * code: String (Required)
+ * message: String (Required)
+ * target: String (Optional)
+ * details (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * innererror (Optional): {
+ * code: String (Optional)
+ * innererror (Optional): (recursive schema, see innererror above)
+ * }
+ * }
+ * result (Optional): {
+ * analyzerId: String (Required)
+ * description: String (Optional)
+ * tags (Optional): {
+ * String: String (Required)
+ * }
+ * status: String(creating/ready/deleting/failed) (Required)
+ * createdAt: OffsetDateTime (Required)
+ * lastModifiedAt: OffsetDateTime (Required)
+ * warnings (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * baseAnalyzerId: String (Optional)
+ * config (Optional): {
+ * returnDetails: Boolean (Optional)
+ * locales (Optional): [
+ * String (Optional)
+ * ]
+ * enableOcr: Boolean (Optional)
+ * enableLayout: Boolean (Optional)
+ * enableFigureDescription: Boolean (Optional)
+ * enableFigureAnalysis: Boolean (Optional)
+ * enableFormula: Boolean (Optional)
+ * tableFormat: String(html/markdown) (Optional)
+ * chartFormat: String(chartJs/markdown) (Optional)
+ * annotationFormat: String(none/markdown) (Optional)
+ * disableFaceBlurring: Boolean (Optional)
+ * estimateFieldSourceAndConfidence: Boolean (Optional)
+ * contentCategories (Optional): {
+ * String (Required): {
+ * description: String (Optional)
+ * analyzerId: String (Optional)
+ * analyzer (Optional): (recursive schema, see analyzer above)
+ * }
+ * }
+ * enableSegment: Boolean (Optional)
+ * segmentPerPage: Boolean (Optional)
+ * omitContent: Boolean (Optional)
+ * }
+ * fieldSchema (Optional): {
+ * name: String (Optional)
+ * description: String (Optional)
+ * fields (Optional, Required on create): {
+ * String (Required): {
+ * method: String(generate/extract/classify) (Optional)
+ * type: String(string/date/time/number/integer/boolean/array/object/json) (Optional)
+ * description: String (Optional)
+ * items (Optional): (recursive schema, see items above)
+ * properties (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * examples (Optional): [
+ * String (Optional)
+ * ]
+ * enum (Optional): [
+ * String (Optional)
+ * ]
+ * enumDescriptions (Optional): {
+ * String: String (Required)
+ * }
+ * $ref: String (Optional)
+ * estimateSourceAndConfidence: Boolean (Optional)
+ * }
+ * }
+ * definitions (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * }
+ * dynamicFieldSchema: Boolean (Optional)
+ * processingLocation: String(geography/dataZone/global) (Optional)
+ * knowledgeSources (Optional): [
+ * (Optional){
+ * kind: String(labeledData) (Required)
+ * }
+ * ]
+ * models (Optional): {
+ * String: String (Required)
+ * }
+ * supportedModels (Optional): {
+ * completion (Optional): [
+ * String (Optional)
+ * ]
+ * embedding (Optional): [
+ * String (Optional)
+ * ]
+ * }
+ * }
+ * usage (Optional): {
+ * documentPagesMinimal: Integer (Optional)
+ * documentPagesBasic: Integer (Optional)
+ * documentPagesStandard: Integer (Optional)
+ * audioHours: Double (Optional)
+ * videoHours: Double (Optional)
+ * contextualizationTokens: Integer (Optional)
+ * tokens (Optional): {
+ * String: int (Required)
+ * }
+ * }
+ * }
+ * }
+ *
+ *
+ * @param analyzerId The unique identifier of the analyzer.
+ * @param operationId The unique ID of the operation.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return the status of an analyzer creation operation along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response getOperationStatusWithResponse(String analyzerId, String operationId,
+ RequestOptions requestOptions) {
+ final String accept = "application/json";
+ return service.getOperationStatusSync(this.getEndpoint(), this.getServiceVersion().getVersion(), analyzerId,
+ operationId, accept, requestOptions, Context.NONE);
+ }
+
+ /**
+ * Get the result of an analysis operation.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * id: String (Required)
+ * status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+ * error (Optional): {
+ * code: String (Required)
+ * message: String (Required)
+ * target: String (Optional)
+ * details (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * innererror (Optional): {
+ * code: String (Optional)
+ * innererror (Optional): (recursive schema, see innererror above)
+ * }
+ * }
+ * result (Optional): {
+ * analyzerId: String (Optional)
+ * apiVersion: String (Optional)
+ * createdAt: OffsetDateTime (Optional)
+ * warnings (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * stringEncoding: String (Optional)
+ * contents (Required): [
+ * (Required){
+ * kind: String(document/audioVisual) (Required)
+ * mimeType: String (Required)
+ * analyzerId: String (Optional)
+ * category: String (Optional)
+ * path: String (Optional)
+ * markdown: String (Optional)
+ * fields (Optional): {
+ * String (Required): {
+ * type: String(string/date/time/number/integer/boolean/array/object/json) (Required)
+ * spans (Optional): [
+ * (Optional){
+ * offset: int (Required)
+ * length: int (Required)
+ * }
+ * ]
+ * confidence: Double (Optional)
+ * source: String (Optional)
+ * }
+ * }
+ * }
+ * ]
+ * }
+ * usage (Optional): {
+ * documentPagesMinimal: Integer (Optional)
+ * documentPagesBasic: Integer (Optional)
+ * documentPagesStandard: Integer (Optional)
+ * audioHours: Double (Optional)
+ * videoHours: Double (Optional)
+ * contextualizationTokens: Integer (Optional)
+ * tokens (Optional): {
+ * String: int (Required)
+ * }
+ * }
+ * }
+ * }
+ *
+ *
+ * @param operationId The unique ID of the operation.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return the result of an analysis operation along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> getResultWithResponseAsync(String operationId, RequestOptions requestOptions) {
+ final String accept = "application/json";
+ return FluxUtil.withContext(context -> service.getResult(this.getEndpoint(),
+ this.getServiceVersion().getVersion(), operationId, accept, requestOptions, context));
+ }
+
+ /**
+ * Get the result of an analysis operation.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * id: String (Required)
+ * status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+ * error (Optional): {
+ * code: String (Required)
+ * message: String (Required)
+ * target: String (Optional)
+ * details (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * innererror (Optional): {
+ * code: String (Optional)
+ * innererror (Optional): (recursive schema, see innererror above)
+ * }
+ * }
+ * result (Optional): {
+ * analyzerId: String (Optional)
+ * apiVersion: String (Optional)
+ * createdAt: OffsetDateTime (Optional)
+ * warnings (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * stringEncoding: String (Optional)
+ * contents (Required): [
+ * (Required){
+ * kind: String(document/audioVisual) (Required)
+ * mimeType: String (Required)
+ * analyzerId: String (Optional)
+ * category: String (Optional)
+ * path: String (Optional)
+ * markdown: String (Optional)
+ * fields (Optional): {
+ * String (Required): {
+ * type: String(string/date/time/number/integer/boolean/array/object/json) (Required)
+ * spans (Optional): [
+ * (Optional){
+ * offset: int (Required)
+ * length: int (Required)
+ * }
+ * ]
+ * confidence: Double (Optional)
+ * source: String (Optional)
+ * }
+ * }
+ * }
+ * ]
+ * }
+ * usage (Optional): {
+ * documentPagesMinimal: Integer (Optional)
+ * documentPagesBasic: Integer (Optional)
+ * documentPagesStandard: Integer (Optional)
+ * audioHours: Double (Optional)
+ * videoHours: Double (Optional)
+ * contextualizationTokens: Integer (Optional)
+ * tokens (Optional): {
+ * String: int (Required)
+ * }
+ * }
+ * }
+ * }
+ *
+ *
+ * @param operationId The unique ID of the operation.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return the result of an analysis operation along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response getResultWithResponse(String operationId, RequestOptions requestOptions) {
+ final String accept = "application/json";
+ return service.getResultSync(this.getEndpoint(), this.getServiceVersion().getVersion(), operationId, accept,
+ requestOptions, Context.NONE);
+ }
+
+ /**
+ * Get a file associated with the result of an analysis operation.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * BinaryData
+ * }
+ *
+ *
+ * @param operationId Operation identifier.
+ * @param path File path.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return a file associated with the result of an analysis operation along with {@link Response} on successful
+ * completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> getResultFileWithResponseAsync(String operationId, String path,
+ RequestOptions requestOptions) {
+ final String accept = "*/*";
+ return FluxUtil.withContext(context -> service.getResultFile(this.getEndpoint(),
+ this.getServiceVersion().getVersion(), operationId, path, accept, requestOptions, context));
+ }
+
+ /**
+ * Get a file associated with the result of an analysis operation.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * BinaryData
+ * }
+ *
+ *
+ * @param operationId Operation identifier.
+ * @param path File path.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return a file associated with the result of an analysis operation along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response getResultFileWithResponse(String operationId, String path,
+ RequestOptions requestOptions) {
+ final String accept = "*/*";
+ return service.getResultFileSync(this.getEndpoint(), this.getServiceVersion().getVersion(), operationId, path,
+ accept, requestOptions, Context.NONE);
+ }
+
+ /**
+ * Get authorization for copying this analyzer to another location.
+ * Request Body Schema
+ *
+ *
+ * {@code
+ * {
+ * targetAzureResourceId: String (Required)
+ * targetRegion: String (Optional)
+ * }
+ * }
+ *
+ *
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * source: String (Required)
+ * targetAzureResourceId: String (Required)
+ * expiresAt: OffsetDateTime (Required)
+ * }
+ * }
+ *
+ *
+ * @param analyzerId The unique identifier of the analyzer.
+ * @param grantCopyAuthorizationRequest1 The grantCopyAuthorizationRequest1 parameter.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return authorization for copying this analyzer to another location along with {@link Response} on successful
+ * completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> grantCopyAuthorizationWithResponseAsync(String analyzerId,
+ BinaryData grantCopyAuthorizationRequest1, RequestOptions requestOptions) {
+ final String contentType = "application/json";
+ final String accept = "application/json";
+ return FluxUtil.withContext(
+ context -> service.grantCopyAuthorization(this.getEndpoint(), this.getServiceVersion().getVersion(),
+ analyzerId, contentType, accept, grantCopyAuthorizationRequest1, requestOptions, context));
+ }
+
+ /**
+ * Get authorization for copying this analyzer to another location.
+ * Request Body Schema
+ *
+ *
+ * {@code
+ * {
+ * targetAzureResourceId: String (Required)
+ * targetRegion: String (Optional)
+ * }
+ * }
+ *
+ *
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * source: String (Required)
+ * targetAzureResourceId: String (Required)
+ * expiresAt: OffsetDateTime (Required)
+ * }
+ * }
+ *
+ *
+ * @param analyzerId The unique identifier of the analyzer.
+ * @param grantCopyAuthorizationRequest1 The grantCopyAuthorizationRequest1 parameter.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return authorization for copying this analyzer to another location along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response grantCopyAuthorizationWithResponse(String analyzerId,
+ BinaryData grantCopyAuthorizationRequest1, RequestOptions requestOptions) {
+ final String contentType = "application/json";
+ final String accept = "application/json";
+ return service.grantCopyAuthorizationSync(this.getEndpoint(), this.getServiceVersion().getVersion(), analyzerId,
+ contentType, accept, grantCopyAuthorizationRequest1, requestOptions, Context.NONE);
+ }
+
+ /**
+ * List analyzers.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * analyzerId: String (Required)
+ * description: String (Optional)
+ * tags (Optional): {
+ * String: String (Required)
+ * }
+ * status: String(creating/ready/deleting/failed) (Required)
+ * createdAt: OffsetDateTime (Required)
+ * lastModifiedAt: OffsetDateTime (Required)
+ * warnings (Optional): [
+ * (Optional){
+ * code: String (Required)
+ * message: String (Required)
+ * target: String (Optional)
+ * details (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * innererror (Optional): {
+ * code: String (Optional)
+ * innererror (Optional): (recursive schema, see innererror above)
+ * }
+ * }
+ * ]
+ * baseAnalyzerId: String (Optional)
+ * config (Optional): {
+ * returnDetails: Boolean (Optional)
+ * locales (Optional): [
+ * String (Optional)
+ * ]
+ * enableOcr: Boolean (Optional)
+ * enableLayout: Boolean (Optional)
+ * enableFigureDescription: Boolean (Optional)
+ * enableFigureAnalysis: Boolean (Optional)
+ * enableFormula: Boolean (Optional)
+ * tableFormat: String(html/markdown) (Optional)
+ * chartFormat: String(chartJs/markdown) (Optional)
+ * annotationFormat: String(none/markdown) (Optional)
+ * disableFaceBlurring: Boolean (Optional)
+ * estimateFieldSourceAndConfidence: Boolean (Optional)
+ * contentCategories (Optional): {
+ * String (Required): {
+ * description: String (Optional)
+ * analyzerId: String (Optional)
+ * analyzer (Optional): (recursive schema, see analyzer above)
+ * }
+ * }
+ * enableSegment: Boolean (Optional)
+ * segmentPerPage: Boolean (Optional)
+ * omitContent: Boolean (Optional)
+ * }
+ * fieldSchema (Optional): {
+ * name: String (Optional)
+ * description: String (Optional)
+ * fields (Optional, Required on create): {
+ * String (Required): {
+ * method: String(generate/extract/classify) (Optional)
+ * type: String(string/date/time/number/integer/boolean/array/object/json) (Optional)
+ * description: String (Optional)
+ * items (Optional): (recursive schema, see items above)
+ * properties (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * examples (Optional): [
+ * String (Optional)
+ * ]
+ * enum (Optional): [
+ * String (Optional)
+ * ]
+ * enumDescriptions (Optional): {
+ * String: String (Required)
+ * }
+ * $ref: String (Optional)
+ * estimateSourceAndConfidence: Boolean (Optional)
+ * }
+ * }
+ * definitions (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * }
+ * dynamicFieldSchema: Boolean (Optional)
+ * processingLocation: String(geography/dataZone/global) (Optional)
+ * knowledgeSources (Optional): [
+ * (Optional){
+ * kind: String(labeledData) (Required)
+ * }
+ * ]
+ * models (Optional): {
+ * String: String (Required)
+ * }
+ * supportedModels (Optional): {
+ * completion (Optional): [
+ * String (Optional)
+ * ]
+ * embedding (Optional): [
+ * String (Optional)
+ * ]
+ * }
+ * }
+ * }
+ *
+ *
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return paged collection of ContentAnalyzer items along with {@link PagedResponse} on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listAnalyzersSinglePageAsync(RequestOptions requestOptions) {
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.listAnalyzers(this.getEndpoint(), this.getServiceVersion().getVersion(),
+ accept, requestOptions, context))
+ .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
+ getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null));
+ }
+
+ /**
+ * List analyzers.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * analyzerId: String (Required)
+ * description: String (Optional)
+ * tags (Optional): {
+ * String: String (Required)
+ * }
+ * status: String(creating/ready/deleting/failed) (Required)
+ * createdAt: OffsetDateTime (Required)
+ * lastModifiedAt: OffsetDateTime (Required)
+ * warnings (Optional): [
+ * (Optional){
+ * code: String (Required)
+ * message: String (Required)
+ * target: String (Optional)
+ * details (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * innererror (Optional): {
+ * code: String (Optional)
+ * innererror (Optional): (recursive schema, see innererror above)
+ * }
+ * }
+ * ]
+ * baseAnalyzerId: String (Optional)
+ * config (Optional): {
+ * returnDetails: Boolean (Optional)
+ * locales (Optional): [
+ * String (Optional)
+ * ]
+ * enableOcr: Boolean (Optional)
+ * enableLayout: Boolean (Optional)
+ * enableFigureDescription: Boolean (Optional)
+ * enableFigureAnalysis: Boolean (Optional)
+ * enableFormula: Boolean (Optional)
+ * tableFormat: String(html/markdown) (Optional)
+ * chartFormat: String(chartJs/markdown) (Optional)
+ * annotationFormat: String(none/markdown) (Optional)
+ * disableFaceBlurring: Boolean (Optional)
+ * estimateFieldSourceAndConfidence: Boolean (Optional)
+ * contentCategories (Optional): {
+ * String (Required): {
+ * description: String (Optional)
+ * analyzerId: String (Optional)
+ * analyzer (Optional): (recursive schema, see analyzer above)
+ * }
+ * }
+ * enableSegment: Boolean (Optional)
+ * segmentPerPage: Boolean (Optional)
+ * omitContent: Boolean (Optional)
+ * }
+ * fieldSchema (Optional): {
+ * name: String (Optional)
+ * description: String (Optional)
+ * fields (Optional, Required on create): {
+ * String (Required): {
+ * method: String(generate/extract/classify) (Optional)
+ * type: String(string/date/time/number/integer/boolean/array/object/json) (Optional)
+ * description: String (Optional)
+ * items (Optional): (recursive schema, see items above)
+ * properties (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * examples (Optional): [
+ * String (Optional)
+ * ]
+ * enum (Optional): [
+ * String (Optional)
+ * ]
+ * enumDescriptions (Optional): {
+ * String: String (Required)
+ * }
+ * $ref: String (Optional)
+ * estimateSourceAndConfidence: Boolean (Optional)
+ * }
+ * }
+ * definitions (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * }
+ * dynamicFieldSchema: Boolean (Optional)
+ * processingLocation: String(geography/dataZone/global) (Optional)
+ * knowledgeSources (Optional): [
+ * (Optional){
+ * kind: String(labeledData) (Required)
+ * }
+ * ]
+ * models (Optional): {
+ * String: String (Required)
+ * }
+ * supportedModels (Optional): {
+ * completion (Optional): [
+ * String (Optional)
+ * ]
+ * embedding (Optional): [
+ * String (Optional)
+ * ]
+ * }
+ * }
+ * }
+ *
+ *
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return paged collection of ContentAnalyzer items as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedFlux listAnalyzersAsync(RequestOptions requestOptions) {
+ RequestOptions requestOptionsForNextPage = new RequestOptions();
+ requestOptionsForNextPage.setContext(
+ requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE);
+ return new PagedFlux<>(() -> listAnalyzersSinglePageAsync(requestOptions),
+ nextLink -> listAnalyzersNextSinglePageAsync(nextLink, requestOptionsForNextPage));
+ }
+
+ /**
+ * List analyzers.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * analyzerId: String (Required)
+ * description: String (Optional)
+ * tags (Optional): {
+ * String: String (Required)
+ * }
+ * status: String(creating/ready/deleting/failed) (Required)
+ * createdAt: OffsetDateTime (Required)
+ * lastModifiedAt: OffsetDateTime (Required)
+ * warnings (Optional): [
+ * (Optional){
+ * code: String (Required)
+ * message: String (Required)
+ * target: String (Optional)
+ * details (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * innererror (Optional): {
+ * code: String (Optional)
+ * innererror (Optional): (recursive schema, see innererror above)
+ * }
+ * }
+ * ]
+ * baseAnalyzerId: String (Optional)
+ * config (Optional): {
+ * returnDetails: Boolean (Optional)
+ * locales (Optional): [
+ * String (Optional)
+ * ]
+ * enableOcr: Boolean (Optional)
+ * enableLayout: Boolean (Optional)
+ * enableFigureDescription: Boolean (Optional)
+ * enableFigureAnalysis: Boolean (Optional)
+ * enableFormula: Boolean (Optional)
+ * tableFormat: String(html/markdown) (Optional)
+ * chartFormat: String(chartJs/markdown) (Optional)
+ * annotationFormat: String(none/markdown) (Optional)
+ * disableFaceBlurring: Boolean (Optional)
+ * estimateFieldSourceAndConfidence: Boolean (Optional)
+ * contentCategories (Optional): {
+ * String (Required): {
+ * description: String (Optional)
+ * analyzerId: String (Optional)
+ * analyzer (Optional): (recursive schema, see analyzer above)
+ * }
+ * }
+ * enableSegment: Boolean (Optional)
+ * segmentPerPage: Boolean (Optional)
+ * omitContent: Boolean (Optional)
+ * }
+ * fieldSchema (Optional): {
+ * name: String (Optional)
+ * description: String (Optional)
+ * fields (Optional, Required on create): {
+ * String (Required): {
+ * method: String(generate/extract/classify) (Optional)
+ * type: String(string/date/time/number/integer/boolean/array/object/json) (Optional)
+ * description: String (Optional)
+ * items (Optional): (recursive schema, see items above)
+ * properties (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * examples (Optional): [
+ * String (Optional)
+ * ]
+ * enum (Optional): [
+ * String (Optional)
+ * ]
+ * enumDescriptions (Optional): {
+ * String: String (Required)
+ * }
+ * $ref: String (Optional)
+ * estimateSourceAndConfidence: Boolean (Optional)
+ * }
+ * }
+ * definitions (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * }
+ * dynamicFieldSchema: Boolean (Optional)
+ * processingLocation: String(geography/dataZone/global) (Optional)
+ * knowledgeSources (Optional): [
+ * (Optional){
+ * kind: String(labeledData) (Required)
+ * }
+ * ]
+ * models (Optional): {
+ * String: String (Required)
+ * }
+ * supportedModels (Optional): {
+ * completion (Optional): [
+ * String (Optional)
+ * ]
+ * embedding (Optional): [
+ * String (Optional)
+ * ]
+ * }
+ * }
+ * }
+ *
+ *
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return paged collection of ContentAnalyzer items along with {@link PagedResponse}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PagedResponse listAnalyzersSinglePage(RequestOptions requestOptions) {
+ final String accept = "application/json";
+ Response res = service.listAnalyzersSync(this.getEndpoint(), this.getServiceVersion().getVersion(),
+ accept, requestOptions, Context.NONE);
+ return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
+ getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null);
+ }
+
+ /**
+ * List analyzers.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * analyzerId: String (Required)
+ * description: String (Optional)
+ * tags (Optional): {
+ * String: String (Required)
+ * }
+ * status: String(creating/ready/deleting/failed) (Required)
+ * createdAt: OffsetDateTime (Required)
+ * lastModifiedAt: OffsetDateTime (Required)
+ * warnings (Optional): [
+ * (Optional){
+ * code: String (Required)
+ * message: String (Required)
+ * target: String (Optional)
+ * details (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * innererror (Optional): {
+ * code: String (Optional)
+ * innererror (Optional): (recursive schema, see innererror above)
+ * }
+ * }
+ * ]
+ * baseAnalyzerId: String (Optional)
+ * config (Optional): {
+ * returnDetails: Boolean (Optional)
+ * locales (Optional): [
+ * String (Optional)
+ * ]
+ * enableOcr: Boolean (Optional)
+ * enableLayout: Boolean (Optional)
+ * enableFigureDescription: Boolean (Optional)
+ * enableFigureAnalysis: Boolean (Optional)
+ * enableFormula: Boolean (Optional)
+ * tableFormat: String(html/markdown) (Optional)
+ * chartFormat: String(chartJs/markdown) (Optional)
+ * annotationFormat: String(none/markdown) (Optional)
+ * disableFaceBlurring: Boolean (Optional)
+ * estimateFieldSourceAndConfidence: Boolean (Optional)
+ * contentCategories (Optional): {
+ * String (Required): {
+ * description: String (Optional)
+ * analyzerId: String (Optional)
+ * analyzer (Optional): (recursive schema, see analyzer above)
+ * }
+ * }
+ * enableSegment: Boolean (Optional)
+ * segmentPerPage: Boolean (Optional)
+ * omitContent: Boolean (Optional)
+ * }
+ * fieldSchema (Optional): {
+ * name: String (Optional)
+ * description: String (Optional)
+ * fields (Optional, Required on create): {
+ * String (Required): {
+ * method: String(generate/extract/classify) (Optional)
+ * type: String(string/date/time/number/integer/boolean/array/object/json) (Optional)
+ * description: String (Optional)
+ * items (Optional): (recursive schema, see items above)
+ * properties (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * examples (Optional): [
+ * String (Optional)
+ * ]
+ * enum (Optional): [
+ * String (Optional)
+ * ]
+ * enumDescriptions (Optional): {
+ * String: String (Required)
+ * }
+ * $ref: String (Optional)
+ * estimateSourceAndConfidence: Boolean (Optional)
+ * }
+ * }
+ * definitions (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * }
+ * dynamicFieldSchema: Boolean (Optional)
+ * processingLocation: String(geography/dataZone/global) (Optional)
+ * knowledgeSources (Optional): [
+ * (Optional){
+ * kind: String(labeledData) (Required)
+ * }
+ * ]
+ * models (Optional): {
+ * String: String (Required)
+ * }
+ * supportedModels (Optional): {
+ * completion (Optional): [
+ * String (Optional)
+ * ]
+ * embedding (Optional): [
+ * String (Optional)
+ * ]
+ * }
+ * }
+ * }
+ *
+ *
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return paged collection of ContentAnalyzer items as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listAnalyzers(RequestOptions requestOptions) {
+ RequestOptions requestOptionsForNextPage = new RequestOptions();
+ requestOptionsForNextPage.setContext(
+ requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE);
+ return new PagedIterable<>(() -> listAnalyzersSinglePage(requestOptions),
+ nextLink -> listAnalyzersNextSinglePage(nextLink, requestOptionsForNextPage));
+ }
+
+ /**
+ * Update analyzer properties.
+ * Request Body Schema
+ *
+ *
+ * {@code
+ * {
+ * analyzerId: String (Required)
+ * description: String (Optional)
+ * tags (Optional): {
+ * String: String (Required)
+ * }
+ * status: String(creating/ready/deleting/failed) (Required)
+ * createdAt: OffsetDateTime (Required)
+ * lastModifiedAt: OffsetDateTime (Required)
+ * warnings (Optional): [
+ * (Optional){
+ * code: String (Required)
+ * message: String (Required)
+ * target: String (Optional)
+ * details (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * innererror (Optional): {
+ * code: String (Optional)
+ * innererror (Optional): (recursive schema, see innererror above)
+ * }
+ * }
+ * ]
+ * baseAnalyzerId: String (Optional)
+ * config (Optional): {
+ * returnDetails: Boolean (Optional)
+ * locales (Optional): [
+ * String (Optional)
+ * ]
+ * enableOcr: Boolean (Optional)
+ * enableLayout: Boolean (Optional)
+ * enableFigureDescription: Boolean (Optional)
+ * enableFigureAnalysis: Boolean (Optional)
+ * enableFormula: Boolean (Optional)
+ * tableFormat: String(html/markdown) (Optional)
+ * chartFormat: String(chartJs/markdown) (Optional)
+ * annotationFormat: String(none/markdown) (Optional)
+ * disableFaceBlurring: Boolean (Optional)
+ * estimateFieldSourceAndConfidence: Boolean (Optional)
+ * contentCategories (Optional): {
+ * String (Required): {
+ * description: String (Optional)
+ * analyzerId: String (Optional)
+ * analyzer (Optional): (recursive schema, see analyzer above)
+ * }
+ * }
+ * enableSegment: Boolean (Optional)
+ * segmentPerPage: Boolean (Optional)
+ * omitContent: Boolean (Optional)
+ * }
+ * fieldSchema (Optional): {
+ * name: String (Optional)
+ * description: String (Optional)
+ * fields (Optional, Required on create): {
+ * String (Required): {
+ * method: String(generate/extract/classify) (Optional)
+ * type: String(string/date/time/number/integer/boolean/array/object/json) (Optional)
+ * description: String (Optional)
+ * items (Optional): (recursive schema, see items above)
+ * properties (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * examples (Optional): [
+ * String (Optional)
+ * ]
+ * enum (Optional): [
+ * String (Optional)
+ * ]
+ * enumDescriptions (Optional): {
+ * String: String (Required)
+ * }
+ * $ref: String (Optional)
+ * estimateSourceAndConfidence: Boolean (Optional)
+ * }
+ * }
+ * definitions (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * }
+ * dynamicFieldSchema: Boolean (Optional)
+ * processingLocation: String(geography/dataZone/global) (Optional)
+ * knowledgeSources (Optional): [
+ * (Optional){
+ * kind: String(labeledData) (Required)
+ * }
+ * ]
+ * models (Optional): {
+ * String: String (Required)
+ * }
+ * supportedModels (Optional): {
+ * completion (Optional): [
+ * String (Optional)
+ * ]
+ * embedding (Optional): [
+ * String (Optional)
+ * ]
+ * }
+ * }
+ * }
+ *
+ *
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * analyzerId: String (Required)
+ * description: String (Optional)
+ * tags (Optional): {
+ * String: String (Required)
+ * }
+ * status: String(creating/ready/deleting/failed) (Required)
+ * createdAt: OffsetDateTime (Required)
+ * lastModifiedAt: OffsetDateTime (Required)
+ * warnings (Optional): [
+ * (Optional){
+ * code: String (Required)
+ * message: String (Required)
+ * target: String (Optional)
+ * details (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * innererror (Optional): {
+ * code: String (Optional)
+ * innererror (Optional): (recursive schema, see innererror above)
+ * }
+ * }
+ * ]
+ * baseAnalyzerId: String (Optional)
+ * config (Optional): {
+ * returnDetails: Boolean (Optional)
+ * locales (Optional): [
+ * String (Optional)
+ * ]
+ * enableOcr: Boolean (Optional)
+ * enableLayout: Boolean (Optional)
+ * enableFigureDescription: Boolean (Optional)
+ * enableFigureAnalysis: Boolean (Optional)
+ * enableFormula: Boolean (Optional)
+ * tableFormat: String(html/markdown) (Optional)
+ * chartFormat: String(chartJs/markdown) (Optional)
+ * annotationFormat: String(none/markdown) (Optional)
+ * disableFaceBlurring: Boolean (Optional)
+ * estimateFieldSourceAndConfidence: Boolean (Optional)
+ * contentCategories (Optional): {
+ * String (Required): {
+ * description: String (Optional)
+ * analyzerId: String (Optional)
+ * analyzer (Optional): (recursive schema, see analyzer above)
+ * }
+ * }
+ * enableSegment: Boolean (Optional)
+ * segmentPerPage: Boolean (Optional)
+ * omitContent: Boolean (Optional)
+ * }
+ * fieldSchema (Optional): {
+ * name: String (Optional)
+ * description: String (Optional)
+ * fields (Optional, Required on create): {
+ * String (Required): {
+ * method: String(generate/extract/classify) (Optional)
+ * type: String(string/date/time/number/integer/boolean/array/object/json) (Optional)
+ * description: String (Optional)
+ * items (Optional): (recursive schema, see items above)
+ * properties (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * examples (Optional): [
+ * String (Optional)
+ * ]
+ * enum (Optional): [
+ * String (Optional)
+ * ]
+ * enumDescriptions (Optional): {
+ * String: String (Required)
+ * }
+ * $ref: String (Optional)
+ * estimateSourceAndConfidence: Boolean (Optional)
+ * }
+ * }
+ * definitions (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * }
+ * dynamicFieldSchema: Boolean (Optional)
+ * processingLocation: String(geography/dataZone/global) (Optional)
+ * knowledgeSources (Optional): [
+ * (Optional){
+ * kind: String(labeledData) (Required)
+ * }
+ * ]
+ * models (Optional): {
+ * String: String (Required)
+ * }
+ * supportedModels (Optional): {
+ * completion (Optional): [
+ * String (Optional)
+ * ]
+ * embedding (Optional): [
+ * String (Optional)
+ * ]
+ * }
+ * }
+ * }
+ *
+ *
+ * @param analyzerId The unique identifier of the analyzer.
+ * @param resource The resource instance.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return analyzer that extracts content and fields from multimodal documents along with {@link Response} on
+ * successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> updateAnalyzerWithResponseAsync(String analyzerId, BinaryData resource,
+ RequestOptions requestOptions) {
+ final String contentType = "application/merge-patch+json";
+ final String accept = "application/json";
+ return FluxUtil.withContext(context -> service.updateAnalyzer(this.getEndpoint(),
+ this.getServiceVersion().getVersion(), analyzerId, contentType, accept, resource, requestOptions, context));
+ }
+
+ /**
+ * Update analyzer properties.
+ * Request Body Schema
+ *
+ *
+ * {@code
+ * {
+ * analyzerId: String (Required)
+ * description: String (Optional)
+ * tags (Optional): {
+ * String: String (Required)
+ * }
+ * status: String(creating/ready/deleting/failed) (Required)
+ * createdAt: OffsetDateTime (Required)
+ * lastModifiedAt: OffsetDateTime (Required)
+ * warnings (Optional): [
+ * (Optional){
+ * code: String (Required)
+ * message: String (Required)
+ * target: String (Optional)
+ * details (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * innererror (Optional): {
+ * code: String (Optional)
+ * innererror (Optional): (recursive schema, see innererror above)
+ * }
+ * }
+ * ]
+ * baseAnalyzerId: String (Optional)
+ * config (Optional): {
+ * returnDetails: Boolean (Optional)
+ * locales (Optional): [
+ * String (Optional)
+ * ]
+ * enableOcr: Boolean (Optional)
+ * enableLayout: Boolean (Optional)
+ * enableFigureDescription: Boolean (Optional)
+ * enableFigureAnalysis: Boolean (Optional)
+ * enableFormula: Boolean (Optional)
+ * tableFormat: String(html/markdown) (Optional)
+ * chartFormat: String(chartJs/markdown) (Optional)
+ * annotationFormat: String(none/markdown) (Optional)
+ * disableFaceBlurring: Boolean (Optional)
+ * estimateFieldSourceAndConfidence: Boolean (Optional)
+ * contentCategories (Optional): {
+ * String (Required): {
+ * description: String (Optional)
+ * analyzerId: String (Optional)
+ * analyzer (Optional): (recursive schema, see analyzer above)
+ * }
+ * }
+ * enableSegment: Boolean (Optional)
+ * segmentPerPage: Boolean (Optional)
+ * omitContent: Boolean (Optional)
+ * }
+ * fieldSchema (Optional): {
+ * name: String (Optional)
+ * description: String (Optional)
+ * fields (Optional, Required on create): {
+ * String (Required): {
+ * method: String(generate/extract/classify) (Optional)
+ * type: String(string/date/time/number/integer/boolean/array/object/json) (Optional)
+ * description: String (Optional)
+ * items (Optional): (recursive schema, see items above)
+ * properties (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * examples (Optional): [
+ * String (Optional)
+ * ]
+ * enum (Optional): [
+ * String (Optional)
+ * ]
+ * enumDescriptions (Optional): {
+ * String: String (Required)
+ * }
+ * $ref: String (Optional)
+ * estimateSourceAndConfidence: Boolean (Optional)
+ * }
+ * }
+ * definitions (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * }
+ * dynamicFieldSchema: Boolean (Optional)
+ * processingLocation: String(geography/dataZone/global) (Optional)
+ * knowledgeSources (Optional): [
+ * (Optional){
+ * kind: String(labeledData) (Required)
+ * }
+ * ]
+ * models (Optional): {
+ * String: String (Required)
+ * }
+ * supportedModels (Optional): {
+ * completion (Optional): [
+ * String (Optional)
+ * ]
+ * embedding (Optional): [
+ * String (Optional)
+ * ]
+ * }
+ * }
+ * }
+ *
+ *
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * analyzerId: String (Required)
+ * description: String (Optional)
+ * tags (Optional): {
+ * String: String (Required)
+ * }
+ * status: String(creating/ready/deleting/failed) (Required)
+ * createdAt: OffsetDateTime (Required)
+ * lastModifiedAt: OffsetDateTime (Required)
+ * warnings (Optional): [
+ * (Optional){
+ * code: String (Required)
+ * message: String (Required)
+ * target: String (Optional)
+ * details (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * innererror (Optional): {
+ * code: String (Optional)
+ * innererror (Optional): (recursive schema, see innererror above)
+ * }
+ * }
+ * ]
+ * baseAnalyzerId: String (Optional)
+ * config (Optional): {
+ * returnDetails: Boolean (Optional)
+ * locales (Optional): [
+ * String (Optional)
+ * ]
+ * enableOcr: Boolean (Optional)
+ * enableLayout: Boolean (Optional)
+ * enableFigureDescription: Boolean (Optional)
+ * enableFigureAnalysis: Boolean (Optional)
+ * enableFormula: Boolean (Optional)
+ * tableFormat: String(html/markdown) (Optional)
+ * chartFormat: String(chartJs/markdown) (Optional)
+ * annotationFormat: String(none/markdown) (Optional)
+ * disableFaceBlurring: Boolean (Optional)
+ * estimateFieldSourceAndConfidence: Boolean (Optional)
+ * contentCategories (Optional): {
+ * String (Required): {
+ * description: String (Optional)
+ * analyzerId: String (Optional)
+ * analyzer (Optional): (recursive schema, see analyzer above)
+ * }
+ * }
+ * enableSegment: Boolean (Optional)
+ * segmentPerPage: Boolean (Optional)
+ * omitContent: Boolean (Optional)
+ * }
+ * fieldSchema (Optional): {
+ * name: String (Optional)
+ * description: String (Optional)
+ * fields (Optional, Required on create): {
+ * String (Required): {
+ * method: String(generate/extract/classify) (Optional)
+ * type: String(string/date/time/number/integer/boolean/array/object/json) (Optional)
+ * description: String (Optional)
+ * items (Optional): (recursive schema, see items above)
+ * properties (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * examples (Optional): [
+ * String (Optional)
+ * ]
+ * enum (Optional): [
+ * String (Optional)
+ * ]
+ * enumDescriptions (Optional): {
+ * String: String (Required)
+ * }
+ * $ref: String (Optional)
+ * estimateSourceAndConfidence: Boolean (Optional)
+ * }
+ * }
+ * definitions (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * }
+ * dynamicFieldSchema: Boolean (Optional)
+ * processingLocation: String(geography/dataZone/global) (Optional)
+ * knowledgeSources (Optional): [
+ * (Optional){
+ * kind: String(labeledData) (Required)
+ * }
+ * ]
+ * models (Optional): {
+ * String: String (Required)
+ * }
+ * supportedModels (Optional): {
+ * completion (Optional): [
+ * String (Optional)
+ * ]
+ * embedding (Optional): [
+ * String (Optional)
+ * ]
+ * }
+ * }
+ * }
+ *
+ *
+ * @param analyzerId The unique identifier of the analyzer.
+ * @param resource The resource instance.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return analyzer that extracts content and fields from multimodal documents along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response updateAnalyzerWithResponse(String analyzerId, BinaryData resource,
+ RequestOptions requestOptions) {
+ final String contentType = "application/merge-patch+json";
+ final String accept = "application/json";
+ return service.updateAnalyzerSync(this.getEndpoint(), this.getServiceVersion().getVersion(), analyzerId,
+ contentType, accept, resource, requestOptions, Context.NONE);
+ }
+
+ /**
+ * Update default settings for this Content Understanding resource.
+ * Request Body Schema
+ *
+ *
+ * {@code
+ * {
+ * modelDeployments (Optional): {
+ * (Optional): {
+ * String: String (Required)
+ * }
+ * }
+ * }
+ * }
+ *
+ *
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * modelDeployments (Required): {
+ * String: String (Required)
+ * }
+ * }
+ * }
+ *
+ *
+ * @param updateDefaultsRequest The updateDefaultsRequest parameter.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return default settings for this Content Understanding resource along with {@link Response} on successful
+ * completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> updateDefaultsWithResponseAsync(BinaryData updateDefaultsRequest,
+ RequestOptions requestOptions) {
+ final String contentType = "application/merge-patch+json";
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.updateDefaults(this.getEndpoint(), this.getServiceVersion().getVersion(),
+ contentType, accept, updateDefaultsRequest, requestOptions, context));
+ }
+
+ /**
+ * Update default settings for this Content Understanding resource.
+ * Request Body Schema
+ *
+ *
+ * {@code
+ * {
+ * modelDeployments (Optional): {
+ * (Optional): {
+ * String: String (Required)
+ * }
+ * }
+ * }
+ * }
+ *
+ *
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * modelDeployments (Required): {
+ * String: String (Required)
+ * }
+ * }
+ * }
+ *
+ *
+ * @param updateDefaultsRequest The updateDefaultsRequest parameter.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return default settings for this Content Understanding resource along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response updateDefaultsWithResponse(BinaryData updateDefaultsRequest,
+ RequestOptions requestOptions) {
+ final String contentType = "application/merge-patch+json";
+ final String accept = "application/json";
+ return service.updateDefaultsSync(this.getEndpoint(), this.getServiceVersion().getVersion(), contentType,
+ accept, updateDefaultsRequest, requestOptions, Context.NONE);
+ }
+
+ /**
+ * Get the next page of items.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * analyzerId: String (Required)
+ * description: String (Optional)
+ * tags (Optional): {
+ * String: String (Required)
+ * }
+ * status: String(creating/ready/deleting/failed) (Required)
+ * createdAt: OffsetDateTime (Required)
+ * lastModifiedAt: OffsetDateTime (Required)
+ * warnings (Optional): [
+ * (Optional){
+ * code: String (Required)
+ * message: String (Required)
+ * target: String (Optional)
+ * details (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * innererror (Optional): {
+ * code: String (Optional)
+ * innererror (Optional): (recursive schema, see innererror above)
+ * }
+ * }
+ * ]
+ * baseAnalyzerId: String (Optional)
+ * config (Optional): {
+ * returnDetails: Boolean (Optional)
+ * locales (Optional): [
+ * String (Optional)
+ * ]
+ * enableOcr: Boolean (Optional)
+ * enableLayout: Boolean (Optional)
+ * enableFigureDescription: Boolean (Optional)
+ * enableFigureAnalysis: Boolean (Optional)
+ * enableFormula: Boolean (Optional)
+ * tableFormat: String(html/markdown) (Optional)
+ * chartFormat: String(chartJs/markdown) (Optional)
+ * annotationFormat: String(none/markdown) (Optional)
+ * disableFaceBlurring: Boolean (Optional)
+ * estimateFieldSourceAndConfidence: Boolean (Optional)
+ * contentCategories (Optional): {
+ * String (Required): {
+ * description: String (Optional)
+ * analyzerId: String (Optional)
+ * analyzer (Optional): (recursive schema, see analyzer above)
+ * }
+ * }
+ * enableSegment: Boolean (Optional)
+ * segmentPerPage: Boolean (Optional)
+ * omitContent: Boolean (Optional)
+ * }
+ * fieldSchema (Optional): {
+ * name: String (Optional)
+ * description: String (Optional)
+ * fields (Optional, Required on create): {
+ * String (Required): {
+ * method: String(generate/extract/classify) (Optional)
+ * type: String(string/date/time/number/integer/boolean/array/object/json) (Optional)
+ * description: String (Optional)
+ * items (Optional): (recursive schema, see items above)
+ * properties (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * examples (Optional): [
+ * String (Optional)
+ * ]
+ * enum (Optional): [
+ * String (Optional)
+ * ]
+ * enumDescriptions (Optional): {
+ * String: String (Required)
+ * }
+ * $ref: String (Optional)
+ * estimateSourceAndConfidence: Boolean (Optional)
+ * }
+ * }
+ * definitions (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * }
+ * dynamicFieldSchema: Boolean (Optional)
+ * processingLocation: String(geography/dataZone/global) (Optional)
+ * knowledgeSources (Optional): [
+ * (Optional){
+ * kind: String(labeledData) (Required)
+ * }
+ * ]
+ * models (Optional): {
+ * String: String (Required)
+ * }
+ * supportedModels (Optional): {
+ * completion (Optional): [
+ * String (Optional)
+ * ]
+ * embedding (Optional): [
+ * String (Optional)
+ * ]
+ * }
+ * }
+ * }
+ *
+ *
+ * @param nextLink The URL to get the next list of items.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return paged collection of ContentAnalyzer items along with {@link PagedResponse} on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listAnalyzersNextSinglePageAsync(String nextLink,
+ RequestOptions requestOptions) {
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context -> service.listAnalyzersNext(nextLink, this.getEndpoint(), accept, requestOptions, context))
+ .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
+ getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null));
+ }
+
+ /**
+ * Get the next page of items.
+ * Response Body Schema
+ *
+ *
+ * {@code
+ * {
+ * analyzerId: String (Required)
+ * description: String (Optional)
+ * tags (Optional): {
+ * String: String (Required)
+ * }
+ * status: String(creating/ready/deleting/failed) (Required)
+ * createdAt: OffsetDateTime (Required)
+ * lastModifiedAt: OffsetDateTime (Required)
+ * warnings (Optional): [
+ * (Optional){
+ * code: String (Required)
+ * message: String (Required)
+ * target: String (Optional)
+ * details (Optional): [
+ * (recursive schema, see above)
+ * ]
+ * innererror (Optional): {
+ * code: String (Optional)
+ * innererror (Optional): (recursive schema, see innererror above)
+ * }
+ * }
+ * ]
+ * baseAnalyzerId: String (Optional)
+ * config (Optional): {
+ * returnDetails: Boolean (Optional)
+ * locales (Optional): [
+ * String (Optional)
+ * ]
+ * enableOcr: Boolean (Optional)
+ * enableLayout: Boolean (Optional)
+ * enableFigureDescription: Boolean (Optional)
+ * enableFigureAnalysis: Boolean (Optional)
+ * enableFormula: Boolean (Optional)
+ * tableFormat: String(html/markdown) (Optional)
+ * chartFormat: String(chartJs/markdown) (Optional)
+ * annotationFormat: String(none/markdown) (Optional)
+ * disableFaceBlurring: Boolean (Optional)
+ * estimateFieldSourceAndConfidence: Boolean (Optional)
+ * contentCategories (Optional): {
+ * String (Required): {
+ * description: String (Optional)
+ * analyzerId: String (Optional)
+ * analyzer (Optional): (recursive schema, see analyzer above)
+ * }
+ * }
+ * enableSegment: Boolean (Optional)
+ * segmentPerPage: Boolean (Optional)
+ * omitContent: Boolean (Optional)
+ * }
+ * fieldSchema (Optional): {
+ * name: String (Optional)
+ * description: String (Optional)
+ * fields (Optional, Required on create): {
+ * String (Required): {
+ * method: String(generate/extract/classify) (Optional)
+ * type: String(string/date/time/number/integer/boolean/array/object/json) (Optional)
+ * description: String (Optional)
+ * items (Optional): (recursive schema, see items above)
+ * properties (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * examples (Optional): [
+ * String (Optional)
+ * ]
+ * enum (Optional): [
+ * String (Optional)
+ * ]
+ * enumDescriptions (Optional): {
+ * String: String (Required)
+ * }
+ * $ref: String (Optional)
+ * estimateSourceAndConfidence: Boolean (Optional)
+ * }
+ * }
+ * definitions (Optional): {
+ * String (Required): (recursive schema, see String above)
+ * }
+ * }
+ * dynamicFieldSchema: Boolean (Optional)
+ * processingLocation: String(geography/dataZone/global) (Optional)
+ * knowledgeSources (Optional): [
+ * (Optional){
+ * kind: String(labeledData) (Required)
+ * }
+ * ]
+ * models (Optional): {
+ * String: String (Required)
+ * }
+ * supportedModels (Optional): {
+ * completion (Optional): [
+ * String (Optional)
+ * ]
+ * embedding (Optional): [
+ * String (Optional)
+ * ]
+ * }
+ * }
+ * }
+ *
+ *
+ * @param nextLink The URL to get the next list of items.
+ * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
+ * @throws HttpResponseException thrown if the request is rejected by server.
+ * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
+ * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
+ * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
+ * @return paged collection of ContentAnalyzer items along with {@link PagedResponse}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PagedResponse listAnalyzersNextSinglePage(String nextLink, RequestOptions requestOptions) {
+ final String accept = "application/json";
+ Response res
+ = service.listAnalyzersNextSync(nextLink, this.getEndpoint(), accept, requestOptions, Context.NONE);
+ return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
+ getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null);
+ }
+
+ private List getValues(BinaryData binaryData, String path) {
+ try {
+ Map, ?> obj = binaryData.toObject(Map.class);
+ List> values = (List>) obj.get(path);
+ return values.stream().map(BinaryData::fromObject).collect(Collectors.toList());
+ } catch (RuntimeException e) {
+ return null;
+ }
+ }
+
+ private String getNextLink(BinaryData binaryData, String path) {
+ try {
+ Map, ?> obj = binaryData.toObject(Map.class);
+ return (String) obj.get(path);
+ } catch (RuntimeException e) {
+ return null;
+ }
+ }
+}
diff --git a/sdk/contentunderstanding/azure-ai-contentunderstanding/src/main/java/com/azure/ai/contentunderstanding/implementation/JsonMergePatchHelper.java b/sdk/contentunderstanding/azure-ai-contentunderstanding/src/main/java/com/azure/ai/contentunderstanding/implementation/JsonMergePatchHelper.java
new file mode 100644
index 000000000000..88e775e92486
--- /dev/null
+++ b/sdk/contentunderstanding/azure-ai-contentunderstanding/src/main/java/com/azure/ai/contentunderstanding/implementation/JsonMergePatchHelper.java
@@ -0,0 +1,117 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.ai.contentunderstanding.implementation;
+
+import com.azure.ai.contentunderstanding.models.ContentAnalyzer;
+import com.azure.ai.contentunderstanding.models.ContentAnalyzerConfig;
+import com.azure.ai.contentunderstanding.models.ContentCategoryDefinition;
+import com.azure.ai.contentunderstanding.models.ContentFieldDefinition;
+import com.azure.ai.contentunderstanding.models.ContentFieldSchema;
+import com.azure.ai.contentunderstanding.models.KnowledgeSource;
+
+/**
+ * This is the Helper class to enable json merge patch serialization for a model.
+ */
+public class JsonMergePatchHelper {
+ private static ContentAnalyzerAccessor contentAnalyzerAccessor;
+
+ public interface ContentAnalyzerAccessor {
+ ContentAnalyzer prepareModelForJsonMergePatch(ContentAnalyzer contentAnalyzer, boolean jsonMergePatchEnabled);
+
+ boolean isJsonMergePatch(ContentAnalyzer contentAnalyzer);
+ }
+
+ public static void setContentAnalyzerAccessor(ContentAnalyzerAccessor accessor) {
+ contentAnalyzerAccessor = accessor;
+ }
+
+ public static ContentAnalyzerAccessor getContentAnalyzerAccessor() {
+ return contentAnalyzerAccessor;
+ }
+
+ private static ContentAnalyzerConfigAccessor contentAnalyzerConfigAccessor;
+
+ public interface ContentAnalyzerConfigAccessor {
+ ContentAnalyzerConfig prepareModelForJsonMergePatch(ContentAnalyzerConfig contentAnalyzerConfig,
+ boolean jsonMergePatchEnabled);
+
+ boolean isJsonMergePatch(ContentAnalyzerConfig contentAnalyzerConfig);
+ }
+
+ public static void setContentAnalyzerConfigAccessor(ContentAnalyzerConfigAccessor accessor) {
+ contentAnalyzerConfigAccessor = accessor;
+ }
+
+ public static ContentAnalyzerConfigAccessor getContentAnalyzerConfigAccessor() {
+ return contentAnalyzerConfigAccessor;
+ }
+
+ private static ContentCategoryDefinitionAccessor contentCategoryDefinitionAccessor;
+
+ public interface ContentCategoryDefinitionAccessor {
+ ContentCategoryDefinition prepareModelForJsonMergePatch(ContentCategoryDefinition contentCategoryDefinition,
+ boolean jsonMergePatchEnabled);
+
+ boolean isJsonMergePatch(ContentCategoryDefinition contentCategoryDefinition);
+ }
+
+ public static void setContentCategoryDefinitionAccessor(ContentCategoryDefinitionAccessor accessor) {
+ contentCategoryDefinitionAccessor = accessor;
+ }
+
+ public static ContentCategoryDefinitionAccessor getContentCategoryDefinitionAccessor() {
+ return contentCategoryDefinitionAccessor;
+ }
+
+ private static ContentFieldSchemaAccessor contentFieldSchemaAccessor;
+
+ public interface ContentFieldSchemaAccessor {
+ ContentFieldSchema prepareModelForJsonMergePatch(ContentFieldSchema contentFieldSchema,
+ boolean jsonMergePatchEnabled);
+
+ boolean isJsonMergePatch(ContentFieldSchema contentFieldSchema);
+ }
+
+ public static void setContentFieldSchemaAccessor(ContentFieldSchemaAccessor accessor) {
+ contentFieldSchemaAccessor = accessor;
+ }
+
+ public static ContentFieldSchemaAccessor getContentFieldSchemaAccessor() {
+ return contentFieldSchemaAccessor;
+ }
+
+ private static ContentFieldDefinitionAccessor contentFieldDefinitionAccessor;
+
+ public interface ContentFieldDefinitionAccessor {
+ ContentFieldDefinition prepareModelForJsonMergePatch(ContentFieldDefinition contentFieldDefinition,
+ boolean jsonMergePatchEnabled);
+
+ boolean isJsonMergePatch(ContentFieldDefinition contentFieldDefinition);
+ }
+
+ public static void setContentFieldDefinitionAccessor(ContentFieldDefinitionAccessor accessor) {
+ contentFieldDefinitionAccessor = accessor;
+ }
+
+ public static ContentFieldDefinitionAccessor getContentFieldDefinitionAccessor() {
+ return contentFieldDefinitionAccessor;
+ }
+
+ private static KnowledgeSourceAccessor knowledgeSourceAccessor;
+
+ public interface KnowledgeSourceAccessor {
+ KnowledgeSource prepareModelForJsonMergePatch(KnowledgeSource knowledgeSource, boolean jsonMergePatchEnabled);
+
+ boolean isJsonMergePatch(KnowledgeSource knowledgeSource);
+ }
+
+ public static void setKnowledgeSourceAccessor(KnowledgeSourceAccessor accessor) {
+ knowledgeSourceAccessor = accessor;
+ }
+
+ public static KnowledgeSourceAccessor getKnowledgeSourceAccessor() {
+ return knowledgeSourceAccessor;
+ }
+}
diff --git a/sdk/contentunderstanding/azure-ai-contentunderstanding/src/main/java/com/azure/ai/contentunderstanding/implementation/OperationLocationPollingStrategy.java b/sdk/contentunderstanding/azure-ai-contentunderstanding/src/main/java/com/azure/ai/contentunderstanding/implementation/OperationLocationPollingStrategy.java
new file mode 100644
index 000000000000..0915a94d484a
--- /dev/null
+++ b/sdk/contentunderstanding/azure-ai-contentunderstanding/src/main/java/com/azure/ai/contentunderstanding/implementation/OperationLocationPollingStrategy.java
@@ -0,0 +1,138 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+package com.azure.ai.contentunderstanding.implementation;
+
+import com.azure.core.exception.AzureException;
+import com.azure.core.http.HttpHeader;
+import com.azure.core.http.rest.Response;
+import com.azure.core.util.BinaryData;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.core.util.polling.LongRunningOperationStatus;
+import com.azure.core.util.polling.OperationResourcePollingStrategy;
+import com.azure.core.util.polling.PollResponse;
+import com.azure.core.util.polling.PollingContext;
+import com.azure.core.util.polling.PollingStrategyOptions;
+import com.azure.core.util.serializer.JsonSerializerProviders;
+import com.azure.core.util.serializer.ObjectSerializer;
+import com.azure.core.util.serializer.TypeReference;
+import java.time.Duration;
+import java.time.OffsetDateTime;
+import reactor.core.publisher.Mono;
+
+// DO NOT modify this helper class
+/**
+ * Implements an operation location polling strategy, from Operation-Location.
+ *
+ * @param the type of the response type from a polling call, or BinaryData if raw response body should be kept
+ * @param the type of the final result object to deserialize into, or BinaryData if raw response body should be
+ * kept
+ */
+public final class OperationLocationPollingStrategy extends OperationResourcePollingStrategy {
+
+ private static final ClientLogger LOGGER = new ClientLogger(OperationLocationPollingStrategy.class);
+
+ private final ObjectSerializer serializer;
+
+ private final String endpoint;
+
+ private final String propertyName;
+
+ /**
+ * Creates an instance of the operation resource polling strategy.
+ *
+ * @param pollingStrategyOptions options to configure this polling strategy.
+ * @throws NullPointerException if {@code pollingStrategyOptions} is null.
+ */
+ public OperationLocationPollingStrategy(PollingStrategyOptions pollingStrategyOptions) {
+ this(pollingStrategyOptions, null);
+ }
+
+ /**
+ * Creates an instance of the operation resource polling strategy.
+ *
+ * @param pollingStrategyOptions options to configure this polling strategy.
+ * @param propertyName the name of the property to extract final result.
+ * @throws NullPointerException if {@code pollingStrategyOptions} is null.
+ */
+ public OperationLocationPollingStrategy(PollingStrategyOptions pollingStrategyOptions, String propertyName) {
+ super(PollingUtils.OPERATION_LOCATION_HEADER, pollingStrategyOptions);
+ this.propertyName = propertyName;
+ this.endpoint = pollingStrategyOptions.getEndpoint();
+ this.serializer = pollingStrategyOptions.getSerializer() != null
+ ? pollingStrategyOptions.getSerializer()
+ : JsonSerializerProviders.createInstance(true);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public Mono> onInitialResponse(Response> response, PollingContext pollingContext,
+ TypeReference pollResponseType) {
+ // Response> is Response
+ HttpHeader operationLocationHeader = response.getHeaders().get(PollingUtils.OPERATION_LOCATION_HEADER);
+ if (operationLocationHeader != null) {
+ pollingContext.setData(PollingUtils.OPERATION_LOCATION_HEADER.getCaseSensitiveName(),
+ PollingUtils.getAbsolutePath(operationLocationHeader.getValue(), endpoint, LOGGER));
+ }
+ final String httpMethod = response.getRequest().getHttpMethod().name();
+ pollingContext.setData(PollingUtils.HTTP_METHOD, httpMethod);
+ pollingContext.setData(PollingUtils.REQUEST_URL, response.getRequest().getUrl().toString());
+ if (response.getStatusCode() == 200
+ || response.getStatusCode() == 201
+ || response.getStatusCode() == 202
+ || response.getStatusCode() == 204) {
+ final Duration retryAfter
+ = PollingUtils.getRetryAfterFromHeaders(response.getHeaders(), OffsetDateTime::now);
+ final Mono> pollResponseMono
+ = PollingUtils.deserializeResponse((BinaryData) response.getValue(), serializer, pollResponseType)
+ .onErrorResume(exception -> {
+ LOGGER.info("Failed to parse initial response.");
+ return Mono.empty();
+ })
+ .map(value -> new PollResponse<>(LongRunningOperationStatus.IN_PROGRESS, value, retryAfter));
+ return pollResponseMono.switchIfEmpty(
+ Mono.fromSupplier(() -> new PollResponse<>(LongRunningOperationStatus.IN_PROGRESS, null, retryAfter)));
+ } else {
+ return Mono
+ .error(
+ new AzureException(String.format(
+ "Operation failed or cancelled with status code %d,"
+ + ", '%s' header: %s, and response body: %s",
+ response.getStatusCode(), PollingUtils.OPERATION_LOCATION_HEADER, operationLocationHeader,
+ response.getValue())));
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public Mono getResult(PollingContext pollingContext, TypeReference resultType) {
+ if (pollingContext.getLatestResponse().getStatus() == LongRunningOperationStatus.FAILED) {
+ return Mono.error(new AzureException("Long running operation failed."));
+ } else if (pollingContext.getLatestResponse().getStatus() == LongRunningOperationStatus.USER_CANCELLED) {
+ return Mono.error(new AzureException("Long running operation cancelled."));
+ }
+ if (propertyName != null) {
+ // take the last poll response body from PollingContext,
+ // and de-serialize the property as final result
+ BinaryData latestResponseBody
+ = BinaryData.fromString(pollingContext.getData(PollingUtils.POLL_RESPONSE_BODY));
+ return PollingUtils
+ .deserializeResponse(latestResponseBody, serializer, PollingUtils.POST_POLL_RESULT_TYPE_REFERENCE)
+ .flatMap(value -> {
+ if (value.get(propertyName) != null) {
+ return BinaryData.fromObjectAsync(value.get(propertyName))
+ .flatMap(result -> PollingUtils.deserializeResponse(result, serializer, resultType));
+ } else {
+ return Mono.error(new AzureException("Cannot get final result"));
+ }
+ })
+ .switchIfEmpty(Mono.error(new AzureException("Cannot get final result")));
+ } else {
+ return super.getResult(pollingContext, resultType);
+ }
+ }
+}
diff --git a/sdk/contentunderstanding/azure-ai-contentunderstanding/src/main/java/com/azure/ai/contentunderstanding/implementation/PollingUtils.java b/sdk/contentunderstanding/azure-ai-contentunderstanding/src/main/java/com/azure/ai/contentunderstanding/implementation/PollingUtils.java
new file mode 100644
index 000000000000..4dae6c7203a5
--- /dev/null
+++ b/sdk/contentunderstanding/azure-ai-contentunderstanding/src/main/java/com/azure/ai/contentunderstanding/implementation/PollingUtils.java
@@ -0,0 +1,151 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.ai.contentunderstanding.implementation;
+
+import com.azure.core.http.HttpHeaderName;
+import com.azure.core.http.HttpHeaders;
+import com.azure.core.util.BinaryData;
+import com.azure.core.util.CoreUtils;
+import com.azure.core.util.DateTimeRfc1123;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.core.util.serializer.ObjectSerializer;
+import com.azure.core.util.serializer.TypeReference;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.time.DateTimeException;
+import java.time.Duration;
+import java.time.OffsetDateTime;
+import java.time.temporal.ChronoUnit;
+import java.util.Map;
+import java.util.function.Function;
+import java.util.function.Supplier;
+import reactor.core.publisher.Mono;
+
+// DO NOT modify this helper class
+
+final class PollingUtils {
+
+ public static final TypeReference