示例#1
0
 public B2Client(B2Options options)
 {
     _options   = options;
     Buckets    = new Buckets(options);
     Files      = new Files(options);
     LargeFiles = new LargeFiles(options);
 }
示例#2
0
 public B2Client(B2Options options)
 {
     _options      = Authorize(options);
     Buckets       = new Buckets(options);
     Files         = new Files(options);
     LargeFiles    = new LargeFiles(options);
     _capabilities = options.Capabilities;
 }
示例#3
0
        /// <summary>
        /// Simple method for instantiating the B2Client. Does auth for you.
        /// </summary>
        /// <param name="accountId"></param>
        /// <param name="applicationkey"></param>
        /// <param name="requestTimeout"></param>
        public B2Client(string accountId, string applicationkey, int requestTimeout = 100)
        {
            _options = new B2Options()
            {
                AccountId      = accountId,
                ApplicationKey = applicationkey,
                RequestTimeout = requestTimeout
            };
            _options = Authorize(_options);

            Buckets    = new Buckets(_options);
            Files      = new Files(_options);
            LargeFiles = new LargeFiles(_options);
        }
示例#4
0
        /// <summary>
        /// Simple method for instantiating the B2Client. Does auth for you. See https://www.backblaze.com/b2/docs/application_keys.html for details on application keys.
        /// This method defaults to not persisting a bucket. Manually build the options object if you wish to do that.
        /// </summary>
        /// <param name="accountId"></param>
        /// <param name="applicationkey"></param>
        /// <param name="requestTimeout"></param>
        public B2Client(string keyId, string applicationkey, int requestTimeout = 100)
        {
            _options = new B2Options()
            {
                KeyId          = keyId,
                ApplicationKey = applicationkey,
                RequestTimeout = requestTimeout
            };
            _options = Authorize(_options);

            Buckets       = new Buckets(_options);
            Files         = new Files(_options);
            LargeFiles    = new LargeFiles(_options);
            _capabilities = _options.Capabilities;
        }
示例#5
0
 /// <summary>
 /// If you specify authorizeOnInitialize = false, you MUST call Initialize() once before you use the client.
 /// </summary>
 /// <param name="options"></param>
 /// <param name="authorizeOnInitialize"></param>
 public B2Client(B2Options options, bool authorizeOnInitialize = true)
 {
     // Should we authorize on the class initialization?
     if (authorizeOnInitialize)
     {
         _options      = Authorize(options);
         Buckets       = new Buckets(options);
         Files         = new Files(options);
         LargeFiles    = new LargeFiles(options);
         _capabilities = options.Capabilities;
     }
     else
     {
         // If not, then the user will have to Initialize() before making any calls.
         _options = options;
     }
 }