/// <summary> /// Creates a new datasource on the specified gateway. /// </summary> /// <remarks> /// <br/>**Required scope**: Dataset.ReadWrite.All <br/>To set the /// permissions scope, see [Register an /// app](https://docs.microsoft.com/power-bi/developer/register-app). /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='gatewayId'> /// The gateway id /// </param> /// <param name='datasourceToGatewayRequest'> /// The datasource requested to create /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <GatewayDatasource> CreateDatasourceAsync(this IGateways operations, string gatewayId, PublishDatasourceToGatewayRequest datasourceToGatewayRequest, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.CreateDatasourceWithHttpMessagesAsync(gatewayId, datasourceToGatewayRequest, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }