import { EventHubManagementClient , EventHubManagementModels } from '@azure/arm-eventhub' ; import { AzureWizardPromptStep } from 'vscode-azureextensionui' ; import { localize } from '../../../../localize' ; import { getResourceGroupFromId , promptForResource } from '../../../../utils/azure' ; import { createEventHubClient } from '../../../../utils/azureClients' ; import { nonNullProp } from '../../../../utils/nonNull' ; import { IEventHubWizardContext } from './IEventHubWizardContext' ; export class EventHubNamespaceListStep extends AzureWizardPromptStep < IEventHubWizardContext > { public async prompt ( context ) { const placeHolder = localize ( 'placeHolder' , 'Select an event hub namespace' ) ; const client = await createEventHubClient ( context ) ; const result = await promptForResource ( context , placeHolder , client . namespaces . list ( ) ) ; if ( result ) { context . namespaceName = nonNullProp ( result , 'name' ) ; context . resourceGroupName = getResourceGroupFromId ( nonNullProp ( result , 'id' ) ) ; } } public shouldPrompt ( context ) { return ! context . namespaceName ; } }