diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5abcd38 --- /dev/null +++ b/.gitignore @@ -0,0 +1,191 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.sln.docstates + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +build/ +bld/ +[Bb]in/ +[Oo]bj/ + +# Roslyn cache directories +*.ide/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +#NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +*_i.c +*_p.c +*_i.h +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opensdf +*.sdf +*.cachefile + +# Visual Studio profiler +*.psess +*.vsp +*.vspx + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding addin-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# NCrunch +_NCrunch_* +.*crunch*.local.xml + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# TODO: Comment the next line if you want to checkin your web deploy settings +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/packages/* +# except build/, which is used as an MSBuild target. +!**/packages/build/ +# If using the old MSBuild-Integrated Package Restore, uncomment this: +#!**/packages/repositories.config + +# Windows Azure Build Output +csx/ +*.build.csdef + +# Windows Store app package directory +AppPackages/ + +# Others +sql/ +*.Cache +ClientBin/ +[Ss]tyle[Cc]op.* +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.pfx +*.publishsettings +node_modules/ +.vs + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +*.mdf +*.ldf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings + +# Microsoft Fakes +FakesAssemblies/ + +# Other +.DS_Store +/packages + +# Ignore config because api keys are stored here (copy example configs to these files) +web.config +app.config diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..550b627 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,9 @@ +language: csharp +solution: InterFAX.Api.sln +install: + - cp ./InterFAX.Api.Test.Integration/App.config.example ./InterFAX.Api.Test.Integration/App.config + - nuget restore InterFAX.Api.sln + - nuget install NUnit.Runners -Version 3.4.1 -OutputDirectory testrunner +script: + - xbuild /p:Configuration=Release InterFAX.Api.sln + - mono ./testrunner/NUnit.ConsoleRunner.3.4.1/tools/nunit3-console.exe ./InterFAX.Api.Test.Unit/bin/Release/InterFAX.Api.Test.Unit.dll diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..3b5a10f --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,4 @@ + +# 1.0.0 (2016-09-16) + +* Initial release with nuget package \ No newline at end of file diff --git a/InterFAX.Api.Test.Integration/AccountTests.cs b/InterFAX.Api.Test.Integration/AccountTests.cs new file mode 100644 index 0000000..f1931bb --- /dev/null +++ b/InterFAX.Api.Test.Integration/AccountTests.cs @@ -0,0 +1,16 @@ +using NUnit.Framework; + +namespace InterFAX.Api.Test.Integration +{ + [TestFixture] + public class AccountTests + { + [Test] + public void can_get_balance() + { + var interfax = new FaxClient(); + var actual = interfax.Account.GetBalance().Result; + Assert.IsTrue(actual > 0); + } + } +} \ No newline at end of file diff --git a/InterFAX.Api.Test.Integration/App.config.example b/InterFAX.Api.Test.Integration/App.config.example new file mode 100644 index 0000000..544c4c3 --- /dev/null +++ b/InterFAX.Api.Test.Integration/App.config.example @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/InterFAX.Api.Test.Integration/DocumentsTests.cs b/InterFAX.Api.Test.Integration/DocumentsTests.cs new file mode 100644 index 0000000..8a08012 --- /dev/null +++ b/InterFAX.Api.Test.Integration/DocumentsTests.cs @@ -0,0 +1,170 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Net; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; +using InterFAX.Api.Dtos; +using NUnit.Framework; + +namespace InterFAX.Api.Test.Integration +{ + [TestFixture] + public class DocumentsTests + { + private FaxClient _interfax; + private readonly string _testPath; + + public DocumentsTests() + { + _testPath = new Uri(Path.GetDirectoryName(Assembly.GetExecutingAssembly().CodeBase)).LocalPath; + } + + [SetUp] + public void Setup() + { + _interfax = new FaxClient(); + } + + [Test] + public void can_get_outbound_document_list() + { + Assert.DoesNotThrow(() => + { + var list = _interfax.Outbound.Documents.GetUploadSessions().Result; + }); + } + + [Test] + public void can_get_outbound_document_list_with_listoptions() + { + Assert.DoesNotThrow(() => + { + var list = _interfax.Outbound.Documents.GetUploadSessions(new Documents.ListOptions + { + Offset = 10, + Limit = 5 + }).Result; + }); + } + + [Test] + public void can_create_and_delete_document_upload_session() + { + var options = new Documents.UploadSessionOptions + { + Name = "document.pdf", + Size = 102400, + Disposition = DocumentDisposition.SingleUse, + Sharing = DocumentSharing.Private + }; + + var sessionId = _interfax.Outbound.Documents.CreateUploadSession(options).Result; + Assert.NotNull(sessionId); + + var sessionStatus = _interfax.Outbound.Documents.GetUploadSession(sessionId).Result; + Assert.NotNull(sessionStatus); + Assert.AreEqual(options.Name, sessionStatus.FileName); + Assert.AreEqual(options.Size, sessionStatus.FileSize); + Assert.AreEqual(options.Disposition, sessionStatus.Disposition); + Assert.AreEqual(options.Sharing, sessionStatus.Sharing); + Assert.AreEqual(DocumentStatus.Created, sessionStatus.Status); + + var result = _interfax.Outbound.Documents.CancelUploadSession(sessionId).Result; + Assert.AreEqual("OK", result); + + var exception = Assert.Throws(() => + { + var response = _interfax.Outbound.Documents.GetUploadSession(sessionId).Result; + }); + + var apiException = exception.InnerExceptions[0] as ApiException; + Assert.NotNull(apiException); + + var error = apiException.Error; + Assert.AreEqual(HttpStatusCode.NotFound, apiException.StatusCode); + Assert.AreEqual(-1062, error.Code); + Assert.AreEqual("Wrong uploaded document resource", error.Message); + Assert.IsNull(error.MoreInfo); + } + + + [Test] + public void can_upload_large_document() + { + var fileInfo = new FileInfo(Path.Combine(_testPath, "large.pdf")); + + var options = new Documents.UploadSessionOptions + { + Name = fileInfo.Name, + Size = (int) fileInfo.Length, + Disposition = DocumentDisposition.SingleUse, + Sharing = DocumentSharing.Private + }; + + // Upload the document. + var session = _interfax.Outbound.Documents.UploadDocument(fileInfo.FullName); + + // Delete the session + var result = _interfax.Outbound.Documents.CancelUploadSession(session.Id).Result; + Assert.AreEqual("OK", result); + + // Check that the session no longer exists + var exception = Assert.Throws(() => + { + var response = _interfax.Outbound.Documents.GetUploadSession(session.Id).Result; + }); + + var apiException = exception.InnerExceptions[0] as ApiException; + Assert.NotNull(apiException); + + var error = apiException.Error; + Assert.AreEqual(HttpStatusCode.NotFound, apiException.StatusCode); + Assert.AreEqual(-1062, error.Code); + Assert.AreEqual("Wrong uploaded document resource", error.Message); + Assert.IsNull(error.MoreInfo); + } + + [Test] + public void can_fax_small_document() + { + var fileInfo = new FileInfo(Path.Combine(_testPath, "test.pdf")); + + var options = new Documents.UploadSessionOptions + { + Name = fileInfo.Name, + Size = (int)fileInfo.Length, + Disposition = DocumentDisposition.SingleUse, + Sharing = DocumentSharing.Private + }; + + // Upload the document. + var session = _interfax.Outbound.Documents.UploadDocument(fileInfo.FullName); + + // Fax the document + var faxDocument = _interfax.Documents.BuildFaxDocument(session.Uri); + var faxId = _interfax.Outbound.SendFax(faxDocument, new SendOptions {FaxNumber = "+442086090368" }); + + // Delete the session + var result = _interfax.Outbound.Documents.CancelUploadSession(session.Id).Result; + Assert.AreEqual("OK", result); + + // Check that the session no longer exists + var exception = Assert.Throws(() => + { + var response = _interfax.Outbound.Documents.GetUploadSession(session.Id).Result; + }); + + var apiException = exception.InnerExceptions[0] as ApiException; + Assert.NotNull(apiException); + + var error = apiException.Error; + Assert.AreEqual(HttpStatusCode.NotFound, apiException.StatusCode); + Assert.AreEqual(-1062, error.Code); + Assert.AreEqual("Wrong uploaded document resource", error.Message); + Assert.IsNull(error.MoreInfo); + } + } +} diff --git a/InterFAX.Api.Test.Integration/InboundTests.cs b/InterFAX.Api.Test.Integration/InboundTests.cs new file mode 100644 index 0000000..c242b82 --- /dev/null +++ b/InterFAX.Api.Test.Integration/InboundTests.cs @@ -0,0 +1,134 @@ +using System; +using System.IO; +using System.Linq; +using System.Net; +using NUnit.Framework; + +namespace InterFAX.Api.Test.Integration +{ + public class InboundTests + { + private FaxClient _interfax; + + [SetUp] + public void Setup() + { + _interfax = new FaxClient(); + } + + [Test] + public void can_get_inbound_fax_list() + { + var list = _interfax.Inbound.GetList().Result; + Assert.IsTrue(list.Any()); + } + + [Test] + public void can_get_forwarding_emails() + { + var emails = _interfax.Inbound.GetForwardingEmails(291704306).Result; + Assert.IsTrue(emails.Any()); + } + + [Test] + public void can_get_single_fax() + { + var item = _interfax.Inbound.GetFaxRecord(291704306).Result; + Assert.NotNull(item); + } + + [Test] + public void can_get_inbound_fax_list_with_listoptions() + { + var list = _interfax.Inbound.GetList(new Inbound.ListOptions + { + UnreadOnly = true, + Limit = 10, + AllUsers = true + }).Result; + Assert.IsTrue(list.Any()); + } + + [Test] + public void can_stream_fax_image_to_file() + { + var filename = $"{Guid.NewGuid().ToString()}.tiff"; + + using (var imageStream = _interfax.Inbound.GetFaxImageStream(291704306).Result) + { + using (var fileStream = File.Create(filename)) + { + Utils.CopyStream(imageStream, fileStream); + } + } + Assert.IsTrue(File.Exists(filename)); + Assert.IsTrue(new FileInfo(filename).Length > 0); + File.Delete(filename); + } + + [Test] + public void can_mark_fax_as_read() + { + const int messageId = 291704306; + + var response = _interfax.Inbound.MarkRead(messageId).Result; + + var fax = _interfax.Inbound.GetFaxRecord(messageId).Result; + Assert.AreEqual(ImageStatus.READ, fax.ImageStatus); + } + + [Test] + public void can_mark_fax_as_unread() + { + const int messageId = 291704306; + + var response = _interfax.Inbound.MarkUnread(messageId).Result; + + var fax = _interfax.Inbound.GetFaxRecord(messageId).Result; + Assert.AreEqual(ImageStatus.UNREAD, fax.ImageStatus); + } + + [Test] + public void can_resend_fax() + { + const int messageId = 291704306; + + Assert.DoesNotThrow(() => + { + var response = _interfax.Inbound.Resend(messageId).Result; + }); + } + + + [Test] + public void resending_non_existing_fax_builds_error_response() + { + const int messageId = 1; + + var exception = Assert.Throws(() => + { + var response = _interfax.Inbound.Resend(messageId).Result; + }); + + var apiException = exception.InnerExceptions[0] as ApiException; + Assert.NotNull(apiException); + + var error = apiException.Error; + Assert.AreEqual(HttpStatusCode.NotFound, apiException.StatusCode); + Assert.AreEqual(-3001, error.Code); + Assert.AreEqual("Invalid MessageID or User is not authorized to access message", error.Message); + Assert.AreEqual("Invalid ID [1]", error.MoreInfo); + } + + [Test] + public void can_resend_fax_with_email_address() + { + const int messageId = 291704306; + + Assert.DoesNotThrow(() => + { + var response = _interfax.Inbound.Resend(messageId, "InterFAXDevelopersDotNet@interfax.net").Result; + }); + } + } +} \ No newline at end of file diff --git a/Interfax.ClientLib/Interfax.ClientLib.csproj b/InterFAX.Api.Test.Integration/InterFAX.Api.Test.Integration.csproj similarity index 52% rename from Interfax.ClientLib/Interfax.ClientLib.csproj rename to InterFAX.Api.Test.Integration/InterFAX.Api.Test.Integration.csproj index 70cb4fb..4a632b5 100644 --- a/Interfax.ClientLib/Interfax.ClientLib.csproj +++ b/InterFAX.Api.Test.Integration/InterFAX.Api.Test.Integration.csproj @@ -1,85 +1,91 @@ - - - - - Debug - AnyCPU - {D68E4382-67D1-4851-B063-9BA6E3A8293A} - Library - Properties - Interfax.ClientLib - Interfax.ClientLib - v4.5.1 - 512 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - Off - bin\Debug\Interfax.ClientLib.XML - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - bin\Release\Interfax.ClientLib.XML - Off - - - - False - ..\..\Lib\Newtonsoft.Json.dll - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + Debug + AnyCPU + {738F8549-D143-4B8D-8641-A1BF57947518} + Library + Properties + InterFAX.Api.Test.Integration + InterFAX.Api.Test.Integration + v4.5.2 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\packages\NUnit.3.4.1\lib\net45\nunit.framework.dll + True + + + + + + + + + + + + + + + + + + + + + large.pdf + PreserveNewest + + + test.pdf + PreserveNewest + + + + + + + + {1A4809EE-070E-4255-BDD2-2AEECDBA5BC5} + InterFAX.Api + + + + + test.html + PreserveNewest + + + test.txt + PreserveNewest + + + + \ No newline at end of file diff --git a/InterFAX.Api.Test.Integration/OutboundTests.cs b/InterFAX.Api.Test.Integration/OutboundTests.cs new file mode 100644 index 0000000..85793ae --- /dev/null +++ b/InterFAX.Api.Test.Integration/OutboundTests.cs @@ -0,0 +1,170 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Net; +using System.Reflection; +using NUnit.Framework; + +namespace InterFAX.Api.Test.Integration +{ + [TestFixture] + public class OutboundTests + { + private FaxClient _interfax; + private readonly string _testPath; + + public OutboundTests() + { + _testPath = new Uri(Path.GetDirectoryName(Assembly.GetExecutingAssembly().CodeBase)).LocalPath; + } + + [SetUp] + public void Setup() + { + _interfax = new FaxClient(); + } + + + [Test] + public void can_get_outbound_fax_list() + { + var list = _interfax.Outbound.GetList().Result; + Assert.IsTrue(list.Any()); + } + + + [Test] + public void can_get_outbound_fax_list_with_listoptions() + { + // not testing the results, except that they should be a list of + // whether the REST api is working correctly or not isn't part of these tests. + + var list = _interfax.Outbound.GetList(new Outbound.ListOptions + { + LastId = 0, + Limit = 2, + SortOrder = ListSortOrder.Ascending + }).Result; + Assert.IsTrue(list.Any()); + } + + [Test] + public void can_stream_fax_image_to_file() + { + var filename = $"{Guid.NewGuid().ToString()}.tiff"; + + using (var imageStream = _interfax.Outbound.GetFaxImageStream(662208217).Result) + { + using (var fileStream = File.Create(filename)) + { + Utils.CopyStream(imageStream, fileStream); + } + } + Assert.IsTrue(File.Exists(filename)); + Assert.IsTrue(new FileInfo(filename).Length > 0); + File.Delete(filename); + } + + [Test] + public void cancelling_already_sent_fax_builds_error_response() + { + const int messageId = 661900007; + + var exception = Assert.Throws(() => + { + var result = _interfax.Outbound.CancelFax(messageId).Result; + }); + + var apiException = exception.InnerExceptions[0] as ApiException; + Assert.NotNull(apiException); + + var error = apiException.Error; + Assert.AreEqual(HttpStatusCode.Conflict, apiException.StatusCode); + Assert.AreEqual(-162, error.Code); + Assert.AreEqual("Transaction is in a wrong status for this operation", error.Message); + Assert.AreEqual("Transaction ID 661900007 has already completed", error.MoreInfo); + } + + [Test] + public void can_resend_fax() + { + const int messageId = 661900007; + + var exception = Assert.Throws(() => + { + var response = _interfax.Outbound.CancelFax(messageId).Result; + }); + } + + [Test] + public void can_hide_fax() + { + var faxDocument = _interfax.Documents.BuildFaxDocument(Path.Combine(_testPath, "test.pdf")); + var faxId = _interfax.Outbound.SendFax(faxDocument, new SendOptions + { + FaxNumber = "+442086090368", + + }).Result; + + // verify it shows up in the list + var faxes = _interfax.Outbound.SearchFaxes(new SearchOptions { Ids = new [] {faxId}}).Result; + Assert.AreEqual(1, faxes.Count()); + + // hide the fax + var response = _interfax.Outbound.HideFax(faxId).Result; + + // search again + faxes = _interfax.Outbound.SearchFaxes(new SearchOptions { Ids = new[] { faxId } }).Result; + Assert.AreEqual(0, faxes.Count()); + } + + [Test] + public void can_send_fax() + { + var faxDocument = _interfax.Documents.BuildFaxDocument(Path.Combine(_testPath, "test.pdf")); + var response = _interfax.Outbound.SendFax(faxDocument, new SendOptions + { + FaxNumber = "+442086090368", + + }).Result; + } + + [Test] + public void can_send_multiple_inline_faxes() + { + var path = new Uri(Path.GetDirectoryName(Assembly.GetExecutingAssembly().CodeBase)).LocalPath; + + var faxDocuments = new List + { + _interfax.Documents.BuildFaxDocument(Path.Combine(path, "test.pdf")), + _interfax.Documents.BuildFaxDocument(Path.Combine(path, "test.html")), + _interfax.Documents.BuildFaxDocument(Path.Combine(path, "test.txt")) + }; + + var response = _interfax.Outbound.SendFax(faxDocuments, new SendOptions + { + FaxNumber = "+442086090368", + + }).Result; + } + + [Test] + public void can_send_multiple_mixed_faxes() + { + var path = new Uri(Path.GetDirectoryName(Assembly.GetExecutingAssembly().CodeBase)).LocalPath; + + var faxDocuments = new List + { + _interfax.Documents.BuildFaxDocument(Path.Combine(path, "test.pdf")), + _interfax.Documents.BuildFaxDocument(new Uri("https://en.wikipedia.org/wiki/Representational_state_transfer")), + }; + + var response = _interfax.Outbound.SendFax(faxDocuments, new SendOptions + { + FaxNumber = "+442086090368", + + }).Result; + } + } +} diff --git a/InterFAX.Api.Test.Integration/Properties/AssemblyInfo.cs b/InterFAX.Api.Test.Integration/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..c296326 --- /dev/null +++ b/InterFAX.Api.Test.Integration/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("InterFAX.Api.Test.Integration")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("InterFAX.Api.Test.Integration")] +[assembly: AssemblyCopyright("Copyright © 2016")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("738f8549-d143-4b8d-8641-a1bf57947518")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/InterFAX.Api.Test.Integration/packages.config b/InterFAX.Api.Test.Integration/packages.config new file mode 100644 index 0000000..6a61562 --- /dev/null +++ b/InterFAX.Api.Test.Integration/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/InterFAX.Api.Test.Unit/AccountTests.cs b/InterFAX.Api.Test.Unit/AccountTests.cs new file mode 100644 index 0000000..dafdc95 --- /dev/null +++ b/InterFAX.Api.Test.Unit/AccountTests.cs @@ -0,0 +1,32 @@ +using System; +using System.Globalization; +using NUnit.Framework; + +namespace InterFAX.Api.Test.Unit +{ + [TestFixture] + public class AccountTests + { + private FaxClient _interfax; + private MockHttpMessageHandler _handler; + + + [Test] + public void should_call_correct_balance_uri() + { + const decimal expected = 1.23M; + + _handler = new MockHttpMessageHandler + { + ExpectedContent = expected.ToString(CultureInfo.InvariantCulture), + ExpectedUri = new Uri("https://rest.interfax.net/accounts/self/ppcards/balance") + }; + + _interfax = new FaxClient("unit-test-user", "unit-test-pass", _handler); + + var actual = _interfax.Account.GetBalance().Result; + Assert.AreEqual(_handler.ExpectedUri, _handler.ActualUri); + Assert.AreEqual(expected, actual); + } + } +} \ No newline at end of file diff --git a/InterFAX.Api.Test.Unit/DocumentsTests.cs b/InterFAX.Api.Test.Unit/DocumentsTests.cs new file mode 100644 index 0000000..94ebc7e --- /dev/null +++ b/InterFAX.Api.Test.Unit/DocumentsTests.cs @@ -0,0 +1,97 @@ +using System; +using System.Globalization; +using System.IO; +using System.Net.Http; +using System.Reflection; +using System.Web; +using NUnit.Framework; + +namespace InterFAX.Api.Test.Unit +{ + [TestFixture] + public class DocumentsTests + { + private FaxClient _interfax; + private MockHttpMessageHandler _handler; + private readonly string _testPdf; + + public DocumentsTests() + { + var assembly = Assembly.GetAssembly(typeof(DocumentsTests)); + var assemblyPath = Path.GetDirectoryName(assembly.Location); + + // unpack test file + _testPdf = Path.Combine(assemblyPath, "test.pdf"); + using (var resource = assembly.GetManifestResourceStream("InterFAX.Api.Test.Unit.test.pdf")) + { + using (var file = new FileStream(_testPdf, FileMode.Create, FileAccess.Write)) + { + resource.CopyTo(file); + } + } + } + + [Test] + public void GetList_should_call_correct_uri_with_options() + { + _handler = new MockHttpMessageHandler + { + ExpectedContent = "[]", + ExpectedUri = new Uri("https://rest.interfax.net/outbound/documents?limit=10&offset=5") + }; + + _interfax = new FaxClient("unit-test-user", "unit-test-pass", _handler); + + var actual = _interfax.Outbound.Documents.GetUploadSessions(new Documents.ListOptions + { + Limit = 10, + Offset = 5 + }).Result; + + Assert.That(_handler.ExpectedUriWasVisited()); + } + + [Test] + public void GetList_should_call_correct_uri_without_options() + { + _handler = new MockHttpMessageHandler + { + ExpectedContent = "[]", + ExpectedUri = new Uri("https://rest.interfax.net/outbound/documents") + }; + + _interfax = new FaxClient("unit-test-user", "unit-test-pass", _handler); + + var actual = _interfax.Outbound.Documents.GetUploadSessions().Result; + Assert.That(_handler.ExpectedUriWasVisited()); + } + + [Test] + public void can_build_fax_document() + { + _handler = new MockHttpMessageHandler + { + ExpectedContent = "[{'MediaType': 'application/pdf','FileType': 'pdf'}]", + ExpectedUri = new Uri("https://rest.interfax.net/outbound/help/mediatype") + }; + + _interfax = new FaxClient("unit-test-user", "unit-test-pass", _handler); + + var faxDocument = _interfax.Documents.BuildFaxDocument(_testPdf); + Assert.NotNull(faxDocument); + var fileDocument = faxDocument as FileDocument; + Assert.NotNull(fileDocument); + Assert.AreEqual(_testPdf, fileDocument.FilePath); + Assert.AreEqual("application/pdf", fileDocument.MediaType); + } + + [Test] + public void can_unpack_and_load_supported_media_types() + { + _interfax = new FaxClient("unit-test-user", "unit-test-pass"); + var types = _interfax.Documents.SupportedMediaTypes; + Assert.NotNull(types); + Assert.That(types.ContainsKey("pdf")); + } + } +} \ No newline at end of file diff --git a/InterFAX.Api.Test.Unit/FaxClientTests.cs b/InterFAX.Api.Test.Unit/FaxClientTests.cs new file mode 100644 index 0000000..8984107 --- /dev/null +++ b/InterFAX.Api.Test.Unit/FaxClientTests.cs @@ -0,0 +1,61 @@ +using System; +using System.Configuration; +using NUnit.Framework; + +namespace InterFAX.Api.Test.Unit +{ + [TestFixture] + public class FaxClientTests + { + private const string Username = "fakeusername"; + private const string Password = "fakepassword"; + + [Test] + public void can_instantiate_with_credentials() + { + var interfax = new FaxClient(Username, Password); + } + + [Test] + public void can_instantiate_from_config() + { + ConfigurationManager.AppSettings[FaxClient.UsernameConfigKey] = Username; + ConfigurationManager.AppSettings[FaxClient.PasswordConfigKey] = Password; + + Assert.DoesNotThrow(() => + { + var interfax = new FaxClient(); + }); + + ConfigurationManager.AppSettings[FaxClient.UsernameConfigKey] = null; + ConfigurationManager.AppSettings[FaxClient.PasswordConfigKey] = null; + } + + [Test] + public void can_instantiate_from_environment() + { + var existingUsername = Environment.GetEnvironmentVariable(FaxClient.UsernameConfigKey); + var existingPassword = Environment.GetEnvironmentVariable(FaxClient.PasswordConfigKey); + + Environment.SetEnvironmentVariable(FaxClient.UsernameConfigKey, Username); + Environment.SetEnvironmentVariable(FaxClient.PasswordConfigKey, Password); + + Assert.DoesNotThrow(() => + { + var interfax = new FaxClient(); + }); + + Environment.SetEnvironmentVariable(FaxClient.UsernameConfigKey, existingUsername); + Environment.SetEnvironmentVariable(FaxClient.PasswordConfigKey, existingPassword); + } + + [Test] + public void should_throw_if_no_config() + { + Assert.Throws(() => + { + var interfax = new FaxClient(); + }); + } + } +} \ No newline at end of file diff --git a/InterFAX.Api.Test.Unit/HttpClientExtensionsTests.cs b/InterFAX.Api.Test.Unit/HttpClientExtensionsTests.cs new file mode 100644 index 0000000..dd37ae3 --- /dev/null +++ b/InterFAX.Api.Test.Unit/HttpClientExtensionsTests.cs @@ -0,0 +1,38 @@ +using System; +using System.Globalization; +using System.Net; +using NUnit.Framework; + +namespace InterFAX.Api.Test.Unit +{ + [TestFixture] + public class HttpClientExtensionsTests + { + private FaxClient _interfax; + private MockHttpMessageHandler _handler; + + [Test] + public void should_throw_exception_on_error() + { + _handler = new MockHttpMessageHandler + { + ExpectedContent = "Not json...", + ExpectedReasonPhrase = "Something was not found.", + ExpectedContentType = "text/plain", + ExpectedStatusCode = HttpStatusCode.NotFound, + ExpectedUri = new Uri("https://rest.interfax.net/accounts/self/ppcards/balance") + }; + + _interfax = new FaxClient("unit-test-user", "unit-test-pass", _handler); + + var exception = Assert.Throws(() => { var balance = _interfax.Account.GetBalance().Result; }); + Assert.AreEqual(1, exception.InnerExceptions.Count); + + var apiException = exception.InnerExceptions[0] as ApiException; + Assert.NotNull(apiException); + Assert.AreEqual((int) _handler.ExpectedStatusCode, apiException.Error.Code); + Assert.AreEqual(_handler.ExpectedContent, apiException.Error.Message); + Assert.AreEqual(_handler.ExpectedReasonPhrase, apiException.Error.MoreInfo); + } + } +} \ No newline at end of file diff --git a/InterFAX.Api.Test.Unit/InboundListOptionsTests.cs b/InterFAX.Api.Test.Unit/InboundListOptionsTests.cs new file mode 100644 index 0000000..a652c4e --- /dev/null +++ b/InterFAX.Api.Test.Unit/InboundListOptionsTests.cs @@ -0,0 +1,39 @@ +using NUnit.Framework; + +namespace InterFAX.Api.Test.Unit +{ + [TestFixture] + public class InboundListOptionsTests + { + [Test] + public void should_return_dictionary_of_options() + { + var listOptions = new Inbound.ListOptions + { + UnreadOnly = true, + Limit = 20, + LastId = 40, + AllUsers = true + }; + + var actual = listOptions.ToDictionary(); + Assert.AreEqual(4, actual.Keys.Count); + + var key = "unreadOnly"; + Assert.That(actual.ContainsKey(key)); + Assert.AreEqual("true", actual[key]); + + key = "limit"; + Assert.That(actual.ContainsKey(key)); + Assert.AreEqual(listOptions.Limit.ToString(), actual[key]); + + key = "lastId"; + Assert.That(actual.ContainsKey(key)); + Assert.AreEqual(listOptions.LastId.ToString(), actual[key]); + + key = "allUsers"; + Assert.That(actual.ContainsKey(key)); + Assert.AreEqual("true", actual[key]); + } + } +} \ No newline at end of file diff --git a/InterFAX.Api.Test.Unit/InboundTests.cs b/InterFAX.Api.Test.Unit/InboundTests.cs new file mode 100644 index 0000000..6340904 --- /dev/null +++ b/InterFAX.Api.Test.Unit/InboundTests.cs @@ -0,0 +1,129 @@ +using System; +using System.Globalization; +using System.Net.Http; +using System.Web; +using NUnit.Framework; + +namespace InterFAX.Api.Test.Unit +{ + [TestFixture] + public class InboundTests + { + private FaxClient _interfax; + private MockHttpMessageHandler _handler; + + [Test] + public void GetList_should_call_correct_uri_with_options() + { + _handler = new MockHttpMessageHandler + { + ExpectedContent = "[]", + ExpectedUri = new Uri("https://rest.interfax.net/inbound/faxes?limit=10&lastId=5&unreadOnly=true&allUsers=true") + }; + + _interfax = new FaxClient("unit-test-user", "unit-test-pass", _handler); + + var actual = _interfax.Inbound.GetList(new Inbound.ListOptions + { + Limit = 10, + LastId = 5, + UnreadOnly = true, + AllUsers = true + }).Result; + + Assert.That(_handler.ExpectedUriWasVisited()); + } + + [Test] + public void GetList_should_call_correct_uri_without_options() + { + _handler = new MockHttpMessageHandler + { + ExpectedContent = "[]", + ExpectedUri = new Uri("https://rest.interfax.net/inbound/faxes") + }; + + _interfax = new FaxClient("unit-test-user", "unit-test-pass", _handler); + + var actual = _interfax.Inbound.GetList().Result; + Assert.That(_handler.ExpectedUriWasVisited()); + } + + [Test] + public void GetFaxRecord_should_call_correct_uri() + { + _handler = new MockHttpMessageHandler + { + ExpectedContent = "{}", + ExpectedUri = new Uri("https://rest.interfax.net/inbound/faxes/1") + }; + + _interfax = new FaxClient("unit-test-user", "unit-test-pass", _handler); + + var actual = _interfax.Inbound.GetFaxRecord(1).Result; + Assert.That(_handler.ExpectedUriWasVisited()); + } + + [Test] + public void GetFaxImageStream_should_call_correct_uri() + { + _handler = new MockHttpMessageHandler + { + ExpectedContent = "{}", + ExpectedUri = new Uri("https://rest.interfax.net/inbound/faxes/1/image") + }; + + _interfax = new FaxClient("unit-test-user", "unit-test-pass", _handler); + + var actual = _interfax.Inbound.GetFaxImageStream(1).Result; + Assert.That(_handler.ExpectedUriWasVisited()); + } + + [Test] + public void GetForwardingEmails_should_call_correct_uri() + { + _handler = new MockHttpMessageHandler + { + ExpectedContent = "[]", + ExpectedUri = new Uri("https://rest.interfax.net/inbound/faxes/1/emails") + }; + + _interfax = new FaxClient("unit-test-user", "unit-test-pass", _handler); + + var actual = _interfax.Inbound.GetForwardingEmails(1).Result; + Assert.That(_handler.ExpectedUriWasVisited()); + } + + [Test] + public void MarkRead_should_call_correct_uri() + { + _handler = new MockHttpMessageHandler + { + ExpectedHttpMethod = HttpMethod.Post, + ExpectedContent = "", + ExpectedUri = new Uri("https://rest.interfax.net/inbound/faxes/1/mark") + }; + + _interfax = new FaxClient("unit-test-user", "unit-test-pass", _handler); + + var response = _interfax.Inbound.MarkRead(1).Result; + Assert.That(_handler.ExpectedUriWasVisited()); + } + + [Test] + public void MarkUnread_should_call_correct_uri() + { + _handler = new MockHttpMessageHandler + { + ExpectedHttpMethod = HttpMethod.Post, + ExpectedContent = "", + ExpectedUri = new Uri("https://rest.interfax.net/inbound/faxes/1/mark?unread=true") + }; + + _interfax = new FaxClient("unit-test-user", "unit-test-pass", _handler); + + var response = _interfax.Inbound.MarkUnread(1).Result; + Assert.That(_handler.ExpectedUriWasVisited()); + } + } +} \ No newline at end of file diff --git a/InterFAX.Api.Test.Unit/InterFAX.Api.Test.Unit.csproj b/InterFAX.Api.Test.Unit/InterFAX.Api.Test.Unit.csproj new file mode 100644 index 0000000..0b1dc55 --- /dev/null +++ b/InterFAX.Api.Test.Unit/InterFAX.Api.Test.Unit.csproj @@ -0,0 +1,100 @@ + + + + + Debug + AnyCPU + {64090388-3301-4BB7-82D1-8C2C03B1BF82} + Library + Properties + InterFAX.Api.Test.Unit + InterFAX.Api.Test.Unit + v4.5.2 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\packages\Castle.Core.3.3.3\lib\net45\Castle.Core.dll + True + + + ..\packages\Moq.4.5.21\lib\net45\Moq.dll + True + + + ..\packages\NUnit.3.4.1\lib\net45\nunit.framework.dll + True + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + test.pdf + + + + + + {1a4809ee-070e-4255-bdd2-2aeecdba5bc5} + InterFAX.Api + + + + + test.html + + + test.txt + + + + + \ No newline at end of file diff --git a/InterFAX.Api.Test.Unit/MockHttpMessageHandler.cs b/InterFAX.Api.Test.Unit/MockHttpMessageHandler.cs new file mode 100644 index 0000000..222f379 --- /dev/null +++ b/InterFAX.Api.Test.Unit/MockHttpMessageHandler.cs @@ -0,0 +1,55 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using System.Web; +using NUnit.Framework; + +namespace InterFAX.Api.Test.Unit +{ + /// + /// A fairly simplistic mock HttpMessageHandler for testing without going to the network. + /// + internal class MockHttpMessageHandler : HttpMessageHandler + { + public string ExpectedContent { get; set; } = "{}"; + public string ExpectedReasonPhrase { get; set; } + public Uri ActualUri { get; private set; } + public HttpMethod ActualHttpMethod { get; set; } + public HttpStatusCode ExpectedStatusCode { get; set; } = HttpStatusCode.OK; + public Uri ExpectedUri { get; set; } + public HttpMethod ExpectedHttpMethod { get; set; } = HttpMethod.Get; + public string ExpectedContentType { get; set; } = "application/json"; + public Uri ExpectedLocationHeader { get; set; } = null; + + protected override async Task SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) + { + ActualUri = request.RequestUri; + ActualHttpMethod = request.Method; + + var responseMessage = new HttpResponseMessage(ExpectedStatusCode); + if (ExpectedContent != null) responseMessage.Content = new StringContent(ExpectedContent); + if (!string.IsNullOrEmpty(ExpectedReasonPhrase)) responseMessage.ReasonPhrase = ExpectedReasonPhrase; + if (ExpectedLocationHeader != null) responseMessage.Headers.Location = ExpectedLocationHeader; + responseMessage.Content.Headers.ContentType = new MediaTypeHeaderValue(ExpectedContentType); + + return await Task.FromResult(responseMessage); + } + + public bool ExpectedUriWasVisited() + { + var verified = ExpectedHttpMethod == ActualHttpMethod; + + verified = verified && ExpectedUri.AbsolutePath == ActualUri.AbsolutePath; + + var expectedQuery = HttpUtility.ParseQueryString(ExpectedUri.Query); + var actualQuery = HttpUtility.ParseQueryString(ActualUri.Query); + return expectedQuery.AllKeys.Aggregate(verified, (current, option) => current && actualQuery[option] != null && expectedQuery[option] == actualQuery[option]); + } + } +} diff --git a/InterFAX.Api.Test.Unit/OutboundListOptionsTests.cs b/InterFAX.Api.Test.Unit/OutboundListOptionsTests.cs new file mode 100644 index 0000000..f6481cd --- /dev/null +++ b/InterFAX.Api.Test.Unit/OutboundListOptionsTests.cs @@ -0,0 +1,39 @@ +using NUnit.Framework; + +namespace InterFAX.Api.Test.Unit +{ + [TestFixture] + public class OutboundListOptionsTests + { + [Test] + public void should_return_dictionary_of_options() + { + var listOptions = new Outbound.ListOptions + { + LastId = 10, + Limit = 20, + UserId = "unit-test-userid", + SortOrder = ListSortOrder.Ascending + }; + + var actual = listOptions.ToDictionary(); + Assert.AreEqual(4, actual.Keys.Count); + + var key = "lastId"; + Assert.That(actual.ContainsKey(key)); + Assert.AreEqual(listOptions.LastId.ToString(), actual[key]); + + key = "limit"; + Assert.That(actual.ContainsKey(key)); + Assert.AreEqual(listOptions.Limit.ToString(), actual[key]); + + key = "userId"; + Assert.That(actual.ContainsKey(key)); + Assert.AreEqual(listOptions.UserId, actual[key]); + + key = "sortOrder"; + Assert.That(actual.ContainsKey(key)); + Assert.AreEqual("asc", actual[key]); + } + } +} \ No newline at end of file diff --git a/InterFAX.Api.Test.Unit/OutboundTests.cs b/InterFAX.Api.Test.Unit/OutboundTests.cs new file mode 100644 index 0000000..e8f5153 --- /dev/null +++ b/InterFAX.Api.Test.Unit/OutboundTests.cs @@ -0,0 +1,169 @@ +using System; +using System.Globalization; +using System.Net; +using System.Net.Http; +using System.Web; +using NUnit.Framework; + +namespace InterFAX.Api.Test.Unit +{ + [TestFixture] + public class OutboundTests + { + private FaxClient _interfax; + private MockHttpMessageHandler _handler; + + [Test] + public void GetList_should_call_correct_uri_with_options() + { + _handler = new MockHttpMessageHandler + { + ExpectedContent = "[]", + ExpectedUri = new Uri("https://rest.interfax.net/outbound/faxes?lastId=5&limit=10&sortOrder=asc&userId=unit-test-associate") + }; + + _interfax = new FaxClient("unit-test-user", "unit-test-pass", _handler); + + var actual = _interfax.Outbound.GetList(new Outbound.ListOptions + { + Limit = 10, + LastId = 5, + SortOrder = ListSortOrder.Ascending, + UserId = "unit-test-associate" + }).Result; + Assert.That(_handler.ExpectedUriWasVisited()); + } + + [Test] + public void GetList_should_call_correct_uri_without_options() + { + _handler = new MockHttpMessageHandler + { + ExpectedContent = "[]", + ExpectedUri = new Uri("https://rest.interfax.net/outbound/faxes") + }; + + _interfax = new FaxClient("unit-test-user", "unit-test-pass", _handler); + + var actual = _interfax.Outbound.GetList().Result; + Assert.That(_handler.ExpectedUriWasVisited()); + } + + [Test] + public void GetFaxImageStream_should_call_correct_uri() + { + _handler = new MockHttpMessageHandler + { + ExpectedContent = "{}", + ExpectedUri = new Uri("https://rest.interfax.net/outbound/faxes/1/image") + }; + + _interfax = new FaxClient("unit-test-user", "unit-test-pass", _handler); + + var actual = _interfax.Outbound.GetFaxImageStream(1).Result; + Assert.That(_handler.ExpectedUriWasVisited()); + } + + [Test] + public void GetFaxRecord_should_call_correct_uri() + { + _handler = new MockHttpMessageHandler + { + ExpectedContent = "{}", + ExpectedUri = new Uri("https://rest.interfax.net/inbound/faxes/1") + }; + + _interfax = new FaxClient("unit-test-user", "unit-test-pass", _handler); + + var actual = _interfax.Inbound.GetFaxRecord(1).Result; + Assert.That(_handler.ExpectedUriWasVisited()); + } + + [Test] + public void CancelFax_should_call_correct_uri() + { + _handler = new MockHttpMessageHandler + { + ExpectedHttpMethod = HttpMethod.Post, + ExpectedContent = "", + ExpectedUri = new Uri("https://rest.interfax.net/outbound/faxes/1/cancel") + }; + + _interfax = new FaxClient("unit-test-user", "unit-test-pass", _handler); + + var response = _interfax.Outbound.CancelFax(1).Result; + Assert.That(_handler.ExpectedUriWasVisited()); + } + + [Test] + public void ResendFax_should_call_correct_uri() + { + _handler = new MockHttpMessageHandler + { + ExpectedHttpMethod = HttpMethod.Post, + ExpectedContent = "", + ExpectedLocationHeader = new Uri("https://rest.interfax.net/outbound/faxes/2"), + ExpectedUri = new Uri("https://rest.interfax.net/outbound/faxes/1/resend") + }; + + _interfax = new FaxClient("unit-test-user", "unit-test-pass", _handler); + + var faxId = _interfax.Outbound.ResendFax(1).Result; + Assert.AreEqual(2, faxId); + Assert.That(_handler.ExpectedUriWasVisited()); + } + + [Test] + public void ResendFax_should_call_correct_uri_with_faxNumber() + { + _handler = new MockHttpMessageHandler + { + ExpectedHttpMethod = HttpMethod.Post, + ExpectedContent = "", + ExpectedLocationHeader = new Uri("https://rest.interfax.net/outbound/faxes/2"), + ExpectedUri = new Uri("https://rest.interfax.net/outbound/faxes/1/resend?faxNumber=123456789") + }; + + _interfax = new FaxClient("unit-test-user", "unit-test-pass", _handler); + + var faxId = _interfax.Outbound.ResendFax(1, "123456789").Result; + Assert.AreEqual(2, faxId); + Assert.That(_handler.ExpectedUriWasVisited()); + } + + [Test] + public void ResendFax_returns_fax_id() + { + _handler = new MockHttpMessageHandler + { + ExpectedHttpMethod = HttpMethod.Post, + ExpectedStatusCode = HttpStatusCode.Created, + ExpectedLocationHeader = new Uri("https://rest.interfax.net/outbound/faxes/1"), + ExpectedContent = "", + ExpectedUri = new Uri("https://rest.interfax.net/outbound/faxes/1/resend?faxNumber=123456789") + }; + + _interfax = new FaxClient("unit-test-user", "unit-test-pass", _handler); + + var faxId = _interfax.Outbound.ResendFax(1, "123456789").Result; + Assert.AreEqual(1, faxId); + Assert.That(_handler.ExpectedUriWasVisited()); + } + + [Test] + public void HideFax_should_call_correct_uri() + { + _handler = new MockHttpMessageHandler + { + ExpectedHttpMethod = HttpMethod.Post, + ExpectedContent = "", + ExpectedUri = new Uri("https://rest.interfax.net/outbound/faxes/1/hide") + }; + + _interfax = new FaxClient("unit-test-user", "unit-test-pass", _handler); + + var response = _interfax.Outbound.HideFax(1).Result; + Assert.That(_handler.ExpectedUriWasVisited()); + } + } +} \ No newline at end of file diff --git a/Interfax.ClientLib/Properties/AssemblyInfo.cs b/InterFAX.Api.Test.Unit/Properties/AssemblyInfo.cs similarity index 88% rename from Interfax.ClientLib/Properties/AssemblyInfo.cs rename to InterFAX.Api.Test.Unit/Properties/AssemblyInfo.cs index 11d7030..9e6051e 100644 --- a/Interfax.ClientLib/Properties/AssemblyInfo.cs +++ b/InterFAX.Api.Test.Unit/Properties/AssemblyInfo.cs @@ -1,36 +1,36 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("ClassLib")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("ClassLib")] -[assembly: AssemblyCopyright("Copyright © 2016")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("c6ab4610-3924-4235-a1c2-1b5c804fdcee")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("InterFAX.Api.Test.Unit")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("InterFAX.Api.Test.Unit")] +[assembly: AssemblyCopyright("Copyright © 2016")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("64090388-3301-4bb7-82d1-8c2c03b1bf82")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/InterFAX.Api.Test.Unit/SearchOptionsTests.cs b/InterFAX.Api.Test.Unit/SearchOptionsTests.cs new file mode 100644 index 0000000..ff71537 --- /dev/null +++ b/InterFAX.Api.Test.Unit/SearchOptionsTests.cs @@ -0,0 +1,86 @@ +using System; +using NUnit.Framework; + +namespace InterFAX.Api.Test.Unit +{ + [TestFixture] + public class SearchOptionsTests + { + [Test] + public void should_return_dictionary_of_options() + { + var searchOptions = new SearchOptions + { + Ids = new[] { 1, 2, 3, 4, 5 }, + Reference = "unit-test-reference", + DateFrom = new DateTime(2016, 6, 1, 14, 30, 0), + DateTo = new DateTime(2016, 7, 5, 16, 45, 0), + StatusFamily = StatusFamily.Completed, + UserId = "unit-test-userid", + FaxNumber = "+1234567890", + SortOrder = ListSortOrder.Ascending, + Offset = 10, + Limit = 20, + }; + + var actual = searchOptions.ToDictionary(); + Assert.AreEqual(10, actual.Keys.Count); + + var key = "ids"; + Assert.That(actual.ContainsKey(key)); + Assert.AreEqual("1,2,3,4,5", actual[key]); + + key = "reference"; + Assert.That(actual.ContainsKey(key)); + Assert.AreEqual(searchOptions.Reference, actual[key]); + + key = "dateFrom"; + Assert.That(actual.ContainsKey(key)); + Assert.AreEqual("2016-06-01T14:30:00Z", actual[key]); + + key = "dateTo"; + Assert.That(actual.ContainsKey(key)); + Assert.AreEqual("2016-07-05T16:45:00Z", actual[key]); + + key = "status"; + Assert.That(actual.ContainsKey(key)); + Assert.AreEqual("Completed", actual[key]); + + key = "userId"; + Assert.That(actual.ContainsKey(key)); + Assert.AreEqual(searchOptions.UserId, actual[key]); + + key = "faxNumber"; + Assert.That(actual.ContainsKey(key)); + Assert.AreEqual(searchOptions.FaxNumber, actual[key]); + + key = "sortOrder"; + Assert.That(actual.ContainsKey(key)); + Assert.AreEqual("asc", actual[key]); + + key = "offset"; + Assert.That(actual.ContainsKey(key)); + Assert.AreEqual(searchOptions.Offset.ToString(), actual[key]); + + key = "limit"; + Assert.That(actual.ContainsKey(key)); + Assert.AreEqual(searchOptions.Limit.ToString(), actual[key]); + } + + [Test] + public void should_switch_on_status() + { + var searchOptions = new SearchOptions + { + Status = 2 + }; + + var actual = searchOptions.ToDictionary(); + Assert.AreEqual(1, actual.Keys.Count); + + const string key = "status"; + Assert.That(actual.ContainsKey(key)); + Assert.AreEqual(searchOptions.Status.ToString(), actual[key]); + } + } +} \ No newline at end of file diff --git a/InterFAX.Api.Test.Unit/SendOptionsTests.cs b/InterFAX.Api.Test.Unit/SendOptionsTests.cs new file mode 100644 index 0000000..3ad4c1b --- /dev/null +++ b/InterFAX.Api.Test.Unit/SendOptionsTests.cs @@ -0,0 +1,122 @@ +using System; +using InterFAX.Api.Dtos; +using NUnit.Framework; + +namespace InterFAX.Api.Test.Unit +{ + [TestFixture] + public class SendOptionsTests + { + [Test] + public void should_return_dictionary_of_options() + { + var options = new SendOptions + { + FaxNumber = "+1234567890", + Contact = "unit-test-contact", + PostponeTime = new DateTime(2016, 6, 1, 14, 30, 30), + RetriesToPerform = 5, + Csid = "unit-test-csid", + PageHeader = "unit-test-page-header", + Reference = "unit-test-reference", + ReplyAddress = "unit-test-reply-address", + PageSize = PageSize.A4, + ShouldScale = true, + PageOrientation = PageOrientation.Portrait, + PageResolution = PageResolution.Standard, + PageRendering = PageRendering.GreyScale + }; + + var actual = options.ToDictionary(); + Assert.AreEqual(13, actual.Keys.Count); + + var key = "faxNumber"; + Assert.That(actual.ContainsKey(key)); + Assert.AreEqual(options.FaxNumber, actual[key]); + + key = "contact"; + Assert.That(actual.ContainsKey(key)); + Assert.AreEqual(options.Contact, actual[key]); + + key = "postponeTime"; + Assert.That(actual.ContainsKey(key)); + Assert.AreEqual("2016-06-01T14:30:30Z", actual[key]); + + key = "retriesToPerform"; + Assert.That(actual.ContainsKey(key)); + Assert.AreEqual("5", actual[key]); + + key = "csid"; + Assert.That(actual.ContainsKey(key)); + Assert.AreEqual(options.Csid, actual[key]); + + key = "pageHeader"; + Assert.That(actual.ContainsKey(key)); + Assert.AreEqual(options.PageHeader, actual[key]); + + key = "reference"; + Assert.That(actual.ContainsKey(key)); + Assert.AreEqual(options.Reference, actual[key]); + + key = "replyAddress"; + Assert.That(actual.ContainsKey(key)); + Assert.AreEqual(options.ReplyAddress, actual[key]); + + key = "pageSize"; + Assert.That(actual.ContainsKey(key)); + Assert.AreEqual("a4", actual[key]); + + key = "fitToPage"; + Assert.That(actual.ContainsKey(key)); + Assert.AreEqual("scale", actual[key]); + + key = "pageOrientation"; + Assert.That(actual.ContainsKey(key)); + Assert.AreEqual("portrait", actual[key]); + + key = "resolution"; + Assert.That(actual.ContainsKey(key)); + Assert.AreEqual("standard", actual[key]); + + key = "rendering"; + Assert.That(actual.ContainsKey(key)); + Assert.AreEqual("greyscale", actual[key]); + } + + [Test] + public void should_return_partial_dictionary_of_options() + { + var options = new SendOptions + { + FaxNumber = "+1234567890", + Contact = "unit-test-contact", + PostponeTime = new DateTime(2016, 6, 1, 14, 30, 30), + RetriesToPerform = 5, + Csid = "unit-test-csid" + }; + + var actual = options.ToDictionary(); + Assert.AreEqual(5, actual.Keys.Count); + + var key = "faxNumber"; + Assert.That(actual.ContainsKey(key)); + Assert.AreEqual(options.FaxNumber, actual[key]); + + key = "contact"; + Assert.That(actual.ContainsKey(key)); + Assert.AreEqual(options.Contact, actual[key]); + + key = "postponeTime"; + Assert.That(actual.ContainsKey(key)); + Assert.AreEqual("2016-06-01T14:30:30Z", actual[key]); + + key = "retriesToPerform"; + Assert.That(actual.ContainsKey(key)); + Assert.AreEqual("5", actual[key]); + + key = "csid"; + Assert.That(actual.ContainsKey(key)); + Assert.AreEqual(options.Csid, actual[key]); + } + } +} \ No newline at end of file diff --git a/InterFAX.Api.Test.Unit/UploadSessionOptionsTests.cs b/InterFAX.Api.Test.Unit/UploadSessionOptionsTests.cs new file mode 100644 index 0000000..6de618c --- /dev/null +++ b/InterFAX.Api.Test.Unit/UploadSessionOptionsTests.cs @@ -0,0 +1,40 @@ +using InterFAX.Api.Dtos; +using NUnit.Framework; + +namespace InterFAX.Api.Test.Unit +{ + [TestFixture] + public class UploadSessionOptionsTests + { + [Test] + public void should_return_dictionary_of_options() + { + var options = new Documents.UploadSessionOptions + { + Size = 102400, + Name = "document.pdf", + Disposition = DocumentDisposition.Permanent, + Sharing = DocumentSharing.Private + }; + + var actual = options.ToDictionary(); + Assert.AreEqual(4, actual.Keys.Count); + + var key = "size"; + Assert.That(actual.ContainsKey(key)); + Assert.AreEqual(options.Size.ToString(), actual[key]); + + key = "name"; + Assert.That(actual.ContainsKey(key)); + Assert.AreEqual(options.Name, actual[key]); + + key = "disposition"; + Assert.That(actual.ContainsKey(key)); + Assert.AreEqual("permanent", actual[key]); + + key = "sharing"; + Assert.That(actual.ContainsKey(key)); + Assert.AreEqual("private", actual[key]); + } + } +} \ No newline at end of file diff --git a/InterFAX.Api.Test.Unit/UtilsTests.cs b/InterFAX.Api.Test.Unit/UtilsTests.cs new file mode 100644 index 0000000..904d531 --- /dev/null +++ b/InterFAX.Api.Test.Unit/UtilsTests.cs @@ -0,0 +1,16 @@ +using NUnit.Framework; + +namespace InterFAX.Api.Test.Unit +{ + [TestFixture] + public class UtilsTests + { + [Test] + public void can_base64_encode() + { + const string expected = "YXN0cmluZzp0b2VuY29kZQ=="; + var actual = Utils.Base64Encode("astring:toencode"); + Assert.AreEqual(expected, actual); + } + } +} \ No newline at end of file diff --git a/InterFAX.Api.Test.Unit/packages.config b/InterFAX.Api.Test.Unit/packages.config new file mode 100644 index 0000000..d2d4095 --- /dev/null +++ b/InterFAX.Api.Test.Unit/packages.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/InterFAX.Api.sln b/InterFAX.Api.sln new file mode 100644 index 0000000..0947361 --- /dev/null +++ b/InterFAX.Api.sln @@ -0,0 +1,44 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.25420.1 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{C8C2A28B-C476-46C8-AB76-04FBC45DF9D5}" + ProjectSection(SolutionItems) = preProject + .gitignore = .gitignore + .travis.yml = .travis.yml + CHANGELOG.md = CHANGELOG.md + InterFAX.Api\InterFAX.Api.nuspec = InterFAX.Api\InterFAX.Api.nuspec + LICENSE = LICENSE + README.md = README.md + EndProjectSection +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "InterFAX.Api.Test.Unit", "InterFAX.Api.Test.Unit\InterFAX.Api.Test.Unit.csproj", "{64090388-3301-4BB7-82D1-8C2C03B1BF82}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "InterFAX.Api.Test.Integration", "InterFAX.Api.Test.Integration\InterFAX.Api.Test.Integration.csproj", "{738F8549-D143-4B8D-8641-A1BF57947518}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "InterFAX.Api", "InterFAX.Api\InterFAX.Api.csproj", "{1A4809EE-070E-4255-BDD2-2AEECDBA5BC5}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {64090388-3301-4BB7-82D1-8C2C03B1BF82}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {64090388-3301-4BB7-82D1-8C2C03B1BF82}.Debug|Any CPU.Build.0 = Debug|Any CPU + {64090388-3301-4BB7-82D1-8C2C03B1BF82}.Release|Any CPU.ActiveCfg = Release|Any CPU + {64090388-3301-4BB7-82D1-8C2C03B1BF82}.Release|Any CPU.Build.0 = Release|Any CPU + {738F8549-D143-4B8D-8641-A1BF57947518}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {738F8549-D143-4B8D-8641-A1BF57947518}.Debug|Any CPU.Build.0 = Debug|Any CPU + {738F8549-D143-4B8D-8641-A1BF57947518}.Release|Any CPU.ActiveCfg = Release|Any CPU + {738F8549-D143-4B8D-8641-A1BF57947518}.Release|Any CPU.Build.0 = Release|Any CPU + {1A4809EE-070E-4255-BDD2-2AEECDBA5BC5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1A4809EE-070E-4255-BDD2-2AEECDBA5BC5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1A4809EE-070E-4255-BDD2-2AEECDBA5BC5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1A4809EE-070E-4255-BDD2-2AEECDBA5BC5}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/InterFAX.Api.sln.DotSettings b/InterFAX.Api.sln.DotSettings new file mode 100644 index 0000000..6ad756a --- /dev/null +++ b/InterFAX.Api.sln.DotSettings @@ -0,0 +1,2 @@ + + FAX \ No newline at end of file diff --git a/InterFAX.Api/Account.cs b/InterFAX.Api/Account.cs new file mode 100644 index 0000000..8da8f3b --- /dev/null +++ b/InterFAX.Api/Account.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Net; +using System.Net.Http; +using System.Text; +using System.Threading.Tasks; + +namespace InterFAX.Api +{ + public class Account + { + private readonly FaxClient _interfax; + + internal Account(FaxClient interfax) + { + _interfax = interfax; + } + + /// + /// Get the remaining faxing credits in your account (in the account's currency). + /// + public async Task GetBalance() + { + return await _interfax.HttpClient.GetResourceAsync("/accounts/self/ppcards/balance"); + } + } +} \ No newline at end of file diff --git a/InterFAX.Api/ApiException.cs b/InterFAX.Api/ApiException.cs new file mode 100644 index 0000000..677901f --- /dev/null +++ b/InterFAX.Api/ApiException.cs @@ -0,0 +1,23 @@ +using System; +using System.Net; +using System.Net.Http; +using InterFAX.Api.Dtos; + +namespace InterFAX.Api +{ + /// + /// Instances of this exception contain information about what went wrong with the request made. + /// + /// TODO : This is actually slightly clunky to use as it gets packaged up in an AggregateException. Could be improved by modifying requests to take a callback function? + public class ApiException : Exception + { + public HttpStatusCode StatusCode { get; private set; } + public Error Error { get; private set; } + + internal ApiException(HttpStatusCode statusCode, Error error) + { + StatusCode = statusCode; + Error = error; + } + } +} \ No newline at end of file diff --git a/InterFAX.Api/Documents.ListOptions.cs b/InterFAX.Api/Documents.ListOptions.cs new file mode 100644 index 0000000..7c51621 --- /dev/null +++ b/InterFAX.Api/Documents.ListOptions.cs @@ -0,0 +1,28 @@ +using System.Collections.Generic; + +namespace InterFAX.Api +{ + public partial class Documents + { + public class ListOptions : IOptions + { + /// + /// How many document references to return. + /// + public int? Limit { get; set; } + + /// + /// Skip this many document references in the list. + /// + public int? Offset { get; set; } + + public Dictionary ToDictionary() + { + var options = new Dictionary(); + if (Offset.HasValue) options.Add("offset", Offset.ToString()); + if (Limit.HasValue) options.Add("limit", Limit.ToString()); + return options; + } + } + } +} \ No newline at end of file diff --git a/InterFAX.Api/Documents.UploadSessionOptions.cs b/InterFAX.Api/Documents.UploadSessionOptions.cs new file mode 100644 index 0000000..90e352d --- /dev/null +++ b/InterFAX.Api/Documents.UploadSessionOptions.cs @@ -0,0 +1,40 @@ +using System.Collections.Generic; +using InterFAX.Api.Dtos; + +namespace InterFAX.Api +{ + public partial class Documents + { + public class UploadSessionOptions : IOptions + { + /// + /// How many document references to return. + /// + public int Size { get; set; } + + /// + /// The document file name, which can subsequently be queried. + /// The filename must end with an extension defining the file type, e.g. dailyrates.docx or newsletter.pdf, and the file type must be in the list of supported file types. + /// + public string Name { get; set; } + + /// + /// Sets the retention policy of the uploaded document. + /// + public DocumentDisposition? Disposition { get; set; } + + /// + /// The sharing policy of the uploaded document. + /// + public DocumentSharing? Sharing { get; set; } + + public Dictionary ToDictionary() + { + var options = new Dictionary {{"size", Size.ToString()}, {"name", Name}}; + if (Disposition.HasValue) options.Add("disposition", Disposition.ToCamelCase()); + if (Sharing.HasValue) options.Add("sharing", Sharing.ToCamelCase()); + return options; + } + } + } +} \ No newline at end of file diff --git a/InterFAX.Api/Documents.cs b/InterFAX.Api/Documents.cs new file mode 100644 index 0000000..81db76b --- /dev/null +++ b/InterFAX.Api/Documents.cs @@ -0,0 +1,181 @@ +using System; +using System.Collections.Generic; +using System.Configuration; +using System.IO; +using System.Linq; +using System.Net; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Reflection; +using System.Threading.Tasks; +using InterFAX.Api.Dtos; +using Newtonsoft.Json; + +namespace InterFAX.Api +{ + public partial class Documents + { + private readonly FaxClient _interfax; + private const string ResourceUri = "/outbound/documents"; + public const int MaxChunkSize = 256 * 1024; //quarter of a MB + + internal Documents(FaxClient interfax) + { + _interfax = interfax; + } + + private Dictionary _supportedMediaTypes; + public Dictionary SupportedMediaTypes + { + get + { + if (_supportedMediaTypes == null) + { + var assembly = Assembly.GetAssembly(typeof(Documents)); + var assemblyPath = Path.GetDirectoryName(assembly.Location); + var typesFile = Path.Combine(assemblyPath, "SupportedMediaTypes.json"); + + if (!File.Exists(typesFile)) + { + // unpack the types file to the assembly path + using (var resource = assembly.GetManifestResourceStream("InterFAX.Api.SupportedMediaTypes.json")) + { + using (var file = new FileStream(typesFile, FileMode.Create, FileAccess.Write)) + { + resource.CopyTo(file); + } + } + } + + var mappings = JsonConvert.DeserializeObject>(File.ReadAllText(typesFile)); + _supportedMediaTypes = mappings.ToDictionary( + mapping => mapping.FileType, + mapping => mapping.MediaType); + } + return _supportedMediaTypes; + } + } + + public IFaxDocument BuildFaxDocument(Uri fileUri) + { + return new UriDocument(fileUri); + } + + public IFaxDocument BuildFaxDocument(string filePath) + { + if (!File.Exists(filePath)) + throw new FileNotFoundException(filePath); + + var extension = Path.GetExtension(filePath) ?? "*"; + extension = extension.TrimStart('.'); + + var mediaType = SupportedMediaTypes.Keys.Contains(extension) + ? SupportedMediaTypes[extension] + : "application/octet-stream"; + + return new FileDocument(filePath, mediaType); + } + + /// + /// Get a list of previous document upload sessions which are currently available. + /// + /// + public async Task> GetUploadSessions(ListOptions listOptions = null) + { + return await _interfax.HttpClient.GetResourceAsync>(ResourceUri, listOptions); + } + + /// + /// Create a document upload session. + /// + /// + /// The id of the created session. + public async Task CreateUploadSession(UploadSessionOptions options) + { + if (options == null) + throw new ArgumentNullException(nameof(options)); + + var response = await _interfax.HttpClient.PostAsync(ResourceUri, options); + return response.Headers.Location.Segments.Last(); + } + + /// + /// Get a single upload session object. + /// + /// + public async Task GetUploadSession(string sessionId) + { + return await _interfax.HttpClient.GetResourceAsync($"{ResourceUri}/{sessionId}"); + } + + /// + /// Uploads a chunk of data to the given document upload session. + /// + /// The id of the upload session. + /// The starting position of in the document. + /// The data to upload.s + /// + public async Task UploadDocumentChunk(string sessionId, long offset, byte[] data) + { + if (data.Length > MaxChunkSize) + throw new ArgumentOutOfRangeException(nameof(data), $"Cannot upload more than {MaxChunkSize} bytes at once."); + + var content = new ByteArrayContent(data); + var range = new RangeHeaderValue(offset, offset + data.Length - 1); + + return await _interfax.HttpClient.PostRangeAsync($"{ResourceUri}/{sessionId}", content, range); + } + + /// + /// Upload a document to be attached to a fax. + /// + /// The full path of the file to be uploaded. + /// The upload sessionId of the uploaded document. + public UploadSession UploadDocument(string filePath) + { + if (!File.Exists(filePath)) + throw new FileNotFoundException($"Could not find file : {filePath}", filePath); + + var fileInfo = new FileInfo(filePath); + + var sessionId = CreateUploadSession(new UploadSessionOptions + { + Name = fileInfo.Name, + Size = (int) fileInfo.Length + }).Result; + + using (var fileStream = File.OpenRead(filePath)) + { + var buffer = new byte[MaxChunkSize]; + int len; + while ((len = fileStream.Read(buffer, 0, buffer.Length)) > 0) + { + var data = new byte[len]; + Array.Copy(buffer, data, len); + var response = UploadDocumentChunk(sessionId, fileStream.Position - len, data).Result; + if (response.StatusCode == HttpStatusCode.Accepted) continue; + if (response.StatusCode == HttpStatusCode.OK) break; + + throw new ApiException(response.StatusCode, new Error + { + Code = (int) response.StatusCode, + Message = response.ReasonPhrase, + MoreInfo = response.Content.ReadAsStringAsync().Result + }); + } + } + + return GetUploadSession(sessionId).Result; + } + + /// + /// Cancel a document upload session. + /// + /// The identifier of the session to cancel. + /// The Uri of the created session. + public async Task CancelUploadSession(string sessionId) + { + return await _interfax.HttpClient.DeleteResourceAsync($"{ResourceUri}/{sessionId}"); + } + } +} \ No newline at end of file diff --git a/Interfax.ClientLib/Enums/DocumentDisposition.cs b/InterFAX.Api/Dtos/DocumentDisposition.cs similarity index 51% rename from Interfax.ClientLib/Enums/DocumentDisposition.cs rename to InterFAX.Api/Dtos/DocumentDisposition.cs index 73a0c95..1e1266a 100644 --- a/Interfax.ClientLib/Enums/DocumentDisposition.cs +++ b/InterFAX.Api/Dtos/DocumentDisposition.cs @@ -1,23 +1,23 @@ -namespace Interfax.ClientLib.Enums -{ - /// - /// Upload documents disposition - /// - public enum DocumentDisposition - { - /// - /// can be used once - /// - SingleUse, - - /// - /// deleted 60 minutes after the last usage - /// - MultiUse, - - /// - /// remains available until specifically removed by user - /// - Permanent - } -} +namespace InterFAX.Api.Dtos +{ + /// + /// The retention policy of an uploaded document. + /// + public enum DocumentDisposition + { + /// + /// The document can only be used once. + /// + SingleUse, + + /// + /// The document is deleted 60 minutes after the last usage. + /// + MultiUse, + + /// + /// The document remains available until removed. + /// + Permanent + } +} \ No newline at end of file diff --git a/InterFAX.Api/Dtos/DocumentSharing.cs b/InterFAX.Api/Dtos/DocumentSharing.cs new file mode 100644 index 0000000..c495b8f --- /dev/null +++ b/InterFAX.Api/Dtos/DocumentSharing.cs @@ -0,0 +1,8 @@ +namespace InterFAX.Api.Dtos +{ + public enum DocumentSharing + { + Private, + Shared + } +} \ No newline at end of file diff --git a/Interfax.ClientLib/Enums/DocumentStatus.cs b/InterFAX.Api/Dtos/DocumentStatus.cs similarity index 90% rename from Interfax.ClientLib/Enums/DocumentStatus.cs rename to InterFAX.Api/Dtos/DocumentStatus.cs index af5f7cb..b7f61dd 100644 --- a/Interfax.ClientLib/Enums/DocumentStatus.cs +++ b/InterFAX.Api/Dtos/DocumentStatus.cs @@ -1,33 +1,33 @@ -namespace Interfax.ClientLib.Enums -{ - /// - /// Document upload status - /// - public enum DocumentStatus - { - /// - /// Upload session was started, but no data has been uploaded - /// - Created, - - /// - /// Upload session was started, and some (not complete) data has been uploaded - /// - PartiallyUploaded, - - /// - /// Data upload is in progress - /// - Uploading, - - /// - /// Document is ready to be used - /// - Ready, - - /// - /// Document is being deleted - /// - Deleting - } -} +namespace InterFAX.Api.Dtos +{ + /// + /// Document upload status + /// + public enum DocumentStatus + { + /// + /// Upload session was started, but no data has been uploaded + /// + Created, + + /// + /// Upload session was started, and some (not complete) data has been uploaded + /// + PartiallyUploaded, + + /// + /// Data upload is in progress + /// + Uploading, + + /// + /// Document is ready to be used + /// + Ready, + + /// + /// Document is being deleted + /// + Deleting + } +} \ No newline at end of file diff --git a/InterFAX.Api/Dtos/Error.cs b/InterFAX.Api/Dtos/Error.cs new file mode 100644 index 0000000..b61ebf4 --- /dev/null +++ b/InterFAX.Api/Dtos/Error.cs @@ -0,0 +1,23 @@ +namespace InterFAX.Api.Dtos +{ + /// + /// An error response returned by some of the REST API methods. + /// + public class Error + { + /// + /// Code as returned from service. + /// + public int Code { get; set; } + + /// + /// The base error message. + /// + public string Message { get; set; } + + /// + /// Detailed information about the error. + /// + public string MoreInfo { get; set; } + } +} \ No newline at end of file diff --git a/InterFAX.Api/Dtos/ForwardingEmail.cs b/InterFAX.Api/Dtos/ForwardingEmail.cs new file mode 100644 index 0000000..8a96414 --- /dev/null +++ b/InterFAX.Api/Dtos/ForwardingEmail.cs @@ -0,0 +1,22 @@ +using System; + +namespace InterFAX.Api.Dtos +{ + public class ForwardingEmail + { + /// + /// An email address to which forwarding of the fax was attempted. + /// + public string EmailAddress { get; set; } + + /// + /// 0 = OK; number smaller than zero = in progress; number greater than zero = error. + /// + public int MessageStatus { get; set; } + + /// + /// Completion timestamp. May be null if incomplete. + /// + public DateTime? CompletionTime { get; set; } + } +} \ No newline at end of file diff --git a/InterFAX.Api/Dtos/InboundFax.cs b/InterFAX.Api/Dtos/InboundFax.cs new file mode 100644 index 0000000..0be390d --- /dev/null +++ b/InterFAX.Api/Dtos/InboundFax.cs @@ -0,0 +1,81 @@ +using System; +using Newtonsoft.Json; + +namespace InterFAX.Api.Dtos +{ + public class InboundFax + { + /// + /// The UserId who sent the fax. + /// + public string UserId { get; set; } + + /// + /// The Fax Id. + /// + public string MessageId { get; set; } + + /// + /// The Phone number at which this fax was received. + /// + public string PhoneNumber { get; set; } + + /// + /// The CSID of the sender. + /// + public string RemoteCSID { get; set; } + + /// + /// Status of the fax. See the list of InterFAX Error Codes - https://www.interfax.net/en/help/error_codes + /// + public int MessageStatus { get; set; } + + /// + /// The number of pages received in this fax. + /// + public int Pages { get; set; } + + /// + /// The size of the inbound fax image (in bytes). + /// + public int MessageSize { get; set; } + + /// + /// The type of message. Currently sends out static '1'. + /// + public int MessageType { get; set; } + + /// + /// The time and date that the fax was received + /// (formatted as dd/MM/yyyy hh:mm:ss). Times listed are GMT. + /// + public DateTime ReceiveTime { get; set; } + + /// + /// The caller ID of the sender. + /// + public string CallerId { get; set; } + + /// + /// The time (in seconds) that it took to receive the fax. + /// + public int RecordingDuration { get; set; } + + /// + /// Has the image been READ or is it UNREAD. + /// + public ImageStatus ImageStatus { get; set; } + + /// + /// Number of emails sent. + /// + [JsonProperty(PropertyName = "numOfEmails")] + public int NumberOfEmails { get; set; } + + /// + /// Number of times the emails have failed to send. + /// + [JsonProperty(PropertyName = "numOfFailedEmails")] + public int NumberOfFailedEmails { get; set; } + } +} \ No newline at end of file diff --git a/InterFAX.Api/Dtos/MediaTypeMapping.cs b/InterFAX.Api/Dtos/MediaTypeMapping.cs new file mode 100644 index 0000000..bff55de --- /dev/null +++ b/InterFAX.Api/Dtos/MediaTypeMapping.cs @@ -0,0 +1,12 @@ +using Newtonsoft.Json; + +namespace InterFAX.Api.Dtos +{ + internal class MediaTypeMapping + { + [JsonProperty(PropertyName = "MediaType")] + internal string MediaType { get; set; } + [JsonProperty(PropertyName = "FileType")] + internal string FileType { get; set; } + } +} \ No newline at end of file diff --git a/InterFAX.Api/Dtos/OutboundFax.cs b/InterFAX.Api/Dtos/OutboundFax.cs new file mode 100644 index 0000000..c0d55d3 --- /dev/null +++ b/InterFAX.Api/Dtos/OutboundFax.cs @@ -0,0 +1,78 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Newtonsoft.Json; + +namespace InterFAX.Api.Dtos +{ + public class OutboundFax : OutboundFaxSummary + { + /// + /// a4, letter, legal, or b4 + /// + public string PageSize { get; set; } + + /// + /// portrait or landscape + /// + public string PageOrientation { get; set; } + + /// + /// standard or fine + /// + public string PageResolution { get; set; } + + /// + /// Standard (optimize for black & white) or Fine (optimize for greyscale) + /// + public string Rendering { get; set; } + + /// + /// The fax header text inserted at the top of the page. + /// + public int PageHeader { get; set; } + + /// + // Time when the transaction was originally submitted. Always returned in GMT. + /// + public DateTime SubmitTime { get; set; } + + /// + /// A name or other optional identifier. + /// + public string Subject { get; set; } + + /// + /// The resolved fax number to which the fax was sent. + /// + public string DestinationFax { get; set; } + + /// + /// E-mail address for confirmation message. + /// + public string ReplyEmail { get; set; } + + /// + /// Total number of pages submitted. + /// + public int PagesSubmitted { get; set; } + + /// + /// Sender's fax ID. + /// + [JsonProperty(PropertyName = "senderCSID")] + public string SenderCSID { get; set; } + + /// + /// Maximum number of transmission attempts requested in case of fax transmission failure. + /// + public int AttemptsToPerform { get; set; } + + /// + /// The text which was inserted into the Contacts property upon submission of the fax (available in select submission methods only). + /// + public string Contact { get; set; } + } +} diff --git a/InterFAX.Api/Dtos/OutboundFaxResult.cs b/InterFAX.Api/Dtos/OutboundFaxResult.cs new file mode 100644 index 0000000..e56eadc --- /dev/null +++ b/InterFAX.Api/Dtos/OutboundFaxResult.cs @@ -0,0 +1,20 @@ +namespace InterFAX.Api.Dtos +{ + public class OutboundFaxResult + { + /// + /// A unique identifier for the fax. + /// + public int Id { get; set; } + + /// + /// A unique resource locator for the fax. + /// + public string Uri { get; set; } + + /// + /// Fax status. Generally, 0= OK; less than 0 = in process; greater than 0 = Error (See Interfax Status Codes) + /// + public int Status { get; set; } + } +} \ No newline at end of file diff --git a/InterFAX.Api/Dtos/OutboundFaxSummary.cs b/InterFAX.Api/Dtos/OutboundFaxSummary.cs new file mode 100644 index 0000000..7d906d9 --- /dev/null +++ b/InterFAX.Api/Dtos/OutboundFaxSummary.cs @@ -0,0 +1,56 @@ +using System; +using Newtonsoft.Json; + +namespace InterFAX.Api.Dtos +{ + public class OutboundFaxSummary : OutboundFaxResult + { + + /// + /// The submitting user. + /// + public string UserId { get; set; } + + /// + /// Number of successfully sent pages. + /// + public int PagesSent { get; set; } + + /// + /// End time of last of all transmission attempts. + /// + public DateTime CompletionTime { get; set; } + + /// + /// Receiving party fax ID (up to 20 characters). + /// + [JsonProperty(PropertyName = "remoteCSID")] + public string RemoteCSID { get; set; } + + /// + /// Transmission time in seconds. + /// + public decimal Duration { get; set; } + + /// + /// Decimal number of units to be billed (pages or tenths of minutes) + /// + public decimal Units { get; set; } + + /// + /// Monetary units, in account currency. + /// + public decimal CostPerUnit { get; set; } + + /// + /// Retry attempts actually performed. + /// + public int AttemptsMade { get; set; } + + /// + /// Units * CostPerUnit + /// + [JsonIgnore] + public decimal Cost => Units * CostPerUnit; + } +} \ No newline at end of file diff --git a/InterFAX.Api/Dtos/PageOrientation.cs b/InterFAX.Api/Dtos/PageOrientation.cs new file mode 100644 index 0000000..a3d2166 --- /dev/null +++ b/InterFAX.Api/Dtos/PageOrientation.cs @@ -0,0 +1,12 @@ +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; + +namespace InterFAX.Api.Dtos +{ + [JsonConverter(typeof(StringEnumConverter))] + public enum PageOrientation + { + Portrait, + Landscape + } +} diff --git a/InterFAX.Api/Dtos/PageRendering.cs b/InterFAX.Api/Dtos/PageRendering.cs new file mode 100644 index 0000000..60decb5 --- /dev/null +++ b/InterFAX.Api/Dtos/PageRendering.cs @@ -0,0 +1,19 @@ +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; + +namespace InterFAX.Api.Dtos +{ + [JsonConverter(typeof(StringEnumConverter))] + public enum PageRendering + { + /// + /// Better for greyscale text and images. + /// + GreyScale, + + /// + /// Recommended for textual, black & white documents. + /// + BlackAndWhite + } +} diff --git a/InterFAX.Api/Dtos/PageResolution.cs b/InterFAX.Api/Dtos/PageResolution.cs new file mode 100644 index 0000000..2d372c1 --- /dev/null +++ b/InterFAX.Api/Dtos/PageResolution.cs @@ -0,0 +1,19 @@ +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; + +namespace InterFAX.Api.Dtos +{ + [JsonConverter(typeof(StringEnumConverter))] + public enum PageResolution + { + /// + /// Standard page rendering quality. + /// + Standard, + + /// + /// Documents rendered as fine may be more readable but take longer to transmit (and may therefore be more costly). + /// + Fine + } +} \ No newline at end of file diff --git a/Interfax.ClientLib/Enums/PageSize.cs b/InterFAX.Api/Dtos/PageSize.cs similarity index 81% rename from Interfax.ClientLib/Enums/PageSize.cs rename to InterFAX.Api/Dtos/PageSize.cs index 1eb4847..3539208 100644 --- a/Interfax.ClientLib/Enums/PageSize.cs +++ b/InterFAX.Api/Dtos/PageSize.cs @@ -1,28 +1,31 @@ -namespace Interfax.ClientLib.Enums -{ - /// - /// Represents supported page sizes - /// - public enum PageSize - { - /// - /// A4 page size (common outside North America) - /// - A4, - - /// - /// Letter page size (common in North America) - /// - Letter, - - /// - /// Legal page size (common in North America) - /// - Legal, - - /// - /// B4 page size (used mainly in Japan) - /// - B4 - } -} +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; + +namespace InterFAX.Api.Dtos +{ + /// + /// Supported page sizes. + /// + public enum PageSize + { + /// + /// A4 page size (common outside North America) + /// + A4, + + /// + /// Letter page size (common in North America) + /// + Letter, + + /// + /// Legal page size (common in North America) + /// + Legal, + + /// + /// B4 page size (used mainly in Japan) + /// + B4 + } +} diff --git a/InterFAX.Api/Dtos/UploadSession.cs b/InterFAX.Api/Dtos/UploadSession.cs new file mode 100644 index 0000000..d365384 --- /dev/null +++ b/InterFAX.Api/Dtos/UploadSession.cs @@ -0,0 +1,69 @@ +using System; +using System.Linq; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; + +namespace InterFAX.Api.Dtos +{ + /// + /// Meta data about a document upload session. + /// + public class UploadSession + { + /// + /// The id of the user who uploaded the document. + /// + public string UserId { get; set; } + + /// + /// The filename provided when the document was uploaded, e.g. newsletter.pdf + /// + public string FileName { get; set; } + + /// + /// The planned size in bytes of the document. + /// + public int FileSize { get; set; } + + /// + /// The number of bytes actually uploaded. + /// + public int Uploaded { get; set; } + + /// + /// Fully-qualified resource URI of the document. + /// + public Uri Uri { get; set; } + + /// + /// The session Id. + /// + [JsonIgnore] + public string Id => Uri == null ? null : Uri.Segments.Last(); + + /// + /// The time the document was created. + /// + public DateTime CreationTime { get; set; } + + /// + /// When the document was last used. + /// + public DateTime LastUsageTime { get; set; } + + /// + /// One of created, partiallyUploaded, uploading, ready, deleting + /// + public DocumentStatus Status { get; set; } + + /// + /// singleUse, multiUse, permanent + /// + public DocumentDisposition Disposition { get; set; } + + /// + /// private, shared + /// + public DocumentSharing Sharing { get; set; } + } +} \ No newline at end of file diff --git a/InterFAX.Api/FaxClient.cs b/InterFAX.Api/FaxClient.cs new file mode 100644 index 0000000..e5a95a2 --- /dev/null +++ b/InterFAX.Api/FaxClient.cs @@ -0,0 +1,84 @@ +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Diagnostics; +using System.IO; +using System.Linq; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Text; +using System.Threading.Tasks; +using System.Web; +using InterFAX.Api.Dtos; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; + +namespace InterFAX.Api +{ + public class FaxClient + { + public const string UsernameConfigKey = "INTERFAX_USERNAME"; + public const string PasswordConfigKey = "INTERFAX_PASSWORD"; + + public Inbound Inbound { get; private set; } + public Outbound Outbound { get; private set; } + public Account Account { get; private set; } + public Documents Documents { get; private set; } + + internal HttpClient HttpClient { get; private set; } + + /// + /// Initialises the client with the given and + /// + /// + /// + /// + public FaxClient(string username, string password, HttpMessageHandler messageHandler = null) + { + Initialise(username, password, messageHandler); + } + + /// + /// Initialises the client from the App.config file. + /// + public FaxClient(HttpMessageHandler messageHandler = null) + { + var username = ConfigurationManager.AppSettings[UsernameConfigKey]; + if (string.IsNullOrEmpty(username)) + username = Environment.GetEnvironmentVariable(UsernameConfigKey); + + var password = ConfigurationManager.AppSettings[PasswordConfigKey]; + if (string.IsNullOrEmpty(password)) + password = Environment.GetEnvironmentVariable(PasswordConfigKey); + + Initialise(username, password, messageHandler); + } + + private void Initialise(string username, string password, HttpMessageHandler messageHandler = null) + { + if (string.IsNullOrEmpty(username)) + throw new ArgumentException($"{UsernameConfigKey} has not been set."); + + if (string.IsNullOrEmpty(password)) + throw new ArgumentException($"{PasswordConfigKey} has not been set."); + + Account = new Account(this); + Inbound = new Inbound(this); + Outbound = new Outbound(this); + Documents = new Documents(this); + + HttpClient = messageHandler == null ? new HttpClient() : new HttpClient(messageHandler); + HttpClient.BaseAddress = new Uri("https://rest.interfax.net/"); + HttpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); + HttpClient.DefaultRequestHeaders.Add("Authorization", + new List {$"Basic {Utils.Base64Encode($"{username}:{password}")}"}); + + JsonConvert.DefaultSettings = () => + { + var settings = new JsonSerializerSettings(); + settings.Converters.Add(new StringEnumConverter { CamelCaseText = true }); + return settings; + }; + } + } +} diff --git a/InterFAX.Api/FaxDocument.cs b/InterFAX.Api/FaxDocument.cs new file mode 100644 index 0000000..e382677 --- /dev/null +++ b/InterFAX.Api/FaxDocument.cs @@ -0,0 +1,59 @@ +using System; +using System.IO; +using System.Net; +using System.Net.Http; +using System.Net.Http.Headers; + +namespace InterFAX.Api +{ + public interface IFaxDocument + { + HttpContent ToHttpContent(); + } + + /// + /// Represents a fax document referenced by a URI. + /// + public class UriDocument : IFaxDocument + { + public Uri FileUri { get; private set; } + + internal UriDocument(Uri fileUri) + { + if (fileUri == null) + throw new ArgumentException("uri"); + + FileUri = fileUri; + } + + public HttpContent ToHttpContent() + { + var content = new ByteArrayContent(new byte[0]); + content.Headers.ContentLocation = FileUri; + content.Headers.ContentLength = 0; + return content; + } + } + + /// + /// Represents a fax document from a local file. + /// + public class FileDocument : IFaxDocument + { + public string FilePath { get; private set; } + public string MediaType { get; private set; } + + internal FileDocument(string filePath, string mediaType) + { + FilePath = filePath; + MediaType = mediaType; + } + + public HttpContent ToHttpContent() + { + var content = new ByteArrayContent(File.ReadAllBytes(FilePath)); + content.Headers.ContentType = MediaTypeHeaderValue.Parse(MediaType); + return content; + } + } +} \ No newline at end of file diff --git a/InterFAX.Api/HttpClientExtensions.cs b/InterFAX.Api/HttpClientExtensions.cs new file mode 100644 index 0000000..28fa055 --- /dev/null +++ b/InterFAX.Api/HttpClientExtensions.cs @@ -0,0 +1,80 @@ +using System.Collections.Generic; +using System.Net; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Threading.Tasks; +using System.Web; +using InterFAX.Api.Dtos; + +namespace InterFAX.Api +{ + internal static class HttpClientExtensions + { + public static async Task GetResourceAsync(this HttpClient httpClient, string requestUri, IOptions options = null) + { + var task = httpClient.GetAsync(requestUri.AddOptions(options)); + var response = await task; + if (response.IsSuccessStatusCode) return await response.Content.ReadAsAsync(); + + throw new ApiException(response.StatusCode, await response.ToError()); + } + + public static async Task PostAsync(this HttpClient httpClient, string requestUri, IOptions options = null) + { + var task = httpClient.PostAsync(requestUri.AddOptions(options), new StringContent("")); + var response = await task; + if (response.IsSuccessStatusCode) return await response.Content.ReadAsAsync(); + + throw new ApiException(response.StatusCode, await response.ToError()); + } + + public static async Task PostAsync(this HttpClient httpClient, string requestUri, IOptions options = null, HttpContent content = null) + { + var task = httpClient.PostAsync(requestUri.AddOptions(options), content ?? new StringContent("")); + var response = await task; + if (response.IsSuccessStatusCode) return response; + + throw new ApiException(response.StatusCode, await response.ToError()); + } + + public static async Task PostRangeAsync(this HttpClient httpClient, string requestUri, ByteArrayContent content, RangeHeaderValue range) + { + var request = new HttpRequestMessage(HttpMethod.Post, requestUri); + request.Headers.Range = range; + request.Content = content; + var task = httpClient.SendAsync(request); + var response = await task; + if (response.IsSuccessStatusCode) return response; + + throw new ApiException(response.StatusCode, await response.ToError()); + } + + public static async Task DeleteResourceAsync(this HttpClient httpClient, string requestUri) + { + var task = httpClient.DeleteAsync(requestUri); + var response = await task; + if (response.IsSuccessStatusCode) return response.ReasonPhrase; + + throw new ApiException(response.StatusCode, await response.ToError()); + } + + public static string AddOptions(this string requestUri, IOptions options) + { + if (options == null) return requestUri; + + var optionsDictionary = options.ToDictionary(); + if (optionsDictionary.Keys.Count == 0) return requestUri; + + var queryString = HttpUtility.ParseQueryString(string.Empty); + foreach (var key in optionsDictionary.Keys) + queryString[key] = optionsDictionary[key]; + return $"{requestUri}?{queryString}"; + } + + private static async Task ToError(this HttpResponseMessage response) + { + try { return await response.Content.ReadAsAsync(); } + catch { return new Error { Code = (int)response.StatusCode, Message = await response.Content.ReadAsStringAsync(), MoreInfo = response.ReasonPhrase }; } + } + } +} \ No newline at end of file diff --git a/InterFAX.Api/IOptions.cs b/InterFAX.Api/IOptions.cs new file mode 100644 index 0000000..008ea88 --- /dev/null +++ b/InterFAX.Api/IOptions.cs @@ -0,0 +1,9 @@ +using System.Collections.Generic; + +namespace InterFAX.Api +{ + internal interface IOptions + { + Dictionary ToDictionary(); + } +} \ No newline at end of file diff --git a/InterFAX.Api/Inbound.ListOptions.cs b/InterFAX.Api/Inbound.ListOptions.cs new file mode 100644 index 0000000..b81c646 --- /dev/null +++ b/InterFAX.Api/Inbound.ListOptions.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; + +namespace InterFAX.Api +{ + public partial class Inbound + { + public class ListOptions : IOptions + { + /// + /// Return only unread faxes? + /// + public bool UnreadOnly { get; set; } = false; + + /// + /// How many transactions to return. + /// + public int? Limit { get; set; } + + /// + /// Return results from this ID onwards (not including this ID). Used for pagination. + /// + public int? LastId { get; set; } + + /// + /// For a "primary" user, determines whether to return data for the current user only or for all account users. + /// + public bool AllUsers { get; set; } = false; + + public Dictionary ToDictionary() + { + var options = new Dictionary(); + if (UnreadOnly) options.Add("unreadOnly", "true"); + if (Limit.HasValue) options.Add("limit", Limit.ToString()); + if (LastId.HasValue) options.Add("lastId", LastId.ToString()); + if (AllUsers) options.Add("allUsers", "true"); + return options; + } + } + } +} \ No newline at end of file diff --git a/InterFAX.Api/Inbound.cs b/InterFAX.Api/Inbound.cs new file mode 100644 index 0000000..176ab53 --- /dev/null +++ b/InterFAX.Api/Inbound.cs @@ -0,0 +1,91 @@ +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using InterFAX.Api.Dtos; + +namespace InterFAX.Api +{ + public partial class Inbound + { + private readonly FaxClient _interfax; + private const string ResourceUri = "/inbound/faxes"; + + internal Inbound(FaxClient interfax) + { + _interfax = interfax; + } + + #region GET Methods + /// + /// Retrieves a user's list of inbound faxes. (Sort order is always in descending ID). + /// + /// + public async Task> GetList(ListOptions listOptions = null) + { + return await _interfax.HttpClient.GetResourceAsync>(ResourceUri, listOptions); + } + + /// + /// Retrieves a single fax's metadata (receive time, sender number, etc.). + /// + /// The message ID of the fax for which to retrieve data. + public async Task GetFaxRecord(int id) + { + return await _interfax.HttpClient.GetResourceAsync($"{ResourceUri}/{id}"); + } + + /// + /// Retrieves a single fax's metadata (receive time, sender number, etc.). + /// + /// The message ID of the fax for which to retrieve data. + public async Task> GetForwardingEmails(int id) + { + return await _interfax.HttpClient.GetResourceAsync>($"{ResourceUri}/{id}/emails"); + } + + /// + /// Retrieve the fax image (TIFF file) of a received fax. + /// + /// The message ID of the fax for which to retrieve data. + public async Task GetFaxImageStream(int id) + { + return await _interfax.HttpClient.GetStreamAsync($"{ResourceUri}/{id}/image"); + } + #endregion + + #region POST Methods + /// + /// Mark a fax as read. + /// + /// The message ID of the fax to mark as read. + public async Task MarkRead(int id) + { + var response = await _interfax.HttpClient.PostAsync($"{ResourceUri}/{id}/mark"); + return response.ReasonPhrase; + } + + /// + /// Mark a fax as unread. + /// + /// The message ID of the fax to mark as read. + public async Task MarkUnread(int id) + { + var response = await _interfax.HttpClient.PostAsync($"{ResourceUri}/{id}/mark?unread=true"); + return response.ReasonPhrase; + } + + /// + /// Resend an inbound fax, optionally to a specific email address. + /// + /// The message ID of the fax to resend. + /// Optional email address to forward the inbound fax on to. + public async Task Resend(int id, string emailAddress = null) + { + var requestUri = $"{ResourceUri}/{id}/resend"; + if (!string.IsNullOrEmpty(emailAddress)) requestUri += $"?emailAddress={emailAddress}"; + var response = await _interfax.HttpClient.PostAsync(requestUri); + return response.ReasonPhrase; + } + #endregion + } +} \ No newline at end of file diff --git a/InterFAX.Api/InterFAX.Api.csproj b/InterFAX.Api/InterFAX.Api.csproj new file mode 100644 index 0000000..78d64ad --- /dev/null +++ b/InterFAX.Api/InterFAX.Api.csproj @@ -0,0 +1,100 @@ + + + + + Debug + AnyCPU + {1A4809EE-070E-4255-BDD2-2AEECDBA5BC5} + Library + Properties + InterFAX.Api + InterFAX.Api + v4.5.2 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + ..\release\ + TRACE + prompt + 4 + + + + ..\packages\Newtonsoft.Json.6.0.4\lib\net45\Newtonsoft.Json.dll + True + + + + + + ..\packages\Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll + True + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/InterFAX.Api/InterFAX.Api.nuspec b/InterFAX.Api/InterFAX.Api.nuspec new file mode 100644 index 0000000..51366a7 --- /dev/null +++ b/InterFAX.Api/InterFAX.Api.nuspec @@ -0,0 +1,17 @@ + + + + $id$ + $version$ + $title$ + $author$ + $author$ + https://github.com/interfax/interfax-dotnet/blob/master/LICENSE + https://github.com/interfax/interfax-dotnet + false + $description$ + Initial packaging. + Copyright 2016 + Fax API + + \ No newline at end of file diff --git a/InterFAX.Api/ListSortOrder.cs b/InterFAX.Api/ListSortOrder.cs new file mode 100644 index 0000000..34e3eeb --- /dev/null +++ b/InterFAX.Api/ListSortOrder.cs @@ -0,0 +1,10 @@ +namespace InterFAX.Api +{ + public enum ListSortOrder { Ascending, Descending } + + public enum ImageStatus + { + READ, + UNREAD + } +} \ No newline at end of file diff --git a/InterFAX.Api/Outbound.ListOptions.cs b/InterFAX.Api/Outbound.ListOptions.cs new file mode 100644 index 0000000..3b273ba --- /dev/null +++ b/InterFAX.Api/Outbound.ListOptions.cs @@ -0,0 +1,40 @@ +using System.Collections.Generic; + +namespace InterFAX.Api +{ + public partial class Outbound + { + public class ListOptions : IOptions + { + /// + /// How many transactions to return. + /// + public int? Limit { get; set; } + + /// + /// Return results from this ID onwards (not including this ID). Used for pagination. + /// + public int? LastId { get; set; } + + /// + /// Ascending or descending. Sorts by fax ID. (Default is descending) + /// + public ListSortOrder SortOrder { get; set; } = ListSortOrder.Descending; + + /// + /// Enables a "primary" user to query for other account users' faxes. + /// + public string UserId { get; set; } + + public Dictionary ToDictionary() + { + var options = new Dictionary(); + if (!string.IsNullOrEmpty(UserId)) options.Add("userId", UserId); + if (LastId.HasValue) options.Add("lastId", LastId.ToString()); + if (Limit.HasValue) options.Add("limit", Limit.ToString()); + if (SortOrder == ListSortOrder.Ascending) options.Add("sortOrder", "asc"); + return options; + } + } + } +} \ No newline at end of file diff --git a/InterFAX.Api/Outbound.cs b/InterFAX.Api/Outbound.cs new file mode 100644 index 0000000..3e1a6c1 --- /dev/null +++ b/InterFAX.Api/Outbound.cs @@ -0,0 +1,139 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Net.Http; +using System.Threading.Tasks; +using InterFAX.Api.Dtos; + +namespace InterFAX.Api +{ + public partial class Outbound + { + private readonly FaxClient _interfax; + private const string ResourceUri = "/outbound/faxes"; + + internal Outbound(FaxClient interfax) + { + _interfax = interfax; + + Documents = new Documents(interfax); + } + + public Documents Documents { get; set; } + + #region Query Methods + /// + /// Get a list of recent outbound faxes (which does not include batch faxes). + /// + /// + public async Task> GetList(ListOptions listOptions = null) + { + return await _interfax.HttpClient.GetResourceAsync>(ResourceUri, listOptions); + } + + /// + /// Get details for a subset of completed faxes from a submitted list. (Submitted id's which have not completed are ignored). + /// + /// Array of fax id's to retrieve, if they have completed. + public async Task> GetCompleted(IEnumerable ids = null) + { + return await _interfax.HttpClient.GetResourceAsync>($"{ResourceUri}/completed"); + } + + /// + /// Retrieves information regarding a previously-submitted fax, including its current status. + /// + /// The transaction ID of the fax for which to retrieve data. + public async Task GetFaxRecord(int id) + { + return await _interfax.HttpClient.GetResourceAsync($"{ResourceUri}/{id}"); + } + + /// + /// Retrieve the fax image (TIFF file) of a submitted fax. + /// + /// The transaction ID of the fax for which to retrieve data. + public async Task GetFaxImageStream(int id) + { + return await _interfax.HttpClient.GetStreamAsync($"{ResourceUri}/{id}/image"); + } + + /// + /// Search fax list. + /// + /// This operation will return individual faxes (i.e., /faxes resources) as well as child faxes of batches (i.e., /batches/{id}/children resources). + /// + /// + public async Task> SearchFaxes(SearchOptions searchOptions) + { + if (searchOptions == null) + throw new ArgumentException("searchOptions"); + + return await _interfax.HttpClient.GetResourceAsync>("/outbound/search", searchOptions); + } + #endregion + + #region Sending Faxes + /// + /// Submit a fax with multiple documents to a destination number. + /// + /// The messageId of the newly created fax. + public async Task SendFax(List faxDocuments, SendOptions options) + { + var content = new MultipartContent(); + foreach(var faxDocument in faxDocuments) + content.Add(faxDocument.ToHttpContent()); + var response = await _interfax.HttpClient.PostAsync(ResourceUri, options, content); + return Convert.ToInt32(response.Headers.Location.Segments.Last()); + } + + /// + /// Submit a fax with a single document to a destination number. + /// + /// The messageId of the newly created fax. + public async Task SendFax(IFaxDocument faxDocument, SendOptions options) + { + return await SendFax(new List {faxDocument}, options); + } + #endregion + + #region Modify Existing Faxes + /// + /// Cancel a fax in progress. + /// + /// The message ID of the fax to cancel. + public async Task CancelFax(int id) + { + var response = await _interfax.HttpClient.PostAsync($"{ResourceUri}/{id}/cancel"); + return response.ReasonPhrase; + } + + /// + /// Resend a previously-submitted fax, without needing to re-upload the original document. + /// + /// The resent fax is allocated a new message ID. + /// + /// The message ID of the fax to resend. + /// (optional) The new destination fax number to which this fax should be sent. + /// The messageId of the newly created fax. + public async Task ResendFax(int id, string faxNumber = null) + { + var requestUri = $"{ResourceUri}/{id}/resend"; + if (!string.IsNullOrEmpty(faxNumber)) requestUri += $"?faxNumber={faxNumber}"; + var response = await _interfax.HttpClient.PostAsync(requestUri); + return Convert.ToInt32(response.Headers.Location.Segments.Last()); + } + + /// + /// Hide a fax from listing in queries (there is no way to unhide a fax). + /// + /// The message ID of the fax to hide. + public async Task HideFax(int id) + { + var response = await _interfax.HttpClient.PostAsync($"{ResourceUri}/{id}/hide"); + return response.ReasonPhrase; + } + #endregion + } +} \ No newline at end of file diff --git a/InterFAX.Api/Properties/AssemblyInfo.cs b/InterFAX.Api/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..952aac0 --- /dev/null +++ b/InterFAX.Api/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("InterFAX.Api")] +[assembly: AssemblyDescription("The InterFAX .NET Client Library")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Interfax Communications Limited")] +[assembly: AssemblyProduct("InterFAX.Api")] +[assembly: AssemblyCopyright("Copyright © 2016")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("1a4809ee-070e-4255-bdd2-2aeecdba5bc5")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.1.0")] +[assembly: AssemblyFileVersion("1.0.1.31")] diff --git a/InterFAX.Api/SearchOptions.cs b/InterFAX.Api/SearchOptions.cs new file mode 100644 index 0000000..cfddec5 --- /dev/null +++ b/InterFAX.Api/SearchOptions.cs @@ -0,0 +1,87 @@ +using System; +using System.Collections.Generic; +using System.Linq; + +namespace InterFAX.Api +{ + public class SearchOptions : IOptions + { + /// + /// List of fax IDs. + /// + public int[] Ids { get; set; } + + /// + /// The 'reference' parameter entered at submit time. + /// + public string Reference { get; set; } + + /// + /// Lower bound of date range from which to return faxes. + /// + public DateTime? DateFrom { get; set; } + + /// + /// Upper bound of date range frrom which to return faxes. + /// + public DateTime? DateTo { get; set; } + + /// + /// A specific value from the list of possible fax status codes. + /// + public int? Status { get; set; } + + /// + /// Completed = return only completed faxes, whether successful or failed, + /// Success = return only successfully-completed faxes, + /// Failed = return only failed faxes, + /// Inprocess = return only faxes in process, + /// All = return faxes of any status. (default) + /// + public StatusFamily? StatusFamily { get; set; } + + /// + /// Limit returned faxes to these user ID's. This parameter has effect only when the querying username is a "primary" user. + /// + public string UserId { get; set; } + + /// + /// Limit returned faxes to this destination fax number. + /// + public string FaxNumber { get; set; } + + /// + /// Ascending or descending. Sorts by fax ID. (Default is descending) + /// + public ListSortOrder SortOrder { get; set; } = ListSortOrder.Descending; + + /// + /// Skip this many records. + /// + public int? Offset { get; set; } + + /// + /// How many transactions to return. + /// + public int? Limit { get; set; } + + public Dictionary ToDictionary() + { + var options = new Dictionary(); + if (Ids != null) options.Add("ids", string.Join(",", Ids)); + if (!string.IsNullOrEmpty(Reference)) options.Add("reference", Reference); + if (DateFrom.HasValue) options.Add("dateFrom", DateFrom.Value.ToString("s") + "Z"); + if (DateTo.HasValue) options.Add("dateTo", DateTo.Value.ToString("s") + "Z"); + if (Status.HasValue) + options.Add("status", Status.ToString()); + else if (StatusFamily.HasValue) + options.Add("status", StatusFamily.ToString()); + if (!string.IsNullOrEmpty(UserId)) options.Add("userId", UserId); + if (!string.IsNullOrEmpty(FaxNumber)) options.Add("faxNumber", FaxNumber); + if (SortOrder == ListSortOrder.Ascending) options.Add("sortOrder", "asc"); + if (Offset.HasValue) options.Add("offset", Offset.ToString()); + if (Limit.HasValue) options.Add("limit", Limit.ToString()); + return options; + } + } +} \ No newline at end of file diff --git a/InterFAX.Api/SendOptions.cs b/InterFAX.Api/SendOptions.cs new file mode 100644 index 0000000..f7014c6 --- /dev/null +++ b/InterFAX.Api/SendOptions.cs @@ -0,0 +1,108 @@ +using System; +using System.Collections.Generic; +using System.Data.SqlClient; +using System.Globalization; +using InterFAX.Api.Dtos; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; + +namespace InterFAX.Api +{ + /// + /// Options which can be provided when submitting a fax. + /// + public class SendOptions : IOptions + { + /// + /// A single fax number, e.g: +1-212-3456789. + /// + public string FaxNumber { get; set; } + + /// + /// A name or other reference. The entered string will appear: + /// (1) for reference in the outbound queue; + /// (2) in the outbound fax header, if headers are configured; and + /// (3) in subsequent queries of the fax object. + /// + public string Contact { get; set; } + + /// + /// Time to schedule the transmission. + /// + public DateTime? PostponeTime { get; set; } + + /// + /// Number of transmission attempts to perform, in case of fax transmission failure. + /// + public int? RetriesToPerform { get; set; } + + /// + /// Sender CSID. (defaults is taken from control panel settings) + /// + public string Csid { get; set; } + + /// + /// The fax header text to insert at the top of the page. + /// Enter a string template to send a fax with a dynamically-populated header. + /// e.g. "To: {To} From: {From} Pages: {TotalPages}" + /// + public string PageHeader { get; set; } + + /// + /// Provide your internal ID to a document. + /// This parameter can be obtained by status query, but is not included in the transmitted fax message. + /// + public string Reference { get; set; } + + /// + /// E-mail address to which feedback messages will be sent. + /// + public string ReplyAddress { get; set; } + + /// + /// a4, letter, legal, or b4. + /// + public PageSize? PageSize { get; set; } + + /// + /// Scaling enlarges or reduces an image file to the given page size. + /// + public bool? ShouldScale { get; set; } + + /// + /// portrait or landscape. + /// + public PageOrientation? PageOrientation { get; set; } + + /// + /// standard or fine. Documents rendered as fine may be more readable but take longer to transmit (and may therefore be more costly). + /// + public PageResolution? PageResolution { get; set; } + + /// + /// greyscale or bw. + /// Determines the rendering mode. + /// bw is recommended for textual, black & white documents, while greyscale is better for greyscale text and for images. + /// + public PageRendering? PageRendering { get; set; } + + public Dictionary ToDictionary() + { + var options = new Dictionary(); + if (!string.IsNullOrEmpty(FaxNumber)) options.Add("faxNumber", FaxNumber); + if (!string.IsNullOrEmpty(Contact)) options.Add("contact", Contact); + if (PostponeTime.HasValue) options.Add("postponeTime", PostponeTime.Value.ToString("s") + "Z"); + if (RetriesToPerform != null) options.Add("retriesToPerform", RetriesToPerform.ToString()); + if (!string.IsNullOrEmpty(Csid)) options.Add("csid", Csid); + if (!string.IsNullOrEmpty(PageHeader)) options.Add("pageHeader", PageHeader); + if (!string.IsNullOrEmpty(Reference)) options.Add("reference", Reference); + if (!string.IsNullOrEmpty(ReplyAddress)) options.Add("replyAddress", ReplyAddress); + if (PageSize.HasValue) options.Add("pageSize", PageSize.ToCamelCase()); + if (ShouldScale.HasValue) options.Add("fitToPage", ShouldScale.Value? "scale" : "noscale"); + if (PageOrientation.HasValue) options.Add("pageOrientation", PageOrientation.ToCamelCase()); + if (PageResolution.HasValue) options.Add("resolution", PageResolution.ToCamelCase()); + if (PageRendering.HasValue) options.Add("rendering", PageRendering.ToCamelCase()); + return options; + } + } +} \ No newline at end of file diff --git a/Interfax.ClientLib/Enums/StatusFamily.cs b/InterFAX.Api/StatusFamily.cs similarity index 53% rename from Interfax.ClientLib/Enums/StatusFamily.cs rename to InterFAX.Api/StatusFamily.cs index 5af38bb..82def1c 100644 --- a/Interfax.ClientLib/Enums/StatusFamily.cs +++ b/InterFAX.Api/StatusFamily.cs @@ -1,38 +1,33 @@ -namespace Interfax.ClientLib.Enums -{ - /// - /// Defines groups of statuses - /// - public enum StatusFamily - { - /// - /// any status - /// - All, - - /// - /// A specific status - /// - Specific, - - /// - /// Completed faxes, whether successful or failed - /// - Completed, - - /// - /// successfully-completed faxes - /// - Success, - - /// - /// failed faxes - /// - Failed, - - /// - /// faxes in process (not completed) - /// - Inprocess - } -} +namespace InterFAX.Api +{ + /// + /// Defines groups of statuses + /// + public enum StatusFamily + { + /// + /// Any status code. + /// + All, + + /// + /// Completed faxes, whether successful or failed. + /// + Completed, + + /// + /// Successfully completed faxes. + /// + Success, + + /// + /// Failed faxes. + /// + Failed, + + /// + /// Faxes in process (not completed). + /// + Inprocess + } +} \ No newline at end of file diff --git a/InterFAX.Api/SupportedMediaTypes.json b/InterFAX.Api/SupportedMediaTypes.json new file mode 100644 index 0000000..7380155 --- /dev/null +++ b/InterFAX.Api/SupportedMediaTypes.json @@ -0,0 +1,134 @@ +[ + { + "MediaType": "application/vnd.oasis.opendocument.formula", + "FileType": "odf" + }, + { + "MediaType": "application/vnd.oasis.opendocument.text", + "FileType": "odt" + }, + { + "MediaType": "application/vnd.oasis.opendocument.spreadsheet", + "FileType": "ods" + }, + { + "MediaType": "application/vnd.oasis.opendocument.presentation", + "FileType": "odp" + }, + { + "MediaType": "application/vnd.oasis.opendocument.graphics", + "FileType": "odg" + }, + { + "MediaType": "application/vnd.oasis.opendocument.textmaster", + "FileType": "odm" + }, + { + "MediaType": "application/msword", + "FileType": "doc" + }, + { + "MediaType": "application/msword", + "FileType": "docx" + }, + { + "MediaType": "application/msword", + "FileType": "dot" + }, + { + "MediaType": "application/xml", + "FileType": "xml" + }, + { + "MediaType": "application/pdf", + "FileType": "pdf" + }, + { + "MediaType": "image/tiff", + "FileType": "tiff" + }, + { + "MediaType": "image/tiff", + "FileType": "tif" + }, + { + "MediaType": "text/plain", + "FileType": "txt" + }, + { + "MediaType": "application/vnd.ms-excel", + "FileType": "xls" + }, + { + "MediaType": "application/vnd.ms-excel", + "FileType": "xlsx" + }, + { + "MediaType": "text/html", + "FileType": "html" + }, + { + "MediaType": "text/html", + "FileType": "htm" + }, + { + "MediaType": "message/rfc822", + "FileType": "mht" + }, + { + "MediaType": "application/internet-shortcut", + "FileType": "url" + }, + { + "MediaType": "application/vnd.ms-powerpoint", + "FileType": "ppt" + }, + { + "MediaType": "application/vnd.ms-powerpoint", + "FileType": "pptx" + }, + { + "MediaType": "image/gif", + "FileType": "gif" + }, + { + "MediaType": "image/png", + "FileType": "png" + }, + { + "MediaType": "image/jpeg", + "FileType": "jpeg" + }, + { + "MediaType": "image/jpeg", + "FileType": "jpg" + }, + { + "MediaType": "application/postscript", + "FileType": "ps" + }, + { + "MediaType": "application/eps", + "FileType": "eps" + }, + { + "MediaType": "application/rtf", + "FileType": "rtf" + }, + { + "MediaType": "image/bmp", + "FileType": "bmp" + }, + { + "MediaType": "application/pcx", + "FileType": "pcx" + }, + { + "MediaType": "application/snapshot", + "FileType": "snp" + }, + { + "MediaType": "application/zip", + "FileType": "zip" + } +] \ No newline at end of file diff --git a/InterFAX.Api/Utils.cs b/InterFAX.Api/Utils.cs new file mode 100644 index 0000000..5c814dd --- /dev/null +++ b/InterFAX.Api/Utils.cs @@ -0,0 +1,52 @@ +using System; +using System.Globalization; +using System.IO; +using System.Text; + +namespace InterFAX.Api +{ + public static class Utils + { + /// + /// Encodes a string in Base64 (primarily for basic authentication) + /// + /// The string to encode. + /// + public static string Base64Encode(string toEncode) + { + var authBytes = Encoding.UTF8.GetBytes(toEncode); + return Convert.ToBase64String(authBytes); + } + + /// + /// Copies the contents of input to output. Doesn't close either stream. + /// + public static void CopyStream(Stream input, Stream output) + { + var buffer = new byte[8 * 1024]; + int len; + while ((len = input.Read(buffer, 0, buffer.Length)) > 0) + { + output.Write(buffer, 0, len); + } + } + + /// + /// Convert an input string to camelCase. + /// + public static string ToCamelCase(this string input) + { + var camelCased = CultureInfo.InvariantCulture.TextInfo.ToTitleCase(input.ToLowerInvariant().Trim()).Replace("_", "").Replace("-", "").Replace(".", "").Replace(" ", ""); + if (camelCased.Length < 2) return camelCased; + return char.ToLowerInvariant(camelCased[0]) + camelCased.Substring(1); + } + + /// + /// Convert an enum value to camelCase. + /// + public static string ToCamelCase(this Enum input) + { + return input.ToString().ToCamelCase(); + } + } +} \ No newline at end of file diff --git a/InterFAX.Api/packages.config b/InterFAX.Api/packages.config new file mode 100644 index 0000000..db9c810 --- /dev/null +++ b/InterFAX.Api/packages.config @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Interfax.ClientLib/Accounts.cs b/Interfax.ClientLib/Accounts.cs deleted file mode 100644 index 95a46d2..0000000 --- a/Interfax.ClientLib/Accounts.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System; - -namespace Interfax.ClientLib -{ - /// - /// Represents Accounts service - /// - public class Accounts : Base - { - /// - /// Constructor - /// - /// Interfax User Id - /// Interfax password - /// Request timeout (optional, default is 30 sec.) - /// The service end point (optional). Default is live service - public Accounts(string userId, string Password, TimeSpan? timeout = null, string endPoint = null) : base("accounts", userId, Password, timeout, endPoint) { } - - - /// - /// Determine the remaining faxing credits in your account (in the account's currency). - /// - /// The found balance - /// Request status - public Enums.RequestStatus getBalance(out decimal balance) - { - return base.GetObject("self/ppcards/balance", out balance); - } - } -} diff --git a/Interfax.ClientLib/Base.cs b/Interfax.ClientLib/Base.cs deleted file mode 100644 index a96166c..0000000 --- a/Interfax.ClientLib/Base.cs +++ /dev/null @@ -1,385 +0,0 @@ -using System; -using System.Net.Http; -using System.Net.Http.Headers; -using System.Text; -using Newtonsoft.Json; - -namespace Interfax.ClientLib -{ - /// - /// Base class for services classes - /// - abstract public class Base - { - /// - /// Constructor - /// - /// The base path for the specific service - /// Interfax User Id - /// Interfax password - /// Request timeout (optional, default is 30 sec.) - /// The service end point (optional). Default is live service - protected Base(string basePath, string userId, string password, TimeSpan? timeout = null, string endPoint = null) - { - // set default value for timeout - if (!timeout.HasValue) - timeout = TimeSpan.FromSeconds(30); - - // set default value for timeout - if (string.IsNullOrEmpty( endPoint)) - endPoint = @"https://rest.interfax.net/"; - - //build with basepath - UriBuilder builder = new UriBuilder(endPoint); - if (!basePath.EndsWith("/")) - basePath += "/"; - - builder.Path = basePath; - - // set base uri - client.BaseAddress = builder.Uri; - - // set timeout - client.Timeout = timeout.Value; - - // Add an Accept header for JSON format. - string accept_format = "application/json"; - client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue(accept_format)); - - // add authentication header - var credentials = Convert.ToBase64String(Encoding.ASCII.GetBytes(string.Format("{0}:{1}", userId, password))); - client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", credentials); - - // add AcceptEncoding header - client.DefaultRequestHeaders.AcceptEncoding.Add(new StringWithQualityHeaderValue("gzip")); - } - - /// - /// Error message of last operation - /// - public string LastError { get { return _lastError; } } - - /// - /// Detailed error block of last operation - /// - public Entities.ErrorBlock ErrorBlock { get { return _errorBlock; } } - - /// - /// The Http client to use - /// - private HttpClient client = new HttpClient(); - private string _lastError; - private Entities.ErrorBlock _errorBlock; - - #region Helper methods - /// - /// Send a Get request and populate a response to a .NET object of a given type - /// - /// Type of result - /// Request Uri - /// Output: the resulting object - /// The request status - protected Enums.RequestStatus GetObject(string uri, out T result) - { - result = default(T); - byte[] data; - var st = GetBinary(uri, out data); - - if (st == Enums.RequestStatus.OK) - { - st = GetObject(data, out result); - } - return st; - } - - /// - /// Send a Get request and populate a binary response - /// - /// Request Uri - /// Output: the resulting binary data - /// The request status - protected Enums.RequestStatus GetBinary(string uri, out byte[] result) - { - result = null; - - try - { - var response = client.GetAsync(uri).Result; - _lastError = response.ReasonPhrase + " " + (int)response.StatusCode; - _errorBlock = null; - - result = response.Content.ReadAsByteArrayAsync().Result; - - switch (response.StatusCode) - { - case System.Net.HttpStatusCode.OK: - _lastError = ""; - return Enums.RequestStatus.OK; - - case System.Net.HttpStatusCode.NotFound: - ExtractErrorBlock(response); - return Enums.RequestStatus.NotFound; - - case System.Net.HttpStatusCode.Forbidden: - case System.Net.HttpStatusCode.Unauthorized: - ExtractErrorBlock(response); - return Enums.RequestStatus.AuthenticationError; - - default: - return Enums.RequestStatus.SystemError; - } - - } - catch (Exception ex) - { - _lastError = ex.ToString(); - return Enums.RequestStatus.SystemError; - } - } - - /// - /// Send a POST request with content of a given type and populate a response on another type - /// - /// Type of input - /// Type of result - /// Request Uri - /// Input object - /// Output: the resulting object - /// The request status - protected Enums.RequestStatus Post(string uri, Tin input, out Tout result) - { - result = default(Tout); - Enums.RequestStatus st; - - try - { - var jsonString = JsonConvert.SerializeObject(input); - var response = client.PostAsync(uri, new StringContent(jsonString, Encoding.UTF8)).Result; - - byte[] data; - st = ParseBinary(response, out data); - - if (st == Enums.RequestStatus.OK) - { - st = GetObject(data, out result); - } - - return st; - } - catch (Exception ex) - { - _lastError = ex.ToString(); - return Enums.RequestStatus.SystemError; - } - } - - /// - /// Send a POST request with no content and no returned object - /// - /// Request Uri - /// The request status - protected Enums.RequestStatus Post(string uri) - { - string output; // dummy - return Post(uri, "", out output); - } - - - /// - /// Send a POST request with no content and no returned object - /// - /// Request Uri - /// Output: The value in the Locationn Http header - /// Optional: the content to be posted - /// The request status - protected Enums.RequestStatus PostAndGetLocation(string uri, out Uri location, HttpContent content = null) - { - location = null; - try - { - var response = client.PostAsync(uri,content).Result; - - byte[] data; - var st = ParseBinary(response, out data); - - if (st == Enums.RequestStatus.Created) - { - location = response.Headers.Location; - } - - return st; - } - catch (Exception ex) - { - _lastError = ex.ToString(); - return Enums.RequestStatus.SystemError; - } - } - - - /// - /// Send a POST request with binary content and no returned object - /// - /// Request Uri - /// Binary data to be sent - /// The request status - protected Enums.RequestStatus PostBinary(string uri, byte[] data) - { - var content = new ByteArrayContent(data); - return PostBinary(uri, content); - } - - /// - /// Send a POST request with binary content and no returned object - /// - /// Request Uri - /// Binary data to be sent - /// position in data to start transfer from - /// Number of bytes from offset to transfer - /// The request status - protected Enums.RequestStatus PostBinary(string uri, byte[] data, int offset, int count) - { - var content = new ByteArrayContent(data,offset,count); - return PostBinary(uri, content, new RangeHeaderValue(offset, offset + count - 1)); - } - - /// - /// Sends a Delete Http request to a given Uri - /// - /// the Uri - /// The request status - protected Enums.RequestStatus DeleteUri(string uri) - { - var response = client.DeleteAsync(uri).Result; - byte[] data; - return ParseBinary(response, out data); - } - - /// - /// Send a POST request with binary content and no returned object - /// - /// Request Uri - /// Content to be posted - /// Optional: a range header to be set (default is null) - /// The request status - protected Enums.RequestStatus PostBinary(string uri, HttpContent content, RangeHeaderValue range = null) - { - try - { - var request = new HttpRequestMessage(HttpMethod.Post, uri); - request.Content = content; - request.Headers.Range = range; - var response = client.SendAsync(request).Result; - byte[] data; //dummy - return ParseBinary(response, out data); - } - catch (Exception ex) - { - _lastError = ex.ToString(); - return Enums.RequestStatus.SystemError; - } - } - #endregion - - #region Private helper methods - /// - /// Get an object of a given type from a binary content - /// - /// The type of the resulting object - /// binary content - /// Output: the resulting object - /// The request status - private Enums.RequestStatus GetObject(byte[] data, out T result) - { - string jsonString = ""; - try - { - jsonString = Encoding.UTF8.GetString(data); - result = JsonConvert.DeserializeObject(jsonString); - return Enums.RequestStatus.OK; - } - catch - { - _lastError = "Could not parse Json response: " + jsonString; - result = default(T); - return Enums.RequestStatus.SystemError; - } - - } - - /// - /// Perse a response and get its content as binary data - /// - /// The ResponseMessage object received from server - /// The resulting byte array - /// The request status - private Enums.RequestStatus ParseBinary(HttpResponseMessage response, out byte[] result) - { - result = null; - - try - { - _lastError = response.ReasonPhrase + " " + (int)response.StatusCode; - _errorBlock = null; - - result = response.Content.ReadAsByteArrayAsync().Result; - - switch (response.StatusCode) - { - case System.Net.HttpStatusCode.OK: - _lastError = ""; - return Enums.RequestStatus.OK; - - case System.Net.HttpStatusCode.NotFound: - ExtractErrorBlock(response); - return Enums.RequestStatus.NotFound; - - case System.Net.HttpStatusCode.Forbidden: - case System.Net.HttpStatusCode.Unauthorized: - ExtractErrorBlock(response); - return Enums.RequestStatus.AuthenticationError; - - case System.Net.HttpStatusCode.Accepted: - _lastError = ""; - return Enums.RequestStatus.Accepted; - - case System.Net.HttpStatusCode.Created: - _lastError = ""; - return Enums.RequestStatus.Created; - - case System.Net.HttpStatusCode.RequestEntityTooLarge: - ExtractErrorBlock(response); - return Enums.RequestStatus.OverLimits; - - default: - ExtractErrorBlock(response); - return Enums.RequestStatus.SystemError; - } - - } - catch (Exception ex) - { - _lastError = ex.ToString(); - return Enums.RequestStatus.SystemError; - } - } - - /// - /// Try to extract an error block from the response content and deserialize it - /// - /// The response message object - private void ExtractErrorBlock(HttpResponseMessage res) - { - try - { - var jsonString = res.Content.ReadAsStringAsync().Result; - _errorBlock = JsonConvert.DeserializeObject(jsonString); - } - catch - { - _errorBlock = null; - } - } - #endregion - } -} diff --git a/Interfax.ClientLib/Entities/ErrorBlock.cs b/Interfax.ClientLib/Entities/ErrorBlock.cs deleted file mode 100644 index 808d2a4..0000000 --- a/Interfax.ClientLib/Entities/ErrorBlock.cs +++ /dev/null @@ -1,23 +0,0 @@ -namespace Interfax.ClientLib.Entities -{ - /// - /// Represents detailed error reporting block - /// - public class ErrorBlock - { - /// - /// Code as returned from service - /// - public int Code; - - /// - /// The base error message - /// - public string Message; - - /// - /// Detailed information about the error - /// - public string MoreInfo; - } -} diff --git a/Interfax.ClientLib/Entities/InboundFax.cs b/Interfax.ClientLib/Entities/InboundFax.cs deleted file mode 100644 index ea27cee..0000000 --- a/Interfax.ClientLib/Entities/InboundFax.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System; - -namespace Interfax.ClientLib.Entities -{ - /// - /// Meta-data of an inbound fax - /// - public class InboundFax - { - /// - /// The ID of this transaction - /// - public int MessageID; - /// - /// The time and date that the fax was received (in GMT) - /// - public DateTime ReceiveTime; - /// - /// The Phone number at which this fax was received - /// - public String PhoneNumber; - /// - /// The caller ID of the sender - /// - public String CallerID; - /// - /// The CSID of the sender - /// - public String RemoteCSID; - /// - /// The number of pages received in this fax. - /// - public int Pages; - /// - /// Status of the fax. See the list of InterFAX Error Codes - /// - public int Status; - /// - /// The time (in seconds) that it took to receive the fax - /// - public int RecordingDuration; - } -} diff --git a/Interfax.ClientLib/Entities/OutboundDocument.cs b/Interfax.ClientLib/Entities/OutboundDocument.cs deleted file mode 100644 index 8e31f5d..0000000 --- a/Interfax.ClientLib/Entities/OutboundDocument.cs +++ /dev/null @@ -1,94 +0,0 @@ -using System; -using System.IO; - -namespace Interfax.ClientLib.Entities -{ - /// - /// Represents a single document to be faxes - /// - public abstract class OutboundDocument - { - } - - /// - /// Represents an already-uploaded document to be faxed - /// - public class LinkedOutboundDocument : OutboundDocument - { - /// - /// The uri of the uploaded document as returned by calling Upload() method - /// - public Uri UploadedDocument; - } - - /// - /// Represents a single document with inline content to be faxes - /// - public class InlineOutboundDocument : OutboundDocument - { - - private string _fileType; - private string _charSet; - private byte[] _data; - - /// - /// Constructor: Initialize with a file - /// - /// The fully qualified path to the file containing the document to be faxed - /// In case of a text (e.g Html), this should be specified - public InlineOutboundDocument(string path, string charSet = null) - : this(File.ReadAllBytes(path), Path.GetExtension(path).TrimStart('.'), charSet) - { } - - /// - /// Constructor: Initialize with a Stream - /// - /// The IO stream containing the document to be faxed - /// The type of the document to be faxed (e.g 'pdf') - /// Optional (default=true), tells the method whether to close the stream after using its data - /// In case of a text (e.g Html), this should be specified - public InlineOutboundDocument(Stream dataStream, string fileType, bool closeStream = false, string charSet = null) : - this(StreamToByteArray(dataStream,closeStream), fileType, charSet) - { } - - private static byte[] StreamToByteArray(Stream dataStream, bool closeStream = false) - { - var data = new byte[dataStream.Length - dataStream.Position]; - dataStream.Read(data, 0, data.Length); - if (closeStream) - dataStream.Close(); - return data; - } - - - /// - /// Constructor: Initialize with a byte array - /// - /// The byte-array containing the document to be faxed - /// The type of the document to be faxed (e.g 'pdf') - /// In case of a text (e.g Html), this should be specified - public InlineOutboundDocument(byte[] data, string fileType, string charSet = null) - { - _data = data; - _fileType = fileType; - _charSet = charSet; - } - - /// - /// The raw data - /// - public byte[] Data { get { return _data; } } - - - /// - /// The type of the document to be faxed. - /// The File type must be in the list of supported file types as specifies in https://www.interfax.net/en/help/supported_file_types. - /// - public string FileType { get { return _fileType; } } - - /// - /// The character set encoding (applies in case of textual content) - /// - public string CharSet { get { return _charSet; } } - } -} diff --git a/Interfax.ClientLib/Entities/OutboundFax.cs b/Interfax.ClientLib/Entities/OutboundFax.cs deleted file mode 100644 index 6741f96..0000000 --- a/Interfax.ClientLib/Entities/OutboundFax.cs +++ /dev/null @@ -1,137 +0,0 @@ -using System; - -namespace Interfax.ClientLib.Entities -{ - /// - /// Represents an outbound fax - /// - public class OutboundFaxFull : OutboundFaxSummary - { - /// - /// Page size: a4, letter, legal, or b4 - /// - public Enums.PageSize PageSize; - - /// - /// portrait or landscape - /// - public Enums.PageOrientation PageOrientation; - - /// - /// standard or fine - /// - public Enums.PageResolution Resolution; - - /// - /// greyscale or bw - /// - public Enums.PageRendering Rendering; - - /// - /// The fax header text inserted at the top of the page. - /// - public string PageHeader; - - /// - /// Time when the transaction was originally submitted. Always returned in GMT. - /// - public DateTime SubmitTime; - - /// - /// A name or other optional identifier. - /// - public string Subject; - - /// - /// The resolved fax number to which the fax was sent. - /// - public string DestinationFax; - - /// - /// Contact name provided during submission - /// - public string Contact; - - /// - /// E-mail address(es) for confirmation message. - /// - public string ReplyEmail; - - /// - /// Total number of pages submitted. - /// - public int PagesSubmitted; - - /// - /// Sender's fax ID. - /// - public string SenderCSID; - - /// - /// Maximum number of transmission attempts requested in case of fax transmission failure. - /// - public int AttemptsToPerform; - } - - /// - /// Represents an outbound fax summary information - /// - public class OutboundFaxSummary - { - /// - /// A unique identifier for the fax. - /// - public string Id; - - /// - /// A unique resource locator for the fax. - /// - public Uri Uri; - - /// - /// Fax status. Generally, 0= OK; less than 0 = in process; greater than 0 = Error (See Interfax Status Codes) - /// - public int Status; - - /// - /// The submitting user. - /// - public string UserID; - - /// - /// Number of successfully sent pages. - /// - public int PagesSent; - - /// - /// End time of last of all transmission attempts. Always returned in GMT. - /// - public DateTime CompletionTime; - - /// - /// Receiving party fax ID (up to 20 characters). - /// - public string RemoteCSID; - - /// - /// Transmission time in seconds. - /// - public int Duration; - - /// - /// For internal use. - /// - public int Priority; - - /// - /// Decimal number of units to be billed (pages or tenths of minutes) - /// - public decimal Units; - - /// - /// Monetary units, in account currency. Multiply this by 'Units' to get tde actual cost of the fax. - /// - public decimal CostPerUnit; - } - -} diff --git a/Interfax.ClientLib/Entities/UploadedDocument.cs b/Interfax.ClientLib/Entities/UploadedDocument.cs deleted file mode 100644 index 616f569..0000000 --- a/Interfax.ClientLib/Entities/UploadedDocument.cs +++ /dev/null @@ -1,54 +0,0 @@ -using System; - -namespace Interfax.ClientLib.Entities -{ - /// - /// represents a single uploaded document meta data - /// - public class UploadedDocument - { - /// - /// Username under which document was created. - /// - public String userId; - /// - /// The filename provided when the document was uploaded, e.g. newsletter.pdf - /// - public String fileName; - /// - /// The planned size in bytes of the document. - /// - public int fileSize; - /// - /// The number of bytes actually uploaded. - /// - public int uploaded; - /// - /// Fully-qualified resource URI of the document. - /// - public Uri uri; - /// - /// Time (UTC) when the document was created - /// - public DateTime creationTime; - /// - /// Time (UTC) when the document was last used - /// - public DateTime lastUsageTime; - - /// - /// Current status of the document - /// - public Enums.DocumentStatus documentStatus; - - /// - /// Document disposition definition - /// - public Enums.DocumentDisposition disposition; - - /// - /// Document sharing definition - /// - public Enums.Sharing sharing; - } -} diff --git a/Interfax.ClientLib/Enums/PageOrientation.cs b/Interfax.ClientLib/Enums/PageOrientation.cs deleted file mode 100644 index fc84935..0000000 --- a/Interfax.ClientLib/Enums/PageOrientation.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace Interfax.ClientLib.Enums -{ - /// - /// Represents supported page sizes - /// - public enum PageOrientation - { - /// - /// Portrait - /// - Portrait, - - /// - /// Landscape - /// - Landscape - } -} diff --git a/Interfax.ClientLib/Enums/PageRendering.cs b/Interfax.ClientLib/Enums/PageRendering.cs deleted file mode 100644 index f430d54..0000000 --- a/Interfax.ClientLib/Enums/PageRendering.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace Interfax.ClientLib.Enums -{ - /// - /// Represents supported page sizes - /// - public enum PageRendering - { - /// - /// Black and white; Optimized for text-intensive document - /// - Standard, - - /// - /// Grey scale; Optimized for image-intensive document - /// - Fine - } -} diff --git a/Interfax.ClientLib/Enums/PageResolution.cs b/Interfax.ClientLib/Enums/PageResolution.cs deleted file mode 100644 index 4663693..0000000 --- a/Interfax.ClientLib/Enums/PageResolution.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace Interfax.ClientLib.Enums -{ - /// - /// Represents supported page sizes - /// - public enum PageResolution - { - /// - /// High resolution (approx. 100 x 200); Optimized size and transmission time - /// - Standard, - - /// - /// High resolution (approx. 200 x 200); Better quality with higher size and transmission time - /// - High - } -} diff --git a/Interfax.ClientLib/Enums/RequestStatus.cs b/Interfax.ClientLib/Enums/RequestStatus.cs deleted file mode 100644 index 34e2ea2..0000000 --- a/Interfax.ClientLib/Enums/RequestStatus.cs +++ /dev/null @@ -1,53 +0,0 @@ -namespace Interfax.ClientLib.Enums -{ - /// - /// Status for requests - /// - public enum RequestStatus - { - /// - /// Success - /// - OK, - - /// - /// Resource created - /// - Created, - - /// - /// Request accepted, but resource is not completed - /// - Accepted, - - /// - /// Resource not found - /// - NotFound, - - /// - /// System error - /// - SystemError, - - /// - /// Request time out - /// - TimedOut, - - /// - /// Authentication error - /// - AuthenticationError, - - /// - /// Request was over limit(s) - /// - OverLimits, - - /// - /// The request has some bad input. - /// - BadParameters - } -} diff --git a/Interfax.ClientLib/Enums/Sharing.cs b/Interfax.ClientLib/Enums/Sharing.cs deleted file mode 100644 index 03a03fa..0000000 --- a/Interfax.ClientLib/Enums/Sharing.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace Interfax.ClientLib.Enums -{ - /// - /// Sharing options - /// - public enum Sharing - { - /// - /// Only owner user can access the resource - /// - Private, - - /// - /// All users in the account can access the resource - /// - Shared - } -} diff --git a/Interfax.ClientLib/InboundFax.cs b/Interfax.ClientLib/InboundFax.cs deleted file mode 100644 index c8227ed..0000000 --- a/Interfax.ClientLib/InboundFax.cs +++ /dev/null @@ -1,78 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Web; - -namespace Interfax.ClientLib -{ - /// - /// Client for the Inbound fax service - /// - public class InboundFax : Base - { - #region Constructor and private members - /// - /// Constructor - /// - /// Interfax User Id - /// Interfax password - /// Request timeout (optional, default is 30 sec.) - /// The service end point (optional). Default is live service - public InboundFax(string userId, string password, TimeSpan? timeout = null, string endPoint = null) : base("inbound",userId, password, timeout, endPoint) { } - #endregion - - #region public operational methods - /// - /// Retrieves a user's list of inbound faxes. (Sort order is always by descending ID). - /// - /// output: The list of meta data for each fax - /// Optional: Return results from this ID backwards (not including this ID). Used for pagination. //TODO: check sort order - /// Optional (default is false). Return only unread faxes? - /// Optional (default is 25). How many transactions to return. - /// Optional (default is false). For a "primary" user, determines whether to return data for the current user only or for all account users. - /// Request status - public Enums.RequestStatus GetList(out IEnumerable list, bool unreadOnly = false, int limit = 25, bool allUsers = false, int lastId = int.MaxValue) - { - var query = HttpUtility.ParseQueryString(string.Empty); - query["lastId"] = lastId.ToString(); - query["unreadOnly"] = unreadOnly.ToString(); - query["limit"] = limit.ToString(); - query["allUsers"] = allUsers.ToString(); - - return base.GetObject>("faxes?" + query.ToString(), out list); - } - - /// - /// Retrieve meta data for a specific fax - /// - /// Transaction Id - /// Output: The meta data for the fax - /// Request status - public Enums.RequestStatus GetMeta(out Entities.InboundFax meta, int id) - { - return base.GetObject("faxes/" + id.ToString(), out meta); - } - - /// - /// Retrieve Image data for a specific fax, Format is determined by the user's setting - /// - /// Transaction Id - /// Output: The image data for the fax - /// Request status - public Enums.RequestStatus GetImage(out byte[] image, int id) - { - return base.GetBinary("faxes/" + id.ToString() + "/image", out image); - } - - /// - /// Mark an image as read (or unread) - /// - /// Transaction Id - /// Optional: set false to mark as Unread - /// - public Enums.RequestStatus MarkRead(int id, bool unread = true) - { - return base.Post(string.Format("faxes/{0}/mark?unread={1}",id,unread)); - } - #endregion - } -} diff --git a/Interfax.ClientLib/OutboundDocuments.cs b/Interfax.ClientLib/OutboundDocuments.cs deleted file mode 100644 index c3e5a07..0000000 --- a/Interfax.ClientLib/OutboundDocuments.cs +++ /dev/null @@ -1,106 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Web; - -namespace Interfax.ClientLib -{ - /// - /// Represents the document upload facility for outbound faxing - /// - public class OutboundDocuments : Base - { - /// - /// Constructor - /// - /// Interfax User Id - /// Interfax password - /// Request timeout (optional, default is 30 sec.) - /// The service end point (optional). Default is live service - public OutboundDocuments(string userId, string Password, TimeSpan? timeout = null, string endPoint = null) : base("outbound", userId, Password, timeout, endPoint) { } - - /// - /// Uploads an entire document in chuncks - /// - /// Output: the Uri for the created document - /// Document data - /// - /// The document file name, which can subsequently be queried with the GetList() method. - /// The filename must end with an extension defining the file type, e.g. dailyrates.docx or newsletter.pdf, - /// and the file type must be in the list of supported file types as specifies in https://www.interfax.net/en/help/supported_file_types. - /// - /// size in bytes for data to uload in each HTTP request - /// This sets the retention policy of the uploaded document, that is, how long it can be used by the POST - /// private or shared - /// The request status - public Enums.RequestStatus Upload(out Uri location, byte[] data, string name, int chunckSize = 218*1024, Enums.DocumentDisposition disposition = Enums.DocumentDisposition.SingleUse, Enums.Sharing sharing = Enums.Sharing.Private) - { - // start an upload session - var query = HttpUtility.ParseQueryString(string.Empty); - query["size"] = data.Length.ToString(); - query["name"] = name; - query["disposition"] = disposition.ToString(); - query["sharing"] = sharing.ToString(); - - var st = base.PostAndGetLocation("documents?" + query.ToString(), out location); - - // if not created, return - if (st != Enums.RequestStatus.Created) - { - return st; - } - - // upload in chuncks - int pos = 0; - while (pos - /// Get a list of previous document uploads which are currently available. - /// - /// How many document references to return. - /// Skip this many document references in the list. - /// Output: the list of documents - /// The request status - public Enums.RequestStatus GetList(out IEnumerable list, int limit = 25, int offset = 0) - { - var query = HttpUtility.ParseQueryString(string.Empty); - query["limit"] = limit.ToString(); - query["offset"] = offset.ToString(); - return base.GetObject>("documents?" + query.ToString(), out list); - } - - /// - /// Retrieve the meta data about a document - /// - /// - /// - /// The request status - public Enums.RequestStatus GetStatus(out Entities.UploadedDocument document, string documentId) - { - return base.GetObject("documents/" + documentId, out document); - } - - /// - /// Delete an uploaded document (also cancels an uploaded document session) - /// - /// Id obtained during call to D - /// The request status - public Enums.RequestStatus Delete(string documentId) - { - return base.DeleteUri("documents/" + documentId); - } - } -} diff --git a/Interfax.ClientLib/OutboundFax.cs b/Interfax.ClientLib/OutboundFax.cs deleted file mode 100644 index aba3bae..0000000 --- a/Interfax.ClientLib/OutboundFax.cs +++ /dev/null @@ -1,391 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.IO; -using System.Web; -using System.Net.Http; - -namespace Interfax.ClientLib -{ - /// - /// Proxy class for fax outbound service - /// - public class OutboundFax : Base - { - /// - /// Constructor - /// - /// Interfax User Id - /// Interfax password - /// Request timeout (optional, default is 30 sec.) - /// The service end point (optional). Default is live service - public OutboundFax(string userId, string Password, TimeSpan? timeout = null, string endPoint = null) : base("outbound",userId, Password, timeout, endPoint) { } - - #region Fax submission - /// - /// Submit a fax containing one document from file - /// - /// A single fax number, e.g: +1-212-3456789 - /// Output: the URI of the newly-created fax resource - /// - /// The fully qualified path to the file containing the document to be faxed - /// The filename must end with an extension defining the file type, e.g. dailyrates.docx or newsletter.pdf, - /// and the file type must be in the list of supported file types as specifies in https://www.interfax.net/en/help/supported_file_types. - /// - /// In case of a text (e.g Html), this should be specified - /// The request status; If successful, a 201 Created status is returned - public Enums.RequestStatus Submit(out Uri location, string faxNumber, string path, string charSet = null) - { - using (var fs = File.OpenRead(path)) - { - return Submit(out location, faxNumber, fs, Path.GetExtension(path).TrimStart('.'), true, charSet); - } - } - - /// - /// Submit a fax containing one document from stream - /// - /// A single fax number, e.g: +1-212-3456789 - /// Output: the URI of the newly-created fax resource - /// The IO stream containing the document to be faxed - /// The type of the document to be faxed (e.g 'pdf') - /// Optional (default=true), tells the method whether to close the stream after using its data - /// In case of a text (e.g Html), this should be specified - /// The request status; If successful, a 201 Created status is returned - public Enums.RequestStatus Submit(out Uri location, string faxNumber, Stream dataStream, string fileType, bool closeStream = false, string charSet = null) - { - var data = new byte[dataStream.Length-dataStream.Position]; - dataStream.Read(data, 0, data.Length); - if (closeStream) - dataStream.Close(); - - return Submit(out location, faxNumber, data, fileType, charSet); - } - - /// - /// List of supported textual file types - /// - private static HashSet textualTypes = new HashSet(new[] { "html","txt","rtf","xml" }, StringComparer.InvariantCultureIgnoreCase); - /// - /// Submit a fax containing one document from byte array - /// - /// Output: the URI of the newly-created fax resource - /// A single fax number, e.g: +1-212-3456789 - /// The byte-array containing the document to be faxed - /// The type of the textual document to be faxed (e.g. html) - /// The request status; If successful, a 201 Created status is returned - public Enums.RequestStatus SubmitTextDocument(out Uri location, string faxNumber,string text, string fileType) - { - if (!textualTypes.Contains(fileType)) - { - location = null; - return Enums.RequestStatus.BadParameters; - } - var charSetEncoding = System.Text.Encoding.UTF8; - var data = charSetEncoding.GetBytes(text); - - return SubmitExtended(out location, faxNumber, new[] { new Entities.InlineOutboundDocument(data, fileType, charSetEncoding.WebName) }); - } - - /// - /// Submit a fax containing one document from byte array - /// - /// Output: the URI of the newly-created fax resource - /// A single fax number, e.g: +1-212-3456789 - /// The byte-array containing the document to be faxed - /// The type of the document to be faxed (e.g 'pdf') - /// In case of a text (e.g Html), this should be specified - /// The request status; If successful, a 201 Created status is returned - public Enums.RequestStatus Submit(out Uri location, string faxNumber, byte[] data, string fileType, string charSet = null) - { - return SubmitExtended(out location,faxNumber,new[] {new Entities.InlineOutboundDocument(data,fileType, charSet)}); - } - - /// - /// Submit a fax with multiple documents and extended options - /// - /// A single fax number, e.g: +1-212-3456789 - /// Output: the URI of the newly-created fax resource - /// list of documents to be faxed, in that order of pages - /// - /// A name or other reference. The entered string will appear: - /// (1) for reference in the outbound queue; - /// (2) in the outbound fax header, if headers are configured; and - /// (3) in subsequent queries of the fax object. - /// Time to schedule the transmission. - /// Number of transmission attempts to perform, in case of fax transmission failure. - /// Sender CSID (up to 20 ascii characters) - /// The fax header text to insert at the top of the page - /// Provide your internal ID to a document. This parameter can be obtained by status query, but is not included in the transmitted fax message. - /// E-mail address to which feedback messages will be sent. - /// page size - /// True to fit an image to the designated page size - /// portrait or landscape - /// Documents rendered as fine may be more readable but take longer to transmit (and may therefore be more costly). - /// Determines the rendering mode. bw is recommended for textual, black and white documents, while greyscale is better for greyscale text and for images. - /// - public Enums.RequestStatus SubmitExtended( - out Uri location, - string faxNumber, - IEnumerable documents, - string contact = null, - DateTime? postponeTime = null, - int? retriesToPerform = null, - string csid = null, - string pageHeader = null, - string reference = null, - string replyAddress = null, - Enums.PageSize? pageSize = null, - bool? fitToPage = null, - Enums.PageOrientation? pageOrientation = null, - Enums.PageResolution? resolution = null, - Enums.PageRendering? rendering = null - ) - { - location = null; - if (documents == null || documents.Count() == 0) - return Enums.RequestStatus.BadParameters; - - HttpContent content; - if (documents.Count() == 1) - { - // a simple case - just create the content for the single document - content = MakeContent(documents.First()); - } - else - { - // create a multi-part content and populate it - content = new MultipartContent(); - foreach (var doc in documents) - { - HttpContent docContent = MakeContent(doc); - ((MultipartContent)content).Add(docContent); - } - } - - // construct uri from parameters - var query = HttpUtility.ParseQueryString(string.Empty); - query["faxNumber"] = faxNumber; - - if (!string.IsNullOrEmpty(contact)) - query["contact"] = contact; - - if (postponeTime.HasValue) - query["postponeTime"] = postponeTime.Value.ToString("s"); - - if (retriesToPerform.HasValue) - query["retriesToPerform"] = retriesToPerform.Value.ToString(); - - if (!string.IsNullOrEmpty(csid)) - query["csid"] = csid; - - if (!string.IsNullOrEmpty(pageHeader)) - query["pageHeader"] = pageHeader; - - if (!string.IsNullOrEmpty(reference)) - query["reference"] = reference; - - if (!string.IsNullOrEmpty(replyAddress)) - query["replyAddress"] = replyAddress; - - if (pageSize.HasValue) - query["pageSize"] = pageSize.ToString(); - - if (fitToPage.HasValue) - query["fitToPage"] = (fitToPage.Value) ? "scale" : "noscale"; - - if (pageOrientation.HasValue) - query["pageOrientation"] = pageOrientation.ToString(); - - if (resolution.HasValue) - query["resolution"] = resolution.ToString(); - - if (rendering.HasValue) - query["rendering"] = rendering.ToString(); - - return base.PostAndGetLocation("faxes?" + query.ToString(), out location, content); - } - - /// - /// Create an Http content out of an abstract OutboundDocument - /// - /// The OutboundDocument to fax - /// Http Content - private ByteArrayContent MakeContent(Entities.OutboundDocument document) - { - ByteArrayContent content = null; - if (document.GetType() == typeof(Entities.InlineOutboundDocument)) - { - var inlineDoc = (Entities.InlineOutboundDocument)document; - // create the inline content - content = new ByteArrayContent(inlineDoc.Data); - content.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue(Utils.MediaTypeFinder.GetMediaType(inlineDoc.FileType)); - content.Headers.ContentType.CharSet = inlineDoc.CharSet; - } - else if (document.GetType() == typeof(Entities.LinkedOutboundDocument)) - { - var uploadedDoc = (Entities.LinkedOutboundDocument)document; - // create an empty content - content = new ByteArrayContent(new byte[0]); - // add the link to the uploaded document - content.Headers.ContentLocation = uploadedDoc.UploadedDocument; - } - - return content; - } - #endregion - - #region Queries - /// - /// Get a list of recent outbound faxes (which does not include batch faxes). - /// - /// Output: the returned list - /// (optional) Return results from this ID onwards (not including this ID). Used for pagination. - /// If not provided, MaxValue is set when sortOrder is descending; zero when sortOrder is ascending. - /// (Optional) How many transactions to return. - /// Set to false for ascending order - /// (Optional, Default is Current user provided in credentials). Enables a "primary" user to query for other account users' faxes. - /// The request status - public Enums.RequestStatus GetList(out IEnumerable list, string lastId = null, int limit = 25, bool descendingOrder = true, string userId = null) - { - var query = HttpUtility.ParseQueryString(string.Empty); - query["lastId"] = (lastId==null)? ((descendingOrder)? long.MaxValue : 0).ToString() : lastId; - query["sortOrder"] = (descendingOrder) ? "desc":"asc"; - query["limit"] = limit.ToString(); - query["userId"] = userId; - - return base.GetObject>("faxes?" + query.ToString(), out list); - } - - /// - /// Get details for a subset of completed faxes from a submitted list. (Submitted id's which have not completed are ignored). - /// - /// Output: the returned list - /// List of transactions to query - /// The request status - public Enums.RequestStatus GetCompleted(out IEnumerable list, IEnumerable Ids) - { - var query = HttpUtility.ParseQueryString(string.Empty); - query["ids"] = string.Join(",", Ids); - return base.GetObject>("faxes/completed?" + query.ToString(), out list); - } - - /// - /// Retrieves information regarding a previously-submitted fax, including its current status. - /// - /// The - /// The transaction ID of the fax for which to retrieve data. - /// The request status - public Enums.RequestStatus GetStatus(out Entities.OutboundFaxFull meta, string id) - { - return base.GetObject("faxes/" + HttpUtility.UrlEncode(id), out meta); - } - - /// - /// Retrieve the fax image (TIFF file) of a submitted fax. - /// - /// If successful, the response returns a TIFF file (image/tiff) of the outgoing fax image. - /// The transaction ID of the fax for which to retrieve data. - /// The request status - public Enums.RequestStatus GetImage(out byte[] data, string id) - { - return base.GetBinary("faxes/" + HttpUtility.UrlEncode(id) + "/image",out data); - } - - /// - /// Search outbound faxes - /// - /// Output: the returned list - /// (Optional, default is no restriction) List of fax IDs - /// (Optional, default is no restriction) The 'reference' parameter entered at submit time - /// (Optional, default is no restriction) Lower bound of date range from which to return faxes (GMT) - /// (Optional, default is no restriction) Upper bound of date range frrom which to return faxes - /// (Optional, default is 'All') The status family of faxes to return - /// Must be used in case the statusFamily is set to 'Specific' - /// (Optional, default is no restriction) Limit returned faxes to these user ID's. This parameter has effect only when the querying username is a "primary" user. - /// (Optional, default is no restriction) Limit returned faxes to this destination fax number. - /// Set to false for ascending order - /// (Optional) How many transactions to return. - /// (Optional) Skip this many records - /// The request status - public Enums.RequestStatus Search(out IEnumerable list, - IEnumerable ids = null, - string reference = null, - DateTime? dateFrom = null, - DateTime? dateTo = null, - Enums.StatusFamily? statusFamily = Enums.StatusFamily.All, - int status = int.MinValue, - string userId = null, - string faxNumber = null, - bool descendingOrder = true, - int offset = 0, - int limit = 25 - ) - { - var query = HttpUtility.ParseQueryString(string.Empty); - if (ids != null && ids.Count() > 0) - query["ids"] = string.Join(",",ids); - - if (!string.IsNullOrEmpty(reference)) - query["reference"] = reference; - - if (dateFrom.HasValue) - query["dateFrom"] = dateFrom.Value.ToString("s"); - - if (dateTo.HasValue) - query["dateTo"] = dateTo.Value.ToString("s"); - - // set status - if (statusFamily.HasValue) - { - query["status"] = (statusFamily == Enums.StatusFamily.Specific)? status.ToString() : statusFamily.ToString(); - } - - if (!string.IsNullOrEmpty(userId)) - query["userId"] = userId; - - if (!string.IsNullOrEmpty(faxNumber)) - query["faxNumber"] = faxNumber; - - query["sortOrder"] = (descendingOrder) ? "desc" : "asc"; - query["limit"] = limit.ToString(); - query["offset"] = offset.ToString(); - return base.GetObject>("search?" + query.ToString(), out list); - } - #endregion - - #region Other operational methods - /// - /// Cancel a fax in progress. - /// - /// ID of the fax to be cancelled. - /// The request status - public Enums.RequestStatus CancelFax(string id) - { - return base.Post("faxes/" + HttpUtility.UrlEncode(id) + "/cancel" ) ; - } - - /// - /// The resent fax is allocated a new transaction ID. - /// - /// Output: the URI of the newly-created fax resource - /// ID of the fax to be cancelled. - /// A single fax number, e.g: +1-212-3456789 - /// The request status - public Enums.RequestStatus ResendFax(out Uri location, string id, string faxNumber) - { - return base.PostAndGetLocation("faxes/" + HttpUtility.UrlEncode(id) + "/resend", out location); - } - - /// - /// Hide a fax from listing in queries (there is no way to unhide a fax). - /// - /// - /// - public Enums.RequestStatus HideFax(string id) - { - return base.Post("faxes/" + HttpUtility.UrlEncode(id) + "/hide"); - } - #endregion - } -} diff --git a/Interfax.ClientLib/Utils/MediaTypeFinder.cs b/Interfax.ClientLib/Utils/MediaTypeFinder.cs deleted file mode 100644 index eaf80b1..0000000 --- a/Interfax.ClientLib/Utils/MediaTypeFinder.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Xml; - -namespace Interfax.ClientLib.Utils -{ - /// - /// Helper - get media type by file type - /// - public class MediaTypeFinder - { - private static Dictionary _mapping = new Dictionary(StringComparer.InvariantCultureIgnoreCase); - - /// - /// Static constructor - load xml into a dictionary - /// - static MediaTypeFinder() - { - var doc = new XmlDocument(); - var assembly = System.Reflection.Assembly.GetExecutingAssembly(); - var st = assembly.GetManifestResourceStream(assembly.GetName().Name + ".Utils.MediaTypes.xml"); - doc.Load(st); - - var mappings = doc.GetElementsByTagName("MediaTypeMapping"); - - //iterate all and load to dictionary - foreach (XmlNode node in mappings) - { - var element = (XmlElement)node; - var fileType = element.GetElementsByTagName("FileType")[0].InnerText; - if (_mapping.ContainsKey(fileType)) - continue; // ignore duplicates - var mediaType = element.GetElementsByTagName("MediaType")[0].InnerText; - _mapping.Add(fileType, mediaType); - } - - } - - /// - /// Get media type by file type - /// - /// file type - /// media type - public static string GetMediaType(string fileType) - { - if (_mapping.ContainsKey(fileType)) - return _mapping[fileType]; - return "application/octet-stream"; // default for any unknown file type - } - } -} diff --git a/Interfax.ClientLib/Utils/MediaTypes.xml b/Interfax.ClientLib/Utils/MediaTypes.xml deleted file mode 100644 index 359cfb1..0000000 --- a/Interfax.ClientLib/Utils/MediaTypes.xml +++ /dev/null @@ -1,101 +0,0 @@ - - - - application/rtf - rtf - - - application/pdf - pdf - - - application/postscript - ps - - - application/zip - zip - - - image/gif - gif - - - image/jpeg - jpeg - - - image/png - png - - - image/tiff - tiff - - - image/tiff - tif - - - text/html - html - - - text/plain - txt - - - application/msword - doc - - - application/vnd.ms-excel - xls - - - application/vnd.ms-powerpoint - ppt - - - - application/vnd.openxmlformats-officedocument.wordprocessingml.document - - docx - - - - application/vnd.openxmlformats-officedocument.presentationml.presentation - - pptx - - - - application/vnd.openxmlformats-officedocument.spreadsheetml.sheet - - xlsx - - - application/vnd.oasis.opendocument.text - odt - - - application/vnd.oasis.opendocument.spreadsheet - ods - - - application/vnd.oasis.opendocument.presentation - odp - - - application/vnd.oasis.opendocument.graphics - odg - - - application/vnd.oasis.opendocument.text-master - odm - - - message/rfc822 - mht - - \ No newline at end of file diff --git a/Interfax.ClientLib/bin/Debug/Interfax.ClientLib.XML b/Interfax.ClientLib/bin/Debug/Interfax.ClientLib.XML deleted file mode 100644 index ee0bf13..0000000 --- a/Interfax.ClientLib/bin/Debug/Interfax.ClientLib.XML +++ /dev/null @@ -1,985 +0,0 @@ - - - - Interfax.ClientLib - - - - - Represents Accounts service - - - - - Base class for services classes - - - - - Constructor - - The base path for the specific service - Interfax User Id - Interfax password - Request timeout (optional, default is 30 sec.) - The service end point (optional). Default is live service - - - - The Http client to use - - - - - Send a Get request and populate a response to a .NET object of a given type - - Type of result - Request Uri - Output: the resulting object - The request status - - - - Send a Get request and populate a binary response - - Request Uri - Output: the resulting binary data - The request status - - - - Send a POST request with content of a given type and populate a response on another type - - Type of input - Type of result - Request Uri - Input object - Output: the resulting object - The request status - - - - Send a POST request with no content and no returned object - - Request Uri - The request status - - - - Send a POST request with no content and no returned object - - Request Uri - Output: The value in the Locationn Http header - Optional: the content to be posted - The request status - - - - Send a POST request with binary content and no returned object - - Request Uri - Binary data to be sent - The request status - - - - Send a POST request with binary content and no returned object - - Request Uri - Binary data to be sent - position in data to start transfer from - Number of bytes from offset to transfer - The request status - - - - Sends a Delete Http request to a given Uri - - the Uri - The request status - - - - Send a POST request with binary content and no returned object - - Request Uri - Content to be posted - Optional: a range header to be set (default is null) - The request status - - - - Get an object of a given type from a binary content - - The type of the resulting object - binary content - Output: the resulting object - The request status - - - - Perse a response and get its content as binary data - - The ResponseMessage object received from server - The resulting byte array - The request status - - - - Try to extract an error block from the response content and deserialize it - - The response message object - - - - Error message of last operation - - - - - Detailed error block of last operation - - - - - Constructor - - Interfax User Id - Interfax password - Request timeout (optional, default is 30 sec.) - The service end point (optional). Default is live service - - - - Determine the remaining faxing credits in your account (in the account's currency). - - The found balance - Request status - - - - Represents detailed error reporting block - - - - - Code as returned from service - - - - - The base error message - - - - - Detailed information about the error - - - - - Meta-data of an inbound fax - - - - - The ID of this transaction - - - - - The time and date that the fax was received (in GMT) - - - - - The Phone number at which this fax was received - - - - - The caller ID of the sender - - - - - The CSID of the sender - - - - - The number of pages received in this fax. - - - - - Status of the fax. See the list of InterFAX Error Codes - - - - - The time (in seconds) that it took to receive the fax - - - - - Represents a single document to be faxes - - - - - Represents an already-uploaded document to be faxed - - - - - The uri of the uploaded document as returned by calling Upload() method - - - - - Represents a single document with inline content to be faxes - - - - - Constructor: Initialize with a file - - The fully qualified path to the file containing the document to be faxed - In case of a text (e.g Html), this should be specified - - - - Constructor: Initialize with a Stream - - The IO stream containing the document to be faxed - The type of the document to be faxed (e.g 'pdf') - Optional (default=true), tells the method whether to close the stream after using its data - In case of a text (e.g Html), this should be specified - - - - Constructor: Initialize with a byte array - - The byte-array containing the document to be faxed - The type of the document to be faxed (e.g 'pdf') - In case of a text (e.g Html), this should be specified - - - - The raw data - - - - - The type of the document to be faxed. - The File type must be in the list of supported file types as specifies in https://www.interfax.net/en/help/supported_file_types. - - - - - The character set encoding (applies in case of textual content) - - - - - Represents an outbound fax - - - - - Represents an outbound fax summary information - - - - - A unique identifier for the fax. - - - - - A unique resource locator for the fax. - - - - - Fax status. Generally, 0= OK; less than 0 = in process; greater than 0 = Error (See Interfax Status Codes) - - - - - The submitting user. - - - - - Number of successfully sent pages. - - - - - End time of last of all transmission attempts. Always returned in GMT. - - - - - Receiving party fax ID (up to 20 characters). - - - - - Transmission time in seconds. - - - - - For internal use. - - - - - Decimal number of units to be billed (pages or tenths of minutes) - - - - - Monetary units, in account currency. Multiply this by 'Units' to get tde actual cost of the fax. - - - - - Page size: a4, letter, legal, or b4 - - - - - portrait or landscape - - - - - standard or fine - - - - - greyscale or bw - - - - - The fax header text inserted at the top of the page. - - - - - Time when the transaction was originally submitted. Always returned in GMT. - - - - - A name or other optional identifier. - - - - - The resolved fax number to which the fax was sent. - - - - - Contact name provided during submission - - - - - E-mail address(es) for confirmation message. - - - - - Total number of pages submitted. - - - - - Sender's fax ID. - - - - - Maximum number of transmission attempts requested in case of fax transmission failure. - - - - - represents a single uploaded document meta data - - - - - Username under which document was created. - - - - - The filename provided when the document was uploaded, e.g. newsletter.pdf - - - - - The planned size in bytes of the document. - - - - - The number of bytes actually uploaded. - - - - - Fully-qualified resource URI of the document. - - - - - Time (UTC) when the document was created - - - - - Time (UTC) when the document was last used - - - - - Current status of the document - - - - - Document disposition definition - - - - - Document sharing definition - - - - - Upload documents disposition - - - - - can be used once - - - - - deleted 60 minutes after the last usage - - - - - remains available until specifically removed by user - - - - - Document upload status - - - - - Upload session was started, but no data has been uploaded - - - - - Upload session was started, and some (not complete) data has been uploaded - - - - - Data upload is in progress - - - - - Document is ready to be used - - - - - Document is being deleted - - - - - Represents supported page sizes - - - - - High resolution (approx. 100 x 200); Optimized size and transmission time - - - - - High resolution (approx. 200 x 200); Better quality with higher size and transmission time - - - - - Represents supported page sizes - - - - - Black and white; Optimized for text-intensive document - - - - - Grey scale; Optimized for image-intensive document - - - - - Represents supported page sizes - - - - - Portrait - - - - - Landscape - - - - - Represents supported page sizes - - - - - A4 page size (common outside North America) - - - - - Letter page size (common in North America) - - - - - Legal page size (common in North America) - - - - - B4 page size (used mainly in Japan) - - - - - Status for requests - - - - - Success - - - - - Resource created - - - - - Request accepted, but resource is not completed - - - - - Resource not found - - - - - System error - - - - - Request time out - - - - - Authentication error - - - - - Request was over limit(s) - - - - - The request has some bad input. - - - - - Sharing options - - - - - Only owner user can access the resource - - - - - All users in the account can access the resource - - - - - Defines groups of statuses - - - - - any status - - - - - A specific status - - - - - Completed faxes, whether successful or failed - - - - - successfully-completed faxes - - - - - failed faxes - - - - - faxes in process (not completed) - - - - - Client for the Inbound fax service - - - - - Constructor - - Interfax User Id - Interfax password - Request timeout (optional, default is 30 sec.) - The service end point (optional). Default is live service - - - - Retrieves a user's list of inbound faxes. (Sort order is always by descending ID). - - output: The list of meta data for each fax - Optional: Return results from this ID backwards (not including this ID). Used for pagination. //TODO: check sort order - Optional (default is false). Return only unread faxes? - Optional (default is 25). How many transactions to return. - Optional (default is false). For a "primary" user, determines whether to return data for the current user only or for all account users. - Request status - - - - Retrieve meta data for a specific fax - - Transaction Id - Output: The meta data for the fax - Request status - - - - Retrieve Image data for a specific fax, Format is determined by the user's setting - - Transaction Id - Output: The image data for the fax - Request status - - - - Mark an image as read (or unread) - - Transaction Id - Optional: set false to mark as Unread - - - - - Represents the document upload facility for outbound faxing - - - - - Constructor - - Interfax User Id - Interfax password - Request timeout (optional, default is 30 sec.) - The service end point (optional). Default is live service - - - - Uploads an entire document in chuncks - - Output: the Uri for the created document - Document data - - The document file name, which can subsequently be queried with the GetList() method. - The filename must end with an extension defining the file type, e.g. dailyrates.docx or newsletter.pdf, - and the file type must be in the list of supported file types as specifies in https://www.interfax.net/en/help/supported_file_types. - - size in bytes for data to uload in each HTTP request - This sets the retention policy of the uploaded document, that is, how long it can be used by the POST - private or shared - The request status - - - - Get a list of previous document uploads which are currently available. - - How many document references to return. - Skip this many document references in the list. - Output: the list of documents - The request status - - - - Retrieve the meta data about a document - - - - The request status - - - - Delete an uploaded document (also cancels an uploaded document session) - - Id obtained during call to D - The request status - - - - Proxy class for fax outbound service - - - - - Constructor - - Interfax User Id - Interfax password - Request timeout (optional, default is 30 sec.) - The service end point (optional). Default is live service - - - - Submit a fax containing one document from file - - A single fax number, e.g: +1-212-3456789 - Output: the URI of the newly-created fax resource - - The fully qualified path to the file containing the document to be faxed - The filename must end with an extension defining the file type, e.g. dailyrates.docx or newsletter.pdf, - and the file type must be in the list of supported file types as specifies in https://www.interfax.net/en/help/supported_file_types. - - In case of a text (e.g Html), this should be specified - The request status; If successful, a 201 Created status is returned - - - - Submit a fax containing one document from stream - - A single fax number, e.g: +1-212-3456789 - Output: the URI of the newly-created fax resource - The IO stream containing the document to be faxed - The type of the document to be faxed (e.g 'pdf') - Optional (default=true), tells the method whether to close the stream after using its data - In case of a text (e.g Html), this should be specified - The request status; If successful, a 201 Created status is returned - - - - List of supported textual file types - - - - - Submit a fax containing one document from byte array - - Output: the URI of the newly-created fax resource - A single fax number, e.g: +1-212-3456789 - The byte-array containing the document to be faxed - The type of the textual document to be faxed (e.g. html) - The request status; If successful, a 201 Created status is returned - - - - Submit a fax containing one document from byte array - - Output: the URI of the newly-created fax resource - A single fax number, e.g: +1-212-3456789 - The byte-array containing the document to be faxed - The type of the document to be faxed (e.g 'pdf') - In case of a text (e.g Html), this should be specified - The request status; If successful, a 201 Created status is returned - - - - Submit a fax with multiple documents and extended options - - A single fax number, e.g: +1-212-3456789 - Output: the URI of the newly-created fax resource - list of documents to be faxed, in that order of pages - - A name or other reference. The entered string will appear: - (1) for reference in the outbound queue; - (2) in the outbound fax header, if headers are configured; and - (3) in subsequent queries of the fax object. - Time to schedule the transmission. - Number of transmission attempts to perform, in case of fax transmission failure. - Sender CSID (up to 20 ascii characters) - The fax header text to insert at the top of the page - Provide your internal ID to a document. This parameter can be obtained by status query, but is not included in the transmitted fax message. - E-mail address to which feedback messages will be sent. - page size - True to fit an image to the designated page size - portrait or landscape - Documents rendered as fine may be more readable but take longer to transmit (and may therefore be more costly). - Determines the rendering mode. bw is recommended for textual, black and white documents, while greyscale is better for greyscale text and for images. - - - - - Create an Http content out of an abstract OutboundDocument - - The OutboundDocument to fax - Http Content - - - - Get a list of recent outbound faxes (which does not include batch faxes). - - Output: the returned list - (optional) Return results from this ID onwards (not including this ID). Used for pagination. - If not provided, MaxValue is set when sortOrder is descending; zero when sortOrder is ascending. - (Optional) How many transactions to return. - Set to false for ascending order - (Optional, Default is Current user provided in credentials). Enables a "primary" user to query for other account users' faxes. - The request status - - - - Get details for a subset of completed faxes from a submitted list. (Submitted id's which have not completed are ignored). - - Output: the returned list - List of transactions to query - The request status - - - - Retrieves information regarding a previously-submitted fax, including its current status. - - The - The transaction ID of the fax for which to retrieve data. - The request status - - - - Retrieve the fax image (TIFF file) of a submitted fax. - - If successful, the response returns a TIFF file (image/tiff) of the outgoing fax image. - The transaction ID of the fax for which to retrieve data. - The request status - - - - Search outbound faxes - - Output: the returned list - (Optional, default is no restriction) List of fax IDs - (Optional, default is no restriction) The 'reference' parameter entered at submit time - (Optional, default is no restriction) Lower bound of date range from which to return faxes (GMT) - (Optional, default is no restriction) Upper bound of date range frrom which to return faxes - (Optional, default is 'All') The status family of faxes to return - Must be used in case the statusFamily is set to 'Specific' - (Optional, default is no restriction) Limit returned faxes to these user ID's. This parameter has effect only when the querying username is a "primary" user. - (Optional, default is no restriction) Limit returned faxes to this destination fax number. - Set to false for ascending order - (Optional) How many transactions to return. - (Optional) Skip this many records - The request status - - - - Cancel a fax in progress. - - ID of the fax to be cancelled. - The request status - - - - The resent fax is allocated a new transaction ID. - - Output: the URI of the newly-created fax resource - ID of the fax to be cancelled. - A single fax number, e.g: +1-212-3456789 - The request status - - - - Hide a fax from listing in queries (there is no way to unhide a fax). - - - - - - - Helper - get media type by file type - - - - - Static constructor - load xml into a dictionary - - - - - Get media type by file type - - file type - media type - - - diff --git a/Interfax.ClientLib/bin/Debug/Interfax.ClientLib.pdb b/Interfax.ClientLib/bin/Debug/Interfax.ClientLib.pdb deleted file mode 100644 index cdcc24d..0000000 Binary files a/Interfax.ClientLib/bin/Debug/Interfax.ClientLib.pdb and /dev/null differ diff --git a/Interfax.ClientLib/bin/Debug/Newtonsoft.Json.xml b/Interfax.ClientLib/bin/Debug/Newtonsoft.Json.xml deleted file mode 100644 index 4975984..0000000 --- a/Interfax.ClientLib/bin/Debug/Newtonsoft.Json.xml +++ /dev/null @@ -1,8488 +0,0 @@ - - - - Newtonsoft.Json - - - - - Represents a reader that provides fast, non-cached, forward-only access to serialized Json data. - - - - - Represents a reader that provides fast, non-cached, forward-only access to serialized Json data. - - - - - Initializes a new instance of the class with the specified . - - - - - Reads the next JSON token from the stream. - - true if the next token was read successfully; false if there are no more tokens to read. - - - - Reads the next JSON token from the stream as a . - - A . This method will return null at the end of an array. - - - - Reads the next JSON token from the stream as a . - - A . This method will return null at the end of an array. - - - - Reads the next JSON token from the stream as a . - - A or a null reference if the next JSON token is null. This method will return null at the end of an array. - - - - Reads the next JSON token from the stream as a . - - A . This method will return null at the end of an array. - - - - Reads the next JSON token from the stream as a . - - A . This method will return null at the end of an array. - - - - Reads the next JSON token from the stream as a . - - A . This method will return null at the end of an array. - - - - Skips the children of the current token. - - - - - Sets the current token. - - The new token. - - - - Sets the current token and value. - - The new token. - The value. - - - - Sets the state based on current token type. - - - - - Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. - - - - - Releases unmanaged and - optionally - managed resources - - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - - Changes the to Closed. - - - - - Gets the current reader state. - - The current reader state. - - - - Gets or sets a value indicating whether the underlying stream or - should be closed when the reader is closed. - - - true to close the underlying stream or when - the reader is closed; otherwise false. The default is true. - - - - - Gets or sets a value indicating whether multiple pieces of JSON content can - be read from a continuous stream without erroring. - - - true to support reading multiple pieces of JSON content; otherwise false. The default is false. - - - - - Gets the quotation mark character used to enclose the value of a string. - - - - - Get or set how time zones are handling when reading JSON. - - - - - Get or set how date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed when reading JSON. - - - - - Get or set how floating point numbers, e.g. 1.0 and 9.9, are parsed when reading JSON text. - - - - - Get or set how custom date formatted strings are parsed when reading JSON. - - - - - Gets or sets the maximum depth allowed when reading JSON. Reading past this depth will throw a . - - - - - Gets the type of the current JSON token. - - - - - Gets the text value of the current JSON token. - - - - - Gets The Common Language Runtime (CLR) type for the current JSON token. - - - - - Gets the depth of the current token in the JSON document. - - The depth of the current token in the JSON document. - - - - Gets the path of the current JSON token. - - - - - Gets or sets the culture used when reading JSON. Defaults to . - - - - - Specifies the state of the reader. - - - - - The Read method has not been called. - - - - - The end of the file has been reached successfully. - - - - - Reader is at a property. - - - - - Reader is at the start of an object. - - - - - Reader is in an object. - - - - - Reader is at the start of an array. - - - - - Reader is in an array. - - - - - The Close method has been called. - - - - - Reader has just read a value. - - - - - Reader is at the start of a constructor. - - - - - Reader in a constructor. - - - - - An error occurred that prevents the read operation from continuing. - - - - - The end of the file has been reached successfully. - - - - - Initializes a new instance of the class. - - The stream. - - - - Initializes a new instance of the class. - - The reader. - - - - Initializes a new instance of the class. - - The stream. - if set to true the root object will be read as a JSON array. - The used when reading values from BSON. - - - - Initializes a new instance of the class. - - The reader. - if set to true the root object will be read as a JSON array. - The used when reading values from BSON. - - - - Reads the next JSON token from the stream as a . - - - A or a null reference if the next JSON token is null. This method will return null at the end of an array. - - - - - Reads the next JSON token from the stream as a . - - A . This method will return null at the end of an array. - - - - Reads the next JSON token from the stream as a . - - A . This method will return null at the end of an array. - - - - Reads the next JSON token from the stream as a . - - A . This method will return null at the end of an array. - - - - Reads the next JSON token from the stream as a . - - A . This method will return null at the end of an array. - - - - Reads the next JSON token from the stream as a . - - - A . This method will return null at the end of an array. - - - - - Reads the next JSON token from the stream. - - - true if the next token was read successfully; false if there are no more tokens to read. - - - - - Changes the to Closed. - - - - - Gets or sets a value indicating whether binary data reading should compatible with incorrect Json.NET 3.5 written binary. - - - true if binary data reading will be compatible with incorrect Json.NET 3.5 written binary; otherwise, false. - - - - - Gets or sets a value indicating whether the root object will be read as a JSON array. - - - true if the root object will be read as a JSON array; otherwise, false. - - - - - Gets or sets the used when reading values from BSON. - - The used when reading values from BSON. - - - - Represents a writer that provides a fast, non-cached, forward-only way of generating JSON data. - - - - - Represents a writer that provides a fast, non-cached, forward-only way of generating Json data. - - - - - Creates an instance of the JsonWriter class. - - - - - Flushes whatever is in the buffer to the underlying streams and also flushes the underlying stream. - - - - - Closes this stream and the underlying stream. - - - - - Writes the beginning of a Json object. - - - - - Writes the end of a Json object. - - - - - Writes the beginning of a Json array. - - - - - Writes the end of an array. - - - - - Writes the start of a constructor with the given name. - - The name of the constructor. - - - - Writes the end constructor. - - - - - Writes the property name of a name/value pair on a JSON object. - - The name of the property. - - - - Writes the property name of a name/value pair on a JSON object. - - The name of the property. - A flag to indicate whether the text should be escaped when it is written as a JSON property name. - - - - Writes the end of the current Json object or array. - - - - - Writes the current token and its children. - - The to read the token from. - - - - Writes the current token. - - The to read the token from. - A flag indicating whether the current token's children should be written. - - - - Writes the specified end token. - - The end token to write. - - - - Writes indent characters. - - - - - Writes the JSON value delimiter. - - - - - Writes an indent space. - - - - - Writes a null value. - - - - - Writes an undefined value. - - - - - Writes raw JSON without changing the writer's state. - - The raw JSON to write. - - - - Writes raw JSON where a value is expected and updates the writer's state. - - The raw JSON to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - An error will raised if the value cannot be written as a single JSON token. - - The value to write. - - - - Writes out a comment /*...*/ containing the specified text. - - Text to place inside the comment. - - - - Writes out the given white space. - - The string of white space characters. - - - - Sets the state of the JsonWriter, - - The JsonToken being written. - The value being written. - - - - Gets or sets a value indicating whether the underlying stream or - should be closed when the writer is closed. - - - true to close the underlying stream or when - the writer is closed; otherwise false. The default is true. - - - - - Gets the top. - - The top. - - - - Gets the state of the writer. - - - - - Gets the path of the writer. - - - - - Indicates how JSON text output is formatted. - - - - - Get or set how dates are written to JSON text. - - - - - Get or set how time zones are handling when writing JSON text. - - - - - Get or set how strings are escaped when writing JSON text. - - - - - Get or set how special floating point numbers, e.g. , - and , - are written to JSON text. - - - - - Get or set how and values are formatting when writing JSON text. - - - - - Gets or sets the culture used when writing JSON. Defaults to . - - - - - Initializes a new instance of the class. - - The stream. - - - - Initializes a new instance of the class. - - The writer. - - - - Flushes whatever is in the buffer to the underlying streams and also flushes the underlying stream. - - - - - Writes the end. - - The token. - - - - Writes out a comment /*...*/ containing the specified text. - - Text to place inside the comment. - - - - Writes the start of a constructor with the given name. - - The name of the constructor. - - - - Writes raw JSON. - - The raw JSON to write. - - - - Writes raw JSON where a value is expected and updates the writer's state. - - The raw JSON to write. - - - - Writes the beginning of a Json array. - - - - - Writes the beginning of a Json object. - - - - - Writes the property name of a name/value pair on a Json object. - - The name of the property. - - - - Closes this stream and the underlying stream. - - - - - Writes a value. - An error will raised if the value cannot be written as a single JSON token. - - The value to write. - - - - Writes a null value. - - - - - Writes an undefined value. - - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value that represents a BSON object id. - - The Object ID value to write. - - - - Writes a BSON regex. - - The regex pattern. - The regex options. - - - - Gets or sets the used when writing values to BSON. - When set to no conversion will occur. - - The used when writing values to BSON. - - - - Represents a BSON Oid (object id). - - - - - Initializes a new instance of the class. - - The Oid value. - - - - Gets or sets the value of the Oid. - - The value of the Oid. - - - - Converts a binary value to and from a base 64 string value. - - - - - Converts an object to and from JSON. - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Gets the of the JSON produced by the JsonConverter. - - The of the JSON produced by the JsonConverter. - - - - Gets a value indicating whether this can read JSON. - - true if this can read JSON; otherwise, false. - - - - Gets a value indicating whether this can write JSON. - - true if this can write JSON; otherwise, false. - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Converts a to and from JSON. - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Determines whether this instance can convert the specified value type. - - Type of the value. - - true if this instance can convert the specified value type; otherwise, false. - - - - - Converts a to and from JSON. - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Determines whether this instance can convert the specified value type. - - Type of the value. - - true if this instance can convert the specified value type; otherwise, false. - - - - - Create a custom object - - The object type to convert. - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Creates an object which will then be populated by the serializer. - - Type of the object. - The created object. - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Gets a value indicating whether this can write JSON. - - - true if this can write JSON; otherwise, false. - - - - - Provides a base class for converting a to and from JSON. - - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Converts a F# discriminated union type to and from JSON. - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Converts an Entity Framework EntityKey to and from JSON. - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Converts an ExpandoObject to and from JSON. - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Gets a value indicating whether this can write JSON. - - - true if this can write JSON; otherwise, false. - - - - - Converts a to and from JSON. - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Converts a to and from JSON and BSON. - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Converts a to and from JSON and BSON. - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Converts an to and from its name string value. - - - - - Initializes a new instance of the class. - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Gets or sets a value indicating whether the written enum text should be camel case. - - true if the written enum text will be camel case; otherwise, false. - - - - Gets or sets a value indicating whether integer values are allowed. - - true if integers are allowed; otherwise, false. - - - - Specifies how constructors are used when initializing objects during deserialization by the . - - - - - First attempt to use the public default constructor, then fall back to single paramatized constructor, then the non-public default constructor. - - - - - Json.NET will use a non-public default constructor before falling back to a paramatized constructor. - - - - - Converts a to and from a string (e.g. "1.2.3.4"). - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing property value of the JSON that is being converted. - The calling serializer. - The object value. - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Specifies float format handling options when writing special floating point numbers, e.g. , - and with . - - - - - Write special floating point values as strings in JSON, e.g. "NaN", "Infinity", "-Infinity". - - - - - Write special floating point values as symbols in JSON, e.g. NaN, Infinity, -Infinity. - Note that this will produce non-valid JSON. - - - - - Write special floating point values as the property's default value in JSON, e.g. 0.0 for a property, null for a property. - - - - - Specifies how floating point numbers, e.g. 1.0 and 9.9, are parsed when reading JSON text. - - - - - Floating point numbers are parsed to . - - - - - Floating point numbers are parsed to . - - - - - Instructs the how to serialize the collection. - - - - - Instructs the how to serialize the object. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class with the specified container Id. - - The container Id. - - - - Gets or sets the id. - - The id. - - - - Gets or sets the title. - - The title. - - - - Gets or sets the description. - - The description. - - - - Gets the collection's items converter. - - The collection's items converter. - - - - Gets or sets a value that indicates whether to preserve object references. - - - true to keep object reference; otherwise, false. The default is false. - - - - - Gets or sets a value that indicates whether to preserve collection's items references. - - - true to keep collection's items object references; otherwise, false. The default is false. - - - - - Gets or sets the reference loop handling used when serializing the collection's items. - - The reference loop handling. - - - - Gets or sets the type name handling used when serializing the collection's items. - - The type name handling. - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class with the specified container Id. - - The container Id. - - - - The exception thrown when an error occurs during Json serialization or deserialization. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class - with a specified error message. - - The error message that explains the reason for the exception. - - - - Initializes a new instance of the class - with a specified error message and a reference to the inner exception that is the cause of this exception. - - The error message that explains the reason for the exception. - The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. - - - - Initializes a new instance of the class. - - The that holds the serialized object data about the exception being thrown. - The that contains contextual information about the source or destination. - The parameter is null. - The class name is null or is zero (0). - - - - Specifies how dates are formatted when writing JSON text. - - - - - Dates are written in the ISO 8601 format, e.g. "2012-03-21T05:40Z". - - - - - Dates are written in the Microsoft JSON format, e.g. "\/Date(1198908717056)\/". - - - - - Specifies how date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed when reading JSON text. - - - - - Date formatted strings are not parsed to a date type and are read as strings. - - - - - Date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed to . - - - - - Date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed to . - - - - - Specifies how to treat the time value when converting between string and . - - - - - Treat as local time. If the object represents a Coordinated Universal Time (UTC), it is converted to the local time. - - - - - Treat as a UTC. If the object represents a local time, it is converted to a UTC. - - - - - Treat as a local time if a is being converted to a string. - If a string is being converted to , convert to a local time if a time zone is specified. - - - - - Time zone information should be preserved when converting. - - - - - Specifies formatting options for the . - - - - - No special formatting is applied. This is the default. - - - - - Causes child objects to be indented according to the and settings. - - - - - Instructs the to use the specified constructor when deserializing that object. - - - - - Instructs the to deserialize properties with no matching class member into the specified collection - and write values during serialization. - - - - - Initializes a new instance of the class. - - - - - Gets or sets a value that indicates whether to write extension data when serializing the object. - - - true to write extension data when serializing the object; otherwise, false. The default is true. - - - - - Gets or sets a value that indicates whether to read extension data when deserializing the object. - - - true to read extension data when deserializing the object; otherwise, false. The default is true. - - - - - Specifies metadata property handling options for the . - - - - - Read metadata properties located at the start of a JSON object. - - - - - Read metadata properties located anywhere in a JSON object. Note that this setting will impact performance. - - - - - Represents a trace writer that writes to the application's instances. - - - - - Represents a trace writer. - - - - - Writes the specified trace level, message and optional exception. - - The at which to write this trace. - The trace message. - The trace exception. This parameter is optional. - - - - Gets the that will be used to filter the trace messages passed to the writer. - For example a filter level of Info will exclude Verbose messages and include Info, - Warning and Error messages. - - The that will be used to filter the trace messages passed to the writer. - - - - Writes the specified trace level, message and optional exception. - - The at which to write this trace. - The trace message. - The trace exception. This parameter is optional. - - - - Gets the that will be used to filter the trace messages passed to the writer. - For example a filter level of Info will exclude Verbose messages and include Info, - Warning and Error messages. - - - The that will be used to filter the trace messages passed to the writer. - - - - - Get and set values for a using dynamic methods. - - - - - Provides methods to get and set values. - - - - - Sets the value. - - The target to set the value on. - The value to set on the target. - - - - Gets the value. - - The target to get the value from. - The value. - - - - Initializes a new instance of the class. - - The member info. - - - - Sets the value. - - The target to set the value on. - The value to set on the target. - - - - Gets the value. - - The target to get the value from. - The value. - - - - Contract details for a used by the . - - - - - Contract details for a used by the . - - - - - Gets the underlying type for the contract. - - The underlying type for the contract. - - - - Gets or sets the type created during deserialization. - - The type created during deserialization. - - - - Gets or sets whether this type contract is serialized as a reference. - - Whether this type contract is serialized as a reference. - - - - Gets or sets the default for this contract. - - The converter. - - - - Gets or sets all methods called immediately after deserialization of the object. - - The methods called immediately after deserialization of the object. - - - - Gets or sets all methods called during deserialization of the object. - - The methods called during deserialization of the object. - - - - Gets or sets all methods called after serialization of the object graph. - - The methods called after serialization of the object graph. - - - - Gets or sets all methods called before serialization of the object. - - The methods called before serialization of the object. - - - - Gets or sets all method called when an error is thrown during the serialization of the object. - - The methods called when an error is thrown during the serialization of the object. - - - - Gets or sets the method called immediately after deserialization of the object. - - The method called immediately after deserialization of the object. - - - - Gets or sets the method called during deserialization of the object. - - The method called during deserialization of the object. - - - - Gets or sets the method called after serialization of the object graph. - - The method called after serialization of the object graph. - - - - Gets or sets the method called before serialization of the object. - - The method called before serialization of the object. - - - - Gets or sets the method called when an error is thrown during the serialization of the object. - - The method called when an error is thrown during the serialization of the object. - - - - Gets or sets the default creator method used to create the object. - - The default creator method used to create the object. - - - - Gets or sets a value indicating whether the default creator is non public. - - true if the default object creator is non-public; otherwise, false. - - - - Initializes a new instance of the class. - - The underlying type for the contract. - - - - Gets or sets the default collection items . - - The converter. - - - - Gets or sets a value indicating whether the collection items preserve object references. - - true if collection items preserve object references; otherwise, false. - - - - Gets or sets the collection item reference loop handling. - - The reference loop handling. - - - - Gets or sets the collection item type name handling. - - The type name handling. - - - - Represents a trace writer that writes to memory. When the trace message limit is - reached then old trace messages will be removed as new messages are added. - - - - - Initializes a new instance of the class. - - - - - Writes the specified trace level, message and optional exception. - - The at which to write this trace. - The trace message. - The trace exception. This parameter is optional. - - - - Returns an enumeration of the most recent trace messages. - - An enumeration of the most recent trace messages. - - - - Returns a of the most recent trace messages. - - - A of the most recent trace messages. - - - - - Gets the that will be used to filter the trace messages passed to the writer. - For example a filter level of Info will exclude Verbose messages and include Info, - Warning and Error messages. - - - The that will be used to filter the trace messages passed to the writer. - - - - - Provides an interface to enable a class to return line and position information. - - - - - Gets a value indicating whether the class can return line information. - - - true if LineNumber and LinePosition can be provided; otherwise, false. - - - - - Gets the current line number. - - The current line number or 0 if no line information is available (for example, HasLineInfo returns false). - - - - Gets the current line position. - - The current line position or 0 if no line information is available (for example, HasLineInfo returns false). - - - - Specifies how strings are escaped when writing JSON text. - - - - - Only control characters (e.g. newline) are escaped. - - - - - All non-ASCII and control characters (e.g. newline) are escaped. - - - - - HTML (<, >, &, ', ") and control characters (e.g. newline) are escaped. - - - - - Represents a raw JSON string. - - - - - Represents a value in JSON (string, integer, date, etc). - - - - - Represents an abstract JSON token. - - - - - Represents a collection of objects. - - The type of token - - - - Gets the with the specified key. - - - - - - Compares the values of two tokens, including the values of all descendant tokens. - - The first to compare. - The second to compare. - true if the tokens are equal; otherwise false. - - - - Adds the specified content immediately after this token. - - A content object that contains simple content or a collection of content objects to be added after this token. - - - - Adds the specified content immediately before this token. - - A content object that contains simple content or a collection of content objects to be added before this token. - - - - Returns a collection of the ancestor tokens of this token. - - A collection of the ancestor tokens of this token. - - - - Returns a collection of the sibling tokens after this token, in document order. - - A collection of the sibling tokens after this tokens, in document order. - - - - Returns a collection of the sibling tokens before this token, in document order. - - A collection of the sibling tokens before this token, in document order. - - - - Gets the with the specified key converted to the specified type. - - The type to convert the token to. - The token key. - The converted token value. - - - - Returns a collection of the child tokens of this token, in document order. - - An of containing the child tokens of this , in document order. - - - - Returns a collection of the child tokens of this token, in document order, filtered by the specified type. - - The type to filter the child tokens on. - A containing the child tokens of this , in document order. - - - - Returns a collection of the child values of this token, in document order. - - The type to convert the values to. - A containing the child values of this , in document order. - - - - Removes this token from its parent. - - - - - Replaces this token with the specified token. - - The value. - - - - Writes this token to a . - - A into which this method will write. - A collection of which will be used when writing the token. - - - - Returns the indented JSON for this token. - - - The indented JSON for this token. - - - - - Returns the JSON for this token using the given formatting and converters. - - Indicates how the output is formatted. - A collection of which will be used when writing the token. - The JSON for this token using the given formatting and converters. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Creates an for this token. - - An that can be used to read this token and its descendants. - - - - Creates a from an object. - - The object that will be used to create . - A with the value of the specified object - - - - Creates a from an object using the specified . - - The object that will be used to create . - The that will be used when reading the object. - A with the value of the specified object - - - - Creates the specified .NET type from the . - - The object type that the token will be deserialized to. - The new object created from the JSON value. - - - - Creates the specified .NET type from the . - - The object type that the token will be deserialized to. - The new object created from the JSON value. - - - - Creates the specified .NET type from the using the specified . - - The object type that the token will be deserialized to. - The that will be used when creating the object. - The new object created from the JSON value. - - - - Creates the specified .NET type from the using the specified . - - The object type that the token will be deserialized to. - The that will be used when creating the object. - The new object created from the JSON value. - - - - Creates a from a . - - An positioned at the token to read into this . - - An that contains the token and its descendant tokens - that were read from the reader. The runtime type of the token is determined - by the token type of the first token encountered in the reader. - - - - - Load a from a string that contains JSON. - - A that contains JSON. - A populated from the string that contains JSON. - - - - Creates a from a . - - An positioned at the token to read into this . - - An that contains the token and its descendant tokens - that were read from the reader. The runtime type of the token is determined - by the token type of the first token encountered in the reader. - - - - - Selects a using a JPath expression. Selects the token that matches the object path. - - - A that contains a JPath expression. - - A , or null. - - - - Selects a using a JPath expression. Selects the token that matches the object path. - - - A that contains a JPath expression. - - A flag to indicate whether an error should be thrown if no tokens are found when evaluating part of the expression. - A . - - - - Selects a collection of elements using a JPath expression. - - - A that contains a JPath expression. - - An that contains the selected elements. - - - - Selects a collection of elements using a JPath expression. - - - A that contains a JPath expression. - - A flag to indicate whether an error should be thrown if no tokens are found when evaluating part of the expression. - An that contains the selected elements. - - - - Returns the responsible for binding operations performed on this object. - - The expression tree representation of the runtime value. - - The to bind this object. - - - - - Returns the responsible for binding operations performed on this object. - - The expression tree representation of the runtime value. - - The to bind this object. - - - - - Creates a new instance of the . All child tokens are recursively cloned. - - A new instance of the . - - - - Gets a comparer that can compare two tokens for value equality. - - A that can compare two nodes for value equality. - - - - Gets or sets the parent. - - The parent. - - - - Gets the root of this . - - The root of this . - - - - Gets the node type for this . - - The type. - - - - Gets a value indicating whether this token has child tokens. - - - true if this token has child values; otherwise, false. - - - - - Gets the next sibling token of this node. - - The that contains the next sibling token. - - - - Gets the previous sibling token of this node. - - The that contains the previous sibling token. - - - - Gets the path of the JSON token. - - - - - Gets the with the specified key. - - The with the specified key. - - - - Get the first child token of this token. - - A containing the first child token of the . - - - - Get the last child token of this token. - - A containing the last child token of the . - - - - Initializes a new instance of the class from another object. - - A object to copy from. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Creates a comment with the given value. - - The value. - A comment with the given value. - - - - Creates a string with the given value. - - The value. - A string with the given value. - - - - Writes this token to a . - - A into which this method will write. - A collection of which will be used when writing the token. - - - - Indicates whether the current object is equal to another object of the same type. - - - true if the current object is equal to the parameter; otherwise, false. - - An object to compare with this object. - - - - Determines whether the specified is equal to the current . - - The to compare with the current . - - true if the specified is equal to the current ; otherwise, false. - - - The parameter is null. - - - - - Serves as a hash function for a particular type. - - - A hash code for the current . - - - - - Returns a that represents this instance. - - - A that represents this instance. - - - - - Returns a that represents this instance. - - The format. - - A that represents this instance. - - - - - Returns a that represents this instance. - - The format provider. - - A that represents this instance. - - - - - Returns a that represents this instance. - - The format. - The format provider. - - A that represents this instance. - - - - - Returns the responsible for binding operations performed on this object. - - The expression tree representation of the runtime value. - - The to bind this object. - - - - - Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object. - - An object to compare with this instance. - - A 32-bit signed integer that indicates the relative order of the objects being compared. The return value has these meanings: - Value - Meaning - Less than zero - This instance is less than . - Zero - This instance is equal to . - Greater than zero - This instance is greater than . - - - is not the same type as this instance. - - - - - Gets a value indicating whether this token has child tokens. - - - true if this token has child values; otherwise, false. - - - - - Gets the node type for this . - - The type. - - - - Gets or sets the underlying token value. - - The underlying token value. - - - - Initializes a new instance of the class from another object. - - A object to copy from. - - - - Initializes a new instance of the class. - - The raw json. - - - - Creates an instance of with the content of the reader's current token. - - The reader. - An instance of with the content of the reader's current token. - - - - Indicating whether a property is required. - - - - - The property is not required. The default state. - - - - - The property must be defined in JSON but can be a null value. - - - - - The property must be defined in JSON and cannot be a null value. - - - - - Contract details for a used by the . - - - - - Initializes a new instance of the class. - - The underlying type for the contract. - - - - Gets the object's properties. - - The object's properties. - - - - Gets or sets the property name resolver. - - The property name resolver. - - - - Contract details for a used by the . - - - - - Initializes a new instance of the class. - - The underlying type for the contract. - - - - Gets or sets the ISerializable object constructor. - - The ISerializable object constructor. - - - - Contract details for a used by the . - - - - - Initializes a new instance of the class. - - The underlying type for the contract. - - - - Contract details for a used by the . - - - - - Initializes a new instance of the class. - - The underlying type for the contract. - - - - Get and set values for a using dynamic methods. - - - - - Initializes a new instance of the class. - - The member info. - - - - Sets the value. - - The target to set the value on. - The value to set on the target. - - - - Gets the value. - - The target to get the value from. - The value. - - - - Provides data for the Error event. - - - - - Initializes a new instance of the class. - - The current object. - The error context. - - - - Gets the current object the error event is being raised against. - - The current object the error event is being raised against. - - - - Gets the error context. - - The error context. - - - - Represents a view of a . - - - - - Initializes a new instance of the class. - - The name. - - - - When overridden in a derived class, returns whether resetting an object changes its value. - - - true if resetting the component changes its value; otherwise, false. - - The component to test for reset capability. - - - - - When overridden in a derived class, gets the current value of the property on a component. - - - The value of a property for a given component. - - The component with the property for which to retrieve the value. - - - - - When overridden in a derived class, resets the value for this property of the component to the default value. - - The component with the property value that is to be reset to the default value. - - - - - When overridden in a derived class, sets the value of the component to a different value. - - The component with the property value that is to be set. - The new value. - - - - - When overridden in a derived class, determines a value indicating whether the value of this property needs to be persisted. - - - true if the property should be persisted; otherwise, false. - - The component with the property to be examined for persistence. - - - - - When overridden in a derived class, gets the type of the component this property is bound to. - - - A that represents the type of component this property is bound to. When the or methods are invoked, the object specified might be an instance of this type. - - - - - When overridden in a derived class, gets a value indicating whether this property is read-only. - - - true if the property is read-only; otherwise, false. - - - - - When overridden in a derived class, gets the type of the property. - - - A that represents the type of the property. - - - - - Gets the hash code for the name of the member. - - - - The hash code for the name of the member. - - - - - Used to resolve references when serializing and deserializing JSON by the . - - - - - Resolves a reference to its object. - - The serialization context. - The reference to resolve. - The object that - - - - Gets the reference for the sepecified object. - - The serialization context. - The object to get a reference for. - The reference to the object. - - - - Determines whether the specified object is referenced. - - The serialization context. - The object to test for a reference. - - true if the specified object is referenced; otherwise, false. - - - - - Adds a reference to the specified object. - - The serialization context. - The reference. - The object to reference. - - - - Specifies reference handling options for the . - Note that references cannot be preserved when a value is set via a non-default constructor such as types that implement ISerializable. - - - - - - - - Do not preserve references when serializing types. - - - - - Preserve references when serializing into a JSON object structure. - - - - - Preserve references when serializing into a JSON array structure. - - - - - Preserve references when serializing. - - - - - Instructs the how to serialize the collection. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class with a flag indicating whether the array can contain null items - - A flag indicating whether the array can contain null items. - - - - Initializes a new instance of the class with the specified container Id. - - The container Id. - - - - Gets or sets a value indicating whether null items are allowed in the collection. - - true if null items are allowed in the collection; otherwise, false. - - - - Specifies default value handling options for the . - - - - - - - - - Include members where the member value is the same as the member's default value when serializing objects. - Included members are written to JSON. Has no effect when deserializing. - - - - - Ignore members where the member value is the same as the member's default value when serializing objects - so that is is not written to JSON. - This option will ignore all default values (e.g. null for objects and nullable types; 0 for integers, - decimals and floating point numbers; and false for booleans). The default value ignored can be changed by - placing the on the property. - - - - - Members with a default value but no JSON will be set to their default value when deserializing. - - - - - Ignore members where the member value is the same as the member's default value when serializing objects - and sets members to their default value when deserializing. - - - - - Instructs the to use the specified when serializing the member or class. - - - - - Initializes a new instance of the class. - - Type of the converter. - - - - Gets the type of the converter. - - The type of the converter. - - - - Instructs the how to serialize the object. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class with the specified member serialization. - - The member serialization. - - - - Initializes a new instance of the class with the specified container Id. - - The container Id. - - - - Gets or sets the member serialization. - - The member serialization. - - - - Gets or sets a value that indicates whether the object's properties are required. - - - A value indicating whether the object's properties are required. - - - - - Specifies the settings on a object. - - - - - Initializes a new instance of the class. - - - - - Gets or sets how reference loops (e.g. a class referencing itself) is handled. - - Reference loop handling. - - - - Gets or sets how missing members (e.g. JSON contains a property that isn't a member on the object) are handled during deserialization. - - Missing member handling. - - - - Gets or sets how objects are created during deserialization. - - The object creation handling. - - - - Gets or sets how null values are handled during serialization and deserialization. - - Null value handling. - - - - Gets or sets how null default are handled during serialization and deserialization. - - The default value handling. - - - - Gets or sets a collection that will be used during serialization. - - The converters. - - - - Gets or sets how object references are preserved by the serializer. - - The preserve references handling. - - - - Gets or sets how type name writing and reading is handled by the serializer. - - The type name handling. - - - - Gets or sets how metadata properties are used during deserialization. - - The metadata properties handling. - - - - Gets or sets how a type name assembly is written and resolved by the serializer. - - The type name assembly format. - - - - Gets or sets how constructors are used during deserialization. - - The constructor handling. - - - - Gets or sets the contract resolver used by the serializer when - serializing .NET objects to JSON and vice versa. - - The contract resolver. - - - - Gets or sets the used by the serializer when resolving references. - - The reference resolver. - - - - Gets or sets the used by the serializer when writing trace messages. - - The trace writer. - - - - Gets or sets the used by the serializer when resolving type names. - - The binder. - - - - Gets or sets the error handler called during serialization and deserialization. - - The error handler called during serialization and deserialization. - - - - Gets or sets the used by the serializer when invoking serialization callback methods. - - The context. - - - - Get or set how and values are formatting when writing JSON text. - - - - - Gets or sets the maximum depth allowed when reading JSON. Reading past this depth will throw a . - - - - - Indicates how JSON text output is formatted. - - - - - Get or set how dates are written to JSON text. - - - - - Get or set how time zones are handling during serialization and deserialization. - - - - - Get or set how date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed when reading JSON. - - - - - Get or set how special floating point numbers, e.g. , - and , - are written as JSON. - - - - - Get or set how floating point numbers, e.g. 1.0 and 9.9, are parsed when reading JSON text. - - - - - Get or set how strings are escaped when writing JSON text. - - - - - Gets or sets the culture used when reading JSON. Defaults to . - - - - - Gets a value indicating whether there will be a check for additional content after deserializing an object. - - - true if there will be a check for additional content after deserializing an object; otherwise, false. - - - - - Represents a reader that provides validation. - - - - - Initializes a new instance of the class that - validates the content returned from the given . - - The to read from while validating. - - - - Reads the next JSON token from the stream as a . - - A . - - - - Reads the next JSON token from the stream as a . - - - A or a null reference if the next JSON token is null. - - - - - Reads the next JSON token from the stream as a . - - A . - - - - Reads the next JSON token from the stream as a . - - A . This method will return null at the end of an array. - - - - Reads the next JSON token from the stream as a . - - A . This method will return null at the end of an array. - - - - Reads the next JSON token from the stream as a . - - A . - - - - Reads the next JSON token from the stream. - - - true if the next token was read successfully; false if there are no more tokens to read. - - - - - Sets an event handler for receiving schema validation errors. - - - - - Gets the text value of the current JSON token. - - - - - - Gets the depth of the current token in the JSON document. - - The depth of the current token in the JSON document. - - - - Gets the path of the current JSON token. - - - - - Gets the quotation mark character used to enclose the value of a string. - - - - - - Gets the type of the current JSON token. - - - - - - Gets the Common Language Runtime (CLR) type for the current JSON token. - - - - - - Gets or sets the schema. - - The schema. - - - - Gets the used to construct this . - - The specified in the constructor. - - - - Compares tokens to determine whether they are equal. - - - - - Determines whether the specified objects are equal. - - The first object of type to compare. - The second object of type to compare. - - true if the specified objects are equal; otherwise, false. - - - - - Returns a hash code for the specified object. - - The for which a hash code is to be returned. - A hash code for the specified object. - The type of is a reference type and is null. - - - - Specifies the member serialization options for the . - - - - - All public members are serialized by default. Members can be excluded using or . - This is the default member serialization mode. - - - - - Only members must be marked with or are serialized. - This member serialization mode can also be set by marking the class with . - - - - - All public and private fields are serialized. Members can be excluded using or . - This member serialization mode can also be set by marking the class with - and setting IgnoreSerializableAttribute on to false. - - - - - Specifies how object creation is handled by the . - - - - - Reuse existing objects, create new objects when needed. - - - - - Only reuse existing objects. - - - - - Always create new objects. - - - - - Converts a to and from the ISO 8601 date format (e.g. 2008-04-12T12:53Z). - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Gets or sets the date time styles used when converting a date to and from JSON. - - The date time styles used when converting a date to and from JSON. - - - - Gets or sets the date time format used when converting a date to and from JSON. - - The date time format used when converting a date to and from JSON. - - - - Gets or sets the culture used when converting a date to and from JSON. - - The culture used when converting a date to and from JSON. - - - - Converts a to and from a JavaScript date constructor (e.g. new Date(52231943)). - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing property value of the JSON that is being converted. - The calling serializer. - The object value. - - - - Converts XML to and from JSON. - - - - - Writes the JSON representation of the object. - - The to write to. - The calling serializer. - The value. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Checks if the attributeName is a namespace attribute. - - Attribute name to test. - The attribute name prefix if it has one, otherwise an empty string. - True if attribute name is for a namespace attribute, otherwise false. - - - - Determines whether this instance can convert the specified value type. - - Type of the value. - - true if this instance can convert the specified value type; otherwise, false. - - - - - Gets or sets the name of the root element to insert when deserializing to XML if the JSON structure has produces multiple root elements. - - The name of the deserialize root element. - - - - Gets or sets a flag to indicate whether to write the Json.NET array attribute. - This attribute helps preserve arrays when converting the written XML back to JSON. - - true if the array attibute is written to the XML; otherwise, false. - - - - Gets or sets a value indicating whether to write the root JSON object. - - true if the JSON root object is omitted; otherwise, false. - - - - Represents a reader that provides fast, non-cached, forward-only access to JSON text data. - - - - - Initializes a new instance of the class with the specified . - - The TextReader containing the XML data to read. - - - - Reads the next JSON token from the stream. - - - true if the next token was read successfully; false if there are no more tokens to read. - - - - - Reads the next JSON token from the stream as a . - - - A or a null reference if the next JSON token is null. This method will return null at the end of an array. - - - - - Reads the next JSON token from the stream as a . - - A . This method will return null at the end of an array. - - - - Reads the next JSON token from the stream as a . - - A . This method will return null at the end of an array. - - - - Reads the next JSON token from the stream as a . - - A . This method will return null at the end of an array. - - - - Reads the next JSON token from the stream as a . - - A . This method will return null at the end of an array. - - - - Reads the next JSON token from the stream as a . - - A . This method will return null at the end of an array. - - - - Changes the state to closed. - - - - - Gets a value indicating whether the class can return line information. - - - true if LineNumber and LinePosition can be provided; otherwise, false. - - - - - Gets the current line number. - - - The current line number or 0 if no line information is available (for example, HasLineInfo returns false). - - - - - Gets the current line position. - - - The current line position or 0 if no line information is available (for example, HasLineInfo returns false). - - - - - Instructs the to always serialize the member with the specified name. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class with the specified name. - - Name of the property. - - - - Gets or sets the converter used when serializing the property's collection items. - - The collection's items converter. - - - - Gets or sets the null value handling used when serializing this property. - - The null value handling. - - - - Gets or sets the default value handling used when serializing this property. - - The default value handling. - - - - Gets or sets the reference loop handling used when serializing this property. - - The reference loop handling. - - - - Gets or sets the object creation handling used when deserializing this property. - - The object creation handling. - - - - Gets or sets the type name handling used when serializing this property. - - The type name handling. - - - - Gets or sets whether this property's value is serialized as a reference. - - Whether this property's value is serialized as a reference. - - - - Gets or sets the order of serialization and deserialization of a member. - - The numeric order of serialization or deserialization. - - - - Gets or sets a value indicating whether this property is required. - - - A value indicating whether this property is required. - - - - - Gets or sets the name of the property. - - The name of the property. - - - - Gets or sets the the reference loop handling used when serializing the property's collection items. - - The collection's items reference loop handling. - - - - Gets or sets the the type name handling used when serializing the property's collection items. - - The collection's items type name handling. - - - - Gets or sets whether this property's collection items are serialized as a reference. - - Whether this property's collection items are serialized as a reference. - - - - Instructs the not to serialize the public field or public read/write property value. - - - - - Represents a writer that provides a fast, non-cached, forward-only way of generating Json data. - - - - - Creates an instance of the JsonWriter class using the specified . - - The TextWriter to write to. - - - - Flushes whatever is in the buffer to the underlying streams and also flushes the underlying stream. - - - - - Closes this stream and the underlying stream. - - - - - Writes the beginning of a Json object. - - - - - Writes the beginning of a Json array. - - - - - Writes the start of a constructor with the given name. - - The name of the constructor. - - - - Writes the specified end token. - - The end token to write. - - - - Writes the property name of a name/value pair on a Json object. - - The name of the property. - - - - Writes the property name of a name/value pair on a JSON object. - - The name of the property. - A flag to indicate whether the text should be escaped when it is written as a JSON property name. - - - - Writes indent characters. - - - - - Writes the JSON value delimiter. - - - - - Writes an indent space. - - - - - Writes a value. - An error will raised if the value cannot be written as a single JSON token. - - The value to write. - - - - Writes a null value. - - - - - Writes an undefined value. - - - - - Writes raw JSON. - - The raw JSON to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes out a comment /*...*/ containing the specified text. - - Text to place inside the comment. - - - - Writes out the given white space. - - The string of white space characters. - - - - Gets or sets how many IndentChars to write for each level in the hierarchy when is set to Formatting.Indented. - - - - - Gets or sets which character to use to quote attribute values. - - - - - Gets or sets which character to use for indenting when is set to Formatting.Indented. - - - - - Gets or sets a value indicating whether object names will be surrounded with quotes. - - - - - The exception thrown when an error occurs while reading Json text. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class - with a specified error message. - - The error message that explains the reason for the exception. - - - - Initializes a new instance of the class - with a specified error message and a reference to the inner exception that is the cause of this exception. - - The error message that explains the reason for the exception. - The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. - - - - Initializes a new instance of the class. - - The that holds the serialized object data about the exception being thrown. - The that contains contextual information about the source or destination. - The parameter is null. - The class name is null or is zero (0). - - - - Gets the path to the JSON where the error occurred. - - The path to the JSON where the error occurred. - - - - The exception thrown when an error occurs while reading Json text. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class - with a specified error message. - - The error message that explains the reason for the exception. - - - - Initializes a new instance of the class - with a specified error message and a reference to the inner exception that is the cause of this exception. - - The error message that explains the reason for the exception. - The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. - - - - Initializes a new instance of the class. - - The that holds the serialized object data about the exception being thrown. - The that contains contextual information about the source or destination. - The parameter is null. - The class name is null or is zero (0). - - - - Gets the line number indicating where the error occurred. - - The line number indicating where the error occurred. - - - - Gets the line position indicating where the error occurred. - - The line position indicating where the error occurred. - - - - Gets the path to the JSON where the error occurred. - - The path to the JSON where the error occurred. - - - - Represents a collection of . - - - - - Provides methods for converting between common language runtime types and JSON types. - - - - - - - - Represents JavaScript's boolean value true as a string. This field is read-only. - - - - - Represents JavaScript's boolean value false as a string. This field is read-only. - - - - - Represents JavaScript's null as a string. This field is read-only. - - - - - Represents JavaScript's undefined as a string. This field is read-only. - - - - - Represents JavaScript's positive infinity as a string. This field is read-only. - - - - - Represents JavaScript's negative infinity as a string. This field is read-only. - - - - - Represents JavaScript's NaN as a string. This field is read-only. - - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation using the specified. - - The value to convert. - The format the date will be converted to. - The time zone handling when the date is converted to a string. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation using the specified. - - The value to convert. - The format the date will be converted to. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - The string delimiter character. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Serializes the specified object to a JSON string. - - The object to serialize. - A JSON string representation of the object. - - - - Serializes the specified object to a JSON string using formatting. - - The object to serialize. - Indicates how the output is formatted. - - A JSON string representation of the object. - - - - - Serializes the specified object to a JSON string using a collection of . - - The object to serialize. - A collection converters used while serializing. - A JSON string representation of the object. - - - - Serializes the specified object to a JSON string using formatting and a collection of . - - The object to serialize. - Indicates how the output is formatted. - A collection converters used while serializing. - A JSON string representation of the object. - - - - Serializes the specified object to a JSON string using . - - The object to serialize. - The used to serialize the object. - If this is null, default serialization settings will be is used. - - A JSON string representation of the object. - - - - - Serializes the specified object to a JSON string using a type, formatting and . - - The object to serialize. - The used to serialize the object. - If this is null, default serialization settings will be is used. - - The type of the value being serialized. - This parameter is used when is Auto to write out the type name if the type of the value does not match. - Specifing the type is optional. - - - A JSON string representation of the object. - - - - - Serializes the specified object to a JSON string using formatting and . - - The object to serialize. - Indicates how the output is formatted. - The used to serialize the object. - If this is null, default serialization settings will be is used. - - A JSON string representation of the object. - - - - - Serializes the specified object to a JSON string using a type, formatting and . - - The object to serialize. - Indicates how the output is formatted. - The used to serialize the object. - If this is null, default serialization settings will be is used. - - The type of the value being serialized. - This parameter is used when is Auto to write out the type name if the type of the value does not match. - Specifing the type is optional. - - - A JSON string representation of the object. - - - - - Asynchronously serializes the specified object to a JSON string. - Serialization will happen on a new thread. - - The object to serialize. - - A task that represents the asynchronous serialize operation. The value of the TResult parameter contains a JSON string representation of the object. - - - - - Asynchronously serializes the specified object to a JSON string using formatting. - Serialization will happen on a new thread. - - The object to serialize. - Indicates how the output is formatted. - - A task that represents the asynchronous serialize operation. The value of the TResult parameter contains a JSON string representation of the object. - - - - - Asynchronously serializes the specified object to a JSON string using formatting and a collection of . - Serialization will happen on a new thread. - - The object to serialize. - Indicates how the output is formatted. - The used to serialize the object. - If this is null, default serialization settings will be is used. - - A task that represents the asynchronous serialize operation. The value of the TResult parameter contains a JSON string representation of the object. - - - - - Deserializes the JSON to a .NET object. - - The JSON to deserialize. - The deserialized object from the Json string. - - - - Deserializes the JSON to a .NET object using . - - The JSON to deserialize. - - The used to deserialize the object. - If this is null, default serialization settings will be is used. - - The deserialized object from the JSON string. - - - - Deserializes the JSON to the specified .NET type. - - The JSON to deserialize. - The of object being deserialized. - The deserialized object from the Json string. - - - - Deserializes the JSON to the specified .NET type. - - The type of the object to deserialize to. - The JSON to deserialize. - The deserialized object from the Json string. - - - - Deserializes the JSON to the given anonymous type. - - - The anonymous type to deserialize to. This can't be specified - traditionally and must be infered from the anonymous type passed - as a parameter. - - The JSON to deserialize. - The anonymous type object. - The deserialized anonymous type from the JSON string. - - - - Deserializes the JSON to the given anonymous type using . - - - The anonymous type to deserialize to. This can't be specified - traditionally and must be infered from the anonymous type passed - as a parameter. - - The JSON to deserialize. - The anonymous type object. - - The used to deserialize the object. - If this is null, default serialization settings will be is used. - - The deserialized anonymous type from the JSON string. - - - - Deserializes the JSON to the specified .NET type using a collection of . - - The type of the object to deserialize to. - The JSON to deserialize. - Converters to use while deserializing. - The deserialized object from the JSON string. - - - - Deserializes the JSON to the specified .NET type using . - - The type of the object to deserialize to. - The object to deserialize. - - The used to deserialize the object. - If this is null, default serialization settings will be is used. - - The deserialized object from the JSON string. - - - - Deserializes the JSON to the specified .NET type using a collection of . - - The JSON to deserialize. - The type of the object to deserialize. - Converters to use while deserializing. - The deserialized object from the JSON string. - - - - Deserializes the JSON to the specified .NET type using . - - The JSON to deserialize. - The type of the object to deserialize to. - - The used to deserialize the object. - If this is null, default serialization settings will be is used. - - The deserialized object from the JSON string. - - - - Asynchronously deserializes the JSON to the specified .NET type. - Deserialization will happen on a new thread. - - The type of the object to deserialize to. - The JSON to deserialize. - - A task that represents the asynchronous deserialize operation. The value of the TResult parameter contains the deserialized object from the JSON string. - - - - - Asynchronously deserializes the JSON to the specified .NET type using . - Deserialization will happen on a new thread. - - The type of the object to deserialize to. - The JSON to deserialize. - - The used to deserialize the object. - If this is null, default serialization settings will be is used. - - - A task that represents the asynchronous deserialize operation. The value of the TResult parameter contains the deserialized object from the JSON string. - - - - - Asynchronously deserializes the JSON to the specified .NET type. - Deserialization will happen on a new thread. - - The JSON to deserialize. - - A task that represents the asynchronous deserialize operation. The value of the TResult parameter contains the deserialized object from the JSON string. - - - - - Asynchronously deserializes the JSON to the specified .NET type using . - Deserialization will happen on a new thread. - - The JSON to deserialize. - The type of the object to deserialize to. - - The used to deserialize the object. - If this is null, default serialization settings will be is used. - - - A task that represents the asynchronous deserialize operation. The value of the TResult parameter contains the deserialized object from the JSON string. - - - - - Populates the object with values from the JSON string. - - The JSON to populate values from. - The target object to populate values onto. - - - - Populates the object with values from the JSON string using . - - The JSON to populate values from. - The target object to populate values onto. - - The used to deserialize the object. - If this is null, default serialization settings will be is used. - - - - - Asynchronously populates the object with values from the JSON string using . - - The JSON to populate values from. - The target object to populate values onto. - - The used to deserialize the object. - If this is null, default serialization settings will be is used. - - - A task that represents the asynchronous populate operation. - - - - - Serializes the XML node to a JSON string. - - The node to serialize. - A JSON string of the XmlNode. - - - - Serializes the XML node to a JSON string using formatting. - - The node to serialize. - Indicates how the output is formatted. - A JSON string of the XmlNode. - - - - Serializes the XML node to a JSON string using formatting and omits the root object if is true. - - The node to serialize. - Indicates how the output is formatted. - Omits writing the root object. - A JSON string of the XmlNode. - - - - Deserializes the XmlNode from a JSON string. - - The JSON string. - The deserialized XmlNode - - - - Deserializes the XmlNode from a JSON string nested in a root elment specified by . - - The JSON string. - The name of the root element to append when deserializing. - The deserialized XmlNode - - - - Deserializes the XmlNode from a JSON string nested in a root elment specified by - and writes a .NET array attribute for collections. - - The JSON string. - The name of the root element to append when deserializing. - - A flag to indicate whether to write the Json.NET array attribute. - This attribute helps preserve arrays when converting the written XML back to JSON. - - The deserialized XmlNode - - - - Serializes the to a JSON string. - - The node to convert to JSON. - A JSON string of the XNode. - - - - Serializes the to a JSON string using formatting. - - The node to convert to JSON. - Indicates how the output is formatted. - A JSON string of the XNode. - - - - Serializes the to a JSON string using formatting and omits the root object if is true. - - The node to serialize. - Indicates how the output is formatted. - Omits writing the root object. - A JSON string of the XNode. - - - - Deserializes the from a JSON string. - - The JSON string. - The deserialized XNode - - - - Deserializes the from a JSON string nested in a root elment specified by . - - The JSON string. - The name of the root element to append when deserializing. - The deserialized XNode - - - - Deserializes the from a JSON string nested in a root elment specified by - and writes a .NET array attribute for collections. - - The JSON string. - The name of the root element to append when deserializing. - - A flag to indicate whether to write the Json.NET array attribute. - This attribute helps preserve arrays when converting the written XML back to JSON. - - The deserialized XNode - - - - Gets or sets a function that creates default . - Default settings are automatically used by serialization methods on , - and and on . - To serialize without using any default settings create a with - . - - - - - The exception thrown when an error occurs during Json serialization or deserialization. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class - with a specified error message. - - The error message that explains the reason for the exception. - - - - Initializes a new instance of the class - with a specified error message and a reference to the inner exception that is the cause of this exception. - - The error message that explains the reason for the exception. - The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. - - - - Initializes a new instance of the class. - - The that holds the serialized object data about the exception being thrown. - The that contains contextual information about the source or destination. - The parameter is null. - The class name is null or is zero (0). - - - - Serializes and deserializes objects into and from the JSON format. - The enables you to control how objects are encoded into JSON. - - - - - Initializes a new instance of the class. - - - - - Creates a new instance. - The will not use default settings. - - - A new instance. - The will not use default settings. - - - - - Creates a new instance using the specified . - The will not use default settings. - - The settings to be applied to the . - - A new instance using the specified . - The will not use default settings. - - - - - Creates a new instance. - The will use default settings. - - - A new instance. - The will use default settings. - - - - - Creates a new instance using the specified . - The will use default settings. - - The settings to be applied to the . - - A new instance using the specified . - The will use default settings. - - - - - Populates the JSON values onto the target object. - - The that contains the JSON structure to reader values from. - The target object to populate values onto. - - - - Populates the JSON values onto the target object. - - The that contains the JSON structure to reader values from. - The target object to populate values onto. - - - - Deserializes the Json structure contained by the specified . - - The that contains the JSON structure to deserialize. - The being deserialized. - - - - Deserializes the Json structure contained by the specified - into an instance of the specified type. - - The containing the object. - The of object being deserialized. - The instance of being deserialized. - - - - Deserializes the Json structure contained by the specified - into an instance of the specified type. - - The containing the object. - The type of the object to deserialize. - The instance of being deserialized. - - - - Deserializes the Json structure contained by the specified - into an instance of the specified type. - - The containing the object. - The of object being deserialized. - The instance of being deserialized. - - - - Serializes the specified and writes the Json structure - to a Stream using the specified . - - The used to write the Json structure. - The to serialize. - - - - Serializes the specified and writes the Json structure - to a Stream using the specified . - - The used to write the Json structure. - The to serialize. - - The type of the value being serialized. - This parameter is used when is Auto to write out the type name if the type of the value does not match. - Specifing the type is optional. - - - - - Serializes the specified and writes the Json structure - to a Stream using the specified . - - The used to write the Json structure. - The to serialize. - - The type of the value being serialized. - This parameter is used when is Auto to write out the type name if the type of the value does not match. - Specifing the type is optional. - - - - - Serializes the specified and writes the Json structure - to a Stream using the specified . - - The used to write the Json structure. - The to serialize. - - - - Occurs when the errors during serialization and deserialization. - - - - - Gets or sets the used by the serializer when resolving references. - - - - - Gets or sets the used by the serializer when resolving type names. - - - - - Gets or sets the used by the serializer when writing trace messages. - - The trace writer. - - - - Gets or sets how type name writing and reading is handled by the serializer. - - - - - Gets or sets how a type name assembly is written and resolved by the serializer. - - The type name assembly format. - - - - Gets or sets how object references are preserved by the serializer. - - - - - Get or set how reference loops (e.g. a class referencing itself) is handled. - - - - - Get or set how missing members (e.g. JSON contains a property that isn't a member on the object) are handled during deserialization. - - - - - Get or set how null values are handled during serialization and deserialization. - - - - - Get or set how null default are handled during serialization and deserialization. - - - - - Gets or sets how objects are created during deserialization. - - The object creation handling. - - - - Gets or sets how constructors are used during deserialization. - - The constructor handling. - - - - Gets or sets how metadata properties are used during deserialization. - - The metadata properties handling. - - - - Gets a collection that will be used during serialization. - - Collection that will be used during serialization. - - - - Gets or sets the contract resolver used by the serializer when - serializing .NET objects to JSON and vice versa. - - - - - Gets or sets the used by the serializer when invoking serialization callback methods. - - The context. - - - - Indicates how JSON text output is formatted. - - - - - Get or set how dates are written to JSON text. - - - - - Get or set how time zones are handling during serialization and deserialization. - - - - - Get or set how date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed when reading JSON. - - - - - Get or set how floating point numbers, e.g. 1.0 and 9.9, are parsed when reading JSON text. - - - - - Get or set how special floating point numbers, e.g. , - and , - are written as JSON text. - - - - - Get or set how strings are escaped when writing JSON text. - - - - - Get or set how and values are formatting when writing JSON text. - - - - - Gets or sets the culture used when reading JSON. Defaults to . - - - - - Gets or sets the maximum depth allowed when reading JSON. Reading past this depth will throw a . - - - - - Gets a value indicating whether there will be a check for additional JSON content after deserializing an object. - - - true if there will be a check for additional JSON content after deserializing an object; otherwise, false. - - - - - Contains the LINQ to JSON extension methods. - - - - - Returns a collection of tokens that contains the ancestors of every token in the source collection. - - The type of the objects in source, constrained to . - An of that contains the source collection. - An of that contains the ancestors of every node in the source collection. - - - - Returns a collection of tokens that contains the descendants of every token in the source collection. - - The type of the objects in source, constrained to . - An of that contains the source collection. - An of that contains the descendants of every node in the source collection. - - - - Returns a collection of child properties of every object in the source collection. - - An of that contains the source collection. - An of that contains the properties of every object in the source collection. - - - - Returns a collection of child values of every object in the source collection with the given key. - - An of that contains the source collection. - The token key. - An of that contains the values of every node in the source collection with the given key. - - - - Returns a collection of child values of every object in the source collection. - - An of that contains the source collection. - An of that contains the values of every node in the source collection. - - - - Returns a collection of converted child values of every object in the source collection with the given key. - - The type to convert the values to. - An of that contains the source collection. - The token key. - An that contains the converted values of every node in the source collection with the given key. - - - - Returns a collection of converted child values of every object in the source collection. - - The type to convert the values to. - An of that contains the source collection. - An that contains the converted values of every node in the source collection. - - - - Converts the value. - - The type to convert the value to. - A cast as a of . - A converted value. - - - - Converts the value. - - The source collection type. - The type to convert the value to. - A cast as a of . - A converted value. - - - - Returns a collection of child tokens of every array in the source collection. - - The source collection type. - An of that contains the source collection. - An of that contains the values of every node in the source collection. - - - - Returns a collection of converted child tokens of every array in the source collection. - - An of that contains the source collection. - The type to convert the values to. - The source collection type. - An that contains the converted values of every node in the source collection. - - - - Returns the input typed as . - - An of that contains the source collection. - The input typed as . - - - - Returns the input typed as . - - The source collection type. - An of that contains the source collection. - The input typed as . - - - - Represents a JSON constructor. - - - - - Represents a token that can contain other tokens. - - - - - Raises the event. - - The instance containing the event data. - - - - Raises the event. - - The instance containing the event data. - - - - Raises the event. - - The instance containing the event data. - - - - Returns a collection of the child tokens of this token, in document order. - - - An of containing the child tokens of this , in document order. - - - - - Returns a collection of the child values of this token, in document order. - - The type to convert the values to. - - A containing the child values of this , in document order. - - - - - Returns a collection of the descendant tokens for this token in document order. - - An containing the descendant tokens of the . - - - - Adds the specified content as children of this . - - The content to be added. - - - - Adds the specified content as the first children of this . - - The content to be added. - - - - Creates an that can be used to add tokens to the . - - An that is ready to have content written to it. - - - - Replaces the children nodes of this token with the specified content. - - The content. - - - - Removes the child nodes from this token. - - - - - Occurs when the list changes or an item in the list changes. - - - - - Occurs before an item is added to the collection. - - - - - Occurs when the items list of the collection has changed, or the collection is reset. - - - - - Gets the container's children tokens. - - The container's children tokens. - - - - Gets a value indicating whether this token has child tokens. - - - true if this token has child values; otherwise, false. - - - - - Get the first child token of this token. - - - A containing the first child token of the . - - - - - Get the last child token of this token. - - - A containing the last child token of the . - - - - - Gets the count of child JSON tokens. - - The count of child JSON tokens - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class from another object. - - A object to copy from. - - - - Initializes a new instance of the class with the specified name and content. - - The constructor name. - The contents of the constructor. - - - - Initializes a new instance of the class with the specified name and content. - - The constructor name. - The contents of the constructor. - - - - Initializes a new instance of the class with the specified name. - - The constructor name. - - - - Writes this token to a . - - A into which this method will write. - A collection of which will be used when writing the token. - - - - Loads an from a . - - A that will be read for the content of the . - A that contains the JSON that was read from the specified . - - - - Gets the container's children tokens. - - The container's children tokens. - - - - Gets or sets the name of this constructor. - - The constructor name. - - - - Gets the node type for this . - - The type. - - - - Gets the with the specified key. - - The with the specified key. - - - - Represents a collection of objects. - - The type of token - - - - An empty collection of objects. - - - - - Initializes a new instance of the struct. - - The enumerable. - - - - Returns an enumerator that iterates through the collection. - - - A that can be used to iterate through the collection. - - - - - Returns an enumerator that iterates through a collection. - - - An object that can be used to iterate through the collection. - - - - - Determines whether the specified is equal to this instance. - - The to compare with this instance. - - true if the specified is equal to this instance; otherwise, false. - - - - - Returns a hash code for this instance. - - - A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. - - - - - Gets the with the specified key. - - - - - - Represents a JSON object. - - - - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class from another object. - - A object to copy from. - - - - Initializes a new instance of the class with the specified content. - - The contents of the object. - - - - Initializes a new instance of the class with the specified content. - - The contents of the object. - - - - Gets an of this object's properties. - - An of this object's properties. - - - - Gets a the specified name. - - The property name. - A with the specified name or null. - - - - Gets an of this object's property values. - - An of this object's property values. - - - - Loads an from a . - - A that will be read for the content of the . - A that contains the JSON that was read from the specified . - - - - Load a from a string that contains JSON. - - A that contains JSON. - A populated from the string that contains JSON. - - - - - - - Creates a from an object. - - The object that will be used to create . - A with the values of the specified object - - - - Creates a from an object. - - The object that will be used to create . - The that will be used to read the object. - A with the values of the specified object - - - - Writes this token to a . - - A into which this method will write. - A collection of which will be used when writing the token. - - - - Gets the with the specified property name. - - Name of the property. - The with the specified property name. - - - - Gets the with the specified property name. - The exact property name will be searched for first and if no matching property is found then - the will be used to match a property. - - Name of the property. - One of the enumeration values that specifies how the strings will be compared. - The with the specified property name. - - - - Tries to get the with the specified property name. - The exact property name will be searched for first and if no matching property is found then - the will be used to match a property. - - Name of the property. - The value. - One of the enumeration values that specifies how the strings will be compared. - true if a value was successfully retrieved; otherwise, false. - - - - Adds the specified property name. - - Name of the property. - The value. - - - - Removes the property with the specified name. - - Name of the property. - true if item was successfully removed; otherwise, false. - - - - Tries the get value. - - Name of the property. - The value. - true if a value was successfully retrieved; otherwise, false. - - - - Returns an enumerator that iterates through the collection. - - - A that can be used to iterate through the collection. - - - - - Raises the event with the provided arguments. - - Name of the property. - - - - Raises the event with the provided arguments. - - Name of the property. - - - - Returns the properties for this instance of a component. - - - A that represents the properties for this component instance. - - - - - Returns the properties for this instance of a component using the attribute array as a filter. - - An array of type that is used as a filter. - - A that represents the filtered properties for this component instance. - - - - - Returns a collection of custom attributes for this instance of a component. - - - An containing the attributes for this object. - - - - - Returns the class name of this instance of a component. - - - The class name of the object, or null if the class does not have a name. - - - - - Returns the name of this instance of a component. - - - The name of the object, or null if the object does not have a name. - - - - - Returns a type converter for this instance of a component. - - - A that is the converter for this object, or null if there is no for this object. - - - - - Returns the default event for this instance of a component. - - - An that represents the default event for this object, or null if this object does not have events. - - - - - Returns the default property for this instance of a component. - - - A that represents the default property for this object, or null if this object does not have properties. - - - - - Returns an editor of the specified type for this instance of a component. - - A that represents the editor for this object. - - An of the specified type that is the editor for this object, or null if the editor cannot be found. - - - - - Returns the events for this instance of a component using the specified attribute array as a filter. - - An array of type that is used as a filter. - - An that represents the filtered events for this component instance. - - - - - Returns the events for this instance of a component. - - - An that represents the events for this component instance. - - - - - Returns an object that contains the property described by the specified property descriptor. - - A that represents the property whose owner is to be found. - - An that represents the owner of the specified property. - - - - - Returns the responsible for binding operations performed on this object. - - The expression tree representation of the runtime value. - - The to bind this object. - - - - - Gets the container's children tokens. - - The container's children tokens. - - - - Occurs when a property value changes. - - - - - Occurs when a property value is changing. - - - - - Gets the node type for this . - - The type. - - - - Gets the with the specified key. - - The with the specified key. - - - - Gets or sets the with the specified property name. - - - - - - Represents a JSON array. - - - - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class from another object. - - A object to copy from. - - - - Initializes a new instance of the class with the specified content. - - The contents of the array. - - - - Initializes a new instance of the class with the specified content. - - The contents of the array. - - - - Loads an from a . - - A that will be read for the content of the . - A that contains the JSON that was read from the specified . - - - - Load a from a string that contains JSON. - - A that contains JSON. - A populated from the string that contains JSON. - - - - - - - Creates a from an object. - - The object that will be used to create . - A with the values of the specified object - - - - Creates a from an object. - - The object that will be used to create . - The that will be used to read the object. - A with the values of the specified object - - - - Writes this token to a . - - A into which this method will write. - A collection of which will be used when writing the token. - - - - Determines the index of a specific item in the . - - The object to locate in the . - - The index of if found in the list; otherwise, -1. - - - - - Inserts an item to the at the specified index. - - The zero-based index at which should be inserted. - The object to insert into the . - - is not a valid index in the . - The is read-only. - - - - Removes the item at the specified index. - - The zero-based index of the item to remove. - - is not a valid index in the . - The is read-only. - - - - Returns an enumerator that iterates through the collection. - - - A that can be used to iterate through the collection. - - - - - Adds an item to the . - - The object to add to the . - The is read-only. - - - - Removes all items from the . - - The is read-only. - - - - Determines whether the contains a specific value. - - The object to locate in the . - - true if is found in the ; otherwise, false. - - - - - Copies to. - - The array. - Index of the array. - - - - Removes the first occurrence of a specific object from the . - - The object to remove from the . - - true if was successfully removed from the ; otherwise, false. This method also returns false if is not found in the original . - - The is read-only. - - - - Gets the container's children tokens. - - The container's children tokens. - - - - Gets the node type for this . - - The type. - - - - Gets the with the specified key. - - The with the specified key. - - - - Gets or sets the at the specified index. - - - - - - Gets a value indicating whether the is read-only. - - true if the is read-only; otherwise, false. - - - - Represents a reader that provides fast, non-cached, forward-only access to serialized Json data. - - - - - Initializes a new instance of the class. - - The token to read from. - - - - Reads the next JSON token from the stream as a . - - - A or a null reference if the next JSON token is null. This method will return null at the end of an array. - - - - - Reads the next JSON token from the stream as a . - - A . This method will return null at the end of an array. - - - - Reads the next JSON token from the stream as a . - - A . This method will return null at the end of an array. - - - - Reads the next JSON token from the stream as a . - - A . This method will return null at the end of an array. - - - - Reads the next JSON token from the stream as a . - - A . This method will return null at the end of an array. - - - - Reads the next JSON token from the stream as a . - - A . This method will return null at the end of an array. - - - - Reads the next JSON token from the stream. - - - true if the next token was read successfully; false if there are no more tokens to read. - - - - - Gets the path of the current JSON token. - - - - - Represents a writer that provides a fast, non-cached, forward-only way of generating Json data. - - - - - Initializes a new instance of the class writing to the given . - - The container being written to. - - - - Initializes a new instance of the class. - - - - - Flushes whatever is in the buffer to the underlying streams and also flushes the underlying stream. - - - - - Closes this stream and the underlying stream. - - - - - Writes the beginning of a Json object. - - - - - Writes the beginning of a Json array. - - - - - Writes the start of a constructor with the given name. - - The name of the constructor. - - - - Writes the end. - - The token. - - - - Writes the property name of a name/value pair on a Json object. - - The name of the property. - - - - Writes a value. - An error will raised if the value cannot be written as a single JSON token. - - The value to write. - - - - Writes a null value. - - - - - Writes an undefined value. - - - - - Writes raw JSON. - - The raw JSON to write. - - - - Writes out a comment /*...*/ containing the specified text. - - Text to place inside the comment. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Gets the token being writen. - - The token being writen. - - - - Represents a JSON property. - - - - - Initializes a new instance of the class from another object. - - A object to copy from. - - - - Initializes a new instance of the class. - - The property name. - The property content. - - - - Initializes a new instance of the class. - - The property name. - The property content. - - - - Writes this token to a . - - A into which this method will write. - A collection of which will be used when writing the token. - - - - Loads an from a . - - A that will be read for the content of the . - A that contains the JSON that was read from the specified . - - - - Gets the container's children tokens. - - The container's children tokens. - - - - Gets the property name. - - The property name. - - - - Gets or sets the property value. - - The property value. - - - - Gets the node type for this . - - The type. - - - - Specifies the type of token. - - - - - No token type has been set. - - - - - A JSON object. - - - - - A JSON array. - - - - - A JSON constructor. - - - - - A JSON object property. - - - - - A comment. - - - - - An integer value. - - - - - A float value. - - - - - A string value. - - - - - A boolean value. - - - - - A null value. - - - - - An undefined value. - - - - - A date value. - - - - - A raw JSON value. - - - - - A collection of bytes value. - - - - - A Guid value. - - - - - A Uri value. - - - - - A TimeSpan value. - - - - - Contains the JSON schema extension methods. - - - - - Determines whether the is valid. - - The source to test. - The schema to test with. - - true if the specified is valid; otherwise, false. - - - - - Determines whether the is valid. - - The source to test. - The schema to test with. - When this method returns, contains any error messages generated while validating. - - true if the specified is valid; otherwise, false. - - - - - Validates the specified . - - The source to test. - The schema to test with. - - - - Validates the specified . - - The source to test. - The schema to test with. - The validation event handler. - - - - Returns detailed information about the schema exception. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class - with a specified error message. - - The error message that explains the reason for the exception. - - - - Initializes a new instance of the class - with a specified error message and a reference to the inner exception that is the cause of this exception. - - The error message that explains the reason for the exception. - The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. - - - - Initializes a new instance of the class. - - The that holds the serialized object data about the exception being thrown. - The that contains contextual information about the source or destination. - The parameter is null. - The class name is null or is zero (0). - - - - Gets the line number indicating where the error occurred. - - The line number indicating where the error occurred. - - - - Gets the line position indicating where the error occurred. - - The line position indicating where the error occurred. - - - - Gets the path to the JSON where the error occurred. - - The path to the JSON where the error occurred. - - - - Resolves from an id. - - - - - Initializes a new instance of the class. - - - - - Gets a for the specified reference. - - The id. - A for the specified reference. - - - - Gets or sets the loaded schemas. - - The loaded schemas. - - - - Specifies undefined schema Id handling options for the . - - - - - Do not infer a schema Id. - - - - - Use the .NET type name as the schema Id. - - - - - Use the assembly qualified .NET type name as the schema Id. - - - - - Returns detailed information related to the . - - - - - Gets the associated with the validation error. - - The JsonSchemaException associated with the validation error. - - - - Gets the path of the JSON location where the validation error occurred. - - The path of the JSON location where the validation error occurred. - - - - Gets the text description corresponding to the validation error. - - The text description. - - - - Represents the callback method that will handle JSON schema validation events and the . - - - - - Resolves member mappings for a type, camel casing property names. - - - - - Used by to resolves a for a given . - - - - - Used by to resolves a for a given . - - - - - - - - - Resolves the contract for a given type. - - The type to resolve a contract for. - The contract for a given type. - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - - If set to true the will use a cached shared with other resolvers of the same type. - Sharing the cache will significantly performance because expensive reflection will only happen once but could cause unexpected - behavior if different instances of the resolver are suppose to produce different results. When set to false it is highly - recommended to reuse instances with the . - - - - - Resolves the contract for a given type. - - The type to resolve a contract for. - The contract for a given type. - - - - Gets the serializable members for the type. - - The type to get serializable members for. - The serializable members for the type. - - - - Creates a for the given type. - - Type of the object. - A for the given type. - - - - Creates the constructor parameters. - - The constructor to create properties for. - The type's member properties. - Properties for the given . - - - - Creates a for the given . - - The matching member property. - The constructor parameter. - A created for the given . - - - - Resolves the default for the contract. - - Type of the object. - The contract's default . - - - - Creates a for the given type. - - Type of the object. - A for the given type. - - - - Creates a for the given type. - - Type of the object. - A for the given type. - - - - Creates a for the given type. - - Type of the object. - A for the given type. - - - - Creates a for the given type. - - Type of the object. - A for the given type. - - - - Creates a for the given type. - - Type of the object. - A for the given type. - - - - Creates a for the given type. - - Type of the object. - A for the given type. - - - - Creates a for the given type. - - Type of the object. - A for the given type. - - - - Determines which contract type is created for the given type. - - Type of the object. - A for the given type. - - - - Creates properties for the given . - - The type to create properties for. - /// The member serialization mode for the type. - Properties for the given . - - - - Creates the used by the serializer to get and set values from a member. - - The member. - The used by the serializer to get and set values from a member. - - - - Creates a for the given . - - The member's parent . - The member to create a for. - A created for the given . - - - - Resolves the name of the property. - - Name of the property. - Name of the property. - - - - Gets the resolved name of the property. - - Name of the property. - Name of the property. - - - - Gets a value indicating whether members are being get and set using dynamic code generation. - This value is determined by the runtime permissions available. - - - true if using dynamic code generation; otherwise, false. - - - - - Gets or sets the default members search flags. - - The default members search flags. - - - - Gets or sets a value indicating whether compiler generated members should be serialized. - - - true if serialized compiler generated members; otherwise, false. - - - - - Gets or sets a value indicating whether to ignore the interface when serializing and deserializing types. - - - true if the interface will be ignored when serializing and deserializing types; otherwise, false. - - - - - Gets or sets a value indicating whether to ignore the attribute when serializing and deserializing types. - - - true if the attribute will be ignored when serializing and deserializing types; otherwise, false. - - - - - Initializes a new instance of the class. - - - - - Resolves the name of the property. - - Name of the property. - The property name camel cased. - - - - The default serialization binder used when resolving and loading classes from type names. - - - - - When overridden in a derived class, controls the binding of a serialized object to a type. - - Specifies the name of the serialized object. - Specifies the name of the serialized object. - - The type of the object the formatter creates a new instance of. - - - - - When overridden in a derived class, controls the binding of a serialized object to a type. - - The type of the object the formatter creates a new instance of. - Specifies the name of the serialized object. - Specifies the name of the serialized object. - - - - Provides information surrounding an error. - - - - - Gets the error. - - The error. - - - - Gets the original object that caused the error. - - The original object that caused the error. - - - - Gets the member that caused the error. - - The member that caused the error. - - - - Gets the path of the JSON location where the error occurred. - - The path of the JSON location where the error occurred. - - - - Gets or sets a value indicating whether this is handled. - - true if handled; otherwise, false. - - - - Contract details for a used by the . - - - - - Initializes a new instance of the class. - - The underlying type for the contract. - - - - Gets the of the collection items. - - The of the collection items. - - - - Gets a value indicating whether the collection type is a multidimensional array. - - true if the collection type is a multidimensional array; otherwise, false. - - - - Handles serialization callback events. - - The object that raised the callback event. - The streaming context. - - - - Handles serialization error callback events. - - The object that raised the callback event. - The streaming context. - The error context. - - - - Sets extension data for an object during deserialization. - - The object to set extension data on. - The extension data key. - The extension data value. - - - - Gets extension data for an object during serialization. - - The object to set extension data on. - - - - Contract details for a used by the . - - - - - Initializes a new instance of the class. - - The underlying type for the contract. - - - - Gets or sets the property name resolver. - - The property name resolver. - - - - Gets the of the dictionary keys. - - The of the dictionary keys. - - - - Gets the of the dictionary values. - - The of the dictionary values. - - - - Maps a JSON property to a .NET member or constructor parameter. - - - - - Returns a that represents this instance. - - - A that represents this instance. - - - - - Gets or sets the name of the property. - - The name of the property. - - - - Gets or sets the type that declared this property. - - The type that declared this property. - - - - Gets or sets the order of serialization and deserialization of a member. - - The numeric order of serialization or deserialization. - - - - Gets or sets the name of the underlying member or parameter. - - The name of the underlying member or parameter. - - - - Gets the that will get and set the during serialization. - - The that will get and set the during serialization. - - - - Gets or sets the type of the property. - - The type of the property. - - - - Gets or sets the for the property. - If set this converter takes presidence over the contract converter for the property type. - - The converter. - - - - Gets or sets the member converter. - - The member converter. - - - - Gets or sets a value indicating whether this is ignored. - - true if ignored; otherwise, false. - - - - Gets or sets a value indicating whether this is readable. - - true if readable; otherwise, false. - - - - Gets or sets a value indicating whether this is writable. - - true if writable; otherwise, false. - - - - Gets or sets a value indicating whether this has a member attribute. - - true if has a member attribute; otherwise, false. - - - - Gets the default value. - - The default value. - - - - Gets or sets a value indicating whether this is required. - - A value indicating whether this is required. - - - - Gets or sets a value indicating whether this property preserves object references. - - - true if this instance is reference; otherwise, false. - - - - - Gets or sets the property null value handling. - - The null value handling. - - - - Gets or sets the property default value handling. - - The default value handling. - - - - Gets or sets the property reference loop handling. - - The reference loop handling. - - - - Gets or sets the property object creation handling. - - The object creation handling. - - - - Gets or sets or sets the type name handling. - - The type name handling. - - - - Gets or sets a predicate used to determine whether the property should be serialize. - - A predicate used to determine whether the property should be serialize. - - - - Gets or sets a predicate used to determine whether the property should be serialized. - - A predicate used to determine whether the property should be serialized. - - - - Gets or sets an action used to set whether the property has been deserialized. - - An action used to set whether the property has been deserialized. - - - - Gets or sets the converter used when serializing the property's collection items. - - The collection's items converter. - - - - Gets or sets whether this property's collection items are serialized as a reference. - - Whether this property's collection items are serialized as a reference. - - - - Gets or sets the the type name handling used when serializing the property's collection items. - - The collection's items type name handling. - - - - Gets or sets the the reference loop handling used when serializing the property's collection items. - - The collection's items reference loop handling. - - - - A collection of objects. - - - - - Initializes a new instance of the class. - - The type. - - - - When implemented in a derived class, extracts the key from the specified element. - - The element from which to extract the key. - The key for the specified element. - - - - Adds a object. - - The property to add to the collection. - - - - Gets the closest matching object. - First attempts to get an exact case match of propertyName and then - a case insensitive match. - - Name of the property. - A matching property if found. - - - - Gets a property by property name. - - The name of the property to get. - Type property name string comparison. - A matching property if found. - - - - Specifies missing member handling options for the . - - - - - Ignore a missing member and do not attempt to deserialize it. - - - - - Throw a when a missing member is encountered during deserialization. - - - - - Specifies null value handling options for the . - - - - - - - - - Include null values when serializing and deserializing objects. - - - - - Ignore null values when serializing and deserializing objects. - - - - - Specifies reference loop handling options for the . - - - - - Throw a when a loop is encountered. - - - - - Ignore loop references and do not serialize. - - - - - Serialize loop references. - - - - - An in-memory representation of a JSON Schema. - - - - - Initializes a new instance of the class. - - - - - Reads a from the specified . - - The containing the JSON Schema to read. - The object representing the JSON Schema. - - - - Reads a from the specified . - - The containing the JSON Schema to read. - The to use when resolving schema references. - The object representing the JSON Schema. - - - - Load a from a string that contains schema JSON. - - A that contains JSON. - A populated from the string that contains JSON. - - - - Parses the specified json. - - The json. - The resolver. - A populated from the string that contains JSON. - - - - Writes this schema to a . - - A into which this method will write. - - - - Writes this schema to a using the specified . - - A into which this method will write. - The resolver used. - - - - Returns a that represents the current . - - - A that represents the current . - - - - - Gets or sets the id. - - - - - Gets or sets the title. - - - - - Gets or sets whether the object is required. - - - - - Gets or sets whether the object is read only. - - - - - Gets or sets whether the object is visible to users. - - - - - Gets or sets whether the object is transient. - - - - - Gets or sets the description of the object. - - - - - Gets or sets the types of values allowed by the object. - - The type. - - - - Gets or sets the pattern. - - The pattern. - - - - Gets or sets the minimum length. - - The minimum length. - - - - Gets or sets the maximum length. - - The maximum length. - - - - Gets or sets a number that the value should be divisble by. - - A number that the value should be divisble by. - - - - Gets or sets the minimum. - - The minimum. - - - - Gets or sets the maximum. - - The maximum. - - - - Gets or sets a flag indicating whether the value can not equal the number defined by the "minimum" attribute. - - A flag indicating whether the value can not equal the number defined by the "minimum" attribute. - - - - Gets or sets a flag indicating whether the value can not equal the number defined by the "maximum" attribute. - - A flag indicating whether the value can not equal the number defined by the "maximum" attribute. - - - - Gets or sets the minimum number of items. - - The minimum number of items. - - - - Gets or sets the maximum number of items. - - The maximum number of items. - - - - Gets or sets the of items. - - The of items. - - - - Gets or sets a value indicating whether items in an array are validated using the instance at their array position from . - - - true if items are validated using their array position; otherwise, false. - - - - - Gets or sets the of additional items. - - The of additional items. - - - - Gets or sets a value indicating whether additional items are allowed. - - - true if additional items are allowed; otherwise, false. - - - - - Gets or sets whether the array items must be unique. - - - - - Gets or sets the of properties. - - The of properties. - - - - Gets or sets the of additional properties. - - The of additional properties. - - - - Gets or sets the pattern properties. - - The pattern properties. - - - - Gets or sets a value indicating whether additional properties are allowed. - - - true if additional properties are allowed; otherwise, false. - - - - - Gets or sets the required property if this property is present. - - The required property if this property is present. - - - - Gets or sets the a collection of valid enum values allowed. - - A collection of valid enum values allowed. - - - - Gets or sets disallowed types. - - The disallow types. - - - - Gets or sets the default value. - - The default value. - - - - Gets or sets the collection of that this schema extends. - - The collection of that this schema extends. - - - - Gets or sets the format. - - The format. - - - - Generates a from a specified . - - - - - Generate a from the specified type. - - The type to generate a from. - A generated from the specified type. - - - - Generate a from the specified type. - - The type to generate a from. - The used to resolve schema references. - A generated from the specified type. - - - - Generate a from the specified type. - - The type to generate a from. - Specify whether the generated root will be nullable. - A generated from the specified type. - - - - Generate a from the specified type. - - The type to generate a from. - The used to resolve schema references. - Specify whether the generated root will be nullable. - A generated from the specified type. - - - - Gets or sets how undefined schemas are handled by the serializer. - - - - - Gets or sets the contract resolver. - - The contract resolver. - - - - The value types allowed by the . - - - - - No type specified. - - - - - String type. - - - - - Float type. - - - - - Integer type. - - - - - Boolean type. - - - - - Object type. - - - - - Array type. - - - - - Null type. - - - - - Any type. - - - - - Contract details for a used by the . - - - - - Initializes a new instance of the class. - - The underlying type for the contract. - - - - Gets or sets the object member serialization. - - The member object serialization. - - - - Gets or sets a value that indicates whether the object's properties are required. - - - A value indicating whether the object's properties are required. - - - - - Gets the object's properties. - - The object's properties. - - - - Gets the constructor parameters required for any non-default constructor - - - - - Gets or sets the override constructor used to create the object. - This is set when a constructor is marked up using the - JsonConstructor attribute. - - The override constructor. - - - - Gets or sets the parametrized constructor used to create the object. - - The parametrized constructor. - - - - Gets or sets the extension data setter. - - - - - Gets or sets the extension data getter. - - - - - Contract details for a used by the . - - - - - Initializes a new instance of the class. - - The underlying type for the contract. - - - - Get and set values for a using reflection. - - - - - Initializes a new instance of the class. - - The member info. - - - - Sets the value. - - The target to set the value on. - The value to set on the target. - - - - Gets the value. - - The target to get the value from. - The value. - - - - When applied to a method, specifies that the method is called when an error occurs serializing an object. - - - - - Helper method for generating a MetaObject which calls a - specific method on Dynamic that returns a result - - - - - Helper method for generating a MetaObject which calls a - specific method on Dynamic, but uses one of the arguments for - the result. - - - - - Helper method for generating a MetaObject which calls a - specific method on Dynamic, but uses one of the arguments for - the result. - - - - - Returns a Restrictions object which includes our current restrictions merged - with a restriction limiting our type - - - - - Represents a method that constructs an object. - - The object type to create. - - - - Specifies type name handling options for the . - - - - - Do not include the .NET type name when serializing types. - - - - - Include the .NET type name when serializing into a JSON object structure. - - - - - Include the .NET type name when serializing into a JSON array structure. - - - - - Always include the .NET type name when serializing. - - - - - Include the .NET type name when the type of the object being serialized is not the same as its declared type. - - - - - Converts the value to the specified type. If the value is unable to be converted, the - value is checked whether it assignable to the specified type. - - The value to convert. - The culture to use when converting. - The type to convert or cast the value to. - - The converted type. If conversion was unsuccessful, the initial value - is returned if assignable to the target type. - - - - - Gets a dictionary of the names and values of an Enum type. - - - - - - Gets a dictionary of the names and values of an Enum type. - - The enum type to get names and values for. - - - - - Specifies the type of Json token. - - - - - This is returned by the if a method has not been called. - - - - - An object start token. - - - - - An array start token. - - - - - A constructor start token. - - - - - An object property name. - - - - - A comment. - - - - - Raw JSON. - - - - - An integer. - - - - - A float. - - - - - A string. - - - - - A boolean. - - - - - A null token. - - - - - An undefined token. - - - - - An object end token. - - - - - An array end token. - - - - - A constructor end token. - - - - - A Date. - - - - - Byte data. - - - - - Builds a string. Unlike StringBuilder this class lets you reuse it's internal buffer. - - - - - Determines whether the collection is null or empty. - - The collection. - - true if the collection is null or empty; otherwise, false. - - - - - Adds the elements of the specified collection to the specified generic IList. - - The list to add to. - The collection of elements to add. - - - - Returns the index of the first occurrence in a sequence by using a specified IEqualityComparer. - - The type of the elements of source. - A sequence in which to locate a value. - The object to locate in the sequence - An equality comparer to compare values. - The zero-based index of the first occurrence of value within the entire sequence, if found; otherwise, –1. - - - - Gets the type of the typed collection's items. - - The type. - The type of the typed collection's items. - - - - Gets the member's underlying type. - - The member. - The underlying type of the member. - - - - Determines whether the member is an indexed property. - - The member. - - true if the member is an indexed property; otherwise, false. - - - - - Determines whether the property is an indexed property. - - The property. - - true if the property is an indexed property; otherwise, false. - - - - - Gets the member's value on the object. - - The member. - The target object. - The member's value on the object. - - - - Sets the member's value on the target object. - - The member. - The target. - The value. - - - - Determines whether the specified MemberInfo can be read. - - The MemberInfo to determine whether can be read. - /// if set to true then allow the member to be gotten non-publicly. - - true if the specified MemberInfo can be read; otherwise, false. - - - - - Determines whether the specified MemberInfo can be set. - - The MemberInfo to determine whether can be set. - if set to true then allow the member to be set non-publicly. - if set to true then allow the member to be set if read-only. - - true if the specified MemberInfo can be set; otherwise, false. - - - - - Determines whether the string is all white space. Empty string will return false. - - The string to test whether it is all white space. - - true if the string is all white space; otherwise, false. - - - - - Nulls an empty string. - - The string. - Null if the string was null, otherwise the string unchanged. - - - - Specifies the state of the . - - - - - An exception has been thrown, which has left the in an invalid state. - You may call the method to put the in the Closed state. - Any other method calls results in an being thrown. - - - - - The method has been called. - - - - - An object is being written. - - - - - A array is being written. - - - - - A constructor is being written. - - - - - A property is being written. - - - - - A write method has not been called. - - - - diff --git a/Interfax.ClientLib/bin/Release/Interfax.ClientLib.XML b/Interfax.ClientLib/bin/Release/Interfax.ClientLib.XML deleted file mode 100644 index 5c3b720..0000000 --- a/Interfax.ClientLib/bin/Release/Interfax.ClientLib.XML +++ /dev/null @@ -1,961 +0,0 @@ - - - - Interfax.ClientLib - - - - - Represents Accounts service - - - - - Base class for services classes - - - - - Constructor - - The base path for the specific service - Interfax User Id - Interfax password - Request timeout (optional, default is 30 sec.) - The service end point (optional). Default is live service - - - - The Http client to use - - - - - Send a Get request and populate a response to a .NET object of a given type - - Type of result - Request Uri - Output: the resulting object - The request status - - - - Send a Get request and populate a binary response - - Request Uri - Output: the resulting binary data - The request status - - - - Send a POST request with content of a given type and populate a response on another type - - Type of input - Type of result - Request Uri - Input object - Output: the resulting object - The request status - - - - Send a POST request with no content and no returned object - - Request Uri - The request status - - - - Send a POST request with no content and no returned object - - Request Uri - Output: The value in the Locationn Http header - Optional: the content to be posted - The request status - - - - Send a POST request with binary content and no returned object - - Request Uri - Binary data to be sent - The request status - - - - Send a POST request with binary content and no returned object - - Request Uri - Binary data to be sent - position in data to start transfer from - Number of bytes from offset to transfer - The request status - - - - Sends a Delete Http request to a given Uri - - the Uri - The request status - - - - Send a POST request with binary content and no returned object - - Request Uri - Content to be posted - Optional: a range header to be set (default is null) - The request status - - - - Get an object of a given type from a binary content - - The type of the resulting object - binary content - Output: the resulting object - The request status - - - - Perse a response and get its content as binary data - - The ResponseMessage object received from server - The resulting byte array - The request status - - - - Try to extract an error block from the response content and deserialize it - - The response message object - - - - Error message of last operation - - - - - Detailed error block of last operation - - - - - Constructor - - Interfax User Id - Interfax password - Request timeout (optional, default is 30 sec.) - The service end point (optional). Default is live service - - - - Determine the remaining faxing credits in your account (in the account's currency). - - The found balance - Request status - - - - Represents detailed error reporting block - - - - - Code as returned from service - - - - - The base error message - - - - - Detailed information about the error - - - - - Meta-data of an inbound fax - - - - - The ID of this transaction - - - - - The time and date that the fax was received (in GMT) - - - - - The Phone number at which this fax was received - - - - - The caller ID of the sender - - - - - The CSID of the sender - - - - - The number of pages received in this fax. - - - - - Status of the fax. See the list of InterFAX Error Codes - - - - - The time (in seconds) that it took to receive the fax - - - - - Represents a single document to be faxes - - - - - Represents an already-uploaded document to be faxed - - - - - The uri of the uploaded document as returned by calling Upload() method - - - - - Represents a single document with inline content to be faxes - - - - - Constructor: Initialize with a file - - The fully qualified path to the file containing the document to be faxed - In case of a text (e.g Html), this should be specified - - - - Constructor: Initialize with a Stream - - The IO stream containing the document to be faxed - The type of the document to be faxed (e.g 'pdf') - Optional (default=true), tells the method whether to close the stream after using its data - In case of a text (e.g Html), this should be specified - - - - Constructor: Initialize with a byte array - - The byte-array containing the document to be faxed - The type of the document to be faxed (e.g 'pdf') - In case of a text (e.g Html), this should be specified - - - - The raw data - - - - - The type of the document to be faxed (e.g 'pdf') - - - - - The character set encoding (applies in case of textual content) - - - - - Represents an outbound fax - - - - - Represents an outbound fax summary information - - - - - A unique identifier for the fax. - - - - - A unique resource locator for the fax. - - - - - Fax status. Generally, 0= OK; less than 0 = in process; greater than 0 = Error (See Interfax Status Codes) - - - - - The submitting user. - - - - - Number of successfully sent pages. - - - - - End time of last of all transmission attempts. Always returned in GMT. - - - - - Receiving party fax ID (up to 20 characters). - - - - - Transmission time in seconds. - - - - - For internal use. - - - - - Decimal number of units to be billed (pages or tenths of minutes) - - - - - Monetary units, in account currency. Multiply this by 'Units' to get tde actual cost of the fax. - - - - - Page size: a4, letter, legal, or b4 - - - - - portrait or landscape - - - - - standard or fine - - - - - greyscale or bw - - - - - The fax header text inserted at the top of the page. - - - - - Time when the transaction was originally submitted. Always returned in GMT. - - - - - A name or other optional identifier. - - - - - The resolved fax number to which the fax was sent. - - - - - Contact name provided during submission - - - - - E-mail address(es) for confirmation message. - - - - - Total number of pages submitted. - - - - - Sender's fax ID. - - - - - Maximum number of transmission attempts requested in case of fax transmission failure. - - - - - represents a single uploaded document meta data - - - - - Username under which document was created. - - - - - The filename provided when the document was uploaded, e.g. newsletter.pdf - - - - - The planned size in bytes of the document. - - - - - The number of bytes actually uploaded. - - - - - Fully-qualified resource URI of the document. - - - - - Time (UTC) when the document was created - - - - - Time (UTC) when the document was last used - - - - - Current status of the document - - - - - Document disposition definition - - - - - Document sharing definition - - - - - Upload documents disposition - - - - - can be used once - - - - - deleted 60 minutes after the last usage - - - - - remains available until specifically removed by user - - - - - Document upload status - - - - - Upload session was started, but no data has been uploaded - - - - - Upload session was started, and some (not complete) data has been uploaded - - - - - Data upload is in progress - - - - - Document is ready to be used - - - - - Document is being deleted - - - - - Represents supported page sizes - - - - - High resolution (approx. 100 x 200); Optimized size and transmission time - - - - - High resolution (approx. 200 x 200); Better quality with higher size and transmission time - - - - - Represents supported page sizes - - - - - Black and white; Optimized for text-intensive document - - - - - Grey scale; Optimized for image-intensive document - - - - - Represents supported page sizes - - - - - Portrait - - - - - Landscape - - - - - Represents supported page sizes - - - - - A4 page size (common outside North America) - - - - - Letter page size (common in North America) - - - - - Legal page size (common in North America) - - - - - B4 page size (used mainly in Japan) - - - - - Status for requests - - - - - Success - - - - - Resource created - - - - - Request accepted, but resource is not completed - - - - - Resource not found - - - - - System error - - - - - Request time out - - - - - Authentication error - - - - - Request was over limit(s) - - - - - The request has some bad input. - - - - - Sharing options - - - - - Only owner user can access the resource - - - - - All users in the account can access the resource - - - - - Defines groups of statuses - - - - - any status - - - - - A specific status - - - - - Completed faxes, whether successful or failed - - - - - successfully-completed faxes - - - - - failed faxes - - - - - faxes in process (not completed) - - - - - Client for the Inbound fax service - - - - - Constructor - - Interfax User Id - Interfax password - Request timeout (optional, default is 30 sec.) - The service end point (optional). Default is live service - - - - Retrieves a user's list of inbound faxes. (Sort order is always in descending ID). - - output: The list of meta data for each fax - Optional: Return results from this ID backwards (not including this ID). Used for pagination. //TODO: check sort order - Optional (default is false). Return only unread faxes? - Optional (default is 25). How many transactions to return. - Optional (default is false). For a "primary" user, determines whether to return data for the current user only or for all account users. - Request status - - - - Retrieve meta data for a specific fax - - Transaction Id - Output: The meta data for the fax - Request status - - - - Retrieve Image data for a specific fax, Format is determined by the user's setting - - Transaction Id - Output: The image data for the fax - Request status - - - - Mark an image as read (or unread) - - Transaction Id - Optional: set false to mark as Unread - - - - - Represents the document upload facility for outbound faxing - - - - - Constructor - - Interfax User Id - Interfax password - Request timeout (optional, default is 30 sec.) - The service end point (optional). Default is live service - - - - Uploads an entire document in chuncks - - Output: the Uri for the created document - Document data - The document file name, which can subsequently be queried with the Get fax list operation. The filename must end with an extension defining the file type, e.g. dailyrates.docx or newsletter.pdf, and the file type must be in the list of supported file types. - size in bytes for data to uload in each HTTP request - This sets the retention policy of the uploaded document, that is, how long it can be used by the POST - private or shared - The request status - - - - Get a list of previous document uploads which are currently available. - - How many document references to return. - Skip this many document references in the list. - Output: the list of documents - The request status - - - - Retrieve the meta data about a document - - - - The request status - - - - Delete an uploaded document (also cancels an uploaded document session) - - Id obtained during call to D - The request status - - - - Proxy class for fax outbound service - - - - - Constructor - - Interfax User Id - Interfax password - Request timeout (optional, default is 30 sec.) - The service end point (optional). Default is live service - - - - Submit a fax containing one document from file - - A single fax number, e.g: +1-212-3456789 - Output: the URI of the newly-created fax resource - The fully qualified path to the file containing the document to be faxed - In case of a text (e.g Html), this should be specified - The request status; If successful, a 201 Created status is returned - - - - Submit a fax containing one document from stream - - A single fax number, e.g: +1-212-3456789 - Output: the URI of the newly-created fax resource - The IO stream containing the document to be faxed - The type of the document to be faxed (e.g 'pdf') - Optional (default=true), tells the method whether to close the stream after using its data - In case of a text (e.g Html), this should be specified - The request status; If successful, a 201 Created status is returned - - - - Submit a fax containing one document from byte array - - Output: the URI of the newly-created fax resource - A single fax number, e.g: +1-212-3456789 - The byte-array containing the document to be faxed - The type of the document to be faxed (e.g 'pdf') - In case of a text (e.g Html), this should be specified - The request status; If successful, a 201 Created status is returned - - - - Submit a fax with multiple documents and extended options - - A single fax number, e.g: +1-212-3456789 - Output: the URI of the newly-created fax resource - list of documents to be faxed, in that order of pages - - A name or other reference. The entered string will appear: - (1) for reference in the outbound queue; - (2) in the outbound fax header, if headers are configured; and - (3) in subsequent queries of the fax object. - Time to schedule the transmission. - Number of transmission attempts to perform, in case of fax transmission failure. - Sender CSID (up to 20 ascii characters) - The fax header text to insert at the top of the page - Provide your internal ID to a document. This parameter can be obtained by status query, but is not included in the transmitted fax message. - E-mail address to which feedback messages will be sent. - page size - True to fit an image to the designated page size - portrait or landscape - Documents rendered as fine may be more readable but take longer to transmit (and may therefore be more costly). - Determines the rendering mode. bw is recommended for textual, black and white documents, while greyscale is better for greyscale text and for images. - - - - - Create an Http content out of an abstract OutboundDocument - - The OutboundDocument to fax - Http Content - - - - Get a list of recent outbound faxes (which does not include batch faxes). - - Output: the returned list - (optional) Return results from this ID onwards (not including this ID). Used for pagination. - If not provided, MaxValue is set when sortOrder is descending; zero when sortOrder is ascending. - (Optional) How many transactions to return. - Set to false for ascending order - (Optional, Default is Current user provided in credentials). Enables a "primary" user to query for other account users' faxes. - The request status - - - - Get details for a subset of completed faxes from a submitted list. (Submitted id's which have not completed are ignored). - - Output: the returned list - List of transactions to query - The request status - - - - Retrieves information regarding a previously-submitted fax, including its current status. - - The - The transaction ID of the fax for which to retrieve data. - The request status - - - - Retrieve the fax image (TIFF file) of a submitted fax. - - If successful, the response returns a TIFF file (image/tiff) of the outgoing fax image. - The transaction ID of the fax for which to retrieve data. - The request status - - - - Search outbound faxes - - Output: the returned list - (Optional, default is no restriction) List of fax IDs - (Optional, default is no restriction) The 'reference' parameter entered at submit time - (Optional, default is no restriction) Lower bound of date range from which to return faxes (GMT) - (Optional, default is no restriction) Upper bound of date range frrom which to return faxes - (Optional, default is 'All') The status family of faxes to return - Must be used in case the statusFamily is set to 'Specific' - (Optional, default is no restriction) Limit returned faxes to these user ID's. This parameter has effect only when the querying username is a "primary" user. - (Optional, default is no restriction) Limit returned faxes to this destination fax number. - Set to false for ascending order - (Optional) How many transactions to return. - (Optional) Skip this many records - The request status - - - - Cancel a fax in progress. - - ID of the fax to be cancelled. - The request status - - - - The resent fax is allocated a new transaction ID. - - Output: the URI of the newly-created fax resource - ID of the fax to be cancelled. - A single fax number, e.g: +1-212-3456789 - The request status - - - - Hide a fax from listing in queries (there is no way to unhide a fax). - - - - - - - Helper - get media type by file type - - - - - Static constructor - load xml into a dictionary - - - - - Get media type by file type - - file type - media type - - - diff --git a/Interfax.ClientLib/bin/Release/Interfax.ClientLib.pdb b/Interfax.ClientLib/bin/Release/Interfax.ClientLib.pdb deleted file mode 100644 index 7713082..0000000 Binary files a/Interfax.ClientLib/bin/Release/Interfax.ClientLib.pdb and /dev/null differ diff --git a/Interfax.ClientLib/bin/Release/Newtonsoft.Json.xml b/Interfax.ClientLib/bin/Release/Newtonsoft.Json.xml deleted file mode 100644 index 4975984..0000000 --- a/Interfax.ClientLib/bin/Release/Newtonsoft.Json.xml +++ /dev/null @@ -1,8488 +0,0 @@ - - - - Newtonsoft.Json - - - - - Represents a reader that provides fast, non-cached, forward-only access to serialized Json data. - - - - - Represents a reader that provides fast, non-cached, forward-only access to serialized Json data. - - - - - Initializes a new instance of the class with the specified . - - - - - Reads the next JSON token from the stream. - - true if the next token was read successfully; false if there are no more tokens to read. - - - - Reads the next JSON token from the stream as a . - - A . This method will return null at the end of an array. - - - - Reads the next JSON token from the stream as a . - - A . This method will return null at the end of an array. - - - - Reads the next JSON token from the stream as a . - - A or a null reference if the next JSON token is null. This method will return null at the end of an array. - - - - Reads the next JSON token from the stream as a . - - A . This method will return null at the end of an array. - - - - Reads the next JSON token from the stream as a . - - A . This method will return null at the end of an array. - - - - Reads the next JSON token from the stream as a . - - A . This method will return null at the end of an array. - - - - Skips the children of the current token. - - - - - Sets the current token. - - The new token. - - - - Sets the current token and value. - - The new token. - The value. - - - - Sets the state based on current token type. - - - - - Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. - - - - - Releases unmanaged and - optionally - managed resources - - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - - Changes the to Closed. - - - - - Gets the current reader state. - - The current reader state. - - - - Gets or sets a value indicating whether the underlying stream or - should be closed when the reader is closed. - - - true to close the underlying stream or when - the reader is closed; otherwise false. The default is true. - - - - - Gets or sets a value indicating whether multiple pieces of JSON content can - be read from a continuous stream without erroring. - - - true to support reading multiple pieces of JSON content; otherwise false. The default is false. - - - - - Gets the quotation mark character used to enclose the value of a string. - - - - - Get or set how time zones are handling when reading JSON. - - - - - Get or set how date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed when reading JSON. - - - - - Get or set how floating point numbers, e.g. 1.0 and 9.9, are parsed when reading JSON text. - - - - - Get or set how custom date formatted strings are parsed when reading JSON. - - - - - Gets or sets the maximum depth allowed when reading JSON. Reading past this depth will throw a . - - - - - Gets the type of the current JSON token. - - - - - Gets the text value of the current JSON token. - - - - - Gets The Common Language Runtime (CLR) type for the current JSON token. - - - - - Gets the depth of the current token in the JSON document. - - The depth of the current token in the JSON document. - - - - Gets the path of the current JSON token. - - - - - Gets or sets the culture used when reading JSON. Defaults to . - - - - - Specifies the state of the reader. - - - - - The Read method has not been called. - - - - - The end of the file has been reached successfully. - - - - - Reader is at a property. - - - - - Reader is at the start of an object. - - - - - Reader is in an object. - - - - - Reader is at the start of an array. - - - - - Reader is in an array. - - - - - The Close method has been called. - - - - - Reader has just read a value. - - - - - Reader is at the start of a constructor. - - - - - Reader in a constructor. - - - - - An error occurred that prevents the read operation from continuing. - - - - - The end of the file has been reached successfully. - - - - - Initializes a new instance of the class. - - The stream. - - - - Initializes a new instance of the class. - - The reader. - - - - Initializes a new instance of the class. - - The stream. - if set to true the root object will be read as a JSON array. - The used when reading values from BSON. - - - - Initializes a new instance of the class. - - The reader. - if set to true the root object will be read as a JSON array. - The used when reading values from BSON. - - - - Reads the next JSON token from the stream as a . - - - A or a null reference if the next JSON token is null. This method will return null at the end of an array. - - - - - Reads the next JSON token from the stream as a . - - A . This method will return null at the end of an array. - - - - Reads the next JSON token from the stream as a . - - A . This method will return null at the end of an array. - - - - Reads the next JSON token from the stream as a . - - A . This method will return null at the end of an array. - - - - Reads the next JSON token from the stream as a . - - A . This method will return null at the end of an array. - - - - Reads the next JSON token from the stream as a . - - - A . This method will return null at the end of an array. - - - - - Reads the next JSON token from the stream. - - - true if the next token was read successfully; false if there are no more tokens to read. - - - - - Changes the to Closed. - - - - - Gets or sets a value indicating whether binary data reading should compatible with incorrect Json.NET 3.5 written binary. - - - true if binary data reading will be compatible with incorrect Json.NET 3.5 written binary; otherwise, false. - - - - - Gets or sets a value indicating whether the root object will be read as a JSON array. - - - true if the root object will be read as a JSON array; otherwise, false. - - - - - Gets or sets the used when reading values from BSON. - - The used when reading values from BSON. - - - - Represents a writer that provides a fast, non-cached, forward-only way of generating JSON data. - - - - - Represents a writer that provides a fast, non-cached, forward-only way of generating Json data. - - - - - Creates an instance of the JsonWriter class. - - - - - Flushes whatever is in the buffer to the underlying streams and also flushes the underlying stream. - - - - - Closes this stream and the underlying stream. - - - - - Writes the beginning of a Json object. - - - - - Writes the end of a Json object. - - - - - Writes the beginning of a Json array. - - - - - Writes the end of an array. - - - - - Writes the start of a constructor with the given name. - - The name of the constructor. - - - - Writes the end constructor. - - - - - Writes the property name of a name/value pair on a JSON object. - - The name of the property. - - - - Writes the property name of a name/value pair on a JSON object. - - The name of the property. - A flag to indicate whether the text should be escaped when it is written as a JSON property name. - - - - Writes the end of the current Json object or array. - - - - - Writes the current token and its children. - - The to read the token from. - - - - Writes the current token. - - The to read the token from. - A flag indicating whether the current token's children should be written. - - - - Writes the specified end token. - - The end token to write. - - - - Writes indent characters. - - - - - Writes the JSON value delimiter. - - - - - Writes an indent space. - - - - - Writes a null value. - - - - - Writes an undefined value. - - - - - Writes raw JSON without changing the writer's state. - - The raw JSON to write. - - - - Writes raw JSON where a value is expected and updates the writer's state. - - The raw JSON to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - An error will raised if the value cannot be written as a single JSON token. - - The value to write. - - - - Writes out a comment /*...*/ containing the specified text. - - Text to place inside the comment. - - - - Writes out the given white space. - - The string of white space characters. - - - - Sets the state of the JsonWriter, - - The JsonToken being written. - The value being written. - - - - Gets or sets a value indicating whether the underlying stream or - should be closed when the writer is closed. - - - true to close the underlying stream or when - the writer is closed; otherwise false. The default is true. - - - - - Gets the top. - - The top. - - - - Gets the state of the writer. - - - - - Gets the path of the writer. - - - - - Indicates how JSON text output is formatted. - - - - - Get or set how dates are written to JSON text. - - - - - Get or set how time zones are handling when writing JSON text. - - - - - Get or set how strings are escaped when writing JSON text. - - - - - Get or set how special floating point numbers, e.g. , - and , - are written to JSON text. - - - - - Get or set how and values are formatting when writing JSON text. - - - - - Gets or sets the culture used when writing JSON. Defaults to . - - - - - Initializes a new instance of the class. - - The stream. - - - - Initializes a new instance of the class. - - The writer. - - - - Flushes whatever is in the buffer to the underlying streams and also flushes the underlying stream. - - - - - Writes the end. - - The token. - - - - Writes out a comment /*...*/ containing the specified text. - - Text to place inside the comment. - - - - Writes the start of a constructor with the given name. - - The name of the constructor. - - - - Writes raw JSON. - - The raw JSON to write. - - - - Writes raw JSON where a value is expected and updates the writer's state. - - The raw JSON to write. - - - - Writes the beginning of a Json array. - - - - - Writes the beginning of a Json object. - - - - - Writes the property name of a name/value pair on a Json object. - - The name of the property. - - - - Closes this stream and the underlying stream. - - - - - Writes a value. - An error will raised if the value cannot be written as a single JSON token. - - The value to write. - - - - Writes a null value. - - - - - Writes an undefined value. - - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value that represents a BSON object id. - - The Object ID value to write. - - - - Writes a BSON regex. - - The regex pattern. - The regex options. - - - - Gets or sets the used when writing values to BSON. - When set to no conversion will occur. - - The used when writing values to BSON. - - - - Represents a BSON Oid (object id). - - - - - Initializes a new instance of the class. - - The Oid value. - - - - Gets or sets the value of the Oid. - - The value of the Oid. - - - - Converts a binary value to and from a base 64 string value. - - - - - Converts an object to and from JSON. - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Gets the of the JSON produced by the JsonConverter. - - The of the JSON produced by the JsonConverter. - - - - Gets a value indicating whether this can read JSON. - - true if this can read JSON; otherwise, false. - - - - Gets a value indicating whether this can write JSON. - - true if this can write JSON; otherwise, false. - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Converts a to and from JSON. - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Determines whether this instance can convert the specified value type. - - Type of the value. - - true if this instance can convert the specified value type; otherwise, false. - - - - - Converts a to and from JSON. - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Determines whether this instance can convert the specified value type. - - Type of the value. - - true if this instance can convert the specified value type; otherwise, false. - - - - - Create a custom object - - The object type to convert. - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Creates an object which will then be populated by the serializer. - - Type of the object. - The created object. - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Gets a value indicating whether this can write JSON. - - - true if this can write JSON; otherwise, false. - - - - - Provides a base class for converting a to and from JSON. - - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Converts a F# discriminated union type to and from JSON. - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Converts an Entity Framework EntityKey to and from JSON. - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Converts an ExpandoObject to and from JSON. - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Gets a value indicating whether this can write JSON. - - - true if this can write JSON; otherwise, false. - - - - - Converts a to and from JSON. - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Converts a to and from JSON and BSON. - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Converts a to and from JSON and BSON. - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Converts an to and from its name string value. - - - - - Initializes a new instance of the class. - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Gets or sets a value indicating whether the written enum text should be camel case. - - true if the written enum text will be camel case; otherwise, false. - - - - Gets or sets a value indicating whether integer values are allowed. - - true if integers are allowed; otherwise, false. - - - - Specifies how constructors are used when initializing objects during deserialization by the . - - - - - First attempt to use the public default constructor, then fall back to single paramatized constructor, then the non-public default constructor. - - - - - Json.NET will use a non-public default constructor before falling back to a paramatized constructor. - - - - - Converts a to and from a string (e.g. "1.2.3.4"). - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing property value of the JSON that is being converted. - The calling serializer. - The object value. - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Specifies float format handling options when writing special floating point numbers, e.g. , - and with . - - - - - Write special floating point values as strings in JSON, e.g. "NaN", "Infinity", "-Infinity". - - - - - Write special floating point values as symbols in JSON, e.g. NaN, Infinity, -Infinity. - Note that this will produce non-valid JSON. - - - - - Write special floating point values as the property's default value in JSON, e.g. 0.0 for a property, null for a property. - - - - - Specifies how floating point numbers, e.g. 1.0 and 9.9, are parsed when reading JSON text. - - - - - Floating point numbers are parsed to . - - - - - Floating point numbers are parsed to . - - - - - Instructs the how to serialize the collection. - - - - - Instructs the how to serialize the object. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class with the specified container Id. - - The container Id. - - - - Gets or sets the id. - - The id. - - - - Gets or sets the title. - - The title. - - - - Gets or sets the description. - - The description. - - - - Gets the collection's items converter. - - The collection's items converter. - - - - Gets or sets a value that indicates whether to preserve object references. - - - true to keep object reference; otherwise, false. The default is false. - - - - - Gets or sets a value that indicates whether to preserve collection's items references. - - - true to keep collection's items object references; otherwise, false. The default is false. - - - - - Gets or sets the reference loop handling used when serializing the collection's items. - - The reference loop handling. - - - - Gets or sets the type name handling used when serializing the collection's items. - - The type name handling. - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class with the specified container Id. - - The container Id. - - - - The exception thrown when an error occurs during Json serialization or deserialization. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class - with a specified error message. - - The error message that explains the reason for the exception. - - - - Initializes a new instance of the class - with a specified error message and a reference to the inner exception that is the cause of this exception. - - The error message that explains the reason for the exception. - The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. - - - - Initializes a new instance of the class. - - The that holds the serialized object data about the exception being thrown. - The that contains contextual information about the source or destination. - The parameter is null. - The class name is null or is zero (0). - - - - Specifies how dates are formatted when writing JSON text. - - - - - Dates are written in the ISO 8601 format, e.g. "2012-03-21T05:40Z". - - - - - Dates are written in the Microsoft JSON format, e.g. "\/Date(1198908717056)\/". - - - - - Specifies how date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed when reading JSON text. - - - - - Date formatted strings are not parsed to a date type and are read as strings. - - - - - Date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed to . - - - - - Date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed to . - - - - - Specifies how to treat the time value when converting between string and . - - - - - Treat as local time. If the object represents a Coordinated Universal Time (UTC), it is converted to the local time. - - - - - Treat as a UTC. If the object represents a local time, it is converted to a UTC. - - - - - Treat as a local time if a is being converted to a string. - If a string is being converted to , convert to a local time if a time zone is specified. - - - - - Time zone information should be preserved when converting. - - - - - Specifies formatting options for the . - - - - - No special formatting is applied. This is the default. - - - - - Causes child objects to be indented according to the and settings. - - - - - Instructs the to use the specified constructor when deserializing that object. - - - - - Instructs the to deserialize properties with no matching class member into the specified collection - and write values during serialization. - - - - - Initializes a new instance of the class. - - - - - Gets or sets a value that indicates whether to write extension data when serializing the object. - - - true to write extension data when serializing the object; otherwise, false. The default is true. - - - - - Gets or sets a value that indicates whether to read extension data when deserializing the object. - - - true to read extension data when deserializing the object; otherwise, false. The default is true. - - - - - Specifies metadata property handling options for the . - - - - - Read metadata properties located at the start of a JSON object. - - - - - Read metadata properties located anywhere in a JSON object. Note that this setting will impact performance. - - - - - Represents a trace writer that writes to the application's instances. - - - - - Represents a trace writer. - - - - - Writes the specified trace level, message and optional exception. - - The at which to write this trace. - The trace message. - The trace exception. This parameter is optional. - - - - Gets the that will be used to filter the trace messages passed to the writer. - For example a filter level of Info will exclude Verbose messages and include Info, - Warning and Error messages. - - The that will be used to filter the trace messages passed to the writer. - - - - Writes the specified trace level, message and optional exception. - - The at which to write this trace. - The trace message. - The trace exception. This parameter is optional. - - - - Gets the that will be used to filter the trace messages passed to the writer. - For example a filter level of Info will exclude Verbose messages and include Info, - Warning and Error messages. - - - The that will be used to filter the trace messages passed to the writer. - - - - - Get and set values for a using dynamic methods. - - - - - Provides methods to get and set values. - - - - - Sets the value. - - The target to set the value on. - The value to set on the target. - - - - Gets the value. - - The target to get the value from. - The value. - - - - Initializes a new instance of the class. - - The member info. - - - - Sets the value. - - The target to set the value on. - The value to set on the target. - - - - Gets the value. - - The target to get the value from. - The value. - - - - Contract details for a used by the . - - - - - Contract details for a used by the . - - - - - Gets the underlying type for the contract. - - The underlying type for the contract. - - - - Gets or sets the type created during deserialization. - - The type created during deserialization. - - - - Gets or sets whether this type contract is serialized as a reference. - - Whether this type contract is serialized as a reference. - - - - Gets or sets the default for this contract. - - The converter. - - - - Gets or sets all methods called immediately after deserialization of the object. - - The methods called immediately after deserialization of the object. - - - - Gets or sets all methods called during deserialization of the object. - - The methods called during deserialization of the object. - - - - Gets or sets all methods called after serialization of the object graph. - - The methods called after serialization of the object graph. - - - - Gets or sets all methods called before serialization of the object. - - The methods called before serialization of the object. - - - - Gets or sets all method called when an error is thrown during the serialization of the object. - - The methods called when an error is thrown during the serialization of the object. - - - - Gets or sets the method called immediately after deserialization of the object. - - The method called immediately after deserialization of the object. - - - - Gets or sets the method called during deserialization of the object. - - The method called during deserialization of the object. - - - - Gets or sets the method called after serialization of the object graph. - - The method called after serialization of the object graph. - - - - Gets or sets the method called before serialization of the object. - - The method called before serialization of the object. - - - - Gets or sets the method called when an error is thrown during the serialization of the object. - - The method called when an error is thrown during the serialization of the object. - - - - Gets or sets the default creator method used to create the object. - - The default creator method used to create the object. - - - - Gets or sets a value indicating whether the default creator is non public. - - true if the default object creator is non-public; otherwise, false. - - - - Initializes a new instance of the class. - - The underlying type for the contract. - - - - Gets or sets the default collection items . - - The converter. - - - - Gets or sets a value indicating whether the collection items preserve object references. - - true if collection items preserve object references; otherwise, false. - - - - Gets or sets the collection item reference loop handling. - - The reference loop handling. - - - - Gets or sets the collection item type name handling. - - The type name handling. - - - - Represents a trace writer that writes to memory. When the trace message limit is - reached then old trace messages will be removed as new messages are added. - - - - - Initializes a new instance of the class. - - - - - Writes the specified trace level, message and optional exception. - - The at which to write this trace. - The trace message. - The trace exception. This parameter is optional. - - - - Returns an enumeration of the most recent trace messages. - - An enumeration of the most recent trace messages. - - - - Returns a of the most recent trace messages. - - - A of the most recent trace messages. - - - - - Gets the that will be used to filter the trace messages passed to the writer. - For example a filter level of Info will exclude Verbose messages and include Info, - Warning and Error messages. - - - The that will be used to filter the trace messages passed to the writer. - - - - - Provides an interface to enable a class to return line and position information. - - - - - Gets a value indicating whether the class can return line information. - - - true if LineNumber and LinePosition can be provided; otherwise, false. - - - - - Gets the current line number. - - The current line number or 0 if no line information is available (for example, HasLineInfo returns false). - - - - Gets the current line position. - - The current line position or 0 if no line information is available (for example, HasLineInfo returns false). - - - - Specifies how strings are escaped when writing JSON text. - - - - - Only control characters (e.g. newline) are escaped. - - - - - All non-ASCII and control characters (e.g. newline) are escaped. - - - - - HTML (<, >, &, ', ") and control characters (e.g. newline) are escaped. - - - - - Represents a raw JSON string. - - - - - Represents a value in JSON (string, integer, date, etc). - - - - - Represents an abstract JSON token. - - - - - Represents a collection of objects. - - The type of token - - - - Gets the with the specified key. - - - - - - Compares the values of two tokens, including the values of all descendant tokens. - - The first to compare. - The second to compare. - true if the tokens are equal; otherwise false. - - - - Adds the specified content immediately after this token. - - A content object that contains simple content or a collection of content objects to be added after this token. - - - - Adds the specified content immediately before this token. - - A content object that contains simple content or a collection of content objects to be added before this token. - - - - Returns a collection of the ancestor tokens of this token. - - A collection of the ancestor tokens of this token. - - - - Returns a collection of the sibling tokens after this token, in document order. - - A collection of the sibling tokens after this tokens, in document order. - - - - Returns a collection of the sibling tokens before this token, in document order. - - A collection of the sibling tokens before this token, in document order. - - - - Gets the with the specified key converted to the specified type. - - The type to convert the token to. - The token key. - The converted token value. - - - - Returns a collection of the child tokens of this token, in document order. - - An of containing the child tokens of this , in document order. - - - - Returns a collection of the child tokens of this token, in document order, filtered by the specified type. - - The type to filter the child tokens on. - A containing the child tokens of this , in document order. - - - - Returns a collection of the child values of this token, in document order. - - The type to convert the values to. - A containing the child values of this , in document order. - - - - Removes this token from its parent. - - - - - Replaces this token with the specified token. - - The value. - - - - Writes this token to a . - - A into which this method will write. - A collection of which will be used when writing the token. - - - - Returns the indented JSON for this token. - - - The indented JSON for this token. - - - - - Returns the JSON for this token using the given formatting and converters. - - Indicates how the output is formatted. - A collection of which will be used when writing the token. - The JSON for this token using the given formatting and converters. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Creates an for this token. - - An that can be used to read this token and its descendants. - - - - Creates a from an object. - - The object that will be used to create . - A with the value of the specified object - - - - Creates a from an object using the specified . - - The object that will be used to create . - The that will be used when reading the object. - A with the value of the specified object - - - - Creates the specified .NET type from the . - - The object type that the token will be deserialized to. - The new object created from the JSON value. - - - - Creates the specified .NET type from the . - - The object type that the token will be deserialized to. - The new object created from the JSON value. - - - - Creates the specified .NET type from the using the specified . - - The object type that the token will be deserialized to. - The that will be used when creating the object. - The new object created from the JSON value. - - - - Creates the specified .NET type from the using the specified . - - The object type that the token will be deserialized to. - The that will be used when creating the object. - The new object created from the JSON value. - - - - Creates a from a . - - An positioned at the token to read into this . - - An that contains the token and its descendant tokens - that were read from the reader. The runtime type of the token is determined - by the token type of the first token encountered in the reader. - - - - - Load a from a string that contains JSON. - - A that contains JSON. - A populated from the string that contains JSON. - - - - Creates a from a . - - An positioned at the token to read into this . - - An that contains the token and its descendant tokens - that were read from the reader. The runtime type of the token is determined - by the token type of the first token encountered in the reader. - - - - - Selects a using a JPath expression. Selects the token that matches the object path. - - - A that contains a JPath expression. - - A , or null. - - - - Selects a using a JPath expression. Selects the token that matches the object path. - - - A that contains a JPath expression. - - A flag to indicate whether an error should be thrown if no tokens are found when evaluating part of the expression. - A . - - - - Selects a collection of elements using a JPath expression. - - - A that contains a JPath expression. - - An that contains the selected elements. - - - - Selects a collection of elements using a JPath expression. - - - A that contains a JPath expression. - - A flag to indicate whether an error should be thrown if no tokens are found when evaluating part of the expression. - An that contains the selected elements. - - - - Returns the responsible for binding operations performed on this object. - - The expression tree representation of the runtime value. - - The to bind this object. - - - - - Returns the responsible for binding operations performed on this object. - - The expression tree representation of the runtime value. - - The to bind this object. - - - - - Creates a new instance of the . All child tokens are recursively cloned. - - A new instance of the . - - - - Gets a comparer that can compare two tokens for value equality. - - A that can compare two nodes for value equality. - - - - Gets or sets the parent. - - The parent. - - - - Gets the root of this . - - The root of this . - - - - Gets the node type for this . - - The type. - - - - Gets a value indicating whether this token has child tokens. - - - true if this token has child values; otherwise, false. - - - - - Gets the next sibling token of this node. - - The that contains the next sibling token. - - - - Gets the previous sibling token of this node. - - The that contains the previous sibling token. - - - - Gets the path of the JSON token. - - - - - Gets the with the specified key. - - The with the specified key. - - - - Get the first child token of this token. - - A containing the first child token of the . - - - - Get the last child token of this token. - - A containing the last child token of the . - - - - Initializes a new instance of the class from another object. - - A object to copy from. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Creates a comment with the given value. - - The value. - A comment with the given value. - - - - Creates a string with the given value. - - The value. - A string with the given value. - - - - Writes this token to a . - - A into which this method will write. - A collection of which will be used when writing the token. - - - - Indicates whether the current object is equal to another object of the same type. - - - true if the current object is equal to the parameter; otherwise, false. - - An object to compare with this object. - - - - Determines whether the specified is equal to the current . - - The to compare with the current . - - true if the specified is equal to the current ; otherwise, false. - - - The parameter is null. - - - - - Serves as a hash function for a particular type. - - - A hash code for the current . - - - - - Returns a that represents this instance. - - - A that represents this instance. - - - - - Returns a that represents this instance. - - The format. - - A that represents this instance. - - - - - Returns a that represents this instance. - - The format provider. - - A that represents this instance. - - - - - Returns a that represents this instance. - - The format. - The format provider. - - A that represents this instance. - - - - - Returns the responsible for binding operations performed on this object. - - The expression tree representation of the runtime value. - - The to bind this object. - - - - - Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object. - - An object to compare with this instance. - - A 32-bit signed integer that indicates the relative order of the objects being compared. The return value has these meanings: - Value - Meaning - Less than zero - This instance is less than . - Zero - This instance is equal to . - Greater than zero - This instance is greater than . - - - is not the same type as this instance. - - - - - Gets a value indicating whether this token has child tokens. - - - true if this token has child values; otherwise, false. - - - - - Gets the node type for this . - - The type. - - - - Gets or sets the underlying token value. - - The underlying token value. - - - - Initializes a new instance of the class from another object. - - A object to copy from. - - - - Initializes a new instance of the class. - - The raw json. - - - - Creates an instance of with the content of the reader's current token. - - The reader. - An instance of with the content of the reader's current token. - - - - Indicating whether a property is required. - - - - - The property is not required. The default state. - - - - - The property must be defined in JSON but can be a null value. - - - - - The property must be defined in JSON and cannot be a null value. - - - - - Contract details for a used by the . - - - - - Initializes a new instance of the class. - - The underlying type for the contract. - - - - Gets the object's properties. - - The object's properties. - - - - Gets or sets the property name resolver. - - The property name resolver. - - - - Contract details for a used by the . - - - - - Initializes a new instance of the class. - - The underlying type for the contract. - - - - Gets or sets the ISerializable object constructor. - - The ISerializable object constructor. - - - - Contract details for a used by the . - - - - - Initializes a new instance of the class. - - The underlying type for the contract. - - - - Contract details for a used by the . - - - - - Initializes a new instance of the class. - - The underlying type for the contract. - - - - Get and set values for a using dynamic methods. - - - - - Initializes a new instance of the class. - - The member info. - - - - Sets the value. - - The target to set the value on. - The value to set on the target. - - - - Gets the value. - - The target to get the value from. - The value. - - - - Provides data for the Error event. - - - - - Initializes a new instance of the class. - - The current object. - The error context. - - - - Gets the current object the error event is being raised against. - - The current object the error event is being raised against. - - - - Gets the error context. - - The error context. - - - - Represents a view of a . - - - - - Initializes a new instance of the class. - - The name. - - - - When overridden in a derived class, returns whether resetting an object changes its value. - - - true if resetting the component changes its value; otherwise, false. - - The component to test for reset capability. - - - - - When overridden in a derived class, gets the current value of the property on a component. - - - The value of a property for a given component. - - The component with the property for which to retrieve the value. - - - - - When overridden in a derived class, resets the value for this property of the component to the default value. - - The component with the property value that is to be reset to the default value. - - - - - When overridden in a derived class, sets the value of the component to a different value. - - The component with the property value that is to be set. - The new value. - - - - - When overridden in a derived class, determines a value indicating whether the value of this property needs to be persisted. - - - true if the property should be persisted; otherwise, false. - - The component with the property to be examined for persistence. - - - - - When overridden in a derived class, gets the type of the component this property is bound to. - - - A that represents the type of component this property is bound to. When the or methods are invoked, the object specified might be an instance of this type. - - - - - When overridden in a derived class, gets a value indicating whether this property is read-only. - - - true if the property is read-only; otherwise, false. - - - - - When overridden in a derived class, gets the type of the property. - - - A that represents the type of the property. - - - - - Gets the hash code for the name of the member. - - - - The hash code for the name of the member. - - - - - Used to resolve references when serializing and deserializing JSON by the . - - - - - Resolves a reference to its object. - - The serialization context. - The reference to resolve. - The object that - - - - Gets the reference for the sepecified object. - - The serialization context. - The object to get a reference for. - The reference to the object. - - - - Determines whether the specified object is referenced. - - The serialization context. - The object to test for a reference. - - true if the specified object is referenced; otherwise, false. - - - - - Adds a reference to the specified object. - - The serialization context. - The reference. - The object to reference. - - - - Specifies reference handling options for the . - Note that references cannot be preserved when a value is set via a non-default constructor such as types that implement ISerializable. - - - - - - - - Do not preserve references when serializing types. - - - - - Preserve references when serializing into a JSON object structure. - - - - - Preserve references when serializing into a JSON array structure. - - - - - Preserve references when serializing. - - - - - Instructs the how to serialize the collection. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class with a flag indicating whether the array can contain null items - - A flag indicating whether the array can contain null items. - - - - Initializes a new instance of the class with the specified container Id. - - The container Id. - - - - Gets or sets a value indicating whether null items are allowed in the collection. - - true if null items are allowed in the collection; otherwise, false. - - - - Specifies default value handling options for the . - - - - - - - - - Include members where the member value is the same as the member's default value when serializing objects. - Included members are written to JSON. Has no effect when deserializing. - - - - - Ignore members where the member value is the same as the member's default value when serializing objects - so that is is not written to JSON. - This option will ignore all default values (e.g. null for objects and nullable types; 0 for integers, - decimals and floating point numbers; and false for booleans). The default value ignored can be changed by - placing the on the property. - - - - - Members with a default value but no JSON will be set to their default value when deserializing. - - - - - Ignore members where the member value is the same as the member's default value when serializing objects - and sets members to their default value when deserializing. - - - - - Instructs the to use the specified when serializing the member or class. - - - - - Initializes a new instance of the class. - - Type of the converter. - - - - Gets the type of the converter. - - The type of the converter. - - - - Instructs the how to serialize the object. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class with the specified member serialization. - - The member serialization. - - - - Initializes a new instance of the class with the specified container Id. - - The container Id. - - - - Gets or sets the member serialization. - - The member serialization. - - - - Gets or sets a value that indicates whether the object's properties are required. - - - A value indicating whether the object's properties are required. - - - - - Specifies the settings on a object. - - - - - Initializes a new instance of the class. - - - - - Gets or sets how reference loops (e.g. a class referencing itself) is handled. - - Reference loop handling. - - - - Gets or sets how missing members (e.g. JSON contains a property that isn't a member on the object) are handled during deserialization. - - Missing member handling. - - - - Gets or sets how objects are created during deserialization. - - The object creation handling. - - - - Gets or sets how null values are handled during serialization and deserialization. - - Null value handling. - - - - Gets or sets how null default are handled during serialization and deserialization. - - The default value handling. - - - - Gets or sets a collection that will be used during serialization. - - The converters. - - - - Gets or sets how object references are preserved by the serializer. - - The preserve references handling. - - - - Gets or sets how type name writing and reading is handled by the serializer. - - The type name handling. - - - - Gets or sets how metadata properties are used during deserialization. - - The metadata properties handling. - - - - Gets or sets how a type name assembly is written and resolved by the serializer. - - The type name assembly format. - - - - Gets or sets how constructors are used during deserialization. - - The constructor handling. - - - - Gets or sets the contract resolver used by the serializer when - serializing .NET objects to JSON and vice versa. - - The contract resolver. - - - - Gets or sets the used by the serializer when resolving references. - - The reference resolver. - - - - Gets or sets the used by the serializer when writing trace messages. - - The trace writer. - - - - Gets or sets the used by the serializer when resolving type names. - - The binder. - - - - Gets or sets the error handler called during serialization and deserialization. - - The error handler called during serialization and deserialization. - - - - Gets or sets the used by the serializer when invoking serialization callback methods. - - The context. - - - - Get or set how and values are formatting when writing JSON text. - - - - - Gets or sets the maximum depth allowed when reading JSON. Reading past this depth will throw a . - - - - - Indicates how JSON text output is formatted. - - - - - Get or set how dates are written to JSON text. - - - - - Get or set how time zones are handling during serialization and deserialization. - - - - - Get or set how date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed when reading JSON. - - - - - Get or set how special floating point numbers, e.g. , - and , - are written as JSON. - - - - - Get or set how floating point numbers, e.g. 1.0 and 9.9, are parsed when reading JSON text. - - - - - Get or set how strings are escaped when writing JSON text. - - - - - Gets or sets the culture used when reading JSON. Defaults to . - - - - - Gets a value indicating whether there will be a check for additional content after deserializing an object. - - - true if there will be a check for additional content after deserializing an object; otherwise, false. - - - - - Represents a reader that provides validation. - - - - - Initializes a new instance of the class that - validates the content returned from the given . - - The to read from while validating. - - - - Reads the next JSON token from the stream as a . - - A . - - - - Reads the next JSON token from the stream as a . - - - A or a null reference if the next JSON token is null. - - - - - Reads the next JSON token from the stream as a . - - A . - - - - Reads the next JSON token from the stream as a . - - A . This method will return null at the end of an array. - - - - Reads the next JSON token from the stream as a . - - A . This method will return null at the end of an array. - - - - Reads the next JSON token from the stream as a . - - A . - - - - Reads the next JSON token from the stream. - - - true if the next token was read successfully; false if there are no more tokens to read. - - - - - Sets an event handler for receiving schema validation errors. - - - - - Gets the text value of the current JSON token. - - - - - - Gets the depth of the current token in the JSON document. - - The depth of the current token in the JSON document. - - - - Gets the path of the current JSON token. - - - - - Gets the quotation mark character used to enclose the value of a string. - - - - - - Gets the type of the current JSON token. - - - - - - Gets the Common Language Runtime (CLR) type for the current JSON token. - - - - - - Gets or sets the schema. - - The schema. - - - - Gets the used to construct this . - - The specified in the constructor. - - - - Compares tokens to determine whether they are equal. - - - - - Determines whether the specified objects are equal. - - The first object of type to compare. - The second object of type to compare. - - true if the specified objects are equal; otherwise, false. - - - - - Returns a hash code for the specified object. - - The for which a hash code is to be returned. - A hash code for the specified object. - The type of is a reference type and is null. - - - - Specifies the member serialization options for the . - - - - - All public members are serialized by default. Members can be excluded using or . - This is the default member serialization mode. - - - - - Only members must be marked with or are serialized. - This member serialization mode can also be set by marking the class with . - - - - - All public and private fields are serialized. Members can be excluded using or . - This member serialization mode can also be set by marking the class with - and setting IgnoreSerializableAttribute on to false. - - - - - Specifies how object creation is handled by the . - - - - - Reuse existing objects, create new objects when needed. - - - - - Only reuse existing objects. - - - - - Always create new objects. - - - - - Converts a to and from the ISO 8601 date format (e.g. 2008-04-12T12:53Z). - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Gets or sets the date time styles used when converting a date to and from JSON. - - The date time styles used when converting a date to and from JSON. - - - - Gets or sets the date time format used when converting a date to and from JSON. - - The date time format used when converting a date to and from JSON. - - - - Gets or sets the culture used when converting a date to and from JSON. - - The culture used when converting a date to and from JSON. - - - - Converts a to and from a JavaScript date constructor (e.g. new Date(52231943)). - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing property value of the JSON that is being converted. - The calling serializer. - The object value. - - - - Converts XML to and from JSON. - - - - - Writes the JSON representation of the object. - - The to write to. - The calling serializer. - The value. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Checks if the attributeName is a namespace attribute. - - Attribute name to test. - The attribute name prefix if it has one, otherwise an empty string. - True if attribute name is for a namespace attribute, otherwise false. - - - - Determines whether this instance can convert the specified value type. - - Type of the value. - - true if this instance can convert the specified value type; otherwise, false. - - - - - Gets or sets the name of the root element to insert when deserializing to XML if the JSON structure has produces multiple root elements. - - The name of the deserialize root element. - - - - Gets or sets a flag to indicate whether to write the Json.NET array attribute. - This attribute helps preserve arrays when converting the written XML back to JSON. - - true if the array attibute is written to the XML; otherwise, false. - - - - Gets or sets a value indicating whether to write the root JSON object. - - true if the JSON root object is omitted; otherwise, false. - - - - Represents a reader that provides fast, non-cached, forward-only access to JSON text data. - - - - - Initializes a new instance of the class with the specified . - - The TextReader containing the XML data to read. - - - - Reads the next JSON token from the stream. - - - true if the next token was read successfully; false if there are no more tokens to read. - - - - - Reads the next JSON token from the stream as a . - - - A or a null reference if the next JSON token is null. This method will return null at the end of an array. - - - - - Reads the next JSON token from the stream as a . - - A . This method will return null at the end of an array. - - - - Reads the next JSON token from the stream as a . - - A . This method will return null at the end of an array. - - - - Reads the next JSON token from the stream as a . - - A . This method will return null at the end of an array. - - - - Reads the next JSON token from the stream as a . - - A . This method will return null at the end of an array. - - - - Reads the next JSON token from the stream as a . - - A . This method will return null at the end of an array. - - - - Changes the state to closed. - - - - - Gets a value indicating whether the class can return line information. - - - true if LineNumber and LinePosition can be provided; otherwise, false. - - - - - Gets the current line number. - - - The current line number or 0 if no line information is available (for example, HasLineInfo returns false). - - - - - Gets the current line position. - - - The current line position or 0 if no line information is available (for example, HasLineInfo returns false). - - - - - Instructs the to always serialize the member with the specified name. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class with the specified name. - - Name of the property. - - - - Gets or sets the converter used when serializing the property's collection items. - - The collection's items converter. - - - - Gets or sets the null value handling used when serializing this property. - - The null value handling. - - - - Gets or sets the default value handling used when serializing this property. - - The default value handling. - - - - Gets or sets the reference loop handling used when serializing this property. - - The reference loop handling. - - - - Gets or sets the object creation handling used when deserializing this property. - - The object creation handling. - - - - Gets or sets the type name handling used when serializing this property. - - The type name handling. - - - - Gets or sets whether this property's value is serialized as a reference. - - Whether this property's value is serialized as a reference. - - - - Gets or sets the order of serialization and deserialization of a member. - - The numeric order of serialization or deserialization. - - - - Gets or sets a value indicating whether this property is required. - - - A value indicating whether this property is required. - - - - - Gets or sets the name of the property. - - The name of the property. - - - - Gets or sets the the reference loop handling used when serializing the property's collection items. - - The collection's items reference loop handling. - - - - Gets or sets the the type name handling used when serializing the property's collection items. - - The collection's items type name handling. - - - - Gets or sets whether this property's collection items are serialized as a reference. - - Whether this property's collection items are serialized as a reference. - - - - Instructs the not to serialize the public field or public read/write property value. - - - - - Represents a writer that provides a fast, non-cached, forward-only way of generating Json data. - - - - - Creates an instance of the JsonWriter class using the specified . - - The TextWriter to write to. - - - - Flushes whatever is in the buffer to the underlying streams and also flushes the underlying stream. - - - - - Closes this stream and the underlying stream. - - - - - Writes the beginning of a Json object. - - - - - Writes the beginning of a Json array. - - - - - Writes the start of a constructor with the given name. - - The name of the constructor. - - - - Writes the specified end token. - - The end token to write. - - - - Writes the property name of a name/value pair on a Json object. - - The name of the property. - - - - Writes the property name of a name/value pair on a JSON object. - - The name of the property. - A flag to indicate whether the text should be escaped when it is written as a JSON property name. - - - - Writes indent characters. - - - - - Writes the JSON value delimiter. - - - - - Writes an indent space. - - - - - Writes a value. - An error will raised if the value cannot be written as a single JSON token. - - The value to write. - - - - Writes a null value. - - - - - Writes an undefined value. - - - - - Writes raw JSON. - - The raw JSON to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes out a comment /*...*/ containing the specified text. - - Text to place inside the comment. - - - - Writes out the given white space. - - The string of white space characters. - - - - Gets or sets how many IndentChars to write for each level in the hierarchy when is set to Formatting.Indented. - - - - - Gets or sets which character to use to quote attribute values. - - - - - Gets or sets which character to use for indenting when is set to Formatting.Indented. - - - - - Gets or sets a value indicating whether object names will be surrounded with quotes. - - - - - The exception thrown when an error occurs while reading Json text. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class - with a specified error message. - - The error message that explains the reason for the exception. - - - - Initializes a new instance of the class - with a specified error message and a reference to the inner exception that is the cause of this exception. - - The error message that explains the reason for the exception. - The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. - - - - Initializes a new instance of the class. - - The that holds the serialized object data about the exception being thrown. - The that contains contextual information about the source or destination. - The parameter is null. - The class name is null or is zero (0). - - - - Gets the path to the JSON where the error occurred. - - The path to the JSON where the error occurred. - - - - The exception thrown when an error occurs while reading Json text. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class - with a specified error message. - - The error message that explains the reason for the exception. - - - - Initializes a new instance of the class - with a specified error message and a reference to the inner exception that is the cause of this exception. - - The error message that explains the reason for the exception. - The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. - - - - Initializes a new instance of the class. - - The that holds the serialized object data about the exception being thrown. - The that contains contextual information about the source or destination. - The parameter is null. - The class name is null or is zero (0). - - - - Gets the line number indicating where the error occurred. - - The line number indicating where the error occurred. - - - - Gets the line position indicating where the error occurred. - - The line position indicating where the error occurred. - - - - Gets the path to the JSON where the error occurred. - - The path to the JSON where the error occurred. - - - - Represents a collection of . - - - - - Provides methods for converting between common language runtime types and JSON types. - - - - - - - - Represents JavaScript's boolean value true as a string. This field is read-only. - - - - - Represents JavaScript's boolean value false as a string. This field is read-only. - - - - - Represents JavaScript's null as a string. This field is read-only. - - - - - Represents JavaScript's undefined as a string. This field is read-only. - - - - - Represents JavaScript's positive infinity as a string. This field is read-only. - - - - - Represents JavaScript's negative infinity as a string. This field is read-only. - - - - - Represents JavaScript's NaN as a string. This field is read-only. - - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation using the specified. - - The value to convert. - The format the date will be converted to. - The time zone handling when the date is converted to a string. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation using the specified. - - The value to convert. - The format the date will be converted to. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - The string delimiter character. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Serializes the specified object to a JSON string. - - The object to serialize. - A JSON string representation of the object. - - - - Serializes the specified object to a JSON string using formatting. - - The object to serialize. - Indicates how the output is formatted. - - A JSON string representation of the object. - - - - - Serializes the specified object to a JSON string using a collection of . - - The object to serialize. - A collection converters used while serializing. - A JSON string representation of the object. - - - - Serializes the specified object to a JSON string using formatting and a collection of . - - The object to serialize. - Indicates how the output is formatted. - A collection converters used while serializing. - A JSON string representation of the object. - - - - Serializes the specified object to a JSON string using . - - The object to serialize. - The used to serialize the object. - If this is null, default serialization settings will be is used. - - A JSON string representation of the object. - - - - - Serializes the specified object to a JSON string using a type, formatting and . - - The object to serialize. - The used to serialize the object. - If this is null, default serialization settings will be is used. - - The type of the value being serialized. - This parameter is used when is Auto to write out the type name if the type of the value does not match. - Specifing the type is optional. - - - A JSON string representation of the object. - - - - - Serializes the specified object to a JSON string using formatting and . - - The object to serialize. - Indicates how the output is formatted. - The used to serialize the object. - If this is null, default serialization settings will be is used. - - A JSON string representation of the object. - - - - - Serializes the specified object to a JSON string using a type, formatting and . - - The object to serialize. - Indicates how the output is formatted. - The used to serialize the object. - If this is null, default serialization settings will be is used. - - The type of the value being serialized. - This parameter is used when is Auto to write out the type name if the type of the value does not match. - Specifing the type is optional. - - - A JSON string representation of the object. - - - - - Asynchronously serializes the specified object to a JSON string. - Serialization will happen on a new thread. - - The object to serialize. - - A task that represents the asynchronous serialize operation. The value of the TResult parameter contains a JSON string representation of the object. - - - - - Asynchronously serializes the specified object to a JSON string using formatting. - Serialization will happen on a new thread. - - The object to serialize. - Indicates how the output is formatted. - - A task that represents the asynchronous serialize operation. The value of the TResult parameter contains a JSON string representation of the object. - - - - - Asynchronously serializes the specified object to a JSON string using formatting and a collection of . - Serialization will happen on a new thread. - - The object to serialize. - Indicates how the output is formatted. - The used to serialize the object. - If this is null, default serialization settings will be is used. - - A task that represents the asynchronous serialize operation. The value of the TResult parameter contains a JSON string representation of the object. - - - - - Deserializes the JSON to a .NET object. - - The JSON to deserialize. - The deserialized object from the Json string. - - - - Deserializes the JSON to a .NET object using . - - The JSON to deserialize. - - The used to deserialize the object. - If this is null, default serialization settings will be is used. - - The deserialized object from the JSON string. - - - - Deserializes the JSON to the specified .NET type. - - The JSON to deserialize. - The of object being deserialized. - The deserialized object from the Json string. - - - - Deserializes the JSON to the specified .NET type. - - The type of the object to deserialize to. - The JSON to deserialize. - The deserialized object from the Json string. - - - - Deserializes the JSON to the given anonymous type. - - - The anonymous type to deserialize to. This can't be specified - traditionally and must be infered from the anonymous type passed - as a parameter. - - The JSON to deserialize. - The anonymous type object. - The deserialized anonymous type from the JSON string. - - - - Deserializes the JSON to the given anonymous type using . - - - The anonymous type to deserialize to. This can't be specified - traditionally and must be infered from the anonymous type passed - as a parameter. - - The JSON to deserialize. - The anonymous type object. - - The used to deserialize the object. - If this is null, default serialization settings will be is used. - - The deserialized anonymous type from the JSON string. - - - - Deserializes the JSON to the specified .NET type using a collection of . - - The type of the object to deserialize to. - The JSON to deserialize. - Converters to use while deserializing. - The deserialized object from the JSON string. - - - - Deserializes the JSON to the specified .NET type using . - - The type of the object to deserialize to. - The object to deserialize. - - The used to deserialize the object. - If this is null, default serialization settings will be is used. - - The deserialized object from the JSON string. - - - - Deserializes the JSON to the specified .NET type using a collection of . - - The JSON to deserialize. - The type of the object to deserialize. - Converters to use while deserializing. - The deserialized object from the JSON string. - - - - Deserializes the JSON to the specified .NET type using . - - The JSON to deserialize. - The type of the object to deserialize to. - - The used to deserialize the object. - If this is null, default serialization settings will be is used. - - The deserialized object from the JSON string. - - - - Asynchronously deserializes the JSON to the specified .NET type. - Deserialization will happen on a new thread. - - The type of the object to deserialize to. - The JSON to deserialize. - - A task that represents the asynchronous deserialize operation. The value of the TResult parameter contains the deserialized object from the JSON string. - - - - - Asynchronously deserializes the JSON to the specified .NET type using . - Deserialization will happen on a new thread. - - The type of the object to deserialize to. - The JSON to deserialize. - - The used to deserialize the object. - If this is null, default serialization settings will be is used. - - - A task that represents the asynchronous deserialize operation. The value of the TResult parameter contains the deserialized object from the JSON string. - - - - - Asynchronously deserializes the JSON to the specified .NET type. - Deserialization will happen on a new thread. - - The JSON to deserialize. - - A task that represents the asynchronous deserialize operation. The value of the TResult parameter contains the deserialized object from the JSON string. - - - - - Asynchronously deserializes the JSON to the specified .NET type using . - Deserialization will happen on a new thread. - - The JSON to deserialize. - The type of the object to deserialize to. - - The used to deserialize the object. - If this is null, default serialization settings will be is used. - - - A task that represents the asynchronous deserialize operation. The value of the TResult parameter contains the deserialized object from the JSON string. - - - - - Populates the object with values from the JSON string. - - The JSON to populate values from. - The target object to populate values onto. - - - - Populates the object with values from the JSON string using . - - The JSON to populate values from. - The target object to populate values onto. - - The used to deserialize the object. - If this is null, default serialization settings will be is used. - - - - - Asynchronously populates the object with values from the JSON string using . - - The JSON to populate values from. - The target object to populate values onto. - - The used to deserialize the object. - If this is null, default serialization settings will be is used. - - - A task that represents the asynchronous populate operation. - - - - - Serializes the XML node to a JSON string. - - The node to serialize. - A JSON string of the XmlNode. - - - - Serializes the XML node to a JSON string using formatting. - - The node to serialize. - Indicates how the output is formatted. - A JSON string of the XmlNode. - - - - Serializes the XML node to a JSON string using formatting and omits the root object if is true. - - The node to serialize. - Indicates how the output is formatted. - Omits writing the root object. - A JSON string of the XmlNode. - - - - Deserializes the XmlNode from a JSON string. - - The JSON string. - The deserialized XmlNode - - - - Deserializes the XmlNode from a JSON string nested in a root elment specified by . - - The JSON string. - The name of the root element to append when deserializing. - The deserialized XmlNode - - - - Deserializes the XmlNode from a JSON string nested in a root elment specified by - and writes a .NET array attribute for collections. - - The JSON string. - The name of the root element to append when deserializing. - - A flag to indicate whether to write the Json.NET array attribute. - This attribute helps preserve arrays when converting the written XML back to JSON. - - The deserialized XmlNode - - - - Serializes the to a JSON string. - - The node to convert to JSON. - A JSON string of the XNode. - - - - Serializes the to a JSON string using formatting. - - The node to convert to JSON. - Indicates how the output is formatted. - A JSON string of the XNode. - - - - Serializes the to a JSON string using formatting and omits the root object if is true. - - The node to serialize. - Indicates how the output is formatted. - Omits writing the root object. - A JSON string of the XNode. - - - - Deserializes the from a JSON string. - - The JSON string. - The deserialized XNode - - - - Deserializes the from a JSON string nested in a root elment specified by . - - The JSON string. - The name of the root element to append when deserializing. - The deserialized XNode - - - - Deserializes the from a JSON string nested in a root elment specified by - and writes a .NET array attribute for collections. - - The JSON string. - The name of the root element to append when deserializing. - - A flag to indicate whether to write the Json.NET array attribute. - This attribute helps preserve arrays when converting the written XML back to JSON. - - The deserialized XNode - - - - Gets or sets a function that creates default . - Default settings are automatically used by serialization methods on , - and and on . - To serialize without using any default settings create a with - . - - - - - The exception thrown when an error occurs during Json serialization or deserialization. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class - with a specified error message. - - The error message that explains the reason for the exception. - - - - Initializes a new instance of the class - with a specified error message and a reference to the inner exception that is the cause of this exception. - - The error message that explains the reason for the exception. - The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. - - - - Initializes a new instance of the class. - - The that holds the serialized object data about the exception being thrown. - The that contains contextual information about the source or destination. - The parameter is null. - The class name is null or is zero (0). - - - - Serializes and deserializes objects into and from the JSON format. - The enables you to control how objects are encoded into JSON. - - - - - Initializes a new instance of the class. - - - - - Creates a new instance. - The will not use default settings. - - - A new instance. - The will not use default settings. - - - - - Creates a new instance using the specified . - The will not use default settings. - - The settings to be applied to the . - - A new instance using the specified . - The will not use default settings. - - - - - Creates a new instance. - The will use default settings. - - - A new instance. - The will use default settings. - - - - - Creates a new instance using the specified . - The will use default settings. - - The settings to be applied to the . - - A new instance using the specified . - The will use default settings. - - - - - Populates the JSON values onto the target object. - - The that contains the JSON structure to reader values from. - The target object to populate values onto. - - - - Populates the JSON values onto the target object. - - The that contains the JSON structure to reader values from. - The target object to populate values onto. - - - - Deserializes the Json structure contained by the specified . - - The that contains the JSON structure to deserialize. - The being deserialized. - - - - Deserializes the Json structure contained by the specified - into an instance of the specified type. - - The containing the object. - The of object being deserialized. - The instance of being deserialized. - - - - Deserializes the Json structure contained by the specified - into an instance of the specified type. - - The containing the object. - The type of the object to deserialize. - The instance of being deserialized. - - - - Deserializes the Json structure contained by the specified - into an instance of the specified type. - - The containing the object. - The of object being deserialized. - The instance of being deserialized. - - - - Serializes the specified and writes the Json structure - to a Stream using the specified . - - The used to write the Json structure. - The to serialize. - - - - Serializes the specified and writes the Json structure - to a Stream using the specified . - - The used to write the Json structure. - The to serialize. - - The type of the value being serialized. - This parameter is used when is Auto to write out the type name if the type of the value does not match. - Specifing the type is optional. - - - - - Serializes the specified and writes the Json structure - to a Stream using the specified . - - The used to write the Json structure. - The to serialize. - - The type of the value being serialized. - This parameter is used when is Auto to write out the type name if the type of the value does not match. - Specifing the type is optional. - - - - - Serializes the specified and writes the Json structure - to a Stream using the specified . - - The used to write the Json structure. - The to serialize. - - - - Occurs when the errors during serialization and deserialization. - - - - - Gets or sets the used by the serializer when resolving references. - - - - - Gets or sets the used by the serializer when resolving type names. - - - - - Gets or sets the used by the serializer when writing trace messages. - - The trace writer. - - - - Gets or sets how type name writing and reading is handled by the serializer. - - - - - Gets or sets how a type name assembly is written and resolved by the serializer. - - The type name assembly format. - - - - Gets or sets how object references are preserved by the serializer. - - - - - Get or set how reference loops (e.g. a class referencing itself) is handled. - - - - - Get or set how missing members (e.g. JSON contains a property that isn't a member on the object) are handled during deserialization. - - - - - Get or set how null values are handled during serialization and deserialization. - - - - - Get or set how null default are handled during serialization and deserialization. - - - - - Gets or sets how objects are created during deserialization. - - The object creation handling. - - - - Gets or sets how constructors are used during deserialization. - - The constructor handling. - - - - Gets or sets how metadata properties are used during deserialization. - - The metadata properties handling. - - - - Gets a collection that will be used during serialization. - - Collection that will be used during serialization. - - - - Gets or sets the contract resolver used by the serializer when - serializing .NET objects to JSON and vice versa. - - - - - Gets or sets the used by the serializer when invoking serialization callback methods. - - The context. - - - - Indicates how JSON text output is formatted. - - - - - Get or set how dates are written to JSON text. - - - - - Get or set how time zones are handling during serialization and deserialization. - - - - - Get or set how date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed when reading JSON. - - - - - Get or set how floating point numbers, e.g. 1.0 and 9.9, are parsed when reading JSON text. - - - - - Get or set how special floating point numbers, e.g. , - and , - are written as JSON text. - - - - - Get or set how strings are escaped when writing JSON text. - - - - - Get or set how and values are formatting when writing JSON text. - - - - - Gets or sets the culture used when reading JSON. Defaults to . - - - - - Gets or sets the maximum depth allowed when reading JSON. Reading past this depth will throw a . - - - - - Gets a value indicating whether there will be a check for additional JSON content after deserializing an object. - - - true if there will be a check for additional JSON content after deserializing an object; otherwise, false. - - - - - Contains the LINQ to JSON extension methods. - - - - - Returns a collection of tokens that contains the ancestors of every token in the source collection. - - The type of the objects in source, constrained to . - An of that contains the source collection. - An of that contains the ancestors of every node in the source collection. - - - - Returns a collection of tokens that contains the descendants of every token in the source collection. - - The type of the objects in source, constrained to . - An of that contains the source collection. - An of that contains the descendants of every node in the source collection. - - - - Returns a collection of child properties of every object in the source collection. - - An of that contains the source collection. - An of that contains the properties of every object in the source collection. - - - - Returns a collection of child values of every object in the source collection with the given key. - - An of that contains the source collection. - The token key. - An of that contains the values of every node in the source collection with the given key. - - - - Returns a collection of child values of every object in the source collection. - - An of that contains the source collection. - An of that contains the values of every node in the source collection. - - - - Returns a collection of converted child values of every object in the source collection with the given key. - - The type to convert the values to. - An of that contains the source collection. - The token key. - An that contains the converted values of every node in the source collection with the given key. - - - - Returns a collection of converted child values of every object in the source collection. - - The type to convert the values to. - An of that contains the source collection. - An that contains the converted values of every node in the source collection. - - - - Converts the value. - - The type to convert the value to. - A cast as a of . - A converted value. - - - - Converts the value. - - The source collection type. - The type to convert the value to. - A cast as a of . - A converted value. - - - - Returns a collection of child tokens of every array in the source collection. - - The source collection type. - An of that contains the source collection. - An of that contains the values of every node in the source collection. - - - - Returns a collection of converted child tokens of every array in the source collection. - - An of that contains the source collection. - The type to convert the values to. - The source collection type. - An that contains the converted values of every node in the source collection. - - - - Returns the input typed as . - - An of that contains the source collection. - The input typed as . - - - - Returns the input typed as . - - The source collection type. - An of that contains the source collection. - The input typed as . - - - - Represents a JSON constructor. - - - - - Represents a token that can contain other tokens. - - - - - Raises the event. - - The instance containing the event data. - - - - Raises the event. - - The instance containing the event data. - - - - Raises the event. - - The instance containing the event data. - - - - Returns a collection of the child tokens of this token, in document order. - - - An of containing the child tokens of this , in document order. - - - - - Returns a collection of the child values of this token, in document order. - - The type to convert the values to. - - A containing the child values of this , in document order. - - - - - Returns a collection of the descendant tokens for this token in document order. - - An containing the descendant tokens of the . - - - - Adds the specified content as children of this . - - The content to be added. - - - - Adds the specified content as the first children of this . - - The content to be added. - - - - Creates an that can be used to add tokens to the . - - An that is ready to have content written to it. - - - - Replaces the children nodes of this token with the specified content. - - The content. - - - - Removes the child nodes from this token. - - - - - Occurs when the list changes or an item in the list changes. - - - - - Occurs before an item is added to the collection. - - - - - Occurs when the items list of the collection has changed, or the collection is reset. - - - - - Gets the container's children tokens. - - The container's children tokens. - - - - Gets a value indicating whether this token has child tokens. - - - true if this token has child values; otherwise, false. - - - - - Get the first child token of this token. - - - A containing the first child token of the . - - - - - Get the last child token of this token. - - - A containing the last child token of the . - - - - - Gets the count of child JSON tokens. - - The count of child JSON tokens - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class from another object. - - A object to copy from. - - - - Initializes a new instance of the class with the specified name and content. - - The constructor name. - The contents of the constructor. - - - - Initializes a new instance of the class with the specified name and content. - - The constructor name. - The contents of the constructor. - - - - Initializes a new instance of the class with the specified name. - - The constructor name. - - - - Writes this token to a . - - A into which this method will write. - A collection of which will be used when writing the token. - - - - Loads an from a . - - A that will be read for the content of the . - A that contains the JSON that was read from the specified . - - - - Gets the container's children tokens. - - The container's children tokens. - - - - Gets or sets the name of this constructor. - - The constructor name. - - - - Gets the node type for this . - - The type. - - - - Gets the with the specified key. - - The with the specified key. - - - - Represents a collection of objects. - - The type of token - - - - An empty collection of objects. - - - - - Initializes a new instance of the struct. - - The enumerable. - - - - Returns an enumerator that iterates through the collection. - - - A that can be used to iterate through the collection. - - - - - Returns an enumerator that iterates through a collection. - - - An object that can be used to iterate through the collection. - - - - - Determines whether the specified is equal to this instance. - - The to compare with this instance. - - true if the specified is equal to this instance; otherwise, false. - - - - - Returns a hash code for this instance. - - - A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. - - - - - Gets the with the specified key. - - - - - - Represents a JSON object. - - - - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class from another object. - - A object to copy from. - - - - Initializes a new instance of the class with the specified content. - - The contents of the object. - - - - Initializes a new instance of the class with the specified content. - - The contents of the object. - - - - Gets an of this object's properties. - - An of this object's properties. - - - - Gets a the specified name. - - The property name. - A with the specified name or null. - - - - Gets an of this object's property values. - - An of this object's property values. - - - - Loads an from a . - - A that will be read for the content of the . - A that contains the JSON that was read from the specified . - - - - Load a from a string that contains JSON. - - A that contains JSON. - A populated from the string that contains JSON. - - - - - - - Creates a from an object. - - The object that will be used to create . - A with the values of the specified object - - - - Creates a from an object. - - The object that will be used to create . - The that will be used to read the object. - A with the values of the specified object - - - - Writes this token to a . - - A into which this method will write. - A collection of which will be used when writing the token. - - - - Gets the with the specified property name. - - Name of the property. - The with the specified property name. - - - - Gets the with the specified property name. - The exact property name will be searched for first and if no matching property is found then - the will be used to match a property. - - Name of the property. - One of the enumeration values that specifies how the strings will be compared. - The with the specified property name. - - - - Tries to get the with the specified property name. - The exact property name will be searched for first and if no matching property is found then - the will be used to match a property. - - Name of the property. - The value. - One of the enumeration values that specifies how the strings will be compared. - true if a value was successfully retrieved; otherwise, false. - - - - Adds the specified property name. - - Name of the property. - The value. - - - - Removes the property with the specified name. - - Name of the property. - true if item was successfully removed; otherwise, false. - - - - Tries the get value. - - Name of the property. - The value. - true if a value was successfully retrieved; otherwise, false. - - - - Returns an enumerator that iterates through the collection. - - - A that can be used to iterate through the collection. - - - - - Raises the event with the provided arguments. - - Name of the property. - - - - Raises the event with the provided arguments. - - Name of the property. - - - - Returns the properties for this instance of a component. - - - A that represents the properties for this component instance. - - - - - Returns the properties for this instance of a component using the attribute array as a filter. - - An array of type that is used as a filter. - - A that represents the filtered properties for this component instance. - - - - - Returns a collection of custom attributes for this instance of a component. - - - An containing the attributes for this object. - - - - - Returns the class name of this instance of a component. - - - The class name of the object, or null if the class does not have a name. - - - - - Returns the name of this instance of a component. - - - The name of the object, or null if the object does not have a name. - - - - - Returns a type converter for this instance of a component. - - - A that is the converter for this object, or null if there is no for this object. - - - - - Returns the default event for this instance of a component. - - - An that represents the default event for this object, or null if this object does not have events. - - - - - Returns the default property for this instance of a component. - - - A that represents the default property for this object, or null if this object does not have properties. - - - - - Returns an editor of the specified type for this instance of a component. - - A that represents the editor for this object. - - An of the specified type that is the editor for this object, or null if the editor cannot be found. - - - - - Returns the events for this instance of a component using the specified attribute array as a filter. - - An array of type that is used as a filter. - - An that represents the filtered events for this component instance. - - - - - Returns the events for this instance of a component. - - - An that represents the events for this component instance. - - - - - Returns an object that contains the property described by the specified property descriptor. - - A that represents the property whose owner is to be found. - - An that represents the owner of the specified property. - - - - - Returns the responsible for binding operations performed on this object. - - The expression tree representation of the runtime value. - - The to bind this object. - - - - - Gets the container's children tokens. - - The container's children tokens. - - - - Occurs when a property value changes. - - - - - Occurs when a property value is changing. - - - - - Gets the node type for this . - - The type. - - - - Gets the with the specified key. - - The with the specified key. - - - - Gets or sets the with the specified property name. - - - - - - Represents a JSON array. - - - - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class from another object. - - A object to copy from. - - - - Initializes a new instance of the class with the specified content. - - The contents of the array. - - - - Initializes a new instance of the class with the specified content. - - The contents of the array. - - - - Loads an from a . - - A that will be read for the content of the . - A that contains the JSON that was read from the specified . - - - - Load a from a string that contains JSON. - - A that contains JSON. - A populated from the string that contains JSON. - - - - - - - Creates a from an object. - - The object that will be used to create . - A with the values of the specified object - - - - Creates a from an object. - - The object that will be used to create . - The that will be used to read the object. - A with the values of the specified object - - - - Writes this token to a . - - A into which this method will write. - A collection of which will be used when writing the token. - - - - Determines the index of a specific item in the . - - The object to locate in the . - - The index of if found in the list; otherwise, -1. - - - - - Inserts an item to the at the specified index. - - The zero-based index at which should be inserted. - The object to insert into the . - - is not a valid index in the . - The is read-only. - - - - Removes the item at the specified index. - - The zero-based index of the item to remove. - - is not a valid index in the . - The is read-only. - - - - Returns an enumerator that iterates through the collection. - - - A that can be used to iterate through the collection. - - - - - Adds an item to the . - - The object to add to the . - The is read-only. - - - - Removes all items from the . - - The is read-only. - - - - Determines whether the contains a specific value. - - The object to locate in the . - - true if is found in the ; otherwise, false. - - - - - Copies to. - - The array. - Index of the array. - - - - Removes the first occurrence of a specific object from the . - - The object to remove from the . - - true if was successfully removed from the ; otherwise, false. This method also returns false if is not found in the original . - - The is read-only. - - - - Gets the container's children tokens. - - The container's children tokens. - - - - Gets the node type for this . - - The type. - - - - Gets the with the specified key. - - The with the specified key. - - - - Gets or sets the at the specified index. - - - - - - Gets a value indicating whether the is read-only. - - true if the is read-only; otherwise, false. - - - - Represents a reader that provides fast, non-cached, forward-only access to serialized Json data. - - - - - Initializes a new instance of the class. - - The token to read from. - - - - Reads the next JSON token from the stream as a . - - - A or a null reference if the next JSON token is null. This method will return null at the end of an array. - - - - - Reads the next JSON token from the stream as a . - - A . This method will return null at the end of an array. - - - - Reads the next JSON token from the stream as a . - - A . This method will return null at the end of an array. - - - - Reads the next JSON token from the stream as a . - - A . This method will return null at the end of an array. - - - - Reads the next JSON token from the stream as a . - - A . This method will return null at the end of an array. - - - - Reads the next JSON token from the stream as a . - - A . This method will return null at the end of an array. - - - - Reads the next JSON token from the stream. - - - true if the next token was read successfully; false if there are no more tokens to read. - - - - - Gets the path of the current JSON token. - - - - - Represents a writer that provides a fast, non-cached, forward-only way of generating Json data. - - - - - Initializes a new instance of the class writing to the given . - - The container being written to. - - - - Initializes a new instance of the class. - - - - - Flushes whatever is in the buffer to the underlying streams and also flushes the underlying stream. - - - - - Closes this stream and the underlying stream. - - - - - Writes the beginning of a Json object. - - - - - Writes the beginning of a Json array. - - - - - Writes the start of a constructor with the given name. - - The name of the constructor. - - - - Writes the end. - - The token. - - - - Writes the property name of a name/value pair on a Json object. - - The name of the property. - - - - Writes a value. - An error will raised if the value cannot be written as a single JSON token. - - The value to write. - - - - Writes a null value. - - - - - Writes an undefined value. - - - - - Writes raw JSON. - - The raw JSON to write. - - - - Writes out a comment /*...*/ containing the specified text. - - Text to place inside the comment. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Gets the token being writen. - - The token being writen. - - - - Represents a JSON property. - - - - - Initializes a new instance of the class from another object. - - A object to copy from. - - - - Initializes a new instance of the class. - - The property name. - The property content. - - - - Initializes a new instance of the class. - - The property name. - The property content. - - - - Writes this token to a . - - A into which this method will write. - A collection of which will be used when writing the token. - - - - Loads an from a . - - A that will be read for the content of the . - A that contains the JSON that was read from the specified . - - - - Gets the container's children tokens. - - The container's children tokens. - - - - Gets the property name. - - The property name. - - - - Gets or sets the property value. - - The property value. - - - - Gets the node type for this . - - The type. - - - - Specifies the type of token. - - - - - No token type has been set. - - - - - A JSON object. - - - - - A JSON array. - - - - - A JSON constructor. - - - - - A JSON object property. - - - - - A comment. - - - - - An integer value. - - - - - A float value. - - - - - A string value. - - - - - A boolean value. - - - - - A null value. - - - - - An undefined value. - - - - - A date value. - - - - - A raw JSON value. - - - - - A collection of bytes value. - - - - - A Guid value. - - - - - A Uri value. - - - - - A TimeSpan value. - - - - - Contains the JSON schema extension methods. - - - - - Determines whether the is valid. - - The source to test. - The schema to test with. - - true if the specified is valid; otherwise, false. - - - - - Determines whether the is valid. - - The source to test. - The schema to test with. - When this method returns, contains any error messages generated while validating. - - true if the specified is valid; otherwise, false. - - - - - Validates the specified . - - The source to test. - The schema to test with. - - - - Validates the specified . - - The source to test. - The schema to test with. - The validation event handler. - - - - Returns detailed information about the schema exception. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class - with a specified error message. - - The error message that explains the reason for the exception. - - - - Initializes a new instance of the class - with a specified error message and a reference to the inner exception that is the cause of this exception. - - The error message that explains the reason for the exception. - The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. - - - - Initializes a new instance of the class. - - The that holds the serialized object data about the exception being thrown. - The that contains contextual information about the source or destination. - The parameter is null. - The class name is null or is zero (0). - - - - Gets the line number indicating where the error occurred. - - The line number indicating where the error occurred. - - - - Gets the line position indicating where the error occurred. - - The line position indicating where the error occurred. - - - - Gets the path to the JSON where the error occurred. - - The path to the JSON where the error occurred. - - - - Resolves from an id. - - - - - Initializes a new instance of the class. - - - - - Gets a for the specified reference. - - The id. - A for the specified reference. - - - - Gets or sets the loaded schemas. - - The loaded schemas. - - - - Specifies undefined schema Id handling options for the . - - - - - Do not infer a schema Id. - - - - - Use the .NET type name as the schema Id. - - - - - Use the assembly qualified .NET type name as the schema Id. - - - - - Returns detailed information related to the . - - - - - Gets the associated with the validation error. - - The JsonSchemaException associated with the validation error. - - - - Gets the path of the JSON location where the validation error occurred. - - The path of the JSON location where the validation error occurred. - - - - Gets the text description corresponding to the validation error. - - The text description. - - - - Represents the callback method that will handle JSON schema validation events and the . - - - - - Resolves member mappings for a type, camel casing property names. - - - - - Used by to resolves a for a given . - - - - - Used by to resolves a for a given . - - - - - - - - - Resolves the contract for a given type. - - The type to resolve a contract for. - The contract for a given type. - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - - If set to true the will use a cached shared with other resolvers of the same type. - Sharing the cache will significantly performance because expensive reflection will only happen once but could cause unexpected - behavior if different instances of the resolver are suppose to produce different results. When set to false it is highly - recommended to reuse instances with the . - - - - - Resolves the contract for a given type. - - The type to resolve a contract for. - The contract for a given type. - - - - Gets the serializable members for the type. - - The type to get serializable members for. - The serializable members for the type. - - - - Creates a for the given type. - - Type of the object. - A for the given type. - - - - Creates the constructor parameters. - - The constructor to create properties for. - The type's member properties. - Properties for the given . - - - - Creates a for the given . - - The matching member property. - The constructor parameter. - A created for the given . - - - - Resolves the default for the contract. - - Type of the object. - The contract's default . - - - - Creates a for the given type. - - Type of the object. - A for the given type. - - - - Creates a for the given type. - - Type of the object. - A for the given type. - - - - Creates a for the given type. - - Type of the object. - A for the given type. - - - - Creates a for the given type. - - Type of the object. - A for the given type. - - - - Creates a for the given type. - - Type of the object. - A for the given type. - - - - Creates a for the given type. - - Type of the object. - A for the given type. - - - - Creates a for the given type. - - Type of the object. - A for the given type. - - - - Determines which contract type is created for the given type. - - Type of the object. - A for the given type. - - - - Creates properties for the given . - - The type to create properties for. - /// The member serialization mode for the type. - Properties for the given . - - - - Creates the used by the serializer to get and set values from a member. - - The member. - The used by the serializer to get and set values from a member. - - - - Creates a for the given . - - The member's parent . - The member to create a for. - A created for the given . - - - - Resolves the name of the property. - - Name of the property. - Name of the property. - - - - Gets the resolved name of the property. - - Name of the property. - Name of the property. - - - - Gets a value indicating whether members are being get and set using dynamic code generation. - This value is determined by the runtime permissions available. - - - true if using dynamic code generation; otherwise, false. - - - - - Gets or sets the default members search flags. - - The default members search flags. - - - - Gets or sets a value indicating whether compiler generated members should be serialized. - - - true if serialized compiler generated members; otherwise, false. - - - - - Gets or sets a value indicating whether to ignore the interface when serializing and deserializing types. - - - true if the interface will be ignored when serializing and deserializing types; otherwise, false. - - - - - Gets or sets a value indicating whether to ignore the attribute when serializing and deserializing types. - - - true if the attribute will be ignored when serializing and deserializing types; otherwise, false. - - - - - Initializes a new instance of the class. - - - - - Resolves the name of the property. - - Name of the property. - The property name camel cased. - - - - The default serialization binder used when resolving and loading classes from type names. - - - - - When overridden in a derived class, controls the binding of a serialized object to a type. - - Specifies the name of the serialized object. - Specifies the name of the serialized object. - - The type of the object the formatter creates a new instance of. - - - - - When overridden in a derived class, controls the binding of a serialized object to a type. - - The type of the object the formatter creates a new instance of. - Specifies the name of the serialized object. - Specifies the name of the serialized object. - - - - Provides information surrounding an error. - - - - - Gets the error. - - The error. - - - - Gets the original object that caused the error. - - The original object that caused the error. - - - - Gets the member that caused the error. - - The member that caused the error. - - - - Gets the path of the JSON location where the error occurred. - - The path of the JSON location where the error occurred. - - - - Gets or sets a value indicating whether this is handled. - - true if handled; otherwise, false. - - - - Contract details for a used by the . - - - - - Initializes a new instance of the class. - - The underlying type for the contract. - - - - Gets the of the collection items. - - The of the collection items. - - - - Gets a value indicating whether the collection type is a multidimensional array. - - true if the collection type is a multidimensional array; otherwise, false. - - - - Handles serialization callback events. - - The object that raised the callback event. - The streaming context. - - - - Handles serialization error callback events. - - The object that raised the callback event. - The streaming context. - The error context. - - - - Sets extension data for an object during deserialization. - - The object to set extension data on. - The extension data key. - The extension data value. - - - - Gets extension data for an object during serialization. - - The object to set extension data on. - - - - Contract details for a used by the . - - - - - Initializes a new instance of the class. - - The underlying type for the contract. - - - - Gets or sets the property name resolver. - - The property name resolver. - - - - Gets the of the dictionary keys. - - The of the dictionary keys. - - - - Gets the of the dictionary values. - - The of the dictionary values. - - - - Maps a JSON property to a .NET member or constructor parameter. - - - - - Returns a that represents this instance. - - - A that represents this instance. - - - - - Gets or sets the name of the property. - - The name of the property. - - - - Gets or sets the type that declared this property. - - The type that declared this property. - - - - Gets or sets the order of serialization and deserialization of a member. - - The numeric order of serialization or deserialization. - - - - Gets or sets the name of the underlying member or parameter. - - The name of the underlying member or parameter. - - - - Gets the that will get and set the during serialization. - - The that will get and set the during serialization. - - - - Gets or sets the type of the property. - - The type of the property. - - - - Gets or sets the for the property. - If set this converter takes presidence over the contract converter for the property type. - - The converter. - - - - Gets or sets the member converter. - - The member converter. - - - - Gets or sets a value indicating whether this is ignored. - - true if ignored; otherwise, false. - - - - Gets or sets a value indicating whether this is readable. - - true if readable; otherwise, false. - - - - Gets or sets a value indicating whether this is writable. - - true if writable; otherwise, false. - - - - Gets or sets a value indicating whether this has a member attribute. - - true if has a member attribute; otherwise, false. - - - - Gets the default value. - - The default value. - - - - Gets or sets a value indicating whether this is required. - - A value indicating whether this is required. - - - - Gets or sets a value indicating whether this property preserves object references. - - - true if this instance is reference; otherwise, false. - - - - - Gets or sets the property null value handling. - - The null value handling. - - - - Gets or sets the property default value handling. - - The default value handling. - - - - Gets or sets the property reference loop handling. - - The reference loop handling. - - - - Gets or sets the property object creation handling. - - The object creation handling. - - - - Gets or sets or sets the type name handling. - - The type name handling. - - - - Gets or sets a predicate used to determine whether the property should be serialize. - - A predicate used to determine whether the property should be serialize. - - - - Gets or sets a predicate used to determine whether the property should be serialized. - - A predicate used to determine whether the property should be serialized. - - - - Gets or sets an action used to set whether the property has been deserialized. - - An action used to set whether the property has been deserialized. - - - - Gets or sets the converter used when serializing the property's collection items. - - The collection's items converter. - - - - Gets or sets whether this property's collection items are serialized as a reference. - - Whether this property's collection items are serialized as a reference. - - - - Gets or sets the the type name handling used when serializing the property's collection items. - - The collection's items type name handling. - - - - Gets or sets the the reference loop handling used when serializing the property's collection items. - - The collection's items reference loop handling. - - - - A collection of objects. - - - - - Initializes a new instance of the class. - - The type. - - - - When implemented in a derived class, extracts the key from the specified element. - - The element from which to extract the key. - The key for the specified element. - - - - Adds a object. - - The property to add to the collection. - - - - Gets the closest matching object. - First attempts to get an exact case match of propertyName and then - a case insensitive match. - - Name of the property. - A matching property if found. - - - - Gets a property by property name. - - The name of the property to get. - Type property name string comparison. - A matching property if found. - - - - Specifies missing member handling options for the . - - - - - Ignore a missing member and do not attempt to deserialize it. - - - - - Throw a when a missing member is encountered during deserialization. - - - - - Specifies null value handling options for the . - - - - - - - - - Include null values when serializing and deserializing objects. - - - - - Ignore null values when serializing and deserializing objects. - - - - - Specifies reference loop handling options for the . - - - - - Throw a when a loop is encountered. - - - - - Ignore loop references and do not serialize. - - - - - Serialize loop references. - - - - - An in-memory representation of a JSON Schema. - - - - - Initializes a new instance of the class. - - - - - Reads a from the specified . - - The containing the JSON Schema to read. - The object representing the JSON Schema. - - - - Reads a from the specified . - - The containing the JSON Schema to read. - The to use when resolving schema references. - The object representing the JSON Schema. - - - - Load a from a string that contains schema JSON. - - A that contains JSON. - A populated from the string that contains JSON. - - - - Parses the specified json. - - The json. - The resolver. - A populated from the string that contains JSON. - - - - Writes this schema to a . - - A into which this method will write. - - - - Writes this schema to a using the specified . - - A into which this method will write. - The resolver used. - - - - Returns a that represents the current . - - - A that represents the current . - - - - - Gets or sets the id. - - - - - Gets or sets the title. - - - - - Gets or sets whether the object is required. - - - - - Gets or sets whether the object is read only. - - - - - Gets or sets whether the object is visible to users. - - - - - Gets or sets whether the object is transient. - - - - - Gets or sets the description of the object. - - - - - Gets or sets the types of values allowed by the object. - - The type. - - - - Gets or sets the pattern. - - The pattern. - - - - Gets or sets the minimum length. - - The minimum length. - - - - Gets or sets the maximum length. - - The maximum length. - - - - Gets or sets a number that the value should be divisble by. - - A number that the value should be divisble by. - - - - Gets or sets the minimum. - - The minimum. - - - - Gets or sets the maximum. - - The maximum. - - - - Gets or sets a flag indicating whether the value can not equal the number defined by the "minimum" attribute. - - A flag indicating whether the value can not equal the number defined by the "minimum" attribute. - - - - Gets or sets a flag indicating whether the value can not equal the number defined by the "maximum" attribute. - - A flag indicating whether the value can not equal the number defined by the "maximum" attribute. - - - - Gets or sets the minimum number of items. - - The minimum number of items. - - - - Gets or sets the maximum number of items. - - The maximum number of items. - - - - Gets or sets the of items. - - The of items. - - - - Gets or sets a value indicating whether items in an array are validated using the instance at their array position from . - - - true if items are validated using their array position; otherwise, false. - - - - - Gets or sets the of additional items. - - The of additional items. - - - - Gets or sets a value indicating whether additional items are allowed. - - - true if additional items are allowed; otherwise, false. - - - - - Gets or sets whether the array items must be unique. - - - - - Gets or sets the of properties. - - The of properties. - - - - Gets or sets the of additional properties. - - The of additional properties. - - - - Gets or sets the pattern properties. - - The pattern properties. - - - - Gets or sets a value indicating whether additional properties are allowed. - - - true if additional properties are allowed; otherwise, false. - - - - - Gets or sets the required property if this property is present. - - The required property if this property is present. - - - - Gets or sets the a collection of valid enum values allowed. - - A collection of valid enum values allowed. - - - - Gets or sets disallowed types. - - The disallow types. - - - - Gets or sets the default value. - - The default value. - - - - Gets or sets the collection of that this schema extends. - - The collection of that this schema extends. - - - - Gets or sets the format. - - The format. - - - - Generates a from a specified . - - - - - Generate a from the specified type. - - The type to generate a from. - A generated from the specified type. - - - - Generate a from the specified type. - - The type to generate a from. - The used to resolve schema references. - A generated from the specified type. - - - - Generate a from the specified type. - - The type to generate a from. - Specify whether the generated root will be nullable. - A generated from the specified type. - - - - Generate a from the specified type. - - The type to generate a from. - The used to resolve schema references. - Specify whether the generated root will be nullable. - A generated from the specified type. - - - - Gets or sets how undefined schemas are handled by the serializer. - - - - - Gets or sets the contract resolver. - - The contract resolver. - - - - The value types allowed by the . - - - - - No type specified. - - - - - String type. - - - - - Float type. - - - - - Integer type. - - - - - Boolean type. - - - - - Object type. - - - - - Array type. - - - - - Null type. - - - - - Any type. - - - - - Contract details for a used by the . - - - - - Initializes a new instance of the class. - - The underlying type for the contract. - - - - Gets or sets the object member serialization. - - The member object serialization. - - - - Gets or sets a value that indicates whether the object's properties are required. - - - A value indicating whether the object's properties are required. - - - - - Gets the object's properties. - - The object's properties. - - - - Gets the constructor parameters required for any non-default constructor - - - - - Gets or sets the override constructor used to create the object. - This is set when a constructor is marked up using the - JsonConstructor attribute. - - The override constructor. - - - - Gets or sets the parametrized constructor used to create the object. - - The parametrized constructor. - - - - Gets or sets the extension data setter. - - - - - Gets or sets the extension data getter. - - - - - Contract details for a used by the . - - - - - Initializes a new instance of the class. - - The underlying type for the contract. - - - - Get and set values for a using reflection. - - - - - Initializes a new instance of the class. - - The member info. - - - - Sets the value. - - The target to set the value on. - The value to set on the target. - - - - Gets the value. - - The target to get the value from. - The value. - - - - When applied to a method, specifies that the method is called when an error occurs serializing an object. - - - - - Helper method for generating a MetaObject which calls a - specific method on Dynamic that returns a result - - - - - Helper method for generating a MetaObject which calls a - specific method on Dynamic, but uses one of the arguments for - the result. - - - - - Helper method for generating a MetaObject which calls a - specific method on Dynamic, but uses one of the arguments for - the result. - - - - - Returns a Restrictions object which includes our current restrictions merged - with a restriction limiting our type - - - - - Represents a method that constructs an object. - - The object type to create. - - - - Specifies type name handling options for the . - - - - - Do not include the .NET type name when serializing types. - - - - - Include the .NET type name when serializing into a JSON object structure. - - - - - Include the .NET type name when serializing into a JSON array structure. - - - - - Always include the .NET type name when serializing. - - - - - Include the .NET type name when the type of the object being serialized is not the same as its declared type. - - - - - Converts the value to the specified type. If the value is unable to be converted, the - value is checked whether it assignable to the specified type. - - The value to convert. - The culture to use when converting. - The type to convert or cast the value to. - - The converted type. If conversion was unsuccessful, the initial value - is returned if assignable to the target type. - - - - - Gets a dictionary of the names and values of an Enum type. - - - - - - Gets a dictionary of the names and values of an Enum type. - - The enum type to get names and values for. - - - - - Specifies the type of Json token. - - - - - This is returned by the if a method has not been called. - - - - - An object start token. - - - - - An array start token. - - - - - A constructor start token. - - - - - An object property name. - - - - - A comment. - - - - - Raw JSON. - - - - - An integer. - - - - - A float. - - - - - A string. - - - - - A boolean. - - - - - A null token. - - - - - An undefined token. - - - - - An object end token. - - - - - An array end token. - - - - - A constructor end token. - - - - - A Date. - - - - - Byte data. - - - - - Builds a string. Unlike StringBuilder this class lets you reuse it's internal buffer. - - - - - Determines whether the collection is null or empty. - - The collection. - - true if the collection is null or empty; otherwise, false. - - - - - Adds the elements of the specified collection to the specified generic IList. - - The list to add to. - The collection of elements to add. - - - - Returns the index of the first occurrence in a sequence by using a specified IEqualityComparer. - - The type of the elements of source. - A sequence in which to locate a value. - The object to locate in the sequence - An equality comparer to compare values. - The zero-based index of the first occurrence of value within the entire sequence, if found; otherwise, –1. - - - - Gets the type of the typed collection's items. - - The type. - The type of the typed collection's items. - - - - Gets the member's underlying type. - - The member. - The underlying type of the member. - - - - Determines whether the member is an indexed property. - - The member. - - true if the member is an indexed property; otherwise, false. - - - - - Determines whether the property is an indexed property. - - The property. - - true if the property is an indexed property; otherwise, false. - - - - - Gets the member's value on the object. - - The member. - The target object. - The member's value on the object. - - - - Sets the member's value on the target object. - - The member. - The target. - The value. - - - - Determines whether the specified MemberInfo can be read. - - The MemberInfo to determine whether can be read. - /// if set to true then allow the member to be gotten non-publicly. - - true if the specified MemberInfo can be read; otherwise, false. - - - - - Determines whether the specified MemberInfo can be set. - - The MemberInfo to determine whether can be set. - if set to true then allow the member to be set non-publicly. - if set to true then allow the member to be set if read-only. - - true if the specified MemberInfo can be set; otherwise, false. - - - - - Determines whether the string is all white space. Empty string will return false. - - The string to test whether it is all white space. - - true if the string is all white space; otherwise, false. - - - - - Nulls an empty string. - - The string. - Null if the string was null, otherwise the string unchanged. - - - - Specifies the state of the . - - - - - An exception has been thrown, which has left the in an invalid state. - You may call the method to put the in the Closed state. - Any other method calls results in an being thrown. - - - - - The method has been called. - - - - - An object is being written. - - - - - A array is being written. - - - - - A constructor is being written. - - - - - A property is being written. - - - - - A write method has not been called. - - - - diff --git a/Interfax.ClientLib/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/Interfax.ClientLib/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache deleted file mode 100644 index c3df0be..0000000 Binary files a/Interfax.ClientLib/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache and /dev/null differ diff --git a/Interfax.ClientLib/obj/Debug/Interfax.ClassLib.csproj.FileListAbsolute.txt b/Interfax.ClientLib/obj/Debug/Interfax.ClassLib.csproj.FileListAbsolute.txt deleted file mode 100644 index 2adaddd..0000000 --- a/Interfax.ClientLib/obj/Debug/Interfax.ClassLib.csproj.FileListAbsolute.txt +++ /dev/null @@ -1,4 +0,0 @@ -c:\Projects\Interfax\trunk\Interfax20\ClientLib\ClassLib\bin\Debug\Interfax.ClientLib.dll -c:\Projects\Interfax\trunk\Interfax20\ClientLib\ClassLib\bin\Debug\Interfax.ClientLib.pdb -c:\Projects\Interfax\trunk\Interfax20\ClientLib\ClassLib\obj\Debug\Interfax.ClientLib.dll -c:\Projects\Interfax\trunk\Interfax20\ClientLib\ClassLib\obj\Debug\Interfax.ClientLib.pdb diff --git a/Interfax.ClientLib/obj/Debug/Interfax.ClientLib.csproj.FileListAbsolute.txt b/Interfax.ClientLib/obj/Debug/Interfax.ClientLib.csproj.FileListAbsolute.txt deleted file mode 100644 index b0ba4ff..0000000 --- a/Interfax.ClientLib/obj/Debug/Interfax.ClientLib.csproj.FileListAbsolute.txt +++ /dev/null @@ -1,20 +0,0 @@ -c:\Projects\Interfax\trunk\Interfax20\ClientLib\ClassLib\bin\Debug\Interfax.ClientLib.dll -c:\Projects\Interfax\trunk\Interfax20\ClientLib\ClassLib\bin\Debug\Interfax.ClientLib.pdb -c:\Projects\Interfax\trunk\Interfax20\ClientLib\ClassLib\obj\Debug\Interfax.ClientLib.dll -c:\Projects\Interfax\trunk\Interfax20\ClientLib\ClassLib\obj\Debug\Interfax.ClientLib.pdb -c:\Projects\Interfax\trunk\Interfax20\ClientLib\ClientLib\bin\Debug\Interfax.ClientLib.dll -c:\Projects\Interfax\trunk\Interfax20\ClientLib\ClientLib\bin\Debug\Interfax.ClientLib.pdb -c:\Projects\Interfax\trunk\Interfax20\ClientLib\ClientLib\bin\Debug\Newtonsoft.Json.dll -c:\Projects\Interfax\trunk\Interfax20\ClientLib\ClientLib\bin\Debug\Newtonsoft.Json.xml -c:\Projects\Interfax\trunk\Interfax20\ClientLib\ClientLib\obj\Debug\Interfax.ClientLib.dll -c:\Projects\Interfax\trunk\Interfax20\ClientLib\ClientLib\obj\Debug\Interfax.ClientLib.pdb -c:\Projects\Interfax\trunk\Interfax20\ClientLib\ClientLib\bin\Debug\Interfax.ClientLib.XML -c:\Projects\Interfax\trunk\Interfax20\ClientLib\ClientLib\obj\Debug\Interfax.ClientLib.csprojResolveAssemblyReference.cache -c:\Projects\Interfax\trunk\Interfax20\Interfax.ClientLib\Interfax.ClientLib\bin\Debug\Interfax.ClientLib.XML -c:\Projects\Interfax\trunk\Interfax20\Interfax.ClientLib\Interfax.ClientLib\bin\Debug\Interfax.ClientLib.dll -c:\Projects\Interfax\trunk\Interfax20\Interfax.ClientLib\Interfax.ClientLib\bin\Debug\Interfax.ClientLib.pdb -c:\Projects\Interfax\trunk\Interfax20\Interfax.ClientLib\Interfax.ClientLib\bin\Debug\Newtonsoft.Json.dll -c:\Projects\Interfax\trunk\Interfax20\Interfax.ClientLib\Interfax.ClientLib\bin\Debug\Newtonsoft.Json.xml -c:\Projects\Interfax\trunk\Interfax20\Interfax.ClientLib\Interfax.ClientLib\obj\Debug\Interfax.ClientLib.csprojResolveAssemblyReference.cache -c:\Projects\Interfax\trunk\Interfax20\Interfax.ClientLib\Interfax.ClientLib\obj\Debug\Interfax.ClientLib.dll -c:\Projects\Interfax\trunk\Interfax20\Interfax.ClientLib\Interfax.ClientLib\obj\Debug\Interfax.ClientLib.pdb diff --git a/Interfax.ClientLib/obj/Debug/Interfax.ClientLib.csprojResolveAssemblyReference.cache b/Interfax.ClientLib/obj/Debug/Interfax.ClientLib.csprojResolveAssemblyReference.cache deleted file mode 100644 index f05f7af..0000000 Binary files a/Interfax.ClientLib/obj/Debug/Interfax.ClientLib.csprojResolveAssemblyReference.cache and /dev/null differ diff --git a/Interfax.ClientLib/obj/Debug/Interfax.ClientLib.pdb b/Interfax.ClientLib/obj/Debug/Interfax.ClientLib.pdb deleted file mode 100644 index cdcc24d..0000000 Binary files a/Interfax.ClientLib/obj/Debug/Interfax.ClientLib.pdb and /dev/null differ diff --git a/Interfax.ClientLib/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs b/Interfax.ClientLib/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs deleted file mode 100644 index e69de29..0000000 diff --git a/Interfax.ClientLib/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs b/Interfax.ClientLib/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs deleted file mode 100644 index e69de29..0000000 diff --git a/Interfax.ClientLib/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs b/Interfax.ClientLib/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs deleted file mode 100644 index e69de29..0000000 diff --git a/Interfax.ClientLib/obj/Release/DesignTimeResolveAssemblyReferencesInput.cache b/Interfax.ClientLib/obj/Release/DesignTimeResolveAssemblyReferencesInput.cache deleted file mode 100644 index fbcb722..0000000 Binary files a/Interfax.ClientLib/obj/Release/DesignTimeResolveAssemblyReferencesInput.cache and /dev/null differ diff --git a/Interfax.ClientLib/obj/Release/Interfax.ClientLib.csproj.FileListAbsolute.txt b/Interfax.ClientLib/obj/Release/Interfax.ClientLib.csproj.FileListAbsolute.txt deleted file mode 100644 index 5289969..0000000 --- a/Interfax.ClientLib/obj/Release/Interfax.ClientLib.csproj.FileListAbsolute.txt +++ /dev/null @@ -1,7 +0,0 @@ -c:\Projects\Interfax\trunk\Interfax20\ClientLib\ClientLib\bin\Release\Interfax.ClientLib.XML -c:\Projects\Interfax\trunk\Interfax20\ClientLib\ClientLib\bin\Release\Interfax.ClientLib.dll -c:\Projects\Interfax\trunk\Interfax20\ClientLib\ClientLib\bin\Release\Interfax.ClientLib.pdb -c:\Projects\Interfax\trunk\Interfax20\ClientLib\ClientLib\bin\Release\Newtonsoft.Json.dll -c:\Projects\Interfax\trunk\Interfax20\ClientLib\ClientLib\bin\Release\Newtonsoft.Json.xml -c:\Projects\Interfax\trunk\Interfax20\ClientLib\ClientLib\obj\Release\Interfax.ClientLib.dll -c:\Projects\Interfax\trunk\Interfax20\ClientLib\ClientLib\obj\Release\Interfax.ClientLib.pdb diff --git a/Interfax.ClientLib/obj/Release/Interfax.ClientLib.pdb b/Interfax.ClientLib/obj/Release/Interfax.ClientLib.pdb deleted file mode 100644 index 7713082..0000000 Binary files a/Interfax.ClientLib/obj/Release/Interfax.ClientLib.pdb and /dev/null differ diff --git a/Interfax.ClientLib/obj/Release/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs b/Interfax.ClientLib/obj/Release/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs deleted file mode 100644 index e69de29..0000000 diff --git a/Interfax.ClientLib/obj/Release/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs b/Interfax.ClientLib/obj/Release/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs deleted file mode 100644 index e69de29..0000000 diff --git a/Interfax.ClientLib/obj/Release/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs b/Interfax.ClientLib/obj/Release/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs deleted file mode 100644 index e69de29..0000000 diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..0fe727d --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2016 InterFAX + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index 75caa0e..efa0920 100644 --- a/README.md +++ b/README.md @@ -1,73 +1,442 @@ -# InterFAX client library for .Net -This is the .Net client library for the InterFAX fax API. To use it, you'll need [register for an InterFAX developer account](https://www.interfax.net/en/dev/register). +# InterFAX .NET Library -* [Installation](https://github.com/interfax/interfax-dotnet#installation) -* [Usage](https://github.com/interfax/interfax-dotnet#usage) -* [Examples](https://github.com/interfax/interfax-dotnet#examples) -* [Documentation](https://github.com/interfax/interfax-dotnet#documentation) -* [Support](https://github.com/interfax/interfax-dotnet#support) -* [Contributing](https://github.com/interfax/interfax-dotnet#contributing) -* [License](https://github.com/interfax/interfax-dotnet#license) +[![Build Status](https://travis-ci.org/jdpearce/interfax-dotnet.svg?branch=master)](https://travis-ci.org/jdpearce/interfax-dotnet) + +[Installation](#installation) | [Getting Started](#getting-started) | [Contributing](#contributing) | [License](#license) + +Send and receive faxes in [CLI Languages](https://en.wikipedia.org/wiki/List_of_CLI_languages) with the [InterFAX REST API](https://www.interfax.net/en/dev/rest/reference). + +(examples are in C#) ## Installation -### Via Nuget +This library targets .NET 4.5.2 and can be installed via Nuget : + +``` +Install-Package InterFAX.Api -Version 1.0.1 +``` + +## Getting started + + +# Usage + +[Client](#client) | [Account](#account) | [Outbound](#outbound) | [Inbound](#inbound) | [Documents](#documents) + +## Client + +The client follows the [12-factor](http://12factor.net/config) apps principle and can be either set directly, via configuration files or environment variables. + +```csharp +using InterFAX.Api; + +// Initialize using parameters +var interfax = new FaxClient(username: "...", password: "..."); + +// Initialize using App.config or Environment variables (both have the same key) +// NB : App.config will take precedence over environment variables. +// +// +// +// + +var interfax = new FaxClient(); +``` + +All connections are established over HTTPS. + +## Account + +### Balance + +`async Task GetBalance();` + +Determine the remaining faxing credits in your account. + +```csharp +var interfax = new FaxClient(); + +var balance = await interfax.Account.GetBalance(); +Console.WriteLine($"Account balance is {balance}"); //=> Account balance is 9.86 +``` + +**More:** [documentation](https://www.interfax.net/en/dev/rest/reference/3001) + +## Outbound + +[Send](#send-fax) | [Get list](#get-outbound-fax-list) | [Get completed list](#get-completed-fax-list) | [Get record](#get-outbound-fax-record) | [Get image stream](#get-outbound-fax-image-stream) | [Cancel fax](#cancel-a-fax) | [Search](#search-fax-list) + +### Send fax + +`async Task SendFax(IFaxDocument faxDocument, SendOptions options)` +`async Task SendFax(List faxDocuments, SendOptions options)` + +Submit a fax to a single destination number. Returns the messageId of the fax. + +There are a few ways to send a fax. You can directly provide a file path or a url, which can be a web page anywhere or a link to a previously uploaded document resource (see [Documents](#documents)). + +```csharp +var options = new SendOptions { FaxNumber = "+11111111112"}; + +// with a path +var fileDocument = interfax.Documents.BuildFaxDocument(@".\folder\fax.txt"); +var messageId = await interfax.SendFax(faxDocument, options); + +// with a URL +var urlDocument = interfax.Documents.BuildFaxDocument(new Uri("https://s3.aws.com/example/fax.pdf")); +var messageId = await interfax.SendFax(urlDocument, options); + +// or both at once +var documents = new List { fileDocument, urlDocument }; +var messageId = await interfax.SendFax(documents, options) +``` + +InterFAX supports over 20 file types including HTML, PDF, TXT, Word, and many more. For a full list see the [Supported File Types](https://www.interfax.net/en/help/supported_file_types) documentation. +The supported types are mapped to media types in the file SupportedMediaTypes.json - this can be modified by hand. + +The returned object is the Id of the fax. Use this Id to load more information, get the image, or cancel the sending of the fax. + +```csharp +var result = await interfax.CancelFax(messageId); + +// result in this case is just "OK". +``` +**SendOptions:** [`FaxNumber`, `Contact`, `PostponeTime`, `RetriesToPerform`, `Csid`, `PageHeader`, `Reference`, `PageSize`, `FitToPage`, `PageOrientation`, `Resolution`, `Rendering`](https://www.interfax.net/en/dev/rest/reference/2918) + +--- + +### Get outbound fax list + +`async Task> GetList(Outbound.ListOptions options = null);` + +Get a list of recent outbound faxes (which does not include batch faxes). + +```csharp +var faxes = await interfax.Outbound.GetList(); +``` + +**Outbound.ListOptions:** [`Limit`, `LastId`, `SortOrder`, `UserId`](https://www.interfax.net/en/dev/rest/reference/2920) + +--- + +### Get completed fax list + +`async Task> GetCompleted(IEnumerable ids = null)` + +Get details for a subset of completed faxes from a submitted list. (Submitted id's which have not completed are ignored). + +```csharp +var completed = await interfax.Outbound.Completed([123, 234]); +``` + +**More:** [documentation](https://www.interfax.net/en/dev/rest/reference/2972) + +---- + +### Get outbound fax record + +`async Task GetFaxRecord(int id);` + +Retrieves information regarding a previously-submitted fax, including its current status. + +```csharp +var fax = interfax.Outbound.GetFaxRecord(123456) +``` + +**More:** [documentation](https://www.interfax.net/en/dev/rest/reference/2921) + +--- + +### Get outbound fax image stream + +`async Task GetFaxImageStream(int id);` + +Retrieve the fax image stream (TIFF file) of a submitted fax. + +```csharp +using (var imageStream = await _interfax.Outbound.GetFaxImageStream(662208217)) +{ + using (var fileStream = File.Create(@".\image.tiff")) + { + InterFAX.Utils.CopyStream(imageStream, fileStream); + } +} +``` + +**More:** [documentation](https://www.interfax.net/en/dev/rest/reference/2941) + +---- + +### Cancel a fax + +`async Task CancelFax(int id)` + +Cancel a fax in progress. + +```csharp +var result = interfax.Outbound.CancelFax(123456) + +// => OK +``` + +**More:** [documentation](https://www.interfax.net/en/dev/rest/reference/2939) + +---- + +### Search fax list + +`async Task> SearchFaxes(SearchOptions searchOptions)` + +Search for outbound faxes. + +```csharp +var faxes = await interfax.Outbound.Search(new SearchOptions { + faxNumber = '+1230002305555' +}); +``` + +**Options:** [`Ids`, `Reference`, `DateFrom`, `DateTo`, `Status`, `UserId`, `FaxNumber`, `Limit`, `Offset`](https://www.interfax.net/en/dev/rest/reference/2959) -... +## Inbound -### By direct download +[Get list](#get-inbound-fax-list) | [Get record](#get-inbound-fax-record) | [Get image stream](#get-inbound-fax-image-stream) | [Get emails](#get-forwarding-emails) | [Mark as read](#mark-as-readunread) | [Resend to email](#resend-inbound-fax) -1. Download the library at https://github.com/interfax/interfax-csharp/releases/latest -2. ... +### Get inbound fax list -## Usage +`async Task> GetList(ListOptions listOptions = null)` -... +Retrieves a user's list of inbound faxes. (Sort order is always in descending ID). -## Examples +```csharp +var faxes = await interfax.Inbound.GetList(new ListOptions { UnreadOnly = true }); +``` -Samples demonstrating the usage of this library can be found at the following locations: +**Options:** [`UnreadOnly`, `Limit`, `LastId`, `AllUsers`](https://www.interfax.net/en/dev/rest/reference/2935) -### C# faxing samples +--- -* Basic samples: https://github.com/interfax/interfax-csharp-samples -* More advanced usage: https://www.interfax.net/en/dev/csharp +### Get inbound fax record -## Documentation +`async Task GetFaxRecord(int id)` -* A 'Getting Started' guide is available at [TBD](#) -* More advanced topics are covered at [TBD](#) -* Documentation of the REST API can be found at https://www.interfax.net/en/dev/rest/reference +Retrieves a single fax's metadata (receive time, sender number, etc.). -## Support +```csharp +var fax = await interfax.Inbound.GetFaxRecord(123456); +``` -Support can be received through the following channels: +**More:** [documentation](https://www.interfax.net/en/dev/rest/reference/2938) -* The InterFAX developer forum at https://www.interfax.net/en/forum/dev -* Our dedicated developer support desk at dev@interfax.net +--- + +### Get inbound fax image stream + +`async Task GetFaxImageStream(int id)` + +Retrieves a single fax's image. + +```csharp +using (var imageStream = await _interfax.Inbound.GetFaxImageStream(291704306)) +{ + using (var fileStream = File.Create(@".\image.tiff")) + { + Utils.CopyStream(imageStream, fileStream); + } +} +``` + +**More:** [documentation](https://www.interfax.net/en/dev/rest/reference/2937) + +--- + +### Get forwarding emails + +`async Task> GetForwardingEmails(int id)` + +Retrieve the list of email addresses to which a fax was forwarded. + +```csharp +var emails = await interfax.Inbound.GetForwardingEmails(12345); +foreach(var email in emails) + Console.WriteLine($"{email.EmailAddress}, {email.MessageStatus}, {email.CompletionTime.ToString("s")}") +``` + +**More:** [documentation](https://www.interfax.net/en/dev/rest/reference/2930) + +--- + +### Mark as read/unread + +`async Task MarkRead(int id)` +`async Task MarkUnread(int id)` + +Mark a transaction as read/unread. + +```csharp +// mark as read +var result = interfax.Inbound.MarkRead(123456); + +// => OK + +// mark as unread +var result = interfax.Inbound.MarkUnread(123456); + +// => OK +``` + +**More:** [documentation](https://www.interfax.net/en/dev/rest/reference/2936) + +### Resend inbound fax + +`async Task Resend(int id, string emailAddress = null)` + +Resend an inbound fax, optionally to a specific email address. + +```csharp +// resend to the email(s) to which the fax was previously forwarded +var result = await interfax.Inbound.Resend(123456); + +// => OK + +// resend to a specific address +var result = await interfax.Inbound.Resend(123456) "test@example.com") + +// => OK +``` + +**More:** [documentation](https://www.interfax.net/en/dev/rest/reference/2929) + +--- + +## Documents + +[Create document upload session](#create-document-upload-session) | [Upload chunk](#upload-chunk) | [Get upload session list](#get-upload-session-list) | [Status](#get-upload-session-status) | [Cancel](#cancel-document-upload-session) + +Document upload sessions allow for uploading of large files up to 20MB in chunks of arbitrary size. + +You can do this quite simply by calling : + +`UploadSession UploadDocument(string filePath)` + +```csharp +var session = _interfax.Outbound.Documents.UploadDocument(fileInfo.FullName); +``` + +The Uri property of the returned session object can be used when sending a fax. + +If you want to control the chunking yourself, the following example shows how you could upload a file in 500 byte chunks: + +```csharp +var fileInfo = new FileInfo("large.pdf"); + +var sessionId = CreateUploadSession(new UploadSessionOptions +{ + Name = fileInfo.Name, + Size = (int) fileInfo.Length +}).Result; + +using (var fileStream = File.OpenRead(filePath)) +{ + var buffer = new byte[500]; + int len; + while ((len = fileStream.Read(buffer, 0, buffer.Length)) > 0) + { + var data = new byte[len]; + Array.Copy(buffer, data, len); + var response = UploadDocumentChunk(sessionId, fileStream.Position - len, data).Result; + if (response.StatusCode == HttpStatusCode.Accepted) continue; + if (response.StatusCode == HttpStatusCode.OK) break; + } +} +``` + +### Create Document Upload Session + +`async Task CreateUploadSession(UploadSessionOptions options)` + +Create a document upload session, allowing you to upload large files in chunks. + +```csharp +var sessionId = _interfax.Outbound.Documents.CreateUploadSession(options) +``` + +**Options:** [`Disposition`, `Sharing`](https://www.interfax.net/en/dev/rest/reference/2967) + +--- + +### Upload chunk + +`async Task UploadDocumentChunk(string sessionId, long offset, byte[] data)` + +Upload a chunk to an existing document upload session. The offset refers to the offset in the unchunked file not the data parameter. + +```csharp +var response = UploadDocumentChunk(sessionId, offset, data).Result; + +// HttpStatusCode.OK (done) or HttpStatusCode.Accepted (unfinished) +``` + +**More:** [documentation](https://www.interfax.net/en/dev/rest/reference/2966) + +--- + +### Get Upload Session List + +`async Task> GetUploadSessions(ListOptions listOptions = null)` + +Get a list of previous document uploads which are currently available. + +```csharp +var list = _interfax.Outbound.Documents.GetUploadSessions(new Documents.ListOptions + { + Offset = 10, + Limit = 5 + }).Result; +``` + +**Options:** [`Limit`, `Offset`](https://www.interfax.net/en/dev/rest/reference/2968) + +--- + +### Get upload session status + +`async Task GetUploadSession(string sessionId)` + +Get the current status of a specific document upload session. + +```csharp +var session = interfax.Documents.GetUploadSession(123456); +``` + +**More:** [documentation](https://www.interfax.net/en/dev/rest/reference/2965) + +--- + +### Cancel document upload session + +`interfax.documents.cancel(document_id, callback);` + +Cancel a document upload and tear down the upload session, or delete a previous upload. + +```csharp +var result = await interfax.Outbound.Documents.CancelUploadSession(sessionId); + +// => OK +``` + +**More:** [documentation](https://www.interfax.net/en/dev/rest/reference/2964) + +--- ## Contributing -To contribute to the library, docs, or examples available here on Github, [create an issue](https://github.com/interfax/interfax-dotnet/issues) or a pull request. + + 1. **Fork** the repo on GitHub + 2. **Clone** the project to your own machine + 3. **Commit** changes to your own branch + 4. **Push** your work back up to your fork + 5. Submit a **Pull request** so that we can review your changes ## License -Copyright (c) 2016 Interfax Communications Ltd - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +This library is released under the [MIT License](LICENSE). \ No newline at end of file diff --git a/testfiles/large.pdf b/testfiles/large.pdf new file mode 100644 index 0000000..235c433 Binary files /dev/null and b/testfiles/large.pdf differ diff --git a/testfiles/test.html b/testfiles/test.html new file mode 100644 index 0000000..fee6abe --- /dev/null +++ b/testfiles/test.html @@ -0,0 +1,10 @@ + + + + + Test + + + Hello World + + diff --git a/testfiles/test.pdf b/testfiles/test.pdf new file mode 100644 index 0000000..f4e7411 Binary files /dev/null and b/testfiles/test.pdf differ diff --git a/testfiles/test.txt b/testfiles/test.txt new file mode 100644 index 0000000..557db03 --- /dev/null +++ b/testfiles/test.txt @@ -0,0 +1 @@ +Hello World