-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathDataCenter.cs
49 lines (41 loc) · 2.03 KB
/
DataCenter.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
// Copyright © 2023 Textkernel BV. All rights reserved.
// This file is provided for use by, or on behalf of, Textkernel licensees
// within the terms of their license of Textkernel products or Textkernel customers
// within the Terms of Service pertaining to the Textkernel SaaS products.
using System;
namespace Textkernel.Tx
{
/// <summary>
/// Use either <see cref="US"/>, <see cref="EU"/> or <see cref="AU"/>
/// </summary>
public class DataCenter
{
/// <summary>
/// Represents the US datacenter. You can find out which datacenter your account is in at <see href="https://cloud.textkernel.com/tx/console/"/>
/// </summary>
public static DataCenter US = new DataCenter("https://api.us.textkernel.com/tx", "v10", true);
/// <summary>
/// Represents the EU datacenter. You can find out which datacenter your account is in at <see href="https://cloud.textkernel.com/tx/console/"/>
/// </summary>
public static DataCenter EU = new DataCenter("https://api.eu.textkernel.com/tx", "v10", true);
/// <summary>
/// Represents the AU datacenter. You can find out which datacenter your account is in at <see href="https://cloud.textkernel.com/tx/console/"/>
/// </summary>
public static DataCenter AU = new DataCenter("https://api.au.textkernel.com/tx", "v10", true);
internal string Root { get; private set; }
internal string Version { get; private set; }
internal bool IsSaaS { get; private set; }
internal DataCenter(string root, string version, bool isSaaS)
{
if (string.IsNullOrWhiteSpace(root)) throw new ArgumentNullException(nameof(root));
Root = root;
Version = version;
IsSaaS = isSaaS;
}
/// <summary>
/// Create a DataCenter for a self-hosted instance
/// </summary>
/// <param name="endpoint">The URL of your self-hosted instance</param>
public DataCenter(string endpoint) : this(endpoint, null, false) { }
}
}