diff --git a/src/ComDiadocApi.cs b/src/ComDiadocApi.cs index 1feda8bf..2eca56b9 100644 --- a/src/ComDiadocApi.cs +++ b/src/ComDiadocApi.cs @@ -605,6 +605,11 @@ public void SetProxyCredentialsSecure(string proxyUser, SecureString proxyPasswo diadoc.SetProxyCredentials(proxyUser, proxyPassword); } + public void SetSolutionInfo(string solutionInfo) + { + diadoc.SetSolutionInfo(solutionInfo); + } + public void EnableSystemProxyUsage() { diadoc.EnableSystemProxyUsage(); diff --git a/src/DiadocApi.cs b/src/DiadocApi.cs index 6fc5e38b..0ab2d940 100644 --- a/src/DiadocApi.cs +++ b/src/DiadocApi.cs @@ -90,6 +90,14 @@ public void SetProxyCredentials([NotNull] string user, [NotNull] SecureString pa diadocHttpApi.HttpClient.SetProxyCredentials(user, password); } + /// + /// Установить информацию об интеграционном решении технологического партнера. + /// + public void SetSolutionInfo([NotNull] string solutionInfo) + { + diadocHttpApi.SolutionInfo = solutionInfo; + } + public string Authenticate(string login, string password, string key = null, string id = null) { return diadocHttpApi.Authenticate(login, password, key, id); diff --git a/src/DiadocHttpApi.cs b/src/DiadocHttpApi.cs index d99473ee..adde8b92 100644 --- a/src/DiadocHttpApi.cs +++ b/src/DiadocHttpApi.cs @@ -47,6 +47,11 @@ public DiadocHttpApi( [NotNull] public IHttpClient HttpClient { get; } [NotNull] public DocflowHttpApi Docflow { get; } + + /// + /// Информация об интеграционном решении технологического партнера. + /// + [CanBeNull] public string SolutionInfo { get; set; } [NotNull] protected byte[] PerformHttpRequest( @@ -150,6 +155,10 @@ protected virtual HttpRequest BuildRequest( sb.AppendFormat(",ddauth_token={0}", token); } request.AddHeader("Authorization", sb.ToString()); + if (!string.IsNullOrEmpty(SolutionInfo)) + { + request.AddHeader("X-Solution-Info", SolutionInfo); + } return request; } diff --git a/tests/TaskAsyncronousPattern_Test.cs b/tests/TaskAsyncronousPattern_Test.cs index dfb9ef88..96831db4 100644 --- a/tests/TaskAsyncronousPattern_Test.cs +++ b/tests/TaskAsyncronousPattern_Test.cs @@ -114,7 +114,8 @@ private static IEnumerable GetAllDiadocHttpApiMethods() "SetProxyUri", "EnableSystemProxyUsage", "DisableSystemProxyUsage", - "SetProxyCredentials" + "SetProxyCredentials", + "SetSolutionInfo" }; private static readonly string[] ObjectMethods = typeof(object).GetMethods().Select(x => x.Name).ToArray(); @@ -127,4 +128,4 @@ private static IEnumerable GetAllApiMethodsForType(Type type) .Where(x => !ObjectMethods.Contains(x.Name)); } } -} \ No newline at end of file +}