Skip to content

Commit

Permalink
chore: update cloudapi
Browse files Browse the repository at this point in the history
  • Loading branch information
GermanVor committed Oct 10, 2024
1 parent 5ea9902 commit 93a2ff9
Show file tree
Hide file tree
Showing 36 changed files with 7,657 additions and 66 deletions.
13 changes: 1 addition & 12 deletions scripts/generate-code.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,9 @@ for (const projectDir of projectsDirs) {
const relativePath = path
.relative(projectDir, modulePath)
.replace('.ts', '');

const relativePathSegments = relativePath.split(path.sep);
const firstPathSegment = relativePathSegments[0];
const moduleName = path.basename(modulePath);
const serviceName = moduleName.replace('_service', '');

// Do not use 'vX' as prefixes
const usePathSegmentAsPrefix = relativePathSegments.length > 1
&& firstPathSegment.length > 2
&& firstPathSegment !== serviceName;

const moduleAlias = relativePathSegments.join('_');

Expand Down Expand Up @@ -117,11 +111,6 @@ for (const projectDir of projectsDirs) {
}
}

const toCamelCase = (str: string) => str
.split('_')
.map((str) => str.charAt(0).toUpperCase() + str.slice(1))
.join('');

logger.debug('Generating root index module');

const rootIndexModulePath = path.join(GENERATED_PROJECTS_DIR, 'index.ts');
Expand Down
2 changes: 1 addition & 1 deletion src/generated/google/protobuf/struct.ts
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ export const ListValue = {
},

wrap(value: Array<any>): ListValue {
return { $type: "google.protobuf.ListValue", values: value };
return { values: value };

Check failure on line 500 in src/generated/google/protobuf/struct.ts

View workflow job for this annotation

GitHub Actions / build

Property '$type' is missing in type '{ values: any[]; }' but required in type 'ListValue'.
},

