@@ -17,13 +17,15 @@ syntax = "proto3";
1717
1818package google.cloud.bigquery.v2 ;
1919
20+ import "google/api/client.proto" ;
21+ import "google/api/field_behavior.proto" ;
22+ import "google/cloud/bigquery/v2/encryption_config.proto" ;
2023import "google/cloud/bigquery/v2/model_reference.proto" ;
2124import "google/cloud/bigquery/v2/standard_sql.proto" ;
2225import "google/protobuf/empty.proto" ;
2326import "google/protobuf/timestamp.proto" ;
2427import "google/protobuf/wrappers.proto" ;
2528import "google/api/annotations.proto" ;
26- import "google/api/client.proto" ;
2729
2830option go_package = "google.golang.org/genproto/googleapis/cloud/bigquery/v2;bigquery" ;
2931option java_outer_classname = "ModelProto" ;
@@ -39,19 +41,23 @@ service ModelService {
3941
4042// Gets the specified model resource by model ID.
4143rpc GetModel (GetModelRequest )returns (Model ) {
44+ option (google.api.method_signature ) = "project_id,dataset_id,model_id" ;
4245 }
4346
4447// Lists all models in the specified dataset. Requires the READER dataset
4548// role.
4649rpc ListModels (ListModelsRequest )returns (ListModelsResponse ) {
50+ option (google.api.method_signature ) = "project_id,dataset_id,max_results" ;
4751 }
4852
4953// Patch specific fields in the specified model.
5054rpc PatchModel (PatchModelRequest )returns (Model ) {
55+ option (google.api.method_signature ) = "project_id,dataset_id,model_id,model" ;
5156 }
5257
5358// Deletes the model specified by modelId from the dataset.
5459rpc DeleteModel (DeleteModelRequest )returns (google .protobuf .Empty ) {
60+ option (google.api.method_signature ) = "project_id,dataset_id,model_id" ;
5561 }
5662}
5763
@@ -236,7 +242,7 @@ message Model {
236242
237243// Counts of all categories for the categorical feature. If there are
238244// more than ten categories, we return top ten (by count) and return
239- // one more CategoryCount with category‘ _OTHER_’ and count as
245+ // one more CategoryCount with category" _OTHER_" and count as
240246// aggregate counts of remaining categories.
241247repeated CategoryCount category_counts = 1 ;
242248 }
@@ -514,103 +520,105 @@ message Model {
514520 }
515521
516522// Output only. A hash of this resource.
517- string etag = 1 ;
523+ string etag = 1 [ (google.api .field_behavior ) = OUTPUT_ONLY ] ;
518524
519525// Required. Unique identifier for this model.
520- ModelReference model_reference = 2 ;
526+ ModelReference model_reference = 2 [ (google.api .field_behavior ) = REQUIRED ] ;
521527
522- // Output only. The time when this model was created, in millisecs since the
523- // epoch.
524- int64 creation_time = 5 ;
528+ // Output only. The time when this model was created, in millisecs since the epoch.
529+ int64 creation_time = 5 [(google.api.field_behavior ) =OUTPUT_ONLY ];
525530
526- // Output only. The time when this model was last modified, in millisecs
527- // since the epoch.
528- int64 last_modified_time = 6 ;
531+ // Output only. The time when this model was last modified, in millisecs since the epoch.
532+ int64 last_modified_time = 6 [(google.api.field_behavior ) =OUTPUT_ONLY ];
529533
530- //[ Optional] A user-friendly description of this model.
531- string description = 12 ;
534+ // Optional. A user-friendly description of this model.
535+ string description = 12 [ (google.api .field_behavior ) = OPTIONAL ] ;
532536
533- //[ Optional] A descriptive name for this model.
534- string friendly_name = 14 ;
537+ // Optional. A descriptive name for this model.
538+ string friendly_name = 14 [ (google.api .field_behavior ) = OPTIONAL ] ;
535539
536- //[Optional] The labels associated with this model. You can use these to
537- //organize and group your models. Label keys and values can be no longer
540+ // The labels associated with this model. You can use these to organize
541+ // and group your models. Label keys and values can be no longer
538542// than 63 characters, can only contain lowercase letters, numeric
539543// characters, underscores and dashes. International characters are allowed.
540544// Label values are optional. Label keys must start with a letter and each
541545// label in the list must have a different key.
542546map <string ,string >labels = 15 ;
543547
544- //[ Optional] The time when this model expires, in milliseconds since the
545- //epoch. If not present, the model will persist indefinitely. Expired models
548+ // Optional. The time when this model expires, in milliseconds since the epoch.
549+ // If not present, the model will persist indefinitely. Expired models
546550// will be deleted and their storage reclaimed. The defaultTableExpirationMs
547551// property of the encapsulating dataset can be used to set a default
548552// expirationTime on newly created models.
549- int64 expiration_time = 16 ;
553+ int64 expiration_time = 16 [ (google.api .field_behavior ) = OPTIONAL ] ;
550554
551555// Output only. The geographic location where the model resides. This value
552556// is inherited from the dataset.
553- string location = 13 ;
557+ string location = 13 [(google.api.field_behavior ) =OUTPUT_ONLY ];
558+
559+ // Custom encryption configuration (e.g., Cloud KMS keys). This shows the
560+ // encryption configuration of the model data while stored in BigQuery
561+ // storage.
562+ google.cloud.bigquery.v2.EncryptionConfiguration encryption_configuration = 17 ;
554563
555564// Output only. Type of the model resource.
556- ModelType model_type = 7 ;
565+ ModelType model_type = 7 [ (google.api .field_behavior ) = OUTPUT_ONLY ] ;
557566
558- // Output only. Information for all training runs in increasing order of
559- // start_time.
560- repeated TrainingRun training_runs = 9 ;
567+ // Output only. Information for all training runs in increasing order of start_time.
568+ repeated TrainingRun training_runs = 9 [(google.api.field_behavior ) =OUTPUT_ONLY ];
561569
562570// Output only. Input feature columns that were used to train this model.
563- repeated StandardSqlField feature_columns = 10 ;
571+ repeated StandardSqlField feature_columns = 10 [ (google.api .field_behavior ) = OUTPUT_ONLY ] ;
564572
565573// Output only. Label columns that were used to train this model.
566574// The output of the model will have a "predicted_" prefix to these columns.
567- repeated StandardSqlField label_columns = 11 ;
575+ repeated StandardSqlField label_columns = 11 [ (google.api .field_behavior ) = OUTPUT_ONLY ] ;
568576}
569577
570578message GetModelRequest {
571- // Project ID of the requested model.
572- string project_id = 1 ;
579+ //Required. Project ID of the requested model.
580+ string project_id = 1 [ (google.api .field_behavior ) = REQUIRED ] ;
573581
574- // Dataset ID of the requested model.
575- string dataset_id = 2 ;
582+ //Required. Dataset ID of the requested model.
583+ string dataset_id = 2 [ (google.api .field_behavior ) = REQUIRED ] ;
576584
577- // Model ID of the requested model.
578- string model_id = 3 ;
585+ //Required. Model ID of the requested model.
586+ string model_id = 3 [ (google.api .field_behavior ) = REQUIRED ] ;
579587}
580588
581589message PatchModelRequest {
582- // Project ID of the model to patch.
583- string project_id = 1 ;
590+ //Required. Project ID of the model to patch.
591+ string project_id = 1 [ (google.api .field_behavior ) = REQUIRED ] ;
584592
585- // Dataset ID of the model to patch.
586- string dataset_id = 2 ;
593+ //Required. Dataset ID of the model to patch.
594+ string dataset_id = 2 [ (google.api .field_behavior ) = REQUIRED ] ;
587595
588- // Model ID of the model to patch.
589- string model_id = 3 ;
596+ //Required. Model ID of the model to patch.
597+ string model_id = 3 [ (google.api .field_behavior ) = REQUIRED ] ;
590598
591- // Patched model.
599+ //Required. Patched model.
592600// Follows RFC5789 patch semantics. Missing fields are not updated.
593601// To clear a field, explicitly set to default value.
594- Model model = 4 ;
602+ Model model = 4 [ (google.api .field_behavior ) = REQUIRED ] ;
595603}
596604
597605message DeleteModelRequest {
598- // Project ID of the model to delete.
599- string project_id = 1 ;
606+ //Required. Project ID of the model to delete.
607+ string project_id = 1 [ (google.api .field_behavior ) = REQUIRED ] ;
600608
601- // Dataset ID of the model to delete.
602- string dataset_id = 2 ;
609+ //Required. Dataset ID of the model to delete.
610+ string dataset_id = 2 [ (google.api .field_behavior ) = REQUIRED ] ;
603611
604- // Model ID of the model to delete.
605- string model_id = 3 ;
612+ //Required. Model ID of the model to delete.
613+ string model_id = 3 [ (google.api .field_behavior ) = REQUIRED ] ;
606614}
607615
608616message ListModelsRequest {
609- // Project ID of the models to list.
610- string project_id = 1 ;
617+ //Required. Project ID of the models to list.
618+ string project_id = 1 [ (google.api .field_behavior ) = REQUIRED ] ;
611619
612- // Dataset ID of the models to list.
613- string dataset_id = 2 ;
620+ //Required. Dataset ID of the models to list.
621+ string dataset_id = 2 [ (google.api .field_behavior ) = REQUIRED ] ;
614622
615623// The maximum number of results to return in a single response page.
616624// Leverage the page tokens to iterate through the entire collection.