/// <summary>
 /// Initializes a new instance of the <see cref="ArticleResource" /> class.
 /// </summary>
 /// <param name="Active">Whether the article is active (required).</param>
 /// <param name="AdditionalProperties">A map of additional properties, keyed on the property name.  Must match the names and types defined in the template for this item type.</param>
 /// <param name="Body">The body of the article (required).</param>
 /// <param name="Category">The category for the article (required).</param>
 /// <param name="Tags">The tags for the article.</param>
 /// <param name="Template">An article template this article is validated against (private). May be null and no validation of additional_properties will be done.</param>
 /// <param name="Title">The title of the article (required).</param>
 public ArticleResource(bool?Active = default(bool?), Dictionary <string, Property> AdditionalProperties = default(Dictionary <string, Property>), string Body = default(string), NestedCategory Category = default(NestedCategory), List <string> Tags = default(List <string>), string Template = default(string), string Title = default(string))
 {
     // to ensure "Active" is required (not null)
     if (Active == null)
     {
         throw new InvalidDataException("Active is a required property for ArticleResource and cannot be null");
     }
     else
     {
         this.Active = Active;
     }
     // to ensure "Body" is required (not null)
     if (Body == null)
     {
         throw new InvalidDataException("Body is a required property for ArticleResource and cannot be null");
     }
     else
     {
         this.Body = Body;
     }
     // to ensure "Category" is required (not null)
     if (Category == null)
     {
         throw new InvalidDataException("Category is a required property for ArticleResource and cannot be null");
     }
     else
     {
         this.Category = Category;
     }
     // to ensure "Title" is required (not null)
     if (Title == null)
     {
         throw new InvalidDataException("Title is a required property for ArticleResource and cannot be null");
     }
     else
     {
         this.Title = Title;
     }
     this.AdditionalProperties = AdditionalProperties;
     this.Tags     = Tags;
     this.Template = Template;
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="QuestionResource" /> class.
 /// </summary>
 /// <param name="AdditionalProperties">A map of additional properties, keyed on the property name.  Must match the names and types defined in the template for this item type.</param>
 /// <param name="Answers">The list of available answers.</param>
 /// <param name="Category">The category for the question (required).</param>
 /// <param name="Difficulty">The difficulty of the question (required).</param>
 /// <param name="ImportId">The id of the import job that created the question, or null if not from an import.</param>
 /// <param name="PublishedDate">When the question becomes available, null for never, in seconds since epoch.</param>
 /// <param name="Question">The question. Different &#39;type&#39; values indicate different structures as the question may be test, image, etc. See information on additional properties for the list and their structures (required).</param>
 /// <param name="Source1">The first source of the question.</param>
 /// <param name="Source2">The second source of the question.</param>
 /// <param name="Tags">The list of tags.</param>
 /// <param name="Template">A question template this question is validated against (private). May be null and no validation of additional_properties will be done.</param>
 /// <param name="Vendor">The supplier of the question.</param>
 public QuestionResource(Dictionary <string, Property> AdditionalProperties = default(Dictionary <string, Property>), List <AnswerResource> Answers = default(List <AnswerResource>), NestedCategory Category = default(NestedCategory), int?Difficulty = default(int?), long?ImportId = default(long?), long?PublishedDate = default(long?), Property Question = default(Property), string Source1 = default(string), string Source2 = default(string), List <string> Tags = default(List <string>), string Template = default(string), string Vendor = default(string))
 {
     // to ensure "Category" is required (not null)
     if (Category == null)
     {
         throw new InvalidDataException("Category is a required property for QuestionResource and cannot be null");
     }
     else
     {
         this.Category = Category;
     }
     // to ensure "Difficulty" is required (not null)
     if (Difficulty == null)
     {
         throw new InvalidDataException("Difficulty is a required property for QuestionResource and cannot be null");
     }
     else
     {
         this.Difficulty = Difficulty;
     }
     // to ensure "Question" is required (not null)
     if (Question == null)
     {
         throw new InvalidDataException("Question is a required property for QuestionResource and cannot be null");
     }
     else
     {
         this.Question = Question;
     }
     this.AdditionalProperties = AdditionalProperties;
     this.Answers       = Answers;
     this.ImportId      = ImportId;
     this.PublishedDate = PublishedDate;
     this.Source1       = Source1;
     this.Source2       = Source2;
     this.Tags          = Tags;
     this.Template      = Template;
     this.Vendor        = Vendor;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="PollResource" /> class.
 /// </summary>
 /// <param name="Active">Whether the poll is active (required).</param>
 /// <param name="AdditionalProperties">A map of additional properties, keyed on the property name.  Must match the names and types defined in the template for this item type.</param>
 /// <param name="Answers">The answers to the poll (required).</param>
 /// <param name="Category">The category for the poll (required).</param>
 /// <param name="Tags">The tags for the poll.</param>
 /// <param name="Template">A poll template this poll is validated against (private). May be null and no validation of additional_properties will be done.</param>
 /// <param name="Text">The text of the poll (required).</param>
 /// <param name="Type">The media type of the poll (required).</param>
 public PollResource(bool?Active = default(bool?), Dictionary <string, Property> AdditionalProperties = default(Dictionary <string, Property>), List <PollAnswerResource> Answers = default(List <PollAnswerResource>), NestedCategory Category = default(NestedCategory), List <string> Tags = default(List <string>), string Template = default(string), string Text = default(string), TypeEnum?Type = default(TypeEnum?))
 {
     // to ensure "Active" is required (not null)
     if (Active == null)
     {
         throw new InvalidDataException("Active is a required property for PollResource and cannot be null");
     }
     else
     {
         this.Active = Active;
     }
     // to ensure "Answers" is required (not null)
     if (Answers == null)
     {
         throw new InvalidDataException("Answers is a required property for PollResource and cannot be null");
     }
     else
     {
         this.Answers = Answers;
     }
     // to ensure "Category" is required (not null)
     if (Category == null)
     {
         throw new InvalidDataException("Category is a required property for PollResource and cannot be null");
     }
     else
     {
         this.Category = Category;
     }
     // to ensure "Text" is required (not null)
     if (Text == null)
     {
         throw new InvalidDataException("Text is a required property for PollResource and cannot be null");
     }
     else
     {
         this.Text = Text;
     }
     // to ensure "Type" is required (not null)
     if (Type == null)
     {
         throw new InvalidDataException("Type is a required property for PollResource and cannot be null");
     }
     else
     {
         this.Type = Type;
     }
     this.AdditionalProperties = AdditionalProperties;
     this.Tags     = Tags;
     this.Template = Template;
 }