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

Commit

Permalink
feat: Expose supported languages of the agent; feat: add export / imp…
Browse files Browse the repository at this point in the history
…ort flow API docs: Update docs on Pages, Session, Version, etc. (#104)

PiperOrigin-RevId: 370928139

Source-Link: googleapis/googleapis@0fa726c

Source-Link: googleapis/googleapis-gen@e3f4a88
  • Loading branch information
gcf-owl-bot[bot] committed Apr 29, 2021
1 parent 11bef92 commit c7ac26e
Show file tree
Hide file tree
Showing 19 changed files with 2,900 additions and 150 deletions.
14 changes: 14 additions & 0 deletions protos/google/cloud/dialogflow/cx/v3beta1/agent.proto
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,10 @@ message Agent {
// This field cannot be set by the [Agents.UpdateAgent][google.cloud.dialogflow.cx.v3beta1.Agents.UpdateAgent] method.
string default_language_code = 3 [(google.api.field_behavior) = IMMUTABLE];

// The list of all languages supported by the agent (except for the
// `default_language_code`).
repeated string supported_language_codes = 4;

// Required. The time zone of the agent from the [time zone
// database](https://www.iana.org/time-zones), e.g., America/New_York,
// Europe/Paris.
Expand Down Expand Up @@ -306,6 +310,16 @@ message ExportAgentRequest {
// `gs://<bucket-name>/<object-name>`.
// If left unspecified, the serialized agent is returned inline.
string agent_uri = 2 [(google.api.field_behavior) = OPTIONAL];

// Optional. Environment name. If not set, draft environment is assumed.
// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
// ID>/environments/<Environment ID>`.
string environment = 5 [
(google.api.field_behavior) = OPTIONAL,
(google.api.resource_reference) = {
type: "dialogflow.googleapis.com/Environment"
}
];
}

// The response message for [Agents.ExportAgent][google.cloud.dialogflow.cx.v3beta1.Agents.ExportAgent].
Expand Down
2 changes: 1 addition & 1 deletion protos/google/cloud/dialogflow/cx/v3beta1/experiment.proto
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ message Experiment {
// Version variant and associated metrics.
message VersionMetrics {
// The name of the flow [Version][google.cloud.dialogflow.cx.v3beta1.Version].
// Format: `projects/<Project Number>/locations/<Location
// Format: `projects/<Project ID>/locations/<Location
// ID>/agents/<Agent ID>/flows/<Flow ID>/versions/<Version ID>`.
string version = 1 [(google.api.resource_reference) = {
type: "dialogflow.googleapis.com/Version"
Expand Down
122 changes: 122 additions & 0 deletions protos/google/cloud/dialogflow/cx/v3beta1/flow.proto
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,33 @@ service Flows {
};
option (google.api.method_signature) = "name";
}

// Imports the specified flow to the specified agent from a binary file.
rpc ImportFlow(ImportFlowRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v3beta1/{parent=projects/*/locations/*/agents/*}/flows:import"
body: "*"
};
option (google.longrunning.operation_info) = {
response_type: "ImportFlowResponse"
metadata_type: "google.protobuf.Struct"
};
}

// Exports the specified flow to a binary file.
//
// Note that resources (e.g. intents, entities, webhooks) that the flow
// references will also be exported.
rpc ExportFlow(ExportFlowRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v3beta1/{name=projects/*/locations/*/agents/*/flows/*}:export"
body: "*"
};
option (google.longrunning.operation_info) = {
response_type: "ExportFlowResponse"
metadata_type: "google.protobuf.Struct"
};
}
}

// Settings related to NLU.
Expand Down Expand Up @@ -260,7 +287,9 @@ message CreateFlowRequest {
// The language of the following fields in `flow`:
//
// * `Flow.event_handlers.trigger_fulfillment.messages`
// * `Flow.event_handlers.trigger_fulfillment.conditional_cases`
// * `Flow.transition_routes.trigger_fulfillment.messages`
// * `Flow.transition_routes.trigger_fulfillment.conditional_cases`
//
// If not specified, the agent's default language is used.
// [Many
Expand Down Expand Up @@ -317,7 +346,9 @@ message ListFlowsRequest {
// dependent:
//
// * `Flow.event_handlers.trigger_fulfillment.messages`
// * `Flow.event_handlers.trigger_fulfillment.conditional_cases`
// * `Flow.transition_routes.trigger_fulfillment.messages`
// * `Flow.transition_routes.trigger_fulfillment.conditional_cases`
//
// If not specified, the agent's default language is used.
// [Many
Expand Down Expand Up @@ -354,7 +385,9 @@ message GetFlowRequest {
// dependent:
//
// * `Flow.event_handlers.trigger_fulfillment.messages`
// * `Flow.event_handlers.trigger_fulfillment.conditional_cases`
// * `Flow.transition_routes.trigger_fulfillment.messages`
// * `Flow.transition_routes.trigger_fulfillment.conditional_cases`
//
// If not specified, the agent's default language is used.
// [Many
Expand All @@ -376,7 +409,9 @@ message UpdateFlowRequest {
// The language of the following fields in `flow`:
//
// * `Flow.event_handlers.trigger_fulfillment.messages`
// * `Flow.event_handlers.trigger_fulfillment.conditional_cases`
// * `Flow.transition_routes.trigger_fulfillment.messages`
// * `Flow.transition_routes.trigger_fulfillment.conditional_cases`
//
// If not specified, the agent's default language is used.
// [Many
Expand Down Expand Up @@ -449,3 +484,90 @@ message FlowValidationResult {
// Last time the flow was validated.
google.protobuf.Timestamp update_time = 3;
}

// The request message for [Flows.ImportFlow][google.cloud.dialogflow.cx.v3beta1.Flows.ImportFlow].
message ImportFlowRequest {
// Import option.
enum ImportOption {
// Unspecified. Treated as `KEEP`.
IMPORT_OPTION_UNSPECIFIED = 0;

// Always respect settings in exported flow content. It may cause a
// import failure if some settings (e.g. custom NLU) are not supported in
// the agent to import into.
KEEP = 1;

// Fallback to default settings if some settings are not supported in the
// agent to import into. E.g. Standard NLU will be used if custom NLU is
// not available.
FALLBACK = 2;
}

// Required. The agent to import the flow into.
// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
child_type: "dialogflow.googleapis.com/Flow"
}
];

// Required. The flow to import.
oneof flow {
// The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI
// to import flow from. The format of this URI must be
// `gs://<bucket-name>/<object-name>`.
string flow_uri = 2;

// Uncompressed raw byte content for flow.
bytes flow_content = 3;
}

// Flow import mode. If not specified, `KEEP` is assumed.
ImportOption import_option = 4;
}

// The response message for [Flows.ImportFlow][google.cloud.dialogflow.cx.v3beta1.Flows.ImportFlow].
message ImportFlowResponse {
// The unique identifier of the new flow.
// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
// ID>/flows/<Flow ID>`.
string flow = 1 [(google.api.resource_reference) = {
type: "dialogflow.googleapis.com/Flow"
}];
}

// The request message for [Flows.ExportFlow][google.cloud.dialogflow.cx.v3beta1.Flows.ExportFlow].
message ExportFlowRequest {
// Required. The name of the flow to export.
// 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"
}
];

// Optional. The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI to
// export the flow to. The format of this URI must be
// `gs://<bucket-name>/<object-name>`.
// If left unspecified, the serialized flow is returned inline.
string flow_uri = 2 [(google.api.field_behavior) = OPTIONAL];

// Optional. Whether to export flows referenced by the specified flow.
bool include_referenced_flows = 4 [(google.api.field_behavior) = OPTIONAL];
}

// The response message for [Flows.ExportFlow][google.cloud.dialogflow.cx.v3beta1.Flows.ExportFlow].
message ExportFlowResponse {
// The exported flow.
oneof flow {
// The URI to a file containing the exported flow. This field is populated
// only if `flow_uri` is specified in [ExportFlowRequest][google.cloud.dialogflow.cx.v3beta1.ExportFlowRequest].
string flow_uri = 1;

// Uncompressed raw byte content for flow.
bytes flow_content = 2;
}
}
40 changes: 32 additions & 8 deletions protos/google/cloud/dialogflow/cx/v3beta1/page.proto
Original file line number Diff line number Diff line change
Expand Up @@ -378,11 +378,17 @@ message ListPagesRequest {
// dependent:
//
// * `Page.entry_fulfillment.messages`
// * `Page.entry_fulfillment.conditional_cases`
// * `Page.event_handlers.trigger_fulfillment.messages`
// * `Page.event_handlers.trigger_fulfillment.conditional_cases`
// * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages`
// *
// `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.conditional_cases`
// * `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages`
// * `Page.transition_routes.trigger_fulfillment.messages`
// *
// `Page.transition_route_groups.transition_routes.trigger_fulfillment.messages`
// `Page.form.parameters.fill_behavior.reprompt_event_handlers.conditional_cases`
// * `Page.transition_routes.trigger_fulfillment.messages`
// * `Page.transition_routes.trigger_fulfillment.conditional_cases`
//
// If not specified, the agent's default language is used.
// [Many
Expand Down Expand Up @@ -426,11 +432,17 @@ message GetPageRequest {
// dependent:
//
// * `Page.entry_fulfillment.messages`
// * `Page.entry_fulfillment.conditional_cases`
// * `Page.event_handlers.trigger_fulfillment.messages`
// * `Page.event_handlers.trigger_fulfillment.conditional_cases`
// * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages`
// *
// `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.conditional_cases`
// * `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages`
// * `Page.transition_routes.trigger_fulfillment.messages`
// *
// `Page.transition_route_groups.transition_routes.trigger_fulfillment.messages`
// `Page.form.parameters.fill_behavior.reprompt_event_handlers.conditional_cases`
// * `Page.transition_routes.trigger_fulfillment.messages`
// * `Page.transition_routes.trigger_fulfillment.conditional_cases`
//
// If not specified, the agent's default language is used.
// [Many
Expand Down Expand Up @@ -458,11 +470,17 @@ message CreatePageRequest {
// The language of the following fields in `page`:
//
// * `Page.entry_fulfillment.messages`
// * `Page.entry_fulfillment.conditional_cases`
// * `Page.event_handlers.trigger_fulfillment.messages`
// * `Page.event_handlers.trigger_fulfillment.conditional_cases`
// * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages`
// *
// `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.conditional_cases`
// * `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages`
// * `Page.transition_routes.trigger_fulfillment.messages`
// *
// `Page.transition_route_groups.transition_routes.trigger_fulfillment.messages`
// `Page.form.parameters.fill_behavior.reprompt_event_handlers.conditional_cases`
// * `Page.transition_routes.trigger_fulfillment.messages`
// * `Page.transition_routes.trigger_fulfillment.conditional_cases`
//
// If not specified, the agent's default language is used.
// [Many
Expand All @@ -480,11 +498,17 @@ message UpdatePageRequest {
// The language of the following fields in `page`:
//
// * `Page.entry_fulfillment.messages`
// * `Page.entry_fulfillment.conditional_cases`
// * `Page.event_handlers.trigger_fulfillment.messages`
// * `Page.event_handlers.trigger_fulfillment.conditional_cases`
// * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages`
// *
// `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.conditional_cases`
// * `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages`
// * `Page.transition_routes.trigger_fulfillment.messages`
// *
// `Page.transition_route_groups.transition_routes.trigger_fulfillment.messages`
// `Page.form.parameters.fill_behavior.reprompt_event_handlers.conditional_cases`
// * `Page.transition_routes.trigger_fulfillment.messages`
// * `Page.transition_routes.trigger_fulfillment.conditional_cases`
//
// If not specified, the agent's default language is used.
// [Many
Expand Down
Loading

0 comments on commit c7ac26e

Please sign in to comment.