///
import { ChannelCredentials, ChannelOptions, UntypedServiceImplementation, handleUnaryCall, Client, ClientUnaryCall, Metadata, CallOptions, ServiceError } from '@grpc/grpc-js';
import _m0 from 'protobufjs/minimal';
import { ApiKey } from '../../../../yandex/cloud/iam/v1/api_key';
import { FieldMask } from '../../../../google/protobuf/field_mask';
import { Operation } from '../../../../yandex/cloud/operation/operation';
export declare const protobufPackage = "yandex.cloud.iam.v1";
export interface GetApiKeyRequest {
/**
* ID of the API key to return.
* To get the API key ID, use a [ApiKeyService.List] request.
*/
apiKeyId: string;
}
export interface ListApiKeysRequest {
/**
* ID of the service account to list API keys for.
* To get the service account ID, use a [yandex.cloud.iam.v1.ServiceAccountService.List] request.
* If not specified, it defaults to the subject that made the request.
*/
serviceAccountId: 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 [ListApiKeysResponse.next_page_token]
* that can be used to get the next page of results in subsequent list requests.
* Default value: 100.
*/
pageSize: number;
/**
* Page token. To get the next page of results, set [page_token]
* to the [ListApiKeysResponse.next_page_token]
* returned by a previous list request.
*/
pageToken: string;
}
export interface ListApiKeysResponse {
/** List of API keys. */
apiKeys: ApiKey[];
/**
* This token allows you to get the next page of results for list requests. If the number of results
* is larger than [ListApiKeysRequest.page_size], use
* the [next_page_token] as the value
* for the [ListApiKeysRequest.page_token] query 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 CreateApiKeyRequest {
/**
* ID of the service account to create an API key for.
* To get the service account ID, use a [yandex.cloud.iam.v1.ServiceAccountService.List] request.
* If not specified, it defaults to the subject that made the request.
*/
serviceAccountId: string;
/** Description of the API key. */
description: string;
/**
* Draft
* Scope of the API key.
*
* @deprecated
*/
scope: string;
/** Scopes of the API key. */
scopes: string[];
/** API key expiration timestamp, if not specified, then the API key doesn't expire */
expiresAt?: Date;
}
export interface CreateApiKeyResponse {
/** ApiKey resource. */
apiKey?: ApiKey;
/** Secret part of the API key. This secret key you may use in the requests for authentication. */
secret: string;
}
export interface UpdateApiKeyRequest {
/**
* ID of the ApiKey resource to update.
* To get the API key ID, use a [ApiKeyService.List] request.
*/
apiKeyId: string;
/** Field mask that specifies which fields of the ApiKey resource are going to be updated. */
updateMask?: FieldMask;
/** Description of the API key. */
description: string;
/** Scopes of the API key. */
scopes: string[];
/** API key expiration timestamp, if not specified, then the API key doesn't expire */
expiresAt?: Date;
}
export interface UpdateApiKeyMetadata {
/** ID of the ApiKey resource that is being updated. */
apiKeyId: string;
}
export interface DeleteApiKeyRequest {
/**
* ID of the API key to delete.
* To get the API key ID, use a [ApiKeyService.List] request.
*/
apiKeyId: string;
}
export interface DeleteApiKeyMetadata {
/** ID of the API key that is being deleted. */
apiKeyId: string;
}
export interface ListApiKeyOperationsRequest {
/** ID of the key to list operations for. */
apiKeyId: 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 [ListApiKeyOperationsResponse.next_page_token]
* that can be used to get the next page of results in subsequent list requests.
* Default value: 100.
*/
pageSize: number;
/**
* Page token. To get the next page of results, set [page_token] to the
* [ListApiKeyOperationsResponse.next_page_token] returned by a previous list request.
*/
pageToken: string;
}
export interface ListApiKeyOperationsResponse {
/** List of operations for the specified API key. */
operations: Operation[];
/**
* This token allows you to get the next page of results for list requests. If the number of results
* is larger than [ListApiKeyOperationsRequest.page_size], use the [next_page_token] as the value
* for the [ListApiKeyOperationsRequest.page_token] query 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 ListApiKeyScopesRequest {
/**
* The maximum number of results per page to return. If the number of available
* results is larger than [page_size],
* the service returns a [ListApiKeyScopesResponse.next_page_token]
* that can be used to get the next page of results in subsequent list requests.
* Default value: 100.
*/
pageSize: number;
/**
* Page token. To get the next page of results, set [page_token] to the
* [ListApiKeyScopesResponse.next_page_token] returned by a previous list request.
*/
pageToken: string;
}
export interface ListApiKeyScopesResponse {
/** List of scopes */
scopes: string[];
/**
* This token allows you to get the next page of results for list requests. If the number of results
* is larger than [ListApiKeyScopesRequest.page_size], use the [next_page_token] as the value
* for the [ListApiKeyScopesRequest.page_token] query 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 declare const GetApiKeyRequest: {
encode(message: GetApiKeyRequest, writer?: _m0.Writer): _m0.Writer;
decode(input: _m0.Reader | Uint8Array, length?: number): GetApiKeyRequest;
fromJSON(object: any): GetApiKeyRequest;
toJSON(message: GetApiKeyRequest): unknown;
fromPartial, never>>(object: I): GetApiKeyRequest;
};
export declare const ListApiKeysRequest: {
encode(message: ListApiKeysRequest, writer?: _m0.Writer): _m0.Writer;
decode(input: _m0.Reader | Uint8Array, length?: number): ListApiKeysRequest;
fromJSON(object: any): ListApiKeysRequest;
toJSON(message: ListApiKeysRequest): unknown;
fromPartial, never>>(object: I): ListApiKeysRequest;
};
export declare const ListApiKeysResponse: {
encode(message: ListApiKeysResponse, writer?: _m0.Writer): _m0.Writer;
decode(input: _m0.Reader | Uint8Array, length?: number): ListApiKeysResponse;
fromJSON(object: any): ListApiKeysResponse;
toJSON(message: ListApiKeysResponse): unknown;
fromPartial, never>) | undefined;
expiresAt?: Date | undefined;
} & Record, never>)[] & Record, never>) | undefined;
nextPageToken?: string | undefined;
} & Record, never>>(object: I): ListApiKeysResponse;
};
export declare const CreateApiKeyRequest: {
encode(message: CreateApiKeyRequest, writer?: _m0.Writer): _m0.Writer;
decode(input: _m0.Reader | Uint8Array, length?: number): CreateApiKeyRequest;
fromJSON(object: any): CreateApiKeyRequest;
toJSON(message: CreateApiKeyRequest): unknown;
fromPartial, never>) | undefined;
expiresAt?: Date | undefined;
} & Record, never>>(object: I): CreateApiKeyRequest;
};
export declare const CreateApiKeyResponse: {
encode(message: CreateApiKeyResponse, writer?: _m0.Writer): _m0.Writer;
decode(input: _m0.Reader | Uint8Array, length?: number): CreateApiKeyResponse;
fromJSON(object: any): CreateApiKeyResponse;
toJSON(message: CreateApiKeyResponse): unknown;
fromPartial, never>) | undefined;
expiresAt?: Date | undefined;
} & Record, never>) | undefined;
secret?: string | undefined;
} & Record, never>>(object: I): CreateApiKeyResponse;
};
export declare const UpdateApiKeyRequest: {
encode(message: UpdateApiKeyRequest, writer?: _m0.Writer): _m0.Writer;
decode(input: _m0.Reader | Uint8Array, length?: number): UpdateApiKeyRequest;
fromJSON(object: any): UpdateApiKeyRequest;
toJSON(message: UpdateApiKeyRequest): unknown;
fromPartial, never>) | undefined;
} & Record, never>) | undefined;
description?: string | undefined;
scopes?: (string[] & string[] & Record, never>) | undefined;
expiresAt?: Date | undefined;
} & Record, never>>(object: I): UpdateApiKeyRequest;
};
export declare const UpdateApiKeyMetadata: {
encode(message: UpdateApiKeyMetadata, writer?: _m0.Writer): _m0.Writer;
decode(input: _m0.Reader | Uint8Array, length?: number): UpdateApiKeyMetadata;
fromJSON(object: any): UpdateApiKeyMetadata;
toJSON(message: UpdateApiKeyMetadata): unknown;
fromPartial, never>>(object: I): UpdateApiKeyMetadata;
};
export declare const DeleteApiKeyRequest: {
encode(message: DeleteApiKeyRequest, writer?: _m0.Writer): _m0.Writer;
decode(input: _m0.Reader | Uint8Array, length?: number): DeleteApiKeyRequest;
fromJSON(object: any): DeleteApiKeyRequest;
toJSON(message: DeleteApiKeyRequest): unknown;
fromPartial, never>>(object: I): DeleteApiKeyRequest;
};
export declare const DeleteApiKeyMetadata: {
encode(message: DeleteApiKeyMetadata, writer?: _m0.Writer): _m0.Writer;
decode(input: _m0.Reader | Uint8Array, length?: number): DeleteApiKeyMetadata;
fromJSON(object: any): DeleteApiKeyMetadata;
toJSON(message: DeleteApiKeyMetadata): unknown;
fromPartial, never>>(object: I): DeleteApiKeyMetadata;
};
export declare const ListApiKeyOperationsRequest: {
encode(message: ListApiKeyOperationsRequest, writer?: _m0.Writer): _m0.Writer;
decode(input: _m0.Reader | Uint8Array, length?: number): ListApiKeyOperationsRequest;
fromJSON(object: any): ListApiKeyOperationsRequest;
toJSON(message: ListApiKeyOperationsRequest): unknown;
fromPartial, never>>(object: I): ListApiKeyOperationsRequest;
};
export declare const ListApiKeyOperationsResponse: {
encode(message: ListApiKeyOperationsResponse, writer?: _m0.Writer): _m0.Writer;
decode(input: _m0.Reader | Uint8Array, length?: number): ListApiKeyOperationsResponse;
fromJSON(object: any): ListApiKeyOperationsResponse;
toJSON(message: ListApiKeyOperationsResponse): unknown;
fromPartial, never>) | undefined;
error?: ({
code?: number | undefined;
message?: string | undefined;
details?: {
typeUrl?: string | undefined;
value?: Buffer | undefined;
}[] | undefined;
} & {
code?: number | undefined;
message?: string | undefined;
details?: ({
typeUrl?: string | undefined;
value?: Buffer | undefined;
}[] & ({
typeUrl?: string | undefined;
value?: Buffer | undefined;
} & {
typeUrl?: string | undefined;
value?: Buffer | undefined;
} & Record, never>)[] & Record, never>) | undefined;
} & Record, never>) | undefined;
response?: ({
typeUrl?: string | undefined;
value?: Buffer | undefined;
} & {
typeUrl?: string | undefined;
value?: Buffer | undefined;
} & Record, never>) | undefined;
} & Record, never>)[] & Record, never>) | undefined;
nextPageToken?: string | undefined;
} & Record, never>>(object: I): ListApiKeyOperationsResponse;
};
export declare const ListApiKeyScopesRequest: {
encode(message: ListApiKeyScopesRequest, writer?: _m0.Writer): _m0.Writer;
decode(input: _m0.Reader | Uint8Array, length?: number): ListApiKeyScopesRequest;
fromJSON(object: any): ListApiKeyScopesRequest;
toJSON(message: ListApiKeyScopesRequest): unknown;
fromPartial, never>>(object: I): ListApiKeyScopesRequest;
};
export declare const ListApiKeyScopesResponse: {
encode(message: ListApiKeyScopesResponse, writer?: _m0.Writer): _m0.Writer;
decode(input: _m0.Reader | Uint8Array, length?: number): ListApiKeyScopesResponse;
fromJSON(object: any): ListApiKeyScopesResponse;
toJSON(message: ListApiKeyScopesResponse): unknown;
fromPartial, never>) | undefined;
nextPageToken?: string | undefined;
} & Record, never>>(object: I): ListApiKeyScopesResponse;
};
/** A set of methods for managing API keys. */
export declare const ApiKeyServiceService: {
/** Retrieves the list of API keys for the specified service account. */
readonly list: {
readonly path: "/yandex.cloud.iam.v1.ApiKeyService/List";
readonly requestStream: false;
readonly responseStream: false;
readonly requestSerialize: (value: ListApiKeysRequest) => Buffer;
readonly requestDeserialize: (value: Buffer) => ListApiKeysRequest;
readonly responseSerialize: (value: ListApiKeysResponse) => Buffer;
readonly responseDeserialize: (value: Buffer) => ListApiKeysResponse;
};
/**
* Returns the specified API key.
*
* To get the list of available API keys, make a [List] request.
*/
readonly get: {
readonly path: "/yandex.cloud.iam.v1.ApiKeyService/Get";
readonly requestStream: false;
readonly responseStream: false;
readonly requestSerialize: (value: GetApiKeyRequest) => Buffer;
readonly requestDeserialize: (value: Buffer) => GetApiKeyRequest;
readonly responseSerialize: (value: ApiKey) => Buffer;
readonly responseDeserialize: (value: Buffer) => ApiKey;
};
/** Creates an API key for the specified service account. */
readonly create: {
readonly path: "/yandex.cloud.iam.v1.ApiKeyService/Create";
readonly requestStream: false;
readonly responseStream: false;
readonly requestSerialize: (value: CreateApiKeyRequest) => Buffer;
readonly requestDeserialize: (value: Buffer) => CreateApiKeyRequest;
readonly responseSerialize: (value: CreateApiKeyResponse) => Buffer;
readonly responseDeserialize: (value: Buffer) => CreateApiKeyResponse;
};
/** Updates the specified API key. */
readonly update: {
readonly path: "/yandex.cloud.iam.v1.ApiKeyService/Update";
readonly requestStream: false;
readonly responseStream: false;
readonly requestSerialize: (value: UpdateApiKeyRequest) => Buffer;
readonly requestDeserialize: (value: Buffer) => UpdateApiKeyRequest;
readonly responseSerialize: (value: Operation) => Buffer;
readonly responseDeserialize: (value: Buffer) => Operation;
};
/** Deletes the specified API key. */
readonly delete: {
readonly path: "/yandex.cloud.iam.v1.ApiKeyService/Delete";
readonly requestStream: false;
readonly responseStream: false;
readonly requestSerialize: (value: DeleteApiKeyRequest) => Buffer;
readonly requestDeserialize: (value: Buffer) => DeleteApiKeyRequest;
readonly responseSerialize: (value: Operation) => Buffer;
readonly responseDeserialize: (value: Buffer) => Operation;
};
/** Retrieves the list of operations for the specified API key. */
readonly listOperations: {
readonly path: "/yandex.cloud.iam.v1.ApiKeyService/ListOperations";
readonly requestStream: false;
readonly responseStream: false;
readonly requestSerialize: (value: ListApiKeyOperationsRequest) => Buffer;
readonly requestDeserialize: (value: Buffer) => ListApiKeyOperationsRequest;
readonly responseSerialize: (value: ListApiKeyOperationsResponse) => Buffer;
readonly responseDeserialize: (value: Buffer) => ListApiKeyOperationsResponse;
};
/** Retrieves the list of scopes. */
readonly listScopes: {
readonly path: "/yandex.cloud.iam.v1.ApiKeyService/ListScopes";
readonly requestStream: false;
readonly responseStream: false;
readonly requestSerialize: (value: ListApiKeyScopesRequest) => Buffer;
readonly requestDeserialize: (value: Buffer) => ListApiKeyScopesRequest;
readonly responseSerialize: (value: ListApiKeyScopesResponse) => Buffer;
readonly responseDeserialize: (value: Buffer) => ListApiKeyScopesResponse;
};
};
export interface ApiKeyServiceServer extends UntypedServiceImplementation {
/** Retrieves the list of API keys for the specified service account. */
list: handleUnaryCall;
/**
* Returns the specified API key.
*
* To get the list of available API keys, make a [List] request.
*/
get: handleUnaryCall;
/** Creates an API key for the specified service account. */
create: handleUnaryCall;
/** Updates the specified API key. */
update: handleUnaryCall;
/** Deletes the specified API key. */
delete: handleUnaryCall;
/** Retrieves the list of operations for the specified API key. */
listOperations: handleUnaryCall;
/** Retrieves the list of scopes. */
listScopes: handleUnaryCall;
}
export interface ApiKeyServiceClient extends Client {
/** Retrieves the list of API keys for the specified service account. */
list(request: ListApiKeysRequest, callback: (error: ServiceError | null, response: ListApiKeysResponse) => void): ClientUnaryCall;
list(request: ListApiKeysRequest, metadata: Metadata, callback: (error: ServiceError | null, response: ListApiKeysResponse) => void): ClientUnaryCall;
list(request: ListApiKeysRequest, metadata: Metadata, options: Partial, callback: (error: ServiceError | null, response: ListApiKeysResponse) => void): ClientUnaryCall;
/**
* Returns the specified API key.
*
* To get the list of available API keys, make a [List] request.
*/
get(request: GetApiKeyRequest, callback: (error: ServiceError | null, response: ApiKey) => void): ClientUnaryCall;
get(request: GetApiKeyRequest, metadata: Metadata, callback: (error: ServiceError | null, response: ApiKey) => void): ClientUnaryCall;
get(request: GetApiKeyRequest, metadata: Metadata, options: Partial, callback: (error: ServiceError | null, response: ApiKey) => void): ClientUnaryCall;
/** Creates an API key for the specified service account. */
create(request: CreateApiKeyRequest, callback: (error: ServiceError | null, response: CreateApiKeyResponse) => void): ClientUnaryCall;
create(request: CreateApiKeyRequest, metadata: Metadata, callback: (error: ServiceError | null, response: CreateApiKeyResponse) => void): ClientUnaryCall;
create(request: CreateApiKeyRequest, metadata: Metadata, options: Partial, callback: (error: ServiceError | null, response: CreateApiKeyResponse) => void): ClientUnaryCall;
/** Updates the specified API key. */
update(request: UpdateApiKeyRequest, callback: (error: ServiceError | null, response: Operation) => void): ClientUnaryCall;
update(request: UpdateApiKeyRequest, metadata: Metadata, callback: (error: ServiceError | null, response: Operation) => void): ClientUnaryCall;
update(request: UpdateApiKeyRequest, metadata: Metadata, options: Partial, callback: (error: ServiceError | null, response: Operation) => void): ClientUnaryCall;
/** Deletes the specified API key. */
delete(request: DeleteApiKeyRequest, callback: (error: ServiceError | null, response: Operation) => void): ClientUnaryCall;
delete(request: DeleteApiKeyRequest, metadata: Metadata, callback: (error: ServiceError | null, response: Operation) => void): ClientUnaryCall;
delete(request: DeleteApiKeyRequest, metadata: Metadata, options: Partial, callback: (error: ServiceError | null, response: Operation) => void): ClientUnaryCall;
/** Retrieves the list of operations for the specified API key. */
listOperations(request: ListApiKeyOperationsRequest, callback: (error: ServiceError | null, response: ListApiKeyOperationsResponse) => void): ClientUnaryCall;
listOperations(request: ListApiKeyOperationsRequest, metadata: Metadata, callback: (error: ServiceError | null, response: ListApiKeyOperationsResponse) => void): ClientUnaryCall;
listOperations(request: ListApiKeyOperationsRequest, metadata: Metadata, options: Partial, callback: (error: ServiceError | null, response: ListApiKeyOperationsResponse) => void): ClientUnaryCall;
/** Retrieves the list of scopes. */
listScopes(request: ListApiKeyScopesRequest, callback: (error: ServiceError | null, response: ListApiKeyScopesResponse) => void): ClientUnaryCall;
listScopes(request: ListApiKeyScopesRequest, metadata: Metadata, callback: (error: ServiceError | null, response: ListApiKeyScopesResponse) => void): ClientUnaryCall;
listScopes(request: ListApiKeyScopesRequest, metadata: Metadata, options: Partial, callback: (error: ServiceError | null, response: ListApiKeyScopesResponse) => void): ClientUnaryCall;
}
export declare const ApiKeyServiceClient: {
new (address: string, credentials: ChannelCredentials, options?: Partial): ApiKeyServiceClient;
service: typeof ApiKeyServiceService;
};
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial = T extends Builtin ? T : T extends Array ? Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? {
[K in keyof T]?: DeepPartial;
} : Partial;
type KeysOfUnion = T extends T ? keyof T : never;
export type Exact
= P extends Builtin ? P : P & {
[K in keyof P]: Exact