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/proto/viam/service/datamanager/v1/data_manager.proto b/proto/viam/service/datamanager/v1/data_manager.proto index f357120ae..d596402fd 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,11 @@ service DataManagerService { rpc DoCommand(common.v1.DoCommandRequest) returns (common.v1.DoCommandResponse) { option (google.api.http) = {post: "/viam/api/v1/service/datamanager/{name}/do_command"}; } + + // 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"}; + } } message SyncRequest { @@ -29,3 +35,15 @@ message SyncRequest { } message SyncResponse {} + +message UploadBinaryDataToDatasetsRequest { + 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 UploadBinaryDataToDatasetsResponse {} 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",