-
Notifications
You must be signed in to change notification settings - Fork 4.5k
/
BatchSharedKeyCredentials.cs
52 lines (46 loc) · 1.75 KB
/
BatchSharedKeyCredentials.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
40
41
42
43
44
45
46
47
48
49
50
51
52
//
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
namespace Microsoft.Azure.Batch.Auth
{
using System;
/// <summary>
/// Shared key credentials for an Azure Batch account.
/// </summary>
public class BatchSharedKeyCredentials : BatchCredentials
{
/// <summary>
/// Gets the Batch account name.
/// </summary>
public string AccountName { get; private set; }
/// <summary>
/// Gets the Base64 encoded account access key.
/// </summary>
internal string KeyValue { get; private set; }
/// <summary>
/// Initializes a new instance of the <see cref="BatchSharedKeyCredentials"/> class with the specified Batch service endpoint, account name, and access key.
/// </summary>
/// <param name="baseUrl">The Batch service endpoint.</param>
/// <param name="accountName">The name of the Batch account.</param>
/// <param name="keyValue">The Base64 encoded account access key.</param>
public BatchSharedKeyCredentials(string baseUrl, string accountName, string keyValue)
{
if (string.IsNullOrEmpty(baseUrl))
{
throw new ArgumentNullException("baseUrl");
}
if (string.IsNullOrEmpty(accountName))
{
throw new ArgumentNullException("accountName");
}
if (string.IsNullOrEmpty(keyValue))
{
throw new ArgumentNullException("keyValue");
}
this.BaseUrl = baseUrl;
this.AccountName = accountName;
this.KeyValue = keyValue;
}
}
}