/*
* Tribufu API
*
* API to access Tribufu services.
*
* The version of the OpenAPI document: 1.3.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.Client.OpenAPIDateConverter;
namespace Tribufu.Model
{
///
/// Group
///
[DataContract(Name = "Group")]
public partial class Group : IValidatableObject
{
///
/// Initializes a new instance of the class.
///
[JsonConstructorAttribute]
protected Group() { }
///
/// Initializes a new instance of the class.
///
/// id.
/// uuid.
/// name (required).
/// tag.
/// description.
/// type.
/// privacy.
/// ownerId.
/// verified.
/// photoUrl.
/// bannerUrl.
/// memberCount.
/// followerCount.
/// viewCount.
/// created.
/// updated.
public Group(string id = default(string), Guid uuid = default(Guid), string name = default(string), string tag = default(string), string description = default(string), int type = default(int), int privacy = default(int), string ownerId = default(string), bool verified = default(bool), string photoUrl = default(string), string bannerUrl = default(string), int memberCount = default(int), int followerCount = default(int), int viewCount = default(int), DateTime created = default(DateTime), DateTime? updated = default(DateTime?))
{
// to ensure "name" is required (not null)
if (name == null)
{
throw new ArgumentNullException("name is a required property for Group and cannot be null");
}
this.Name = name;
this.Id = id;
this.Uuid = uuid;
this.Tag = tag;
this.Description = description;
this.Type = type;
this.Privacy = privacy;
this.OwnerId = ownerId;
this.Verified = verified;
this.PhotoUrl = photoUrl;
this.BannerUrl = bannerUrl;
this.MemberCount = memberCount;
this.FollowerCount = followerCount;
this.ViewCount = viewCount;
this.Created = created;
this.Updated = updated;
}
///
/// Gets or Sets Id
///
[DataMember(Name = "id", EmitDefaultValue = false)]
public string Id { get; set; }
///
/// Gets or Sets Uuid
///
[DataMember(Name = "uuid", EmitDefaultValue = false)]
public Guid Uuid { get; set; }
///
/// Gets or Sets Name
///
[DataMember(Name = "name", IsRequired = true, EmitDefaultValue = true)]
public string Name { get; set; }
///
/// Gets or Sets Tag
///
[DataMember(Name = "tag", EmitDefaultValue = true)]
public string Tag { get; set; }
///
/// Gets or Sets Description
///
[DataMember(Name = "description", EmitDefaultValue = true)]
public string Description { get; set; }
///
/// Gets or Sets Type
///
[DataMember(Name = "type", EmitDefaultValue = false)]
public int Type { get; set; }
///
/// Gets or Sets Privacy
///
[DataMember(Name = "privacy", EmitDefaultValue = false)]
public int Privacy { get; set; }
///
/// Gets or Sets OwnerId
///
[DataMember(Name = "owner_id", EmitDefaultValue = false)]
public string OwnerId { get; set; }
///
/// Gets or Sets Verified
///
[DataMember(Name = "verified", EmitDefaultValue = true)]
public bool Verified { get; set; }
///
/// Gets or Sets PhotoUrl
///
[DataMember(Name = "photo_url", EmitDefaultValue = true)]
public string PhotoUrl { get; set; }
///
/// Gets or Sets BannerUrl
///
[DataMember(Name = "banner_url", EmitDefaultValue = true)]
public string BannerUrl { get; set; }
///
/// Gets or Sets MemberCount
///
[DataMember(Name = "member_count", EmitDefaultValue = false)]
public int MemberCount { get; set; }
///
/// Gets or Sets FollowerCount
///
[DataMember(Name = "follower_count", EmitDefaultValue = false)]
public int FollowerCount { get; set; }
///
/// Gets or Sets ViewCount
///
[DataMember(Name = "view_count", EmitDefaultValue = false)]
public int ViewCount { get; set; }
///
/// 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 Group {\n");
sb.Append(" Id: ").Append(Id).Append("\n");
sb.Append(" Uuid: ").Append(Uuid).Append("\n");
sb.Append(" Name: ").Append(Name).Append("\n");
sb.Append(" Tag: ").Append(Tag).Append("\n");
sb.Append(" Description: ").Append(Description).Append("\n");
sb.Append(" Type: ").Append(Type).Append("\n");
sb.Append(" Privacy: ").Append(Privacy).Append("\n");
sb.Append(" OwnerId: ").Append(OwnerId).Append("\n");
sb.Append(" Verified: ").Append(Verified).Append("\n");
sb.Append(" PhotoUrl: ").Append(PhotoUrl).Append("\n");
sb.Append(" BannerUrl: ").Append(BannerUrl).Append("\n");
sb.Append(" MemberCount: ").Append(MemberCount).Append("\n");
sb.Append(" FollowerCount: ").Append(FollowerCount).Append("\n");
sb.Append(" ViewCount: ").Append(ViewCount).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" });
}
yield break;
}
}
}