Exemple #1
0
        /// <summary>
        /// <para>Initializes a new instance of the <see cref="MemberProfile" /> class.</para>
        /// </summary>
        /// <param name="teamMemberId">ID of user as a member of a team.</param>
        /// <param name="email">Email address of user.</param>
        /// <param name="emailVerified">Is true if the user's email is verified to be owned by
        /// the user.</param>
        /// <param name="status">The user's status as a member of a specific team.</param>
        /// <param name="name">Representations for a person's name.</param>
        /// <param name="externalId">External ID that a team can attach to the user. An
        /// application using the API may find it easier to use their own IDs instead of
        /// Dropbox IDs like account_id or team_member_id.</param>
        public MemberProfile(string teamMemberId,
                             string email,
                             bool emailVerified,
                             TeamMemberStatus status,
                             Dropbox.Api.Users.Name name,
                             string externalId = null)
        {
            if (teamMemberId == null)
            {
                throw new sys.ArgumentNullException("teamMemberId");
            }

            if (email == null)
            {
                throw new sys.ArgumentNullException("email");
            }

            if (status == null)
            {
                throw new sys.ArgumentNullException("status");
            }

            if (name == null)
            {
                throw new sys.ArgumentNullException("name");
            }

            this.TeamMemberId  = teamMemberId;
            this.Email         = email;
            this.EmailVerified = emailVerified;
            this.Status        = status;
            this.Name          = name;
            this.ExternalId    = externalId;
        }
Exemple #2
0
        /// <summary>
        /// <para>Initializes a new instance of the <see cref="MemberProfile" /> class.</para>
        /// </summary>
        /// <param name="teamMemberId">ID of user as a member of a team.</param>
        /// <param name="email">Email address of user.</param>
        /// <param name="emailVerified">Is true if the user's email is verified to be owned by
        /// the user.</param>
        /// <param name="status">The user's status as a member of a specific team.</param>
        /// <param name="name">Representations for a person's name.</param>
        /// <param name="membershipType">The user's membership type: full (normal team member)
        /// vs limited (does not use a license; no access to the team's shared quota).</param>
        /// <param name="externalId">External ID that a team can attach to the user. An
        /// application using the API may find it easier to use their own IDs instead of
        /// Dropbox IDs like account_id or team_member_id.</param>
        /// <param name="accountId">A user's account identifier.</param>
        /// <param name="joinedOn">The date and time the user joined as a member of a specific
        /// team.</param>
        /// <param name="persistentId">Persistent ID that a team can attach to the user. The
        /// persistent ID is unique ID to be used for SAML authentication.</param>
        public MemberProfile(string teamMemberId,
                             string email,
                             bool emailVerified,
                             TeamMemberStatus status,
                             Dropbox.Api.Users.Name name,
                             TeamMembershipType membershipType,
                             string externalId     = null,
                             string accountId      = null,
                             sys.DateTime?joinedOn = null,
                             string persistentId   = null)
        {
            if (teamMemberId == null)
            {
                throw new sys.ArgumentNullException("teamMemberId");
            }

            if (email == null)
            {
                throw new sys.ArgumentNullException("email");
            }

            if (status == null)
            {
                throw new sys.ArgumentNullException("status");
            }

            if (name == null)
            {
                throw new sys.ArgumentNullException("name");
            }

            if (membershipType == null)
            {
                throw new sys.ArgumentNullException("membershipType");
            }

            if (accountId != null)
            {
                if (accountId.Length < 40)
                {
                    throw new sys.ArgumentOutOfRangeException("accountId", "Length should be at least 40");
                }
                if (accountId.Length > 40)
                {
                    throw new sys.ArgumentOutOfRangeException("accountId", "Length should be at most 40");
                }
            }

            this.TeamMemberId   = teamMemberId;
            this.Email          = email;
            this.EmailVerified  = emailVerified;
            this.Status         = status;
            this.Name           = name;
            this.MembershipType = membershipType;
            this.ExternalId     = externalId;
            this.AccountId      = accountId;
            this.JoinedOn       = joinedOn;
            this.PersistentId   = persistentId;
        }
Exemple #3
0
        /// <summary>
        /// <para>Initializes a new instance of the <see cref="TeamMemberProfile" />
        /// class.</para>
        /// </summary>
        /// <param name="teamMemberId">ID of user as a member of a team.</param>
        /// <param name="email">Email address of user.</param>
        /// <param name="emailVerified">Is true if the user's email is verified to be owned by
        /// the user.</param>
        /// <param name="status">The user's status as a member of a specific team.</param>
        /// <param name="name">Representations for a person's name.</param>
        /// <param name="groups">List of group IDs of groups that the user belongs to.</param>
        /// <param name="externalId">External ID that a team can attach to the user. An
        /// application using the API may find it easier to use their own IDs instead of
        /// Dropbox IDs like account_id or team_member_id.</param>
        public TeamMemberProfile(string teamMemberId,
                                 string email,
                                 bool emailVerified,
                                 TeamMemberStatus status,
                                 Dropbox.Api.Users.Name name,
                                 col.IEnumerable <string> groups,
                                 string externalId = null)
            : base(teamMemberId, email, emailVerified, status, name, externalId)
        {
            var groupsList = enc.Util.ToList(groups);

            if (groups == null)
            {
                throw new sys.ArgumentNullException("groups");
            }

            this.Groups = groupsList;
        }