import { Logger } from 'pino'; import { AzureApiResponse, AzureApiResult, Body, CallApiDto, CallStorageApiDto, Tokens } from 'types/index.js'; import { IAzureAuth } from '../types/test-utils/azure-auth.interface.js'; /** * * @returns {AzureApiResult} */ export declare const initAzureApiResult: () => AzureApiResult; /** * Wrap Azure API response to a convenient result object * @param {AzureApiResponse} response * @returns {AzureApiResult} */ export declare function wrap(response: AzureApiResponse, wrapper?: (body: any) => any): AzureApiResult; export declare class AzureRestApi { logger: Logger; auth: IAzureAuth; tokens: Tokens; /** * * @param {Logger} logger * @param {AzureAuth} auth */ constructor(logger: Logger, auth: IAzureAuth); init(): Promise; /** * Call an Azure REST API * @param {string} accessToken - access token to use * @param {string} method - HTTP method to use * @param {string} url - full URL of an endpoint to call * @param {PlainQuery?} query - query parameters * @param {Body?} body - object to use as a body * @param {PlainHeaders?} headers - extra headers * @param {string?} username - username to use for basic auth * @param {string?} password - password to use for basic auth */ callApi({ accessToken, method, url, query, body, headers, username, password }: CallApiDto): Promise>; /** * Call an Azure management API endpoint * @param {string} method - HTTP method to use * @param {string[]} path - the elements of a path to a resource in an URL * @param {string} apiVersion - API version to use * @param {Body?} body - request body */ callManagementApi(method: string, path: string[], apiVersion: string, body?: Body | null): Promise>; /** * Call an Azure async management API endpoint (long-running operation) * @param {string} method - HTTP method to use * @param {string[]} path - the elements of a path to a resource in an URL * @param {string} apiVersion - API version to use * @param {Body?} body - request body */ callAsyncManagementApi(method: string, path: string[], apiVersion: string, body?: Body | null): Promise>; /** * Call an Azure IoT Hub API endpoint * @param {string} iotHubName - Azure IoT Hub name * @param {string} method - HTTP method to use * @param {string[]} path - the elements of a path to a resource in an URL * @param {string} apiVersion - API version to use * @param {Body?} body - request body */ callIotHubApi(iotHubName: string, method: string, path: string[], apiVersion: string, body?: Body | null): Promise>; callAcrApi(registryName: string, method: string, username: string, password: string, path: string[], body?: Body | null): Promise>; callStorageApi({ storageAccountName, method, endpoint, apiVersion, query, body, headers, }: CallStorageApiDto): Promise>; }