forked from Azure/autorest
-
Notifications
You must be signed in to change notification settings - Fork 8
/
ServiceClientCredentials.cs
39 lines (36 loc) · 1.44 KB
/
ServiceClientCredentials.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
namespace Microsoft.Rest
{
/// <summary>
/// ServiceClientCredentials is the abstraction for credentials used by ServiceClients accessing REST services.
/// </summary>
public abstract class ServiceClientCredentials
{
/// <summary>
/// Initialize a ServiceClient instance for accessing REST APIs with these credentials.
/// </summary>
/// <typeparam name="T">Type of ServiceClient.</typeparam>
/// <param name="client">The ServiceClient.</param>
public virtual void InitializeServiceClient<T>(ServiceClient<T> client)
where T : ServiceClient<T>
{
}
/// <summary>
/// Apply the credentials to the HTTP request.
/// </summary>
/// <param name="request">The HTTP request message.</param>
/// <param name="cancellationToken">Cancellation token.</param>
/// <returns>
/// Task that will complete when processing has finished.
/// </returns>
public virtual Task ProcessHttpRequestAsync(HttpRequestMessage request, CancellationToken cancellationToken)
{
// Return an empty task by default
return Task.FromResult<object>(null);
}
}
}