@@ -20,6 +20,8 @@ import "google/api/annotations.proto";
2020import "google/api/client.proto" ;
2121import "google/api/field_behavior.proto" ;
2222import "google/api/resource.proto" ;
23+ import "google/cloud/dialogflow/cx/v3/inline.proto" ;
24+ import "google/longrunning/operations.proto" ;
2325import "google/protobuf/empty.proto" ;
2426import "google/protobuf/field_mask.proto" ;
2527
@@ -94,6 +96,32 @@ service EntityTypes {
9496 };
9597 option (google.api.method_signature ) = "parent" ;
9698 }
99+
100+ // Exports the selected entity types.
101+ rpc ExportEntityTypes (ExportEntityTypesRequest )
102+ returns (google.longrunning.Operation ) {
103+ option (google.api.http ) = {
104+ post : "/v3/{parent=projects/*/locations/*/agents/*}/entityTypes:export"
105+ body : "*"
106+ };
107+ option (google.longrunning.operation_info ) = {
108+ response_type : "ExportEntityTypesResponse"
109+ metadata_type : "ExportEntityTypesMetadata"
110+ };
111+ }
112+
113+ // Imports the specified entitytypes into the agent.
114+ rpc ImportEntityTypes (ImportEntityTypesRequest )
115+ returns (google.longrunning.Operation ) {
116+ option (google.api.http ) = {
117+ post : "/v3/{parent=projects/*/locations/*/agents/*}/entityTypes:import"
118+ body : "*"
119+ };
120+ option (google.longrunning.operation_info ) = {
121+ response_type : "ImportEntityTypesResponse"
122+ metadata_type : "ImportEntityTypesMetadata"
123+ };
124+ }
97125}
98126
99127// Entities are extracted from user input and represent parameters that are
@@ -230,6 +258,202 @@ message EntityType {
230258 bool redact = 9 ;
231259}
232260
261+ // The request message for
262+ // [EntityTypes.ExportEntityTypes][google.cloud.dialogflow.cx.v3.EntityTypes.ExportEntityTypes].
263+ message ExportEntityTypesRequest {
264+ // Data format of the exported entity types.
265+ enum DataFormat {
266+ // Unspecified format. Treated as `BLOB`.
267+ DATA_FORMAT_UNSPECIFIED = 0 ;
268+
269+ // EntityTypes will be exported as raw bytes.
270+ BLOB = 1 ;
271+
272+ // EntityTypes will be exported in JSON Package format.
273+ JSON_PACKAGE = 5 ;
274+ }
275+
276+ // Required. The name of the parent agent to export entity types.
277+ // Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
278+ // ID>`.
279+ string parent = 1 [
280+ (google.api.field_behavior ) = REQUIRED ,
281+ (google.api.resource_reference ) = {
282+ child_type : "dialogflow.googleapis.com/EntityType"
283+ }
284+ ];
285+
286+ // Required. The name of the entity types to export.
287+ // Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
288+ // ID>/entityTypes/<EntityType ID>`.
289+ repeated string entity_types = 2 [(google.api.field_behavior ) = REQUIRED ];
290+
291+ // The destination to export.
292+ oneof destination {
293+ // Optional. The [Google Cloud
294+ // Storage](https://cloud.google.com/storage/docs/) URI to export the entity
295+ // types to. The format of this URI must be
296+ // `gs://<bucket-name>/<object-name>`.
297+ //
298+ // Dialogflow performs a write operation for the Cloud Storage object
299+ // on the caller's behalf, so your request authentication must
300+ // have write permissions for the object. For more information, see
301+ // [Dialogflow access
302+ // control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage).
303+ string entity_types_uri = 3 [(google.api.field_behavior ) = OPTIONAL ];
304+
305+ // Optional. The option to return the serialized entity types inline.
306+ bool entity_types_content_inline = 4
307+ [(google.api.field_behavior ) = OPTIONAL ];
308+ }
309+
310+ // Optional. The data format of the exported entity types. If not specified,
311+ // `BLOB` is assumed.
312+ DataFormat data_format = 5 [(google.api.field_behavior ) = OPTIONAL ];
313+
314+ // Optional. The language to retrieve the entity type for. The following
315+ // fields are language dependent:
316+ //
317+ // * `EntityType.entities.value`
318+ // * `EntityType.entities.synonyms`
319+ // * `EntityType.excluded_phrases.value`
320+ //
321+ // If not specified, all language dependent fields will be retrieved.
322+ // [Many
323+ // languages](https://cloud.google.com/dialogflow/docs/reference/language)
324+ // are supported.
325+ // Note: languages must be enabled in the agent before they can be used.
326+ string language_code = 6 [(google.api.field_behavior ) = OPTIONAL ];
327+ }
328+
329+ // The response message for
330+ // [EntityTypes.ExportEntityTypes][google.cloud.dialogflow.cx.v3.EntityTypes.ExportEntityTypes].
331+ message ExportEntityTypesResponse {
332+ // Exported entity types can be either in cloud storage or local download.
333+ oneof exported_entity_types {
334+ // The URI to a file containing the exported entity types. This field is
335+ // populated only if `entity_types_uri` is specified in
336+ // [ExportEntityTypesRequest][google.cloud.dialogflow.cx.v3.ExportEntityTypesRequest].
337+ string entity_types_uri = 1 ;
338+
339+ // Uncompressed byte content for entity types. This field is populated only
340+ // if `entity_types_content_inline` is set to true in
341+ // [ExportEntityTypesRequest][google.cloud.dialogflow.cx.v3.ExportEntityTypesRequest].
342+ InlineDestination entity_types_content = 2 ;
343+ }
344+ }
345+
346+ // Metadata returned for the
347+ // [EntityTypes.ExportEntityTypes][google.cloud.dialogflow.cx.v3.EntityTypes.ExportEntityTypes]
348+ // long running operation.
349+ message ExportEntityTypesMetadata {}
350+
351+ // The request message for
352+ // [EntityTypes.ImportEntityTypes][google.cloud.dialogflow.cx.v3.EntityTypes.ImportEntityTypes].
353+ message ImportEntityTypesRequest {
354+ // Merge option when display name conflicts exist during import.
355+ enum MergeOption {
356+ // Unspecified. If used, system uses REPORT_CONFLICT as default.
357+ MERGE_OPTION_UNSPECIFIED = 0 ;
358+
359+ // Replace the original entity type in the agent with the new entity type
360+ // when display name conflicts exist.
361+ REPLACE = 1 ;
362+
363+ // Merge the original entity type with the new entity type when display name
364+ // conflicts exist.
365+ MERGE = 2 ;
366+
367+ // Create new entity types with new display names to differentiate them from
368+ // the existing entity types when display name conflicts exist.
369+ RENAME = 3 ;
370+
371+ // Report conflict information if display names conflict is detected.
372+ // Otherwise, import entity types.
373+ REPORT_CONFLICT = 4 ;
374+
375+ // Keep the original entity type and discard the conflicting new entity type
376+ // when display name conflicts exist.
377+ KEEP = 5 ;
378+ }
379+
380+ // Required. The agent to import the entity types into.
381+ // Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
382+ string parent = 1 [
383+ (google.api.field_behavior ) = REQUIRED ,
384+ (google.api.resource_reference ) = {
385+ child_type : "dialogflow.googleapis.com/EntityType"
386+ }
387+ ];
388+
389+ // Required. The entity types to import.
390+ oneof entity_types {
391+ // The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI
392+ // to import entity types from. The format of this URI must be
393+ // `gs://<bucket-name>/<object-name>`.
394+ //
395+ // Dialogflow performs a read operation for the Cloud Storage object
396+ // on the caller's behalf, so your request authentication must
397+ // have read permissions for the object. For more information, see
398+ // [Dialogflow access
399+ // control](https://cloud.google.com/dialogflow/cx/docs/concept/access-control#storage).
400+ string entity_types_uri = 2 ;
401+
402+ // Uncompressed byte content of entity types.
403+ InlineSource entity_types_content = 3 ;
404+ }
405+
406+ // Required. Merge option for importing entity types.
407+ MergeOption merge_option = 4 [(google.api.field_behavior ) = REQUIRED ];
408+
409+ // Optional. The target entity type to import into.
410+ // Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
411+ // ID>/entity_types/<EntityType ID>`.
412+ // If set, there should be only one entity type included in
413+ // [entity_types][google.cloud.dialogflow.cx.v3.ImportEntityTypesRequest.entity_types],
414+ // of which the type should match the type of the target entity type. All
415+ // [entities][google.cloud.dialogflow.cx.v3.EntityType.entities] in the
416+ // imported entity type will be added to the target entity type.
417+ string target_entity_type = 5 [
418+ (google.api.field_behavior ) = OPTIONAL ,
419+ (google.api.resource_reference ) = {
420+ type : "dialogflow.googleapis.com/EntityType"
421+ }
422+ ];
423+ }
424+
425+ // The response message for
426+ // [EntityTypes.ImportEntityTypes][google.cloud.dialogflow.cx.v3.EntityTypes.ImportEntityTypes].
427+ message ImportEntityTypesResponse {
428+ // Conflicting resources detected during the import process. Only filled when
429+ // [REPORT_CONFLICT][ImportEntityTypesResponse.REPORT_CONFLICT] is set in the
430+ // request and there are conflicts in the display names.
431+ message ConflictingResources {
432+ // Display names of conflicting entity types.
433+ repeated string entity_type_display_names = 1 ;
434+
435+ // Display names of conflicting entities.
436+ repeated string entity_display_names = 2 ;
437+ }
438+
439+ // The unique identifier of the imported entity types.
440+ // Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
441+ // ID>/entity_types/<EntityType ID>`.
442+ repeated string entity_types = 1 [(google.api.resource_reference ) = {
443+ type : "dialogflow.googleapis.com/EntityType"
444+ }];
445+
446+ // Info which resources have conflicts when
447+ // [REPORT_CONFLICT][ImportEntityTypesResponse.REPORT_CONFLICT] merge_option
448+ // is set in ImportEntityTypesRequest.
449+ ConflictingResources conflicting_resources = 2 ;
450+ }
451+
452+ // Metadata returned for the
453+ // [EntityTypes.ImportEntityTypes][google.cloud.dialogflow.cx.v3.EntityTypes.ImportEntityTypes]
454+ // long running operation.
455+ message ImportEntityTypesMetadata {}
456+
233457// The request message for
234458// [EntityTypes.ListEntityTypes][google.cloud.dialogflow.cx.v3.EntityTypes.ListEntityTypes].
235459message ListEntityTypesRequest {
0 commit comments