From a7459002342d1f638c9f7a935ee77234af933f7f Mon Sep 17 00:00:00 2001 From: Tahiya Salam Date: Mon, 14 Jul 2025 09:31:50 -0400 Subject: [PATCH 1/6] Update protos --- proto/viam/app/datasync/v1/data_sync.proto | 1 + .../service/datamanager/v1/data_manager.proto | 20 +++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/proto/viam/app/datasync/v1/data_sync.proto b/proto/viam/app/datasync/v1/data_sync.proto index b572929b2..3f8163aab 100644 --- a/proto/viam/app/datasync/v1/data_sync.proto +++ b/proto/viam/app/datasync/v1/data_sync.proto @@ -110,6 +110,7 @@ message UploadMetadata { map method_parameters = 8; string file_extension = 9; repeated string tags = 10; + repeated string dataset_ids = 12; reserved 4, 11; reserved "component_model", "session_id"; diff --git a/proto/viam/service/datamanager/v1/data_manager.proto b/proto/viam/service/datamanager/v1/data_manager.proto index f357120ae..3cbfbda6d 100644 --- a/proto/viam/service/datamanager/v1/data_manager.proto +++ b/proto/viam/service/datamanager/v1/data_manager.proto @@ -2,6 +2,7 @@ syntax = "proto3"; package viam.service.datamanager.v1; +import "app/datasync/v1/data_sync.proto"; import "common/v1/common.proto"; import "google/api/annotations.proto"; import "google/protobuf/struct.proto"; @@ -20,6 +21,13 @@ service DataManagerService { rpc DoCommand(common.v1.DoCommandRequest) returns (common.v1.DoCommandResponse) { option (google.api.http) = {post: "/viam/api/v1/service/datamanager/{name}/do_command"}; } + + // UploadBinaryDataToDataset uploads binary data to a dataset. + rpc UploadBinaryDataToDataset(UploadBinaryDataToDatasetRequest) returns (UploadBinaryDataToDatasetResponse) { + option (google.api.http) = {post: "/viam/api/v1/service/datamanager/{name}/upload_binary_data_to_dataset"}; + } + + } message SyncRequest { @@ -29,3 +37,15 @@ message SyncRequest { } message SyncResponse {} + +message UploadBinaryDataToDatasetRequest { + string name = 1; + bytes binary_data = 2; + repeated string tags = 3; + repeated string dataset_ids = 4; + app.datasync.v1.MimeType mime_type = 5; + // Additional arguments to the method + google.protobuf.Struct extra = 99; +} + +message UploadBinaryDataToDatasetResponse {} From d81ce61c771a5a93d46f165c37a2475bb6701fd1 Mon Sep 17 00:00:00 2001 From: Tahiya Salam Date: Thu, 17 Jul 2025 15:22:26 -0400 Subject: [PATCH 2/6] Add protos for upload binary data to dataset --- proto/viam/service/datamanager/v1/data_manager.proto | 2 -- 1 file changed, 2 deletions(-) diff --git a/proto/viam/service/datamanager/v1/data_manager.proto b/proto/viam/service/datamanager/v1/data_manager.proto index 3cbfbda6d..fcc61b4b5 100644 --- a/proto/viam/service/datamanager/v1/data_manager.proto +++ b/proto/viam/service/datamanager/v1/data_manager.proto @@ -26,8 +26,6 @@ service DataManagerService { rpc UploadBinaryDataToDataset(UploadBinaryDataToDatasetRequest) returns (UploadBinaryDataToDatasetResponse) { option (google.api.http) = {post: "/viam/api/v1/service/datamanager/{name}/upload_binary_data_to_dataset"}; } - - } message SyncRequest { From d9437d8203b60d2c31e0efd3211e9e010105c415 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 17 Jul 2025 19:27:12 +0000 Subject: [PATCH 3/6] Built new protos from 4828d58 --- .../v1/data_manager_grpc_web_pb.js | 63 +++ .../datamanager/v1/data_manager_pb.d.ts | 65 +++ .../service/datamanager/v1/data_manager_pb.js | 517 ++++++++++++++++++ .../v1/data_manager_pb_service.d.ts | 19 + .../datamanager/v1/data_manager_pb_service.js | 40 ++ service/datamanager/v1/data_manager.pb.go | 273 +++++++-- service/datamanager/v1/data_manager.pb.gw.go | 127 ++++- .../datamanager/v1/data_manager_grpc.pb.go | 38 ++ 8 files changed, 1085 insertions(+), 57 deletions(-) diff --git a/gen/js/service/datamanager/v1/data_manager_grpc_web_pb.js b/gen/js/service/datamanager/v1/data_manager_grpc_web_pb.js index 04f875e29..af14ac8aa 100644 --- a/gen/js/service/datamanager/v1/data_manager_grpc_web_pb.js +++ b/gen/js/service/datamanager/v1/data_manager_grpc_web_pb.js @@ -20,6 +20,8 @@ const grpc = {}; grpc.web = require('grpc-web'); +var app_datasync_v1_data_sync_pb = require('../../../app/datasync/v1/data_sync_pb.js') + var common_v1_common_pb = require('../../../common/v1/common_pb.js') var google_api_annotations_pb = require('../../../google/api/annotations_pb.js') @@ -205,5 +207,66 @@ proto.viam.service.datamanager.v1.DataManagerServicePromiseClient.prototype.doCo }; +/** + * @const + * @type {!grpc.web.MethodDescriptor< + * !proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest, + * !proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetResponse>} + */ +const methodDescriptor_DataManagerService_UploadBinaryDataToDataset = new grpc.web.MethodDescriptor( + '/viam.service.datamanager.v1.DataManagerService/UploadBinaryDataToDataset', + grpc.web.MethodType.UNARY, + proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest, + proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetResponse, + /** + * @param {!proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest} request + * @return {!Uint8Array} + */ + function(request) { + return request.serializeBinary(); + }, + proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetResponse.deserializeBinary +); + + +/** + * @param {!proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest} request The + * request proto + * @param {?Object} metadata User defined + * call metadata + * @param {function(?grpc.web.RpcError, ?proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetResponse)} + * callback The callback function(error, response) + * @return {!grpc.web.ClientReadableStream|undefined} + * The XHR Node Readable Stream + */ +proto.viam.service.datamanager.v1.DataManagerServiceClient.prototype.uploadBinaryDataToDataset = + function(request, metadata, callback) { + return this.client_.rpcCall(this.hostname_ + + '/viam.service.datamanager.v1.DataManagerService/UploadBinaryDataToDataset', + request, + metadata || {}, + methodDescriptor_DataManagerService_UploadBinaryDataToDataset, + callback); +}; + + +/** + * @param {!proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest} request The + * request proto + * @param {?Object=} metadata User defined + * call metadata + * @return {!Promise} + * Promise that resolves to the response + */ +proto.viam.service.datamanager.v1.DataManagerServicePromiseClient.prototype.uploadBinaryDataToDataset = + function(request, metadata) { + return this.client_.unaryCall(this.hostname_ + + '/viam.service.datamanager.v1.DataManagerService/UploadBinaryDataToDataset', + request, + metadata || {}, + methodDescriptor_DataManagerService_UploadBinaryDataToDataset); +}; + + module.exports = proto.viam.service.datamanager.v1; diff --git a/gen/js/service/datamanager/v1/data_manager_pb.d.ts b/gen/js/service/datamanager/v1/data_manager_pb.d.ts index dfa03dbb5..7fa39e96e 100644 --- a/gen/js/service/datamanager/v1/data_manager_pb.d.ts +++ b/gen/js/service/datamanager/v1/data_manager_pb.d.ts @@ -2,6 +2,7 @@ // file: service/datamanager/v1/data_manager.proto import * as jspb from "google-protobuf"; +import * as app_datasync_v1_data_sync_pb from "../../../app/datasync/v1/data_sync_pb"; import * as common_v1_common_pb from "../../../common/v1/common_pb"; import * as google_api_annotations_pb from "../../../google/api/annotations_pb"; import * as google_protobuf_struct_pb from "google-protobuf/google/protobuf/struct_pb"; @@ -48,3 +49,67 @@ export namespace SyncResponse { } } +export class UploadBinaryDataToDatasetRequest extends jspb.Message { + getName(): string; + setName(value: string): void; + + getBinaryData(): Uint8Array | string; + getBinaryData_asU8(): Uint8Array; + getBinaryData_asB64(): string; + setBinaryData(value: Uint8Array | string): void; + + clearTagsList(): void; + getTagsList(): Array; + setTagsList(value: Array): void; + addTags(value: string, index?: number): string; + + clearDatasetIdsList(): void; + getDatasetIdsList(): Array; + setDatasetIdsList(value: Array): void; + addDatasetIds(value: string, index?: number): string; + + getMimeType(): app_datasync_v1_data_sync_pb.MimeTypeMap[keyof app_datasync_v1_data_sync_pb.MimeTypeMap]; + setMimeType(value: app_datasync_v1_data_sync_pb.MimeTypeMap[keyof app_datasync_v1_data_sync_pb.MimeTypeMap]): void; + + hasExtra(): boolean; + clearExtra(): void; + getExtra(): google_protobuf_struct_pb.Struct | undefined; + setExtra(value?: google_protobuf_struct_pb.Struct): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): UploadBinaryDataToDatasetRequest.AsObject; + static toObject(includeInstance: boolean, msg: UploadBinaryDataToDatasetRequest): UploadBinaryDataToDatasetRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: UploadBinaryDataToDatasetRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): UploadBinaryDataToDatasetRequest; + static deserializeBinaryFromReader(message: UploadBinaryDataToDatasetRequest, reader: jspb.BinaryReader): UploadBinaryDataToDatasetRequest; +} + +export namespace UploadBinaryDataToDatasetRequest { + export type AsObject = { + name: string, + binaryData: Uint8Array | string, + tagsList: Array, + datasetIdsList: Array, + mimeType: app_datasync_v1_data_sync_pb.MimeTypeMap[keyof app_datasync_v1_data_sync_pb.MimeTypeMap], + extra?: google_protobuf_struct_pb.Struct.AsObject, + } +} + +export class UploadBinaryDataToDatasetResponse extends jspb.Message { + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): UploadBinaryDataToDatasetResponse.AsObject; + static toObject(includeInstance: boolean, msg: UploadBinaryDataToDatasetResponse): UploadBinaryDataToDatasetResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: UploadBinaryDataToDatasetResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): UploadBinaryDataToDatasetResponse; + static deserializeBinaryFromReader(message: UploadBinaryDataToDatasetResponse, reader: jspb.BinaryReader): UploadBinaryDataToDatasetResponse; +} + +export namespace UploadBinaryDataToDatasetResponse { + export type AsObject = { + } +} + diff --git a/gen/js/service/datamanager/v1/data_manager_pb.js b/gen/js/service/datamanager/v1/data_manager_pb.js index e8e362084..da9a9c4e5 100644 --- a/gen/js/service/datamanager/v1/data_manager_pb.js +++ b/gen/js/service/datamanager/v1/data_manager_pb.js @@ -15,6 +15,8 @@ var jspb = require('google-protobuf'); var goog = jspb; var global = (function() { return this || window || global || self || Function('return this')(); }).call(null); +var app_datasync_v1_data_sync_pb = require('../../../app/datasync/v1/data_sync_pb.js'); +goog.object.extend(proto, app_datasync_v1_data_sync_pb); var common_v1_common_pb = require('../../../common/v1/common_pb.js'); goog.object.extend(proto, common_v1_common_pb); var google_api_annotations_pb = require('../../../google/api/annotations_pb.js'); @@ -23,6 +25,8 @@ var google_protobuf_struct_pb = require('google-protobuf/google/protobuf/struct_ goog.object.extend(proto, google_protobuf_struct_pb); goog.exportSymbol('proto.viam.service.datamanager.v1.SyncRequest', null, global); goog.exportSymbol('proto.viam.service.datamanager.v1.SyncResponse', null, global); +goog.exportSymbol('proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest', null, global); +goog.exportSymbol('proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetResponse', null, global); /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a @@ -65,6 +69,48 @@ if (goog.DEBUG && !COMPILED) { */ proto.viam.service.datamanager.v1.SyncResponse.displayName = 'proto.viam.service.datamanager.v1.SyncResponse'; } +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest.repeatedFields_, null); +}; +goog.inherits(proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest.displayName = 'proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetResponse.displayName = 'proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetResponse'; +} @@ -347,4 +393,475 @@ proto.viam.service.datamanager.v1.SyncResponse.serializeBinaryToWriter = functio }; + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest.repeatedFields_ = [3,4]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest.prototype.toObject = function(opt_includeInstance) { + return proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest.toObject = function(includeInstance, msg) { + var f, obj = { + name: jspb.Message.getFieldWithDefault(msg, 1, ""), + binaryData: msg.getBinaryData_asB64(), + tagsList: (f = jspb.Message.getRepeatedField(msg, 3)) == null ? undefined : f, + datasetIdsList: (f = jspb.Message.getRepeatedField(msg, 4)) == null ? undefined : f, + mimeType: jspb.Message.getFieldWithDefault(msg, 5, 0), + extra: (f = msg.getExtra()) && google_protobuf_struct_pb.Struct.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest} + */ +proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest; + return proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest} + */ +proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setName(value); + break; + case 2: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setBinaryData(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.addTags(value); + break; + case 4: + var value = /** @type {string} */ (reader.readString()); + msg.addDatasetIds(value); + break; + case 5: + var value = /** @type {!proto.viam.app.datasync.v1.MimeType} */ (reader.readEnum()); + msg.setMimeType(value); + break; + case 99: + var value = new google_protobuf_struct_pb.Struct; + reader.readMessage(value,google_protobuf_struct_pb.Struct.deserializeBinaryFromReader); + msg.setExtra(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getName(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getBinaryData_asU8(); + if (f.length > 0) { + writer.writeBytes( + 2, + f + ); + } + f = message.getTagsList(); + if (f.length > 0) { + writer.writeRepeatedString( + 3, + f + ); + } + f = message.getDatasetIdsList(); + if (f.length > 0) { + writer.writeRepeatedString( + 4, + f + ); + } + f = message.getMimeType(); + if (f !== 0.0) { + writer.writeEnum( + 5, + f + ); + } + f = message.getExtra(); + if (f != null) { + writer.writeMessage( + 99, + f, + google_protobuf_struct_pb.Struct.serializeBinaryToWriter + ); + } +}; + + +/** + * optional string name = 1; + * @return {string} + */ +proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest.prototype.getName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest} returns this + */ +proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest.prototype.setName = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional bytes binary_data = 2; + * @return {string} + */ +proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest.prototype.getBinaryData = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * optional bytes binary_data = 2; + * This is a type-conversion wrapper around `getBinaryData()` + * @return {string} + */ +proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest.prototype.getBinaryData_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getBinaryData())); +}; + + +/** + * optional bytes binary_data = 2; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getBinaryData()` + * @return {!Uint8Array} + */ +proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest.prototype.getBinaryData_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getBinaryData())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest} returns this + */ +proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest.prototype.setBinaryData = function(value) { + return jspb.Message.setProto3BytesField(this, 2, value); +}; + + +/** + * repeated string tags = 3; + * @return {!Array} + */ +proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest.prototype.getTagsList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 3)); +}; + + +/** + * @param {!Array} value + * @return {!proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest} returns this + */ +proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest.prototype.setTagsList = function(value) { + return jspb.Message.setField(this, 3, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest} returns this + */ +proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest.prototype.addTags = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 3, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest} returns this + */ +proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest.prototype.clearTagsList = function() { + return this.setTagsList([]); +}; + + +/** + * repeated string dataset_ids = 4; + * @return {!Array} + */ +proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest.prototype.getDatasetIdsList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 4)); +}; + + +/** + * @param {!Array} value + * @return {!proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest} returns this + */ +proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest.prototype.setDatasetIdsList = function(value) { + return jspb.Message.setField(this, 4, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest} returns this + */ +proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest.prototype.addDatasetIds = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 4, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest} returns this + */ +proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest.prototype.clearDatasetIdsList = function() { + return this.setDatasetIdsList([]); +}; + + +/** + * optional viam.app.datasync.v1.MimeType mime_type = 5; + * @return {!proto.viam.app.datasync.v1.MimeType} + */ +proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest.prototype.getMimeType = function() { + return /** @type {!proto.viam.app.datasync.v1.MimeType} */ (jspb.Message.getFieldWithDefault(this, 5, 0)); +}; + + +/** + * @param {!proto.viam.app.datasync.v1.MimeType} value + * @return {!proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest} returns this + */ +proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest.prototype.setMimeType = function(value) { + return jspb.Message.setProto3EnumField(this, 5, value); +}; + + +/** + * optional google.protobuf.Struct extra = 99; + * @return {?proto.google.protobuf.Struct} + */ +proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest.prototype.getExtra = function() { + return /** @type{?proto.google.protobuf.Struct} */ ( + jspb.Message.getWrapperField(this, google_protobuf_struct_pb.Struct, 99)); +}; + + +/** + * @param {?proto.google.protobuf.Struct|undefined} value + * @return {!proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest} returns this +*/ +proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest.prototype.setExtra = function(value) { + return jspb.Message.setWrapperField(this, 99, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest} returns this + */ +proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest.prototype.clearExtra = function() { + return this.setExtra(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest.prototype.hasExtra = function() { + return jspb.Message.getField(this, 99) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetResponse.prototype.toObject = function(opt_includeInstance) { + return proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetResponse.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetResponse.toObject = function(includeInstance, msg) { + var f, obj = { + + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetResponse} + */ +proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetResponse; + return proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetResponse} + */ +proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; +}; + + goog.object.extend(exports, proto.viam.service.datamanager.v1); diff --git a/gen/js/service/datamanager/v1/data_manager_pb_service.d.ts b/gen/js/service/datamanager/v1/data_manager_pb_service.d.ts index b997e8c87..61c84e4bc 100644 --- a/gen/js/service/datamanager/v1/data_manager_pb_service.d.ts +++ b/gen/js/service/datamanager/v1/data_manager_pb_service.d.ts @@ -23,10 +23,20 @@ type DataManagerServiceDoCommand = { readonly responseType: typeof common_v1_common_pb.DoCommandResponse; }; +type DataManagerServiceUploadBinaryDataToDataset = { + readonly methodName: string; + readonly service: typeof DataManagerService; + readonly requestStream: false; + readonly responseStream: false; + readonly requestType: typeof service_datamanager_v1_data_manager_pb.UploadBinaryDataToDatasetRequest; + readonly responseType: typeof service_datamanager_v1_data_manager_pb.UploadBinaryDataToDatasetResponse; +}; + export class DataManagerService { static readonly serviceName: string; static readonly Sync: DataManagerServiceSync; static readonly DoCommand: DataManagerServiceDoCommand; + static readonly UploadBinaryDataToDataset: DataManagerServiceUploadBinaryDataToDataset; } export type ServiceError = { message: string, code: number; metadata: grpc.Metadata } @@ -79,5 +89,14 @@ export class DataManagerServiceClient { requestMessage: common_v1_common_pb.DoCommandRequest, callback: (error: ServiceError|null, responseMessage: common_v1_common_pb.DoCommandResponse|null) => void ): UnaryResponse; + uploadBinaryDataToDataset( + requestMessage: service_datamanager_v1_data_manager_pb.UploadBinaryDataToDatasetRequest, + metadata: grpc.Metadata, + callback: (error: ServiceError|null, responseMessage: service_datamanager_v1_data_manager_pb.UploadBinaryDataToDatasetResponse|null) => void + ): UnaryResponse; + uploadBinaryDataToDataset( + requestMessage: service_datamanager_v1_data_manager_pb.UploadBinaryDataToDatasetRequest, + callback: (error: ServiceError|null, responseMessage: service_datamanager_v1_data_manager_pb.UploadBinaryDataToDatasetResponse|null) => void + ): UnaryResponse; } diff --git a/gen/js/service/datamanager/v1/data_manager_pb_service.js b/gen/js/service/datamanager/v1/data_manager_pb_service.js index 508c4a4f1..8dba9a409 100644 --- a/gen/js/service/datamanager/v1/data_manager_pb_service.js +++ b/gen/js/service/datamanager/v1/data_manager_pb_service.js @@ -29,6 +29,15 @@ DataManagerService.DoCommand = { responseType: common_v1_common_pb.DoCommandResponse }; +DataManagerService.UploadBinaryDataToDataset = { + methodName: "UploadBinaryDataToDataset", + service: DataManagerService, + requestStream: false, + responseStream: false, + requestType: service_datamanager_v1_data_manager_pb.UploadBinaryDataToDatasetRequest, + responseType: service_datamanager_v1_data_manager_pb.UploadBinaryDataToDatasetResponse +}; + exports.DataManagerService = DataManagerService; function DataManagerServiceClient(serviceHost, options) { @@ -98,5 +107,36 @@ DataManagerServiceClient.prototype.doCommand = function doCommand(requestMessage }; }; +DataManagerServiceClient.prototype.uploadBinaryDataToDataset = function uploadBinaryDataToDataset(requestMessage, metadata, callback) { + if (arguments.length === 2) { + callback = arguments[1]; + } + var client = grpc.unary(DataManagerService.UploadBinaryDataToDataset, { + request: requestMessage, + host: this.serviceHost, + metadata: metadata, + transport: this.options.transport, + debug: this.options.debug, + onEnd: function (response) { + if (callback) { + if (response.status !== grpc.Code.OK) { + var err = new Error(response.statusMessage); + err.code = response.status; + err.metadata = response.trailers; + callback(err, null); + } else { + callback(null, response.message); + } + } + } + }); + return { + cancel: function () { + callback = null; + client.close(); + } + }; +}; + exports.DataManagerServiceClient = DataManagerServiceClient; diff --git a/service/datamanager/v1/data_manager.pb.go b/service/datamanager/v1/data_manager.pb.go index af8e5bda0..41d1de6f8 100644 --- a/service/datamanager/v1/data_manager.pb.go +++ b/service/datamanager/v1/data_manager.pb.go @@ -7,7 +7,8 @@ package v1 import ( - v1 "go.viam.com/api/common/v1" + v1 "go.viam.com/api/app/datasync/v1" + v11 "go.viam.com/api/common/v1" _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" @@ -113,6 +114,128 @@ func (*SyncResponse) Descriptor() ([]byte, []int) { return file_service_datamanager_v1_data_manager_proto_rawDescGZIP(), []int{1} } +type UploadBinaryDataToDatasetRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + BinaryData []byte `protobuf:"bytes,2,opt,name=binary_data,json=binaryData,proto3" json:"binary_data,omitempty"` + Tags []string `protobuf:"bytes,3,rep,name=tags,proto3" json:"tags,omitempty"` + DatasetIds []string `protobuf:"bytes,4,rep,name=dataset_ids,json=datasetIds,proto3" json:"dataset_ids,omitempty"` + MimeType v1.MimeType `protobuf:"varint,5,opt,name=mime_type,json=mimeType,proto3,enum=viam.app.datasync.v1.MimeType" json:"mime_type,omitempty"` + // Additional arguments to the method + Extra *structpb.Struct `protobuf:"bytes,99,opt,name=extra,proto3" json:"extra,omitempty"` +} + +func (x *UploadBinaryDataToDatasetRequest) Reset() { + *x = UploadBinaryDataToDatasetRequest{} + mi := &file_service_datamanager_v1_data_manager_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UploadBinaryDataToDatasetRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UploadBinaryDataToDatasetRequest) ProtoMessage() {} + +func (x *UploadBinaryDataToDatasetRequest) ProtoReflect() protoreflect.Message { + mi := &file_service_datamanager_v1_data_manager_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UploadBinaryDataToDatasetRequest.ProtoReflect.Descriptor instead. +func (*UploadBinaryDataToDatasetRequest) Descriptor() ([]byte, []int) { + return file_service_datamanager_v1_data_manager_proto_rawDescGZIP(), []int{2} +} + +func (x *UploadBinaryDataToDatasetRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *UploadBinaryDataToDatasetRequest) GetBinaryData() []byte { + if x != nil { + return x.BinaryData + } + return nil +} + +func (x *UploadBinaryDataToDatasetRequest) GetTags() []string { + if x != nil { + return x.Tags + } + return nil +} + +func (x *UploadBinaryDataToDatasetRequest) GetDatasetIds() []string { + if x != nil { + return x.DatasetIds + } + return nil +} + +func (x *UploadBinaryDataToDatasetRequest) GetMimeType() v1.MimeType { + if x != nil { + return x.MimeType + } + return v1.MimeType(0) +} + +func (x *UploadBinaryDataToDatasetRequest) GetExtra() *structpb.Struct { + if x != nil { + return x.Extra + } + return nil +} + +type UploadBinaryDataToDatasetResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *UploadBinaryDataToDatasetResponse) Reset() { + *x = UploadBinaryDataToDatasetResponse{} + mi := &file_service_datamanager_v1_data_manager_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UploadBinaryDataToDatasetResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UploadBinaryDataToDatasetResponse) ProtoMessage() {} + +func (x *UploadBinaryDataToDatasetResponse) ProtoReflect() protoreflect.Message { + mi := &file_service_datamanager_v1_data_manager_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UploadBinaryDataToDatasetResponse.ProtoReflect.Descriptor instead. +func (*UploadBinaryDataToDatasetResponse) Descriptor() ([]byte, []int) { + return file_service_datamanager_v1_data_manager_proto_rawDescGZIP(), []int{3} +} + var File_service_datamanager_v1_data_manager_proto protoreflect.FileDescriptor var file_service_datamanager_v1_data_manager_proto_rawDesc = []byte{ @@ -120,43 +243,78 @@ var file_service_datamanager_v1_data_manager_proto_rawDesc = []byte{ 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2f, 0x76, 0x31, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1b, 0x76, 0x69, 0x61, 0x6d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x6d, 0x61, - 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x1a, 0x16, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, - 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, - 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, - 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x50, 0x0a, 0x0b, - 0x53, 0x79, 0x6e, 0x63, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, - 0x2d, 0x0a, 0x05, 0x65, 0x78, 0x74, 0x72, 0x61, 0x18, 0x63, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, 0x05, 0x65, 0x78, 0x74, 0x72, 0x61, 0x22, 0x0e, - 0x0a, 0x0c, 0x53, 0x79, 0x6e, 0x63, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xbb, - 0x02, 0x0a, 0x12, 0x44, 0x61, 0x74, 0x61, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x53, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x95, 0x01, 0x0a, 0x04, 0x53, 0x79, 0x6e, 0x63, 0x12, 0x28, - 0x2e, 0x76, 0x69, 0x61, 0x6d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x64, 0x61, - 0x74, 0x61, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x79, 0x6e, - 0x63, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x76, 0x69, 0x61, 0x6d, 0x2e, - 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x6d, 0x61, 0x6e, 0x61, - 0x67, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x38, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x32, 0x22, 0x30, 0x2f, 0x76, 0x69, - 0x61, 0x6d, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2f, 0x7b, 0x6e, - 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x73, 0x79, 0x6e, 0x63, 0x12, 0x8c, 0x01, - 0x0a, 0x09, 0x44, 0x6f, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x20, 0x2e, 0x76, 0x69, - 0x61, 0x6d, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x6f, 0x43, - 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, - 0x76, 0x69, 0x61, 0x6d, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x44, - 0x6f, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x3a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x34, 0x22, 0x32, 0x2f, 0x76, 0x69, 0x61, 0x6d, 0x2f, - 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x64, - 0x61, 0x74, 0x61, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, - 0x7d, 0x2f, 0x64, 0x6f, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x42, 0x49, 0x0a, 0x1f, - 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x69, 0x61, 0x6d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x2e, 0x64, 0x61, 0x74, 0x61, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x5a, - 0x26, 0x67, 0x6f, 0x2e, 0x76, 0x69, 0x61, 0x6d, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x70, 0x69, + 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x1a, 0x1f, 0x61, 0x70, 0x70, 0x2f, 0x64, 0x61, + 0x74, 0x61, 0x73, 0x79, 0x6e, 0x63, 0x2f, 0x76, 0x31, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x73, + 0x79, 0x6e, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x16, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, + 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, + 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2f, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x50, 0x0a, + 0x0b, 0x53, 0x79, 0x6e, 0x63, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x12, 0x2d, 0x0a, 0x05, 0x65, 0x78, 0x74, 0x72, 0x61, 0x18, 0x63, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, 0x05, 0x65, 0x78, 0x74, 0x72, 0x61, 0x22, + 0x0e, 0x0a, 0x0c, 0x53, 0x79, 0x6e, 0x63, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0xf8, 0x01, 0x0a, 0x20, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x42, 0x69, 0x6e, 0x61, 0x72, 0x79, + 0x44, 0x61, 0x74, 0x61, 0x54, 0x6f, 0x44, 0x61, 0x74, 0x61, 0x73, 0x65, 0x74, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x62, 0x69, 0x6e, 0x61, + 0x72, 0x79, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x62, + 0x69, 0x6e, 0x61, 0x72, 0x79, 0x44, 0x61, 0x74, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x61, 0x67, + 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x74, 0x61, 0x67, 0x73, 0x12, 0x1f, 0x0a, + 0x0b, 0x64, 0x61, 0x74, 0x61, 0x73, 0x65, 0x74, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x04, 0x20, 0x03, + 0x28, 0x09, 0x52, 0x0a, 0x64, 0x61, 0x74, 0x61, 0x73, 0x65, 0x74, 0x49, 0x64, 0x73, 0x12, 0x3b, + 0x0a, 0x09, 0x6d, 0x69, 0x6d, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x0e, 0x32, 0x1e, 0x2e, 0x76, 0x69, 0x61, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x64, 0x61, 0x74, + 0x61, 0x73, 0x79, 0x6e, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x69, 0x6d, 0x65, 0x54, 0x79, 0x70, + 0x65, 0x52, 0x08, 0x6d, 0x69, 0x6d, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x2d, 0x0a, 0x05, 0x65, + 0x78, 0x74, 0x72, 0x61, 0x18, 0x63, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, + 0x75, 0x63, 0x74, 0x52, 0x05, 0x65, 0x78, 0x74, 0x72, 0x61, 0x22, 0x23, 0x0a, 0x21, 0x55, 0x70, + 0x6c, 0x6f, 0x61, 0x64, 0x42, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x44, 0x61, 0x74, 0x61, 0x54, 0x6f, + 0x44, 0x61, 0x74, 0x61, 0x73, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, + 0xa7, 0x04, 0x0a, 0x12, 0x44, 0x61, 0x74, 0x61, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x95, 0x01, 0x0a, 0x04, 0x53, 0x79, 0x6e, 0x63, 0x12, + 0x28, 0x2e, 0x76, 0x69, 0x61, 0x6d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x64, + 0x61, 0x74, 0x61, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x79, + 0x6e, 0x63, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x76, 0x69, 0x61, 0x6d, + 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x6d, 0x61, 0x6e, + 0x61, 0x67, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x38, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x32, 0x22, 0x30, 0x2f, 0x76, + 0x69, 0x61, 0x6d, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2f, 0x7b, + 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x73, 0x79, 0x6e, 0x63, 0x12, 0x8c, + 0x01, 0x0a, 0x09, 0x44, 0x6f, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x20, 0x2e, 0x76, + 0x69, 0x61, 0x6d, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x6f, + 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, + 0x2e, 0x76, 0x69, 0x61, 0x6d, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, + 0x44, 0x6f, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x3a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x34, 0x22, 0x32, 0x2f, 0x76, 0x69, 0x61, 0x6d, + 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, + 0x64, 0x61, 0x74, 0x61, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, + 0x65, 0x7d, 0x2f, 0x64, 0x6f, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0xe9, 0x01, + 0x0a, 0x19, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x42, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x44, 0x61, + 0x74, 0x61, 0x54, 0x6f, 0x44, 0x61, 0x74, 0x61, 0x73, 0x65, 0x74, 0x12, 0x3d, 0x2e, 0x76, 0x69, + 0x61, 0x6d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x6d, + 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, + 0x42, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x44, 0x61, 0x74, 0x61, 0x54, 0x6f, 0x44, 0x61, 0x74, 0x61, + 0x73, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3e, 0x2e, 0x76, 0x69, 0x61, + 0x6d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x6d, 0x61, + 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x42, + 0x69, 0x6e, 0x61, 0x72, 0x79, 0x44, 0x61, 0x74, 0x61, 0x54, 0x6f, 0x44, 0x61, 0x74, 0x61, 0x73, + 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x4d, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x47, 0x22, 0x45, 0x2f, 0x76, 0x69, 0x61, 0x6d, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x6d, 0x61, 0x6e, - 0x61, 0x67, 0x65, 0x72, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x61, 0x67, 0x65, 0x72, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x75, 0x70, 0x6c, 0x6f, + 0x61, 0x64, 0x5f, 0x62, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x74, + 0x6f, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x73, 0x65, 0x74, 0x42, 0x49, 0x0a, 0x1f, 0x63, 0x6f, 0x6d, + 0x2e, 0x76, 0x69, 0x61, 0x6d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x64, 0x61, + 0x74, 0x61, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x5a, 0x26, 0x67, 0x6f, + 0x2e, 0x76, 0x69, 0x61, 0x6d, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, + 0x72, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -171,25 +329,32 @@ func file_service_datamanager_v1_data_manager_proto_rawDescGZIP() []byte { return file_service_datamanager_v1_data_manager_proto_rawDescData } -var file_service_datamanager_v1_data_manager_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_service_datamanager_v1_data_manager_proto_msgTypes = make([]protoimpl.MessageInfo, 4) var file_service_datamanager_v1_data_manager_proto_goTypes = []any{ - (*SyncRequest)(nil), // 0: viam.service.datamanager.v1.SyncRequest - (*SyncResponse)(nil), // 1: viam.service.datamanager.v1.SyncResponse - (*structpb.Struct)(nil), // 2: google.protobuf.Struct - (*v1.DoCommandRequest)(nil), // 3: viam.common.v1.DoCommandRequest - (*v1.DoCommandResponse)(nil), // 4: viam.common.v1.DoCommandResponse + (*SyncRequest)(nil), // 0: viam.service.datamanager.v1.SyncRequest + (*SyncResponse)(nil), // 1: viam.service.datamanager.v1.SyncResponse + (*UploadBinaryDataToDatasetRequest)(nil), // 2: viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest + (*UploadBinaryDataToDatasetResponse)(nil), // 3: viam.service.datamanager.v1.UploadBinaryDataToDatasetResponse + (*structpb.Struct)(nil), // 4: google.protobuf.Struct + (v1.MimeType)(0), // 5: viam.app.datasync.v1.MimeType + (*v11.DoCommandRequest)(nil), // 6: viam.common.v1.DoCommandRequest + (*v11.DoCommandResponse)(nil), // 7: viam.common.v1.DoCommandResponse } var file_service_datamanager_v1_data_manager_proto_depIdxs = []int32{ - 2, // 0: viam.service.datamanager.v1.SyncRequest.extra:type_name -> google.protobuf.Struct - 0, // 1: viam.service.datamanager.v1.DataManagerService.Sync:input_type -> viam.service.datamanager.v1.SyncRequest - 3, // 2: viam.service.datamanager.v1.DataManagerService.DoCommand:input_type -> viam.common.v1.DoCommandRequest - 1, // 3: viam.service.datamanager.v1.DataManagerService.Sync:output_type -> viam.service.datamanager.v1.SyncResponse - 4, // 4: viam.service.datamanager.v1.DataManagerService.DoCommand:output_type -> viam.common.v1.DoCommandResponse - 3, // [3:5] is the sub-list for method output_type - 1, // [1:3] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name + 4, // 0: viam.service.datamanager.v1.SyncRequest.extra:type_name -> google.protobuf.Struct + 5, // 1: viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest.mime_type:type_name -> viam.app.datasync.v1.MimeType + 4, // 2: viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest.extra:type_name -> google.protobuf.Struct + 0, // 3: viam.service.datamanager.v1.DataManagerService.Sync:input_type -> viam.service.datamanager.v1.SyncRequest + 6, // 4: viam.service.datamanager.v1.DataManagerService.DoCommand:input_type -> viam.common.v1.DoCommandRequest + 2, // 5: viam.service.datamanager.v1.DataManagerService.UploadBinaryDataToDataset:input_type -> viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest + 1, // 6: viam.service.datamanager.v1.DataManagerService.Sync:output_type -> viam.service.datamanager.v1.SyncResponse + 7, // 7: viam.service.datamanager.v1.DataManagerService.DoCommand:output_type -> viam.common.v1.DoCommandResponse + 3, // 8: viam.service.datamanager.v1.DataManagerService.UploadBinaryDataToDataset:output_type -> viam.service.datamanager.v1.UploadBinaryDataToDatasetResponse + 6, // [6:9] is the sub-list for method output_type + 3, // [3:6] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name } func init() { file_service_datamanager_v1_data_manager_proto_init() } @@ -203,7 +368,7 @@ func file_service_datamanager_v1_data_manager_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_service_datamanager_v1_data_manager_proto_rawDesc, NumEnums: 0, - NumMessages: 2, + NumMessages: 4, NumExtensions: 0, NumServices: 1, }, diff --git a/service/datamanager/v1/data_manager.pb.gw.go b/service/datamanager/v1/data_manager.pb.gw.go index a3065013b..3ade9f8cc 100644 --- a/service/datamanager/v1/data_manager.pb.gw.go +++ b/service/datamanager/v1/data_manager.pb.gw.go @@ -15,7 +15,7 @@ import ( "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" - "go.viam.com/api/common/v1" + v1_1 "go.viam.com/api/common/v1" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/grpclog" @@ -107,7 +107,7 @@ var ( ) func request_DataManagerService_DoCommand_0(ctx context.Context, marshaler runtime.Marshaler, client DataManagerServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1.DoCommandRequest + var protoReq v1_1.DoCommandRequest var metadata runtime.ServerMetadata var ( @@ -140,7 +140,7 @@ func request_DataManagerService_DoCommand_0(ctx context.Context, marshaler runti } func local_request_DataManagerService_DoCommand_0(ctx context.Context, marshaler runtime.Marshaler, server DataManagerServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1.DoCommandRequest + var protoReq v1_1.DoCommandRequest var metadata runtime.ServerMetadata var ( @@ -172,6 +172,76 @@ func local_request_DataManagerService_DoCommand_0(ctx context.Context, marshaler } +var ( + filter_DataManagerService_UploadBinaryDataToDataset_0 = &utilities.DoubleArray{Encoding: map[string]int{"name": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + +func request_DataManagerService_UploadBinaryDataToDataset_0(ctx context.Context, marshaler runtime.Marshaler, client DataManagerServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq UploadBinaryDataToDatasetRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") + } + + protoReq.Name, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_DataManagerService_UploadBinaryDataToDataset_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.UploadBinaryDataToDataset(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_DataManagerService_UploadBinaryDataToDataset_0(ctx context.Context, marshaler runtime.Marshaler, server DataManagerServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq UploadBinaryDataToDatasetRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") + } + + protoReq.Name, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_DataManagerService_UploadBinaryDataToDataset_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.UploadBinaryDataToDataset(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterDataManagerServiceHandlerServer registers the http handlers for service DataManagerService to "mux". // UnaryRPC :call DataManagerServiceServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -228,6 +298,31 @@ func RegisterDataManagerServiceHandlerServer(ctx context.Context, mux *runtime.S }) + mux.Handle("POST", pattern_DataManagerService_UploadBinaryDataToDataset_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/viam.service.datamanager.v1.DataManagerService/UploadBinaryDataToDataset", runtime.WithHTTPPathPattern("/viam/api/v1/service/datamanager/{name}/upload_binary_data_to_dataset")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_DataManagerService_UploadBinaryDataToDataset_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_DataManagerService_UploadBinaryDataToDataset_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -313,6 +408,28 @@ func RegisterDataManagerServiceHandlerClient(ctx context.Context, mux *runtime.S }) + mux.Handle("POST", pattern_DataManagerService_UploadBinaryDataToDataset_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/viam.service.datamanager.v1.DataManagerService/UploadBinaryDataToDataset", runtime.WithHTTPPathPattern("/viam/api/v1/service/datamanager/{name}/upload_binary_data_to_dataset")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_DataManagerService_UploadBinaryDataToDataset_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_DataManagerService_UploadBinaryDataToDataset_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -320,10 +437,14 @@ var ( pattern_DataManagerService_Sync_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5, 2, 6}, []string{"viam", "api", "v1", "service", "datamanager", "name", "datasync"}, "")) pattern_DataManagerService_DoCommand_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5, 2, 6}, []string{"viam", "api", "v1", "service", "datamanager", "name", "do_command"}, "")) + + pattern_DataManagerService_UploadBinaryDataToDataset_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5, 2, 6}, []string{"viam", "api", "v1", "service", "datamanager", "name", "upload_binary_data_to_dataset"}, "")) ) var ( forward_DataManagerService_Sync_0 = runtime.ForwardResponseMessage forward_DataManagerService_DoCommand_0 = runtime.ForwardResponseMessage + + forward_DataManagerService_UploadBinaryDataToDataset_0 = runtime.ForwardResponseMessage ) diff --git a/service/datamanager/v1/data_manager_grpc.pb.go b/service/datamanager/v1/data_manager_grpc.pb.go index b9ef91c7e..70ac24b8d 100644 --- a/service/datamanager/v1/data_manager_grpc.pb.go +++ b/service/datamanager/v1/data_manager_grpc.pb.go @@ -27,6 +27,8 @@ type DataManagerServiceClient interface { Sync(ctx context.Context, in *SyncRequest, opts ...grpc.CallOption) (*SyncResponse, error) // DoCommand sends/receives arbitrary commands DoCommand(ctx context.Context, in *v1.DoCommandRequest, opts ...grpc.CallOption) (*v1.DoCommandResponse, error) + // UploadBinaryDataToDataset uploads binary data to a dataset. + UploadBinaryDataToDataset(ctx context.Context, in *UploadBinaryDataToDatasetRequest, opts ...grpc.CallOption) (*UploadBinaryDataToDatasetResponse, error) } type dataManagerServiceClient struct { @@ -55,6 +57,15 @@ func (c *dataManagerServiceClient) DoCommand(ctx context.Context, in *v1.DoComma return out, nil } +func (c *dataManagerServiceClient) UploadBinaryDataToDataset(ctx context.Context, in *UploadBinaryDataToDatasetRequest, opts ...grpc.CallOption) (*UploadBinaryDataToDatasetResponse, error) { + out := new(UploadBinaryDataToDatasetResponse) + err := c.cc.Invoke(ctx, "/viam.service.datamanager.v1.DataManagerService/UploadBinaryDataToDataset", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // DataManagerServiceServer is the server API for DataManagerService service. // All implementations must embed UnimplementedDataManagerServiceServer // for forward compatibility @@ -63,6 +74,8 @@ type DataManagerServiceServer interface { Sync(context.Context, *SyncRequest) (*SyncResponse, error) // DoCommand sends/receives arbitrary commands DoCommand(context.Context, *v1.DoCommandRequest) (*v1.DoCommandResponse, error) + // UploadBinaryDataToDataset uploads binary data to a dataset. + UploadBinaryDataToDataset(context.Context, *UploadBinaryDataToDatasetRequest) (*UploadBinaryDataToDatasetResponse, error) mustEmbedUnimplementedDataManagerServiceServer() } @@ -76,6 +89,9 @@ func (UnimplementedDataManagerServiceServer) Sync(context.Context, *SyncRequest) func (UnimplementedDataManagerServiceServer) DoCommand(context.Context, *v1.DoCommandRequest) (*v1.DoCommandResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method DoCommand not implemented") } +func (UnimplementedDataManagerServiceServer) UploadBinaryDataToDataset(context.Context, *UploadBinaryDataToDatasetRequest) (*UploadBinaryDataToDatasetResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UploadBinaryDataToDataset not implemented") +} func (UnimplementedDataManagerServiceServer) mustEmbedUnimplementedDataManagerServiceServer() {} // UnsafeDataManagerServiceServer may be embedded to opt out of forward compatibility for this service. @@ -125,6 +141,24 @@ func _DataManagerService_DoCommand_Handler(srv interface{}, ctx context.Context, return interceptor(ctx, in, info, handler) } +func _DataManagerService_UploadBinaryDataToDataset_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UploadBinaryDataToDatasetRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DataManagerServiceServer).UploadBinaryDataToDataset(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/viam.service.datamanager.v1.DataManagerService/UploadBinaryDataToDataset", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DataManagerServiceServer).UploadBinaryDataToDataset(ctx, req.(*UploadBinaryDataToDatasetRequest)) + } + return interceptor(ctx, in, info, handler) +} + // DataManagerService_ServiceDesc is the grpc.ServiceDesc for DataManagerService service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -140,6 +174,10 @@ var DataManagerService_ServiceDesc = grpc.ServiceDesc{ MethodName: "DoCommand", Handler: _DataManagerService_DoCommand_Handler, }, + { + MethodName: "UploadBinaryDataToDataset", + Handler: _DataManagerService_UploadBinaryDataToDataset_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "service/datamanager/v1/data_manager.proto", From d322c7674a1d811ca52333acf0a88b289d8201db Mon Sep 17 00:00:00 2001 From: Tahiya Salam Date: Mon, 21 Jul 2025 13:35:17 -0400 Subject: [PATCH 4/6] Revert "Built new protos from 4828d58" This reverts commit d9437d8203b60d2c31e0efd3211e9e010105c415. --- .../v1/data_manager_grpc_web_pb.js | 63 --- .../datamanager/v1/data_manager_pb.d.ts | 65 --- .../service/datamanager/v1/data_manager_pb.js | 517 ------------------ .../v1/data_manager_pb_service.d.ts | 19 - .../datamanager/v1/data_manager_pb_service.js | 40 -- service/datamanager/v1/data_manager.pb.go | 273 ++------- service/datamanager/v1/data_manager.pb.gw.go | 127 +---- .../datamanager/v1/data_manager_grpc.pb.go | 38 -- 8 files changed, 57 insertions(+), 1085 deletions(-) diff --git a/gen/js/service/datamanager/v1/data_manager_grpc_web_pb.js b/gen/js/service/datamanager/v1/data_manager_grpc_web_pb.js index af14ac8aa..04f875e29 100644 --- a/gen/js/service/datamanager/v1/data_manager_grpc_web_pb.js +++ b/gen/js/service/datamanager/v1/data_manager_grpc_web_pb.js @@ -20,8 +20,6 @@ const grpc = {}; grpc.web = require('grpc-web'); -var app_datasync_v1_data_sync_pb = require('../../../app/datasync/v1/data_sync_pb.js') - var common_v1_common_pb = require('../../../common/v1/common_pb.js') var google_api_annotations_pb = require('../../../google/api/annotations_pb.js') @@ -207,66 +205,5 @@ proto.viam.service.datamanager.v1.DataManagerServicePromiseClient.prototype.doCo }; -/** - * @const - * @type {!grpc.web.MethodDescriptor< - * !proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest, - * !proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetResponse>} - */ -const methodDescriptor_DataManagerService_UploadBinaryDataToDataset = new grpc.web.MethodDescriptor( - '/viam.service.datamanager.v1.DataManagerService/UploadBinaryDataToDataset', - grpc.web.MethodType.UNARY, - proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest, - proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetResponse, - /** - * @param {!proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest} request - * @return {!Uint8Array} - */ - function(request) { - return request.serializeBinary(); - }, - proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetResponse.deserializeBinary -); - - -/** - * @param {!proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest} request The - * request proto - * @param {?Object} metadata User defined - * call metadata - * @param {function(?grpc.web.RpcError, ?proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetResponse)} - * callback The callback function(error, response) - * @return {!grpc.web.ClientReadableStream|undefined} - * The XHR Node Readable Stream - */ -proto.viam.service.datamanager.v1.DataManagerServiceClient.prototype.uploadBinaryDataToDataset = - function(request, metadata, callback) { - return this.client_.rpcCall(this.hostname_ + - '/viam.service.datamanager.v1.DataManagerService/UploadBinaryDataToDataset', - request, - metadata || {}, - methodDescriptor_DataManagerService_UploadBinaryDataToDataset, - callback); -}; - - -/** - * @param {!proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest} request The - * request proto - * @param {?Object=} metadata User defined - * call metadata - * @return {!Promise} - * Promise that resolves to the response - */ -proto.viam.service.datamanager.v1.DataManagerServicePromiseClient.prototype.uploadBinaryDataToDataset = - function(request, metadata) { - return this.client_.unaryCall(this.hostname_ + - '/viam.service.datamanager.v1.DataManagerService/UploadBinaryDataToDataset', - request, - metadata || {}, - methodDescriptor_DataManagerService_UploadBinaryDataToDataset); -}; - - module.exports = proto.viam.service.datamanager.v1; diff --git a/gen/js/service/datamanager/v1/data_manager_pb.d.ts b/gen/js/service/datamanager/v1/data_manager_pb.d.ts index 7fa39e96e..dfa03dbb5 100644 --- a/gen/js/service/datamanager/v1/data_manager_pb.d.ts +++ b/gen/js/service/datamanager/v1/data_manager_pb.d.ts @@ -2,7 +2,6 @@ // file: service/datamanager/v1/data_manager.proto import * as jspb from "google-protobuf"; -import * as app_datasync_v1_data_sync_pb from "../../../app/datasync/v1/data_sync_pb"; import * as common_v1_common_pb from "../../../common/v1/common_pb"; import * as google_api_annotations_pb from "../../../google/api/annotations_pb"; import * as google_protobuf_struct_pb from "google-protobuf/google/protobuf/struct_pb"; @@ -49,67 +48,3 @@ export namespace SyncResponse { } } -export class UploadBinaryDataToDatasetRequest extends jspb.Message { - getName(): string; - setName(value: string): void; - - getBinaryData(): Uint8Array | string; - getBinaryData_asU8(): Uint8Array; - getBinaryData_asB64(): string; - setBinaryData(value: Uint8Array | string): void; - - clearTagsList(): void; - getTagsList(): Array; - setTagsList(value: Array): void; - addTags(value: string, index?: number): string; - - clearDatasetIdsList(): void; - getDatasetIdsList(): Array; - setDatasetIdsList(value: Array): void; - addDatasetIds(value: string, index?: number): string; - - getMimeType(): app_datasync_v1_data_sync_pb.MimeTypeMap[keyof app_datasync_v1_data_sync_pb.MimeTypeMap]; - setMimeType(value: app_datasync_v1_data_sync_pb.MimeTypeMap[keyof app_datasync_v1_data_sync_pb.MimeTypeMap]): void; - - hasExtra(): boolean; - clearExtra(): void; - getExtra(): google_protobuf_struct_pb.Struct | undefined; - setExtra(value?: google_protobuf_struct_pb.Struct): void; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): UploadBinaryDataToDatasetRequest.AsObject; - static toObject(includeInstance: boolean, msg: UploadBinaryDataToDatasetRequest): UploadBinaryDataToDatasetRequest.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: UploadBinaryDataToDatasetRequest, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): UploadBinaryDataToDatasetRequest; - static deserializeBinaryFromReader(message: UploadBinaryDataToDatasetRequest, reader: jspb.BinaryReader): UploadBinaryDataToDatasetRequest; -} - -export namespace UploadBinaryDataToDatasetRequest { - export type AsObject = { - name: string, - binaryData: Uint8Array | string, - tagsList: Array, - datasetIdsList: Array, - mimeType: app_datasync_v1_data_sync_pb.MimeTypeMap[keyof app_datasync_v1_data_sync_pb.MimeTypeMap], - extra?: google_protobuf_struct_pb.Struct.AsObject, - } -} - -export class UploadBinaryDataToDatasetResponse extends jspb.Message { - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): UploadBinaryDataToDatasetResponse.AsObject; - static toObject(includeInstance: boolean, msg: UploadBinaryDataToDatasetResponse): UploadBinaryDataToDatasetResponse.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: UploadBinaryDataToDatasetResponse, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): UploadBinaryDataToDatasetResponse; - static deserializeBinaryFromReader(message: UploadBinaryDataToDatasetResponse, reader: jspb.BinaryReader): UploadBinaryDataToDatasetResponse; -} - -export namespace UploadBinaryDataToDatasetResponse { - export type AsObject = { - } -} - diff --git a/gen/js/service/datamanager/v1/data_manager_pb.js b/gen/js/service/datamanager/v1/data_manager_pb.js index da9a9c4e5..e8e362084 100644 --- a/gen/js/service/datamanager/v1/data_manager_pb.js +++ b/gen/js/service/datamanager/v1/data_manager_pb.js @@ -15,8 +15,6 @@ var jspb = require('google-protobuf'); var goog = jspb; var global = (function() { return this || window || global || self || Function('return this')(); }).call(null); -var app_datasync_v1_data_sync_pb = require('../../../app/datasync/v1/data_sync_pb.js'); -goog.object.extend(proto, app_datasync_v1_data_sync_pb); var common_v1_common_pb = require('../../../common/v1/common_pb.js'); goog.object.extend(proto, common_v1_common_pb); var google_api_annotations_pb = require('../../../google/api/annotations_pb.js'); @@ -25,8 +23,6 @@ var google_protobuf_struct_pb = require('google-protobuf/google/protobuf/struct_ goog.object.extend(proto, google_protobuf_struct_pb); goog.exportSymbol('proto.viam.service.datamanager.v1.SyncRequest', null, global); goog.exportSymbol('proto.viam.service.datamanager.v1.SyncResponse', null, global); -goog.exportSymbol('proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest', null, global); -goog.exportSymbol('proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetResponse', null, global); /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a @@ -69,48 +65,6 @@ if (goog.DEBUG && !COMPILED) { */ proto.viam.service.datamanager.v1.SyncResponse.displayName = 'proto.viam.service.datamanager.v1.SyncResponse'; } -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest.repeatedFields_, null); -}; -goog.inherits(proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest.displayName = 'proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetResponse = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetResponse, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetResponse.displayName = 'proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetResponse'; -} @@ -393,475 +347,4 @@ proto.viam.service.datamanager.v1.SyncResponse.serializeBinaryToWriter = functio }; - -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest.repeatedFields_ = [3,4]; - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest.prototype.toObject = function(opt_includeInstance) { - return proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest.toObject = function(includeInstance, msg) { - var f, obj = { - name: jspb.Message.getFieldWithDefault(msg, 1, ""), - binaryData: msg.getBinaryData_asB64(), - tagsList: (f = jspb.Message.getRepeatedField(msg, 3)) == null ? undefined : f, - datasetIdsList: (f = jspb.Message.getRepeatedField(msg, 4)) == null ? undefined : f, - mimeType: jspb.Message.getFieldWithDefault(msg, 5, 0), - extra: (f = msg.getExtra()) && google_protobuf_struct_pb.Struct.toObject(includeInstance, f) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest} - */ -proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest; - return proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest} - */ -proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setName(value); - break; - case 2: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setBinaryData(value); - break; - case 3: - var value = /** @type {string} */ (reader.readString()); - msg.addTags(value); - break; - case 4: - var value = /** @type {string} */ (reader.readString()); - msg.addDatasetIds(value); - break; - case 5: - var value = /** @type {!proto.viam.app.datasync.v1.MimeType} */ (reader.readEnum()); - msg.setMimeType(value); - break; - case 99: - var value = new google_protobuf_struct_pb.Struct; - reader.readMessage(value,google_protobuf_struct_pb.Struct.deserializeBinaryFromReader); - msg.setExtra(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getName(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getBinaryData_asU8(); - if (f.length > 0) { - writer.writeBytes( - 2, - f - ); - } - f = message.getTagsList(); - if (f.length > 0) { - writer.writeRepeatedString( - 3, - f - ); - } - f = message.getDatasetIdsList(); - if (f.length > 0) { - writer.writeRepeatedString( - 4, - f - ); - } - f = message.getMimeType(); - if (f !== 0.0) { - writer.writeEnum( - 5, - f - ); - } - f = message.getExtra(); - if (f != null) { - writer.writeMessage( - 99, - f, - google_protobuf_struct_pb.Struct.serializeBinaryToWriter - ); - } -}; - - -/** - * optional string name = 1; - * @return {string} - */ -proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest.prototype.getName = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest} returns this - */ -proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest.prototype.setName = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional bytes binary_data = 2; - * @return {string} - */ -proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest.prototype.getBinaryData = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * optional bytes binary_data = 2; - * This is a type-conversion wrapper around `getBinaryData()` - * @return {string} - */ -proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest.prototype.getBinaryData_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getBinaryData())); -}; - - -/** - * optional bytes binary_data = 2; - * Note that Uint8Array is not supported on all browsers. - * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getBinaryData()` - * @return {!Uint8Array} - */ -proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest.prototype.getBinaryData_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getBinaryData())); -}; - - -/** - * @param {!(string|Uint8Array)} value - * @return {!proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest} returns this - */ -proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest.prototype.setBinaryData = function(value) { - return jspb.Message.setProto3BytesField(this, 2, value); -}; - - -/** - * repeated string tags = 3; - * @return {!Array} - */ -proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest.prototype.getTagsList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 3)); -}; - - -/** - * @param {!Array} value - * @return {!proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest} returns this - */ -proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest.prototype.setTagsList = function(value) { - return jspb.Message.setField(this, 3, value || []); -}; - - -/** - * @param {string} value - * @param {number=} opt_index - * @return {!proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest} returns this - */ -proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest.prototype.addTags = function(value, opt_index) { - return jspb.Message.addToRepeatedField(this, 3, value, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest} returns this - */ -proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest.prototype.clearTagsList = function() { - return this.setTagsList([]); -}; - - -/** - * repeated string dataset_ids = 4; - * @return {!Array} - */ -proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest.prototype.getDatasetIdsList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 4)); -}; - - -/** - * @param {!Array} value - * @return {!proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest} returns this - */ -proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest.prototype.setDatasetIdsList = function(value) { - return jspb.Message.setField(this, 4, value || []); -}; - - -/** - * @param {string} value - * @param {number=} opt_index - * @return {!proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest} returns this - */ -proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest.prototype.addDatasetIds = function(value, opt_index) { - return jspb.Message.addToRepeatedField(this, 4, value, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest} returns this - */ -proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest.prototype.clearDatasetIdsList = function() { - return this.setDatasetIdsList([]); -}; - - -/** - * optional viam.app.datasync.v1.MimeType mime_type = 5; - * @return {!proto.viam.app.datasync.v1.MimeType} - */ -proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest.prototype.getMimeType = function() { - return /** @type {!proto.viam.app.datasync.v1.MimeType} */ (jspb.Message.getFieldWithDefault(this, 5, 0)); -}; - - -/** - * @param {!proto.viam.app.datasync.v1.MimeType} value - * @return {!proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest} returns this - */ -proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest.prototype.setMimeType = function(value) { - return jspb.Message.setProto3EnumField(this, 5, value); -}; - - -/** - * optional google.protobuf.Struct extra = 99; - * @return {?proto.google.protobuf.Struct} - */ -proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest.prototype.getExtra = function() { - return /** @type{?proto.google.protobuf.Struct} */ ( - jspb.Message.getWrapperField(this, google_protobuf_struct_pb.Struct, 99)); -}; - - -/** - * @param {?proto.google.protobuf.Struct|undefined} value - * @return {!proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest} returns this -*/ -proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest.prototype.setExtra = function(value) { - return jspb.Message.setWrapperField(this, 99, value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest} returns this - */ -proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest.prototype.clearExtra = function() { - return this.setExtra(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest.prototype.hasExtra = function() { - return jspb.Message.getField(this, 99) != null; -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetResponse.prototype.toObject = function(opt_includeInstance) { - return proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetResponse.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetResponse} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetResponse.toObject = function(includeInstance, msg) { - var f, obj = { - - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetResponse} - */ -proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetResponse.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetResponse; - return proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetResponse.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetResponse} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetResponse} - */ -proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetResponse.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetResponse.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetResponse.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetResponse} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetResponse.serializeBinaryToWriter = function(message, writer) { - var f = undefined; -}; - - goog.object.extend(exports, proto.viam.service.datamanager.v1); diff --git a/gen/js/service/datamanager/v1/data_manager_pb_service.d.ts b/gen/js/service/datamanager/v1/data_manager_pb_service.d.ts index 61c84e4bc..b997e8c87 100644 --- a/gen/js/service/datamanager/v1/data_manager_pb_service.d.ts +++ b/gen/js/service/datamanager/v1/data_manager_pb_service.d.ts @@ -23,20 +23,10 @@ type DataManagerServiceDoCommand = { readonly responseType: typeof common_v1_common_pb.DoCommandResponse; }; -type DataManagerServiceUploadBinaryDataToDataset = { - readonly methodName: string; - readonly service: typeof DataManagerService; - readonly requestStream: false; - readonly responseStream: false; - readonly requestType: typeof service_datamanager_v1_data_manager_pb.UploadBinaryDataToDatasetRequest; - readonly responseType: typeof service_datamanager_v1_data_manager_pb.UploadBinaryDataToDatasetResponse; -}; - export class DataManagerService { static readonly serviceName: string; static readonly Sync: DataManagerServiceSync; static readonly DoCommand: DataManagerServiceDoCommand; - static readonly UploadBinaryDataToDataset: DataManagerServiceUploadBinaryDataToDataset; } export type ServiceError = { message: string, code: number; metadata: grpc.Metadata } @@ -89,14 +79,5 @@ export class DataManagerServiceClient { requestMessage: common_v1_common_pb.DoCommandRequest, callback: (error: ServiceError|null, responseMessage: common_v1_common_pb.DoCommandResponse|null) => void ): UnaryResponse; - uploadBinaryDataToDataset( - requestMessage: service_datamanager_v1_data_manager_pb.UploadBinaryDataToDatasetRequest, - metadata: grpc.Metadata, - callback: (error: ServiceError|null, responseMessage: service_datamanager_v1_data_manager_pb.UploadBinaryDataToDatasetResponse|null) => void - ): UnaryResponse; - uploadBinaryDataToDataset( - requestMessage: service_datamanager_v1_data_manager_pb.UploadBinaryDataToDatasetRequest, - callback: (error: ServiceError|null, responseMessage: service_datamanager_v1_data_manager_pb.UploadBinaryDataToDatasetResponse|null) => void - ): UnaryResponse; } diff --git a/gen/js/service/datamanager/v1/data_manager_pb_service.js b/gen/js/service/datamanager/v1/data_manager_pb_service.js index 8dba9a409..508c4a4f1 100644 --- a/gen/js/service/datamanager/v1/data_manager_pb_service.js +++ b/gen/js/service/datamanager/v1/data_manager_pb_service.js @@ -29,15 +29,6 @@ DataManagerService.DoCommand = { responseType: common_v1_common_pb.DoCommandResponse }; -DataManagerService.UploadBinaryDataToDataset = { - methodName: "UploadBinaryDataToDataset", - service: DataManagerService, - requestStream: false, - responseStream: false, - requestType: service_datamanager_v1_data_manager_pb.UploadBinaryDataToDatasetRequest, - responseType: service_datamanager_v1_data_manager_pb.UploadBinaryDataToDatasetResponse -}; - exports.DataManagerService = DataManagerService; function DataManagerServiceClient(serviceHost, options) { @@ -107,36 +98,5 @@ DataManagerServiceClient.prototype.doCommand = function doCommand(requestMessage }; }; -DataManagerServiceClient.prototype.uploadBinaryDataToDataset = function uploadBinaryDataToDataset(requestMessage, metadata, callback) { - if (arguments.length === 2) { - callback = arguments[1]; - } - var client = grpc.unary(DataManagerService.UploadBinaryDataToDataset, { - request: requestMessage, - host: this.serviceHost, - metadata: metadata, - transport: this.options.transport, - debug: this.options.debug, - onEnd: function (response) { - if (callback) { - if (response.status !== grpc.Code.OK) { - var err = new Error(response.statusMessage); - err.code = response.status; - err.metadata = response.trailers; - callback(err, null); - } else { - callback(null, response.message); - } - } - } - }); - return { - cancel: function () { - callback = null; - client.close(); - } - }; -}; - exports.DataManagerServiceClient = DataManagerServiceClient; diff --git a/service/datamanager/v1/data_manager.pb.go b/service/datamanager/v1/data_manager.pb.go index 41d1de6f8..af8e5bda0 100644 --- a/service/datamanager/v1/data_manager.pb.go +++ b/service/datamanager/v1/data_manager.pb.go @@ -7,8 +7,7 @@ package v1 import ( - v1 "go.viam.com/api/app/datasync/v1" - v11 "go.viam.com/api/common/v1" + v1 "go.viam.com/api/common/v1" _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" @@ -114,128 +113,6 @@ func (*SyncResponse) Descriptor() ([]byte, []int) { return file_service_datamanager_v1_data_manager_proto_rawDescGZIP(), []int{1} } -type UploadBinaryDataToDatasetRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - BinaryData []byte `protobuf:"bytes,2,opt,name=binary_data,json=binaryData,proto3" json:"binary_data,omitempty"` - Tags []string `protobuf:"bytes,3,rep,name=tags,proto3" json:"tags,omitempty"` - DatasetIds []string `protobuf:"bytes,4,rep,name=dataset_ids,json=datasetIds,proto3" json:"dataset_ids,omitempty"` - MimeType v1.MimeType `protobuf:"varint,5,opt,name=mime_type,json=mimeType,proto3,enum=viam.app.datasync.v1.MimeType" json:"mime_type,omitempty"` - // Additional arguments to the method - Extra *structpb.Struct `protobuf:"bytes,99,opt,name=extra,proto3" json:"extra,omitempty"` -} - -func (x *UploadBinaryDataToDatasetRequest) Reset() { - *x = UploadBinaryDataToDatasetRequest{} - mi := &file_service_datamanager_v1_data_manager_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *UploadBinaryDataToDatasetRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UploadBinaryDataToDatasetRequest) ProtoMessage() {} - -func (x *UploadBinaryDataToDatasetRequest) ProtoReflect() protoreflect.Message { - mi := &file_service_datamanager_v1_data_manager_proto_msgTypes[2] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UploadBinaryDataToDatasetRequest.ProtoReflect.Descriptor instead. -func (*UploadBinaryDataToDatasetRequest) Descriptor() ([]byte, []int) { - return file_service_datamanager_v1_data_manager_proto_rawDescGZIP(), []int{2} -} - -func (x *UploadBinaryDataToDatasetRequest) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *UploadBinaryDataToDatasetRequest) GetBinaryData() []byte { - if x != nil { - return x.BinaryData - } - return nil -} - -func (x *UploadBinaryDataToDatasetRequest) GetTags() []string { - if x != nil { - return x.Tags - } - return nil -} - -func (x *UploadBinaryDataToDatasetRequest) GetDatasetIds() []string { - if x != nil { - return x.DatasetIds - } - return nil -} - -func (x *UploadBinaryDataToDatasetRequest) GetMimeType() v1.MimeType { - if x != nil { - return x.MimeType - } - return v1.MimeType(0) -} - -func (x *UploadBinaryDataToDatasetRequest) GetExtra() *structpb.Struct { - if x != nil { - return x.Extra - } - return nil -} - -type UploadBinaryDataToDatasetResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *UploadBinaryDataToDatasetResponse) Reset() { - *x = UploadBinaryDataToDatasetResponse{} - mi := &file_service_datamanager_v1_data_manager_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *UploadBinaryDataToDatasetResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UploadBinaryDataToDatasetResponse) ProtoMessage() {} - -func (x *UploadBinaryDataToDatasetResponse) ProtoReflect() protoreflect.Message { - mi := &file_service_datamanager_v1_data_manager_proto_msgTypes[3] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UploadBinaryDataToDatasetResponse.ProtoReflect.Descriptor instead. -func (*UploadBinaryDataToDatasetResponse) Descriptor() ([]byte, []int) { - return file_service_datamanager_v1_data_manager_proto_rawDescGZIP(), []int{3} -} - var File_service_datamanager_v1_data_manager_proto protoreflect.FileDescriptor var file_service_datamanager_v1_data_manager_proto_rawDesc = []byte{ @@ -243,78 +120,43 @@ var file_service_datamanager_v1_data_manager_proto_rawDesc = []byte{ 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2f, 0x76, 0x31, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1b, 0x76, 0x69, 0x61, 0x6d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x6d, 0x61, - 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x1a, 0x1f, 0x61, 0x70, 0x70, 0x2f, 0x64, 0x61, - 0x74, 0x61, 0x73, 0x79, 0x6e, 0x63, 0x2f, 0x76, 0x31, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x73, - 0x79, 0x6e, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x16, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, - 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, - 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, - 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2f, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x50, 0x0a, - 0x0b, 0x53, 0x79, 0x6e, 0x63, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x12, 0x2d, 0x0a, 0x05, 0x65, 0x78, 0x74, 0x72, 0x61, 0x18, 0x63, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, 0x05, 0x65, 0x78, 0x74, 0x72, 0x61, 0x22, - 0x0e, 0x0a, 0x0c, 0x53, 0x79, 0x6e, 0x63, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0xf8, 0x01, 0x0a, 0x20, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x42, 0x69, 0x6e, 0x61, 0x72, 0x79, - 0x44, 0x61, 0x74, 0x61, 0x54, 0x6f, 0x44, 0x61, 0x74, 0x61, 0x73, 0x65, 0x74, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x62, 0x69, 0x6e, 0x61, - 0x72, 0x79, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x62, - 0x69, 0x6e, 0x61, 0x72, 0x79, 0x44, 0x61, 0x74, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x61, 0x67, - 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x74, 0x61, 0x67, 0x73, 0x12, 0x1f, 0x0a, - 0x0b, 0x64, 0x61, 0x74, 0x61, 0x73, 0x65, 0x74, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x04, 0x20, 0x03, - 0x28, 0x09, 0x52, 0x0a, 0x64, 0x61, 0x74, 0x61, 0x73, 0x65, 0x74, 0x49, 0x64, 0x73, 0x12, 0x3b, - 0x0a, 0x09, 0x6d, 0x69, 0x6d, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x0e, 0x32, 0x1e, 0x2e, 0x76, 0x69, 0x61, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x64, 0x61, 0x74, - 0x61, 0x73, 0x79, 0x6e, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x69, 0x6d, 0x65, 0x54, 0x79, 0x70, - 0x65, 0x52, 0x08, 0x6d, 0x69, 0x6d, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x2d, 0x0a, 0x05, 0x65, - 0x78, 0x74, 0x72, 0x61, 0x18, 0x63, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, - 0x75, 0x63, 0x74, 0x52, 0x05, 0x65, 0x78, 0x74, 0x72, 0x61, 0x22, 0x23, 0x0a, 0x21, 0x55, 0x70, - 0x6c, 0x6f, 0x61, 0x64, 0x42, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x44, 0x61, 0x74, 0x61, 0x54, 0x6f, - 0x44, 0x61, 0x74, 0x61, 0x73, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, - 0xa7, 0x04, 0x0a, 0x12, 0x44, 0x61, 0x74, 0x61, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x53, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x95, 0x01, 0x0a, 0x04, 0x53, 0x79, 0x6e, 0x63, 0x12, - 0x28, 0x2e, 0x76, 0x69, 0x61, 0x6d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x64, - 0x61, 0x74, 0x61, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x79, - 0x6e, 0x63, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x76, 0x69, 0x61, 0x6d, - 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x6d, 0x61, 0x6e, - 0x61, 0x67, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x38, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x32, 0x22, 0x30, 0x2f, 0x76, - 0x69, 0x61, 0x6d, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2f, 0x7b, - 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x73, 0x79, 0x6e, 0x63, 0x12, 0x8c, - 0x01, 0x0a, 0x09, 0x44, 0x6f, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x20, 0x2e, 0x76, - 0x69, 0x61, 0x6d, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x6f, - 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, - 0x2e, 0x76, 0x69, 0x61, 0x6d, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, - 0x44, 0x6f, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x3a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x34, 0x22, 0x32, 0x2f, 0x76, 0x69, 0x61, 0x6d, - 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, - 0x64, 0x61, 0x74, 0x61, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, - 0x65, 0x7d, 0x2f, 0x64, 0x6f, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0xe9, 0x01, - 0x0a, 0x19, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x42, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x44, 0x61, - 0x74, 0x61, 0x54, 0x6f, 0x44, 0x61, 0x74, 0x61, 0x73, 0x65, 0x74, 0x12, 0x3d, 0x2e, 0x76, 0x69, - 0x61, 0x6d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x6d, - 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, - 0x42, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x44, 0x61, 0x74, 0x61, 0x54, 0x6f, 0x44, 0x61, 0x74, 0x61, - 0x73, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3e, 0x2e, 0x76, 0x69, 0x61, - 0x6d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x6d, 0x61, - 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x42, - 0x69, 0x6e, 0x61, 0x72, 0x79, 0x44, 0x61, 0x74, 0x61, 0x54, 0x6f, 0x44, 0x61, 0x74, 0x61, 0x73, - 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x4d, 0x82, 0xd3, 0xe4, 0x93, - 0x02, 0x47, 0x22, 0x45, 0x2f, 0x76, 0x69, 0x61, 0x6d, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, - 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x6d, 0x61, 0x6e, - 0x61, 0x67, 0x65, 0x72, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x75, 0x70, 0x6c, 0x6f, - 0x61, 0x64, 0x5f, 0x62, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x74, - 0x6f, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x73, 0x65, 0x74, 0x42, 0x49, 0x0a, 0x1f, 0x63, 0x6f, 0x6d, + 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x1a, 0x16, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, + 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, + 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, + 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x50, 0x0a, 0x0b, + 0x53, 0x79, 0x6e, 0x63, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, + 0x2d, 0x0a, 0x05, 0x65, 0x78, 0x74, 0x72, 0x61, 0x18, 0x63, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, 0x05, 0x65, 0x78, 0x74, 0x72, 0x61, 0x22, 0x0e, + 0x0a, 0x0c, 0x53, 0x79, 0x6e, 0x63, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xbb, + 0x02, 0x0a, 0x12, 0x44, 0x61, 0x74, 0x61, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x95, 0x01, 0x0a, 0x04, 0x53, 0x79, 0x6e, 0x63, 0x12, 0x28, 0x2e, 0x76, 0x69, 0x61, 0x6d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x64, 0x61, - 0x74, 0x61, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x5a, 0x26, 0x67, 0x6f, - 0x2e, 0x76, 0x69, 0x61, 0x6d, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, - 0x72, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x74, 0x61, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x79, 0x6e, + 0x63, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x76, 0x69, 0x61, 0x6d, 0x2e, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x6d, 0x61, 0x6e, 0x61, + 0x67, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x38, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x32, 0x22, 0x30, 0x2f, 0x76, 0x69, + 0x61, 0x6d, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2f, 0x7b, 0x6e, + 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x73, 0x79, 0x6e, 0x63, 0x12, 0x8c, 0x01, + 0x0a, 0x09, 0x44, 0x6f, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x20, 0x2e, 0x76, 0x69, + 0x61, 0x6d, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x6f, 0x43, + 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, + 0x76, 0x69, 0x61, 0x6d, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x44, + 0x6f, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x3a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x34, 0x22, 0x32, 0x2f, 0x76, 0x69, 0x61, 0x6d, 0x2f, + 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x64, + 0x61, 0x74, 0x61, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, + 0x7d, 0x2f, 0x64, 0x6f, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x42, 0x49, 0x0a, 0x1f, + 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x69, 0x61, 0x6d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x2e, 0x64, 0x61, 0x74, 0x61, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x5a, + 0x26, 0x67, 0x6f, 0x2e, 0x76, 0x69, 0x61, 0x6d, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x70, 0x69, + 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x6d, 0x61, 0x6e, + 0x61, 0x67, 0x65, 0x72, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -329,32 +171,25 @@ func file_service_datamanager_v1_data_manager_proto_rawDescGZIP() []byte { return file_service_datamanager_v1_data_manager_proto_rawDescData } -var file_service_datamanager_v1_data_manager_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_service_datamanager_v1_data_manager_proto_msgTypes = make([]protoimpl.MessageInfo, 2) var file_service_datamanager_v1_data_manager_proto_goTypes = []any{ - (*SyncRequest)(nil), // 0: viam.service.datamanager.v1.SyncRequest - (*SyncResponse)(nil), // 1: viam.service.datamanager.v1.SyncResponse - (*UploadBinaryDataToDatasetRequest)(nil), // 2: viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest - (*UploadBinaryDataToDatasetResponse)(nil), // 3: viam.service.datamanager.v1.UploadBinaryDataToDatasetResponse - (*structpb.Struct)(nil), // 4: google.protobuf.Struct - (v1.MimeType)(0), // 5: viam.app.datasync.v1.MimeType - (*v11.DoCommandRequest)(nil), // 6: viam.common.v1.DoCommandRequest - (*v11.DoCommandResponse)(nil), // 7: viam.common.v1.DoCommandResponse + (*SyncRequest)(nil), // 0: viam.service.datamanager.v1.SyncRequest + (*SyncResponse)(nil), // 1: viam.service.datamanager.v1.SyncResponse + (*structpb.Struct)(nil), // 2: google.protobuf.Struct + (*v1.DoCommandRequest)(nil), // 3: viam.common.v1.DoCommandRequest + (*v1.DoCommandResponse)(nil), // 4: viam.common.v1.DoCommandResponse } var file_service_datamanager_v1_data_manager_proto_depIdxs = []int32{ - 4, // 0: viam.service.datamanager.v1.SyncRequest.extra:type_name -> google.protobuf.Struct - 5, // 1: viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest.mime_type:type_name -> viam.app.datasync.v1.MimeType - 4, // 2: viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest.extra:type_name -> google.protobuf.Struct - 0, // 3: viam.service.datamanager.v1.DataManagerService.Sync:input_type -> viam.service.datamanager.v1.SyncRequest - 6, // 4: viam.service.datamanager.v1.DataManagerService.DoCommand:input_type -> viam.common.v1.DoCommandRequest - 2, // 5: viam.service.datamanager.v1.DataManagerService.UploadBinaryDataToDataset:input_type -> viam.service.datamanager.v1.UploadBinaryDataToDatasetRequest - 1, // 6: viam.service.datamanager.v1.DataManagerService.Sync:output_type -> viam.service.datamanager.v1.SyncResponse - 7, // 7: viam.service.datamanager.v1.DataManagerService.DoCommand:output_type -> viam.common.v1.DoCommandResponse - 3, // 8: viam.service.datamanager.v1.DataManagerService.UploadBinaryDataToDataset:output_type -> viam.service.datamanager.v1.UploadBinaryDataToDatasetResponse - 6, // [6:9] is the sub-list for method output_type - 3, // [3:6] is the sub-list for method input_type - 3, // [3:3] is the sub-list for extension type_name - 3, // [3:3] is the sub-list for extension extendee - 0, // [0:3] is the sub-list for field type_name + 2, // 0: viam.service.datamanager.v1.SyncRequest.extra:type_name -> google.protobuf.Struct + 0, // 1: viam.service.datamanager.v1.DataManagerService.Sync:input_type -> viam.service.datamanager.v1.SyncRequest + 3, // 2: viam.service.datamanager.v1.DataManagerService.DoCommand:input_type -> viam.common.v1.DoCommandRequest + 1, // 3: viam.service.datamanager.v1.DataManagerService.Sync:output_type -> viam.service.datamanager.v1.SyncResponse + 4, // 4: viam.service.datamanager.v1.DataManagerService.DoCommand:output_type -> viam.common.v1.DoCommandResponse + 3, // [3:5] is the sub-list for method output_type + 1, // [1:3] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name } func init() { file_service_datamanager_v1_data_manager_proto_init() } @@ -368,7 +203,7 @@ func file_service_datamanager_v1_data_manager_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_service_datamanager_v1_data_manager_proto_rawDesc, NumEnums: 0, - NumMessages: 4, + NumMessages: 2, NumExtensions: 0, NumServices: 1, }, diff --git a/service/datamanager/v1/data_manager.pb.gw.go b/service/datamanager/v1/data_manager.pb.gw.go index 3ade9f8cc..a3065013b 100644 --- a/service/datamanager/v1/data_manager.pb.gw.go +++ b/service/datamanager/v1/data_manager.pb.gw.go @@ -15,7 +15,7 @@ import ( "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" - v1_1 "go.viam.com/api/common/v1" + "go.viam.com/api/common/v1" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/grpclog" @@ -107,7 +107,7 @@ var ( ) func request_DataManagerService_DoCommand_0(ctx context.Context, marshaler runtime.Marshaler, client DataManagerServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1_1.DoCommandRequest + var protoReq v1.DoCommandRequest var metadata runtime.ServerMetadata var ( @@ -140,7 +140,7 @@ func request_DataManagerService_DoCommand_0(ctx context.Context, marshaler runti } func local_request_DataManagerService_DoCommand_0(ctx context.Context, marshaler runtime.Marshaler, server DataManagerServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1_1.DoCommandRequest + var protoReq v1.DoCommandRequest var metadata runtime.ServerMetadata var ( @@ -172,76 +172,6 @@ func local_request_DataManagerService_DoCommand_0(ctx context.Context, marshaler } -var ( - filter_DataManagerService_UploadBinaryDataToDataset_0 = &utilities.DoubleArray{Encoding: map[string]int{"name": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} -) - -func request_DataManagerService_UploadBinaryDataToDataset_0(ctx context.Context, marshaler runtime.Marshaler, client DataManagerServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq UploadBinaryDataToDatasetRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["name"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") - } - - protoReq.Name, err = runtime.String(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_DataManagerService_UploadBinaryDataToDataset_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.UploadBinaryDataToDataset(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_DataManagerService_UploadBinaryDataToDataset_0(ctx context.Context, marshaler runtime.Marshaler, server DataManagerServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq UploadBinaryDataToDatasetRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["name"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") - } - - protoReq.Name, err = runtime.String(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_DataManagerService_UploadBinaryDataToDataset_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.UploadBinaryDataToDataset(ctx, &protoReq) - return msg, metadata, err - -} - // RegisterDataManagerServiceHandlerServer registers the http handlers for service DataManagerService to "mux". // UnaryRPC :call DataManagerServiceServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -298,31 +228,6 @@ func RegisterDataManagerServiceHandlerServer(ctx context.Context, mux *runtime.S }) - mux.Handle("POST", pattern_DataManagerService_UploadBinaryDataToDataset_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/viam.service.datamanager.v1.DataManagerService/UploadBinaryDataToDataset", runtime.WithHTTPPathPattern("/viam/api/v1/service/datamanager/{name}/upload_binary_data_to_dataset")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_DataManagerService_UploadBinaryDataToDataset_0(annotatedContext, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_DataManagerService_UploadBinaryDataToDataset_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - return nil } @@ -408,28 +313,6 @@ func RegisterDataManagerServiceHandlerClient(ctx context.Context, mux *runtime.S }) - mux.Handle("POST", pattern_DataManagerService_UploadBinaryDataToDataset_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - var err error - var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/viam.service.datamanager.v1.DataManagerService/UploadBinaryDataToDataset", runtime.WithHTTPPathPattern("/viam/api/v1/service/datamanager/{name}/upload_binary_data_to_dataset")) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_DataManagerService_UploadBinaryDataToDataset_0(annotatedContext, inboundMarshaler, client, req, pathParams) - annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) - if err != nil { - runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) - return - } - - forward_DataManagerService_UploadBinaryDataToDataset_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - return nil } @@ -437,14 +320,10 @@ var ( pattern_DataManagerService_Sync_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5, 2, 6}, []string{"viam", "api", "v1", "service", "datamanager", "name", "datasync"}, "")) pattern_DataManagerService_DoCommand_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5, 2, 6}, []string{"viam", "api", "v1", "service", "datamanager", "name", "do_command"}, "")) - - pattern_DataManagerService_UploadBinaryDataToDataset_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5, 2, 6}, []string{"viam", "api", "v1", "service", "datamanager", "name", "upload_binary_data_to_dataset"}, "")) ) var ( forward_DataManagerService_Sync_0 = runtime.ForwardResponseMessage forward_DataManagerService_DoCommand_0 = runtime.ForwardResponseMessage - - forward_DataManagerService_UploadBinaryDataToDataset_0 = runtime.ForwardResponseMessage ) diff --git a/service/datamanager/v1/data_manager_grpc.pb.go b/service/datamanager/v1/data_manager_grpc.pb.go index 70ac24b8d..b9ef91c7e 100644 --- a/service/datamanager/v1/data_manager_grpc.pb.go +++ b/service/datamanager/v1/data_manager_grpc.pb.go @@ -27,8 +27,6 @@ type DataManagerServiceClient interface { Sync(ctx context.Context, in *SyncRequest, opts ...grpc.CallOption) (*SyncResponse, error) // DoCommand sends/receives arbitrary commands DoCommand(ctx context.Context, in *v1.DoCommandRequest, opts ...grpc.CallOption) (*v1.DoCommandResponse, error) - // UploadBinaryDataToDataset uploads binary data to a dataset. - UploadBinaryDataToDataset(ctx context.Context, in *UploadBinaryDataToDatasetRequest, opts ...grpc.CallOption) (*UploadBinaryDataToDatasetResponse, error) } type dataManagerServiceClient struct { @@ -57,15 +55,6 @@ func (c *dataManagerServiceClient) DoCommand(ctx context.Context, in *v1.DoComma return out, nil } -func (c *dataManagerServiceClient) UploadBinaryDataToDataset(ctx context.Context, in *UploadBinaryDataToDatasetRequest, opts ...grpc.CallOption) (*UploadBinaryDataToDatasetResponse, error) { - out := new(UploadBinaryDataToDatasetResponse) - err := c.cc.Invoke(ctx, "/viam.service.datamanager.v1.DataManagerService/UploadBinaryDataToDataset", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - // DataManagerServiceServer is the server API for DataManagerService service. // All implementations must embed UnimplementedDataManagerServiceServer // for forward compatibility @@ -74,8 +63,6 @@ type DataManagerServiceServer interface { Sync(context.Context, *SyncRequest) (*SyncResponse, error) // DoCommand sends/receives arbitrary commands DoCommand(context.Context, *v1.DoCommandRequest) (*v1.DoCommandResponse, error) - // UploadBinaryDataToDataset uploads binary data to a dataset. - UploadBinaryDataToDataset(context.Context, *UploadBinaryDataToDatasetRequest) (*UploadBinaryDataToDatasetResponse, error) mustEmbedUnimplementedDataManagerServiceServer() } @@ -89,9 +76,6 @@ func (UnimplementedDataManagerServiceServer) Sync(context.Context, *SyncRequest) func (UnimplementedDataManagerServiceServer) DoCommand(context.Context, *v1.DoCommandRequest) (*v1.DoCommandResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method DoCommand not implemented") } -func (UnimplementedDataManagerServiceServer) UploadBinaryDataToDataset(context.Context, *UploadBinaryDataToDatasetRequest) (*UploadBinaryDataToDatasetResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UploadBinaryDataToDataset not implemented") -} func (UnimplementedDataManagerServiceServer) mustEmbedUnimplementedDataManagerServiceServer() {} // UnsafeDataManagerServiceServer may be embedded to opt out of forward compatibility for this service. @@ -141,24 +125,6 @@ func _DataManagerService_DoCommand_Handler(srv interface{}, ctx context.Context, return interceptor(ctx, in, info, handler) } -func _DataManagerService_UploadBinaryDataToDataset_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UploadBinaryDataToDatasetRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(DataManagerServiceServer).UploadBinaryDataToDataset(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/viam.service.datamanager.v1.DataManagerService/UploadBinaryDataToDataset", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DataManagerServiceServer).UploadBinaryDataToDataset(ctx, req.(*UploadBinaryDataToDatasetRequest)) - } - return interceptor(ctx, in, info, handler) -} - // DataManagerService_ServiceDesc is the grpc.ServiceDesc for DataManagerService service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -174,10 +140,6 @@ var DataManagerService_ServiceDesc = grpc.ServiceDesc{ MethodName: "DoCommand", Handler: _DataManagerService_DoCommand_Handler, }, - { - MethodName: "UploadBinaryDataToDataset", - Handler: _DataManagerService_UploadBinaryDataToDataset_Handler, - }, }, Streams: []grpc.StreamDesc{}, Metadata: "service/datamanager/v1/data_manager.proto", From e44b5523b2035c4af2aa95b9125b8e8db4618723 Mon Sep 17 00:00:00 2001 From: Tahiya Salam Date: Mon, 21 Jul 2025 13:36:39 -0400 Subject: [PATCH 5/6] Change from dataset to datasets --- proto/viam/service/datamanager/v1/data_manager.proto | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/proto/viam/service/datamanager/v1/data_manager.proto b/proto/viam/service/datamanager/v1/data_manager.proto index fcc61b4b5..d596402fd 100644 --- a/proto/viam/service/datamanager/v1/data_manager.proto +++ b/proto/viam/service/datamanager/v1/data_manager.proto @@ -22,9 +22,9 @@ service DataManagerService { option (google.api.http) = {post: "/viam/api/v1/service/datamanager/{name}/do_command"}; } - // UploadBinaryDataToDataset uploads binary data to a dataset. - rpc UploadBinaryDataToDataset(UploadBinaryDataToDatasetRequest) returns (UploadBinaryDataToDatasetResponse) { - option (google.api.http) = {post: "/viam/api/v1/service/datamanager/{name}/upload_binary_data_to_dataset"}; + // UploadBinaryDataToDatasets uploads binary data to specified datasets. + rpc UploadBinaryDataToDatasets(UploadBinaryDataToDatasetsRequest) returns (UploadBinaryDataToDatasetsResponse) { + option (google.api.http) = {post: "/viam/api/v1/service/datamanager/{name}/upload_binary_data_to_datasets"}; } } @@ -36,7 +36,7 @@ message SyncRequest { message SyncResponse {} -message UploadBinaryDataToDatasetRequest { +message UploadBinaryDataToDatasetsRequest { string name = 1; bytes binary_data = 2; repeated string tags = 3; @@ -46,4 +46,4 @@ message UploadBinaryDataToDatasetRequest { google.protobuf.Struct extra = 99; } -message UploadBinaryDataToDatasetResponse {} +message UploadBinaryDataToDatasetsResponse {} From 8f2cfc307b6e95c65f3ae4be6f5a63cd17884e0c Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 19 Aug 2025 19:11:56 +0000 Subject: [PATCH 6/6] Built new protos from dba69e1 --- .../v1/data_manager_grpc_web_pb.js | 63 +++ .../datamanager/v1/data_manager_pb.d.ts | 65 +++ .../service/datamanager/v1/data_manager_pb.js | 517 ++++++++++++++++++ .../v1/data_manager_pb_service.d.ts | 19 + .../datamanager/v1/data_manager_pb_service.js | 40 ++ service/datamanager/v1/data_manager.pb.go | 272 +++++++-- service/datamanager/v1/data_manager.pb.gw.go | 127 ++++- .../datamanager/v1/data_manager_grpc.pb.go | 38 ++ 8 files changed, 1085 insertions(+), 56 deletions(-) diff --git a/gen/js/service/datamanager/v1/data_manager_grpc_web_pb.js b/gen/js/service/datamanager/v1/data_manager_grpc_web_pb.js index 04f875e29..19fa67881 100644 --- a/gen/js/service/datamanager/v1/data_manager_grpc_web_pb.js +++ b/gen/js/service/datamanager/v1/data_manager_grpc_web_pb.js @@ -20,6 +20,8 @@ const grpc = {}; grpc.web = require('grpc-web'); +var app_datasync_v1_data_sync_pb = require('../../../app/datasync/v1/data_sync_pb.js') + var common_v1_common_pb = require('../../../common/v1/common_pb.js') var google_api_annotations_pb = require('../../../google/api/annotations_pb.js') @@ -205,5 +207,66 @@ proto.viam.service.datamanager.v1.DataManagerServicePromiseClient.prototype.doCo }; +/** + * @const + * @type {!grpc.web.MethodDescriptor< + * !proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetsRequest, + * !proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetsResponse>} + */ +const methodDescriptor_DataManagerService_UploadBinaryDataToDatasets = new grpc.web.MethodDescriptor( + '/viam.service.datamanager.v1.DataManagerService/UploadBinaryDataToDatasets', + grpc.web.MethodType.UNARY, + proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetsRequest, + proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetsResponse, + /** + * @param {!proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetsRequest} request + * @return {!Uint8Array} + */ + function(request) { + return request.serializeBinary(); + }, + proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetsResponse.deserializeBinary +); + + +/** + * @param {!proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetsRequest} request The + * request proto + * @param {?Object} metadata User defined + * call metadata + * @param {function(?grpc.web.RpcError, ?proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetsResponse)} + * callback The callback function(error, response) + * @return {!grpc.web.ClientReadableStream|undefined} + * The XHR Node Readable Stream + */ +proto.viam.service.datamanager.v1.DataManagerServiceClient.prototype.uploadBinaryDataToDatasets = + function(request, metadata, callback) { + return this.client_.rpcCall(this.hostname_ + + '/viam.service.datamanager.v1.DataManagerService/UploadBinaryDataToDatasets', + request, + metadata || {}, + methodDescriptor_DataManagerService_UploadBinaryDataToDatasets, + callback); +}; + + +/** + * @param {!proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetsRequest} request The + * request proto + * @param {?Object=} metadata User defined + * call metadata + * @return {!Promise} + * Promise that resolves to the response + */ +proto.viam.service.datamanager.v1.DataManagerServicePromiseClient.prototype.uploadBinaryDataToDatasets = + function(request, metadata) { + return this.client_.unaryCall(this.hostname_ + + '/viam.service.datamanager.v1.DataManagerService/UploadBinaryDataToDatasets', + request, + metadata || {}, + methodDescriptor_DataManagerService_UploadBinaryDataToDatasets); +}; + + module.exports = proto.viam.service.datamanager.v1; diff --git a/gen/js/service/datamanager/v1/data_manager_pb.d.ts b/gen/js/service/datamanager/v1/data_manager_pb.d.ts index dfa03dbb5..3edd5f01f 100644 --- a/gen/js/service/datamanager/v1/data_manager_pb.d.ts +++ b/gen/js/service/datamanager/v1/data_manager_pb.d.ts @@ -2,6 +2,7 @@ // file: service/datamanager/v1/data_manager.proto import * as jspb from "google-protobuf"; +import * as app_datasync_v1_data_sync_pb from "../../../app/datasync/v1/data_sync_pb"; import * as common_v1_common_pb from "../../../common/v1/common_pb"; import * as google_api_annotations_pb from "../../../google/api/annotations_pb"; import * as google_protobuf_struct_pb from "google-protobuf/google/protobuf/struct_pb"; @@ -48,3 +49,67 @@ export namespace SyncResponse { } } +export class UploadBinaryDataToDatasetsRequest extends jspb.Message { + getName(): string; + setName(value: string): void; + + getBinaryData(): Uint8Array | string; + getBinaryData_asU8(): Uint8Array; + getBinaryData_asB64(): string; + setBinaryData(value: Uint8Array | string): void; + + clearTagsList(): void; + getTagsList(): Array; + setTagsList(value: Array): void; + addTags(value: string, index?: number): string; + + clearDatasetIdsList(): void; + getDatasetIdsList(): Array; + setDatasetIdsList(value: Array): void; + addDatasetIds(value: string, index?: number): string; + + getMimeType(): app_datasync_v1_data_sync_pb.MimeTypeMap[keyof app_datasync_v1_data_sync_pb.MimeTypeMap]; + setMimeType(value: app_datasync_v1_data_sync_pb.MimeTypeMap[keyof app_datasync_v1_data_sync_pb.MimeTypeMap]): void; + + hasExtra(): boolean; + clearExtra(): void; + getExtra(): google_protobuf_struct_pb.Struct | undefined; + setExtra(value?: google_protobuf_struct_pb.Struct): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): UploadBinaryDataToDatasetsRequest.AsObject; + static toObject(includeInstance: boolean, msg: UploadBinaryDataToDatasetsRequest): UploadBinaryDataToDatasetsRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: UploadBinaryDataToDatasetsRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): UploadBinaryDataToDatasetsRequest; + static deserializeBinaryFromReader(message: UploadBinaryDataToDatasetsRequest, reader: jspb.BinaryReader): UploadBinaryDataToDatasetsRequest; +} + +export namespace UploadBinaryDataToDatasetsRequest { + export type AsObject = { + name: string, + binaryData: Uint8Array | string, + tagsList: Array, + datasetIdsList: Array, + mimeType: app_datasync_v1_data_sync_pb.MimeTypeMap[keyof app_datasync_v1_data_sync_pb.MimeTypeMap], + extra?: google_protobuf_struct_pb.Struct.AsObject, + } +} + +export class UploadBinaryDataToDatasetsResponse extends jspb.Message { + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): UploadBinaryDataToDatasetsResponse.AsObject; + static toObject(includeInstance: boolean, msg: UploadBinaryDataToDatasetsResponse): UploadBinaryDataToDatasetsResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: UploadBinaryDataToDatasetsResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): UploadBinaryDataToDatasetsResponse; + static deserializeBinaryFromReader(message: UploadBinaryDataToDatasetsResponse, reader: jspb.BinaryReader): UploadBinaryDataToDatasetsResponse; +} + +export namespace UploadBinaryDataToDatasetsResponse { + export type AsObject = { + } +} + diff --git a/gen/js/service/datamanager/v1/data_manager_pb.js b/gen/js/service/datamanager/v1/data_manager_pb.js index e8e362084..500c0d5cc 100644 --- a/gen/js/service/datamanager/v1/data_manager_pb.js +++ b/gen/js/service/datamanager/v1/data_manager_pb.js @@ -15,6 +15,8 @@ var jspb = require('google-protobuf'); var goog = jspb; var global = (function() { return this || window || global || self || Function('return this')(); }).call(null); +var app_datasync_v1_data_sync_pb = require('../../../app/datasync/v1/data_sync_pb.js'); +goog.object.extend(proto, app_datasync_v1_data_sync_pb); var common_v1_common_pb = require('../../../common/v1/common_pb.js'); goog.object.extend(proto, common_v1_common_pb); var google_api_annotations_pb = require('../../../google/api/annotations_pb.js'); @@ -23,6 +25,8 @@ var google_protobuf_struct_pb = require('google-protobuf/google/protobuf/struct_ goog.object.extend(proto, google_protobuf_struct_pb); goog.exportSymbol('proto.viam.service.datamanager.v1.SyncRequest', null, global); goog.exportSymbol('proto.viam.service.datamanager.v1.SyncResponse', null, global); +goog.exportSymbol('proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetsRequest', null, global); +goog.exportSymbol('proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetsResponse', null, global); /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a @@ -65,6 +69,48 @@ if (goog.DEBUG && !COMPILED) { */ proto.viam.service.datamanager.v1.SyncResponse.displayName = 'proto.viam.service.datamanager.v1.SyncResponse'; } +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetsRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetsRequest.repeatedFields_, null); +}; +goog.inherits(proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetsRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetsRequest.displayName = 'proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetsRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetsResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetsResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetsResponse.displayName = 'proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetsResponse'; +} @@ -347,4 +393,475 @@ proto.viam.service.datamanager.v1.SyncResponse.serializeBinaryToWriter = functio }; + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetsRequest.repeatedFields_ = [3,4]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetsRequest.prototype.toObject = function(opt_includeInstance) { + return proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetsRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetsRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetsRequest.toObject = function(includeInstance, msg) { + var f, obj = { + name: jspb.Message.getFieldWithDefault(msg, 1, ""), + binaryData: msg.getBinaryData_asB64(), + tagsList: (f = jspb.Message.getRepeatedField(msg, 3)) == null ? undefined : f, + datasetIdsList: (f = jspb.Message.getRepeatedField(msg, 4)) == null ? undefined : f, + mimeType: jspb.Message.getFieldWithDefault(msg, 5, 0), + extra: (f = msg.getExtra()) && google_protobuf_struct_pb.Struct.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetsRequest} + */ +proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetsRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetsRequest; + return proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetsRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetsRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetsRequest} + */ +proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetsRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setName(value); + break; + case 2: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setBinaryData(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.addTags(value); + break; + case 4: + var value = /** @type {string} */ (reader.readString()); + msg.addDatasetIds(value); + break; + case 5: + var value = /** @type {!proto.viam.app.datasync.v1.MimeType} */ (reader.readEnum()); + msg.setMimeType(value); + break; + case 99: + var value = new google_protobuf_struct_pb.Struct; + reader.readMessage(value,google_protobuf_struct_pb.Struct.deserializeBinaryFromReader); + msg.setExtra(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetsRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetsRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetsRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetsRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getName(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getBinaryData_asU8(); + if (f.length > 0) { + writer.writeBytes( + 2, + f + ); + } + f = message.getTagsList(); + if (f.length > 0) { + writer.writeRepeatedString( + 3, + f + ); + } + f = message.getDatasetIdsList(); + if (f.length > 0) { + writer.writeRepeatedString( + 4, + f + ); + } + f = message.getMimeType(); + if (f !== 0.0) { + writer.writeEnum( + 5, + f + ); + } + f = message.getExtra(); + if (f != null) { + writer.writeMessage( + 99, + f, + google_protobuf_struct_pb.Struct.serializeBinaryToWriter + ); + } +}; + + +/** + * optional string name = 1; + * @return {string} + */ +proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetsRequest.prototype.getName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetsRequest} returns this + */ +proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetsRequest.prototype.setName = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional bytes binary_data = 2; + * @return {string} + */ +proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetsRequest.prototype.getBinaryData = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * optional bytes binary_data = 2; + * This is a type-conversion wrapper around `getBinaryData()` + * @return {string} + */ +proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetsRequest.prototype.getBinaryData_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getBinaryData())); +}; + + +/** + * optional bytes binary_data = 2; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getBinaryData()` + * @return {!Uint8Array} + */ +proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetsRequest.prototype.getBinaryData_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getBinaryData())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetsRequest} returns this + */ +proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetsRequest.prototype.setBinaryData = function(value) { + return jspb.Message.setProto3BytesField(this, 2, value); +}; + + +/** + * repeated string tags = 3; + * @return {!Array} + */ +proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetsRequest.prototype.getTagsList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 3)); +}; + + +/** + * @param {!Array} value + * @return {!proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetsRequest} returns this + */ +proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetsRequest.prototype.setTagsList = function(value) { + return jspb.Message.setField(this, 3, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetsRequest} returns this + */ +proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetsRequest.prototype.addTags = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 3, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetsRequest} returns this + */ +proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetsRequest.prototype.clearTagsList = function() { + return this.setTagsList([]); +}; + + +/** + * repeated string dataset_ids = 4; + * @return {!Array} + */ +proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetsRequest.prototype.getDatasetIdsList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 4)); +}; + + +/** + * @param {!Array} value + * @return {!proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetsRequest} returns this + */ +proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetsRequest.prototype.setDatasetIdsList = function(value) { + return jspb.Message.setField(this, 4, value || []); +}; + + +/** + * @param {string} value + * @param {number=} opt_index + * @return {!proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetsRequest} returns this + */ +proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetsRequest.prototype.addDatasetIds = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 4, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetsRequest} returns this + */ +proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetsRequest.prototype.clearDatasetIdsList = function() { + return this.setDatasetIdsList([]); +}; + + +/** + * optional viam.app.datasync.v1.MimeType mime_type = 5; + * @return {!proto.viam.app.datasync.v1.MimeType} + */ +proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetsRequest.prototype.getMimeType = function() { + return /** @type {!proto.viam.app.datasync.v1.MimeType} */ (jspb.Message.getFieldWithDefault(this, 5, 0)); +}; + + +/** + * @param {!proto.viam.app.datasync.v1.MimeType} value + * @return {!proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetsRequest} returns this + */ +proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetsRequest.prototype.setMimeType = function(value) { + return jspb.Message.setProto3EnumField(this, 5, value); +}; + + +/** + * optional google.protobuf.Struct extra = 99; + * @return {?proto.google.protobuf.Struct} + */ +proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetsRequest.prototype.getExtra = function() { + return /** @type{?proto.google.protobuf.Struct} */ ( + jspb.Message.getWrapperField(this, google_protobuf_struct_pb.Struct, 99)); +}; + + +/** + * @param {?proto.google.protobuf.Struct|undefined} value + * @return {!proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetsRequest} returns this +*/ +proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetsRequest.prototype.setExtra = function(value) { + return jspb.Message.setWrapperField(this, 99, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetsRequest} returns this + */ +proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetsRequest.prototype.clearExtra = function() { + return this.setExtra(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetsRequest.prototype.hasExtra = function() { + return jspb.Message.getField(this, 99) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetsResponse.prototype.toObject = function(opt_includeInstance) { + return proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetsResponse.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetsResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetsResponse.toObject = function(includeInstance, msg) { + var f, obj = { + + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetsResponse} + */ +proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetsResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetsResponse; + return proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetsResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetsResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetsResponse} + */ +proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetsResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetsResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetsResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetsResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.viam.service.datamanager.v1.UploadBinaryDataToDatasetsResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; +}; + + goog.object.extend(exports, proto.viam.service.datamanager.v1); diff --git a/gen/js/service/datamanager/v1/data_manager_pb_service.d.ts b/gen/js/service/datamanager/v1/data_manager_pb_service.d.ts index b997e8c87..a83d80ccb 100644 --- a/gen/js/service/datamanager/v1/data_manager_pb_service.d.ts +++ b/gen/js/service/datamanager/v1/data_manager_pb_service.d.ts @@ -23,10 +23,20 @@ type DataManagerServiceDoCommand = { readonly responseType: typeof common_v1_common_pb.DoCommandResponse; }; +type DataManagerServiceUploadBinaryDataToDatasets = { + readonly methodName: string; + readonly service: typeof DataManagerService; + readonly requestStream: false; + readonly responseStream: false; + readonly requestType: typeof service_datamanager_v1_data_manager_pb.UploadBinaryDataToDatasetsRequest; + readonly responseType: typeof service_datamanager_v1_data_manager_pb.UploadBinaryDataToDatasetsResponse; +}; + export class DataManagerService { static readonly serviceName: string; static readonly Sync: DataManagerServiceSync; static readonly DoCommand: DataManagerServiceDoCommand; + static readonly UploadBinaryDataToDatasets: DataManagerServiceUploadBinaryDataToDatasets; } export type ServiceError = { message: string, code: number; metadata: grpc.Metadata } @@ -79,5 +89,14 @@ export class DataManagerServiceClient { requestMessage: common_v1_common_pb.DoCommandRequest, callback: (error: ServiceError|null, responseMessage: common_v1_common_pb.DoCommandResponse|null) => void ): UnaryResponse; + uploadBinaryDataToDatasets( + requestMessage: service_datamanager_v1_data_manager_pb.UploadBinaryDataToDatasetsRequest, + metadata: grpc.Metadata, + callback: (error: ServiceError|null, responseMessage: service_datamanager_v1_data_manager_pb.UploadBinaryDataToDatasetsResponse|null) => void + ): UnaryResponse; + uploadBinaryDataToDatasets( + requestMessage: service_datamanager_v1_data_manager_pb.UploadBinaryDataToDatasetsRequest, + callback: (error: ServiceError|null, responseMessage: service_datamanager_v1_data_manager_pb.UploadBinaryDataToDatasetsResponse|null) => void + ): UnaryResponse; } diff --git a/gen/js/service/datamanager/v1/data_manager_pb_service.js b/gen/js/service/datamanager/v1/data_manager_pb_service.js index 508c4a4f1..a0ce6a77c 100644 --- a/gen/js/service/datamanager/v1/data_manager_pb_service.js +++ b/gen/js/service/datamanager/v1/data_manager_pb_service.js @@ -29,6 +29,15 @@ DataManagerService.DoCommand = { responseType: common_v1_common_pb.DoCommandResponse }; +DataManagerService.UploadBinaryDataToDatasets = { + methodName: "UploadBinaryDataToDatasets", + service: DataManagerService, + requestStream: false, + responseStream: false, + requestType: service_datamanager_v1_data_manager_pb.UploadBinaryDataToDatasetsRequest, + responseType: service_datamanager_v1_data_manager_pb.UploadBinaryDataToDatasetsResponse +}; + exports.DataManagerService = DataManagerService; function DataManagerServiceClient(serviceHost, options) { @@ -98,5 +107,36 @@ DataManagerServiceClient.prototype.doCommand = function doCommand(requestMessage }; }; +DataManagerServiceClient.prototype.uploadBinaryDataToDatasets = function uploadBinaryDataToDatasets(requestMessage, metadata, callback) { + if (arguments.length === 2) { + callback = arguments[1]; + } + var client = grpc.unary(DataManagerService.UploadBinaryDataToDatasets, { + request: requestMessage, + host: this.serviceHost, + metadata: metadata, + transport: this.options.transport, + debug: this.options.debug, + onEnd: function (response) { + if (callback) { + if (response.status !== grpc.Code.OK) { + var err = new Error(response.statusMessage); + err.code = response.status; + err.metadata = response.trailers; + callback(err, null); + } else { + callback(null, response.message); + } + } + } + }); + return { + cancel: function () { + callback = null; + client.close(); + } + }; +}; + exports.DataManagerServiceClient = DataManagerServiceClient; diff --git a/service/datamanager/v1/data_manager.pb.go b/service/datamanager/v1/data_manager.pb.go index af8e5bda0..cb61e03e2 100644 --- a/service/datamanager/v1/data_manager.pb.go +++ b/service/datamanager/v1/data_manager.pb.go @@ -7,7 +7,8 @@ package v1 import ( - v1 "go.viam.com/api/common/v1" + v1 "go.viam.com/api/app/datasync/v1" + v11 "go.viam.com/api/common/v1" _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" @@ -113,6 +114,128 @@ func (*SyncResponse) Descriptor() ([]byte, []int) { return file_service_datamanager_v1_data_manager_proto_rawDescGZIP(), []int{1} } +type UploadBinaryDataToDatasetsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + BinaryData []byte `protobuf:"bytes,2,opt,name=binary_data,json=binaryData,proto3" json:"binary_data,omitempty"` + Tags []string `protobuf:"bytes,3,rep,name=tags,proto3" json:"tags,omitempty"` + DatasetIds []string `protobuf:"bytes,4,rep,name=dataset_ids,json=datasetIds,proto3" json:"dataset_ids,omitempty"` + MimeType v1.MimeType `protobuf:"varint,5,opt,name=mime_type,json=mimeType,proto3,enum=viam.app.datasync.v1.MimeType" json:"mime_type,omitempty"` + // Additional arguments to the method + Extra *structpb.Struct `protobuf:"bytes,99,opt,name=extra,proto3" json:"extra,omitempty"` +} + +func (x *UploadBinaryDataToDatasetsRequest) Reset() { + *x = UploadBinaryDataToDatasetsRequest{} + mi := &file_service_datamanager_v1_data_manager_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UploadBinaryDataToDatasetsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UploadBinaryDataToDatasetsRequest) ProtoMessage() {} + +func (x *UploadBinaryDataToDatasetsRequest) ProtoReflect() protoreflect.Message { + mi := &file_service_datamanager_v1_data_manager_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UploadBinaryDataToDatasetsRequest.ProtoReflect.Descriptor instead. +func (*UploadBinaryDataToDatasetsRequest) Descriptor() ([]byte, []int) { + return file_service_datamanager_v1_data_manager_proto_rawDescGZIP(), []int{2} +} + +func (x *UploadBinaryDataToDatasetsRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *UploadBinaryDataToDatasetsRequest) GetBinaryData() []byte { + if x != nil { + return x.BinaryData + } + return nil +} + +func (x *UploadBinaryDataToDatasetsRequest) GetTags() []string { + if x != nil { + return x.Tags + } + return nil +} + +func (x *UploadBinaryDataToDatasetsRequest) GetDatasetIds() []string { + if x != nil { + return x.DatasetIds + } + return nil +} + +func (x *UploadBinaryDataToDatasetsRequest) GetMimeType() v1.MimeType { + if x != nil { + return x.MimeType + } + return v1.MimeType(0) +} + +func (x *UploadBinaryDataToDatasetsRequest) GetExtra() *structpb.Struct { + if x != nil { + return x.Extra + } + return nil +} + +type UploadBinaryDataToDatasetsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *UploadBinaryDataToDatasetsResponse) Reset() { + *x = UploadBinaryDataToDatasetsResponse{} + mi := &file_service_datamanager_v1_data_manager_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UploadBinaryDataToDatasetsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UploadBinaryDataToDatasetsResponse) ProtoMessage() {} + +func (x *UploadBinaryDataToDatasetsResponse) ProtoReflect() protoreflect.Message { + mi := &file_service_datamanager_v1_data_manager_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UploadBinaryDataToDatasetsResponse.ProtoReflect.Descriptor instead. +func (*UploadBinaryDataToDatasetsResponse) Descriptor() ([]byte, []int) { + return file_service_datamanager_v1_data_manager_proto_rawDescGZIP(), []int{3} +} + var File_service_datamanager_v1_data_manager_proto protoreflect.FileDescriptor var file_service_datamanager_v1_data_manager_proto_rawDesc = []byte{ @@ -120,43 +243,79 @@ var file_service_datamanager_v1_data_manager_proto_rawDesc = []byte{ 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2f, 0x76, 0x31, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1b, 0x76, 0x69, 0x61, 0x6d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x6d, 0x61, - 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x1a, 0x16, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, - 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, - 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, - 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x50, 0x0a, 0x0b, - 0x53, 0x79, 0x6e, 0x63, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, - 0x2d, 0x0a, 0x05, 0x65, 0x78, 0x74, 0x72, 0x61, 0x18, 0x63, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, 0x05, 0x65, 0x78, 0x74, 0x72, 0x61, 0x22, 0x0e, - 0x0a, 0x0c, 0x53, 0x79, 0x6e, 0x63, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xbb, - 0x02, 0x0a, 0x12, 0x44, 0x61, 0x74, 0x61, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x53, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x95, 0x01, 0x0a, 0x04, 0x53, 0x79, 0x6e, 0x63, 0x12, 0x28, - 0x2e, 0x76, 0x69, 0x61, 0x6d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x64, 0x61, - 0x74, 0x61, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x79, 0x6e, - 0x63, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x76, 0x69, 0x61, 0x6d, 0x2e, - 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x6d, 0x61, 0x6e, 0x61, - 0x67, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x38, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x32, 0x22, 0x30, 0x2f, 0x76, 0x69, + 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x1a, 0x1f, 0x61, 0x70, 0x70, 0x2f, 0x64, 0x61, + 0x74, 0x61, 0x73, 0x79, 0x6e, 0x63, 0x2f, 0x76, 0x31, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x73, + 0x79, 0x6e, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x16, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, + 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, + 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2f, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x50, 0x0a, + 0x0b, 0x53, 0x79, 0x6e, 0x63, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x12, 0x2d, 0x0a, 0x05, 0x65, 0x78, 0x74, 0x72, 0x61, 0x18, 0x63, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x52, 0x05, 0x65, 0x78, 0x74, 0x72, 0x61, 0x22, + 0x0e, 0x0a, 0x0c, 0x53, 0x79, 0x6e, 0x63, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0xf9, 0x01, 0x0a, 0x21, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x42, 0x69, 0x6e, 0x61, 0x72, 0x79, + 0x44, 0x61, 0x74, 0x61, 0x54, 0x6f, 0x44, 0x61, 0x74, 0x61, 0x73, 0x65, 0x74, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x62, 0x69, 0x6e, + 0x61, 0x72, 0x79, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, + 0x62, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x44, 0x61, 0x74, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x61, + 0x67, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x74, 0x61, 0x67, 0x73, 0x12, 0x1f, + 0x0a, 0x0b, 0x64, 0x61, 0x74, 0x61, 0x73, 0x65, 0x74, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x04, 0x20, + 0x03, 0x28, 0x09, 0x52, 0x0a, 0x64, 0x61, 0x74, 0x61, 0x73, 0x65, 0x74, 0x49, 0x64, 0x73, 0x12, + 0x3b, 0x0a, 0x09, 0x6d, 0x69, 0x6d, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x0e, 0x32, 0x1e, 0x2e, 0x76, 0x69, 0x61, 0x6d, 0x2e, 0x61, 0x70, 0x70, 0x2e, 0x64, 0x61, + 0x74, 0x61, 0x73, 0x79, 0x6e, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x69, 0x6d, 0x65, 0x54, 0x79, + 0x70, 0x65, 0x52, 0x08, 0x6d, 0x69, 0x6d, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x2d, 0x0a, 0x05, + 0x65, 0x78, 0x74, 0x72, 0x61, 0x18, 0x63, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, + 0x72, 0x75, 0x63, 0x74, 0x52, 0x05, 0x65, 0x78, 0x74, 0x72, 0x61, 0x22, 0x24, 0x0a, 0x22, 0x55, + 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x42, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x44, 0x61, 0x74, 0x61, 0x54, + 0x6f, 0x44, 0x61, 0x74, 0x61, 0x73, 0x65, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x32, 0xab, 0x04, 0x0a, 0x12, 0x44, 0x61, 0x74, 0x61, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, + 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x95, 0x01, 0x0a, 0x04, 0x53, 0x79, 0x6e, + 0x63, 0x12, 0x28, 0x2e, 0x76, 0x69, 0x61, 0x6d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x2e, 0x64, 0x61, 0x74, 0x61, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, + 0x53, 0x79, 0x6e, 0x63, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x76, 0x69, + 0x61, 0x6d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x6d, + 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x38, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x32, 0x22, 0x30, + 0x2f, 0x76, 0x69, 0x61, 0x6d, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, + 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x73, 0x79, 0x6e, 0x63, + 0x12, 0x8c, 0x01, 0x0a, 0x09, 0x44, 0x6f, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x20, + 0x2e, 0x76, 0x69, 0x61, 0x6d, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, + 0x44, 0x6f, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x21, 0x2e, 0x76, 0x69, 0x61, 0x6d, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, + 0x31, 0x2e, 0x44, 0x6f, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x3a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x34, 0x22, 0x32, 0x2f, 0x76, 0x69, 0x61, 0x6d, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2f, 0x7b, 0x6e, - 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x73, 0x79, 0x6e, 0x63, 0x12, 0x8c, 0x01, - 0x0a, 0x09, 0x44, 0x6f, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x20, 0x2e, 0x76, 0x69, - 0x61, 0x6d, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x6f, 0x43, - 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, - 0x76, 0x69, 0x61, 0x6d, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x44, - 0x6f, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x3a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x34, 0x22, 0x32, 0x2f, 0x76, 0x69, 0x61, 0x6d, 0x2f, - 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x64, - 0x61, 0x74, 0x61, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, - 0x7d, 0x2f, 0x64, 0x6f, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x42, 0x49, 0x0a, 0x1f, - 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x69, 0x61, 0x6d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x2e, 0x64, 0x61, 0x74, 0x61, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x5a, - 0x26, 0x67, 0x6f, 0x2e, 0x76, 0x69, 0x61, 0x6d, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x70, 0x69, - 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x64, 0x61, 0x74, 0x61, 0x6d, 0x61, 0x6e, - 0x61, 0x67, 0x65, 0x72, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x61, 0x6d, 0x65, 0x7d, 0x2f, 0x64, 0x6f, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, + 0xed, 0x01, 0x0a, 0x1a, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x42, 0x69, 0x6e, 0x61, 0x72, 0x79, + 0x44, 0x61, 0x74, 0x61, 0x54, 0x6f, 0x44, 0x61, 0x74, 0x61, 0x73, 0x65, 0x74, 0x73, 0x12, 0x3e, + 0x2e, 0x76, 0x69, 0x61, 0x6d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x64, 0x61, + 0x74, 0x61, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x6c, + 0x6f, 0x61, 0x64, 0x42, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x44, 0x61, 0x74, 0x61, 0x54, 0x6f, 0x44, + 0x61, 0x74, 0x61, 0x73, 0x65, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3f, + 0x2e, 0x76, 0x69, 0x61, 0x6d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x64, 0x61, + 0x74, 0x61, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x6c, + 0x6f, 0x61, 0x64, 0x42, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x44, 0x61, 0x74, 0x61, 0x54, 0x6f, 0x44, + 0x61, 0x74, 0x61, 0x73, 0x65, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x4e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x48, 0x22, 0x46, 0x2f, 0x76, 0x69, 0x61, 0x6d, 0x2f, 0x61, + 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x64, 0x61, + 0x74, 0x61, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x7d, + 0x2f, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x62, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x5f, 0x64, + 0x61, 0x74, 0x61, 0x5f, 0x74, 0x6f, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x73, 0x65, 0x74, 0x73, 0x42, + 0x49, 0x0a, 0x1f, 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x69, 0x61, 0x6d, 0x2e, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, + 0x76, 0x31, 0x5a, 0x26, 0x67, 0x6f, 0x2e, 0x76, 0x69, 0x61, 0x6d, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x61, 0x70, 0x69, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x64, 0x61, 0x74, 0x61, + 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( @@ -171,25 +330,32 @@ func file_service_datamanager_v1_data_manager_proto_rawDescGZIP() []byte { return file_service_datamanager_v1_data_manager_proto_rawDescData } -var file_service_datamanager_v1_data_manager_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_service_datamanager_v1_data_manager_proto_msgTypes = make([]protoimpl.MessageInfo, 4) var file_service_datamanager_v1_data_manager_proto_goTypes = []any{ - (*SyncRequest)(nil), // 0: viam.service.datamanager.v1.SyncRequest - (*SyncResponse)(nil), // 1: viam.service.datamanager.v1.SyncResponse - (*structpb.Struct)(nil), // 2: google.protobuf.Struct - (*v1.DoCommandRequest)(nil), // 3: viam.common.v1.DoCommandRequest - (*v1.DoCommandResponse)(nil), // 4: viam.common.v1.DoCommandResponse + (*SyncRequest)(nil), // 0: viam.service.datamanager.v1.SyncRequest + (*SyncResponse)(nil), // 1: viam.service.datamanager.v1.SyncResponse + (*UploadBinaryDataToDatasetsRequest)(nil), // 2: viam.service.datamanager.v1.UploadBinaryDataToDatasetsRequest + (*UploadBinaryDataToDatasetsResponse)(nil), // 3: viam.service.datamanager.v1.UploadBinaryDataToDatasetsResponse + (*structpb.Struct)(nil), // 4: google.protobuf.Struct + (v1.MimeType)(0), // 5: viam.app.datasync.v1.MimeType + (*v11.DoCommandRequest)(nil), // 6: viam.common.v1.DoCommandRequest + (*v11.DoCommandResponse)(nil), // 7: viam.common.v1.DoCommandResponse } var file_service_datamanager_v1_data_manager_proto_depIdxs = []int32{ - 2, // 0: viam.service.datamanager.v1.SyncRequest.extra:type_name -> google.protobuf.Struct - 0, // 1: viam.service.datamanager.v1.DataManagerService.Sync:input_type -> viam.service.datamanager.v1.SyncRequest - 3, // 2: viam.service.datamanager.v1.DataManagerService.DoCommand:input_type -> viam.common.v1.DoCommandRequest - 1, // 3: viam.service.datamanager.v1.DataManagerService.Sync:output_type -> viam.service.datamanager.v1.SyncResponse - 4, // 4: viam.service.datamanager.v1.DataManagerService.DoCommand:output_type -> viam.common.v1.DoCommandResponse - 3, // [3:5] is the sub-list for method output_type - 1, // [1:3] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name + 4, // 0: viam.service.datamanager.v1.SyncRequest.extra:type_name -> google.protobuf.Struct + 5, // 1: viam.service.datamanager.v1.UploadBinaryDataToDatasetsRequest.mime_type:type_name -> viam.app.datasync.v1.MimeType + 4, // 2: viam.service.datamanager.v1.UploadBinaryDataToDatasetsRequest.extra:type_name -> google.protobuf.Struct + 0, // 3: viam.service.datamanager.v1.DataManagerService.Sync:input_type -> viam.service.datamanager.v1.SyncRequest + 6, // 4: viam.service.datamanager.v1.DataManagerService.DoCommand:input_type -> viam.common.v1.DoCommandRequest + 2, // 5: viam.service.datamanager.v1.DataManagerService.UploadBinaryDataToDatasets:input_type -> viam.service.datamanager.v1.UploadBinaryDataToDatasetsRequest + 1, // 6: viam.service.datamanager.v1.DataManagerService.Sync:output_type -> viam.service.datamanager.v1.SyncResponse + 7, // 7: viam.service.datamanager.v1.DataManagerService.DoCommand:output_type -> viam.common.v1.DoCommandResponse + 3, // 8: viam.service.datamanager.v1.DataManagerService.UploadBinaryDataToDatasets:output_type -> viam.service.datamanager.v1.UploadBinaryDataToDatasetsResponse + 6, // [6:9] is the sub-list for method output_type + 3, // [3:6] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name } func init() { file_service_datamanager_v1_data_manager_proto_init() } @@ -203,7 +369,7 @@ func file_service_datamanager_v1_data_manager_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_service_datamanager_v1_data_manager_proto_rawDesc, NumEnums: 0, - NumMessages: 2, + NumMessages: 4, NumExtensions: 0, NumServices: 1, }, diff --git a/service/datamanager/v1/data_manager.pb.gw.go b/service/datamanager/v1/data_manager.pb.gw.go index a3065013b..1c838e55d 100644 --- a/service/datamanager/v1/data_manager.pb.gw.go +++ b/service/datamanager/v1/data_manager.pb.gw.go @@ -15,7 +15,7 @@ import ( "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" - "go.viam.com/api/common/v1" + v1_1 "go.viam.com/api/common/v1" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/grpclog" @@ -107,7 +107,7 @@ var ( ) func request_DataManagerService_DoCommand_0(ctx context.Context, marshaler runtime.Marshaler, client DataManagerServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1.DoCommandRequest + var protoReq v1_1.DoCommandRequest var metadata runtime.ServerMetadata var ( @@ -140,7 +140,7 @@ func request_DataManagerService_DoCommand_0(ctx context.Context, marshaler runti } func local_request_DataManagerService_DoCommand_0(ctx context.Context, marshaler runtime.Marshaler, server DataManagerServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq v1.DoCommandRequest + var protoReq v1_1.DoCommandRequest var metadata runtime.ServerMetadata var ( @@ -172,6 +172,76 @@ func local_request_DataManagerService_DoCommand_0(ctx context.Context, marshaler } +var ( + filter_DataManagerService_UploadBinaryDataToDatasets_0 = &utilities.DoubleArray{Encoding: map[string]int{"name": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + +func request_DataManagerService_UploadBinaryDataToDatasets_0(ctx context.Context, marshaler runtime.Marshaler, client DataManagerServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq UploadBinaryDataToDatasetsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") + } + + protoReq.Name, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_DataManagerService_UploadBinaryDataToDatasets_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.UploadBinaryDataToDatasets(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_DataManagerService_UploadBinaryDataToDatasets_0(ctx context.Context, marshaler runtime.Marshaler, server DataManagerServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq UploadBinaryDataToDatasetsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") + } + + protoReq.Name, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_DataManagerService_UploadBinaryDataToDatasets_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.UploadBinaryDataToDatasets(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterDataManagerServiceHandlerServer registers the http handlers for service DataManagerService to "mux". // UnaryRPC :call DataManagerServiceServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -228,6 +298,31 @@ func RegisterDataManagerServiceHandlerServer(ctx context.Context, mux *runtime.S }) + mux.Handle("POST", pattern_DataManagerService_UploadBinaryDataToDatasets_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/viam.service.datamanager.v1.DataManagerService/UploadBinaryDataToDatasets", runtime.WithHTTPPathPattern("/viam/api/v1/service/datamanager/{name}/upload_binary_data_to_datasets")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_DataManagerService_UploadBinaryDataToDatasets_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_DataManagerService_UploadBinaryDataToDatasets_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -313,6 +408,28 @@ func RegisterDataManagerServiceHandlerClient(ctx context.Context, mux *runtime.S }) + mux.Handle("POST", pattern_DataManagerService_UploadBinaryDataToDatasets_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/viam.service.datamanager.v1.DataManagerService/UploadBinaryDataToDatasets", runtime.WithHTTPPathPattern("/viam/api/v1/service/datamanager/{name}/upload_binary_data_to_datasets")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_DataManagerService_UploadBinaryDataToDatasets_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_DataManagerService_UploadBinaryDataToDatasets_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -320,10 +437,14 @@ var ( pattern_DataManagerService_Sync_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5, 2, 6}, []string{"viam", "api", "v1", "service", "datamanager", "name", "datasync"}, "")) pattern_DataManagerService_DoCommand_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5, 2, 6}, []string{"viam", "api", "v1", "service", "datamanager", "name", "do_command"}, "")) + + pattern_DataManagerService_UploadBinaryDataToDatasets_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5, 2, 6}, []string{"viam", "api", "v1", "service", "datamanager", "name", "upload_binary_data_to_datasets"}, "")) ) var ( forward_DataManagerService_Sync_0 = runtime.ForwardResponseMessage forward_DataManagerService_DoCommand_0 = runtime.ForwardResponseMessage + + forward_DataManagerService_UploadBinaryDataToDatasets_0 = runtime.ForwardResponseMessage ) diff --git a/service/datamanager/v1/data_manager_grpc.pb.go b/service/datamanager/v1/data_manager_grpc.pb.go index b9ef91c7e..9bac68e35 100644 --- a/service/datamanager/v1/data_manager_grpc.pb.go +++ b/service/datamanager/v1/data_manager_grpc.pb.go @@ -27,6 +27,8 @@ type DataManagerServiceClient interface { Sync(ctx context.Context, in *SyncRequest, opts ...grpc.CallOption) (*SyncResponse, error) // DoCommand sends/receives arbitrary commands DoCommand(ctx context.Context, in *v1.DoCommandRequest, opts ...grpc.CallOption) (*v1.DoCommandResponse, error) + // UploadBinaryDataToDatasets uploads binary data to specified datasets. + UploadBinaryDataToDatasets(ctx context.Context, in *UploadBinaryDataToDatasetsRequest, opts ...grpc.CallOption) (*UploadBinaryDataToDatasetsResponse, error) } type dataManagerServiceClient struct { @@ -55,6 +57,15 @@ func (c *dataManagerServiceClient) DoCommand(ctx context.Context, in *v1.DoComma return out, nil } +func (c *dataManagerServiceClient) UploadBinaryDataToDatasets(ctx context.Context, in *UploadBinaryDataToDatasetsRequest, opts ...grpc.CallOption) (*UploadBinaryDataToDatasetsResponse, error) { + out := new(UploadBinaryDataToDatasetsResponse) + err := c.cc.Invoke(ctx, "/viam.service.datamanager.v1.DataManagerService/UploadBinaryDataToDatasets", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // DataManagerServiceServer is the server API for DataManagerService service. // All implementations must embed UnimplementedDataManagerServiceServer // for forward compatibility @@ -63,6 +74,8 @@ type DataManagerServiceServer interface { Sync(context.Context, *SyncRequest) (*SyncResponse, error) // DoCommand sends/receives arbitrary commands DoCommand(context.Context, *v1.DoCommandRequest) (*v1.DoCommandResponse, error) + // UploadBinaryDataToDatasets uploads binary data to specified datasets. + UploadBinaryDataToDatasets(context.Context, *UploadBinaryDataToDatasetsRequest) (*UploadBinaryDataToDatasetsResponse, error) mustEmbedUnimplementedDataManagerServiceServer() } @@ -76,6 +89,9 @@ func (UnimplementedDataManagerServiceServer) Sync(context.Context, *SyncRequest) func (UnimplementedDataManagerServiceServer) DoCommand(context.Context, *v1.DoCommandRequest) (*v1.DoCommandResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method DoCommand not implemented") } +func (UnimplementedDataManagerServiceServer) UploadBinaryDataToDatasets(context.Context, *UploadBinaryDataToDatasetsRequest) (*UploadBinaryDataToDatasetsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UploadBinaryDataToDatasets not implemented") +} func (UnimplementedDataManagerServiceServer) mustEmbedUnimplementedDataManagerServiceServer() {} // UnsafeDataManagerServiceServer may be embedded to opt out of forward compatibility for this service. @@ -125,6 +141,24 @@ func _DataManagerService_DoCommand_Handler(srv interface{}, ctx context.Context, return interceptor(ctx, in, info, handler) } +func _DataManagerService_UploadBinaryDataToDatasets_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UploadBinaryDataToDatasetsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DataManagerServiceServer).UploadBinaryDataToDatasets(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/viam.service.datamanager.v1.DataManagerService/UploadBinaryDataToDatasets", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DataManagerServiceServer).UploadBinaryDataToDatasets(ctx, req.(*UploadBinaryDataToDatasetsRequest)) + } + return interceptor(ctx, in, info, handler) +} + // DataManagerService_ServiceDesc is the grpc.ServiceDesc for DataManagerService service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -140,6 +174,10 @@ var DataManagerService_ServiceDesc = grpc.ServiceDesc{ MethodName: "DoCommand", Handler: _DataManagerService_DoCommand_Handler, }, + { + MethodName: "UploadBinaryDataToDatasets", + Handler: _DataManagerService_UploadBinaryDataToDatasets_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "service/datamanager/v1/data_manager.proto",