Skip to content
This repository has been archived by the owner on Jul 20, 2023. It is now read-only.

Commit

Permalink
fix: do not modify options object, use defaultScopes (#27)
Browse files Browse the repository at this point in the history
* fix: do not modify options object, use defaultScopes

Regenerated the library using gapic-generator-typescript v1.2.1.

* fix(deps): require google-gax ^2.9.2
  • Loading branch information
alexander-fenster authored Nov 7, 2020
1 parent ef4ceef commit a0124c7
Show file tree
Hide file tree
Showing 42 changed files with 3,175 additions and 1,695 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"samples-test": "cd samples/ && npm link ../ && npm test"
},
"dependencies": {
"google-gax": "^2.7.0"
"google-gax": "^2.9.2"
},
"devDependencies": {
"@types/mocha": "^8.0.2",
Expand Down
8 changes: 4 additions & 4 deletions protos/google/cloud/dialogflow/cx/v3beta1/agent.proto
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ service Agents {
option (google.api.method_signature) = "name";
}

// Exports the specified agent to a ZIP file.
// Exports the specified agent to a binary file.
rpc ExportAgent(ExportAgentRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v3beta1/{name=projects/*/locations/*/agents/*}:export"
Expand All @@ -94,10 +94,10 @@ service Agents {
};
}

// Restores the specified agent from a ZIP file.
// Restores the specified agent from a binary file.
//
// Note that all existing intents, intent routes, entity types, pages and
// webhooks in the agent will be deleted.
// Replaces the current agent with a new one. Note that all existing resources
// in agent (e.g. intents, entity types, flows) will be removed.
rpc RestoreAgent(RestoreAgentRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v3beta1/{name=projects/*/locations/*/agents/*}:restore"
Expand Down
32 changes: 13 additions & 19 deletions protos/google/cloud/dialogflow/cx/v3beta1/audio_config.proto
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ syntax = "proto3";

package google.cloud.dialogflow.cx.v3beta1;

import "google/api/annotations.proto";
import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/protobuf/duration.proto";
import "google/api/annotations.proto";

option cc_enable_arenas = true;
option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3Beta1";
Expand Down Expand Up @@ -115,12 +115,10 @@ message InputAudioConfig {
// more details.
int32 sample_rate_hertz = 2;

// Optional. If `true`, Dialogflow returns
// [SpeechWordInfo][google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo] in
// [StreamingRecognitionResult][google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult]
// with information about the recognized speech words, e.g. start and end time
// offsets. If false or unspecified, Speech doesn't return any word-level
// information.
// Optional. If `true`, Dialogflow returns [SpeechWordInfo][google.cloud.dialogflow.cx.v3beta1.SpeechWordInfo] in
// [StreamingRecognitionResult][google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult] with information about the recognized speech
// words, e.g. start and end time offsets. If false or unspecified, Speech
// doesn't return any word-level information.
bool enable_word_info = 13;

// Optional. A list of strings containing words and phrases that the speech
Expand All @@ -144,8 +142,7 @@ message InputAudioConfig {
// for more details.
string model = 7;

// Optional. Which variant of the [Speech
// model][google.cloud.dialogflow.cx.v3beta1.InputAudioConfig.model] to use.
// Optional. Which variant of the [Speech model][google.cloud.dialogflow.cx.v3beta1.InputAudioConfig.model] to use.
SpeechModelVariant model_variant = 10;

// Optional. If `false` (default), recognition does not cease until the
Expand All @@ -159,8 +156,7 @@ message InputAudioConfig {
bool single_utterance = 8;
}

// Variant of the specified [Speech
// model][google.cloud.dialogflow.cx.v3beta1.InputAudioConfig.model] to use.
// Variant of the specified [Speech model][google.cloud.dialogflow.cx.v3beta1.InputAudioConfig.model] to use.
//
// See the [Cloud Speech
// documentation](https://cloud.google.com/speech-to-text/docs/enhanced-models)
Expand Down Expand Up @@ -189,8 +185,8 @@ enum SpeechModelVariant {
// Use an enhanced model variant:
//
// * If an enhanced variant does not exist for the given
// [model][google.cloud.dialogflow.cx.v3beta1.InputAudioConfig.model] and
// request language, Dialogflow falls back to the standard variant.
// [model][google.cloud.dialogflow.cx.v3beta1.InputAudioConfig.model] and request language, Dialogflow falls
// back to the standard variant.
//
// The [Cloud Speech
// documentation](https://cloud.google.com/speech-to-text/docs/enhanced-models)
Expand All @@ -212,10 +208,9 @@ message VoiceSelectionParams {

// Optional. The preferred gender of the voice. If not set, the service will
// choose a voice based on the other parameters such as language_code and
// [name][google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams.name]. Note
// that this is only a preference, not requirement. If a voice of the
// appropriate gender is not available, the synthesizer should substitute a
// voice with a different gender rather than failing the request.
// [name][google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams.name]. Note that this is only a preference, not requirement. If a
// voice of the appropriate gender is not available, the synthesizer should
// substitute a voice with a different gender rather than failing the request.
SsmlVoiceGender ssml_gender = 2;
}

Expand Down Expand Up @@ -271,8 +266,7 @@ enum SsmlVoiceGender {
// Instructs the speech synthesizer how to generate the output audio content.
message OutputAudioConfig {
// Required. Audio encoding of the synthesized audio content.
OutputAudioEncoding audio_encoding = 1
[(google.api.field_behavior) = REQUIRED];
OutputAudioEncoding audio_encoding = 1 [(google.api.field_behavior) = REQUIRED];

// Optional. The synthesis sample rate (in hertz) for this audio. If not
// provided, then the synthesizer will use the default sample rate based on
Expand Down
45 changes: 15 additions & 30 deletions protos/google/cloud/dialogflow/cx/v3beta1/entity_type.proto
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,15 @@ option java_outer_classname = "EntityTypeProto";
option java_package = "com.google.cloud.dialogflow.cx.v3beta1";
option objc_class_prefix = "DF";

// Service for managing
// [EntityTypes][google.cloud.dialogflow.cx.v3beta1.EntityType].
// Service for managing [EntityTypes][google.cloud.dialogflow.cx.v3beta1.EntityType].
service EntityTypes {
option (google.api.default_host) = "dialogflow.googleapis.com";
option (google.api.oauth_scopes) =
"https://www.googleapis.com/auth/cloud-platform,"
"https://www.googleapis.com/auth/dialogflow";

// Returns the list of all entity types in the specified agent.
rpc ListEntityTypes(ListEntityTypesRequest)
returns (ListEntityTypesResponse) {
rpc ListEntityTypes(ListEntityTypesRequest) returns (ListEntityTypesResponse) {
option (google.api.http) = {
get: "/v3beta1/{parent=projects/*/locations/*/agents/*}/entityTypes"
};
Expand Down Expand Up @@ -75,8 +73,7 @@ service EntityTypes {
}

// Deletes the specified entity type.
rpc DeleteEntityType(DeleteEntityTypeRequest)
returns (google.protobuf.Empty) {
rpc DeleteEntityType(DeleteEntityTypeRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
delete: "/v3beta1/{name=projects/*/locations/*/agents/*/entityTypes/*}"
};
Expand Down Expand Up @@ -107,9 +104,7 @@ service EntityTypes {
//
// * **User** - entities that are built for an individual user such as
// favorites, preferences, playlists, and so on. A user entity is
// represented by the
// [SessionEntityType][google.cloud.dialogflow.cx.v3beta1.SessionEntityType]
// type.
// represented by the [SessionEntityType][google.cloud.dialogflow.cx.v3beta1.SessionEntityType] type.
//
// For more information about entity types, see the [Dialogflow
// documentation](https://cloud.google.com/dialogflow/docs/entities-overview).
Expand Down Expand Up @@ -184,14 +179,12 @@ message EntityType {
}

// The unique identifier of the entity type.
// Required for
// [EntityTypes.UpdateEntityType][google.cloud.dialogflow.cx.v3beta1.EntityTypes.UpdateEntityType].
// Required for [EntityTypes.UpdateEntityType][google.cloud.dialogflow.cx.v3beta1.EntityTypes.UpdateEntityType].
// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
// ID>/entityTypes/<Entity Type ID>`.
string name = 1;

// Required. The human-readable name of the entity type, unique within the
// agent.
// Required. The human-readable name of the entity type, unique within the agent.
string display_name = 2 [(google.api.field_behavior) = REQUIRED];

// Required. Indicates the kind of entity type.
Expand All @@ -214,8 +207,7 @@ message EntityType {
bool enable_fuzzy_extraction = 7;
}

// The request message for
// [EntityTypes.ListEntityTypes][google.cloud.dialogflow.cx.v3beta1.EntityTypes.ListEntityTypes].
// The request message for [EntityTypes.ListEntityTypes][google.cloud.dialogflow.cx.v3beta1.EntityTypes.ListEntityTypes].
message ListEntityTypesRequest {
// Required. The agent to list all entity types for.
// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
Expand Down Expand Up @@ -248,8 +240,7 @@ message ListEntityTypesRequest {
string page_token = 4;
}

// The response message for
// [EntityTypes.ListEntityTypes][google.cloud.dialogflow.cx.v3beta1.EntityTypes.ListEntityTypes].
// The response message for [EntityTypes.ListEntityTypes][google.cloud.dialogflow.cx.v3beta1.EntityTypes.ListEntityTypes].
message ListEntityTypesResponse {
// The list of entity types. There will be a maximum number of items returned
// based on the page_size field in the request.
Expand All @@ -260,8 +251,7 @@ message ListEntityTypesResponse {
string next_page_token = 2;
}

// The request message for
// [EntityTypes.GetEntityType][google.cloud.dialogflow.cx.v3beta1.EntityTypes.GetEntityType].
// The request message for [EntityTypes.GetEntityType][google.cloud.dialogflow.cx.v3beta1.EntityTypes.GetEntityType].
message GetEntityTypeRequest {
// Required. The name of the entity type.
// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
Expand All @@ -288,8 +278,7 @@ message GetEntityTypeRequest {
string language_code = 2;
}

// The request message for
// [EntityTypes.CreateEntityType][google.cloud.dialogflow.cx.v3beta1.EntityTypes.CreateEntityType].
// The request message for [EntityTypes.CreateEntityType][google.cloud.dialogflow.cx.v3beta1.EntityTypes.CreateEntityType].
message CreateEntityTypeRequest {
// Required. The agent to create a entity type for.
// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
Expand Down Expand Up @@ -317,8 +306,7 @@ message CreateEntityTypeRequest {
string language_code = 3;
}

// The request message for
// [EntityTypes.UpdateEntityType][google.cloud.dialogflow.cx.v3beta1.EntityTypes.UpdateEntityType].
// The request message for [EntityTypes.UpdateEntityType][google.cloud.dialogflow.cx.v3beta1.EntityTypes.UpdateEntityType].
message UpdateEntityTypeRequest {
// Required. The entity type to update.
EntityType entity_type = 1 [(google.api.field_behavior) = REQUIRED];
Expand All @@ -340,8 +328,7 @@ message UpdateEntityTypeRequest {
google.protobuf.FieldMask update_mask = 3;
}

// The request message for
// [EntityTypes.DeleteEntityType][google.cloud.dialogflow.cx.v3beta1.EntityTypes.DeleteEntityType].
// The request message for [EntityTypes.DeleteEntityType][google.cloud.dialogflow.cx.v3beta1.EntityTypes.DeleteEntityType].
message DeleteEntityTypeRequest {
// Required. The name of the entity type to delete.
// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
Expand All @@ -360,10 +347,8 @@ message DeleteEntityTypeRequest {
// indicating the referencing resources.
// * If `force` is set to true, Dialogflow will remove the entity type, as
// well as any references to the entity type (i.e. Page
// [parameter][google.cloud.dialogflow.cx.v3beta1.Form.Parameter] of the
// entity type will be changed to
// '@sys.any' and intent
// [parameter][google.cloud.dialogflow.cx.v3beta1.Intent.Parameter] of the
// entity type will be removed).
// [parameter][google.cloud.dialogflow.cx.v3beta1.Form.Parameter] of the entity type will be changed to
// '@sys.any' and intent [parameter][google.cloud.dialogflow.cx.v3beta1.Intent.Parameter] of the entity type
// will be removed).
bool force = 2;
}
52 changes: 23 additions & 29 deletions protos/google/cloud/dialogflow/cx/v3beta1/flow.proto
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import "google/cloud/dialogflow/cx/v3beta1/page.proto";
import "google/longrunning/operations.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/field_mask.proto";
import "google/protobuf/timestamp.proto";

option cc_enable_arenas = true;
option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3Beta1";
Expand Down Expand Up @@ -138,10 +139,6 @@ message NluSettings {

// Indicates NLU model training mode.
ModelTrainingMode model_training_mode = 4;

// Indicates if automatic spell correction is enabled in detect intent
// requests.
bool enable_spell_correction = 5 [deprecated = true];
}

// Flows represents the conversation flows when you build your chatbot agent.
Expand Down Expand Up @@ -203,18 +200,16 @@ message Flow {
// regardless of the current page. Event handlers defined in the page
// have higher priority than those defined in the flow.
//
// Unlike
// [transition_routes][google.cloud.dialogflow.cx.v3beta1.Flow.transition_routes],
// these handlers are evaluated on a first-match basis. The first one that
// matches the event get executed, with the rest being ignored.
// Unlike [transition_routes][google.cloud.dialogflow.cx.v3beta1.Flow.transition_routes], these handlers are
// evaluated on a first-match basis. The first one that matches the event
// get executed, with the rest being ignored.
repeated EventHandler event_handlers = 10;

// NLU related settings of the flow.
NluSettings nlu_settings = 11;
}

// The request message for
// [Flows.CreateFlow][google.cloud.dialogflow.cx.v3beta1.Flows.CreateFlow].
// The request message for [Flows.CreateFlow][google.cloud.dialogflow.cx.v3beta1.Flows.CreateFlow].
message CreateFlowRequest {
// Required. The agent to create a flow for.
// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
Expand All @@ -241,15 +236,16 @@ message CreateFlowRequest {
string language_code = 3;
}

// The request message for
// [Flows.DeleteFlow][google.cloud.dialogflow.cx.v3beta1.Flows.DeleteFlow].
// The request message for [Flows.DeleteFlow][google.cloud.dialogflow.cx.v3beta1.Flows.DeleteFlow].
message DeleteFlowRequest {
// Required. The name of the flow to delete.
// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
// ID>/flows/<Flow ID>`.
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = { type: "dialogflow.googleapis.com/Flow" }
(google.api.resource_reference) = {
type: "dialogflow.googleapis.com/Flow"
}
];

// This field has no effect for flows with no incoming transitions.
Expand All @@ -265,8 +261,7 @@ message DeleteFlowRequest {
bool force = 2;
}

// The request message for
// [Flows.ListFlows][google.cloud.dialogflow.cx.v3beta1.Flows.ListFlows].
// The request message for [Flows.ListFlows][google.cloud.dialogflow.cx.v3beta1.Flows.ListFlows].
message ListFlowsRequest {
// Required. The agent containing the flows.
// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
Expand Down Expand Up @@ -298,8 +293,7 @@ message ListFlowsRequest {
string language_code = 4;
}

// The response message for
// [Flows.ListFlows][google.cloud.dialogflow.cx.v3beta1.Flows.ListFlows].
// The response message for [Flows.ListFlows][google.cloud.dialogflow.cx.v3beta1.Flows.ListFlows].
message ListFlowsResponse {
// The list of flows. There will be a maximum number of items returned based
// on the page_size field in the request.
Expand All @@ -310,15 +304,16 @@ message ListFlowsResponse {
string next_page_token = 2;
}

// The response message for
// [Flows.GetFlow][google.cloud.dialogflow.cx.v3beta1.Flows.GetFlow].
// The response message for [Flows.GetFlow][google.cloud.dialogflow.cx.v3beta1.Flows.GetFlow].
message GetFlowRequest {
// Required. The name of the flow to get.
// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
// ID>/flows/<Flow ID>`.
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = { type: "dialogflow.googleapis.com/Flow" }
(google.api.resource_reference) = {
type: "dialogflow.googleapis.com/Flow"
}
];

// The language to retrieve the flow for. The following fields are language
Expand All @@ -335,16 +330,14 @@ message GetFlowRequest {
string language_code = 2;
}

// The request message for
// [Flows.UpdateFlow][google.cloud.dialogflow.cx.v3beta1.Flows.UpdateFlow].
// The request message for [Flows.UpdateFlow][google.cloud.dialogflow.cx.v3beta1.Flows.UpdateFlow].
message UpdateFlowRequest {
// Required. The flow to update.
Flow flow = 1 [(google.api.field_behavior) = REQUIRED];

// Required. The mask to control which fields get updated. If `update_mask` is
// not specified, an error will be returned.
google.protobuf.FieldMask update_mask = 2
[(google.api.field_behavior) = REQUIRED];
// Required. The mask to control which fields get updated. If `update_mask` is not
// specified, an error will be returned.
google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED];

// The language of the following fields in `flow`:
//
Expand All @@ -359,14 +352,15 @@ message UpdateFlowRequest {
string language_code = 3;
}

// The request message for
// [Flows.TrainFlow][google.cloud.dialogflow.cx.v3beta1.Flows.TrainFlow].
// The request message for [Flows.TrainFlow][google.cloud.dialogflow.cx.v3beta1.Flows.TrainFlow].
message TrainFlowRequest {
// Required. The flow to train.
// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
// ID>/flows/<Flow ID>`.
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = { type: "dialogflow.googleapis.com/Flow" }
(google.api.resource_reference) = {
type: "dialogflow.googleapis.com/Flow"
}
];
}
Loading

0 comments on commit a0124c7

Please sign in to comment.