Skip to content

Commit

Permalink
Add 'Model.encryption_config' (via synth). (googleapis#9214)
Browse files Browse the repository at this point in the history
* Add 'Model.encryption_config' (via synth).
  • Loading branch information
tseaver authored and emar-kar committed Sep 18, 2019
1 parent 0641e03 commit 58f6b8f
Show file tree
Hide file tree
Showing 12 changed files with 450 additions and 214 deletions.
33 changes: 33 additions & 0 deletions bigquery/google/cloud/bigquery_v2/proto/encryption_config.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// Copyright 2019 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.bigquery.v2;

import "google/api/field_behavior.proto";
import "google/protobuf/wrappers.proto";
import "google/api/annotations.proto";

option go_package = "google.golang.org/genproto/googleapis/cloud/bigquery/v2;bigquery";
option java_outer_classname = "EncryptionConfigProto";
option java_package = "com.google.cloud.bigquery.v2";

message EncryptionConfiguration {
// Optional. Describes the Cloud KMS encryption key that will be used to
// protect destination BigQuery table. The BigQuery Service Account associated
// with your project requires access to this encryption key.
google.protobuf.StringValue kms_key_name = 1 [(google.api.field_behavior) = OPTIONAL];
}
108 changes: 108 additions & 0 deletions bigquery/google/cloud/bigquery_v2/proto/encryption_config_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
108 changes: 58 additions & 50 deletions bigquery/google/cloud/bigquery_v2/proto/model.proto
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@ syntax = "proto3";

package google.cloud.bigquery.v2;

import "google/api/client.proto";
import "google/api/field_behavior.proto";
import "google/cloud/bigquery/v2/encryption_config.proto";
import "google/cloud/bigquery/v2/model_reference.proto";
import "google/cloud/bigquery/v2/standard_sql.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/timestamp.proto";
import "google/protobuf/wrappers.proto";
import "google/api/annotations.proto";
import "google/api/client.proto";

option go_package = "google.golang.org/genproto/googleapis/cloud/bigquery/v2;bigquery";
option java_outer_classname = "ModelProto";
Expand All @@ -39,19 +41,23 @@ service ModelService {

// Gets the specified model resource by model ID.
rpc GetModel(GetModelRequest) returns (Model) {
option (google.api.method_signature) = "project_id,dataset_id,model_id";
}

// Lists all models in the specified dataset. Requires the READER dataset
// role.
rpc ListModels(ListModelsRequest) returns (ListModelsResponse) {
option (google.api.method_signature) = "project_id,dataset_id,max_results";
}

// Patch specific fields in the specified model.
rpc PatchModel(PatchModelRequest) returns (Model) {
option (google.api.method_signature) = "project_id,dataset_id,model_id,model";
}

// Deletes the model specified by modelId from the dataset.
rpc DeleteModel(DeleteModelRequest) returns (google.protobuf.Empty) {
option (google.api.method_signature) = "project_id,dataset_id,model_id";
}
}

Expand Down Expand Up @@ -236,7 +242,7 @@ message Model {

// Counts of all categories for the categorical feature. If there are
// more than ten categories, we return top ten (by count) and return
// one more CategoryCount with category _OTHER_ and count as
// one more CategoryCount with category "_OTHER_" and count as
// aggregate counts of remaining categories.
repeated CategoryCount category_counts = 1;
}
Expand Down Expand Up @@ -514,103 +520,105 @@ message Model {
}

// Output only. A hash of this resource.
string etag = 1;
string etag = 1 [(google.api.field_behavior) = OUTPUT_ONLY];

// Required. Unique identifier for this model.
ModelReference model_reference = 2;
ModelReference model_reference = 2 [(google.api.field_behavior) = REQUIRED];

// Output only. The time when this model was created, in millisecs since the
// epoch.
int64 creation_time = 5;
// Output only. The time when this model was created, in millisecs since the epoch.
int64 creation_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. The time when this model was last modified, in millisecs
// since the epoch.
int64 last_modified_time = 6;
// Output only. The time when this model was last modified, in millisecs since the epoch.
int64 last_modified_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY];

// [Optional] A user-friendly description of this model.
string description = 12;
// Optional. A user-friendly description of this model.
string description = 12 [(google.api.field_behavior) = OPTIONAL];

// [Optional] A descriptive name for this model.
string friendly_name = 14;
// Optional. A descriptive name for this model.
string friendly_name = 14 [(google.api.field_behavior) = OPTIONAL];

