コード例 #1
0
        /// <summary>
        /// <para>Initializes a new instance of the <see cref="AlphaGetMetadataArg" />
        /// class.</para>
        /// </summary>
        /// <param name="path">The path of a file or folder on Dropbox.</param>
        /// <param name="includeMediaInfo">If true, <see
        /// cref="Dropbox.Api.Files.FileMetadata.MediaInfo" /> is set for photo and
        /// video.</param>
        /// <param name="includeDeleted">If true, <see cref="DeletedMetadata" /> will be
        /// returned for deleted file or folder, otherwise <see
        /// cref="Dropbox.Api.Files.LookupError.NotFound" /> will be returned.</param>
        /// <param name="includeHasExplicitSharedMembers">If true, the results will include a
        /// flag for each file indicating whether or not  that file has any explicit
        /// members.</param>
        /// <param name="includePropertyGroups">If set to a valid list of template IDs, <see
        /// cref="Dropbox.Api.Files.FileMetadata.PropertyGroups" /> is set if there exists
        /// property data associated with the file and each of the listed templates.</param>
        /// <param name="includePropertyTemplates">If set to a valid list of template IDs, <see
        /// cref="Dropbox.Api.Files.FileMetadata.PropertyGroups" /> is set for files with
        /// custom properties.</param>
        public AlphaGetMetadataArg(string path,
                                   bool includeMediaInfo = false,
                                   bool includeDeleted   = false,
                                   bool includeHasExplicitSharedMembers = false,
                                   global::Dropbox.Api.FileProperties.TemplateFilterBase includePropertyGroups = null,
                                   col.IEnumerable <string> includePropertyTemplates = null)
            : base(path, includeMediaInfo, includeDeleted, includeHasExplicitSharedMembers, includePropertyGroups)
        {
            var includePropertyTemplatesList = enc.Util.ToList(includePropertyTemplates);

            this.IncludePropertyTemplates = includePropertyTemplatesList;
        }
コード例 #2
0
        /// <summary>
        /// <para>Initializes a new instance of the <see cref="ListFolderArg" /> class.</para>
        /// </summary>
        /// <param name="path">A unique identifier for the file.</param>
        /// <param name="recursive">If true, the list folder operation will be applied
        /// recursively to all subfolders and the response will contain contents of all
        /// subfolders.</param>
        /// <param name="includeMediaInfo">If true, <see
        /// cref="Dropbox.Api.Files.FileMetadata.MediaInfo" /> is set for photo and video. This
        /// parameter will no longer have an effect starting December 2, 2019.</param>
        /// <param name="includeDeleted">If true, the results will include entries for files
        /// and folders that used to exist but were deleted.</param>
        /// <param name="includeHasExplicitSharedMembers">If true, the results will include a
        /// flag for each file indicating whether or not  that file has any explicit
        /// members.</param>
        /// <param name="includeMountedFolders">If true, the results will include entries under
        /// mounted folders which includes app folder, shared folder and team folder.</param>
        /// <param name="limit">The maximum number of results to return per request. Note: This
        /// is an approximate number and there can be slightly more entries returned in some
        /// cases.</param>
        /// <param name="sharedLink">A shared link to list the contents of. If the link is
        /// password-protected, the password must be provided. If this field is present, <see
        /// cref="Dropbox.Api.Files.ListFolderArg.Path" /> will be relative to root of the
        /// shared link. Only non-recursive mode is supported for shared link.</param>
        /// <param name="includePropertyGroups">If set to a valid list of template IDs, <see
        /// cref="Dropbox.Api.Files.FileMetadata.PropertyGroups" /> is set if there exists
        /// property data associated with the file and each of the listed templates.</param>
        /// <param name="includeNonDownloadableFiles">If true, include files that are not
        /// downloadable, i.e. Google Docs.</param>
        public ListFolderArg(string path,
                             bool recursive        = false,
                             bool includeMediaInfo = false,
                             bool includeDeleted   = false,
                             bool includeHasExplicitSharedMembers = false,
                             bool includeMountedFolders           = true,
                             uint?limit            = null,
                             SharedLink sharedLink = null,
                             global::Dropbox.Api.FileProperties.TemplateFilterBase includePropertyGroups = null,
                             bool includeNonDownloadableFiles = true)
        {
            if (path == null)
            {
                throw new sys.ArgumentNullException("path");
            }
            if (!re.Regex.IsMatch(path, @"\A(?:(/(.|[\r\n])*)?|id:.*|(ns:[0-9]+(/.*)?))\z"))
            {
                throw new sys.ArgumentOutOfRangeException("path", @"Value should match pattern '\A(?:(/(.|[\r\n])*)?|id:.*|(ns:[0-9]+(/.*)?))\z'");
            }

            if (limit != null)
            {
                if (limit < 1U)
                {
                    throw new sys.ArgumentOutOfRangeException("limit", "Value should be greater or equal than 1");
                }
                if (limit > 2000U)
                {
                    throw new sys.ArgumentOutOfRangeException("limit", "Value should be less of equal than 2000");
                }
            }

            this.Path             = path;
            this.Recursive        = recursive;
            this.IncludeMediaInfo = includeMediaInfo;
            this.IncludeDeleted   = includeDeleted;
            this.IncludeHasExplicitSharedMembers = includeHasExplicitSharedMembers;
            this.IncludeMountedFolders           = includeMountedFolders;
            this.Limit                       = limit;
            this.SharedLink                  = sharedLink;
            this.IncludePropertyGroups       = includePropertyGroups;
            this.IncludeNonDownloadableFiles = includeNonDownloadableFiles;
        }
