Esempio n. 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="T:Dropbox.Api.DropboxRequestHandler"/> class.
        /// </summary>
        /// <param name="options">The configuration options for dropbox client.</param>
        /// <param name="selectUser">The member id of the selected user.</param>
        public DropboxRequestHandler(
            DrpoboxRequestHandlerOptions options,
            string selectUser = null)
        {
            if (options == null)
            {
                throw new ArgumentNullException("options");
            }

            this.options    = options;
            this.selectUser = selectUser;
        }
Esempio n. 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="T:Dropbox.Api.DropboxTeamClient"/> class.
        /// </summary>
        /// <param name="oauth2AccessToken">The team oauth2 access token for making client requests.</param>
        /// <param name="maxRetriesOnError">The maximum retries on a 5xx error.</param>
        /// <param name="userAgent">The user agent to use when making requests.</param>
        /// <param name="httpClient">The custom http client. If not provided, a default
        /// http client will be created.</param>
        /// <remarks>
        /// The <paramref name="userAgent"/> helps Dropbox to identify requests coming from your application.
        /// We recommend that you use the format <c>"AppName/Version"</c>; if a value is supplied, the string
        /// <c>"/OfficialDropboxDotNetV2SDK/__version__"</c> is appended to the user agent.
        /// </remarks>
        public DropboxTeamClient(
            string oauth2AccessToken,
            int maxRetriesOnError = 4,
            string userAgent      = null,
            HttpClient httpClient = null)
        {
            if (oauth2AccessToken == null)
            {
                throw new ArgumentNullException("oauth2AccessToken");
            }

            this.options = new DrpoboxRequestHandlerOptions(oauth2AccessToken, maxRetriesOnError, userAgent, httpClient: httpClient);
            this.InitializeRoutes(new DropboxRequestHandler(this.options));
        }
Esempio n. 3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="T:Dropbox.Api.DropboxClient"/> class.
 /// </summary>
 /// <param name="options">The request handler options.</param>
 /// <param name="selectUser">The member id of the selected user. If provided together with
 /// a team access token, actions will be performed on this this user's Dropbox.</param>
 internal DropboxClient(DrpoboxRequestHandlerOptions options, string selectUser = null)
 {
     this.InitializeRoutes(new DropboxRequestHandler(options, selectUser));
 }