Пример #1
0
        /// <summary>
        /// <para>Initializes a new instance of the <see cref="FolderMetadata" /> class.</para>
        /// </summary>
        /// <param name="name">The last component of the path (including extension). This never
        /// contains a slash.</param>
        /// <param name="id">A unique identifier for the folder.</param>
        /// <param name="pathLower">The lowercased full path in the user's Dropbox. This always
        /// starts with a slash. This field will be null if the file or folder is not
        /// mounted.</param>
        /// <param name="pathDisplay">The cased path to be used for display purposes only. In
        /// rare instances the casing will not correctly match the user's filesystem, but this
        /// behavior will match the path provided in the Core API v1, and at least the last
        /// path component will have the correct casing. Changes to only the casing of paths
        /// won't be returned by <see
        /// cref="Dropbox.Api.Files.Routes.FilesUserRoutes.ListFolderContinueAsync" />. This
        /// field will be null if the file or folder is not mounted.</param>
        /// <param name="parentSharedFolderId">Please use <see
        /// cref="Dropbox.Api.Files.FileSharingInfo.ParentSharedFolderId" /> or <see
        /// cref="Dropbox.Api.Files.FolderSharingInfo.ParentSharedFolderId" /> instead.</param>
        /// <param name="sharedFolderId">Please use <paramref name="sharingInfo" />
        /// instead.</param>
        /// <param name="sharingInfo">Set if the folder is contained in a shared folder or is a
        /// shared folder mount point.</param>
        /// <param name="propertyGroups">Additional information if the file has custom
        /// properties with the property template specified. Note that only properties
        /// associated with user-owned templates, not team-owned templates, can be attached to
        /// folders.</param>
        public FolderMetadata(string name,
                              string id,
                              string pathLower              = null,
                              string pathDisplay            = null,
                              string parentSharedFolderId   = null,
                              string sharedFolderId         = null,
                              FolderSharingInfo sharingInfo = null,
                              col.IEnumerable <global::Dropbox.Api.FileProperties.PropertyGroup> propertyGroups = null)
            : base(name, pathLower, pathDisplay, parentSharedFolderId)
        {
            if (id == null)
            {
                throw new sys.ArgumentNullException("id");
            }
            if (id.Length < 1)
            {
                throw new sys.ArgumentOutOfRangeException("id", "Length should be at least 1");
            }

            if (sharedFolderId != null)
            {
                if (!re.Regex.IsMatch(sharedFolderId, @"\A(?:[-_0-9a-zA-Z:]+)\z"))
                {
                    throw new sys.ArgumentOutOfRangeException("sharedFolderId", @"Value should match pattern '\A(?:[-_0-9a-zA-Z:]+)\z'");
                }
            }

            var propertyGroupsList = enc.Util.ToList(propertyGroups);

            this.Id             = id;
            this.SharedFolderId = sharedFolderId;
            this.SharingInfo    = sharingInfo;
            this.PropertyGroups = propertyGroupsList;
        }
        /// <summary>
        /// <para>Initializes a new instance of the <see cref="ListUsersOnFolderResponse" />
        /// class.</para>
        /// </summary>
        /// <param name="invitees">List of email addresses that are invited on the Paper
        /// folder.</param>
        /// <param name="users">List of users that are invited on the Paper folder.</param>
        /// <param name="cursor">Pass the cursor into <see
        /// cref="Dropbox.Api.Paper.Routes.PaperUserRoutes.DocsFolderUsersListContinueAsync" />
        /// to paginate through all users. The cursor preserves all properties as specified in
        /// the original call to <see
        /// cref="Dropbox.Api.Paper.Routes.PaperUserRoutes.DocsFolderUsersListAsync"
        /// />.</param>
        /// <param name="hasMore">Will be set to True if a subsequent call with the provided
        /// cursor to <see
        /// cref="Dropbox.Api.Paper.Routes.PaperUserRoutes.DocsFolderUsersListContinueAsync" />
        /// returns immediately with some results. If set to False please allow some delay
        /// before making another call to <see
        /// cref="Dropbox.Api.Paper.Routes.PaperUserRoutes.DocsFolderUsersListContinueAsync"
        /// />.</param>
        public ListUsersOnFolderResponse(col.IEnumerable <global::Dropbox.Api.Sharing.InviteeInfo> invitees,
                                         col.IEnumerable <global::Dropbox.Api.Sharing.UserInfo> users,
                                         Cursor cursor,
                                         bool hasMore)
        {
            var inviteesList = enc.Util.ToList(invitees);

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

            var usersList = enc.Util.ToList(users);

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

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

            this.Invitees = inviteesList;
            this.Users    = usersList;
            this.Cursor   = cursor;
            this.HasMore  = hasMore;
        }
        /// <summary>
        /// <para>Initializes a new instance of the <see cref="PropertyGroupUpdate" />
        /// class.</para>
        /// </summary>
        /// <param name="templateId">A unique identifier for a property template.</param>
        /// <param name="addOrUpdateFields">List of property fields to update if the field
        /// already exists. If the field doesn't exist, add the field to the property
        /// group.</param>
        /// <param name="removeFields">List of property field names to remove from property
        /// group if the field exists.</param>
        public PropertyGroupUpdate(string templateId,
                                   col.IEnumerable <Dropbox.Api.Properties.PropertyField> addOrUpdateFields = null,
                                   col.IEnumerable <string> removeFields = null)
        {
            if (templateId == null)
            {
                throw new sys.ArgumentNullException("templateId");
            }
            if (templateId.Length < 1)
            {
                throw new sys.ArgumentOutOfRangeException("templateId", "Length should be at least 1");
            }
            if (!re.Regex.IsMatch(templateId, @"\A(?:(/|ptid:).*)\z"))
            {
                throw new sys.ArgumentOutOfRangeException("templateId", @"Value should match pattern '\A(?:(/|ptid:).*)\z'");
            }

            var addOrUpdateFieldsList = enc.Util.ToList(addOrUpdateFields);

            var removeFieldsList = enc.Util.ToList(removeFields);

            this.TemplateId        = templateId;
            this.AddOrUpdateFields = addOrUpdateFieldsList;
            this.RemoveFields      = removeFieldsList;
        }
        /// <summary>
        /// <para>Initializes a new instance of the <see cref="UpdatePropertyTemplateArg" />
        /// class.</para>
        /// </summary>
        /// <param name="templateId">An identifier for property template added by <see
        /// cref="Dropbox.Api.Team.Routes.TeamTeamRoutes.PropertiesTemplateAddAsync"
        /// />.</param>
        /// <param name="name">A display name for the property template. Property template
        /// names can be up to 256 bytes.</param>
        /// <param name="description">Description for new property template. Property template
        /// descriptions can be up to 1024 bytes.</param>
        /// <param name="addFields">This is a list of custom properties to add to the property
        /// template. There can be up to 64 properties in a single property template.</param>
        public UpdatePropertyTemplateArg(string templateId,
                                         string name        = null,
                                         string description = null,
                                         col.IEnumerable <global::Dropbox.Api.Properties.PropertyFieldTemplate> addFields = null)
        {
            if (templateId == null)
            {
                throw new sys.ArgumentNullException("templateId");
            }
            if (templateId.Length < 1)
            {
                throw new sys.ArgumentOutOfRangeException("templateId", "Length should be at least 1");
            }
            if (!re.Regex.IsMatch(templateId, @"\A(?:(/|ptid:).*)\z"))
            {
                throw new sys.ArgumentOutOfRangeException("templateId", @"Value should match pattern '\A(?:(/|ptid:).*)\z'");
            }

            var addFieldsList = enc.Util.ToList(addFields);

            this.TemplateId  = templateId;
            this.Name        = name;
            this.Description = description;
            this.AddFields   = addFieldsList;
        }
