diff --git a/Digipost.Api.Client.Common.Tests/DataTransferObjectConverterTests.cs b/Digipost.Api.Client.Common.Tests/DataTransferObjectConverterTests.cs index 74c73caf..151e1230 100755 --- a/Digipost.Api.Client.Common.Tests/DataTransferObjectConverterTests.cs +++ b/Digipost.Api.Client.Common.Tests/DataTransferObjectConverterTests.cs @@ -13,8 +13,6 @@ namespace Digipost.Api.Client.Common.Tests { public class DataTransferObjectConverterTests { - private readonly Comparator _comparator = new Comparator(); - public class ToDataTransferObjectMethod : DataTransferObjectConverterTests { [Fact] @@ -44,9 +42,7 @@ public void ForeignAddress() var actualDto = DataTransferObjectConverter.ToDataTransferObject(source); //Assert - IEnumerable differences; - _comparator.Equal(expectedDto, actualDto, out differences); - Assert.Equal(0, differences.Count()); + Comparator.AssertEqual(expectedDto, actualDto); } [Fact] @@ -71,9 +67,7 @@ public void IdentificationByAddressReturnsDigipostResultWithDigipostAddressResul var actual = DataTransferObjectConverter.FromDataTransferObject(source); //Assert - IEnumerable differences; - _comparator.Equal(expected, actual, out differences); - Assert.Equal(0, differences.Count()); + Comparator.AssertEqual(expected, actual); } [Fact] @@ -98,9 +92,7 @@ public void IdentificationByAddressReturnsIdentifiedResultWithPersonalAliasResul var actual = DataTransferObjectConverter.FromDataTransferObject(source); //Assert - IEnumerable differences; - _comparator.Equal(expected, actual, out differences); - Assert.Equal(0, differences.Count()); + Comparator.AssertEqual(expected, actual); } [Fact] @@ -131,9 +123,7 @@ public void IdentificationByAddressReturnsUnidentifiedResultWithUnidentifiedReas var actual = DataTransferObjectConverter.FromDataTransferObject(source); //Assert - IEnumerable differences; - _comparator.Equal(expected, actual, out differences); - Assert.Equal(0, differences.Count()); + Comparator.AssertEqual(expected, actual); } [Fact] @@ -173,9 +163,7 @@ public void IdentificationByNameAndAddress() var actualDto = DataTransferObjectConverter.ToDataTransferObject(source); //Assert - IEnumerable differences; - _comparator.Equal(expectedDto, actualDto, out differences); - Assert.Equal(0, differences.Count()); + Comparator.AssertEqual(expectedDto, actualDto); } [Fact] @@ -213,9 +201,7 @@ public void IdentificationByNameAndAddressAcceptsNoBirthDate() var actualDto = DataTransferObjectConverter.ToDataTransferObject(source); //Assert - IEnumerable differences; - _comparator.Equal(expectedDto, actualDto, out differences); - Assert.Equal(0, differences.Count()); + Comparator.AssertEqual(expectedDto, actualDto); } [Fact] @@ -233,9 +219,7 @@ public void IdentificationByOrganizationNumber() var actualDto = DataTransferObjectConverter.ToDataTransferObject(source); //Assert - IEnumerable differences; - _comparator.Equal(expectedDto, actualDto, out differences); - Assert.Equal(0, differences.Count()); + Comparator.AssertEqual(expectedDto, actualDto); } [Fact] @@ -260,9 +244,7 @@ public void IdentificationByOrganizationNumberReturnsDigipostResultWithDigipostA var actual = DataTransferObjectConverter.FromDataTransferObject(source); //Assert - IEnumerable differences; - _comparator.Equal(expected, actual, out differences); - Assert.Equal(0, differences.Count()); + Comparator.AssertEqual(expected, actual); } [Fact] @@ -293,9 +275,7 @@ public void IdentificationByOrganizationNumberReturnsInvalidResultWithInvalidRea var actual = DataTransferObjectConverter.FromDataTransferObject(source); //Assert - IEnumerable differences; - _comparator.Equal(expected, actual, out differences); - Assert.Equal(0, differences.Count()); + Comparator.AssertEqual(expected, actual); } [Fact] @@ -320,9 +300,7 @@ public void IdentificationByOrganizationNumberReturnsUnidentifiedResultWithUnide var actual = DataTransferObjectConverter.FromDataTransferObject(source); //Assert - IEnumerable differences; - _comparator.Equal(expected, actual, out differences); - Assert.Equal(0, differences.Count()); + Comparator.AssertEqual(expected, actual); } [Fact] @@ -346,9 +324,7 @@ public void IdentificationByPinReturnsDigipostResultWithNoneResultType() var actual = DataTransferObjectConverter.FromDataTransferObject(source); //Assert - IEnumerable differences; - _comparator.Equal(expected, actual, out differences); - Assert.Equal(0, differences.Count()); + Comparator.AssertEqual(expected, actual); } [Fact] @@ -373,9 +349,7 @@ public void IdentificationByPinReturnsIdentifiedResultWithNoneResultType() var actual = DataTransferObjectConverter.FromDataTransferObject(source); //Assert - IEnumerable differences; - _comparator.Equal(expected, actual, out differences); - Assert.Equal(0, differences.Count()); + Comparator.AssertEqual(expected, actual); } [Fact] @@ -400,9 +374,7 @@ public void IdentificationByPinReturnsInvalidResultWithInvalidReason() var actual = DataTransferObjectConverter.FromDataTransferObject(source); //Assert - IEnumerable differences; - _comparator.Equal(expected, actual, out differences); - Assert.Equal(0, differences.Count()); + Comparator.AssertEqual(expected, actual); } [Fact] @@ -430,9 +402,7 @@ public void NorwegianAddress() var actualDto = DataTransferObjectConverter.ToDataTransferObject(source); //Assert - IEnumerable differences; - _comparator.Equal(expectedDto, actualDto, out differences); - Assert.Equal(0, differences.Count()); + Comparator.AssertEqual(expectedDto, actualDto); } [Fact] @@ -486,10 +456,7 @@ public void PrintDetails() var actualDto = DataTransferObjectConverter.ToDataTransferObject(source); //Assert - IEnumerable differences; - _comparator.Equal(expectedDto, actualDto, out differences); - - Assert.Equal(0, differences.Count()); + Comparator.AssertEqual(expectedDto, actualDto); Assert.Null(DataTransferObjectConverter.ToDataTransferObject((IPrintDetails) null)); } @@ -527,10 +494,7 @@ public void PrintRecipientFromForeignAddress() var actualDto = DataTransferObjectConverter.ToDataTransferObject(source); //Assert - //Assert - IEnumerable differences; - _comparator.Equal(expectedDto, actualDto, out differences); - Assert.Equal(0, differences.Count()); + Comparator.AssertEqual(expectedDto, actualDto); } [Fact] @@ -558,10 +522,7 @@ public void PrintRecipientFromNorwegianAddress() var actualDto = DataTransferObjectConverter.ToDataTransferObject(source); //Assert - //Assert - IEnumerable differences; - _comparator.Equal(expectedDto, actualDto, out differences); - Assert.Equal(0, differences.Count()); + Comparator.AssertEqual(expectedDto, actualDto); } [Fact] @@ -597,10 +558,7 @@ public void PrintReturnRecipientFromForeignAddress() var actualDto = DataTransferObjectConverter.ToDataTransferObject(source); //Assert - //Assert - IEnumerable differences; - _comparator.Equal(expectedDto, actualDto, out differences); - Assert.Equal(0, differences.Count()); + Comparator.AssertEqual(expectedDto, actualDto); } [Fact] @@ -628,9 +586,7 @@ public void PrintReturnRecipientFromNorwegianAddress() var actualDto = DataTransferObjectConverter.ToDataTransferObject(source); //Assert - IEnumerable differences; - _comparator.Equal(expectedDto, actualDto, out differences); - Assert.Equal(0, differences.Count()); + Comparator.AssertEqual(expectedDto, actualDto); } [Fact] @@ -653,9 +609,7 @@ public void RecipientById() var actualDto = DataTransferObjectConverter.ToDataTransferObject(source); //Assert - IEnumerable differences; - _comparator.Equal(expectedDto, actualDto, out differences); - Assert.Equal(0, differences.Count()); + Comparator.AssertEqual(expectedDto, actualDto); } [Fact] @@ -693,9 +647,7 @@ public void RecipientByNameAndAddress() var actualDto = DataTransferObjectConverter.ToDataTransferObject(source); //Assert - IEnumerable differences; - _comparator.Equal(expectedDto, actualDto, out differences); - Assert.Equal(0, differences.Count()); + Comparator.AssertEqual(expectedDto, actualDto); } [Fact] @@ -821,10 +773,7 @@ public void SearchResult() var actual = DataTransferObjectConverter.FromDataTransferObject(source); //Assert - IEnumerable differences; - var comparator = new Comparator {ComparisonConfiguration = new ComparisonConfiguration {IgnoreObjectTypes = true}}; - comparator.Equal(expected, actual, out differences); - Assert.Equal(0, differences.Count()); + Comparator.AssertEqual(expected, actual); } [Fact] @@ -848,9 +797,7 @@ public void SmsNotification() var actual = DataTransferObjectConverter.ToDataTransferObject(source); //Assert - IEnumerable differences; - _comparator.Equal(expectedDto, actual, out differences); - Assert.Equal(0, differences.Count()); + Comparator.AssertEqual(expectedDto, actual); } } @@ -878,9 +825,7 @@ public void Error() var actual = DataTransferObjectConverter.FromDataTransferObject(source); //Assert - IEnumerable differences; - _comparator.Equal(expected, actual, out differences); - Assert.Equal(0, differences.Count()); + Comparator.AssertEqual(expected, actual); } } } diff --git a/Digipost.Api.Client.Common.Tests/Print/PrintDetailsTests.cs b/Digipost.Api.Client.Common.Tests/Print/PrintDetailsTests.cs index b6082bf4..fdefc052 100755 --- a/Digipost.Api.Client.Common.Tests/Print/PrintDetailsTests.cs +++ b/Digipost.Api.Client.Common.Tests/Print/PrintDetailsTests.cs @@ -1,6 +1,4 @@ -using System.Collections.Generic; -using System.Linq; -using Digipost.Api.Client.Common.Enums; +using Digipost.Api.Client.Common.Enums; using Digipost.Api.Client.Common.Print; using Digipost.Api.Client.Tests; using Digipost.Api.Client.Tests.CompareObjects; @@ -12,8 +10,6 @@ public class PrintDetailsTests { public class ConstructorMethod : PrintDetailsTests { - private readonly Comparator _comparator = new Comparator(); - [Fact] public void SimpleConstructor() { @@ -24,13 +20,9 @@ public void SimpleConstructor() //Act //Assert - IEnumerable printDifference; - _comparator.Equal(DomainUtility.GetPrintRecipientWithNorwegianAddress(), printDetails.PrintRecipient, out printDifference); - Assert.Equal(0, printDifference.Count()); + Comparator.AssertEqual(DomainUtility.GetPrintRecipientWithNorwegianAddress(), printDetails.PrintRecipient); - IEnumerable printReturnDifference; - _comparator.Equal(DomainUtility.GetPrintReturnRecipientWithNorwegianAddress(), printDetails.PrintReturnRecipient, out printReturnDifference); - Assert.Equal(0, printReturnDifference.Count()); + Comparator.AssertEqual(DomainUtility.GetPrintReturnRecipientWithNorwegianAddress(), printDetails.PrintReturnRecipient); Assert.Equal(PostType.A, printDetails.PostType); Assert.Equal(PrintColors.Colors, printDetails.PrintColors); diff --git a/Digipost.Api.Client.Common.Tests/Print/PrintRecipientTests.cs b/Digipost.Api.Client.Common.Tests/Print/PrintRecipientTests.cs index 247ed783..b7ade46c 100755 --- a/Digipost.Api.Client.Common.Tests/Print/PrintRecipientTests.cs +++ b/Digipost.Api.Client.Common.Tests/Print/PrintRecipientTests.cs @@ -1,6 +1,4 @@ -using System.Collections.Generic; -using System.Linq; -using Digipost.Api.Client.Common.Print; +using Digipost.Api.Client.Common.Print; using Digipost.Api.Client.Tests; using Digipost.Api.Client.Tests.CompareObjects; using Xunit; @@ -12,8 +10,6 @@ public class PrintRecipientTests public class ConstructorMethod : PrintRecipientTests { - private readonly Comparator _comparator = new Comparator(); - [Fact] public void SimpleConstructor() { @@ -27,10 +23,7 @@ public void SimpleConstructor() //Assert Assert.Equal(name, printRecipient.Name); - IEnumerable differences; - _comparator.Equal(DomainUtility.GetNorwegianAddress(), printRecipient.Address, out differences); - - Assert.Equal(0, differences.Count()); + Comparator.AssertEqual(DomainUtility.GetNorwegianAddress(), printRecipient.Address); } } } diff --git a/Digipost.Api.Client.Common.Tests/Print/PrintReturnRecipientTests.cs b/Digipost.Api.Client.Common.Tests/Print/PrintReturnRecipientTests.cs index 67d9fa6a..c6ebd476 100755 --- a/Digipost.Api.Client.Common.Tests/Print/PrintReturnRecipientTests.cs +++ b/Digipost.Api.Client.Common.Tests/Print/PrintReturnRecipientTests.cs @@ -1,6 +1,4 @@ -using System.Collections.Generic; -using System.Linq; -using Digipost.Api.Client.Common.Print; +using Digipost.Api.Client.Common.Print; using Digipost.Api.Client.Tests; using Digipost.Api.Client.Tests.CompareObjects; using Xunit; @@ -11,8 +9,6 @@ public class PrintReturnRecipientTests { public class ConstructorMethod : PrintReturnRecipientTests { - private readonly Comparator _comparator = new Comparator(); - [Fact] public void SimpleConstructor() { @@ -25,10 +21,7 @@ public void SimpleConstructor() //Assert Assert.Equal(name, printRecipient.Name); - IEnumerable differences; - _comparator.Equal(DomainUtility.GetNorwegianAddress(), printRecipient.Address, out differences); - - Assert.Equal(0, differences.Count()); + Comparator.AssertEqual(DomainUtility.GetNorwegianAddress(), printRecipient.Address); } } } diff --git a/Digipost.Api.Client.Common/ApiClientXmlValidator.cs b/Digipost.Api.Client.Common/ApiClientXmlValidator.cs index c2b0da62..167a740c 100755 --- a/Digipost.Api.Client.Common/ApiClientXmlValidator.cs +++ b/Digipost.Api.Client.Common/ApiClientXmlValidator.cs @@ -8,6 +8,7 @@ internal class ApiClientXmlValidator : XmlValidator public ApiClientXmlValidator() { AddXsd(Namespace.DigipostApiV7, XsdResource.GetApiV7Xsd()); + AddXsd(Namespace.DataTypes, XsdResource.GetDataTypesXsd()); } } } diff --git a/Digipost.Api.Client.Common/Exceptions/XmlParseException.cs b/Digipost.Api.Client.Common/Exceptions/XmlParseException.cs index e8e5e70d..d5c74514 100755 --- a/Digipost.Api.Client.Common/Exceptions/XmlParseException.cs +++ b/Digipost.Api.Client.Common/Exceptions/XmlParseException.cs @@ -18,6 +18,6 @@ public XmlParseException(string message, Exception inner, string xmlRawData) XmlRawData = xmlRawData; } - public string XmlRawData { get; private set; } + public string XmlRawData { get; } } } diff --git a/Digipost.Api.Client.Common/Namespace.cs b/Digipost.Api.Client.Common/Namespace.cs index f7e1c242..cd826ad4 100755 --- a/Digipost.Api.Client.Common/Namespace.cs +++ b/Digipost.Api.Client.Common/Namespace.cs @@ -2,9 +2,8 @@ { internal class Namespace { - /// - /// http://api.digipost.no/schema/v7 - /// public const string DigipostApiV7 = "http://api.digipost.no/schema/v7"; + + public const string DataTypes = "http://api.digipost.no/schema/datatypes"; } } diff --git a/Digipost.Api.Client.Common/Properties/AssemblyInfo.cs b/Digipost.Api.Client.Common/Properties/AssemblyInfo.cs index 22f4b96d..dec04030 100755 --- a/Digipost.Api.Client.Common/Properties/AssemblyInfo.cs +++ b/Digipost.Api.Client.Common/Properties/AssemblyInfo.cs @@ -9,3 +9,4 @@ [assembly: InternalsVisibleTo("Digipost.Api.Client.Send,PublicKey=0024000004800000940000000602000000240000525341310004000001000100316e4dede15e9c7abbb2af935ae2a983f3df3d04edf806ac01cba681ca15781bd969d78556a6f1edb79db27e4be9b205335fa73d0d6b8df239d5867540c55171fbf63aa667dc46e871e1399da71e38af47b46eca3d3830629979975ccd92eb1cb59fa6d21f95245106a3ee8853d43c2e9096f114fb7bc377661c60264dc064ad")] [assembly: InternalsVisibleTo("Digipost.Api.Client.Send.Tests,PublicKey=0024000004800000940000000602000000240000525341310004000001000100316e4dede15e9c7abbb2af935ae2a983f3df3d04edf806ac01cba681ca15781bd969d78556a6f1edb79db27e4be9b205335fa73d0d6b8df239d5867540c55171fbf63aa667dc46e871e1399da71e38af47b46eca3d3830629979975ccd92eb1cb59fa6d21f95245106a3ee8853d43c2e9096f114fb7bc377661c60264dc064ad")] [assembly: InternalsVisibleTo("Digipost.Api.Client.Common.Tests,PublicKey=0024000004800000940000000602000000240000525341310004000001000100316e4dede15e9c7abbb2af935ae2a983f3df3d04edf806ac01cba681ca15781bd969d78556a6f1edb79db27e4be9b205335fa73d0d6b8df239d5867540c55171fbf63aa667dc46e871e1399da71e38af47b46eca3d3830629979975ccd92eb1cb59fa6d21f95245106a3ee8853d43c2e9096f114fb7bc377661c60264dc064ad")] +[assembly: InternalsVisibleTo("Digipost.Api.Client.DataTypes,PublicKey=0024000004800000940000000602000000240000525341310004000001000100316e4dede15e9c7abbb2af935ae2a983f3df3d04edf806ac01cba681ca15781bd969d78556a6f1edb79db27e4be9b205335fa73d0d6b8df239d5867540c55171fbf63aa667dc46e871e1399da71e38af47b46eca3d3830629979975ccd92eb1cb59fa6d21f95245106a3ee8853d43c2e9096f114fb7bc377661c60264dc064ad")] diff --git a/Digipost.Api.Client.ConcurrencyTest/Digipost.Api.Client.ConcurrencyTest.csproj b/Digipost.Api.Client.ConcurrencyTest/Digipost.Api.Client.ConcurrencyTest.csproj index 291c8ac6..75075c5e 100755 --- a/Digipost.Api.Client.ConcurrencyTest/Digipost.Api.Client.ConcurrencyTest.csproj +++ b/Digipost.Api.Client.ConcurrencyTest/Digipost.Api.Client.ConcurrencyTest.csproj @@ -79,6 +79,10 @@ {baa33e63-9cdf-4b8a-ba06-b107995585d0} Digipost.Api.Client.Common + + {04ea2e77-b6b0-48aa-888c-eb21876f6767} + Digipost.Api.Client.DataTypes + {5548c4bb-7811-4a22-a8f6-751f3ab8ce0d} Digipost.Api.Client.Resources diff --git a/Digipost.Api.Client.DataTypes.Tests/Appointment/AppointmentAddressTests.cs b/Digipost.Api.Client.DataTypes.Tests/Appointment/AppointmentAddressTests.cs new file mode 100755 index 00000000..8b2c285f --- /dev/null +++ b/Digipost.Api.Client.DataTypes.Tests/Appointment/AppointmentAddressTests.cs @@ -0,0 +1,39 @@ +using Digipost.Api.Client.Tests.CompareObjects; +using Xunit; + +namespace Digipost.Api.Client.DataTypes.Tests.Appointment +{ + public class AppointmentAddressTests + { + [Fact] + public void AsDataTransferObject() + { + var source = new AppointmentAddress("Gateveien 1", "0001", "Oslo"); + var expected = source.AsDataTransferObject(); + + var actual = new appointmentAddress + { + streetaddress = "Gateveien 1", + postalcode = "0001", + city = "Oslo" + }; + + Comparator.AssertEqual(expected, actual); + } + + [Fact] + public void AsDataTransferObjectWithoutStreetAddress() + { + var expected = new AppointmentAddress("0001", "Oslo"); + + var actual = new appointmentAddress + { + streetaddress = null, + postalcode = "0001", + city = "Oslo" + }; + + Comparator.AssertEqual(expected, actual); + } + } +} diff --git a/Digipost.Api.Client.DataTypes.Tests/Appointment/AppointmentTests.cs b/Digipost.Api.Client.DataTypes.Tests/Appointment/AppointmentTests.cs new file mode 100755 index 00000000..28f37e9f --- /dev/null +++ b/Digipost.Api.Client.DataTypes.Tests/Appointment/AppointmentTests.cs @@ -0,0 +1,64 @@ +using System; +using System.Collections.Generic; +using Digipost.Api.Client.Tests.CompareObjects; +using Xunit; + +namespace Digipost.Api.Client.DataTypes.Tests.Appointment +{ + public class AppointmentTests + { + [Fact] + public void AllowsOnlyRequiredParameters() + { + var now = DateTime.Now; + + var source = new DataTypes.Appointment.Appointment(now); + var expected = source.AsDataTransferObject(); + + var actual = new appointment + { + starttime = now.ToString("O") + }; + + Comparator.AssertEqual(expected, actual); + } + + [Fact] + public void AsDataTransferObject() + { + var now = DateTime.Now; + var address = new AppointmentAddress("Gateveien 1", "0001", "Oslo"); + var info = new Info("Title", "Very important information"); + + var source = new DataTypes.Appointment.Appointment(now) + { + EndTime = now.AddHours(1), + AppointmentAddress = address, + ArrivalTime = "15 minutes before", + Info = new List + { + info + }, + Place = "Oslo City Røntgen", + SubTitle = "SubTitle" + }; + var expected = source.AsDataTransferObject(); + + var actual = new appointment + { + starttime = now.ToString("O"), + endtime = now.AddHours(1).ToString("O"), + arrivaltime = "15 minutes before", + address = address.AsDataTransferObject(), + info = new[] + { + info.AsDataTransferObject() + }, + place = "Oslo City Røntgen", + subtitle = "SubTitle" + }; + + Comparator.AssertEqual(expected, actual); + } + } +} diff --git a/Digipost.Api.Client.DataTypes.Tests/Appointment/InfoTests.cs b/Digipost.Api.Client.DataTypes.Tests/Appointment/InfoTests.cs new file mode 100755 index 00000000..095aa59d --- /dev/null +++ b/Digipost.Api.Client.DataTypes.Tests/Appointment/InfoTests.cs @@ -0,0 +1,23 @@ +using Digipost.Api.Client.Tests.CompareObjects; +using Xunit; + +namespace Digipost.Api.Client.DataTypes.Tests.Appointment +{ + public class InfoTests + { + [Fact] + public void AsDataTransferObject() + { + var source = new Info("Title", "Text"); + var expected = source.AsDataTransferObject(); + + var actual = new info + { + title = "Title", + text = "Text" + }; + + Comparator.AssertEqual(expected, actual); + } + } +} diff --git a/Digipost.Api.Client.DataTypes.Tests/Digipost.Api.Client.DataTypes.Tests.csproj b/Digipost.Api.Client.DataTypes.Tests/Digipost.Api.Client.DataTypes.Tests.csproj new file mode 100755 index 00000000..2c144879 --- /dev/null +++ b/Digipost.Api.Client.DataTypes.Tests/Digipost.Api.Client.DataTypes.Tests.csproj @@ -0,0 +1,97 @@ + + + + + Debug + AnyCPU + {FF6174C7-8429-4889-8E8E-98A908916B14} + Library + Properties + Digipost.Api.Client.DataTypes.Tests + Digipost.Api.Client.DataTypes.Tests + v4.5 + 512 + + + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + true + + + C:\Keys\signingkey.snk + + + + + + + + + + + + ..\packages\xunit.abstractions.2.0.0\lib\net35\xunit.abstractions.dll + + + ..\packages\xunit.assert.2.1.0\lib\dotnet\xunit.assert.dll + + + ..\packages\xunit.extensibility.core.2.1.0\lib\dotnet\xunit.core.dll + + + ..\packages\xunit.extensibility.execution.2.1.0\lib\net45\xunit.execution.desktop.dll + + + + + Properties\SharedAssemblyInfo.cs + + + + + + + + + + Properties\signingkey.snk + + + + + + + + + {04EA2E77-B6B0-48AA-888C-EB21876F6767} + Digipost.Api.Client.DataTypes + + + {9E8E7C47-894D-441C-956A-2F6EAC2215E0} + Digipost.Api.Client.Xsd + + + {FDF4509B-F574-4EEF-A7C7-80B79AFB31AD} + Digipost.Api.Client.Tests + + + + \ No newline at end of file diff --git a/Digipost.Api.Client.DataTypes.Tests/ExternalLinkTests.cs b/Digipost.Api.Client.DataTypes.Tests/ExternalLinkTests.cs new file mode 100755 index 00000000..16f972d0 --- /dev/null +++ b/Digipost.Api.Client.DataTypes.Tests/ExternalLinkTests.cs @@ -0,0 +1,33 @@ +using System; +using Digipost.Api.Client.Tests.CompareObjects; +using Xunit; + +namespace Digipost.Api.Client.DataTypes.Tests +{ + public class ExternalLinkTests + { + [Fact] + public void AsDataTransferObject() + { + var now = DateTime.Now; + var source = new ExternalLink(new Uri("https://digipost.no")) + { + ButtonText = "Click me", + Deadline = now, + Description = "Description" + }; + var expected = source.AsDataTransferObject(); + + var actual = new externalLink + { + buttontext = "Click me", + deadline = now, + deadlineSpecified = true, + description = "Description", + url = "https://digipost.no/" + }; + + Comparator.AssertEqual(expected, actual); + } + } +} diff --git a/Digipost.Api.Client.DataTypes.Tests/Properties/AssemblyInfo.cs b/Digipost.Api.Client.DataTypes.Tests/Properties/AssemblyInfo.cs new file mode 100755 index 00000000..b5c4045e --- /dev/null +++ b/Digipost.Api.Client.DataTypes.Tests/Properties/AssemblyInfo.cs @@ -0,0 +1,3 @@ +using System.Reflection; + +[assembly: AssemblyTitle("Digipost.Api.Client.DataTypes.Tests")] diff --git a/Digipost.Api.Client.DataTypes.Tests/packages.config b/Digipost.Api.Client.DataTypes.Tests/packages.config new file mode 100755 index 00000000..a2ff4866 --- /dev/null +++ b/Digipost.Api.Client.DataTypes.Tests/packages.config @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/Digipost.Api.Client.DataTypes/Appointment/Appointment.cs b/Digipost.Api.Client.DataTypes/Appointment/Appointment.cs new file mode 100755 index 00000000..ad14cd86 --- /dev/null +++ b/Digipost.Api.Client.DataTypes/Appointment/Appointment.cs @@ -0,0 +1,78 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Xml; + +namespace Digipost.Api.Client.DataTypes.Appointment +{ + public class Appointment : IDataType + { + public Appointment(DateTime startTime) + { + StartTime = startTime; + } + + public DateTime StartTime { get; set; } + + /// + /// Default value 30 minutes after . + /// + public DateTime? EndTime { get; set; } + + /// + /// Free text but can contain ISO8601 formatted date and time. Example: Please arrive 15 minutes early. + /// 150 characters or less. + /// + public string ArrivalTime { get; set; } + + /// + /// The name of the place. Example: Oslo City Røntgen. + /// 150 characters or less. + /// + public string Place { get; set; } + + public AppointmentAddress AppointmentAddress { get; set; } + + /// + /// Example: MR-undersøkelse av høyre kne. + /// 150 characters or less. + /// + public string SubTitle { get; set; } + + /// + /// Additional sections of information (max 2) with a title and text. + /// + public List Info { get; set; } + + public XmlElement Serialize() + { + return DataTypeSerialization.Serialize(AsDataTransferObject()); + } + + internal appointment AsDataTransferObject() + { + var dto = new appointment + { + starttime = StartTime.ToString("O"), + arrivaltime = ArrivalTime, + subtitle = SubTitle, + place = Place, + endtime = EndTime?.ToString("O"), + address = AppointmentAddress?.AsDataTransferObject(), + info = Info?.Select(i => i.AsDataTransferObject()).ToArray() + }; + return dto; + } + + public override string ToString() + { + return $"Appointment starting at {StartTime}. " + + $"End time: '{(EndTime.HasValue ? EndTime.ToString() : "")}', " + + $"arrival time: '{ArrivalTime ?? ""}', " + + $"{AppointmentAddress?.ToString() ?? "address: "}, " + + $"place: '{Place ?? ""}', " + + $"sub title: '{SubTitle ?? ""}', " + + $"{(Info != null ? string.Join(", ", Info.Select(x => x.ToString())) : "no additional info")}."; + } + } +} diff --git a/Digipost.Api.Client.DataTypes/Appointment/AppointmentAddress.cs b/Digipost.Api.Client.DataTypes/Appointment/AppointmentAddress.cs new file mode 100755 index 00000000..d792bba2 --- /dev/null +++ b/Digipost.Api.Client.DataTypes/Appointment/AppointmentAddress.cs @@ -0,0 +1,47 @@ +namespace Digipost.Api.Client.DataTypes +{ + public class AppointmentAddress + { + public AppointmentAddress(string postalCode, string city) + : this(null, postalCode, city) + { + } + + public AppointmentAddress(string streetAddress, string postalCode, string city) + { + StreetAddress = streetAddress; + PostalCode = postalCode; + City = city; + } + + /// + /// Optional street address. 100 characters or less. + /// + public string StreetAddress { get; set; } + + /// + /// 10 characters or less. + /// + public string PostalCode { get; set; } + + /// + /// 100 characters or less. + /// + public string City { get; set; } + + internal appointmentAddress AsDataTransferObject() + { + return new appointmentAddress + { + streetaddress = StreetAddress, + postalcode = PostalCode, + city = City + }; + } + + public override string ToString() + { + return $"Address: '{(StreetAddress != null ? $"{StreetAddress}, " : "")}{PostalCode} {City}'"; + } + } +} diff --git a/Digipost.Api.Client.DataTypes/Appointment/Info.cs b/Digipost.Api.Client.DataTypes/Appointment/Info.cs new file mode 100755 index 00000000..c7556e29 --- /dev/null +++ b/Digipost.Api.Client.DataTypes/Appointment/Info.cs @@ -0,0 +1,32 @@ +namespace Digipost.Api.Client.DataTypes +{ + public class Info + { + public Info(string title, string text) + { + Title = title; + Text = text; + } + + /// + /// 150 characters or less. + /// + public string Title { get; set; } + + public string Text { get; set; } + + internal info AsDataTransferObject() + { + return new info + { + title = Title, + text = Text + }; + } + + public override string ToString() + { + return $"Info: '{Title}' - '{Text}'"; + } + } +} diff --git a/Digipost.Api.Client.DataTypes/DataType.cs b/Digipost.Api.Client.DataTypes/DataType.cs new file mode 100755 index 00000000..652ea09d --- /dev/null +++ b/Digipost.Api.Client.DataTypes/DataType.cs @@ -0,0 +1,9 @@ +using System.Xml; + +namespace Digipost.Api.Client.DataTypes +{ + public interface IDataType + { + XmlElement Serialize(); + } +} diff --git a/Digipost.Api.Client.DataTypes/DataTypeSerialization.cs b/Digipost.Api.Client.DataTypes/DataTypeSerialization.cs new file mode 100755 index 00000000..74fecb5b --- /dev/null +++ b/Digipost.Api.Client.DataTypes/DataTypeSerialization.cs @@ -0,0 +1,16 @@ +using System.Xml; +using Digipost.Api.Client.Common.Utilities; + +namespace Digipost.Api.Client.DataTypes +{ + internal class DataTypeSerialization + { + internal static XmlElement Serialize(T data) + { + var document = new XmlDocument(); + var serialized = SerializeUtil.Serialize(data); + document.LoadXml(serialized); + return document.DocumentElement; + } + } +} diff --git a/Digipost.Api.Client.DataTypes/Digipost.Api.Client.DataTypes.csproj b/Digipost.Api.Client.DataTypes/Digipost.Api.Client.DataTypes.csproj new file mode 100755 index 00000000..61c305db --- /dev/null +++ b/Digipost.Api.Client.DataTypes/Digipost.Api.Client.DataTypes.csproj @@ -0,0 +1,77 @@ + + + + + Debug + AnyCPU + {04EA2E77-B6B0-48AA-888C-EB21876F6767} + Library + Properties + Digipost.Api.Client.DataTypes + Digipost.Api.Client.DataTypes + v4.5 + 512 + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + true + + + C:\Keys\signingkey.snk + + + + + + + + + + + + + + Properties\signingkey.snk + + + + + Properties\SharedAssemblyInfo.cs + + + + + + + + + + + + {BAA33E63-9CDF-4B8A-BA06-B107995585D0} + Digipost.Api.Client.Common + + + {9E8E7C47-894D-441C-956A-2F6EAC2215E0} + Digipost.Api.Client.Xsd + + + + \ No newline at end of file diff --git a/Digipost.Api.Client.DataTypes/ExternalLink.cs b/Digipost.Api.Client.DataTypes/ExternalLink.cs new file mode 100755 index 00000000..a1d3d7d8 --- /dev/null +++ b/Digipost.Api.Client.DataTypes/ExternalLink.cs @@ -0,0 +1,61 @@ +using System; +using System.Xml; + +namespace Digipost.Api.Client.DataTypes +{ + public class ExternalLink : IDataType + { + public ExternalLink(Uri url) + { + Url = url; + } + + /// + /// Target URL of this link. Must be http or https. + /// + public Uri Url { get; set; } + + /// + /// Optional deadline for the user to respond. ISO8601 full DateTime. + /// + public DateTime? Deadline { get; set; } + + /// + /// A short, optional text-field, describing the external link. + /// 70 characters or less. + /// + public string Description { get; set; } + + /// + /// Optional text which will be displayed on the button. + /// 30 characters or less. + /// + public string ButtonText { get; set; } + + public XmlElement Serialize() + { + return DataTypeSerialization.Serialize(AsDataTransferObject()); + } + + internal externalLink AsDataTransferObject() + { + var dto = new externalLink + { + buttontext = ButtonText, + description = Description, + url = Url.AbsoluteUri + }; + if (Deadline.HasValue) + { + dto.deadline = Deadline.Value; + dto.deadlineSpecified = true; + } + return dto; + } + + public override string ToString() + { + return $"External link to '{Url}'. Description: '{Description ?? ""}', ButtonText: '{ButtonText ?? ""}', DeadLine: '{(Deadline.HasValue ? Deadline.ToString() : "")}'"; + } + } +} diff --git a/Digipost.Api.Client.DataTypes/Properties/AssemblyInfo.cs b/Digipost.Api.Client.DataTypes/Properties/AssemblyInfo.cs new file mode 100755 index 00000000..5ee45bf1 --- /dev/null +++ b/Digipost.Api.Client.DataTypes/Properties/AssemblyInfo.cs @@ -0,0 +1,9 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +[assembly: AssemblyTitle("Digipost.Api.Client.DataTypes")] +[assembly: ComVisible(false)] +[assembly: InternalsVisibleTo("Digipost.Api.Client.Send,PublicKey=0024000004800000940000000602000000240000525341310004000001000100316e4dede15e9c7abbb2af935ae2a983f3df3d04edf806ac01cba681ca15781bd969d78556a6f1edb79db27e4be9b205335fa73d0d6b8df239d5867540c55171fbf63aa667dc46e871e1399da71e38af47b46eca3d3830629979975ccd92eb1cb59fa6d21f95245106a3ee8853d43c2e9096f114fb7bc377661c60264dc064ad")] +[assembly: InternalsVisibleTo("Digipost.Api.Client.Send.Tests,PublicKey=0024000004800000940000000602000000240000525341310004000001000100316e4dede15e9c7abbb2af935ae2a983f3df3d04edf806ac01cba681ca15781bd969d78556a6f1edb79db27e4be9b205335fa73d0d6b8df239d5867540c55171fbf63aa667dc46e871e1399da71e38af47b46eca3d3830629979975ccd92eb1cb59fa6d21f95245106a3ee8853d43c2e9096f114fb7bc377661c60264dc064ad")] +[assembly: InternalsVisibleTo("Digipost.Api.Client.DataTypes.Tests,PublicKey=0024000004800000940000000602000000240000525341310004000001000100316e4dede15e9c7abbb2af935ae2a983f3df3d04edf806ac01cba681ca15781bd969d78556a6f1edb79db27e4be9b205335fa73d0d6b8df239d5867540c55171fbf63aa667dc46e871e1399da71e38af47b46eca3d3830629979975ccd92eb1cb59fa6d21f95245106a3ee8853d43c2e9096f114fb7bc377661c60264dc064ad")] diff --git a/Digipost.Api.Client.Docs/Digipost.Api.Client.Docs.csproj b/Digipost.Api.Client.Docs/Digipost.Api.Client.Docs.csproj index c9d5a6bb..1d4a433e 100755 --- a/Digipost.Api.Client.Docs/Digipost.Api.Client.Docs.csproj +++ b/Digipost.Api.Client.Docs/Digipost.Api.Client.Docs.csproj @@ -60,6 +60,10 @@ {BAA33E63-9CDF-4B8A-BA06-B107995585D0} Digipost.Api.Client.Common + + {04ea2e77-b6b0-48aa-888c-eb21876f6767} + Digipost.Api.Client.DataTypes + {11E46C69-8CD6-412D-9D25-1562770660A9} Digipost.Api.Client.Inbox diff --git a/Digipost.Api.Client.Inbox.Tests/DataTransferObjectConverterTests.cs b/Digipost.Api.Client.Inbox.Tests/DataTransferObjectConverterTests.cs index d263605f..a8feaa55 100755 --- a/Digipost.Api.Client.Inbox.Tests/DataTransferObjectConverterTests.cs +++ b/Digipost.Api.Client.Inbox.Tests/DataTransferObjectConverterTests.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using System.Linq; using Digipost.Api.Client.Common.Enums; using Digipost.Api.Client.Tests.CompareObjects; using Xunit; @@ -50,10 +49,7 @@ public void InboxDocument() var actual = InboxDataTransferObjectConverter.FromDataTransferObject(source); - IEnumerable differences; - var comparator = new Comparator {ComparisonConfiguration = new ComparisonConfiguration {IgnoreObjectTypes = true}}; - comparator.Equal(expected, actual, out differences); - Assert.Equal(0, differences.Count()); + Comparator.AssertEqual(expected, actual); } [Fact] @@ -64,10 +60,7 @@ public void InboxWithEmptyListOnNullResult() var actual = InboxDataTransferObjectConverter.FromDataTransferObject(source); - IEnumerable differences; - var comparator = new Comparator {ComparisonConfiguration = new ComparisonConfiguration {IgnoreObjectTypes = true}}; - comparator.Equal(expected, actual, out differences); - Assert.Equal(0, differences.Count()); + Comparator.AssertEqual(expected, actual); } } } diff --git a/Digipost.Api.Client.Resources/Digipost.Api.Client.Resources.csproj b/Digipost.Api.Client.Resources/Digipost.Api.Client.Resources.csproj index a66c37af..121a8eaa 100755 --- a/Digipost.Api.Client.Resources/Digipost.Api.Client.Resources.csproj +++ b/Digipost.Api.Client.Resources/Digipost.Api.Client.Resources.csproj @@ -1,114 +1,117 @@ - - - - - Debug - AnyCPU - {5548C4BB-7811-4A22-A8F6-751F3AB8CE0D} - Library - Properties - Digipost.Api.Client.Resources - Digipost.Api.Client.Resources - v4.5 - 512 - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - 1591 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - true - - - C:\Keys\signingkey.snk - - - - ..\packages\api-client-shared.2.0.0\lib\net45\ApiClientShared.dll - True - - - - - - - - - - - - - Properties\SharedAssemblyInfo.cs - - - - - - - - - - - - - - Designer - - - - - - - - - - - - - - - - - - - - - - - - - - signingkey.snk - - - - - - - - - - + + + + + Debug + AnyCPU + {5548C4BB-7811-4A22-A8F6-751F3AB8CE0D} + Library + Properties + Digipost.Api.Client.Resources + Digipost.Api.Client.Resources + v4.5 + 512 + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + 1591 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + true + + + C:\Keys\signingkey.snk + + + + ..\packages\api-client-shared.2.0.0\lib\net45\ApiClientShared.dll + True + + + + + + + + + + + + + Properties\SharedAssemblyInfo.cs + + + + + + + + + + + + + + Designer + + + + + + + + + + + + + + + + + + + + + + + + + + signingkey.snk + + + + Designer + + + + + + + + + + --> \ No newline at end of file diff --git a/Digipost.Api.Client.Resources/Xsd/Data/api_v7.xsd b/Digipost.Api.Client.Resources/Xsd/Data/api_v7.xsd old mode 100755 new mode 100644 index 1bed1f6f..e04b4937 --- a/Digipost.Api.Client.Resources/Xsd/Data/api_v7.xsd +++ b/Digipost.Api.Client.Resources/Xsd/Data/api_v7.xsd @@ -499,23 +499,23 @@ - - - - A or B for respectively A-Priority and B-Economy - - - - - - - + + + + A or B for respectively A-Priority and B-Economy + + + + + + + - - + + - + @@ -607,6 +607,7 @@ + @@ -922,7 +923,7 @@ - Only relevant for the web-channel, i.e. . When an opening receipt is requested by the sender, this value indicates(Y/N) whether the receiver has + Only relevant for the web-channel, i.e. . When an opening receipt is requested by the sender, this value indicates(Y/N) whether the receiver has read the letter or not. This attribute is empty if no opening receipt has been requested. @@ -1100,4 +1101,9 @@ + + + + + diff --git a/Digipost.Api.Client.Resources/Xsd/Data/datatypes.xsd b/Digipost.Api.Client.Resources/Xsd/Data/datatypes.xsd new file mode 100644 index 00000000..51c1cbb4 --- /dev/null +++ b/Digipost.Api.Client.Resources/Xsd/Data/datatypes.xsd @@ -0,0 +1,122 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Digipost.Api.Client.Resources/Xsd/XsdResource.cs b/Digipost.Api.Client.Resources/Xsd/XsdResource.cs index 69e22c5f..27fc418c 100755 --- a/Digipost.Api.Client.Resources/Xsd/XsdResource.cs +++ b/Digipost.Api.Client.Resources/Xsd/XsdResource.cs @@ -18,5 +18,10 @@ public static XmlReader GetApiV7Xsd() { return GetResource("api_v7.xsd"); } + + public static XmlReader GetDataTypesXsd() + { + return GetResource("datatypes.xsd"); + } } } diff --git a/Digipost.Api.Client.Scripts/Digipost.Api.Client.Xsd.csproj b/Digipost.Api.Client.Scripts/Digipost.Api.Client.Xsd.csproj index 0a237d68..c17c4623 100755 --- a/Digipost.Api.Client.Scripts/Digipost.Api.Client.Xsd.csproj +++ b/Digipost.Api.Client.Scripts/Digipost.Api.Client.Xsd.csproj @@ -1,70 +1,73 @@ - - - - - Debug - AnyCPU - {9E8E7C47-894D-441C-956A-2F6EAC2215E0} - Library - Properties - Digipost.Api.Client.Scripts.Xsd - Digipost.Api.Client.Xsd - v4.5 - 512 - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - 1591 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - true - - - C:\Keys\signingkey.snk - - - - - - - - - - - - - - Properties\SharedAssemblyInfo.cs - - - - - signingkey.snk - - - - - + + + + + Debug + AnyCPU + {9E8E7C47-894D-441C-956A-2F6EAC2215E0} + Library + Properties + Digipost.Api.Client.Scripts.Xsd + Digipost.Api.Client.Xsd + v4.5 + 512 + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + 1591 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + true + + + C:\Keys\signingkey.snk + + + + + + + + + + + + + + Properties\SharedAssemblyInfo.cs + + + + + + signingkey.snk + + + + + + + + --> \ No newline at end of file diff --git a/Digipost.Api.Client.Scripts/XsdToCode/Code/api_v7.cs b/Digipost.Api.Client.Scripts/XsdToCode/Code/api_v7.cs index 65577ef1..2da7f067 100755 --- a/Digipost.Api.Client.Scripts/XsdToCode/Code/api_v7.cs +++ b/Digipost.Api.Client.Scripts/XsdToCode/Code/api_v7.cs @@ -1,3138 +1,3151 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -using System.Xml.Serialization; - -// -// This source code was auto-generated by xsd, Version=4.6.81.0. -// - - -/// -[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] -[System.SerializableAttribute()] -[System.Diagnostics.DebuggerStepThroughAttribute()] -[System.ComponentModel.DesignerCategoryAttribute("code")] -[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://api.digipost.no/schema/v7")] -[System.Xml.Serialization.XmlRootAttribute(Namespace="http://api.digipost.no/schema/v7", IsNullable=false)] -public partial class entrypoint { - - private string certificateField; - - private link[] linkField; - - /// - public string certificate { - get { - return this.certificateField; - } - set { - this.certificateField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute("link")] - public link[] link { - get { - return this.linkField; - } - set { - this.linkField = value; - } - } -} - -/// -[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] -[System.SerializableAttribute()] -[System.Diagnostics.DebuggerStepThroughAttribute()] -[System.ComponentModel.DesignerCategoryAttribute("code")] -[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://api.digipost.no/schema/v7")] -public partial class link { - - private string relField; - - private string uriField; - - private string mediatypeField; - - /// - [System.Xml.Serialization.XmlAttributeAttribute()] - public string rel { - get { - return this.relField; - } - set { - this.relField = value; - } - } - - /// - [System.Xml.Serialization.XmlAttributeAttribute()] - public string uri { - get { - return this.uriField; - } - set { - this.uriField = value; - } - } - - /// - [System.Xml.Serialization.XmlAttributeAttribute("media-type")] - public string mediatype { - get { - return this.mediatypeField; - } - set { - this.mediatypeField = value; - } - } -} - -/// -[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] -[System.SerializableAttribute()] -[System.Diagnostics.DebuggerStepThroughAttribute()] -[System.ComponentModel.DesignerCategoryAttribute("code")] -[System.Xml.Serialization.XmlTypeAttribute(TypeName="inbox-document", Namespace="http://api.digipost.no/schema/v7")] -public partial class inboxdocument { - - private long idField; - - private string referencefromsenderField; - - private string subjectField; - - private string senderField; - - private System.DateTime deliverytimeField; - - private System.DateTime firstaccessedField; - - private bool firstaccessedFieldSpecified; - - private authenticationlevel authenticationlevelField; - - private string contenttypeField; - - private string contenturiField; - - private string deleteuriField; - - private inboxdocument[] attachmentField; - - /// - public long id { - get { - return this.idField; - } - set { - this.idField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute("reference-from-sender")] - public string referencefromsender { - get { - return this.referencefromsenderField; - } - set { - this.referencefromsenderField = value; - } - } - - /// - public string subject { - get { - return this.subjectField; - } - set { - this.subjectField = value; - } - } - - /// - public string sender { - get { - return this.senderField; - } - set { - this.senderField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute("delivery-time")] - public System.DateTime deliverytime { - get { - return this.deliverytimeField; - } - set { - this.deliverytimeField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute("first-accessed")] - public System.DateTime firstaccessed { - get { - return this.firstaccessedField; - } - set { - this.firstaccessedField = value; - } - } - - /// - [System.Xml.Serialization.XmlIgnoreAttribute()] - public bool firstaccessedSpecified { - get { - return this.firstaccessedFieldSpecified; - } - set { - this.firstaccessedFieldSpecified = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute("authentication-level")] - public authenticationlevel authenticationlevel { - get { - return this.authenticationlevelField; - } - set { - this.authenticationlevelField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute("content-type")] - public string contenttype { - get { - return this.contenttypeField; - } - set { - this.contenttypeField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute("content-uri")] - public string contenturi { - get { - return this.contenturiField; - } - set { - this.contenturiField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute("delete-uri")] - public string deleteuri { - get { - return this.deleteuriField; - } - set { - this.deleteuriField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute("attachment")] - public inboxdocument[] attachment { - get { - return this.attachmentField; - } - set { - this.attachmentField = value; - } - } -} - -/// -[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] -[System.SerializableAttribute()] -[System.Xml.Serialization.XmlTypeAttribute(TypeName="authentication-level", Namespace="http://api.digipost.no/schema/v7")] -public enum authenticationlevel { - - /// - PASSWORD, - - /// - TWO_FACTOR, - - /// - IDPORTEN_3, - - /// - IDPORTEN_4, -} - -/// -[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] -[System.SerializableAttribute()] -[System.Diagnostics.DebuggerStepThroughAttribute()] -[System.ComponentModel.DesignerCategoryAttribute("code")] -[System.Xml.Serialization.XmlTypeAttribute(TypeName="document-metadata", Namespace="http://api.digipost.no/schema/v7")] -public partial class documentmetadata { - - private link[] linkField; - - private string uuidField; - - private string technicaltypeField; - - /// - [System.Xml.Serialization.XmlElementAttribute("link")] - public link[] link { - get { - return this.linkField; - } - set { - this.linkField = value; - } - } - - /// - [System.Xml.Serialization.XmlAttributeAttribute()] - public string uuid { - get { - return this.uuidField; - } - set { - this.uuidField = value; - } - } - - /// - [System.Xml.Serialization.XmlAttributeAttribute("technical-type")] - public string technicaltype { - get { - return this.technicaltypeField; - } - set { - this.technicaltypeField = value; - } - } -} - -/// -[System.Xml.Serialization.XmlIncludeAttribute(typeof(postmarkedmetadata))] -[System.Xml.Serialization.XmlIncludeAttribute(typeof(failedprintmetadata))] -[System.Xml.Serialization.XmlIncludeAttribute(typeof(smsnotificationfailedmetadata))] -[System.Xml.Serialization.XmlIncludeAttribute(typeof(emailnotificationfailedmetadata))] -[System.Xml.Serialization.XmlIncludeAttribute(typeof(movefilesfrompublicsectormetadata))] -[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] -[System.SerializableAttribute()] -[System.Diagnostics.DebuggerStepThroughAttribute()] -[System.ComponentModel.DesignerCategoryAttribute("code")] -[System.Xml.Serialization.XmlTypeAttribute(TypeName="event-metadata", Namespace="http://api.digipost.no/schema/v7")] -public abstract partial class eventmetadata { -} - -/// -[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] -[System.SerializableAttribute()] -[System.Diagnostics.DebuggerStepThroughAttribute()] -[System.ComponentModel.DesignerCategoryAttribute("code")] -[System.Xml.Serialization.XmlTypeAttribute(TypeName="postmarked-metadata", Namespace="http://api.digipost.no/schema/v7")] -public partial class postmarkedmetadata : eventmetadata { - - private System.DateTime postmarkeddateField; - - /// - [System.Xml.Serialization.XmlAttributeAttribute("postmarked-date")] - public System.DateTime postmarkeddate { - get { - return this.postmarkeddateField; - } - set { - this.postmarkeddateField = value; - } - } -} - -/// -[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] -[System.SerializableAttribute()] -[System.Diagnostics.DebuggerStepThroughAttribute()] -[System.ComponentModel.DesignerCategoryAttribute("code")] -[System.Xml.Serialization.XmlTypeAttribute(TypeName="failed-print-metadata", Namespace="http://api.digipost.no/schema/v7")] -public partial class failedprintmetadata : eventmetadata { - - private string errorcodeField; - - /// - [System.Xml.Serialization.XmlAttributeAttribute("error-code")] - public string errorcode { - get { - return this.errorcodeField; - } - set { - this.errorcodeField = value; - } - } -} - -/// -[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] -[System.SerializableAttribute()] -[System.Diagnostics.DebuggerStepThroughAttribute()] -[System.ComponentModel.DesignerCategoryAttribute("code")] -[System.Xml.Serialization.XmlTypeAttribute(TypeName="sms-notification-failed-metadata", Namespace="http://api.digipost.no/schema/v7")] -public partial class smsnotificationfailedmetadata : eventmetadata { - - private string mobilenumberField; - - private string errorcodeField; - - /// - [System.Xml.Serialization.XmlAttributeAttribute("mobile-number")] - public string mobilenumber { - get { - return this.mobilenumberField; - } - set { - this.mobilenumberField = value; - } - } - - /// - [System.Xml.Serialization.XmlAttributeAttribute("error-code")] - public string errorcode { - get { - return this.errorcodeField; - } - set { - this.errorcodeField = value; - } - } -} - -/// -[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] -[System.SerializableAttribute()] -[System.Diagnostics.DebuggerStepThroughAttribute()] -[System.ComponentModel.DesignerCategoryAttribute("code")] -[System.Xml.Serialization.XmlTypeAttribute(TypeName="email-notification-failed-metadata", Namespace="http://api.digipost.no/schema/v7")] -public partial class emailnotificationfailedmetadata : eventmetadata { - - private string emailaddressField; - - private string errorcodeField; - - /// - [System.Xml.Serialization.XmlAttributeAttribute("email-address")] - public string emailaddress { - get { - return this.emailaddressField; - } - set { - this.emailaddressField = value; - } - } - - /// - [System.Xml.Serialization.XmlAttributeAttribute("error-code")] - public string errorcode { - get { - return this.errorcodeField; - } - set { - this.errorcodeField = value; - } - } -} - -/// -[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] -[System.SerializableAttribute()] -[System.Diagnostics.DebuggerStepThroughAttribute()] -[System.ComponentModel.DesignerCategoryAttribute("code")] -[System.Xml.Serialization.XmlTypeAttribute(TypeName="move-files-from-public-sector-metadata", Namespace="http://api.digipost.no/schema/v7")] -public partial class movefilesfrompublicsectormetadata : eventmetadata { - - private documentmetadata[] documentField; - - private string x509CertificateField; - - private bool openedField; - - private System.DateTime deliverytimeField; - - private string subjectField; - - private authenticationlevel authenticationlevelField; - - private sensitivitylevel sensitivitylevelField; - - private string destinationmailboxField; - - private string destinationmailboxaddressField; - - /// - [System.Xml.Serialization.XmlElementAttribute("document")] - public documentmetadata[] document { - get { - return this.documentField; - } - set { - this.documentField = value; - } - } - - /// - public string x509Certificate { - get { - return this.x509CertificateField; - } - set { - this.x509CertificateField = value; - } - } - - /// - [System.Xml.Serialization.XmlAttributeAttribute()] - public bool opened { - get { - return this.openedField; - } - set { - this.openedField = value; - } - } - - /// - [System.Xml.Serialization.XmlAttributeAttribute("delivery-time")] - public System.DateTime deliverytime { - get { - return this.deliverytimeField; - } - set { - this.deliverytimeField = value; - } - } - - /// - [System.Xml.Serialization.XmlAttributeAttribute()] - public string subject { - get { - return this.subjectField; - } - set { - this.subjectField = value; - } - } - - /// - [System.Xml.Serialization.XmlAttributeAttribute("authentication-level")] - public authenticationlevel authenticationlevel { - get { - return this.authenticationlevelField; - } - set { - this.authenticationlevelField = value; - } - } - - /// - [System.Xml.Serialization.XmlAttributeAttribute("sensitivity-level")] - public sensitivitylevel sensitivitylevel { - get { - return this.sensitivitylevelField; - } - set { - this.sensitivitylevelField = value; - } - } - - /// - [System.Xml.Serialization.XmlAttributeAttribute("destination-mailbox")] - public string destinationmailbox { - get { - return this.destinationmailboxField; - } - set { - this.destinationmailboxField = value; - } - } - - /// - [System.Xml.Serialization.XmlAttributeAttribute("destination-mailbox-address")] - public string destinationmailboxaddress { - get { - return this.destinationmailboxaddressField; - } - set { - this.destinationmailboxaddressField = value; - } - } -} - -/// -[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] -[System.SerializableAttribute()] -[System.Xml.Serialization.XmlTypeAttribute(TypeName="sensitivity-level", Namespace="http://api.digipost.no/schema/v7")] -public enum sensitivitylevel { - - /// - NORMAL, - - /// - SENSITIVE, -} - -/// -[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] -[System.SerializableAttribute()] -[System.Diagnostics.DebuggerStepThroughAttribute()] -[System.ComponentModel.DesignerCategoryAttribute("code")] -[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://api.digipost.no/schema/v7")] -public partial class @event { - - private eventmetadata metadataField; - - private string uuidField; - - private eventtype typeField; - - private System.DateTime createdField; - - private System.DateTime documentcreatedField; - - /// - public eventmetadata metadata { - get { - return this.metadataField; - } - set { - this.metadataField = value; - } - } - - /// - [System.Xml.Serialization.XmlAttributeAttribute()] - public string uuid { - get { - return this.uuidField; - } - set { - this.uuidField = value; - } - } - - /// - [System.Xml.Serialization.XmlAttributeAttribute()] - public eventtype type { - get { - return this.typeField; - } - set { - this.typeField = value; - } - } - - /// - [System.Xml.Serialization.XmlAttributeAttribute()] - public System.DateTime created { - get { - return this.createdField; - } - set { - this.createdField = value; - } - } - - /// - [System.Xml.Serialization.XmlAttributeAttribute("document-created")] - public System.DateTime documentcreated { - get { - return this.documentcreatedField; - } - set { - this.documentcreatedField = value; - } - } -} - -/// -[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] -[System.SerializableAttribute()] -[System.Xml.Serialization.XmlTypeAttribute(TypeName="event-type", Namespace="http://api.digipost.no/schema/v7")] -public enum eventtype { - - /// - EMAIL_NOTIFICATION_FAILED, - - /// - SMS_NOTIFICATION_FAILED, - - /// - OPENED, - - /// - MOVE_FILES_FROM_PUBLIC_SECTOR, - - /// - POSTMARKED, - - /// - PRINT_FAILED, - - /// - SHREDDED, -} - -/// -[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] -[System.SerializableAttribute()] -[System.Diagnostics.DebuggerStepThroughAttribute()] -[System.ComponentModel.DesignerCategoryAttribute("code")] -[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://api.digipost.no/schema/v7")] -public partial class feature { - - private string paramField; - - private string valueField; - - /// - [System.Xml.Serialization.XmlAttributeAttribute()] - public string param { - get { - return this.paramField; - } - set { - this.paramField = value; - } - } - - /// - [System.Xml.Serialization.XmlTextAttribute()] - public string Value { - get { - return this.valueField; - } - set { - this.valueField = value; - } - } -} - -/// -[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] -[System.SerializableAttribute()] -[System.Diagnostics.DebuggerStepThroughAttribute()] -[System.ComponentModel.DesignerCategoryAttribute("code")] -[System.Xml.Serialization.XmlTypeAttribute(TypeName="sender-organization", Namespace="http://api.digipost.no/schema/v7")] -public partial class senderorganization { - - private string organizationidField; - - private string partidField; - - /// - [System.Xml.Serialization.XmlElementAttribute("organization-id")] - public string organizationid { - get { - return this.organizationidField; - } - set { - this.organizationidField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute("part-id")] - public string partid { - get { - return this.partidField; - } - set { - this.partidField = value; - } - } -} - -/// -[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] -[System.SerializableAttribute()] -[System.Diagnostics.DebuggerStepThroughAttribute()] -[System.ComponentModel.DesignerCategoryAttribute("code")] -[System.Xml.Serialization.XmlTypeAttribute(TypeName="content-hash", Namespace="http://api.digipost.no/schema/v7")] -public partial class contenthash { - - private string hashalgorithmField; - - private string valueField; - - /// - [System.Xml.Serialization.XmlAttributeAttribute("hash-algorithm")] - public string hashalgorithm { - get { - return this.hashalgorithmField; - } - set { - this.hashalgorithmField = value; - } - } - - /// - [System.Xml.Serialization.XmlTextAttribute()] - public string Value { - get { - return this.valueField; - } - set { - this.valueField = value; - } - } -} - -/// -[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] -[System.SerializableAttribute()] -[System.Diagnostics.DebuggerStepThroughAttribute()] -[System.ComponentModel.DesignerCategoryAttribute("code")] -[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://api.digipost.no/schema/v7")] -public partial class encrypted { - - private int numberofpagesField; - - private bool numberofpagesFieldSpecified; - - /// - [System.Xml.Serialization.XmlAttributeAttribute("number-of-pages")] - public int numberofpages { - get { - return this.numberofpagesField; - } - set { - this.numberofpagesField = value; - } - } - - /// - [System.Xml.Serialization.XmlIgnoreAttribute()] - public bool numberofpagesSpecified { - get { - return this.numberofpagesFieldSpecified; - } - set { - this.numberofpagesFieldSpecified = value; - } - } -} - -/// -[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] -[System.SerializableAttribute()] -[System.Diagnostics.DebuggerStepThroughAttribute()] -[System.ComponentModel.DesignerCategoryAttribute("code")] -[System.Xml.Serialization.XmlTypeAttribute(TypeName="email-notification", Namespace="http://api.digipost.no/schema/v7")] -public partial class emailnotification { - - private string emailaddressField; - - private string subjectField; - - private string textField; - - private listedtime[] atField; - - /// - [System.Xml.Serialization.XmlElementAttribute("email-address")] - public string emailaddress { - get { - return this.emailaddressField; - } - set { - this.emailaddressField = value; - } - } - - /// - public string subject { - get { - return this.subjectField; - } - set { - this.subjectField = value; - } - } - - /// - public string text { - get { - return this.textField; - } - set { - this.textField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute("at")] - public listedtime[] at { - get { - return this.atField; - } - set { - this.atField = value; - } - } -} - -/// -[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] -[System.SerializableAttribute()] -[System.Diagnostics.DebuggerStepThroughAttribute()] -[System.ComponentModel.DesignerCategoryAttribute("code")] -[System.Xml.Serialization.XmlTypeAttribute(TypeName="listed-time", Namespace="http://api.digipost.no/schema/v7")] -public partial class listedtime { - - private System.DateTime timeField; - - private bool timeFieldSpecified; - - /// - [System.Xml.Serialization.XmlAttributeAttribute()] - public System.DateTime time { - get { - return this.timeField; - } - set { - this.timeField = value; - } - } - - /// - [System.Xml.Serialization.XmlIgnoreAttribute()] - public bool timeSpecified { - get { - return this.timeFieldSpecified; - } - set { - this.timeFieldSpecified = value; - } - } -} - -/// -[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] -[System.SerializableAttribute()] -[System.Diagnostics.DebuggerStepThroughAttribute()] -[System.ComponentModel.DesignerCategoryAttribute("code")] -[System.Xml.Serialization.XmlTypeAttribute(TypeName="sms-overrides", Namespace="http://api.digipost.no/schema/v7")] -public partial class smsoverrides { - - private string smsmobilenumberField; - - private string textField; - - /// - [System.Xml.Serialization.XmlElementAttribute("sms-mobile-number")] - public string smsmobilenumber { - get { - return this.smsmobilenumberField; - } - set { - this.smsmobilenumberField = value; - } - } - - /// - public string text { - get { - return this.textField; - } - set { - this.textField = value; - } - } -} - -/// -[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] -[System.SerializableAttribute()] -[System.Diagnostics.DebuggerStepThroughAttribute()] -[System.ComponentModel.DesignerCategoryAttribute("code")] -[System.Xml.Serialization.XmlTypeAttribute(TypeName="sms-notification", Namespace="http://api.digipost.no/schema/v7")] -public partial class smsnotification { - - private smsoverrides overridesField; - - private listedtime[] atField; - - private int[] afterhoursField; - - /// - public smsoverrides overrides { - get { - return this.overridesField; - } - set { - this.overridesField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute("at")] - public listedtime[] at { - get { - return this.atField; - } - set { - this.atField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute("after-hours")] - public int[] afterhours { - get { - return this.afterhoursField; - } - set { - this.afterhoursField = value; - } - } -} - -/// -[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] -[System.SerializableAttribute()] -[System.Diagnostics.DebuggerStepThroughAttribute()] -[System.ComponentModel.DesignerCategoryAttribute("code")] -[System.Xml.Serialization.XmlTypeAttribute(TypeName="foreign-address", Namespace="http://api.digipost.no/schema/v7")] -public partial class foreignaddress { - - private string addressline1Field; - - private string addressline2Field; - - private string addressline3Field; - - private string addressline4Field; - - private string itemField; - - private ItemChoiceType2 itemElementNameField; - - /// - public string addressline1 { - get { - return this.addressline1Field; - } - set { - this.addressline1Field = value; - } - } - - /// - public string addressline2 { - get { - return this.addressline2Field; - } - set { - this.addressline2Field = value; - } - } - - /// - public string addressline3 { - get { - return this.addressline3Field; - } - set { - this.addressline3Field = value; - } - } - - /// - public string addressline4 { - get { - return this.addressline4Field; - } - set { - this.addressline4Field = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute("country", typeof(string))] - [System.Xml.Serialization.XmlElementAttribute("country-code", typeof(string))] - [System.Xml.Serialization.XmlChoiceIdentifierAttribute("ItemElementName")] - public string Item { - get { - return this.itemField; - } - set { - this.itemField = value; - } - } - - /// - [System.Xml.Serialization.XmlIgnoreAttribute()] - public ItemChoiceType2 ItemElementName { - get { - return this.itemElementNameField; - } - set { - this.itemElementNameField = value; - } - } -} - -/// -[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] -[System.SerializableAttribute()] -[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://api.digipost.no/schema/v7", IncludeInSchema=false)] -public enum ItemChoiceType2 { - - /// - country, - - /// - [System.Xml.Serialization.XmlEnumAttribute("country-code")] - countrycode, -} - -/// -[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] -[System.SerializableAttribute()] -[System.Diagnostics.DebuggerStepThroughAttribute()] -[System.ComponentModel.DesignerCategoryAttribute("code")] -[System.Xml.Serialization.XmlTypeAttribute(TypeName="norwegian-address", Namespace="http://api.digipost.no/schema/v7")] -public partial class norwegianaddress { - - private string addressline1Field; - - private string addressline2Field; - - private string addressline3Field; - - private string zipcodeField; - - private string cityField; - - /// - public string addressline1 { - get { - return this.addressline1Field; - } - set { - this.addressline1Field = value; - } - } - - /// - public string addressline2 { - get { - return this.addressline2Field; - } - set { - this.addressline2Field = value; - } - } - - /// - public string addressline3 { - get { - return this.addressline3Field; - } - set { - this.addressline3Field = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute("zip-code")] - public string zipcode { - get { - return this.zipcodeField; - } - set { - this.zipcodeField = value; - } - } - - /// - public string city { - get { - return this.cityField; - } - set { - this.cityField = value; - } - } -} - -/// -[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] -[System.SerializableAttribute()] -[System.Diagnostics.DebuggerStepThroughAttribute()] -[System.ComponentModel.DesignerCategoryAttribute("code")] -[System.Xml.Serialization.XmlTypeAttribute(TypeName="print-recipient", Namespace="http://api.digipost.no/schema/v7")] -public partial class printrecipient { - - private string nameField; - - private object itemField; - - /// - public string name { - get { - return this.nameField; - } - set { - this.nameField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute("foreign-address", typeof(foreignaddress))] - [System.Xml.Serialization.XmlElementAttribute("norwegian-address", typeof(norwegianaddress))] - public object Item { - get { - return this.itemField; - } - set { - this.itemField = value; - } - } -} - -/// -[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] -[System.SerializableAttribute()] -[System.Diagnostics.DebuggerStepThroughAttribute()] -[System.ComponentModel.DesignerCategoryAttribute("code")] -[System.Xml.Serialization.XmlTypeAttribute(TypeName="print-details", Namespace="http://api.digipost.no/schema/v7")] -public partial class printdetails { - - private printrecipient recipientField; - - private printrecipient returnaddressField; - - private posttype posttypeField; - - private printcolors colorField; - - private nondeliverablehandling nondeliverablehandlingField; - - public printdetails() { - this.colorField = printcolors.MONOCHROME; - this.nondeliverablehandlingField = nondeliverablehandling.RETURN_TO_SENDER; - } - - /// - public printrecipient recipient { - get { - return this.recipientField; - } - set { - this.recipientField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute("return-address")] - public printrecipient returnaddress { - get { - return this.returnaddressField; - } - set { - this.returnaddressField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute("post-type")] - public posttype posttype { - get { - return this.posttypeField; - } - set { - this.posttypeField = value; - } - } - - /// - [System.ComponentModel.DefaultValueAttribute(printcolors.MONOCHROME)] - public printcolors color { - get { - return this.colorField; - } - set { - this.colorField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute("nondeliverable-handling")] - [System.ComponentModel.DefaultValueAttribute(nondeliverablehandling.RETURN_TO_SENDER)] - public nondeliverablehandling nondeliverablehandling { - get { - return this.nondeliverablehandlingField; - } - set { - this.nondeliverablehandlingField = value; - } - } -} - -/// -[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] -[System.SerializableAttribute()] -[System.Xml.Serialization.XmlTypeAttribute(TypeName="post-type", Namespace="http://api.digipost.no/schema/v7")] -public enum posttype { - - /// - A, - - /// - B, -} - -/// -[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] -[System.SerializableAttribute()] -[System.Xml.Serialization.XmlTypeAttribute(TypeName="print-colors", Namespace="http://api.digipost.no/schema/v7")] -public enum printcolors { - - /// - MONOCHROME, - - /// - COLORS, -} - -/// -[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] -[System.SerializableAttribute()] -[System.Xml.Serialization.XmlTypeAttribute(TypeName="nondeliverable-handling", Namespace="http://api.digipost.no/schema/v7")] -public enum nondeliverablehandling { - - /// - SHRED, - - /// - RETURN_TO_SENDER, -} - -/// -[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] -[System.SerializableAttribute()] -[System.Diagnostics.DebuggerStepThroughAttribute()] -[System.ComponentModel.DesignerCategoryAttribute("code")] -[System.Xml.Serialization.XmlTypeAttribute(TypeName="name-and-address", Namespace="http://api.digipost.no/schema/v7")] -public partial class nameandaddress { - - private string fullnameField; - - private string addressline1Field; - - private string addressline2Field; - - private string postalcodeField; - - private string cityField; - - private System.DateTime birthdateField; - - private bool birthdateFieldSpecified; - - private string phonenumberField; - - private string emailaddressField; - - /// - public string fullname { - get { - return this.fullnameField; - } - set { - this.fullnameField = value; - } - } - - /// - public string addressline1 { - get { - return this.addressline1Field; - } - set { - this.addressline1Field = value; - } - } - - /// - public string addressline2 { - get { - return this.addressline2Field; - } - set { - this.addressline2Field = value; - } - } - - /// - public string postalcode { - get { - return this.postalcodeField; - } - set { - this.postalcodeField = value; - } - } - - /// - public string city { - get { - return this.cityField; - } - set { - this.cityField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute("birth-date", DataType="date")] - public System.DateTime birthdate { - get { - return this.birthdateField; - } - set { - this.birthdateField = value; - } - } - - /// - [System.Xml.Serialization.XmlIgnoreAttribute()] - public bool birthdateSpecified { - get { - return this.birthdateFieldSpecified; - } - set { - this.birthdateFieldSpecified = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute("phone-number")] - public string phonenumber { - get { - return this.phonenumberField; - } - set { - this.phonenumberField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute("email-address")] - public string emailaddress { - get { - return this.emailaddressField; - } - set { - this.emailaddressField = value; - } - } -} - -/// -[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] -[System.SerializableAttribute()] -[System.Diagnostics.DebuggerStepThroughAttribute()] -[System.ComponentModel.DesignerCategoryAttribute("code")] -[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://api.digipost.no/schema/v7")] -public partial class suggestion { - - private string searchstringField; - - private link linkField; - - /// - [System.Xml.Serialization.XmlElementAttribute("search-string")] - public string searchstring { - get { - return this.searchstringField; - } - set { - this.searchstringField = value; - } - } - - /// - public link link { - get { - return this.linkField; - } - set { - this.linkField = value; - } - } -} - -/// -[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] -[System.SerializableAttribute()] -[System.Diagnostics.DebuggerStepThroughAttribute()] -[System.ComponentModel.DesignerCategoryAttribute("code")] -[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://api.digipost.no/schema/v7")] -public partial class address { - - private string streetField; - - private string housenumberField; - - private string houseletterField; - - private string additionaladdresslineField; - - private string zipcodeField; - - private string cityField; - - /// - public string street { - get { - return this.streetField; - } - set { - this.streetField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute("house-number")] - public string housenumber { - get { - return this.housenumberField; - } - set { - this.housenumberField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute("house-letter")] - public string houseletter { - get { - return this.houseletterField; - } - set { - this.houseletterField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute("additional-addressline")] - public string additionaladdressline { - get { - return this.additionaladdresslineField; - } - set { - this.additionaladdresslineField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute("zip-code")] - public string zipcode { - get { - return this.zipcodeField; - } - set { - this.zipcodeField = value; - } - } - - /// - public string city { - get { - return this.cityField; - } - set { - this.cityField = value; - } - } -} - -/// -[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] -[System.SerializableAttribute()] -[System.Diagnostics.DebuggerStepThroughAttribute()] -[System.ComponentModel.DesignerCategoryAttribute("code")] -[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://api.digipost.no/schema/v7")] -[System.Xml.Serialization.XmlRootAttribute(Namespace="http://api.digipost.no/schema/v7", IsNullable=false)] -public partial class recipients { - - private recipient[] recipientField; - - private link[] linkField; - - /// - [System.Xml.Serialization.XmlElementAttribute("recipient")] - public recipient[] recipient { - get { - return this.recipientField; - } - set { - this.recipientField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute("link")] - public link[] link { - get { - return this.linkField; - } - set { - this.linkField = value; - } - } -} - -/// -[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] -[System.SerializableAttribute()] -[System.Diagnostics.DebuggerStepThroughAttribute()] -[System.ComponentModel.DesignerCategoryAttribute("code")] -[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://api.digipost.no/schema/v7")] -[System.Xml.Serialization.XmlRootAttribute(Namespace="http://api.digipost.no/schema/v7", IsNullable=false)] -public partial class recipient { - - private string firstnameField; - - private string middlenameField; - - private string lastnameField; - - private string digipostaddressField; - - private string mobilenumberField; - - private string organisationnumberField; - - private string organisationnameField; - - private address[] addressField; - - private link[] linkField; - - /// - public string firstname { - get { - return this.firstnameField; - } - set { - this.firstnameField = value; - } - } - - /// - public string middlename { - get { - return this.middlenameField; - } - set { - this.middlenameField = value; - } - } - - /// - public string lastname { - get { - return this.lastnameField; - } - set { - this.lastnameField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute("digipost-address")] - public string digipostaddress { - get { - return this.digipostaddressField; - } - set { - this.digipostaddressField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute("mobile-number")] - public string mobilenumber { - get { - return this.mobilenumberField; - } - set { - this.mobilenumberField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute("organisation-number")] - public string organisationnumber { - get { - return this.organisationnumberField; - } - set { - this.organisationnumberField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute("organisation-name")] - public string organisationname { - get { - return this.organisationnameField; - } - set { - this.organisationnameField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute("address")] - public address[] address { - get { - return this.addressField; - } - set { - this.addressField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute("link")] - public link[] link { - get { - return this.linkField; - } - set { - this.linkField = value; - } - } -} - -/// -[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] -[System.SerializableAttribute()] -[System.Diagnostics.DebuggerStepThroughAttribute()] -[System.ComponentModel.DesignerCategoryAttribute("code")] -[System.Xml.Serialization.XmlTypeAttribute(TypeName="encryption-key", Namespace="http://api.digipost.no/schema/v7")] -[System.Xml.Serialization.XmlRootAttribute("encryption-key", Namespace="http://api.digipost.no/schema/v7", IsNullable=false)] -public partial class encryptionkey { - - private string keyidField; - - private string valueField; - - /// - [System.Xml.Serialization.XmlAttributeAttribute("key-id")] - public string keyid { - get { - return this.keyidField; - } - set { - this.keyidField = value; - } - } - - /// - [System.Xml.Serialization.XmlTextAttribute()] - public string Value { - get { - return this.valueField; - } - set { - this.valueField = value; - } - } -} - -/// -[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] -[System.SerializableAttribute()] -[System.Diagnostics.DebuggerStepThroughAttribute()] -[System.ComponentModel.DesignerCategoryAttribute("code")] -[System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="http://api.digipost.no/schema/v7")] -[System.Xml.Serialization.XmlRootAttribute(Namespace="http://api.digipost.no/schema/v7", IsNullable=false)] -public partial class autocomplete { - - private suggestion[] suggestionField; - - private link[] linkField; - - /// - [System.Xml.Serialization.XmlElementAttribute("suggestion")] - public suggestion[] suggestion { - get { - return this.suggestionField; - } - set { - this.suggestionField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute("link")] - public link[] link { - get { - return this.linkField; - } - set { - this.linkField = value; - } - } -} - -/// -[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] -[System.SerializableAttribute()] -[System.Diagnostics.DebuggerStepThroughAttribute()] -[System.ComponentModel.DesignerCategoryAttribute("code")] -[System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="http://api.digipost.no/schema/v7")] -[System.Xml.Serialization.XmlRootAttribute(Namespace="http://api.digipost.no/schema/v7", IsNullable=false)] -public partial class error { - - private string errorcodeField; - - private string errormessageField; - - private string errortypeField; - - private link[] linkField; - - /// - [System.Xml.Serialization.XmlElementAttribute("error-code")] - public string errorcode { - get { - return this.errorcodeField; - } - set { - this.errorcodeField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute("error-message")] - public string errormessage { - get { - return this.errormessageField; - } - set { - this.errormessageField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute("error-type")] - public string errortype { - get { - return this.errortypeField; - } - set { - this.errortypeField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute("link")] - public link[] link { - get { - return this.linkField; - } - set { - this.linkField = value; - } - } -} - -/// -[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] -[System.SerializableAttribute()] -[System.Diagnostics.DebuggerStepThroughAttribute()] -[System.ComponentModel.DesignerCategoryAttribute("code")] -[System.Xml.Serialization.XmlTypeAttribute(TypeName="identification-result", Namespace="http://api.digipost.no/schema/v7")] -[System.Xml.Serialization.XmlRootAttribute("identification-result", Namespace="http://api.digipost.no/schema/v7", IsNullable=false)] -public partial class identificationresult { - - private identificationresultcode resultField; - - private object[] itemsField; - - private ItemsChoiceType[] itemsElementNameField; - - /// - public identificationresultcode result { - get { - return this.resultField; - } - set { - this.resultField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute("digipost-address", typeof(string))] - [System.Xml.Serialization.XmlElementAttribute("invalid-reason", typeof(invalidreason))] - [System.Xml.Serialization.XmlElementAttribute("person-alias", typeof(string))] - [System.Xml.Serialization.XmlElementAttribute("unidentified-reason", typeof(unidentifiedreason))] - [System.Xml.Serialization.XmlChoiceIdentifierAttribute("ItemsElementName")] - public object[] Items { - get { - return this.itemsField; - } - set { - this.itemsField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute("ItemsElementName")] - [System.Xml.Serialization.XmlIgnoreAttribute()] - public ItemsChoiceType[] ItemsElementName { - get { - return this.itemsElementNameField; - } - set { - this.itemsElementNameField = value; - } - } -} - -/// -[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] -[System.SerializableAttribute()] -[System.Xml.Serialization.XmlTypeAttribute(TypeName="identification-result-code", Namespace="http://api.digipost.no/schema/v7")] -public enum identificationresultcode { - - /// - DIGIPOST, - - /// - IDENTIFIED, - - /// - UNIDENTIFIED, - - /// - INVALID, -} - -/// -[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] -[System.SerializableAttribute()] -[System.Xml.Serialization.XmlTypeAttribute(TypeName="invalid-reason", Namespace="http://api.digipost.no/schema/v7")] -public enum invalidreason { - - /// - INVALID_PERSONAL_IDENTIFICATION_NUMBER, - - /// - INVALID_ORGANISATION_NUMBER, - - /// - UNKNOWN, -} - -/// -[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] -[System.SerializableAttribute()] -[System.Xml.Serialization.XmlTypeAttribute(TypeName="unidentified-reason", Namespace="http://api.digipost.no/schema/v7")] -public enum unidentifiedreason { - - /// - MULTIPLE_MATCHES, - - /// - NOT_FOUND, -} - -/// -[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] -[System.SerializableAttribute()] -[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://api.digipost.no/schema/v7", IncludeInSchema=false)] -public enum ItemsChoiceType { - - /// - [System.Xml.Serialization.XmlEnumAttribute("digipost-address")] - digipostaddress, - - /// - [System.Xml.Serialization.XmlEnumAttribute("invalid-reason")] - invalidreason, - - /// - [System.Xml.Serialization.XmlEnumAttribute("person-alias")] - personalias, - - /// - [System.Xml.Serialization.XmlEnumAttribute("unidentified-reason")] - unidentifiedreason, -} - -/// -[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] -[System.SerializableAttribute()] -[System.Diagnostics.DebuggerStepThroughAttribute()] -[System.ComponentModel.DesignerCategoryAttribute("code")] -[System.Xml.Serialization.XmlTypeAttribute(TypeName="identification-result-with-encryption-key", Namespace="http://api.digipost.no/schema/v7")] -[System.Xml.Serialization.XmlRootAttribute("identification-result-with-encryption-key", Namespace="http://api.digipost.no/schema/v7", IsNullable=false)] -public partial class identificationresultwithencryptionkey { - - private identificationresult identificationresultField; - - private encryptionkey encryptionkeyField; - - /// - [System.Xml.Serialization.XmlElementAttribute("identification-result")] - public identificationresult identificationresult { - get { - return this.identificationresultField; - } - set { - this.identificationresultField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute("encryption-key")] - public encryptionkey encryptionkey { - get { - return this.encryptionkeyField; - } - set { - this.encryptionkeyField = value; - } - } -} - -/// -[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] -[System.SerializableAttribute()] -[System.Diagnostics.DebuggerStepThroughAttribute()] -[System.ComponentModel.DesignerCategoryAttribute("code")] -[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://api.digipost.no/schema/v7")] -[System.Xml.Serialization.XmlRootAttribute(Namespace="http://api.digipost.no/schema/v7", IsNullable=false)] -public partial class identification { - - private object itemField; - - private ItemChoiceType itemElementNameField; - - private bool includepersonaliasfordigipostuserField; - - public identification() { - this.includepersonaliasfordigipostuserField = false; - } - - /// - [System.Xml.Serialization.XmlElementAttribute("digipost-address", typeof(string))] - [System.Xml.Serialization.XmlElementAttribute("name-and-address", typeof(nameandaddress))] - [System.Xml.Serialization.XmlElementAttribute("organisation-number", typeof(string))] - [System.Xml.Serialization.XmlElementAttribute("personal-identification-number", typeof(string))] - [System.Xml.Serialization.XmlChoiceIdentifierAttribute("ItemElementName")] - public object Item { - get { - return this.itemField; - } - set { - this.itemField = value; - } - } - - /// - [System.Xml.Serialization.XmlIgnoreAttribute()] - public ItemChoiceType ItemElementName { - get { - return this.itemElementNameField; - } - set { - this.itemElementNameField = value; - } - } - - /// - [System.Xml.Serialization.XmlAttributeAttribute("include-personalias-for-digipost-user")] - [System.ComponentModel.DefaultValueAttribute(false)] - public bool includepersonaliasfordigipostuser { - get { - return this.includepersonaliasfordigipostuserField; - } - set { - this.includepersonaliasfordigipostuserField = value; - } - } -} - -/// -[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] -[System.SerializableAttribute()] -[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://api.digipost.no/schema/v7", IncludeInSchema=false)] -public enum ItemChoiceType { - - /// - [System.Xml.Serialization.XmlEnumAttribute("digipost-address")] - digipostaddress, - - /// - [System.Xml.Serialization.XmlEnumAttribute("name-and-address")] - nameandaddress, - - /// - [System.Xml.Serialization.XmlEnumAttribute("organisation-number")] - organisationnumber, - - /// - [System.Xml.Serialization.XmlEnumAttribute("personal-identification-number")] - personalidentificationnumber, -} - -/// -[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] -[System.SerializableAttribute()] -[System.Diagnostics.DebuggerStepThroughAttribute()] -[System.ComponentModel.DesignerCategoryAttribute("code")] -[System.Xml.Serialization.XmlTypeAttribute(TypeName="message-recipient", Namespace="http://api.digipost.no/schema/v7")] -[System.Xml.Serialization.XmlRootAttribute("message-recipient", Namespace="http://api.digipost.no/schema/v7", IsNullable=false)] -public partial class messagerecipient { - - private object itemField; - - private ItemChoiceType1 itemElementNameField; - - private printdetails printdetailsField; - - /// - [System.Xml.Serialization.XmlElementAttribute("digipost-address", typeof(string))] - [System.Xml.Serialization.XmlElementAttribute("name-and-address", typeof(nameandaddress))] - [System.Xml.Serialization.XmlElementAttribute("organisation-number", typeof(string))] - [System.Xml.Serialization.XmlElementAttribute("personal-identification-number", typeof(string))] - [System.Xml.Serialization.XmlChoiceIdentifierAttribute("ItemElementName")] - public object Item { - get { - return this.itemField; - } - set { - this.itemField = value; - } - } - - /// - [System.Xml.Serialization.XmlIgnoreAttribute()] - public ItemChoiceType1 ItemElementName { - get { - return this.itemElementNameField; - } - set { - this.itemElementNameField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute("print-details")] - public printdetails printdetails { - get { - return this.printdetailsField; - } - set { - this.printdetailsField = value; - } - } -} - -/// -[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] -[System.SerializableAttribute()] -[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://api.digipost.no/schema/v7", IncludeInSchema=false)] -public enum ItemChoiceType1 { - - /// - [System.Xml.Serialization.XmlEnumAttribute("digipost-address")] - digipostaddress, - - /// - [System.Xml.Serialization.XmlEnumAttribute("name-and-address")] - nameandaddress, - - /// - [System.Xml.Serialization.XmlEnumAttribute("organisation-number")] - organisationnumber, - - /// - [System.Xml.Serialization.XmlEnumAttribute("personal-identification-number")] - personalidentificationnumber, -} - -/// -[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] -[System.SerializableAttribute()] -[System.Diagnostics.DebuggerStepThroughAttribute()] -[System.ComponentModel.DesignerCategoryAttribute("code")] -[System.Xml.Serialization.XmlTypeAttribute(TypeName="message-delivery", Namespace="http://api.digipost.no/schema/v7")] -[System.Xml.Serialization.XmlRootAttribute("message-delivery", Namespace="http://api.digipost.no/schema/v7", IsNullable=false)] -public partial class messagedelivery { - - private string messageidField; - - private channel deliverymethodField; - - private long senderidField; - - private messagestatus statusField; - - private System.DateTime deliverytimeField; - - private bool deliverytimeFieldSpecified; - - private document primarydocumentField; - - private document[] attachmentField; - - private link[] linkField; - - /// - [System.Xml.Serialization.XmlElementAttribute("message-id")] - public string messageid { - get { - return this.messageidField; - } - set { - this.messageidField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute("delivery-method")] - public channel deliverymethod { - get { - return this.deliverymethodField; - } - set { - this.deliverymethodField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute("sender-id")] - public long senderid { - get { - return this.senderidField; - } - set { - this.senderidField = value; - } - } - - /// - public messagestatus status { - get { - return this.statusField; - } - set { - this.statusField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute("delivery-time")] - public System.DateTime deliverytime { - get { - return this.deliverytimeField; - } - set { - this.deliverytimeField = value; - } - } - - /// - [System.Xml.Serialization.XmlIgnoreAttribute()] - public bool deliverytimeSpecified { - get { - return this.deliverytimeFieldSpecified; - } - set { - this.deliverytimeFieldSpecified = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute("primary-document")] - public document primarydocument { - get { - return this.primarydocumentField; - } - set { - this.primarydocumentField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute("attachment")] - public document[] attachment { - get { - return this.attachmentField; - } - set { - this.attachmentField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute("link")] - public link[] link { - get { - return this.linkField; - } - set { - this.linkField = value; - } - } -} - -/// -[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] -[System.SerializableAttribute()] -[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://api.digipost.no/schema/v7")] -public enum channel { - - /// - PRINT, - - /// - DIGIPOST, -} - -/// -[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] -[System.SerializableAttribute()] -[System.Xml.Serialization.XmlTypeAttribute(TypeName="message-status", Namespace="http://api.digipost.no/schema/v7")] -public enum messagestatus { - - /// - NOT_COMPLETE, - - /// - COMPLETE, - - /// - DELIVERED, - - /// - DELIVERED_TO_PRINT, -} - -/// -[System.Xml.Serialization.XmlIncludeAttribute(typeof(invoice))] -[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] -[System.SerializableAttribute()] -[System.Diagnostics.DebuggerStepThroughAttribute()] -[System.ComponentModel.DesignerCategoryAttribute("code")] -[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://api.digipost.no/schema/v7")] -[System.Xml.Serialization.XmlRootAttribute(Namespace="http://api.digipost.no/schema/v7", IsNullable=false)] -public partial class document { - - private string uuidField; - - private string subjectField; - - private string filetypeField; - - private object itemField; - - private smsnotification smsnotificationField; - - private emailnotification emailnotificationField; - - private authenticationlevel authenticationlevelField; - - private bool authenticationlevelFieldSpecified; - - private sensitivitylevel sensitivitylevelField; - - private bool sensitivitylevelFieldSpecified; - - private encrypted encryptedField; - - private contenthash contenthashField; - - private link[] linkField; - - private string technicaltypeField; - - /// - public string uuid { - get { - return this.uuidField; - } - set { - this.uuidField = value; - } - } - - /// - public string subject { - get { - return this.subjectField; - } - set { - this.subjectField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute("file-type")] - public string filetype { - get { - return this.filetypeField; - } - set { - this.filetypeField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute("opened", typeof(bool))] - [System.Xml.Serialization.XmlElementAttribute("opening-receipt", typeof(string))] - public object Item { - get { - return this.itemField; - } - set { - this.itemField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute("sms-notification")] - public smsnotification smsnotification { - get { - return this.smsnotificationField; - } - set { - this.smsnotificationField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute("email-notification")] - public emailnotification emailnotification { - get { - return this.emailnotificationField; - } - set { - this.emailnotificationField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute("authentication-level")] - public authenticationlevel authenticationlevel { - get { - return this.authenticationlevelField; - } - set { - this.authenticationlevelField = value; - } - } - - /// - [System.Xml.Serialization.XmlIgnoreAttribute()] - public bool authenticationlevelSpecified { - get { - return this.authenticationlevelFieldSpecified; - } - set { - this.authenticationlevelFieldSpecified = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute("sensitivity-level")] - public sensitivitylevel sensitivitylevel { - get { - return this.sensitivitylevelField; - } - set { - this.sensitivitylevelField = value; - } - } - - /// - [System.Xml.Serialization.XmlIgnoreAttribute()] - public bool sensitivitylevelSpecified { - get { - return this.sensitivitylevelFieldSpecified; - } - set { - this.sensitivitylevelFieldSpecified = value; - } - } - - /// - public encrypted encrypted { - get { - return this.encryptedField; - } - set { - this.encryptedField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute("content-hash")] - public contenthash contenthash { - get { - return this.contenthashField; - } - set { - this.contenthashField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute("link")] - public link[] link { - get { - return this.linkField; - } - set { - this.linkField = value; - } - } - - /// - [System.Xml.Serialization.XmlAttributeAttribute("technical-type")] - public string technicaltype { - get { - return this.technicaltypeField; - } - set { - this.technicaltypeField = value; - } - } -} - -/// -[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] -[System.SerializableAttribute()] -[System.Diagnostics.DebuggerStepThroughAttribute()] -[System.ComponentModel.DesignerCategoryAttribute("code")] -[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://api.digipost.no/schema/v7")] -[System.Xml.Serialization.XmlRootAttribute(Namespace="http://api.digipost.no/schema/v7", IsNullable=false)] -public partial class message { - - private string messageidField; - - private object itemField; - - private messagerecipient recipientField; - - private System.DateTime deliverytimeField; - - private bool deliverytimeFieldSpecified; - - private string invoicereferenceField; - - private document primarydocumentField; - - private document[] attachmentField; - - /// - [System.Xml.Serialization.XmlElementAttribute("message-id")] - public string messageid { - get { - return this.messageidField; - } - set { - this.messageidField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute("sender-id", typeof(long))] - [System.Xml.Serialization.XmlElementAttribute("sender-organization", typeof(senderorganization))] - public object Item { - get { - return this.itemField; - } - set { - this.itemField = value; - } - } - - /// - public messagerecipient recipient { - get { - return this.recipientField; - } - set { - this.recipientField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute("delivery-time")] - public System.DateTime deliverytime { - get { - return this.deliverytimeField; - } - set { - this.deliverytimeField = value; - } - } - - /// - [System.Xml.Serialization.XmlIgnoreAttribute()] - public bool deliverytimeSpecified { - get { - return this.deliverytimeFieldSpecified; - } - set { - this.deliverytimeFieldSpecified = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute("invoice-reference")] - public string invoicereference { - get { - return this.invoicereferenceField; - } - set { - this.invoicereferenceField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute("primary-document")] - public document primarydocument { - get { - return this.primarydocumentField; - } - set { - this.primarydocumentField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute("attachment")] - public document[] attachment { - get { - return this.attachmentField; - } - set { - this.attachmentField = value; - } - } -} - -/// -[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] -[System.SerializableAttribute()] -[System.Diagnostics.DebuggerStepThroughAttribute()] -[System.ComponentModel.DesignerCategoryAttribute("code")] -[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://api.digipost.no/schema/v7")] -[System.Xml.Serialization.XmlRootAttribute(Namespace="http://api.digipost.no/schema/v7", IsNullable=false)] -public partial class invoice : document { - - private string kidField; - - private decimal amountField; - - private string accountField; - - private System.DateTime duedateField; - - /// - public string kid { - get { - return this.kidField; - } - set { - this.kidField = value; - } - } - - /// - public decimal amount { - get { - return this.amountField; - } - set { - this.amountField = value; - } - } - - /// - public string account { - get { - return this.accountField; - } - set { - this.accountField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute("due-date", DataType="date")] - public System.DateTime duedate { - get { - return this.duedateField; - } - set { - this.duedateField = value; - } - } -} - -/// -[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] -[System.SerializableAttribute()] -[System.Diagnostics.DebuggerStepThroughAttribute()] -[System.ComponentModel.DesignerCategoryAttribute("code")] -[System.Xml.Serialization.XmlTypeAttribute(TypeName="sender-information", Namespace="http://api.digipost.no/schema/v7")] -[System.Xml.Serialization.XmlRootAttribute("sender-information", Namespace="http://api.digipost.no/schema/v7", IsNullable=false)] -public partial class senderinformation { - - private long senderidField; - - private bool senderidFieldSpecified; - - private senderstatus statusField; - - private feature[] supportedfeaturesField; - - /// - [System.Xml.Serialization.XmlElementAttribute("sender-id")] - public long senderid { - get { - return this.senderidField; - } - set { - this.senderidField = value; - } - } - - /// - [System.Xml.Serialization.XmlIgnoreAttribute()] - public bool senderidSpecified { - get { - return this.senderidFieldSpecified; - } - set { - this.senderidFieldSpecified = value; - } - } - - /// - public senderstatus status { - get { - return this.statusField; - } - set { - this.statusField = value; - } - } - - /// - [System.Xml.Serialization.XmlArrayAttribute("supported-features")] - [System.Xml.Serialization.XmlArrayItemAttribute(IsNullable=false)] - public feature[] supportedfeatures { - get { - return this.supportedfeaturesField; - } - set { - this.supportedfeaturesField = value; - } - } -} - -/// -[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] -[System.SerializableAttribute()] -[System.Xml.Serialization.XmlTypeAttribute(TypeName="sender-status", Namespace="http://api.digipost.no/schema/v7")] -public enum senderstatus { - - /// - NO_INFO_AVAILABLE, - - /// - VALID_SENDER, -} - -/// -[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] -[System.SerializableAttribute()] -[System.Diagnostics.DebuggerStepThroughAttribute()] -[System.ComponentModel.DesignerCategoryAttribute("code")] -[System.Xml.Serialization.XmlTypeAttribute(TypeName="document-status", Namespace="http://api.digipost.no/schema/v7")] -[System.Xml.Serialization.XmlRootAttribute("document-status", Namespace="http://api.digipost.no/schema/v7", IsNullable=false)] -public partial class documentstatus { - - private documentstatus[] attachmentsField; - - private link[] linkField; - - private string uuidField; - - private long senderidField; - - private bool senderidFieldSpecified; - - private deliverystatus statusField; - - private bool statusFieldSpecified; - - private System.DateTime createdField; - - private bool createdFieldSpecified; - - private System.DateTime deliveredField; - - private bool deliveredFieldSpecified; - - private read readField; - - private bool readFieldSpecified; - - private channel channelField; - - private bool channelFieldSpecified; - - private bool isprimarydocumentField; - - private bool isprimarydocumentFieldSpecified; - - private string contenthashField; - - private hashalgorithm contenthashalgorithmField; - - private bool contenthashalgorithmFieldSpecified; - - /// - [System.Xml.Serialization.XmlElementAttribute("attachments")] - public documentstatus[] attachments { - get { - return this.attachmentsField; - } - set { - this.attachmentsField = value; - } - } - - /// - [System.Xml.Serialization.XmlElementAttribute("link")] - public link[] link { - get { - return this.linkField; - } - set { - this.linkField = value; - } - } - - /// - [System.Xml.Serialization.XmlAttributeAttribute()] - public string uuid { - get { - return this.uuidField; - } - set { - this.uuidField = value; - } - } - - /// - [System.Xml.Serialization.XmlAttributeAttribute("sender-id")] - public long senderid { - get { - return this.senderidField; - } - set { - this.senderidField = value; - } - } - - /// - [System.Xml.Serialization.XmlIgnoreAttribute()] - public bool senderidSpecified { - get { - return this.senderidFieldSpecified; - } - set { - this.senderidFieldSpecified = value; - } - } - - /// - [System.Xml.Serialization.XmlAttributeAttribute()] - public deliverystatus status { - get { - return this.statusField; - } - set { - this.statusField = value; - } - } - - /// - [System.Xml.Serialization.XmlIgnoreAttribute()] - public bool statusSpecified { - get { - return this.statusFieldSpecified; - } - set { - this.statusFieldSpecified = value; - } - } - - /// - [System.Xml.Serialization.XmlAttributeAttribute()] - public System.DateTime created { - get { - return this.createdField; - } - set { - this.createdField = value; - } - } - - /// - [System.Xml.Serialization.XmlIgnoreAttribute()] - public bool createdSpecified { - get { - return this.createdFieldSpecified; - } - set { - this.createdFieldSpecified = value; - } - } - - /// - [System.Xml.Serialization.XmlAttributeAttribute()] - public System.DateTime delivered { - get { - return this.deliveredField; - } - set { - this.deliveredField = value; - } - } - - /// - [System.Xml.Serialization.XmlIgnoreAttribute()] - public bool deliveredSpecified { - get { - return this.deliveredFieldSpecified; - } - set { - this.deliveredFieldSpecified = value; - } - } - - /// - [System.Xml.Serialization.XmlAttributeAttribute()] - public read read { - get { - return this.readField; - } - set { - this.readField = value; - } - } - - /// - [System.Xml.Serialization.XmlIgnoreAttribute()] - public bool readSpecified { - get { - return this.readFieldSpecified; - } - set { - this.readFieldSpecified = value; - } - } - - /// - [System.Xml.Serialization.XmlAttributeAttribute()] - public channel channel { - get { - return this.channelField; - } - set { - this.channelField = value; - } - } - - /// - [System.Xml.Serialization.XmlIgnoreAttribute()] - public bool channelSpecified { - get { - return this.channelFieldSpecified; - } - set { - this.channelFieldSpecified = value; - } - } - - /// - [System.Xml.Serialization.XmlAttributeAttribute("is-primary-document")] - public bool isprimarydocument { - get { - return this.isprimarydocumentField; - } - set { - this.isprimarydocumentField = value; - } - } - - /// - [System.Xml.Serialization.XmlIgnoreAttribute()] - public bool isprimarydocumentSpecified { - get { - return this.isprimarydocumentFieldSpecified; - } - set { - this.isprimarydocumentFieldSpecified = value; - } - } - - /// - [System.Xml.Serialization.XmlAttributeAttribute("content-hash")] - public string contenthash { - get { - return this.contenthashField; - } - set { - this.contenthashField = value; - } - } - - /// - [System.Xml.Serialization.XmlAttributeAttribute("content-hash-algorithm")] - public hashalgorithm contenthashalgorithm { - get { - return this.contenthashalgorithmField; - } - set { - this.contenthashalgorithmField = value; - } - } - - /// - [System.Xml.Serialization.XmlIgnoreAttribute()] - public bool contenthashalgorithmSpecified { - get { - return this.contenthashalgorithmFieldSpecified; - } - set { - this.contenthashalgorithmFieldSpecified = value; - } - } -} - -/// -[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] -[System.SerializableAttribute()] -[System.Xml.Serialization.XmlTypeAttribute(TypeName="delivery-status", Namespace="http://api.digipost.no/schema/v7")] -public enum deliverystatus { - - /// - DELIVERED, - - /// - NOT_DELIVERED, -} - -/// -[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] -[System.SerializableAttribute()] -[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://api.digipost.no/schema/v7")] -public enum read { - - /// - Y, - - /// - N, -} - -/// -[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] -[System.SerializableAttribute()] -[System.Xml.Serialization.XmlTypeAttribute(TypeName="hash-algorithm", Namespace="http://api.digipost.no/schema/v7")] -public enum hashalgorithm { - - /// - NONE, - - /// - MD5, - - /// - SHA256, -} - -/// -[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] -[System.SerializableAttribute()] -[System.Diagnostics.DebuggerStepThroughAttribute()] -[System.ComponentModel.DesignerCategoryAttribute("code")] -[System.Xml.Serialization.XmlTypeAttribute(TypeName="document-events", Namespace="http://api.digipost.no/schema/v7")] -[System.Xml.Serialization.XmlRootAttribute("document-events", Namespace="http://api.digipost.no/schema/v7", IsNullable=false)] -public partial class documentevents { - - private @event[] eventField; - - /// - [System.Xml.Serialization.XmlElementAttribute("event")] - public @event[] @event { - get { - return this.eventField; - } - set { - this.eventField = value; - } - } -} - -/// -[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] -[System.SerializableAttribute()] -[System.Diagnostics.DebuggerStepThroughAttribute()] -[System.ComponentModel.DesignerCategoryAttribute("code")] -[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://api.digipost.no/schema/v7")] -[System.Xml.Serialization.XmlRootAttribute(Namespace="http://api.digipost.no/schema/v7", IsNullable=false)] -public partial class inbox { - - private inboxdocument[] documentField; - - /// - [System.Xml.Serialization.XmlElementAttribute("document")] - public inboxdocument[] document { - get { - return this.documentField; - } - set { - this.documentField = value; - } - } -} +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System.Xml.Serialization; + +// +// This source code was auto-generated by xsd, Version=4.6.81.0. +// + + +/// +[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] +[System.SerializableAttribute()] +[System.Diagnostics.DebuggerStepThroughAttribute()] +[System.ComponentModel.DesignerCategoryAttribute("code")] +[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://api.digipost.no/schema/v7")] +[System.Xml.Serialization.XmlRootAttribute(Namespace="http://api.digipost.no/schema/v7", IsNullable=false)] +public partial class entrypoint { + + private string certificateField; + + private link[] linkField; + + /// + public string certificate { + get { + return this.certificateField; + } + set { + this.certificateField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("link")] + public link[] link { + get { + return this.linkField; + } + set { + this.linkField = value; + } + } +} + +/// +[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] +[System.SerializableAttribute()] +[System.Diagnostics.DebuggerStepThroughAttribute()] +[System.ComponentModel.DesignerCategoryAttribute("code")] +[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://api.digipost.no/schema/v7")] +public partial class link { + + private string relField; + + private string uriField; + + private string mediatypeField; + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string rel { + get { + return this.relField; + } + set { + this.relField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string uri { + get { + return this.uriField; + } + set { + this.uriField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute("media-type")] + public string mediatype { + get { + return this.mediatypeField; + } + set { + this.mediatypeField = value; + } + } +} + +/// +[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] +[System.SerializableAttribute()] +[System.Diagnostics.DebuggerStepThroughAttribute()] +[System.ComponentModel.DesignerCategoryAttribute("code")] +[System.Xml.Serialization.XmlTypeAttribute(TypeName="inbox-document", Namespace="http://api.digipost.no/schema/v7")] +public partial class inboxdocument { + + private long idField; + + private string referencefromsenderField; + + private string subjectField; + + private string senderField; + + private System.DateTime deliverytimeField; + + private System.DateTime firstaccessedField; + + private bool firstaccessedFieldSpecified; + + private authenticationlevel authenticationlevelField; + + private string contenttypeField; + + private string contenturiField; + + private string deleteuriField; + + private inboxdocument[] attachmentField; + + /// + public long id { + get { + return this.idField; + } + set { + this.idField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("reference-from-sender")] + public string referencefromsender { + get { + return this.referencefromsenderField; + } + set { + this.referencefromsenderField = value; + } + } + + /// + public string subject { + get { + return this.subjectField; + } + set { + this.subjectField = value; + } + } + + /// + public string sender { + get { + return this.senderField; + } + set { + this.senderField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("delivery-time")] + public System.DateTime deliverytime { + get { + return this.deliverytimeField; + } + set { + this.deliverytimeField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("first-accessed")] + public System.DateTime firstaccessed { + get { + return this.firstaccessedField; + } + set { + this.firstaccessedField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool firstaccessedSpecified { + get { + return this.firstaccessedFieldSpecified; + } + set { + this.firstaccessedFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("authentication-level")] + public authenticationlevel authenticationlevel { + get { + return this.authenticationlevelField; + } + set { + this.authenticationlevelField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("content-type")] + public string contenttype { + get { + return this.contenttypeField; + } + set { + this.contenttypeField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("content-uri")] + public string contenturi { + get { + return this.contenturiField; + } + set { + this.contenturiField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("delete-uri")] + public string deleteuri { + get { + return this.deleteuriField; + } + set { + this.deleteuriField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("attachment")] + public inboxdocument[] attachment { + get { + return this.attachmentField; + } + set { + this.attachmentField = value; + } + } +} + +/// +[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] +[System.SerializableAttribute()] +[System.Xml.Serialization.XmlTypeAttribute(TypeName="authentication-level", Namespace="http://api.digipost.no/schema/v7")] +public enum authenticationlevel { + + /// + PASSWORD, + + /// + TWO_FACTOR, + + /// + IDPORTEN_3, + + /// + IDPORTEN_4, +} + +/// +[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] +[System.SerializableAttribute()] +[System.Diagnostics.DebuggerStepThroughAttribute()] +[System.ComponentModel.DesignerCategoryAttribute("code")] +[System.Xml.Serialization.XmlTypeAttribute(TypeName="document-metadata", Namespace="http://api.digipost.no/schema/v7")] +public partial class documentmetadata { + + private link[] linkField; + + private string uuidField; + + private string technicaltypeField; + + /// + [System.Xml.Serialization.XmlElementAttribute("link")] + public link[] link { + get { + return this.linkField; + } + set { + this.linkField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string uuid { + get { + return this.uuidField; + } + set { + this.uuidField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute("technical-type")] + public string technicaltype { + get { + return this.technicaltypeField; + } + set { + this.technicaltypeField = value; + } + } +} + +/// +[System.Xml.Serialization.XmlIncludeAttribute(typeof(postmarkedmetadata))] +[System.Xml.Serialization.XmlIncludeAttribute(typeof(failedprintmetadata))] +[System.Xml.Serialization.XmlIncludeAttribute(typeof(smsnotificationfailedmetadata))] +[System.Xml.Serialization.XmlIncludeAttribute(typeof(emailnotificationfailedmetadata))] +[System.Xml.Serialization.XmlIncludeAttribute(typeof(movefilesfrompublicsectormetadata))] +[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] +[System.SerializableAttribute()] +[System.Diagnostics.DebuggerStepThroughAttribute()] +[System.ComponentModel.DesignerCategoryAttribute("code")] +[System.Xml.Serialization.XmlTypeAttribute(TypeName="event-metadata", Namespace="http://api.digipost.no/schema/v7")] +public abstract partial class eventmetadata { +} + +/// +[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] +[System.SerializableAttribute()] +[System.Diagnostics.DebuggerStepThroughAttribute()] +[System.ComponentModel.DesignerCategoryAttribute("code")] +[System.Xml.Serialization.XmlTypeAttribute(TypeName="postmarked-metadata", Namespace="http://api.digipost.no/schema/v7")] +public partial class postmarkedmetadata : eventmetadata { + + private System.DateTime postmarkeddateField; + + /// + [System.Xml.Serialization.XmlAttributeAttribute("postmarked-date")] + public System.DateTime postmarkeddate { + get { + return this.postmarkeddateField; + } + set { + this.postmarkeddateField = value; + } + } +} + +/// +[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] +[System.SerializableAttribute()] +[System.Diagnostics.DebuggerStepThroughAttribute()] +[System.ComponentModel.DesignerCategoryAttribute("code")] +[System.Xml.Serialization.XmlTypeAttribute(TypeName="failed-print-metadata", Namespace="http://api.digipost.no/schema/v7")] +public partial class failedprintmetadata : eventmetadata { + + private string errorcodeField; + + /// + [System.Xml.Serialization.XmlAttributeAttribute("error-code")] + public string errorcode { + get { + return this.errorcodeField; + } + set { + this.errorcodeField = value; + } + } +} + +/// +[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] +[System.SerializableAttribute()] +[System.Diagnostics.DebuggerStepThroughAttribute()] +[System.ComponentModel.DesignerCategoryAttribute("code")] +[System.Xml.Serialization.XmlTypeAttribute(TypeName="sms-notification-failed-metadata", Namespace="http://api.digipost.no/schema/v7")] +public partial class smsnotificationfailedmetadata : eventmetadata { + + private string mobilenumberField; + + private string errorcodeField; + + /// + [System.Xml.Serialization.XmlAttributeAttribute("mobile-number")] + public string mobilenumber { + get { + return this.mobilenumberField; + } + set { + this.mobilenumberField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute("error-code")] + public string errorcode { + get { + return this.errorcodeField; + } + set { + this.errorcodeField = value; + } + } +} + +/// +[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] +[System.SerializableAttribute()] +[System.Diagnostics.DebuggerStepThroughAttribute()] +[System.ComponentModel.DesignerCategoryAttribute("code")] +[System.Xml.Serialization.XmlTypeAttribute(TypeName="email-notification-failed-metadata", Namespace="http://api.digipost.no/schema/v7")] +public partial class emailnotificationfailedmetadata : eventmetadata { + + private string emailaddressField; + + private string errorcodeField; + + /// + [System.Xml.Serialization.XmlAttributeAttribute("email-address")] + public string emailaddress { + get { + return this.emailaddressField; + } + set { + this.emailaddressField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute("error-code")] + public string errorcode { + get { + return this.errorcodeField; + } + set { + this.errorcodeField = value; + } + } +} + +/// +[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] +[System.SerializableAttribute()] +[System.Diagnostics.DebuggerStepThroughAttribute()] +[System.ComponentModel.DesignerCategoryAttribute("code")] +[System.Xml.Serialization.XmlTypeAttribute(TypeName="move-files-from-public-sector-metadata", Namespace="http://api.digipost.no/schema/v7")] +public partial class movefilesfrompublicsectormetadata : eventmetadata { + + private documentmetadata[] documentField; + + private string x509CertificateField; + + private bool openedField; + + private System.DateTime deliverytimeField; + + private string subjectField; + + private authenticationlevel authenticationlevelField; + + private sensitivitylevel sensitivitylevelField; + + private string destinationmailboxField; + + private string destinationmailboxaddressField; + + /// + [System.Xml.Serialization.XmlElementAttribute("document")] + public documentmetadata[] document { + get { + return this.documentField; + } + set { + this.documentField = value; + } + } + + /// + public string x509Certificate { + get { + return this.x509CertificateField; + } + set { + this.x509CertificateField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public bool opened { + get { + return this.openedField; + } + set { + this.openedField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute("delivery-time")] + public System.DateTime deliverytime { + get { + return this.deliverytimeField; + } + set { + this.deliverytimeField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string subject { + get { + return this.subjectField; + } + set { + this.subjectField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute("authentication-level")] + public authenticationlevel authenticationlevel { + get { + return this.authenticationlevelField; + } + set { + this.authenticationlevelField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute("sensitivity-level")] + public sensitivitylevel sensitivitylevel { + get { + return this.sensitivitylevelField; + } + set { + this.sensitivitylevelField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute("destination-mailbox")] + public string destinationmailbox { + get { + return this.destinationmailboxField; + } + set { + this.destinationmailboxField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute("destination-mailbox-address")] + public string destinationmailboxaddress { + get { + return this.destinationmailboxaddressField; + } + set { + this.destinationmailboxaddressField = value; + } + } +} + +/// +[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] +[System.SerializableAttribute()] +[System.Xml.Serialization.XmlTypeAttribute(TypeName="sensitivity-level", Namespace="http://api.digipost.no/schema/v7")] +public enum sensitivitylevel { + + /// + NORMAL, + + /// + SENSITIVE, +} + +/// +[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] +[System.SerializableAttribute()] +[System.Diagnostics.DebuggerStepThroughAttribute()] +[System.ComponentModel.DesignerCategoryAttribute("code")] +[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://api.digipost.no/schema/v7")] +public partial class @event { + + private eventmetadata metadataField; + + private string uuidField; + + private eventtype typeField; + + private System.DateTime createdField; + + private System.DateTime documentcreatedField; + + /// + public eventmetadata metadata { + get { + return this.metadataField; + } + set { + this.metadataField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string uuid { + get { + return this.uuidField; + } + set { + this.uuidField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public eventtype type { + get { + return this.typeField; + } + set { + this.typeField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public System.DateTime created { + get { + return this.createdField; + } + set { + this.createdField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute("document-created")] + public System.DateTime documentcreated { + get { + return this.documentcreatedField; + } + set { + this.documentcreatedField = value; + } + } +} + +/// +[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] +[System.SerializableAttribute()] +[System.Xml.Serialization.XmlTypeAttribute(TypeName="event-type", Namespace="http://api.digipost.no/schema/v7")] +public enum eventtype { + + /// + EMAIL_NOTIFICATION_FAILED, + + /// + SMS_NOTIFICATION_FAILED, + + /// + OPENED, + + /// + MOVE_FILES_FROM_PUBLIC_SECTOR, + + /// + POSTMARKED, + + /// + PRINT_FAILED, + + /// + SHREDDED, +} + +/// +[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] +[System.SerializableAttribute()] +[System.Diagnostics.DebuggerStepThroughAttribute()] +[System.ComponentModel.DesignerCategoryAttribute("code")] +[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://api.digipost.no/schema/v7")] +public partial class feature { + + private string paramField; + + private string valueField; + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string param { + get { + return this.paramField; + } + set { + this.paramField = value; + } + } + + /// + [System.Xml.Serialization.XmlTextAttribute()] + public string Value { + get { + return this.valueField; + } + set { + this.valueField = value; + } + } +} + +/// +[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] +[System.SerializableAttribute()] +[System.Diagnostics.DebuggerStepThroughAttribute()] +[System.ComponentModel.DesignerCategoryAttribute("code")] +[System.Xml.Serialization.XmlTypeAttribute(TypeName="sender-organization", Namespace="http://api.digipost.no/schema/v7")] +public partial class senderorganization { + + private string organizationidField; + + private string partidField; + + /// + [System.Xml.Serialization.XmlElementAttribute("organization-id")] + public string organizationid { + get { + return this.organizationidField; + } + set { + this.organizationidField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("part-id")] + public string partid { + get { + return this.partidField; + } + set { + this.partidField = value; + } + } +} + +/// +[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] +[System.SerializableAttribute()] +[System.Diagnostics.DebuggerStepThroughAttribute()] +[System.ComponentModel.DesignerCategoryAttribute("code")] +[System.Xml.Serialization.XmlTypeAttribute(TypeName="content-hash", Namespace="http://api.digipost.no/schema/v7")] +public partial class contenthash { + + private string hashalgorithmField; + + private string valueField; + + /// + [System.Xml.Serialization.XmlAttributeAttribute("hash-algorithm")] + public string hashalgorithm { + get { + return this.hashalgorithmField; + } + set { + this.hashalgorithmField = value; + } + } + + /// + [System.Xml.Serialization.XmlTextAttribute()] + public string Value { + get { + return this.valueField; + } + set { + this.valueField = value; + } + } +} + +/// +[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] +[System.SerializableAttribute()] +[System.Diagnostics.DebuggerStepThroughAttribute()] +[System.ComponentModel.DesignerCategoryAttribute("code")] +[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://api.digipost.no/schema/v7")] +public partial class encrypted { + + private int numberofpagesField; + + private bool numberofpagesFieldSpecified; + + /// + [System.Xml.Serialization.XmlAttributeAttribute("number-of-pages")] + public int numberofpages { + get { + return this.numberofpagesField; + } + set { + this.numberofpagesField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool numberofpagesSpecified { + get { + return this.numberofpagesFieldSpecified; + } + set { + this.numberofpagesFieldSpecified = value; + } + } +} + +/// +[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] +[System.SerializableAttribute()] +[System.Diagnostics.DebuggerStepThroughAttribute()] +[System.ComponentModel.DesignerCategoryAttribute("code")] +[System.Xml.Serialization.XmlTypeAttribute(TypeName="email-notification", Namespace="http://api.digipost.no/schema/v7")] +public partial class emailnotification { + + private string emailaddressField; + + private string subjectField; + + private string textField; + + private listedtime[] atField; + + /// + [System.Xml.Serialization.XmlElementAttribute("email-address")] + public string emailaddress { + get { + return this.emailaddressField; + } + set { + this.emailaddressField = value; + } + } + + /// + public string subject { + get { + return this.subjectField; + } + set { + this.subjectField = value; + } + } + + /// + public string text { + get { + return this.textField; + } + set { + this.textField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("at")] + public listedtime[] at { + get { + return this.atField; + } + set { + this.atField = value; + } + } +} + +/// +[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] +[System.SerializableAttribute()] +[System.Diagnostics.DebuggerStepThroughAttribute()] +[System.ComponentModel.DesignerCategoryAttribute("code")] +[System.Xml.Serialization.XmlTypeAttribute(TypeName="listed-time", Namespace="http://api.digipost.no/schema/v7")] +public partial class listedtime { + + private System.DateTime timeField; + + private bool timeFieldSpecified; + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public System.DateTime time { + get { + return this.timeField; + } + set { + this.timeField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool timeSpecified { + get { + return this.timeFieldSpecified; + } + set { + this.timeFieldSpecified = value; + } + } +} + +/// +[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] +[System.SerializableAttribute()] +[System.Diagnostics.DebuggerStepThroughAttribute()] +[System.ComponentModel.DesignerCategoryAttribute("code")] +[System.Xml.Serialization.XmlTypeAttribute(TypeName="sms-overrides", Namespace="http://api.digipost.no/schema/v7")] +public partial class smsoverrides { + + private string smsmobilenumberField; + + private string textField; + + /// + [System.Xml.Serialization.XmlElementAttribute("sms-mobile-number")] + public string smsmobilenumber { + get { + return this.smsmobilenumberField; + } + set { + this.smsmobilenumberField = value; + } + } + + /// + public string text { + get { + return this.textField; + } + set { + this.textField = value; + } + } +} + +/// +[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] +[System.SerializableAttribute()] +[System.Diagnostics.DebuggerStepThroughAttribute()] +[System.ComponentModel.DesignerCategoryAttribute("code")] +[System.Xml.Serialization.XmlTypeAttribute(TypeName="sms-notification", Namespace="http://api.digipost.no/schema/v7")] +public partial class smsnotification { + + private smsoverrides overridesField; + + private listedtime[] atField; + + private int[] afterhoursField; + + /// + public smsoverrides overrides { + get { + return this.overridesField; + } + set { + this.overridesField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("at")] + public listedtime[] at { + get { + return this.atField; + } + set { + this.atField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("after-hours")] + public int[] afterhours { + get { + return this.afterhoursField; + } + set { + this.afterhoursField = value; + } + } +} + +/// +[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] +[System.SerializableAttribute()] +[System.Diagnostics.DebuggerStepThroughAttribute()] +[System.ComponentModel.DesignerCategoryAttribute("code")] +[System.Xml.Serialization.XmlTypeAttribute(TypeName="foreign-address", Namespace="http://api.digipost.no/schema/v7")] +public partial class foreignaddress { + + private string addressline1Field; + + private string addressline2Field; + + private string addressline3Field; + + private string addressline4Field; + + private string itemField; + + private ItemChoiceType2 itemElementNameField; + + /// + public string addressline1 { + get { + return this.addressline1Field; + } + set { + this.addressline1Field = value; + } + } + + /// + public string addressline2 { + get { + return this.addressline2Field; + } + set { + this.addressline2Field = value; + } + } + + /// + public string addressline3 { + get { + return this.addressline3Field; + } + set { + this.addressline3Field = value; + } + } + + /// + public string addressline4 { + get { + return this.addressline4Field; + } + set { + this.addressline4Field = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("country", typeof(string))] + [System.Xml.Serialization.XmlElementAttribute("country-code", typeof(string))] + [System.Xml.Serialization.XmlChoiceIdentifierAttribute("ItemElementName")] + public string Item { + get { + return this.itemField; + } + set { + this.itemField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public ItemChoiceType2 ItemElementName { + get { + return this.itemElementNameField; + } + set { + this.itemElementNameField = value; + } + } +} + +/// +[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] +[System.SerializableAttribute()] +[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://api.digipost.no/schema/v7", IncludeInSchema=false)] +public enum ItemChoiceType2 { + + /// + country, + + /// + [System.Xml.Serialization.XmlEnumAttribute("country-code")] + countrycode, +} + +/// +[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] +[System.SerializableAttribute()] +[System.Diagnostics.DebuggerStepThroughAttribute()] +[System.ComponentModel.DesignerCategoryAttribute("code")] +[System.Xml.Serialization.XmlTypeAttribute(TypeName="norwegian-address", Namespace="http://api.digipost.no/schema/v7")] +public partial class norwegianaddress { + + private string addressline1Field; + + private string addressline2Field; + + private string addressline3Field; + + private string zipcodeField; + + private string cityField; + + /// + public string addressline1 { + get { + return this.addressline1Field; + } + set { + this.addressline1Field = value; + } + } + + /// + public string addressline2 { + get { + return this.addressline2Field; + } + set { + this.addressline2Field = value; + } + } + + /// + public string addressline3 { + get { + return this.addressline3Field; + } + set { + this.addressline3Field = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("zip-code")] + public string zipcode { + get { + return this.zipcodeField; + } + set { + this.zipcodeField = value; + } + } + + /// + public string city { + get { + return this.cityField; + } + set { + this.cityField = value; + } + } +} + +/// +[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] +[System.SerializableAttribute()] +[System.Diagnostics.DebuggerStepThroughAttribute()] +[System.ComponentModel.DesignerCategoryAttribute("code")] +[System.Xml.Serialization.XmlTypeAttribute(TypeName="print-recipient", Namespace="http://api.digipost.no/schema/v7")] +public partial class printrecipient { + + private string nameField; + + private object itemField; + + /// + public string name { + get { + return this.nameField; + } + set { + this.nameField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("foreign-address", typeof(foreignaddress))] + [System.Xml.Serialization.XmlElementAttribute("norwegian-address", typeof(norwegianaddress))] + public object Item { + get { + return this.itemField; + } + set { + this.itemField = value; + } + } +} + +/// +[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] +[System.SerializableAttribute()] +[System.Diagnostics.DebuggerStepThroughAttribute()] +[System.ComponentModel.DesignerCategoryAttribute("code")] +[System.Xml.Serialization.XmlTypeAttribute(TypeName="print-details", Namespace="http://api.digipost.no/schema/v7")] +public partial class printdetails { + + private printrecipient recipientField; + + private printrecipient returnaddressField; + + private posttype posttypeField; + + private printcolors colorField; + + private nondeliverablehandling nondeliverablehandlingField; + + public printdetails() { + this.colorField = printcolors.MONOCHROME; + this.nondeliverablehandlingField = nondeliverablehandling.RETURN_TO_SENDER; + } + + /// + public printrecipient recipient { + get { + return this.recipientField; + } + set { + this.recipientField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("return-address")] + public printrecipient returnaddress { + get { + return this.returnaddressField; + } + set { + this.returnaddressField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("post-type")] + public posttype posttype { + get { + return this.posttypeField; + } + set { + this.posttypeField = value; + } + } + + /// + [System.ComponentModel.DefaultValueAttribute(printcolors.MONOCHROME)] + public printcolors color { + get { + return this.colorField; + } + set { + this.colorField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("nondeliverable-handling")] + [System.ComponentModel.DefaultValueAttribute(nondeliverablehandling.RETURN_TO_SENDER)] + public nondeliverablehandling nondeliverablehandling { + get { + return this.nondeliverablehandlingField; + } + set { + this.nondeliverablehandlingField = value; + } + } +} + +/// +[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] +[System.SerializableAttribute()] +[System.Xml.Serialization.XmlTypeAttribute(TypeName="post-type", Namespace="http://api.digipost.no/schema/v7")] +public enum posttype { + + /// + A, + + /// + B, +} + +/// +[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] +[System.SerializableAttribute()] +[System.Xml.Serialization.XmlTypeAttribute(TypeName="print-colors", Namespace="http://api.digipost.no/schema/v7")] +public enum printcolors { + + /// + MONOCHROME, + + /// + COLORS, +} + +/// +[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] +[System.SerializableAttribute()] +[System.Xml.Serialization.XmlTypeAttribute(TypeName="nondeliverable-handling", Namespace="http://api.digipost.no/schema/v7")] +public enum nondeliverablehandling { + + /// + SHRED, + + /// + RETURN_TO_SENDER, +} + +/// +[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] +[System.SerializableAttribute()] +[System.Diagnostics.DebuggerStepThroughAttribute()] +[System.ComponentModel.DesignerCategoryAttribute("code")] +[System.Xml.Serialization.XmlTypeAttribute(TypeName="name-and-address", Namespace="http://api.digipost.no/schema/v7")] +public partial class nameandaddress { + + private string fullnameField; + + private string addressline1Field; + + private string addressline2Field; + + private string postalcodeField; + + private string cityField; + + private System.DateTime birthdateField; + + private bool birthdateFieldSpecified; + + private string phonenumberField; + + private string emailaddressField; + + /// + public string fullname { + get { + return this.fullnameField; + } + set { + this.fullnameField = value; + } + } + + /// + public string addressline1 { + get { + return this.addressline1Field; + } + set { + this.addressline1Field = value; + } + } + + /// + public string addressline2 { + get { + return this.addressline2Field; + } + set { + this.addressline2Field = value; + } + } + + /// + public string postalcode { + get { + return this.postalcodeField; + } + set { + this.postalcodeField = value; + } + } + + /// + public string city { + get { + return this.cityField; + } + set { + this.cityField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("birth-date", DataType="date")] + public System.DateTime birthdate { + get { + return this.birthdateField; + } + set { + this.birthdateField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool birthdateSpecified { + get { + return this.birthdateFieldSpecified; + } + set { + this.birthdateFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("phone-number")] + public string phonenumber { + get { + return this.phonenumberField; + } + set { + this.phonenumberField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("email-address")] + public string emailaddress { + get { + return this.emailaddressField; + } + set { + this.emailaddressField = value; + } + } +} + +/// +[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] +[System.SerializableAttribute()] +[System.Diagnostics.DebuggerStepThroughAttribute()] +[System.ComponentModel.DesignerCategoryAttribute("code")] +[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://api.digipost.no/schema/v7")] +public partial class suggestion { + + private string searchstringField; + + private link linkField; + + /// + [System.Xml.Serialization.XmlElementAttribute("search-string")] + public string searchstring { + get { + return this.searchstringField; + } + set { + this.searchstringField = value; + } + } + + /// + public link link { + get { + return this.linkField; + } + set { + this.linkField = value; + } + } +} + +/// +[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] +[System.SerializableAttribute()] +[System.Diagnostics.DebuggerStepThroughAttribute()] +[System.ComponentModel.DesignerCategoryAttribute("code")] +[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://api.digipost.no/schema/v7")] +public partial class address { + + private string streetField; + + private string housenumberField; + + private string houseletterField; + + private string additionaladdresslineField; + + private string zipcodeField; + + private string cityField; + + /// + public string street { + get { + return this.streetField; + } + set { + this.streetField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("house-number")] + public string housenumber { + get { + return this.housenumberField; + } + set { + this.housenumberField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("house-letter")] + public string houseletter { + get { + return this.houseletterField; + } + set { + this.houseletterField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("additional-addressline")] + public string additionaladdressline { + get { + return this.additionaladdresslineField; + } + set { + this.additionaladdresslineField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("zip-code")] + public string zipcode { + get { + return this.zipcodeField; + } + set { + this.zipcodeField = value; + } + } + + /// + public string city { + get { + return this.cityField; + } + set { + this.cityField = value; + } + } +} + +/// +[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] +[System.SerializableAttribute()] +[System.Diagnostics.DebuggerStepThroughAttribute()] +[System.ComponentModel.DesignerCategoryAttribute("code")] +[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://api.digipost.no/schema/v7")] +[System.Xml.Serialization.XmlRootAttribute(Namespace="http://api.digipost.no/schema/v7", IsNullable=false)] +public partial class recipients { + + private recipient[] recipientField; + + private link[] linkField; + + /// + [System.Xml.Serialization.XmlElementAttribute("recipient")] + public recipient[] recipient { + get { + return this.recipientField; + } + set { + this.recipientField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("link")] + public link[] link { + get { + return this.linkField; + } + set { + this.linkField = value; + } + } +} + +/// +[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] +[System.SerializableAttribute()] +[System.Diagnostics.DebuggerStepThroughAttribute()] +[System.ComponentModel.DesignerCategoryAttribute("code")] +[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://api.digipost.no/schema/v7")] +[System.Xml.Serialization.XmlRootAttribute(Namespace="http://api.digipost.no/schema/v7", IsNullable=false)] +public partial class recipient { + + private string firstnameField; + + private string middlenameField; + + private string lastnameField; + + private string digipostaddressField; + + private string mobilenumberField; + + private string organisationnumberField; + + private string organisationnameField; + + private address[] addressField; + + private link[] linkField; + + /// + public string firstname { + get { + return this.firstnameField; + } + set { + this.firstnameField = value; + } + } + + /// + public string middlename { + get { + return this.middlenameField; + } + set { + this.middlenameField = value; + } + } + + /// + public string lastname { + get { + return this.lastnameField; + } + set { + this.lastnameField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("digipost-address")] + public string digipostaddress { + get { + return this.digipostaddressField; + } + set { + this.digipostaddressField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("mobile-number")] + public string mobilenumber { + get { + return this.mobilenumberField; + } + set { + this.mobilenumberField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("organisation-number")] + public string organisationnumber { + get { + return this.organisationnumberField; + } + set { + this.organisationnumberField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("organisation-name")] + public string organisationname { + get { + return this.organisationnameField; + } + set { + this.organisationnameField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("address")] + public address[] address { + get { + return this.addressField; + } + set { + this.addressField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("link")] + public link[] link { + get { + return this.linkField; + } + set { + this.linkField = value; + } + } +} + +/// +[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] +[System.SerializableAttribute()] +[System.Diagnostics.DebuggerStepThroughAttribute()] +[System.ComponentModel.DesignerCategoryAttribute("code")] +[System.Xml.Serialization.XmlTypeAttribute(TypeName="encryption-key", Namespace="http://api.digipost.no/schema/v7")] +[System.Xml.Serialization.XmlRootAttribute("encryption-key", Namespace="http://api.digipost.no/schema/v7", IsNullable=false)] +public partial class encryptionkey { + + private string keyidField; + + private string valueField; + + /// + [System.Xml.Serialization.XmlAttributeAttribute("key-id")] + public string keyid { + get { + return this.keyidField; + } + set { + this.keyidField = value; + } + } + + /// + [System.Xml.Serialization.XmlTextAttribute()] + public string Value { + get { + return this.valueField; + } + set { + this.valueField = value; + } + } +} + +/// +[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] +[System.SerializableAttribute()] +[System.Diagnostics.DebuggerStepThroughAttribute()] +[System.ComponentModel.DesignerCategoryAttribute("code")] +[System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="http://api.digipost.no/schema/v7")] +[System.Xml.Serialization.XmlRootAttribute(Namespace="http://api.digipost.no/schema/v7", IsNullable=false)] +public partial class autocomplete { + + private suggestion[] suggestionField; + + private link[] linkField; + + /// + [System.Xml.Serialization.XmlElementAttribute("suggestion")] + public suggestion[] suggestion { + get { + return this.suggestionField; + } + set { + this.suggestionField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("link")] + public link[] link { + get { + return this.linkField; + } + set { + this.linkField = value; + } + } +} + +/// +[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] +[System.SerializableAttribute()] +[System.Diagnostics.DebuggerStepThroughAttribute()] +[System.ComponentModel.DesignerCategoryAttribute("code")] +[System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="http://api.digipost.no/schema/v7")] +[System.Xml.Serialization.XmlRootAttribute(Namespace="http://api.digipost.no/schema/v7", IsNullable=false)] +public partial class error { + + private string errorcodeField; + + private string errormessageField; + + private string errortypeField; + + private link[] linkField; + + /// + [System.Xml.Serialization.XmlElementAttribute("error-code")] + public string errorcode { + get { + return this.errorcodeField; + } + set { + this.errorcodeField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("error-message")] + public string errormessage { + get { + return this.errormessageField; + } + set { + this.errormessageField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("error-type")] + public string errortype { + get { + return this.errortypeField; + } + set { + this.errortypeField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("link")] + public link[] link { + get { + return this.linkField; + } + set { + this.linkField = value; + } + } +} + +/// +[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] +[System.SerializableAttribute()] +[System.Diagnostics.DebuggerStepThroughAttribute()] +[System.ComponentModel.DesignerCategoryAttribute("code")] +[System.Xml.Serialization.XmlTypeAttribute(TypeName="identification-result", Namespace="http://api.digipost.no/schema/v7")] +[System.Xml.Serialization.XmlRootAttribute("identification-result", Namespace="http://api.digipost.no/schema/v7", IsNullable=false)] +public partial class identificationresult { + + private identificationresultcode resultField; + + private object[] itemsField; + + private ItemsChoiceType[] itemsElementNameField; + + /// + public identificationresultcode result { + get { + return this.resultField; + } + set { + this.resultField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("digipost-address", typeof(string))] + [System.Xml.Serialization.XmlElementAttribute("invalid-reason", typeof(invalidreason))] + [System.Xml.Serialization.XmlElementAttribute("person-alias", typeof(string))] + [System.Xml.Serialization.XmlElementAttribute("unidentified-reason", typeof(unidentifiedreason))] + [System.Xml.Serialization.XmlChoiceIdentifierAttribute("ItemsElementName")] + public object[] Items { + get { + return this.itemsField; + } + set { + this.itemsField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("ItemsElementName")] + [System.Xml.Serialization.XmlIgnoreAttribute()] + public ItemsChoiceType[] ItemsElementName { + get { + return this.itemsElementNameField; + } + set { + this.itemsElementNameField = value; + } + } +} + +/// +[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] +[System.SerializableAttribute()] +[System.Xml.Serialization.XmlTypeAttribute(TypeName="identification-result-code", Namespace="http://api.digipost.no/schema/v7")] +public enum identificationresultcode { + + /// + DIGIPOST, + + /// + IDENTIFIED, + + /// + UNIDENTIFIED, + + /// + INVALID, +} + +/// +[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] +[System.SerializableAttribute()] +[System.Xml.Serialization.XmlTypeAttribute(TypeName="invalid-reason", Namespace="http://api.digipost.no/schema/v7")] +public enum invalidreason { + + /// + INVALID_PERSONAL_IDENTIFICATION_NUMBER, + + /// + INVALID_ORGANISATION_NUMBER, + + /// + UNKNOWN, +} + +/// +[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] +[System.SerializableAttribute()] +[System.Xml.Serialization.XmlTypeAttribute(TypeName="unidentified-reason", Namespace="http://api.digipost.no/schema/v7")] +public enum unidentifiedreason { + + /// + MULTIPLE_MATCHES, + + /// + NOT_FOUND, +} + +/// +[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] +[System.SerializableAttribute()] +[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://api.digipost.no/schema/v7", IncludeInSchema=false)] +public enum ItemsChoiceType { + + /// + [System.Xml.Serialization.XmlEnumAttribute("digipost-address")] + digipostaddress, + + /// + [System.Xml.Serialization.XmlEnumAttribute("invalid-reason")] + invalidreason, + + /// + [System.Xml.Serialization.XmlEnumAttribute("person-alias")] + personalias, + + /// + [System.Xml.Serialization.XmlEnumAttribute("unidentified-reason")] + unidentifiedreason, +} + +/// +[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] +[System.SerializableAttribute()] +[System.Diagnostics.DebuggerStepThroughAttribute()] +[System.ComponentModel.DesignerCategoryAttribute("code")] +[System.Xml.Serialization.XmlTypeAttribute(TypeName="identification-result-with-encryption-key", Namespace="http://api.digipost.no/schema/v7")] +[System.Xml.Serialization.XmlRootAttribute("identification-result-with-encryption-key", Namespace="http://api.digipost.no/schema/v7", IsNullable=false)] +public partial class identificationresultwithencryptionkey { + + private identificationresult identificationresultField; + + private encryptionkey encryptionkeyField; + + /// + [System.Xml.Serialization.XmlElementAttribute("identification-result")] + public identificationresult identificationresult { + get { + return this.identificationresultField; + } + set { + this.identificationresultField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("encryption-key")] + public encryptionkey encryptionkey { + get { + return this.encryptionkeyField; + } + set { + this.encryptionkeyField = value; + } + } +} + +/// +[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] +[System.SerializableAttribute()] +[System.Diagnostics.DebuggerStepThroughAttribute()] +[System.ComponentModel.DesignerCategoryAttribute("code")] +[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://api.digipost.no/schema/v7")] +[System.Xml.Serialization.XmlRootAttribute(Namespace="http://api.digipost.no/schema/v7", IsNullable=false)] +public partial class identification { + + private object itemField; + + private ItemChoiceType itemElementNameField; + + private bool includepersonaliasfordigipostuserField; + + public identification() { + this.includepersonaliasfordigipostuserField = false; + } + + /// + [System.Xml.Serialization.XmlElementAttribute("digipost-address", typeof(string))] + [System.Xml.Serialization.XmlElementAttribute("name-and-address", typeof(nameandaddress))] + [System.Xml.Serialization.XmlElementAttribute("organisation-number", typeof(string))] + [System.Xml.Serialization.XmlElementAttribute("personal-identification-number", typeof(string))] + [System.Xml.Serialization.XmlChoiceIdentifierAttribute("ItemElementName")] + public object Item { + get { + return this.itemField; + } + set { + this.itemField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public ItemChoiceType ItemElementName { + get { + return this.itemElementNameField; + } + set { + this.itemElementNameField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute("include-personalias-for-digipost-user")] + [System.ComponentModel.DefaultValueAttribute(false)] + public bool includepersonaliasfordigipostuser { + get { + return this.includepersonaliasfordigipostuserField; + } + set { + this.includepersonaliasfordigipostuserField = value; + } + } +} + +/// +[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] +[System.SerializableAttribute()] +[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://api.digipost.no/schema/v7", IncludeInSchema=false)] +public enum ItemChoiceType { + + /// + [System.Xml.Serialization.XmlEnumAttribute("digipost-address")] + digipostaddress, + + /// + [System.Xml.Serialization.XmlEnumAttribute("name-and-address")] + nameandaddress, + + /// + [System.Xml.Serialization.XmlEnumAttribute("organisation-number")] + organisationnumber, + + /// + [System.Xml.Serialization.XmlEnumAttribute("personal-identification-number")] + personalidentificationnumber, +} + +/// +[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] +[System.SerializableAttribute()] +[System.Diagnostics.DebuggerStepThroughAttribute()] +[System.ComponentModel.DesignerCategoryAttribute("code")] +[System.Xml.Serialization.XmlTypeAttribute(TypeName="message-recipient", Namespace="http://api.digipost.no/schema/v7")] +[System.Xml.Serialization.XmlRootAttribute("message-recipient", Namespace="http://api.digipost.no/schema/v7", IsNullable=false)] +public partial class messagerecipient { + + private object itemField; + + private ItemChoiceType1 itemElementNameField; + + private printdetails printdetailsField; + + /// + [System.Xml.Serialization.XmlElementAttribute("digipost-address", typeof(string))] + [System.Xml.Serialization.XmlElementAttribute("name-and-address", typeof(nameandaddress))] + [System.Xml.Serialization.XmlElementAttribute("organisation-number", typeof(string))] + [System.Xml.Serialization.XmlElementAttribute("personal-identification-number", typeof(string))] + [System.Xml.Serialization.XmlChoiceIdentifierAttribute("ItemElementName")] + public object Item { + get { + return this.itemField; + } + set { + this.itemField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public ItemChoiceType1 ItemElementName { + get { + return this.itemElementNameField; + } + set { + this.itemElementNameField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("print-details")] + public printdetails printdetails { + get { + return this.printdetailsField; + } + set { + this.printdetailsField = value; + } + } +} + +/// +[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] +[System.SerializableAttribute()] +[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://api.digipost.no/schema/v7", IncludeInSchema=false)] +public enum ItemChoiceType1 { + + /// + [System.Xml.Serialization.XmlEnumAttribute("digipost-address")] + digipostaddress, + + /// + [System.Xml.Serialization.XmlEnumAttribute("name-and-address")] + nameandaddress, + + /// + [System.Xml.Serialization.XmlEnumAttribute("organisation-number")] + organisationnumber, + + /// + [System.Xml.Serialization.XmlEnumAttribute("personal-identification-number")] + personalidentificationnumber, +} + +/// +[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] +[System.SerializableAttribute()] +[System.Diagnostics.DebuggerStepThroughAttribute()] +[System.ComponentModel.DesignerCategoryAttribute("code")] +[System.Xml.Serialization.XmlTypeAttribute(TypeName="message-delivery", Namespace="http://api.digipost.no/schema/v7")] +[System.Xml.Serialization.XmlRootAttribute("message-delivery", Namespace="http://api.digipost.no/schema/v7", IsNullable=false)] +public partial class messagedelivery { + + private string messageidField; + + private channel deliverymethodField; + + private long senderidField; + + private messagestatus statusField; + + private System.DateTime deliverytimeField; + + private bool deliverytimeFieldSpecified; + + private document primarydocumentField; + + private document[] attachmentField; + + private link[] linkField; + + /// + [System.Xml.Serialization.XmlElementAttribute("message-id")] + public string messageid { + get { + return this.messageidField; + } + set { + this.messageidField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("delivery-method")] + public channel deliverymethod { + get { + return this.deliverymethodField; + } + set { + this.deliverymethodField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("sender-id")] + public long senderid { + get { + return this.senderidField; + } + set { + this.senderidField = value; + } + } + + /// + public messagestatus status { + get { + return this.statusField; + } + set { + this.statusField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("delivery-time")] + public System.DateTime deliverytime { + get { + return this.deliverytimeField; + } + set { + this.deliverytimeField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool deliverytimeSpecified { + get { + return this.deliverytimeFieldSpecified; + } + set { + this.deliverytimeFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("primary-document")] + public document primarydocument { + get { + return this.primarydocumentField; + } + set { + this.primarydocumentField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("attachment")] + public document[] attachment { + get { + return this.attachmentField; + } + set { + this.attachmentField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("link")] + public link[] link { + get { + return this.linkField; + } + set { + this.linkField = value; + } + } +} + +/// +[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] +[System.SerializableAttribute()] +[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://api.digipost.no/schema/v7")] +public enum channel { + + /// + PRINT, + + /// + DIGIPOST, +} + +/// +[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] +[System.SerializableAttribute()] +[System.Xml.Serialization.XmlTypeAttribute(TypeName="message-status", Namespace="http://api.digipost.no/schema/v7")] +public enum messagestatus { + + /// + NOT_COMPLETE, + + /// + COMPLETE, + + /// + DELIVERED, + + /// + DELIVERED_TO_PRINT, +} + +/// +[System.Xml.Serialization.XmlIncludeAttribute(typeof(invoice))] +[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] +[System.SerializableAttribute()] +[System.Diagnostics.DebuggerStepThroughAttribute()] +[System.ComponentModel.DesignerCategoryAttribute("code")] +[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://api.digipost.no/schema/v7")] +[System.Xml.Serialization.XmlRootAttribute(Namespace="http://api.digipost.no/schema/v7", IsNullable=false)] +public partial class document { + + private string uuidField; + + private string subjectField; + + private string filetypeField; + + private object itemField; + + private smsnotification smsnotificationField; + + private emailnotification emailnotificationField; + + private authenticationlevel authenticationlevelField; + + private bool authenticationlevelFieldSpecified; + + private sensitivitylevel sensitivitylevelField; + + private bool sensitivitylevelFieldSpecified; + + private encrypted encryptedField; + + private contenthash contenthashField; + + private link[] linkField; + + private System.Xml.XmlElement datatypeField; + + private string technicaltypeField; + + /// + public string uuid { + get { + return this.uuidField; + } + set { + this.uuidField = value; + } + } + + /// + public string subject { + get { + return this.subjectField; + } + set { + this.subjectField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("file-type")] + public string filetype { + get { + return this.filetypeField; + } + set { + this.filetypeField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("opened", typeof(bool))] + [System.Xml.Serialization.XmlElementAttribute("opening-receipt", typeof(string))] + public object Item { + get { + return this.itemField; + } + set { + this.itemField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("sms-notification")] + public smsnotification smsnotification { + get { + return this.smsnotificationField; + } + set { + this.smsnotificationField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("email-notification")] + public emailnotification emailnotification { + get { + return this.emailnotificationField; + } + set { + this.emailnotificationField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("authentication-level")] + public authenticationlevel authenticationlevel { + get { + return this.authenticationlevelField; + } + set { + this.authenticationlevelField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool authenticationlevelSpecified { + get { + return this.authenticationlevelFieldSpecified; + } + set { + this.authenticationlevelFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("sensitivity-level")] + public sensitivitylevel sensitivitylevel { + get { + return this.sensitivitylevelField; + } + set { + this.sensitivitylevelField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool sensitivitylevelSpecified { + get { + return this.sensitivitylevelFieldSpecified; + } + set { + this.sensitivitylevelFieldSpecified = value; + } + } + + /// + public encrypted encrypted { + get { + return this.encryptedField; + } + set { + this.encryptedField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("content-hash")] + public contenthash contenthash { + get { + return this.contenthashField; + } + set { + this.contenthashField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("link")] + public link[] link { + get { + return this.linkField; + } + set { + this.linkField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("data-type")] + public System.Xml.XmlElement datatype { + get { + return this.datatypeField; + } + set { + this.datatypeField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute("technical-type")] + public string technicaltype { + get { + return this.technicaltypeField; + } + set { + this.technicaltypeField = value; + } + } +} + +/// +[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] +[System.SerializableAttribute()] +[System.Diagnostics.DebuggerStepThroughAttribute()] +[System.ComponentModel.DesignerCategoryAttribute("code")] +[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://api.digipost.no/schema/v7")] +[System.Xml.Serialization.XmlRootAttribute(Namespace="http://api.digipost.no/schema/v7", IsNullable=false)] +public partial class message { + + private string messageidField; + + private object itemField; + + private messagerecipient recipientField; + + private System.DateTime deliverytimeField; + + private bool deliverytimeFieldSpecified; + + private string invoicereferenceField; + + private document primarydocumentField; + + private document[] attachmentField; + + /// + [System.Xml.Serialization.XmlElementAttribute("message-id")] + public string messageid { + get { + return this.messageidField; + } + set { + this.messageidField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("sender-id", typeof(long))] + [System.Xml.Serialization.XmlElementAttribute("sender-organization", typeof(senderorganization))] + public object Item { + get { + return this.itemField; + } + set { + this.itemField = value; + } + } + + /// + public messagerecipient recipient { + get { + return this.recipientField; + } + set { + this.recipientField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("delivery-time")] + public System.DateTime deliverytime { + get { + return this.deliverytimeField; + } + set { + this.deliverytimeField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool deliverytimeSpecified { + get { + return this.deliverytimeFieldSpecified; + } + set { + this.deliverytimeFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("invoice-reference")] + public string invoicereference { + get { + return this.invoicereferenceField; + } + set { + this.invoicereferenceField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("primary-document")] + public document primarydocument { + get { + return this.primarydocumentField; + } + set { + this.primarydocumentField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("attachment")] + public document[] attachment { + get { + return this.attachmentField; + } + set { + this.attachmentField = value; + } + } +} + +/// +[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] +[System.SerializableAttribute()] +[System.Diagnostics.DebuggerStepThroughAttribute()] +[System.ComponentModel.DesignerCategoryAttribute("code")] +[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://api.digipost.no/schema/v7")] +[System.Xml.Serialization.XmlRootAttribute(Namespace="http://api.digipost.no/schema/v7", IsNullable=false)] +public partial class invoice : document { + + private string kidField; + + private decimal amountField; + + private string accountField; + + private System.DateTime duedateField; + + /// + public string kid { + get { + return this.kidField; + } + set { + this.kidField = value; + } + } + + /// + public decimal amount { + get { + return this.amountField; + } + set { + this.amountField = value; + } + } + + /// + public string account { + get { + return this.accountField; + } + set { + this.accountField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("due-date", DataType="date")] + public System.DateTime duedate { + get { + return this.duedateField; + } + set { + this.duedateField = value; + } + } +} + +/// +[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] +[System.SerializableAttribute()] +[System.Diagnostics.DebuggerStepThroughAttribute()] +[System.ComponentModel.DesignerCategoryAttribute("code")] +[System.Xml.Serialization.XmlTypeAttribute(TypeName="sender-information", Namespace="http://api.digipost.no/schema/v7")] +[System.Xml.Serialization.XmlRootAttribute("sender-information", Namespace="http://api.digipost.no/schema/v7", IsNullable=false)] +public partial class senderinformation { + + private long senderidField; + + private bool senderidFieldSpecified; + + private senderstatus statusField; + + private feature[] supportedfeaturesField; + + /// + [System.Xml.Serialization.XmlElementAttribute("sender-id")] + public long senderid { + get { + return this.senderidField; + } + set { + this.senderidField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool senderidSpecified { + get { + return this.senderidFieldSpecified; + } + set { + this.senderidFieldSpecified = value; + } + } + + /// + public senderstatus status { + get { + return this.statusField; + } + set { + this.statusField = value; + } + } + + /// + [System.Xml.Serialization.XmlArrayAttribute("supported-features")] + [System.Xml.Serialization.XmlArrayItemAttribute(IsNullable=false)] + public feature[] supportedfeatures { + get { + return this.supportedfeaturesField; + } + set { + this.supportedfeaturesField = value; + } + } +} + +/// +[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] +[System.SerializableAttribute()] +[System.Xml.Serialization.XmlTypeAttribute(TypeName="sender-status", Namespace="http://api.digipost.no/schema/v7")] +public enum senderstatus { + + /// + NO_INFO_AVAILABLE, + + /// + VALID_SENDER, +} + +/// +[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] +[System.SerializableAttribute()] +[System.Diagnostics.DebuggerStepThroughAttribute()] +[System.ComponentModel.DesignerCategoryAttribute("code")] +[System.Xml.Serialization.XmlTypeAttribute(TypeName="document-status", Namespace="http://api.digipost.no/schema/v7")] +[System.Xml.Serialization.XmlRootAttribute("document-status", Namespace="http://api.digipost.no/schema/v7", IsNullable=false)] +public partial class documentstatus { + + private documentstatus[] attachmentsField; + + private link[] linkField; + + private string uuidField; + + private long senderidField; + + private bool senderidFieldSpecified; + + private deliverystatus statusField; + + private bool statusFieldSpecified; + + private System.DateTime createdField; + + private bool createdFieldSpecified; + + private System.DateTime deliveredField; + + private bool deliveredFieldSpecified; + + private read readField; + + private bool readFieldSpecified; + + private channel channelField; + + private bool channelFieldSpecified; + + private bool isprimarydocumentField; + + private bool isprimarydocumentFieldSpecified; + + private string contenthashField; + + private hashalgorithm contenthashalgorithmField; + + private bool contenthashalgorithmFieldSpecified; + + /// + [System.Xml.Serialization.XmlElementAttribute("attachments")] + public documentstatus[] attachments { + get { + return this.attachmentsField; + } + set { + this.attachmentsField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("link")] + public link[] link { + get { + return this.linkField; + } + set { + this.linkField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string uuid { + get { + return this.uuidField; + } + set { + this.uuidField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute("sender-id")] + public long senderid { + get { + return this.senderidField; + } + set { + this.senderidField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool senderidSpecified { + get { + return this.senderidFieldSpecified; + } + set { + this.senderidFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public deliverystatus status { + get { + return this.statusField; + } + set { + this.statusField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool statusSpecified { + get { + return this.statusFieldSpecified; + } + set { + this.statusFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public System.DateTime created { + get { + return this.createdField; + } + set { + this.createdField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool createdSpecified { + get { + return this.createdFieldSpecified; + } + set { + this.createdFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public System.DateTime delivered { + get { + return this.deliveredField; + } + set { + this.deliveredField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool deliveredSpecified { + get { + return this.deliveredFieldSpecified; + } + set { + this.deliveredFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public read read { + get { + return this.readField; + } + set { + this.readField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool readSpecified { + get { + return this.readFieldSpecified; + } + set { + this.readFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public channel channel { + get { + return this.channelField; + } + set { + this.channelField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool channelSpecified { + get { + return this.channelFieldSpecified; + } + set { + this.channelFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute("is-primary-document")] + public bool isprimarydocument { + get { + return this.isprimarydocumentField; + } + set { + this.isprimarydocumentField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool isprimarydocumentSpecified { + get { + return this.isprimarydocumentFieldSpecified; + } + set { + this.isprimarydocumentFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute("content-hash")] + public string contenthash { + get { + return this.contenthashField; + } + set { + this.contenthashField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute("content-hash-algorithm")] + public hashalgorithm contenthashalgorithm { + get { + return this.contenthashalgorithmField; + } + set { + this.contenthashalgorithmField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool contenthashalgorithmSpecified { + get { + return this.contenthashalgorithmFieldSpecified; + } + set { + this.contenthashalgorithmFieldSpecified = value; + } + } +} + +/// +[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] +[System.SerializableAttribute()] +[System.Xml.Serialization.XmlTypeAttribute(TypeName="delivery-status", Namespace="http://api.digipost.no/schema/v7")] +public enum deliverystatus { + + /// + DELIVERED, + + /// + NOT_DELIVERED, +} + +/// +[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] +[System.SerializableAttribute()] +[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://api.digipost.no/schema/v7")] +public enum read { + + /// + Y, + + /// + N, +} + +/// +[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] +[System.SerializableAttribute()] +[System.Xml.Serialization.XmlTypeAttribute(TypeName="hash-algorithm", Namespace="http://api.digipost.no/schema/v7")] +public enum hashalgorithm { + + /// + NONE, + + /// + MD5, + + /// + SHA256, +} + +/// +[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] +[System.SerializableAttribute()] +[System.Diagnostics.DebuggerStepThroughAttribute()] +[System.ComponentModel.DesignerCategoryAttribute("code")] +[System.Xml.Serialization.XmlTypeAttribute(TypeName="document-events", Namespace="http://api.digipost.no/schema/v7")] +[System.Xml.Serialization.XmlRootAttribute("document-events", Namespace="http://api.digipost.no/schema/v7", IsNullable=false)] +public partial class documentevents { + + private @event[] eventField; + + /// + [System.Xml.Serialization.XmlElementAttribute("event")] + public @event[] @event { + get { + return this.eventField; + } + set { + this.eventField = value; + } + } +} + +/// +[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] +[System.SerializableAttribute()] +[System.Diagnostics.DebuggerStepThroughAttribute()] +[System.ComponentModel.DesignerCategoryAttribute("code")] +[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://api.digipost.no/schema/v7")] +[System.Xml.Serialization.XmlRootAttribute(Namespace="http://api.digipost.no/schema/v7", IsNullable=false)] +public partial class inbox { + + private inboxdocument[] documentField; + + /// + [System.Xml.Serialization.XmlElementAttribute("document")] + public inboxdocument[] document { + get { + return this.documentField; + } + set { + this.documentField = value; + } + } +} diff --git a/Digipost.Api.Client.Scripts/XsdToCode/Code/datatypes.cs b/Digipost.Api.Client.Scripts/XsdToCode/Code/datatypes.cs new file mode 100755 index 00000000..d21598fb --- /dev/null +++ b/Digipost.Api.Client.Scripts/XsdToCode/Code/datatypes.cs @@ -0,0 +1,804 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System.Xml.Serialization; + +// +// This source code was auto-generated by xsd, Version=4.6.81.0. +// + + +/// +[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] +[System.SerializableAttribute()] +[System.Diagnostics.DebuggerStepThroughAttribute()] +[System.ComponentModel.DesignerCategoryAttribute("code")] +[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://api.digipost.no/schema/datatypes")] +[System.Xml.Serialization.XmlRootAttribute(Namespace="http://api.digipost.no/schema/datatypes", IsNullable=false)] +public partial class appointment { + + private string starttimeField; + + private string endtimeField; + + private string arrivaltimeField; + + private string placeField; + + private appointmentAddress addressField; + + private string subtitleField; + + private info[] infoField; + + /// + [System.Xml.Serialization.XmlElementAttribute("start-time")] + public string starttime { + get { + return this.starttimeField; + } + set { + this.starttimeField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("end-time")] + public string endtime { + get { + return this.endtimeField; + } + set { + this.endtimeField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("arrival-time")] + public string arrivaltime { + get { + return this.arrivaltimeField; + } + set { + this.arrivaltimeField = value; + } + } + + /// + public string place { + get { + return this.placeField; + } + set { + this.placeField = value; + } + } + + /// + public appointmentAddress address { + get { + return this.addressField; + } + set { + this.addressField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("sub-title")] + public string subtitle { + get { + return this.subtitleField; + } + set { + this.subtitleField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("info")] + public info[] info { + get { + return this.infoField; + } + set { + this.infoField = value; + } + } +} + +/// +[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] +[System.SerializableAttribute()] +[System.Diagnostics.DebuggerStepThroughAttribute()] +[System.ComponentModel.DesignerCategoryAttribute("code")] +[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://api.digipost.no/schema/datatypes")] +public partial class appointmentAddress { + + private string streetaddressField; + + private string postalcodeField; + + private string cityField; + + /// + [System.Xml.Serialization.XmlElementAttribute("street-address")] + public string streetaddress { + get { + return this.streetaddressField; + } + set { + this.streetaddressField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("postal-code")] + public string postalcode { + get { + return this.postalcodeField; + } + set { + this.postalcodeField = value; + } + } + + /// + public string city { + get { + return this.cityField; + } + set { + this.cityField = value; + } + } +} + +/// +[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] +[System.SerializableAttribute()] +[System.Diagnostics.DebuggerStepThroughAttribute()] +[System.ComponentModel.DesignerCategoryAttribute("code")] +[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://api.digipost.no/schema/datatypes")] +public partial class heftelse { + + private string panthaverField; + + private string typepantField; + + private string beloepField; + + /// + public string panthaver { + get { + return this.panthaverField; + } + set { + this.panthaverField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("type-pant")] + public string typepant { + get { + return this.typepantField; + } + set { + this.typepantField = value; + } + } + + /// + public string beloep { + get { + return this.beloepField; + } + set { + this.beloepField = value; + } + } +} + +/// +[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] +[System.SerializableAttribute()] +[System.Diagnostics.DebuggerStepThroughAttribute()] +[System.ComponentModel.DesignerCategoryAttribute("code")] +[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://api.digipost.no/schema/datatypes")] +public partial class omsetningshistorikk { + + private string datoField; + + private string beskrivelseField; + + private string selgerField; + + private string kjoeperField; + + private long beloepField; + + private bool beloepFieldSpecified; + + /// + public string dato { + get { + return this.datoField; + } + set { + this.datoField = value; + } + } + + /// + public string beskrivelse { + get { + return this.beskrivelseField; + } + set { + this.beskrivelseField = value; + } + } + + /// + public string selger { + get { + return this.selgerField; + } + set { + this.selgerField = value; + } + } + + /// + public string kjoeper { + get { + return this.kjoeperField; + } + set { + this.kjoeperField = value; + } + } + + /// + public long beloep { + get { + return this.beloepField; + } + set { + this.beloepField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool beloepSpecified { + get { + return this.beloepFieldSpecified; + } + set { + this.beloepFieldSpecified = value; + } + } +} + +/// +[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] +[System.SerializableAttribute()] +[System.Diagnostics.DebuggerStepThroughAttribute()] +[System.ComponentModel.DesignerCategoryAttribute("code")] +[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://api.digipost.no/schema/datatypes")] +public partial class hjemmelshaver { + + private string nameField; + + private string emailField; + + /// + public string name { + get { + return this.nameField; + } + set { + this.nameField = value; + } + } + + /// + public string email { + get { + return this.emailField; + } + set { + this.emailField = value; + } + } +} + +/// +[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] +[System.SerializableAttribute()] +[System.Diagnostics.DebuggerStepThroughAttribute()] +[System.ComponentModel.DesignerCategoryAttribute("code")] +[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://api.digipost.no/schema/datatypes")] +public partial class matrikkel { + + private string kommunenummerField; + + private string gaardsnummerField; + + private string bruksnummerField; + + private string festenummerField; + + private string seksjonsnummerField; + + /// + public string kommunenummer { + get { + return this.kommunenummerField; + } + set { + this.kommunenummerField = value; + } + } + + /// + public string gaardsnummer { + get { + return this.gaardsnummerField; + } + set { + this.gaardsnummerField = value; + } + } + + /// + public string bruksnummer { + get { + return this.bruksnummerField; + } + set { + this.bruksnummerField = value; + } + } + + /// + public string festenummer { + get { + return this.festenummerField; + } + set { + this.festenummerField = value; + } + } + + /// + public string seksjonsnummer { + get { + return this.seksjonsnummerField; + } + set { + this.seksjonsnummerField = value; + } + } +} + +/// +[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] +[System.SerializableAttribute()] +[System.Diagnostics.DebuggerStepThroughAttribute()] +[System.ComponentModel.DesignerCategoryAttribute("code")] +[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://api.digipost.no/schema/datatypes")] +public partial class residenceAddress { + + private string unitnumberField; + + private string housenumberField; + + private string streetnameField; + + private string postalcodeField; + + private string cityField; + + /// + [System.Xml.Serialization.XmlElementAttribute("unit-number")] + public string unitnumber { + get { + return this.unitnumberField; + } + set { + this.unitnumberField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("house-number")] + public string housenumber { + get { + return this.housenumberField; + } + set { + this.housenumberField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("street-name")] + public string streetname { + get { + return this.streetnameField; + } + set { + this.streetnameField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("postal-code")] + public string postalcode { + get { + return this.postalcodeField; + } + set { + this.postalcodeField = value; + } + } + + /// + public string city { + get { + return this.cityField; + } + set { + this.cityField = value; + } + } +} + +/// +[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] +[System.SerializableAttribute()] +[System.Diagnostics.DebuggerStepThroughAttribute()] +[System.ComponentModel.DesignerCategoryAttribute("code")] +[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://api.digipost.no/schema/datatypes")] +public partial class info { + + private string titleField; + + private string textField; + + /// + public string title { + get { + return this.titleField; + } + set { + this.titleField = value; + } + } + + /// + public string text { + get { + return this.textField; + } + set { + this.textField = value; + } + } +} + +/// +[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] +[System.SerializableAttribute()] +[System.Diagnostics.DebuggerStepThroughAttribute()] +[System.ComponentModel.DesignerCategoryAttribute("code")] +[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://api.digipost.no/schema/datatypes")] +[System.Xml.Serialization.XmlRootAttribute(Namespace="http://api.digipost.no/schema/datatypes", IsNullable=false)] +public partial class boligdetaljer { + + private residence residenceField; + + private hjemmelshaver[] hjemmelshavereField; + + private int bruksarealField; + + private bool bruksarealFieldSpecified; + + private int antalloppholdsromField; + + private bool antalloppholdsromFieldSpecified; + + private int antallbaderomField; + + private bool antallbaderomFieldSpecified; + + private omsetningshistorikk[] omsetningshistorikkField; + + private string organisasjonsnummerField; + + private string bruksenhetField; + + private string andelsnummerField; + + private heftelse[] heftelserField; + + /// + public residence residence { + get { + return this.residenceField; + } + set { + this.residenceField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("hjemmelshavere")] + public hjemmelshaver[] hjemmelshavere { + get { + return this.hjemmelshavereField; + } + set { + this.hjemmelshavereField = value; + } + } + + /// + public int bruksareal { + get { + return this.bruksarealField; + } + set { + this.bruksarealField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool bruksarealSpecified { + get { + return this.bruksarealFieldSpecified; + } + set { + this.bruksarealFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("antall-oppholdsrom")] + public int antalloppholdsrom { + get { + return this.antalloppholdsromField; + } + set { + this.antalloppholdsromField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool antalloppholdsromSpecified { + get { + return this.antalloppholdsromFieldSpecified; + } + set { + this.antalloppholdsromFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("antall-baderom")] + public int antallbaderom { + get { + return this.antallbaderomField; + } + set { + this.antallbaderomField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool antallbaderomSpecified { + get { + return this.antallbaderomFieldSpecified; + } + set { + this.antallbaderomFieldSpecified = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("omsetningshistorikk")] + public omsetningshistorikk[] omsetningshistorikk { + get { + return this.omsetningshistorikkField; + } + set { + this.omsetningshistorikkField = value; + } + } + + /// + public string organisasjonsnummer { + get { + return this.organisasjonsnummerField; + } + set { + this.organisasjonsnummerField = value; + } + } + + /// + public string bruksenhet { + get { + return this.bruksenhetField; + } + set { + this.bruksenhetField = value; + } + } + + /// + public string andelsnummer { + get { + return this.andelsnummerField; + } + set { + this.andelsnummerField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("heftelser")] + public heftelse[] heftelser { + get { + return this.heftelserField; + } + set { + this.heftelserField = value; + } + } +} + +/// +[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] +[System.SerializableAttribute()] +[System.Diagnostics.DebuggerStepThroughAttribute()] +[System.ComponentModel.DesignerCategoryAttribute("code")] +[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://api.digipost.no/schema/datatypes")] +[System.Xml.Serialization.XmlRootAttribute(Namespace="http://api.digipost.no/schema/datatypes", IsNullable=false)] +public partial class residence { + + private residenceAddress addressField; + + private matrikkel matrikkelField; + + private string sourceField; + + private string externalidField; + + /// + public residenceAddress address { + get { + return this.addressField; + } + set { + this.addressField = value; + } + } + + /// + public matrikkel matrikkel { + get { + return this.matrikkelField; + } + set { + this.matrikkelField = value; + } + } + + /// + public string source { + get { + return this.sourceField; + } + set { + this.sourceField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("external-id")] + public string externalid { + get { + return this.externalidField; + } + set { + this.externalidField = value; + } + } +} + +/// +[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.81.0")] +[System.SerializableAttribute()] +[System.Diagnostics.DebuggerStepThroughAttribute()] +[System.ComponentModel.DesignerCategoryAttribute("code")] +[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://api.digipost.no/schema/datatypes")] +[System.Xml.Serialization.XmlRootAttribute(Namespace="http://api.digipost.no/schema/datatypes", IsNullable=false)] +public partial class externalLink { + + private string urlField; + + private System.DateTime deadlineField; + + private bool deadlineFieldSpecified; + + private string descriptionField; + + private string buttontextField; + + /// + [System.Xml.Serialization.XmlElementAttribute(DataType="anyURI")] + public string url { + get { + return this.urlField; + } + set { + this.urlField = value; + } + } + + /// + public System.DateTime deadline { + get { + return this.deadlineField; + } + set { + this.deadlineField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool deadlineSpecified { + get { + return this.deadlineFieldSpecified; + } + set { + this.deadlineFieldSpecified = value; + } + } + + /// + public string description { + get { + return this.descriptionField; + } + set { + this.descriptionField = value; + } + } + + /// + [System.Xml.Serialization.XmlElementAttribute("button-text")] + public string buttontext { + get { + return this.buttontextField; + } + set { + this.buttontextField = value; + } + } +} diff --git a/Digipost.Api.Client.Scripts/XsdToCode/GenerateClassesFromXs.ps1 b/Digipost.Api.Client.Scripts/XsdToCode/Functions.ps1 similarity index 52% rename from Digipost.Api.Client.Scripts/XsdToCode/GenerateClassesFromXs.ps1 rename to Digipost.Api.Client.Scripts/XsdToCode/Functions.ps1 index 14b89910..3fc9a8d7 100755 --- a/Digipost.Api.Client.Scripts/XsdToCode/GenerateClassesFromXs.ps1 +++ b/Digipost.Api.Client.Scripts/XsdToCode/Functions.ps1 @@ -1,14 +1,4 @@ -# RUNNING THE FIRST TIME -# To be able to run the first time, enable running of scripts for current user. Open PowerShell as admin and run: -# Set-Executionpolicy -Scope CurrentUser -ExecutionPolicy UnRestricted -# If you want to check that it was set: -# Get-ExecutionPolicy -List | Format-Table -AutoSize -# Set policy to restricted afterwards: -# Set-Executionpolicy -Scope CurrentUser -ExecutionPolicy Restricted -# If problems running script from network drive: -# net use Z: `"\\vmware-host\Shared Folders` - -function GenerateCode($XsdPath, $OutDir) +function Generate-Code-From-Xsd($XsdPath, $OutDir) { Write-Host("XSD: $XsdPath") Write-Host("OUT: $OutDir") @@ -37,10 +27,4 @@ function Get-Xsd($XsdPathRelativeToSourceDir) $XsdPath } - -$CodeDir = Get-CodeDirectory - -$XsdRelativePath= "\Digipost.Api.Client.Resources\Xsd\Data\api_v7.xsd" -$XsdPath = Get-Xsd($XsdRelativePath) - -GenerateCode $XsdPath "$CodeDir" \ No newline at end of file +# export-modulemember -function Generate-Code-From-Xsd \ No newline at end of file diff --git a/Digipost.Api.Client.Scripts/XsdToCode/GenerateDataTypesClasses.ps1 b/Digipost.Api.Client.Scripts/XsdToCode/GenerateDataTypesClasses.ps1 new file mode 100755 index 00000000..da42982f --- /dev/null +++ b/Digipost.Api.Client.Scripts/XsdToCode/GenerateDataTypesClasses.ps1 @@ -0,0 +1,19 @@ +# RUNNING THE FIRST TIME +# To be able to run the first time, enable running of scripts for current user. Open PowerShell as admin and run: +# Set-Executionpolicy -Scope CurrentUser -ExecutionPolicy UnRestricted +# If you want to check that it was set: +# Get-ExecutionPolicy -List | Format-Table -AutoSize +# Set policy to restricted afterwards: +# Set-Executionpolicy -Scope CurrentUser -ExecutionPolicy Restricted +# If problems running script from network drive: +# net use Z: `"\\vmware-host\Shared Folders` + +$Functions = $PSScriptRoot + "\GenerateClassesFromXsdFunctions.ps1" +. $Functions + +$CodeDir = Get-CodeDirectory + +$XsdRelativePath= "\Digipost.Api.Client.Resources\Xsd\Data\datatypes.xsd" +$XsdPath = Get-Xsd($XsdRelativePath) + +Generate-Code-From-Xsd $XsdPath "$CodeDir" \ No newline at end of file diff --git a/Digipost.Api.Client.Scripts/XsdToCode/GennerateDigipostClasses.ps1 b/Digipost.Api.Client.Scripts/XsdToCode/GennerateDigipostClasses.ps1 new file mode 100755 index 00000000..cce7264e --- /dev/null +++ b/Digipost.Api.Client.Scripts/XsdToCode/GennerateDigipostClasses.ps1 @@ -0,0 +1,19 @@ +# RUNNING THE FIRST TIME +# To be able to run the first time, enable running of scripts for current user. Open PowerShell as admin and run: +# Set-Executionpolicy -Scope CurrentUser -ExecutionPolicy UnRestricted +# If you want to check that it was set: +# Get-ExecutionPolicy -List | Format-Table -AutoSize +# Set policy to restricted afterwards: +# Set-Executionpolicy -Scope CurrentUser -ExecutionPolicy Restricted +# If problems running script from network drive: +# net use Z: `"\\vmware-host\Shared Folders` + +$Functions = $PSScriptRoot + "\Functions.ps1" +. $Functions + +$CodeDir = Get-CodeDirectory + +$XsdRelativePath= "\Digipost.Api.Client.Resources\Xsd\Data\api_V7.xsd" +$XsdPath = Get-Xsd($XsdRelativePath) + +Generate-Code-From-Xsd $XsdPath "$CodeDir" \ No newline at end of file diff --git a/Digipost.Api.Client.Send.Tests/Digipost.Api.Client.Send.Tests.csproj b/Digipost.Api.Client.Send.Tests/Digipost.Api.Client.Send.Tests.csproj index b9fde644..10191c46 100755 --- a/Digipost.Api.Client.Send.Tests/Digipost.Api.Client.Send.Tests.csproj +++ b/Digipost.Api.Client.Send.Tests/Digipost.Api.Client.Send.Tests.csproj @@ -92,6 +92,10 @@ {baa33e63-9cdf-4b8a-ba06-b107995585d0} Digipost.Api.Client.Common + + {04EA2E77-B6B0-48AA-888C-EB21876F6767} + Digipost.Api.Client.DataTypes + {5548c4bb-7811-4a22-a8f6-751f3ab8ce0d} Digipost.Api.Client.Resources diff --git a/Digipost.Api.Client.Send.Tests/MessageActionTests.cs b/Digipost.Api.Client.Send.Tests/MessageActionTests.cs index 562a8e8a..65e3bbd1 100755 --- a/Digipost.Api.Client.Send.Tests/MessageActionTests.cs +++ b/Digipost.Api.Client.Send.Tests/MessageActionTests.cs @@ -1,4 +1,6 @@ -using Digipost.Api.Client.Common.Utilities; +using System; +using Digipost.Api.Client.Common.Utilities; +using Digipost.Api.Client.DataTypes; using Digipost.Api.Client.Tests; using Xunit; @@ -22,6 +24,17 @@ public void ReturnsCorrectDataForMessage() var expected = SerializeUtil.Serialize(SendDataTransferObjectConverter.ToDataTransferObject(message)); Assert.Equal(expected, content.InnerXml); } + + [Fact] + public void SerializedXmlContainsDataType() + { + var message = DomainUtility.GetSimpleMessageWithRecipientById(DomainUtility.GetDocument(new ExternalLink(new Uri("https://digipost.no")))); + + var action = new MessageAction(message); + var content = action.RequestContent; + + Assert.Contains(" differences; - Comparator.Equal(expectedDto, actualDto, out differences); - Assert.Equal(0, differences.Count()); + Comparator.AssertEqual(expectedDto, actualDto); } [Fact] @@ -82,9 +78,7 @@ public void Invoice() var actualDto = SendDataTransferObjectConverter.ToDataTransferObject(source); //Assert - IEnumerable differences; - Comparator.Equal(expectedDto, actualDto, out differences); - Assert.Equal(0, differences.Count()); + Comparator.AssertEqual(expectedDto, actualDto); } [Fact] @@ -148,10 +142,7 @@ public void Message() var actual = SendDataTransferObjectConverter.FromDataTransferObject(source); //Assert - IEnumerable differences; - Comparator.Equal(expected, actual, out differences); - - Assert.Equal(0, differences.Count()); + Comparator.AssertEqual(expected, actual); } } @@ -182,10 +173,7 @@ public void Document() var actual = SendDataTransferObjectConverter.FromDataTransferObject(source); //Assert - IEnumerable differences; - Comparator.Equal(expected, actual, out differences); - - Assert.Equal(0, differences.Count()); + Comparator.AssertEqual(expected, actual); } [Fact] @@ -200,10 +188,7 @@ public void Message() var actualDto = SendDataTransferObjectConverter.ToDataTransferObject(source); //Assert - - IEnumerable differences; - Comparator.Equal(expectedDto, actualDto, out differences); - Assert.Equal(0, differences.Count()); + Comparator.AssertEqual(expectedDto, actualDto); } [Fact] @@ -221,10 +206,7 @@ public void MessageWithPrintDetailsAndRecipientById() var actualDto = SendDataTransferObjectConverter.ToDataTransferObject(source); //Assert - - IEnumerable differences; - Comparator.Equal(expectedDto, actualDto, out differences); - Assert.Equal(0, differences.Count()); + Comparator.AssertEqual(expectedDto, actualDto); } [Fact] @@ -294,10 +276,7 @@ public void MessageWithPrintDetailsAndRecipientByNameAndAddress() var actualDto = SendDataTransferObjectConverter.ToDataTransferObject(source); //Assert - - IEnumerable differences; - Comparator.Equal(expectedDto, actualDto, out differences); - Assert.Equal(0, differences.Count()); + Comparator.AssertEqual(expectedDto, actualDto); } [Fact] @@ -321,9 +300,7 @@ public void SmsNotification() var actual = SendDataTransferObjectConverter.FromDataTransferObject(sourceDto); //Assert - IEnumerable differences; - Comparator.Equal(expected, actual, out differences); - Assert.Equal(0, differences.Count()); + Comparator.AssertEqual(expected, actual); } } } diff --git a/Digipost.Api.Client.Send.Tests/SmsNotificationTests.cs b/Digipost.Api.Client.Send.Tests/SmsNotificationTests.cs index 8ae127bc..7ad0524d 100755 --- a/Digipost.Api.Client.Send.Tests/SmsNotificationTests.cs +++ b/Digipost.Api.Client.Send.Tests/SmsNotificationTests.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using System.Linq; using Digipost.Api.Client.Common; using Digipost.Api.Client.Tests.CompareObjects; using Xunit; @@ -9,8 +8,6 @@ namespace Digipost.Api.Client.Send.Tests { public class SmsNotificationTests { - private readonly Comparator _comparator = new Comparator(); - public class ConstructorMethod : SmsNotificationTests { [Fact] @@ -26,10 +23,7 @@ public void WithAfterHours() var actual = smsNotification.NotifyAfterHours; //Assert - IEnumerable differences; - _comparator.Equal(expected, actual, out differences); - - Assert.Equal(0, differences.Count()); + Comparator.AssertEqual(expected, actual); } [Fact] @@ -45,10 +39,7 @@ public void WithSendingTime() var actual = smsNotification.NotifyAtTimes; //Assert - IEnumerable differences; - _comparator.Equal(expected, actual, out differences); - - Assert.Equal(0, differences.Count()); + Comparator.AssertEqual(expected, actual); } } } diff --git a/Digipost.Api.Client.Send/Digipost.Api.Client.Send.csproj b/Digipost.Api.Client.Send/Digipost.Api.Client.Send.csproj index 3d4fb9d1..ce8a6cd2 100755 --- a/Digipost.Api.Client.Send/Digipost.Api.Client.Send.csproj +++ b/Digipost.Api.Client.Send/Digipost.Api.Client.Send.csproj @@ -70,6 +70,10 @@ {BAA33E63-9CDF-4B8A-BA06-B107995585D0} Digipost.Api.Client.Common + + {04ea2e77-b6b0-48aa-888c-eb21876f6767} + Digipost.Api.Client.DataTypes + {9e8e7c47-894d-441c-956a-2f6eac2215e0} Digipost.Api.Client.Xsd diff --git a/Digipost.Api.Client.Send/Document.cs b/Digipost.Api.Client.Send/Document.cs index f1b1efdb..a5a16f30 100755 --- a/Digipost.Api.Client.Send/Document.cs +++ b/Digipost.Api.Client.Send/Document.cs @@ -1,6 +1,7 @@ using System.IO; using Digipost.Api.Client.Common; using Digipost.Api.Client.Common.Enums; +using Digipost.Api.Client.DataTypes; namespace Digipost.Api.Client.Send { @@ -12,7 +13,9 @@ public class Document : IDocument /// Required authentication level of the document. Default password. /// Sensitivity level of the document. Default normal. /// Optional notification to receiver of message via SMS. - public Document(string subject, string fileType, byte[] contentBytes, AuthenticationLevel authenticationLevel = AuthenticationLevel.Password, SensitivityLevel sensitivityLevel = SensitivityLevel.Normal, ISmsNotification smsNotification = null) + /// Optional metadata for enriching the document when viewed in Digipost + public Document(string subject, string fileType, byte[] contentBytes, AuthenticationLevel authenticationLevel = AuthenticationLevel.Password, + SensitivityLevel sensitivityLevel = SensitivityLevel.Normal, ISmsNotification smsNotification = null, IDataType dataType = null) { Guid = System.Guid.NewGuid().ToString(); Subject = subject; @@ -21,6 +24,7 @@ public Document(string subject, string fileType, byte[] contentBytes, Authentica AuthenticationLevel = authenticationLevel; SensitivityLevel = sensitivityLevel; SmsNotification = smsNotification; + DataType = dataType; } /// The subject of the document. @@ -29,8 +33,10 @@ public Document(string subject, string fileType, byte[] contentBytes, Authentica /// Required authentication level of the document. Default password. /// Sensitivity level of the document. Default normal. /// Optional notification to receiver of message via SMS. - public Document(string subject, string fileType, Stream documentStream, AuthenticationLevel authenticationLevel = AuthenticationLevel.Password, SensitivityLevel sensitivityLevel = SensitivityLevel.Normal, ISmsNotification smsNotification = null) - : this(subject, fileType, new byte[] {}, authenticationLevel, sensitivityLevel, smsNotification) + /// Optional metadata for enriching the document when viewed in Digipost + public Document(string subject, string fileType, Stream documentStream, AuthenticationLevel authenticationLevel = AuthenticationLevel.Password, + SensitivityLevel sensitivityLevel = SensitivityLevel.Normal, ISmsNotification smsNotification = null, IDataType dataType = null) + : this(subject, fileType, new byte[] { }, authenticationLevel, sensitivityLevel, smsNotification, dataType) { ContentBytes = ReadAllBytes(documentStream); } @@ -41,8 +47,10 @@ public Document(string subject, string fileType, Stream documentStream, Authenti /// Required authentication level of the document. Default password. /// Sensitivity level of the document. Default normal. /// Optional notification to receiver of message via SMS. - public Document(string subject, string fileType, string path, AuthenticationLevel authenticationLevel = AuthenticationLevel.Password, SensitivityLevel sensitivityLevel = SensitivityLevel.Normal, ISmsNotification smsNotification = null) - : this(subject, fileType, new byte[] {}, authenticationLevel, sensitivityLevel, smsNotification) + /// Optional metadata for enriching the document when viewed in Digipost + public Document(string subject, string fileType, string path, AuthenticationLevel authenticationLevel = AuthenticationLevel.Password, + SensitivityLevel sensitivityLevel = SensitivityLevel.Normal, ISmsNotification smsNotification = null, IDataType dataType = null) + : this(subject, fileType, new byte[] { }, authenticationLevel, sensitivityLevel, smsNotification, dataType) { ContentBytes = ReadAllBytes(path); } @@ -52,9 +60,10 @@ public Document(string subject, string fileType, string path, AuthenticationLeve /// Required authentication level of the document. Default password. /// Sensitivity level of the document. Default normal. /// Optional notification to receiver of message via SMS. + /// Optional metadata for enriching the document when viewed in Digipost internal Document(string subject, string fileType, AuthenticationLevel authenticationLevel = AuthenticationLevel.Password, - SensitivityLevel sensitivityLevel = SensitivityLevel.Normal, ISmsNotification smsNotification = null) - : this(subject, fileType, new byte[] {}, authenticationLevel, sensitivityLevel, smsNotification) + SensitivityLevel sensitivityLevel = SensitivityLevel.Normal, ISmsNotification smsNotification = null, IDataType dataType = null) + : this(subject, fileType, new byte[] { }, authenticationLevel, sensitivityLevel, smsNotification, dataType) { } @@ -74,6 +83,8 @@ internal Document(string subject, string fileType, AuthenticationLevel authentic public byte[] ContentBytes { get; set; } + public IDataType DataType { get; set; } + internal virtual byte[] ReadAllBytes(string pathToDocument) { return File.ReadAllBytes(pathToDocument); diff --git a/Digipost.Api.Client.Send/IDocument.cs b/Digipost.Api.Client.Send/IDocument.cs index fd4f2b2f..595b9825 100755 --- a/Digipost.Api.Client.Send/IDocument.cs +++ b/Digipost.Api.Client.Send/IDocument.cs @@ -1,5 +1,6 @@ using Digipost.Api.Client.Common; using Digipost.Api.Client.Common.Enums; +using Digipost.Api.Client.DataTypes; namespace Digipost.Api.Client.Send { @@ -41,5 +42,10 @@ public interface IDocument /// The document encoded as a byte array. /// byte[] ContentBytes { get; set; } + + /// + /// Optional metadata to enrich the document in Digipost. See https://github.com/digipost/digipost-data-types for valid data-types. + /// + IDataType DataType { get; set; } } } diff --git a/Digipost.Api.Client.Send/SendDataTransferObjectConverter.cs b/Digipost.Api.Client.Send/SendDataTransferObjectConverter.cs index 71078135..287cdc1e 100755 --- a/Digipost.Api.Client.Send/SendDataTransferObjectConverter.cs +++ b/Digipost.Api.Client.Send/SendDataTransferObjectConverter.cs @@ -76,6 +76,11 @@ public static document ToDataTransferObject(IDocument document) documentDto.smsnotification = DataTransferObjectConverter.ToDataTransferObject(document.SmsNotification); documentDto.uuid = document.Guid; + if (document.DataType != null) + { + documentDto.datatype = document.DataType.Serialize(); + } + return documentDto; } diff --git a/Digipost.Api.Client.Tests/CompareObjects/Comparator.cs b/Digipost.Api.Client.Tests/CompareObjects/Comparator.cs index ad7d4a78..0bd322cd 100755 --- a/Digipost.Api.Client.Tests/CompareObjects/Comparator.cs +++ b/Digipost.Api.Client.Tests/CompareObjects/Comparator.cs @@ -1,20 +1,13 @@ using System.Collections.Generic; using System.Linq; using KellermanSoftware.CompareNetObjects; +using Xunit; namespace Digipost.Api.Client.Tests.CompareObjects { - internal class Comparator : IComparator + internal static class Comparator { - public ComparisonConfiguration ComparisonConfiguration { get; set; } = new ComparisonConfiguration(); - - public bool Equal(object expected, object actual) - { - IEnumerable differences; - return Equal(expected, actual, out differences); - } - - public bool Equal(object expected, object actual, out IEnumerable differences) + private static void Equal(object expected, object actual, out IEnumerable differences) { var compareLogic = new CompareLogic( new ComparisonConfig @@ -31,9 +24,14 @@ public bool Equal(object expected, object actual, out IEnumerable d WhatIsCompared = d.GetWhatIsCompared(), ExpectedValue = d.Object1Value, ActualValue = d.Object2Value - }).ToList(); + }).ToList(); + } - return compareResult.AreEqual; + public static void AssertEqual(object expected, object actual) + { + IEnumerable differences; + Equal(expected, actual, out differences); + Assert.Equal(new List(), differences); } } } diff --git a/Digipost.Api.Client.Tests/CompareObjects/Difference.cs b/Digipost.Api.Client.Tests/CompareObjects/Difference.cs index 5488f091..5c96b05c 100755 --- a/Digipost.Api.Client.Tests/CompareObjects/Difference.cs +++ b/Digipost.Api.Client.Tests/CompareObjects/Difference.cs @@ -1,6 +1,6 @@ namespace Digipost.Api.Client.Tests.CompareObjects { - internal class Difference : IDifference + internal class Difference { public string WhatIsCompared { get; set; } @@ -9,5 +9,10 @@ internal class Difference : IDifference public string ActualValue { get; set; } public string PropertyName { get; set; } + + public override string ToString() + { + return $"Difference in property '{PropertyName}'! Expected '{ExpectedValue}' but was '{ActualValue}'"; + } } } diff --git a/Digipost.Api.Client.Tests/CompareObjects/IComparator.cs b/Digipost.Api.Client.Tests/CompareObjects/IComparator.cs deleted file mode 100755 index 5b46198c..00000000 --- a/Digipost.Api.Client.Tests/CompareObjects/IComparator.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System.Collections.Generic; - -namespace Digipost.Api.Client.Tests.CompareObjects -{ - public interface IComparator - { - bool Equal(object expected, object actual); - - bool Equal(object expected, object actual, out IEnumerable differences); - } -} diff --git a/Digipost.Api.Client.Tests/CompareObjects/IDifference.cs b/Digipost.Api.Client.Tests/CompareObjects/IDifference.cs deleted file mode 100755 index b83a7c1a..00000000 --- a/Digipost.Api.Client.Tests/CompareObjects/IDifference.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace Digipost.Api.Client.Tests.CompareObjects -{ - public interface IDifference - { - string WhatIsCompared { get; set; } - - object ExpectedValue { get; set; } - - string ActualValue { get; set; } - - string PropertyName { get; set; } - } -} diff --git a/Digipost.Api.Client.Tests/Digipost.Api.Client.Tests.csproj b/Digipost.Api.Client.Tests/Digipost.Api.Client.Tests.csproj index de8b0791..2298a6d5 100755 --- a/Digipost.Api.Client.Tests/Digipost.Api.Client.Tests.csproj +++ b/Digipost.Api.Client.Tests/Digipost.Api.Client.Tests.csproj @@ -90,8 +90,6 @@ - - @@ -116,6 +114,10 @@ {BAA33E63-9CDF-4B8A-BA06-B107995585D0} Digipost.Api.Client.Common + + {04ea2e77-b6b0-48aa-888c-eb21876f6767} + Digipost.Api.Client.DataTypes + {5548c4bb-7811-4a22-a8f6-751f3ab8ce0d} Digipost.Api.Client.Resources diff --git a/Digipost.Api.Client.Tests/DomainUtility.cs b/Digipost.Api.Client.Tests/DomainUtility.cs index 8dd80c38..45a20508 100755 --- a/Digipost.Api.Client.Tests/DomainUtility.cs +++ b/Digipost.Api.Client.Tests/DomainUtility.cs @@ -5,6 +5,7 @@ using Digipost.Api.Client.Common.Identify; using Digipost.Api.Client.Common.Print; using Digipost.Api.Client.Common.Recipient; +using Digipost.Api.Client.DataTypes; using Digipost.Api.Client.Resources.Content; using Digipost.Api.Client.Send; using Environment = Digipost.Api.Client.Common.Environment; @@ -24,11 +25,16 @@ public static Sender GetSender() } public static IMessage GetSimpleMessageWithRecipientById() + { + return GetSimpleMessageWithRecipientById(GetDocument()); + } + + public static IMessage GetSimpleMessageWithRecipientById(IDocument document) { var message = new Message( GetSender(), new RecipientById(IdentificationType.PersonalIdentificationNumber, "00000000000"), - GetDocument() + document ); return message; } @@ -93,9 +99,12 @@ public static IMessage GetSimpleMessageWithRecipientByNameAndAddress() return new Message(GetSender(), GetRecipientByNameAndAddress(), GetDocument()); } - public static IDocument GetDocument() + public static IDocument GetDocument(IDataType dataType = null) { - return new Document("simple-document-dotnet", "txt", ContentResource.Hoveddokument.PlainText()); + return new Document("simple-document-dotnet", "txt", ContentResource.Hoveddokument.PlainText()) + { + DataType = dataType + }; } public static IDocument GetInvoice() diff --git a/Digipost.Api.Client.Tests/Properties/AssemblyInfo.cs b/Digipost.Api.Client.Tests/Properties/AssemblyInfo.cs index ef0d4ef5..0b43cca0 100755 --- a/Digipost.Api.Client.Tests/Properties/AssemblyInfo.cs +++ b/Digipost.Api.Client.Tests/Properties/AssemblyInfo.cs @@ -7,3 +7,4 @@ [assembly: InternalsVisibleTo("Digipost.Api.Client.Inbox.Tests,PublicKey=0024000004800000940000000602000000240000525341310004000001000100316e4dede15e9c7abbb2af935ae2a983f3df3d04edf806ac01cba681ca15781bd969d78556a6f1edb79db27e4be9b205335fa73d0d6b8df239d5867540c55171fbf63aa667dc46e871e1399da71e38af47b46eca3d3830629979975ccd92eb1cb59fa6d21f95245106a3ee8853d43c2e9096f114fb7bc377661c60264dc064ad")] [assembly: InternalsVisibleTo("Digipost.Api.Client.Send.Tests,PublicKey=0024000004800000940000000602000000240000525341310004000001000100316e4dede15e9c7abbb2af935ae2a983f3df3d04edf806ac01cba681ca15781bd969d78556a6f1edb79db27e4be9b205335fa73d0d6b8df239d5867540c55171fbf63aa667dc46e871e1399da71e38af47b46eca3d3830629979975ccd92eb1cb59fa6d21f95245106a3ee8853d43c2e9096f114fb7bc377661c60264dc064ad")] [assembly: InternalsVisibleTo("Digipost.Api.Client.Common.Tests,PublicKey=0024000004800000940000000602000000240000525341310004000001000100316e4dede15e9c7abbb2af935ae2a983f3df3d04edf806ac01cba681ca15781bd969d78556a6f1edb79db27e4be9b205335fa73d0d6b8df239d5867540c55171fbf63aa667dc46e871e1399da71e38af47b46eca3d3830629979975ccd92eb1cb59fa6d21f95245106a3ee8853d43c2e9096f114fb7bc377661c60264dc064ad")] +[assembly: InternalsVisibleTo("Digipost.Api.Client.DataTypes.Tests,PublicKey=0024000004800000940000000602000000240000525341310004000001000100316e4dede15e9c7abbb2af935ae2a983f3df3d04edf806ac01cba681ca15781bd969d78556a6f1edb79db27e4be9b205335fa73d0d6b8df239d5867540c55171fbf63aa667dc46e871e1399da71e38af47b46eca3d3830629979975ccd92eb1cb59fa6d21f95245106a3ee8853d43c2e9096f114fb7bc377661c60264dc064ad")] diff --git a/Digipost.Api.Client.Tests/Smoke/TestHelper.cs b/Digipost.Api.Client.Tests/Smoke/TestHelper.cs index 0fc6302e..3768fa80 100755 --- a/Digipost.Api.Client.Tests/Smoke/TestHelper.cs +++ b/Digipost.Api.Client.Tests/Smoke/TestHelper.cs @@ -20,11 +20,13 @@ internal class TestHelper //Gradually built state, identification private Identification _identification; + private IIdentificationResult _identificationResult; private IMessageDeliveryResult _messageDeliveryResult; //Gradually built state, message private IDocument _primary; + private DigipostRecipient _recipient; //Gradually built state, search diff --git a/SharedAssemblyInfo.cs b/SharedAssemblyInfo.cs index 4f555640..6ce9a5be 100755 --- a/SharedAssemblyInfo.cs +++ b/SharedAssemblyInfo.cs @@ -4,8 +4,8 @@ [assembly: AssemblyTrademark("Digipost AS")] [assembly: AssemblyProduct("Digipost API Client")] [assembly: AssemblyDescription("Digipost Client library for API integration.")] -[assembly: AssemblyVersion("8.1.0")] -[assembly: AssemblyFileVersion("8.1.0")] -[assembly: AssemblyInformationalVersion("8.1.0")] +[assembly: AssemblyVersion("8.2.0")] +[assembly: AssemblyFileVersion("8.2.0")] +[assembly: AssemblyInformationalVersion("8.2.0")] [assembly: AssemblyCulture("")] [assembly: AssemblyCopyright("© 2015-2017 Digipost AS")] diff --git a/digipost-api-client.sln b/digipost-api-client.sln index 4d7f9ba6..a062781c 100755 --- a/digipost-api-client.sln +++ b/digipost-api-client.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 14 -VisualStudioVersion = 14.0.24720.0 +# Visual Studio 15 +VisualStudioVersion = 15.0.27004.2009 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Digipost.Api.Client", "Digipost.Api.Client\Digipost.Api.Client.csproj", "{309FBB5E-248F-42EC-81CC-4D4F4578CBFD}" EndProject @@ -27,6 +27,9 @@ EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Digipost.Api.Client.Send", "Digipost.Api.Client.Send\Digipost.Api.Client.Send.csproj", "{28138693-B5B5-40DA-B9FA-E75F28EC9E90}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Digipost.Api.Client.Send.Tests", "Digipost.Api.Client.Send.Tests\Digipost.Api.Client.Send.Tests.csproj", "{71983742-4592-43BF-9599-7575ECA508A0}" + ProjectSection(ProjectDependencies) = postProject + {04EA2E77-B6B0-48AA-888C-EB21876F6767} = {04EA2E77-B6B0-48AA-888C-EB21876F6767} + EndProjectSection EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Digipost.Api.Client.Common.Tests", "Digipost.Api.Client.Common.Tests\Digipost.Api.Client.Common.Tests.csproj", "{3C80F5A3-7D71-4A46-B917-C5AEBF0EC5BA}" EndProject @@ -34,6 +37,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Digipost.Api.Client.Tests", EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Digipost.Api.Client.Docs", "Digipost.Api.Client.Docs\Digipost.Api.Client.Docs.csproj", "{78746C71-867E-42C6-B729-DAAC3461E203}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Digipost.Api.Client.DataTypes", "Digipost.Api.Client.DataTypes\Digipost.Api.Client.DataTypes.csproj", "{04EA2E77-B6B0-48AA-888C-EB21876F6767}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Digipost.Api.Client.DataTypes.Tests", "Digipost.Api.Client.DataTypes.Tests\Digipost.Api.Client.DataTypes.Tests.csproj", "{FF6174C7-8429-4889-8E8E-98A908916B14}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -92,8 +99,19 @@ Global {78746C71-867E-42C6-B729-DAAC3461E203}.Debug|Any CPU.Build.0 = Debug|Any CPU {78746C71-867E-42C6-B729-DAAC3461E203}.Release|Any CPU.ActiveCfg = Release|Any CPU {78746C71-867E-42C6-B729-DAAC3461E203}.Release|Any CPU.Build.0 = Release|Any CPU + {04EA2E77-B6B0-48AA-888C-EB21876F6767}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {04EA2E77-B6B0-48AA-888C-EB21876F6767}.Debug|Any CPU.Build.0 = Debug|Any CPU + {04EA2E77-B6B0-48AA-888C-EB21876F6767}.Release|Any CPU.ActiveCfg = Release|Any CPU + {04EA2E77-B6B0-48AA-888C-EB21876F6767}.Release|Any CPU.Build.0 = Release|Any CPU + {FF6174C7-8429-4889-8E8E-98A908916B14}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FF6174C7-8429-4889-8E8E-98A908916B14}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FF6174C7-8429-4889-8E8E-98A908916B14}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FF6174C7-8429-4889-8E8E-98A908916B14}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {D8D99B4A-C3C1-4400-8FE3-829B98E986C2} + EndGlobalSection EndGlobal