Add AzureAccount service (#18502)

This commit is contained in:
Charles Gagnon
2022-02-22 09:00:07 -08:00
committed by GitHub
parent 40ee82ee3e
commit 5547c2baba
11 changed files with 154 additions and 0 deletions

View File

@@ -3,6 +3,7 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import './mainThreadAzureAccount';
import './mainThreadAccountManagement';
import './mainThreadBackgroundTaskManagement';
import './mainThreadConnectionManagement';

View File

@@ -0,0 +1,37 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import type * as azurecore from 'azurecore';
import { Disposable } from 'vs/base/common/lifecycle';
import {
ExtHostAzureAccountShape,
MainThreadAzureAccountShape,
SqlExtHostContext,
SqlMainContext
} from 'sql/workbench/api/common/sqlExtHost.protocol';
import { IExtHostContext } from 'vs/workbench/api/common/extHost.protocol';
import { extHostNamedCustomer } from 'vs/workbench/api/common/extHostCustomers';
import { IAzureAccountService } from 'sql/platform/azureAccount/common/azureAccountService';
import { AzureAccountService } from 'sql/workbench/services/azureAccount/browser/azureAccountService';
@extHostNamedCustomer(SqlMainContext.MainThreadAzureAccount)
export class MainThreadAzureAccount extends Disposable implements MainThreadAzureAccountShape {
private _proxy: ExtHostAzureAccountShape;
public _serviceBrand: undefined;
constructor(
extHostContext: IExtHostContext,
@IAzureAccountService azureAccountService: IAzureAccountService
) {
super();
this._proxy = extHostContext.getProxy(SqlExtHostContext.ExtHostAzureAccount);
(azureAccountService as AzureAccountService).registerProxy(this);
}
public async getSubscriptions(account: azurecore.AzureAccount, ignoreErrors?: boolean, selectedOnly?: boolean): Promise<azurecore.GetSubscriptionsResult> {
return this._proxy.$getSubscriptions(account, ignoreErrors, selectedOnly);
}
}