PageRenderTime 57ms CodeModel.GetById 14ms RepoModel.GetById 0ms app.codeStats 0ms

/GrinGlobal.Web/APIs/Models/BrAPIGermplasm/PedigreeNodeParents.cs

https://gitlab.com/GRIN-Global/GRIN-Global-server
C# | 178 lines | 101 code | 14 blank | 63 comment | 20 complexity | 1fdc40701c97af913f53ef2ae8e9bb6e MD5 | raw file
  1. /*
  2. * BrAPI-Germplasm
  3. *
  4. * The Breeding API (BrAPI) is a Standardized REST ful Web Service API Specification for communicating Plant Breeding Data. BrAPI allows for easy data sharing between databases and tools involved in plant breeding. <div class=\"brapi-section\"> <h2 class=\"brapi-section-title\">General Reference Documentation</h2> <div class=\"gen-info-link\"><a href=\"https://github.com/plantbreeding/API/blob/master/Specification/GeneralInfo/URL_Structure.md\">URL Structure</a></div> <div class=\"gen-info-link\"><a href=\"https://github.com/plantbreeding/API/blob/master/Specification/GeneralInfo/Response_Structure.md\">Response Structure</a></div> <div class=\"gen-info-link\"><a href=\"https://github.com/plantbreeding/API/blob/master/Specification/GeneralInfo/Date_Time_Encoding.md\">Date/Time Encoding</a></div> <div class=\"gen-info-link\"><a href=\"https://github.com/plantbreeding/API/blob/master/Specification/GeneralInfo/Location_Encoding.md\">Location Encoding</a></div> <div class=\"gen-info-link\"><a href=\"https://github.com/plantbreeding/API/blob/master/Specification/GeneralInfo/Error_Handling.md\">Error Handling</a></div> <div class=\"gen-info-link\"><a href=\"https://github.com/plantbreeding/API/blob/master/Specification/GeneralInfo/Search_Services.md\">Search Services</a></div> </div> <div class=\"brapi-section\"> <h2 class=\"brapi-section-title\">BrAPI Core</h2> <div class=\"brapi-section-description\">The BrAPI Core module contains high level entities used for organization and management. This includes Programs, Trials, Studies, Locations, People, and Lists</div> <div class=\"version-number\">V2.0</div> <div class=\"link-btn\"><a href=\"https://github.com/plantbreeding/API/tree/master/Specification/BrAPI-Core\">GitHub</a></div> <div class=\"link-btn\"><a href=\"https://app.swaggerhub.com/apis/PlantBreedingAPI/BrAPI-Core\">SwaggerHub</a></div> <div class=\"link-btn\"><a href=\"https://brapicore.docs.apiary.io\">Apiary</a></div> <div class=\"stop-float\"></div> </div> <div class=\"brapi-section\"> <h2 class=\"brapi-section-title\">BrAPI Phenotyping</h2> <div class=\"brapi-section-description\">The BrAPI Phenotyping module contains entities related to phenotypic observations. This includes Observation Units, Observations, Observation Variables, Traits, Scales, Methods, and Images</div> <div class=\"version-number\">V2.0</div> <div class=\"link-btn\"><a href=\"https://github.com/plantbreeding/API/tree/master/Specification/BrAPI-Phenotyping\">GitHub</a></div> <div class=\"link-btn\"><a href=\"https://app.swaggerhub.com/apis/PlantBreedingAPI/BrAPI-Phenotyping\">SwaggerHub</a></div> <div class=\"link-btn\"><a href=\"https://brapiphenotyping.docs.apiary.io\">Apiary</a></div> <div class=\"stop-float\"></div> </div> <div class=\"brapi-section\"> <h2 class=\"brapi-section-title\">BrAPI Genotyping</h2> <div class=\"brapi-section-description\">The BrAPI Genotyping module contains entities related to genotyping analysis. This includes Samples, Markers, Variant Sets, Variants, Call Sets, Calls, References, Reads, and Vendor Orders</div> <div class=\"version-number\">V2.0</div> <div class=\"link-btn\"><a href=\"https://github.com/plantbreeding/API/tree/master/Specification/BrAPI-Genotyping\">GitHub</a></div> <div class=\"link-btn\"><a href=\"https://app.swaggerhub.com/apis/PlantBreedingAPI/BrAPI-Genotyping\">SwaggerHub</a></div> <div class=\"link-btn\"><a href=\"https://brapigenotyping.docs.apiary.io\">Apiary</a></div> <div class=\"stop-float\"></div> </div> <div class=\"current-brapi-section brapi-section\"> <h2 class=\"brapi-section-title\">BrAPI Germplasm</h2> <div class=\"brapi-section-description\">The BrAPI Germplasm module contains entities related to germplasm management. This includes Germplasm, Germplasm Attributes, Seed Lots, Crosses, Pedigree, and Progeny</div> <div class=\"version-number\">V2.0</div> <div class=\"link-btn\"><a href=\"https://github.com/plantbreeding/API/tree/master/Specification/BrAPI-Germplasm\">GitHub</a></div> <div class=\"link-btn\"><a href=\"https://app.swaggerhub.com/apis/PlantBreedingAPI/BrAPI-Germplasm\">SwaggerHub</a></div> <div class=\"link-btn\"><a href=\"https://brapigermplasm.docs.apiary.io\">Apiary</a></div> <div class=\"stop-float\"></div> </div> <style> .link-btn{ float: left; margin: 2px 10px 0 0; padding: 0 5px; border-radius: 5px; background-color: #ddd; } .stop-float{ clear: both; } .version-number{ float: left; margin: 5px 10px 0 5px; } .brapi-section-title{ margin: 0 10px 0 0; font-size: 20px; } .current-brapi-section{ font-weight: bolder; border-radius: 5px; background-color: #ddd; } .brapi-section{ padding: 5px 5px; } .brapi-section-description{ margin: 5px 0 0 5px; } </style>
  5. *
  6. * OpenAPI spec version: 2.0
  7. *
  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.Collections;
  15. using System.Collections.Generic;
  16. using System.Collections.ObjectModel;
  17. using System.ComponentModel.DataAnnotations;
  18. using System.Runtime.Serialization;
  19. using Newtonsoft.Json;
  20. namespace GrinGlobal.BrAPI.Models
  21. {
  22. /// <summary>
  23. ///
  24. /// </summary>
  25. [DataContract]
  26. public partial class PedigreeNodeParents : IEquatable<PedigreeNodeParents>
  27. {
  28. /// <summary>
  29. /// The germplasm DbId of the parent of this germplasm
  30. /// </summary>
  31. /// <value>The germplasm DbId of the parent of this germplasm</value>
  32. [DataMember(Name="germplasmDbId")]
  33. public string GermplasmDbId { get; set; }
  34. /// <summary>
  35. /// the human readable name of the parent of this germplasm
  36. /// </summary>
  37. /// <value>the human readable name of the parent of this germplasm</value>
  38. [DataMember(Name="germplasmName")]
  39. public string GermplasmName { get; set; }
  40. /// <summary>
  41. /// The type of parent the parent is. ex. 'MALE', 'FEMALE', 'SELF', 'POPULATION', etc.
  42. /// </summary>
  43. /// <value>The type of parent the parent is. ex. 'MALE', 'FEMALE', 'SELF', 'POPULATION', etc.</value>
  44. [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))]
  45. public enum ParentTypeEnum
  46. {
  47. /// <summary>
  48. /// Enum MALEEnum for MALE
  49. /// </summary>
  50. [EnumMember(Value = "MALE")]
  51. MALEEnum = 0,
  52. /// <summary>
  53. /// Enum FEMALEEnum for FEMALE
  54. /// </summary>
  55. [EnumMember(Value = "FEMALE")]
  56. FEMALEEnum = 1,
  57. /// <summary>
  58. /// Enum SELFEnum for SELF
  59. /// </summary>
  60. [EnumMember(Value = "SELF")]
  61. SELFEnum = 2,
  62. /// <summary>
  63. /// Enum POPULATIONEnum for POPULATION
  64. /// </summary>
  65. [EnumMember(Value = "POPULATION")]
  66. POPULATIONEnum = 3 }
  67. /// <summary>
  68. /// The type of parent the parent is. ex. &#x27;MALE&#x27;, &#x27;FEMALE&#x27;, &#x27;SELF&#x27;, &#x27;POPULATION&#x27;, etc.
  69. /// </summary>
  70. /// <value>The type of parent the parent is. ex. &#x27;MALE&#x27;, &#x27;FEMALE&#x27;, &#x27;SELF&#x27;, &#x27;POPULATION&#x27;, etc.</value>
  71. [DataMember(Name="parentType")]
  72. public ParentTypeEnum? ParentType { get; set; }
  73. /// <summary>
  74. /// Returns the string presentation of the object
  75. /// </summary>
  76. /// <returns>String presentation of the object</returns>
  77. public override string ToString()
  78. {
  79. var sb = new StringBuilder();
  80. sb.Append("class PedigreeNodeParents {\n");
  81. sb.Append(" GermplasmDbId: ").Append(GermplasmDbId).Append("\n");
  82. sb.Append(" GermplasmName: ").Append(GermplasmName).Append("\n");
  83. sb.Append(" ParentType: ").Append(ParentType).Append("\n");
  84. sb.Append("}\n");
  85. return sb.ToString();
  86. }
  87. /// <summary>
  88. /// Returns the JSON string presentation of the object
  89. /// </summary>
  90. /// <returns>JSON string presentation of the object</returns>
  91. public string ToJson()
  92. {
  93. return JsonConvert.SerializeObject(this, Formatting.Indented);
  94. }
  95. /// <summary>
  96. /// Returns true if objects are equal
  97. /// </summary>
  98. /// <param name="obj">Object to be compared</param>
  99. /// <returns>Boolean</returns>
  100. public override bool Equals(object obj)
  101. {
  102. if (ReferenceEquals(null, obj)) return false;
  103. if (ReferenceEquals(this, obj)) return true;
  104. return obj.GetType() == GetType() && Equals((PedigreeNodeParents)obj);
  105. }
  106. /// <summary>
  107. /// Returns true if PedigreeNodeParents instances are equal
  108. /// </summary>
  109. /// <param name="other">Instance of PedigreeNodeParents to be compared</param>
  110. /// <returns>Boolean</returns>
  111. public bool Equals(PedigreeNodeParents other)
  112. {
  113. if (ReferenceEquals(null, other)) return false;
  114. if (ReferenceEquals(this, other)) return true;
  115. return
  116. (
  117. GermplasmDbId == other.GermplasmDbId ||
  118. GermplasmDbId != null &&
  119. GermplasmDbId.Equals(other.GermplasmDbId)
  120. ) &&
  121. (
  122. GermplasmName == other.GermplasmName ||
  123. GermplasmName != null &&
  124. GermplasmName.Equals(other.GermplasmName)
  125. ) &&
  126. (
  127. ParentType == other.ParentType ||
  128. ParentType != null &&
  129. ParentType.Equals(other.ParentType)
  130. );
  131. }
  132. /// <summary>
  133. /// Gets the hash code
  134. /// </summary>
  135. /// <returns>Hash code</returns>
  136. public override int GetHashCode()
  137. {
  138. unchecked // Overflow is fine, just wrap
  139. {
  140. var hashCode = 41;
  141. // Suitable nullity checks etc, of course :)
  142. if (GermplasmDbId != null)
  143. hashCode = hashCode * 59 + GermplasmDbId.GetHashCode();
  144. if (GermplasmName != null)
  145. hashCode = hashCode * 59 + GermplasmName.GetHashCode();
  146. if (ParentType != null)
  147. hashCode = hashCode * 59 + ParentType.GetHashCode();
  148. return hashCode;
  149. }
  150. }
  151. #region Operators
  152. #pragma warning disable 1591
  153. public static bool operator ==(PedigreeNodeParents left, PedigreeNodeParents right)
  154. {
  155. return Equals(left, right);
  156. }
  157. public static bool operator !=(PedigreeNodeParents left, PedigreeNodeParents right)
  158. {
  159. return !Equals(left, right);
  160. }
  161. #pragma warning restore 1591
  162. #endregion Operators
  163. }
  164. }