public async execute()

in tools/vscode-azurewebpubsub/src/workflows/hubSetting/common/CreateOrUpdateHubSettingStep.ts [17:37]


    public async execute(context: ICreateOrUpdateHubSettingContext, progress: Progress<{ message?: string; increment?: number }>): Promise<void> {
        progress.report({ message: this.isNewHub ? localize('creatingHubSetting', `Creating Hub Setting {0}`, context.hubName) 
                                                 : localize('updatingHubSetting', `Updating Hub Setting {0}`, context.hubName)});
        
        if (!context.hubProperties || !context.hubName || !context.resourceGroupName || !context.serviceName) {
            throw new Error(localize('invalidICreateOrUpdateHubSettingContext', 'Invalid ICreateOrUpdateHubSettingContext, hubName = {0}, resourceGroupName = {1}, serviceName = {2}, hubProperties = {3}',
                    context.hubName, context.resourceGroupName, context.serviceName, JSON.stringify(context.hubProperties)
                )
            );
        }

        await this.client.webPubSubHubs.beginCreateOrUpdateAndWait(context.hubName, context.resourceGroupName, context.serviceName, 
            {
                properties: {
                    ...context.hubProperties,
                    eventHandlers: context.hubProperties.eventHandlers ?? [],
                    eventListeners: context.hubProperties.eventListeners ?? []
                }
            }
        );
    }