/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the Source EULA. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import * as azdataExt from 'azdata-ext'; /** * Simple fake Azdata Api used to mock the API during tests */ export class FakeAzdataApi implements azdataExt.IAzdataApi { public postgresInstances: azdataExt.PostgresServerListResult[] = []; public miaaInstances: azdataExt.SqlMiListResult[] = []; // // API Implementation // public get arc() { const self = this; return { dc: { create(_namespace: string, _name: string, _connectivityMode: string, _resourceGroup: string, _location: string, _subscription: string, _profileName?: string, _storageClass?: string): Promise> { throw new Error('Method not implemented.'); }, endpoint: { async list(): Promise> { return { result: [] }; } }, config: { list(): Promise> { throw new Error('Method not implemented.'); }, async show(): Promise> { return { result: undefined! }; } } }, postgres: { server: { delete(_name: string): Promise> { throw new Error('Method not implemented.'); }, async list(): Promise> { return { result: self.postgresInstances }; }, show(_name: string): Promise> { throw new Error('Method not implemented.'); }, edit( _name: string, _args: { adminPassword?: boolean, coresLimit?: string, coresRequest?: string, engineSettings?: string, extensions?: string, memoryLimit?: string, memoryRequest?: string, noWait?: boolean, port?: number, replaceEngineSettings?: boolean, workers?: number }, _additionalEnvVars?: { [key: string]: string }): Promise> { throw new Error('Method not implemented.'); } } }, sql: { mi: { delete(_name: string): Promise> { throw new Error('Method not implemented.'); }, async list(): Promise> { return { result: self.miaaInstances }; }, show(_name: string): Promise> { throw new Error('Method not implemented.'); } } } }; } getPath(): Promise { throw new Error('Method not implemented.'); } login(_endpoint: string, _username: string, _password: string): Promise> { return undefined; } version(): Promise> { throw new Error('Method not implemented.'); } getSemVersion(): any { throw new Error('Method not implemented.'); } }