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

Commit

Permalink
feat: add new issue model API methods
Browse files Browse the repository at this point in the history
feat: support Dialogflow and user-specified participant IDs
docs: update pubsub_notification_settings docs (#25)
PiperOrigin-RevId: 389978361
  • Loading branch information
gcf-owl-bot[bot] authored Aug 11, 2021
1 parent 8c039c6 commit b73f2e9
Show file tree
Hide file tree
Showing 9 changed files with 7,344 additions and 375 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,28 @@ service ContactCenterInsights {
};
}

// Creates an issue model.
rpc CreateIssueModel(CreateIssueModelRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v1/{parent=projects/*/locations/*}/issueModels"
body: "issue_model"
};
option (google.api.method_signature) = "parent,issue_model";
option (google.longrunning.operation_info) = {
response_type: "IssueModel"
metadata_type: "CreateIssueModelMetadata"
};
}

// Updates an issue model.
rpc UpdateIssueModel(UpdateIssueModelRequest) returns (IssueModel) {
option (google.api.http) = {
patch: "/v1/{issue_model.name=projects/*/locations/*/issueModels/*}"
body: "issue_model"
};
option (google.api.method_signature) = "issue_model,update_mask";
}

// Gets an issue model.
rpc GetIssueModel(GetIssueModelRequest) returns (IssueModel) {
option (google.api.http) = {
Expand All @@ -150,6 +172,46 @@ service ContactCenterInsights {
option (google.api.method_signature) = "parent";
}

// Deletes an issue model.
rpc DeleteIssueModel(DeleteIssueModelRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
delete: "/v1/{name=projects/*/locations/*/issueModels/*}"
};
option (google.api.method_signature) = "name";
option (google.longrunning.operation_info) = {
response_type: "google.protobuf.Empty"
metadata_type: "DeleteIssueModelMetadata"
};
}

// Deploys an issue model. Returns an error if a model is already deployed.
// An issue model can only be used in analysis after it has been deployed.
rpc DeployIssueModel(DeployIssueModelRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v1/{name=projects/*/locations/*/issueModels/*}:deploy"
body: "*"
};
option (google.api.method_signature) = "name";
option (google.longrunning.operation_info) = {
response_type: "DeployIssueModelResponse"
metadata_type: "DeployIssueModelMetadata"
};
}

// Undeploys an issue model.
// An issue model can not be used in analysis after it has been undeployed.
rpc UndeployIssueModel(UndeployIssueModelRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v1/{name=projects/*/locations/*/issueModels/*}:undeploy"
body: "*"
};
option (google.api.method_signature) = "name";
option (google.longrunning.operation_info) = {
response_type: "UndeployIssueModelResponse"
metadata_type: "UndeployIssueModelMetadata"
};
}

// Gets an issue.
rpc GetIssue(GetIssueRequest) returns (Issue) {
option (google.api.http) = {
Expand All @@ -166,6 +228,15 @@ service ContactCenterInsights {
option (google.api.method_signature) = "parent";
}

// Updates an issue.
rpc UpdateIssue(UpdateIssueRequest) returns (Issue) {
option (google.api.http) = {
patch: "/v1/{issue.name=projects/*/locations/*/issueModels/*/issues/*}"
body: "issue"
};
option (google.api.method_signature) = "issue,update_mask";
}

// Gets an issue model's statistics.
rpc CalculateIssueModelStats(CalculateIssueModelStatsRequest) returns (CalculateIssueModelStatsResponse) {
option (google.api.http) = {
Expand Down Expand Up @@ -566,6 +637,41 @@ message ExportInsightsDataResponse {

}

// The request to create an issue model.
message CreateIssueModelRequest {
// Required. The parent resource of the issue model.
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "locations.googleapis.com/Location"
}
];

// Required. The issue model to create.
IssueModel issue_model = 2 [(google.api.field_behavior) = REQUIRED];
}

// Metadata for creating an issue model.
message CreateIssueModelMetadata {
// Output only. The time the operation was created.
google.protobuf.Timestamp create_time = 1 [(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. The time the operation finished running.
google.protobuf.Timestamp end_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY];

// The original request for creation.
CreateIssueModelRequest request = 3;
}

// The request to update an issue model.
message UpdateIssueModelRequest {
// Required. The new values for the issue model.
IssueModel issue_model = 1 [(google.api.field_behavior) = REQUIRED];

// The list of fields to be updated.
google.protobuf.FieldMask update_mask = 2;
}

// Request to list issue models.
message ListIssueModelsRequest {
// Required. The parent resource of the issue model.
Expand Down Expand Up @@ -594,6 +700,85 @@ message GetIssueModelRequest {
];
}

// The request to delete an issue model.
message DeleteIssueModelRequest {
// Required. The name of the issue model to delete.
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "contactcenterinsights.googleapis.com/IssueModel"
}
];
}

// Metadata for deleting an issue model.
message DeleteIssueModelMetadata {
// Output only. The time the operation was created.
google.protobuf.Timestamp create_time = 1 [(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. The time the operation finished running.
google.protobuf.Timestamp end_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY];

// The original request for deletion.
DeleteIssueModelRequest request = 3;
}

// The request to deploy an issue model.
message DeployIssueModelRequest {
// Required. The issue model to deploy.
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "contactcenterinsights.googleapis.com/IssueModel"
}
];
}

// The response to deploy an issue model.
message DeployIssueModelResponse {

}

// Metadata for deploying an issue model.
message DeployIssueModelMetadata {
// Output only. The time the operation was created.
google.protobuf.Timestamp create_time = 1 [(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. The time the operation finished running.
google.protobuf.Timestamp end_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY];

// The original request for deployment.
DeployIssueModelRequest request = 3;
}

// The request to undeploy an issue model.
message UndeployIssueModelRequest {
// Required. The issue model to undeploy.
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "contactcenterinsights.googleapis.com/IssueModel"
}
];
}

// The response to undeploy an issue model.
message UndeployIssueModelResponse {

}

// Metadata for undeploying an issue model.
message UndeployIssueModelMetadata {
// Output only. The time the operation was created.
google.protobuf.Timestamp create_time = 1 [(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. The time the operation finished running.
google.protobuf.Timestamp end_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY];

// The original request for undeployment.
UndeployIssueModelRequest request = 3;
}

// The request to get an issue.
message GetIssueRequest {
// Required. The name of the issue to get.
Expand Down Expand Up @@ -622,6 +807,15 @@ message ListIssuesResponse {
repeated Issue issues = 1;
}

// The request to update an issue.
message UpdateIssueRequest {
// Required. The new values for the issue.
Issue issue = 1 [(google.api.field_behavior) = REQUIRED];

// The list of fields to be updated.
google.protobuf.FieldMask update_mask = 2;
}

// Request to get statistics of an issue model.
message CalculateIssueModelStatsRequest {
// Required. The resource name of the issue model to query against.
Expand Down
27 changes: 26 additions & 1 deletion protos/google/cloud/contactcenterinsights/v1/resources.proto
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,15 @@ message IssueModel {
pattern: "projects/{project}/locations/{location}/issueModels/{issue_model}"
};

// Configs for the input data used to create the issue model.
message InputDataConfig {
// Required. Medium of conversations used in training data.
Conversation.Medium medium = 1 [(google.api.field_behavior) = REQUIRED];

// Output only. Number of conversations used in training. Output only.
int64 training_conversations_count = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
}

// State of the model.
enum State {
// Unspecified.
Expand Down Expand Up @@ -600,6 +609,9 @@ message IssueModel {
// Output only. State of the model.
State state = 5 [(google.api.field_behavior) = OUTPUT_ONLY];

// Configs for the input data that used to create the issue model.
InputDataConfig input_data_config = 6;

// Output only. Immutable. The issue model's label statistics on its training data.
IssueModelLabelStats training_stats = 7 [
(google.api.field_behavior) = OUTPUT_ONLY,
Expand Down Expand Up @@ -813,6 +825,8 @@ message Settings {
// * "create-analysis": Notify each time an analysis is created.
// * "create-conversation": Notify each time a conversation is created.
// * "export-insights-data": Notify each time an export is complete.
// * "update-conversation": Notify each time a conversation is updated via
// UpdateConversation.
//
// Values are Pub/Sub topics. The format of each Pub/Sub topic is:
// projects/{project}/topics/{topic}
Expand Down Expand Up @@ -1016,9 +1030,20 @@ message ConversationParticipant {
ANY_AGENT = 4;
}

oneof participant {
// The name of the participant provided by Dialogflow. Format:
// projects/{project}/locations/{location}/conversations/{conversation}/participants/{participant}
string dialogflow_participant_name = 5 [(google.api.resource_reference) = {
type: "dialogflow.googleapis.com/Participant"
}];

// A user-specified ID representing the participant.
string user_id = 6;
}

// The name of the Dialogflow participant. Format:
// projects/{project}/locations/{location}/conversations/{conversation}/participants/{participant}
string dialogflow_participant = 1;
string dialogflow_participant = 1 [deprecated = true];

// The role of the participant.
Role role = 2;
Expand Down
Loading

0 comments on commit b73f2e9

Please sign in to comment.