Пример #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ResourceOwner" /> class.
 /// </summary>
 /// <param name="role">role (default to RoleEnum.Owner).</param>
 public ResourceOwner(RoleEnum?role = RoleEnum.Owner, string oauthID = default(string), string name = default(string), StatusEnum?status = StatusEnum.Active, UserLinks links = default(UserLinks)) : base(oauthID, name, status, links)
 {
     // use default value if no "role" provided
     if (role == null)
     {
         this.Role = RoleEnum.Owner;
     }
     else
     {
         this.Role = role;
     }
 }
Пример #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="User" /> class.
 /// </summary>
 /// <param name="oauthID">oauthID.</param>
 /// <param name="name">name (required).</param>
 /// <param name="status">if inactive the user is inactive. (default to StatusEnum.Active).</param>
 /// <param name="links">links.</param>
 public User(string oauthID = default(string), string name = default(string), StatusEnum?status = StatusEnum.Active, UserLinks links = default(UserLinks))
 {
     // to ensure "name" is required (not null)
     if (name == null)
     {
         throw new InvalidDataException("name is a required property for User and cannot be null");
     }
     else
     {
         this.Name = name;
     }
     this.OauthID = oauthID;
     // use default value if no "status" provided
     if (status == null)
     {
         this.Status = StatusEnum.Active;
     }
     else
     {
         this.Status = status;
     }
     this.Links = links;
 }