How to use the vscode-azureextensionui.addExtensionUserAgent function in vscode-azureextensionui

To help you get started, we’ve selected a few vscode-azureextensionui examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github microsoft / vscode-azurelogicapps / src / wizard / logic-app / LogicAppNameStep.ts View on Github external
private async isNameAvailable(name: string, wizardContext: IAzureLogicAppWizardContext): Promise {
        let resourceGroupName: string;
        if (wizardContext.newResourceGroupName) {
            return true;
        } else {
            resourceGroupName = wizardContext.resourceGroup!.name!;
        }

        const client = new LogicAppsManagementClient(wizardContext.credentials, wizardContext.subscriptionId);
        addExtensionUserAgent(client);

        let workflows = await client.workflows.listByResourceGroup(resourceGroupName);
        let nextPageLink = workflows.nextLink;
        if (workflows.some((workflow: Workflow) => workflow.name! === name)) {
            return false;
        }

        while (nextPageLink !== undefined) {
            workflows = await client.workflows.listByResourceGroupNext(nextPageLink);
            if (workflows.some((workflow: Workflow) => workflow.name! === name)) {
                return false;
            }

            nextPageLink = workflows.nextLink;
        }
github microsoft / vscode-azuretools / appservice / src / SiteClient.ts View on Github external
public get kudu(): KuduClient {
        if (!this.kuduHostName) {
            throw new Error(localize('notSupportedLinux', 'This operation is not supported by this app service plan.'));
        }
        const kuduClient: KuduClient = new KuduClient(this._subscription.credentials, this.kuduUrl);
        addExtensionUserAgent(kuduClient);
        return kuduClient;
    }
github microsoft / vscode-azuretools / appservice / src / getKuduClient.ts View on Github external
export async function getKuduClient(client: SiteClient): Promise {
    if (!client.kuduHostName) {
        const asp: AppServicePlan | undefined = await client.getAppServicePlan();
        const notSupportedLinux: string = localize('notSupportedLinux', 'This operation is not supported by App Service plans with kind "{0}" and sku tier "{1}".', client.kind, asp && asp.sku && asp.sku.tier);
        throw new Error(notSupportedLinux);
    }
    const user: User = await client.getWebAppPublishCredential();
    const cred: BasicAuthenticationCredentials = new BasicAuthenticationCredentials(user.publishingUserName, nonNullProp(user, 'publishingPassword'));

    const kuduClient: KuduClient = new KuduClient(cred, client.kuduUrl);
    addExtensionUserAgent(kuduClient);
    return kuduClient;
}
github microsoft / vscode-azurelogicapps / src / tree / integration-account / IntegrationAccountsProvider.ts View on Github external
public async loadMoreChildren(node: IAzureNode, clearCache: boolean): Promise {
        if (clearCache) {
            this.nextLink = undefined;
        }

        const client = new LogicAppsManagementClient(node.credentials, node.subscriptionId);
        addExtensionUserAgent(client);

        const integrationAccounts = this.nextLink === undefined
            ? await client.integrationAccounts.listBySubscription()
            : await client.integrationAccounts.listBySubscriptionNext(this.nextLink);

        this.nextLink = integrationAccounts.nextLink;

        return integrationAccounts.map((integrationAccount: IntegrationAccount) => new IntegrationAccountTreeItem(client, integrationAccount));
    }
github microsoft / vscode-azurelogicapps / src / wizard / integration-account / schemas / schemaCreateStep.ts View on Github external
public async execute(wizardContext: ISchemaWizardContext): Promise {
        const client = new LogicAppsManagementClient(wizardContext.credentials, wizardContext.subscriptionId);
        addExtensionUserAgent(client);

        const newSchema: IntegrationAccountSchema = await client.integrationAccountSchemas.createOrUpdate(wizardContext.resourceGroup!.name!,
            wizardContext.integrationAccountName,
            wizardContext.schemaName!,
            await createNewSchema(wizardContext.schemaName!));

        wizardContext.schema = new IntegrationAccountSchemaTreeItem(client, newSchema);

        return wizardContext;
    }
}
github microsoft / vscode-azurelogicapps / src / wizard / integration-account / maps / mapNameStep.ts View on Github external
private async isNameAvailable(name: string, wizardContext: IMapWizardContext): Promise {
        const client = new LogicAppsManagementClient(wizardContext.credentials, wizardContext.subscriptionId);
        addExtensionUserAgent(client);

        let maps = await client.integrationAccountMaps.list(wizardContext.resourceGroup!.name!, wizardContext.integrationAccountName);
        let nextPageLink = maps.nextLink;
        if (maps.some((map: IntegrationAccountMap) => map.name! === name)) {
            return false;
        }

        while (nextPageLink) {
            maps = await client.integrationAccountMaps.listNext(nextPageLink);
            if (maps.some((map: IntegrationAccountMap) => map.name! === name)) {
                return false;
            }

            nextPageLink = maps.nextLink;
        }
github microsoft / vscode-azurelogicapps / src / utils / integration-account / partnerUtils.ts View on Github external
export async function getAllPartners(credentials: ServiceClientCredentials, subscriptionId: string, resourceGroup: string, integrationAccount: string): Promise {
    const client = new LogicAppsManagementClient(credentials, subscriptionId);
    addExtensionUserAgent(client);

    const partners = await client.integrationAccountPartners.list(resourceGroup, integrationAccount);
    let nextPageLink = partners.nextLink;

    while (nextPageLink) {
        partners.push(...await client.integrationAccountPartners.listNext(nextPageLink));
        nextPageLink = partners.nextLink;
    }

    return partners;
}
github microsoft / vscode-azurelogicapps / src / wizard / integration-account / integrationAccountNameStep.ts View on Github external
private async isNameAvailable(name: string, wizardContext: IIntegrationAccountWizardContext): Promise {
        let resourceGroupName: string;
        if (wizardContext.newResourceGroupName) {
            return true;
        } else {
            resourceGroupName = wizardContext.resourceGroup!.name!;
        }

        const client = new LogicAppsManagementClient(wizardContext.credentials, wizardContext.subscriptionId);
        addExtensionUserAgent(client);

        let integrationAccounts = await client.integrationAccounts.listByResourceGroup(resourceGroupName);
        let nextPageLink = integrationAccounts.nextLink;
        if (integrationAccounts.some((integrationAccount: IntegrationAccount) => integrationAccount.name! === name)) {
            return false;
        }

        while (nextPageLink) {
            integrationAccounts = await client.integrationAccounts.listByResourceGroupNext(nextPageLink);
            if (integrationAccounts.some((integrationAccount: IntegrationAccount) => integrationAccount.name! === name)) {
                return false;
            }

            nextPageLink = integrationAccounts.nextLink;
        }
github microsoft / vscode-azurelogicapps / src / wizard / integration-account / schemas / schemaNameStep.ts View on Github external
private async isNameAvailable(name: string, wizardContext: ISchemaWizardContext): Promise {
        const client = new LogicAppsManagementClient(wizardContext.credentials, wizardContext.subscriptionId);
        addExtensionUserAgent(client);

        let schemas = await client.integrationAccountSchemas.list(wizardContext.resourceGroup!.name!, wizardContext.integrationAccountName);
        let nextPageLink = schemas.nextLink;
        if (schemas.some((schema: IntegrationAccountSchema) => schema.name! === name)) {
            return false;
        }

        while (nextPageLink) {
            schemas = await client.integrationAccountSchemas.listNext(nextPageLink);
            if (schemas.some((schema: IntegrationAccountSchema) => schema.name! === name)) {
                return false;
            }

            nextPageLink = schemas.nextLink;
        }