コード例 #3
0
        /// <summary>
        /// <para>Initializes a new instance of the <see cref="GetMetadataArg" /> class.</para>
        /// </summary>
        /// <param name="path">The path of a file or folder on Dropbox.</param>
        /// <param name="includeMediaInfo">If true, <see
        /// cref="Dropbox.Api.Files.FileMetadata.MediaInfo" /> is set for photo and
        /// video.</param>
        /// <param name="includeDeleted">If true, <see cref="DeletedMetadata" /> will be
        /// returned for deleted file or folder, otherwise <see
        /// cref="Dropbox.Api.Files.LookupError.NotFound" /> will be returned.</param>
        /// <param name="includeHasExplicitSharedMembers">If true, the results will include a
        /// flag for each file indicating whether or not  that file has any explicit
        /// members.</param>
        /// <param name="includePropertyGroups">If set to a valid list of template IDs, <see
        /// cref="Dropbox.Api.Files.FileMetadata.PropertyGroups" /> is set if there exists
        /// property data associated with the file and each of the listed templates.</param>
        public GetMetadataArg(string path,
                              bool includeMediaInfo = false,
                              bool includeDeleted   = false,
                              bool includeHasExplicitSharedMembers = false,
                              global::Dropbox.Api.FileProperties.TemplateFilterBase includePropertyGroups = null)
        {
            if (path == null)
            {
                throw new sys.ArgumentNullException("path");
            }
            if (!re.Regex.IsMatch(path, @"\A(?:(/(.|[\r\n])*|id:.*)|(rev:[0-9a-f]{9,})|(ns:[0-9]+(/.*)?))\z"))
            {
                throw new sys.ArgumentOutOfRangeException("path", @"Value should match pattern '\A(?:(/(.|[\r\n])*|id:.*)|(rev:[0-9a-f]{9,})|(ns:[0-9]+(/.*)?))\z'");
            }

            this.Path             = path;
            this.IncludeMediaInfo = includeMediaInfo;
            this.IncludeDeleted   = includeDeleted;
            this.IncludeHasExplicitSharedMembers = includeHasExplicitSharedMembers;
            this.IncludePropertyGroups           = includePropertyGroups;
        }