diff --git a/Autodesk.Forge.Oss.Tests/Autodesk.Forge.Oss.Tests.csproj b/Autodesk.Forge.Oss.Tests/Autodesk.Forge.Oss.Tests.csproj
index 826a3b1..82df46e 100644
--- a/Autodesk.Forge.Oss.Tests/Autodesk.Forge.Oss.Tests.csproj
+++ b/Autodesk.Forge.Oss.Tests/Autodesk.Forge.Oss.Tests.csproj
@@ -13,6 +13,7 @@
+
diff --git a/Autodesk.Forge.Oss.Tests/BucketApiTests.cs b/Autodesk.Forge.Oss.Tests/BucketApiTests.cs
index 35fb51a..775021d 100644
--- a/Autodesk.Forge.Oss.Tests/BucketApiTests.cs
+++ b/Autodesk.Forge.Oss.Tests/BucketApiTests.cs
@@ -1,5 +1,7 @@
+using Autodesk.Forge.Client;
using NUnit.Framework;
using System;
+using System.IO;
using System.Threading.Tasks;
namespace Autodesk.Forge.Oss.Tests
@@ -32,6 +34,38 @@ public async Task BucketApi_CreateAndDelete()
Assert.IsNull(await OssClient.TryGetBucketDetailsAsync(BucketKey));
}
+ [TestCase("US")]
+ [TestCase("EMEA")]
+ [TestCase("AUS")]
+ public async Task BucketApi_CreateAndDelete_Region(string region)
+ {
+ var bucketKey = $"{BucketKey}_{region}".ToLower();
+ var bucketCreated = await OssClient.CreateBucketAsync(bucketKey, region);
+ Assert.AreEqual(bucketKey, bucketCreated.BucketKey);
+ Assert.IsNotNull(await OssClient.GetBucketDetailsAsync(bucketKey));
+
+
+ // Test file in the region
+ {
+ var ObjectName = TestFactory.CreateObjectName();
+ var DataString = TestFactory.CreateDataString();
+ File.WriteAllText(ObjectName, DataString);
+ var fileDetail = await OssClient.UploadFileAsync(bucketKey, ObjectName, ObjectName);
+ Assert.AreEqual(DataString.Length, fileDetail.Size);
+
+ var objectDetails = await OssClient.GetObjectDetailsAsync(bucketKey, ObjectName);
+ Assert.AreEqual(DataString.Length, objectDetails.Size);
+
+ await OssClient.DeleteObjectAsync(bucketKey, ObjectName);
+ Assert.ThrowsAsync(() => OssClient.GetObjectDetailsAsync(bucketKey, ObjectName));
+
+ File.Delete(ObjectName);
+ }
+
+ await OssClient.DeleteBucketAsync(bucketKey);
+ Assert.IsNull(await OssClient.TryGetBucketDetailsAsync(bucketKey));
+ }
+
[Ignore("Skip Delete Buckets")]
[Test]
public async Task BucketApi_DeleteAll()
diff --git a/Autodesk.Forge.Oss.sln b/Autodesk.Forge.Oss.sln
index 94058dc..f27416c 100644
--- a/Autodesk.Forge.Oss.sln
+++ b/Autodesk.Forge.Oss.sln
@@ -10,11 +10,14 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution", "Solution", "{D62567F0-6FCF-4C5B-B139-B2B219D51FDF}"
ProjectSection(SolutionItems) = preProject
CHANGELOG.md = CHANGELOG.md
+ Directory.Build.props = Directory.Build.props
LICENSE = LICENSE
README.md = README.md
EndProjectSection
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Autodesk.Forge.Oss.Tests", "Autodesk.Forge.Oss.Tests\Autodesk.Forge.Oss.Tests.csproj", "{6CF07E6C-9623-4B4E-A549-59ABDC74537D}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Autodesk.Forge.Oss.Tests", "Autodesk.Forge.Oss.Tests\Autodesk.Forge.Oss.Tests.csproj", "{6CF07E6C-9623-4B4E-A549-59ABDC74537D}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Autodesk.Forge", "Autodesk.Forge\Autodesk.Forge.csproj", "{A30518D1-F6D0-4190-81A7-142088761FB2}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -32,6 +35,10 @@ Global
{6CF07E6C-9623-4B4E-A549-59ABDC74537D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6CF07E6C-9623-4B4E-A549-59ABDC74537D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6CF07E6C-9623-4B4E-A549-59ABDC74537D}.Release|Any CPU.Build.0 = Release|Any CPU
+ {A30518D1-F6D0-4190-81A7-142088761FB2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {A30518D1-F6D0-4190-81A7-142088761FB2}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {A30518D1-F6D0-4190-81A7-142088761FB2}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {A30518D1-F6D0-4190-81A7-142088761FB2}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/Autodesk.Forge.Oss/Autodesk.Forge.Oss.csproj b/Autodesk.Forge.Oss/Autodesk.Forge.Oss.csproj
index 600930d..3ba90ac 100644
--- a/Autodesk.Forge.Oss/Autodesk.Forge.Oss.csproj
+++ b/Autodesk.Forge.Oss/Autodesk.Forge.Oss.csproj
@@ -14,9 +14,28 @@
-
+
+
+
+
+
+
+ $(TargetsForTfmSpecificContentInPackage);CustomContentTarget
+
+
+
+
+
+ lib/$(TargetFramework)
+
+
+ lib/$(TargetFramework)
+
+
+
+
true
@@ -36,7 +55,6 @@
ricaun.Autodesk.Forge.Oss
- 2.1.0
{54AC7247-0A9C-4A56-835B-D1790800647B}
@@ -67,6 +85,10 @@
$(OutputPath)\$(AssemblyName).xml
+ true
+ snupkg
+ true
+ Full
false
diff --git a/Autodesk.Forge.Oss/OssClient.cs b/Autodesk.Forge.Oss/OssClient.cs
index 371d529..d87d39d 100644
--- a/Autodesk.Forge.Oss/OssClient.cs
+++ b/Autodesk.Forge.Oss/OssClient.cs
@@ -103,18 +103,18 @@ public async Task DeleteBucketAsync(string bucketKey)
///
/// Thrown when fails to make API call
/// Bucket key (required).
- /// .
+ /// The region where the bucket resides Acceptable values: `US`, `EMEA` Default is `US` (optional, default to US)
/// [Data retention policy](https://developer.autodesk.com/en/docs/data/v2/overview/retention-policy/) Acceptable values: `transient`, `temporary` or `persistent` (required).
- /// The region where the bucket resides Acceptable values: `US`, `EMEA` Default is `US` (optional, default to US)
+ /// .
///
public async Task CreateBucketAsync(
string bucketKey,
- List allow = null,
+ string region = null,
PostBucketsPayload.PolicyKeyEnum policyKey = PostBucketsPayload.PolicyKeyEnum.Transient,
- string xAdsRegion = null)
+ List allow = null)
{
var postBuckets = new PostBucketsPayload(bucketKey, allow, policyKey);
- return await this.CreateBucketAsync(postBuckets, xAdsRegion);
+ return await this.CreateBucketAsync(postBuckets, region);
}
///
@@ -122,11 +122,11 @@ public async Task CreateBucketAsync(
///
/// Thrown when fails to make API call
/// Body Structure
- /// The region where the bucket resides Acceptable values: `US`, `EMEA` Default is `US` (optional, default to US)
+ /// The region where the bucket resides Acceptable values: `US`, `EMEA` Default is `US` (optional, default to US)
/// Task of Bucket
- public async Task CreateBucketAsync(PostBucketsPayload postBuckets, string xAdsRegion = null)
+ public async Task CreateBucketAsync(PostBucketsPayload postBuckets, string region = null)
{
- var value = await BucketsApi.CreateBucketAsync(postBuckets, xAdsRegion) as DynamicJsonResponse;
+ var value = await BucketsApi.CreateBucketAsync(postBuckets, region) as DynamicJsonResponse;
return value.ToObject();
}
#endregion
@@ -146,23 +146,23 @@ public async Task GetObjectsAsync(string bucketKey, int? limit =
var value = await this.ObjectsApi.GetObjectsAsync(bucketKey, limit, beginsWith, startAt) as DynamicJsonResponse;
return value.ToObject();
}
- // ///
- ///// Download an object.
- /////
- ///// Thrown when fails to make API call
- ///// URL-encoded bucket key
- ///// URL-encoded object name
- ///// A range of bytes to download from the specified object. (optional)
- ///// The value of this header is compared to the ETAG of the object. If they match, the body will not be included in the response. Only the object information will be included. (optional)
- ///// If the requested object has not been modified since the time specified in this field, an entity will not be returned from the server; instead, a 304 (not modified) response will be returned without any message body. (optional)
- ///// When gzip is specified, a gzip compressed stream of the object’s bytes will be returned in the response. Cannot use “Accept-Encoding:gzip” with Range header containing an end byte range. End byte range will not be honored if “Accept-Encoding: gzip” header is used. (optional)
- ///// Task of System.IO.Stream
- //[Obsolete]
- //public async Task GetObjectAsync(string bucketKey, string objectName, string range = null, string ifNoneMatch = null, DateTime? ifModifiedSince = null, string acceptEncoding = null)
- //{
- // var value = await this.ObjectsApi.GetObjectAsync(bucketKey, objectName, range, ifNoneMatch, ifModifiedSince, acceptEncoding);
- // return value as Stream;
- //}
+ ///
+ /// Download an object.
+ ///
+ /// Thrown when fails to make API call
+ /// URL-encoded bucket key
+ /// URL-encoded object name
+ /// A range of bytes to download from the specified object. (optional)
+ /// The value of this header is compared to the ETAG of the object. If they match, the body will not be included in the response. Only the object information will be included. (optional)
+ /// If the requested object has not been modified since the time specified in this field, an entity will not be returned from the server; instead, a 304 (not modified) response will be returned without any message body. (optional)
+ /// When gzip is specified, a gzip compressed stream of the object’s bytes will be returned in the response. Cannot use “Accept-Encoding:gzip” with Range header containing an end byte range. End byte range will not be honored if “Accept-Encoding: gzip” header is used. (optional)
+ /// Task of System.IO.Stream
+ [Obsolete]
+ internal async Task GetObjectAsyncObsolete(string bucketKey, string objectName, string range = null, string ifNoneMatch = null, DateTime? ifModifiedSince = null, string acceptEncoding = null)
+ {
+ var value = await this.ObjectsApi.GetObjectAsync(bucketKey, objectName, range, ifNoneMatch, ifModifiedSince, acceptEncoding);
+ return value as Stream;
+ }
///
/// GetObjectAsync using CreateSignedFileAsync and GetStreamAsync
///
diff --git a/Autodesk.Forge/Api/BucketsApi.cs b/Autodesk.Forge/Api/BucketsApi.cs
new file mode 100644
index 0000000..093548b
--- /dev/null
+++ b/Autodesk.Forge/Api/BucketsApi.cs
@@ -0,0 +1,989 @@
+/*
+ * Forge SDK
+ *
+ * The Forge Platform contains an expanding collection of web service components that can be used with Autodesk cloud-based products or your own technologies. Take advantage of Autodesk’s expertise in design and engineering.
+ *
+
+ * Contact: forge.help@autodesk.com
+ * Generated by: https://github.com/swagger-api/swagger-codegen.git
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Linq;
+using RestSharp;
+using Newtonsoft.Json.Linq;
+using Autodesk.Forge.Client;
+using Autodesk.Forge.Model;
+
+namespace Autodesk.Forge {
+ ///
+ /// Represents a collection of functions to interact with the API endpoints
+ ///
+ public interface IBucketsApi : IApiAccessor {
+ #region Synchronous Operations
+ ///
+ ///
+ ///
+ ///
+ /// Use this endpoint to create a bucket. Buckets are arbitrary spaces created and owned by applications. Bucket keys are globally unique across all regions, regardless of where they were created, and they cannot be changed. The application creating the bucket is the owner of the bucket.
+ ///
+ /// Thrown when fails to make API call
+ /// Body Structure
+ /// The region where the bucket resides Acceptable values: `US`, `EMEA` Default is `US` (optional, default to US)
+ /// Bucket
+ /*Bucket*/
+ dynamic CreateBucket (PostBucketsPayload postBuckets, string region = null);
+
+ ///
+ ///
+ ///
+ ///
+ /// Use this endpoint to create a bucket. Buckets are arbitrary spaces created and owned by applications. Bucket keys are globally unique across all regions, regardless of where they were created, and they cannot be changed. The application creating the bucket is the owner of the bucket.
+ ///
+ /// Thrown when fails to make API call
+ /// Body Structure
+ /// The region where the bucket resides Acceptable values: `US`, `EMEA` Default is `US` (optional, default to US)
+ /// ApiResponse of Bucket
+ ApiResponse*Bucket*/dynamic> CreateBucketWithHttpInfo (PostBucketsPayload postBuckets, string region = null);
+ ///
+ ///
+ ///
+ ///
+ /// This endpoint will delete a bucket.
+ ///
+ /// Thrown when fails to make API call
+ /// URL-encoded bucket key
+ ///
+ void DeleteBucket (string bucketKey);
+
+ ///
+ ///
+ ///
+ ///
+ /// This endpoint will delete a bucket.
+ ///
+ /// Thrown when fails to make API call
+ /// URL-encoded bucket key
+ /// ApiResponse of Object(void)
+ ApiResponse DeleteBucketWithHttpInfo (string bucketKey);
+ ///
+ ///
+ ///
+ ///
+ /// This endpoint will return the buckets owned by the application. This endpoint supports pagination.
+ ///
+ /// Thrown when fails to make API call
+ /// URL-encoded bucket key
+ /// Bucket
+ /*Bucket*/
+ dynamic GetBucketDetails (string bucketKey);
+
+ ///
+ ///
+ ///
+ ///
+ /// This endpoint will return the buckets owned by the application. This endpoint supports pagination.
+ ///
+ /// Thrown when fails to make API call
+ /// URL-encoded bucket key
+ /// ApiResponse of Bucket
+ ApiResponse*Bucket*/dynamic> GetBucketDetailsWithHttpInfo (string bucketKey);
+ ///
+ ///
+ ///
+ ///
+ /// This endpoint will return the buckets owned by the application. This endpoint supports pagination.
+ ///
+ /// Thrown when fails to make API call
+ /// The region where the bucket resides Acceptable values: `US`, `EMEA` Default is `US` (optional, default to US)
+ /// Limit to the response size, Acceptable values: 1-100 Default = 10 (optional, default to 10)
+ /// Key to use as an offset to continue pagination This is typically the last bucket key found in a preceding GET buckets response (optional)
+ /// Buckets
+ /*Buckets*/
+ dynamic GetBuckets (string region = null, int? limit = null, string startAt = null);
+
+ ///
+ ///
+ ///
+ ///
+ /// This endpoint will return the buckets owned by the application. This endpoint supports pagination.
+ ///
+ /// Thrown when fails to make API call
+ /// The region where the bucket resides Acceptable values: `US`, `EMEA` Default is `US` (optional, default to US)
+ /// Limit to the response size, Acceptable values: 1-100 Default = 10 (optional, default to 10)
+ /// Key to use as an offset to continue pagination This is typically the last bucket key found in a preceding GET buckets response (optional)
+ /// ApiResponse of Buckets
+ ApiResponse*Buckets*/dynamic> GetBucketsWithHttpInfo (string region = null, int? limit = null, string startAt = null);
+ #endregion Synchronous Operations
+ #region Asynchronous Operations
+ ///
+ ///
+ ///
+ ///
+ /// Use this endpoint to create a bucket. Buckets are arbitrary spaces created and owned by applications. Bucket keys are globally unique across all regions, regardless of where they were created, and they cannot be changed. The application creating the bucket is the owner of the bucket.
+ ///
+ /// Thrown when fails to make API call
+ /// Body Structure
+ /// The region where the bucket resides Acceptable values: `US`, `EMEA` Default is `US` (optional, default to US)
+ /// Task of Bucket
+ System.Threading.Tasks.Task*Bucket*/dynamic> CreateBucketAsync (PostBucketsPayload postBuckets, string region = null);
+
+ ///
+ ///
+ ///
+ ///
+ /// Use this endpoint to create a bucket. Buckets are arbitrary spaces created and owned by applications. Bucket keys are globally unique across all regions, regardless of where they were created, and they cannot be changed. The application creating the bucket is the owner of the bucket.
+ ///
+ /// Thrown when fails to make API call
+ /// Body Structure
+ /// The region where the bucket resides Acceptable values: `US`, `EMEA` Default is `US` (optional, default to US)
+ /// Task of ApiResponse (Bucket)
+ System.Threading.Tasks.Task> CreateBucketAsyncWithHttpInfo (PostBucketsPayload postBuckets, string region = null);
+
+ ///
+ ///
+ ///
+ ///
+ /// This endpoint will delete a bucket.
+ ///
+ /// Thrown when fails to make API call
+ /// URL-encoded bucket key
+ /// Task of void
+ System.Threading.Tasks.Task DeleteBucketAsync (string bucketKey);
+
+ ///
+ ///
+ ///
+ ///
+ /// This endpoint will delete a bucket.
+ ///
+ /// Thrown when fails to make API call
+ /// URL-encoded bucket key
+ /// Task of ApiResponse
+ System.Threading.Tasks.Task> DeleteBucketAsyncWithHttpInfo (string bucketKey);
+
+ ///
+ ///
+ ///
+ ///
+ /// This endpoint will return the buckets owned by the application. This endpoint supports pagination.
+ ///
+ /// Thrown when fails to make API call
+ /// URL-encoded bucket key
+ /// Task of Bucket
+ System.Threading.Tasks.Task*Bucket*/dynamic> GetBucketDetailsAsync (string bucketKey);
+
+ ///
+ ///
+ ///
+ ///
+ /// This endpoint will return the buckets owned by the application. This endpoint supports pagination.
+ ///
+ /// Thrown when fails to make API call
+ /// URL-encoded bucket key
+ /// Task of ApiResponse (Bucket)
+ System.Threading.Tasks.Task> GetBucketDetailsAsyncWithHttpInfo (string bucketKey);
+
+ ///
+ ///
+ ///
+ ///
+ /// This endpoint will return the buckets owned by the application. This endpoint supports pagination.
+ ///
+ /// Thrown when fails to make API call
+ /// The region where the bucket resides Acceptable values: `US`, `EMEA` Default is `US` (optional, default to US)
+ /// Limit to the response size, Acceptable values: 1-100 Default = 10 (optional, default to 10)
+ /// Key to use as an offset to continue pagination This is typically the last bucket key found in a preceding GET buckets response (optional)
+ /// Task of Buckets
+ System.Threading.Tasks.Task*Buckets*/dynamic> GetBucketsAsync (string region = null, int? limit = null, string startAt = null);
+
+ ///
+ ///
+ ///
+ ///
+ /// This endpoint will return the buckets owned by the application. This endpoint supports pagination.
+ ///
+ /// Thrown when fails to make API call
+ /// The region where the bucket resides Acceptable values: `US`, `EMEA` Default is `US` (optional, default to US)
+ /// Limit to the response size, Acceptable values: 1-100 Default = 10 (optional, default to 10)
+ /// Key to use as an offset to continue pagination This is typically the last bucket key found in a preceding GET buckets response (optional)
+ /// Task of ApiResponse (Buckets)
+ System.Threading.Tasks.Task> GetBucketsAsyncWithHttpInfo (string region = null, int? limit = null, string startAt = null);
+ #endregion Asynchronous Operations
+ }
+
+ ///
+ /// Represents a collection of functions to interact with the API endpoints
+ ///
+ public partial class BucketsApi : IBucketsApi {
+ private const string HeaderParamRegion = "region";
+ private Autodesk.Forge.Client.ExceptionFactory _exceptionFactory = (name, response) => null;
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ public BucketsApi (String basePath) {
+ this.Configuration = new Configuration (new ApiClient (basePath));
+
+ ExceptionFactory = Autodesk.Forge.Client.Configuration.DefaultExceptionFactory;
+
+ // ensure API client has configuration ready
+ if ( Configuration.ApiClient.Configuration == null ) {
+ this.Configuration.ApiClient.Configuration = this.Configuration;
+ }
+ }
+
+ ///
+ /// Initializes a new instance of the class
+ /// using Configuration object
+ ///
+ /// An instance of Configuration
+ ///
+ public BucketsApi (Configuration configuration = null) {
+ if ( configuration == null ) // use the default one in Configuration
+ this.Configuration = Configuration.Default;
+ else
+ this.Configuration = configuration;
+
+ ExceptionFactory = Autodesk.Forge.Client.Configuration.DefaultExceptionFactory;
+
+ // ensure API client has configuration ready
+ if ( Configuration.ApiClient.Configuration == null ) {
+ Configuration.ApiClient.Configuration = this.Configuration;
+ }
+ }
+
+ ///
+ /// Gets the base path of the API client.
+ ///
+ /// The base path
+ public String GetBasePath () {
+ return Configuration.ApiClient.RestClient.Options.BaseUrl.ToString ();
+ }
+
+ ///
+ /// Sets the base path of the API client.
+ ///
+ /// The base path
+ [Obsolete ("SetBasePath is deprecated, please do 'Configuration.ApiClient = new ApiClient(\"http://new-path\")' instead.")]
+ public void SetBasePath (String basePath) {
+ // do nothing
+ }
+
+ ///
+ /// Gets or sets the configuration object
+ ///
+ /// An instance of the Configuration
+ public Configuration Configuration { get; set; }
+
+ ///
+ /// Provides a factory method hook for the creation of exceptions.
+ ///
+ public Autodesk.Forge.Client.ExceptionFactory ExceptionFactory {
+ get {
+ if ( _exceptionFactory != null && _exceptionFactory.GetInvocationList ().Length > 1 ) {
+ throw new InvalidOperationException ("Multicast delegate for ExceptionFactory is unsupported.");
+ }
+ return _exceptionFactory;
+ }
+ set { _exceptionFactory = value; }
+ }
+
+ ///
+ /// Gets the default header.
+ ///
+ /// Dictionary of HTTP header
+ [Obsolete ("DefaultHeader is deprecated, please use Configuration.DefaultHeader instead.")]
+ public Dictionary DefaultHeader () {
+ return this.Configuration.DefaultHeader;
+ }
+
+ ///
+ /// Add default header.
+ ///
+ /// Header field name.
+ /// Header field value.
+ ///
+ [Obsolete ("AddDefaultHeader is deprecated, please use Configuration.AddDefaultHeader instead.")]
+ public void AddDefaultHeader (string key, string value) {
+ this.Configuration.AddDefaultHeader (key, value);
+ }
+
+ ///
+ /// Use this endpoint to create a bucket. Buckets are arbitrary spaces created and owned by applications. Bucket keys are globally unique across all regions, regardless of where they were created, and they cannot be changed. The application creating the bucket is the owner of the bucket.
+ ///
+ /// Thrown when fails to make API call
+ /// Body Structure
+ /// The region where the bucket resides Acceptable values: `US`, `EMEA` Default is `US` (optional, default to US)
+ /// Bucket
+ public /*Bucket*/dynamic CreateBucket (PostBucketsPayload postBuckets, string region = null) {
+ ApiResponse*Bucket*/dynamic> localVarResponse = CreateBucketWithHttpInfo (postBuckets, region);
+ return localVarResponse.Data;
+ }
+
+ ///
+ /// Use this endpoint to create a bucket. Buckets are arbitrary spaces created and owned by applications. Bucket keys are globally unique across all regions, regardless of where they were created, and they cannot be changed. The application creating the bucket is the owner of the bucket.
+ ///
+ /// Thrown when fails to make API call
+ /// Body Structure
+ /// The region where the bucket resides Acceptable values: `US`, `EMEA` Default is `US` (optional, default to US)
+ /// ApiResponse of Bucket
+ public ApiResponse*Bucket*/dynamic> CreateBucketWithHttpInfo (PostBucketsPayload postBuckets, string region = null) {
+ // verify the required parameter 'postBuckets' is set
+ if ( postBuckets == null )
+ throw new ApiException (400, "Missing required parameter 'postBuckets' when calling BucketsApi->CreateBucket");
+
+ var localVarPath = "/oss/v2/buckets";
+ var localVarPathParams = new Dictionary ();
+ var localVarQueryParams = new Dictionary ();
+ var localVarHeaderParams = new Dictionary (Configuration.DefaultHeader);
+ var localVarFormParams = new Dictionary ();
+ var localVarFileParams = new Dictionary ();
+ Object localVarPostBody = null;
+
+ // to determine the Content-Type header
+ String [] localVarHttpContentTypes = new String [] {
+ "application/json"
+ };
+ String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType (localVarHttpContentTypes);
+
+ // to determine the Accept header
+ String [] localVarHttpHeaderAccepts = new String [] {
+ "application/vnd.api+json",
+ "application/json"
+ };
+ String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept (localVarHttpHeaderAccepts);
+ if ( localVarHttpHeaderAccept != null )
+ localVarHeaderParams.Add ("Accept", localVarHttpHeaderAccept);
+
+ // set "format" to json by default
+ // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
+ localVarPathParams.Add ("format", "json");
+ if ( region != null && localVarHeaderParams.ContainsKey (HeaderParamRegion) )
+ localVarHeaderParams [HeaderParamRegion] = Configuration.ApiClient.ParameterToString (region); // header parameter
+ else if ( region != null )
+ localVarHeaderParams.Add (HeaderParamRegion, Configuration.ApiClient.ParameterToString (region)); // header parameter
+ if ( postBuckets != null && postBuckets.GetType () == typeof (byte []) ) // http body (model) parameter
+ {
+ localVarPostBody = postBuckets; // byte array
+ } else if ( postBuckets != null
+ && (postBuckets.GetType () == typeof (System.IO.FileStream)
+ || postBuckets.GetType () == typeof (System.IO.BinaryReader)
+ || postBuckets.GetType () == typeof (System.IO.BufferedStream)
+ || postBuckets.GetType () == typeof (System.IO.MemoryStream)
+ || postBuckets.GetType () == typeof (System.IO.StreamReader)
+ )
+ ) {
+ localVarPostBody = Configuration.ApiClient.toByteArray (postBuckets); // byte array
+ } else if ( postBuckets != null ) {
+ localVarPostBody = Configuration.ApiClient.Serialize (postBuckets);
+ }
+
+ // authentication (oauth2_application) required
+ // oauth required
+ if ( !String.IsNullOrEmpty (Configuration.AccessToken) ) {
+ localVarHeaderParams ["Authorization"] = "Bearer " + Configuration.AccessToken;
+ }
+
+ // make the HTTP request
+ RestResponse localVarResponse = (RestResponse)Configuration.ApiClient.CallApi (localVarPath,
+ Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
+ localVarPathParams, localVarHttpContentType);
+
+ int localVarStatusCode = (int)localVarResponse.StatusCode;
+
+ if ( ExceptionFactory != null ) {
+ Exception exception = ExceptionFactory ("CreateBucket", localVarResponse);
+ if ( exception != null )
+ throw exception;
+ }
+
+ ApiResponse apiResponse = new ApiResponse*Bucket*/dynamic> (
+ localVarStatusCode,
+ localVarResponse.Headers.ToDictionary (x => x.Name, x => x.Value.ToString ()),
+ /*(Bucket)*/ Configuration.ApiClient.Deserialize (localVarResponse, typeof (Bucket))
+ );
+ return apiResponse;
+ }
+
+ ///
+ /// Use this endpoint to create a bucket. Buckets are arbitrary spaces created and owned by applications. Bucket keys are globally unique across all regions, regardless of where they were created, and they cannot be changed. The application creating the bucket is the owner of the bucket.
+ ///
+ /// Thrown when fails to make API call
+ /// Body Structure
+ /// The region where the bucket resides Acceptable values: `US`, `EMEA` Default is `US` (optional, default to US)
+ /// Task of Bucket
+ public async System.Threading.Tasks.Task*Bucket*/dynamic> CreateBucketAsync (PostBucketsPayload postBuckets, string region = null) {
+ ApiResponse*Bucket*/dynamic> localVarResponse = await CreateBucketAsyncWithHttpInfo (postBuckets, region);
+ return localVarResponse.Data;
+
+ }
+
+ ///
+ /// Use this endpoint to create a bucket. Buckets are arbitrary spaces created and owned by applications. Bucket keys are globally unique across all regions, regardless of where they were created, and they cannot be changed. The application creating the bucket is the owner of the bucket.
+ ///
+ /// Thrown when fails to make API call
+ /// Body Structure
+ /// The region where the bucket resides Acceptable values: `US`, `EMEA` Default is `US` (optional, default to US)
+ /// Task of ApiResponse (Bucket)
+ public async System.Threading.Tasks.Task> CreateBucketAsyncWithHttpInfo (PostBucketsPayload postBuckets, string region = null) {
+ // verify the required parameter 'postBuckets' is set
+ if ( postBuckets == null )
+ throw new ApiException (400, "Missing required parameter 'postBuckets' when calling BucketsApi->CreateBucket");
+
+ var localVarPath = "/oss/v2/buckets";
+ var localVarPathParams = new Dictionary ();
+ var localVarQueryParams = new Dictionary ();
+ var localVarHeaderParams = new Dictionary (Configuration.DefaultHeader);
+ var localVarFormParams = new Dictionary ();
+ var localVarFileParams = new Dictionary ();
+ Object localVarPostBody = null;
+
+ // to determine the Content-Type header
+ String [] localVarHttpContentTypes = new String [] {
+ "application/json"
+ };
+ String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType (localVarHttpContentTypes);
+
+ // to determine the Accept header
+ String [] localVarHttpHeaderAccepts = new String [] {
+ "application/vnd.api+json",
+ "application/json"
+ };
+ String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept (localVarHttpHeaderAccepts);
+ if ( localVarHttpHeaderAccept != null )
+ localVarHeaderParams.Add ("Accept", localVarHttpHeaderAccept);
+
+ // set "format" to json by default
+ // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
+ localVarPathParams.Add ("format", "json");
+ if ( region != null && localVarHeaderParams.ContainsKey (HeaderParamRegion) )
+ localVarHeaderParams [HeaderParamRegion] = Configuration.ApiClient.ParameterToString (region); // header parameter
+ else if (region != null )
+ localVarHeaderParams.Add (HeaderParamRegion, Configuration.ApiClient.ParameterToString (region)); // header parameter
+ if ( postBuckets != null && postBuckets.GetType () == typeof (byte []) ) // http body (model) parameter
+ {
+ localVarPostBody = postBuckets; // byte array
+ } else if ( postBuckets != null
+ && (postBuckets.GetType () == typeof (System.IO.FileStream)
+ || postBuckets.GetType () == typeof (System.IO.BinaryReader)
+ || postBuckets.GetType () == typeof (System.IO.BufferedStream)
+ || postBuckets.GetType () == typeof (System.IO.MemoryStream)
+ || postBuckets.GetType () == typeof (System.IO.StreamReader)
+ )
+ ) {
+ localVarPostBody = Configuration.ApiClient.toByteArray (postBuckets); // byte array
+ } else if ( postBuckets != null ) {
+ localVarPostBody = Configuration.ApiClient.Serialize (postBuckets);
+ }
+
+ // authentication (oauth2_application) required
+ // oauth required
+ if ( !String.IsNullOrEmpty (Configuration.AccessToken) ) {
+ localVarHeaderParams ["Authorization"] = "Bearer " + Configuration.AccessToken;
+ }
+
+ // make the HTTP request
+ RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync (localVarPath,
+ Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
+ localVarPathParams, localVarHttpContentType);
+
+ int localVarStatusCode = (int)localVarResponse.StatusCode;
+
+ if ( ExceptionFactory != null ) {
+ Exception exception = ExceptionFactory ("CreateBucket", localVarResponse);
+ if ( exception != null )
+ throw exception;
+ }
+
+ return new ApiResponse*Bucket*/dynamic> (localVarStatusCode,
+ localVarResponse.Headers.ToDictionary (x => x.Name, x => x.Value.ToString ()),
+ /*(Bucket)*/ Configuration.ApiClient.Deserialize (localVarResponse, typeof (Bucket)));
+
+ }
+
+ ///
+ /// This endpoint will delete a bucket.
+ ///
+ /// Thrown when fails to make API call
+ /// URL-encoded bucket key
+ ///
+ public void DeleteBucket (string bucketKey) {
+ DeleteBucketWithHttpInfo (bucketKey);
+ }
+
+ ///
+ /// This endpoint will delete a bucket.
+ ///
+ /// Thrown when fails to make API call
+ /// URL-encoded bucket key
+ /// ApiResponse of Object(void)
+ public ApiResponse DeleteBucketWithHttpInfo (string bucketKey) {
+ // verify the required parameter 'bucketKey' is set
+ if ( bucketKey == null )
+ throw new ApiException (400, "Missing required parameter 'bucketKey' when calling BucketsApi->DeleteBucket");
+
+ var localVarPath = "/oss/v2/buckets/{bucketKey}";
+ var localVarPathParams = new Dictionary ();
+ var localVarQueryParams = new Dictionary ();
+ var localVarHeaderParams = new Dictionary (Configuration.DefaultHeader);
+ var localVarFormParams = new Dictionary ();
+ var localVarFileParams = new Dictionary ();
+ Object localVarPostBody = null;
+
+ // to determine the Content-Type header
+ String [] localVarHttpContentTypes = new String [] {
+ "application/json"
+ };
+ String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType (localVarHttpContentTypes);
+
+ // to determine the Accept header
+ String [] localVarHttpHeaderAccepts = new String [] {
+ "application/vnd.api+json",
+ "application/json"
+ };
+ String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept (localVarHttpHeaderAccepts);
+ if ( localVarHttpHeaderAccept != null )
+ localVarHeaderParams.Add ("Accept", localVarHttpHeaderAccept);
+
+ // set "format" to json by default
+ // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
+ localVarPathParams.Add ("format", "json");
+ if ( bucketKey != null )
+ localVarPathParams.Add ("bucketKey", Configuration.ApiClient.ParameterToString (bucketKey)); // path parameter
+
+ // authentication (oauth2_application) required
+ // oauth required
+ if ( !String.IsNullOrEmpty (Configuration.AccessToken) ) {
+ localVarHeaderParams ["Authorization"] = "Bearer " + Configuration.AccessToken;
+ }
+
+ // make the HTTP request
+ RestResponse localVarResponse = (RestResponse)Configuration.ApiClient.CallApi (localVarPath,
+ Method.Delete, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
+ localVarPathParams, localVarHttpContentType);
+
+ int localVarStatusCode = (int)localVarResponse.StatusCode;
+
+ if ( ExceptionFactory != null ) {
+ Exception exception = ExceptionFactory ("DeleteBucket", localVarResponse);
+ if ( exception != null )
+ throw exception;
+ }
+
+
+ return new ApiResponse (localVarStatusCode,
+ localVarResponse.Headers.ToDictionary (x => x.Name, x => x.Value.ToString ()),
+ null);
+ }
+
+ ///
+ /// This endpoint will delete a bucket.
+ ///
+ /// Thrown when fails to make API call
+ /// URL-encoded bucket key
+ /// Task of void
+ public async System.Threading.Tasks.Task DeleteBucketAsync (string bucketKey) {
+ await DeleteBucketAsyncWithHttpInfo (bucketKey);
+
+ }
+
+ ///
+ /// This endpoint will delete a bucket.
+ ///
+ /// Thrown when fails to make API call
+ /// URL-encoded bucket key
+ /// Task of ApiResponse
+ public async System.Threading.Tasks.Task> DeleteBucketAsyncWithHttpInfo (string bucketKey) {
+ // verify the required parameter 'bucketKey' is set
+ if ( bucketKey == null )
+ throw new ApiException (400, "Missing required parameter 'bucketKey' when calling BucketsApi->DeleteBucket");
+
+ var localVarPath = "/oss/v2/buckets/{bucketKey}";
+ var localVarPathParams = new Dictionary ();
+ var localVarQueryParams = new Dictionary ();
+ var localVarHeaderParams = new Dictionary (Configuration.DefaultHeader);
+ var localVarFormParams = new Dictionary ();
+ var localVarFileParams = new Dictionary ();
+ Object localVarPostBody = null;
+
+ // to determine the Content-Type header
+ String [] localVarHttpContentTypes = new String [] {
+ "application/json"
+ };
+ String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType (localVarHttpContentTypes);
+
+ // to determine the Accept header
+ String [] localVarHttpHeaderAccepts = new String [] {
+ "application/vnd.api+json",
+ "application/json"
+ };
+ String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept (localVarHttpHeaderAccepts);
+ if ( localVarHttpHeaderAccept != null )
+ localVarHeaderParams.Add ("Accept", localVarHttpHeaderAccept);
+
+ // set "format" to json by default
+ // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
+ localVarPathParams.Add ("format", "json");
+ if ( bucketKey != null )
+ localVarPathParams.Add ("bucketKey", Configuration.ApiClient.ParameterToString (bucketKey)); // path parameter
+
+ // authentication (oauth2_application) required
+ // oauth required
+ if ( !String.IsNullOrEmpty (Configuration.AccessToken) ) {
+ localVarHeaderParams ["Authorization"] = "Bearer " + Configuration.AccessToken;
+ }
+
+ // make the HTTP request
+ RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync (localVarPath,
+ Method.Delete, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
+ localVarPathParams, localVarHttpContentType);
+
+ int localVarStatusCode = (int)localVarResponse.StatusCode;
+
+ if ( ExceptionFactory != null ) {
+ Exception exception = ExceptionFactory ("DeleteBucket", localVarResponse);
+ if ( exception != null )
+ throw exception;
+ }
+
+
+ return new ApiResponse (localVarStatusCode,
+ localVarResponse.Headers.ToDictionary (x => x.Name, x => x.Value.ToString ()),
+ null);
+ }
+
+ ///
+ /// This endpoint will return the buckets owned by the application. This endpoint supports pagination.
+ ///
+ /// Thrown when fails to make API call
+ /// URL-encoded bucket key
+ /// Bucket
+ public /*Bucket*/dynamic GetBucketDetails (string bucketKey) {
+ ApiResponse*Bucket*/dynamic> localVarResponse = GetBucketDetailsWithHttpInfo (bucketKey);
+ return localVarResponse.Data;
+ }
+
+ ///
+ /// This endpoint will return the buckets owned by the application. This endpoint supports pagination.
+ ///
+ /// Thrown when fails to make API call
+ /// URL-encoded bucket key
+ /// ApiResponse of Bucket
+ public ApiResponse< /*Bucket*/dynamic> GetBucketDetailsWithHttpInfo (string bucketKey) {
+ // verify the required parameter 'bucketKey' is set
+ if ( bucketKey == null )
+ throw new ApiException (400, "Missing required parameter 'bucketKey' when calling BucketsApi->GetBucketDetails");
+
+ var localVarPath = "/oss/v2/buckets/{bucketKey}/details";
+ var localVarPathParams = new Dictionary ();
+ var localVarQueryParams = new Dictionary ();
+ var localVarHeaderParams = new Dictionary (Configuration.DefaultHeader);
+ var localVarFormParams = new Dictionary ();
+ var localVarFileParams = new Dictionary ();
+ Object localVarPostBody = null;
+
+ // to determine the Content-Type header
+ String [] localVarHttpContentTypes = new String [] {
+ "application/json"
+ };
+ String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType (localVarHttpContentTypes);
+
+ // to determine the Accept header
+ String [] localVarHttpHeaderAccepts = new String [] {
+ "application/vnd.api+json",
+ "application/json"
+ };
+ String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept (localVarHttpHeaderAccepts);
+ if ( localVarHttpHeaderAccept != null )
+ localVarHeaderParams.Add ("Accept", localVarHttpHeaderAccept);
+
+ // set "format" to json by default
+ // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
+ localVarPathParams.Add ("format", "json");
+ if ( bucketKey != null )
+ localVarPathParams.Add ("bucketKey", Configuration.ApiClient.ParameterToString (bucketKey)); // path parameter
+
+ // authentication (oauth2_application) required
+ // oauth required
+ if ( !String.IsNullOrEmpty (Configuration.AccessToken) ) {
+ localVarHeaderParams ["Authorization"] = "Bearer " + Configuration.AccessToken;
+ }
+
+ // make the HTTP request
+ RestResponse localVarResponse = (RestResponse)Configuration.ApiClient.CallApi (localVarPath,
+ Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
+ localVarPathParams, localVarHttpContentType);
+
+ int localVarStatusCode = (int)localVarResponse.StatusCode;
+
+ if ( ExceptionFactory != null ) {
+ Exception exception = ExceptionFactory ("GetBucketDetails", localVarResponse);
+ if ( exception != null )
+ throw exception;
+ }
+
+ ApiResponse apiResponse = new ApiResponse*Bucket*/dynamic> (localVarStatusCode,
+ localVarResponse.Headers.ToDictionary (x => x.Name, x => x.Value.ToString ()),
+ /*(Bucket)*/ Configuration.ApiClient.Deserialize (localVarResponse, typeof (Bucket)));
+ return apiResponse;
+
+ }
+
+ ///
+ /// This endpoint will return the buckets owned by the application. This endpoint supports pagination.
+ ///
+ /// Thrown when fails to make API call
+ /// URL-encoded bucket key
+ /// Task of Bucket
+ public async System.Threading.Tasks.Task*Bucket*/dynamic> GetBucketDetailsAsync (string bucketKey) {
+ ApiResponse*Bucket*/dynamic> localVarResponse = await GetBucketDetailsAsyncWithHttpInfo (bucketKey);
+ return localVarResponse.Data;
+
+ }
+
+ ///
+ /// This endpoint will return the buckets owned by the application. This endpoint supports pagination.
+ ///
+ /// Thrown when fails to make API call
+ /// URL-encoded bucket key
+ /// Task of ApiResponse (Bucket)
+ public async System.Threading.Tasks.Task> GetBucketDetailsAsyncWithHttpInfo (string bucketKey) {
+ // verify the required parameter 'bucketKey' is set
+ if ( bucketKey == null )
+ throw new ApiException (400, "Missing required parameter 'bucketKey' when calling BucketsApi->GetBucketDetails");
+
+ var localVarPath = "/oss/v2/buckets/{bucketKey}/details";
+ var localVarPathParams = new Dictionary ();
+ var localVarQueryParams = new Dictionary ();
+ var localVarHeaderParams = new Dictionary (Configuration.DefaultHeader);
+ var localVarFormParams = new Dictionary ();
+ var localVarFileParams = new Dictionary ();
+ Object localVarPostBody = null;
+
+ // to determine the Content-Type header
+ String [] localVarHttpContentTypes = new String [] {
+ "application/json"
+ };
+ String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType (localVarHttpContentTypes);
+
+ // to determine the Accept header
+ String [] localVarHttpHeaderAccepts = new String [] {
+ "application/vnd.api+json",
+ "application/json"
+ };
+ String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept (localVarHttpHeaderAccepts);
+ if ( localVarHttpHeaderAccept != null )
+ localVarHeaderParams.Add ("Accept", localVarHttpHeaderAccept);
+
+ // set "format" to json by default
+ // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
+ //localVarPathParams.Add("format", "json");
+ if ( bucketKey != null )
+ localVarPathParams.Add ("bucketKey", Configuration.ApiClient.ParameterToString (bucketKey)); // path parameter
+
+ // authentication (oauth2_application) required
+ // oauth required
+ if ( !String.IsNullOrEmpty (Configuration.AccessToken) ) {
+ localVarHeaderParams ["Authorization"] = "Bearer " + Configuration.AccessToken;
+ }
+
+ // make the HTTP request
+ RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync (localVarPath,
+ Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
+ localVarPathParams, localVarHttpContentType);
+
+ int localVarStatusCode = (int)localVarResponse.StatusCode;
+
+ if ( ExceptionFactory != null ) {
+ Exception exception = ExceptionFactory ("GetBucketDetails", localVarResponse);
+ if ( exception != null )
+ throw exception;
+ }
+
+ return new ApiResponse*Bucket*/dynamic> (localVarStatusCode,
+ localVarResponse.Headers.ToDictionary (x => x.Name, x => x.Value.ToString ()),
+ /*(Bucket)*/ Configuration.ApiClient.Deserialize (localVarResponse, typeof (Bucket)));
+
+ }
+
+ ///
+ /// This endpoint will return the buckets owned by the application. This endpoint supports pagination.
+ ///
+ /// Thrown when fails to make API call
+ /// The region where the bucket resides Acceptable values: `US`, `EMEA` Default is `US` (optional, default to US)
+ /// Limit to the response size, Acceptable values: 1-100 Default = 10 (optional, default to 10)
+ /// Key to use as an offset to continue pagination This is typically the last bucket key found in a preceding GET buckets response (optional)
+ /// Buckets
+ public /*Buckets*/dynamic GetBuckets (string region = null, int? limit = null, string startAt = null) {
+ ApiResponse*Buckets*/dynamic> localVarResponse = GetBucketsWithHttpInfo (region, limit, startAt);
+ return localVarResponse.Data;
+ }
+
+ ///
+ /// This endpoint will return the buckets owned by the application. This endpoint supports pagination.
+ ///
+ /// Thrown when fails to make API call
+ /// The region where the bucket resides Acceptable values: `US`, `EMEA` Default is `US` (optional, default to US)
+ /// Limit to the response size, Acceptable values: 1-100 Default = 10 (optional, default to 10)
+ /// Key to use as an offset to continue pagination This is typically the last bucket key found in a preceding GET buckets response (optional)
+ /// ApiResponse of Buckets
+ public ApiResponse< /*Buckets*/dynamic> GetBucketsWithHttpInfo (string region = null, int? limit = null, string startAt = null) {
+
+ var localVarPath = "/oss/v2/buckets";
+ var localVarPathParams = new Dictionary ();
+ var localVarQueryParams = new Dictionary ();
+ var localVarHeaderParams = new Dictionary (Configuration.DefaultHeader);
+ var localVarFormParams = new Dictionary ();
+ var localVarFileParams = new Dictionary ();
+ Object localVarPostBody = null;
+
+ // to determine the Content-Type header
+ String [] localVarHttpContentTypes = new String [] {
+ "application/json"
+ };
+ String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType (localVarHttpContentTypes);
+
+ // to determine the Accept header
+ String [] localVarHttpHeaderAccepts = new String [] {
+ "application/vnd.api+json",
+ "application/json"
+ };
+ String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept (localVarHttpHeaderAccepts);
+ if ( localVarHttpHeaderAccept != null )
+ localVarHeaderParams.Add ("Accept", localVarHttpHeaderAccept);
+
+ // set "format" to json by default
+ // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
+ localVarPathParams.Add ("format", "json");
+ if ( region != null )
+ localVarQueryParams.Add ("region", Configuration.ApiClient.ParameterToString (region)); // query parameter
+ if ( limit != null )
+ localVarQueryParams.Add ("limit", Configuration.ApiClient.ParameterToString (limit)); // query parameter
+ if ( startAt != null )
+ localVarQueryParams.Add ("startAt", Configuration.ApiClient.ParameterToString (startAt)); // query parameter
+
+ // authentication (oauth2_application) required
+ // oauth required
+ if ( !String.IsNullOrEmpty (Configuration.AccessToken) ) {
+ localVarHeaderParams ["Authorization"] = "Bearer " + Configuration.AccessToken;
+ }
+
+ // make the HTTP request
+ RestResponse localVarResponse = (RestResponse)Configuration.ApiClient.CallApi (localVarPath,
+ Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
+ localVarPathParams, localVarHttpContentType);
+
+ int localVarStatusCode = (int)localVarResponse.StatusCode;
+
+ if ( ExceptionFactory != null ) {
+ Exception exception = ExceptionFactory ("GetBuckets", localVarResponse);
+ if ( exception != null )
+ throw exception;
+ }
+
+ return new ApiResponse*Buckets*/dynamic> (localVarStatusCode,
+ localVarResponse.Headers.ToDictionary (x => x.Name, x => x.Value.ToString ()),
+ /*(Buckets)*/ Configuration.ApiClient.Deserialize (localVarResponse, typeof (Buckets)));
+
+ }
+
+ ///
+ /// This endpoint will return the buckets owned by the application. This endpoint supports pagination.
+ ///
+ /// Thrown when fails to make API call
+ /// The region where the bucket resides Acceptable values: `US`, `EMEA` Default is `US` (optional, default to US)
+ /// Limit to the response size, Acceptable values: 1-100 Default = 10 (optional, default to 10)
+ /// Key to use as an offset to continue pagination This is typically the last bucket key found in a preceding GET buckets response (optional)
+ /// Task of Buckets
+ public async System.Threading.Tasks.Task*Buckets*/dynamic> GetBucketsAsync (string region = null, int? limit = null, string startAt = null) {
+ ApiResponse*Buckets*/dynamic> localVarResponse = await GetBucketsAsyncWithHttpInfo (region, limit, startAt);
+ return localVarResponse.Data;
+
+ }
+
+ ///
+ /// This endpoint will return the buckets owned by the application. This endpoint supports pagination.
+ ///
+ /// Thrown when fails to make API call
+ /// The region where the bucket resides Acceptable values: `US`, `EMEA` Default is `US` (optional, default to US)
+ /// Limit to the response size, Acceptable values: 1-100 Default = 10 (optional, default to 10)
+ /// Key to use as an offset to continue pagination This is typically the last bucket key found in a preceding GET buckets response (optional)
+ /// Task of ApiResponse (Buckets)
+ public async System.Threading.Tasks.Task> GetBucketsAsyncWithHttpInfo (string region = null, int? limit = null, string startAt = null) {
+
+ var localVarPath = "/oss/v2/buckets";
+ var localVarPathParams = new Dictionary ();
+ var localVarQueryParams = new Dictionary ();
+ var localVarHeaderParams = new Dictionary (Configuration.DefaultHeader);
+ var localVarFormParams = new Dictionary ();
+ var localVarFileParams = new Dictionary ();
+ Object localVarPostBody = null;
+
+ // to determine the Content-Type header
+ String [] localVarHttpContentTypes = new String [] {
+ "application/json"
+ };
+ String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType (localVarHttpContentTypes);
+
+ // to determine the Accept header
+ String [] localVarHttpHeaderAccepts = new String [] {
+ "application/vnd.api+json",
+ "application/json"
+ };
+ String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept (localVarHttpHeaderAccepts);
+ if ( localVarHttpHeaderAccept != null )
+ localVarHeaderParams.Add ("Accept", localVarHttpHeaderAccept);
+
+ // set "format" to json by default
+ // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
+ localVarPathParams.Add ("format", "json");
+ if ( region != null )
+ localVarQueryParams.Add ("region", Configuration.ApiClient.ParameterToString (region)); // query parameter
+ if ( limit != null )
+ localVarQueryParams.Add ("limit", Configuration.ApiClient.ParameterToString (limit)); // query parameter
+ if ( startAt != null )
+ localVarQueryParams.Add ("startAt", Configuration.ApiClient.ParameterToString (startAt)); // query parameter
+
+ // authentication (oauth2_application) required
+ // oauth required
+ if ( !String.IsNullOrEmpty (Configuration.AccessToken) ) {
+ localVarHeaderParams ["Authorization"] = "Bearer " + Configuration.AccessToken;
+ }
+
+ // make the HTTP request
+ RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync (localVarPath,
+ Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
+ localVarPathParams, localVarHttpContentType);
+
+ int localVarStatusCode = (int)localVarResponse.StatusCode;
+
+ if ( ExceptionFactory != null ) {
+ Exception exception = ExceptionFactory ("GetBuckets", localVarResponse);
+ if ( exception != null )
+ throw exception;
+ }
+
+ return new ApiResponse*Buckets*/dynamic> (localVarStatusCode,
+ localVarResponse.Headers.ToDictionary (x => x.Name, x => x.Value.ToString ()),
+ /*(Buckets)*/ Configuration.ApiClient.Deserialize (localVarResponse, typeof (Buckets)));
+
+ }
+
+ }
+}
diff --git a/Autodesk.Forge/Api/ObjectsApi.cs b/Autodesk.Forge/Api/ObjectsApi.cs
new file mode 100644
index 0000000..8876376
--- /dev/null
+++ b/Autodesk.Forge/Api/ObjectsApi.cs
@@ -0,0 +1,5050 @@
+/*
+ * Forge SDK
+ *
+ * The Forge Platform contains an expanding collection of web service components that can be used with Autodesk cloud-based products or your own technologies. Take advantage of Autodesk’s expertise in design and engineering.
+ *
+
+ * Contact: forge.help@autodesk.com
+ * Generated by: https://github.com/swagger-api/swagger-codegen.git
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Linq;
+using RestSharp;
+using Newtonsoft.Json.Linq;
+using Autodesk.Forge.Client;
+using Autodesk.Forge.Model;
+using System.Security.Cryptography;
+using System.Net.Http;
+using System.Diagnostics;
+using System.IO;
+using System.Net.Http.Headers;
+
+namespace Autodesk.Forge {
+ ///
+ /// Represents a collection of functions to interact with the API endpoints
+ ///
+ public interface IObjectsApi : IApiAccessor {
+ #region Synchronous Operations
+
+ ///
+ ///
+ ///
+ ///
+ /// Copies an object to another object name in the same bucket.
+ ///
+ /// Thrown when fails to make API call
+ /// URL-encoded bucket key
+ /// URL-encoded object name
+ /// URL-encoded Object key to use as the destination
+ /// ObjectDetails
+ /*ObjectDetails*/
+ dynamic CopyTo (string bucketKey, string objectName, string newObjName);
+
+ ///
+ ///
+ ///
+ ///
+ /// Copies an object to another object name in the same bucket.
+ ///
+ /// Thrown when fails to make API call
+ /// URL-encoded bucket key
+ /// URL-encoded object name
+ /// URL-encoded Object key to use as the destination
+ /// ApiResponse of ObjectDetails
+ ApiResponse*ObjectDetails*/dynamic> CopyToWithHttpInfo (string bucketKey, string objectName, string newObjName);
+
+ ///
+ ///
+ ///
+ ///
+ /// This endpoint creates a signed URL that can be used to download an object within the specified expiration time. Be aware that if the object the signed URL points to is deleted or expires before the signed URL expires, then the signed URL will no longer be valid. A successful call to this endpoint requires bucket owner access.
+ ///
+ /// Thrown when fails to make API call
+ /// URL-encoded bucket key
+ /// URL-encoded object name
+ /// Body Structure
+ /// Access for signed resource Acceptable values: `read`, `write`, `readwrite`. Default value: `read` (optional, default to read)
+ /// If true, this will generate a CloudFront URL for the S3 object
+ /// PostObjectSigned
+ /*PostObjectSigned*/
+ dynamic CreateSignedResource (string bucketKey, string objectName, PostBucketsSigned postBucketsSigned, string access = null, bool useCdn = true);
+
+ ///
+ ///
+ ///
+ ///
+ /// This endpoint creates a signed URL that can be used to download an object within the specified expiration time. Be aware that if the object the signed URL points to is deleted or expires before the signed URL expires, then the signed URL will no longer be valid. A successful call to this endpoint requires bucket owner access.
+ ///
+ /// Thrown when fails to make API call
+ /// URL-encoded bucket key
+ /// URL-encoded object name
+ /// Body Structure
+ /// Access for signed resource Acceptable values: `read`, `write`, `readwrite`. Default value: `read` (optional, default to read)
+ /// If true, this will generate a CloudFront URL for the S3 object
+ /// ApiResponse of PostObjectSigned
+ ApiResponse*PostObjectSigned*/dynamic> CreateSignedResourceWithHttpInfo (string bucketKey, string objectName, PostBucketsSigned postBucketsSigned, string access = null, bool useCdn = true);
+
+ ///
+ ///
+ ///
+ ///
+ /// Deletes an object from the bucket.
+ ///
+ /// Thrown when fails to make API call
+ /// URL-encoded bucket key
+ /// URL-encoded object name
+ ///
+ void DeleteObject (string bucketKey, string objectName);
+
+ ///
+ ///
+ ///
+ ///
+ /// Deletes an object from the bucket.
+ ///
+ /// Thrown when fails to make API call
+ /// URL-encoded bucket key
+ /// URL-encoded object name
+ /// ApiResponse of Object(void)
+ ApiResponse DeleteObjectWithHttpInfo (string bucketKey, string objectName);
+ ///
+ ///
+ ///
+ ///
+ /// Delete a signed URL. A successful call to this endpoint requires bucket owner access.
+ ///
+ /// Thrown when fails to make API call
+ /// Id of signed resource
+ /// The region where the bucket resides Acceptable values: `US`, `EMEA` Default is `US` (optional, default to US)
+ ///
+ void DeleteSignedResource (string id, string region = null);
+
+ ///
+ ///
+ ///
+ ///
+ /// Delete a signed URL. A successful call to this endpoint requires bucket owner access.
+ ///
+ /// Thrown when fails to make API call
+ /// Id of signed resource
+ /// The region where the bucket resides Acceptable values: `US`, `EMEA` Default is `US` (optional, default to US)
+ /// ApiResponse of Object(void)
+ ApiResponse DeleteSignedResourceWithHttpInfo (string id, string region = null);
+
+ ///
+ ///
+ ///
+ ///
+ /// Download an object.
+ ///
+ /// Thrown when fails to make API call
+ /// URL-encoded bucket key
+ /// URL-encoded object name
+ /// A range of bytes to download from the specified object. (optional)
+ /// The value of this header is compared to the ETAG of the object. If they match, the body will not be included in the response. Only the object information will be included. (optional)
+ /// If the requested object has not been modified since the time specified in this field, an entity will not be returned from the server; instead, a 304 (not modified) response will be returned without any message body. (optional)
+ /// When gzip is specified, a gzip compressed stream of the object’s bytes will be returned in the response. Cannot use “Accept-Encoding:gzip” with Range header containing an end byte range. End byte range will not be honored if “Accept-Encoding: gzip” header is used. (optional)
+ /// System.IO.Stream
+ /*System.IO.Stream*/
+ dynamic GetObject (string bucketKey, string objectName, string range = null, string ifNoneMatch = null, DateTime? ifModifiedSince = null, string acceptEncoding = null);
+
+ ///
+ ///
+ ///
+ ///
+ /// Download an object.
+ ///
+ /// Thrown when fails to make API call
+ /// URL-encoded bucket key
+ /// URL-encoded object name
+ /// A range of bytes to download from the specified object. (optional)
+ /// The value of this header is compared to the ETAG of the object. If they match, the body will not be included in the response. Only the object information will be included. (optional)
+ /// If the requested object has not been modified since the time specified in this field, an entity will not be returned from the server; instead, a 304 (not modified) response will be returned without any message body. (optional)
+ /// When gzip is specified, a gzip compressed stream of the object’s bytes will be returned in the response. Cannot use “Accept-Encoding:gzip” with Range header containing an end byte range. End byte range will not be honored if “Accept-Encoding: gzip” header is used. (optional)
+ /// ApiResponse of System.IO.Stream
+ ApiResponse*System.IO.Stream*/dynamic> GetObjectWithHttpInfo (string bucketKey, string objectName, string range = null, string ifNoneMatch = null, DateTime? ifModifiedSince = null, string acceptEncoding = null);
+
+ ///
+ ///
+ ///
+ ///
+ /// Returns object details in JSON format.
+ ///
+ /// Thrown when fails to make API call
+ /// URL-encoded bucket key
+ /// URL-encoded object name
+ /// If the requested object has not been modified since the time specified in this field, an entity will not be returned from the server; instead, a 304 (not modified) response will be returned without any message body. (optional)
+ /// Extra information in details; multiple uses are supported Acceptable values: `createdDate`, `lastAccessedDate`, `lastModifiedDate` (optional)
+ /// ObjectFullDetails
+ /*ObjectFullDetails*/
+ dynamic GetObjectDetails (string bucketKey, string objectName, DateTime? ifModifiedSince = null, string with = null);
+
+ ///
+ ///
+ ///
+ ///
+ /// Returns object details in JSON format.
+ ///
+ /// Thrown when fails to make API call
+ /// URL-encoded bucket key
+ /// URL-encoded object name
+ /// If the requested object has not been modified since the time specified in this field, an entity will not be returned from the server; instead, a 304 (not modified) response will be returned without any message body. (optional)
+ /// Extra information in details; multiple uses are supported Acceptable values: `createdDate`, `lastAccessedDate`, `lastModifiedDate` (optional)
+ /// ApiResponse of ObjectFullDetails
+ ApiResponse*ObjectFullDetails*/dynamic> GetObjectDetailsWithHttpInfo (string bucketKey, string objectName, DateTime? ifModifiedSince = null, string with = null);
+
+ ///
+ ///
+ ///
+ ///
+ /// List objects in a bucket. It is only available to the bucket creator.
+ ///
+ /// Thrown when fails to make API call
+ /// URL-encoded bucket key
+ /// Limit to the response size, Acceptable values: 1-100 Default = 10 (optional, default to 10)
+ /// Provides a way to filter the based on object key name (optional)
+ /// Key to use as an offset to continue pagination This is typically the last bucket key found in a preceding GET buckets response (optional)
+ /// BucketObjects
+ /*BucketObjects*/
+ dynamic GetObjects (string bucketKey, int? limit = null, string beginsWith = null, string startAt = null);
+
+ ///
+ ///
+ ///
+ ///
+ /// List objects in a bucket. It is only available to the bucket creator.
+ ///
+ /// Thrown when fails to make API call
+ /// URL-encoded bucket key
+ /// Limit to the response size, Acceptable values: 1-100 Default = 10 (optional, default to 10)
+ /// Provides a way to filter the based on object key name (optional)
+ /// Key to use as an offset to continue pagination This is typically the last bucket key found in a preceding GET buckets response (optional)
+ /// ApiResponse of BucketObjects
+ ApiResponse*BucketObjects*/dynamic> GetObjectsWithHttpInfo (string bucketKey, int? limit = null, string beginsWith = null, string startAt = null);
+
+ ///
+ ///
+ ///
+ ///
+ /// Download an object using a signed URL.
+ ///
+ /// Thrown when fails to make API call
+ /// Id of signed resource
+ /// A range of bytes to download from the specified object. (optional)
+ /// The value of this header is compared to the ETAG of the object. If they match, the body will not be included in the response. Only the object information will be included. (optional)
+ /// If the requested object has not been modified since the time specified in this field, an entity will not be returned from the server; instead, a 304 (not modified) response will be returned without any message body. (optional)
+ /// When gzip is specified, a gzip compressed stream of the object’s bytes will be returned in the response. Cannot use “Accept-Encoding:gzip” with Range header containing an end byte range. End byte range will not be honored if “Accept-Encoding: gzip” header is used. (optional)
+ /// The region where the bucket resides Acceptable values: `US`, `EMEA` Default is `US` (optional, default to US)
+ /// System.IO.Stream
+ /*System.IO.Stream*/
+ dynamic GetSignedResource (string id, string range = null, string ifNoneMatch = null, DateTime? ifModifiedSince = null, string acceptEncoding = null, string region = null);
+
+ ///
+ ///
+ ///
+ ///
+ /// Download an object using a signed URL.
+ ///
+ /// Thrown when fails to make API call
+ /// Id of signed resource
+ /// A range of bytes to download from the specified object. (optional)
+ /// The value of this header is compared to the ETAG of the object. If they match, the body will not be included in the response. Only the object information will be included. (optional)
+ /// If the requested object has not been modified since the time specified in this field, an entity will not be returned from the server; instead, a 304 (not modified) response will be returned without any message body. (optional)
+ /// When gzip is specified, a gzip compressed stream of the object’s bytes will be returned in the response. Cannot use “Accept-Encoding:gzip” with Range header containing an end byte range. End byte range will not be honored if “Accept-Encoding: gzip” header is used. (optional)
+ /// The region where the bucket resides Acceptable values: `US`, `EMEA` Default is `US` (optional, default to US)
+ /// ApiResponse of System.IO.Stream
+ ApiResponse*System.IO.Stream*/dynamic> GetSignedResourceWithHttpInfo (string id, string range = null, string ifNoneMatch = null, DateTime? ifModifiedSince = null, string acceptEncoding = null, string region = null);
+
+ ///
+ ///
+ ///
+ ///
+ /// This endpoint returns status information about a resumable upload.
+ ///
+ /// Thrown when fails to make API call
+ /// URL-encoded bucket key
+ /// URL-encoded object name
+ /// Unique identifier of a session of a file being uploaded
+ ///
+ void GetStatusBySessionId (string bucketKey, string objectName, string sessionId);
+
+ ///
+ ///
+ ///
+ ///
+ /// This endpoint returns status information about a resumable upload.
+ ///
+ /// Thrown when fails to make API call
+ /// URL-encoded bucket key
+ /// URL-encoded object name
+ /// Unique identifier of a session of a file being uploaded
+ /// ApiResponse of Object(void)
+ ApiResponse GetStatusBySessionIdWithHttpInfo (string bucketKey, string objectName, string sessionId);
+
+ ///
+ ///
+ ///
+ ///
+ /// This endpoint allows resumable uploads for large files in chunks.
+ ///
+ /// Thrown when fails to make API call
+ /// URL-encoded bucket key
+ /// URL-encoded object name
+ /// Indicates the size of the request body.
+ /// Byte range of a segment being uploaded
+ /// Unique identifier of a session of a file being uploaded
+ ///
+ /// The suggested default filename when downloading this object to a file after it has been uploaded. (optional)
+ /// If-Match header containing a SHA-1 hash of the bytes in the request body can be sent by the calling service or client application with the request. If present, OSS will use the value of If-Match header to verify that a SHA-1 calculated for the uploaded bytes server side matches what was sent in the header. If not, the request is failed with a status 412 Precondition Failed and the data is not written. (optional)
+ /// ObjectDetails
+ /*ObjectDetails*/
+ dynamic UploadChunk (string bucketKey, string objectName, int? contentLength, string contentRange, string sessionId, System.IO.Stream body, string contentDisposition = null, string ifMatch = null, string contentType = "application/octet-stream");
+
+ ///
+ ///
+ ///
+ ///
+ /// This endpoint allows resumable uploads for large files in chunks.
+ ///
+ /// Thrown when fails to make API call
+ /// URL-encoded bucket key
+ /// URL-encoded object name
+ /// Indicates the size of the request body.
+ /// Byte range of a segment being uploaded
+ /// Unique identifier of a session of a file being uploaded
+ ///
+ /// The suggested default filename when downloading this object to a file after it has been uploaded. (optional)
+ /// If-Match header containing a SHA-1 hash of the bytes in the request body can be sent by the calling service or client application with the request. If present, OSS will use the value of If-Match header to verify that a SHA-1 calculated for the uploaded bytes server side matches what was sent in the header. If not, the request is failed with a status 412 Precondition Failed and the data is not written. (optional)
+ /// ApiResponse of ObjectDetails
+ ApiResponse*ObjectDetails*/dynamic> UploadChunkWithHttpInfo (string bucketKey, string objectName, int? contentLength, string contentRange, string sessionId, System.IO.Stream body, string contentDisposition = null, string ifMatch = null, string contentType = "application/octet-stream");
+
+ ///
+ ///
+ ///
+ ///
+ /// Upload an object. If the specified object name already exists in the bucket, the uploaded content will overwrite the existing content for the bucket name/object name combination.
+ ///
+ /// Thrown when fails to make API call
+ /// URL-encoded bucket key
+ /// URL-encoded object name
+ /// Indicates the size of the request body.
+ ///
+ /// The suggested default filename when downloading this object to a file after it has been uploaded. (optional)
+ /// If-Match header containing a SHA-1 hash of the bytes in the request body can be sent by the calling service or client application with the request. If present, OSS will use the value of If-Match header to verify that a SHA-1 calculated for the uploaded bytes server side matches what was sent in the header. If not, the request is failed with a status 412 Precondition Failed and the data is not written. (optional)
+ /// ObjectDetails
+ /*ObjectDetails*/
+ dynamic UploadObject (string bucketKey, string objectName, int? contentLength, System.IO.Stream body, string contentDisposition = null, string ifMatch = null, string contentType = "application/octet-stream");
+
+ ///
+ ///
+ ///
+ ///
+ /// Upload an object. If the specified object name already exists in the bucket, the uploaded content will overwrite the existing content for the bucket name/object name combination.
+ ///
+ /// Thrown when fails to make API call
+ /// URL-encoded bucket key
+ /// URL-encoded object name
+ /// Indicates the size of the request body.
+ ///
+ /// The suggested default filename when downloading this object to a file after it has been uploaded. (optional)
+ /// If-Match header containing a SHA-1 hash of the bytes in the request body can be sent by the calling service or client application with the request. If present, OSS will use the value of If-Match header to verify that a SHA-1 calculated for the uploaded bytes server side matches what was sent in the header. If not, the request is failed with a status 412 Precondition Failed and the data is not written. (optional)
+ /// ApiResponse of ObjectDetails
+ ApiResponse*ObjectDetails*/dynamic> UploadObjectWithHttpInfo (string bucketKey, string objectName, int? contentLength, System.IO.Stream body, string contentDisposition = null, string ifMatch = null, string contentType = "application/octet-stream");
+
+ ///
+ ///
+ ///
+ ///
+ /// Overwrite a existing object using a signed URL. Conditions to call this operation: Object is available Expiration period is valid Signed URL should be created with `write` or `readwrite`
+ ///
+ /// Thrown when fails to make API call
+ /// Id of signed resource
+ /// Indicates the size of the request body.
+ ///
+ /// The suggested default filename when downloading this object to a file after it has been uploaded. (optional)
+ /// The region where the bucket resides Acceptable values: `US`, `EMEA` Default is `US` (optional, default to US)
+ /// If-Match header containing a SHA-1 hash of the bytes in the request body can be sent by the calling service or client application with the request. If present, OSS will use the value of If-Match header to verify that a SHA-1 calculated for the uploaded bytes server side matches what was sent in the header. If not, the request is failed with a status 412 Precondition Failed and the data is not written. (optional)
+ /// ObjectDetails
+ /*ObjectDetails*/
+ dynamic UploadSignedResource (string id, int? contentLength, System.IO.Stream body, string contentDisposition = null, string xAdsRegion = null, string ifMatch = null, string contentType = "application/octet-stream");
+
+ ///
+ ///
+ ///
+ ///
+ /// Overwrite a existing object using a signed URL. Conditions to call this operation: Object is available Expiration period is valid Signed URL should be created with `write` or `readwrite`
+ ///
+ /// Thrown when fails to make API call
+ /// Id of signed resource
+ /// Indicates the size of the request body.
+ ///
+ /// The suggested default filename when downloading this object to a file after it has been uploaded. (optional)
+ /// The region where the bucket resides Acceptable values: `US`, `EMEA` Default is `US` (optional, default to US)
+ /// If-Match header containing a SHA-1 hash of the bytes in the request body can be sent by the calling service or client application with the request. If present, OSS will use the value of If-Match header to verify that a SHA-1 calculated for the uploaded bytes server side matches what was sent in the header. If not, the request is failed with a status 412 Precondition Failed and the data is not written. (optional)
+ /// ApiResponse of ObjectDetails
+ ApiResponse*ObjectDetails*/dynamic> UploadSignedResourceWithHttpInfo (string id, int? contentLength, System.IO.Stream body, string contentDisposition = null, string xAdsRegion = null, string ifMatch = null, string contentType = "application/octet-stream");
+
+ ///
+ ///
+ ///
+ ///
+ /// Resumable upload for signed URLs.
+ ///
+ /// Thrown when fails to make API call
+ /// Id of signed resource
+ /// Byte range of a segment being uploaded
+ /// Unique identifier of a session of a file being uploaded
+ ///
+ /// The suggested default filename when downloading this object to a file after it has been uploaded. (optional)
+ /// The region where the bucket resides Acceptable values: `US`, `EMEA` Default is `US` (optional, default to US)
+ /// ObjectDetails
+ /*ObjectDetails*/
+ dynamic UploadSignedResourcesChunk (string id, string contentRange, string sessionId, System.IO.Stream body, string contentDisposition = null, string xAdsRegion = null, string contentType = "application/octet-stream");
+
+ ///
+ ///
+ ///
+ ///
+ /// Resumable upload for signed URLs.
+ ///
+ /// Thrown when fails to make API call
+ /// Id of signed resource
+ /// Byte range of a segment being uploaded
+ /// Unique identifier of a session of a file being uploaded
+ ///
+ /// The suggested default filename when downloading this object to a file after it has been uploaded. (optional)
+ /// The region where the bucket resides Acceptable values: `US`, `EMEA` Default is `US` (optional, default to US)
+ /// ApiResponse of ObjectDetails
+ ApiResponse*ObjectDetails*/dynamic> UploadSignedResourcesChunkWithHttpInfo (string id, string contentRange, string sessionId, System.IO.Stream body, string contentDisposition = null, string xAdsRegion = null, string contentType = "application/octet-stream");
+
+ #endregion Synchronous Operations
+
+ #region Asynchronous Operations
+ ///
+ ///
+ ///
+ ///
+ /// Copies an object to another object name in the same bucket.
+ ///
+ /// Thrown when fails to make API call
+ /// URL-encoded bucket key
+ /// URL-encoded object name
+ /// URL-encoded Object key to use as the destination
+ /// Task of ObjectDetails
+ [Obsolete]
+ System.Threading.Tasks.Task*ObjectDetails*/dynamic> CopyToAsync (string bucketKey, string objectName, string newObjName);
+
+ ///
+ ///
+ ///
+ ///
+ /// Copies an object to another object name in the same bucket.
+ ///
+ /// Thrown when fails to make API call
+ /// URL-encoded bucket key
+ /// URL-encoded object name
+ /// URL-encoded Object key to use as the destination
+ /// Task of ApiResponse (ObjectDetails)
+ [Obsolete]
+ System.Threading.Tasks.Task> CopyToAsyncWithHttpInfo (string bucketKey, string objectName, string newObjName);
+
+ ///
+ ///
+ ///
+ ///
+ /// This endpoint creates a signed URL that can be used to download an object within the specified expiration time. Be aware that if the object the signed URL points to is deleted or expires before the signed URL expires, then the signed URL will no longer be valid. A successful call to this endpoint requires bucket owner access.
+ ///
+ /// Thrown when fails to make API call
+ /// URL-encoded bucket key
+ /// URL-encoded object name
+ /// Body Structure
+ /// Access for signed resource Acceptable values: `read`, `write`, `readwrite`. Default value: `read` (optional, default to read)
+ /// If true, this will generate a CloudFront URL for the S3 object
+ /// Task of PostObjectSigned
+ System.Threading.Tasks.Task*PostObjectSigned*/dynamic> CreateSignedResourceAsync (string bucketKey, string objectName, PostBucketsSigned postBucketsSigned, string access = null, bool useCdn = true);
+
+ ///
+ ///
+ ///
+ ///
+ /// This endpoint creates a signed URL that can be used to download an object within the specified expiration time. Be aware that if the object the signed URL points to is deleted or expires before the signed URL expires, then the signed URL will no longer be valid. A successful call to this endpoint requires bucket owner access.
+ ///
+ /// Thrown when fails to make API call
+ /// URL-encoded bucket key
+ /// URL-encoded object name
+ /// Body Structure
+ /// Access for signed resource Acceptable values: `read`, `write`, `readwrite`. Default value: `read` (optional, default to read)
+ /// If true, this will generate a CloudFront URL for the S3 object
+ /// Task of ApiResponse (PostObjectSigned)
+ System.Threading.Tasks.Task> CreateSignedResourceAsyncWithHttpInfo (string bucketKey, string objectName, PostBucketsSigned postBucketsSigned, string access = null, bool useCdn = true);
+
+ ///
+ ///
+ ///
+ ///
+ /// Deletes an object from the bucket.
+ ///
+ /// Thrown when fails to make API call
+ /// URL-encoded bucket key
+ /// URL-encoded object name
+ /// Task of void
+ System.Threading.Tasks.Task DeleteObjectAsync (string bucketKey, string objectName);
+
+ ///
+ ///
+ ///
+ ///
+ /// Deletes an object from the bucket.
+ ///
+ /// Thrown when fails to make API call
+ /// URL-encoded bucket key
+ /// URL-encoded object name
+ /// Task of ApiResponse
+ System.Threading.Tasks.Task> DeleteObjectAsyncWithHttpInfo (string bucketKey, string objectName);
+
+ ///
+ ///
+ ///
+ ///
+ /// Delete a signed URL. A successful call to this endpoint requires bucket owner access.
+ ///
+ /// Thrown when fails to make API call
+ /// Id of signed resource
+ /// The region where the bucket resides Acceptable values: `US`, `EMEA` Default is `US` (optional, default to US)
+ /// Task of void
+ System.Threading.Tasks.Task DeleteSignedResourceAsync (string id, string region = null);
+
+ ///
+ ///
+ ///
+ ///
+ /// Delete a signed URL. A successful call to this endpoint requires bucket owner access.
+ ///
+ /// Thrown when fails to make API call
+ /// Id of signed resource
+ /// The region where the bucket resides Acceptable values: `US`, `EMEA` Default is `US` (optional, default to US)
+ /// Task of ApiResponse
+ System.Threading.Tasks.Task> DeleteSignedResourceAsyncWithHttpInfo (string id, string region = null);
+
+ ///
+ ///
+ ///
+ ///
+ /// Download an object.
+ ///
+ /// Thrown when fails to make API call
+ /// URL-encoded bucket key
+ /// URL-encoded object name
+ /// A range of bytes to download from the specified object. (optional)
+ /// The value of this header is compared to the ETAG of the object. If they match, the body will not be included in the response. Only the object information will be included. (optional)
+ /// If the requested object has not been modified since the time specified in this field, an entity will not be returned from the server; instead, a 304 (not modified) response will be returned without any message body. (optional)
+ /// When gzip is specified, a gzip compressed stream of the object’s bytes will be returned in the response. Cannot use “Accept-Encoding:gzip” with Range header containing an end byte range. End byte range will not be honored if “Accept-Encoding: gzip” header is used. (optional)
+ /// Task of System.IO.Stream
+ [Obsolete]
+ System.Threading.Tasks.Task*System.IO.Stream*/dynamic> GetObjectAsync (string bucketKey, string objectName, string range = null, string ifNoneMatch = null, DateTime? ifModifiedSince = null, string acceptEncoding = null);
+
+ ///
+ ///
+ ///
+ ///
+ /// Download an object.
+ ///
+ /// Thrown when fails to make API call
+ /// URL-encoded bucket key
+ /// URL-encoded object name
+ /// A range of bytes to download from the specified object. (optional)
+ /// The value of this header is compared to the ETAG of the object. If they match, the body will not be included in the response. Only the object information will be included. (optional)
+ /// If the requested object has not been modified since the time specified in this field, an entity will not be returned from the server; instead, a 304 (not modified) response will be returned without any message body. (optional)
+ /// When gzip is specified, a gzip compressed stream of the object’s bytes will be returned in the response. Cannot use “Accept-Encoding:gzip” with Range header containing an end byte range. End byte range will not be honored if “Accept-Encoding: gzip” header is used. (optional)
+ /// Task of ApiResponse (System.IO.Stream)
+ [Obsolete]
+ System.Threading.Tasks.Task> GetObjectAsyncWithHttpInfo (string bucketKey, string objectName, string range = null, string ifNoneMatch = null, DateTime? ifModifiedSince = null, string acceptEncoding = null);
+
+ ///
+ ///
+ ///
+ ///
+ /// Returns object details in JSON format.
+ ///
+ /// Thrown when fails to make API call
+ /// URL-encoded bucket key
+ /// URL-encoded object name
+ /// If the requested object has not been modified since the time specified in this field, an entity will not be returned from the server; instead, a 304 (not modified) response will be returned without any message body. (optional)
+ /// Extra information in details; multiple uses are supported Acceptable values: `createdDate`, `lastAccessedDate`, `lastModifiedDate` (optional)
+ /// Task of ObjectFullDetails
+ System.Threading.Tasks.Task*ObjectFullDetails*/dynamic> GetObjectDetailsAsync (string bucketKey, string objectName, DateTime? ifModifiedSince = null, string with = null);
+
+ ///
+ ///
+ ///
+ ///
+ /// Returns object details in JSON format.
+ ///
+ /// Thrown when fails to make API call
+ /// URL-encoded bucket key
+ /// URL-encoded object name
+ /// If the requested object has not been modified since the time specified in this field, an entity will not be returned from the server; instead, a 304 (not modified) response will be returned without any message body. (optional)
+ /// Extra information in details; multiple uses are supported Acceptable values: `createdDate`, `lastAccessedDate`, `lastModifiedDate` (optional)
+ /// Task of ApiResponse (ObjectFullDetails)
+ System.Threading.Tasks.Task> GetObjectDetailsAsyncWithHttpInfo (string bucketKey, string objectName, DateTime? ifModifiedSince = null, string with = null);
+
+ ///
+ ///
+ ///
+ ///
+ /// List objects in a bucket. It is only available to the bucket creator.
+ ///
+ /// Thrown when fails to make API call
+ /// URL-encoded bucket key
+ /// Limit to the response size, Acceptable values: 1-100 Default = 10 (optional, default to 10)
+ /// Provides a way to filter the based on object key name (optional)
+ /// Key to use as an offset to continue pagination This is typically the last bucket key found in a preceding GET buckets response (optional)
+ /// Task of BucketObjects
+ System.Threading.Tasks.Task*BucketObjects*/dynamic> GetObjectsAsync (string bucketKey, int? limit = null, string beginsWith = null, string startAt = null);
+
+ ///
+ ///
+ ///
+ ///
+ /// List objects in a bucket. It is only available to the bucket creator.
+ ///
+ /// Thrown when fails to make API call
+ /// URL-encoded bucket key
+ /// Limit to the response size, Acceptable values: 1-100 Default = 10 (optional, default to 10)
+ /// Provides a way to filter the based on object key name (optional)
+ /// Key to use as an offset to continue pagination This is typically the last bucket key found in a preceding GET buckets response (optional)
+ /// Task of ApiResponse (BucketObjects)
+ System.Threading.Tasks.Task> GetObjectsAsyncWithHttpInfo (string bucketKey, int? limit = null, string beginsWith = null, string startAt = null);
+
+ ///
+ ///
+ ///
+ ///
+ /// Download an object using a signed URL.
+ ///
+ /// Thrown when fails to make API call
+ /// Id of signed resource
+ /// A range of bytes to download from the specified object. (optional)
+ /// The value of this header is compared to the ETAG of the object. If they match, the body will not be included in the response. Only the object information will be included. (optional)
+ /// If the requested object has not been modified since the time specified in this field, an entity will not be returned from the server; instead, a 304 (not modified) response will be returned without any message body. (optional)
+ /// When gzip is specified, a gzip compressed stream of the object’s bytes will be returned in the response. Cannot use “Accept-Encoding:gzip” with Range header containing an end byte range. End byte range will not be honored if “Accept-Encoding: gzip” header is used. (optional)
+ /// The region where the bucket resides Acceptable values: `US`, `EMEA` Default is `US` (optional, default to US)
+ /// Task of System.IO.Stream
+ System.Threading.Tasks.Task*System.IO.Stream*/dynamic> GetSignedResourceAsync (string id, string range = null, string ifNoneMatch = null, DateTime? ifModifiedSince = null, string acceptEncoding = null, string region = null);
+
+ ///
+ ///
+ ///
+ ///
+ /// Download an object using a signed URL.
+ ///
+ /// Thrown when fails to make API call
+ /// Id of signed resource
+ /// A range of bytes to download from the specified object. (optional)
+ /// The value of this header is compared to the ETAG of the object. If they match, the body will not be included in the response. Only the object information will be included. (optional)
+ /// If the requested object has not been modified since the time specified in this field, an entity will not be returned from the server; instead, a 304 (not modified) response will be returned without any message body. (optional)
+ /// When gzip is specified, a gzip compressed stream of the object’s bytes will be returned in the response. Cannot use “Accept-Encoding:gzip” with Range header containing an end byte range. End byte range will not be honored if “Accept-Encoding: gzip” header is used. (optional)
+ /// The region where the bucket resides Acceptable values: `US`, `EMEA` Default is `US` (optional, default to US)
+ /// Task of ApiResponse (System.IO.Stream)
+ System.Threading.Tasks.Task> GetSignedResourceAsyncWithHttpInfo (string id, string range = null, string ifNoneMatch = null, DateTime? ifModifiedSince = null, string acceptEncoding = null, string region = null);
+
+ ///
+ ///
+ ///
+ ///
+ /// This endpoint returns status information about a resumable upload.
+ ///
+ /// Thrown when fails to make API call
+ /// URL-encoded bucket key
+ /// URL-encoded object name
+ /// Unique identifier of a session of a file being uploaded
+ /// Task of void
+ System.Threading.Tasks.Task GetStatusBySessionIdAsync (string bucketKey, string objectName, string sessionId);
+
+ ///
+ ///
+ ///
+ ///
+ /// This endpoint returns status information about a resumable upload.
+ ///
+ /// Thrown when fails to make API call
+ /// URL-encoded bucket key
+ /// URL-encoded object name
+ /// Unique identifier of a session of a file being uploaded
+ /// Task of ApiResponse
+ System.Threading.Tasks.Task> GetStatusBySessionIdAsyncWithHttpInfo (string bucketKey, string objectName, string sessionId);
+
+ ///
+ ///
+ ///
+ ///
+ /// This endpoint allows resumable uploads for large files in chunks.
+ ///
+ /// Thrown when fails to make API call
+ /// URL-encoded bucket key
+ /// URL-encoded object name
+ /// Indicates the size of the request body.
+ /// Byte range of a segment being uploaded
+ /// Unique identifier of a session of a file being uploaded
+ ///
+ /// The suggested default filename when downloading this object to a file after it has been uploaded. (optional)
+ /// If-Match header containing a SHA-1 hash of the bytes in the request body can be sent by the calling service or client application with the request. If present, OSS will use the value of If-Match header to verify that a SHA-1 calculated for the uploaded bytes server side matches what was sent in the header. If not, the request is failed with a status 412 Precondition Failed and the data is not written. (optional)
+ /// Task of ObjectDetails
+ [Obsolete]
+ System.Threading.Tasks.Task*ObjectDetails*/dynamic> UploadChunkAsync (string bucketKey, string objectName, int? contentLength, string contentRange, string sessionId, System.IO.Stream body, string contentDisposition = null, string ifMatch = null, string contentType = "application/octet-stream");
+
+ ///
+ ///
+ ///
+ ///
+ /// This endpoint allows resumable uploads for large files in chunks.
+ ///
+ /// Thrown when fails to make API call
+ /// URL-encoded bucket key
+ /// URL-encoded object name
+ /// Indicates the size of the request body.
+ /// Byte range of a segment being uploaded
+ /// Unique identifier of a session of a file being uploaded
+ ///
+ /// The suggested default filename when downloading this object to a file after it has been uploaded. (optional)
+ /// If-Match header containing a SHA-1 hash of the bytes in the request body can be sent by the calling service or client application with the request. If present, OSS will use the value of If-Match header to verify that a SHA-1 calculated for the uploaded bytes server side matches what was sent in the header. If not, the request is failed with a status 412 Precondition Failed and the data is not written. (optional)
+ /// Task of ApiResponse (ObjectDetails)
+ [Obsolete]
+ System.Threading.Tasks.Task> UploadChunkAsyncWithHttpInfo (string bucketKey, string objectName, int? contentLength, string contentRange, string sessionId, System.IO.Stream body, string contentDisposition = null, string ifMatch = null, string contentType = "application/octet-stream");
+
+ ///
+ ///
+ ///
+ ///
+ /// Upload an object. If the specified object name already exists in the bucket, the uploaded content will overwrite the existing content for the bucket name/object name combination.
+ ///
+ /// Thrown when fails to make API call
+ /// URL-encoded bucket key
+ /// URL-encoded object name
+ /// Indicates the size of the request body.
+ ///
+ /// The suggested default filename when downloading this object to a file after it has been uploaded. (optional)
+ /// If-Match header containing a SHA-1 hash of the bytes in the request body can be sent by the calling service or client application with the request. If present, OSS will use the value of If-Match header to verify that a SHA-1 calculated for the uploaded bytes server side matches what was sent in the header. If not, the request is failed with a status 412 Precondition Failed and the data is not written. (optional)
+ /// Task of ObjectDetails
+ [Obsolete]
+ System.Threading.Tasks.Task*ObjectDetails*/dynamic> UploadObjectAsync (string bucketKey, string objectName, int? contentLength, System.IO.Stream body, string contentDisposition = null, string ifMatch = null, string contentType = "application/octet-stream");
+
+ ///
+ ///
+ ///
+ ///
+ /// Upload an object. If the specified object name already exists in the bucket, the uploaded content will overwrite the existing content for the bucket name/object name combination.
+ ///
+ /// Thrown when fails to make API call
+ /// URL-encoded bucket key
+ /// URL-encoded object name
+ /// Indicates the size of the request body.
+ ///
+ /// The suggested default filename when downloading this object to a file after it has been uploaded. (optional)
+ /// If-Match header containing a SHA-1 hash of the bytes in the request body can be sent by the calling service or client application with the request. If present, OSS will use the value of If-Match header to verify that a SHA-1 calculated for the uploaded bytes server side matches what was sent in the header. If not, the request is failed with a status 412 Precondition Failed and the data is not written. (optional)
+ /// Task of ApiResponse (ObjectDetails)
+ [Obsolete]
+ System.Threading.Tasks.Task> UploadObjectAsyncWithHttpInfo (string bucketKey, string objectName, int? contentLength, System.IO.Stream body, string contentDisposition = null, string ifMatch = null, string contentType = "application/octet-stream");
+
+ ///
+ ///
+ ///
+ ///
+ /// Overwrite a existing object using a signed URL. Conditions to call this operation: Object is available Expiration period is valid Signed URL should be created with `write` or `readwrite`
+ ///
+ /// Thrown when fails to make API call
+ /// Id of signed resource
+ /// Indicates the size of the request body.
+ ///
+ /// The suggested default filename when downloading this object to a file after it has been uploaded. (optional)
+ /// The region where the bucket resides Acceptable values: `US`, `EMEA` Default is `US` (optional, default to US)
+ /// If-Match header containing a SHA-1 hash of the bytes in the request body can be sent by the calling service or client application with the request. If present, OSS will use the value of If-Match header to verify that a SHA-1 calculated for the uploaded bytes server side matches what was sent in the header. If not, the request is failed with a status 412 Precondition Failed and the data is not written. (optional)
+ /// Task of ObjectDetails
+ System.Threading.Tasks.Task*ObjectDetails*/dynamic> UploadSignedResourceAsync (string id, int? contentLength, System.IO.Stream body, string contentDisposition = null, string xAdsRegion = null, string ifMatch = null, string contentType = "application/octet-stream");
+
+ ///
+ ///
+ ///
+ ///
+ /// Overwrite a existing object using a signed URL. Conditions to call this operation: Object is available Expiration period is valid Signed URL should be created with `write` or `readwrite`
+ ///
+ /// Thrown when fails to make API call
+ /// Id of signed resource
+ /// Indicates the size of the request body.
+ ///
+ /// The suggested default filename when downloading this object to a file after it has been uploaded. (optional)
+ /// The region where the bucket resides Acceptable values: `US`, `EMEA` Default is `US` (optional, default to US)
+ /// If-Match header containing a SHA-1 hash of the bytes in the request body can be sent by the calling service or client application with the request. If present, OSS will use the value of If-Match header to verify that a SHA-1 calculated for the uploaded bytes server side matches what was sent in the header. If not, the request is failed with a status 412 Precondition Failed and the data is not written. (optional)
+ /// Task of ApiResponse (ObjectDetails)
+ System.Threading.Tasks.Task> UploadSignedResourceAsyncWithHttpInfo (string id, int? contentLength, System.IO.Stream body, string contentDisposition = null, string xAdsRegion = null, string ifMatch = null, string contentType = "application/octet-stream");
+
+ ///
+ ///
+ ///
+ ///
+ /// Resumable upload for signed URLs.
+ ///
+ /// Thrown when fails to make API call
+ /// Id of signed resource
+ /// Byte range of a segment being uploaded
+ /// Unique identifier of a session of a file being uploaded
+ ///
+ /// The suggested default filename when downloading this object to a file after it has been uploaded. (optional)
+ /// The region where the bucket resides Acceptable values: `US`, `EMEA` Default is `US` (optional, default to US)
+ /// Task of ObjectDetails
+ System.Threading.Tasks.Task*ObjectDetails*/dynamic> UploadSignedResourcesChunkAsync (string id, string contentRange, string sessionId, System.IO.Stream body, string contentDisposition = null, string xAdsRegion = null, string contentType = "application/octet-stream");
+
+ ///
+ ///
+ ///
+ ///
+ /// Resumable upload for signed URLs.
+ ///
+ /// Thrown when fails to make API call
+ /// Id of signed resource
+ /// Byte range of a segment being uploaded
+ /// Unique identifier of a session of a file being uploaded
+ ///
+ /// The suggested default filename when downloading this object to a file after it has been uploaded. (optional)
+ /// The region where the bucket resides Acceptable values: `US`, `EMEA` Default is `US` (optional, default to US)
+ /// Task of ApiResponse (ObjectDetails)
+ System.Threading.Tasks.Task> UploadSignedResourcesChunkAsyncWithHttpInfo (string id, string contentRange, string sessionId, System.IO.Stream body, string contentDisposition = null, string xAdsRegion = null, string contentType = "application/octet-stream");
+
+ /// summary>Returns a signed S3 URL.
+ /// Thrown when fails to make API call
+ /// {String} bucket key (will be URL-encoded automatically)
+ /// {String} object key (will be URL-encoded automatically)
+ /// {Object=} Optional parameters
+ /// {String=} If the value of this header matches the ETag of the object, an entity will not be returned from the server;
+ /// instead a 304 (not modified) response will be returned without any message-body.
+ /// {Date=} If the requested object has not been modified since the time specified in this field,
+ /// an entity will not be returned from the server; instead, a 304 (not modified) response will be returned without any message-body.
+ /// {String=} Value of the Content-Type header that the client expects to receive.
+ /// If this attribute is not provided, it defaults to the value corresponding to the object.
+ /// {String=} Value of the Content Disposition header the client expects to receive.
+ /// If this attribute is not provided, it defaults to the value corresponding to the object.
+ /// {String=} Value of the Cache-Control header that the client expects to receive.
+ /// If this attribute is not provided, it defaults to the value corresponding to the object.
+ /// {Boolean=} Allows fallback to OSS signed URLs in case of unmerged resumable uploads.
+ /// {Boolean=true} Will generate a CloudFront URL for the S3 object.
+ /// {Integer=2} The custom expiration time within the 1 to 60 minutes range, if not specified, default is 2 minutes.
+ /// https://forge.autodesk.com/en/docs/data/v2/reference/http/buckets-:bucketKey-objects-:objectKey-signeds3download-GET/
+ /// Task of ApiResponse (ObjectS3Download)
+ System.Threading.Tasks.Task getS3DownloadURLAsync (string bucketKey, string objectKey, Dictionary opts = null);
+
+ /// summary>Returns a signed S3 URL.
+ /// Thrown when fails to make API call
+ /// {String} bucket key (will be URL-encoded automatically)
+ /// {String} object key (will be URL-encoded automatically)
+ /// {Object=} Optional parameters
+ /// {String=} If the value of this header matches the ETag of the object, an entity will not be returned from the server;
+ /// instead a 304 (not modified) response will be returned without any message-body.
+ /// {Date=} If the requested object has not been modified since the time specified in this field,
+ /// an entity will not be returned from the server; instead, a 304 (not modified) response will be returned without any message-body.
+ /// {String=} Value of the Content-Type header that the client expects to receive.
+ /// If this attribute is not provided, it defaults to the value corresponding to the object.
+ /// {String=} Value of the Content Disposition header the client expects to receive.
+ /// If this attribute is not provided, it defaults to the value corresponding to the object.
+ /// {String=} Value of the Cache-Control header that the client expects to receive.
+ /// If this attribute is not provided, it defaults to the value corresponding to the object.
+ /// {Boolean=} Allows fallback to OSS signed URLs in case of unmerged resumable uploads.
+ /// {Boolean=true} Will generate a CloudFront URL for the S3 object.
+ /// {Integer=2} The custom expiration time within the 1 to 60 minutes range, if not specified, default is 2 minutes.
+ /// https://forge.autodesk.com/en/docs/data/v2/reference/http/buckets-:bucketKey-objects-:objectKey-signeds3download-GET/
+ /// Task of ApiResponse (ObjectS3Download)
+ System.Threading.Tasks.Task> getS3DownloadURLAsyncWithHttpInfo (string bucketKey, string objectKey, Dictionary opts = null);
+
+ ///
+ /// Gets one or more signed URLs to objects. The signed URLs can be used to download the objects directly from S3, skipping OSS servers.
+ /// Be aware that expiration time for the signed URL(s) is just 60 seconds. So, a request to the URL(s) must begin within 60 seconds; the transfer
+ /// of the data can exceed 60 seconds.
+ /// A successful call to this endpoint requires bucket owner access.
+ /// Note that resumable uploads store each chunk individually. After upload completes, an async process merges all the chunks and creates the
+ /// definitive OSS file. This async process can take time. If you request an S3 download URL before the async process completes, the response returns
+ /// a map of S3 URLs, one per chunk where the key is the corresponding range bytes. In case you don't want multiple URLs in the response, you can use
+ /// OSS signed URL functionality , with the public-resource-fallback query parameter set to true.
+ /// Note: While this endpoint does not support range headers, the returned URL(s) can be used for ranged downloads. This way, downloads can be
+ /// parallelized using multiple ranges for maximum speed.
+ ///
+ /// {String} bucket key (will be URL-encoded automatically)
+ /// {Object} body parameter
+ /// {Object[]} An array of objects representing each request to get an S3 URL to download from.
+ /// {String} Object name to create a download S3 signed URL for
+ /// {String=} Value of the Content-Type header that the client expects to receive.
+ /// If this attribute is not provided, it defaults to the value corresponding to the object.
+ /// {String=} Value of the Content Disposition header the client expects to receive.
+ /// If this attribute is not provided, it defaults to the value corresponding to the object.
+ /// {String=} Value of the Cache-Control header that the client expects to receive.
+ /// If this attribute is not provided, it defaults to the value corresponding to the object.
+ /// {String=} The value of this attribute is compared to the ETAG of the object.
+ /// If they match, the response body will show the status of this item as "skipped" with the reason as "Not modified".
+ /// {Date=} If the requested object has not been modified since the time specified in this attribute,
+ /// the response body will show the status of this item as "skipped" with the reason as "Not modified".
+ /// {Object=} Optional parameters
+ /// {Boolean=false } (public-resource-fallback) Allows fallback to OSS signed URLs in case of unmerged resumable uploads.
+ /// {Boolean=true} Will generate a CloudFront URL for the S3 object.
+ /// {Integer=2} The custom expiration time within the 1 to 60 minutes range, if not specified, default is 2 minutes.
+ /// https://forge.autodesk.com/en/docs/data/v2/reference/http/buckets-:bucketKey-objects-batchsigneds3download-POST/
+ /// Task of ApiResponse (dynamic)
+ System.Threading.Tasks.Task getS3DownloadURLsAsync (string bucketKey, PostBatchSignedS3DownloadPayload body, Dictionary opts = null);
+
+ ///
+ /// Gets one or more signed URLs to objects. The signed URLs can be used to download the objects directly from S3, skipping OSS servers.
+ /// Be aware that expiration time for the signed URL(s) is just 60 seconds. So, a request to the URL(s) must begin within 60 seconds; the transfer
+ /// of the data can exceed 60 seconds.
+ /// A successful call to this endpoint requires bucket owner access.
+ /// Note that resumable uploads store each chunk individually. After upload completes, an async process merges all the chunks and creates the
+ /// definitive OSS file. This async process can take time. If you request an S3 download URL before the async process completes, the response returns
+ /// a map of S3 URLs, one per chunk where the key is the corresponding range bytes. In case you don't want multiple URLs in the response, you can use
+ /// OSS signed URL functionality , with the public-resource-fallback query parameter set to true.
+ /// Note: While this endpoint does not support range headers, the returned URL(s) can be used for ranged downloads. This way, downloads can be
+ /// parallelized using multiple ranges for maximum speed.
+ ///
+ /// {String} bucket key (will be URL-encoded automatically)
+ /// {Object} body parameter
+ /// {Object[]} An array of objects representing each request to get an S3 URL to download from.
+ /// {String} Object name to create a download S3 signed URL for
+ /// {String=} Value of the Content-Type header that the client expects to receive.
+ /// If this attribute is not provided, it defaults to the value corresponding to the object.
+ /// {String=} Value of the Content Disposition header the client expects to receive.
+ /// If this attribute is not provided, it defaults to the value corresponding to the object.
+ /// {String=} Value of the Cache-Control header that the client expects to receive.
+ /// If this attribute is not provided, it defaults to the value corresponding to the object.
+ /// {String=} The value of this attribute is compared to the ETAG of the object.
+ /// If they match, the response body will show the status of this item as "skipped" with the reason as "Not modified".
+ /// {Date=} If the requested object has not been modified since the time specified in this attribute,
+ /// the response body will show the status of this item as "skipped" with the reason as "Not modified".
+ /// {Object=} Optional parameters
+ /// {Boolean=false } (public-resource-fallback) Allows fallback to OSS signed URLs in case of unmerged resumable uploads.
+ /// {Boolean=true} Will generate a CloudFront URL for the S3 object.
+ /// {Integer=2} The custom expiration time within the 1 to 60 minutes range, if not specified, default is 2 minutes.
+ /// https://forge.autodesk.com/en/docs/data/v2/reference/http/buckets-:bucketKey-objects-batchsigneds3download-POST/
+ /// Task of ApiResponse (dynamic)
+ System.Threading.Tasks.Task> getS3DownloadURLsAsyncWithHttpInfo (string bucketKey, PostBatchSignedS3DownloadPayload body, Dictionary opts = null);
+
+ /// Requests an S3 signed URL with which to upload an object, or an array of signed URLs with which to upload an object in multiple parts.
+ /// {String} bucket key (will be URL-encoded automatically)
+ /// {String} object key (will be URL-encoded automatically)
+ /// {Object=} Optional parameters
+ /// {String=} Get a new set of signed urls if the ones that were generated before have already expired and the user
+ /// still needs to upload some of them.
+ /// {Integer=} For a multipart upload, is the starting index when getting upload part URL.
+ /// If this parameter is not specified the default value is firstPart = 1.
+ /// Example: To retrieve the parts from 10 to 15 you should pass firstPart = 10 and parts = 6, this will retrieve the parts 10, 11, 12, 13, 14 and 15.
+ /// {Integer=} For a multipart upload, is the starting index when getting upload part URL.
+ /// If this parameter is not specified the default value is firstPart = 1.
+ /// Example: To retrieve the parts from 10 to 15 you should pass firstPart = 10 and parts = 6, this will retrieve the parts 10, 11, 12, 13, 14 and 15.
+ ///
+ /// {Boolean=true} Whether or not to generate an accelerated signed URL (ie: URLs of
+ /// the form …s3-accelerate.amazonaws.com… vs …s3.amazonaws.com…).
+ /// When not specified, defaults to true. Providing non-boolean values will result in a 400 error.
+ /// {Integer=2} The custom expiration time within the 1 to 60 minutes range, if not specified, default is 2 minutes.
+ /// https://forge.autodesk.com/en/docs/data/v2/reference/http/buckets-:bucketKey-objects-:objectKey-signeds3upload-GET/
+ /// Task of ApiResponse (dynamic)
+ System.Threading.Tasks.Task getS3UploadURLAsync (string bucketKey, string objectKey, Dictionary opts = null);
+
+ /// Requests an S3 signed URL with which to upload an object, or an array of signed URLs with which to upload an object in multiple parts.
+ /// {String} bucket key (will be URL-encoded automatically)
+ /// {String} object key (will be URL-encoded automatically)
+ /// {Object=} Optional parameters
+ /// {String=} Get a new set of signed urls if the ones that were generated before have already expired and the user
+ /// still needs to upload some of them.
+ /// {Integer=} For a multipart upload, is the starting index when getting upload part URL.
+ /// If this parameter is not specified the default value is firstPart = 1.
+ /// Example: To retrieve the parts from 10 to 15 you should pass firstPart = 10 and parts = 6, this will retrieve the parts 10, 11, 12, 13, 14 and 15.
+ /// {Integer=} For a multipart upload, is the starting index when getting upload part URL.
+ /// If this parameter is not specified the default value is firstPart = 1.
+ /// Example: To retrieve the parts from 10 to 15 you should pass firstPart = 10 and parts = 6, this will retrieve the parts 10, 11, 12, 13, 14 and 15.
+ ///
+ /// {Boolean=true} Whether or not to generate an accelerated signed URL (ie: URLs of
+ /// the form …s3-accelerate.amazonaws.com… vs …s3.amazonaws.com…).
+ /// When not specified, defaults to true. Providing non-boolean values will result in a 400 error.
+ /// {Integer=2} The custom expiration time within the 1 to 60 minutes range, if not specified, default is 2 minutes.
+ /// https://forge.autodesk.com/en/docs/data/v2/reference/http/buckets-:bucketKey-objects-:objectKey-signeds3upload-GET/
+ /// Task of ApiResponse (dynamic)
+ System.Threading.Tasks.Task> getS3UploadURLAsyncWithHttpInfo (string bucketKey, string objectKey, Dictionary opts = null);
+
+ /// Instructs OSS to complete the object creation process after the bytes have been uploaded directly to S3.
+ /// {String} bucket key (will be URL-encoded automatically)
+ /// {String} object key (will be URL-encoded automatically)
+ /// {Object}
+ /// {String} The identifier of the upload session, which was provided by OSS in the response to the Get Upload URL/s request.
+ /// {Integer=} The expected size of the uploaded object. If provided, OSS will check this against the blob in S3 and return
+ /// an error if the size does not match.
+ /// {List=} An array of eTags. S3 returns an eTag to each upload request, be it for a chunk or an entire file.
+ /// For a single-part upload, this array contains the expected eTag of the entire object. For a multipart upload, this array contains the expected
+ /// eTag of each part of the upload; the index of an eTag in the array corresponds to its part number in the upload. If provided, OSS will validate
+ /// these eTags against the content in S3, and return an error if the eTags do not match (indicating some form of data corruption).
+ /// {Object=} Optional parameters
+ /// {String=} (x-ads-meta-Content-Type) The Content-Type value that OSS will store in the record for the uploaded object.
+ /// {String=} (x-ads-meta-Content-Disposition) The Content-Disposition value that OSS will store in the record for the uploaded object.
+ /// {String=} (x-ads-meta-Content-Encoding) The Content-Encoding value that OSS will store in the record for the uploaded object.
+ /// {String=} (x-ads-meta-Cache-Control) The Cache-Control value that OSS will store in the record for the uploaded object.
+ /// https://forge.autodesk.com/en/docs/data/v2/reference/http/buckets-:bucketKey-objects-:objectKey-signeds3upload-POST/
+ /// Task of ApiResponse (dynamic)
+ System.Threading.Tasks.Task completeS3UploadAsync (string bucketKey, string objectKey, PostCompleteS3UploadPayload body, Dictionary opts = null);
+
+ /// Instructs OSS to complete the object creation process after the bytes have been uploaded directly to S3.
+ /// {String} bucket key (will be URL-encoded automatically)
+ /// {String} object key (will be URL-encoded automatically)
+ /// {Object}
+ /// {String} The identifier of the upload session, which was provided by OSS in the response to the Get Upload URL/s request.
+ /// {Integer=} The expected size of the uploaded object. If provided, OSS will check this against the blob in S3 and return
+ /// an error if the size does not match.
+ /// {List=} An array of eTags. S3 returns an eTag to each upload request, be it for a chunk or an entire file.
+ /// For a single-part upload, this array contains the expected eTag of the entire object. For a multipart upload, this array contains the expected
+ /// eTag of each part of the upload; the index of an eTag in the array corresponds to its part number in the upload. If provided, OSS will validate
+ /// these eTags against the content in S3, and return an error if the eTags do not match (indicating some form of data corruption).
+ /// {Object=} Optional parameters
+ /// {String=} (x-ads-meta-Content-Type) The Content-Type value that OSS will store in the record for the uploaded obcreateject.
+ /// {String=} (x-ads-meta-Content-Disposition) The Content-Disposition value that OSS will store in the record for the uploaded object.
+ /// {String=} (x-ads-meta-Content-Encoding) The Content-Encoding value that OSS will store in the record for the uploaded object.
+ /// {String=} (x-ads-meta-Cache-Control) The Cache-Control value that OSS will store in the record for the uploaded object.
+ /// https://forge.autodesk.com/en/docs/data/v2/reference/http/buckets-:bucketKey-objects-:objectKey-signeds3upload-POST/
+ /// Task of ApiResponse (dynamic)
+ System.Threading.Tasks.Task> completeS3UploadAsyncWithHttpInfo (string bucketKey, string objectKey, PostCompleteS3UploadPayload body, Dictionary opts = null);
+
+ /// Instructs OSS to complete the object creation process for numerous objects after their bytes have been uploaded directly to S3.
+ /// {String} bucket key (will be URL-encoded automatically)
+ /// {Object} body parameter
+ /// {Object[]} An array of objects representing each request to get an S3 URL to download from.
+ /// {String} The key/name of the object for which to complete an upload.
+ /// {String} The identifier of the upload session, which was provided by OSS in the response to the Get Upload URL/s request.
+ /// {Integer=} The expected size of the uploaded object. If provided, OSS will check this against the blob in S3 and return
+ /// an error if the size does not match.
+ /// {String[]=} An array of eTags. S3 returns an eTag to each upload request, be it for a chunk or an entire file.
+ /// For a single-part upload, this array contains the expected eTag of the entire object. For a multipart upload, this array contains the expected
+ /// eTag of each part of the upload; the index of an eTag in the array corresponds to its part number in the upload. If provided, OSS will validate
+ /// these eTags against the content in S3, and return an error if the eTags do not match (indicating some form of data corruption).
+ /// {String=} (x-ads-meta-Content-Type) The Content-Type value that OSS will store in the record for the uploaded object.
+ /// {String=} (x-ads-meta-Content-Disposition) The Content-Disposition value that OSS will store in the record for the uploaded object.
+ /// {String=} (x-ads-meta-Content-Encoding) The Content-Encoding value that OSS will store in the record for the uploaded object.
+ /// {String=} (x-ads-meta-Cache-Control) The Cache-Control value that OSS will store in the record for the uploaded object.
+ /// {Object=} Optional parameters
+ /// https://forge.autodesk.com/en/docs/data/v2/reference/http/buckets-:bucketKey-objects-:objectKey-batchcompleteupload-POST/
+ /// Task of ApiResponse (dynamic)
+ System.Threading.Tasks.Task completeS3UploadsAsync (string bucketKey, PostBatchCompleteS3UploadPayload body, Dictionary opts = null);
+
+ /// Instructs OSS to complete the object creation process for numerous objects after their bytes have been uploaded directly to S3.
+ /// {String} bucket key (will be URL-encoded automatically)
+ /// {Object} body parameter
+ /// {Object[]} An array of objects representing each request to get an S3 URL to download from.
+ /// {String} The key/name of the object for which to complete an upload.
+ /// {String} The identifier of the upload session, which was provided by OSS in the response to the Get Upload URL/s request.
+ /// {Integer=} The expected size of the uploaded object. If provided, OSS will check this against the blob in S3 and return
+ /// an error if the size does not match.
+ /// {String[]=} An array of eTags. S3 returns an eTag to each upload request, be it for a chunk or an entire file.
+ /// For a single-part upload, this array contains the expected eTag of the entire object. For a multipart upload, this array contains the expected
+ /// eTag of each part of the upload; the index of an eTag in the array corresponds to its part number in the upload. If provided, OSS will validate
+ /// these eTags against the content in S3, and return an error if the eTags do not match (indicating some form of data corruption).
+ /// {String=} (x-ads-meta-Content-Type) The Content-Type value that OSS will store in the record for the uploaded object.
+ /// {String=} (x-ads-meta-Content-Disposition) The Content-Disposition value that OSS will store in the record for the uploaded object.
+ /// {String=} (x-ads-meta-Content-Encoding) The Content-Encoding value that OSS will store in the record for the uploaded object.
+ /// {String=} (x-ads-meta-Cache-Control) The Cache-Control value that OSS will store in the record for the uploaded object.
+ /// {Object=} Optional parameters
+ /// https://forge.autodesk.com/en/docs/data/v2/reference/http/buckets-:bucketKey-objects-:objectKey-batchcompleteupload-POST/
+ /// Task of ApiResponse (dynamic)
+ System.Threading.Tasks.Task> completeS3UploadsAsyncWithHttpInfo (string bucketKey, PostBatchCompleteS3UploadPayload body, Dictionary opts = null);
+
+ /// Requests a batch of S3 signed URL with which to upload multiple objects or chunks of multiple objects.
+ /// {String} bucket key (will be URL-encoded automatically)
+ /// {Object} body parameter
+ /// {Object[]} An array of objects representing each request to get an S3 URL to download from.
+ /// {String} The key/name of the object for which to create an S3 upload URL. If neither the "part" nor "parts"
+ /// attribute is provided, OSS will return a single upload URL with which to upload the entire object.
+ /// {String=} Get a new set of signed urls if the ones that were generated before have already expired and the user
+ /// still needs to upload some of them.
+ /// {Integer=} For a multipart upload, is the starting index when getting upload part URL.
+ /// If this parameter is not specified the default value is firstPart = 1.
+ /// Example: To retrieve the parts from 10 to 15 you should pass firstPart = 10 and parts = 6, this will retrieve the parts 10, 11, 12, 13, 14 and 15.
+ /// @param {Integer=} [body.requests[].parts=1] For a multipart upload, is the starting index when getting upload part URL.
+ /// If this parameter is not specified the default value is firstPart = 1.
+ /// Example: To retrieve the parts from 10 to 15 you should pass firstPart = 10 and parts = 6, this will retrieve the parts 10, 11, 12, 13, 14 and 15.
+ /// {Object=} Optional parameters
+ /// {Boolean=true} Whether or not to generate an accelerated signed URL (ie: URLs of
+ /// the form …s3-accelerate.amazonaws.com… vs …s3.amazonaws.com…).
+ /// When not specified, defaults to true. Providing non-boolean values will result in a 400 error.
+ /// {Integer=2} The custom expiration time within the 1 to 60 minutes range, if not specified, default is 2 minutes.
+ /// https://forge.autodesk.com/en/docs/data/v2/reference/http/buckets-:bucketKey-objects-:objectKey-batchsigneds3upload-POST/
+ /// Task of ApiResponse (dynamic)
+ System.Threading.Tasks.Task getS3UploadURLsAsync (string bucketKey, PostBatchSignedS3UploadPayload body, Dictionary opts = null);
+
+ /// Requests a batch of S3 signed URL with which to upload multiple objects or chunks of multiple objects.
+ /// {String} bucket key (will be URL-encoded automatically)
+ /// {Object} body parameter
+ /// {Object[]} An array of objects representing each request to get an S3 URL to download from.
+ /// {String} The key/name of the object for which to create an S3 upload URL. If neither the "part" nor "parts"
+ /// attribute is provided, OSS will return a single upload URL with which to upload the entire object.
+ /// {String=} Get a new set of signed urls if the ones that were generated before have already expired and the user
+ /// still needs to upload some of them.
+ /// {Integer=} For a multipart upload, is the starting index when getting upload part URL.
+ /// If this parameter is not specified the default value is firstPart = 1.
+ /// Example: To retrieve the parts from 10 to 15 you should pass firstPart = 10 and parts = 6, this will retrieve the parts 10, 11, 12, 13, 14 and 15.
+ /// @param {Integer=} [body.requests[].parts=1] For a multipart upload, is the starting index when getting upload part URL.
+ /// If this parameter is not specified the default value is firstPart = 1.
+ /// Example: To retrieve the parts from 10 to 15 you should pass firstPart = 10 and parts = 6, this will retrieve the parts 10, 11, 12, 13, 14 and 15.
+ /// {Object=} Optional parameters
+ /// {Boolean=true} Whether or not to generate an accelerated signed URL (ie: URLs of
+ /// the form …s3-accelerate.amazonaws.com… vs …s3.amazonaws.com…).
+ /// When not specified, defaults to true. Providing non-boolean values will result in a 400 error.
+ /// {Integer=2} The custom expiration time within the 1 to 60 minutes range, if not specified, default is 2 minutes.
+ /// https://forge.autodesk.com/en/docs/data/v2/reference/http/buckets-:bucketKey-objects-:objectKey-batchsigneds3upload-POST/
+ /// Task of ApiResponse (dynamic)
+ System.Threading.Tasks.Task> getS3UploadURLsAsyncWithHttpInfo (string bucketKey, PostBatchSignedS3UploadPayload body, Dictionary opts = null);
+
+ // Workflow implementations
+
+ /// Download a resource.
+ /// {String} bucket key (will be URL-encoded automatically)
+ /// {Object|Object[]} Object or Object array of resource to uplaod with their parameters
+ /// {String} object key
+ /// {String} Resource to upload
+ /// If String, it is the expected response type (defaults to json) ['arraybuffer', 'document', 'json', 'text', 'stream']
+ /// If you 'stream', you need to provide a writable stream ('data'), the method will pipe content into it.
+ /// {Object=} Optional parameters
+ /// {Boolean=false} Allows fallback to OSS signed URLs in case of unmerged resumable uploads.
+ /// {Boolean=true} Will generate a CloudFront URL for the S3 object.
+ /// {Integer=2} The custom expiration time within the 1 to 60 minutes range, if not specified, default is 2 minutes.
+ /// {Integer=0} Chunk size in Mb. Should not be below 5Mb. Default is 0, download file in one piece.
+ /// {DownloadItemsCallBack} (progressEvent) => {}
+ /// {RefreshTokenCallBack} () => {}
+ /// Task of ApiResponse (dynamic[])
+ System.Threading.Tasks.Task> downloadResources (string bucketKey, List objects, Dictionary opts = null, DownloadItemsCallBack onDownloadProgress = null, RefreshTokenCallBack onRefreshToken = null);
+
+ /// Upload a resource. If the specified object name already exists in the bucket, the uploaded content will overwrite the existing content for the bucket name/object name combination.
+ /// {String} bucket key (will be URL-encoded automatically)
+ /// {Object|Object[]} Object or Object array of resource to upload with their parameters
+ /// {String} object key
+ /// {String|Buffer|Stream} Resource to upload (String| Buffer | Stream)
+ /// {String[]=} An array of eTags. S3 returns an eTag to each upload request, be it for a chunk or an entire file.
+ /// For a single-part upload, this array contains the expected eTag of the entire object. For a multipart upload, this array contains the expected
+ /// eTag of each part of the upload; the index of an eTag in the array corresponds to its part number in the upload. If provided, OSS will validate
+ /// these eTags against the content in S3, and return an error if the eTags do not match (indicating some form of data corruption).
+ /// {String=} (x-ads-meta-Content-Type) The Content-Type value that OSS will store in the record for the uploaded object.
+ /// {String=} (x-ads-meta-Content-Disposition) The Content-Disposition value that OSS will store in the record for the uploaded object.
+ /// {String=} (x-ads-meta-Content-Encoding) The Content-Encoding value that OSS will store in the record for the uploaded object.
+ /// {String=} (x-ads-meta-Cache-Control) The Cache-Control value that OSS will store in the record for the uploaded object.
+ /// {Object=} Optional parameters
+ /// {Integer=5} Chunk size in Mb. Should not be below 5Mb.
+ /// {Integer=25} Maximum batch to produces. Should not be above 25 or below 1.
+ /// {Boolean=true} Whether or not to generate an accelerated signed URL (ie: URLs of
+ /// the form …s3-accelerate.amazonaws.com… vs …s3.amazonaws.com…).
+ /// When not specified, defaults to true. Providing non-boolean values will result in a 400 error.
+ /// {Integer=2} The custom expiration time within the 1 to 60 minutes range, if not specified, default is 2 minutes.
+ /// {DownloadItemsCallBack} (progressEvent) => {}
+ /// {RefreshTokenCallBack} () => {}
+ /// Task of ApiResponse (dynamic[])
+ System.Threading.Tasks.Task> uploadResources (string bucketKey, List objects, Dictionary opts = null, UploadItemsCallBack onUploadProgress = null, RefreshTokenCallBack onRefreshToken = null);
+
+ // Workflow implementations
+
+ #endregion Asynchronous Operations
+
+ }
+
+ ///
+ /// Represents a collection of functions to interact with the API endpoints
+ ///
+ public partial class ObjectsApi : IObjectsApi {
+
+ private Autodesk.Forge.Client.ExceptionFactory _exceptionFactory = (name, response) => null;
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ public ObjectsApi (String basePath) {
+ this.Configuration = new Configuration (new ApiClient (basePath));
+
+ ExceptionFactory = Autodesk.Forge.Client.Configuration.DefaultExceptionFactory;
+
+ // ensure API client has configuration ready
+ if ( Configuration.ApiClient.Configuration == null ) {
+ this.Configuration.ApiClient.Configuration = this.Configuration;
+ }
+ }
+
+ ///
+ /// Initializes a new instance of the class
+ /// using Configuration object
+ ///
+ /// An instance of Configuration
+ ///
+ public ObjectsApi (Configuration configuration = null) {
+ if ( configuration == null ) // use the default one in Configuration
+ this.Configuration = Configuration.Default;
+ else
+ this.Configuration = configuration;
+
+ ExceptionFactory = Autodesk.Forge.Client.Configuration.DefaultExceptionFactory;
+
+ // ensure API client has configuration ready
+ if ( Configuration.ApiClient.Configuration == null ) {
+ this.Configuration.ApiClient.Configuration = this.Configuration;
+ }
+ }
+
+ ///
+ /// Gets the base path of the API client.
+ ///
+ /// The base path
+ public String GetBasePath () {
+ return this.Configuration.ApiClient.RestClient.Options.BaseUrl.ToString ();
+ }
+
+ ///
+ /// Sets the base path of the API client.
+ ///
+ /// The base path
+ [Obsolete ("SetBasePath is deprecated, please do 'Configuration.ApiClient = new ApiClient(\"http://new-path\")' instead.")]
+ public void SetBasePath (String basePath) {
+ // do nothing
+ }
+
+ ///
+ /// Gets or sets the configuration object
+ ///
+ /// An instance of the Configuration
+ public Configuration Configuration { get; set; }
+
+ ///
+ /// Provides a factory method hook for the creation of exceptions.
+ ///
+ public Autodesk.Forge.Client.ExceptionFactory ExceptionFactory {
+ get {
+ if ( _exceptionFactory != null && _exceptionFactory.GetInvocationList ().Length > 1 ) {
+ throw new InvalidOperationException ("Multicast delegate for ExceptionFactory is unsupported.");
+ }
+ return _exceptionFactory;
+ }
+ set { _exceptionFactory = value; }
+ }
+
+ ///
+ /// Gets the default header.
+ ///
+ /// Dictionary of HTTP header
+ [Obsolete ("DefaultHeader is deprecated, please use Configuration.DefaultHeader instead.")]
+ public Dictionary DefaultHeader () {
+ return this.Configuration.DefaultHeader;
+ }
+
+ ///
+ /// Add default header.
+ ///
+ /// Header field name.
+ /// Header field value.
+ ///
+ [Obsolete ("AddDefaultHeader is deprecated, please use Configuration.AddDefaultHeader instead.")]
+ public void AddDefaultHeader (string key, string value) {
+ this.Configuration.AddDefaultHeader (key, value);
+ }
+
+ ///
+ /// Copies an object to another object name in the same bucket.
+ ///
+ /// Thrown when fails to make API call
+ /// URL-encoded bucket key
+ /// URL-encoded object name
+ /// URL-encoded Object key to use as the destination
+ /// ObjectDetails
+ public /*ObjectDetails*/dynamic CopyTo (string bucketKey, string objectName, string newObjName) {
+ ApiResponse*ObjectDetails*/dynamic> localVarResponse = CopyToWithHttpInfo (bucketKey, objectName, newObjName);
+ return localVarResponse.Data;
+ }
+
+ ///
+ /// Copies an object to another object name in the same bucket.
+ ///
+ /// Thrown when fails to make API call
+ /// URL-encoded bucket key
+ /// URL-encoded object name
+ /// URL-encoded Object key to use as the destination
+ /// ApiResponse of ObjectDetails
+ public ApiResponse< /*ObjectDetails*/dynamic> CopyToWithHttpInfo (string bucketKey, string objectName, string newObjName) {
+ // verify the required parameter 'bucketKey' is set
+ if ( bucketKey == null )
+ throw new ApiException (400, "Missing required parameter 'bucketKey' when calling ObjectsApi->CopyTo");
+ // verify the required parameter 'objectName' is set
+ if ( objectName == null )
+ throw new ApiException (400, "Missing required parameter 'objectName' when calling ObjectsApi->CopyTo");
+ // verify the required parameter 'newObjName' is set
+ if ( newObjName == null )
+ throw new ApiException (400, "Missing required parameter 'newObjName' when calling ObjectsApi->CopyTo");
+
+ var localVarPath = "/oss/v2/buckets/{bucketKey}/objects/{objectName}/copyto/{newObjName}";
+ var localVarPathParams = new Dictionary ();
+ var localVarQueryParams = new Dictionary ();
+ var localVarHeaderParams = new Dictionary (Configuration.DefaultHeader);
+ var localVarFormParams = new Dictionary ();
+ var localVarFileParams = new Dictionary ();
+ Object localVarPostBody = null;
+
+ // to determine the Content-Type header
+ String [] localVarHttpContentTypes = new String [] {
+ "application/json"
+ };
+ String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType (localVarHttpContentTypes);
+
+ // to determine the Accept header
+ String [] localVarHttpHeaderAccepts = new String [] {
+ "application/vnd.api+json",
+ "application/json"
+ };
+ String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept (localVarHttpHeaderAccepts);
+ if ( localVarHttpHeaderAccept != null )
+ localVarHeaderParams.Add ("Accept", localVarHttpHeaderAccept);
+
+ // set "format" to json by default
+ // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
+ localVarPathParams.Add ("format", "json");
+ if ( bucketKey != null )
+ localVarPathParams.Add ("bucketKey", Configuration.ApiClient.ParameterToString (bucketKey)); // path parameter
+ if ( objectName != null )
+ localVarPathParams.Add ("objectName", Configuration.ApiClient.ParameterToString (objectName)); // path parameter
+ if ( newObjName != null )
+ localVarPathParams.Add ("newObjName", Configuration.ApiClient.ParameterToString (newObjName)); // path parameter
+
+ // authentication (oauth2_application) required
+ // oauth required
+ if ( !String.IsNullOrEmpty (Configuration.AccessToken) ) {
+ localVarHeaderParams ["Authorization"] = "Bearer " + Configuration.AccessToken;
+ }
+
+ // make the HTTP request
+ RestResponse localVarResponse = (RestResponse)Configuration.ApiClient.CallApi (localVarPath,
+ Method.Put, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
+ localVarPathParams, localVarHttpContentType);
+
+ int localVarStatusCode = (int)localVarResponse.StatusCode;
+
+ if ( ExceptionFactory != null ) {
+ Exception exception = ExceptionFactory ("CopyTo", localVarResponse);
+ if ( exception != null )
+ throw exception;
+ }
+
+ return new ApiResponse*ObjectDetails*/dynamic> (localVarStatusCode,
+ localVarResponse.Headers.ToDictionary (x => x.Name, x => x.Value.ToString ()),
+ /*(ObjectDetails)*/ Configuration.ApiClient.Deserialize (localVarResponse, typeof (ObjectDetails)));
+
+ }
+
+ ///
+ /// Copies an object to another object name in the same bucket.
+ ///
+ /// Thrown when fails to make API call
+ /// URL-encoded bucket key
+ /// URL-encoded object name
+ /// URL-encoded Object key to use as the destination
+ /// Task of ObjectDetails
+ public async System.Threading.Tasks.Task*ObjectDetails*/dynamic> CopyToAsync (string bucketKey, string objectName, string newObjName) {
+ ApiResponse*ObjectDetails*/dynamic> localVarResponse = await CopyToAsyncWithHttpInfo (bucketKey, objectName, newObjName);
+ return localVarResponse.Data;
+
+ }
+
+ ///
+ /// Copies an object to another object name in the same bucket.
+ ///
+ /// Thrown when fails to make API call
+ /// URL-encoded bucket key
+ /// URL-encoded object name
+ /// URL-encoded Object key to use as the destination
+ /// Task of ApiResponse (ObjectDetails)
+ public async System.Threading.Tasks.Task> CopyToAsyncWithHttpInfo (string bucketKey, string objectName, string newObjName) {
+ // verify the required parameter 'bucketKey' is set
+ if ( bucketKey == null )
+ throw new ApiException (400, "Missing required parameter 'bucketKey' when calling ObjectsApi->CopyTo");
+ // verify the required parameter 'objectName' is set
+ if ( objectName == null )
+ throw new ApiException (400, "Missing required parameter 'objectName' when calling ObjectsApi->CopyTo");
+ // verify the required parameter 'newObjName' is set
+ if ( newObjName == null )
+ throw new ApiException (400, "Missing required parameter 'newObjName' when calling ObjectsApi->CopyTo");
+
+ var localVarPath = "/oss/v2/buckets/{bucketKey}/objects/{objectName}/copyto/{newObjName}";
+ var localVarPathParams = new Dictionary ();
+ var localVarQueryParams = new Dictionary ();
+ var localVarHeaderParams = new Dictionary (Configuration.DefaultHeader);
+ var localVarFormParams = new Dictionary ();
+ var localVarFileParams = new Dictionary ();
+ Object localVarPostBody = null;
+
+ // to determine the Content-Type header
+ String [] localVarHttpContentTypes = new String [] {
+ "application/json"
+ };
+ String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType (localVarHttpContentTypes);
+
+ // to determine the Accept header
+ String [] localVarHttpHeaderAccepts = new String [] {
+ "application/vnd.api+json",
+ "application/json"
+ };
+ String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept (localVarHttpHeaderAccepts);
+ if ( localVarHttpHeaderAccept != null )
+ localVarHeaderParams.Add ("Accept", localVarHttpHeaderAccept);
+
+ // set "format" to json by default
+ // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
+ localVarPathParams.Add ("format", "json");
+ if ( bucketKey != null )
+ localVarPathParams.Add ("bucketKey", Configuration.ApiClient.ParameterToString (bucketKey)); // path parameter
+ if ( objectName != null )
+ localVarPathParams.Add ("objectName", Configuration.ApiClient.ParameterToString (objectName)); // path parameter
+ if ( newObjName != null )
+ localVarPathParams.Add ("newObjName", Configuration.ApiClient.ParameterToString (newObjName)); // path parameter
+
+ // authentication (oauth2_application) required
+ // oauth required
+ if ( !String.IsNullOrEmpty (Configuration.AccessToken) ) {
+ localVarHeaderParams ["Authorization"] = "Bearer " + Configuration.AccessToken;
+ }
+
+ // make the HTTP request
+ RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync (localVarPath,
+ Method.Put, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
+ localVarPathParams, localVarHttpContentType);
+
+ int localVarStatusCode = (int)localVarResponse.StatusCode;
+
+ if ( ExceptionFactory != null ) {
+ Exception exception = ExceptionFactory ("CopyTo", localVarResponse);
+ if ( exception != null )
+ throw exception;
+ }
+
+ return new ApiResponse*ObjectDetails*/dynamic> (localVarStatusCode,
+ localVarResponse.Headers.ToDictionary (x => x.Name, x => x.Value.ToString ()),
+ /*(ObjectDetails)*/ Configuration.ApiClient.Deserialize (localVarResponse, typeof (ObjectDetails)));
+
+ }
+
+ ///
+ /// This endpoint creates a signed URL that can be used to download an object within the specified expiration time. Be aware that if the object the signed URL points to is deleted or expires before the signed URL expires, then the signed URL will no longer be valid. A successful call to this endpoint requires bucket owner access.
+ ///
+ /// Thrown when fails to make API call
+ /// URL-encoded bucket key
+ /// URL-encoded object name
+ /// Body Structure
+ /// Access for signed resource Acceptable values: `read`, `write`, `readwrite`. Default value: `read` (optional, default to read)
+ /// If true, this will generate a CloudFront URL for the S3 object
+ /// PostObjectSigned
+ public /*PostObjectSigned*/dynamic CreateSignedResource (string bucketKey, string objectName, PostBucketsSigned postBucketsSigned, string access = null, bool useCdn = true) {
+ ApiResponse*PostObjectSigned*/dynamic> localVarResponse = CreateSignedResourceWithHttpInfo (bucketKey, objectName, postBucketsSigned, access, useCdn);
+ return (localVarResponse.Data);
+ }
+
+ ///
+ /// This endpoint creates a signed URL that can be used to download an object within the specified expiration time. Be aware that if the object the signed URL points to is deleted or expires before the signed URL expires, then the signed URL will no longer be valid. A successful call to this endpoint requires bucket owner access.
+ ///
+ /// Thrown when fails to make API call
+ /// URL-encoded bucket key
+ /// URL-encoded object name
+ /// Body Structure
+ /// Access for signed resource Acceptable values: `read`, `write`, `readwrite`. Default value: `read` (optional, default to read)
+ /// If true, this will generate a CloudFront URL for the S3 object
+ /// ApiResponse of PostObjectSigned
+ public ApiResponse< /*PostObjectSigned*/dynamic> CreateSignedResourceWithHttpInfo (string bucketKey, string objectName, PostBucketsSigned postBucketsSigned, string access = null, bool useCdn = true) {
+ // verify the required parameter 'bucketKey' is set
+ if ( bucketKey == null )
+ throw new ApiException (400, "Missing required parameter 'bucketKey' when calling ObjectsApi->CreateSignedResource");
+ // verify the required parameter 'objectName' is set
+ if ( objectName == null )
+ throw new ApiException (400, "Missing required parameter 'objectName' when calling ObjectsApi->CreateSignedResource");
+ // verify the required parameter 'postBucketsSigned' is set
+ if ( postBucketsSigned == null )
+ throw new ApiException (400, "Missing required parameter 'postBucketsSigned' when calling ObjectsApi->CreateSignedResource");
+
+ var localVarPath = "/oss/v2/buckets/{bucketKey}/objects/{objectName}/signed";
+ var localVarPathParams = new Dictionary ();
+ var localVarQueryParams = new Dictionary ();
+ var localVarHeaderParams = new Dictionary (Configuration.DefaultHeader);
+ var localVarFormParams = new Dictionary ();
+ var localVarFileParams = new Dictionary ();
+ Object localVarPostBody = null;
+
+ // to determine the Content-Type header
+ String [] localVarHttpContentTypes = new String [] {
+ "application/json"
+ };
+ String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType (localVarHttpContentTypes);
+
+ // to determine the Accept header
+ String [] localVarHttpHeaderAccepts = new String [] {
+ "application/vnd.api+json",
+ "application/json"
+ };
+ String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept (localVarHttpHeaderAccepts);
+ if ( localVarHttpHeaderAccept != null )
+ localVarHeaderParams.Add ("Accept", localVarHttpHeaderAccept);
+
+ // set "format" to json by default
+ // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
+ localVarPathParams.Add ("format", "json");
+ if ( bucketKey != null )
+ localVarPathParams.Add ("bucketKey", Configuration.ApiClient.ParameterToString (bucketKey)); // path parameter
+ if ( objectName != null )
+ localVarPathParams.Add ("objectName", Configuration.ApiClient.ParameterToString (objectName)); // path parameter
+ if ( access != null )
+ localVarQueryParams.Add ("access", Configuration.ApiClient.ParameterToString (access)); // query parameter
+ localVarQueryParams.Add ("useCdn", Configuration.ApiClient.ParameterToString (useCdn));
+ if ( postBucketsSigned != null && postBucketsSigned.GetType () == typeof (byte []) ) // http body (model) parameter
+ {
+ localVarPostBody = postBucketsSigned; // byte array
+ } else if ( postBucketsSigned != null
+ && (postBucketsSigned.GetType () == typeof (System.IO.FileStream)
+ || postBucketsSigned.GetType () == typeof (System.IO.BinaryReader)
+ || postBucketsSigned.GetType () == typeof (System.IO.BufferedStream)
+ || postBucketsSigned.GetType () == typeof (System.IO.MemoryStream)
+ || postBucketsSigned.GetType () == typeof (System.IO.StreamReader)
+ )
+ ) {
+ localVarPostBody = Configuration.ApiClient.toByteArray (postBucketsSigned); // byte array
+ } else if ( postBucketsSigned != null ) {
+ localVarPostBody = Configuration.ApiClient.Serialize (postBucketsSigned);
+ }
+
+ // authentication (oauth2_application) required
+ // oauth required
+ if ( !String.IsNullOrEmpty (Configuration.AccessToken) ) {
+ localVarHeaderParams ["Authorization"] = "Bearer " + Configuration.AccessToken;
+ }
+
+ // make the HTTP request
+ RestResponse localVarResponse = (RestResponse)Configuration.ApiClient.CallApi (localVarPath,
+ Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
+ localVarPathParams, localVarHttpContentType);
+
+ int localVarStatusCode = (int)localVarResponse.StatusCode;
+
+ if ( ExceptionFactory != null ) {
+ Exception exception = ExceptionFactory ("CreateSignedResource", localVarResponse);
+ if ( exception != null )
+ throw exception;
+ }
+
+ return new ApiResponse*PostObjectSigned*/dynamic> (localVarStatusCode,
+ localVarResponse.Headers.ToDictionary (x => x.Name, x => x.Value.ToString ()),
+ /*(PostObjectSigned)*/ Configuration.ApiClient.Deserialize (localVarResponse, typeof (PostObjectSigned)));
+
+ }
+
+ ///
+ /// This endpoint creates a signed URL that can be used to download an object within the specified expiration time. Be aware that if the object the signed URL points to is deleted or expires before the signed URL expires, then the signed URL will no longer be valid. A successful call to this endpoint requires bucket owner access.
+ ///
+ /// Thrown when fails to make API call
+ /// URL-encoded bucket key
+ /// URL-encoded object name
+ /// Body Structure
+ /// Access for signed resource Acceptable values: `read`, `write`, `readwrite`. Default value: `read` (optional, default to read)
+ /// If true, this will generate a CloudFront URL for the S3 object
+ /// Task of PostObjectSigned
+ public async System.Threading.Tasks.Task*PostObjectSigned*/dynamic> CreateSignedResourceAsync (string bucketKey, string objectName, PostBucketsSigned postBucketsSigned, string access = null, bool useCdn = true) {
+ ApiResponse*PostObjectSigned*/dynamic> localVarResponse = await CreateSignedResourceAsyncWithHttpInfo (bucketKey, objectName, postBucketsSigned, access, useCdn);
+ return (localVarResponse.Data);
+ }
+
+ ///
+ /// This endpoint creates a signed URL that can be used to download an object within the specified expiration time. Be aware that if the object the signed URL points to is deleted or expires before the signed URL expires, then the signed URL will no longer be valid. A successful call to this endpoint requires bucket owner access.
+ ///
+ /// Thrown when fails to make API call
+ /// URL-encoded bucket key
+ /// URL-encoded object name
+ /// Body Structure
+ /// Access for signed resource Acceptable values: `read`, `write`, `readwrite`. Default value: `read` (optional, default to read)
+ /// If true, this will generate a CloudFront URL for the S3 object
+ /// Task of ApiResponse (PostObjectSigned)
+ public async System.Threading.Tasks.Task> CreateSignedResourceAsyncWithHttpInfo (string bucketKey, string objectName, PostBucketsSigned postBucketsSigned, string access = null, bool useCdn = true) {
+ // verify the required parameter 'bucketKey' is set
+ if ( bucketKey == null )
+ throw new ApiException (400, "Missing required parameter 'bucketKey' when calling ObjectsApi->CreateSignedResource");
+ // verify the required parameter 'objectName' is set
+ if ( objectName == null )
+ throw new ApiException (400, "Missing required parameter 'objectName' when calling ObjectsApi->CreateSignedResource");
+ // verify the required parameter 'postBucketsSigned' is set
+ if ( postBucketsSigned == null )
+ throw new ApiException (400, "Missing required parameter 'postBucketsSigned' when calling ObjectsApi->CreateSignedResource");
+
+ var localVarPath = "/oss/v2/buckets/{bucketKey}/objects/{objectName}/signed";
+ var localVarPathParams = new Dictionary ();
+ var localVarQueryParams = new Dictionary ();
+ var localVarHeaderParams = new Dictionary (Configuration.DefaultHeader);
+ var localVarFormParams = new Dictionary ();
+ var localVarFileParams = new Dictionary ();
+ Object localVarPostBody = null;
+
+ // to determine the Content-Type header
+ String [] localVarHttpContentTypes = new String [] {
+ "application/json"
+ };
+ String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType (localVarHttpContentTypes);
+
+ // to determine the Accept header
+ String [] localVarHttpHeaderAccepts = new String [] {
+ "application/vnd.api+json",
+ "application/json"
+ };
+ String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept (localVarHttpHeaderAccepts);
+ if ( localVarHttpHeaderAccept != null )
+ localVarHeaderParams.Add ("Accept", localVarHttpHeaderAccept);
+
+ // set "format" to json by default
+ // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
+ localVarPathParams.Add ("format", "json");
+ if ( bucketKey != null )
+ localVarPathParams.Add ("bucketKey", Configuration.ApiClient.ParameterToString (bucketKey)); // path parameter
+ if ( objectName != null )
+ localVarPathParams.Add ("objectName", Configuration.ApiClient.ParameterToString (objectName)); // path parameter
+ if ( access != null )
+ localVarQueryParams.Add ("access", Configuration.ApiClient.ParameterToString (access)); // query parameter
+ localVarQueryParams.Add ("useCdn", Configuration.ApiClient.ParameterToString (useCdn));
+ if ( postBucketsSigned != null && postBucketsSigned.GetType () == typeof (byte []) ) // http body (model) parameter
+ {
+ localVarPostBody = postBucketsSigned; // byte array
+ } else if ( postBucketsSigned != null
+ && (postBucketsSigned.GetType () == typeof (System.IO.FileStream)
+ || postBucketsSigned.GetType () == typeof (System.IO.BinaryReader)
+ || postBucketsSigned.GetType () == typeof (System.IO.BufferedStream)
+ || postBucketsSigned.GetType () == typeof (System.IO.MemoryStream)
+ || postBucketsSigned.GetType () == typeof (System.IO.StreamReader)
+ )
+ ) {
+ localVarPostBody = Configuration.ApiClient.toByteArray (postBucketsSigned); // byte array
+ } else if ( postBucketsSigned != null ) {
+ localVarPostBody = Configuration.ApiClient.Serialize (postBucketsSigned);
+ }
+
+ // authentication (oauth2_application) required
+ // oauth required
+ if ( !String.IsNullOrEmpty (Configuration.AccessToken) ) {
+ localVarHeaderParams ["Authorization"] = "Bearer " + Configuration.AccessToken;
+ }
+
+ // make the HTTP request
+ RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync (localVarPath,
+ Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
+ localVarPathParams, localVarHttpContentType);
+
+ int localVarStatusCode = (int)localVarResponse.StatusCode;
+
+ if ( ExceptionFactory != null ) {
+ Exception exception = ExceptionFactory ("CreateSignedResource", localVarResponse);
+ if ( exception != null )
+ throw exception;
+ }
+
+ return new ApiResponse*PostObjectSigned*/dynamic> (localVarStatusCode,
+ localVarResponse.Headers.ToDictionary (x => x.Name, x => x.Value.ToString ()),
+ /*(PostObjectSigned)*/ Configuration.ApiClient.Deserialize (localVarResponse, typeof (PostObjectSigned)));
+
+ }
+
+ ///
+ /// Deletes an object from the bucket.
+ ///
+ /// Thrown when fails to make API call
+ /// URL-encoded bucket key
+ /// URL-encoded object name
+ ///
+ public void DeleteObject (string bucketKey, string objectName) {
+ DeleteObjectWithHttpInfo (bucketKey, objectName);
+ }
+
+ ///
+ /// Deletes an object from the bucket.
+ ///
+ /// Thrown when fails to make API call
+ /// URL-encoded bucket key
+ /// URL-encoded object name
+ /// ApiResponse of Object(void)
+ public ApiResponse DeleteObjectWithHttpInfo (string bucketKey, string objectName) {
+ // verify the required parameter 'bucketKey' is set
+ if ( bucketKey == null )
+ throw new ApiException (400, "Missing required parameter 'bucketKey' when calling ObjectsApi->DeleteObject");
+ // verify the required parameter 'objectName' is set
+ if ( objectName == null )
+ throw new ApiException (400, "Missing required parameter 'objectName' when calling ObjectsApi->DeleteObject");
+
+ var localVarPath = "/oss/v2/buckets/{bucketKey}/objects/{objectName}";
+ var localVarPathParams = new Dictionary ();
+ var localVarQueryParams = new Dictionary ();
+ var localVarHeaderParams = new Dictionary (Configuration.DefaultHeader);
+ var localVarFormParams = new Dictionary ();
+ var localVarFileParams = new Dictionary ();
+ Object localVarPostBody = null;
+
+ // to determine the Content-Type header
+ String [] localVarHttpContentTypes = new String [] {
+ "application/json"
+ };
+ String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType (localVarHttpContentTypes);
+
+ // to determine the Accept header
+ String [] localVarHttpHeaderAccepts = new String [] {
+ };
+ String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept (localVarHttpHeaderAccepts);
+ if ( localVarHttpHeaderAccept != null )
+ localVarHeaderParams.Add ("Accept", localVarHttpHeaderAccept);
+
+ // set "format" to json by default
+ // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
+ localVarPathParams.Add ("format", "json");
+ if ( bucketKey != null )
+ localVarPathParams.Add ("bucketKey", Configuration.ApiClient.ParameterToString (bucketKey)); // path parameter
+ if ( objectName != null )
+ localVarPathParams.Add ("objectName", Configuration.ApiClient.ParameterToString (objectName)); // path parameter
+
+ // authentication (oauth2_application) required
+ // oauth required
+ if ( !String.IsNullOrEmpty (Configuration.AccessToken) ) {
+ localVarHeaderParams ["Authorization"] = "Bearer " + Configuration.AccessToken;
+ }
+
+ // make the HTTP request
+ RestResponse localVarResponse = (RestResponse)Configuration.ApiClient.CallApi (localVarPath,
+ Method.Delete, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
+ localVarPathParams, localVarHttpContentType);
+
+ int localVarStatusCode = (int)localVarResponse.StatusCode;
+
+ if ( ExceptionFactory != null ) {
+ Exception exception = ExceptionFactory ("DeleteObject", localVarResponse);
+ if ( exception != null )
+ throw exception;
+ }
+
+
+ return new ApiResponse (localVarStatusCode,
+ localVarResponse.Headers.ToDictionary (x => x.Name, x => x.Value.ToString ()),
+ null);
+ }
+
+ ///
+ /// Deletes an object from the bucket.
+ ///
+ /// Thrown when fails to make API call
+ /// URL-encoded bucket key
+ /// URL-encoded object name
+ /// Task of void
+ public async System.Threading.Tasks.Task DeleteObjectAsync (string bucketKey, string objectName) {
+ await DeleteObjectAsyncWithHttpInfo (bucketKey, objectName);
+
+ }
+
+ ///
+ /// Deletes an object from the bucket.
+ ///
+ /// Thrown when fails to make API call
+ /// URL-encoded bucket key
+ /// URL-encoded object name
+ /// Task of ApiResponse
+ public async System.Threading.Tasks.Task> DeleteObjectAsyncWithHttpInfo (string bucketKey, string objectName) {
+ // verify the required parameter 'bucketKey' is set
+ if ( bucketKey == null )
+ throw new ApiException (400, "Missing required parameter 'bucketKey' when calling ObjectsApi->DeleteObject");
+ // verify the required parameter 'objectName' is set
+ if ( objectName == null )
+ throw new ApiException (400, "Missing required parameter 'objectName' when calling ObjectsApi->DeleteObject");
+
+ var localVarPath = "/oss/v2/buckets/{bucketKey}/objects/{objectName}";
+ var localVarPathParams = new Dictionary ();
+ var localVarQueryParams = new Dictionary ();
+ var localVarHeaderParams = new Dictionary (Configuration.DefaultHeader);
+ var localVarFormParams = new Dictionary ();
+ var localVarFileParams = new Dictionary ();
+ Object localVarPostBody = null;
+
+ // to determine the Content-Type header
+ String [] localVarHttpContentTypes = new String [] {
+ "application/json"
+ };
+ String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType (localVarHttpContentTypes);
+
+ // to determine the Accept header
+ String [] localVarHttpHeaderAccepts = new String [] {
+ };
+ String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept (localVarHttpHeaderAccepts);
+ if ( localVarHttpHeaderAccept != null )
+ localVarHeaderParams.Add ("Accept", localVarHttpHeaderAccept);
+
+ // set "format" to json by default
+ // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
+ localVarPathParams.Add ("format", "json");
+ if ( bucketKey != null )
+ localVarPathParams.Add ("bucketKey", Configuration.ApiClient.ParameterToString (bucketKey)); // path parameter
+ if ( objectName != null )
+ localVarPathParams.Add ("objectName", Configuration.ApiClient.ParameterToString (objectName)); // path parameter
+
+ // authentication (oauth2_application) required
+ // oauth required
+ if ( !String.IsNullOrEmpty (Configuration.AccessToken) ) {
+ localVarHeaderParams ["Authorization"] = "Bearer " + Configuration.AccessToken;
+ }
+
+ // make the HTTP request
+ RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync (localVarPath,
+ Method.Delete, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
+ localVarPathParams, localVarHttpContentType);
+
+ int localVarStatusCode = (int)localVarResponse.StatusCode;
+
+ if ( ExceptionFactory != null ) {
+ Exception exception = ExceptionFactory ("DeleteObject", localVarResponse);
+ if ( exception != null )
+ throw exception;
+ }
+
+
+ return new ApiResponse (localVarStatusCode,
+ localVarResponse.Headers.ToDictionary (x => x.Name, x => x.Value.ToString ()),
+ null);
+ }
+
+ ///
+ /// Delete a signed URL. A successful call to this endpoint requires bucket owner access.
+ ///
+ /// Thrown when fails to make API call
+ /// Id of signed resource
+ /// The region where the bucket resides Acceptable values: `US`, `EMEA` Default is `US` (optional, default to US)
+ ///
+ public void DeleteSignedResource (string id, string region = null) {
+ DeleteSignedResourceWithHttpInfo (id, region);
+ }
+
+ ///
+ /// Delete a signed URL. A successful call to this endpoint requires bucket owner access.
+ ///
+ /// Thrown when fails to make API call
+ /// Id of signed resource
+ /// The region where the bucket resides Acceptable values: `US`, `EMEA` Default is `US` (optional, default to US)
+ /// ApiResponse of Object(void)
+ public ApiResponse DeleteSignedResourceWithHttpInfo (string id, string region = null) {
+ // verify the required parameter 'id' is set
+ if ( id == null )
+ throw new ApiException (400, "Missing required parameter 'id' when calling ObjectsApi->DeleteSignedResource");
+
+ var localVarPath = "/oss/v2/signedresources/{id}";
+ var localVarPathParams = new Dictionary ();
+ var localVarQueryParams = new Dictionary ();
+ var localVarHeaderParams = new Dictionary (Configuration.DefaultHeader);
+ var localVarFormParams = new Dictionary ();
+ var localVarFileParams = new Dictionary ();
+ Object localVarPostBody = null;
+
+ // to determine the Content-Type header
+ String [] localVarHttpContentTypes = new String [] {
+ "application/json"
+ };
+ String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType (localVarHttpContentTypes);
+
+ // to determine the Accept header
+ String [] localVarHttpHeaderAccepts = new String [] {
+ "text/plain"
+ };
+ String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept (localVarHttpHeaderAccepts);
+ if ( localVarHttpHeaderAccept != null )
+ localVarHeaderParams.Add ("Accept", localVarHttpHeaderAccept);
+
+ // set "format" to json by default
+ // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
+ localVarPathParams.Add ("format", "json");
+ if ( id != null )
+ localVarPathParams.Add ("id", Configuration.ApiClient.ParameterToString (id)); // path parameter
+ if ( region != null )
+ localVarQueryParams.Add ("region", Configuration.ApiClient.ParameterToString (region)); // query parameter
+
+ // authentication (oauth2_application) required
+ // oauth required
+ if ( !String.IsNullOrEmpty (Configuration.AccessToken) ) {
+ localVarHeaderParams ["Authorization"] = "Bearer " + Configuration.AccessToken;
+ }
+
+ // make the HTTP request
+ RestResponse localVarResponse = (RestResponse)Configuration.ApiClient.CallApi (localVarPath,
+ Method.Delete, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
+ localVarPathParams, localVarHttpContentType);
+
+ int localVarStatusCode = (int)localVarResponse.StatusCode;
+
+ if ( ExceptionFactory != null ) {
+ Exception exception = ExceptionFactory ("DeleteSignedResource", localVarResponse);
+ if ( exception != null )
+ throw exception;
+ }
+
+
+ return new ApiResponse (localVarStatusCode,
+ localVarResponse.Headers.ToDictionary (x => x.Name, x => x.Value.ToString ()),
+ null);
+ }
+
+ ///
+ /// Delete a signed URL. A successful call to this endpoint requires bucket owner access.
+ ///
+ /// Thrown when fails to make API call
+ /// Id of signed resource
+ /// The region where the bucket resides Acceptable values: `US`, `EMEA` Default is `US` (optional, default to US)
+ /// Task of void
+ public async System.Threading.Tasks.Task DeleteSignedResourceAsync (string id, string region = null) {
+ await DeleteSignedResourceAsyncWithHttpInfo (id, region);
+
+ }
+
+ ///
+ /// Delete a signed URL. A successful call to this endpoint requires bucket owner access.
+ ///
+ /// Thrown when fails to make API call
+ /// Id of signed resource
+ /// The region where the bucket resides Acceptable values: `US`, `EMEA` Default is `US` (optional, default to US)
+ /// Task of ApiResponse
+ public async System.Threading.Tasks.Task> DeleteSignedResourceAsyncWithHttpInfo (string id, string region = null) {
+ // verify the required parameter 'id' is set
+ if ( id == null )
+ throw new ApiException (400, "Missing required parameter 'id' when calling ObjectsApi->DeleteSignedResource");
+
+ var localVarPath = "/oss/v2/signedresources/{id}";
+ var localVarPathParams = new Dictionary ();
+ var localVarQueryParams = new Dictionary ();
+ var localVarHeaderParams = new Dictionary (Configuration.DefaultHeader);
+ var localVarFormParams = new Dictionary ();
+ var localVarFileParams = new Dictionary ();
+ Object localVarPostBody = null;
+
+ // to determine the Content-Type header
+ String [] localVarHttpContentTypes = new String [] {
+ "application/json"
+ };
+ String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType (localVarHttpContentTypes);
+
+ // to determine the Accept header
+ String [] localVarHttpHeaderAccepts = new String [] {
+ "text/plain"
+ };
+ String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept (localVarHttpHeaderAccepts);
+ if ( localVarHttpHeaderAccept != null )
+ localVarHeaderParams.Add ("Accept", localVarHttpHeaderAccept);
+
+ // set "format" to json by default
+ // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
+ localVarPathParams.Add ("format", "json");
+ if ( id != null )
+ localVarPathParams.Add ("id", Configuration.ApiClient.ParameterToString (id)); // path parameter
+ if ( region != null )
+ localVarQueryParams.Add ("region", Configuration.ApiClient.ParameterToString (region)); // query parameter
+
+ // authentication (oauth2_application) required
+ // oauth required
+ if ( !String.IsNullOrEmpty (Configuration.AccessToken) ) {
+ localVarHeaderParams ["Authorization"] = "Bearer " + Configuration.AccessToken;
+ }
+
+ // make the HTTP request
+ RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync (localVarPath,
+ Method.Delete, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
+ localVarPathParams, localVarHttpContentType);
+
+ int localVarStatusCode = (int)localVarResponse.StatusCode;
+
+ if ( ExceptionFactory != null ) {
+ Exception exception = ExceptionFactory ("DeleteSignedResource", localVarResponse);
+ if ( exception != null )
+ throw exception;
+ }
+
+
+ return new ApiResponse (localVarStatusCode,
+ localVarResponse.Headers.ToDictionary (x => x.Name, x => x.Value.ToString ()),
+ null);
+ }
+
+ ///
+ /// Download an object.
+ ///
+ /// Thrown when fails to make API call
+ /// URL-encoded bucket key
+ /// URL-encoded object name
+ /// A range of bytes to download from the specified object. (optional)
+ /// The value of this header is compared to the ETAG of the object. If they match, the body will not be included in the response. Only the object information will be included. (optional)
+ /// If the requested object has not been modified since the time specified in this field, an entity will not be returned from the server; instead, a 304 (not modified) response will be returned without any message body. (optional)
+ /// When gzip is specified, a gzip compressed stream of the object’s bytes will be returned in the response. Cannot use “Accept-Encoding:gzip” with Range header containing an end byte range. End byte range will not be honored if “Accept-Encoding: gzip” header is used. (optional)
+ /// System.IO.Stream
+ public /*System.IO.Stream*/dynamic GetObject (string bucketKey, string objectName, string range = null, string ifNoneMatch = null, DateTime? ifModifiedSince = null, string acceptEncoding = null) {
+ ApiResponse*System.IO.Stream*/dynamic> localVarResponse = GetObjectWithHttpInfo (bucketKey, objectName, range, ifNoneMatch, ifModifiedSince, acceptEncoding);
+ return localVarResponse.Data;
+ }
+
+ ///
+ /// Download an object.
+ ///
+ /// Thrown when fails to make API call
+ /// URL-encoded bucket key
+ /// URL-encoded object name
+ /// A range of bytes to download from the specified object. (optional)
+ /// The value of this header is compared to the ETAG of the object. If they match, the body will not be included in the response. Only the object information will be included. (optional)
+ /// If the requested object has not been modified since the time specified in this field, an entity will not be returned from the server; instead, a 304 (not modified) response will be returned without any message body. (optional)
+ /// When gzip is specified, a gzip compressed stream of the object’s bytes will be returned in the response. Cannot use “Accept-Encoding:gzip” with Range header containing an end byte range. End byte range will not be honored if “Accept-Encoding: gzip” header is used. (optional)
+ /// ApiResponse of System.IO.Stream
+ public ApiResponse< /*System.IO.Stream*/dynamic> GetObjectWithHttpInfo (string bucketKey, string objectName, string range = null, string ifNoneMatch = null, DateTime? ifModifiedSince = null, string acceptEncoding = null) {
+ // verify the required parameter 'bucketKey' is set
+ if ( bucketKey == null )
+ throw new ApiException (400, "Missing required parameter 'bucketKey' when calling ObjectsApi->GetObject");
+ // verify the required parameter 'objectName' is set
+ if ( objectName == null )
+ throw new ApiException (400, "Missing required parameter 'objectName' when calling ObjectsApi->GetObject");
+
+ var localVarPath = "/oss/v2/buckets/{bucketKey}/objects/{objectName}";
+ var localVarPathParams = new Dictionary ();
+ var localVarQueryParams = new Dictionary ();
+ var localVarHeaderParams = new Dictionary (Configuration.DefaultHeader);
+ var localVarFormParams = new Dictionary ();
+ var localVarFileParams = new Dictionary ();
+ Object localVarPostBody = null;
+
+ // to determine the Content-Type header
+ String [] localVarHttpContentTypes = new String [] {
+ "application/json"
+ };
+ String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType (localVarHttpContentTypes);
+
+ // to determine the Accept header
+ String [] localVarHttpHeaderAccepts = new String [] {
+ "application/octet-stream"
+ };
+ String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept (localVarHttpHeaderAccepts);
+ if ( localVarHttpHeaderAccept != null )
+ localVarHeaderParams.Add ("Accept", localVarHttpHeaderAccept);
+
+ // set "format" to json by default
+ // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
+ localVarPathParams.Add ("format", "json");
+ if ( bucketKey != null )
+ localVarPathParams.Add ("bucketKey", Configuration.ApiClient.ParameterToString (bucketKey)); // path parameter
+ if ( objectName != null )
+ localVarPathParams.Add ("objectName", Configuration.ApiClient.ParameterToString (objectName)); // path parameter
+ if ( range != null )
+ localVarHeaderParams.Add ("Range", Configuration.ApiClient.ParameterToString (range)); // header parameter
+ if ( ifNoneMatch != null )
+ localVarHeaderParams.Add ("If-None-Match", Configuration.ApiClient.ParameterToString (ifNoneMatch)); // header parameter
+ if ( ifModifiedSince != null )
+ localVarHeaderParams.Add ("If-Modified-Since", Configuration.ApiClient.ParameterToString (ifModifiedSince)); // header parameter
+ if ( acceptEncoding != null )
+ localVarHeaderParams.Add ("Accept-Encoding", Configuration.ApiClient.ParameterToString (acceptEncoding)); // header parameter
+
+ // authentication (oauth2_application) required
+ // oauth required
+ if ( !String.IsNullOrEmpty (Configuration.AccessToken) ) {
+ localVarHeaderParams ["Authorization"] = "Bearer " + Configuration.AccessToken;
+ }
+
+ // make the HTTP request
+ RestResponse localVarResponse = (RestResponse)Configuration.ApiClient.CallApi (localVarPath,
+ Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
+ localVarPathParams, localVarHttpContentType);
+
+ int localVarStatusCode = (int)localVarResponse.StatusCode;
+
+ if ( ExceptionFactory != null ) {
+ Exception exception = ExceptionFactory ("GetObject", localVarResponse);
+ if ( exception != null )
+ throw exception;
+ }
+
+ return new ApiResponse*System.IO.Stream*/dynamic> (localVarStatusCode,
+ localVarResponse.Headers.ToDictionary (x => x.Name, x => x.Value.ToString ()),
+ /*(System.IO.Stream)*/ Configuration.ApiClient.Deserialize (localVarResponse, typeof (System.IO.Stream)));
+
+ }
+
+ ///
+ /// Download an object.
+ ///
+ /// Thrown when fails to make API call
+ /// URL-encoded bucket key
+ /// URL-encoded object name
+ /// A range of bytes to download from the specified object. (optional)
+ /// The value of this header is compared to the ETAG of the object. If they match, the body will not be included in the response. Only the object information will be included. (optional)
+ /// If the requested object has not been modified since the time specified in this field, an entity will not be returned from the server; instead, a 304 (not modified) response will be returned without any message body. (optional)
+ /// When gzip is specified, a gzip compressed stream of the object’s bytes will be returned in the response. Cannot use “Accept-Encoding:gzip” with Range header containing an end byte range. End byte range will not be honored if “Accept-Encoding: gzip” header is used. (optional)
+ /// Task of System.IO.Stream
+ public async System.Threading.Tasks.Task*System.IO.Stream*/dynamic> GetObjectAsync (string bucketKey, string objectName, string range = null, string ifNoneMatch = null, DateTime? ifModifiedSince = null, string acceptEncoding = null) {
+ ApiResponse*System.IO.Stream*/dynamic> localVarResponse = await GetObjectAsyncWithHttpInfo (bucketKey, objectName, range, ifNoneMatch, ifModifiedSince, acceptEncoding);
+ return localVarResponse.Data;
+
+ }
+
+ ///
+ /// Download an object.
+ ///
+ /// Thrown when fails to make API call
+ /// URL-encoded bucket key
+ /// URL-encoded object name
+ /// A range of bytes to download from the specified object. (optional)
+ /// The value of this header is compared to the ETAG of the object. If they match, the body will not be included in the response. Only the object information will be included. (optional)
+ /// If the requested object has not been modified since the time specified in this field, an entity will not be returned from the server; instead, a 304 (not modified) response will be returned without any message body. (optional)
+ /// When gzip is specified, a gzip compressed stream of the object’s bytes will be returned in the response. Cannot use “Accept-Encoding:gzip” with Range header containing an end byte range. End byte range will not be honored if “Accept-Encoding: gzip” header is used. (optional)
+ /// Task of ApiResponse (System.IO.Stream)
+ public async System.Threading.Tasks.Task> GetObjectAsyncWithHttpInfo (string bucketKey, string objectName, string range = null, string ifNoneMatch = null, DateTime? ifModifiedSince = null, string acceptEncoding = null) {
+ // verify the required parameter 'bucketKey' is set
+ if ( bucketKey == null )
+ throw new ApiException (400, "Missing required parameter 'bucketKey' when calling ObjectsApi->GetObject");
+ // verify the required parameter 'objectName' is set
+ if ( objectName == null )
+ throw new ApiException (400, "Missing required parameter 'objectName' when calling ObjectsApi->GetObject");
+
+ var localVarPath = "/oss/v2/buckets/{bucketKey}/objects/{objectName}";
+ var localVarPathParams = new Dictionary ();
+ var localVarQueryParams = new Dictionary ();
+ var localVarHeaderParams = new Dictionary (Configuration.DefaultHeader);
+ var localVarFormParams = new Dictionary ();
+ var localVarFileParams = new Dictionary ();
+ Object localVarPostBody = null;
+
+ // to determine the Content-Type header
+ String [] localVarHttpContentTypes = new String [] {
+ "application/json"
+ };
+ String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType (localVarHttpContentTypes);
+
+ // to determine the Accept header
+ String [] localVarHttpHeaderAccepts = new String [] {
+ "application/octet-stream"
+ };
+ String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept (localVarHttpHeaderAccepts);
+ if ( localVarHttpHeaderAccept != null )
+ localVarHeaderParams.Add ("Accept", localVarHttpHeaderAccept);
+
+ // set "format" to json by default
+ // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
+ localVarPathParams.Add ("format", "json");
+ if ( bucketKey != null )
+ localVarPathParams.Add ("bucketKey", Configuration.ApiClient.ParameterToString (bucketKey)); // path parameter
+ if ( objectName != null )
+ localVarPathParams.Add ("objectName", Configuration.ApiClient.ParameterToString (objectName)); // path parameter
+ if ( range != null )
+ localVarHeaderParams.Add ("Range", Configuration.ApiClient.ParameterToString (range)); // header parameter
+ if ( ifNoneMatch != null )
+ localVarHeaderParams.Add ("If-None-Match", Configuration.ApiClient.ParameterToString (ifNoneMatch)); // header parameter
+ if ( ifModifiedSince != null )
+ localVarHeaderParams.Add ("If-Modified-Since", Configuration.ApiClient.ParameterToString (ifModifiedSince)); // header parameter
+ if ( acceptEncoding != null )
+ localVarHeaderParams.Add ("Accept-Encoding", Configuration.ApiClient.ParameterToString (acceptEncoding)); // header parameter
+
+ // authentication (oauth2_application) required
+ // oauth required
+ if ( !String.IsNullOrEmpty (Configuration.AccessToken) ) {
+ localVarHeaderParams ["Authorization"] = "Bearer " + Configuration.AccessToken;
+ }
+
+ // make the HTTP request
+ RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync (localVarPath,
+ Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
+ localVarPathParams, localVarHttpContentType);
+
+ int localVarStatusCode = (int)localVarResponse.StatusCode;
+
+ if ( ExceptionFactory != null ) {
+ Exception exception = ExceptionFactory ("GetObject", localVarResponse);
+ if ( exception != null )
+ throw exception;
+ }
+
+ return new ApiResponse*System.IO.Stream*/dynamic> (localVarStatusCode,
+ localVarResponse.Headers.ToDictionary (x => x.Name, x => x.Value.ToString ()),
+ /*(System.IO.Stream)*/ Configuration.ApiClient.Deserialize (localVarResponse, typeof (System.IO.Stream)));
+
+ }
+
+ ///
+ /// Returns object details in JSON format.
+ ///
+ /// Thrown when fails to make API call
+ /// URL-encoded bucket key
+ /// URL-encoded object name
+ /// If the requested object has not been modified since the time specified in this field, an entity will not be returned from the server; instead, a 304 (not modified) response will be returned without any message body. (optional)
+ /// Extra information in details; multiple uses are supported Acceptable values: `createdDate`, `lastAccessedDate`, `lastModifiedDate` (optional)
+ /// ObjectFullDetails
+ public /*ObjectFullDetails*/dynamic GetObjectDetails (string bucketKey, string objectName, DateTime? ifModifiedSince = null, string with = null) {
+ ApiResponse*ObjectFullDetails*/dynamic> localVarResponse = GetObjectDetailsWithHttpInfo (bucketKey, objectName, ifModifiedSince, with);
+ return localVarResponse.Data;
+ }
+
+ ///
+ /// Returns object details in JSON format.
+ ///
+ /// Thrown when fails to make API call
+ /// URL-encoded bucket key
+ /// URL-encoded object name
+ /// If the requested object has not been modified since the time specified in this field, an entity will not be returned from the server; instead, a 304 (not modified) response will be returned without any message body. (optional)
+ /// Extra information in details; multiple uses are supported Acceptable values: `createdDate`, `lastAccessedDate`, `lastModifiedDate` (optional)
+ /// ApiResponse of ObjectFullDetails
+ public ApiResponse< /*ObjectFullDetails*/dynamic> GetObjectDetailsWithHttpInfo (string bucketKey, string objectName, DateTime? ifModifiedSince = null, string with = null) {
+ // verify the required parameter 'bucketKey' is set
+ if ( bucketKey == null )
+ throw new ApiException (400, "Missing required parameter 'bucketKey' when calling ObjectsApi->GetObjectDetails");
+ // verify the required parameter 'objectName' is set
+ if ( objectName == null )
+ throw new ApiException (400, "Missing required parameter 'objectName' when calling ObjectsApi->GetObjectDetails");
+
+ var localVarPath = "/oss/v2/buckets/{bucketKey}/objects/{objectName}/details";
+ var localVarPathParams = new Dictionary ();
+ var localVarQueryParams = new Dictionary ();
+ var localVarHeaderParams = new Dictionary (Configuration.DefaultHeader);
+ var localVarFormParams = new Dictionary ();
+ var localVarFileParams = new Dictionary ();
+ Object localVarPostBody = null;
+
+ // to determine the Content-Type header
+ String [] localVarHttpContentTypes = new String [] {
+ "application/json"
+ };
+ String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType (localVarHttpContentTypes);
+
+ // to determine the Accept header
+ String [] localVarHttpHeaderAccepts = new String [] {
+ "application/vnd.api+json",
+ "application/json"
+ };
+ String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept (localVarHttpHeaderAccepts);
+ if ( localVarHttpHeaderAccept != null )
+ localVarHeaderParams.Add ("Accept", localVarHttpHeaderAccept);
+
+ // set "format" to json by default
+ // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
+ localVarPathParams.Add ("format", "json");
+ if ( bucketKey != null )
+ localVarPathParams.Add ("bucketKey", Configuration.ApiClient.ParameterToString (bucketKey)); // path parameter
+ if ( objectName != null )
+ localVarPathParams.Add ("objectName", Configuration.ApiClient.ParameterToString (objectName)); // path parameter
+ if ( with != null )
+ localVarQueryParams.Add ("with", Configuration.ApiClient.ParameterToString (with)); // query parameter
+ if ( ifModifiedSince != null )
+ localVarHeaderParams.Add ("If-Modified-Since", Configuration.ApiClient.ParameterToString (ifModifiedSince)); // header parameter
+
+ // authentication (oauth2_application) required
+ // oauth required
+ if ( !String.IsNullOrEmpty (Configuration.AccessToken) ) {
+ localVarHeaderParams ["Authorization"] = "Bearer " + Configuration.AccessToken;
+ }
+
+ // make the HTTP request
+ RestResponse localVarResponse = (RestResponse)Configuration.ApiClient.CallApi (localVarPath,
+ Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
+ localVarPathParams, localVarHttpContentType);
+
+ int localVarStatusCode = (int)localVarResponse.StatusCode;
+
+ if ( ExceptionFactory != null ) {
+ Exception exception = ExceptionFactory ("GetObjectDetails", localVarResponse);
+ if ( exception != null )
+ throw exception;
+ }
+
+ return new ApiResponse*ObjectFullDetails*/dynamic> (localVarStatusCode,
+ localVarResponse.Headers.ToDictionary (x => x.Name, x => x.Value.ToString ()),
+ /*(ObjectFullDetails)*/ Configuration.ApiClient.Deserialize (localVarResponse, typeof (ObjectFullDetails)));
+
+ }
+
+ ///
+ /// Returns object details in JSON format.
+ ///
+ /// Thrown when fails to make API call
+ /// URL-encoded bucket key
+ /// URL-encoded object name
+ /// If the requested object has not been modified since the time specified in this field, an entity will not be returned from the server; instead, a 304 (not modified) response will be returned without any message body. (optional)
+ /// Extra information in details; multiple uses are supported Acceptable values: `createdDate`, `lastAccessedDate`, `lastModifiedDate` (optional)
+ /// Task of ObjectFullDetails
+ public async System.Threading.Tasks.Task*ObjectFullDetails*/dynamic> GetObjectDetailsAsync (string bucketKey, string objectName, DateTime? ifModifiedSince = null, string with = null) {
+ ApiResponse*ObjectFullDetails*/dynamic> localVarResponse = await GetObjectDetailsAsyncWithHttpInfo (bucketKey, objectName, ifModifiedSince, with);
+ return localVarResponse.Data;
+
+ }
+
+ ///
+ /// Returns object details in JSON format.
+ ///
+ /// Thrown when fails to make API call
+ /// URL-encoded bucket key
+ /// URL-encoded object name
+ /// If the requested object has not been modified since the time specified in this field, an entity will not be returned from the server; instead, a 304 (not modified) response will be returned without any message body. (optional)
+ /// Extra information in details; multiple uses are supported Acceptable values: `createdDate`, `lastAccessedDate`, `lastModifiedDate` (optional)
+ /// Task of ApiResponse (ObjectFullDetails)
+ public async System.Threading.Tasks.Task> GetObjectDetailsAsyncWithHttpInfo (string bucketKey, string objectName, DateTime? ifModifiedSince = null, string with = null) {
+ // verify the required parameter 'bucketKey' is set
+ if ( bucketKey == null )
+ throw new ApiException (400, "Missing required parameter 'bucketKey' when calling ObjectsApi->GetObjectDetails");
+ // verify the required parameter 'objectName' is set
+ if ( objectName == null )
+ throw new ApiException (400, "Missing required parameter 'objectName' when calling ObjectsApi->GetObjectDetails");
+
+ var localVarPath = "/oss/v2/buckets/{bucketKey}/objects/{objectName}/details";
+ var localVarPathParams = new Dictionary ();
+ var localVarQueryParams = new Dictionary ();
+ var localVarHeaderParams = new Dictionary (Configuration.DefaultHeader);
+ var localVarFormParams = new Dictionary ();
+ var localVarFileParams = new Dictionary ();
+ Object localVarPostBody = null;
+
+ // to determine the Content-Type header
+ String [] localVarHttpContentTypes = new String [] {
+ "application/json"
+ };
+ String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType (localVarHttpContentTypes);
+
+ // to determine the Accept header
+ String [] localVarHttpHeaderAccepts = new String [] {
+ "application/vnd.api+json",
+ "application/json"
+ };
+ String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept (localVarHttpHeaderAccepts);
+ if ( localVarHttpHeaderAccept != null )
+ localVarHeaderParams.Add ("Accept", localVarHttpHeaderAccept);
+
+ // set "format" to json by default
+ // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
+ localVarPathParams.Add ("format", "json");
+ if ( bucketKey != null )
+ localVarPathParams.Add ("bucketKey", Configuration.ApiClient.ParameterToString (bucketKey)); // path parameter
+ if ( objectName != null )
+ localVarPathParams.Add ("objectName", Configuration.ApiClient.ParameterToString (objectName)); // path parameter
+ if ( with != null )
+ localVarQueryParams.Add ("with", Configuration.ApiClient.ParameterToString (with)); // query parameter
+ if ( ifModifiedSince != null )
+ localVarHeaderParams.Add ("If-Modified-Since", Configuration.ApiClient.ParameterToString (ifModifiedSince)); // header parameter
+
+ // authentication (oauth2_application) required
+ // oauth required
+ if ( !String.IsNullOrEmpty (Configuration.AccessToken) ) {
+ localVarHeaderParams ["Authorization"] = "Bearer " + Configuration.AccessToken;
+ }
+
+ // make the HTTP request
+ RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync (localVarPath,
+ Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
+ localVarPathParams, localVarHttpContentType);
+
+ int localVarStatusCode = (int)localVarResponse.StatusCode;
+
+ if ( ExceptionFactory != null ) {
+ Exception exception = ExceptionFactory ("GetObjectDetails", localVarResponse);
+ if ( exception != null )
+ throw exception;
+ }
+
+ return new ApiResponse*ObjectFullDetails*/dynamic> (localVarStatusCode,
+ localVarResponse.Headers.ToDictionary (x => x.Name, x => x.Value.ToString ()),
+ /*(ObjectFullDetails)*/ Configuration.ApiClient.Deserialize (localVarResponse, typeof (ObjectFullDetails)));
+
+ }
+
+ ///
+ /// List objects in a bucket. It is only available to the bucket creator.
+ ///
+ /// Thrown when fails to make API call
+ /// URL-encoded bucket key
+ /// Limit to the response size, Acceptable values: 1-100 Default = 10 (optional, default to 10)
+ /// Provides a way to filter the based on object key name (optional)
+ /// Key to use as an offset to continue pagination This is typically the last bucket key found in a preceding GET buckets response (optional)
+ /// BucketObjects
+ public /*BucketObjects*/dynamic GetObjects (string bucketKey, int? limit = null, string beginsWith = null, string startAt = null) {
+ ApiResponse*BucketObjects*/dynamic> localVarResponse = GetObjectsWithHttpInfo (bucketKey, limit, beginsWith, startAt);
+ return localVarResponse.Data;
+ }
+
+ ///
+ /// List objects in a bucket. It is only available to the bucket creator.
+ ///
+ /// Thrown when fails to make API call
+ /// URL-encoded bucket key
+ /// Limit to the response size, Acceptable values: 1-100 Default = 10 (optional, default to 10)
+ /// Provides a way to filter the based on object key name (optional)
+ /// Key to use as an offset to continue pagination This is typically the last bucket key found in a preceding GET buckets response (optional)
+ /// ApiResponse of BucketObjects
+ public ApiResponse< /*BucketObjects*/dynamic> GetObjectsWithHttpInfo (string bucketKey, int? limit = null, string beginsWith = null, string startAt = null) {
+ // verify the required parameter 'bucketKey' is set
+ if ( bucketKey == null )
+ throw new ApiException (400, "Missing required parameter 'bucketKey' when calling ObjectsApi->GetObjects");
+
+ var localVarPath = "/oss/v2/buckets/{bucketKey}/objects";
+ var localVarPathParams = new Dictionary ();
+ var localVarQueryParams = new Dictionary ();
+ var localVarHeaderParams = new Dictionary (Configuration.DefaultHeader);
+ var localVarFormParams = new Dictionary ();
+ var localVarFileParams = new Dictionary ();
+ Object localVarPostBody = null;
+
+ // to determine the Content-Type header
+ String [] localVarHttpContentTypes = new String [] {
+ "application/json"
+ };
+ String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType (localVarHttpContentTypes);
+
+ // to determine the Accept header
+ String [] localVarHttpHeaderAccepts = new String [] {
+ "application/vnd.api+json",
+ "application/json"
+ };
+ String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept (localVarHttpHeaderAccepts);
+ if ( localVarHttpHeaderAccept != null )
+ localVarHeaderParams.Add ("Accept", localVarHttpHeaderAccept);
+
+ // set "format" to json by default
+ // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
+ localVarPathParams.Add ("format", "json");
+ if ( bucketKey != null )
+ localVarPathParams.Add ("bucketKey", Configuration.ApiClient.ParameterToString (bucketKey)); // path parameter
+ if ( limit != null )
+ localVarQueryParams.Add ("limit", Configuration.ApiClient.ParameterToString (limit)); // query parameter
+ if ( beginsWith != null )
+ localVarQueryParams.Add ("beginsWith", Configuration.ApiClient.ParameterToString (beginsWith)); // query parameter
+ if ( startAt != null )
+ localVarQueryParams.Add ("startAt", Configuration.ApiClient.ParameterToString (startAt)); // query parameter
+
+ // authentication (oauth2_application) required
+ // oauth required
+ if ( !String.IsNullOrEmpty (Configuration.AccessToken) ) {
+ localVarHeaderParams ["Authorization"] = "Bearer " + Configuration.AccessToken;
+ }
+
+ // make the HTTP request
+ RestResponse localVarResponse = (RestResponse)Configuration.ApiClient.CallApi (localVarPath,
+ Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
+ localVarPathParams, localVarHttpContentType);
+
+ int localVarStatusCode = (int)localVarResponse.StatusCode;
+
+ if ( ExceptionFactory != null ) {
+ Exception exception = ExceptionFactory ("GetObjects", localVarResponse);
+ if ( exception != null )
+ throw exception;
+ }
+
+ return new ApiResponse*BucketObjects*/dynamic> (localVarStatusCode,
+ localVarResponse.Headers.ToDictionary (x => x.Name, x => x.Value.ToString ()),
+ /*(BucketObjects)*/ Configuration.ApiClient.Deserialize (localVarResponse, typeof (BucketObjects)));
+
+ }
+
+ ///
+ /// List objects in a bucket. It is only available to the bucket creator.
+ ///
+ /// Thrown when fails to make API call
+ /// URL-encoded bucket key
+ /// Limit to the response size, Acceptable values: 1-100 Default = 10 (optional, default to 10)
+ /// Provides a way to filter the based on object key name (optional)
+ /// Key to use as an offset to continue pagination This is typically the last bucket key found in a preceding GET buckets response (optional)
+ /// Task of BucketObjects
+ public async System.Threading.Tasks.Task*BucketObjects*/dynamic> GetObjectsAsync (string bucketKey, int? limit = null, string beginsWith = null, string startAt = null) {
+ ApiResponse*BucketObjects*/dynamic> localVarResponse = await GetObjectsAsyncWithHttpInfo (bucketKey, limit, beginsWith, startAt);
+ return localVarResponse.Data;
+
+ }
+
+ ///
+ /// List objects in a bucket. It is only available to the bucket creator.
+ ///
+ /// Thrown when fails to make API call
+ /// URL-encoded bucket key
+ /// Limit to the response size, Acceptable values: 1-100 Default = 10 (optional, default to 10)
+ /// Provides a way to filter the based on object key name (optional)
+ /// Key to use as an offset to continue pagination This is typically the last bucket key found in a preceding GET buckets response (optional)
+ /// Task of ApiResponse (BucketObjects)
+ public async System.Threading.Tasks.Task> GetObjectsAsyncWithHttpInfo (string bucketKey, int? limit = null, string beginsWith = null, string startAt = null) {
+ // verify the required parameter 'bucketKey' is set
+ if ( bucketKey == null )
+ throw new ApiException (400, "Missing required parameter 'bucketKey' when calling ObjectsApi->GetObjects");
+
+ var localVarPath = "/oss/v2/buckets/{bucketKey}/objects";
+ var localVarPathParams = new Dictionary ();
+ var localVarQueryParams = new Dictionary ();
+ var localVarHeaderParams = new Dictionary (Configuration.DefaultHeader);
+ var localVarFormParams = new Dictionary ();
+ var localVarFileParams = new Dictionary ();
+ Object localVarPostBody = null;
+
+ // to determine the Content-Type header
+ String [] localVarHttpContentTypes = new String [] {
+ "application/json"
+ };
+ String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType (localVarHttpContentTypes);
+
+ // to determine the Accept header
+ String [] localVarHttpHeaderAccepts = new String [] {
+ "application/vnd.api+json",
+ "application/json"
+ };
+ String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept (localVarHttpHeaderAccepts);
+ if ( localVarHttpHeaderAccept != null )
+ localVarHeaderParams.Add ("Accept", localVarHttpHeaderAccept);
+
+ // set "format" to json by default
+ // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
+ localVarPathParams.Add ("format", "json");
+ if ( bucketKey != null )
+ localVarPathParams.Add ("bucketKey", Configuration.ApiClient.ParameterToString (bucketKey)); // path parameter
+ if ( limit != null )
+ localVarQueryParams.Add ("limit", Configuration.ApiClient.ParameterToString (limit)); // query parameter
+ if ( beginsWith != null )
+ localVarQueryParams.Add ("beginsWith", Configuration.ApiClient.ParameterToString (beginsWith)); // query parameter
+ if ( startAt != null )
+ localVarQueryParams.Add ("startAt", Configuration.ApiClient.ParameterToString (startAt)); // query parameter
+
+ // authentication (oauth2_application) required
+ // oauth required
+ if ( !String.IsNullOrEmpty (Configuration.AccessToken) ) {
+ localVarHeaderParams ["Authorization"] = "Bearer " + Configuration.AccessToken;
+ }
+
+ // make the HTTP request
+ RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync (localVarPath,
+ Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
+ localVarPathParams, localVarHttpContentType);
+
+ int localVarStatusCode = (int)localVarResponse.StatusCode;
+
+ if ( ExceptionFactory != null ) {
+ Exception exception = ExceptionFactory ("GetObjects", localVarResponse);
+ if ( exception != null )
+ throw exception;
+ }
+
+ return new ApiResponse*BucketObjects*/dynamic> (localVarStatusCode,
+ localVarResponse.Headers.ToDictionary (x => x.Name, x => x.Value.ToString ()),
+ /*(BucketObjects)*/ Configuration.ApiClient.Deserialize (localVarResponse, typeof (BucketObjects)));
+
+ }
+
+ ///
+ /// Download an object using a signed URL.
+ ///
+ /// Thrown when fails to make API call
+ /// Id of signed resource
+ /// A range of bytes to download from the specified object. (optional)
+ /// The value of this header is compared to the ETAG of the object. If they match, the body will not be included in the response. Only the object information will be included. (optional)
+ /// If the requested object has not been modified since the time specified in this field, an entity will not be returned from the server; instead, a 304 (not modified) response will be returned without any message body. (optional)
+ /// When gzip is specified, a gzip compressed stream of the object’s bytes will be returned in the response. Cannot use “Accept-Encoding:gzip” with Range header containing an end byte range. End byte range will not be honored if “Accept-Encoding: gzip” header is used. (optional)
+ /// The region where the bucket resides Acceptable values: `US`, `EMEA` Default is `US` (optional, default to US)
+ /// System.IO.Stream
+ public /*System.IO.Stream*/dynamic GetSignedResource (string id, string range = null, string ifNoneMatch = null, DateTime? ifModifiedSince = null, string acceptEncoding = null, string region = null) {
+ ApiResponse*System.IO.Stream*/dynamic> localVarResponse = GetSignedResourceWithHttpInfo (id, range, ifNoneMatch, ifModifiedSince, acceptEncoding, region);
+ return localVarResponse.Data;
+ }
+
+ ///
+ /// Download an object using a signed URL.
+ ///
+ /// Thrown when fails to make API call
+ /// Id of signed resource
+ /// A range of bytes to download from the specified object. (optional)
+ /// The value of this header is compared to the ETAG of the object. If they match, the body will not be included in the response. Only the object information will be included. (optional)
+ /// If the requested object has not been modified since the time specified in this field, an entity will not be returned from the server; instead, a 304 (not modified) response will be returned without any message body. (optional)
+ /// When gzip is specified, a gzip compressed stream of the object’s bytes will be returned in the response. Cannot use “Accept-Encoding:gzip” with Range header containing an end byte range. End byte range will not be honored if “Accept-Encoding: gzip” header is used. (optional)
+ /// The region where the bucket resides Acceptable values: `US`, `EMEA` Default is `US` (optional, default to US)
+ /// ApiResponse of System.IO.Stream
+ public ApiResponse< /*System.IO.Stream*/dynamic> GetSignedResourceWithHttpInfo (string id, string range = null, string ifNoneMatch = null, DateTime? ifModifiedSince = null, string acceptEncoding = null, string region = null) {
+ // verify the required parameter 'id' is set
+ if ( id == null )
+ throw new ApiException (400, "Missing required parameter 'id' when calling ObjectsApi->GetSignedResource");
+
+ var localVarPath = "/oss/v2/signedresources/{id}";
+ var localVarPathParams = new Dictionary ();
+ var localVarQueryParams = new Dictionary ();
+ var localVarHeaderParams = new Dictionary (Configuration.DefaultHeader);
+ var localVarFormParams = new Dictionary ();
+ var localVarFileParams = new Dictionary ();
+ Object localVarPostBody = null;
+
+ // to determine the Content-Type header
+ String [] localVarHttpContentTypes = new String [] {
+ "application/json"
+ };
+ String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType (localVarHttpContentTypes);
+
+ // to determine the Accept header
+ String [] localVarHttpHeaderAccepts = new String [] {
+ "application/octet-stream"
+ };
+ String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept (localVarHttpHeaderAccepts);
+ if ( localVarHttpHeaderAccept != null )
+ localVarHeaderParams.Add ("Accept", localVarHttpHeaderAccept);
+
+ // set "format" to json by default
+ // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
+ localVarPathParams.Add ("format", "json");
+ if ( id != null )
+ localVarPathParams.Add ("id", Configuration.ApiClient.ParameterToString (id)); // path parameter
+ if ( region != null )
+ localVarQueryParams.Add ("region", Configuration.ApiClient.ParameterToString (region)); // query parameter
+ if ( range != null )
+ localVarHeaderParams.Add ("Range", Configuration.ApiClient.ParameterToString (range)); // header parameter
+ if ( ifNoneMatch != null )
+ localVarHeaderParams.Add ("If-None-Match", Configuration.ApiClient.ParameterToString (ifNoneMatch)); // header parameter
+ if ( ifModifiedSince != null )
+ localVarHeaderParams.Add ("If-Modified-Since", Configuration.ApiClient.ParameterToString (ifModifiedSince)); // header parameter
+ if ( acceptEncoding != null )
+ localVarHeaderParams.Add ("Accept-Encoding", Configuration.ApiClient.ParameterToString (acceptEncoding)); // header parameter
+
+ // authentication (oauth2_application) required
+ // oauth required
+ if ( !String.IsNullOrEmpty (Configuration.AccessToken) ) {
+ localVarHeaderParams ["Authorization"] = "Bearer " + Configuration.AccessToken;
+ }
+
+ // make the HTTP request
+ RestResponse localVarResponse = (RestResponse)Configuration.ApiClient.CallApi (localVarPath,
+ Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
+ localVarPathParams, localVarHttpContentType);
+
+ int localVarStatusCode = (int)localVarResponse.StatusCode;
+
+ if ( ExceptionFactory != null ) {
+ Exception exception = ExceptionFactory ("GetSignedResource", localVarResponse);
+ if ( exception != null )
+ throw exception;
+ }
+
+ return new ApiResponse*System.IO.Stream*/dynamic> (localVarStatusCode,
+ localVarResponse.Headers.ToDictionary (x => x.Name, x => x.Value.ToString ()),
+ /*(System.IO.Stream)*/ Configuration.ApiClient.Deserialize (localVarResponse, typeof (System.IO.Stream)));
+
+ }
+
+ ///
+ /// Download an object using a signed URL.
+ ///
+ /// Thrown when fails to make API call
+ /// Id of signed resource
+ /// A range of bytes to download from the specified object. (optional)
+ /// The value of this header is compared to the ETAG of the object. If they match, the body will not be included in the response. Only the object information will be included. (optional)
+ /// If the requested object has not been modified since the time specified in this field, an entity will not be returned from the server; instead, a 304 (not modified) response will be returned without any message body. (optional)
+ /// When gzip is specified, a gzip compressed stream of the object’s bytes will be returned in the response. Cannot use “Accept-Encoding:gzip” with Range header containing an end byte range. End byte range will not be honored if “Accept-Encoding: gzip” header is used. (optional)
+ /// The region where the bucket resides Acceptable values: `US`, `EMEA` Default is `US` (optional, default to US)
+ /// Task of System.IO.Stream
+ public async System.Threading.Tasks.Task*System.IO.Stream*/dynamic> GetSignedResourceAsync (string id, string range = null, string ifNoneMatch = null, DateTime? ifModifiedSince = null, string acceptEncoding = null, string region = null) {
+ ApiResponse*System.IO.Stream*/dynamic> localVarResponse = await GetSignedResourceAsyncWithHttpInfo (id, range, ifNoneMatch, ifModifiedSince, acceptEncoding, region);
+ return localVarResponse.Data;
+
+ }
+
+ ///
+ /// Download an object using a signed URL.
+ ///
+ /// Thrown when fails to make API call
+ /// Id of signed resource
+ /// A range of bytes to download from the specified object. (optional)
+ /// The value of this header is compared to the ETAG of the object. If they match, the body will not be included in the response. Only the object information will be included. (optional)
+ /// If the requested object has not been modified since the time specified in this field, an entity will not be returned from the server; instead, a 304 (not modified) response will be returned without any message body. (optional)
+ /// When gzip is specified, a gzip compressed stream of the object’s bytes will be returned in the response. Cannot use “Accept-Encoding:gzip” with Range header containing an end byte range. End byte range will not be honored if “Accept-Encoding: gzip” header is used. (optional)
+ /// The region where the bucket resides Acceptable values: `US`, `EMEA` Default is `US` (optional, default to US)
+ /// Task of ApiResponse (System.IO.Stream)
+ public async System.Threading.Tasks.Task> GetSignedResourceAsyncWithHttpInfo (string id, string range = null, string ifNoneMatch = null, DateTime? ifModifiedSince = null, string acceptEncoding = null, string region = null) {
+ // verify the required parameter 'id' is set
+ if ( id == null )
+ throw new ApiException (400, "Missing required parameter 'id' when calling ObjectsApi->GetSignedResource");
+
+ var localVarPath = "/oss/v2/signedresources/{id}";
+ var localVarPathParams = new Dictionary ();
+ var localVarQueryParams = new Dictionary ();
+ var localVarHeaderParams = new Dictionary (Configuration.DefaultHeader);
+ var localVarFormParams = new Dictionary ();
+ var localVarFileParams = new Dictionary ();
+ Object localVarPostBody = null;
+
+ // to determine the Content-Type header
+ String [] localVarHttpContentTypes = new String [] {
+ "application/json"
+ };
+ String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType (localVarHttpContentTypes);
+
+ // to determine the Accept header
+ String [] localVarHttpHeaderAccepts = new String [] {
+ "application/octet-stream"
+ };
+ String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept (localVarHttpHeaderAccepts);
+ if ( localVarHttpHeaderAccept != null )
+ localVarHeaderParams.Add ("Accept", localVarHttpHeaderAccept);
+
+ // set "format" to json by default
+ // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
+ localVarPathParams.Add ("format", "json");
+ if ( id != null )
+ localVarPathParams.Add ("id", Configuration.ApiClient.ParameterToString (id)); // path parameter
+ if ( region != null )
+ localVarQueryParams.Add ("region", Configuration.ApiClient.ParameterToString (region)); // query parameter
+ if ( range != null )
+ localVarHeaderParams.Add ("Range", Configuration.ApiClient.ParameterToString (range)); // header parameter
+ if ( ifNoneMatch != null )
+ localVarHeaderParams.Add ("If-None-Match", Configuration.ApiClient.ParameterToString (ifNoneMatch)); // header parameter
+ if ( ifModifiedSince != null )
+ localVarHeaderParams.Add ("If-Modified-Since", Configuration.ApiClient.ParameterToString (ifModifiedSince)); // header parameter
+ if ( acceptEncoding != null )
+ localVarHeaderParams.Add ("Accept-Encoding", Configuration.ApiClient.ParameterToString (acceptEncoding)); // header parameter
+
+ // authentication (oauth2_application) required
+ // oauth required
+ if ( !String.IsNullOrEmpty (Configuration.AccessToken) ) {
+ localVarHeaderParams ["Authorization"] = "Bearer " + Configuration.AccessToken;
+ }
+
+ // make the HTTP request
+ RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync (localVarPath,
+ Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
+ localVarPathParams, localVarHttpContentType);
+
+ int localVarStatusCode = (int)localVarResponse.StatusCode;
+
+ if ( ExceptionFactory != null ) {
+ Exception exception = ExceptionFactory ("GetSignedResource", localVarResponse);
+ if ( exception != null )
+ throw exception;
+ }
+
+ return new ApiResponse*System.IO.Stream*/dynamic> (localVarStatusCode,
+ localVarResponse.Headers.ToDictionary (x => x.Name, x => x.Value.ToString ()),
+ /*(System.IO.Stream)*/ Configuration.ApiClient.Deserialize (localVarResponse, typeof (System.IO.Stream)));
+
+ }
+
+ ///
+ /// This endpoint returns status information about a resumable upload.
+ ///
+ /// Thrown when fails to make API call
+ /// URL-encoded bucket key
+ /// URL-encoded object name
+ /// Unique identifier of a session of a file being uploaded
+ ///
+ public void GetStatusBySessionId (string bucketKey, string objectName, string sessionId) {
+ GetStatusBySessionIdWithHttpInfo (bucketKey, objectName, sessionId);
+ }
+
+ ///
+ /// This endpoint returns status information about a resumable upload.
+ ///
+ /// Thrown when fails to make API call
+ /// URL-encoded bucket key
+ /// URL-encoded object name
+ /// Unique identifier of a session of a file being uploaded
+ /// ApiResponse of Object(void)
+ public ApiResponse GetStatusBySessionIdWithHttpInfo (string bucketKey, string objectName, string sessionId) {
+ // verify the required parameter 'bucketKey' is set
+ if ( bucketKey == null )
+ throw new ApiException (400, "Missing required parameter 'bucketKey' when calling ObjectsApi->GetStatusBySessionId");
+ // verify the required parameter 'objectName' is set
+ if ( objectName == null )
+ throw new ApiException (400, "Missing required parameter 'objectName' when calling ObjectsApi->GetStatusBySessionId");
+ // verify the required parameter 'sessionId' is set
+ if ( sessionId == null )
+ throw new ApiException (400, "Missing required parameter 'sessionId' when calling ObjectsApi->GetStatusBySessionId");
+
+ var localVarPath = "/oss/v2/buckets/{bucketKey}/objects/{objectName}/status/{sessionId}";
+ var localVarPathParams = new Dictionary ();
+ var localVarQueryParams = new Dictionary ();
+ var localVarHeaderParams = new Dictionary (Configuration.DefaultHeader);
+ var localVarFormParams = new Dictionary ();
+ var localVarFileParams = new Dictionary ();
+ Object localVarPostBody = null;
+
+ // to determine the Content-Type header
+ String [] localVarHttpContentTypes = new String [] {
+ "application/json"
+ };
+ String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType (localVarHttpContentTypes);
+
+ // to determine the Accept header
+ String [] localVarHttpHeaderAccepts = new String [] {
+ "application/vnd.api+json",
+ "application/json"
+ };
+ String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept (localVarHttpHeaderAccepts);
+ if ( localVarHttpHeaderAccept != null )
+ localVarHeaderParams.Add ("Accept", localVarHttpHeaderAccept);
+
+ // set "format" to json by default
+ // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
+ localVarPathParams.Add ("format", "json");
+ if ( bucketKey != null )
+ localVarPathParams.Add ("bucketKey", Configuration.ApiClient.ParameterToString (bucketKey)); // path parameter
+ if ( objectName != null )
+ localVarPathParams.Add ("objectName", Configuration.ApiClient.ParameterToString (objectName)); // path parameter
+ if ( sessionId != null )
+ localVarPathParams.Add ("sessionId", Configuration.ApiClient.ParameterToString (sessionId)); // path parameter
+
+ // authentication (oauth2_application) required
+ // oauth required
+ if ( !String.IsNullOrEmpty (Configuration.AccessToken) ) {
+ localVarHeaderParams ["Authorization"] = "Bearer " + Configuration.AccessToken;
+ }
+
+ // make the HTTP request
+ RestResponse localVarResponse = (RestResponse)Configuration.ApiClient.CallApi (localVarPath,
+ Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
+ localVarPathParams, localVarHttpContentType);
+
+ int localVarStatusCode = (int)localVarResponse.StatusCode;
+
+ if ( ExceptionFactory != null ) {
+ Exception exception = ExceptionFactory ("GetStatusBySessionId", localVarResponse);
+ if ( exception != null )
+ throw exception;
+ }
+
+
+ return new ApiResponse (localVarStatusCode,
+ localVarResponse.Headers.ToDictionary (x => x.Name, x => x.Value.ToString ()),
+ null);
+ }
+
+ ///
+ /// This endpoint returns status information about a resumable upload.
+ ///
+ /// Thrown when fails to make API call
+ /// URL-encoded bucket key
+ /// URL-encoded object name
+ /// Unique identifier of a session of a file being uploaded
+ /// Task of void
+ public async System.Threading.Tasks.Task GetStatusBySessionIdAsync (string bucketKey, string objectName, string sessionId) {
+ await GetStatusBySessionIdAsyncWithHttpInfo (bucketKey, objectName, sessionId);
+
+ }
+
+ ///
+ /// This endpoint returns status information about a resumable upload.
+ ///
+ /// Thrown when fails to make API call
+ /// URL-encoded bucket key
+ /// URL-encoded object name
+ /// Unique identifier of a session of a file being uploaded
+ /// Task of ApiResponse
+ public async System.Threading.Tasks.Task> GetStatusBySessionIdAsyncWithHttpInfo (string bucketKey, string objectName, string sessionId) {
+ // verify the required parameter 'bucketKey' is set
+ if ( bucketKey == null )
+ throw new ApiException (400, "Missing required parameter 'bucketKey' when calling ObjectsApi->GetStatusBySessionId");
+ // verify the required parameter 'objectName' is set
+ if ( objectName == null )
+ throw new ApiException (400, "Missing required parameter 'objectName' when calling ObjectsApi->GetStatusBySessionId");
+ // verify the required parameter 'sessionId' is set
+ if ( sessionId == null )
+ throw new ApiException (400, "Missing required parameter 'sessionId' when calling ObjectsApi->GetStatusBySessionId");
+
+ var localVarPath = "/oss/v2/buckets/{bucketKey}/objects/{objectName}/status/{sessionId}";
+ var localVarPathParams = new Dictionary ();
+ var localVarQueryParams = new Dictionary ();
+ var localVarHeaderParams = new Dictionary (Configuration.DefaultHeader);
+ var localVarFormParams = new Dictionary ();
+ var localVarFileParams = new Dictionary ();
+ Object localVarPostBody = null;
+
+ // to determine the Content-Type header
+ String [] localVarHttpContentTypes = new String [] {
+ "application/json"
+ };
+ String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType (localVarHttpContentTypes);
+
+ // to determine the Accept header
+ String [] localVarHttpHeaderAccepts = new String [] {
+ "application/vnd.api+json",
+ "application/json"
+ };
+ String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept (localVarHttpHeaderAccepts);
+ if ( localVarHttpHeaderAccept != null )
+ localVarHeaderParams.Add ("Accept", localVarHttpHeaderAccept);
+
+ // set "format" to json by default
+ // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
+ localVarPathParams.Add ("format", "json");
+ if ( bucketKey != null )
+ localVarPathParams.Add ("bucketKey", Configuration.ApiClient.ParameterToString (bucketKey)); // path parameter
+ if ( objectName != null )
+ localVarPathParams.Add ("objectName", Configuration.ApiClient.ParameterToString (objectName)); // path parameter
+ if ( sessionId != null )
+ localVarPathParams.Add ("sessionId", Configuration.ApiClient.ParameterToString (sessionId)); // path parameter
+
+ // authentication (oauth2_application) required
+ // oauth required
+ if ( !String.IsNullOrEmpty (Configuration.AccessToken) ) {
+ localVarHeaderParams ["Authorization"] = "Bearer " + Configuration.AccessToken;
+ }
+
+ // make the HTTP request
+ RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync (localVarPath,
+ Method.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
+ localVarPathParams, localVarHttpContentType);
+
+ int localVarStatusCode = (int)localVarResponse.StatusCode;
+
+ if ( ExceptionFactory != null ) {
+ Exception exception = ExceptionFactory ("GetStatusBySessionId", localVarResponse);
+ if ( exception != null )
+ throw exception;
+ }
+
+
+ return new ApiResponse (localVarStatusCode,
+ localVarResponse.Headers.ToDictionary (x => x.Name, x => x.Value.ToString ()),
+ null);
+ }
+
+ ///
+ /// This endpoint allows resumable uploads for large files in chunks.
+ ///
+ /// Thrown when fails to make API call
+ /// URL-encoded bucket key
+ /// URL-encoded object name
+ /// Indicates the size of the request body.
+ /// Byte range of a segment being uploaded
+ /// Unique identifier of a session of a file being uploaded
+ ///
+ /// The suggested default filename when downloading this object to a file after it has been uploaded. (optional)
+ /// If-Match header containing a SHA-1 hash of the bytes in the request body can be sent by the calling service or client application with the request. If present, OSS will use the value of If-Match header to verify that a SHA-1 calculated for the uploaded bytes server side matches what was sent in the header. If not, the request is failed with a status 412 Precondition Failed and the data is not written. (optional)
+ /// ObjectDetails
+ public /*ObjectDetails*/dynamic UploadChunk (string bucketKey, string objectName, int? contentLength, string contentRange, string sessionId, System.IO.Stream body, string contentDisposition = null, string ifMatch = null, string contentType = "application/octet-stream") {
+ ApiResponse*ObjectDetails*/dynamic> localVarResponse = UploadChunkWithHttpInfo (bucketKey, objectName, contentLength, contentRange, sessionId, body, contentDisposition, ifMatch, contentType);
+ return localVarResponse.Data;
+ }
+
+ ///
+ /// This endpoint allows resumable uploads for large files in chunks.
+ ///
+ /// Thrown when fails to make API call
+ /// URL-encoded bucket key
+ /// URL-encoded object name
+ /// Indicates the size of the request body.
+ /// Byte range of a segment being uploaded
+ /// Unique identifier of a session of a file being uploaded
+ ///
+ /// The suggested default filename when downloading this object to a file after it has been uploaded. (optional)
+ /// If-Match header containing a SHA-1 hash of the bytes in the request body can be sent by the calling service or client application with the request. If present, OSS will use the value of If-Match header to verify that a SHA-1 calculated for the uploaded bytes server side matches what was sent in the header. If not, the request is failed with a status 412 Precondition Failed and the data is not written. (optional)
+ /// ApiResponse of ObjectDetails
+ public ApiResponse< /*ObjectDetails*/dynamic> UploadChunkWithHttpInfo (string bucketKey, string objectName, int? contentLength, string contentRange, string sessionId, System.IO.Stream body, string contentDisposition = null, string ifMatch = null, string contentType = "application/octet-stream") {
+ // verify the required parameter 'bucketKey' is set
+ if ( bucketKey == null )
+ throw new ApiException (400, "Missing required parameter 'bucketKey' when calling ObjectsApi->UploadChunk");
+ // verify the required parameter 'objectName' is set
+ if ( objectName == null )
+ throw new ApiException (400, "Missing required parameter 'objectName' when calling ObjectsApi->UploadChunk");
+ // verify the required parameter 'contentLength' is set
+ if ( contentLength == null )
+ throw new ApiException (400, "Missing required parameter 'contentLength' when calling ObjectsApi->UploadChunk");
+ // verify the required parameter 'contentRange' is set
+ if ( contentRange == null )
+ throw new ApiException (400, "Missing required parameter 'contentRange' when calling ObjectsApi->UploadChunk");
+ // verify the required parameter 'sessionId' is set
+ if ( sessionId == null )
+ throw new ApiException (400, "Missing required parameter 'sessionId' when calling ObjectsApi->UploadChunk");
+ // verify the required parameter 'body' is set
+ if ( body == null )
+ throw new ApiException (400, "Missing required parameter 'body' when calling ObjectsApi->UploadChunk");
+
+ var localVarPath = "/oss/v2/buckets/{bucketKey}/objects/{objectName}/resumable";
+ var localVarPathParams = new Dictionary ();
+ var localVarQueryParams = new Dictionary ();
+ var localVarHeaderParams = new Dictionary (Configuration.DefaultHeader);
+ var localVarFormParams = new Dictionary ();
+ var localVarFileParams = new Dictionary ();
+ Object localVarPostBody = null;
+
+ // to determine the Content-Type header
+ String [] localVarHttpContentTypes = new String [] {
+ contentType
+ };
+ String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType (localVarHttpContentTypes);
+
+ // to determine the Accept header
+ String [] localVarHttpHeaderAccepts = new String [] {
+ "application/vnd.api+json",
+ "application/json"
+ };
+ String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept (localVarHttpHeaderAccepts);
+ if ( localVarHttpHeaderAccept != null )
+ localVarHeaderParams.Add ("Accept", localVarHttpHeaderAccept);
+
+ // set "format" to json by default
+ // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
+ localVarPathParams.Add ("format", "json");
+ if ( bucketKey != null )
+ localVarPathParams.Add ("bucketKey", Configuration.ApiClient.ParameterToString (bucketKey)); // path parameter
+ if ( objectName != null )
+ localVarPathParams.Add ("objectName", Configuration.ApiClient.ParameterToString (objectName)); // path parameter
+ if ( contentLength != null )
+ localVarHeaderParams.Add ("Content-Length", Configuration.ApiClient.ParameterToString (contentLength)); // header parameter
+ if ( contentRange != null )
+ localVarHeaderParams.Add ("Content-Range", Configuration.ApiClient.ParameterToString (contentRange)); // header parameter
+ if ( contentDisposition != null )
+ localVarHeaderParams.Add ("Content-Disposition", Configuration.ApiClient.ParameterToString (contentDisposition)); // header parameter
+ if ( ifMatch != null )
+ localVarHeaderParams.Add ("If-Match", Configuration.ApiClient.ParameterToString (ifMatch)); // header parameter
+ if ( sessionId != null )
+ localVarHeaderParams.Add ("Session-Id", Configuration.ApiClient.ParameterToString (sessionId)); // header parameter
+ if ( body != null && body.GetType () == typeof (byte []) ) // http body (model) parameter
+ {
+ localVarPostBody = body; // byte array
+ } else if ( body != null
+ && (body.GetType () == typeof (System.IO.FileStream)
+ || body.GetType () == typeof (System.IO.BinaryReader)
+ || body.GetType () == typeof (System.IO.BufferedStream)
+ || body.GetType () == typeof (System.IO.MemoryStream)
+ || body.GetType () == typeof (System.IO.StreamReader)
+ )
+ ) {
+ localVarPostBody = Configuration.ApiClient.toByteArray (body); // byte array
+ } else if ( body != null ) {
+ localVarPostBody = Configuration.ApiClient.Serialize (body);
+ }
+
+ // authentication (oauth2_application) required
+ // oauth required
+ if ( !String.IsNullOrEmpty (Configuration.AccessToken) ) {
+ localVarHeaderParams ["Authorization"] = "Bearer " + Configuration.AccessToken;
+ }
+
+ // make the HTTP request
+ RestResponse localVarResponse = (RestResponse)Configuration.ApiClient.CallApi (localVarPath,
+ Method.Put, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
+ localVarPathParams, localVarHttpContentType);
+
+ int localVarStatusCode = (int)localVarResponse.StatusCode;
+
+ if ( ExceptionFactory != null ) {
+ Exception exception = ExceptionFactory ("UploadChunk", localVarResponse);
+ if ( exception != null )
+ throw exception;
+ }
+
+ return new ApiResponse*ObjectDetails*/dynamic> (localVarStatusCode,
+ localVarResponse.Headers.ToDictionary (x => x.Name, x => x.Value.ToString ()),
+ /*(ObjectDetails)*/ Configuration.ApiClient.Deserialize (localVarResponse, typeof (ObjectDetails)));
+
+ }
+
+ ///
+ /// This endpoint allows resumable uploads for large files in chunks.
+ ///
+ /// Thrown when fails to make API call
+ /// URL-encoded bucket key
+ /// URL-encoded object name
+ /// Indicates the size of the request body.
+ /// Byte range of a segment being uploaded
+ /// Unique identifier of a session of a file being uploaded
+ ///
+ /// The suggested default filename when downloading this object to a file after it has been uploaded. (optional)
+ /// If-Match header containing a SHA-1 hash of the bytes in the request body can be sent by the calling service or client application with the request. If present, OSS will use the value of If-Match header to verify that a SHA-1 calculated for the uploaded bytes server side matches what was sent in the header. If not, the request is failed with a status 412 Precondition Failed and the data is not written. (optional)
+ /// Task of ObjectDetails
+ public async System.Threading.Tasks.Task*ObjectDetails*/dynamic> UploadChunkAsync (string bucketKey, string objectName, int? contentLength, string contentRange, string sessionId, System.IO.Stream body, string contentDisposition = null, string ifMatch = null, string contentType = "application/octet-stream") {
+ ApiResponse*ObjectDetails*/dynamic> localVarResponse = await UploadChunkAsyncWithHttpInfo (bucketKey, objectName, contentLength, contentRange, sessionId, body, contentDisposition, ifMatch, contentType);
+ return localVarResponse.Data;
+
+ }
+
+ ///
+ /// This endpoint allows resumable uploads for large files in chunks.
+ ///
+ /// Thrown when fails to make API call
+ /// URL-encoded bucket key
+ /// URL-encoded object name
+ /// Indicates the size of the request body.
+ /// Byte range of a segment being uploaded
+ /// Unique identifier of a session of a file being uploaded
+ ///
+ /// The suggested default filename when downloading this object to a file after it has been uploaded. (optional)
+ /// If-Match header containing a SHA-1 hash of the bytes in the request body can be sent by the calling service or client application with the request. If present, OSS will use the value of If-Match header to verify that a SHA-1 calculated for the uploaded bytes server side matches what was sent in the header. If not, the request is failed with a status 412 Precondition Failed and the data is not written. (optional)
+ /// Task of ApiResponse (ObjectDetails)
+ public async System.Threading.Tasks.Task> UploadChunkAsyncWithHttpInfo (string bucketKey, string objectName, int? contentLength, string contentRange, string sessionId, System.IO.Stream body, string contentDisposition = null, string ifMatch = null, string contentType = "application/octet-stream") {
+ // verify the required parameter 'bucketKey' is set
+ if ( bucketKey == null )
+ throw new ApiException (400, "Missing required parameter 'bucketKey' when calling ObjectsApi->UploadChunk");
+ // verify the required parameter 'objectName' is set
+ if ( objectName == null )
+ throw new ApiException (400, "Missing required parameter 'objectName' when calling ObjectsApi->UploadChunk");
+ // verify the required parameter 'contentLength' is set
+ if ( contentLength == null )
+ throw new ApiException (400, "Missing required parameter 'contentLength' when calling ObjectsApi->UploadChunk");
+ // verify the required parameter 'contentRange' is set
+ if ( contentRange == null )
+ throw new ApiException (400, "Missing required parameter 'contentRange' when calling ObjectsApi->UploadChunk");
+ // verify the required parameter 'sessionId' is set
+ if ( sessionId == null )
+ throw new ApiException (400, "Missing required parameter 'sessionId' when calling ObjectsApi->UploadChunk");
+ // verify the required parameter 'body' is set
+ if ( body == null )
+ throw new ApiException (400, "Missing required parameter 'body' when calling ObjectsApi->UploadChunk");
+
+ var localVarPath = "/oss/v2/buckets/{bucketKey}/objects/{objectName}/resumable";
+ var localVarPathParams = new Dictionary ();
+ var localVarQueryParams = new Dictionary ();
+ var localVarHeaderParams = new Dictionary (Configuration.DefaultHeader);
+ var localVarFormParams = new Dictionary ();
+ var localVarFileParams = new Dictionary ();
+ Object localVarPostBody = null;
+
+ // to determine the Content-Type header
+ String [] localVarHttpContentTypes = new String [] {
+ contentType
+ };
+ String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType (localVarHttpContentTypes);
+
+ // to determine the Accept header
+ String [] localVarHttpHeaderAccepts = new String [] {
+ "application/vnd.api+json",
+ "application/json"
+ };
+ String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept (localVarHttpHeaderAccepts);
+ if ( localVarHttpHeaderAccept != null )
+ localVarHeaderParams.Add ("Accept", localVarHttpHeaderAccept);
+
+ // set "format" to json by default
+ // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
+ localVarPathParams.Add ("format", "json");
+ if ( bucketKey != null )
+ localVarPathParams.Add ("bucketKey", Configuration.ApiClient.ParameterToString (bucketKey)); // path parameter
+ if ( objectName != null )
+ localVarPathParams.Add ("objectName", Configuration.ApiClient.ParameterToString (objectName)); // path parameter
+ if ( contentLength != null )
+ localVarHeaderParams.Add ("Content-Length", Configuration.ApiClient.ParameterToString (contentLength)); // header parameter
+ if ( contentRange != null )
+ localVarHeaderParams.Add ("Content-Range", Configuration.ApiClient.ParameterToString (contentRange)); // header parameter
+ if ( contentDisposition != null )
+ localVarHeaderParams.Add ("Content-Disposition", Configuration.ApiClient.ParameterToString (contentDisposition)); // header parameter
+ if ( ifMatch != null )
+ localVarHeaderParams.Add ("If-Match", Configuration.ApiClient.ParameterToString (ifMatch)); // header parameter
+ if ( sessionId != null )
+ localVarHeaderParams.Add ("Session-Id", Configuration.ApiClient.ParameterToString (sessionId)); // header parameter
+ if ( body != null && body.GetType () == typeof (byte []) ) // http body (model) parameter
+ {
+ localVarPostBody = body; // byte array
+ } else if ( body != null
+ && (body.GetType () == typeof (System.IO.FileStream)
+ || body.GetType () == typeof (System.IO.BinaryReader)
+ || body.GetType () == typeof (System.IO.BufferedStream)
+ || body.GetType () == typeof (System.IO.MemoryStream)
+ || body.GetType () == typeof (System.IO.StreamReader)
+ )
+ ) {
+ localVarPostBody = Configuration.ApiClient.toByteArray (body); // byte array
+ } else if ( body != null ) {
+ localVarPostBody = Configuration.ApiClient.Serialize (body);
+ }
+
+ // authentication (oauth2_application) required
+ // oauth required
+ if ( !String.IsNullOrEmpty (Configuration.AccessToken) ) {
+ localVarHeaderParams ["Authorization"] = "Bearer " + Configuration.AccessToken;
+ }
+
+ // make the HTTP request
+ RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync (localVarPath,
+ Method.Put, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
+ localVarPathParams, localVarHttpContentType);
+
+ int localVarStatusCode = (int)localVarResponse.StatusCode;
+
+ if ( ExceptionFactory != null ) {
+ Exception exception = ExceptionFactory ("UploadChunk", localVarResponse);
+ if ( exception != null )
+ throw exception;
+ }
+
+ return new ApiResponse*ObjectDetails*/dynamic> (localVarStatusCode,
+ localVarResponse.Headers.ToDictionary (x => x.Name, x => x.Value.ToString ()),
+ /*(ObjectDetails)*/ Configuration.ApiClient.Deserialize (localVarResponse, typeof (ObjectDetails)));
+
+ }
+
+ ///
+ /// Upload an object. If the specified object name already exists in the bucket, the uploaded content will overwrite the existing content for the bucket name/object name combination.
+ ///
+ /// Thrown when fails to make API call
+ /// URL-encoded bucket key
+ /// URL-encoded object name
+ /// Indicates the size of the request body.
+ ///
+ /// The suggested default filename when downloading this object to a file after it has been uploaded. (optional)
+ /// If-Match header containing a SHA-1 hash of the bytes in the request body can be sent by the calling service or client application with the request. If present, OSS will use the value of If-Match header to verify that a SHA-1 calculated for the uploaded bytes server side matches what was sent in the header. If not, the request is failed with a status 412 Precondition Failed and the data is not written. (optional)
+ /// ObjectDetails
+ public /*ObjectDetails*/dynamic UploadObject (string bucketKey, string objectName, int? contentLength, System.IO.Stream body, string contentDisposition = null, string ifMatch = null, string contentType = "application/octet-stream") {
+ ApiResponse*ObjectDetails*/dynamic> localVarResponse = UploadObjectWithHttpInfo (bucketKey, objectName, contentLength, body, contentDisposition, ifMatch, contentType);
+ return localVarResponse.Data;
+ }
+
+ ///
+ /// Upload an object. If the specified object name already exists in the bucket, the uploaded content will overwrite the existing content for the bucket name/object name combination.
+ ///
+ /// Thrown when fails to make API call
+ /// URL-encoded bucket key
+ /// URL-encoded object name
+ /// Indicates the size of the request body.
+ ///
+ /// The suggested default filename when downloading this object to a file after it has been uploaded. (optional)
+ /// If-Match header containing a SHA-1 hash of the bytes in the request body can be sent by the calling service or client application with the request. If present, OSS will use the value of If-Match header to verify that a SHA-1 calculated for the uploaded bytes server side matches what was sent in the header. If not, the request is failed with a status 412 Precondition Failed and the data is not written. (optional)
+ /// ApiResponse of ObjectDetails
+ public ApiResponse< /*ObjectDetails*/dynamic> UploadObjectWithHttpInfo (string bucketKey, string objectName, int? contentLength, System.IO.Stream body, string contentDisposition = null, string ifMatch = null, string contentType = "application/octet-stream") {
+ // verify the required parameter 'bucketKey' is set
+ if ( bucketKey == null )
+ throw new ApiException (400, "Missing required parameter 'bucketKey' when calling ObjectsApi->UploadObject");
+ // verify the required parameter 'objectName' is set
+ if ( objectName == null )
+ throw new ApiException (400, "Missing required parameter 'objectName' when calling ObjectsApi->UploadObject");
+ // verify the required parameter 'contentLength' is set
+ if ( contentLength == null )
+ throw new ApiException (400, "Missing required parameter 'contentLength' when calling ObjectsApi->UploadObject");
+ // verify the required parameter 'body' is set
+ if ( body == null )
+ throw new ApiException (400, "Missing required parameter 'body' when calling ObjectsApi->UploadObject");
+
+ var localVarPath = "/oss/v2/buckets/{bucketKey}/objects/{objectName}";
+ var localVarPathParams = new Dictionary ();
+ var localVarQueryParams = new Dictionary ();
+ var localVarHeaderParams = new Dictionary (Configuration.DefaultHeader);
+ var localVarFormParams = new Dictionary ();
+ var localVarFileParams = new Dictionary ();
+ Object localVarPostBody = null;
+
+ // to determine the Content-Type header
+ String [] localVarHttpContentTypes = new String [] {
+ contentType
+ };
+ String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType (localVarHttpContentTypes);
+
+ // to determine the Accept header
+ String [] localVarHttpHeaderAccepts = new String [] {
+ "application/vnd.api+json",
+ "application/json"
+ };
+ String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept (localVarHttpHeaderAccepts);
+ if ( localVarHttpHeaderAccept != null )
+ localVarHeaderParams.Add ("Accept", localVarHttpHeaderAccept);
+
+ // set "format" to json by default
+ // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
+ localVarPathParams.Add ("format", "json");
+ if ( bucketKey != null )
+ localVarPathParams.Add ("bucketKey", Configuration.ApiClient.ParameterToString (bucketKey)); // path parameter
+ if ( objectName != null )
+ localVarPathParams.Add ("objectName", Configuration.ApiClient.ParameterToString (objectName)); // path parameter
+ if ( contentLength != null )
+ localVarHeaderParams.Add ("Content-Length", Configuration.ApiClient.ParameterToString (contentLength)); // header parameter
+ if ( contentDisposition != null )
+ localVarHeaderParams.Add ("Content-Disposition", Configuration.ApiClient.ParameterToString (contentDisposition)); // header parameter
+ if ( ifMatch != null )
+ localVarHeaderParams.Add ("If-Match", Configuration.ApiClient.ParameterToString (ifMatch)); // header parameter
+ if ( body != null && body.GetType () == typeof (byte []) ) // http body (model) parameter
+ {
+ localVarPostBody = body; // byte array
+ } else if ( body != null
+ && (body.GetType () == typeof (System.IO.FileStream)
+ || body.GetType () == typeof (System.IO.BinaryReader)
+ || body.GetType () == typeof (System.IO.BufferedStream)
+ || body.GetType () == typeof (System.IO.MemoryStream)
+ || body.GetType () == typeof (System.IO.StreamReader)
+ )
+ ) {
+ localVarPostBody = Configuration.ApiClient.toByteArray (body); // byte array
+ } else if ( body != null ) {
+ localVarPostBody = Configuration.ApiClient.Serialize (body);
+ }
+
+ // authentication (oauth2_application) required
+ // oauth required
+ if ( !String.IsNullOrEmpty (Configuration.AccessToken) ) {
+ localVarHeaderParams ["Authorization"] = "Bearer " + Configuration.AccessToken;
+ }
+
+ // make the HTTP request
+ RestResponse localVarResponse = (RestResponse)Configuration.ApiClient.CallApi (localVarPath,
+ Method.Put, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
+ localVarPathParams, localVarHttpContentType);
+
+ int localVarStatusCode = (int)localVarResponse.StatusCode;
+
+ if ( ExceptionFactory != null ) {
+ Exception exception = ExceptionFactory ("UploadObject", localVarResponse);
+ if ( exception != null )
+ throw exception;
+ }
+
+ return new ApiResponse*ObjectDetails*/dynamic> (localVarStatusCode,
+ localVarResponse.Headers.ToDictionary (x => x.Name, x => x.Value.ToString ()),
+ /*(ObjectDetails)*/ Configuration.ApiClient.Deserialize (localVarResponse, typeof (ObjectDetails)));
+
+ }
+
+ ///
+ /// Upload an object. If the specified object name already exists in the bucket, the uploaded content will overwrite the existing content for the bucket name/object name combination.
+ ///
+ /// Thrown when fails to make API call
+ /// URL-encoded bucket key
+ /// URL-encoded object name
+ /// Indicates the size of the request body.
+ ///
+ /// The suggested default filename when downloading this object to a file after it has been uploaded. (optional)
+ /// If-Match header containing a SHA-1 hash of the bytes in the request body can be sent by the calling service or client application with the request. If present, OSS will use the value of If-Match header to verify that a SHA-1 calculated for the uploaded bytes server side matches what was sent in the header. If not, the request is failed with a status 412 Precondition Failed and the data is not written. (optional)
+ /// Task of ObjectDetails
+ public async System.Threading.Tasks.Task*ObjectDetails*/dynamic> UploadObjectAsync (string bucketKey, string objectName, int? contentLength, System.IO.Stream body, string contentDisposition = null, string ifMatch = null, string contentType = "application/octet-stream") {
+ ApiResponse*ObjectDetails*/dynamic> localVarResponse = await UploadObjectAsyncWithHttpInfo (bucketKey, objectName, contentLength, body, contentDisposition, ifMatch, contentType);
+ return localVarResponse.Data;
+
+ }
+
+ ///
+ /// Upload an object. If the specified object name already exists in the bucket, the uploaded content will overwrite the existing content for the bucket name/object name combination.
+ ///
+ /// Thrown when fails to make API call
+ /// URL-encoded bucket key
+ /// URL-encoded object name
+ /// Indicates the size of the request body.
+ ///
+ /// The suggested default filename when downloading this object to a file after it has been uploaded. (optional)
+ /// If-Match header containing a SHA-1 hash of the bytes in the request body can be sent by the calling service or client application with the request. If present, OSS will use the value of If-Match header to verify that a SHA-1 calculated for the uploaded bytes server side matches what was sent in the header. If not, the request is failed with a status 412 Precondition Failed and the data is not written. (optional)
+ /// Task of ApiResponse (ObjectDetails)
+ public async System.Threading.Tasks.Task> UploadObjectAsyncWithHttpInfo (string bucketKey, string objectName, int? contentLength, System.IO.Stream body, string contentDisposition = null, string ifMatch = null, string contentType = "application/octet-stream") {
+ // verify the required parameter 'bucketKey' is set
+ if ( bucketKey == null )
+ throw new ApiException (400, "Missing required parameter 'bucketKey' when calling ObjectsApi->UploadObject");
+ // verify the required parameter 'objectName' is set
+ if ( objectName == null )
+ throw new ApiException (400, "Missing required parameter 'objectName' when calling ObjectsApi->UploadObject");
+ // verify the required parameter 'contentLength' is set
+ if ( contentLength == null )
+ throw new ApiException (400, "Missing required parameter 'contentLength' when calling ObjectsApi->UploadObject");
+ // verify the required parameter 'body' is set
+ if ( body == null )
+ throw new ApiException (400, "Missing required parameter 'body' when calling ObjectsApi->UploadObject");
+
+ var localVarPath = "/oss/v2/buckets/{bucketKey}/objects/{objectName}";
+ var localVarPathParams = new Dictionary ();
+ var localVarQueryParams = new Dictionary ();
+ var localVarHeaderParams = new Dictionary (Configuration.DefaultHeader);
+ var localVarFormParams = new Dictionary ();
+ var localVarFileParams = new Dictionary ();
+ Object localVarPostBody = null;
+
+ // to determine the Content-Type header
+ String [] localVarHttpContentTypes = new String [] {
+ contentType
+ };
+ String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType (localVarHttpContentTypes);
+
+ // to determine the Accept header
+ String [] localVarHttpHeaderAccepts = new String [] {
+ "application/vnd.api+json",
+ "application/json"
+ };
+ String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept (localVarHttpHeaderAccepts);
+ if ( localVarHttpHeaderAccept != null )
+ localVarHeaderParams.Add ("Accept", localVarHttpHeaderAccept);
+
+ // set "format" to json by default
+ // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
+ localVarPathParams.Add ("format", "json");
+ if ( bucketKey != null )
+ localVarPathParams.Add ("bucketKey", Configuration.ApiClient.ParameterToString (bucketKey)); // path parameter
+ if ( objectName != null )
+ localVarPathParams.Add ("objectName", Configuration.ApiClient.ParameterToString (objectName)); // path parameter
+ if ( contentLength != null )
+ localVarHeaderParams.Add ("Content-Length", Configuration.ApiClient.ParameterToString (contentLength)); // header parameter
+ if ( contentDisposition != null )
+ localVarHeaderParams.Add ("Content-Disposition", Configuration.ApiClient.ParameterToString (contentDisposition)); // header parameter
+ if ( ifMatch != null )
+ localVarHeaderParams.Add ("If-Match", Configuration.ApiClient.ParameterToString (ifMatch)); // header parameter
+ if ( body != null && body.GetType () == typeof (byte []) ) // http body (model) parameter
+ {
+ localVarPostBody = body; // byte array
+ } else if ( body != null
+ && (body.GetType () == typeof (System.IO.FileStream)
+ || body.GetType () == typeof (System.IO.BinaryReader)
+ || body.GetType () == typeof (System.IO.BufferedStream)
+ || body.GetType () == typeof (System.IO.MemoryStream)
+ || body.GetType () == typeof (System.IO.StreamReader)
+ )
+ ) {
+ localVarPostBody = Configuration.ApiClient.toByteArray (body); // byte array
+ } else if ( body != null ) {
+ localVarPostBody = Configuration.ApiClient.Serialize (body);
+ }
+
+ // authentication (oauth2_application) required
+ // oauth required
+ if ( !String.IsNullOrEmpty (Configuration.AccessToken) ) {
+ localVarHeaderParams ["Authorization"] = "Bearer " + Configuration.AccessToken;
+ }
+
+ // make the HTTP request
+ RestResponse localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync (localVarPath,
+ Method.Put, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
+ localVarPathParams, localVarHttpContentType);
+
+ int localVarStatusCode = (int)localVarResponse.StatusCode;
+
+ if ( ExceptionFactory != null ) {
+ Exception exception = ExceptionFactory ("UploadObject", localVarResponse);
+ if ( exception != null )
+ throw exception;
+ }
+
+ return new ApiResponse*ObjectDetails*/dynamic> (localVarStatusCode,
+ localVarResponse.Headers.ToDictionary (x => x.Name, x => x.Value.ToString ()),
+ /*(ObjectDetails)*/ Configuration.ApiClient.Deserialize (localVarResponse, typeof (ObjectDetails)));
+
+ }
+
+ ///
+ /// Overwrite a existing object using a signed URL. Conditions to call this operation: Object is available Expiration period is valid Signed URL should be created with `write` or `readwrite`
+ ///
+ /// Thrown when fails to make API call
+ /// Id of signed resource
+ /// Indicates the size of the request body.
+ ///
+ /// The suggested default filename when downloading this object to a file after it has been uploaded. (optional)
+ /// The region where the bucket resides Acceptable values: `US`, `EMEA` Default is `US` (optional, default to US)
+ /// If-Match header containing a SHA-1 hash of the bytes in the request body can be sent by the calling service or client application with the request. If present, OSS will use the value of If-Match header to verify that a SHA-1 calculated for the uploaded bytes server side matches what was sent in the header. If not, the request is failed with a status 412 Precondition Failed and the data is not written. (optional)
+ /// ObjectDetails
+ public /*ObjectDetails*/dynamic UploadSignedResource (string id, int? contentLength, System.IO.Stream body, string contentDisposition = null, string xAdsRegion = null, string ifMatch = null, string contentType = "application/octet-stream") {
+ ApiResponse*ObjectDetails*/dynamic> localVarResponse = UploadSignedResourceWithHttpInfo (id, contentLength, body, contentDisposition, xAdsRegion, ifMatch, contentType);
+ return localVarResponse.Data;
+ }
+
+ ///
+ /// Overwrite a existing object using a signed URL. Conditions to call this operation: Object is available Expiration period is valid Signed URL should be created with `write` or `readwrite`
+ ///
+ /// Thrown when fails to make API call
+ /// Id of signed resource
+ /// Indicates the size of the request body.
+ ///
+ /// The suggested default filename when downloading this object to a file after it has been uploaded. (optional)
+ /// The region where the bucket resides Acceptable values: `US`, `EMEA` Default is `US` (optional, default to US)
+ /// If-Match header containing a SHA-1 hash of the bytes in the request body can be sent by the calling service or client application with the request. If present, OSS will use the value of If-Match header to verify that a SHA-1 calculated for the uploaded bytes server side matches what was sent in the header. If not, the request is failed with a status 412 Precondition Failed and the data is not written. (optional)
+ /// ApiResponse of ObjectDetails
+ public ApiResponse< /*ObjectDetails*/dynamic> UploadSignedResourceWithHttpInfo (string id, int? contentLength, System.IO.Stream body, string contentDisposition = null, string xAdsRegion = null, string ifMatch = null, string contentType = "application/octet-stream") {
+ // verify the required parameter 'id' is set
+ if ( id == null )
+ throw new ApiException (400, "Missing required parameter 'id' when calling ObjectsApi->UploadSignedResource");
+ // verify the required parameter 'contentLength' is set
+ if ( contentLength == null )
+ throw new ApiException (400, "Missing required parameter 'contentLength' when calling ObjectsApi->UploadSignedResource");
+ // verify the required parameter 'body' is set
+ if ( body == null )
+ throw new ApiException (400, "Missing required parameter 'body' when calling ObjectsApi->UploadSignedResource");
+
+ var localVarPath = "/oss/v2/signedresources/{id}";
+ var localVarPathParams = new Dictionary ();
+ var localVarQueryParams = new Dictionary ();
+ var localVarHeaderParams = new Dictionary (Configuration.DefaultHeader);
+ var localVarFormParams = new Dictionary ();
+ var localVarFileParams = new Dictionary ();
+ Object localVarPostBody = null;
+
+ // to determine the Content-Type header
+ String [] localVarHttpContentTypes = new String [] {
+ contentType
+ };
+ String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType (localVarHttpContentTypes);
+
+ // to determine the Accept header
+ String [] localVarHttpHeaderAccepts = new String [] {
+ "application/vnd.api+json",
+ "application/json"
+ };
+ String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept (localVarHttpHeaderAccepts);
+ if ( localVarHttpHeaderAccept != null )
+ localVarHeaderParams.Add ("Accept", localVarHttpHeaderAccept);
+
+ // set "format" to json by default
+ // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
+ localVarPathParams.Add ("format", "json");
+ if ( id != null )
+ localVarPathParams.Add ("id", Configuration.ApiClient.ParameterToString (id)); // path parameter
+ if ( contentLength != null )
+ localVarHeaderParams.Add ("Content-Length", Configuration.ApiClient.ParameterToString (contentLength)); // header parameter
+ if ( contentDisposition != null )
+ localVarHeaderParams.Add ("Content-Disposition", Configuration.ApiClient.ParameterToString (contentDisposition)); // header parameter
+ if ( xAdsRegion != null )
+ localVarHeaderParams.Add ("x-ads-region", Configuration.ApiClient.ParameterToString (xAdsRegion)); // header parameter
+ if ( ifMatch != null )
+ localVarHeaderParams.Add ("If-Match", Configuration.ApiClient.ParameterToString (ifMatch)); // header parameter
+ if ( body != null && body.GetType () == typeof (byte []) ) // http body (model) parameter
+ {
+ localVarPostBody = body; // byte array
+ } else if ( body != null
+ && (body.GetType () == typeof (System.IO.FileStream)
+ || body.GetType () == typeof (System.IO.BinaryReader)
+ || body.GetType () == typeof (System.IO.BufferedStream)
+ || body.GetType () == typeof (System.IO.MemoryStream)
+ || body.GetType () == typeof (System.IO.StreamReader)
+ )
+ ) {
+ localVarPostBody = Configuration.ApiClient.toByteArray (body); // byte array
+ } else if ( body != null ) {
+ localVarPostBody = Configuration.ApiClient.Serialize (body);
+ }
+
+ // authentication (oauth2_application) required
+ // oauth required
+ if ( !String.IsNullOrEmpty (Configuration.AccessToken) ) {
+ localVarHeaderParams ["Authorization"] = "Bearer " + Configuration.AccessToken;
+ }
+
+ // make the HTTP request
+ RestResponse localVarResponse = (RestResponse)Configuration.ApiClient.CallApi (localVarPath,
+ Method.Put, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
+ localVarPathParams, localVarHttpContentType);
+
+ int localVarStatusCode = (int)localVarResponse.StatusCode;
+
+ if ( ExceptionFactory != null ) {
+ Exception exception = ExceptionFactory ("UploadSignedResource", localVarResponse);
+ if ( exception != null )
+ throw exception;
+ }
+
+ return new ApiResponse*ObjectDetails*/dynamic> (localVarStatusCode,
+ localVarResponse.Headers.ToDictionary (x => x.Name, x => x.Value.ToString ()),
+ /*(ObjectDetails)*/ Configuration.ApiClient.Deserialize (localVarResponse, typeof (ObjectDetails)));
+
+ }
+
+ ///
+ /// Overwrite a existing object using a signed URL. Conditions to call this operation: Object is available Expiration period is valid Signed URL should be created with `write` or `readwrite`
+ ///
+ /// Thrown when fails to make API call
+ /// Id of signed resource
+ /// Indicates the size of the request body.
+ ///
+ /// The suggested default filename when downloading this object to a file after it has been uploaded. (optional)
+ /// The region where the bucket resides Acceptable values: `US`, `EMEA` Default is `US` (optional, default to US)
+ /// If-Match header containing a SHA-1 hash of the bytes in the request body can be sent by the calling service or client application with the request. If present, OSS will use the value of If-Match header to verify that a SHA-1 calculated for the uploaded bytes server side matches what was sent in the header. If not, the request is failed with a status 412 Precondition Failed and the data is not written. (optional)
+ /// Task of ObjectDetails
+ public async System.Threading.Tasks.Task*ObjectDetails*/dynamic> UploadSignedResourceAsync (string id, int? contentLength, System.IO.Stream body, string contentDisposition = null, string xAdsRegion = null, string ifMatch = null, string contentType = "application/octet-stream") {
+ ApiResponse*ObjectDetails*/dynamic> localVarResponse = await UploadSignedResourceAsyncWithHttpInfo (id, contentLength, body, contentDisposition, xAdsRegion, ifMatch, contentType);
+ return localVarResponse.Data;
+
+ }
+
+ ///
+ /// Overwrite a existing object using a signed URL. Conditions to call this operation: Object is available Expiration period is valid Signed URL should be created with `write` or `readwrite`
+ ///
+ /// Thrown when fails to make API call
+ /// Id of signed resource
+ /// Indicates the size of the request body.
+ ///
+ /// The suggested default filename when downloading this object to a file after it has been uploaded. (optional)
+ /// The region where the bucket resides Acceptable values: `US`, `EMEA` Default is `US` (optional, default to US)
+ /// If-Match header containing a SHA-1 hash of the bytes in the request body can be sent by the calling service or client application with the request. If present, OSS will use the value of If-Match header to verify that a SHA-1 calculated for the uploaded bytes server side matches what was sent in the header. If not, the request is failed with a status 412 Precondition Failed and the data is not written. (optional)
+ /// Task of ApiResponse (ObjectDetails)
+ public async System.Threading.Tasks.Task> UploadSignedResourceAsyncWithHttpInfo (string id, int? contentLength, System.IO.Stream body, string contentDisposition = null, string xAdsRegion = null, string ifMatch = null, string contentType = "application/octet-stream") {
+ // verify the required parameter 'id' is set
+ if ( id == null )
+ throw new ApiException (400, "Missing required parameter 'id' when calling ObjectsApi->UploadSignedResource");
+ // verify the required parameter 'contentLength' is set
+ if ( contentLength == null )
+ throw new ApiException (400, "Missing required parameter 'contentLength' when calling ObjectsApi->UploadSignedResource");
+ // verify the required parameter 'body' is set
+ if ( body == null )
+ throw new ApiException (400, "Missing required parameter 'body' when calling ObjectsApi->UploadSignedResource");
+
+ var localVarPath = "/oss/v2/signedresources/{id}";
+ var localVarPathParams = new Dictionary ();
+ var localVarQueryParams = new Dictionary