-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Expand file tree
/
Copy pathCallAutomationClientOptions.cs
More file actions
84 lines (73 loc) · 2.88 KB
/
CallAutomationClientOptions.cs
File metadata and controls
84 lines (73 loc) · 2.88 KB
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using System;
using System.Net.Http;
using Azure.Core;
using Azure.Core.Pipeline;
namespace Azure.Communication.CallAutomation
{
/// <summary>
/// The latest version of the Call Automation.
/// </summary>
public class CallAutomationClientOptions : ClientOptions
{
/// <summary>
/// The latest version of the CallAutomation service.
/// </summary>
internal const ServiceVersion LatestVersion = ServiceVersion.V2024_09_01_Preview;
internal string ApiVersion { get; }
/// <summary>
/// The caller source of the call automation client.
/// Mutual exclusive with <see cref="OPSSource"/>.
/// </summary>
public CommunicationUserIdentifier Source { get; set; }
/// <summary>
/// The One Phone System caller source of the call automation client.
/// Mutual exclusive with <see cref="Source"/>.
/// </summary>
public MicrosoftTeamsAppIdentifier OPSSource { get; set; }
/// <summary>
/// Initializes a new instance of the <see cref="CallAutomationClientOptions"/>.
/// </summary>
public CallAutomationClientOptions(ServiceVersion version = LatestVersion)
{
ApiVersion = version switch
{
ServiceVersion.V2023_03_06 => "2023-03-06",
ServiceVersion.V2023_06_15_Preview => "2023-06-15-preview",
ServiceVersion.V2023_10_15 => "2023-10-15",
ServiceVersion.V2023_10_03_Preview => "2023-10-03-preview",
ServiceVersion.V2024_09_01_Preview => "2024-09-01-preview",
_ => throw new ArgumentOutOfRangeException(nameof(version)),
};
}
/// <summary>
/// The CallAutomation service version.
/// </summary>
public enum ServiceVersion
{
#pragma warning disable CA1707 // Identifiers should not contain underscores
/// <summary>
/// The GA1 (1.0.0) of the CallAutomation service.
/// </summary>
V2023_03_06 = 1,
/// <summary>
/// The BETA2 (1.1.0-beta) of the CallAutomation service.
/// </summary>
V2023_06_15_Preview = 2,
/// <summary>
/// The GA2 (1.1.0) of the CallAutomation service.
/// </summary>
V2023_10_15 = 3,
/// <summary>
/// Latest ALPHA3 (1.2.0-alpha) preview of the CallAutomation service.
/// </summary>
V2023_10_03_Preview = 4,
/// <summary>
/// Latest ALPHA4 (1.4.0-alpha) preview of the CallAutomation service.
/// </summary>
V2024_09_01_Preview = 5
#pragma warning restore CA1707 // Identifiers should not contain underscores
}
}
}