예제 #1
0
        public async Task DeleteBucket([FromBody] BucketModel bucket)
        {
            BucketsApi buckets = new BucketsApi();
            dynamic    token   = await OAuthController.GetInternalAsync();

            buckets.Configuration.AccessToken = token.access_token;
            await buckets.DeleteBucketAsync(bucket.bucketKey);
        }
예제 #2
0
        public async Task <dynamic> CreateBucket([FromBody] BucketModel bucket)
        {
            BucketsApi buckets = new BucketsApi();
            dynamic    token   = await OAuthController.GetInternalAsync();

            buckets.Configuration.AccessToken = token.access_token;
            PostBucketsPayload bucketPayload = new PostBucketsPayload(string.Format("{0}-{1}", ClientId, bucket.bucketKey.ToLower()), null,
                                                                      PostBucketsPayload.PolicyKeyEnum.Transient);

            return(await buckets.CreateBucketAsync(bucketPayload, "US"));
        }