/*
* GameBrain API
*
* GameBrain API
*
* The version of the OpenAPI document: 1.0.1
* Contact: mail@gamebrain.co
* 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 = gamebrain.Client.OpenAPIDateConverter;
namespace gamebrain.Model
{
/// <summary>
/// GameNewsItem
/// </summary>
[DataContract(Name = "GameNewsItem")]
public partial class GameNewsItem : IValidatableObject
{
/// <summary>
/// Initializes a new instance of the <see cref="GameNewsItem" /> class.
/// </summary>
[JsonConstructorAttribute]
protected GameNewsItem() { }
/// <summary>
/// Initializes a new instance of the <see cref="GameNewsItem" /> class.
/// </summary>
/// <param name="title">title (required).</param>
/// <param name="url">url (required).</param>
/// <param name="source">source (required).</param>
/// <param name="image">image.</param>
/// <param name="published">published (required).</param>
public GameNewsItem(string title = default(string), string url = default(string), string source = default(string), string image = default(string), DateOnly published = default(DateOnly))
{
// to ensure "title" is required (not null)
if (title == null)
{
throw new ArgumentNullException("title is a required property for GameNewsItem and cannot be null");
}
this.Title = title;
// to ensure "url" is required (not null)
if (url == null)
{
throw new ArgumentNullException("url is a required property for GameNewsItem and cannot be null");
}
this.Url = url;
// to ensure "source" is required (not null)
if (source == null)
{
throw new ArgumentNullException("source is a required property for GameNewsItem and cannot be null");
}
this.Source = source;
// to ensure "published" is required (not null)
if (published == null)
{
throw new ArgumentNullException("published is a required property for GameNewsItem and cannot be null");
}
this.Published = published;
this.Image = image;
}
/// <summary>
/// Gets or Sets Title
/// </summary>
[DataMember(Name = "title", IsRequired = true, EmitDefaultValue = true)]
public string Title { get; set; }
/// <summary>
/// Gets or Sets Url
/// </summary>
[DataMember(Name = "url", IsRequired = true, EmitDefaultValue = true)]
public string Url { get; set; }
/// <summary>
/// Gets or Sets Source
/// </summary>
[DataMember(Name = "source", IsRequired = true, EmitDefaultValue = true)]
public string Source { get; set; }
/// <summary>
/// Gets or Sets Image
/// </summary>
[DataMember(Name = "image", EmitDefaultValue = false)]
public string Image { get; set; }
/// <summary>
/// Gets or Sets Published
/// </summary>
[DataMember(Name = "published", IsRequired = true, EmitDefaultValue = true)]
public DateOnly Published { get; set; }
/// <summary>
/// Returns the string presentation of the object
/// </summary>
/// <returns>String presentation of the object</returns>
public override string ToString()
{
StringBuilder sb = new StringBuilder();
sb.Append("class GameNewsItem {\n");
sb.Append(" Title: ").Append(Title).Append("\n");
sb.Append(" Url: ").Append(Url).Append("\n");
sb.Append(" Source: ").Append(Source).Append("\n");
sb.Append(" Image: ").Append(Image).Append("\n");
sb.Append(" Published: ").Append(Published).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
/// <summary>
/// Returns the JSON string presentation of the object
/// </summary>
/// <returns>JSON string presentation of the object</returns>
public virtual string ToJson()
{
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
}
/// <summary>
/// To validate all properties of the instance
/// </summary>
/// <param name="validationContext">Validation context</param>
/// <returns>Validation Result</returns>
IEnumerable<ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
{
yield break;
}
}
}