From 85f7190756a535d75433cca1723b7ad51c20d5ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleksander=20Sja=CC=8Afjell?= Date: Fri, 17 Nov 2017 14:44:54 +0100 Subject: [PATCH 01/20] =?UTF-8?q?Legg=20til=20datatypes-xsd,=20og=20gj?= =?UTF-8?q?=C3=B8r=20kodegenerering?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For å kunne bruke samme script for generering av datatyper-klasser som for digipost-klasser så måtte vi dra ut felles metoder. Ganske smidig og fungerer bra så lenge scriptene ligger i samme mappe --- .../Digipost.Api.Client.Resources.csproj | 217 +- .../Xsd/Data/datatypes.xsd | 122 + .../Digipost.Api.Client.Xsd.csproj | 129 +- .../XsdToCode/Code/api_v7.cs | 6276 ++++++++--------- .../XsdToCode/Code/datatypes.cs | 804 +++ ...enerateClassesFromXs.ps1 => Functions.ps1} | 20 +- .../XsdToCode/GenerateDataTypesClasses.ps1 | 19 + .../XsdToCode/GennerateDigipostClasses.ps1 | 19 + 8 files changed, 4280 insertions(+), 3326 deletions(-) create mode 100644 Digipost.Api.Client.Resources/Xsd/Data/datatypes.xsd create mode 100755 Digipost.Api.Client.Scripts/XsdToCode/Code/datatypes.cs rename Digipost.Api.Client.Scripts/XsdToCode/{GenerateClassesFromXs.ps1 => Functions.ps1} (52%) create mode 100755 Digipost.Api.Client.Scripts/XsdToCode/GenerateDataTypesClasses.ps1 create mode 100755 Digipost.Api.Client.Scripts/XsdToCode/GennerateDigipostClasses.ps1 diff --git a/Digipost.Api.Client.Resources/Digipost.Api.Client.Resources.csproj b/Digipost.Api.Client.Resources/Digipost.Api.Client.Resources.csproj index a66c37af..88a11242 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/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.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..021072b6 100755 --- a/Digipost.Api.Client.Scripts/XsdToCode/Code/api_v7.cs +++ b/Digipost.Api.Client.Scripts/XsdToCode/Code/api_v7.cs @@ -1,3138 +1,3138 @@ -//------------------------------------------------------------------------------ -// -// 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 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; + } + } +} 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..0ed25487 --- /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 + "\GenerateClassesFromXsdFunctions.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 From c624e90ea3c72e0c4f2ab9a8153e44c53256140c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleksander=20Sja=CC=8Afjell?= Date: Tue, 21 Nov 2017 09:41:23 +0100 Subject: [PATCH 02/20] Legg til prosjekt for DataTypes --- .../Appointment/AppointmentAddress.cs | 25 +++++++ .../Appointment/ExternalLink.cs | 38 +++++++++++ .../Appointment/Info.cs | 10 +++ .../Digipost.Api.Client.DataTypes.csproj | 65 +++++++++++++++++++ Digipost.Api.Client.DataTypes/ExternalLink.cs | 32 +++++++++ .../Properties/AssemblyInfo.cs | 5 ++ digipost-api-client.sln | 13 +++- 7 files changed, 186 insertions(+), 2 deletions(-) create mode 100755 Digipost.Api.Client.DataTypes/Appointment/AppointmentAddress.cs create mode 100755 Digipost.Api.Client.DataTypes/Appointment/ExternalLink.cs create mode 100755 Digipost.Api.Client.DataTypes/Appointment/Info.cs create mode 100755 Digipost.Api.Client.DataTypes/Digipost.Api.Client.DataTypes.csproj create mode 100755 Digipost.Api.Client.DataTypes/ExternalLink.cs create mode 100755 Digipost.Api.Client.DataTypes/Properties/AssemblyInfo.cs diff --git a/Digipost.Api.Client.DataTypes/Appointment/AppointmentAddress.cs b/Digipost.Api.Client.DataTypes/Appointment/AppointmentAddress.cs new file mode 100755 index 00000000..f069e283 --- /dev/null +++ b/Digipost.Api.Client.DataTypes/Appointment/AppointmentAddress.cs @@ -0,0 +1,25 @@ +using System; + +namespace Digipost.Api.Client.DataTypes +{ + public class AppointmentAddress + { + public string StreetAddress { get; set; } + + public string PostalCode { get; set; } + + public string City { get; set; } + + /// + public AppointmentAddress(string postalCode, string city) : this(string.Empty, postalCode, city) + { + } + + public AppointmentAddress(string streetAddress, string postalCode, string city) + { + StreetAddress = streetAddress; + PostalCode = postalCode; + City = city; + } + } +} \ No newline at end of file diff --git a/Digipost.Api.Client.DataTypes/Appointment/ExternalLink.cs b/Digipost.Api.Client.DataTypes/Appointment/ExternalLink.cs new file mode 100755 index 00000000..43edb96c --- /dev/null +++ b/Digipost.Api.Client.DataTypes/Appointment/ExternalLink.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; + +namespace Digipost.Api.Client.DataTypes.Appointment +{ + public class Appointment + { + + 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. + /// + public String ArrivalTime { get; set; } + + /// + /// The name of the place. Example: Oslo City Røntgen + /// + public String Place { get; set; } + + public AppointmentAddress AppointmentAddress { get; set; } + + /// + /// Example: MR-undersøkelse av høyre kne + /// + public String SubTitle { get; set; } + + /// + /// Additional sections of information (max 2) with a title and text + /// + public List Info { get; set; } + } +} diff --git a/Digipost.Api.Client.DataTypes/Appointment/Info.cs b/Digipost.Api.Client.DataTypes/Appointment/Info.cs new file mode 100755 index 00000000..123b2906 --- /dev/null +++ b/Digipost.Api.Client.DataTypes/Appointment/Info.cs @@ -0,0 +1,10 @@ +namespace Digipost.Api.Client.DataTypes +{ + public class Info + { + public string Title { get; set; } + + public string Text { get; set; } + + } +} \ No newline at end of file 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..30bba891 --- /dev/null +++ b/Digipost.Api.Client.DataTypes/Digipost.Api.Client.DataTypes.csproj @@ -0,0 +1,65 @@ + + + + + Debug + AnyCPU + {04EA2E77-B6B0-48AA-888C-EB21876F6767} + Library + Properties + Digipost.Api.Client.DataTypes + Digipost.Api.Client.DataTypes + v4.6.1 + 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 + + + + + + + + + + \ 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..21f5de2b --- /dev/null +++ b/Digipost.Api.Client.DataTypes/ExternalLink.cs @@ -0,0 +1,32 @@ +using System; + +namespace Digipost.Api.Client.DataTypes +{ + public class ExternalLink + { + /// + /// 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. + /// + public String Description { get; set; } + + /// + /// Optional text which will be displayed on the button. + /// + public String ButtonText { get; set; } + + public ExternalLink(Uri url) + { + Url = url; + } + } +} diff --git a/Digipost.Api.Client.DataTypes/Properties/AssemblyInfo.cs b/Digipost.Api.Client.DataTypes/Properties/AssemblyInfo.cs new file mode 100755 index 00000000..24603b02 --- /dev/null +++ b/Digipost.Api.Client.DataTypes/Properties/AssemblyInfo.cs @@ -0,0 +1,5 @@ +using System.Reflection; +using System.Runtime.InteropServices; + +[assembly: AssemblyTitle("Digipost.Api.Client.DataTypes")] +[assembly: ComVisible(false)] \ No newline at end of file diff --git a/digipost-api-client.sln b/digipost-api-client.sln index 4d7f9ba6..7182eb5d 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 @@ -34,6 +34,8 @@ 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 Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -92,8 +94,15 @@ 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 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {D8D99B4A-C3C1-4400-8FE3-829B98E986C2} + EndGlobalSection EndGlobal From 5d72a41039f9ff73630ea7d9c0c5c8f23e371c22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleksander=20Sja=CC=8Afjell?= Date: Tue, 21 Nov 2017 10:05:56 +0100 Subject: [PATCH 03/20] Legg til oppdatert XSD for Digipost V7 --- .../Xsd/Data/api_v7.xsd | 36 +++++++++++-------- .../XsdToCode/Code/api_v7.cs | 13 +++++++ .../XsdToCode/GennerateDigipostClasses.ps1 | 2 +- 3 files changed, 35 insertions(+), 16 deletions(-) mode change 100755 => 100644 Digipost.Api.Client.Resources/Xsd/Data/api_v7.xsd 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.Scripts/XsdToCode/Code/api_v7.cs b/Digipost.Api.Client.Scripts/XsdToCode/Code/api_v7.cs index 021072b6..2da7f067 100755 --- a/Digipost.Api.Client.Scripts/XsdToCode/Code/api_v7.cs +++ b/Digipost.Api.Client.Scripts/XsdToCode/Code/api_v7.cs @@ -2376,6 +2376,8 @@ public partial class document { private link[] linkField; + private System.Xml.XmlElement datatypeField; + private string technicaltypeField; /// @@ -2519,6 +2521,17 @@ public link[] link { } } + /// + [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 { diff --git a/Digipost.Api.Client.Scripts/XsdToCode/GennerateDigipostClasses.ps1 b/Digipost.Api.Client.Scripts/XsdToCode/GennerateDigipostClasses.ps1 index 0ed25487..cce7264e 100755 --- a/Digipost.Api.Client.Scripts/XsdToCode/GennerateDigipostClasses.ps1 +++ b/Digipost.Api.Client.Scripts/XsdToCode/GennerateDigipostClasses.ps1 @@ -8,7 +8,7 @@ # If problems running script from network drive: # net use Z: `"\\vmware-host\Shared Folders` -$Functions = $PSScriptRoot + "\GenerateClassesFromXsdFunctions.ps1" +$Functions = $PSScriptRoot + "\Functions.ps1" . $Functions $CodeDir = Get-CodeDirectory From 1f98c2e31f11febc2eb5bd8546ab05c34cdaa56c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sindre=20Nordb=C3=B8?= Date: Tue, 21 Nov 2017 11:43:32 +0100 Subject: [PATCH 04/20] Serialiserer `DataType`-objekter sammen med `Document` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Innført en felles baseklasse for `ExternalLink` som er tenkt brukt for andre data-type-typer (🙃) som håndterer serialisering til XML. --- .../Properties/AssemblyInfo.cs | 1 + Digipost.Api.Client.DataTypes/DataType.cs | 20 +++++++++++++ .../Digipost.Api.Client.DataTypes.csproj | 15 ++++++++-- Digipost.Api.Client.DataTypes/ExternalLink.cs | 25 ++++++++++++++--- .../Properties/AssemblyInfo.cs | 5 +++- .../Digipost.Api.Client.Send.Tests.csproj | 4 +++ .../SendDataTransferObjectConverterTests.cs | 6 ++-- .../Digipost.Api.Client.Send.csproj | 4 +++ Digipost.Api.Client.Send/Document.cs | 28 +++++++++++++------ Digipost.Api.Client.Send/IDocument.cs | 3 ++ .../SendDataTransferObjectConverter.cs | 5 ++++ digipost-api-client.sln | 3 ++ 12 files changed, 102 insertions(+), 17 deletions(-) create mode 100755 Digipost.Api.Client.DataTypes/DataType.cs 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.DataTypes/DataType.cs b/Digipost.Api.Client.DataTypes/DataType.cs new file mode 100755 index 00000000..274df435 --- /dev/null +++ b/Digipost.Api.Client.DataTypes/DataType.cs @@ -0,0 +1,20 @@ +using System.Xml; +using Digipost.Api.Client.Common.Utilities; + +namespace Digipost.Api.Client.DataTypes +{ + public abstract class DataType + { + internal XmlElement Serialize() + { + var document = new XmlDocument(); + var serialized = SerializeUtil.Serialize(AsDataTransferObject()); + document.LoadXml(serialized); + return document.DocumentElement; + } + + protected abstract object AsDataTransferObject(); + + + } +} diff --git a/Digipost.Api.Client.DataTypes/Digipost.Api.Client.DataTypes.csproj b/Digipost.Api.Client.DataTypes/Digipost.Api.Client.DataTypes.csproj index 30bba891..d8292d45 100755 --- a/Digipost.Api.Client.DataTypes/Digipost.Api.Client.DataTypes.csproj +++ b/Digipost.Api.Client.DataTypes/Digipost.Api.Client.DataTypes.csproj @@ -9,8 +9,9 @@ Properties Digipost.Api.Client.DataTypes Digipost.Api.Client.DataTypes - v4.6.1 + v4.5 512 + true @@ -57,9 +58,19 @@ + - + + + {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 index 21f5de2b..97ff4f4a 100755 --- a/Digipost.Api.Client.DataTypes/ExternalLink.cs +++ b/Digipost.Api.Client.DataTypes/ExternalLink.cs @@ -2,7 +2,7 @@ namespace Digipost.Api.Client.DataTypes { - public class ExternalLink + public class ExternalLink : DataType { /// /// Target URL of this link. Must be http or https. @@ -12,21 +12,38 @@ public class ExternalLink /// /// Optional deadline for the user to respond. ISO8601 full DateTime. /// - public DateTime Deadline { get; set; } + public DateTime? Deadline { get; set; } /// /// A short, optional text-field, describing the external link. /// - public String Description { get; set; } + public string Description { get; set; } /// /// Optional text which will be displayed on the button. /// - public String ButtonText { get; set; } + public string ButtonText { get; set; } public ExternalLink(Uri url) { Url = url; } + + protected override object AsDataTransferObject() + { + var dto = new externalLink() + { + buttontext = ButtonText, + description = Description, + url = Url.AbsoluteUri + }; + if (Deadline.HasValue) + { + dto.deadline = Deadline.Value; + dto.deadlineSpecified = true; + } + return dto; + } + } } diff --git a/Digipost.Api.Client.DataTypes/Properties/AssemblyInfo.cs b/Digipost.Api.Client.DataTypes/Properties/AssemblyInfo.cs index 24603b02..901c5e47 100755 --- a/Digipost.Api.Client.DataTypes/Properties/AssemblyInfo.cs +++ b/Digipost.Api.Client.DataTypes/Properties/AssemblyInfo.cs @@ -1,5 +1,8 @@ using System.Reflection; +using System.Runtime.CompilerServices; using System.Runtime.InteropServices; [assembly: AssemblyTitle("Digipost.Api.Client.DataTypes")] -[assembly: ComVisible(false)] \ No newline at end of file +[assembly: ComVisible(false)] +[assembly: InternalsVisibleTo("Digipost.Api.Client.Send,PublicKey=0024000004800000940000000602000000240000525341310004000001000100316e4dede15e9c7abbb2af935ae2a983f3df3d04edf806ac01cba681ca15781bd969d78556a6f1edb79db27e4be9b205335fa73d0d6b8df239d5867540c55171fbf63aa667dc46e871e1399da71e38af47b46eca3d3830629979975ccd92eb1cb59fa6d21f95245106a3ee8853d43c2e9096f114fb7bc377661c60264dc064ad")] +[assembly: InternalsVisibleTo("Digipost.Api.Client.Send.Tests,PublicKey=0024000004800000940000000602000000240000525341310004000001000100316e4dede15e9c7abbb2af935ae2a983f3df3d04edf806ac01cba681ca15781bd969d78556a6f1edb79db27e4be9b205335fa73d0d6b8df239d5867540c55171fbf63aa667dc46e871e1399da71e38af47b46eca3d3830629979975ccd92eb1cb59fa6d21f95245106a3ee8853d43c2e9096f114fb7bc377661c60264dc064ad")] \ 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/SendDataTransferObjectConverterTests.cs b/Digipost.Api.Client.Send.Tests/SendDataTransferObjectConverterTests.cs index cab90463..775e1dcb 100755 --- a/Digipost.Api.Client.Send.Tests/SendDataTransferObjectConverterTests.cs +++ b/Digipost.Api.Client.Send.Tests/SendDataTransferObjectConverterTests.cs @@ -4,6 +4,7 @@ using Digipost.Api.Client.Common; using Digipost.Api.Client.Common.Enums; using Digipost.Api.Client.Common.Extensions; +using Digipost.Api.Client.DataTypes; using Digipost.Api.Client.Tests; using Digipost.Api.Client.Tests.CompareObjects; using Xunit; @@ -20,7 +21,7 @@ public class FromDataTransferObjectConverterMethod public void Document() { //Arrange - IDocument source = new Document("TestSubject", "txt", new byte[2], AuthenticationLevel.Password, SensitivityLevel.Sensitive, new SmsNotification(3)); + IDocument source = new Document("TestSubject", "txt", new byte[2], AuthenticationLevel.Password, SensitivityLevel.Sensitive, new SmsNotification(3), new ExternalLink(new Uri("https://digipost.no"))); var expectedDto = new document { subject = source.Subject, @@ -30,7 +31,8 @@ public void Document() sensitivitylevel = source.SensitivityLevel.ToSensitivityLevel(), sensitivitylevelSpecified = true, smsnotification = new smsnotification {afterhours = source.SmsNotification.NotifyAfterHours.ToArray()}, - uuid = source.Guid + uuid = source.Guid, + datatype = new ExternalLink(new Uri("https://digipost.no")).Serialize() }; //Act 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..4fe10999 100755 --- a/Digipost.Api.Client.Send/Document.cs +++ b/Digipost.Api.Client.Send/Document.cs @@ -1,6 +1,8 @@ -using System.IO; + +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 +14,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, DataType dataType = null) { Guid = System.Guid.NewGuid().ToString(); Subject = subject; @@ -21,6 +25,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 +34,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, DataType dataType = null) + : this(subject, fileType, new byte[] {}, authenticationLevel, sensitivityLevel, smsNotification, dataType) { ContentBytes = ReadAllBytes(documentStream); } @@ -41,8 +48,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, DataType dataType = null) + : this(subject, fileType, new byte[] {}, authenticationLevel, sensitivityLevel, smsNotification, dataType) { ContentBytes = ReadAllBytes(path); } @@ -52,9 +61,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, DataType dataType = null) + : this(subject, fileType, new byte[] {}, authenticationLevel, sensitivityLevel, smsNotification, dataType) { } @@ -83,5 +93,7 @@ internal virtual byte[] ReadAllBytes(Stream documentStream) { return File.ReadAllBytes(new StreamReader(documentStream).ReadToEnd()); } + + public DataType DataType { get; set; } } } diff --git a/Digipost.Api.Client.Send/IDocument.cs b/Digipost.Api.Client.Send/IDocument.cs index fd4f2b2f..cbe27893 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,7 @@ public interface IDocument /// The document encoded as a byte array. /// byte[] ContentBytes { get; set; } + + DataType 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.sln b/digipost-api-client.sln index 7182eb5d..b58d95fb 100755 --- a/digipost-api-client.sln +++ b/digipost-api-client.sln @@ -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 From be410df0fd3c03fe12441e8ef485470d56cadcda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sindre=20Nordb=C3=B8?= Date: Tue, 21 Nov 2017 11:51:32 +0100 Subject: [PATCH 05/20] Lagt til noen manglende referanser til det nye prosjektet --- .../Digipost.Api.Client.ConcurrencyTest.csproj | 4 ++++ Digipost.Api.Client.Docs/Digipost.Api.Client.Docs.csproj | 4 ++++ Digipost.Api.Client.Tests/Digipost.Api.Client.Tests.csproj | 4 ++++ 3 files changed, 12 insertions(+) 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.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.Tests/Digipost.Api.Client.Tests.csproj b/Digipost.Api.Client.Tests/Digipost.Api.Client.Tests.csproj index de8b0791..7cc19402 100755 --- a/Digipost.Api.Client.Tests/Digipost.Api.Client.Tests.csproj +++ b/Digipost.Api.Client.Tests/Digipost.Api.Client.Tests.csproj @@ -116,6 +116,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 From 4cdc52431f64579d23dfba749953a0e0ea3ecd7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sindre=20Nordb=C3=B8?= Date: Tue, 21 Nov 2017 14:20:22 +0100 Subject: [PATCH 06/20] =?UTF-8?q?Flytter=20serialisering=20til=20l=C3=B8vn?= =?UTF-8?q?ode-klassen=20i=20stedet=20for=20superklasse?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Serialiseringen må være «type-aware», så i stedet for å innføre generics og masse greier sørger heller den spesifikke datatypen for å oversette seg selv til XML. --- ...Digipost.Api.Client.DataTypes.Tests.csproj | 91 +++++++++++++++++++ .../ExternalLinkTests.cs | 39 ++++++++ .../Properties/AssemblyInfo.cs | 3 + .../packages.config | 10 ++ Digipost.Api.Client.DataTypes/DataType.cs | 13 +-- .../DataTypeSerialization.cs | 19 ++++ .../Digipost.Api.Client.DataTypes.csproj | 1 + Digipost.Api.Client.DataTypes/ExternalLink.cs | 10 +- .../SendDataTransferObjectConverterTests.cs | 5 +- Digipost.Api.Client.Send/Document.cs | 10 +- Digipost.Api.Client.Send/IDocument.cs | 2 +- .../Properties/AssemblyInfo.cs | 1 + digipost-api-client.sln | 6 ++ 13 files changed, 188 insertions(+), 22 deletions(-) create mode 100755 Digipost.Api.Client.DataTypes.Tests/Digipost.Api.Client.DataTypes.Tests.csproj create mode 100755 Digipost.Api.Client.DataTypes.Tests/ExternalLinkTests.cs create mode 100755 Digipost.Api.Client.DataTypes.Tests/Properties/AssemblyInfo.cs create mode 100755 Digipost.Api.Client.DataTypes.Tests/packages.config create mode 100755 Digipost.Api.Client.DataTypes/DataTypeSerialization.cs 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..ee2e336b --- /dev/null +++ b/Digipost.Api.Client.DataTypes.Tests/Digipost.Api.Client.DataTypes.Tests.csproj @@ -0,0 +1,91 @@ + + + + + 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\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..d3fa689a --- /dev/null +++ b/Digipost.Api.Client.DataTypes.Tests/ExternalLinkTests.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Digipost.Api.Client.Tests.CompareObjects; +using Xunit; + +namespace Digipost.Api.Client.DataTypes.Tests +{ + public class ExternalLinkTests + { + private static readonly Comparator Comparator = new Comparator(); + + [Fact] + public void AsDataTransferObject() + { + var now = DateTime.Now; + var expected = new ExternalLink(new Uri("https://digipost.no")) + { + ButtonText = "Click me", + Deadline = now, + Description = "Description" + }; + + var actual = new externalLink() + { + buttontext = "Click me", + deadline = now, + deadlineSpecified = true, + description = "Description", + url = "https://digipost.no" + }; + + Comparator.Equal(expected, actual, out var differences); + Assert.Empty(differences); + } + } +} 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/DataType.cs b/Digipost.Api.Client.DataTypes/DataType.cs index 274df435..14f2287c 100755 --- a/Digipost.Api.Client.DataTypes/DataType.cs +++ b/Digipost.Api.Client.DataTypes/DataType.cs @@ -3,18 +3,9 @@ namespace Digipost.Api.Client.DataTypes { - public abstract class DataType + public interface IDataType { - internal XmlElement Serialize() - { - var document = new XmlDocument(); - var serialized = SerializeUtil.Serialize(AsDataTransferObject()); - document.LoadXml(serialized); - return document.DocumentElement; - } - - protected abstract object AsDataTransferObject(); - + XmlElement Serialize(); } } diff --git a/Digipost.Api.Client.DataTypes/DataTypeSerialization.cs b/Digipost.Api.Client.DataTypes/DataTypeSerialization.cs new file mode 100755 index 00000000..2323300d --- /dev/null +++ b/Digipost.Api.Client.DataTypes/DataTypeSerialization.cs @@ -0,0 +1,19 @@ +using System; +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 index d8292d45..8f51597a 100755 --- a/Digipost.Api.Client.DataTypes/Digipost.Api.Client.DataTypes.csproj +++ b/Digipost.Api.Client.DataTypes/Digipost.Api.Client.DataTypes.csproj @@ -61,6 +61,7 @@ + diff --git a/Digipost.Api.Client.DataTypes/ExternalLink.cs b/Digipost.Api.Client.DataTypes/ExternalLink.cs index 97ff4f4a..63b460fc 100755 --- a/Digipost.Api.Client.DataTypes/ExternalLink.cs +++ b/Digipost.Api.Client.DataTypes/ExternalLink.cs @@ -1,8 +1,9 @@ using System; +using System.Xml; namespace Digipost.Api.Client.DataTypes { - public class ExternalLink : DataType + public class ExternalLink : IDataType { /// /// Target URL of this link. Must be http or https. @@ -29,7 +30,12 @@ public ExternalLink(Uri url) Url = url; } - protected override object AsDataTransferObject() + public XmlElement Serialize() + { + return DataTypeSerialization.Serialize(AsDataTransferObject()); + } + + protected externalLink AsDataTransferObject() { var dto = new externalLink() { diff --git a/Digipost.Api.Client.Send.Tests/SendDataTransferObjectConverterTests.cs b/Digipost.Api.Client.Send.Tests/SendDataTransferObjectConverterTests.cs index 775e1dcb..ce7ff0b3 100755 --- a/Digipost.Api.Client.Send.Tests/SendDataTransferObjectConverterTests.cs +++ b/Digipost.Api.Client.Send.Tests/SendDataTransferObjectConverterTests.cs @@ -21,7 +21,7 @@ public class FromDataTransferObjectConverterMethod public void Document() { //Arrange - IDocument source = new Document("TestSubject", "txt", new byte[2], AuthenticationLevel.Password, SensitivityLevel.Sensitive, new SmsNotification(3), new ExternalLink(new Uri("https://digipost.no"))); + IDocument source = new Document("TestSubject", "txt", new byte[2], AuthenticationLevel.Password, SensitivityLevel.Sensitive, new SmsNotification(3)); var expectedDto = new document { subject = source.Subject, @@ -31,8 +31,7 @@ public void Document() sensitivitylevel = source.SensitivityLevel.ToSensitivityLevel(), sensitivitylevelSpecified = true, smsnotification = new smsnotification {afterhours = source.SmsNotification.NotifyAfterHours.ToArray()}, - uuid = source.Guid, - datatype = new ExternalLink(new Uri("https://digipost.no")).Serialize() + uuid = source.Guid }; //Act diff --git a/Digipost.Api.Client.Send/Document.cs b/Digipost.Api.Client.Send/Document.cs index 4fe10999..1c6e5ee4 100755 --- a/Digipost.Api.Client.Send/Document.cs +++ b/Digipost.Api.Client.Send/Document.cs @@ -16,7 +16,7 @@ public class Document : IDocument /// Optional notification to receiver of message via SMS. /// 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, DataType dataType = null) + SensitivityLevel sensitivityLevel = SensitivityLevel.Normal, ISmsNotification smsNotification = null, IDataType dataType = null) { Guid = System.Guid.NewGuid().ToString(); Subject = subject; @@ -36,7 +36,7 @@ public Document(string subject, string fileType, byte[] contentBytes, Authentica /// Optional notification to receiver of message via SMS. /// 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, DataType dataType = null) + SensitivityLevel sensitivityLevel = SensitivityLevel.Normal, ISmsNotification smsNotification = null, IDataType dataType = null) : this(subject, fileType, new byte[] {}, authenticationLevel, sensitivityLevel, smsNotification, dataType) { ContentBytes = ReadAllBytes(documentStream); @@ -50,7 +50,7 @@ public Document(string subject, string fileType, Stream documentStream, Authenti /// Optional notification to receiver of message via SMS. /// 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, DataType dataType = null) + SensitivityLevel sensitivityLevel = SensitivityLevel.Normal, ISmsNotification smsNotification = null, IDataType dataType = null) : this(subject, fileType, new byte[] {}, authenticationLevel, sensitivityLevel, smsNotification, dataType) { ContentBytes = ReadAllBytes(path); @@ -63,7 +63,7 @@ public Document(string subject, string fileType, string path, AuthenticationLeve /// 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, DataType dataType = null) + SensitivityLevel sensitivityLevel = SensitivityLevel.Normal, ISmsNotification smsNotification = null, IDataType dataType = null) : this(subject, fileType, new byte[] {}, authenticationLevel, sensitivityLevel, smsNotification, dataType) { } @@ -94,6 +94,6 @@ internal virtual byte[] ReadAllBytes(Stream documentStream) return File.ReadAllBytes(new StreamReader(documentStream).ReadToEnd()); } - public DataType DataType { get; set; } + public IDataType DataType { get; set; } } } diff --git a/Digipost.Api.Client.Send/IDocument.cs b/Digipost.Api.Client.Send/IDocument.cs index cbe27893..1b792f9a 100755 --- a/Digipost.Api.Client.Send/IDocument.cs +++ b/Digipost.Api.Client.Send/IDocument.cs @@ -43,6 +43,6 @@ public interface IDocument /// byte[] ContentBytes { get; set; } - DataType DataType { get; set; } + IDataType DataType { get; set; } } } 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.sln b/digipost-api-client.sln index b58d95fb..a062781c 100755 --- a/digipost-api-client.sln +++ b/digipost-api-client.sln @@ -39,6 +39,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Digipost.Api.Client.Docs", 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 @@ -101,6 +103,10 @@ Global {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 From 2d93a75d46b71d7e48875a9f449a5a9f20c616c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sindre=20Nordb=C3=B8?= Date: Tue, 21 Nov 2017 14:29:04 +0100 Subject: [PATCH 07/20] =?UTF-8?q?Fjerner=20inlining=20som=20gj=C3=B8r=20at?= =?UTF-8?q?=20appveyor=20tryner?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Digipost.Api.Client.DataTypes.Tests/ExternalLinkTests.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Digipost.Api.Client.DataTypes.Tests/ExternalLinkTests.cs b/Digipost.Api.Client.DataTypes.Tests/ExternalLinkTests.cs index d3fa689a..85c21145 100755 --- a/Digipost.Api.Client.DataTypes.Tests/ExternalLinkTests.cs +++ b/Digipost.Api.Client.DataTypes.Tests/ExternalLinkTests.cs @@ -32,7 +32,8 @@ public void AsDataTransferObject() url = "https://digipost.no" }; - Comparator.Equal(expected, actual, out var differences); + IEnumerable differences; + Comparator.Equal(expected, actual, out differences); Assert.Empty(differences); } } From d2617ced044aaec5eff7f1939798600c37a760fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sindre=20Nordb=C3=B8?= Date: Tue, 21 Nov 2017 15:46:32 +0100 Subject: [PATCH 08/20] Legger til datatypes.xsd i XML-validator Uten denne feiler validering av XMLer som inkluderer en datatype. --- .../ApiClientXmlValidator.cs | 2 ++ Digipost.Api.Client.Common/Namespace.cs | 2 ++ .../Digipost.Api.Client.DataTypes.Tests.csproj | 3 +++ .../Digipost.Api.Client.Resources.csproj | 4 ++-- Digipost.Api.Client.Resources/Xsd/XsdResource.cs | 5 +++++ .../MessageActionTests.cs | 16 +++++++++++++++- Digipost.Api.Client.Tests/DomainUtility.cs | 15 ++++++++++++--- 7 files changed, 41 insertions(+), 6 deletions(-) diff --git a/Digipost.Api.Client.Common/ApiClientXmlValidator.cs b/Digipost.Api.Client.Common/ApiClientXmlValidator.cs index c2b0da62..ff6a0c1c 100755 --- a/Digipost.Api.Client.Common/ApiClientXmlValidator.cs +++ b/Digipost.Api.Client.Common/ApiClientXmlValidator.cs @@ -8,6 +8,8 @@ internal class ApiClientXmlValidator : XmlValidator public ApiClientXmlValidator() { AddXsd(Namespace.DigipostApiV7, XsdResource.GetApiV7Xsd()); + + AddXsd(Namespace.DataTypes, XsdResource.GetDataTypesXsd()); } } } diff --git a/Digipost.Api.Client.Common/Namespace.cs b/Digipost.Api.Client.Common/Namespace.cs index f7e1c242..5725672c 100755 --- a/Digipost.Api.Client.Common/Namespace.cs +++ b/Digipost.Api.Client.Common/Namespace.cs @@ -6,5 +6,7 @@ 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.DataTypes.Tests/Digipost.Api.Client.DataTypes.Tests.csproj b/Digipost.Api.Client.DataTypes.Tests/Digipost.Api.Client.DataTypes.Tests.csproj index ee2e336b..5be1b6ac 100755 --- a/Digipost.Api.Client.DataTypes.Tests/Digipost.Api.Client.DataTypes.Tests.csproj +++ b/Digipost.Api.Client.DataTypes.Tests/Digipost.Api.Client.DataTypes.Tests.csproj @@ -61,6 +61,9 @@ + + Properties\SharedAssemblyInfo.cs + diff --git a/Digipost.Api.Client.Resources/Digipost.Api.Client.Resources.csproj b/Digipost.Api.Client.Resources/Digipost.Api.Client.Resources.csproj index 88a11242..121a8eaa 100755 --- a/Digipost.Api.Client.Resources/Digipost.Api.Client.Resources.csproj +++ b/Digipost.Api.Client.Resources/Digipost.Api.Client.Resources.csproj @@ -96,9 +96,9 @@ signingkey.snk - + Designer - + 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.Send.Tests/MessageActionTests.cs b/Digipost.Api.Client.Send.Tests/MessageActionTests.cs index 562a8e8a..5404ae25 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,18 @@ 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(" Date: Tue, 21 Nov 2017 16:53:55 +0100 Subject: [PATCH 09/20] Konvertering av `Appointment` til XML-typer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I tillegg lagt til tilhørende tester, og fikset testen for konvertering av `ExternalLink`. Den forrige versjonen av testen gjorde ikke _faktisk_ konvertering 🤐 --- .../Appointment/AppointmentAddressTests.cs | 47 ++++++++ .../Appointment/AppointmentTests.cs | 74 +++++++++++++ .../Appointment/InfoTests.cs | 29 +++++ ...Digipost.Api.Client.DataTypes.Tests.csproj | 3 + .../ExternalLinkTests.cs | 3 +- .../{ExternalLink.cs => Appointment.cs} | 104 +++++++++++------- .../Appointment/AppointmentAddress.cs | 14 ++- .../Appointment/Info.cs | 15 +++ .../Digipost.Api.Client.DataTypes.csproj | 2 +- Digipost.Api.Client.DataTypes/ExternalLink.cs | 2 +- .../Properties/AssemblyInfo.cs | 5 +- 11 files changed, 254 insertions(+), 44 deletions(-) create mode 100755 Digipost.Api.Client.DataTypes.Tests/Appointment/AppointmentAddressTests.cs create mode 100755 Digipost.Api.Client.DataTypes.Tests/Appointment/AppointmentTests.cs create mode 100755 Digipost.Api.Client.DataTypes.Tests/Appointment/InfoTests.cs rename Digipost.Api.Client.DataTypes/Appointment/{ExternalLink.cs => Appointment.cs} (52%) 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..8644f2db --- /dev/null +++ b/Digipost.Api.Client.DataTypes.Tests/Appointment/AppointmentAddressTests.cs @@ -0,0 +1,47 @@ +using System.Collections.Generic; +using Digipost.Api.Client.Tests.CompareObjects; +using Xunit; + +namespace Digipost.Api.Client.DataTypes.Tests.Appointment +{ + public class AppointmentAddressTests + { + private static readonly Comparator Comparator = new Comparator(); + + [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" + }; + + IEnumerable differences; + Comparator.Equal(expected, actual, out differences); + Assert.Empty(differences); + } + + [Fact] + public void AsDataTransferObjectWithoutStreetAddress() + { + var expected = new AppointmentAddress("0001", "Oslo"); + + var actual = new appointmentAddress() + { + streetaddress = null, + postalcode = "0001", + city = "Oslo" + }; + + IEnumerable differences; + Comparator.Equal(expected, actual, out differences); + Assert.Empty(differences); + } + + } +} 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..f563a9ba --- /dev/null +++ b/Digipost.Api.Client.DataTypes.Tests/Appointment/AppointmentTests.cs @@ -0,0 +1,74 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Digipost.Api.Client.Tests.CompareObjects; +using Xunit; + +namespace Digipost.Api.Client.DataTypes.Tests.Appointment +{ + public class AppointmentTests + { + private static readonly Comparator Comparator = new Comparator(); + + [Fact] + public void AsDataTransferObject() + { + var now = DateTime.Parse("2017-11-21T13:00:00+01:00"); + 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 = "2017-11-21T13:00:00.0000000+01:00", + endtime = "2017-11-21T14:00:00.0000000+01:00", + arrivaltime = "15 minutes before", + address = address.AsDataTransferObject(), + info = new info[] + { + info.AsDataTransferObject() + }, + place = "Oslo City Røntgen", + subtitle = "SubTitle" + }; + + IEnumerable differences; + Comparator.Equal(expected, actual, out differences); + Assert.Empty(differences); + } + + [Fact] + public void AllowsOnlyRequiredParameters() + { + var now = DateTime.Parse("2017-11-21T13:00:00+01:00"); + + var source = new DataTypes.Appointment.Appointment(now); + var expected = source.AsDataTransferObject(); + + var actual = new appointment() + { + starttime = "2017-11-21T13:00:00.0000000+01:00", + }; + + IEnumerable differences; + Comparator.Equal(expected, actual, out differences); + Assert.Empty(differences); + } + + } +} 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..26e47526 --- /dev/null +++ b/Digipost.Api.Client.DataTypes.Tests/Appointment/InfoTests.cs @@ -0,0 +1,29 @@ +using System.Collections.Generic; +using Digipost.Api.Client.Tests.CompareObjects; +using Xunit; + +namespace Digipost.Api.Client.DataTypes.Tests.Appointment +{ + public class InfoTests + { + private static readonly Comparator Comparator = new Comparator(); + + [Fact] + public void AsDataTransferObject() + { + var source = new Info("Title", "Text"); + var expected = source.AsDataTransferObject(); + + var actual = new info() + { + title = "Title", + text = "Text", + }; + + IEnumerable differences; + Comparator.Equal(expected, actual, out differences); + Assert.Empty(differences); + } + + } +} 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 index 5be1b6ac..2c144879 100755 --- a/Digipost.Api.Client.DataTypes.Tests/Digipost.Api.Client.DataTypes.Tests.csproj +++ b/Digipost.Api.Client.DataTypes.Tests/Digipost.Api.Client.DataTypes.Tests.csproj @@ -64,6 +64,9 @@ Properties\SharedAssemblyInfo.cs + + + diff --git a/Digipost.Api.Client.DataTypes.Tests/ExternalLinkTests.cs b/Digipost.Api.Client.DataTypes.Tests/ExternalLinkTests.cs index 85c21145..1d4952e7 100755 --- a/Digipost.Api.Client.DataTypes.Tests/ExternalLinkTests.cs +++ b/Digipost.Api.Client.DataTypes.Tests/ExternalLinkTests.cs @@ -16,12 +16,13 @@ public class ExternalLinkTests public void AsDataTransferObject() { var now = DateTime.Now; - var expected = new ExternalLink(new Uri("https://digipost.no")) + var source = new ExternalLink(new Uri("https://digipost.no")) { ButtonText = "Click me", Deadline = now, Description = "Description" }; + var expected = source.AsDataTransferObject(); var actual = new externalLink() { diff --git a/Digipost.Api.Client.DataTypes/Appointment/ExternalLink.cs b/Digipost.Api.Client.DataTypes/Appointment/Appointment.cs similarity index 52% rename from Digipost.Api.Client.DataTypes/Appointment/ExternalLink.cs rename to Digipost.Api.Client.DataTypes/Appointment/Appointment.cs index 43edb96c..d5c52fd7 100755 --- a/Digipost.Api.Client.DataTypes/Appointment/ExternalLink.cs +++ b/Digipost.Api.Client.DataTypes/Appointment/Appointment.cs @@ -1,38 +1,66 @@ -using System; -using System.Collections.Generic; - -namespace Digipost.Api.Client.DataTypes.Appointment -{ - public class Appointment - { - - 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. - /// - public String ArrivalTime { get; set; } - - /// - /// The name of the place. Example: Oslo City Røntgen - /// - public String Place { get; set; } - - public AppointmentAddress AppointmentAddress { get; set; } - - /// - /// Example: MR-undersøkelse av høyre kne - /// - public String SubTitle { get; set; } - - /// - /// Additional sections of information (max 2) with a title and text - /// - public List Info { get; set; } - } -} +using System; +using System.Collections.Generic; +using System.Linq; +using System.Xml; + +namespace Digipost.Api.Client.DataTypes.Appointment +{ + public class Appointment : IDataType + { + + 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. + /// + public String ArrivalTime { get; set; } + + /// + /// The name of the place. Example: Oslo City Røntgen + /// + public String Place { get; set; } + + public AppointmentAddress AppointmentAddress { get; set; } + + /// + /// Example: MR-undersøkelse av høyre kne + /// + public String SubTitle { get; set; } + + /// w + /// Additional sections of information (max 2) with a title and text + /// + public List Info { get; set; } + + public Appointment(DateTime startTime) + { + StartTime = startTime; + } + + public XmlElement Serialize() + { + return DataTypeSerialization.Serialize(AsDataTransferObject()); + } + + protected 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; + } + + } +} diff --git a/Digipost.Api.Client.DataTypes/Appointment/AppointmentAddress.cs b/Digipost.Api.Client.DataTypes/Appointment/AppointmentAddress.cs index f069e283..f27ed60d 100755 --- a/Digipost.Api.Client.DataTypes/Appointment/AppointmentAddress.cs +++ b/Digipost.Api.Client.DataTypes/Appointment/AppointmentAddress.cs @@ -11,7 +11,7 @@ public class AppointmentAddress public string City { get; set; } /// - public AppointmentAddress(string postalCode, string city) : this(string.Empty, postalCode, city) + public AppointmentAddress(string postalCode, string city) : this(null, postalCode, city) { } @@ -21,5 +21,17 @@ public AppointmentAddress(string streetAddress, string postalCode, string city) PostalCode = postalCode; City = city; } + + internal appointmentAddress AsDataTransferObject() + { + return new appointmentAddress() + { + streetaddress = StreetAddress, + postalcode = PostalCode, + city = City + + }; + } + } } \ No newline at end of file diff --git a/Digipost.Api.Client.DataTypes/Appointment/Info.cs b/Digipost.Api.Client.DataTypes/Appointment/Info.cs index 123b2906..1448eb89 100755 --- a/Digipost.Api.Client.DataTypes/Appointment/Info.cs +++ b/Digipost.Api.Client.DataTypes/Appointment/Info.cs @@ -6,5 +6,20 @@ public class Info public string Text { get; set; } + public Info(string title, string text) + { + Title = title; + Text = text; + } + + internal info AsDataTransferObject() + { + return new info() + { + title = Title, + text = Text + }; + } + } } \ No newline at end of file diff --git a/Digipost.Api.Client.DataTypes/Digipost.Api.Client.DataTypes.csproj b/Digipost.Api.Client.DataTypes/Digipost.Api.Client.DataTypes.csproj index 8f51597a..61c305db 100755 --- a/Digipost.Api.Client.DataTypes/Digipost.Api.Client.DataTypes.csproj +++ b/Digipost.Api.Client.DataTypes/Digipost.Api.Client.DataTypes.csproj @@ -56,7 +56,7 @@ Properties\SharedAssemblyInfo.cs - + diff --git a/Digipost.Api.Client.DataTypes/ExternalLink.cs b/Digipost.Api.Client.DataTypes/ExternalLink.cs index 63b460fc..2984c219 100755 --- a/Digipost.Api.Client.DataTypes/ExternalLink.cs +++ b/Digipost.Api.Client.DataTypes/ExternalLink.cs @@ -35,7 +35,7 @@ public XmlElement Serialize() return DataTypeSerialization.Serialize(AsDataTransferObject()); } - protected externalLink AsDataTransferObject() + internal externalLink AsDataTransferObject() { var dto = new externalLink() { diff --git a/Digipost.Api.Client.DataTypes/Properties/AssemblyInfo.cs b/Digipost.Api.Client.DataTypes/Properties/AssemblyInfo.cs index 901c5e47..1fa236fc 100755 --- a/Digipost.Api.Client.DataTypes/Properties/AssemblyInfo.cs +++ b/Digipost.Api.Client.DataTypes/Properties/AssemblyInfo.cs @@ -4,5 +4,6 @@ [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")] \ No newline at end of file +[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")] \ No newline at end of file From 76a0be9b1aeb2b5c90dd014b69bcc46ab3ade3f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sindre=20Nordb=C3=B8?= Date: Tue, 21 Nov 2017 16:55:49 +0100 Subject: [PATCH 10/20] =?UTF-8?q?Litt=20for=20streng=20modifier=20?= =?UTF-8?q?=F0=9F=A4=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Digipost.Api.Client.DataTypes/Appointment/Appointment.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Digipost.Api.Client.DataTypes/Appointment/Appointment.cs b/Digipost.Api.Client.DataTypes/Appointment/Appointment.cs index d5c52fd7..e1ad4e7f 100755 --- a/Digipost.Api.Client.DataTypes/Appointment/Appointment.cs +++ b/Digipost.Api.Client.DataTypes/Appointment/Appointment.cs @@ -47,7 +47,7 @@ public XmlElement Serialize() return DataTypeSerialization.Serialize(AsDataTransferObject()); } - protected appointment AsDataTransferObject() + internal appointment AsDataTransferObject() { var dto = new appointment() { From 4253e95be3be5ad4cb0e0417599d7501dd47acef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sindre=20Nordb=C3=B8?= Date: Tue, 21 Nov 2017 17:02:37 +0100 Subject: [PATCH 11/20] =?UTF-8?q?Mangla=20en=20/=20p=C3=A5=20slutten=20av?= =?UTF-8?q?=20URLen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Digipost.Api.Client.DataTypes.Tests/ExternalLinkTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Digipost.Api.Client.DataTypes.Tests/ExternalLinkTests.cs b/Digipost.Api.Client.DataTypes.Tests/ExternalLinkTests.cs index 1d4952e7..c0cbc2d6 100755 --- a/Digipost.Api.Client.DataTypes.Tests/ExternalLinkTests.cs +++ b/Digipost.Api.Client.DataTypes.Tests/ExternalLinkTests.cs @@ -30,7 +30,7 @@ public void AsDataTransferObject() deadline = now, deadlineSpecified = true, description = "Description", - url = "https://digipost.no" + url = "https://digipost.no/" }; IEnumerable differences; From 3fdf21722648974f409ceb5324004f68e03a0dcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sindre=20Nordb=C3=B8?= Date: Wed, 22 Nov 2017 08:36:59 +0100 Subject: [PATCH 12/20] =?UTF-8?q?Endrer=20testene=20til=20=C3=A5=20bruke?= =?UTF-8?q?=20n=C3=A5tidspunkt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Byggserveren er ikke i samme tiddsone som oss, så `toString` gir ulik output. Men det er ikke så farlig, vi trenger tross alt ikke å teste at `toString("O")` funker. --- .../Appointment/AppointmentTests.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Digipost.Api.Client.DataTypes.Tests/Appointment/AppointmentTests.cs b/Digipost.Api.Client.DataTypes.Tests/Appointment/AppointmentTests.cs index f563a9ba..2957584a 100755 --- a/Digipost.Api.Client.DataTypes.Tests/Appointment/AppointmentTests.cs +++ b/Digipost.Api.Client.DataTypes.Tests/Appointment/AppointmentTests.cs @@ -15,7 +15,7 @@ public class AppointmentTests [Fact] public void AsDataTransferObject() { - var now = DateTime.Parse("2017-11-21T13:00:00+01:00"); + var now = DateTime.Now; var address = new AppointmentAddress("Gateveien 1", "0001", "Oslo"); var info = new Info("Title", "Very important information"); @@ -35,11 +35,11 @@ public void AsDataTransferObject() var actual = new appointment() { - starttime = "2017-11-21T13:00:00.0000000+01:00", - endtime = "2017-11-21T14:00:00.0000000+01:00", + starttime = now.ToString("O"), + endtime = now.AddHours(1).ToString("O"), arrivaltime = "15 minutes before", address = address.AsDataTransferObject(), - info = new info[] + info = new[] { info.AsDataTransferObject() }, @@ -55,14 +55,14 @@ public void AsDataTransferObject() [Fact] public void AllowsOnlyRequiredParameters() { - var now = DateTime.Parse("2017-11-21T13:00:00+01:00"); + var now = DateTime.Now; var source = new DataTypes.Appointment.Appointment(now); var expected = source.AsDataTransferObject(); var actual = new appointment() { - starttime = "2017-11-21T13:00:00.0000000+01:00", + starttime = now.ToString("O"), }; IEnumerable differences; From 62d09a5ac5445083ffd13579ea1da065f600a250 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sindre=20Nordb=C3=B8?= Date: Wed, 22 Nov 2017 09:59:54 +0100 Subject: [PATCH 13/20] =?UTF-8?q?Endret=20litt=20p=C3=A5=20abstraksjonen?= =?UTF-8?q?=20for=20sammenlikning=20av=20objekter?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Innført én metode som brukes over alt i stedet for at vi trenger gjenta de samme tre linjene til det kjedsommelige. Også endret litt på hva som sammenliknes slik at vi får bedre output når en test feiler. --- .../DataTransferObjectConverterTests.cs | 100 +++++------------- .../Print/PrintDetailsTests.cs | 8 +- .../Print/PrintRecipientTests.cs | 5 +- .../Print/PrintReturnRecipientTests.cs | 5 +- .../Appointment/AppointmentAddressTests.cs | 8 +- .../Appointment/AppointmentTests.cs | 8 +- .../Appointment/InfoTests.cs | 4 +- .../ExternalLinkTests.cs | 4 +- .../DataTransferObjectConverterTests.cs | 8 +- .../SendDataTransferObjectConverterTests.cs | 37 ++----- .../SmsNotificationTests.cs | 10 +- .../CompareObjects/Comparator.cs | 20 ++-- .../CompareObjects/Difference.cs | 7 +- .../CompareObjects/IComparator.cs | 11 -- .../CompareObjects/IDifference.cs | 13 --- .../Digipost.Api.Client.Tests.csproj | 2 - 16 files changed, 62 insertions(+), 188 deletions(-) delete mode 100755 Digipost.Api.Client.Tests/CompareObjects/IComparator.cs delete mode 100755 Digipost.Api.Client.Tests/CompareObjects/IDifference.cs diff --git a/Digipost.Api.Client.Common.Tests/DataTransferObjectConverterTests.cs b/Digipost.Api.Client.Common.Tests/DataTransferObjectConverterTests.cs index 74c73caf..ecf6690e 100755 --- a/Digipost.Api.Client.Common.Tests/DataTransferObjectConverterTests.cs +++ b/Digipost.Api.Client.Common.Tests/DataTransferObjectConverterTests.cs @@ -44,9 +44,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 +69,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 +94,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 +125,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 +165,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 +203,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 +221,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 +246,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 +277,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 +302,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 +326,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 +351,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 +376,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 +404,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 +458,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 +496,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 +524,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 +560,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 +588,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 +611,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 +649,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 +775,8 @@ 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 +800,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 +828,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..db463f33 100755 --- a/Digipost.Api.Client.Common.Tests/Print/PrintDetailsTests.cs +++ b/Digipost.Api.Client.Common.Tests/Print/PrintDetailsTests.cs @@ -24,13 +24,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..6a39ce09 100755 --- a/Digipost.Api.Client.Common.Tests/Print/PrintRecipientTests.cs +++ b/Digipost.Api.Client.Common.Tests/Print/PrintRecipientTests.cs @@ -27,10 +27,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..2fde1f88 100755 --- a/Digipost.Api.Client.Common.Tests/Print/PrintReturnRecipientTests.cs +++ b/Digipost.Api.Client.Common.Tests/Print/PrintReturnRecipientTests.cs @@ -25,10 +25,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.DataTypes.Tests/Appointment/AppointmentAddressTests.cs b/Digipost.Api.Client.DataTypes.Tests/Appointment/AppointmentAddressTests.cs index 8644f2db..77672e23 100755 --- a/Digipost.Api.Client.DataTypes.Tests/Appointment/AppointmentAddressTests.cs +++ b/Digipost.Api.Client.DataTypes.Tests/Appointment/AppointmentAddressTests.cs @@ -21,9 +21,7 @@ public void AsDataTransferObject() city = "Oslo" }; - IEnumerable differences; - Comparator.Equal(expected, actual, out differences); - Assert.Empty(differences); + Comparator.AssertEqual(expected, actual); } [Fact] @@ -38,9 +36,7 @@ public void AsDataTransferObjectWithoutStreetAddress() city = "Oslo" }; - IEnumerable differences; - Comparator.Equal(expected, actual, out differences); - Assert.Empty(differences); + Comparator.AssertEqual(expected, actual); } } diff --git a/Digipost.Api.Client.DataTypes.Tests/Appointment/AppointmentTests.cs b/Digipost.Api.Client.DataTypes.Tests/Appointment/AppointmentTests.cs index 2957584a..56934d1e 100755 --- a/Digipost.Api.Client.DataTypes.Tests/Appointment/AppointmentTests.cs +++ b/Digipost.Api.Client.DataTypes.Tests/Appointment/AppointmentTests.cs @@ -47,9 +47,7 @@ public void AsDataTransferObject() subtitle = "SubTitle" }; - IEnumerable differences; - Comparator.Equal(expected, actual, out differences); - Assert.Empty(differences); + Comparator.AssertEqual(expected, actual); } [Fact] @@ -65,9 +63,7 @@ public void AllowsOnlyRequiredParameters() starttime = now.ToString("O"), }; - IEnumerable differences; - Comparator.Equal(expected, actual, out differences); - Assert.Empty(differences); + Comparator.AssertEqual(expected, actual); } } diff --git a/Digipost.Api.Client.DataTypes.Tests/Appointment/InfoTests.cs b/Digipost.Api.Client.DataTypes.Tests/Appointment/InfoTests.cs index 26e47526..694b39c2 100755 --- a/Digipost.Api.Client.DataTypes.Tests/Appointment/InfoTests.cs +++ b/Digipost.Api.Client.DataTypes.Tests/Appointment/InfoTests.cs @@ -20,9 +20,7 @@ public void AsDataTransferObject() text = "Text", }; - IEnumerable differences; - Comparator.Equal(expected, actual, out differences); - Assert.Empty(differences); + Comparator.AssertEqual(expected, actual); } } diff --git a/Digipost.Api.Client.DataTypes.Tests/ExternalLinkTests.cs b/Digipost.Api.Client.DataTypes.Tests/ExternalLinkTests.cs index c0cbc2d6..bcb71504 100755 --- a/Digipost.Api.Client.DataTypes.Tests/ExternalLinkTests.cs +++ b/Digipost.Api.Client.DataTypes.Tests/ExternalLinkTests.cs @@ -33,9 +33,7 @@ public void AsDataTransferObject() url = "https://digipost.no/" }; - IEnumerable differences; - Comparator.Equal(expected, actual, out differences); - Assert.Empty(differences); + Comparator.AssertEqual(expected, actual); } } } diff --git a/Digipost.Api.Client.Inbox.Tests/DataTransferObjectConverterTests.cs b/Digipost.Api.Client.Inbox.Tests/DataTransferObjectConverterTests.cs index d263605f..4890166a 100755 --- a/Digipost.Api.Client.Inbox.Tests/DataTransferObjectConverterTests.cs +++ b/Digipost.Api.Client.Inbox.Tests/DataTransferObjectConverterTests.cs @@ -50,10 +50,8 @@ 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 +62,8 @@ 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.Send.Tests/SendDataTransferObjectConverterTests.cs b/Digipost.Api.Client.Send.Tests/SendDataTransferObjectConverterTests.cs index ce7ff0b3..546ba24a 100755 --- a/Digipost.Api.Client.Send.Tests/SendDataTransferObjectConverterTests.cs +++ b/Digipost.Api.Client.Send.Tests/SendDataTransferObjectConverterTests.cs @@ -38,9 +38,7 @@ public void Document() var actualDto = SendDataTransferObjectConverter.ToDataTransferObject(source); //Assert - IEnumerable differences; - Comparator.Equal(expectedDto, actualDto, out differences); - Assert.Equal(0, differences.Count()); + Comparator.AssertEqual(expectedDto, actualDto); } [Fact] @@ -83,9 +81,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] @@ -149,10 +145,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); } } @@ -183,10 +176,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] @@ -201,10 +191,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] @@ -222,10 +209,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] @@ -295,10 +279,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] @@ -322,9 +303,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..05478744 100755 --- a/Digipost.Api.Client.Send.Tests/SmsNotificationTests.cs +++ b/Digipost.Api.Client.Send.Tests/SmsNotificationTests.cs @@ -26,10 +26,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 +42,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.Tests/CompareObjects/Comparator.cs b/Digipost.Api.Client.Tests/CompareObjects/Comparator.cs index ad7d4a78..0c7dba35 100755 --- a/Digipost.Api.Client.Tests/CompareObjects/Comparator.cs +++ b/Digipost.Api.Client.Tests/CompareObjects/Comparator.cs @@ -1,20 +1,15 @@ using System.Collections.Generic; using System.Linq; using KellermanSoftware.CompareNetObjects; +using Xunit; namespace Digipost.Api.Client.Tests.CompareObjects { - internal class Comparator : IComparator + internal 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 +26,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 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 7cc19402..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 @@ - - From 4c94e15edac9302c9d982ee153df47844385b95d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sindre=20Nordb=C3=B8?= Date: Wed, 22 Nov 2017 11:34:08 +0100 Subject: [PATCH 14/20] Fikser formatteringsissues --- .../Print/PrintDetailsTests.cs | 4 +- .../Print/PrintRecipientTests.cs | 4 +- .../Print/PrintReturnRecipientTests.cs | 4 +- .../Exceptions/XmlParseException.cs | 2 +- .../Appointment/AppointmentAddressTests.cs | 8 ++-- .../Appointment/AppointmentTests.cs | 40 +++++++++---------- .../Appointment/InfoTests.cs | 8 ++-- .../ExternalLinkTests.cs | 6 +-- .../Appointment/Appointment.cs | 31 +++++++------- .../Appointment/AppointmentAddress.cs | 25 +++++------- .../Appointment/Info.cs | 13 +++--- Digipost.Api.Client.DataTypes/DataType.cs | 2 - .../DataTypeSerialization.cs | 5 +-- Digipost.Api.Client.DataTypes/ExternalLink.cs | 21 +++++----- .../Properties/AssemblyInfo.cs | 2 +- .../DataTransferObjectConverterTests.cs | 1 - .../MessageActionTests.cs | 1 - .../SendDataTransferObjectConverterTests.cs | 1 - .../SmsNotificationTests.cs | 1 - Digipost.Api.Client.Send/Document.cs | 13 +++--- Digipost.Api.Client.Tests/Smoke/TestHelper.cs | 2 + 21 files changed, 81 insertions(+), 113 deletions(-) diff --git a/Digipost.Api.Client.Common.Tests/Print/PrintDetailsTests.cs b/Digipost.Api.Client.Common.Tests/Print/PrintDetailsTests.cs index db463f33..0819b4a3 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; diff --git a/Digipost.Api.Client.Common.Tests/Print/PrintRecipientTests.cs b/Digipost.Api.Client.Common.Tests/Print/PrintRecipientTests.cs index 6a39ce09..d6493f32 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; diff --git a/Digipost.Api.Client.Common.Tests/Print/PrintReturnRecipientTests.cs b/Digipost.Api.Client.Common.Tests/Print/PrintReturnRecipientTests.cs index 2fde1f88..8ee4b951 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; 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.DataTypes.Tests/Appointment/AppointmentAddressTests.cs b/Digipost.Api.Client.DataTypes.Tests/Appointment/AppointmentAddressTests.cs index 77672e23..023c8b6e 100755 --- a/Digipost.Api.Client.DataTypes.Tests/Appointment/AppointmentAddressTests.cs +++ b/Digipost.Api.Client.DataTypes.Tests/Appointment/AppointmentAddressTests.cs @@ -1,5 +1,4 @@ -using System.Collections.Generic; -using Digipost.Api.Client.Tests.CompareObjects; +using Digipost.Api.Client.Tests.CompareObjects; using Xunit; namespace Digipost.Api.Client.DataTypes.Tests.Appointment @@ -14,7 +13,7 @@ public void AsDataTransferObject() var source = new AppointmentAddress("Gateveien 1", "0001", "Oslo"); var expected = source.AsDataTransferObject(); - var actual = new appointmentAddress() + var actual = new appointmentAddress { streetaddress = "Gateveien 1", postalcode = "0001", @@ -29,7 +28,7 @@ public void AsDataTransferObjectWithoutStreetAddress() { var expected = new AppointmentAddress("0001", "Oslo"); - var actual = new appointmentAddress() + var actual = new appointmentAddress { streetaddress = null, postalcode = "0001", @@ -38,6 +37,5 @@ public void AsDataTransferObjectWithoutStreetAddress() Comparator.AssertEqual(expected, actual); } - } } diff --git a/Digipost.Api.Client.DataTypes.Tests/Appointment/AppointmentTests.cs b/Digipost.Api.Client.DataTypes.Tests/Appointment/AppointmentTests.cs index 56934d1e..b9f82260 100755 --- a/Digipost.Api.Client.DataTypes.Tests/Appointment/AppointmentTests.cs +++ b/Digipost.Api.Client.DataTypes.Tests/Appointment/AppointmentTests.cs @@ -1,8 +1,5 @@ using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using Digipost.Api.Client.Tests.CompareObjects; using Xunit; @@ -12,6 +9,22 @@ public class AppointmentTests { private static readonly Comparator Comparator = new Comparator(); + [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() { @@ -24,7 +37,7 @@ public void AsDataTransferObject() EndTime = now.AddHours(1), AppointmentAddress = address, ArrivalTime = "15 minutes before", - Info = new List() + Info = new List { info }, @@ -33,7 +46,7 @@ public void AsDataTransferObject() }; var expected = source.AsDataTransferObject(); - var actual = new appointment() + var actual = new appointment { starttime = now.ToString("O"), endtime = now.AddHours(1).ToString("O"), @@ -49,22 +62,5 @@ public void AsDataTransferObject() Comparator.AssertEqual(expected, actual); } - - [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); - } - } } diff --git a/Digipost.Api.Client.DataTypes.Tests/Appointment/InfoTests.cs b/Digipost.Api.Client.DataTypes.Tests/Appointment/InfoTests.cs index 694b39c2..d5f53e92 100755 --- a/Digipost.Api.Client.DataTypes.Tests/Appointment/InfoTests.cs +++ b/Digipost.Api.Client.DataTypes.Tests/Appointment/InfoTests.cs @@ -1,5 +1,4 @@ -using System.Collections.Generic; -using Digipost.Api.Client.Tests.CompareObjects; +using Digipost.Api.Client.Tests.CompareObjects; using Xunit; namespace Digipost.Api.Client.DataTypes.Tests.Appointment @@ -14,14 +13,13 @@ public void AsDataTransferObject() var source = new Info("Title", "Text"); var expected = source.AsDataTransferObject(); - var actual = new info() + var actual = new info { title = "Title", - text = "Text", + text = "Text" }; Comparator.AssertEqual(expected, actual); } - } } diff --git a/Digipost.Api.Client.DataTypes.Tests/ExternalLinkTests.cs b/Digipost.Api.Client.DataTypes.Tests/ExternalLinkTests.cs index bcb71504..d9c945ee 100755 --- a/Digipost.Api.Client.DataTypes.Tests/ExternalLinkTests.cs +++ b/Digipost.Api.Client.DataTypes.Tests/ExternalLinkTests.cs @@ -1,8 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using Digipost.Api.Client.Tests.CompareObjects; using Xunit; @@ -24,7 +20,7 @@ public void AsDataTransferObject() }; var expected = source.AsDataTransferObject(); - var actual = new externalLink() + var actual = new externalLink { buttontext = "Click me", deadline = now, diff --git a/Digipost.Api.Client.DataTypes/Appointment/Appointment.cs b/Digipost.Api.Client.DataTypes/Appointment/Appointment.cs index e1ad4e7f..1ed4821e 100755 --- a/Digipost.Api.Client.DataTypes/Appointment/Appointment.cs +++ b/Digipost.Api.Client.DataTypes/Appointment/Appointment.cs @@ -7,41 +7,41 @@ 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 . + /// 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. + /// Free text but can contain ISO8601 formatted date and time. Example: Please arrive 15 minutes early. /// - public String ArrivalTime { get; set; } + public string ArrivalTime { get; set; } /// - /// The name of the place. Example: Oslo City Røntgen + /// The name of the place. Example: Oslo City Røntgen /// - public String Place { get; set; } + public string Place { get; set; } public AppointmentAddress AppointmentAddress { get; set; } /// - /// Example: MR-undersøkelse av høyre kne + /// Example: MR-undersøkelse av høyre kne /// - public String SubTitle { get; set; } + public string SubTitle { get; set; } - /// w - /// Additional sections of information (max 2) with a title and text + /// + /// w + /// Additional sections of information (max 2) with a title and text /// public List Info { get; set; } - public Appointment(DateTime startTime) - { - StartTime = startTime; - } - public XmlElement Serialize() { return DataTypeSerialization.Serialize(AsDataTransferObject()); @@ -49,7 +49,7 @@ public XmlElement Serialize() internal appointment AsDataTransferObject() { - var dto = new appointment() + var dto = new appointment { starttime = StartTime.ToString("O"), arrivaltime = ArrivalTime, @@ -61,6 +61,5 @@ internal appointment AsDataTransferObject() }; return dto; } - } } diff --git a/Digipost.Api.Client.DataTypes/Appointment/AppointmentAddress.cs b/Digipost.Api.Client.DataTypes/Appointment/AppointmentAddress.cs index f27ed60d..8d71bb2a 100755 --- a/Digipost.Api.Client.DataTypes/Appointment/AppointmentAddress.cs +++ b/Digipost.Api.Client.DataTypes/Appointment/AppointmentAddress.cs @@ -1,17 +1,10 @@ -using System; - -namespace Digipost.Api.Client.DataTypes +namespace Digipost.Api.Client.DataTypes { public class AppointmentAddress { - public string StreetAddress { get; set; } - - public string PostalCode { get; set; } - - public string City { get; set; } - /// - public AppointmentAddress(string postalCode, string city) : this(null, postalCode, city) + public AppointmentAddress(string postalCode, string city) + : this(null, postalCode, city) { } @@ -22,16 +15,20 @@ public AppointmentAddress(string streetAddress, string postalCode, string city) City = city; } + public string StreetAddress { get; set; } + + public string PostalCode { get; set; } + + public string City { get; set; } + internal appointmentAddress AsDataTransferObject() { - return new appointmentAddress() + return new appointmentAddress { streetaddress = StreetAddress, postalcode = PostalCode, city = City - }; } - } -} \ No newline at end of file +} diff --git a/Digipost.Api.Client.DataTypes/Appointment/Info.cs b/Digipost.Api.Client.DataTypes/Appointment/Info.cs index 1448eb89..3a8692bf 100755 --- a/Digipost.Api.Client.DataTypes/Appointment/Info.cs +++ b/Digipost.Api.Client.DataTypes/Appointment/Info.cs @@ -2,24 +2,23 @@ { public class Info { - public string Title { get; set; } - - public string Text { get; set; } - public Info(string title, string text) { Title = title; Text = text; } + public string Title { get; set; } + + public string Text { get; set; } + internal info AsDataTransferObject() { - return new info() + return new info { title = Title, text = Text }; } - } -} \ No newline at end of file +} diff --git a/Digipost.Api.Client.DataTypes/DataType.cs b/Digipost.Api.Client.DataTypes/DataType.cs index 14f2287c..652ea09d 100755 --- a/Digipost.Api.Client.DataTypes/DataType.cs +++ b/Digipost.Api.Client.DataTypes/DataType.cs @@ -1,11 +1,9 @@ using System.Xml; -using Digipost.Api.Client.Common.Utilities; 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 index 2323300d..74fecb5b 100755 --- a/Digipost.Api.Client.DataTypes/DataTypeSerialization.cs +++ b/Digipost.Api.Client.DataTypes/DataTypeSerialization.cs @@ -1,12 +1,10 @@ -using System; -using System.Xml; +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(); @@ -14,6 +12,5 @@ internal static XmlElement Serialize(T data) document.LoadXml(serialized); return document.DocumentElement; } - } } diff --git a/Digipost.Api.Client.DataTypes/ExternalLink.cs b/Digipost.Api.Client.DataTypes/ExternalLink.cs index 2984c219..a66508f8 100755 --- a/Digipost.Api.Client.DataTypes/ExternalLink.cs +++ b/Digipost.Api.Client.DataTypes/ExternalLink.cs @@ -5,31 +5,31 @@ 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. + /// 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. + /// Optional deadline for the user to respond. ISO8601 full DateTime. /// public DateTime? Deadline { get; set; } /// - /// A short, optional text-field, describing the external link. + /// A short, optional text-field, describing the external link. /// public string Description { get; set; } /// - /// Optional text which will be displayed on the button. + /// Optional text which will be displayed on the button. /// public string ButtonText { get; set; } - public ExternalLink(Uri url) - { - Url = url; - } - public XmlElement Serialize() { return DataTypeSerialization.Serialize(AsDataTransferObject()); @@ -37,7 +37,7 @@ public XmlElement Serialize() internal externalLink AsDataTransferObject() { - var dto = new externalLink() + var dto = new externalLink { buttontext = ButtonText, description = Description, @@ -50,6 +50,5 @@ internal externalLink AsDataTransferObject() } return dto; } - } } diff --git a/Digipost.Api.Client.DataTypes/Properties/AssemblyInfo.cs b/Digipost.Api.Client.DataTypes/Properties/AssemblyInfo.cs index 1fa236fc..5ee45bf1 100755 --- a/Digipost.Api.Client.DataTypes/Properties/AssemblyInfo.cs +++ b/Digipost.Api.Client.DataTypes/Properties/AssemblyInfo.cs @@ -6,4 +6,4 @@ [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")] \ No newline at end of file +[assembly: InternalsVisibleTo("Digipost.Api.Client.DataTypes.Tests,PublicKey=0024000004800000940000000602000000240000525341310004000001000100316e4dede15e9c7abbb2af935ae2a983f3df3d04edf806ac01cba681ca15781bd969d78556a6f1edb79db27e4be9b205335fa73d0d6b8df239d5867540c55171fbf63aa667dc46e871e1399da71e38af47b46eca3d3830629979975ccd92eb1cb59fa6d21f95245106a3ee8853d43c2e9096f114fb7bc377661c60264dc064ad")] diff --git a/Digipost.Api.Client.Inbox.Tests/DataTransferObjectConverterTests.cs b/Digipost.Api.Client.Inbox.Tests/DataTransferObjectConverterTests.cs index 4890166a..2ddf849a 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; diff --git a/Digipost.Api.Client.Send.Tests/MessageActionTests.cs b/Digipost.Api.Client.Send.Tests/MessageActionTests.cs index 5404ae25..65e3bbd1 100755 --- a/Digipost.Api.Client.Send.Tests/MessageActionTests.cs +++ b/Digipost.Api.Client.Send.Tests/MessageActionTests.cs @@ -35,7 +35,6 @@ public void SerializedXmlContainsDataType() Assert.Contains("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) + : this(subject, fileType, new byte[] { }, authenticationLevel, sensitivityLevel, smsNotification, dataType) { ContentBytes = ReadAllBytes(documentStream); } @@ -51,7 +50,7 @@ public Document(string subject, string fileType, Stream documentStream, Authenti /// 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) + : this(subject, fileType, new byte[] { }, authenticationLevel, sensitivityLevel, smsNotification, dataType) { ContentBytes = ReadAllBytes(path); } @@ -64,7 +63,7 @@ public Document(string subject, string fileType, string path, AuthenticationLeve /// 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, IDataType dataType = null) - : this(subject, fileType, new byte[] {}, authenticationLevel, sensitivityLevel, smsNotification, dataType) + : this(subject, fileType, new byte[] { }, authenticationLevel, sensitivityLevel, smsNotification, dataType) { } @@ -84,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); @@ -93,7 +94,5 @@ internal virtual byte[] ReadAllBytes(Stream documentStream) { return File.ReadAllBytes(new StreamReader(documentStream).ReadToEnd()); } - - public IDataType DataType { get; set; } } } 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 From 430da06619876390a4aea938225add66311d1df2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sindre=20Nordb=C3=B8?= Date: Wed, 22 Nov 2017 11:53:15 +0100 Subject: [PATCH 15/20] =?UTF-8?q?Gj=C3=B8r=20`Comparator`=20`static`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Det er ikke noe poeng å instansiere den opp når medlemsvariabelen ikke var i bruk uansett. --- .../DataTransferObjectConverterTests.cs | 51 +++++++++---------- .../Print/PrintDetailsTests.cs | 6 +-- .../Print/PrintRecipientTests.cs | 4 +- .../Print/PrintReturnRecipientTests.cs | 4 +- .../Appointment/AppointmentAddressTests.cs | 2 - .../Appointment/AppointmentTests.cs | 2 - .../Appointment/InfoTests.cs | 2 - .../ExternalLinkTests.cs | 2 - .../DataTransferObjectConverterTests.cs | 6 +-- .../SendDataTransferObjectConverterTests.cs | 2 - .../SmsNotificationTests.cs | 6 +-- .../CompareObjects/Comparator.cs | 6 +-- 12 files changed, 34 insertions(+), 59 deletions(-) diff --git a/Digipost.Api.Client.Common.Tests/DataTransferObjectConverterTests.cs b/Digipost.Api.Client.Common.Tests/DataTransferObjectConverterTests.cs index ecf6690e..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,7 +42,7 @@ public void ForeignAddress() var actualDto = DataTransferObjectConverter.ToDataTransferObject(source); //Assert - _comparator.AssertEqual(expectedDto, actualDto); + Comparator.AssertEqual(expectedDto, actualDto); } [Fact] @@ -69,7 +67,7 @@ public void IdentificationByAddressReturnsDigipostResultWithDigipostAddressResul var actual = DataTransferObjectConverter.FromDataTransferObject(source); //Assert - _comparator.AssertEqual(expected, actual); + Comparator.AssertEqual(expected, actual); } [Fact] @@ -94,7 +92,7 @@ public void IdentificationByAddressReturnsIdentifiedResultWithPersonalAliasResul var actual = DataTransferObjectConverter.FromDataTransferObject(source); //Assert - _comparator.AssertEqual(expected, actual); + Comparator.AssertEqual(expected, actual); } [Fact] @@ -125,7 +123,7 @@ public void IdentificationByAddressReturnsUnidentifiedResultWithUnidentifiedReas var actual = DataTransferObjectConverter.FromDataTransferObject(source); //Assert - _comparator.AssertEqual(expected, actual); + Comparator.AssertEqual(expected, actual); } [Fact] @@ -165,7 +163,7 @@ public void IdentificationByNameAndAddress() var actualDto = DataTransferObjectConverter.ToDataTransferObject(source); //Assert - _comparator.AssertEqual(expectedDto, actualDto); + Comparator.AssertEqual(expectedDto, actualDto); } [Fact] @@ -203,7 +201,7 @@ public void IdentificationByNameAndAddressAcceptsNoBirthDate() var actualDto = DataTransferObjectConverter.ToDataTransferObject(source); //Assert - _comparator.AssertEqual(expectedDto, actualDto); + Comparator.AssertEqual(expectedDto, actualDto); } [Fact] @@ -221,7 +219,7 @@ public void IdentificationByOrganizationNumber() var actualDto = DataTransferObjectConverter.ToDataTransferObject(source); //Assert - _comparator.AssertEqual(expectedDto, actualDto); + Comparator.AssertEqual(expectedDto, actualDto); } [Fact] @@ -246,7 +244,7 @@ public void IdentificationByOrganizationNumberReturnsDigipostResultWithDigipostA var actual = DataTransferObjectConverter.FromDataTransferObject(source); //Assert - _comparator.AssertEqual(expected, actual); + Comparator.AssertEqual(expected, actual); } [Fact] @@ -277,7 +275,7 @@ public void IdentificationByOrganizationNumberReturnsInvalidResultWithInvalidRea var actual = DataTransferObjectConverter.FromDataTransferObject(source); //Assert - _comparator.AssertEqual(expected, actual); + Comparator.AssertEqual(expected, actual); } [Fact] @@ -302,7 +300,7 @@ public void IdentificationByOrganizationNumberReturnsUnidentifiedResultWithUnide var actual = DataTransferObjectConverter.FromDataTransferObject(source); //Assert - _comparator.AssertEqual(expected, actual); + Comparator.AssertEqual(expected, actual); } [Fact] @@ -326,7 +324,7 @@ public void IdentificationByPinReturnsDigipostResultWithNoneResultType() var actual = DataTransferObjectConverter.FromDataTransferObject(source); //Assert - _comparator.AssertEqual(expected, actual); + Comparator.AssertEqual(expected, actual); } [Fact] @@ -351,7 +349,7 @@ public void IdentificationByPinReturnsIdentifiedResultWithNoneResultType() var actual = DataTransferObjectConverter.FromDataTransferObject(source); //Assert - _comparator.AssertEqual(expected, actual); + Comparator.AssertEqual(expected, actual); } [Fact] @@ -376,7 +374,7 @@ public void IdentificationByPinReturnsInvalidResultWithInvalidReason() var actual = DataTransferObjectConverter.FromDataTransferObject(source); //Assert - _comparator.AssertEqual(expected, actual); + Comparator.AssertEqual(expected, actual); } [Fact] @@ -404,7 +402,7 @@ public void NorwegianAddress() var actualDto = DataTransferObjectConverter.ToDataTransferObject(source); //Assert - _comparator.AssertEqual(expectedDto, actualDto); + Comparator.AssertEqual(expectedDto, actualDto); } [Fact] @@ -458,7 +456,7 @@ public void PrintDetails() var actualDto = DataTransferObjectConverter.ToDataTransferObject(source); //Assert - _comparator.AssertEqual(expectedDto, actualDto); + Comparator.AssertEqual(expectedDto, actualDto); Assert.Null(DataTransferObjectConverter.ToDataTransferObject((IPrintDetails) null)); } @@ -496,7 +494,7 @@ public void PrintRecipientFromForeignAddress() var actualDto = DataTransferObjectConverter.ToDataTransferObject(source); //Assert - _comparator.AssertEqual(expectedDto, actualDto); + Comparator.AssertEqual(expectedDto, actualDto); } [Fact] @@ -524,7 +522,7 @@ public void PrintRecipientFromNorwegianAddress() var actualDto = DataTransferObjectConverter.ToDataTransferObject(source); //Assert - _comparator.AssertEqual(expectedDto, actualDto); + Comparator.AssertEqual(expectedDto, actualDto); } [Fact] @@ -560,7 +558,7 @@ public void PrintReturnRecipientFromForeignAddress() var actualDto = DataTransferObjectConverter.ToDataTransferObject(source); //Assert - _comparator.AssertEqual(expectedDto, actualDto); + Comparator.AssertEqual(expectedDto, actualDto); } [Fact] @@ -588,7 +586,7 @@ public void PrintReturnRecipientFromNorwegianAddress() var actualDto = DataTransferObjectConverter.ToDataTransferObject(source); //Assert - _comparator.AssertEqual(expectedDto, actualDto); + Comparator.AssertEqual(expectedDto, actualDto); } [Fact] @@ -611,7 +609,7 @@ public void RecipientById() var actualDto = DataTransferObjectConverter.ToDataTransferObject(source); //Assert - _comparator.AssertEqual(expectedDto, actualDto); + Comparator.AssertEqual(expectedDto, actualDto); } [Fact] @@ -649,7 +647,7 @@ public void RecipientByNameAndAddress() var actualDto = DataTransferObjectConverter.ToDataTransferObject(source); //Assert - _comparator.AssertEqual(expectedDto, actualDto); + Comparator.AssertEqual(expectedDto, actualDto); } [Fact] @@ -775,8 +773,7 @@ public void SearchResult() var actual = DataTransferObjectConverter.FromDataTransferObject(source); //Assert - var comparator = new Comparator {ComparisonConfiguration = new ComparisonConfiguration {IgnoreObjectTypes = true}}; - comparator.AssertEqual(expected, actual); + Comparator.AssertEqual(expected, actual); } [Fact] @@ -800,7 +797,7 @@ public void SmsNotification() var actual = DataTransferObjectConverter.ToDataTransferObject(source); //Assert - _comparator.AssertEqual(expectedDto, actual); + Comparator.AssertEqual(expectedDto, actual); } } @@ -828,7 +825,7 @@ public void Error() var actual = DataTransferObjectConverter.FromDataTransferObject(source); //Assert - _comparator.AssertEqual(expected, actual); + 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 0819b4a3..fdefc052 100755 --- a/Digipost.Api.Client.Common.Tests/Print/PrintDetailsTests.cs +++ b/Digipost.Api.Client.Common.Tests/Print/PrintDetailsTests.cs @@ -10,8 +10,6 @@ public class PrintDetailsTests { public class ConstructorMethod : PrintDetailsTests { - private readonly Comparator _comparator = new Comparator(); - [Fact] public void SimpleConstructor() { @@ -22,9 +20,9 @@ public void SimpleConstructor() //Act //Assert - _comparator.AssertEqual(DomainUtility.GetPrintRecipientWithNorwegianAddress(), printDetails.PrintRecipient); + Comparator.AssertEqual(DomainUtility.GetPrintRecipientWithNorwegianAddress(), printDetails.PrintRecipient); - _comparator.AssertEqual(DomainUtility.GetPrintReturnRecipientWithNorwegianAddress(), printDetails.PrintReturnRecipient); + 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 d6493f32..b7ade46c 100755 --- a/Digipost.Api.Client.Common.Tests/Print/PrintRecipientTests.cs +++ b/Digipost.Api.Client.Common.Tests/Print/PrintRecipientTests.cs @@ -10,8 +10,6 @@ public class PrintRecipientTests public class ConstructorMethod : PrintRecipientTests { - private readonly Comparator _comparator = new Comparator(); - [Fact] public void SimpleConstructor() { @@ -25,7 +23,7 @@ public void SimpleConstructor() //Assert Assert.Equal(name, printRecipient.Name); - _comparator.AssertEqual(DomainUtility.GetNorwegianAddress(), printRecipient.Address); + 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 8ee4b951..c6ebd476 100755 --- a/Digipost.Api.Client.Common.Tests/Print/PrintReturnRecipientTests.cs +++ b/Digipost.Api.Client.Common.Tests/Print/PrintReturnRecipientTests.cs @@ -9,8 +9,6 @@ public class PrintReturnRecipientTests { public class ConstructorMethod : PrintReturnRecipientTests { - private readonly Comparator _comparator = new Comparator(); - [Fact] public void SimpleConstructor() { @@ -23,7 +21,7 @@ public void SimpleConstructor() //Assert Assert.Equal(name, printRecipient.Name); - _comparator.AssertEqual(DomainUtility.GetNorwegianAddress(), printRecipient.Address); + Comparator.AssertEqual(DomainUtility.GetNorwegianAddress(), printRecipient.Address); } } } diff --git a/Digipost.Api.Client.DataTypes.Tests/Appointment/AppointmentAddressTests.cs b/Digipost.Api.Client.DataTypes.Tests/Appointment/AppointmentAddressTests.cs index 023c8b6e..8b2c285f 100755 --- a/Digipost.Api.Client.DataTypes.Tests/Appointment/AppointmentAddressTests.cs +++ b/Digipost.Api.Client.DataTypes.Tests/Appointment/AppointmentAddressTests.cs @@ -5,8 +5,6 @@ namespace Digipost.Api.Client.DataTypes.Tests.Appointment { public class AppointmentAddressTests { - private static readonly Comparator Comparator = new Comparator(); - [Fact] public void AsDataTransferObject() { diff --git a/Digipost.Api.Client.DataTypes.Tests/Appointment/AppointmentTests.cs b/Digipost.Api.Client.DataTypes.Tests/Appointment/AppointmentTests.cs index b9f82260..28f37e9f 100755 --- a/Digipost.Api.Client.DataTypes.Tests/Appointment/AppointmentTests.cs +++ b/Digipost.Api.Client.DataTypes.Tests/Appointment/AppointmentTests.cs @@ -7,8 +7,6 @@ namespace Digipost.Api.Client.DataTypes.Tests.Appointment { public class AppointmentTests { - private static readonly Comparator Comparator = new Comparator(); - [Fact] public void AllowsOnlyRequiredParameters() { diff --git a/Digipost.Api.Client.DataTypes.Tests/Appointment/InfoTests.cs b/Digipost.Api.Client.DataTypes.Tests/Appointment/InfoTests.cs index d5f53e92..095aa59d 100755 --- a/Digipost.Api.Client.DataTypes.Tests/Appointment/InfoTests.cs +++ b/Digipost.Api.Client.DataTypes.Tests/Appointment/InfoTests.cs @@ -5,8 +5,6 @@ namespace Digipost.Api.Client.DataTypes.Tests.Appointment { public class InfoTests { - private static readonly Comparator Comparator = new Comparator(); - [Fact] public void AsDataTransferObject() { diff --git a/Digipost.Api.Client.DataTypes.Tests/ExternalLinkTests.cs b/Digipost.Api.Client.DataTypes.Tests/ExternalLinkTests.cs index d9c945ee..16f972d0 100755 --- a/Digipost.Api.Client.DataTypes.Tests/ExternalLinkTests.cs +++ b/Digipost.Api.Client.DataTypes.Tests/ExternalLinkTests.cs @@ -6,8 +6,6 @@ namespace Digipost.Api.Client.DataTypes.Tests { public class ExternalLinkTests { - private static readonly Comparator Comparator = new Comparator(); - [Fact] public void AsDataTransferObject() { diff --git a/Digipost.Api.Client.Inbox.Tests/DataTransferObjectConverterTests.cs b/Digipost.Api.Client.Inbox.Tests/DataTransferObjectConverterTests.cs index 2ddf849a..a8feaa55 100755 --- a/Digipost.Api.Client.Inbox.Tests/DataTransferObjectConverterTests.cs +++ b/Digipost.Api.Client.Inbox.Tests/DataTransferObjectConverterTests.cs @@ -49,8 +49,7 @@ public void InboxDocument() var actual = InboxDataTransferObjectConverter.FromDataTransferObject(source); - var comparator = new Comparator {ComparisonConfiguration = new ComparisonConfiguration {IgnoreObjectTypes = true}}; - comparator.AssertEqual(expected, actual); + Comparator.AssertEqual(expected, actual); } [Fact] @@ -61,8 +60,7 @@ public void InboxWithEmptyListOnNullResult() var actual = InboxDataTransferObjectConverter.FromDataTransferObject(source); - var comparator = new Comparator {ComparisonConfiguration = new ComparisonConfiguration {IgnoreObjectTypes = true}}; - comparator.AssertEqual(expected, actual); + Comparator.AssertEqual(expected, actual); } } } diff --git a/Digipost.Api.Client.Send.Tests/SendDataTransferObjectConverterTests.cs b/Digipost.Api.Client.Send.Tests/SendDataTransferObjectConverterTests.cs index 88b7946f..08ab94ef 100755 --- a/Digipost.Api.Client.Send.Tests/SendDataTransferObjectConverterTests.cs +++ b/Digipost.Api.Client.Send.Tests/SendDataTransferObjectConverterTests.cs @@ -12,8 +12,6 @@ namespace Digipost.Api.Client.Send.Tests { public class SendDataTransferObjectConverterTests { - private static readonly Comparator Comparator = new Comparator(); - public class FromDataTransferObjectConverterMethod { [Fact] diff --git a/Digipost.Api.Client.Send.Tests/SmsNotificationTests.cs b/Digipost.Api.Client.Send.Tests/SmsNotificationTests.cs index d552fe83..7ad0524d 100755 --- a/Digipost.Api.Client.Send.Tests/SmsNotificationTests.cs +++ b/Digipost.Api.Client.Send.Tests/SmsNotificationTests.cs @@ -8,8 +8,6 @@ namespace Digipost.Api.Client.Send.Tests { public class SmsNotificationTests { - private readonly Comparator _comparator = new Comparator(); - public class ConstructorMethod : SmsNotificationTests { [Fact] @@ -25,7 +23,7 @@ public void WithAfterHours() var actual = smsNotification.NotifyAfterHours; //Assert - _comparator.AssertEqual(expected, actual); + Comparator.AssertEqual(expected, actual); } [Fact] @@ -41,7 +39,7 @@ public void WithSendingTime() var actual = smsNotification.NotifyAtTimes; //Assert - _comparator.AssertEqual(expected, actual); + Comparator.AssertEqual(expected, actual); } } } diff --git a/Digipost.Api.Client.Tests/CompareObjects/Comparator.cs b/Digipost.Api.Client.Tests/CompareObjects/Comparator.cs index 0c7dba35..0bd322cd 100755 --- a/Digipost.Api.Client.Tests/CompareObjects/Comparator.cs +++ b/Digipost.Api.Client.Tests/CompareObjects/Comparator.cs @@ -5,10 +5,8 @@ namespace Digipost.Api.Client.Tests.CompareObjects { - internal class Comparator + internal static class Comparator { - public ComparisonConfiguration ComparisonConfiguration { get; set; } = new ComparisonConfiguration(); - private static void Equal(object expected, object actual, out IEnumerable differences) { var compareLogic = new CompareLogic( @@ -29,7 +27,7 @@ private static void Equal(object expected, object actual, out IEnumerable differences; Equal(expected, actual, out differences); From 77a6e3dd93af6813c8a10e6f4e9a4a00938bdb0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sindre=20Nordb=C3=B8?= Date: Wed, 22 Nov 2017 14:56:39 +0100 Subject: [PATCH 16/20] =?UTF-8?q?Fjernet=20uvesentligheter=20=F0=9F=92=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Digipost.Api.Client.Common/ApiClientXmlValidator.cs | 1 - Digipost.Api.Client.Common/Namespace.cs | 3 --- Digipost.Api.Client.DataTypes/Appointment/Appointment.cs | 1 - 3 files changed, 5 deletions(-) diff --git a/Digipost.Api.Client.Common/ApiClientXmlValidator.cs b/Digipost.Api.Client.Common/ApiClientXmlValidator.cs index ff6a0c1c..167a740c 100755 --- a/Digipost.Api.Client.Common/ApiClientXmlValidator.cs +++ b/Digipost.Api.Client.Common/ApiClientXmlValidator.cs @@ -8,7 +8,6 @@ internal class ApiClientXmlValidator : XmlValidator public ApiClientXmlValidator() { AddXsd(Namespace.DigipostApiV7, XsdResource.GetApiV7Xsd()); - AddXsd(Namespace.DataTypes, XsdResource.GetDataTypesXsd()); } } diff --git a/Digipost.Api.Client.Common/Namespace.cs b/Digipost.Api.Client.Common/Namespace.cs index 5725672c..cd826ad4 100755 --- a/Digipost.Api.Client.Common/Namespace.cs +++ b/Digipost.Api.Client.Common/Namespace.cs @@ -2,9 +2,6 @@ { 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.DataTypes/Appointment/Appointment.cs b/Digipost.Api.Client.DataTypes/Appointment/Appointment.cs index 1ed4821e..ab8d6125 100755 --- a/Digipost.Api.Client.DataTypes/Appointment/Appointment.cs +++ b/Digipost.Api.Client.DataTypes/Appointment/Appointment.cs @@ -37,7 +37,6 @@ public Appointment(DateTime startTime) public string SubTitle { get; set; } /// - /// w /// Additional sections of information (max 2) with a title and text /// public List Info { get; set; } From 99704361d8b8c27786d648db849f578bf731b461 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sindre=20Nordb=C3=B8?= Date: Wed, 22 Nov 2017 15:35:47 +0100 Subject: [PATCH 17/20] Dokumentasjon-fixups Fjerner litt og legger til litt. Such is life --- .../Appointment/AppointmentAddress.cs | 1 - Digipost.Api.Client.Send/IDocument.cs | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Digipost.Api.Client.DataTypes/Appointment/AppointmentAddress.cs b/Digipost.Api.Client.DataTypes/Appointment/AppointmentAddress.cs index 8d71bb2a..f3e03eb3 100755 --- a/Digipost.Api.Client.DataTypes/Appointment/AppointmentAddress.cs +++ b/Digipost.Api.Client.DataTypes/Appointment/AppointmentAddress.cs @@ -2,7 +2,6 @@ { public class AppointmentAddress { - /// public AppointmentAddress(string postalCode, string city) : this(null, postalCode, city) { diff --git a/Digipost.Api.Client.Send/IDocument.cs b/Digipost.Api.Client.Send/IDocument.cs index 1b792f9a..595b9825 100755 --- a/Digipost.Api.Client.Send/IDocument.cs +++ b/Digipost.Api.Client.Send/IDocument.cs @@ -43,6 +43,9 @@ public interface IDocument /// 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; } } } From 6a7ee2132523a6edb7b2c54250398b4308af1056 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sindre=20Nordb=C3=B8?= Date: Wed, 22 Nov 2017 15:36:43 +0100 Subject: [PATCH 18/20] Oppdaterer til versjon 8.2.0 --- SharedAssemblyInfo.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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")] From 7e4c60f49c5f5790352fe91b44f1ae519e368dee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sindre=20Nordb=C3=B8?= Date: Thu, 23 Nov 2017 09:50:42 +0100 Subject: [PATCH 19/20] =?UTF-8?q?Dokumentert=20restriksjoner=20p=C3=A5=20m?= =?UTF-8?q?aks=20lengde?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Dette blir håndhevet på back-end, men for å gi et hint til konsumenter av klientbiblioteket dokumenteres det her. --- Digipost.Api.Client.DataTypes/Appointment/Appointment.cs | 9 ++++++--- .../Appointment/AppointmentAddress.cs | 9 +++++++++ Digipost.Api.Client.DataTypes/Appointment/Info.cs | 3 +++ Digipost.Api.Client.DataTypes/ExternalLink.cs | 2 ++ 4 files changed, 20 insertions(+), 3 deletions(-) diff --git a/Digipost.Api.Client.DataTypes/Appointment/Appointment.cs b/Digipost.Api.Client.DataTypes/Appointment/Appointment.cs index ab8d6125..326b0b03 100755 --- a/Digipost.Api.Client.DataTypes/Appointment/Appointment.cs +++ b/Digipost.Api.Client.DataTypes/Appointment/Appointment.cs @@ -21,23 +21,26 @@ public Appointment(DateTime startTime) /// /// 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 + /// 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 + /// 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 + /// Additional sections of information (max 2) with a title and text. /// public List Info { get; set; } diff --git a/Digipost.Api.Client.DataTypes/Appointment/AppointmentAddress.cs b/Digipost.Api.Client.DataTypes/Appointment/AppointmentAddress.cs index f3e03eb3..5c74ffe3 100755 --- a/Digipost.Api.Client.DataTypes/Appointment/AppointmentAddress.cs +++ b/Digipost.Api.Client.DataTypes/Appointment/AppointmentAddress.cs @@ -14,10 +14,19 @@ public AppointmentAddress(string streetAddress, string postalCode, string city) 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() diff --git a/Digipost.Api.Client.DataTypes/Appointment/Info.cs b/Digipost.Api.Client.DataTypes/Appointment/Info.cs index 3a8692bf..e16528dc 100755 --- a/Digipost.Api.Client.DataTypes/Appointment/Info.cs +++ b/Digipost.Api.Client.DataTypes/Appointment/Info.cs @@ -8,6 +8,9 @@ public Info(string title, string text) Text = text; } + /// + /// 150 characters or less. + /// public string Title { get; set; } public string Text { get; set; } diff --git a/Digipost.Api.Client.DataTypes/ExternalLink.cs b/Digipost.Api.Client.DataTypes/ExternalLink.cs index a66508f8..1a224256 100755 --- a/Digipost.Api.Client.DataTypes/ExternalLink.cs +++ b/Digipost.Api.Client.DataTypes/ExternalLink.cs @@ -22,11 +22,13 @@ public ExternalLink(Uri url) /// /// 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; } From ee17335a5b34b14802930916915bfc39d06977f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sindre=20Nordb=C3=B8?= Date: Thu, 23 Nov 2017 12:45:46 +0100 Subject: [PATCH 20/20] Litt bedre `toString`-s for data-type-objektene --- .../Appointment/Appointment.cs | 11 +++++++++++ .../Appointment/AppointmentAddress.cs | 5 +++++ Digipost.Api.Client.DataTypes/Appointment/Info.cs | 5 +++++ Digipost.Api.Client.DataTypes/ExternalLink.cs | 5 +++++ 4 files changed, 26 insertions(+) diff --git a/Digipost.Api.Client.DataTypes/Appointment/Appointment.cs b/Digipost.Api.Client.DataTypes/Appointment/Appointment.cs index 326b0b03..ad14cd86 100755 --- a/Digipost.Api.Client.DataTypes/Appointment/Appointment.cs +++ b/Digipost.Api.Client.DataTypes/Appointment/Appointment.cs @@ -63,5 +63,16 @@ internal appointment AsDataTransferObject() }; 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 index 5c74ffe3..d792bba2 100755 --- a/Digipost.Api.Client.DataTypes/Appointment/AppointmentAddress.cs +++ b/Digipost.Api.Client.DataTypes/Appointment/AppointmentAddress.cs @@ -38,5 +38,10 @@ internal appointmentAddress AsDataTransferObject() 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 index e16528dc..c7556e29 100755 --- a/Digipost.Api.Client.DataTypes/Appointment/Info.cs +++ b/Digipost.Api.Client.DataTypes/Appointment/Info.cs @@ -23,5 +23,10 @@ internal info AsDataTransferObject() text = Text }; } + + public override string ToString() + { + return $"Info: '{Title}' - '{Text}'"; + } } } diff --git a/Digipost.Api.Client.DataTypes/ExternalLink.cs b/Digipost.Api.Client.DataTypes/ExternalLink.cs index 1a224256..a1d3d7d8 100755 --- a/Digipost.Api.Client.DataTypes/ExternalLink.cs +++ b/Digipost.Api.Client.DataTypes/ExternalLink.cs @@ -52,5 +52,10 @@ internal externalLink AsDataTransferObject() } return dto; } + + public override string ToString() + { + return $"External link to '{Url}'. Description: '{Description ?? ""}', ButtonText: '{ButtonText ?? ""}', DeadLine: '{(Deadline.HasValue ? Deadline.ToString() : "")}'"; + } } }