/// <reference types="node" />
import { ChannelCredentials, ChannelOptions, UntypedServiceImplementation, handleUnaryCall, Client, ClientUnaryCall, Metadata, CallOptions, ServiceError } from '@grpc/grpc-js';
import _m0 from 'protobufjs/minimal';
import { RefreshToken } from '../../../../yandex/cloud/iam/v1/refresh_token';
import { Operation } from '../../../../yandex/cloud/operation/operation';
export declare const protobufPackage = "yandex.cloud.iam.v1";
export interface RevokeRefreshTokenMetadata {
    subjectId: string;
    /** Id of revoked Refresh Tokens. */
    refreshTokenIds: string[];
}
export interface ListRefreshTokensRequest {
    subjectId: 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 [ListRefreshTokensResponse.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 [ListRefreshTokensResponse.next_page_token]
     * returned by a previous list request.
     */
    pageToken: string;
    /**
     * A filter expression that filters refresh tokens listed in the response.
     *
     * The expression must specify:
     * 1. The field name. Currently you can use filtering only on [RefreshToken.client_instance_info], [RefreshToken.client_id] or [RefreshToken.protection_level] fields.
     * 2. The operator. An `=` operator can be used for all fields. An 'IN' operator can be used for [RefreshToken.protection_level].
     * 3. The value. The value must be in double quotes (`"`). Must be 3-63 characters long and match the regular expression `[a-zA-Z][_-a-zA-Z0-9]{1,61}[a-z0-9]`.
     * Example of a filter: `client_instance_info="clientInstanceInfo" AND protection_level IN ("INSECURE_KEY_DPOP", "SECURE_KEY_DPOP")`.
     */
    filter: string;
}
export interface ListRefreshTokensResponse {
    /** List of Refresh Tokens */
    refreshTokens: RefreshToken[];
    /**
     * This token allows you to get the next page of results for list requests. If the number of results
     * is larger than [ListRefreshTokensForSubjectRequest.page_size], use
     * the [next_page_token] as the value
     * for the [ListRefreshTokensForSubjectRequest.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;
}
/**
 * Revoke Refresh Token request.
 * If none of the parameters refresh_token_id, refresh_token, or revoke_filter are provided, all Refresh Tokens for the current subject will be revoked.
 */
export interface RevokeRefreshTokenRequest {
    /** Identifier of the Refresh Token to be revoked. */
    refreshTokenId: string | undefined;
    /** The Refresh Token to be revoked. */
    refreshToken: string | undefined;
    /** The filter for revoking Refresh Token */
    revokeFilter?: RevokeFilter | undefined;
}
/**
 * The Filter object allows filtering Refresh Tokens that will be revoked.
 * It contains three optional fields.
 * When multiple fields are provided, they are combined using a logical AND operation.
 */
export interface RevokeFilter {
    /** The OAuth client identifier for which the Refresh Token was issued. */
    clientId: string;
    /**
     * The subject identifier for whom the Refresh Token was issued.
     * If not specified, it defaults to the subject that made the request.
     */
    subjectId: string;
    /** Information about the app for which the Refresh Token was issued. */
    clientInstanceInfo: string;
}
export interface RevokeRefreshTokenResponse {
    /** Id of revoked Refresh Tokens. */
    refreshTokenIds: string[];
}
export declare const RevokeRefreshTokenMetadata: {
    encode(message: RevokeRefreshTokenMetadata, writer?: _m0.Writer): _m0.Writer;
    decode(input: _m0.Reader | Uint8Array, length?: number): RevokeRefreshTokenMetadata;
    fromJSON(object: any): RevokeRefreshTokenMetadata;
    toJSON(message: RevokeRefreshTokenMetadata): unknown;
    fromPartial<I extends {
        subjectId?: string | undefined;
        refreshTokenIds?: string[] | undefined;
    } & {
        subjectId?: string | undefined;
        refreshTokenIds?: (string[] & string[] & Record<Exclude<keyof I["refreshTokenIds"], keyof string[]>, never>) | undefined;
    } & Record<Exclude<keyof I, keyof RevokeRefreshTokenMetadata>, never>>(object: I): RevokeRefreshTokenMetadata;
};
export declare const ListRefreshTokensRequest: {
    encode(message: ListRefreshTokensRequest, writer?: _m0.Writer): _m0.Writer;
    decode(input: _m0.Reader | Uint8Array, length?: number): ListRefreshTokensRequest;
    fromJSON(object: any): ListRefreshTokensRequest;
    toJSON(message: ListRefreshTokensRequest): unknown;
    fromPartial<I extends {
        subjectId?: string | undefined;
        pageSize?: number | undefined;
        pageToken?: string | undefined;
        filter?: string | undefined;
    } & {
        subjectId?: string | undefined;
        pageSize?: number | undefined;
        pageToken?: string | undefined;
        filter?: string | undefined;
    } & Record<Exclude<keyof I, keyof ListRefreshTokensRequest>, never>>(object: I): ListRefreshTokensRequest;
};
export declare const ListRefreshTokensResponse: {
    encode(message: ListRefreshTokensResponse, writer?: _m0.Writer): _m0.Writer;
    decode(input: _m0.Reader | Uint8Array, length?: number): ListRefreshTokensResponse;
    fromJSON(object: any): ListRefreshTokensResponse;
    toJSON(message: ListRefreshTokensResponse): unknown;
    fromPartial<I extends {
        refreshTokens?: {
            id?: string | undefined;
            clientInstanceInfo?: string | undefined;
            clientId?: string | undefined;
            subjectId?: string | undefined;
            createdAt?: Date | undefined;
            expiresAt?: Date | undefined;
            lastUsedAt?: Date | undefined;
            protectionLevel?: import("../../../../yandex/cloud/iam/v1/refresh_token").RefreshToken_ProtectionLevel | undefined;
        }[] | undefined;
        nextPageToken?: string | undefined;
    } & {
        refreshTokens?: ({
            id?: string | undefined;
            clientInstanceInfo?: string | undefined;
            clientId?: string | undefined;
            subjectId?: string | undefined;
            createdAt?: Date | undefined;
            expiresAt?: Date | undefined;
            lastUsedAt?: Date | undefined;
            protectionLevel?: import("../../../../yandex/cloud/iam/v1/refresh_token").RefreshToken_ProtectionLevel | undefined;
        }[] & ({
            id?: string | undefined;
            clientInstanceInfo?: string | undefined;
            clientId?: string | undefined;
            subjectId?: string | undefined;
            createdAt?: Date | undefined;
            expiresAt?: Date | undefined;
            lastUsedAt?: Date | undefined;
            protectionLevel?: import("../../../../yandex/cloud/iam/v1/refresh_token").RefreshToken_ProtectionLevel | undefined;
        } & {
            id?: string | undefined;
            clientInstanceInfo?: string | undefined;
            clientId?: string | undefined;
            subjectId?: string | undefined;
            createdAt?: Date | undefined;
            expiresAt?: Date | undefined;
            lastUsedAt?: Date | undefined;
            protectionLevel?: import("../../../../yandex/cloud/iam/v1/refresh_token").RefreshToken_ProtectionLevel | undefined;
        } & Record<Exclude<keyof I["refreshTokens"][number], keyof RefreshToken>, never>)[] & Record<Exclude<keyof I["refreshTokens"], keyof {
            id?: string | undefined;
            clientInstanceInfo?: string | undefined;
            clientId?: string | undefined;
            subjectId?: string | undefined;
            createdAt?: Date | undefined;
            expiresAt?: Date | undefined;
            lastUsedAt?: Date | undefined;
            protectionLevel?: import("../../../../yandex/cloud/iam/v1/refresh_token").RefreshToken_ProtectionLevel | undefined;
        }[]>, never>) | undefined;
        nextPageToken?: string | undefined;
    } & Record<Exclude<keyof I, keyof ListRefreshTokensResponse>, never>>(object: I): ListRefreshTokensResponse;
};
export declare const RevokeRefreshTokenRequest: {
    encode(message: RevokeRefreshTokenRequest, writer?: _m0.Writer): _m0.Writer;
    decode(input: _m0.Reader | Uint8Array, length?: number): RevokeRefreshTokenRequest;
    fromJSON(object: any): RevokeRefreshTokenRequest;
    toJSON(message: RevokeRefreshTokenRequest): unknown;
    fromPartial<I extends {
        refreshTokenId?: string | undefined;
        refreshToken?: string | undefined;
        revokeFilter?: {
            clientId?: string | undefined;
            subjectId?: string | undefined;
            clientInstanceInfo?: string | undefined;
        } | undefined;
    } & {
        refreshTokenId?: string | undefined;
        refreshToken?: string | undefined;
        revokeFilter?: ({
            clientId?: string | undefined;
            subjectId?: string | undefined;
            clientInstanceInfo?: string | undefined;
        } & {
            clientId?: string | undefined;
            subjectId?: string | undefined;
            clientInstanceInfo?: string | undefined;
        } & Record<Exclude<keyof I["revokeFilter"], keyof RevokeFilter>, never>) | undefined;
    } & Record<Exclude<keyof I, keyof RevokeRefreshTokenRequest>, never>>(object: I): RevokeRefreshTokenRequest;
};
export declare const RevokeFilter: {
    encode(message: RevokeFilter, writer?: _m0.Writer): _m0.Writer;
    decode(input: _m0.Reader | Uint8Array, length?: number): RevokeFilter;
    fromJSON(object: any): RevokeFilter;
    toJSON(message: RevokeFilter): unknown;
    fromPartial<I extends {
        clientId?: string | undefined;
        subjectId?: string | undefined;
        clientInstanceInfo?: string | undefined;
    } & {
        clientId?: string | undefined;
        subjectId?: string | undefined;
        clientInstanceInfo?: string | undefined;
    } & Record<Exclude<keyof I, keyof RevokeFilter>, never>>(object: I): RevokeFilter;
};
export declare const RevokeRefreshTokenResponse: {
    encode(message: RevokeRefreshTokenResponse, writer?: _m0.Writer): _m0.Writer;
    decode(input: _m0.Reader | Uint8Array, length?: number): RevokeRefreshTokenResponse;
    fromJSON(object: any): RevokeRefreshTokenResponse;
    toJSON(message: RevokeRefreshTokenResponse): unknown;
    fromPartial<I extends {
        refreshTokenIds?: string[] | undefined;
    } & {
        refreshTokenIds?: (string[] & string[] & Record<Exclude<keyof I["refreshTokenIds"], keyof string[]>, never>) | undefined;
    } & Record<Exclude<keyof I, "refreshTokenIds">, never>>(object: I): RevokeRefreshTokenResponse;
};
/** A set of methods for managing Refresh Tokens. */
export declare const RefreshTokenServiceService: {
    /** List subjects Refresh Tokens. */
    readonly list: {
        readonly path: "/yandex.cloud.iam.v1.RefreshTokenService/List";
        readonly requestStream: false;
        readonly responseStream: false;
        readonly requestSerialize: (value: ListRefreshTokensRequest) => Buffer;
        readonly requestDeserialize: (value: Buffer) => ListRefreshTokensRequest;
        readonly responseSerialize: (value: ListRefreshTokensResponse) => Buffer;
        readonly responseDeserialize: (value: Buffer) => ListRefreshTokensResponse;
    };
    /** Revoke Refresh Tokens. Several Refresh Tokens can be revoked by one request. */
    readonly revoke: {
        readonly path: "/yandex.cloud.iam.v1.RefreshTokenService/Revoke";
        readonly requestStream: false;
        readonly responseStream: false;
        readonly requestSerialize: (value: RevokeRefreshTokenRequest) => Buffer;
        readonly requestDeserialize: (value: Buffer) => RevokeRefreshTokenRequest;
        readonly responseSerialize: (value: Operation) => Buffer;
        readonly responseDeserialize: (value: Buffer) => Operation;
    };
};
export interface RefreshTokenServiceServer extends UntypedServiceImplementation {
    /** List subjects Refresh Tokens. */
    list: handleUnaryCall<ListRefreshTokensRequest, ListRefreshTokensResponse>;
    /** Revoke Refresh Tokens. Several Refresh Tokens can be revoked by one request. */
    revoke: handleUnaryCall<RevokeRefreshTokenRequest, Operation>;
}
export interface RefreshTokenServiceClient extends Client {
    /** List subjects Refresh Tokens. */
    list(request: ListRefreshTokensRequest, callback: (error: ServiceError | null, response: ListRefreshTokensResponse) => void): ClientUnaryCall;
    list(request: ListRefreshTokensRequest, metadata: Metadata, callback: (error: ServiceError | null, response: ListRefreshTokensResponse) => void): ClientUnaryCall;
    list(request: ListRefreshTokensRequest, metadata: Metadata, options: Partial<CallOptions>, callback: (error: ServiceError | null, response: ListRefreshTokensResponse) => void): ClientUnaryCall;
    /** Revoke Refresh Tokens. Several Refresh Tokens can be revoked by one request. */
    revoke(request: RevokeRefreshTokenRequest, callback: (error: ServiceError | null, response: Operation) => void): ClientUnaryCall;
    revoke(request: RevokeRefreshTokenRequest, metadata: Metadata, callback: (error: ServiceError | null, response: Operation) => void): ClientUnaryCall;
    revoke(request: RevokeRefreshTokenRequest, metadata: Metadata, options: Partial<CallOptions>, callback: (error: ServiceError | null, response: Operation) => void): ClientUnaryCall;
}
export declare const RefreshTokenServiceClient: {
    new (address: string, credentials: ChannelCredentials, options?: Partial<ChannelOptions>): RefreshTokenServiceClient;
    service: typeof RefreshTokenServiceService;
};
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 keyof T]?: 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>>, never>;
export {};
