Class ExampleQuery.Builder (0.21.0)

public static final class ExampleQuery.Builder extends GeneratedMessage.Builder<ExampleQuery.Builder> implements ExampleQueryOrBuilder

Example of relevant and commonly used SQL query and its corresponding natural language queries optionally present. Currently only used for BigQuery data sources.

Protobuf type google.cloud.geminidataanalytics.v1.ExampleQuery

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

Methods

addAllParameters(Iterable<? extends QueryParameter> values)

public ExampleQuery.Builder addAllParameters(Iterable<? extends QueryParameter> values)

Optional. The list of query parameters. Example: The parameterized SQL query "SELECT * FROM my_table WHERE id = @id" can be matched with any value of id.

repeated .google.cloud.geminidataanalytics.v1.QueryParameter parameters = 3 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
values Iterable<? extends com.google.cloud.geminidataanalytics.v1.QueryParameter>
Returns
Type Description
ExampleQuery.Builder

addParameters(QueryParameter value)

public ExampleQuery.Builder addParameters(QueryParameter value)

Optional. The list of query parameters. Example: The parameterized SQL query "SELECT * FROM my_table WHERE id = @id" can be matched with any value of id.

repeated .google.cloud.geminidataanalytics.v1.QueryParameter parameters = 3 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value QueryParameter
Returns
Type Description
ExampleQuery.Builder

addParameters(QueryParameter.Builder builderForValue)

public ExampleQuery.Builder addParameters(QueryParameter.Builder builderForValue)

Optional. The list of query parameters. Example: The parameterized SQL query "SELECT * FROM my_table WHERE id = @id" can be matched with any value of id.

repeated .google.cloud.geminidataanalytics.v1.QueryParameter parameters = 3 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
builderForValue QueryParameter.Builder
Returns
Type Description
ExampleQuery.Builder

addParameters(int index, QueryParameter value)

public ExampleQuery.Builder addParameters(int index, QueryParameter value)

Optional. The list of query parameters. Example: The parameterized SQL query "SELECT * FROM my_table WHERE id = @id" can be matched with any value of id.

repeated .google.cloud.geminidataanalytics.v1.QueryParameter parameters = 3 [(.google.api.field_behavior) = OPTIONAL];

Parameters
Name Description
index int
value QueryParameter
Returns
Type Description
ExampleQuery.Builder

addParameters(int index, QueryParameter.Builder builderForValue)

public ExampleQuery.Builder addParameters(int index, QueryParameter.Builder builderForValue)

Optional. The list of query parameters. Example: The parameterized SQL query "SELECT * FROM my_table WHERE id = @id" can be matched with any value of id.

repeated .google.cloud.geminidataanalytics.v1.QueryParameter parameters = 3 [(.google.api.field_behavior) = OPTIONAL];

Parameters
Name Description
index int
builderForValue QueryParameter.Builder
Returns
Type Description
ExampleQuery.Builder

addParametersBuilder()

public QueryParameter.Builder addParametersBuilder()

Optional. The list of query parameters. Example: The parameterized SQL query "SELECT * FROM my_table WHERE id = @id" can be matched with any value of id.

repeated .google.cloud.geminidataanalytics.v1.QueryParameter parameters = 3 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
QueryParameter.Builder

addParametersBuilder(int index)

public QueryParameter.Builder addParametersBuilder(int index)

Optional. The list of query parameters. Example: The parameterized SQL query "SELECT * FROM my_table WHERE id = @id" can be matched with any value of id.

repeated .google.cloud.geminidataanalytics.v1.QueryParameter parameters = 3 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
index int
Returns
Type Description
QueryParameter.Builder

build()

public ExampleQuery build()
Returns
Type Description
ExampleQuery

buildPartial()

public ExampleQuery buildPartial()
Returns
Type Description
ExampleQuery

clear()

public ExampleQuery.Builder clear()
Returns
Type Description
ExampleQuery.Builder
Overrides

clearNaturalLanguageQuestion()

public ExampleQuery.Builder clearNaturalLanguageQuestion()

Optional. A natural language question that a user might ask. For example: "How many orders were placed last month?"

string natural_language_question = 1 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
ExampleQuery.Builder

This builder for chaining.

clearParameters()

public ExampleQuery.Builder clearParameters()