unwrap(message: ListValue): Array<any> {
Expand Down
4 changes: 2 additions & 2 deletions src/generated/yandex/cloud/ai/ocr/v1/ocr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export interface TextAnnotation {
tables: Table[];
/** Full text recognized from image. */
fullText: string;
/** Angle of rotate image */
/** Angle of image rotation. */
rotate: Angle;
}

Expand Down Expand Up @@ -122,7 +122,7 @@ export interface Line {
words: Word[];
/** Line position from full_text string. */
textSegments: TextSegments[];
/** Angle of rotate line */
/** Angle of line rotation. */
orientation: Angle;
}

Expand Down
10 changes: 5 additions & 5 deletions src/generated/yandex/cloud/ai/ocr/v1/ocr_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,23 @@ export interface RecognizeTextRequest {
/**
* Specifications of the ([MIME type](https://en.wikipedia.org/wiki/Media_type)). Each specification contains the file to analyze and features to use for analysis. Restrictions:
* * Supported file formats: `JPEG`, `PNG`, `PDF`.
* * Maximum file size: 20 MB.
* * Maximum file size: see [documentation](/docs/vision/concepts/limits).
* * Image size should not exceed 20M pixels (length x width).
* * The number of pages in a PDF file should not exceed 200 (each page counts as 1 request).
* * The number of pages in a PDF file should not exceed 1.
*/
mimeType: string;
/**
* List of the languages to recognize text.
* [List of the languages](/docs/vision/concepts/ocr/supported-languages) to recognize text.
* Specified in [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) format (for example, `ru`).
*/
languageCodes: string[];
/** Model to use for text detection. */
/** [Model](/docs/vision/concepts/ocr/template-recognition#models) to use for text detection. */
model: string;
}

export interface RecognizeTextResponse {
$type: "yandex.cloud.ai.ocr.v1.RecognizeTextResponse";
/** Recognized text blocks in this page or text from entities. */
/** Recognized text blocks in page or text from entities. */
textAnnotation?: TextAnnotation;
/** Page number in PDF file. */
page: number;
Expand Down
14 changes: 14 additions & 0 deletions src/generated/yandex/cloud/cic/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
export * as v1_partner from './v1/partner'
export * as v1_partner_service from './v1/partner_service'
export * as v1_peering from './v1/peering'
export * as v1_point_of_presence from './v1/point_of_presence'
export * as v1_point_of_presence_service from './v1/point_of_presence_service'
export * as v1_private_connection from './v1/private_connection'
export * as v1_private_connection_service from './v1/private_connection_service'
export * as v1_public_connection from './v1/public_connection'
export * as v1_public_connection_service from './v1/public_connection_service'
export * as v1_trunk_connection from './v1/trunk_connection'
export * as v1_trunk_connection_service from './v1/trunk_connection_service'
export * as v1_common_lag_allocation_settings from './v1/common/lag_allocation_settings'
export * as v1_common_lag_info from './v1/common/lag_info'
export * as v1_common_transceiver_type from './v1/common/transceiver_type'
238 changes: 238 additions & 0 deletions src/generated/yandex/cloud/cic/v1/common/lag_allocation_settings.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,238 @@
/* eslint-disable */
import { messageTypeRegistry } from "../../../../../typeRegistry";
import Long from "long";
import _m0 from "protobufjs/minimal";
import { LagInfo } from "../../../../../yandex/cloud/cic/v1/common/lag_info";

export const protobufPackage = "yandex.cloud.cic.v1.common";

/** Structure for create and update requests that describes LAG allocation settings */
export interface LagAllocationSettingsRequest {
$type: "yandex.cloud.cic.v1.common.LagAllocationSettingsRequest";
/**
* Size of LAG.
* Must be from 1 to 10 inclusively.
*/
lagSize: number | undefined;
/** LagInfo */
lagInfo?: LagInfo | undefined;
}

/** Structure that describes LAG allocation settings */
export interface LagAllocationSettings {
$type: "yandex.cloud.cic.v1.common.LagAllocationSettings";
/** LagInfo */
lagInfo?: LagInfo;
}

const baseLagAllocationSettingsRequest: object = {
$type: "yandex.cloud.cic.v1.common.LagAllocationSettingsRequest",
};

export const LagAllocationSettingsRequest = {
$type: "yandex.cloud.cic.v1.common.LagAllocationSettingsRequest" as const,

encode(
message: LagAllocationSettingsRequest,
writer: _m0.Writer = _m0.Writer.create()
): _m0.Writer {
if (message.lagSize !== undefined) {
writer.uint32(104).int64(message.lagSize);
}
if (message.lagInfo !== undefined) {
LagInfo.encode(message.lagInfo, writer.uint32(114).fork()).ldelim();
}
return writer;
},

decode(
input: _m0.Reader | Uint8Array,
length?: number
): LagAllocationSettingsRequest {
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = {
...baseLagAllocationSettingsRequest,
} as LagAllocationSettingsRequest;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 13:
message.lagSize = longToNumber(reader.int64() as Long);
break;
case 14:
message.lagInfo = LagInfo.decode(reader, reader.uint32());
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},

fromJSON(object: any): LagAllocationSettingsRequest {
const message = {
...baseLagAllocationSettingsRequest,
} as LagAllocationSettingsRequest;
message.lagSize =
object.lagSize !== undefined && object.lagSize !== null
? Number(object.lagSize)
: undefined;
message.lagInfo =
object.lagInfo !== undefined && object.lagInfo !== null
? LagInfo.fromJSON(object.lagInfo)
: undefined;
return message;
},

toJSON(message: LagAllocationSettingsRequest): unknown {
const obj: any = {};
message.lagSize !== undefined &&
(obj.lagSize = Math.round(message.lagSize));
message.lagInfo !== undefined &&
(obj.lagInfo = message.lagInfo
? LagInfo.toJSON(message.lagInfo)
: undefined);
return obj;
},

fromPartial<I extends Exact<DeepPartial<LagAllocationSettingsRequest>, I>>(
object: I
): LagAllocationSettingsRequest {
const message = {
...baseLagAllocationSettingsRequest,
} as LagAllocationSettingsRequest;
message.lagSize = object.lagSize ?? undefined;
message.lagInfo =
object.lagInfo !== undefined && object.lagInfo !== null
? LagInfo.fromPartial(object.lagInfo)
: undefined;
return message;
},
};

messageTypeRegistry.set(
LagAllocationSettingsRequest.$type,
LagAllocationSettingsRequest
);

const baseLagAllocationSettings: object = {
$type: "yandex.cloud.cic.v1.common.LagAllocationSettings",
};

export const LagAllocationSettings = {
$type: "yandex.cloud.cic.v1.common.LagAllocationSettings" as const,

encode(
message: LagAllocationSettings,
writer: _m0.Writer = _m0.Writer.create()
): _m0.Writer {
if (message.lagInfo !== undefined) {
LagInfo.encode(message.lagInfo, writer.uint32(114).fork()).ldelim();
}
return writer;
},

decode(
input: _m0.Reader | Uint8Array,
length?: number
): LagAllocationSettings {
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = { ...baseLagAllocationSettings } as LagAllocationSettings;
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 14:
message.lagInfo = LagInfo.decode(reader, reader.uint32());
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},

fromJSON(object: any): LagAllocationSettings {
const message = { ...baseLagAllocationSettings } as LagAllocationSettings;
message.lagInfo =
object.lagInfo !== undefined && object.lagInfo !== null
? LagInfo.fromJSON(object.lagInfo)
: undefined;
return message;
},

toJSON(message: LagAllocationSettings): unknown {
const obj: any = {};
message.lagInfo !== undefined &&
(obj.lagInfo = message.lagInfo
? LagInfo.toJSON(message.lagInfo)
: undefined);
return obj;
},

fromPartial<I extends Exact<DeepPartial<LagAllocationSettings>, I>>(
object: I
): LagAllocationSettings {
const message = { ...baseLagAllocationSettings } as LagAllocationSettings;
message.lagInfo =
object.lagInfo !== undefined && object.lagInfo !== null
? LagInfo.fromPartial(object.lagInfo)
: undefined;
return message;
},
};

messageTypeRegistry.set(LagAllocationSettings.$type, LagAllocationSettings);

declare var self: any | undefined;
declare var window: any | undefined;
declare var global: any | undefined;
var globalThis: any = (() => {
if (typeof globalThis !== "undefined") return globalThis;
if (typeof self !== "undefined") return self;
if (typeof window !== "undefined") return window;
if (typeof global !== "undefined") return global;
throw "Unable to locate global object";
})();

type Builtin =
| Date
| Function
| Uint8Array
| string
| number
| boolean
| undefined;

export type DeepPartial<T> = T extends Builtin
? T
: T extends Array<infer U>
? Array<DeepPartial<U>>
: T extends ReadonlyArray<infer U>
? ReadonlyArray<DeepPartial<U>>
: T extends {}
? { [K in Exclude<keyof T, "$type">]?: DeepPartial<T[K]> }
: Partial<T>;

type KeysOfUnion<T> = T extends T ? keyof T : never;
export type Exact<P, I extends P> = P extends Builtin
? P
: P & { [K in keyof P]: Exact<P[K], I[K]> } & Record<
Exclude<keyof I, KeysOfUnion<P> | "$type">,
never
>;

function longToNumber(long: Long): number {
if (long.gt(Number.MAX_SAFE_INTEGER)) {
throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
}
return long.toNumber();
}

if (_m0.util.Long !== Long) {
_m0.util.Long = Long as any;
_m0.configure();
}
Loading

0 comments on commit 93a2ff9

Please sign in to comment.