Skip to content

Commit

Permalink
feat: added support for Deployments with ListDeployments and GetDeplo…
Browse files Browse the repository at this point in the history
…yment apis

feat: added support for DeployFlow api under Environments
feat: added support for TestCasesConfig under Environment
docs: added long running operation explanation for several apis
fix!: marked resource name of security setting as not-required

PiperOrigin-RevId: 399726267
  • Loading branch information
Google APIs authored and Copybara-Service committed Sep 29, 2021
1 parent 0cfe2ce commit 14829f3
Show file tree
Hide file tree
Showing 10 changed files with 398 additions and 34 deletions.
9 changes: 2 additions & 7 deletions google/cloud/dialogflow/cx/v3beta1/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ proto_library(
"advanced_settings.proto",
"agent.proto",
"audio_config.proto",
"deployment.proto",
"entity_type.proto",
"environment.proto",
"experiment.proto",
Expand Down Expand Up @@ -96,20 +97,18 @@ java_gapic_library(
service_yaml = "dialogflow_v3beta1.yaml",
test_deps = [
":cx_java_grpc",
"//google/cloud/location:location_java_grpc",
],
deps = [
":cx_java_proto",
"//google/api:api_java_proto",
"//google/cloud/location:location_java_grpc",
"//google/cloud/location:location_java_proto",
],
)

java_gapic_test(
name = "cx_java_gapic_test_suite",
test_classes = [
"com.google.cloud.dialogflow.cx.v3beta1.AgentsClientTest",
"com.google.cloud.dialogflow.cx.v3beta1.DeploymentsClientTest",
"com.google.cloud.dialogflow.cx.v3beta1.EntityTypesClientTest",
"com.google.cloud.dialogflow.cx.v3beta1.EnvironmentsClientTest",
"com.google.cloud.dialogflow.cx.v3beta1.ExperimentsClientTest",
Expand All @@ -135,9 +134,6 @@ java_gapic_assembly_gradle_pkg(
":cx_java_grpc",
":cx_java_proto",
":cx_proto",
"//google/cloud/location:location_java_grpc",
"//google/cloud/location:location_java_proto",
"//google/cloud/location:location_proto",
],
)

Expand Down Expand Up @@ -174,7 +170,6 @@ go_gapic_library(
service_yaml = "dialogflow_v3beta1.yaml",
deps = [
":cx_go_proto",
"//google/cloud/location:location_go_proto",
"//google/longrunning:longrunning_go_proto",
"@com_google_cloud_go//longrunning:go_default_library",
"@com_google_cloud_go//longrunning/autogen:go_default_library",
Expand Down
10 changes: 10 additions & 0 deletions google/cloud/dialogflow/cx/v3beta1/agent.proto
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ service Agents {
}

// Exports the specified agent to a binary file.
//
// This method is a [long-running
// operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation).
// The returned `Operation` type has the following method-specific fields:
Expand All @@ -117,6 +118,15 @@ service Agents {
// Replaces the current agent with a new one. Note that all existing resources
// in agent (e.g. intents, entity types, flows) will be removed.
//
// This method is a [long-running
// operation](https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation).
// The returned `Operation` type has the following method-specific fields:
//
// - `metadata`: An empty [Struct
// message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct)
// - `response`: An [Empty
// message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)
//
// Note: You should always train a flow prior to sending it queries. See the
// [training
// documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training).
Expand Down
50 changes: 25 additions & 25 deletions google/cloud/dialogflow/cx/v3beta1/audio_config.proto
Original file line number Diff line number Diff line change
Expand Up @@ -31,31 +31,6 @@ option java_package = "com.google.cloud.dialogflow.cx.v3beta1";
option objc_class_prefix = "DF";
option ruby_package = "Google::Cloud::Dialogflow::CX::V3beta1";

// Information for a word recognized by the speech recognizer.
message SpeechWordInfo {
// The word this info is for.
string word = 3;

// Time offset relative to the beginning of the audio that corresponds to the
// start of the spoken word. This is an experimental feature and the accuracy
// of the time offset can vary.
google.protobuf.Duration start_offset = 1;

// Time offset relative to the beginning of the audio that corresponds to the
// end of the spoken word. This is an experimental feature and the accuracy of
// the time offset can vary.
google.protobuf.Duration end_offset = 2;

// The Speech confidence between 0.0 and 1.0 for this word. A higher number
// indicates an estimated greater likelihood that the recognized word is
// correct. The default of 0.0 is a sentinel value indicating that confidence
// was not set.
//
// This field is not guaranteed to be fully stable over time for the same
// audio input. Users should also not rely on it to always be provided.
float confidence = 4;
}

// Audio encoding of the audio content sent in the conversational query request.
// Refer to the
// [Cloud Speech API
Expand Down Expand Up @@ -105,6 +80,31 @@ enum AudioEncoding {
AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE = 7;
}

// Information for a word recognized by the speech recognizer.
message SpeechWordInfo {
// The word this info is for.
string word = 3;

// Time offset relative to the beginning of the audio that corresponds to the
// start of the spoken word. This is an experimental feature and the accuracy
// of the time offset can vary.
google.protobuf.Duration start_offset = 1;

// Time offset relative to the beginning of the audio that corresponds to the
// end of the spoken word. This is an experimental feature and the accuracy of
// the time offset can vary.
google.protobuf.Duration end_offset = 2;

// The Speech confidence between 0.0 and 1.0 for this word. A higher number
// indicates an estimated greater likelihood that the recognized word is
// correct. The default of 0.0 is a sentinel value indicating that confidence
// was not set.
//
// This field is not guaranteed to be fully stable over time for the same
// audio input. Users should also not rely on it to always be provided.
float confidence = 4;
}

// Instructs the speech recognizer on how to process the audio content.
message InputAudioConfig {
// Required. Audio encoding of the audio content to process.
Expand Down
171 changes: 171 additions & 0 deletions google/cloud/dialogflow/cx/v3beta1/deployment.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
// Copyright 2021 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

syntax = "proto3";

package google.cloud.dialogflow.cx.v3beta1;

import "google/api/annotations.proto";
import "google/api/client.proto";
import "google/api/field_behavior.proto";
import "google/api/resource.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";
option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/cx/v3beta1;cx";
option java_multiple_files = true;
option java_outer_classname = "DeploymentProto";
option java_package = "com.google.cloud.dialogflow.cx.v3beta1";
option objc_class_prefix = "DF";
option ruby_package = "Google::Cloud::Dialogflow::CX::V3beta1";

// Service for managing [Deployments][google.cloud.dialogflow.cx.v3beta1.Deployment].
service Deployments {
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 deployments in the specified [Environment][google.cloud.dialogflow.cx.v3beta1.Environment].
rpc ListDeployments(ListDeploymentsRequest) returns (ListDeploymentsResponse) {
option (google.api.http) = {
get: "/v3beta1/{parent=projects/*/locations/*/agents/*/environments/*}/deployments"
};
option (google.api.method_signature) = "parent";
}

// Retrieves the specified [Deployment][google.cloud.dialogflow.cx.v3beta1.Deployment].
rpc GetDeployment(GetDeploymentRequest) returns (Deployment) {
option (google.api.http) = {
get: "/v3beta1/{name=projects/*/locations/*/agents/*/environments/*/deployments/*}"
};
option (google.api.method_signature) = "name";
}
}

// Represents an deployment in an environment. A deployment happens when a flow
// version configured to be active in the environment. You can configure running
// pre-deployment steps, e.g. running validation test cases, experiment
// auto-rollout, etc.
message Deployment {
option (google.api.resource) = {
type: "dialogflow.googleapis.com/Deployment"
pattern: "projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/deployments/{deployment}"
};

// Result of the deployment.
message Result {
// Results of test cases running before the deployment.
// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
// ID>/testCases/<TestCase ID>/results/<TestCaseResult ID>`.
repeated string deployment_test_results = 1 [(google.api.resource_reference) = {
type: "dialogflow.googleapis.com/TestCaseResult"
}];

// The name of the experiment triggered by this deployment.
// Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent
// ID>/environments/<Environment ID>/experiments/<Experiment ID>.
string experiment = 2 [(google.api.resource_reference) = {
type: "dialogflow.googleapis.com/Experiment"
}];
}

// The state of the deployment.
enum State {
// State unspecified.
STATE_UNSPECIFIED = 0;

// The deployment is running.
RUNNING = 1;

// The deployment succeeded.
SUCCEEDED = 2;

// The deployment failed.
FAILED = 3;
}

// The name of the deployment.
// Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent
// ID>/environments/<Environment ID>/deployments/<Deployment ID>.
string name = 1;

// The name of the flow version for this deployment.
// Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent
// ID>/flows/<Flow ID>/versions/<Verion ID>.
string flow_version = 2 [(google.api.resource_reference) = {
type: "dialogflow.googleapis.com/Version"
}];

// The current state of the deployment.
State state = 3;

// Result of the deployment.
Result result = 4;

// Start time of this deployment.
google.protobuf.Timestamp start_time = 5;

// End time of this deployment.
google.protobuf.Timestamp end_time = 6;
}

// The request message for [Deployments.ListDeployments][google.cloud.dialogflow.cx.v3beta1.Deployments.ListDeployments].
message ListDeploymentsRequest {
// Required. The [Environment][google.cloud.dialogflow.cx.v3beta1.Environment] to list all environments for.
// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
// ID>/environments/<Environment ID>`.
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
child_type: "dialogflow.googleapis.com/Deployment"
}
];

// The maximum number of items to return in a single page. By default 20 and
// at most 100.
int32 page_size = 2;

// The next_page_token value returned from a previous list request.
string page_token = 3;
}

// The response message for [Deployments.ListDeployments][google.cloud.dialogflow.cx.v3beta1.Deployments.ListDeployments].
message ListDeploymentsResponse {
// The list of deployments. There will be a maximum number of items
// returned based on the page_size field in the request. The list may in some
// cases be empty or contain fewer entries than page_size even if this isn't
// the last page.
repeated Deployment deployments = 1;

// Token to retrieve the next page of results, or empty if there are no more
// results in the list.
string next_page_token = 2;
}

// The request message for [Deployments.GetDeployment][google.cloud.dialogflow.cx.v3beta1.Deployments.GetDeployment].
message GetDeploymentRequest {
// Required. The name of the [Deployment][google.cloud.dialogflow.cx.v3beta1.Deployment].
// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
// ID>/environments/<Environment ID>/deployments/<Deployment ID>`.
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "dialogflow.googleapis.com/Deployment"
}
];
}
17 changes: 17 additions & 0 deletions google/cloud/dialogflow/cx/v3beta1/dialogflow_v3beta1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ title: Dialogflow API

apis:
- name: google.cloud.dialogflow.cx.v3beta1.Agents
- name: google.cloud.dialogflow.cx.v3beta1.Deployments
- name: google.cloud.dialogflow.cx.v3beta1.EntityTypes
- name: google.cloud.dialogflow.cx.v3beta1.Environments
- name: google.cloud.dialogflow.cx.v3beta1.Experiments
Expand All @@ -23,6 +24,8 @@ types:
- name: google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesMetadata
- name: google.cloud.dialogflow.cx.v3beta1.BatchRunTestCasesResponse
- name: google.cloud.dialogflow.cx.v3beta1.CreateVersionOperationMetadata
- name: google.cloud.dialogflow.cx.v3beta1.DeployFlowMetadata
- name: google.cloud.dialogflow.cx.v3beta1.DeployFlowResponse
- name: google.cloud.dialogflow.cx.v3beta1.ExportAgentResponse
- name: google.cloud.dialogflow.cx.v3beta1.ExportFlowResponse
- name: google.cloud.dialogflow.cx.v3beta1.ExportTestCasesMetadata
Expand Down Expand Up @@ -68,6 +71,10 @@ backend:
rules:
- selector: 'google.cloud.dialogflow.cx.v3beta1.Agents.*'
deadline: 60.0
- selector: google.cloud.dialogflow.cx.v3beta1.Deployments.GetDeployment
deadline: 60.0
- selector: google.cloud.dialogflow.cx.v3beta1.Deployments.ListDeployments
deadline: 60.0
- selector: 'google.cloud.dialogflow.cx.v3beta1.EntityTypes.*'
deadline: 60.0
- selector: 'google.cloud.dialogflow.cx.v3beta1.Environments.*'
Expand Down Expand Up @@ -133,6 +140,16 @@ authentication:
canonical_scopes: |-
https://www.googleapis.com/auth/cloud-platform,
https://www.googleapis.com/auth/dialogflow
- selector: google.cloud.dialogflow.cx.v3beta1.Deployments.GetDeployment
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/cloud-platform,
https://www.googleapis.com/auth/dialogflow
- selector: google.cloud.dialogflow.cx.v3beta1.Deployments.ListDeployments
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/cloud-platform,
https://www.googleapis.com/auth/dialogflow
- selector: 'google.cloud.dialogflow.cx.v3beta1.EntityTypes.*'
oauth:
canonical_scopes: |-
Expand Down
Loading

0 comments on commit 14829f3

Please sign in to comment.