Skip to content

Commit

Permalink
feat: Publish ListEnvironments for Dialogflow v2/v2beta1 library. (#598)
Browse files Browse the repository at this point in the history
  • Loading branch information
yoshi-automation authored Apr 23, 2020
1 parent a847da1 commit 1e5e469
Show file tree
Hide file tree
Showing 61 changed files with 17,404 additions and 9,300 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
// Copyright 2020 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.v2;

import "google/api/annotations.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";
import "google/api/client.proto";

option cc_enable_arenas = true;
option csharp_namespace = "Google.Cloud.Dialogflow.V2";
option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/v2;dialogflow";
option java_multiple_files = true;
option java_outer_classname = "EnvironmentProto";
option java_package = "com.google.cloud.dialogflow.v2";
option objc_class_prefix = "DF";

// Manages agent environments.
service Environments {
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 non-draft environments of the specified agent.
rpc ListEnvironments(ListEnvironmentsRequest) returns (ListEnvironmentsResponse) {
option (google.api.http) = {
get: "/v2/{parent=projects/*/agent}/environments"
};
}
}

// Represents an agent environment.
message Environment {
option (google.api.resource) = {
type: "dialogflow.googleapis.com/Environment"
pattern: "projects/{project}/agent/environments/{environment}"
};

// Represents an environment state. When a environment is pointed to a new
// agent version, the environment is temporarily set to the `LOADING` state.
// During that time, the environment keeps on serving the previous version of
// the agent. After the new agent version is done loading, the environment is
// set back to the `RUNNING` state.
enum State {
// Not specified. This value is not used.
STATE_UNSPECIFIED = 0;

// Stopped.
STOPPED = 1;

// Loading.
LOADING = 2;

// Running.
RUNNING = 3;
}

// Output only. The unique identifier of this agent environment.
// Format: `projects/<Project ID>/agent/environments/<Environment ID>`.
// For Environment ID, "-" is reserved for 'draft' environment.
string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];

// Optional. The developer-provided description for this environment.
// The maximum length is 500 characters. If exceeded, the request is rejected.
string description = 2 [(google.api.field_behavior) = OPTIONAL];

// Optional. The agent version loaded into this environment.
// Format: `projects/<Project ID>/agent/versions/<Version ID>`.
string agent_version = 3 [(google.api.field_behavior) = OPTIONAL];

// Output only. The state of this environment. This field is read-only, i.e., it cannot be
// set by create and update methods.
State state = 4 [(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. The last update time of this environment. This field is read-only, i.e., it
// cannot be set by create and update methods.
google.protobuf.Timestamp update_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
}

// The request message for [Environments.ListEnvironments][google.cloud.dialogflow.v2.Environments.ListEnvironments].
message ListEnvironmentsRequest {
// Required. The agent to list all environments from.
// Format: `projects/<Project ID>/agent`.
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
child_type: "dialogflow.googleapis.com/Environment"
}
];

// Optional. The maximum number of items to return in a single page. By default 100 and
// at most 1000.
int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];

// Optional. The next_page_token value returned from a previous list request.
string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
}

