diff --git a/.codegen.json b/.codegen.json index f5298e7d..effda484 100644 --- a/.codegen.json +++ b/.codegen.json @@ -1 +1 @@ -{ "engineHash": "5b7aecf", "specHash": "b21666d", "version": "1.1.0" } +{ "engineHash": "5b7aecf", "specHash": "368fe5a", "version": "1.1.0" } diff --git a/Box.Sdk.Gen/Managers/ChunkedUploads/ChunkedUploadsManager.cs b/Box.Sdk.Gen/Managers/ChunkedUploads/ChunkedUploadsManager.cs index 2be8e5d1..0cfcc912 100644 --- a/Box.Sdk.Gen/Managers/ChunkedUploads/ChunkedUploadsManager.cs +++ b/Box.Sdk.Gen/Managers/ChunkedUploads/ChunkedUploadsManager.cs @@ -31,7 +31,7 @@ public ChunkedUploadsManager(NetworkSession? networkSession = default) { public async System.Threading.Tasks.Task CreateFileUploadSessionAsync(CreateFileUploadSessionRequestBody requestBody, CreateFileUploadSessionHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new CreateFileUploadSessionHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.UploadUrl, "/2.0/files/upload_sessions"), networkSession: this.NetworkSession) { Method = "POST", Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), ContentType = "application/json", ResponseFormat = "json", Auth = this.Auth, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat("https://upload.box.com/2.0/files/upload_sessions"), networkSession: this.NetworkSession) { Method = "POST", Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), ContentType = "application/json", ResponseFormat = "json", Auth = this.Auth, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(response.Data); } @@ -60,7 +60,7 @@ public async System.Threading.Tasks.Task CreateFileUploadSessionA public async System.Threading.Tasks.Task CreateFileUploadSessionForExistingFileAsync(string fileId, CreateFileUploadSessionForExistingFileRequestBody requestBody, CreateFileUploadSessionForExistingFileHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new CreateFileUploadSessionForExistingFileHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.UploadUrl, "/2.0/files/", StringUtils.ToStringRepresentation(fileId), "/upload_sessions"), networkSession: this.NetworkSession) { Method = "POST", Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), ContentType = "application/json", ResponseFormat = "json", Auth = this.Auth, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat("https://upload.box.com/2.0/files/", StringUtils.ToStringRepresentation(fileId), "/upload_sessions"), networkSession: this.NetworkSession) { Method = "POST", Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), ContentType = "application/json", ResponseFormat = "json", Auth = this.Auth, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(response.Data); } diff --git a/Box.Sdk.Gen/Managers/Uploads/UploadsManager.cs b/Box.Sdk.Gen/Managers/Uploads/UploadsManager.cs index 11cb7737..78e3a8cc 100644 --- a/Box.Sdk.Gen/Managers/Uploads/UploadsManager.cs +++ b/Box.Sdk.Gen/Managers/Uploads/UploadsManager.cs @@ -51,7 +51,7 @@ public async System.Threading.Tasks.Task UploadFileVersionAsync(string fi headers = headers ?? new UploadFileVersionHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "fields", StringUtils.ToStringRepresentation(queryParams.Fields) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { { "if-match", StringUtils.ToStringRepresentation(headers.IfMatch) }, { "content-md5", StringUtils.ToStringRepresentation(headers.ContentMd5) } }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.UploadUrl, "/2.0/files/", StringUtils.ToStringRepresentation(fileId), "/content"), networkSession: this.NetworkSession) { Method = "POST", Parameters = queryParamsMap, Headers = headersMap, MultipartData = Array.AsReadOnly(new [] {new MultipartItem(partName: "attributes") { Data = SimpleJsonSerializer.Serialize(requestBody.Attributes) },new MultipartItem(partName: "file") { FileStream = requestBody.File, FileName = requestBody.FileFileName, ContentType = requestBody.FileContentType }}), ContentType = "multipart/form-data", ResponseFormat = "json", Auth = this.Auth, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat("https://upload.box.com/2.0/files/", StringUtils.ToStringRepresentation(fileId), "/content"), networkSession: this.NetworkSession) { Method = "POST", Parameters = queryParamsMap, Headers = headersMap, MultipartData = Array.AsReadOnly(new [] {new MultipartItem(partName: "attributes") { Data = SimpleJsonSerializer.Serialize(requestBody.Attributes) },new MultipartItem(partName: "file") { FileStream = requestBody.File, FileName = requestBody.FileFileName, ContentType = requestBody.FileContentType }}), ContentType = "multipart/form-data", ResponseFormat = "json", Auth = this.Auth, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(response.Data); } @@ -102,7 +102,7 @@ public async System.Threading.Tasks.Task UploadFileAsync(UploadFileReques headers = headers ?? new UploadFileHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "fields", StringUtils.ToStringRepresentation(queryParams.Fields) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { { "content-md5", StringUtils.ToStringRepresentation(headers.ContentMd5) } }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.UploadUrl, "/2.0/files/content"), networkSession: this.NetworkSession) { Method = "POST", Parameters = queryParamsMap, Headers = headersMap, MultipartData = Array.AsReadOnly(new [] {new MultipartItem(partName: "attributes") { Data = SimpleJsonSerializer.Serialize(requestBody.Attributes) },new MultipartItem(partName: "file") { FileStream = requestBody.File, FileName = requestBody.FileFileName, ContentType = requestBody.FileContentType }}), ContentType = "multipart/form-data", ResponseFormat = "json", Auth = this.Auth, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat("https://upload.box.com/2.0/files/content"), networkSession: this.NetworkSession) { Method = "POST", Parameters = queryParamsMap, Headers = headersMap, MultipartData = Array.AsReadOnly(new [] {new MultipartItem(partName: "attributes") { Data = SimpleJsonSerializer.Serialize(requestBody.Attributes) },new MultipartItem(partName: "file") { FileStream = requestBody.File, FileName = requestBody.FileFileName, ContentType = requestBody.FileContentType }}), ContentType = "multipart/form-data", ResponseFormat = "json", Auth = this.Auth, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(response.Data); }