Skip to content

Commit

Permalink
Build 1.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
antonchi committed May 9, 2019
1 parent 57efa4e commit eb97140
Show file tree
Hide file tree
Showing 59 changed files with 270 additions and 77,570 deletions.
2 changes: 0 additions & 2 deletions .gitattributes

This file was deleted.

34 changes: 30 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,32 @@
.vs/*
*/obj/*

#ignore thumbnails created by windows
Thumbs.db
#Ignore files build by Visual Studio
*.obj
*.exe
*.pdb
*.user
*.aps
*.pch
*.vspscc
*_i.c
*_p.c
*.ncb
*.suo
*.pdb
*.vshost.*
*.tlb
*.tlh
*.bak
*.cache
*.ilk
*.log
[Bb]in
[Dd]ebug*/
*.lib
*.sbr
obj/
[Rr]elease*/
_ReSharper*/
[Tt]est[Rr]esult*
.vs/

/IntentoSDK.dll
3 changes: 1 addition & 2 deletions IntentoSDK/Embed.bat → Embed.bat
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
echo on
echo off
set arg1=%1
set arg2=%2
echo %arg1%..\ilmerge\ilmerge /targetplatform:v4 /out:%arg1%IntentoSDK.dll %arg1%%arg2%IntentoSDK.dll %arg1%..\Newtonsoft\Newtonsoft.Json.dll
%arg1%..\ilmerge\ilmerge /targetplatform:v4 /out:%arg1%IntentoSDK.dll %arg1%%arg2%IntentoSDK.dll %arg1%..\Newtonsoft\Newtonsoft.Json.dll

6 changes: 3 additions & 3 deletions IntentoSDK/HttpConnector.cs → HttpConnector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
using System.Web;
using System.Net.Http;
using System.Threading.Tasks;
using System.Reflection;

namespace IntentoSDK
{
Expand All @@ -26,7 +25,7 @@ public HttpConnector(Intento _intento)

client = new HttpClient();
client.DefaultRequestHeaders.Add("apikey", intento.apiKey);
string userAgent = string.Format("Intento.CSharpSDK/{0} {1}", Intento.version, intento.otherUserAgent);
string userAgent = string.Format("Intento.CSharpSDK/{0} {1}", intento.version, intento.otherUserAgent);
client.DefaultRequestHeaders.Add("User-Agent", userAgent);
}

Expand All @@ -45,7 +44,8 @@ async public Task<dynamic> PostAsync(string path, dynamic json)

async public Task<dynamic> GetAsync(string path)
{
HttpResponseMessage response = await client.GetAsync(intento.serverUrl + path);
var url = intento.serverUrl + path;
HttpResponseMessage response = await client.GetAsync(url);
dynamic jsonResult = await GetJson(response);

if (response.StatusCode != HttpStatusCode.OK)
Expand Down
34 changes: 18 additions & 16 deletions IntentoSDK/Intento.cs → Intento.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System.Net;
using System.Reflection;
using System.Diagnostics;

namespace IntentoSDK
{
Expand All @@ -19,7 +21,17 @@ public class Intento
internal Dictionary<string, object> auth;
internal string serverUrl;
internal string otherUserAgent;
internal static string version = GetVersion();
internal string version;

// Revision history
// 1.1.0: Public version
// 1.1.1: 2019-01-06
// - Corrected behaviour for async-wait-async request with sandbox apikey or error in validation of prarmeters.
// In this case no operation id returned from IntentoAPI, but result (in case of sandbox key) or error information.
// 1.1.2: 2019-02-02
// - More correct processing of text parameter of Fulfill operation
// 1.1.3: 2019-03-31
// - Added methods for obtaining models and glossaries from the provider

private Intento(string apiKey, Dictionary<string, object> auth=null, string path="https://api.inten.to/",
string userAgent = null)
Expand All @@ -28,20 +40,10 @@ private Intento(string apiKey, Dictionary<string, object> auth=null, string path
this.auth = auth != null ? new Dictionary<string, object>(auth) : null;
this.serverUrl = path;
otherUserAgent = userAgent;
}

private static string GetVersion()
{
try
{
Assembly currentAssem = typeof(Intento).Assembly;
string version = string.Format("{0}", currentAssem.GetName().Version);
version = version.Substring(0, version.Length - 2);
return version;
}
catch { }

return "Unknown";
System.Net.ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;
var assembly = Assembly.GetExecutingAssembly();
var fvi = FileVersionInfo.GetVersionInfo(assembly.Location);
this.version = string.Format("{0}.{1}.{2}", fvi.FileMajorPart, fvi.FileMinorPart, fvi.FileBuildPart);
}

public static Intento Create(string intentoKey, Dictionary<string, object> auth=null, string path = "https://api.inten.to/",
Expand Down
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit eb97140

Please sign in to comment.