private BoxManager(IRequestAuthenticator requestAuthenticator, IWebProxy proxy, BoxManagerOptions options, string onBehalfOf = null)
     : this()
 {
     requestAuthenticator.SetOnBehalfOf(onBehalfOf);
     _restClient = new BoxRestClient(requestAuthenticator, proxy, options);
     _uploadClient = new BoxUploadClient(requestAuthenticator, proxy, options);
 }
 public TokenProvider(string clientId, string clientSecret, IWebProxy webProxy = null, BoxManagerOptions options = BoxManagerOptions.None)
 {
     _clientId = clientId;
     _clientSecret = clientSecret;
     _requestHelper = new RequestHelper();
     _restClient = new BoxRestClient(null, webProxy, options);
 }
 /// <summary>
 ///     Instantiates a BoxAuthenticator
 /// </summary>
 /// <param name="apiKey">The API key for your application</param>
 /// <param name="ticket">The ticket associated with the current authorization token request, if you already have one.</param>
 /// <param name="proxy">An optional web proxy that should be used in conjunction with any calls to Box</param>
 public BoxAuthenticator(string apiKey, string ticket = null, WebProxy proxy = null, BoxManagerOptions options = BoxManagerOptions.None)
 {
     ApiKey = apiKey;
     Ticket = ticket;
     Proxy = proxy;
     _requestHelper = new RequestHelper();
     _restClient = new BoxRestClient(new LegacyRequestAuthenticator(ApiKey, null), proxy, options);
 }
Exemple #4
0
        public BoxRestClientBase(string serviceUrlBase, IRequestAuthenticator authenticator, IWebProxy proxy, BoxManagerOptions options) :
            base(serviceUrlBase)
        {
            Options       = options;
            Authenticator = authenticator;
            Proxy         = proxy;
            ClearHandlers();
            var xmlDeserializer  = new XmlDeserializer();
            var jsonDeserializer = new JsonDeserializer();

            AddHandler(XmlMimeType, xmlDeserializer);
            AddHandler(XmlAltMimeType, xmlDeserializer);
            AddHandler(JsonMimeType, jsonDeserializer);
        }
 public TokenProvider(string clientId, string clientSecret, IWebProxy webProxy = null, BoxManagerOptions options = BoxManagerOptions.None)
 {
     _clientId      = clientId;
     _clientSecret  = clientSecret;
     _requestHelper = new RequestHelper();
     _restClient    = new BoxRestClient(null, webProxy, options);
 }
 public BoxManager(string v1ApiKey, string v1AuthToken, IWebProxy proxy = null, BoxManagerOptions options = BoxManagerOptions.None)
     : this(new LegacyRequestAuthenticator(v1ApiKey, v1AuthToken), proxy, options)
 {
 }
 /// <summary>
 ///     Creates a BoxManager client using the v2 authentication scheme
 /// </summary>
 /// <param name="oauth2AccessToken">The OAuth 2.0 access token for this user</param>
 /// <param name="proxy">HTTP proxy configuration information</param>
 /// <param name="options">Options to customize the behavior of the BoxManager</param>
 /// <param name="onBehalfOf">All operations will be performed on behalf of the user with this login.</param>
 public BoxManager(string oauth2AccessToken, IWebProxy proxy = null, BoxManagerOptions options = BoxManagerOptions.None, string onBehalfOf = null)
     : this(new OAuth2RequestAuthenticator(oauth2AccessToken), proxy, options, onBehalfOf)
 {
 }
 private BoxManager(IRequestAuthenticator requestAuthenticator, IWebProxy proxy, BoxManagerOptions options, string onBehalfOf = null)
     : this()
 {
     requestAuthenticator.SetOnBehalfOf(onBehalfOf);
     _restClient     = new BoxRestClient(requestAuthenticator, proxy, options);
     _uploadClient   = new BoxUploadClient(requestAuthenticator, proxy, options);
     _downloadClient = new RestClient()
     {
         Authenticator = requestAuthenticator
     };
 }
 public BoxManager(string v1ApiKey, string v1AuthToken, IWebProxy proxy = null, BoxManagerOptions options = BoxManagerOptions.None)
     : this(new LegacyRequestAuthenticator(v1ApiKey, v1AuthToken), proxy, options)
 {
 }
 /// <summary>
 ///     Creates a BoxManager client using the v2 authentication scheme
 /// </summary>
 /// <param name="oauth2AccessToken">The OAuth 2.0 access token for this user</param>
 /// <param name="proxy">HTTP proxy configuration information</param>
 /// <param name="options">Options to customize the behavior of the BoxManager</param>
 /// <param name="onBehalfOf">All operations will be performed on behalf of the user with this login.</param>
 public BoxManager(string oauth2AccessToken, IWebProxy proxy = null, BoxManagerOptions options = BoxManagerOptions.None, string onBehalfOf = null)
     : this(new OAuth2RequestAuthenticator(oauth2AccessToken), proxy, options, onBehalfOf)
 {
 }
 /// <summary>
 ///     Instantiates a BoxAuthenticator
 /// </summary>
 /// <param name="apiKey">The API key for your application</param>
 /// <param name="ticket">The ticket associated with the current authorization token request, if you already have one.</param>
 /// <param name="proxy">An optional web proxy that should be used in conjunction with any calls to Box</param>
 public BoxAuthenticator(string apiKey, string ticket = null, WebProxy proxy = null, BoxManagerOptions options = BoxManagerOptions.None)
 {
     ApiKey         = apiKey;
     Ticket         = ticket;
     Proxy          = proxy;
     _requestHelper = new RequestHelper();
     _restClient    = new BoxRestClient(new LegacyRequestAuthenticator(ApiKey, null), proxy, options);
 }
Exemple #12
0
 public BoxUploadClient(IRequestAuthenticator authenticator, IWebProxy proxy, BoxManagerOptions options)
     : base(ServiceUrl, authenticator, proxy, options)
 {
 }
 private void SetClient(IRequestAuthenticator requestAuthenticator, IWebProxy proxy, BoxManagerOptions options)
 {
     _restClient = new BoxRestClient(requestAuthenticator, proxy, options);
 }
 /// <summary>
 ///     Creates a BoxManager client using the v2 authentication scheme
 /// </summary>
 /// <param name="oauth2AccessToken">The OAuth 2.0 access token for this user</param>
 /// <param name="proxy">HTTP proxy configuration information</param>
 /// <param name="options">Options to customize the behavior of the BoxManager</param>
 public BoxManager(string oauth2AccessToken, IWebProxy proxy = null, BoxManagerOptions options = BoxManagerOptions.None)
     : this()
 {
     SetClient(new OAuth2RequestAuthenticator(oauth2AccessToken), proxy, options);
 }
 private BoxManager(IRequestAuthenticator requestAuthenticator, IWebProxy proxy, BoxManagerOptions options)
     : this()
 {
     _restClient = new BoxRestClient(requestAuthenticator, proxy, options);
     _uploadClient = new BoxUploadClient(requestAuthenticator, proxy, options);
 }