Пример #5
0
        /// <summary>
        /// <para>Initializes a new instance of the <see cref="CommitInfo" /> class.</para>
        /// </summary>
        /// <param name="path">Path in the user's Dropbox to save the file.</param>
        /// <param name="mode">Selects what to do if the file already exists.</param>
        /// <param name="autorename">If there's a conflict, as determined by <paramref
        /// name="mode" />, have the Dropbox server try to autorename the file to avoid
        /// conflict.</param>
        /// <param name="clientModified">The value to store as the <paramref
        /// name="clientModified" /> timestamp. Dropbox automatically records the time at which
        /// the file was written to the Dropbox servers. It can also record an additional
        /// timestamp, provided by Dropbox desktop clients, mobile clients, and API apps of
        /// when the file was actually created or modified.</param>
        /// <param name="mute">Normally, users are made aware of any file modifications in
        /// their Dropbox account via notifications in the client software. If <c>true</c>,
        /// this tells the clients that this modification shouldn't result in a user
        /// notification.</param>
        /// <param name="propertyGroups">List of custom properties to add to file.</param>
        /// <param name="strictConflict">Be more strict about how each <see cref="WriteMode" />
        /// detects conflict. For example, always return a conflict error when <paramref
        /// name="mode" /> = <see cref="Dropbox.Api.Files.WriteMode.Update" /> and the given
        /// "rev" doesn't match the existing file's "rev", even if the existing file has been
        /// deleted. This also forces a conflict even when the target path refers to a file
        /// with identical contents.</param>
        public CommitInfo(string path,
                          WriteMode mode              = null,
                          bool autorename             = false,
                          sys.DateTime?clientModified = null,
                          bool mute = false,
                          col.IEnumerable <global::Dropbox.Api.FileProperties.PropertyGroup> propertyGroups = null,
                          bool strictConflict = false)
        {
            if (path == null)
            {
                throw new sys.ArgumentNullException("path");
            }
            if (!re.Regex.IsMatch(path, @"\A(?:(/(.|[\r\n])*)|(ns:[0-9]+(/.*)?)|(id:.*))\z"))
            {
                throw new sys.ArgumentOutOfRangeException("path", @"Value should match pattern '\A(?:(/(.|[\r\n])*)|(ns:[0-9]+(/.*)?)|(id:.*))\z'");
            }

            if (mode == null)
            {
                mode = global::Dropbox.Api.Files.WriteMode.Add.Instance;
            }
            var propertyGroupsList = enc.Util.ToList(propertyGroups);

            this.Path           = path;
            this.Mode           = mode;
            this.Autorename     = autorename;
            this.ClientModified = clientModified;
            this.Mute           = mute;
            this.PropertyGroups = propertyGroupsList;
            this.StrictConflict = strictConflict;
        }
