You've already forked npm-core-sdk
1664 lines
81 KiB
TypeScript
1664 lines
81 KiB
TypeScript
// @generated by protobuf-ts 2.11.0 with parameter use_proto_field_name,keep_enum_prefix
|
|
// @generated from protobuf file "tiny-url.proto" (package "api", syntax proto3)
|
|
// tslint:disable
|
|
import { HttpBody } from "./google/api/httpbody";
|
|
import { ServiceType } from "@protobuf-ts/runtime-rpc";
|
|
import type { BinaryWriteOptions } from "@protobuf-ts/runtime";
|
|
import type { IBinaryWriter } from "@protobuf-ts/runtime";
|
|
import { WireType } from "@protobuf-ts/runtime";
|
|
import type { BinaryReadOptions } from "@protobuf-ts/runtime";
|
|
import type { IBinaryReader } from "@protobuf-ts/runtime";
|
|
import { UnknownFieldHandler } from "@protobuf-ts/runtime";
|
|
import type { PartialMessage } from "@protobuf-ts/runtime";
|
|
import { reflectionMergePartial } from "@protobuf-ts/runtime";
|
|
import { MessageType } from "@protobuf-ts/runtime";
|
|
import { RequestPartnerAppHeader } from "./shared";
|
|
import { RequestSiteHeader } from "./shared";
|
|
import { ResourceType } from "./shared";
|
|
/**
|
|
* @generated from protobuf message api.FileMetadata
|
|
*/
|
|
export interface FileMetadata {
|
|
/**
|
|
* @generated from protobuf field: string Name = 1
|
|
*/
|
|
Name: string;
|
|
/**
|
|
* @generated from protobuf field: string MIMEType = 2
|
|
*/
|
|
MIMEType: string;
|
|
/**
|
|
* @generated from protobuf field: int64 Size = 3
|
|
*/
|
|
Size: bigint;
|
|
}
|
|
/**
|
|
* @generated from protobuf message api.TinyURL
|
|
*/
|
|
export interface TinyURL {
|
|
/**
|
|
* @generated from protobuf field: string ID = 1
|
|
*/
|
|
ID: string;
|
|
/**
|
|
* @generated from protobuf oneof: Type
|
|
*/
|
|
Type: {
|
|
oneofKind: "LongURL";
|
|
/**
|
|
* @generated from protobuf field: string LongURL = 2
|
|
*/
|
|
LongURL: string;
|
|
} | {
|
|
oneofKind: "File";
|
|
/**
|
|
* @generated from protobuf field: api.FileMetadata File = 3
|
|
*/
|
|
File: FileMetadata;
|
|
} | {
|
|
oneofKind: undefined;
|
|
};
|
|
/**
|
|
* @generated from protobuf field: string URL = 4
|
|
*/
|
|
URL: string;
|
|
/**
|
|
* @generated from protobuf field: api.ResourceType ResourceType = 5
|
|
*/
|
|
ResourceType: ResourceType;
|
|
/**
|
|
* @generated from protobuf field: string ResourceRefID = 6
|
|
*/
|
|
ResourceRefID: string;
|
|
/**
|
|
* @generated from protobuf field: api.TimeToLive TimeToLive = 7
|
|
*/
|
|
TimeToLive: TimeToLive;
|
|
/**
|
|
* @generated from protobuf field: string CreatedAt = 8
|
|
*/
|
|
CreatedAt: string;
|
|
/**
|
|
* @generated from protobuf field: bool IsPublic = 9
|
|
*/
|
|
IsPublic: boolean;
|
|
/**
|
|
* @generated from protobuf field: bool IsOnce = 10
|
|
*/
|
|
IsOnce: boolean;
|
|
}
|
|
/**
|
|
* @generated from protobuf message api.FileRequest
|
|
*/
|
|
export interface FileRequest {
|
|
/**
|
|
* @generated from protobuf field: string Name = 1
|
|
*/
|
|
Name: string;
|
|
/**
|
|
* @generated from protobuf field: bytes Content = 3
|
|
*/
|
|
Content: Uint8Array;
|
|
}
|
|
// ========== REQUESTS & RESPONSE MESSAGES ==========
|
|
|
|
/**
|
|
* @generated from protobuf message api.ShortenSiteURLRequest
|
|
*/
|
|
export interface ShortenSiteURLRequest {
|
|
/**
|
|
* @generated from protobuf field: api.RequestSiteHeader Header = 1
|
|
*/
|
|
Header?: RequestSiteHeader;
|
|
/**
|
|
* @generated from protobuf field: string URL = 2
|
|
*/
|
|
URL: string;
|
|
/**
|
|
* @generated from protobuf field: api.TimeToLive TimeToLive = 3
|
|
*/
|
|
TimeToLive: TimeToLive;
|
|
/**
|
|
* @generated from protobuf field: bool isPublic = 4
|
|
*/
|
|
isPublic: boolean;
|
|
/**
|
|
* @generated from protobuf field: bool isOnce = 5
|
|
*/
|
|
isOnce: boolean;
|
|
}
|
|
/**
|
|
* @generated from protobuf message api.ShortenSiteURLResult
|
|
*/
|
|
export interface ShortenSiteURLResult {
|
|
/**
|
|
* @generated from protobuf field: api.TinyURL TinyURL = 1
|
|
*/
|
|
TinyURL?: TinyURL;
|
|
}
|
|
/**
|
|
* @generated from protobuf message api.ShortenPartnerAppURLRequest
|
|
*/
|
|
export interface ShortenPartnerAppURLRequest {
|
|
/**
|
|
* @generated from protobuf field: api.RequestPartnerAppHeader Header = 1
|
|
*/
|
|
Header?: RequestPartnerAppHeader;
|
|
/**
|
|
* @generated from protobuf field: string URL = 2
|
|
*/
|
|
URL: string;
|
|
/**
|
|
* @generated from protobuf field: api.TimeToLive TimeToLive = 3
|
|
*/
|
|
TimeToLive: TimeToLive;
|
|
/**
|
|
* @generated from protobuf field: bool isPublic = 4
|
|
*/
|
|
isPublic: boolean;
|
|
/**
|
|
* @generated from protobuf field: bool isOnce = 5
|
|
*/
|
|
isOnce: boolean;
|
|
}
|
|
/**
|
|
* @generated from protobuf message api.ShortenPartnerAppURLResult
|
|
*/
|
|
export interface ShortenPartnerAppURLResult {
|
|
/**
|
|
* @generated from protobuf field: api.TinyURL TinyURL = 1
|
|
*/
|
|
TinyURL?: TinyURL;
|
|
}
|
|
/**
|
|
* @generated from protobuf message api.UploadSiteFileRequest
|
|
*/
|
|
export interface UploadSiteFileRequest {
|
|
/**
|
|
* @generated from protobuf field: api.RequestSiteHeader Header = 1
|
|
*/
|
|
Header?: RequestSiteHeader;
|
|
/**
|
|
* @generated from protobuf field: api.FileRequest FileData = 2
|
|
*/
|
|
FileData?: FileRequest;
|
|
/**
|
|
* @generated from protobuf field: api.TimeToLive TimeToLive = 3
|
|
*/
|
|
TimeToLive: TimeToLive;
|
|
/**
|
|
* @generated from protobuf field: bool isPublic = 4
|
|
*/
|
|
isPublic: boolean;
|
|
/**
|
|
* @generated from protobuf field: bool isOnce = 5
|
|
*/
|
|
isOnce: boolean;
|
|
}
|
|
/**
|
|
* @generated from protobuf message api.UploadSiteFileResponse
|
|
*/
|
|
export interface UploadSiteFileResponse {
|
|
/**
|
|
* @generated from protobuf field: api.TinyURL TinyURL = 1
|
|
*/
|
|
TinyURL?: TinyURL;
|
|
}
|
|
/**
|
|
* @generated from protobuf message api.UploadPartnerAppFileRequest
|
|
*/
|
|
export interface UploadPartnerAppFileRequest {
|
|
/**
|
|
* @generated from protobuf field: api.RequestPartnerAppHeader Header = 1
|
|
*/
|
|
Header?: RequestPartnerAppHeader;
|
|
/**
|
|
* @generated from protobuf field: api.FileRequest FileData = 2
|
|
*/
|
|
FileData?: FileRequest;
|
|
/**
|
|
* @generated from protobuf field: api.TimeToLive TimeToLive = 3
|
|
*/
|
|
TimeToLive: TimeToLive;
|
|
/**
|
|
* @generated from protobuf field: bool isPublic = 4
|
|
*/
|
|
isPublic: boolean;
|
|
/**
|
|
* @generated from protobuf field: bool isOnce = 5
|
|
*/
|
|
isOnce: boolean;
|
|
}
|
|
/**
|
|
* @generated from protobuf message api.UploadPartnerAppFileResponse
|
|
*/
|
|
export interface UploadPartnerAppFileResponse {
|
|
/**
|
|
* @generated from protobuf field: api.TinyURL TinyURL = 1
|
|
*/
|
|
TinyURL?: TinyURL;
|
|
}
|
|
/**
|
|
* @generated from protobuf message api.ListSiteTinyURLsRequest
|
|
*/
|
|
export interface ListSiteTinyURLsRequest {
|
|
/**
|
|
* @generated from protobuf field: api.RequestSiteHeader Header = 1
|
|
*/
|
|
Header?: RequestSiteHeader;
|
|
}
|
|
/**
|
|
* @generated from protobuf message api.ListSiteTinyURLsResponse
|
|
*/
|
|
export interface ListSiteTinyURLsResponse {
|
|
/**
|
|
* @generated from protobuf field: repeated api.TinyURL TinyURLs = 1
|
|
*/
|
|
TinyURLs: TinyURL[];
|
|
}
|
|
/**
|
|
* @generated from protobuf message api.ListPartnerAppTinyURLsRequest
|
|
*/
|
|
export interface ListPartnerAppTinyURLsRequest {
|
|
/**
|
|
* @generated from protobuf field: api.RequestPartnerAppHeader Header = 1
|
|
*/
|
|
Header?: RequestPartnerAppHeader;
|
|
}
|
|
/**
|
|
* @generated from protobuf message api.ListPartnerAppTinyURLsResponse
|
|
*/
|
|
export interface ListPartnerAppTinyURLsResponse {
|
|
/**
|
|
* @generated from protobuf field: repeated api.TinyURL TinyURLs = 1
|
|
*/
|
|
TinyURLs: TinyURL[];
|
|
}
|
|
/**
|
|
* @generated from protobuf message api.DeleteSiteTinyURLRequest
|
|
*/
|
|
export interface DeleteSiteTinyURLRequest {
|
|
/**
|
|
* @generated from protobuf field: api.RequestSiteHeader Header = 1
|
|
*/
|
|
Header?: RequestSiteHeader;
|
|
/**
|
|
* @generated from protobuf field: string ID = 2
|
|
*/
|
|
ID: string;
|
|
}
|
|
/**
|
|
* @generated from protobuf message api.DeleteSiteTinyURLResponse
|
|
*/
|
|
export interface DeleteSiteTinyURLResponse {
|
|
}
|
|
/**
|
|
* @generated from protobuf message api.DeletePartnerAppTinyURLRequest
|
|
*/
|
|
export interface DeletePartnerAppTinyURLRequest {
|
|
/**
|
|
* @generated from protobuf field: api.RequestPartnerAppHeader Header = 1
|
|
*/
|
|
Header?: RequestPartnerAppHeader;
|
|
/**
|
|
* @generated from protobuf field: string ID = 2
|
|
*/
|
|
ID: string;
|
|
}
|
|
/**
|
|
* @generated from protobuf message api.DeletePartnerAppTinyURLResponse
|
|
*/
|
|
export interface DeletePartnerAppTinyURLResponse {
|
|
}
|
|
/**
|
|
* @generated from protobuf message api.GetLongURLRequest
|
|
*/
|
|
export interface GetLongURLRequest {
|
|
/**
|
|
* @generated from protobuf field: string ID = 1
|
|
*/
|
|
ID: string;
|
|
/**
|
|
* @generated from protobuf field: string Token = 2
|
|
*/
|
|
Token: string;
|
|
}
|
|
/**
|
|
* @generated from protobuf message api.GetLongURLResult
|
|
*/
|
|
export interface GetLongURLResult {
|
|
/**
|
|
* @generated from protobuf field: api.TinyURL TinyURL = 1
|
|
*/
|
|
TinyURL?: TinyURL;
|
|
}
|
|
/**
|
|
* @generated from protobuf message api.DownloadFileRequest
|
|
*/
|
|
export interface DownloadFileRequest {
|
|
/**
|
|
* @generated from protobuf field: string ID = 1
|
|
*/
|
|
ID: string;
|
|
/**
|
|
* @generated from protobuf field: string Token = 2
|
|
*/
|
|
Token: string;
|
|
}
|
|
// ========== MODEL MESSAGES ==========
|
|
|
|
/**
|
|
* @generated from protobuf enum api.TimeToLive
|
|
*/
|
|
export enum TimeToLive {
|
|
/**
|
|
* @generated from protobuf enum value: TIME_TO_LIVE_UNKNOWN = 0;
|
|
*/
|
|
TIME_TO_LIVE_UNKNOWN = 0,
|
|
/**
|
|
* @generated from protobuf enum value: TIME_TO_LIVE_1DAY = 1;
|
|
*/
|
|
TIME_TO_LIVE_1DAY = 1,
|
|
/**
|
|
* @generated from protobuf enum value: TIME_TO_LIVE_2DAYS = 2;
|
|
*/
|
|
TIME_TO_LIVE_2DAYS = 2,
|
|
/**
|
|
* @generated from protobuf enum value: TIME_TO_LIVE_4DAYS = 3;
|
|
*/
|
|
TIME_TO_LIVE_4DAYS = 3,
|
|
/**
|
|
* @generated from protobuf enum value: TIME_TO_LIVE_1WEEK = 4;
|
|
*/
|
|
TIME_TO_LIVE_1WEEK = 4,
|
|
/**
|
|
* @generated from protobuf enum value: TIME_TO_LIVE_2WEEKS = 5;
|
|
*/
|
|
TIME_TO_LIVE_2WEEKS = 5,
|
|
/**
|
|
* @generated from protobuf enum value: TIME_TO_LIVE_1MONTH = 6;
|
|
*/
|
|
TIME_TO_LIVE_1MONTH = 6,
|
|
/**
|
|
* @generated from protobuf enum value: TIME_TO_LIVE_INFINITE = 7;
|
|
*/
|
|
TIME_TO_LIVE_INFINITE = 7
|
|
}
|
|
// @generated message type with reflection information, may provide speed optimized methods
|
|
class FileMetadata$Type extends MessageType<FileMetadata> {
|
|
constructor() {
|
|
super("api.FileMetadata", [
|
|
{ no: 1, name: "Name", kind: "scalar", localName: "Name", jsonName: "Name", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } },
|
|
{ no: 2, name: "MIMEType", kind: "scalar", localName: "MIMEType", jsonName: "MIMEType", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } },
|
|
{ no: 3, name: "Size", kind: "scalar", localName: "Size", jsonName: "Size", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }
|
|
]);
|
|
}
|
|
create(value?: PartialMessage<FileMetadata>): FileMetadata {
|
|
const message = globalThis.Object.create((this.messagePrototype!));
|
|
message.Name = "";
|
|
message.MIMEType = "";
|
|
message.Size = 0n;
|
|
if (value !== undefined)
|
|
reflectionMergePartial<FileMetadata>(this, message, value);
|
|
return message;
|
|
}
|
|
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: FileMetadata): FileMetadata {
|
|
let message = target ?? this.create(), end = reader.pos + length;
|
|
while (reader.pos < end) {
|
|
let [fieldNo, wireType] = reader.tag();
|
|
switch (fieldNo) {
|
|
case /* string Name */ 1:
|
|
message.Name = reader.string();
|
|
break;
|
|
case /* string MIMEType */ 2:
|
|
message.MIMEType = reader.string();
|
|
break;
|
|
case /* int64 Size */ 3:
|
|
message.Size = reader.int64().toBigInt();
|
|
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: FileMetadata, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
|
/* string Name = 1; */
|
|
if (message.Name !== "")
|
|
writer.tag(1, WireType.LengthDelimited).string(message.Name);
|
|
/* string MIMEType = 2; */
|
|
if (message.MIMEType !== "")
|
|
writer.tag(2, WireType.LengthDelimited).string(message.MIMEType);
|
|
/* int64 Size = 3; */
|
|
if (message.Size !== 0n)
|
|
writer.tag(3, WireType.Varint).int64(message.Size);
|
|
let u = options.writeUnknownFields;
|
|
if (u !== false)
|
|
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
return writer;
|
|
}
|
|
}
|
|
/**
|
|
* @generated MessageType for protobuf message api.FileMetadata
|
|
*/
|
|
export const FileMetadata = new FileMetadata$Type();
|
|
// @generated message type with reflection information, may provide speed optimized methods
|
|
class TinyURL$Type extends MessageType<TinyURL> {
|
|
constructor() {
|
|
super("api.TinyURL", [
|
|
{ no: 1, name: "ID", kind: "scalar", localName: "ID", jsonName: "ID", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } },
|
|
{ no: 2, name: "LongURL", kind: "scalar", localName: "LongURL", jsonName: "LongURL", oneof: "Type", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } },
|
|
{ no: 3, name: "File", kind: "message", localName: "File", jsonName: "File", oneof: "Type", T: () => FileMetadata },
|
|
{ no: 4, name: "URL", kind: "scalar", localName: "URL", jsonName: "URL", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } },
|
|
{ no: 5, name: "ResourceType", kind: "enum", localName: "ResourceType", jsonName: "ResourceType", T: () => ["api.ResourceType", ResourceType], options: { "validate.rules": { enum: { definedOnly: true } } } },
|
|
{ no: 6, name: "ResourceRefID", kind: "scalar", localName: "ResourceRefID", jsonName: "ResourceRefID", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } },
|
|
{ no: 7, name: "TimeToLive", kind: "enum", localName: "TimeToLive", jsonName: "TimeToLive", T: () => ["api.TimeToLive", TimeToLive], options: { "validate.rules": { enum: { definedOnly: true } } } },
|
|
{ no: 8, name: "CreatedAt", kind: "scalar", localName: "CreatedAt", jsonName: "CreatedAt", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { dateIso8601: true } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "UTC date/time in <a href='https://en.wikipedia.org/wiki/ISO_8601'>ISO 8601</a> format" } } },
|
|
{ no: 9, name: "IsPublic", kind: "scalar", localName: "IsPublic", jsonName: "IsPublic", T: 8 /*ScalarType.BOOL*/ },
|
|
{ no: 10, name: "IsOnce", kind: "scalar", localName: "IsOnce", jsonName: "IsOnce", T: 8 /*ScalarType.BOOL*/ }
|
|
]);
|
|
}
|
|
create(value?: PartialMessage<TinyURL>): TinyURL {
|
|
const message = globalThis.Object.create((this.messagePrototype!));
|
|
message.ID = "";
|
|
message.Type = { oneofKind: undefined };
|
|
message.URL = "";
|
|
message.ResourceType = 0;
|
|
message.ResourceRefID = "";
|
|
message.TimeToLive = 0;
|
|
message.CreatedAt = "";
|
|
message.IsPublic = false;
|
|
message.IsOnce = false;
|
|
if (value !== undefined)
|
|
reflectionMergePartial<TinyURL>(this, message, value);
|
|
return message;
|
|
}
|
|
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: TinyURL): TinyURL {
|
|
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 /* string LongURL */ 2:
|
|
message.Type = {
|
|
oneofKind: "LongURL",
|
|
LongURL: reader.string()
|
|
};
|
|
break;
|
|
case /* api.FileMetadata File */ 3:
|
|
message.Type = {
|
|
oneofKind: "File",
|
|
File: FileMetadata.internalBinaryRead(reader, reader.uint32(), options, (message.Type as any).File)
|
|
};
|
|
break;
|
|
case /* string URL */ 4:
|
|
message.URL = reader.string();
|
|
break;
|
|
case /* api.ResourceType ResourceType */ 5:
|
|
message.ResourceType = reader.int32();
|
|
break;
|
|
case /* string ResourceRefID */ 6:
|
|
message.ResourceRefID = reader.string();
|
|
break;
|
|
case /* api.TimeToLive TimeToLive */ 7:
|
|
message.TimeToLive = reader.int32();
|
|
break;
|
|
case /* string CreatedAt */ 8:
|
|
message.CreatedAt = reader.string();
|
|
break;
|
|
case /* bool IsPublic */ 9:
|
|
message.IsPublic = reader.bool();
|
|
break;
|
|
case /* bool IsOnce */ 10:
|
|
message.IsOnce = reader.bool();
|
|
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: TinyURL, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
|
/* string ID = 1; */
|
|
if (message.ID !== "")
|
|
writer.tag(1, WireType.LengthDelimited).string(message.ID);
|
|
/* string LongURL = 2; */
|
|
if (message.Type.oneofKind === "LongURL")
|
|
writer.tag(2, WireType.LengthDelimited).string(message.Type.LongURL);
|
|
/* api.FileMetadata File = 3; */
|
|
if (message.Type.oneofKind === "File")
|
|
FileMetadata.internalBinaryWrite(message.Type.File, writer.tag(3, WireType.LengthDelimited).fork(), options).join();
|
|
/* string URL = 4; */
|
|
if (message.URL !== "")
|
|
writer.tag(4, WireType.LengthDelimited).string(message.URL);
|
|
/* api.ResourceType ResourceType = 5; */
|
|
if (message.ResourceType !== 0)
|
|
writer.tag(5, WireType.Varint).int32(message.ResourceType);
|
|
/* string ResourceRefID = 6; */
|
|
if (message.ResourceRefID !== "")
|
|
writer.tag(6, WireType.LengthDelimited).string(message.ResourceRefID);
|
|
/* api.TimeToLive TimeToLive = 7; */
|
|
if (message.TimeToLive !== 0)
|
|
writer.tag(7, WireType.Varint).int32(message.TimeToLive);
|
|
/* string CreatedAt = 8; */
|
|
if (message.CreatedAt !== "")
|
|
writer.tag(8, WireType.LengthDelimited).string(message.CreatedAt);
|
|
/* bool IsPublic = 9; */
|
|
if (message.IsPublic !== false)
|
|
writer.tag(9, WireType.Varint).bool(message.IsPublic);
|
|
/* bool IsOnce = 10; */
|
|
if (message.IsOnce !== false)
|
|
writer.tag(10, WireType.Varint).bool(message.IsOnce);
|
|
let u = options.writeUnknownFields;
|
|
if (u !== false)
|
|
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
return writer;
|
|
}
|
|
}
|
|
/**
|
|
* @generated MessageType for protobuf message api.TinyURL
|
|
*/
|
|
export const TinyURL = new TinyURL$Type();
|
|
// @generated message type with reflection information, may provide speed optimized methods
|
|
class FileRequest$Type extends MessageType<FileRequest> {
|
|
constructor() {
|
|
super("api.FileRequest", [
|
|
{ no: 1, name: "Name", kind: "scalar", localName: "Name", jsonName: "Name", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } },
|
|
{ no: 3, name: "Content", kind: "scalar", localName: "Content", jsonName: "Content", T: 12 /*ScalarType.BYTES*/ }
|
|
], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["Name", "Content"] } } });
|
|
}
|
|
create(value?: PartialMessage<FileRequest>): FileRequest {
|
|
const message = globalThis.Object.create((this.messagePrototype!));
|
|
message.Name = "";
|
|
message.Content = new Uint8Array(0);
|
|
if (value !== undefined)
|
|
reflectionMergePartial<FileRequest>(this, message, value);
|
|
return message;
|
|
}
|
|
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: FileRequest): FileRequest {
|
|
let message = target ?? this.create(), end = reader.pos + length;
|
|
while (reader.pos < end) {
|
|
let [fieldNo, wireType] = reader.tag();
|
|
switch (fieldNo) {
|
|
case /* string Name */ 1:
|
|
message.Name = reader.string();
|
|
break;
|
|
case /* bytes Content */ 3:
|
|
message.Content = reader.bytes();
|
|
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: FileRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
|
/* string Name = 1; */
|
|
if (message.Name !== "")
|
|
writer.tag(1, WireType.LengthDelimited).string(message.Name);
|
|
/* bytes Content = 3; */
|
|
if (message.Content.length)
|
|
writer.tag(3, WireType.LengthDelimited).bytes(message.Content);
|
|
let u = options.writeUnknownFields;
|
|
if (u !== false)
|
|
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
return writer;
|
|
}
|
|
}
|
|
/**
|
|
* @generated MessageType for protobuf message api.FileRequest
|
|
*/
|
|
export const FileRequest = new FileRequest$Type();
|
|
// @generated message type with reflection information, may provide speed optimized methods
|
|
class ShortenSiteURLRequest$Type extends MessageType<ShortenSiteURLRequest> {
|
|
constructor() {
|
|
super("api.ShortenSiteURLRequest", [
|
|
{ no: 1, name: "Header", kind: "message", localName: "Header", jsonName: "Header", T: () => RequestSiteHeader, options: { "validate.rules": { message: { required: true } } } },
|
|
{ no: 2, name: "URL", kind: "scalar", localName: "URL", jsonName: "URL", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } },
|
|
{ no: 3, name: "TimeToLive", kind: "enum", localName: "TimeToLive", jsonName: "TimeToLive", T: () => ["api.TimeToLive", TimeToLive], options: { "validate.rules": { enum: { definedOnly: true } } } },
|
|
{ no: 4, name: "isPublic", kind: "scalar", T: 8 /*ScalarType.BOOL*/ },
|
|
{ no: 5, name: "isOnce", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }
|
|
], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["Header", "URL", "TimeToLive"] } } });
|
|
}
|
|
create(value?: PartialMessage<ShortenSiteURLRequest>): ShortenSiteURLRequest {
|
|
const message = globalThis.Object.create((this.messagePrototype!));
|
|
message.URL = "";
|
|
message.TimeToLive = 0;
|
|
message.isPublic = false;
|
|
message.isOnce = false;
|
|
if (value !== undefined)
|
|
reflectionMergePartial<ShortenSiteURLRequest>(this, message, value);
|
|
return message;
|
|
}
|
|
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ShortenSiteURLRequest): ShortenSiteURLRequest {
|
|
let message = target ?? this.create(), end = reader.pos + length;
|
|
while (reader.pos < end) {
|
|
let [fieldNo, wireType] = reader.tag();
|
|
switch (fieldNo) {
|
|
case /* api.RequestSiteHeader Header */ 1:
|
|
message.Header = RequestSiteHeader.internalBinaryRead(reader, reader.uint32(), options, message.Header);
|
|
break;
|
|
case /* string URL */ 2:
|
|
message.URL = reader.string();
|
|
break;
|
|
case /* api.TimeToLive TimeToLive */ 3:
|
|
message.TimeToLive = reader.int32();
|
|
break;
|
|
case /* bool isPublic */ 4:
|
|
message.isPublic = reader.bool();
|
|
break;
|
|
case /* bool isOnce */ 5:
|
|
message.isOnce = reader.bool();
|
|
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: ShortenSiteURLRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
|
/* api.RequestSiteHeader Header = 1; */
|
|
if (message.Header)
|
|
RequestSiteHeader.internalBinaryWrite(message.Header, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
|
|
/* string URL = 2; */
|
|
if (message.URL !== "")
|
|
writer.tag(2, WireType.LengthDelimited).string(message.URL);
|
|
/* api.TimeToLive TimeToLive = 3; */
|
|
if (message.TimeToLive !== 0)
|
|
writer.tag(3, WireType.Varint).int32(message.TimeToLive);
|
|
/* bool isPublic = 4; */
|
|
if (message.isPublic !== false)
|
|
writer.tag(4, WireType.Varint).bool(message.isPublic);
|
|
/* bool isOnce = 5; */
|
|
if (message.isOnce !== false)
|
|
writer.tag(5, WireType.Varint).bool(message.isOnce);
|
|
let u = options.writeUnknownFields;
|
|
if (u !== false)
|
|
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
return writer;
|
|
}
|
|
}
|
|
/**
|
|
* @generated MessageType for protobuf message api.ShortenSiteURLRequest
|
|
*/
|
|
export const ShortenSiteURLRequest = new ShortenSiteURLRequest$Type();
|
|
// @generated message type with reflection information, may provide speed optimized methods
|
|
class ShortenSiteURLResult$Type extends MessageType<ShortenSiteURLResult> {
|
|
constructor() {
|
|
super("api.ShortenSiteURLResult", [
|
|
{ no: 1, name: "TinyURL", kind: "message", localName: "TinyURL", jsonName: "TinyURL", T: () => TinyURL }
|
|
]);
|
|
}
|
|
create(value?: PartialMessage<ShortenSiteURLResult>): ShortenSiteURLResult {
|
|
const message = globalThis.Object.create((this.messagePrototype!));
|
|
if (value !== undefined)
|
|
reflectionMergePartial<ShortenSiteURLResult>(this, message, value);
|
|
return message;
|
|
}
|
|
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ShortenSiteURLResult): ShortenSiteURLResult {
|
|
let message = target ?? this.create(), end = reader.pos + length;
|
|
while (reader.pos < end) {
|
|
let [fieldNo, wireType] = reader.tag();
|
|
switch (fieldNo) {
|
|
case /* api.TinyURL TinyURL */ 1:
|
|
message.TinyURL = TinyURL.internalBinaryRead(reader, reader.uint32(), options, message.TinyURL);
|
|
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: ShortenSiteURLResult, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
|
/* api.TinyURL TinyURL = 1; */
|
|
if (message.TinyURL)
|
|
TinyURL.internalBinaryWrite(message.TinyURL, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
|
|
let u = options.writeUnknownFields;
|
|
if (u !== false)
|
|
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
return writer;
|
|
}
|
|
}
|
|
/**
|
|
* @generated MessageType for protobuf message api.ShortenSiteURLResult
|
|
*/
|
|
export const ShortenSiteURLResult = new ShortenSiteURLResult$Type();
|
|
// @generated message type with reflection information, may provide speed optimized methods
|
|
class ShortenPartnerAppURLRequest$Type extends MessageType<ShortenPartnerAppURLRequest> {
|
|
constructor() {
|
|
super("api.ShortenPartnerAppURLRequest", [
|
|
{ no: 1, name: "Header", kind: "message", localName: "Header", jsonName: "Header", T: () => RequestPartnerAppHeader, options: { "validate.rules": { message: { required: true } } } },
|
|
{ no: 2, name: "URL", kind: "scalar", localName: "URL", jsonName: "URL", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } },
|
|
{ no: 3, name: "TimeToLive", kind: "enum", localName: "TimeToLive", jsonName: "TimeToLive", T: () => ["api.TimeToLive", TimeToLive], options: { "validate.rules": { enum: { definedOnly: true } } } },
|
|
{ no: 4, name: "isPublic", kind: "scalar", T: 8 /*ScalarType.BOOL*/ },
|
|
{ no: 5, name: "isOnce", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }
|
|
], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["Header", "URL", "TimeToLive"] } } });
|
|
}
|
|
create(value?: PartialMessage<ShortenPartnerAppURLRequest>): ShortenPartnerAppURLRequest {
|
|
const message = globalThis.Object.create((this.messagePrototype!));
|
|
message.URL = "";
|
|
message.TimeToLive = 0;
|
|
message.isPublic = false;
|
|
message.isOnce = false;
|
|
if (value !== undefined)
|
|
reflectionMergePartial<ShortenPartnerAppURLRequest>(this, message, value);
|
|
return message;
|
|
}
|
|
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ShortenPartnerAppURLRequest): ShortenPartnerAppURLRequest {
|
|
let message = target ?? this.create(), end = reader.pos + length;
|
|
while (reader.pos < end) {
|
|
let [fieldNo, wireType] = reader.tag();
|
|
switch (fieldNo) {
|
|
case /* api.RequestPartnerAppHeader Header */ 1:
|
|
message.Header = RequestPartnerAppHeader.internalBinaryRead(reader, reader.uint32(), options, message.Header);
|
|
break;
|
|
case /* string URL */ 2:
|
|
message.URL = reader.string();
|
|
break;
|
|
case /* api.TimeToLive TimeToLive */ 3:
|
|
message.TimeToLive = reader.int32();
|
|
break;
|
|
case /* bool isPublic */ 4:
|
|
message.isPublic = reader.bool();
|
|
break;
|
|
case /* bool isOnce */ 5:
|
|
message.isOnce = reader.bool();
|
|
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: ShortenPartnerAppURLRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
|
/* api.RequestPartnerAppHeader Header = 1; */
|
|
if (message.Header)
|
|
RequestPartnerAppHeader.internalBinaryWrite(message.Header, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
|
|
/* string URL = 2; */
|
|
if (message.URL !== "")
|
|
writer.tag(2, WireType.LengthDelimited).string(message.URL);
|
|
/* api.TimeToLive TimeToLive = 3; */
|
|
if (message.TimeToLive !== 0)
|
|
writer.tag(3, WireType.Varint).int32(message.TimeToLive);
|
|
/* bool isPublic = 4; */
|
|
if (message.isPublic !== false)
|
|
writer.tag(4, WireType.Varint).bool(message.isPublic);
|
|
/* bool isOnce = 5; */
|
|
if (message.isOnce !== false)
|
|
writer.tag(5, WireType.Varint).bool(message.isOnce);
|
|
let u = options.writeUnknownFields;
|
|
if (u !== false)
|
|
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
return writer;
|
|
}
|
|
}
|
|
/**
|
|
* @generated MessageType for protobuf message api.ShortenPartnerAppURLRequest
|
|
*/
|
|
export const ShortenPartnerAppURLRequest = new ShortenPartnerAppURLRequest$Type();
|
|
// @generated message type with reflection information, may provide speed optimized methods
|
|
class ShortenPartnerAppURLResult$Type extends MessageType<ShortenPartnerAppURLResult> {
|
|
constructor() {
|
|
super("api.ShortenPartnerAppURLResult", [
|
|
{ no: 1, name: "TinyURL", kind: "message", localName: "TinyURL", jsonName: "TinyURL", T: () => TinyURL }
|
|
]);
|
|
}
|
|
create(value?: PartialMessage<ShortenPartnerAppURLResult>): ShortenPartnerAppURLResult {
|
|
const message = globalThis.Object.create((this.messagePrototype!));
|
|
if (value !== undefined)
|
|
reflectionMergePartial<ShortenPartnerAppURLResult>(this, message, value);
|
|
return message;
|
|
}
|
|
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ShortenPartnerAppURLResult): ShortenPartnerAppURLResult {
|
|
let message = target ?? this.create(), end = reader.pos + length;
|
|
while (reader.pos < end) {
|
|
let [fieldNo, wireType] = reader.tag();
|
|
switch (fieldNo) {
|
|
case /* api.TinyURL TinyURL */ 1:
|
|
message.TinyURL = TinyURL.internalBinaryRead(reader, reader.uint32(), options, message.TinyURL);
|
|
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: ShortenPartnerAppURLResult, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
|
/* api.TinyURL TinyURL = 1; */
|
|
if (message.TinyURL)
|
|
TinyURL.internalBinaryWrite(message.TinyURL, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
|
|
let u = options.writeUnknownFields;
|
|
if (u !== false)
|
|
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
return writer;
|
|
}
|
|
}
|
|
/**
|
|
* @generated MessageType for protobuf message api.ShortenPartnerAppURLResult
|
|
*/
|
|
export const ShortenPartnerAppURLResult = new ShortenPartnerAppURLResult$Type();
|
|
// @generated message type with reflection information, may provide speed optimized methods
|
|
class UploadSiteFileRequest$Type extends MessageType<UploadSiteFileRequest> {
|
|
constructor() {
|
|
super("api.UploadSiteFileRequest", [
|
|
{ no: 1, name: "Header", kind: "message", localName: "Header", jsonName: "Header", T: () => RequestSiteHeader, options: { "validate.rules": { message: { required: true } } } },
|
|
{ no: 2, name: "FileData", kind: "message", localName: "FileData", jsonName: "FileData", T: () => FileRequest, options: { "validate.rules": { message: { required: true } } } },
|
|
{ no: 3, name: "TimeToLive", kind: "enum", localName: "TimeToLive", jsonName: "TimeToLive", T: () => ["api.TimeToLive", TimeToLive], options: { "validate.rules": { enum: { definedOnly: true } } } },
|
|
{ no: 4, name: "isPublic", kind: "scalar", T: 8 /*ScalarType.BOOL*/ },
|
|
{ no: 5, name: "isOnce", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }
|
|
], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["Header", "FileData", "TimeToLive"] } } });
|
|
}
|
|
create(value?: PartialMessage<UploadSiteFileRequest>): UploadSiteFileRequest {
|
|
const message = globalThis.Object.create((this.messagePrototype!));
|
|
message.TimeToLive = 0;
|
|
message.isPublic = false;
|
|
message.isOnce = false;
|
|
if (value !== undefined)
|
|
reflectionMergePartial<UploadSiteFileRequest>(this, message, value);
|
|
return message;
|
|
}
|
|
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: UploadSiteFileRequest): UploadSiteFileRequest {
|
|
let message = target ?? this.create(), end = reader.pos + length;
|
|
while (reader.pos < end) {
|
|
let [fieldNo, wireType] = reader.tag();
|
|
switch (fieldNo) {
|
|
case /* api.RequestSiteHeader Header */ 1:
|
|
message.Header = RequestSiteHeader.internalBinaryRead(reader, reader.uint32(), options, message.Header);
|
|
break;
|
|
case /* api.FileRequest FileData */ 2:
|
|
message.FileData = FileRequest.internalBinaryRead(reader, reader.uint32(), options, message.FileData);
|
|
break;
|
|
case /* api.TimeToLive TimeToLive */ 3:
|
|
message.TimeToLive = reader.int32();
|
|
break;
|
|
case /* bool isPublic */ 4:
|
|
message.isPublic = reader.bool();
|
|
break;
|
|
case /* bool isOnce */ 5:
|
|
message.isOnce = reader.bool();
|
|
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: UploadSiteFileRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
|
/* api.RequestSiteHeader Header = 1; */
|
|
if (message.Header)
|
|
RequestSiteHeader.internalBinaryWrite(message.Header, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
|
|
/* api.FileRequest FileData = 2; */
|
|
if (message.FileData)
|
|
FileRequest.internalBinaryWrite(message.FileData, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
|
|
/* api.TimeToLive TimeToLive = 3; */
|
|
if (message.TimeToLive !== 0)
|
|
writer.tag(3, WireType.Varint).int32(message.TimeToLive);
|
|
/* bool isPublic = 4; */
|
|
if (message.isPublic !== false)
|
|
writer.tag(4, WireType.Varint).bool(message.isPublic);
|
|
/* bool isOnce = 5; */
|
|
if (message.isOnce !== false)
|
|
writer.tag(5, WireType.Varint).bool(message.isOnce);
|
|
let u = options.writeUnknownFields;
|
|
if (u !== false)
|
|
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
return writer;
|
|
}
|
|
}
|
|
/**
|
|
* @generated MessageType for protobuf message api.UploadSiteFileRequest
|
|
*/
|
|
export const UploadSiteFileRequest = new UploadSiteFileRequest$Type();
|
|
// @generated message type with reflection information, may provide speed optimized methods
|
|
class UploadSiteFileResponse$Type extends MessageType<UploadSiteFileResponse> {
|
|
constructor() {
|
|
super("api.UploadSiteFileResponse", [
|
|
{ no: 1, name: "TinyURL", kind: "message", localName: "TinyURL", jsonName: "TinyURL", T: () => TinyURL }
|
|
]);
|
|
}
|
|
create(value?: PartialMessage<UploadSiteFileResponse>): UploadSiteFileResponse {
|
|
const message = globalThis.Object.create((this.messagePrototype!));
|
|
if (value !== undefined)
|
|
reflectionMergePartial<UploadSiteFileResponse>(this, message, value);
|
|
return message;
|
|
}
|
|
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: UploadSiteFileResponse): UploadSiteFileResponse {
|
|
let message = target ?? this.create(), end = reader.pos + length;
|
|
while (reader.pos < end) {
|
|
let [fieldNo, wireType] = reader.tag();
|
|
switch (fieldNo) {
|
|
case /* api.TinyURL TinyURL */ 1:
|
|
message.TinyURL = TinyURL.internalBinaryRead(reader, reader.uint32(), options, message.TinyURL);
|
|
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: UploadSiteFileResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
|
/* api.TinyURL TinyURL = 1; */
|
|
if (message.TinyURL)
|
|
TinyURL.internalBinaryWrite(message.TinyURL, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
|
|
let u = options.writeUnknownFields;
|
|
if (u !== false)
|
|
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
return writer;
|
|
}
|
|
}
|
|
/**
|
|
* @generated MessageType for protobuf message api.UploadSiteFileResponse
|
|
*/
|
|
export const UploadSiteFileResponse = new UploadSiteFileResponse$Type();
|
|
// @generated message type with reflection information, may provide speed optimized methods
|
|
class UploadPartnerAppFileRequest$Type extends MessageType<UploadPartnerAppFileRequest> {
|
|
constructor() {
|
|
super("api.UploadPartnerAppFileRequest", [
|
|
{ no: 1, name: "Header", kind: "message", localName: "Header", jsonName: "Header", T: () => RequestPartnerAppHeader, options: { "validate.rules": { message: { required: true } } } },
|
|
{ no: 2, name: "FileData", kind: "message", localName: "FileData", jsonName: "FileData", T: () => FileRequest, options: { "validate.rules": { message: { required: true } } } },
|
|
{ no: 3, name: "TimeToLive", kind: "enum", localName: "TimeToLive", jsonName: "TimeToLive", T: () => ["api.TimeToLive", TimeToLive], options: { "validate.rules": { enum: { definedOnly: true } } } },
|
|
{ no: 4, name: "isPublic", kind: "scalar", T: 8 /*ScalarType.BOOL*/ },
|
|
{ no: 5, name: "isOnce", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }
|
|
], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["Header", "FileData", "TimeToLive"] } } });
|
|
}
|
|
create(value?: PartialMessage<UploadPartnerAppFileRequest>): UploadPartnerAppFileRequest {
|
|
const message = globalThis.Object.create((this.messagePrototype!));
|
|
message.TimeToLive = 0;
|
|
message.isPublic = false;
|
|
message.isOnce = false;
|
|
if (value !== undefined)
|
|
reflectionMergePartial<UploadPartnerAppFileRequest>(this, message, value);
|
|
return message;
|
|
}
|
|
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: UploadPartnerAppFileRequest): UploadPartnerAppFileRequest {
|
|
let message = target ?? this.create(), end = reader.pos + length;
|
|
while (reader.pos < end) {
|
|
let [fieldNo, wireType] = reader.tag();
|
|
switch (fieldNo) {
|
|
case /* api.RequestPartnerAppHeader Header */ 1:
|
|
message.Header = RequestPartnerAppHeader.internalBinaryRead(reader, reader.uint32(), options, message.Header);
|
|
break;
|
|
case /* api.FileRequest FileData */ 2:
|
|
message.FileData = FileRequest.internalBinaryRead(reader, reader.uint32(), options, message.FileData);
|
|
break;
|
|
case /* api.TimeToLive TimeToLive */ 3:
|
|
message.TimeToLive = reader.int32();
|
|
break;
|
|
case /* bool isPublic */ 4:
|
|
message.isPublic = reader.bool();
|
|
break;
|
|
case /* bool isOnce */ 5:
|
|
message.isOnce = reader.bool();
|
|
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: UploadPartnerAppFileRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
|
/* api.RequestPartnerAppHeader Header = 1; */
|
|
if (message.Header)
|
|
RequestPartnerAppHeader.internalBinaryWrite(message.Header, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
|
|
/* api.FileRequest FileData = 2; */
|
|
if (message.FileData)
|
|
FileRequest.internalBinaryWrite(message.FileData, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
|
|
/* api.TimeToLive TimeToLive = 3; */
|
|
if (message.TimeToLive !== 0)
|
|
writer.tag(3, WireType.Varint).int32(message.TimeToLive);
|
|
/* bool isPublic = 4; */
|
|
if (message.isPublic !== false)
|
|
writer.tag(4, WireType.Varint).bool(message.isPublic);
|
|
/* bool isOnce = 5; */
|
|
if (message.isOnce !== false)
|
|
writer.tag(5, WireType.Varint).bool(message.isOnce);
|
|
let u = options.writeUnknownFields;
|
|
if (u !== false)
|
|
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
return writer;
|
|
}
|
|
}
|
|
/**
|
|
* @generated MessageType for protobuf message api.UploadPartnerAppFileRequest
|
|
*/
|
|
export const UploadPartnerAppFileRequest = new UploadPartnerAppFileRequest$Type();
|
|
// @generated message type with reflection information, may provide speed optimized methods
|
|
class UploadPartnerAppFileResponse$Type extends MessageType<UploadPartnerAppFileResponse> {
|
|
constructor() {
|
|
super("api.UploadPartnerAppFileResponse", [
|
|
{ no: 1, name: "TinyURL", kind: "message", localName: "TinyURL", jsonName: "TinyURL", T: () => TinyURL }
|
|
]);
|
|
}
|
|
create(value?: PartialMessage<UploadPartnerAppFileResponse>): UploadPartnerAppFileResponse {
|
|
const message = globalThis.Object.create((this.messagePrototype!));
|
|
if (value !== undefined)
|
|
reflectionMergePartial<UploadPartnerAppFileResponse>(this, message, value);
|
|
return message;
|
|
}
|
|
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: UploadPartnerAppFileResponse): UploadPartnerAppFileResponse {
|
|
let message = target ?? this.create(), end = reader.pos + length;
|
|
while (reader.pos < end) {
|
|
let [fieldNo, wireType] = reader.tag();
|
|
switch (fieldNo) {
|
|
case /* api.TinyURL TinyURL */ 1:
|
|
message.TinyURL = TinyURL.internalBinaryRead(reader, reader.uint32(), options, message.TinyURL);
|
|
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: UploadPartnerAppFileResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
|
/* api.TinyURL TinyURL = 1; */
|
|
if (message.TinyURL)
|
|
TinyURL.internalBinaryWrite(message.TinyURL, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
|
|
let u = options.writeUnknownFields;
|
|
if (u !== false)
|
|
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
return writer;
|
|
}
|
|
}
|
|
/**
|
|
* @generated MessageType for protobuf message api.UploadPartnerAppFileResponse
|
|
*/
|
|
export const UploadPartnerAppFileResponse = new UploadPartnerAppFileResponse$Type();
|
|
// @generated message type with reflection information, may provide speed optimized methods
|
|
class ListSiteTinyURLsRequest$Type extends MessageType<ListSiteTinyURLsRequest> {
|
|
constructor() {
|
|
super("api.ListSiteTinyURLsRequest", [
|
|
{ no: 1, name: "Header", kind: "message", localName: "Header", jsonName: "Header", T: () => RequestSiteHeader, options: { "validate.rules": { message: { required: true } } } }
|
|
], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["Header"] } } });
|
|
}
|
|
create(value?: PartialMessage<ListSiteTinyURLsRequest>): ListSiteTinyURLsRequest {
|
|
const message = globalThis.Object.create((this.messagePrototype!));
|
|
if (value !== undefined)
|
|
reflectionMergePartial<ListSiteTinyURLsRequest>(this, message, value);
|
|
return message;
|
|
}
|
|
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListSiteTinyURLsRequest): ListSiteTinyURLsRequest {
|
|
let message = target ?? this.create(), end = reader.pos + length;
|
|
while (reader.pos < end) {
|
|
let [fieldNo, wireType] = reader.tag();
|
|
switch (fieldNo) {
|
|
case /* api.RequestSiteHeader Header */ 1:
|
|
message.Header = RequestSiteHeader.internalBinaryRead(reader, reader.uint32(), options, message.Header);
|
|
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: ListSiteTinyURLsRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
|
/* api.RequestSiteHeader Header = 1; */
|
|
if (message.Header)
|
|
RequestSiteHeader.internalBinaryWrite(message.Header, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
|
|
let u = options.writeUnknownFields;
|
|
if (u !== false)
|
|
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
return writer;
|
|
}
|
|
}
|
|
/**
|
|
* @generated MessageType for protobuf message api.ListSiteTinyURLsRequest
|
|
*/
|
|
export const ListSiteTinyURLsRequest = new ListSiteTinyURLsRequest$Type();
|
|
// @generated message type with reflection information, may provide speed optimized methods
|
|
class ListSiteTinyURLsResponse$Type extends MessageType<ListSiteTinyURLsResponse> {
|
|
constructor() {
|
|
super("api.ListSiteTinyURLsResponse", [
|
|
{ no: 1, name: "TinyURLs", kind: "message", localName: "TinyURLs", jsonName: "TinyURLs", repeat: 2 /*RepeatType.UNPACKED*/, T: () => TinyURL }
|
|
]);
|
|
}
|
|
create(value?: PartialMessage<ListSiteTinyURLsResponse>): ListSiteTinyURLsResponse {
|
|
const message = globalThis.Object.create((this.messagePrototype!));
|
|
message.TinyURLs = [];
|
|
if (value !== undefined)
|
|
reflectionMergePartial<ListSiteTinyURLsResponse>(this, message, value);
|
|
return message;
|
|
}
|
|
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListSiteTinyURLsResponse): ListSiteTinyURLsResponse {
|
|
let message = target ?? this.create(), end = reader.pos + length;
|
|
while (reader.pos < end) {
|
|
let [fieldNo, wireType] = reader.tag();
|
|
switch (fieldNo) {
|
|
case /* repeated api.TinyURL TinyURLs */ 1:
|
|
message.TinyURLs.push(TinyURL.internalBinaryRead(reader, reader.uint32(), options));
|
|
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: ListSiteTinyURLsResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
|
/* repeated api.TinyURL TinyURLs = 1; */
|
|
for (let i = 0; i < message.TinyURLs.length; i++)
|
|
TinyURL.internalBinaryWrite(message.TinyURLs[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join();
|
|
let u = options.writeUnknownFields;
|
|
if (u !== false)
|
|
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
return writer;
|
|
}
|
|
}
|
|
/**
|
|
* @generated MessageType for protobuf message api.ListSiteTinyURLsResponse
|
|
*/
|
|
export const ListSiteTinyURLsResponse = new ListSiteTinyURLsResponse$Type();
|
|
// @generated message type with reflection information, may provide speed optimized methods
|
|
class ListPartnerAppTinyURLsRequest$Type extends MessageType<ListPartnerAppTinyURLsRequest> {
|
|
constructor() {
|
|
super("api.ListPartnerAppTinyURLsRequest", [
|
|
{ no: 1, name: "Header", kind: "message", localName: "Header", jsonName: "Header", T: () => RequestPartnerAppHeader, options: { "validate.rules": { message: { required: true } } } }
|
|
], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["Header"] } } });
|
|
}
|
|
create(value?: PartialMessage<ListPartnerAppTinyURLsRequest>): ListPartnerAppTinyURLsRequest {
|
|
const message = globalThis.Object.create((this.messagePrototype!));
|
|
if (value !== undefined)
|
|
reflectionMergePartial<ListPartnerAppTinyURLsRequest>(this, message, value);
|
|
return message;
|
|
}
|
|
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListPartnerAppTinyURLsRequest): ListPartnerAppTinyURLsRequest {
|
|
let message = target ?? this.create(), end = reader.pos + length;
|
|
while (reader.pos < end) {
|
|
let [fieldNo, wireType] = reader.tag();
|
|
switch (fieldNo) {
|
|
case /* api.RequestPartnerAppHeader Header */ 1:
|
|
message.Header = RequestPartnerAppHeader.internalBinaryRead(reader, reader.uint32(), options, message.Header);
|
|
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: ListPartnerAppTinyURLsRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
|
/* api.RequestPartnerAppHeader Header = 1; */
|
|
if (message.Header)
|
|
RequestPartnerAppHeader.internalBinaryWrite(message.Header, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
|
|
let u = options.writeUnknownFields;
|
|
if (u !== false)
|
|
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
return writer;
|
|
}
|
|
}
|
|
/**
|
|
* @generated MessageType for protobuf message api.ListPartnerAppTinyURLsRequest
|
|
*/
|
|
export const ListPartnerAppTinyURLsRequest = new ListPartnerAppTinyURLsRequest$Type();
|
|
// @generated message type with reflection information, may provide speed optimized methods
|
|
class ListPartnerAppTinyURLsResponse$Type extends MessageType<ListPartnerAppTinyURLsResponse> {
|
|
constructor() {
|
|
super("api.ListPartnerAppTinyURLsResponse", [
|
|
{ no: 1, name: "TinyURLs", kind: "message", localName: "TinyURLs", jsonName: "TinyURLs", repeat: 2 /*RepeatType.UNPACKED*/, T: () => TinyURL }
|
|
]);
|
|
}
|
|
create(value?: PartialMessage<ListPartnerAppTinyURLsResponse>): ListPartnerAppTinyURLsResponse {
|
|
const message = globalThis.Object.create((this.messagePrototype!));
|
|
message.TinyURLs = [];
|
|
if (value !== undefined)
|
|
reflectionMergePartial<ListPartnerAppTinyURLsResponse>(this, message, value);
|
|
return message;
|
|
}
|
|
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListPartnerAppTinyURLsResponse): ListPartnerAppTinyURLsResponse {
|
|
let message = target ?? this.create(), end = reader.pos + length;
|
|
while (reader.pos < end) {
|
|
let [fieldNo, wireType] = reader.tag();
|
|
switch (fieldNo) {
|
|
case /* repeated api.TinyURL TinyURLs */ 1:
|
|
message.TinyURLs.push(TinyURL.internalBinaryRead(reader, reader.uint32(), options));
|
|
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: ListPartnerAppTinyURLsResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
|
/* repeated api.TinyURL TinyURLs = 1; */
|
|
for (let i = 0; i < message.TinyURLs.length; i++)
|
|
TinyURL.internalBinaryWrite(message.TinyURLs[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join();
|
|
let u = options.writeUnknownFields;
|
|
if (u !== false)
|
|
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
return writer;
|
|
}
|
|
}
|
|
/**
|
|
* @generated MessageType for protobuf message api.ListPartnerAppTinyURLsResponse
|
|
*/
|
|
export const ListPartnerAppTinyURLsResponse = new ListPartnerAppTinyURLsResponse$Type();
|
|
// @generated message type with reflection information, may provide speed optimized methods
|
|
class DeleteSiteTinyURLRequest$Type extends MessageType<DeleteSiteTinyURLRequest> {
|
|
constructor() {
|
|
super("api.DeleteSiteTinyURLRequest", [
|
|
{ no: 1, name: "Header", kind: "message", localName: "Header", jsonName: "Header", T: () => RequestSiteHeader, options: { "validate.rules": { message: { required: true } } } },
|
|
{ no: 2, name: "ID", kind: "scalar", localName: "ID", jsonName: "ID", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } }
|
|
], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["Header", "ID"] } } });
|
|
}
|
|
create(value?: PartialMessage<DeleteSiteTinyURLRequest>): DeleteSiteTinyURLRequest {
|
|
const message = globalThis.Object.create((this.messagePrototype!));
|
|
message.ID = "";
|
|
if (value !== undefined)
|
|
reflectionMergePartial<DeleteSiteTinyURLRequest>(this, message, value);
|
|
return message;
|
|
}
|
|
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DeleteSiteTinyURLRequest): DeleteSiteTinyURLRequest {
|
|
let message = target ?? this.create(), end = reader.pos + length;
|
|
while (reader.pos < end) {
|
|
let [fieldNo, wireType] = reader.tag();
|
|
switch (fieldNo) {
|
|
case /* api.RequestSiteHeader Header */ 1:
|
|
message.Header = RequestSiteHeader.internalBinaryRead(reader, reader.uint32(), options, message.Header);
|
|
break;
|
|
case /* string ID */ 2:
|
|
message.ID = 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: DeleteSiteTinyURLRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
|
/* api.RequestSiteHeader Header = 1; */
|
|
if (message.Header)
|
|
RequestSiteHeader.internalBinaryWrite(message.Header, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
|
|
/* string ID = 2; */
|
|
if (message.ID !== "")
|
|
writer.tag(2, WireType.LengthDelimited).string(message.ID);
|
|
let u = options.writeUnknownFields;
|
|
if (u !== false)
|
|
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
return writer;
|
|
}
|
|
}
|
|
/**
|
|
* @generated MessageType for protobuf message api.DeleteSiteTinyURLRequest
|
|
*/
|
|
export const DeleteSiteTinyURLRequest = new DeleteSiteTinyURLRequest$Type();
|
|
// @generated message type with reflection information, may provide speed optimized methods
|
|
class DeleteSiteTinyURLResponse$Type extends MessageType<DeleteSiteTinyURLResponse> {
|
|
constructor() {
|
|
super("api.DeleteSiteTinyURLResponse", []);
|
|
}
|
|
create(value?: PartialMessage<DeleteSiteTinyURLResponse>): DeleteSiteTinyURLResponse {
|
|
const message = globalThis.Object.create((this.messagePrototype!));
|
|
if (value !== undefined)
|
|
reflectionMergePartial<DeleteSiteTinyURLResponse>(this, message, value);
|
|
return message;
|
|
}
|
|
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DeleteSiteTinyURLResponse): DeleteSiteTinyURLResponse {
|
|
let message = target ?? this.create(), end = reader.pos + length;
|
|
while (reader.pos < end) {
|
|
let [fieldNo, wireType] = reader.tag();
|
|
switch (fieldNo) {
|
|
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: DeleteSiteTinyURLResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
|
let u = options.writeUnknownFields;
|
|
if (u !== false)
|
|
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
return writer;
|
|
}
|
|
}
|
|
/**
|
|
* @generated MessageType for protobuf message api.DeleteSiteTinyURLResponse
|
|
*/
|
|
export const DeleteSiteTinyURLResponse = new DeleteSiteTinyURLResponse$Type();
|
|
// @generated message type with reflection information, may provide speed optimized methods
|
|
class DeletePartnerAppTinyURLRequest$Type extends MessageType<DeletePartnerAppTinyURLRequest> {
|
|
constructor() {
|
|
super("api.DeletePartnerAppTinyURLRequest", [
|
|
{ no: 1, name: "Header", kind: "message", localName: "Header", jsonName: "Header", T: () => RequestPartnerAppHeader, options: { "validate.rules": { message: { required: true } } } },
|
|
{ no: 2, name: "ID", kind: "scalar", localName: "ID", jsonName: "ID", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } }
|
|
], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["Header", "ID"] } } });
|
|
}
|
|
create(value?: PartialMessage<DeletePartnerAppTinyURLRequest>): DeletePartnerAppTinyURLRequest {
|
|
const message = globalThis.Object.create((this.messagePrototype!));
|
|
message.ID = "";
|
|
if (value !== undefined)
|
|
reflectionMergePartial<DeletePartnerAppTinyURLRequest>(this, message, value);
|
|
return message;
|
|
}
|
|
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DeletePartnerAppTinyURLRequest): DeletePartnerAppTinyURLRequest {
|
|
let message = target ?? this.create(), end = reader.pos + length;
|
|
while (reader.pos < end) {
|
|
let [fieldNo, wireType] = reader.tag();
|
|
switch (fieldNo) {
|
|
case /* api.RequestPartnerAppHeader Header */ 1:
|
|
message.Header = RequestPartnerAppHeader.internalBinaryRead(reader, reader.uint32(), options, message.Header);
|
|
break;
|
|
case /* string ID */ 2:
|
|
message.ID = 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: DeletePartnerAppTinyURLRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
|
/* api.RequestPartnerAppHeader Header = 1; */
|
|
if (message.Header)
|
|
RequestPartnerAppHeader.internalBinaryWrite(message.Header, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
|
|
/* string ID = 2; */
|
|
if (message.ID !== "")
|
|
writer.tag(2, WireType.LengthDelimited).string(message.ID);
|
|
let u = options.writeUnknownFields;
|
|
if (u !== false)
|
|
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
return writer;
|
|
}
|
|
}
|
|
/**
|
|
* @generated MessageType for protobuf message api.DeletePartnerAppTinyURLRequest
|
|
*/
|
|
export const DeletePartnerAppTinyURLRequest = new DeletePartnerAppTinyURLRequest$Type();
|
|
// @generated message type with reflection information, may provide speed optimized methods
|
|
class DeletePartnerAppTinyURLResponse$Type extends MessageType<DeletePartnerAppTinyURLResponse> {
|
|
constructor() {
|
|
super("api.DeletePartnerAppTinyURLResponse", []);
|
|
}
|
|
create(value?: PartialMessage<DeletePartnerAppTinyURLResponse>): DeletePartnerAppTinyURLResponse {
|
|
const message = globalThis.Object.create((this.messagePrototype!));
|
|
if (value !== undefined)
|
|
reflectionMergePartial<DeletePartnerAppTinyURLResponse>(this, message, value);
|
|
return message;
|
|
}
|
|
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DeletePartnerAppTinyURLResponse): DeletePartnerAppTinyURLResponse {
|
|
let message = target ?? this.create(), end = reader.pos + length;
|
|
while (reader.pos < end) {
|
|
let [fieldNo, wireType] = reader.tag();
|
|
switch (fieldNo) {
|
|
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: DeletePartnerAppTinyURLResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
|
let u = options.writeUnknownFields;
|
|
if (u !== false)
|
|
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
return writer;
|
|
}
|
|
}
|
|
/**
|
|
* @generated MessageType for protobuf message api.DeletePartnerAppTinyURLResponse
|
|
*/
|
|
export const DeletePartnerAppTinyURLResponse = new DeletePartnerAppTinyURLResponse$Type();
|
|
// @generated message type with reflection information, may provide speed optimized methods
|
|
class GetLongURLRequest$Type extends MessageType<GetLongURLRequest> {
|
|
constructor() {
|
|
super("api.GetLongURLRequest", [
|
|
{ no: 1, name: "ID", kind: "scalar", localName: "ID", jsonName: "ID", T: 9 /*ScalarType.STRING*/ },
|
|
{ no: 2, name: "Token", kind: "scalar", localName: "Token", jsonName: "Token", T: 9 /*ScalarType.STRING*/ }
|
|
]);
|
|
}
|
|
create(value?: PartialMessage<GetLongURLRequest>): GetLongURLRequest {
|
|
const message = globalThis.Object.create((this.messagePrototype!));
|
|
message.ID = "";
|
|
message.Token = "";
|
|
if (value !== undefined)
|
|
reflectionMergePartial<GetLongURLRequest>(this, message, value);
|
|
return message;
|
|
}
|
|
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetLongURLRequest): GetLongURLRequest {
|
|
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 /* string Token */ 2:
|
|
message.Token = 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: GetLongURLRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
|
/* string ID = 1; */
|
|
if (message.ID !== "")
|
|
writer.tag(1, WireType.LengthDelimited).string(message.ID);
|
|
/* string Token = 2; */
|
|
if (message.Token !== "")
|
|
writer.tag(2, WireType.LengthDelimited).string(message.Token);
|
|
let u = options.writeUnknownFields;
|
|
if (u !== false)
|
|
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
return writer;
|
|
}
|
|
}
|
|
/**
|
|
* @generated MessageType for protobuf message api.GetLongURLRequest
|
|
*/
|
|
export const GetLongURLRequest = new GetLongURLRequest$Type();
|
|
// @generated message type with reflection information, may provide speed optimized methods
|
|
class GetLongURLResult$Type extends MessageType<GetLongURLResult> {
|
|
constructor() {
|
|
super("api.GetLongURLResult", [
|
|
{ no: 1, name: "TinyURL", kind: "message", localName: "TinyURL", jsonName: "TinyURL", T: () => TinyURL }
|
|
]);
|
|
}
|
|
create(value?: PartialMessage<GetLongURLResult>): GetLongURLResult {
|
|
const message = globalThis.Object.create((this.messagePrototype!));
|
|
if (value !== undefined)
|
|
reflectionMergePartial<GetLongURLResult>(this, message, value);
|
|
return message;
|
|
}
|
|
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetLongURLResult): GetLongURLResult {
|
|
let message = target ?? this.create(), end = reader.pos + length;
|
|
while (reader.pos < end) {
|
|
let [fieldNo, wireType] = reader.tag();
|
|
switch (fieldNo) {
|
|
case /* api.TinyURL TinyURL */ 1:
|
|
message.TinyURL = TinyURL.internalBinaryRead(reader, reader.uint32(), options, message.TinyURL);
|
|
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: GetLongURLResult, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
|
/* api.TinyURL TinyURL = 1; */
|
|
if (message.TinyURL)
|
|
TinyURL.internalBinaryWrite(message.TinyURL, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
|
|
let u = options.writeUnknownFields;
|
|
if (u !== false)
|
|
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
return writer;
|
|
}
|
|
}
|
|
/**
|
|
* @generated MessageType for protobuf message api.GetLongURLResult
|
|
*/
|
|
export const GetLongURLResult = new GetLongURLResult$Type();
|
|
// @generated message type with reflection information, may provide speed optimized methods
|
|
class DownloadFileRequest$Type extends MessageType<DownloadFileRequest> {
|
|
constructor() {
|
|
super("api.DownloadFileRequest", [
|
|
{ no: 1, name: "ID", kind: "scalar", localName: "ID", jsonName: "ID", T: 9 /*ScalarType.STRING*/ },
|
|
{ no: 2, name: "Token", kind: "scalar", localName: "Token", jsonName: "Token", T: 9 /*ScalarType.STRING*/ }
|
|
]);
|
|
}
|
|
create(value?: PartialMessage<DownloadFileRequest>): DownloadFileRequest {
|
|
const message = globalThis.Object.create((this.messagePrototype!));
|
|
message.ID = "";
|
|
message.Token = "";
|
|
if (value !== undefined)
|
|
reflectionMergePartial<DownloadFileRequest>(this, message, value);
|
|
return message;
|
|
}
|
|
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DownloadFileRequest): DownloadFileRequest {
|
|
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 /* string Token */ 2:
|
|
message.Token = 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: DownloadFileRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
|
/* string ID = 1; */
|
|
if (message.ID !== "")
|
|
writer.tag(1, WireType.LengthDelimited).string(message.ID);
|
|
/* string Token = 2; */
|
|
if (message.Token !== "")
|
|
writer.tag(2, WireType.LengthDelimited).string(message.Token);
|
|
let u = options.writeUnknownFields;
|
|
if (u !== false)
|
|
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
return writer;
|
|
}
|
|
}
|
|
/**
|
|
* @generated MessageType for protobuf message api.DownloadFileRequest
|
|
*/
|
|
export const DownloadFileRequest = new DownloadFileRequest$Type();
|
|
/**
|
|
* @generated ServiceType for protobuf service api.TinyURLService
|
|
*/
|
|
export const TinyURLService = new ServiceType("api.TinyURLService", [
|
|
{ name: "ShortenSiteURL", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["TinyURL"], description: "Generates a short alias for a given URL linked to a site." }, "api.rscType": "Site", "api.roles": "", "google.api.method_visibility": { restriction: "SDK" }, "google.api.http": { post: "/api.TinyURLService/ShortenSiteURL", body: "*" } }, I: ShortenSiteURLRequest, O: ShortenSiteURLResult },
|
|
{ name: "ShortenPartnerAppURL", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["TinyURL"], description: "Generates a short alias for a given URL linked to a partnerApp." }, "api.rscType": "PartnerApp", "api.roles": "", "google.api.method_visibility": { restriction: "SDK" }, "google.api.http": { post: "/api.TinyURLService/ShortenPartnerAppURL", body: "*" } }, I: ShortenPartnerAppURLRequest, O: ShortenPartnerAppURLResult },
|
|
{ name: "UploadSiteFile", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["TinyURL"], description: "Uploads a file linked to a specific site resource. Generates a short URL to download the file" }, "api.rscType": "Site", "api.roles": "", "google.api.method_visibility": { restriction: "SDK" } }, I: UploadSiteFileRequest, O: UploadSiteFileResponse },
|
|
{ name: "UploadPartnerAppFile", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["TinyURL"], description: "Uploads a file linked to a specific partnerApp resource. Generates a short URL to download the file" }, "api.rscType": "PartnerApp", "api.roles": "", "google.api.method_visibility": { restriction: "SDK" } }, I: UploadPartnerAppFileRequest, O: UploadPartnerAppFileResponse },
|
|
{ name: "ListSiteTinyURLs", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["TinyURL"], description: "List all the tiny URLs linked to a specific site resource." }, "api.rscType": "Site", "api.roles": "", "google.api.method_visibility": { restriction: "SDK" }, "google.api.http": { post: "/api.TinyURLService/ListSiteTinyURLs", body: "*" } }, I: ListSiteTinyURLsRequest, O: ListSiteTinyURLsResponse },
|
|
{ name: "ListPartnerAppTinyURLs", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["TinyURL"], description: "List all the tiny URLs linked to a specific partnerApp resource." }, "api.rscType": "PartnerApp", "api.roles": "", "google.api.method_visibility": { restriction: "SDK" }, "google.api.http": { post: "/api.TinyURLService/ListPartnerAppTinyURLs", body: "*" } }, I: ListPartnerAppTinyURLsRequest, O: ListPartnerAppTinyURLsResponse },
|
|
{ name: "DeleteSiteTinyURL", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["TinyURL"], description: "Delete a tiny URL linked to a specific site resource." }, "api.rscType": "Site", "api.roles": "", "google.api.method_visibility": { restriction: "SDK" }, "google.api.http": { post: "/api.TinyURLService/DeleteSiteTinyURL", body: "*" } }, I: DeleteSiteTinyURLRequest, O: DeleteSiteTinyURLResponse },
|
|
{ name: "DeletePartnerAppTinyURL", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["TinyURL"], description: "Delete a tiny URL linked to a specific partnerApp resource." }, "api.rscType": "PartnerApp", "api.roles": "", "google.api.method_visibility": { restriction: "SDK" }, "google.api.http": { post: "/api.TinyURLService/DeletePartnerAppTinyURL", body: "*" } }, I: DeletePartnerAppTinyURLRequest, O: DeletePartnerAppTinyURLResponse },
|
|
{ name: "GetLongURL", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["TinyURL"], description: "Redirect to the original long URL." }, "api.rscType": "", "api.roles": "", "google.api.method_visibility": { restriction: "SDK" }, "google.api.http": { get: "/t/{ID}" } }, I: GetLongURLRequest, O: GetLongURLResult },
|
|
{ name: "DownloadFile", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["TinyURL"], description: "Downloads a previously uploaded file using its unique URL. Can be embedded in HTML, for example: <img src=\"https://t.reflex-platform.com/p/UUID?token=...\">" }, "api.rscType": "", "api.roles": "", "google.api.method_visibility": { restriction: "SDK" }, "google.api.http": { get: "/p/{ID}" } }, I: DownloadFileRequest, O: HttpBody }
|
|
]);
|