Optional. The list of query parameters. Example: The parameterized SQL query "SELECT * FROM my_table WHERE id = @id" can be matched with any value of id.

repeated .google.cloud.geminidataanalytics.v1.QueryParameter parameters = 3 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
ExampleQuery.Builder

clearQuery()

public ExampleQuery.Builder clearQuery()
Returns
Type Description
ExampleQuery.Builder

clearSqlQuery()

public ExampleQuery.Builder clearSqlQuery()

Optional. The SQL query that should be generated to answer the natural language question. For example: "SELECT COUNT(*) FROM orders WHERE order_date BETWEEN '2024-01-01' AND '2024-01-31'"

string sql_query = 101 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
ExampleQuery.Builder

This builder for chaining.

getDefaultInstanceForType()

public ExampleQuery getDefaultInstanceForType()
Returns
Type Description
ExampleQuery

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
Descriptor
Overrides

getNaturalLanguageQuestion()

public String getNaturalLanguageQuestion()

Optional. A natural language question that a user might ask. For example: "How many orders were placed last month?"

string natural_language_question = 1 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
String

The naturalLanguageQuestion.

getNaturalLanguageQuestionBytes()

public ByteString getNaturalLanguageQuestionBytes()

Optional. A natural language question that a user might ask. For example: "How many orders were placed last month?"

string natural_language_question = 1 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
ByteString

The bytes for naturalLanguageQuestion.

getParameters(int index)

public QueryParameter getParameters(int index)

Optional. The list of query parameters. Example: The parameterized SQL query "SELECT * FROM my_table WHERE id = @id" can be matched with any value of id.

repeated .google.cloud.geminidataanalytics.v1.QueryParameter parameters = 3 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
index int
Returns
Type Description
QueryParameter

getParametersBuilder(int index)

public QueryParameter.Builder getParametersBuilder(int index)

Optional. The list of query parameters. Example: The parameterized SQL query "SELECT * FROM my_table WHERE id = @id" can be matched with any value of id.

repeated .google.cloud.geminidataanalytics.v1.QueryParameter parameters = 3 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
index int
Returns
Type Description
QueryParameter.Builder

getParametersBuilderList()

public List<QueryParameter.Builder> getParametersBuilderList()

Optional. The list of query parameters. Example: The parameterized SQL query "SELECT * FROM my_table WHERE id = @id" can be matched with any value of id.

repeated .google.cloud.geminidataanalytics.v1.QueryParameter parameters = 3 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
List<Builder>

getParametersCount()

public int getParametersCount()

Optional. The list of query parameters. Example: The parameterized SQL query "SELECT * FROM my_table WHERE id = @id" can be matched with any value of id.

repeated .google.cloud.geminidataanalytics.v1.QueryParameter parameters = 3 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
int

getParametersList()

public List<QueryParameter> getParametersList()

Optional. The list of query parameters. Example: The parameterized SQL query "SELECT * FROM my_table WHERE id = @id" can be matched with any value of id.

repeated .google.cloud.geminidataanalytics.v1.QueryParameter parameters = 3 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
List<QueryParameter>

getParametersOrBuilder(int index)

public QueryParameterOrBuilder getParametersOrBuilder(int index)

Optional. The list of query parameters. Example: The parameterized SQL query "SELECT * FROM my_table WHERE id = @id" can be matched with any value of id.

repeated .google.cloud.geminidataanalytics.v1.QueryParameter parameters = 3 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
index int
Returns
Type Description
QueryParameterOrBuilder

getParametersOrBuilderList()

public List<? extends QueryParameterOrBuilder> getParametersOrBuilderList()

Optional. The list of query parameters. Example: The parameterized SQL query "SELECT * FROM my_table WHERE id = @id" can be matched with any value of id.

repeated .google.cloud.geminidataanalytics.v1.QueryParameter parameters = 3 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
List<? extends com.google.cloud.geminidataanalytics.v1.QueryParameterOrBuilder>

getQueryCase()

public ExampleQuery.QueryCase getQueryCase()
Returns
Type Description
ExampleQuery.QueryCase

getSqlQuery()

public String getSqlQuery()

Optional. The SQL query that should be generated to answer the natural language question. For example: "SELECT COUNT(*) FROM orders WHERE order_date BETWEEN '2024-01-01' AND '2024-01-31'"