Пример #6
0
 /// <summary>
 /// <para>Initializes a new instance of the <see cref="CommitInfoWithProperties" />
 /// class.</para>
 /// </summary>
 /// <param name="path">Path in the user's Dropbox to save the file.</param>
 /// <param name="mode">Selects what to do if the file already exists.</param>
 /// <param name="autorename">If there's a conflict, as determined by <paramref
 /// name="mode" />, have the Dropbox server try to autorename the file to avoid
 /// conflict.</param>
 /// <param name="clientModified">The value to store as the <paramref
 /// name="clientModified" /> timestamp. Dropbox automatically records the time at which
 /// the file was written to the Dropbox servers. It can also record an additional
 /// timestamp, provided by Dropbox desktop clients, mobile clients, and API apps of
 /// when the file was actually created or modified.</param>
 /// <param name="mute">Normally, users are made aware of any file modifications in
 /// their Dropbox account via notifications in the client software. If <c>true</c>,
 /// this tells the clients that this modification shouldn't result in a user
 /// notification.</param>
 /// <param name="propertyGroups">List of custom properties to add to file.</param>
 public CommitInfoWithProperties(string path,
                                 WriteMode mode              = null,
                                 bool autorename             = false,
                                 sys.DateTime?clientModified = null,
                                 bool mute = false,
                                 col.IEnumerable <global::Dropbox.Api.FileProperties.PropertyGroup> propertyGroups = null)
     : base(path, mode, autorename, clientModified, mute, propertyGroups)
 {
 }
Пример #7
0
        /// <summary>
        /// <para>Initializes a new instance of the <see cref="TeamFolderUpdateSyncSettingsArg"
        /// /> class.</para>
        /// </summary>
        /// <param name="teamFolderId">The ID of the team folder.</param>
        /// <param name="syncSetting">Sync setting to apply to the team folder itself. Only
        /// meaningful if the team folder is not a shared team root.</param>
        /// <param name="contentSyncSettings">Sync settings to apply to contents of this team
        /// folder.</param>
        public TeamFolderUpdateSyncSettingsArg(string teamFolderId,
                                               global::Dropbox.Api.Files.SyncSettingArg syncSetting = null,
                                               col.IEnumerable <global::Dropbox.Api.Files.ContentSyncSettingArg> contentSyncSettings = null)
            : base(teamFolderId)
        {
            var contentSyncSettingsList = enc.Util.ToList(contentSyncSettings);

            this.SyncSetting         = syncSetting;
            this.ContentSyncSettings = contentSyncSettingsList;
        }
        /// <summary>
        /// <para>Initializes a new instance of the <see cref="CommitInfoWithProperties" />
        /// class.</para>
        /// </summary>
        /// <param name="path">Path in the user's Dropbox to save the file.</param>
        /// <param name="mode">Selects what to do if the file already exists.</param>
        /// <param name="autorename">If there's a conflict, as determined by <paramref
        /// name="mode" />, have the Dropbox server try to autorename the file to avoid
        /// conflict.</param>
        /// <param name="clientModified">The value to store as the <paramref
        /// name="clientModified" /> timestamp. Dropbox automatically records the time at which
        /// the file was written to the Dropbox servers. It can also record an additional
        /// timestamp, provided by Dropbox desktop clients, mobile clients, and API apps of
        /// when the file was actually created or modified.</param>
        /// <param name="mute">Normally, users are made aware of any file modifications in
        /// their Dropbox account via notifications in the client software. If <c>true</c>,
        /// this tells the clients that this modification shouldn't result in a user
        /// notification.</param>
        /// <param name="propertyGroups">List of custom properties to add to file.</param>
        public CommitInfoWithProperties(string path,
                                        WriteMode mode              = null,
                                        bool autorename             = false,
                                        sys.DateTime?clientModified = null,
                                        bool mute = false,
                                        col.IEnumerable <Dropbox.Api.Properties.PropertyGroup> propertyGroups = null)
            : base(path, mode, autorename, clientModified, mute)
        {
            var propertyGroupsList = enc.Util.ToList(propertyGroups);

            this.PropertyGroups = propertyGroupsList;
        }
