Files
npm-core-sdk/tiny-url.ts
2025-07-01 08:57:10 +00:00

1841 lines
93 KiB
TypeScript

// @generated by protobuf-ts 2.11.1 with parameter use_proto_field_name,keep_enum_prefix
// @generated from protobuf file "tiny-url.proto" (package "api", syntax proto3)
// tslint:disable
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 { FileDataResponse } from "./shared";
import { FileDataRequest } from "./shared";
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.TinyURLData
*/
export interface TinyURLData {
/**
* @generated from protobuf field: string LongURL = 1
*/
LongURL: string;
/**
* @generated from protobuf field: api.FileMetadata File = 2
*/
File?: FileMetadata;
}
/**
* @generated from protobuf message api.TinyURL
*/
export interface TinyURL {
/**
* @generated from protobuf field: string ID = 1
*/
ID: string;
/**
* @generated from protobuf field: api.TinyURLKind Kind = 2
*/
Kind: TinyURLKind;
/**
* @generated from protobuf field: api.TinyURLData Data = 3
*/
Data?: TinyURLData;
/**
* @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: int64 TimeToLive = 7
*/
TimeToLive: bigint;
/**
* @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;
}
// ========== 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: int64 TimeToLive = 3
*/
TimeToLive: bigint;
/**
* @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: int64 TimeToLive = 3
*/
TimeToLive: bigint;
/**
* @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.FileDataRequest FileData = 2
*/
FileData?: FileDataRequest;
/**
* @generated from protobuf field: int64 TimeToLive = 3
*/
TimeToLive: bigint;
/**
* @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.FileDataRequest FileData = 2
*/
FileData?: FileDataRequest;
/**
* @generated from protobuf field: int64 TimeToLive = 3
*/
TimeToLive: bigint;
/**
* @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.GetSiteTinyURLRequest
*/
export interface GetSiteTinyURLRequest {
/**
* @generated from protobuf field: api.RequestSiteHeader Header = 1
*/
Header?: RequestSiteHeader;
/**
* @generated from protobuf field: string ID = 2
*/
ID: string;
}
/**
* @generated from protobuf message api.GetSiteTinyURLResult
*/
export interface GetSiteTinyURLResult {
/**
* @generated from protobuf field: api.TinyURLKind Kind = 1
*/
Kind: TinyURLKind;
/**
* @generated from protobuf field: api.FileDataResponse File = 2
*/
File?: FileDataResponse;
/**
* @generated from protobuf field: string LongURL = 3
*/
LongURL: string;
}
/**
* @generated from protobuf message api.GetPartnerAppTinyURLRequest
*/
export interface GetPartnerAppTinyURLRequest {
/**
* @generated from protobuf field: api.RequestPartnerAppHeader Header = 1
*/
Header?: RequestPartnerAppHeader;
/**
* @generated from protobuf field: string ID = 2
*/
ID: string;
}
/**
* @generated from protobuf message api.GetPartnerAppTinyURLResult
*/
export interface GetPartnerAppTinyURLResult {
/**
* @generated from protobuf field: api.TinyURLKind Kind = 1
*/
Kind: TinyURLKind;
/**
* @generated from protobuf field: api.FileDataResponse File = 2
*/
File?: FileDataResponse;
/**
* @generated from protobuf field: string LongURL = 3
*/
LongURL: string;
}
/**
* @generated from protobuf message api.DeleteAllTinyURLsRequest
*/
export interface DeleteAllTinyURLsRequest {
/**
* @generated from protobuf field: api.ResourceType ResourceType = 1
*/
ResourceType: ResourceType;
/**
* @generated from protobuf field: string ResourceRefID = 2
*/
ResourceRefID: string;
}
/**
* @generated from protobuf message api.DeleteAllTinyURLsResult
*/
export interface DeleteAllTinyURLsResult {
}
// ========== MODEL MESSAGES ==========
/**
* @generated from protobuf enum api.TinyURLKind
*/
export enum TinyURLKind {
/**
* @generated from protobuf enum value: TINYURL_KIND_UNKNOWN = 0;
*/
TINYURL_KIND_UNKNOWN = 0,
/**
* @generated from protobuf enum value: TINYURL_KIND_FILE = 1;
*/
TINYURL_KIND_FILE = 1,
/**
* @generated from protobuf enum value: TINYURL_KIND_URL = 2;
*/
TINYURL_KIND_URL = 2
}
// @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 TinyURLData$Type extends MessageType<TinyURLData> {
constructor() {
super("api.TinyURLData", [
{ no: 1, name: "LongURL", kind: "scalar", localName: "LongURL", jsonName: "LongURL", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } },
{ no: 2, name: "File", kind: "message", localName: "File", jsonName: "File", T: () => FileMetadata }
]);
}
create(value?: PartialMessage<TinyURLData>): TinyURLData {
const message = globalThis.Object.create((this.messagePrototype!));
message.LongURL = "";
if (value !== undefined)
reflectionMergePartial<TinyURLData>(this, message, value);
return message;
}
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: TinyURLData): TinyURLData {
let message = target ?? this.create(), end = reader.pos + length;
while (reader.pos < end) {
let [fieldNo, wireType] = reader.tag();
switch (fieldNo) {
case /* string LongURL */ 1:
message.LongURL = reader.string();
break;
case /* api.FileMetadata File */ 2:
message.File = FileMetadata.internalBinaryRead(reader, reader.uint32(), options, message.File);
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: TinyURLData, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
/* string LongURL = 1; */
if (message.LongURL !== "")
writer.tag(1, WireType.LengthDelimited).string(message.LongURL);
/* api.FileMetadata File = 2; */
if (message.File)
FileMetadata.internalBinaryWrite(message.File, writer.tag(2, 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.TinyURLData
*/
export const TinyURLData = new TinyURLData$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: "Kind", kind: "enum", localName: "Kind", jsonName: "Kind", T: () => ["api.TinyURLKind", TinyURLKind], options: { "validate.rules": { enum: { definedOnly: true } } } },
{ no: 3, name: "Data", kind: "message", localName: "Data", jsonName: "Data", T: () => TinyURLData, options: { "validate.rules": { message: { required: true } } } },
{ no: 4, name: "URL", kind: "scalar", localName: "URL", jsonName: "URL", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Shortened URL used to retrieve the original data (URL or file)." } } },
{ 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: "scalar", localName: "TimeToLive", jsonName: "TimeToLive", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/, options: { "validate.rules": { int64: { lte: "1500000000" } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Specifies the time to live (TTL) of the TinyURL in seconds, limited to fifty years. A value of zero or less indicates an infinite TTL." } } },
{ 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.Kind = 0;
message.URL = "";
message.ResourceType = 0;
message.ResourceRefID = "";
message.TimeToLive = 0n;
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 /* api.TinyURLKind Kind */ 2:
message.Kind = reader.int32();
break;
case /* api.TinyURLData Data */ 3:
message.Data = TinyURLData.internalBinaryRead(reader, reader.uint32(), options, message.Data);
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 /* int64 TimeToLive */ 7:
message.TimeToLive = reader.int64().toBigInt();
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);
/* api.TinyURLKind Kind = 2; */
if (message.Kind !== 0)
writer.tag(2, WireType.Varint).int32(message.Kind);
/* api.TinyURLData Data = 3; */
if (message.Data)
TinyURLData.internalBinaryWrite(message.Data, 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);
/* int64 TimeToLive = 7; */
if (message.TimeToLive !== 0n)
writer.tag(7, WireType.Varint).int64(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 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: "scalar", localName: "TimeToLive", jsonName: "TimeToLive", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/, options: { "validate.rules": { int64: { lte: "1500000000" } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Specifies the time to live (TTL) of the TinyURL in seconds, limited to fifty years. A value of zero or less indicates an infinite TTL." } } },
{ 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 = 0n;
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 /* int64 TimeToLive */ 3:
message.TimeToLive = reader.int64().toBigInt();
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);
/* int64 TimeToLive = 3; */
if (message.TimeToLive !== 0n)
writer.tag(3, WireType.Varint).int64(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: "scalar", localName: "TimeToLive", jsonName: "TimeToLive", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/, options: { "validate.rules": { int64: { lte: "1500000000" } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Specifies the time to live (TTL) of the TinyURL in seconds, limited to fifty years. A value of zero or less indicates an infinite TTL." } } },
{ 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 = 0n;
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 /* int64 TimeToLive */ 3:
message.TimeToLive = reader.int64().toBigInt();
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);
/* int64 TimeToLive = 3; */
if (message.TimeToLive !== 0n)
writer.tag(3, WireType.Varint).int64(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: () => FileDataRequest, options: { "validate.rules": { message: { required: true } } } },
{ no: 3, name: "TimeToLive", kind: "scalar", localName: "TimeToLive", jsonName: "TimeToLive", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/, options: { "validate.rules": { int64: { lte: "1500000000" } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Specifies the time to live (TTL) of the TinyURL in seconds, limited to fifty years. A value of zero or less indicates an infinite TTL." } } },
{ 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 = 0n;
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.FileDataRequest FileData */ 2:
message.FileData = FileDataRequest.internalBinaryRead(reader, reader.uint32(), options, message.FileData);
break;
case /* int64 TimeToLive */ 3:
message.TimeToLive = reader.int64().toBigInt();
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.FileDataRequest FileData = 2; */
if (message.FileData)
FileDataRequest.internalBinaryWrite(message.FileData, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
/* int64 TimeToLive = 3; */
if (message.TimeToLive !== 0n)
writer.tag(3, WireType.Varint).int64(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: () => FileDataRequest, options: { "validate.rules": { message: { required: true } } } },
{ no: 3, name: "TimeToLive", kind: "scalar", localName: "TimeToLive", jsonName: "TimeToLive", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/, options: { "validate.rules": { int64: { lte: "1500000000" } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Specifies the time to live (TTL) of the TinyURL in seconds, limited to fifty years. A value of zero or less indicates an infinite TTL." } } },
{ 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 = 0n;
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.FileDataRequest FileData */ 2:
message.FileData = FileDataRequest.internalBinaryRead(reader, reader.uint32(), options, message.FileData);
break;
case /* int64 TimeToLive */ 3:
message.TimeToLive = reader.int64().toBigInt();
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.FileDataRequest FileData = 2; */
if (message.FileData)
FileDataRequest.internalBinaryWrite(message.FileData, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
/* int64 TimeToLive = 3; */
if (message.TimeToLive !== 0n)
writer.tag(3, WireType.Varint).int64(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 GetSiteTinyURLRequest$Type extends MessageType<GetSiteTinyURLRequest> {
constructor() {
super("api.GetSiteTinyURLRequest", [
{ 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<GetSiteTinyURLRequest>): GetSiteTinyURLRequest {
const message = globalThis.Object.create((this.messagePrototype!));
message.ID = "";
if (value !== undefined)
reflectionMergePartial<GetSiteTinyURLRequest>(this, message, value);
return message;
}
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetSiteTinyURLRequest): GetSiteTinyURLRequest {
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: GetSiteTinyURLRequest, 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.GetSiteTinyURLRequest
*/
export const GetSiteTinyURLRequest = new GetSiteTinyURLRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class GetSiteTinyURLResult$Type extends MessageType<GetSiteTinyURLResult> {
constructor() {
super("api.GetSiteTinyURLResult", [
{ no: 1, name: "Kind", kind: "enum", localName: "Kind", jsonName: "Kind", T: () => ["api.TinyURLKind", TinyURLKind] },
{ no: 2, name: "File", kind: "message", localName: "File", jsonName: "File", T: () => FileDataResponse },
{ no: 3, name: "LongURL", kind: "scalar", localName: "LongURL", jsonName: "LongURL", T: 9 /*ScalarType.STRING*/ }
]);
}
create(value?: PartialMessage<GetSiteTinyURLResult>): GetSiteTinyURLResult {
const message = globalThis.Object.create((this.messagePrototype!));
message.Kind = 0;
message.LongURL = "";
if (value !== undefined)
reflectionMergePartial<GetSiteTinyURLResult>(this, message, value);
return message;
}
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetSiteTinyURLResult): GetSiteTinyURLResult {
let message = target ?? this.create(), end = reader.pos + length;
while (reader.pos < end) {
let [fieldNo, wireType] = reader.tag();
switch (fieldNo) {
case /* api.TinyURLKind Kind */ 1:
message.Kind = reader.int32();
break;
case /* api.FileDataResponse File */ 2:
message.File = FileDataResponse.internalBinaryRead(reader, reader.uint32(), options, message.File);
break;
case /* string LongURL */ 3:
message.LongURL = 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: GetSiteTinyURLResult, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
/* api.TinyURLKind Kind = 1; */
if (message.Kind !== 0)
writer.tag(1, WireType.Varint).int32(message.Kind);
/* api.FileDataResponse File = 2; */
if (message.File)
FileDataResponse.internalBinaryWrite(message.File, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
/* string LongURL = 3; */
if (message.LongURL !== "")
writer.tag(3, WireType.LengthDelimited).string(message.LongURL);
let u = options.writeUnknownFields;
if (u !== false)
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
return writer;
}
}
/**
* @generated MessageType for protobuf message api.GetSiteTinyURLResult
*/
export const GetSiteTinyURLResult = new GetSiteTinyURLResult$Type();
// @generated message type with reflection information, may provide speed optimized methods
class GetPartnerAppTinyURLRequest$Type extends MessageType<GetPartnerAppTinyURLRequest> {
constructor() {
super("api.GetPartnerAppTinyURLRequest", [
{ 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<GetPartnerAppTinyURLRequest>): GetPartnerAppTinyURLRequest {
const message = globalThis.Object.create((this.messagePrototype!));
message.ID = "";
if (value !== undefined)
reflectionMergePartial<GetPartnerAppTinyURLRequest>(this, message, value);
return message;
}
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetPartnerAppTinyURLRequest): GetPartnerAppTinyURLRequest {
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: GetPartnerAppTinyURLRequest, 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.GetPartnerAppTinyURLRequest
*/
export const GetPartnerAppTinyURLRequest = new GetPartnerAppTinyURLRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class GetPartnerAppTinyURLResult$Type extends MessageType<GetPartnerAppTinyURLResult> {
constructor() {
super("api.GetPartnerAppTinyURLResult", [
{ no: 1, name: "Kind", kind: "enum", localName: "Kind", jsonName: "Kind", T: () => ["api.TinyURLKind", TinyURLKind] },
{ no: 2, name: "File", kind: "message", localName: "File", jsonName: "File", T: () => FileDataResponse },
{ no: 3, name: "LongURL", kind: "scalar", localName: "LongURL", jsonName: "LongURL", T: 9 /*ScalarType.STRING*/ }
]);
}
create(value?: PartialMessage<GetPartnerAppTinyURLResult>): GetPartnerAppTinyURLResult {
const message = globalThis.Object.create((this.messagePrototype!));
message.Kind = 0;
message.LongURL = "";
if (value !== undefined)
reflectionMergePartial<GetPartnerAppTinyURLResult>(this, message, value);
return message;
}
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetPartnerAppTinyURLResult): GetPartnerAppTinyURLResult {
let message = target ?? this.create(), end = reader.pos + length;
while (reader.pos < end) {
let [fieldNo, wireType] = reader.tag();
switch (fieldNo) {
case /* api.TinyURLKind Kind */ 1:
message.Kind = reader.int32();
break;
case /* api.FileDataResponse File */ 2:
message.File = FileDataResponse.internalBinaryRead(reader, reader.uint32(), options, message.File);
break;
case /* string LongURL */ 3:
message.LongURL = 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: GetPartnerAppTinyURLResult, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
/* api.TinyURLKind Kind = 1; */
if (message.Kind !== 0)
writer.tag(1, WireType.Varint).int32(message.Kind);
/* api.FileDataResponse File = 2; */
if (message.File)
FileDataResponse.internalBinaryWrite(message.File, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
/* string LongURL = 3; */
if (message.LongURL !== "")
writer.tag(3, WireType.LengthDelimited).string(message.LongURL);
let u = options.writeUnknownFields;
if (u !== false)
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
return writer;
}
}
/**
* @generated MessageType for protobuf message api.GetPartnerAppTinyURLResult
*/
export const GetPartnerAppTinyURLResult = new GetPartnerAppTinyURLResult$Type();
// @generated message type with reflection information, may provide speed optimized methods
class DeleteAllTinyURLsRequest$Type extends MessageType<DeleteAllTinyURLsRequest> {
constructor() {
super("api.DeleteAllTinyURLsRequest", [
{ no: 1, name: "ResourceType", kind: "enum", localName: "ResourceType", jsonName: "ResourceType", T: () => ["api.ResourceType", ResourceType], options: { "validate.rules": { enum: { definedOnly: true } } } },
{ no: 2, name: "ResourceRefID", kind: "scalar", localName: "ResourceRefID", jsonName: "ResourceRefID", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } }
], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["ResourceType", "ResourceRefID"] } } });
}
create(value?: PartialMessage<DeleteAllTinyURLsRequest>): DeleteAllTinyURLsRequest {
const message = globalThis.Object.create((this.messagePrototype!));
message.ResourceType = 0;
message.ResourceRefID = "";
if (value !== undefined)
reflectionMergePartial<DeleteAllTinyURLsRequest>(this, message, value);
return message;
}
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DeleteAllTinyURLsRequest): DeleteAllTinyURLsRequest {
let message = target ?? this.create(), end = reader.pos + length;
while (reader.pos < end) {
let [fieldNo, wireType] = reader.tag();
switch (fieldNo) {
case /* api.ResourceType ResourceType */ 1:
message.ResourceType = reader.int32();
break;
case /* string ResourceRefID */ 2:
message.ResourceRefID = 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: DeleteAllTinyURLsRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
/* api.ResourceType ResourceType = 1; */
if (message.ResourceType !== 0)
writer.tag(1, WireType.Varint).int32(message.ResourceType);
/* string ResourceRefID = 2; */
if (message.ResourceRefID !== "")
writer.tag(2, WireType.LengthDelimited).string(message.ResourceRefID);
let u = options.writeUnknownFields;
if (u !== false)
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
return writer;
}
}
/**
* @generated MessageType for protobuf message api.DeleteAllTinyURLsRequest
*/
export const DeleteAllTinyURLsRequest = new DeleteAllTinyURLsRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class DeleteAllTinyURLsResult$Type extends MessageType<DeleteAllTinyURLsResult> {
constructor() {
super("api.DeleteAllTinyURLsResult", []);
}
create(value?: PartialMessage<DeleteAllTinyURLsResult>): DeleteAllTinyURLsResult {
const message = globalThis.Object.create((this.messagePrototype!));
if (value !== undefined)
reflectionMergePartial<DeleteAllTinyURLsResult>(this, message, value);
return message;
}
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DeleteAllTinyURLsResult): DeleteAllTinyURLsResult {
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: DeleteAllTinyURLsResult, 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.DeleteAllTinyURLsResult
*/
export const DeleteAllTinyURLsResult = new DeleteAllTinyURLsResult$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" } }, 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" } }, 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. <br>Must be called using a multipart form-data content type request. <br> Example of curl request : curl -X POST https://$REFLEXPLATFORM_REST_URL/api.TinyURLService/UploadSiteFile -H Authorization: $TOKEN -F File=\"@path/to/my/file/to/upload\" -F SiteID=mySiteID -F TimeToLive=-1 -F IsPublic=false -F IsOnce=false" }, "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. <br>Must be called using a multipart form-data content type request. <br> Example of curl request : curl -X POST https://$REFLEXPLATFORM_REST_URL/api.TinyURLService/UploadPartnerAppFile -H Authorization: $TOKEN -F File=\"@path/to/my/file/to/upload\" -F PartnerAppID=myPartnerAppID -F TimeToLive=-1 -F IsPublic=false -F IsOnce=false" }, "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" } }, 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" } }, 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" } }, 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" } }, I: DeletePartnerAppTinyURLRequest, O: DeletePartnerAppTinyURLResponse },
{ name: "GetSiteTinyURL", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["TinyURL"], description: "Get a tiny URL linked to a specific site resource. Can be a link or a file." }, "api.rscType": "Site", "api.roles": "", "google.api.method_visibility": { restriction: "SDK" } }, I: GetSiteTinyURLRequest, O: GetSiteTinyURLResult },
{ name: "GetPartnerAppTinyURL", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["TinyURL"], description: "Get a tiny URL linked to a specific partner app resource. Can be a link or a file." }, "api.rscType": "PartnerApp", "api.roles": "", "google.api.method_visibility": { restriction: "SDK" } }, I: GetPartnerAppTinyURLRequest, O: GetPartnerAppTinyURLResult },
{ name: "DeleteAll", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["TinyURL"], description: "Delete all tiny URLs linked to a resource" }, "api.rscType": "Platform", "api.roles": "Platform.Organisation-Deletion", "google.api.method_visibility": { restriction: "INTERNAL" } }, I: DeleteAllTinyURLsRequest, O: DeleteAllTinyURLsResult }
], { "api.k8sService": "tiny-url-server" });