/* * Tribufu API * * REST API to access Tribufu services. * * The version of the OpenAPI document: 1.1.0 * 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.Generated.Client.OpenAPIDateConverter; namespace Tribufu.Generated.Model { /// /// Subscription /// [DataContract(Name = "Subscription")] public partial class Subscription : IValidatableObject { /// /// Initializes a new instance of the class. /// /// id. /// name. /// description. /// imageUrl. /// created. /// updated. public Subscription(string id = default(string), string name = default(string), string description = default(string), string imageUrl = default(string), DateTime created = default(DateTime), DateTime? updated = default(DateTime?)) { this.Id = id; this.Name = name; this.Description = description; this.ImageUrl = imageUrl; this.Created = created; this.Updated = updated; } /// /// Gets or Sets Id /// [DataMember(Name = "id", EmitDefaultValue = false)] public string Id { get; set; } /// /// Gets or Sets Name /// [DataMember(Name = "name", EmitDefaultValue = true)] public string Name { get; set; } /// /// Gets or Sets Description /// [DataMember(Name = "description", EmitDefaultValue = true)] public string Description { get; set; } /// /// Gets or Sets ImageUrl /// [DataMember(Name = "image_url", EmitDefaultValue = true)] public string ImageUrl { get; set; } /// /// Gets or Sets Prices /// [DataMember(Name = "prices", EmitDefaultValue = true)] public Dictionary Prices { get; private set; } /// /// Returns false as Prices should not be serialized given that it's read-only. /// /// false (boolean) public bool ShouldSerializePrices() { 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 Subscription {\n"); sb.Append(" Id: ").Append(Id).Append("\n"); sb.Append(" Name: ").Append(Name).Append("\n"); sb.Append(" Description: ").Append(Description).Append("\n"); sb.Append(" ImageUrl: ").Append(ImageUrl).Append("\n"); sb.Append(" Prices: ").Append(Prices).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) { // Name (string) maxLength if (this.Name != null && this.Name.Length > 75) { yield return new ValidationResult("Invalid value for Name, length must be less than 75.", new [] { "Name" }); } // ImageUrl (string) maxLength if (this.ImageUrl != null && this.ImageUrl.Length > 255) { yield return new ValidationResult("Invalid value for ImageUrl, length must be less than 255.", new [] { "ImageUrl" }); } yield break; } } }