/// <summary> /// Initializes a new instance of the <see cref="Body" /> class. /// </summary> /// <param name="name">Name of task (required).</param> /// <param name="duration">Duration of task.</param> /// <param name="taskTypeId">Id for type of task e.g Call / Email / Meeting etc. (required).</param> /// <param name="date">Task date/time (required).</param> /// <param name="notes">Notes added to a task.</param> /// <param name="done">Task marked as done.</param> /// <param name="assignToId">User id to whom task is assigned.</param> /// <param name="contactsIds">Contact ids for contacts linked to this task.</param> /// <param name="dealsIds">Deal ids for deals a task is linked to.</param> /// <param name="companiesIds">Companies ids for companies a task is linked to.</param> /// <param name="reminder">reminder.</param> public Body(string name = default(string), long?duration = default(long?), string taskTypeId = default(string), DateTime?date = default(DateTime?), string notes = default(string), bool?done = default(bool?), string assignToId = default(string), List <int?> contactsIds = default(List <int?>), List <string> dealsIds = default(List <string>), List <string> companiesIds = default(List <string>), TaskReminder reminder = default(TaskReminder)) { // to ensure "name" is required (not null) if (name == null) { throw new InvalidDataException("name is a required property for Body and cannot be null"); } else { this.Name = name; } // to ensure "taskTypeId" is required (not null) if (taskTypeId == null) { throw new InvalidDataException("taskTypeId is a required property for Body and cannot be null"); } else { this.TaskTypeId = taskTypeId; } // to ensure "date" is required (not null) if (date == null) { throw new InvalidDataException("date is a required property for Body and cannot be null"); } else { this.Date = date; } this.Duration = duration; this.Notes = notes; this.Done = done; this.AssignToId = assignToId; this.ContactsIds = contactsIds; this.DealsIds = dealsIds; this.CompaniesIds = companiesIds; this.Reminder = reminder; }
/// <summary> /// Initializes a new instance of the <see cref="Task" /> class. /// </summary> /// <param name="firstContact">firstContact.</param> /// <param name="id">Unique task id.</param> /// <param name="taskTypeId">Id for type of task e.g Call / Email / Meeting etc. (required).</param> /// <param name="name">Name of task (required).</param> /// <param name="contactsIds">Contact ids for contacts linked to this task.</param> /// <param name="contacts">Contact details for contacts linked to this task.</param> /// <param name="dealsIds">Deal ids for deals a task is linked to.</param> /// <param name="companiesIds">Companies ids for companies a task is linked to.</param> /// <param name="assignToId">User id to whom task is assigned.</param> /// <param name="date">Task date/time (required).</param> /// <param name="duration">Duration of task.</param> /// <param name="notes">Notes added to a task.</param> /// <param name="done">Task marked as done.</param> /// <param name="reminder">Task reminder date/time for a task.</param> /// <param name="createdAt">Task created date/time.</param> /// <param name="updatedAt">Task update date/time.</param> /// <param name="refs">refs.</param> public Task(Contact firstContact = default(Contact), string id = default(string), string taskTypeId = default(string), string name = default(string), List <int?> contactsIds = default(List <int?>), List <Contact> contacts = default(List <Contact>), List <string> dealsIds = default(List <string>), List <string> companiesIds = default(List <string>), string assignToId = default(string), DateTime?date = default(DateTime?), int?duration = default(int?), string notes = default(string), bool?done = default(bool?), TaskReminder reminder = default(TaskReminder), DateTime?createdAt = default(DateTime?), DateTime?updatedAt = default(DateTime?), Object refs = default(Object)) { // to ensure "taskTypeId" is required (not null) if (taskTypeId == null) { throw new InvalidDataException("taskTypeId is a required property for Task and cannot be null"); } else { this.TaskTypeId = taskTypeId; } // to ensure "name" is required (not null) if (name == null) { throw new InvalidDataException("name is a required property for Task and cannot be null"); } else { this.Name = name; } // to ensure "date" is required (not null) if (date == null) { throw new InvalidDataException("date is a required property for Task and cannot be null"); } else { this.Date = date; } this.FirstContact = firstContact; this.Id = id; this.ContactsIds = contactsIds; this.Contacts = contacts; this.DealsIds = dealsIds; this.CompaniesIds = companiesIds; this.AssignToId = assignToId; this.Duration = duration; this.Notes = notes; this.Done = done; this.Reminder = reminder; this.CreatedAt = createdAt; this.UpdatedAt = updatedAt; this.Refs = refs; }