1// Copyright 2023 Google LLC 2// 3// Licensed under the Apache License, Version 2.0 (the "License"); 4// you may not use this file except in compliance with the License. 5// You may obtain a copy of the License at 6// 7// http://www.apache.org/licenses/LICENSE-2.0 8// 9// Unless required by applicable law or agreed to in writing, software 10// distributed under the License is distributed on an "AS IS" BASIS, 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12// See the License for the specific language governing permissions and 13// limitations under the License. 14 15syntax = "proto3"; 16 17package google.cloud.optimization.v1; 18 19import "google/api/field_behavior.proto"; 20import "google/protobuf/timestamp.proto"; 21 22option go_package = "cloud.google.com/go/optimization/apiv1/optimizationpb;optimizationpb"; 23option java_multiple_files = true; 24option java_outer_classname = "AsyncModelProto"; 25option java_package = "com.google.cloud.optimization.v1"; 26 27// The desired input location information. 28message InputConfig { 29 // The location of the input model in cloud storage. 30 // Required. 31 oneof source { 32 // The Google Cloud Storage location to read the input from. This must be a 33 // single file. 34 GcsSource gcs_source = 1; 35 } 36 37 // The input data format that used to store the model in Cloud Storage. 38 DataFormat data_format = 2; 39} 40 41// The desired output location. 42message OutputConfig { 43 // The location of the output result in cloud storage. 44 // Required. 45 oneof destination { 46 // The Google Cloud Storage location to write the output to. 47 GcsDestination gcs_destination = 1; 48 } 49 50 // The output data format that used to store the results in Cloud Storage. 51 DataFormat data_format = 2; 52} 53 54// The Google Cloud Storage location where the input file will be read from. 55message GcsSource { 56 // Required. URI of the Google Cloud Storage location. 57 string uri = 1 [(google.api.field_behavior) = REQUIRED]; 58} 59 60// The Google Cloud Storage location where the output file will be written to. 61message GcsDestination { 62 // Required. URI of the Google Cloud Storage location. 63 string uri = 1 [(google.api.field_behavior) = REQUIRED]; 64} 65 66// The long running operation metadata for async model related methods. 67message AsyncModelMetadata { 68 // Possible states of the operation. 69 enum State { 70 // The default value. This value is used if the state is omitted. 71 STATE_UNSPECIFIED = 0; 72 73 // Request is being processed. 74 RUNNING = 1; 75 76 // The operation completed successfully. 77 SUCCEEDED = 2; 78 79 // The operation was cancelled. 80 CANCELLED = 3; 81 82 // The operation has failed. 83 FAILED = 4; 84 } 85 86 // The state of the current operation. 87 State state = 1; 88 89 // A message providing more details about the current state of the operation. 90 // For example, the error message if the operation is failed. 91 string state_message = 2; 92 93 // The creation time of the operation. 94 google.protobuf.Timestamp create_time = 3; 95 96 // The last update time of the operation. 97 google.protobuf.Timestamp update_time = 4; 98} 99 100// Data formats for input and output files. 101enum DataFormat { 102 // Default value. 103 DATA_FORMAT_UNSPECIFIED = 0; 104 105 // Input data in json format. 106 JSON = 1; 107 108 // Input data in string format. 109 STRING = 2; 110} 111