Share via


AnalysisInput Class

  • java.lang.Object
    • com.azure.ai.contentunderstanding.models.AnalysisInput

Implements

public final class AnalysisInput
implements JsonSerializable<AnalysisInput>

Additional input to analyze.

Constructor Summary

Constructor Description
AnalysisInput()

Creates an instance of AnalysisInput class.

Method Summary

Modifier and Type Method and Description
static AnalysisInput fromJson(JsonReader jsonReader)

Reads an instance of AnalysisInput from the JsonReader.

byte[] getData()

Get the data property: Raw image bytes.

String getMimeType()

Get the mimeType property: The MIME type of the input content.

String getName()

Get the name property: Name of the input.

String getUrl()

Get the url property: The URL of the input to analyze.

AnalysisInput setContentRange(ContentRange contentRange)

Set the contentRange property using a ContentRange for a self-documenting API.

AnalysisInput setData(byte[] data)

Set the data property: Raw image bytes.

AnalysisInput setMimeType(String mimeType)

Set the mimeType property: The MIME type of the input content.

AnalysisInput setName(String name)

Set the name property: Name of the input.

AnalysisInput setUrl(String url)

Set the url property: The URL of the input to analyze.

JsonWriter toJson(JsonWriter jsonWriter)

Methods inherited from java.lang.Object

Constructor Details

AnalysisInput

public AnalysisInput()

Creates an instance of AnalysisInput class.

Method Details

fromJson

public static AnalysisInput fromJson(JsonReader jsonReader)

Reads an instance of AnalysisInput from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of AnalysisInput if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.

Throws:

IOException

- If an error occurs while reading the AnalysisInput.

getData

public byte[] getData()

Get the data property: Raw image bytes. Provide bytes-like object; do not base64-encode. Only one of url or data should be specified.

Returns:

the data value.

getMimeType

public String getMimeType()

Get the mimeType property: The MIME type of the input content. Ex. application/pdf, image/jpeg, etc.

Returns:

the mimeType value.

getName

public String getName()

Get the name property: Name of the input.

Returns:

the name value.

getUrl

public String getUrl()

Get the url property: The URL of the input to analyze. Only one of url or data should be specified.

Returns:

the url value.

setContentRange

public AnalysisInput setContentRange(ContentRange contentRange)

Set the contentRange property using a ContentRange for a self-documenting API. Use factory methods such as pages(int start, int end), ContentRange#timeRange(long, long), or ContentRange#combine(ContentRange...) to build the range.

Parameters:

contentRange - the range value to set, or null to clear.

Returns:

the AnalysisInput object itself.

setData

public AnalysisInput setData(byte[] data)

Set the data property: Raw image bytes. Provide bytes-like object; do not base64-encode. Only one of url or data should be specified.

Parameters:

data - the data value to set.

Returns:

the AnalysisInput object itself.

setMimeType

public AnalysisInput setMimeType(String mimeType)

Set the mimeType property: The MIME type of the input content. Ex. application/pdf, image/jpeg, etc.

Parameters:

mimeType - the mimeType value to set.

Returns:

the AnalysisInput object itself.

setName

public AnalysisInput setName(String name)

Set the name property: Name of the input.

Parameters:

name - the name value to set.

Returns:

the AnalysisInput object itself.

setUrl

public AnalysisInput setUrl(String url)

Set the url property: The URL of the input to analyze. Only one of url or data should be specified.

Parameters:

url - the url value to set.

Returns:

the AnalysisInput object itself.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

Applies to