// [Optional] The labels associated with this model. You can use these to
// organize and group your models. Label keys and values can be no longer
// The labels associated with this model. You can use these to organize
// and group your models. Label keys and values can be no longer
// than 63 characters, can only contain lowercase letters, numeric
// characters, underscores and dashes. International characters are allowed.
// Label values are optional. Label keys must start with a letter and each
// label in the list must have a different key.
map<string, string> labels = 15;

// [Optional] The time when this model expires, in milliseconds since the
// epoch. If not present, the model will persist indefinitely. Expired models
// Optional. The time when this model expires, in milliseconds since the epoch.
// If not present, the model will persist indefinitely. Expired models
// will be deleted and their storage reclaimed. The defaultTableExpirationMs
// property of the encapsulating dataset can be used to set a default
// expirationTime on newly created models.
int64 expiration_time = 16;
int64 expiration_time = 16 [(google.api.field_behavior) = OPTIONAL];

// Output only. The geographic location where the model resides. This value
// is inherited from the dataset.
string location = 13;
string location = 13 [(google.api.field_behavior) = OUTPUT_ONLY];

// Custom encryption configuration (e.g., Cloud KMS keys). This shows the
// encryption configuration of the model data while stored in BigQuery
// storage.
google.cloud.bigquery.v2.EncryptionConfiguration encryption_configuration = 17;

// Output only. Type of the model resource.
ModelType model_type = 7;
ModelType model_type = 7 [(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. Information for all training runs in increasing order of
// start_time.
repeated TrainingRun training_runs = 9;
// Output only. Information for all training runs in increasing order of start_time.
repeated TrainingRun training_runs = 9 [(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. Input feature columns that were used to train this model.
repeated StandardSqlField feature_columns = 10;
repeated StandardSqlField feature_columns = 10 [(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. Label columns that were used to train this model.
// The output of the model will have a "predicted_" prefix to these columns.
repeated StandardSqlField label_columns = 11;
repeated StandardSqlField label_columns = 11 [(google.api.field_behavior) = OUTPUT_ONLY];
}

message GetModelRequest {
// Project ID of the requested model.
string project_id = 1;
// Required. Project ID of the requested model.
string project_id = 1 [(google.api.field_behavior) = REQUIRED];

// Dataset ID of the requested model.
string dataset_id = 2;
// Required. Dataset ID of the requested model.
string dataset_id = 2 [(google.api.field_behavior) = REQUIRED];

// Model ID of the requested model.
string model_id = 3;
// Required. Model ID of the requested model.
string model_id = 3 [(google.api.field_behavior) = REQUIRED];
}

message PatchModelRequest {
// Project ID of the model to patch.
string project_id = 1;
// Required. Project ID of the model to patch.
string project_id = 1 [(google.api.field_behavior) = REQUIRED];

// Dataset ID of the model to patch.
string dataset_id = 2;
// Required. Dataset ID of the model to patch.
string dataset_id = 2 [(google.api.field_behavior) = REQUIRED];

// Model ID of the model to patch.
string model_id = 3;
// Required. Model ID of the model to patch.
string model_id = 3 [(google.api.field_behavior) = REQUIRED];

// Patched model.
// Required. Patched model.
// Follows RFC5789 patch semantics. Missing fields are not updated.
// To clear a field, explicitly set to default value.
Model model = 4;
Model model = 4 [(google.api.field_behavior) = REQUIRED];
}

message DeleteModelRequest {
// Project ID of the model to delete.
string project_id = 1;
// Required. Project ID of the model to delete.
string project_id = 1 [(google.api.field_behavior) = REQUIRED];

// Dataset ID of the model to delete.
string dataset_id = 2;
// Required. Dataset ID of the model to delete.
string dataset_id = 2 [(google.api.field_behavior) = REQUIRED];

// Model ID of the model to delete.
string model_id = 3;
// Required. Model ID of the model to delete.
string model_id = 3 [(google.api.field_behavior) = REQUIRED];
}

message ListModelsRequest {
// Project ID of the models to list.
string project_id = 1;
// Required. Project ID of the models to list.
string project_id = 1 [(google.api.field_behavior) = REQUIRED];

// Dataset ID of the models to list.
string dataset_id = 2;
// Required. Dataset ID of the models to list.
string dataset_id = 2 [(google.api.field_behavior) = REQUIRED];

// The maximum number of results to return in a single response page.
// Leverage the page tokens to iterate through the entire collection.
Expand Down
Loading

0 comments on commit 58f6b8f

Please sign in to comment.