/// <summary> /// Gets the Shared Access Authorization Token for the gateway. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='serviceName'> /// The name of the API Management service. /// </param> /// <param name='gatewayId'> /// Gateway entity identifier. Must be unique in the current API Management /// service instance. Must not have value 'managed' /// </param> /// <param name='parameters'> /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <GatewayTokenContract> GenerateTokenAsync(this IGatewayOperations operations, string resourceGroupName, string serviceName, string gatewayId, GatewayTokenRequestContract parameters, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GenerateTokenWithHttpMessagesAsync(resourceGroupName, serviceName, gatewayId, parameters, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Gets the Shared Access Authorization Token for the gateway. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='serviceName'> /// The name of the API Management service. /// </param> /// <param name='gatewayId'> /// Gateway entity identifier. Must be unique in the current API Management /// service instance. Must not have value 'managed' /// </param> /// <param name='parameters'> /// </param> public static GatewayTokenContract GenerateToken(this IGatewayOperations operations, string resourceGroupName, string serviceName, string gatewayId, GatewayTokenRequestContract parameters) { return(operations.GenerateTokenAsync(resourceGroupName, serviceName, gatewayId, parameters).GetAwaiter().GetResult()); }