Class v1alpha.QuestionServiceClient (1.0.8)

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. v1alpha

Package

@google-cloud/data-qna!

Constructors

(constructor)(opts)

constructor(opts?: ClientOptions);

Construct an instance of QuestionServiceClient.

Parameter
NameDescription
opts ClientOptions

Properties

apiEndpoint

static get apiEndpoint(): string;

The DNS address for this API service - same as servicePath(), exists for compatibility reasons.

Property Value
TypeDescription
string

auth

auth: gax.GoogleAuth;
Property Value
TypeDescription
gax.GoogleAuth

descriptors

descriptors: Descriptors;
Property Value
TypeDescription
Descriptors

innerApiCalls

innerApiCalls: {
        [name: string]: Function;
    };
Property Value
TypeDescription
{ [name: string]: Function; }

pathTemplates

pathTemplates: {
        [name: string]: gax.PathTemplate;
    };
Property Value
TypeDescription
{ [name: string]: gax.PathTemplate; }

port

static get port(): number;

The port for this API service.

Property Value
TypeDescription
number

questionServiceStub

questionServiceStub?: Promise<{
        [name: string]: Function;
    }>;
Property Value
TypeDescription
Promise<{ [name: string]: Function; }>

scopes

static get scopes(): string[];

The scopes needed to make gRPC calls for every method defined in this service.

Property Value
TypeDescription
string[]

servicePath

static get servicePath(): string;

The DNS address for this API service.

Property Value
TypeDescription
string

warn

warn: (code: string, message: string, warnType?: string) => void;
Property Value
TypeDescription
(code: string, message: string, warnType?: string) => void

Methods

close()

close(): Promise<void>;

Terminate the gRPC channel and close the client.

The client will no longer be usable and all future behavior is undefined.

Returns
TypeDescription
Promise<void>

{Promise} A promise that resolves when the client is closed.

createQuestion(request, options)

createQuestion(request?: protos.google.cloud.dataqna.v1alpha.ICreateQuestionRequest, options?: CallOptions): Promise<[
        protos.google.cloud.dataqna.v1alpha.IQuestion,
        protos.google.cloud.dataqna.v1alpha.ICreateQuestionRequest | undefined,
        {} | undefined
    ]>;
Parameters
NameDescription
request protos.google.cloud.dataqna.v1alpha.ICreateQuestionRequest
options CallOptions
Returns
TypeDescription
Promise<[ protos.google.cloud.dataqna.v1alpha.IQuestion, protos.google.cloud.dataqna.v1alpha.ICreateQuestionRequest | undefined, {} | undefined ]>

createQuestion(request, options, callback)

createQuestion(request: protos.google.cloud.dataqna.v1alpha.ICreateQuestionRequest, options: CallOptions, callback: Callback<protos.google.cloud.dataqna.v1alpha.IQuestion, protos.google.cloud.dataqna.v1alpha.ICreateQuestionRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.dataqna.v1alpha.ICreateQuestionRequest
options CallOptions
callback Callback<protos.google.cloud.dataqna.v1alpha.IQuestion, protos.google.cloud.dataqna.v1alpha.ICreateQuestionRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

createQuestion(request, callback)

createQuestion(request: protos.google.cloud.dataqna.v1alpha.ICreateQuestionRequest, callback: Callback<protos.google.cloud.dataqna.v1alpha.IQuestion, protos.google.cloud.dataqna.v1alpha.ICreateQuestionRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.dataqna.v1alpha.ICreateQuestionRequest
callback Callback<protos.google.cloud.dataqna.v1alpha.IQuestion, protos.google.cloud.dataqna.v1alpha.ICreateQuestionRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

executeQuestion(request, options)

executeQuestion(request?: protos.google.cloud.dataqna.v1alpha.IExecuteQuestionRequest, options?: CallOptions): Promise<[
        protos.google.cloud.dataqna.v1alpha.IQuestion,
        protos.google.cloud.dataqna.v1alpha.IExecuteQuestionRequest | undefined,
        {} | undefined
    ]>;
Parameters
NameDescription
request protos.google.cloud.dataqna.v1alpha.IExecuteQuestionRequest
options CallOptions
Returns
TypeDescription
Promise<[ protos.google.cloud.dataqna.v1alpha.IQuestion, protos.google.cloud.dataqna.v1alpha.IExecuteQuestionRequest | undefined, {} | undefined ]>

executeQuestion(request, options, callback)

executeQuestion(request: protos.google.cloud.dataqna.v1alpha.IExecuteQuestionRequest, options: CallOptions, callback: Callback<protos.google.cloud.dataqna.v1alpha.IQuestion, protos.google.cloud.dataqna.v1alpha.IExecuteQuestionRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.dataqna.v1alpha.IExecuteQuestionRequest
options CallOptions
callback Callback<protos.google.cloud.dataqna.v1alpha.IQuestion, protos.google.cloud.dataqna.v1alpha.IExecuteQuestionRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

executeQuestion(request, callback)

executeQuestion(request: protos.google.cloud.dataqna.v1alpha.IExecuteQuestionRequest, callback: Callback<protos.google.cloud.dataqna.v1alpha.IQuestion, protos.google.cloud.dataqna.v1alpha.IExecuteQuestionRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.dataqna.v1alpha.IExecuteQuestionRequest
callback Callback<protos.google.cloud.dataqna.v1alpha.IQuestion, protos.google.cloud.dataqna.v1alpha.IExecuteQuestionRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getProjectId()

getProjectId(): Promise<string>;
Returns
TypeDescription
Promise<string>

getProjectId(callback)

getProjectId(callback: Callback<string, undefined, undefined>): void;
Parameter
NameDescription
callback Callback<string, undefined, undefined>
Returns
TypeDescription
void

getQuestion(request, options)

getQuestion(request?: protos.google.cloud.dataqna.v1alpha.IGetQuestionRequest, options?: CallOptions): Promise<[
        protos.google.cloud.dataqna.v1alpha.IQuestion,
        protos.google.cloud.dataqna.v1alpha.IGetQuestionRequest | undefined,
        {} | undefined
    ]>;
Parameters
NameDescription
request protos.google.cloud.dataqna.v1alpha.IGetQuestionRequest
options CallOptions
Returns
TypeDescription
Promise<[ protos.google.cloud.dataqna.v1alpha.IQuestion, protos.google.cloud.dataqna.v1alpha.IGetQuestionRequest | undefined, {} | undefined ]>

getQuestion(request, options, callback)

getQuestion(request: protos.google.cloud.dataqna.v1alpha.IGetQuestionRequest, options: CallOptions, callback: Callback<protos.google.cloud.dataqna.v1alpha.IQuestion, protos.google.cloud.dataqna.v1alpha.IGetQuestionRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.dataqna.v1alpha.IGetQuestionRequest
options CallOptions
callback Callback<protos.google.cloud.dataqna.v1alpha.IQuestion, protos.google.cloud.dataqna.v1alpha.IGetQuestionRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getQuestion(request, callback)

getQuestion(request: protos.google.cloud.dataqna.v1alpha.IGetQuestionRequest, callback: Callback<protos.google.cloud.dataqna.v1alpha.IQuestion, protos.google.cloud.dataqna.v1alpha.IGetQuestionRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.dataqna.v1alpha.IGetQuestionRequest
callback Callback<protos.google.cloud.dataqna.v1alpha.IQuestion, protos.google.cloud.dataqna.v1alpha.IGetQuestionRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getUserFeedback(request, options)

getUserFeedback(request?: protos.google.cloud.dataqna.v1alpha.IGetUserFeedbackRequest, options?: CallOptions): Promise<[
        protos.google.cloud.dataqna.v1alpha.IUserFeedback,
        protos.google.cloud.dataqna.v1alpha.IGetUserFeedbackRequest | undefined,
        {} | undefined
    ]>;
Parameters
NameDescription
request protos.google.cloud.dataqna.v1alpha.IGetUserFeedbackRequest
options CallOptions
Returns
TypeDescription
Promise<[ protos.google.cloud.dataqna.v1alpha.IUserFeedback, protos.google.cloud.dataqna.v1alpha.IGetUserFeedbackRequest | undefined, {} | undefined ]>

getUserFeedback(request, options, callback)

getUserFeedback(request: protos.google.cloud.dataqna.v1alpha.IGetUserFeedbackRequest, options: CallOptions, callback: Callback<protos.google.cloud.dataqna.v1alpha.IUserFeedback, protos.google.cloud.dataqna.v1alpha.IGetUserFeedbackRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.dataqna.v1alpha.IGetUserFeedbackRequest
options CallOptions
callback Callback<protos.google.cloud.dataqna.v1alpha.IUserFeedback, protos.google.cloud.dataqna.v1alpha.IGetUserFeedbackRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getUserFeedback(request, callback)

getUserFeedback(request: protos.google.cloud.dataqna.v1alpha.IGetUserFeedbackRequest, callback: Callback<protos.google.cloud.dataqna.v1alpha.IUserFeedback, protos.google.cloud.dataqna.v1alpha.IGetUserFeedbackRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.dataqna.v1alpha.IGetUserFeedbackRequest
callback Callback<protos.google.cloud.dataqna.v1alpha.IUserFeedback, protos.google.cloud.dataqna.v1alpha.IGetUserFeedbackRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

initialize()

initialize(): Promise<{
        [name: string]: Function;
    }>;

Initialize the client. Performs asynchronous operations (such as authentication) and prepares the client. This function will be called automatically when any class method is called for the first time, but if you need to initialize it before calling an actual method, feel free to call initialize() directly.

You can await on this method if you want to make sure the client is initialized.

Returns
TypeDescription
Promise<{ [name: string]: Function; }>

{Promise} A promise that resolves to an authenticated service stub.

locationPath(project, location)

locationPath(project: string, location: string): string;

Return a fully-qualified location resource name string.

Parameters
NameDescription
project string
location string
Returns
TypeDescription
string

{string} Resource name string.

matchLocationFromLocationName(locationName)

matchLocationFromLocationName(locationName: string): string | number;

Parse the location from Location resource.

Parameter
NameDescription
locationName string

A fully-qualified path representing Location resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchLocationFromQuestionName(questionName)

matchLocationFromQuestionName(questionName: string): string | number;

Parse the location from Question resource.

Parameter
NameDescription
questionName string

A fully-qualified path representing Question resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchLocationFromUserFeedbackName(userFeedbackName)

matchLocationFromUserFeedbackName(userFeedbackName: string): string | number;

Parse the location from UserFeedback resource.

Parameter
NameDescription
userFeedbackName string

A fully-qualified path representing UserFeedback resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchProjectFromLocationName(locationName)

matchProjectFromLocationName(locationName: string): string | number;

Parse the project from Location resource.

Parameter
NameDescription
locationName string

A fully-qualified path representing Location resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchProjectFromQuestionName(questionName)

matchProjectFromQuestionName(questionName: string): string | number;

Parse the project from Question resource.

Parameter
NameDescription
questionName string

A fully-qualified path representing Question resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchProjectFromUserFeedbackName(userFeedbackName)

matchProjectFromUserFeedbackName(userFeedbackName: string): string | number;

Parse the project from UserFeedback resource.

Parameter
NameDescription
userFeedbackName string

A fully-qualified path representing UserFeedback resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchQuestionFromQuestionName(questionName)

matchQuestionFromQuestionName(questionName: string): string | number;

Parse the question from Question resource.

Parameter
NameDescription
questionName string

A fully-qualified path representing Question resource.

Returns
TypeDescription
string | number

{string} A string representing the question.

matchQuestionFromUserFeedbackName(userFeedbackName)

matchQuestionFromUserFeedbackName(userFeedbackName: string): string | number;

Parse the question from UserFeedback resource.

Parameter
NameDescription
userFeedbackName string

A fully-qualified path representing UserFeedback resource.

Returns
TypeDescription
string | number

{string} A string representing the question.

questionPath(project, location, question)

questionPath(project: string, location: string, question: string): string;

Return a fully-qualified question resource name string.

Parameters
NameDescription
project string
location string
question string
Returns
TypeDescription
string

{string} Resource name string.

updateUserFeedback(request, options)

updateUserFeedback(request?: protos.google.cloud.dataqna.v1alpha.IUpdateUserFeedbackRequest, options?: CallOptions): Promise<[
        protos.google.cloud.dataqna.v1alpha.IUserFeedback,
        (protos.google.cloud.dataqna.v1alpha.IUpdateUserFeedbackRequest | undefined),
        {} | undefined
    ]>;
Parameters
NameDescription
request protos.google.cloud.dataqna.v1alpha.IUpdateUserFeedbackRequest
options CallOptions
Returns
TypeDescription
Promise<[ protos.google.cloud.dataqna.v1alpha.IUserFeedback, (protos.google.cloud.dataqna.v1alpha.IUpdateUserFeedbackRequest | undefined), {} | undefined ]>

updateUserFeedback(request, options, callback)

updateUserFeedback(request: protos.google.cloud.dataqna.v1alpha.IUpdateUserFeedbackRequest, options: CallOptions, callback: Callback<protos.google.cloud.dataqna.v1alpha.IUserFeedback, protos.google.cloud.dataqna.v1alpha.IUpdateUserFeedbackRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.dataqna.v1alpha.IUpdateUserFeedbackRequest
options CallOptions
callback Callback<protos.google.cloud.dataqna.v1alpha.IUserFeedback, protos.google.cloud.dataqna.v1alpha.IUpdateUserFeedbackRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

updateUserFeedback(request, callback)

updateUserFeedback(request: protos.google.cloud.dataqna.v1alpha.IUpdateUserFeedbackRequest, callback: Callback<protos.google.cloud.dataqna.v1alpha.IUserFeedback, protos.google.cloud.dataqna.v1alpha.IUpdateUserFeedbackRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.dataqna.v1alpha.IUpdateUserFeedbackRequest
callback Callback<protos.google.cloud.dataqna.v1alpha.IUserFeedback, protos.google.cloud.dataqna.v1alpha.IUpdateUserFeedbackRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

userFeedbackPath(project, location, question)

userFeedbackPath(project: string, location: string, question: string): string;

Return a fully-qualified userFeedback resource name string.

Parameters
NameDescription
project string
location string
question string
Returns
TypeDescription
string

{string} Resource name string.