Пример #9
0
        /// <summary>
        /// <para>Initializes a new instance of the <see cref="GetStorageReport" />
        /// class.</para>
        /// </summary>
        /// <param name="startDate">First date present in the results as 'YYYY-MM-DD' or
        /// None.</param>
        /// <param name="totalUsage">Sum of the shared, unshared, and datastore usages, for
        /// each day.</param>
        /// <param name="sharedUsage">Array of the combined size (bytes) of team members'
        /// shared folders, for each day.</param>
        /// <param name="unsharedUsage">Array of the combined size (bytes) of team members'
        /// root namespaces, for each day.</param>
        /// <param name="sharedFolders">Array of the number of shared folders owned by team
        /// members, for each day.</param>
        /// <param name="memberStorageMap">Array of storage summaries of team members' account
        /// sizes. Each storage summary is an array of key, value pairs, where each pair
        /// describes a storage bucket. The key indicates the upper bound of the bucket and the
        /// value is the number of users in that bucket. There is one such summary per day. If
        /// there is no data for a day, the storage summary will be empty.</param>
        public GetStorageReport(string startDate,
                                col.IEnumerable <ulong?> totalUsage,
                                col.IEnumerable <ulong?> sharedUsage,
                                col.IEnumerable <ulong?> unsharedUsage,
                                col.IEnumerable <ulong?> sharedFolders,
                                col.IEnumerable <col.IEnumerable <StorageBucket> > memberStorageMap)
            : base(startDate)
        {
            var totalUsageList = enc.Util.ToList(totalUsage);

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

            var sharedUsageList = enc.Util.ToList(sharedUsage);

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

            var unsharedUsageList = enc.Util.ToList(unsharedUsage);

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

            var sharedFoldersList = enc.Util.ToList(sharedFolders);

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

            var memberStorageMapList = enc.Util.ToList(memberStorageMap);

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

            this.TotalUsage       = totalUsageList;
            this.SharedUsage      = sharedUsageList;
            this.UnsharedUsage    = unsharedUsageList;
            this.SharedFolders    = sharedFoldersList;
            this.MemberStorageMap = memberStorageMapList;
        }
