/** @packageDocumentation * @module iTwinServiceClients */ import { ClientRequestContext } from "@bentley/bentleyjs-core"; import { AuthorizedClientRequestContext } from "./AuthorizedClientRequestContext"; import { RequestOptions, ResponseError } from "./Request"; /** * Provider for default RequestOptions, used by Client to set defaults. * @internal */ export declare class DefaultRequestOptionsProvider { protected _defaultOptions: RequestOptions; /** Creates an instance of DefaultRequestOptionsProvider and sets up the default options. */ constructor(); /** * Augments options with the provider's default values. * @note The options passed in override any defaults where necessary. * @param options Options that should be augmented. */ assignOptions(options: RequestOptions): Promise; } /** * Base class for all Client implementations * @beta */ export declare abstract class Client { private static _defaultRequestOptionsProvider; protected _url?: string; /** Creates an instance of Client. */ protected constructor(); /** * Augments request options with defaults returned by the DefaultRequestOptionsProvider. * @note The options passed in by clients override any defaults where necessary. * @param options Options the caller wants to augment with the defaults. * @returns Promise resolves after the defaults are setup. */ protected setupOptionDefaults(options: RequestOptions): Promise; /** * Implemented by clients to specify the name/key to query the service URLs from * the URL Discovery Service ("Buddi") * @returns Search key for the URL. */ protected abstract getUrlSearchKey(): string; /** * Gets the URL of the service. Attempts to discover and cache the URL from the URL Discovery Service. If not * found uses the default URL provided by client implementations. Note that for consistency * sake, the URL is stripped of any trailing "/" * @returns URL for the service */ getUrl(requestContext: ClientRequestContext): Promise; /** used by clients to send delete requests */ protected delete(requestContext: AuthorizedClientRequestContext, relativeUrlPath: string): Promise; } /** * Error for issues with authentication. * @beta */ export declare class AuthenticationError extends ResponseError { } /** * Client API to discover URLs from the URL Discovery service (a.k.a. Buddi service) * @internal */ export declare class UrlDiscoveryClient extends Client { static readonly configURL = "imjs_buddi_url"; static readonly configResolveUrlUsingRegion = "imjs_buddi_resolve_url_using_region"; /** * Creates an instance of UrlDiscoveryClient. */ constructor(); /** * Gets name/key to query the service URLs from the URL Discovery Service ("Buddi") * @returns Search key for the URL. */ protected getUrlSearchKey(): string; /** * Gets the URL for the discovery service * @returns URL of the discovery service. */ getUrl(): Promise; /** * Discovers a URL given the search key. * @param searchKey Search key registered for the service. * @param regionId Override region to use for URL discovery. * @returns Registered URL for the service. */ discoverUrl(requestContext: ClientRequestContext, searchKey: string, regionId: number | undefined): Promise; } //# sourceMappingURL=Client.d.ts.map