// The response message for [Environments.ListEnvironments][google.cloud.dialogflow.v2.Environments.ListEnvironments].
message ListEnvironmentsResponse {
// The list of agent environments. There will be a maximum number of items
// returned based on the page_size field in the request.
repeated Environment environments = 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;
}
Original file line number Diff line number Diff line change
Expand Up @@ -68,21 +68,27 @@ message WebhookRequest {
// [Protocol Buffers Language
// Guide](https://developers.google.com/protocol-buffers/docs/proto3#json).
message WebhookResponse {
// Optional. The text to be shown on the screen. This value is passed directly
// to `QueryResult.fulfillment_text`.
// Optional. The text response message intended for the end-user.
// It is recommended to use `fulfillment_messages.text.text[0]` instead.
// When provided, Dialogflow uses this field to populate
// [QueryResult.fulfillment_text][google.cloud.dialogflow.v2.QueryResult.fulfillment_text] sent to the integration or API caller.
string fulfillment_text = 1;

// Optional. The collection of rich messages to present to the user. This
// value is passed directly to `QueryResult.fulfillment_messages`.
// Optional. The rich response messages intended for the end-user.
// When provided, Dialogflow uses this field to populate
// [QueryResult.fulfillment_messages][google.cloud.dialogflow.v2.QueryResult.fulfillment_messages] sent to the integration or API caller.
repeated Intent.Message fulfillment_messages = 2;

// Optional. This value is passed directly to `QueryResult.webhook_source`.
// Optional. A custom field used to identify the webhook source.
// Arbitrary strings are supported.
// When provided, Dialogflow uses this field to populate
// [QueryResult.webhook_source][google.cloud.dialogflow.v2.QueryResult.webhook_source] sent to the integration or API caller.
string source = 3;

// Optional. This field can be used to pass custom data from your webhook to the API
// caller. Arbitrary JSON objects are supported.
// Optional. This field can be used to pass custom data from your webhook to the
// integration or API caller. Arbitrary JSON objects are supported.
// When provided, Dialogflow uses this field to populate
// `QueryResult.webhook_payload` sent to the API caller.
// [QueryResult.webhook_payload][google.cloud.dialogflow.v2.QueryResult.webhook_payload] sent to the integration or API caller.
// This field is also used by the
// [Google Assistant
// integration](https://cloud.google.com/dialogflow/docs/integrations/aog)
Expand All @@ -91,21 +97,22 @@ message WebhookResponse {
// format](https://developers.google.com/assistant/actions/build/json/dialogflow-webhook-json)
google.protobuf.Struct payload = 4;

// Optional. The collection of output contexts. This value is passed directly
// to `QueryResult.output_contexts`.
// Optional. The collection of output contexts that will overwrite currently
// active contexts for the session and reset their lifespans.
// When provided, Dialogflow uses this field to populate
// [QueryResult.output_contexts][google.cloud.dialogflow.v2.QueryResult.output_contexts] sent to the integration or API caller.
repeated Context output_contexts = 5;

// Optional. Makes the platform immediately invoke another `DetectIntent` call
// internally with the specified event as input.
// Optional. Invokes the supplied events.
// When this field is set, Dialogflow ignores the `fulfillment_text`,
// `fulfillment_messages`, and `payload` fields.
EventInput followup_event_input = 6;

// Optional. Additional session entity types to replace or extend developer
// entity types with. The entity synonyms apply to all languages and persist
// for the session of this query. Setting the session entity types inside
// webhook overwrites the session entity types that have been set through
// `DetectIntentRequest.query_params.session_entity_types`.
// for the session. Setting this data from a webhook overwrites
// the session entity types that have been set using `detectIntent`,
// `streamingDetectIntent` or [SessionEntityType][google.cloud.dialogflow.v2.SessionEntityType] management methods.
repeated SessionEntityType session_entity_types = 10;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package google.cloud.dialogflow.v2beta1;
import "google/api/annotations.proto";
import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/cloud/dialogflow/v2beta1/environment.proto";
import "google/cloud/dialogflow/v2beta1/validation_result.proto";
import "google/longrunning/operations.proto";
import "google/protobuf/empty.proto";
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
// Copyright 2020 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.v2beta1;

import "google/api/annotations.proto";
import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/cloud/dialogflow/v2beta1/audio_config.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/field_mask.proto";
import "google/protobuf/timestamp.proto";
import "google/api/client.proto";

option cc_enable_arenas = true;
option csharp_namespace = "Google.Cloud.Dialogflow.V2beta1";
option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/v2beta1;dialogflow";
option java_multiple_files = true;
option java_outer_classname = "EnvironmentProto";
option java_package = "com.google.cloud.dialogflow.v2beta1";
option objc_class_prefix = "DF";

// Manages agent environments.
service Environments {
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 non-draft environments of the specified agent.
rpc ListEnvironments(ListEnvironmentsRequest) returns (ListEnvironmentsResponse) {
option (google.api.http) = {
get: "/v2beta1/{parent=projects/*/agent}/environments"
additional_bindings {
get: "/v2beta1/{parent=projects/*/locations/*/agent}/environments"
}
};
}
}

// Represents an agent environment.
message Environment {
option (google.api.resource) = {
type: "dialogflow.googleapis.com/Environment"
pattern: "projects/{project}/agent/environments/{environment}"
};

// Represents an environment state. When a environment is pointed to a new
// agent version, the environment is temporarily set to the `LOADING` state.
// During that time, the environment keeps on serving the previous version of
// the agent. After the new agent version is done loading, the environment is
// set back to the `RUNNING` state.
enum State {
// Not specified. This value is not used.
STATE_UNSPECIFIED = 0;

// Stopped.
STOPPED = 1;

// Loading.
LOADING = 2;

// Running.
RUNNING = 3;
}

// Output only. The unique identifier of this agent environment.
// Format: `projects/<Project ID>/agent/environments/<Environment ID>`.
// For Environment ID, "-" is reserved for 'draft' environment.
string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];

// Optional. The developer-provided description for this environment.
// The maximum length is 500 characters. If exceeded, the request is rejected.
string description = 2 [(google.api.field_behavior) = OPTIONAL];

// Optional. The agent version loaded into this environment.
// Format: `projects/<Project ID>/agent/versions/<Version ID>`.
string agent_version = 3 [
(google.api.field_behavior) = OPTIONAL,
(google.api.resource_reference) = {
type: "dialogflow.googleapis.com/Version"
}
];

// Output only. The state of this environment. This field is read-only, i.e., it cannot be
// set by create and update methods.
State state = 4 [(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. The last update time of this environment. This field is read-only, i.e., it
// cannot be set by create and update methods.
google.protobuf.Timestamp update_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
}

// The request message for [Environments.ListEnvironments][google.cloud.dialogflow.v2beta1.Environments.ListEnvironments].
message ListEnvironmentsRequest {
// Required. The agent to list all environments from.
// Format: `projects/<Project ID>/agent`.
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
child_type: "dialogflow.googleapis.com/Environment"
}
];

// Optional. The maximum number of items to return in a single page. By default 100 and
// at most 1000.
int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];

// Optional. The next_page_token value returned from a previous list request.
string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
}

// The response message for [Environments.ListEnvironments][google.cloud.dialogflow.v2beta1.Environments.ListEnvironments].
message ListEnvironmentsResponse {
// The list of agent environments. There will be a maximum number of items
// returned based on the page_size field in the request.
repeated Environment environments = 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;
}
Loading

0 comments on commit 1e5e469

Please sign in to comment.