UNPKG

@yandex-cloud/nodejs-sdk

Version:
395 lines (394 loc) 19.1 kB
/// <reference types="node" /> import { ChannelCredentials, ChannelOptions, UntypedServiceImplementation, handleUnaryCall, Client, ClientUnaryCall, Metadata, CallOptions, ServiceError } from "@grpc/grpc-js"; import _m0 from "protobufjs/minimal"; import { UserSpec, User } from "../../../../../yandex/cloud/mdb/elasticsearch/v1/user"; import { FieldMask } from "../../../../../google/protobuf/field_mask"; import { Operation } from "../../../../../yandex/cloud/operation/operation"; export declare const protobufPackage = "yandex.cloud.mdb.elasticsearch.v1"; export interface GetUserRequest { $type: "yandex.cloud.mdb.elasticsearch.v1.GetUserRequest"; /** * ID of the Elasticsearch cluster the user belongs to. * * To get the cluster ID, make a [ClusterService.List] request. */ clusterId: string; /** * Name of the Elasticsearch user to return. * * To get the name of the user, make a [UserService.List] request. */ userName: string; } export interface ListUsersRequest { $type: "yandex.cloud.mdb.elasticsearch.v1.ListUsersRequest"; /** * ID of the Elasticsearch cluster to list Elasticsearch users in. * * To get the cluster ID, use a [ClusterService.List] request. */ clusterId: string; /** * The maximum number of results per page to return. * * If the number of available results is larger than `page_size`, the service returns a [ListUsersResponse.next_page_token] that can be used to get the next page of results in subsequent list requests. */ pageSize: number; /** * Page token. * * To get the next page of results, set `page_token` to the [ListUsersResponse.next_page_token] returned by the previous list request. */ pageToken: string; } export interface ListUsersResponse { $type: "yandex.cloud.mdb.elasticsearch.v1.ListUsersResponse"; /** List of Elasticsearch users. */ users: User[]; /** * This token allows you to get the next page of results for list requests. * * If the number of results is larger than [ListUsersRequest.page_size], use the `next_page_token` as the value for the [ListUsersRequest.page_token] parameter in the next list request. * Each subsequent list request will have its own `next_page_token` to continue paging through the results. */ nextPageToken: string; } export interface CreateUserRequest { $type: "yandex.cloud.mdb.elasticsearch.v1.CreateUserRequest"; /** * ID of the Elasticsearch cluster to create a user in. * * To get the cluster ID, make a [ClusterService.List] request. */ clusterId: string; /** Configuration of the user to create. */ userSpec?: UserSpec; } export interface CreateUserMetadata { $type: "yandex.cloud.mdb.elasticsearch.v1.CreateUserMetadata"; /** ID of the Elasticsearch cluster the user is being created in. */ clusterId: string; /** Name of the user that is being created. */ userName: string; } export interface UpdateUserRequest { $type: "yandex.cloud.mdb.elasticsearch.v1.UpdateUserRequest"; /** * ID of the Elasticsearch cluster the user belongs to. * * To get the cluster ID, make a [ClusterService.List] request. */ clusterId: string; /** * Name of the user to be updated. * * To get the name of the user, make a [UserService.List] request. */ userName: string; updateMask?: FieldMask; /** New password for the user. */ password: string; } export interface UpdateUserMetadata { $type: "yandex.cloud.mdb.elasticsearch.v1.UpdateUserMetadata"; /** ID of the Elasticsearch cluster the user belongs to. */ clusterId: string; /** Name of the user that is being updated. */ userName: string; } export interface DeleteUserRequest { $type: "yandex.cloud.mdb.elasticsearch.v1.DeleteUserRequest"; /** * ID of the Elasticsearch cluster the user belongs to. * * To get the cluster ID, make a [ClusterService.List] request. */ clusterId: string; /** * Name of the user to delete. * * To get the name of the user, make a [UserService.List] request. */ userName: string; } export interface DeleteUserMetadata { $type: "yandex.cloud.mdb.elasticsearch.v1.DeleteUserMetadata"; /** ID of the Elasticsearch cluster the user belongs to. */ clusterId: string; /** Name of the user that is being deleted. */ userName: string; } export declare const GetUserRequest: { $type: "yandex.cloud.mdb.elasticsearch.v1.GetUserRequest"; encode(message: GetUserRequest, writer?: _m0.Writer): _m0.Writer; decode(input: _m0.Reader | Uint8Array, length?: number | undefined): GetUserRequest; fromJSON(object: any): GetUserRequest; toJSON(message: GetUserRequest): unknown; fromPartial<I extends { clusterId?: string | undefined; userName?: string | undefined; } & { clusterId?: string | undefined; userName?: string | undefined; } & Record<Exclude<keyof I, "$type" | "clusterId" | "userName">, never>>(object: I): GetUserRequest; }; export declare const ListUsersRequest: { $type: "yandex.cloud.mdb.elasticsearch.v1.ListUsersRequest"; encode(message: ListUsersRequest, writer?: _m0.Writer): _m0.Writer; decode(input: _m0.Reader | Uint8Array, length?: number | undefined): ListUsersRequest; fromJSON(object: any): ListUsersRequest; toJSON(message: ListUsersRequest): unknown; fromPartial<I extends { pageSize?: number | undefined; pageToken?: string | undefined; clusterId?: string | undefined; } & { pageSize?: number | undefined; pageToken?: string | undefined; clusterId?: string | undefined; } & Record<Exclude<keyof I, "$type" | "pageSize" | "pageToken" | "clusterId">, never>>(object: I): ListUsersRequest; }; export declare const ListUsersResponse: { $type: "yandex.cloud.mdb.elasticsearch.v1.ListUsersResponse"; encode(message: ListUsersResponse, writer?: _m0.Writer): _m0.Writer; decode(input: _m0.Reader | Uint8Array, length?: number | undefined): ListUsersResponse; fromJSON(object: any): ListUsersResponse; toJSON(message: ListUsersResponse): unknown; fromPartial<I extends { nextPageToken?: string | undefined; users?: { name?: string | undefined; clusterId?: string | undefined; }[] | undefined; } & { nextPageToken?: string | undefined; users?: ({ name?: string | undefined; clusterId?: string | undefined; }[] & ({ name?: string | undefined; clusterId?: string | undefined; } & { name?: string | undefined; clusterId?: string | undefined; } & Record<Exclude<keyof I["users"][number], "$type" | "name" | "clusterId">, never>)[] & Record<Exclude<keyof I["users"], "$type" | keyof { name?: string | undefined; clusterId?: string | undefined; }[]>, never>) | undefined; } & Record<Exclude<keyof I, "$type" | "nextPageToken" | "users">, never>>(object: I): ListUsersResponse; }; export declare const CreateUserRequest: { $type: "yandex.cloud.mdb.elasticsearch.v1.CreateUserRequest"; encode(message: CreateUserRequest, writer?: _m0.Writer): _m0.Writer; decode(input: _m0.Reader | Uint8Array, length?: number | undefined): CreateUserRequest; fromJSON(object: any): CreateUserRequest; toJSON(message: CreateUserRequest): unknown; fromPartial<I extends { clusterId?: string | undefined; userSpec?: { name?: string | undefined; password?: string | undefined; } | undefined; } & { clusterId?: string | undefined; userSpec?: ({ name?: string | undefined; password?: string | undefined; } & { name?: string | undefined; password?: string | undefined; } & Record<Exclude<keyof I["userSpec"], "$type" | "name" | "password">, never>) | undefined; } & Record<Exclude<keyof I, "$type" | "clusterId" | "userSpec">, never>>(object: I): CreateUserRequest; }; export declare const CreateUserMetadata: { $type: "yandex.cloud.mdb.elasticsearch.v1.CreateUserMetadata"; encode(message: CreateUserMetadata, writer?: _m0.Writer): _m0.Writer; decode(input: _m0.Reader | Uint8Array, length?: number | undefined): CreateUserMetadata; fromJSON(object: any): CreateUserMetadata; toJSON(message: CreateUserMetadata): unknown; fromPartial<I extends { clusterId?: string | undefined; userName?: string | undefined; } & { clusterId?: string | undefined; userName?: string | undefined; } & Record<Exclude<keyof I, "$type" | "clusterId" | "userName">, never>>(object: I): CreateUserMetadata; }; export declare const UpdateUserRequest: { $type: "yandex.cloud.mdb.elasticsearch.v1.UpdateUserRequest"; encode(message: UpdateUserRequest, writer?: _m0.Writer): _m0.Writer; decode(input: _m0.Reader | Uint8Array, length?: number | undefined): UpdateUserRequest; fromJSON(object: any): UpdateUserRequest; toJSON(message: UpdateUserRequest): unknown; fromPartial<I extends { updateMask?: { paths?: string[] | undefined; } | undefined; clusterId?: string | undefined; password?: string | undefined; userName?: string | undefined; } & { updateMask?: ({ paths?: string[] | undefined; } & { paths?: (string[] & string[] & Record<Exclude<keyof I["updateMask"]["paths"], "$type" | keyof string[]>, never>) | undefined; } & Record<Exclude<keyof I["updateMask"], "$type" | "paths">, never>) | undefined; clusterId?: string | undefined; password?: string | undefined; userName?: string | undefined; } & Record<Exclude<keyof I, "$type" | "updateMask" | "clusterId" | "password" | "userName">, never>>(object: I): UpdateUserRequest; }; export declare const UpdateUserMetadata: { $type: "yandex.cloud.mdb.elasticsearch.v1.UpdateUserMetadata"; encode(message: UpdateUserMetadata, writer?: _m0.Writer): _m0.Writer; decode(input: _m0.Reader | Uint8Array, length?: number | undefined): UpdateUserMetadata; fromJSON(object: any): UpdateUserMetadata; toJSON(message: UpdateUserMetadata): unknown; fromPartial<I extends { clusterId?: string | undefined; userName?: string | undefined; } & { clusterId?: string | undefined; userName?: string | undefined; } & Record<Exclude<keyof I, "$type" | "clusterId" | "userName">, never>>(object: I): UpdateUserMetadata; }; export declare const DeleteUserRequest: { $type: "yandex.cloud.mdb.elasticsearch.v1.DeleteUserRequest"; encode(message: DeleteUserRequest, writer?: _m0.Writer): _m0.Writer; decode(input: _m0.Reader | Uint8Array, length?: number | undefined): DeleteUserRequest; fromJSON(object: any): DeleteUserRequest; toJSON(message: DeleteUserRequest): unknown; fromPartial<I extends { clusterId?: string | undefined; userName?: string | undefined; } & { clusterId?: string | undefined; userName?: string | undefined; } & Record<Exclude<keyof I, "$type" | "clusterId" | "userName">, never>>(object: I): DeleteUserRequest; }; export declare const DeleteUserMetadata: { $type: "yandex.cloud.mdb.elasticsearch.v1.DeleteUserMetadata"; encode(message: DeleteUserMetadata, writer?: _m0.Writer): _m0.Writer; decode(input: _m0.Reader | Uint8Array, length?: number | undefined): DeleteUserMetadata; fromJSON(object: any): DeleteUserMetadata; toJSON(message: DeleteUserMetadata): unknown; fromPartial<I extends { clusterId?: string | undefined; userName?: string | undefined; } & { clusterId?: string | undefined; userName?: string | undefined; } & Record<Exclude<keyof I, "$type" | "clusterId" | "userName">, never>>(object: I): DeleteUserMetadata; }; /** A set of methods for managing Elasticsearch users. */ export declare const UserServiceService: { /** * Returns the specified Elasticsearch user. * * To get the list of available Elasticsearch users, make a [List] request. */ readonly get: { readonly path: "/yandex.cloud.mdb.elasticsearch.v1.UserService/Get"; readonly requestStream: false; readonly responseStream: false; readonly requestSerialize: (value: GetUserRequest) => Buffer; readonly requestDeserialize: (value: Buffer) => GetUserRequest; readonly responseSerialize: (value: User) => Buffer; readonly responseDeserialize: (value: Buffer) => User; }; /** Retrieves the list of Elasticsearch users in the specified cluster. */ readonly list: { readonly path: "/yandex.cloud.mdb.elasticsearch.v1.UserService/List"; readonly requestStream: false; readonly responseStream: false; readonly requestSerialize: (value: ListUsersRequest) => Buffer; readonly requestDeserialize: (value: Buffer) => ListUsersRequest; readonly responseSerialize: (value: ListUsersResponse) => Buffer; readonly responseDeserialize: (value: Buffer) => ListUsersResponse; }; /** Creates a user in the specified cluster. */ readonly create: { readonly path: "/yandex.cloud.mdb.elasticsearch.v1.UserService/Create"; readonly requestStream: false; readonly responseStream: false; readonly requestSerialize: (value: CreateUserRequest) => Buffer; readonly requestDeserialize: (value: Buffer) => CreateUserRequest; readonly responseSerialize: (value: Operation) => Buffer; readonly responseDeserialize: (value: Buffer) => Operation; }; /** Updates the specified user. */ readonly update: { readonly path: "/yandex.cloud.mdb.elasticsearch.v1.UserService/Update"; readonly requestStream: false; readonly responseStream: false; readonly requestSerialize: (value: UpdateUserRequest) => Buffer; readonly requestDeserialize: (value: Buffer) => UpdateUserRequest; readonly responseSerialize: (value: Operation) => Buffer; readonly responseDeserialize: (value: Buffer) => Operation; }; /** Deletes the specified user. */ readonly delete: { readonly path: "/yandex.cloud.mdb.elasticsearch.v1.UserService/Delete"; readonly requestStream: false; readonly responseStream: false; readonly requestSerialize: (value: DeleteUserRequest) => Buffer; readonly requestDeserialize: (value: Buffer) => DeleteUserRequest; readonly responseSerialize: (value: Operation) => Buffer; readonly responseDeserialize: (value: Buffer) => Operation; }; }; export interface UserServiceServer extends UntypedServiceImplementation { /** * Returns the specified Elasticsearch user. * * To get the list of available Elasticsearch users, make a [List] request. */ get: handleUnaryCall<GetUserRequest, User>; /** Retrieves the list of Elasticsearch users in the specified cluster. */ list: handleUnaryCall<ListUsersRequest, ListUsersResponse>; /** Creates a user in the specified cluster. */ create: handleUnaryCall<CreateUserRequest, Operation>; /** Updates the specified user. */ update: handleUnaryCall<UpdateUserRequest, Operation>; /** Deletes the specified user. */ delete: handleUnaryCall<DeleteUserRequest, Operation>; } export interface UserServiceClient extends Client { /** * Returns the specified Elasticsearch user. * * To get the list of available Elasticsearch users, make a [List] request. */ get(request: GetUserRequest, callback: (error: ServiceError | null, response: User) => void): ClientUnaryCall; get(request: GetUserRequest, metadata: Metadata, callback: (error: ServiceError | null, response: User) => void): ClientUnaryCall; get(request: GetUserRequest, metadata: Metadata, options: Partial<CallOptions>, callback: (error: ServiceError | null, response: User) => void): ClientUnaryCall; /** Retrieves the list of Elasticsearch users in the specified cluster. */ list(request: ListUsersRequest, callback: (error: ServiceError | null, response: ListUsersResponse) => void): ClientUnaryCall; list(request: ListUsersRequest, metadata: Metadata, callback: (error: ServiceError | null, response: ListUsersResponse) => void): ClientUnaryCall; list(request: ListUsersRequest, metadata: Metadata, options: Partial<CallOptions>, callback: (error: ServiceError | null, response: ListUsersResponse) => void): ClientUnaryCall; /** Creates a user in the specified cluster. */ create(request: CreateUserRequest, callback: (error: ServiceError | null, response: Operation) => void): ClientUnaryCall; create(request: CreateUserRequest, metadata: Metadata, callback: (error: ServiceError | null, response: Operation) => void): ClientUnaryCall; create(request: CreateUserRequest, metadata: Metadata, options: Partial<CallOptions>, callback: (error: ServiceError | null, response: Operation) => void): ClientUnaryCall; /** Updates the specified user. */ update(request: UpdateUserRequest, callback: (error: ServiceError | null, response: Operation) => void): ClientUnaryCall; update(request: UpdateUserRequest, metadata: Metadata, callback: (error: ServiceError | null, response: Operation) => void): ClientUnaryCall; update(request: UpdateUserRequest, metadata: Metadata, options: Partial<CallOptions>, callback: (error: ServiceError | null, response: Operation) => void): ClientUnaryCall; /** Deletes the specified user. */ delete(request: DeleteUserRequest, callback: (error: ServiceError | null, response: Operation) => void): ClientUnaryCall; delete(request: DeleteUserRequest, metadata: Metadata, callback: (error: ServiceError | null, response: Operation) => void): ClientUnaryCall; delete(request: DeleteUserRequest, metadata: Metadata, options: Partial<CallOptions>, callback: (error: ServiceError | null, response: Operation) => void): ClientUnaryCall; } export declare const UserServiceClient: { new (address: string, credentials: ChannelCredentials, options?: Partial<ChannelOptions> | undefined): UserServiceClient; service: typeof UserServiceService; }; declare type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; export declare 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>; declare type KeysOfUnion<T> = T extends T ? keyof T : never; export declare 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>; export {};