- 0.116.0 (latest)
- 0.115.1
- 0.114.0
- 0.113.0
- 0.112.2
- 0.111.0
- 0.110.10
- 0.109.0
- 0.108.0
- 0.107.0
- 0.106.0
- 0.105.0
- 0.104.0
- 0.103.0
- 0.102.1
- 0.101.1
- 0.100.2
- 0.99.0
- 0.98.0
- 0.97.0
- 0.96.0
- 0.95.0
- 0.94.1
- 0.93.3
- 0.92.3
- 0.91.1
- 0.90.0
- 0.89.0
- 0.88.0
- 0.87.0
- 0.86.0
- 0.85.0
- 0.84.0
- 0.83.0
- 0.82.0
- 0.81.0
- 0.80.0
- 0.79.0
- 0.78.0
- 0.77.0
- 0.76.0
- 0.75.0
Package dataqna is an auto-generated package for the Data QnA API.
Data QnA is a natural language question and answer service for BigQuery data.
Use of Context
The ctx passed to NewClient is used for authentication requests and for creating the underlying connection, but is not used for subsequent calls. Individual methods on the client use the ctx given to them.
To close the open connection, use the Close() method.
For information about setting deadlines, reusing contexts, and more please visit pkg.go.dev/cloud.google.com/go.
Functions
func DefaultAuthScopes
func DefaultAuthScopes() []string
DefaultAuthScopes reports the default set of authentication scopes to use with this package.
AutoSuggestionCallOptions
type AutoSuggestionCallOptions struct {
SuggestQueries []gax.CallOption
}
AutoSuggestionCallOptions contains the retry settings for each method of AutoSuggestionClient.
AutoSuggestionClient
type AutoSuggestionClient struct {
// The call options for this service.
CallOptions *AutoSuggestionCallOptions
// contains filtered or unexported fields
}
AutoSuggestionClient is a client for interacting with Data QnA API.
Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
func NewAutoSuggestionClient
func NewAutoSuggestionClient(ctx context.Context, opts ...option.ClientOption) (*AutoSuggestionClient, error)
NewAutoSuggestionClient creates a new auto suggestion service client.
This stateless API provides automatic suggestions for natural language queries for the data sources in the provided project and location.
The service provides a resourceless operation suggestQueries that can be called to get a list of suggestions for a given incomplete query and scope (or list of scopes) under which the query is to be interpreted.
There are two types of suggestions, ENTITY for single entity suggestions and TEMPLATE for full sentences. By default, both types are returned.
Example Request:
The service will retrieve information based on the given scope(s) and give suggestions based on that (e.g. “top item” for “top it” if “item” is a known dimension for the provided scope).
Example
package main
import (
"context"
dataqna "cloud.google.com/go/dataqna/apiv1alpha"
)
func main() {
ctx := context.Background()
c, err := dataqna.NewAutoSuggestionClient(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use client.
_ = c
}
func (*AutoSuggestionClient) Close
func (c *AutoSuggestionClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*AutoSuggestionClient) Connection
func (c *AutoSuggestionClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated.
func (*AutoSuggestionClient) SuggestQueries
func (c *AutoSuggestionClient) SuggestQueries(ctx context.Context, req *dataqnapb.SuggestQueriesRequest, opts ...gax.CallOption) (*dataqnapb.SuggestQueriesResponse, error)
SuggestQueries gets a list of suggestions based on a prefix string. AutoSuggestion tolerance should be less than 1 second.
Example
package main
import (
"context"
dataqna "cloud.google.com/go/dataqna/apiv1alpha"
dataqnapb "google.golang.org/genproto/googleapis/cloud/dataqna/v1alpha"
)
func main() {
// import dataqnapb "google.golang.org/genproto/googleapis/cloud/dataqna/v1alpha"
ctx := context.Background()
c, err := dataqna.NewAutoSuggestionClient(ctx)
if err != nil {
// TODO: Handle error.
}
req := &dataqnapb.SuggestQueriesRequest{
// TODO: Fill request struct fields.
}
resp, err := c.SuggestQueries(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
QuestionCallOptions
type QuestionCallOptions struct {
GetQuestion []gax.CallOption
CreateQuestion []gax.CallOption
ExecuteQuestion []gax.CallOption
GetUserFeedback []gax.CallOption
UpdateUserFeedback []gax.CallOption
}
QuestionCallOptions contains the retry settings for each method of QuestionClient.
QuestionClient
type QuestionClient struct {
// The call options for this service.
CallOptions *QuestionCallOptions
// contains filtered or unexported fields
}
QuestionClient is a client for interacting with Data QnA API.
Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
func NewQuestionClient
func NewQuestionClient(ctx context.Context, opts ...option.ClientOption) (*QuestionClient, error)
NewQuestionClient creates a new question service client.
Service to interpret natural language queries. The service allows to create Question resources that are interpreted and are filled with one or more interpretations if the question could be interpreted. Once a Question resource is created and has at least one interpretation, an interpretation can be chosen for execution, which triggers a query to the backend (for BigQuery, it will create a job). Upon successful execution of that interpretation, backend specific information will be returned so that the client can retrieve the results from the backend.
The Question resources are named projects//locations//questions/*.
The Question resource has a singletion sub-resource UserFeedback named projects//locations//questions/*/userFeedback, which allows access to user feedback.
Example
package main
import (
"context"
dataqna "cloud.google.com/go/dataqna/apiv1alpha"
)
func main() {
ctx := context.Background()
c, err := dataqna.NewQuestionClient(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use client.
_ = c
}
func (*QuestionClient) Close
func (c *QuestionClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*QuestionClient) Connection
func (c *QuestionClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated.
func (*QuestionClient) CreateQuestion
func (c *QuestionClient) CreateQuestion(ctx context.Context, req *dataqnapb.CreateQuestionRequest, opts ...gax.CallOption) (*dataqnapb.Question, error)
CreateQuestion creates a question.
Example
package main
import (
"context"
dataqna "cloud.google.com/go/dataqna/apiv1alpha"
dataqnapb "google.golang.org/genproto/googleapis/cloud/dataqna/v1alpha"
)
func main() {
// import dataqnapb "google.golang.org/genproto/googleapis/cloud/dataqna/v1alpha"
ctx := context.Background()
c, err := dataqna.NewQuestionClient(ctx)
if err != nil {
// TODO: Handle error.
}
req := &dataqnapb.CreateQuestionRequest{
// TODO: Fill request struct fields.
}
resp, err := c.CreateQuestion(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*QuestionClient) ExecuteQuestion
func (c *QuestionClient) ExecuteQuestion(ctx context.Context, req *dataqnapb.ExecuteQuestionRequest, opts ...gax.CallOption) (*dataqnapb.Question, error)
ExecuteQuestion executes an interpretation.
Example
package main
import (
"context"
dataqna "cloud.google.com/go/dataqna/apiv1alpha"
dataqnapb "google.golang.org/genproto/googleapis/cloud/dataqna/v1alpha"
)
func main() {
// import dataqnapb "google.golang.org/genproto/googleapis/cloud/dataqna/v1alpha"
ctx := context.Background()
c, err := dataqna.NewQuestionClient(ctx)
if err != nil {
// TODO: Handle error.
}
req := &dataqnapb.ExecuteQuestionRequest{
// TODO: Fill request struct fields.
}
resp, err := c.ExecuteQuestion(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*QuestionClient) GetQuestion
func (c *QuestionClient) GetQuestion(ctx context.Context, req *dataqnapb.GetQuestionRequest, opts ...gax.CallOption) (*dataqnapb.Question, error)
GetQuestion gets a previously created question.
Example
package main
import (
"context"
dataqna "cloud.google.com/go/dataqna/apiv1alpha"
dataqnapb "google.golang.org/genproto/googleapis/cloud/dataqna/v1alpha"
)
func main() {
// import dataqnapb "google.golang.org/genproto/googleapis/cloud/dataqna/v1alpha"
ctx := context.Background()
c, err := dataqna.NewQuestionClient(ctx)
if err != nil {
// TODO: Handle error.
}
req := &dataqnapb.GetQuestionRequest{
// TODO: Fill request struct fields.
}
resp, err := c.GetQuestion(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*QuestionClient) GetUserFeedback
func (c *QuestionClient) GetUserFeedback(ctx context.Context, req *dataqnapb.GetUserFeedbackRequest, opts ...gax.CallOption) (*dataqnapb.UserFeedback, error)
GetUserFeedback gets previously created user feedback.
Example
package main
import (
"context"
dataqna "cloud.google.com/go/dataqna/apiv1alpha"
dataqnapb "google.golang.org/genproto/googleapis/cloud/dataqna/v1alpha"
)
func main() {
// import dataqnapb "google.golang.org/genproto/googleapis/cloud/dataqna/v1alpha"
ctx := context.Background()
c, err := dataqna.NewQuestionClient(ctx)
if err != nil {
// TODO: Handle error.
}
req := &dataqnapb.GetUserFeedbackRequest{
// TODO: Fill request struct fields.
}
resp, err := c.GetUserFeedback(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*QuestionClient) UpdateUserFeedback
func (c *QuestionClient) UpdateUserFeedback(ctx context.Context, req *dataqnapb.UpdateUserFeedbackRequest, opts ...gax.CallOption) (*dataqnapb.UserFeedback, error)
UpdateUserFeedback updates user feedback. This creates user feedback if there was none before (upsert).
Example
package main
import (
"context"
dataqna "cloud.google.com/go/dataqna/apiv1alpha"
dataqnapb "google.golang.org/genproto/googleapis/cloud/dataqna/v1alpha"
)
func main() {
// import dataqnapb "google.golang.org/genproto/googleapis/cloud/dataqna/v1alpha"
ctx := context.Background()
c, err := dataqna.NewQuestionClient(ctx)
if err != nil {
// TODO: Handle error.
}
req := &dataqnapb.UpdateUserFeedbackRequest{
// TODO: Fill request struct fields.
}
resp, err := c.UpdateUserFeedback(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}