Skip to content

RSDK-10559 Add optional_dependencies field to ValidateConfigResponse #685

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions gen/js/module/v1/module_pb.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,11 @@ export class ValidateConfigResponse extends jspb.Message {
setDependenciesList(value: Array<string>): void;
addDependencies(value: string, index?: number): string;

clearOptionalDependenciesList(): void;
getOptionalDependenciesList(): Array<string>;
setOptionalDependenciesList(value: Array<string>): void;
addOptionalDependencies(value: string, index?: number): string;

serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): ValidateConfigResponse.AsObject;
static toObject(includeInstance: boolean, msg: ValidateConfigResponse): ValidateConfigResponse.AsObject;
Expand All @@ -274,6 +279,7 @@ export class ValidateConfigResponse extends jspb.Message {
export namespace ValidateConfigResponse {
export type AsObject = {
dependenciesList: Array<string>,
optionalDependenciesList: Array<string>,
}
}

53 changes: 51 additions & 2 deletions gen/js/module/v1/module_pb.js
Original file line number Diff line number Diff line change
Expand Up @@ -2025,7 +2025,7 @@ proto.viam.module.v1.ValidateConfigRequest.prototype.hasConfig = function() {
* @private {!Array<number>}
* @const
*/
proto.viam.module.v1.ValidateConfigResponse.repeatedFields_ = [1];
proto.viam.module.v1.ValidateConfigResponse.repeatedFields_ = [1,2];



Expand Down Expand Up @@ -2058,7 +2058,8 @@ proto.viam.module.v1.ValidateConfigResponse.prototype.toObject = function(opt_in
*/
proto.viam.module.v1.ValidateConfigResponse.toObject = function(includeInstance, msg) {
var f, obj = {
dependenciesList: (f = jspb.Message.getRepeatedField(msg, 1)) == null ? undefined : f
dependenciesList: (f = jspb.Message.getRepeatedField(msg, 1)) == null ? undefined : f,
optionalDependenciesList: (f = jspb.Message.getRepeatedField(msg, 2)) == null ? undefined : f
};

if (includeInstance) {
Expand Down Expand Up @@ -2099,6 +2100,10 @@ proto.viam.module.v1.ValidateConfigResponse.deserializeBinaryFromReader = functi
var value = /** @type {string} */ (reader.readString());
msg.addDependencies(value);
break;
case 2:
var value = /** @type {string} */ (reader.readString());
msg.addOptionalDependencies(value);
break;
default:
reader.skipField();
break;
Expand Down Expand Up @@ -2135,6 +2140,13 @@ proto.viam.module.v1.ValidateConfigResponse.serializeBinaryToWriter = function(m
f
);
}
f = message.getOptionalDependenciesList();
if (f.length > 0) {
writer.writeRepeatedString(
2,
f
);
}
};


Expand Down Expand Up @@ -2175,4 +2187,41 @@ proto.viam.module.v1.ValidateConfigResponse.prototype.clearDependenciesList = fu
};


/**
* repeated string optional_dependencies = 2;
* @return {!Array<string>}
*/
proto.viam.module.v1.ValidateConfigResponse.prototype.getOptionalDependenciesList = function() {
return /** @type {!Array<string>} */ (jspb.Message.getRepeatedField(this, 2));
};


/**
* @param {!Array<string>} value
* @return {!proto.viam.module.v1.ValidateConfigResponse} returns this
*/
proto.viam.module.v1.ValidateConfigResponse.prototype.setOptionalDependenciesList = function(value) {
return jspb.Message.setField(this, 2, value || []);
};


/**
* @param {string} value
* @param {number=} opt_index
* @return {!proto.viam.module.v1.ValidateConfigResponse} returns this
*/
proto.viam.module.v1.ValidateConfigResponse.prototype.addOptionalDependencies = function(value, opt_index) {
return jspb.Message.addToRepeatedField(this, 2, value, opt_index);
};


/**
* Clears the list making it empty but non-null.
* @return {!proto.viam.module.v1.ValidateConfigResponse} returns this
*/
proto.viam.module.v1.ValidateConfigResponse.prototype.clearOptionalDependenciesList = function() {
return this.setOptionalDependenciesList([]);
};


goog.object.extend(exports, proto.viam.module.v1);
83 changes: 47 additions & 36 deletions module/v1/module.pb.go

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

8 changes: 4 additions & 4 deletions module/v1/module_grpc.pb.go

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

5 changes: 3 additions & 2 deletions proto/viam/module/v1/module.proto
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ service ModuleService {
// Ready determines if the server is started and ready to recieve resource configurations.
rpc Ready(ReadyRequest) returns (ReadyResponse);

// ValidateConfig determines whether the given config is valid and registers/returns implicit
// dependencies.
// ValidateConfig determines whether the given config is valid and registers/returns
// both required and optional implicit dependencies.
rpc ValidateConfig(ValidateConfigRequest) returns (ValidateConfigResponse);
}

Expand Down Expand Up @@ -68,4 +68,5 @@ message ValidateConfigRequest {

message ValidateConfigResponse {
repeated string dependencies = 1;
repeated string optional_dependencies = 2;
}