in src/BundledBindings/EventHubOutputBinding.cs [17:40]
public override BindingInformation? ExtractBinding(AttributeAst attribute)
{
BindingInformation bindingInformation = new BindingInformation();
bindingInformation.Type = BindingType;
bindingInformation.Direction = BindingDirection;
string bindingName = WorkerIndexingHelper.GetNamedArgumentStringValue(attribute, Constants.BindingPropertyNames.Name, Constants.DefaultEventHubOutputName);
string eventHubName = WorkerIndexingHelper.GetNamedArgumentStringValue(attribute, Constants.BindingPropertyNames.EventHubName);
string connection = WorkerIndexingHelper.GetNamedArgumentStringValue(attribute, Constants.BindingPropertyNames.Connection);
bindingInformation.Name = bindingName;
if (!string.IsNullOrWhiteSpace(eventHubName) && !string.IsNullOrWhiteSpace(connection))
{
bindingInformation.otherInformation.Add(Constants.JsonPropertyNames.EventHubName, eventHubName);
bindingInformation.otherInformation.Add(Constants.JsonPropertyNames.Connection, connection);
return bindingInformation;
}
else
{
throw new Exception(AzPowerShellSdkStrings.MalformedEventHubAttribute);
}
}