/** @packageDocumentation * @module iModelHubClient */ import { ClientRequestContext } from "@bentley/bentleyjs-core"; import { WsgClient, WsgRequestOptions } from "../WsgClient"; import { RequestOptions, RequestQueryOptions } from "../Request"; import { WsgInstance } from "../ECJsonTypeMap"; import { AuthorizationToken, AccessToken } from "../Token"; import { FileHandler } from "../imodeljs-clients"; import { CustomRequestOptions } from "./CustomRequestOptions"; import { AuthorizedClientRequestContext } from "../AuthorizedClientRequestContext"; /** * This class acts as the WsgClient for other iModelHub Handlers. * @beta */ export declare class IModelBaseHandler extends WsgClient { protected _url?: string; private _defaultIModelHubOptionsProvider; static readonly searchKey: string; static readonly configRelyingPartyUri = "imjs_imodelhub_relying_party_uri"; protected _agent: any; protected _fileHandler: FileHandler | undefined; private _customRequestOptions; /** * Create an instance of IModelBaseHandler. * @internal */ constructor(keepAliveDuration?: number, fileHandler?: FileHandler); formatContextIdForUrl(contextId: string): string; getFileHandler(): FileHandler | undefined; /** * Augment request options with defaults returned by the DefaultIModelHubRequestOptionsProvider. Note that 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; /** * Get name/key to query the service URLs from the URL Discovery Service ("Buddi") * @returns Search key for the URL. */ protected getUrlSearchKey(): string; /** * Gets theRelyingPartyUrl for the service. * @returns RelyingPartyUrl for the service. */ protected getRelyingPartyUrl(): string; /** * Get the agent used for imodelhub connection pooling. * @returns The agent used for imodelhub connection pooling. */ getAgent(): any; /** * Get the URL of the service. This method 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; /** * Get the (delegation) access token to access the service * @param requestContext The client request context * @param authorizationToken Authorization token. * @returns Resolves to the (delegation) access token. * @internal */ getAccessToken(requestContext: ClientRequestContext, authorizationToken: AuthorizationToken): Promise; /** * Send a delete request. Sends a request without body. * @param requestContext The client request context * @param relativeUrlPath Relative path to the REST resource. * @returns Promise resolves after successfully deleting REST resource at the specified path. */ delete(requestContext: AuthorizedClientRequestContext, relativeUrlPath: string): Promise; /** * Delete a strongly typed instance. Sends a request body with a WSG instance. * @param requestContext The client request context * @param relativeUrlPath Relative path to the REST resource. * @param instance Instance to be deleted. * @param requestOptions WSG options for the request. * @returns Promise resolves after successfully deleting instance. */ deleteInstance(requestContext: AuthorizedClientRequestContext, relativeUrlPath: string, instance?: T, requestOptions?: WsgRequestOptions): Promise; /** * Post a strongly typed instance. Sends a request body with a WSG instance. * @param requestContext The client request context * @param typedConstructor Used to construct the resulting instances from the response. * @param relativeUrlPath Relative path to the REST resource. * @param instance Strongly typed instance to be posted. * @param requestOptions WSG options for the request. * @returns The posted instance that's returned back from the server. */ postInstance(requestContext: AuthorizedClientRequestContext, typedConstructor: new () => T, relativeUrlPath: string, instance: T, requestOptions?: WsgRequestOptions): Promise; /** * Post multiple strongly typed instances. Sends a request body with WSG instances. * @param requestContext The client request context * @param typedConstructor Used to construct the resulting instances from the response. * @param relativeUrlPath Relative path to the REST resource. * @param instances Strongly typed instances to be posted. * @param requestOptions WSG options for the request. * @returns The posted instances that's returned back from the server. */ postInstances(requestContext: AuthorizedClientRequestContext, typedConstructor: new () => T, relativeUrlPath: string, instances: T[], requestOptions?: WsgRequestOptions): Promise; /** * Get multiple strongly typed instances. * @param requestContext The client request context * @param typedConstructor Used to construct the resulting instances from the response. * @param token Delegation token of the authorized user. * @param relativeUrlPath Relative path to the REST resource. * @param queryOptions Query options. * @returns Array of strongly typed instances. */ getInstances(requestContext: AuthorizedClientRequestContext, typedConstructor: new () => T, relativeUrlPath: string, queryOptions?: RequestQueryOptions): Promise; /** * Get multiple strongly typed instances. Sends query in the request's body. This can be used for queries that are too long to fit in URL. * @param requestContext The client request context * @param typedConstructor Used to construct the resulting instances from the response. * @param relativeUrlPath Relative path to the REST resource. * @param queryOptions Query options. * @returns Array of strongly typed instances. */ postQuery(requestContext: AuthorizedClientRequestContext, typedConstructor: new () => T, relativeUrlPath: string, queryOptions: RequestQueryOptions): Promise; /** * Get an instance of CustomRequestOptions, which can be used to set custom request parameters for all future requests made by this handler. */ getCustomRequestOptions(): CustomRequestOptions; } //# sourceMappingURL=BaseHandler.d.ts.map