string sql_query = 101 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
String

The sqlQuery.

getSqlQueryBytes()

public ByteString getSqlQueryBytes()

Optional. The SQL query that should be generated to answer the natural language question. For example: "SELECT COUNT(*) FROM orders WHERE order_date BETWEEN '2024-01-01' AND '2024-01-31'"

string sql_query = 101 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
ByteString

The bytes for sqlQuery.

hasSqlQuery()

public boolean hasSqlQuery()

Optional. The SQL query that should be generated to answer the natural language question. For example: "SELECT COUNT(*) FROM orders WHERE order_date BETWEEN '2024-01-01' AND '2024-01-31'"

string sql_query = 101 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
boolean

Whether the sqlQuery field is set.

internalGetFieldAccessorTable()

protected GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(ExampleQuery other)

public ExampleQuery.Builder mergeFrom(ExampleQuery other)
Parameter
Name Description
other ExampleQuery
Returns
Type Description
ExampleQuery.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public ExampleQuery.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
ExampleQuery.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

public ExampleQuery.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
ExampleQuery.Builder
Overrides

removeParameters(int index)

public ExampleQuery.Builder removeParameters(int index)

Optional. The list of query parameters. Example: The parameterized SQL query "SELECT * FROM my_table WHERE id = @id" can be matched with any value of id.

repeated .google.cloud.geminidataanalytics.v1.QueryParameter parameters = 3 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
index int
Returns
Type Description
ExampleQuery.Builder

setNaturalLanguageQuestion(String value)

public ExampleQuery.Builder setNaturalLanguageQuestion(String value)

Optional. A natural language question that a user might ask. For example: "How many orders were placed last month?"

string natural_language_question = 1 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value String

The naturalLanguageQuestion to set.

Returns
Type Description
ExampleQuery.Builder

This builder for chaining.

setNaturalLanguageQuestionBytes(ByteString value)

public ExampleQuery.Builder setNaturalLanguageQuestionBytes(ByteString value)

Optional. A natural language question that a user might ask. For example: "How many orders were placed last month?"

string natural_language_question = 1 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value ByteString

The bytes for naturalLanguageQuestion to set.

Returns
Type Description
ExampleQuery.Builder

This builder for chaining.

setParameters(int index, QueryParameter value)

public ExampleQuery.Builder setParameters(int index, QueryParameter value)

Optional. The list of query parameters. Example: The parameterized SQL query "SELECT * FROM my_table WHERE id = @id" can be matched with any value of id.

repeated .google.cloud.geminidataanalytics.v1.QueryParameter parameters = 3 [(.google.api.field_behavior) = OPTIONAL];

Parameters
Name Description
index int
value QueryParameter
Returns
Type Description
ExampleQuery.Builder

setParameters(int index, QueryParameter.Builder builderForValue)

public ExampleQuery.Builder setParameters(int index, QueryParameter.Builder builderForValue)

Optional. The list of query parameters. Example: The parameterized SQL query "SELECT * FROM my_table WHERE id = @id" can be matched with any value of id.

repeated .google.cloud.geminidataanalytics.v1.QueryParameter parameters = 3 [(.google.api.field_behavior) = OPTIONAL];

Parameters
Name Description
index int
builderForValue QueryParameter.Builder
Returns
Type Description
ExampleQuery.Builder

setSqlQuery(String value)

public ExampleQuery.Builder setSqlQuery(String value)

Optional. The SQL query that should be generated to answer the natural language question. For example: "SELECT COUNT(*) FROM orders WHERE order_date BETWEEN '2024-01-01' AND '2024-01-31'"

string sql_query = 101 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value String

The sqlQuery to set.

Returns
Type Description
ExampleQuery.Builder

This builder for chaining.

setSqlQueryBytes(ByteString value)

public ExampleQuery.Builder setSqlQueryBytes(ByteString value)

Optional. The SQL query that should be generated to answer the natural language question. For example: "SELECT COUNT(*) FROM orders WHERE order_date BETWEEN '2024-01-01' AND '2024-01-31'"

string sql_query = 101 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value ByteString

The bytes for sqlQuery to set.

Returns
Type Description
ExampleQuery.Builder

This builder for chaining.