Пример #10
0
        /// <summary>
        /// <para>Initializes a new instance of the <see cref="FileMetadata" /> class.</para>
        /// </summary>
        /// <param name="name">The last component of the path (including extension). This never
        /// contains a slash.</param>
        /// <param name="pathLower">The lowercased full path in the user's Dropbox. This always
        /// starts with a slash.</param>
        /// <param name="pathDisplay">The cased path to be used for display purposes only. In
        /// rare instances the casing will not correctly match the user's filesystem, but this
        /// behavior will match the path provided in the Core API v1. Changes to the casing of
        /// paths won't be returned by <see
        /// cref="Dropbox.Api.Files.Routes.FilesRoutes.ListFolderContinueAsync" /></param>
        /// <param name="id">A unique identifier for the file.</param>
        /// <param name="clientModified">For files, this is the modification time set by the
        /// desktop client when the file was added to Dropbox. Since this time is not verified
        /// (the Dropbox server stores whatever the desktop client sends up), this should only
        /// be used for display purposes (such as sorting) and not, for example, to determine
        /// if a file has changed or not.</param>
        /// <param name="serverModified">The last time the file was modified on
        /// Dropbox.</param>
        /// <param name="rev">A unique identifier for the current revision of a file. This
        /// field is the same rev as elsewhere in the API and can be used to detect changes and
        /// avoid conflicts.</param>
        /// <param name="size">The file size in bytes.</param>
        /// <param name="parentSharedFolderId">Deprecated. Please use <see
        /// cref="Dropbox.Api.Files.FileSharingInfo.ParentSharedFolderId" /> or <see
        /// cref="Dropbox.Api.Files.FolderSharingInfo.ParentSharedFolderId" /> instead.</param>
        /// <param name="mediaInfo">Additional information if the file is a photo or
        /// video.</param>
        /// <param name="sharingInfo">Set if this file is contained in a shared folder.</param>
        /// <param name="propertyGroups">Additional information if the file has custom
        /// properties with the property template specified.</param>
        /// <param name="hasExplicitSharedMembers">This flag will only be present if
        /// include_has_explicit_shared_members  is true in <see
        /// cref="Dropbox.Api.Files.Routes.FilesRoutes.ListFolderAsync" /> or <see
        /// cref="Dropbox.Api.Files.Routes.FilesRoutes.GetMetadataAsync" />. If this  flag is
        /// present, it will be true if this file has any explicit shared  members. This is
        /// different from sharing_info in that this could be true  in the case where a file
        /// has explicit members but is not contained within  a shared folder.</param>
        public FileMetadata(string name,
                            string pathLower,
                            string pathDisplay,
                            string id,
                            sys.DateTime clientModified,
                            sys.DateTime serverModified,
                            string rev,
                            ulong size,
                            string parentSharedFolderId = null,
                            MediaInfo mediaInfo         = null,
                            FileSharingInfo sharingInfo = null,
                            col.IEnumerable <Dropbox.Api.Properties.PropertyGroup> propertyGroups = null,
                            bool?hasExplicitSharedMembers = null)
            : base(name, pathLower, pathDisplay, parentSharedFolderId)
        {
            if (id == null)
            {
                throw new sys.ArgumentNullException("id");
            }
            if (id.Length < 1)
            {
                throw new sys.ArgumentOutOfRangeException("id", "Length should be at least 1");
            }

            if (rev == null)
            {
                throw new sys.ArgumentNullException("rev");
            }
            if (rev.Length < 9)
            {
                throw new sys.ArgumentOutOfRangeException("rev", "Length should be at least 9");
            }
            if (!re.Regex.IsMatch(rev, @"\A(?:[0-9a-f]+)\z"))
            {
                throw new sys.ArgumentOutOfRangeException("rev", @"Value should match pattern '\A(?:[0-9a-f]+)\z'");
            }

            var propertyGroupsList = enc.Util.ToList(propertyGroups);

            this.Id                       = id;
            this.ClientModified           = clientModified;
            this.ServerModified           = serverModified;
            this.Rev                      = rev;
            this.Size                     = size;
            this.MediaInfo                = mediaInfo;
            this.SharingInfo              = sharingInfo;
            this.PropertyGroups           = propertyGroupsList;
            this.HasExplicitSharedMembers = hasExplicitSharedMembers;
        }
Пример #11
0
        /// <summary>
        /// <para>Initializes a new instance of the <see cref="TeamFolderMetadata" />
        /// class.</para>
        /// </summary>
        /// <param name="teamFolderId">The ID of the team folder.</param>
        /// <param name="name">The name of the team folder.</param>
        /// <param name="status">The status of the team folder.</param>
        /// <param name="isTeamSharedDropbox">True if this team folder is a shared team
        /// root.</param>
        /// <param name="syncSetting">The sync setting applied to this team folder.</param>
        /// <param name="contentSyncSettings">Sync settings applied to contents of this team
        /// folder.</param>
        public TeamFolderMetadata(string teamFolderId,
                                  string name,
                                  TeamFolderStatus status,
                                  bool isTeamSharedDropbox,
                                  global::Dropbox.Api.Files.SyncSetting syncSetting,
                                  col.IEnumerable <global::Dropbox.Api.Files.ContentSyncSetting> contentSyncSettings)
        {
            if (teamFolderId == null)
            {
                throw new sys.ArgumentNullException("teamFolderId");
            }
            if (!re.Regex.IsMatch(teamFolderId, @"\A(?:[-_0-9a-zA-Z:]+)\z"))
            {
                throw new sys.ArgumentOutOfRangeException("teamFolderId", @"Value should match pattern '\A(?:[-_0-9a-zA-Z:]+)\z'");
            }

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

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

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

            var contentSyncSettingsList = enc.Util.ToList(contentSyncSettings);

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

            this.TeamFolderId        = teamFolderId;
            this.Name                = name;
            this.Status              = status;
            this.IsTeamSharedDropbox = isTeamSharedDropbox;
            this.SyncSetting         = syncSetting;
            this.ContentSyncSettings = contentSyncSettingsList;
        }
        /// <summary>
        /// <para>Initializes a new instance of the <see cref="GroupsListResult" />
        /// class.</para>
        /// </summary>
        /// <param name="groups">The groups</param>
        /// <param name="cursor">Pass the cursor into <see
        /// cref="Dropbox.Api.Team.Routes.TeamTeamRoutes.GroupsListContinueAsync" /> to obtain
        /// the additional groups.</param>
        /// <param name="hasMore">Is true if there are additional groups that have not been
        /// returned yet. An additional call to <see
        /// cref="Dropbox.Api.Team.Routes.TeamTeamRoutes.GroupsListContinueAsync" /> can
        /// retrieve them.</param>
        public GroupsListResult(col.IEnumerable <global::Dropbox.Api.TeamCommon.GroupSummary> groups,
                                string cursor,
                                bool hasMore)
        {
            var groupsList = enc.Util.ToList(groups);

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

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

            this.Groups  = groupsList;
            this.Cursor  = cursor;
            this.HasMore = hasMore;
        }
