PageRenderTime 3460ms CodeModel.GetById 21ms RepoModel.GetById 6ms app.codeStats 0ms

/redistributable/docusign-csharp-client/DocuSign.eSign/Model/Contact.cs

https://gitlab.com/rekby-archive/onlyoffice-CommunityServer
C# | 270 lines | 168 code | 11 blank | 91 comment | 51 complexity | 08c996e67bb1fa8f0d25b708779a6d77 MD5 | raw file
  1. /*
  2. * DocuSign REST API
  3. *
  4. * The DocuSign REST API provides you with a powerful, convenient, and simple Web services API for interacting with DocuSign.
  5. *
  6. * OpenAPI spec version: v2
  7. * Contact: devcenter@docusign.com
  8. * Generated by: https://github.com/swagger-api/swagger-codegen.git
  9. */
  10. using System;
  11. using System.Linq;
  12. using System.IO;
  13. using System.Text;
  14. using System.Text.RegularExpressions;
  15. using System.Collections;
  16. using System.Collections.Generic;
  17. using System.Collections.ObjectModel;
  18. using System.Runtime.Serialization;
  19. using Newtonsoft.Json;
  20. using Newtonsoft.Json.Converters;
  21. using System.ComponentModel.DataAnnotations;
  22. namespace DocuSign.eSign.Model
  23. {
  24. /// <summary>
  25. /// Contact
  26. /// </summary>
  27. [DataContract]
  28. public partial class Contact : IEquatable<Contact>, IValidatableObject
  29. {
  30. public Contact()
  31. {
  32. // Empty Constructor
  33. }
  34. /// <summary>
  35. /// Initializes a new instance of the <see cref="Contact" /> class.
  36. /// </summary>
  37. /// <param name="ContactId">.</param>
  38. /// <param name="ContactPhoneNumbers">.</param>
  39. /// <param name="ContactUri">.</param>
  40. /// <param name="Emails">.</param>
  41. /// <param name="ErrorDetails">ErrorDetails.</param>
  42. /// <param name="Name">.</param>
  43. /// <param name="Organization">.</param>
  44. /// <param name="Shared">When set to **true**, this custom tab is shared..</param>
  45. /// <param name="SigningGroup">.</param>
  46. /// <param name="SigningGroupName">The display name for the signing group. Maximum Length: 100 characters. .</param>
  47. public Contact(string ContactId = default(string), List<ContactPhoneNumber> ContactPhoneNumbers = default(List<ContactPhoneNumber>), string ContactUri = default(string), List<string> Emails = default(List<string>), ErrorDetails ErrorDetails = default(ErrorDetails), string Name = default(string), string Organization = default(string), string Shared = default(string), string SigningGroup = default(string), string SigningGroupName = default(string))
  48. {
  49. this.ContactId = ContactId;
  50. this.ContactPhoneNumbers = ContactPhoneNumbers;
  51. this.ContactUri = ContactUri;
  52. this.Emails = Emails;
  53. this.ErrorDetails = ErrorDetails;
  54. this.Name = Name;
  55. this.Organization = Organization;
  56. this.Shared = Shared;
  57. this.SigningGroup = SigningGroup;
  58. this.SigningGroupName = SigningGroupName;
  59. }
  60. /// <summary>
  61. ///
  62. /// </summary>
  63. /// <value></value>
  64. [DataMember(Name="contactId", EmitDefaultValue=false)]
  65. public string ContactId { get; set; }
  66. /// <summary>
  67. ///
  68. /// </summary>
  69. /// <value></value>
  70. [DataMember(Name="contactPhoneNumbers", EmitDefaultValue=false)]
  71. public List<ContactPhoneNumber> ContactPhoneNumbers { get; set; }
  72. /// <summary>
  73. ///
  74. /// </summary>
  75. /// <value></value>
  76. [DataMember(Name="contactUri", EmitDefaultValue=false)]
  77. public string ContactUri { get; set; }
  78. /// <summary>
  79. ///
  80. /// </summary>
  81. /// <value></value>
  82. [DataMember(Name="emails", EmitDefaultValue=false)]
  83. public List<string> Emails { get; set; }
  84. /// <summary>
  85. /// Gets or Sets ErrorDetails
  86. /// </summary>
  87. [DataMember(Name="errorDetails", EmitDefaultValue=false)]
  88. public ErrorDetails ErrorDetails { get; set; }
  89. /// <summary>
  90. ///
  91. /// </summary>
  92. /// <value></value>
  93. [DataMember(Name="name", EmitDefaultValue=false)]
  94. public string Name { get; set; }
  95. /// <summary>
  96. ///
  97. /// </summary>
  98. /// <value></value>
  99. [DataMember(Name="organization", EmitDefaultValue=false)]
  100. public string Organization { get; set; }
  101. /// <summary>
  102. /// When set to **true**, this custom tab is shared.
  103. /// </summary>
  104. /// <value>When set to **true**, this custom tab is shared.</value>
  105. [DataMember(Name="shared", EmitDefaultValue=false)]
  106. public string Shared { get; set; }
  107. /// <summary>
  108. ///
  109. /// </summary>
  110. /// <value></value>
  111. [DataMember(Name="signingGroup", EmitDefaultValue=false)]
  112. public string SigningGroup { get; set; }
  113. /// <summary>
  114. /// The display name for the signing group. Maximum Length: 100 characters.
  115. /// </summary>
  116. /// <value>The display name for the signing group. Maximum Length: 100 characters. </value>
  117. [DataMember(Name="signingGroupName", EmitDefaultValue=false)]
  118. public string SigningGroupName { get; set; }
  119. /// <summary>
  120. /// Returns the string presentation of the object
  121. /// </summary>
  122. /// <returns>String presentation of the object</returns>
  123. public override string ToString()
  124. {
  125. var sb = new StringBuilder();
  126. sb.Append("class Contact {\n");
  127. sb.Append(" ContactId: ").Append(ContactId).Append("\n");
  128. sb.Append(" ContactPhoneNumbers: ").Append(ContactPhoneNumbers).Append("\n");
  129. sb.Append(" ContactUri: ").Append(ContactUri).Append("\n");
  130. sb.Append(" Emails: ").Append(Emails).Append("\n");
  131. sb.Append(" ErrorDetails: ").Append(ErrorDetails).Append("\n");
  132. sb.Append(" Name: ").Append(Name).Append("\n");
  133. sb.Append(" Organization: ").Append(Organization).Append("\n");
  134. sb.Append(" Shared: ").Append(Shared).Append("\n");
  135. sb.Append(" SigningGroup: ").Append(SigningGroup).Append("\n");
  136. sb.Append(" SigningGroupName: ").Append(SigningGroupName).Append("\n");
  137. sb.Append("}\n");
  138. return sb.ToString();
  139. }
  140. /// <summary>
  141. /// Returns the JSON string presentation of the object
  142. /// </summary>
  143. /// <returns>JSON string presentation of the object</returns>
  144. public string ToJson()
  145. {
  146. return JsonConvert.SerializeObject(this, Formatting.Indented);
  147. }
  148. /// <summary>
  149. /// Returns true if objects are equal
  150. /// </summary>
  151. /// <param name="obj">Object to be compared</param>
  152. /// <returns>Boolean</returns>
  153. public override bool Equals(object obj)
  154. {
  155. // credit: http://stackoverflow.com/a/10454552/677735
  156. return this.Equals(obj as Contact);
  157. }
  158. /// <summary>
  159. /// Returns true if Contact instances are equal
  160. /// </summary>
  161. /// <param name="other">Instance of Contact to be compared</param>
  162. /// <returns>Boolean</returns>
  163. public bool Equals(Contact other)
  164. {
  165. // credit: http://stackoverflow.com/a/10454552/677735
  166. if (other == null)
  167. return false;
  168. return
  169. (
  170. this.ContactId == other.ContactId ||
  171. this.ContactId != null &&
  172. this.ContactId.Equals(other.ContactId)
  173. ) &&
  174. (
  175. this.ContactPhoneNumbers == other.ContactPhoneNumbers ||
  176. this.ContactPhoneNumbers != null &&
  177. this.ContactPhoneNumbers.SequenceEqual(other.ContactPhoneNumbers)
  178. ) &&
  179. (
  180. this.ContactUri == other.ContactUri ||
  181. this.ContactUri != null &&
  182. this.ContactUri.Equals(other.ContactUri)
  183. ) &&
  184. (
  185. this.Emails == other.Emails ||
  186. this.Emails != null &&
  187. this.Emails.SequenceEqual(other.Emails)
  188. ) &&
  189. (
  190. this.ErrorDetails == other.ErrorDetails ||
  191. this.ErrorDetails != null &&
  192. this.ErrorDetails.Equals(other.ErrorDetails)
  193. ) &&
  194. (
  195. this.Name == other.Name ||
  196. this.Name != null &&
  197. this.Name.Equals(other.Name)
  198. ) &&
  199. (
  200. this.Organization == other.Organization ||
  201. this.Organization != null &&
  202. this.Organization.Equals(other.Organization)
  203. ) &&
  204. (
  205. this.Shared == other.Shared ||
  206. this.Shared != null &&
  207. this.Shared.Equals(other.Shared)
  208. ) &&
  209. (
  210. this.SigningGroup == other.SigningGroup ||
  211. this.SigningGroup != null &&
  212. this.SigningGroup.Equals(other.SigningGroup)
  213. ) &&
  214. (
  215. this.SigningGroupName == other.SigningGroupName ||
  216. this.SigningGroupName != null &&
  217. this.SigningGroupName.Equals(other.SigningGroupName)
  218. );
  219. }
  220. /// <summary>
  221. /// Gets the hash code
  222. /// </summary>
  223. /// <returns>Hash code</returns>
  224. public override int GetHashCode()
  225. {
  226. // credit: http://stackoverflow.com/a/263416/677735
  227. unchecked // Overflow is fine, just wrap
  228. {
  229. int hash = 41;
  230. // Suitable nullity checks etc, of course :)
  231. if (this.ContactId != null)
  232. hash = hash * 59 + this.ContactId.GetHashCode();
  233. if (this.ContactPhoneNumbers != null)
  234. hash = hash * 59 + this.ContactPhoneNumbers.GetHashCode();
  235. if (this.ContactUri != null)
  236. hash = hash * 59 + this.ContactUri.GetHashCode();
  237. if (this.Emails != null)
  238. hash = hash * 59 + this.Emails.GetHashCode();
  239. if (this.ErrorDetails != null)
  240. hash = hash * 59 + this.ErrorDetails.GetHashCode();
  241. if (this.Name != null)
  242. hash = hash * 59 + this.Name.GetHashCode();
  243. if (this.Organization != null)
  244. hash = hash * 59 + this.Organization.GetHashCode();
  245. if (this.Shared != null)
  246. hash = hash * 59 + this.Shared.GetHashCode();
  247. if (this.SigningGroup != null)
  248. hash = hash * 59 + this.SigningGroup.GetHashCode();
  249. if (this.SigningGroupName != null)
  250. hash = hash * 59 + this.SigningGroupName.GetHashCode();
  251. return hash;
  252. }
  253. }
  254. public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
  255. {
  256. yield break;
  257. }
  258. }
  259. }