You've already forked npm-core-sdk
Latest generation
This commit is contained in:
81
resource.ts
81
resource.ts
@@ -12,23 +12,7 @@ import type { PartialMessage } from "@protobuf-ts/runtime";
|
||||
import { reflectionMergePartial } from "@protobuf-ts/runtime";
|
||||
import { MessageType } from "@protobuf-ts/runtime";
|
||||
import { ResourceType } from "./shared";
|
||||
/**
|
||||
* @generated from protobuf message api.Resource
|
||||
*/
|
||||
export interface Resource {
|
||||
/**
|
||||
* @generated from protobuf field: string ID = 1
|
||||
*/
|
||||
ID: string;
|
||||
/**
|
||||
* @generated from protobuf field: api.ResourceType Type = 2
|
||||
*/
|
||||
Type: ResourceType;
|
||||
/**
|
||||
* @generated from protobuf field: string ParentID = 3
|
||||
*/
|
||||
ParentID: string;
|
||||
}
|
||||
import { Resource } from "./shared";
|
||||
/**
|
||||
* @generated from protobuf message api.CreateResourceRequest
|
||||
*/
|
||||
@@ -102,69 +86,6 @@ export interface CleanResourceRequest {
|
||||
export interface CleanResourceResult {
|
||||
}
|
||||
// @generated message type with reflection information, may provide speed optimized methods
|
||||
class Resource$Type extends MessageType<Resource> {
|
||||
constructor() {
|
||||
super("api.Resource", [
|
||||
{ no: 1, name: "ID", kind: "scalar", localName: "ID", jsonName: "ID", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } },
|
||||
{ no: 2, name: "Type", kind: "enum", localName: "Type", jsonName: "Type", T: () => ["api.ResourceType", ResourceType], options: { "validate.rules": { enum: { definedOnly: true } } } },
|
||||
{ no: 3, name: "ParentID", kind: "scalar", localName: "ParentID", jsonName: "ParentID", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } }
|
||||
], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["ID", "Type", "ParentId"] } } });
|
||||
}
|
||||
create(value?: PartialMessage<Resource>): Resource {
|
||||
const message = globalThis.Object.create((this.messagePrototype!));
|
||||
message.ID = "";
|
||||
message.Type = 0;
|
||||
message.ParentID = "";
|
||||
if (value !== undefined)
|
||||
reflectionMergePartial<Resource>(this, message, value);
|
||||
return message;
|
||||
}
|
||||
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Resource): Resource {
|
||||
let message = target ?? this.create(), end = reader.pos + length;
|
||||
while (reader.pos < end) {
|
||||
let [fieldNo, wireType] = reader.tag();
|
||||
switch (fieldNo) {
|
||||
case /* string ID */ 1:
|
||||
message.ID = reader.string();
|
||||
break;
|
||||
case /* api.ResourceType Type */ 2:
|
||||
message.Type = reader.int32();
|
||||
break;
|
||||
case /* string ParentID */ 3:
|
||||
message.ParentID = reader.string();
|
||||
break;
|
||||
default:
|
||||
let u = options.readUnknownField;
|
||||
if (u === "throw")
|
||||
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
||||
let d = reader.skip(wireType);
|
||||
if (u !== false)
|
||||
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
internalBinaryWrite(message: Resource, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
||||
/* string ID = 1; */
|
||||
if (message.ID !== "")
|
||||
writer.tag(1, WireType.LengthDelimited).string(message.ID);
|
||||
/* api.ResourceType Type = 2; */
|
||||
if (message.Type !== 0)
|
||||
writer.tag(2, WireType.Varint).int32(message.Type);
|
||||
/* string ParentID = 3; */
|
||||
if (message.ParentID !== "")
|
||||
writer.tag(3, WireType.LengthDelimited).string(message.ParentID);
|
||||
let u = options.writeUnknownFields;
|
||||
if (u !== false)
|
||||
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
||||
return writer;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @generated MessageType for protobuf message api.Resource
|
||||
*/
|
||||
export const Resource = new Resource$Type();
|
||||
// @generated message type with reflection information, may provide speed optimized methods
|
||||
class CreateResourceRequest$Type extends MessageType<CreateResourceRequest> {
|
||||
constructor() {
|
||||
super("api.CreateResourceRequest", [
|
||||
|
||||
Reference in New Issue
Block a user