Пример #13
0
        /// <summary>
        /// <para>Initializes a new instance of the <see cref="PropertyGroupWithPath" />
        /// class.</para>
        /// </summary>
        /// <param name="path">A unique identifier for the file.</param>
        /// <param name="propertyGroups">Filled custom property templates associated with a
        /// file.</param>
        public PropertyGroupWithPath(string path,
                                     col.IEnumerable <Dropbox.Api.Properties.PropertyGroup> propertyGroups)
        {
            if (path == null)
            {
                throw new sys.ArgumentNullException("path");
            }
            if (!re.Regex.IsMatch(path, @"\A(?:/(.|[\r\n])*|id:.*)\z"))
            {
                throw new sys.ArgumentOutOfRangeException("path", @"Value should match pattern '\A(?:/(.|[\r\n])*|id:.*)\z'");
            }

            var propertyGroupsList = enc.Util.ToList(propertyGroups);

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

            this.Path           = path;
            this.PropertyGroups = propertyGroupsList;
        }
        /// <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="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="groups">List of group IDs of groups that the user belongs to.</param>
        /// <param name="memberFolderId">The namespace id of the user's root folder.</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="secondaryEmails">Secondary emails of a user.</param>
        /// <param name="invitedOn">The date and time the user was invited to the team
        /// (contains value only when the member's status matches <see
        /// cref="Dropbox.Api.Team.TeamMemberStatus.Invited" />).</param>
        /// <param name="joinedOn">The date and time the user joined as a member of a specific
        /// team.</param>
        /// <param name="suspendedOn">The date and time the user was suspended from the team
        /// (contains value only when the member's status matches <see
        /// cref="Dropbox.Api.Team.TeamMemberStatus.Suspended" />).</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>
        /// <param name="isDirectoryRestricted">Whether the user is a directory restricted
        /// user.</param>
        /// <param name="profilePhotoUrl">URL for the photo representing the user, if one is
        /// set.</param>
        public TeamMemberProfile(string teamMemberId,
                                 string email,
                                 bool emailVerified,
                                 TeamMemberStatus status,
                                 global::Dropbox.Api.Users.Name name,
                                 TeamMembershipType membershipType,
                                 col.IEnumerable <string> groups,
                                 string memberFolderId,
                                 string externalId = null,
                                 string accountId  = null,
                                 col.IEnumerable <global::Dropbox.Api.SecondaryEmails.SecondaryEmail> secondaryEmails = null,
                                 sys.DateTime?invitedOn     = null,
                                 sys.DateTime?joinedOn      = null,
                                 sys.DateTime?suspendedOn   = null,
                                 string persistentId        = null,
                                 bool?isDirectoryRestricted = null,
                                 string profilePhotoUrl     = null)
            : base(teamMemberId, email, emailVerified, status, name, membershipType, externalId, accountId, secondaryEmails, invitedOn, joinedOn, suspendedOn, persistentId, isDirectoryRestricted, profilePhotoUrl)
        {
            var groupsList = enc.Util.ToList(groups);

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

            if (memberFolderId == null)
            {
                throw new sys.ArgumentNullException("memberFolderId");
            }
            if (!re.Regex.IsMatch(memberFolderId, @"\A(?:[-_0-9a-zA-Z:]+)\z"))
            {
                throw new sys.ArgumentOutOfRangeException("memberFolderId", @"Value should match pattern '\A(?:[-_0-9a-zA-Z:]+)\z'");
            }

            this.Groups         = groupsList;
            this.MemberFolderId = memberFolderId;
        }
