PageRenderTime 37ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/GrinGlobal.Web/APIs/Models/BrAPIPhenotyping/ObservationVariable.cs

https://gitlab.com/GRIN-Global/GRIN-Global-server
C# | 137 lines | 82 code | 12 blank | 43 comment | 15 complexity | 36d2552fa1e78c1d9ac46e6b595eb7ae MD5 | raw file
  1. /*
  2. * BrAPI-Phenotyping
  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=\"current-brapi-section 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=\"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 ObservationVariable : VariableBaseClass, IEquatable<ObservationVariable>
  27. {
  28. /// <summary>
  29. /// Variable unique identifier MIAPPE V1.1 (DM-83) Variable ID - Code used to identify the variable in the data file. We recommend using a variable definition from the Crop Ontology where possible. Otherwise, the Crop Ontology naming convention is recommended: &lt;trait abbreviation&gt;_&lt;method abbreviation&gt;_&lt;scale abbreviation&gt;). A variable ID must be unique within a given investigation.
  30. /// </summary>
  31. /// <value>Variable unique identifier MIAPPE V1.1 (DM-83) Variable ID - Code used to identify the variable in the data file. We recommend using a variable definition from the Crop Ontology where possible. Otherwise, the Crop Ontology naming convention is recommended: &lt;trait abbreviation&gt;_&lt;method abbreviation&gt;_&lt;scale abbreviation&gt;). A variable ID must be unique within a given investigation.</value>
  32. [Required]
  33. [DataMember(Name="observationVariableDbId")]
  34. public string ObservationVariableDbId { get; set; }
  35. /// <summary>
  36. /// Variable name (usually a short name) MIAPPE V1.1 (DM-84) Variable name - Name of the variable.
  37. /// </summary>
  38. /// <value>Variable name (usually a short name) MIAPPE V1.1 (DM-84) Variable name - Name of the variable.</value>
  39. [Required]
  40. [DataMember(Name="observationVariableName")]
  41. public string ObservationVariableName { get; set; }
  42. /// <summary>
  43. /// Returns the string presentation of the object
  44. /// </summary>
  45. /// <returns>String presentation of the object</returns>
  46. public override string ToString()
  47. {
  48. var sb = new StringBuilder();
  49. sb.Append("class ObservationVariable {\n");
  50. sb.Append(" ObservationVariableDbId: ").Append(ObservationVariableDbId).Append("\n");
  51. sb.Append(" ObservationVariableName: ").Append(ObservationVariableName).Append("\n");
  52. sb.Append("}\n");
  53. return sb.ToString();
  54. }
  55. /// <summary>
  56. /// Returns the JSON string presentation of the object
  57. /// </summary>
  58. /// <returns>JSON string presentation of the object</returns>
  59. public new string ToJson()
  60. {
  61. return JsonConvert.SerializeObject(this, Formatting.Indented);
  62. }
  63. /// <summary>
  64. /// Returns true if objects are equal
  65. /// </summary>
  66. /// <param name="obj">Object to be compared</param>
  67. /// <returns>Boolean</returns>
  68. public override bool Equals(object obj)
  69. {
  70. if (ReferenceEquals(null, obj)) return false;
  71. if (ReferenceEquals(this, obj)) return true;
  72. return obj.GetType() == GetType() && Equals((ObservationVariable)obj);
  73. }
  74. /// <summary>
  75. /// Returns true if ObservationVariable instances are equal
  76. /// </summary>
  77. /// <param name="other">Instance of ObservationVariable to be compared</param>
  78. /// <returns>Boolean</returns>
  79. public bool Equals(ObservationVariable other)
  80. {
  81. if (ReferenceEquals(null, other)) return false;
  82. if (ReferenceEquals(this, other)) return true;
  83. return
  84. (
  85. ObservationVariableDbId == other.ObservationVariableDbId ||
  86. ObservationVariableDbId != null &&
  87. ObservationVariableDbId.Equals(other.ObservationVariableDbId)
  88. ) &&
  89. (
  90. ObservationVariableName == other.ObservationVariableName ||
  91. ObservationVariableName != null &&
  92. ObservationVariableName.Equals(other.ObservationVariableName)
  93. );
  94. }
  95. /// <summary>
  96. /// Gets the hash code
  97. /// </summary>
  98. /// <returns>Hash code</returns>
  99. public override int GetHashCode()
  100. {
  101. unchecked // Overflow is fine, just wrap
  102. {
  103. var hashCode = 41;
  104. // Suitable nullity checks etc, of course :)
  105. if (ObservationVariableDbId != null)
  106. hashCode = hashCode * 59 + ObservationVariableDbId.GetHashCode();
  107. if (ObservationVariableName != null)
  108. hashCode = hashCode * 59 + ObservationVariableName.GetHashCode();
  109. return hashCode;
  110. }
  111. }
  112. #region Operators
  113. #pragma warning disable 1591
  114. public static bool operator ==(ObservationVariable left, ObservationVariable right)
  115. {
  116. return Equals(left, right);
  117. }
  118. public static bool operator !=(ObservationVariable left, ObservationVariable right)
  119. {
  120. return !Equals(left, right);
  121. }
  122. #pragma warning restore 1591
  123. #endregion Operators
  124. }
  125. }