/* * Tribufu API * * API to access Tribufu services. * * The version of the OpenAPI document: 1.2.6 * Contact: contact@tribufu.com * Generated by: https://github.com/openapitools/openapi-generator.git */ using System; using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using System.IO; using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Tribufu.Client.OpenAPIDateConverter; namespace Tribufu.Model { /// /// PackageRelease /// [DataContract(Name = "PackageRelease")] public partial class PackageRelease : IValidatableObject { /// /// Initializes a new instance of the class. /// [JsonConstructorAttribute] protected PackageRelease() { } /// /// Initializes a new instance of the class. /// /// id. /// varVersion (required). /// packageId. /// notes. /// created. /// updated. public PackageRelease(string id = default(string), string varVersion = default(string), string packageId = default(string), string notes = default(string), DateTime created = default(DateTime), DateTime? updated = default(DateTime?)) { // to ensure "varVersion" is required (not null) if (varVersion == null) { throw new ArgumentNullException("varVersion is a required property for PackageRelease and cannot be null"); } this.VarVersion = varVersion; this.Id = id; this.PackageId = packageId; this.Notes = notes; this.Created = created; this.Updated = updated; } /// /// Gets or Sets Id /// [DataMember(Name = "id", EmitDefaultValue = false)] public string Id { get; set; } /// /// Gets or Sets VarVersion /// [DataMember(Name = "version", IsRequired = true, EmitDefaultValue = true)] public string VarVersion { get; set; } /// /// Gets or Sets PackageId /// [DataMember(Name = "package_id", EmitDefaultValue = false)] public string PackageId { get; set; } /// /// Gets or Sets Notes /// [DataMember(Name = "notes", EmitDefaultValue = true)] public string Notes { get; set; } /// /// Gets or Sets Files /// [DataMember(Name = "files", EmitDefaultValue = true)] public List Files { get; private set; } /// /// Returns false as Files should not be serialized given that it's read-only. /// /// false (boolean) public bool ShouldSerializeFiles() { return false; } /// /// Gets or Sets Created /// [DataMember(Name = "created", EmitDefaultValue = false)] public DateTime Created { get; set; } /// /// Gets or Sets Updated /// [DataMember(Name = "updated", EmitDefaultValue = true)] public DateTime? Updated { get; set; } /// /// Returns the string presentation of the object /// /// String presentation of the object public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class PackageRelease {\n"); sb.Append(" Id: ").Append(Id).Append("\n"); sb.Append(" VarVersion: ").Append(VarVersion).Append("\n"); sb.Append(" PackageId: ").Append(PackageId).Append("\n"); sb.Append(" Notes: ").Append(Notes).Append("\n"); sb.Append(" Files: ").Append(Files).Append("\n"); sb.Append(" Created: ").Append(Created).Append("\n"); sb.Append(" Updated: ").Append(Updated).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// /// Returns the JSON string presentation of the object /// /// JSON string presentation of the object public virtual string ToJson() { return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } /// /// To validate all properties of the instance /// /// Validation context /// Validation Result IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { // VarVersion (string) maxLength if (this.VarVersion != null && this.VarVersion.Length > 45) { yield return new ValidationResult("Invalid value for VarVersion, length must be less than 45.", new [] { "VarVersion" }); } yield break; } } }