Пример #15
0
        /// <summary>
        /// <para>Initializes a new instance of the <see cref="FileMetadata" /> class.</para>
        /// </summary>
        /// <param name="name">The last component of the path (including extension). This never
        /// contains a slash.</param>
        /// <param name="id">A unique identifier for the file.</param>
        /// <param name="clientModified">For files, this is the modification time set by the
        /// desktop client when the file was added to Dropbox. Since this time is not verified
        /// (the Dropbox server stores whatever the desktop client sends up), this should only
        /// be used for display purposes (such as sorting) and not, for example, to determine
        /// if a file has changed or not.</param>
        /// <param name="serverModified">The last time the file was modified on
        /// Dropbox.</param>
        /// <param name="rev">A unique identifier for the current revision of a file. This
        /// field is the same rev as elsewhere in the API and can be used to detect changes and
        /// avoid conflicts.</param>
        /// <param name="size">The file size in bytes.</param>
        /// <param name="pathLower">The lowercased full path in the user's Dropbox. This always
        /// starts with a slash. This field will be null if the file or folder is not
        /// mounted.</param>
        /// <param name="pathDisplay">The cased path to be used for display purposes only. In
        /// rare instances the casing will not correctly match the user's filesystem, but this
        /// behavior will match the path provided in the Core API v1, and at least the last
        /// path component will have the correct casing. Changes to only the casing of paths
        /// won't be returned by <see
        /// cref="Dropbox.Api.Files.Routes.FilesUserRoutes.ListFolderContinueAsync" />. This
        /// field will be null if the file or folder is not mounted.</param>
        /// <param name="parentSharedFolderId">Please use <see
        /// cref="Dropbox.Api.Files.FileSharingInfo.ParentSharedFolderId" /> or <see
        /// cref="Dropbox.Api.Files.FolderSharingInfo.ParentSharedFolderId" /> instead.</param>
        /// <param name="mediaInfo">Additional information if the file is a photo or video.
        /// This field will not be set on entries returned by <see
        /// cref="Dropbox.Api.Files.Routes.FilesUserRoutes.ListFolderAsync" />, <see
        /// cref="Dropbox.Api.Files.Routes.FilesUserRoutes.ListFolderContinueAsync" />, or <see
        /// cref="Dropbox.Api.Files.Routes.FilesUserRoutes.GetThumbnailBatchAsync" />, starting
        /// December 2, 2019.</param>
        /// <param name="symlinkInfo">Set if this file is a symlink.</param>
        /// <param name="sharingInfo">Set if this file is contained in a shared folder.</param>
        /// <param name="isDownloadable">If true, file can be downloaded directly; else the
        /// file must be exported.</param>
        /// <param name="exportInfo">Information about format this file can be exported to.
        /// This filed must be set if <paramref name="isDownloadable" /> is set to
        /// false.</param>
        /// <param name="propertyGroups">Additional information if the file has custom
        /// properties with the property template specified.</param>
        /// <param name="hasExplicitSharedMembers">This flag will only be present if
        /// include_has_explicit_shared_members  is true in <see
        /// cref="Dropbox.Api.Files.Routes.FilesUserRoutes.ListFolderAsync" /> or <see
        /// cref="Dropbox.Api.Files.Routes.FilesUserRoutes.GetMetadataAsync" />. If this  flag
        /// is present, it will be true if this file has any explicit shared  members. This is
        /// different from sharing_info in that this could be true  in the case where a file
        /// has explicit members but is not contained within  a shared folder.</param>
        /// <param name="contentHash">A hash of the file content. This field can be used to
        /// verify data integrity. For more information see our <a
        /// href="https://www.dropbox.com/developers/reference/content-hash">Content hash</a>
        /// page.</param>
        /// <param name="fileLockInfo">If present, the metadata associated with the file's
        /// current lock.</param>
        public FileMetadata(string name,
                            string id,
                            sys.DateTime clientModified,
                            sys.DateTime serverModified,
                            string rev,
                            ulong size,
                            string pathLower            = null,
                            string pathDisplay          = null,
                            string parentSharedFolderId = null,
                            MediaInfo mediaInfo         = null,
                            SymlinkInfo symlinkInfo     = null,
                            FileSharingInfo sharingInfo = null,
                            bool isDownloadable         = true,
                            ExportInfo exportInfo       = null,
                            col.IEnumerable <global::Dropbox.Api.FileProperties.PropertyGroup> propertyGroups = null,
                            bool?hasExplicitSharedMembers = null,
                            string contentHash            = null,
                            FileLockMetadata fileLockInfo = null)
            : base(name, pathLower, pathDisplay, parentSharedFolderId)
        {
            if (id == null)
            {
                throw new sys.ArgumentNullException("id");
            }
            if (id.Length < 1)
            {
                throw new sys.ArgumentOutOfRangeException("id", "Length should be at least 1");
            }

            if (rev == null)
            {
                throw new sys.ArgumentNullException("rev");
            }
            if (rev.Length < 9)
            {
                throw new sys.ArgumentOutOfRangeException("rev", "Length should be at least 9");
            }
            if (!re.Regex.IsMatch(rev, @"\A(?:[0-9a-f]+)\z"))
            {
                throw new sys.ArgumentOutOfRangeException("rev", @"Value should match pattern '\A(?:[0-9a-f]+)\z'");
            }

            var propertyGroupsList = enc.Util.ToList(propertyGroups);

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

            this.Id                       = id;
            this.ClientModified           = clientModified;
            this.ServerModified           = serverModified;
            this.Rev                      = rev;
            this.Size                     = size;
            this.MediaInfo                = mediaInfo;
            this.SymlinkInfo              = symlinkInfo;
            this.SharingInfo              = sharingInfo;
            this.IsDownloadable           = isDownloadable;
            this.ExportInfo               = exportInfo;
            this.PropertyGroups           = propertyGroupsList;
            this.HasExplicitSharedMembers = hasExplicitSharedMembers;
            this.ContentHash              = contentHash;
            this.FileLockInfo             = fileLockInfo;
        }
Пример #16
0
 /// <summary>
 /// <para>Initializes a new instance of the <see cref="AddPropertyTemplateArg" />
 /// class.</para>
 /// </summary>
 /// <param name="name">A display name for the property template. Property template
 /// names can be up to 256 bytes.</param>
 /// <param name="description">Description for new property template. Property template
 /// descriptions can be up to 1024 bytes.</param>
 /// <param name="fields">This is a list of custom properties associated with a property
 /// template. There can be up to 64 properties in a single property template.</param>
 public AddPropertyTemplateArg(string name,
                               string description,
                               col.IEnumerable <global::Dropbox.Api.Properties.PropertyFieldTemplate> fields)
     : base(name, description, fields)
 {
 }
Пример #17
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="secondaryEmails">Secondary emails of a user.</param>
        /// <param name="invitedOn">The date and time the user was invited to the team
        /// (contains value only when the member's status matches <see
        /// cref="Dropbox.Api.Team.TeamMemberStatus.Invited" />).</param>
        /// <param name="joinedOn">The date and time the user joined as a member of a specific
        /// team.</param>
        /// <param name="suspendedOn">The date and time the user was suspended from the team
        /// (contains value only when the member's status matches <see
        /// cref="Dropbox.Api.Team.TeamMemberStatus.Suspended" />).</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>
        /// <param name="isDirectoryRestricted">Whether the user is a directory restricted
        /// user.</param>
        /// <param name="profilePhotoUrl">URL for the photo representing the user, if one is
        /// set.</param>
        public MemberProfile(string teamMemberId,
                             string email,
                             bool emailVerified,
                             TeamMemberStatus status,
                             global::Dropbox.Api.Users.Name name,
                             TeamMembershipType membershipType,
                             string externalId = null,
                             string accountId  = null,
                             col.IEnumerable <global::Dropbox.Api.SecondaryEmails.SecondaryEmail> secondaryEmails = null,
                             sys.DateTime?invitedOn     = null,
                             sys.DateTime?joinedOn      = null,
                             sys.DateTime?suspendedOn   = null,
                             string persistentId        = null,
                             bool?isDirectoryRestricted = null,
                             string profilePhotoUrl     = 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");
                }
            }

            var secondaryEmailsList = enc.Util.ToList(secondaryEmails);

            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.SecondaryEmails       = secondaryEmailsList;
            this.InvitedOn             = invitedOn;
            this.JoinedOn              = joinedOn;
            this.SuspendedOn           = suspendedOn;
            this.PersistentId          = persistentId;
            this.IsDirectoryRestricted = isDirectoryRestricted;
            this.ProfilePhotoUrl       = profilePhotoUrl;
        }