diff --git a/.codegen.json b/.codegen.json index 187e1972..22e2fe4b 100644 --- a/.codegen.json +++ b/.codegen.json @@ -1 +1 @@ -{ "engineHash": "59999bf", "specHash": "6886603", "version": "1.5.0" } +{ "engineHash": "ce7ab17", "specHash": "6886603", "version": "1.5.0" } diff --git a/Box.Sdk.Gen/Client/BoxClient.cs b/Box.Sdk.Gen/Client/BoxClient.cs index aaa778f4..a15822b1 100644 --- a/Box.Sdk.Gen/Client/BoxClient.cs +++ b/Box.Sdk.Gen/Client/BoxClient.cs @@ -1,5 +1,4 @@ using Box.Sdk.Gen.Internal; -using Box.Sdk.Gen; using System.Collections.Generic; using System.Collections.ObjectModel; using Box.Sdk.Gen.Managers; @@ -234,7 +233,7 @@ public async System.Threading.Tasks.Task MakeRequestAsync(FetchOp IAuthentication auth = fetchOptions.Auth == null ? this.Auth : NullableUtils.Unwrap(fetchOptions.Auth); NetworkSession networkSession = fetchOptions.NetworkSession == null ? this.NetworkSession : NullableUtils.Unwrap(fetchOptions.NetworkSession); FetchOptions enrichedFetchOptions = new FetchOptions(url: fetchOptions.Url, method: fetchOptions.Method, contentType: fetchOptions.ContentType, responseFormat: fetchOptions.ResponseFormat) { Auth = auth, NetworkSession = networkSession, Parameters = fetchOptions.Parameters, Headers = fetchOptions.Headers, Data = fetchOptions.Data, FileStream = fetchOptions.FileStream, MultipartData = fetchOptions.MultipartData }; - return await HttpClientAdapter.FetchAsync(enrichedFetchOptions).ConfigureAwait(false); + return await networkSession.NetworkClient.FetchAsync(options: enrichedFetchOptions).ConfigureAwait(false); } /// diff --git a/Box.Sdk.Gen/Managers/Ai/AiManager.cs b/Box.Sdk.Gen/Managers/Ai/AiManager.cs index 2e10258f..2df627ff 100644 --- a/Box.Sdk.Gen/Managers/Ai/AiManager.cs +++ b/Box.Sdk.Gen/Managers/Ai/AiManager.cs @@ -28,7 +28,7 @@ public AiManager(NetworkSession? networkSession = default) { public async System.Threading.Tasks.Task CreateAiAskAsync(AiAsk requestBody, CreateAiAskHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new CreateAiAskHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/ai/ask"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/ai/ask"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -47,7 +47,7 @@ public async System.Threading.Tasks.Task CreateAiAskAsync(AiAsk public async System.Threading.Tasks.Task CreateAiTextGenAsync(AiTextGen requestBody, CreateAiTextGenHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new CreateAiTextGenHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/ai/text_gen"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/ai/text_gen"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -67,7 +67,7 @@ public async System.Threading.Tasks.Task queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "mode", StringUtils.ToStringRepresentation(queryParams.Mode?.Value) }, { "language", StringUtils.ToStringRepresentation(queryParams.Language) }, { "model", StringUtils.ToStringRepresentation(queryParams.Model) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/ai_agent_default"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/ai_agent_default"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.DeserializeWithoutRawJson(NullableUtils.Unwrap(response.Data)); } @@ -88,7 +88,7 @@ public async System.Threading.Tasks.Task CreateAiExtractAsync(AiExtract requestBody, CreateAiExtractHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new CreateAiExtractHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/ai/extract"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/ai/extract"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -111,7 +111,7 @@ public async System.Threading.Tasks.Task CreateAiExtractAsync(AiExtr public async System.Threading.Tasks.Task CreateAiExtractStructuredAsync(AiExtractStructured requestBody, CreateAiExtractStructuredHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new CreateAiExtractStructuredHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/ai/extract_structured"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/ai/extract_structured"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } diff --git a/Box.Sdk.Gen/Managers/AppItemAssociations/AppItemAssociationsManager.cs b/Box.Sdk.Gen/Managers/AppItemAssociations/AppItemAssociationsManager.cs index 4709a2d9..0d41b4af 100644 --- a/Box.Sdk.Gen/Managers/AppItemAssociations/AppItemAssociationsManager.cs +++ b/Box.Sdk.Gen/Managers/AppItemAssociations/AppItemAssociationsManager.cs @@ -44,7 +44,7 @@ public async System.Threading.Tasks.Task GetFileAppItemAsso headers = headers ?? new GetFileAppItemAssociationsHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "limit", StringUtils.ToStringRepresentation(queryParams.Limit) }, { "marker", StringUtils.ToStringRepresentation(queryParams.Marker) }, { "application_type", StringUtils.ToStringRepresentation(queryParams.ApplicationType) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/files/", StringUtils.ToStringRepresentation(fileId), "/app_item_associations"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/files/", StringUtils.ToStringRepresentation(fileId), "/app_item_associations"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -82,7 +82,7 @@ public async System.Threading.Tasks.Task GetFolderAppItemAs headers = headers ?? new GetFolderAppItemAssociationsHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "limit", StringUtils.ToStringRepresentation(queryParams.Limit) }, { "marker", StringUtils.ToStringRepresentation(queryParams.Marker) }, { "application_type", StringUtils.ToStringRepresentation(queryParams.ApplicationType) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/folders/", StringUtils.ToStringRepresentation(folderId), "/app_item_associations"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/folders/", StringUtils.ToStringRepresentation(folderId), "/app_item_associations"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } diff --git a/Box.Sdk.Gen/Managers/Authorization/AuthorizationManager.cs b/Box.Sdk.Gen/Managers/Authorization/AuthorizationManager.cs index 5d9651a6..fed9cbc8 100644 --- a/Box.Sdk.Gen/Managers/Authorization/AuthorizationManager.cs +++ b/Box.Sdk.Gen/Managers/Authorization/AuthorizationManager.cs @@ -35,7 +35,7 @@ public async System.Threading.Tasks.Task AuthorizeUserAsync(AuthorizeUserQueryPa headers = headers ?? new AuthorizeUserHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "response_type", StringUtils.ToStringRepresentation(queryParams.ResponseType) }, { "client_id", StringUtils.ToStringRepresentation(queryParams.ClientId) }, { "redirect_uri", StringUtils.ToStringRepresentation(queryParams.RedirectUri) }, { "state", StringUtils.ToStringRepresentation(queryParams.State) }, { "scope", StringUtils.ToStringRepresentation(queryParams.Scope) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.Oauth2Url, "/authorize"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.Oauth2Url, "/authorize"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); } /// @@ -64,7 +64,7 @@ public async System.Threading.Tasks.Task AuthorizeUserAsync(AuthorizeUserQueryPa public async System.Threading.Tasks.Task RequestAccessTokenAsync(PostOAuth2Token requestBody, RequestAccessTokenHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new RequestAccessTokenHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/oauth2/token"), method: "POST", contentType: "application/x-www-form-urlencoded", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/oauth2/token"), method: "POST", contentType: "application/x-www-form-urlencoded", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -83,7 +83,7 @@ public async System.Threading.Tasks.Task RequestAccessTokenAsync(Po public async System.Threading.Tasks.Task RefreshAccessTokenAsync(PostOAuth2TokenRefreshAccessToken requestBody, RefreshAccessTokenHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new RefreshAccessTokenHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/oauth2/token#refresh"), method: "POST", contentType: "application/x-www-form-urlencoded", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/oauth2/token#refresh"), method: "POST", contentType: "application/x-www-form-urlencoded", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -103,7 +103,7 @@ public async System.Threading.Tasks.Task RefreshAccessTokenAsync(Po public async System.Threading.Tasks.Task RevokeAccessTokenAsync(PostOAuth2Revoke requestBody, RevokeAccessTokenHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new RevokeAccessTokenHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/oauth2/revoke"), method: "POST", contentType: "application/x-www-form-urlencoded", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/oauth2/revoke"), method: "POST", contentType: "application/x-www-form-urlencoded", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); } } diff --git a/Box.Sdk.Gen/Managers/Avatars/AvatarsManager.cs b/Box.Sdk.Gen/Managers/Avatars/AvatarsManager.cs index 34c603b3..4982e014 100644 --- a/Box.Sdk.Gen/Managers/Avatars/AvatarsManager.cs +++ b/Box.Sdk.Gen/Managers/Avatars/AvatarsManager.cs @@ -30,7 +30,7 @@ public AvatarsManager(NetworkSession? networkSession = default) { public async System.Threading.Tasks.Task GetUserAvatarAsync(string userId, GetUserAvatarHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new GetUserAvatarHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/users/", StringUtils.ToStringRepresentation(userId), "/avatar"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Binary) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/users/", StringUtils.ToStringRepresentation(userId), "/avatar"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Binary) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return NullableUtils.Unwrap(response.Content); } @@ -53,7 +53,7 @@ public AvatarsManager(NetworkSession? networkSession = default) { public async System.Threading.Tasks.Task CreateUserAvatarAsync(string userId, CreateUserAvatarRequestBody requestBody, CreateUserAvatarHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new CreateUserAvatarHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/users/", StringUtils.ToStringRepresentation(userId), "/avatar"), method: "POST", contentType: "multipart/form-data", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, MultipartData = Array.AsReadOnly(new [] {new MultipartItem(partName: "pic") { FileStream = requestBody.Pic, FileName = requestBody.PicFileName, ContentType = requestBody.PicContentType }}), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/users/", StringUtils.ToStringRepresentation(userId), "/avatar"), method: "POST", contentType: "multipart/form-data", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, MultipartData = Array.AsReadOnly(new [] {new MultipartItem(partName: "pic") { FileStream = requestBody.Pic, FileName = requestBody.PicFileName, ContentType = requestBody.PicContentType }}), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -74,7 +74,7 @@ public async System.Threading.Tasks.Task CreateUserAvatarAsync(strin public async System.Threading.Tasks.Task DeleteUserAvatarAsync(string userId, DeleteUserAvatarHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new DeleteUserAvatarHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/users/", StringUtils.ToStringRepresentation(userId), "/avatar"), method: "DELETE", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/users/", StringUtils.ToStringRepresentation(userId), "/avatar"), method: "DELETE", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); } } diff --git a/Box.Sdk.Gen/Managers/ChunkedUploads/ChunkedUploadsManager.cs b/Box.Sdk.Gen/Managers/ChunkedUploads/ChunkedUploadsManager.cs index 40e85623..e936c62b 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"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.UploadUrl, "/2.0/files/upload_sessions"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(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"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.UploadUrl, "/2.0/files/", StringUtils.ToStringRepresentation(fileId), "/upload_sessions"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -83,7 +83,7 @@ public async System.Threading.Tasks.Task CreateFileUploadSessionF public async System.Threading.Tasks.Task GetFileUploadSessionByUrlAsync(string url, GetFileUploadSessionByUrlHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new GetFileUploadSessionByUrlHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: url, method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: url, method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -105,7 +105,7 @@ public async System.Threading.Tasks.Task GetFileUploadSessionByUr public async System.Threading.Tasks.Task GetFileUploadSessionByIdAsync(string uploadSessionId, GetFileUploadSessionByIdHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new GetFileUploadSessionByIdHeaders(); 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/", StringUtils.ToStringRepresentation(uploadSessionId)), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.UploadUrl, "/2.0/files/upload_sessions/", StringUtils.ToStringRepresentation(uploadSessionId)), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -131,7 +131,7 @@ public async System.Threading.Tasks.Task GetFileUploadSessionById /// public async System.Threading.Tasks.Task UploadFilePartByUrlAsync(string url, System.IO.Stream requestBody, UploadFilePartByUrlHeaders headers, System.Threading.CancellationToken? cancellationToken = null) { Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { { "digest", StringUtils.ToStringRepresentation(headers.Digest) }, { "content-range", StringUtils.ToStringRepresentation(headers.ContentRange) } }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: url, method: "PUT", contentType: "application/octet-stream", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, FileStream = requestBody, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: url, method: "PUT", contentType: "application/octet-stream", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, FileStream = requestBody, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -156,7 +156,7 @@ public async System.Threading.Tasks.Task UploadFilePartByUrlAsync( /// public async System.Threading.Tasks.Task UploadFilePartAsync(string uploadSessionId, System.IO.Stream requestBody, UploadFilePartHeaders headers, System.Threading.CancellationToken? cancellationToken = null) { Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { { "digest", StringUtils.ToStringRepresentation(headers.Digest) }, { "content-range", StringUtils.ToStringRepresentation(headers.ContentRange) } }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.UploadUrl, "/2.0/files/upload_sessions/", StringUtils.ToStringRepresentation(uploadSessionId)), method: "PUT", contentType: "application/octet-stream", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, FileStream = requestBody, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.UploadUrl, "/2.0/files/upload_sessions/", StringUtils.ToStringRepresentation(uploadSessionId)), method: "PUT", contentType: "application/octet-stream", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, FileStream = requestBody, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -182,7 +182,7 @@ public async System.Threading.Tasks.Task UploadFilePartAsync(strin public async System.Threading.Tasks.Task DeleteFileUploadSessionByUrlAsync(string url, DeleteFileUploadSessionByUrlHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new DeleteFileUploadSessionByUrlHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: url, method: "DELETE", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: url, method: "DELETE", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); } /// @@ -206,7 +206,7 @@ public async System.Threading.Tasks.Task DeleteFileUploadSessionByUrlAsync(strin public async System.Threading.Tasks.Task DeleteFileUploadSessionByIdAsync(string uploadSessionId, DeleteFileUploadSessionByIdHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new DeleteFileUploadSessionByIdHeaders(); 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/", StringUtils.ToStringRepresentation(uploadSessionId)), method: "DELETE", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.UploadUrl, "/2.0/files/upload_sessions/", StringUtils.ToStringRepresentation(uploadSessionId)), method: "DELETE", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); } /// @@ -234,7 +234,7 @@ public async System.Threading.Tasks.Task GetFileUploadSessionPartsB headers = headers ?? new GetFileUploadSessionPartsByUrlHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "offset", StringUtils.ToStringRepresentation(queryParams.Offset) }, { "limit", StringUtils.ToStringRepresentation(queryParams.Limit) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: url, method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: url, method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -262,7 +262,7 @@ public async System.Threading.Tasks.Task GetFileUploadSessionPartsA headers = headers ?? new GetFileUploadSessionPartsHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "offset", StringUtils.ToStringRepresentation(queryParams.Offset) }, { "limit", StringUtils.ToStringRepresentation(queryParams.Limit) } }); 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/", StringUtils.ToStringRepresentation(uploadSessionId), "/parts"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.UploadUrl, "/2.0/files/upload_sessions/", StringUtils.ToStringRepresentation(uploadSessionId), "/parts"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -288,7 +288,7 @@ public async System.Threading.Tasks.Task GetFileUploadSessionPartsA /// public async System.Threading.Tasks.Task CreateFileUploadSessionCommitByUrlAsync(string url, CreateFileUploadSessionCommitByUrlRequestBody requestBody, CreateFileUploadSessionCommitByUrlHeaders headers, System.Threading.CancellationToken? cancellationToken = null) { Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { { "digest", StringUtils.ToStringRepresentation(headers.Digest) }, { "if-match", StringUtils.ToStringRepresentation(headers.IfMatch) }, { "if-none-match", StringUtils.ToStringRepresentation(headers.IfNoneMatch) } }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: url, method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: url, method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); if (StringUtils.ToStringRepresentation(response.Status) == "202") { return null; } @@ -316,7 +316,7 @@ public async System.Threading.Tasks.Task GetFileUploadSessionPartsA /// public async System.Threading.Tasks.Task CreateFileUploadSessionCommitAsync(string uploadSessionId, CreateFileUploadSessionCommitRequestBody requestBody, CreateFileUploadSessionCommitHeaders headers, System.Threading.CancellationToken? cancellationToken = null) { Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { { "digest", StringUtils.ToStringRepresentation(headers.Digest) }, { "if-match", StringUtils.ToStringRepresentation(headers.IfMatch) }, { "if-none-match", StringUtils.ToStringRepresentation(headers.IfNoneMatch) } }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.UploadUrl, "/2.0/files/upload_sessions/", StringUtils.ToStringRepresentation(uploadSessionId), "/commit"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.UploadUrl, "/2.0/files/upload_sessions/", StringUtils.ToStringRepresentation(uploadSessionId), "/commit"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); if (StringUtils.ToStringRepresentation(response.Status) == "202") { return null; } diff --git a/Box.Sdk.Gen/Managers/Classifications/ClassificationsManager.cs b/Box.Sdk.Gen/Managers/Classifications/ClassificationsManager.cs index fa64b575..99b27332 100644 --- a/Box.Sdk.Gen/Managers/Classifications/ClassificationsManager.cs +++ b/Box.Sdk.Gen/Managers/Classifications/ClassificationsManager.cs @@ -32,7 +32,7 @@ public ClassificationsManager(NetworkSession? networkSession = default) { public async System.Threading.Tasks.Task GetClassificationTemplateAsync(GetClassificationTemplateHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new GetClassificationTemplateHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/metadata_templates/enterprise/securityClassification-6VMVochwUWo/schema"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/metadata_templates/enterprise/securityClassification-6VMVochwUWo/schema"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -56,7 +56,7 @@ public async System.Threading.Tasks.Task GetClassificati public async System.Threading.Tasks.Task AddClassificationAsync(IReadOnlyList requestBody, AddClassificationHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new AddClassificationHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/metadata_templates/enterprise/securityClassification-6VMVochwUWo/schema#add"), method: "PUT", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/metadata_templates/enterprise/securityClassification-6VMVochwUWo/schema#add"), method: "PUT", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -80,7 +80,7 @@ public async System.Threading.Tasks.Task AddClassificati public async System.Threading.Tasks.Task UpdateClassificationAsync(IReadOnlyList requestBody, UpdateClassificationHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new UpdateClassificationHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/metadata_templates/enterprise/securityClassification-6VMVochwUWo/schema#update"), method: "PUT", contentType: "application/json-patch+json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/metadata_templates/enterprise/securityClassification-6VMVochwUWo/schema#update"), method: "PUT", contentType: "application/json-patch+json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -105,7 +105,7 @@ public async System.Threading.Tasks.Task UpdateClassific public async System.Threading.Tasks.Task CreateClassificationTemplateAsync(CreateClassificationTemplateRequestBody requestBody, CreateClassificationTemplateHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new CreateClassificationTemplateHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/metadata_templates/schema#classifications"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/metadata_templates/schema#classifications"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } diff --git a/Box.Sdk.Gen/Managers/CollaborationAllowlistEntries/CollaborationAllowlistEntriesManager.cs b/Box.Sdk.Gen/Managers/CollaborationAllowlistEntries/CollaborationAllowlistEntriesManager.cs index 2e6e881a..f06e8708 100644 --- a/Box.Sdk.Gen/Managers/CollaborationAllowlistEntries/CollaborationAllowlistEntriesManager.cs +++ b/Box.Sdk.Gen/Managers/CollaborationAllowlistEntries/CollaborationAllowlistEntriesManager.cs @@ -32,7 +32,7 @@ public async System.Threading.Tasks.Task GetColla headers = headers ?? new GetCollaborationWhitelistEntriesHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "marker", StringUtils.ToStringRepresentation(queryParams.Marker) }, { "limit", StringUtils.ToStringRepresentation(queryParams.Limit) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/collaboration_whitelist_entries"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/collaboration_whitelist_entries"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -52,7 +52,7 @@ public async System.Threading.Tasks.Task GetColla public async System.Threading.Tasks.Task CreateCollaborationWhitelistEntryAsync(CreateCollaborationWhitelistEntryRequestBody requestBody, CreateCollaborationWhitelistEntryHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new CreateCollaborationWhitelistEntryHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/collaboration_whitelist_entries"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/collaboration_whitelist_entries"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -73,7 +73,7 @@ public async System.Threading.Tasks.Task CreateColl public async System.Threading.Tasks.Task GetCollaborationWhitelistEntryByIdAsync(string collaborationWhitelistEntryId, GetCollaborationWhitelistEntryByIdHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new GetCollaborationWhitelistEntryByIdHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/collaboration_whitelist_entries/", StringUtils.ToStringRepresentation(collaborationWhitelistEntryId)), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/collaboration_whitelist_entries/", StringUtils.ToStringRepresentation(collaborationWhitelistEntryId)), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -94,7 +94,7 @@ public async System.Threading.Tasks.Task GetCollabo public async System.Threading.Tasks.Task DeleteCollaborationWhitelistEntryByIdAsync(string collaborationWhitelistEntryId, DeleteCollaborationWhitelistEntryByIdHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new DeleteCollaborationWhitelistEntryByIdHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/collaboration_whitelist_entries/", StringUtils.ToStringRepresentation(collaborationWhitelistEntryId)), method: "DELETE", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/collaboration_whitelist_entries/", StringUtils.ToStringRepresentation(collaborationWhitelistEntryId)), method: "DELETE", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); } } diff --git a/Box.Sdk.Gen/Managers/CollaborationAllowlistExemptTargets/CollaborationAllowlistExemptTargetsManager.cs b/Box.Sdk.Gen/Managers/CollaborationAllowlistExemptTargets/CollaborationAllowlistExemptTargetsManager.cs index 27324763..a22728bd 100644 --- a/Box.Sdk.Gen/Managers/CollaborationAllowlistExemptTargets/CollaborationAllowlistExemptTargetsManager.cs +++ b/Box.Sdk.Gen/Managers/CollaborationAllowlistExemptTargets/CollaborationAllowlistExemptTargetsManager.cs @@ -32,7 +32,7 @@ public async System.Threading.Tasks.Task Ge headers = headers ?? new GetCollaborationWhitelistExemptTargetsHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "marker", StringUtils.ToStringRepresentation(queryParams.Marker) }, { "limit", StringUtils.ToStringRepresentation(queryParams.Limit) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/collaboration_whitelist_exempt_targets"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/collaboration_whitelist_exempt_targets"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -52,7 +52,7 @@ public async System.Threading.Tasks.Task Ge public async System.Threading.Tasks.Task CreateCollaborationWhitelistExemptTargetAsync(CreateCollaborationWhitelistExemptTargetRequestBody requestBody, CreateCollaborationWhitelistExemptTargetHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new CreateCollaborationWhitelistExemptTargetHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/collaboration_whitelist_exempt_targets"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/collaboration_whitelist_exempt_targets"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -73,7 +73,7 @@ public async System.Threading.Tasks.Task Cre public async System.Threading.Tasks.Task GetCollaborationWhitelistExemptTargetByIdAsync(string collaborationWhitelistExemptTargetId, GetCollaborationWhitelistExemptTargetByIdHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new GetCollaborationWhitelistExemptTargetByIdHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/collaboration_whitelist_exempt_targets/", StringUtils.ToStringRepresentation(collaborationWhitelistExemptTargetId)), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/collaboration_whitelist_exempt_targets/", StringUtils.ToStringRepresentation(collaborationWhitelistExemptTargetId)), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -94,7 +94,7 @@ public async System.Threading.Tasks.Task Get public async System.Threading.Tasks.Task DeleteCollaborationWhitelistExemptTargetByIdAsync(string collaborationWhitelistExemptTargetId, DeleteCollaborationWhitelistExemptTargetByIdHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new DeleteCollaborationWhitelistExemptTargetByIdHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/collaboration_whitelist_exempt_targets/", StringUtils.ToStringRepresentation(collaborationWhitelistExemptTargetId)), method: "DELETE", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/collaboration_whitelist_exempt_targets/", StringUtils.ToStringRepresentation(collaborationWhitelistExemptTargetId)), method: "DELETE", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); } } diff --git a/Box.Sdk.Gen/Managers/Collections/CollectionsManager.cs b/Box.Sdk.Gen/Managers/Collections/CollectionsManager.cs index af042cba..274ce82e 100644 --- a/Box.Sdk.Gen/Managers/Collections/CollectionsManager.cs +++ b/Box.Sdk.Gen/Managers/Collections/CollectionsManager.cs @@ -34,7 +34,7 @@ public async System.Threading.Tasks.Task GetCollectionsAsync(GetCol headers = headers ?? new GetCollectionsHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "fields", StringUtils.ToStringRepresentation(queryParams.Fields) }, { "offset", StringUtils.ToStringRepresentation(queryParams.Offset) }, { "limit", StringUtils.ToStringRepresentation(queryParams.Limit) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/collections"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/collections"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -60,7 +60,7 @@ public async System.Threading.Tasks.Task GetCollectionItem headers = headers ?? new GetCollectionItemsHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "fields", StringUtils.ToStringRepresentation(queryParams.Fields) }, { "offset", StringUtils.ToStringRepresentation(queryParams.Offset) }, { "limit", StringUtils.ToStringRepresentation(queryParams.Limit) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/collections/", StringUtils.ToStringRepresentation(collectionId), "/items"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/collections/", StringUtils.ToStringRepresentation(collectionId), "/items"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -80,7 +80,7 @@ public async System.Threading.Tasks.Task GetCollectionItem public async System.Threading.Tasks.Task GetCollectionByIdAsync(string collectionId, GetCollectionByIdHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new GetCollectionByIdHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/collections/", StringUtils.ToStringRepresentation(collectionId)), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/collections/", StringUtils.ToStringRepresentation(collectionId)), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } diff --git a/Box.Sdk.Gen/Managers/Comments/CommentsManager.cs b/Box.Sdk.Gen/Managers/Comments/CommentsManager.cs index 4d970467..43485e7c 100644 --- a/Box.Sdk.Gen/Managers/Comments/CommentsManager.cs +++ b/Box.Sdk.Gen/Managers/Comments/CommentsManager.cs @@ -42,7 +42,7 @@ public async System.Threading.Tasks.Task GetFileCommentsAsync(string f headers = headers ?? new GetFileCommentsHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "fields", StringUtils.ToStringRepresentation(queryParams.Fields) }, { "limit", StringUtils.ToStringRepresentation(queryParams.Limit) }, { "offset", StringUtils.ToStringRepresentation(queryParams.Offset) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/files/", StringUtils.ToStringRepresentation(fileId), "/comments"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/files/", StringUtils.ToStringRepresentation(fileId), "/comments"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -68,7 +68,7 @@ public async System.Threading.Tasks.Task GetCommentByIdAsync(string headers = headers ?? new GetCommentByIdHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "fields", StringUtils.ToStringRepresentation(queryParams.Fields) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/comments/", StringUtils.ToStringRepresentation(commentId)), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/comments/", StringUtils.ToStringRepresentation(commentId)), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -97,7 +97,7 @@ public async System.Threading.Tasks.Task UpdateCommentByIdAsync(str headers = headers ?? new UpdateCommentByIdHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "fields", StringUtils.ToStringRepresentation(queryParams.Fields) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/comments/", StringUtils.ToStringRepresentation(commentId)), method: "PUT", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/comments/", StringUtils.ToStringRepresentation(commentId)), method: "PUT", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -117,7 +117,7 @@ public async System.Threading.Tasks.Task UpdateCommentByIdAsync(str public async System.Threading.Tasks.Task DeleteCommentByIdAsync(string commentId, DeleteCommentByIdHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new DeleteCommentByIdHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/comments/", StringUtils.ToStringRepresentation(commentId)), method: "DELETE", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/comments/", StringUtils.ToStringRepresentation(commentId)), method: "DELETE", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); } /// @@ -141,7 +141,7 @@ public async System.Threading.Tasks.Task CreateCommentAsync(CreateC headers = headers ?? new CreateCommentHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "fields", StringUtils.ToStringRepresentation(queryParams.Fields) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/comments"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/comments"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } diff --git a/Box.Sdk.Gen/Managers/DevicePinners/DevicePinnersManager.cs b/Box.Sdk.Gen/Managers/DevicePinners/DevicePinnersManager.cs index 386f7ad8..1977d657 100644 --- a/Box.Sdk.Gen/Managers/DevicePinners/DevicePinnersManager.cs +++ b/Box.Sdk.Gen/Managers/DevicePinners/DevicePinnersManager.cs @@ -29,7 +29,7 @@ public DevicePinnersManager(NetworkSession? networkSession = default) { public async System.Threading.Tasks.Task GetDevicePinnerByIdAsync(string devicePinnerId, GetDevicePinnerByIdHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new GetDevicePinnerByIdHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/device_pinners/", StringUtils.ToStringRepresentation(devicePinnerId)), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/device_pinners/", StringUtils.ToStringRepresentation(devicePinnerId)), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -49,7 +49,7 @@ public async System.Threading.Tasks.Task GetDevicePinnerByIdAsync( public async System.Threading.Tasks.Task DeleteDevicePinnerByIdAsync(string devicePinnerId, DeleteDevicePinnerByIdHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new DeleteDevicePinnerByIdHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/device_pinners/", StringUtils.ToStringRepresentation(devicePinnerId)), method: "DELETE", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/device_pinners/", StringUtils.ToStringRepresentation(devicePinnerId)), method: "DELETE", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); } /// @@ -76,7 +76,7 @@ public async System.Threading.Tasks.Task GetEnterpriseDevicePinne headers = headers ?? new GetEnterpriseDevicePinnersHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "marker", StringUtils.ToStringRepresentation(queryParams.Marker) }, { "limit", StringUtils.ToStringRepresentation(queryParams.Limit) }, { "direction", StringUtils.ToStringRepresentation(queryParams.Direction?.Value) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/enterprises/", StringUtils.ToStringRepresentation(enterpriseId), "/device_pinners"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/enterprises/", StringUtils.ToStringRepresentation(enterpriseId), "/device_pinners"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } diff --git a/Box.Sdk.Gen/Managers/Downloads/DownloadsManager.cs b/Box.Sdk.Gen/Managers/Downloads/DownloadsManager.cs index dbd2d961..93a3e7f7 100644 --- a/Box.Sdk.Gen/Managers/Downloads/DownloadsManager.cs +++ b/Box.Sdk.Gen/Managers/Downloads/DownloadsManager.cs @@ -40,7 +40,7 @@ public DownloadsManager(NetworkSession? networkSession = default) { headers = headers ?? new DownloadFileHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "version", StringUtils.ToStringRepresentation(queryParams.Version) }, { "access_token", StringUtils.ToStringRepresentation(queryParams.AccessTokenField) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { { "range", StringUtils.ToStringRepresentation(headers.Range) }, { "boxapi", StringUtils.ToStringRepresentation(headers.Boxapi) } }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/files/", StringUtils.ToStringRepresentation(fileId), "/content"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Binary) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/files/", StringUtils.ToStringRepresentation(fileId), "/content"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Binary) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); if (StringUtils.ToStringRepresentation(response.Status) == "202") { return null; } diff --git a/Box.Sdk.Gen/Managers/EmailAliases/EmailAliasesManager.cs b/Box.Sdk.Gen/Managers/EmailAliases/EmailAliasesManager.cs index da4cb063..b8cfd1d4 100644 --- a/Box.Sdk.Gen/Managers/EmailAliases/EmailAliasesManager.cs +++ b/Box.Sdk.Gen/Managers/EmailAliases/EmailAliasesManager.cs @@ -31,7 +31,7 @@ public EmailAliasesManager(NetworkSession? networkSession = default) { public async System.Threading.Tasks.Task GetUserEmailAliasesAsync(string userId, GetUserEmailAliasesHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new GetUserEmailAliasesHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/users/", StringUtils.ToStringRepresentation(userId), "/email_aliases"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/users/", StringUtils.ToStringRepresentation(userId), "/email_aliases"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -54,7 +54,7 @@ public async System.Threading.Tasks.Task GetUserEmailAliasesAsync( public async System.Threading.Tasks.Task CreateUserEmailAliasAsync(string userId, CreateUserEmailAliasRequestBody requestBody, CreateUserEmailAliasHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new CreateUserEmailAliasHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/users/", StringUtils.ToStringRepresentation(userId), "/email_aliases"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/users/", StringUtils.ToStringRepresentation(userId), "/email_aliases"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -78,7 +78,7 @@ public async System.Threading.Tasks.Task CreateUserEmailAliasAsync(s public async System.Threading.Tasks.Task DeleteUserEmailAliasByIdAsync(string userId, string emailAliasId, DeleteUserEmailAliasByIdHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new DeleteUserEmailAliasByIdHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/users/", StringUtils.ToStringRepresentation(userId), "/email_aliases/", StringUtils.ToStringRepresentation(emailAliasId)), method: "DELETE", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/users/", StringUtils.ToStringRepresentation(userId), "/email_aliases/", StringUtils.ToStringRepresentation(emailAliasId)), method: "DELETE", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); } } diff --git a/Box.Sdk.Gen/Managers/Events/EventsManager.cs b/Box.Sdk.Gen/Managers/Events/EventsManager.cs index 47aba8fc..d9d5089e 100644 --- a/Box.Sdk.Gen/Managers/Events/EventsManager.cs +++ b/Box.Sdk.Gen/Managers/Events/EventsManager.cs @@ -58,7 +58,7 @@ public EventsManager(NetworkSession? networkSession = default) { public async System.Threading.Tasks.Task GetEventsWithLongPollingAsync(GetEventsWithLongPollingHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new GetEventsWithLongPollingHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/events"), method: "OPTIONS", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/events"), method: "OPTIONS", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -87,7 +87,7 @@ public async System.Threading.Tasks.Task GetEventsAsync(GetEventsQueryPa headers = headers ?? new GetEventsHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "stream_type", StringUtils.ToStringRepresentation(queryParams.StreamType) }, { "stream_position", StringUtils.ToStringRepresentation(queryParams.StreamPosition) }, { "limit", StringUtils.ToStringRepresentation(queryParams.Limit) }, { "event_type", StringUtils.ToStringRepresentation(queryParams.EventType) }, { "created_after", StringUtils.ToStringRepresentation(queryParams.CreatedAfter) }, { "created_before", StringUtils.ToStringRepresentation(queryParams.CreatedBefore) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/events"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/events"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } diff --git a/Box.Sdk.Gen/Managers/FileClassifications/FileClassificationsManager.cs b/Box.Sdk.Gen/Managers/FileClassifications/FileClassificationsManager.cs index 232ea3f9..29815e78 100644 --- a/Box.Sdk.Gen/Managers/FileClassifications/FileClassificationsManager.cs +++ b/Box.Sdk.Gen/Managers/FileClassifications/FileClassificationsManager.cs @@ -42,7 +42,7 @@ public FileClassificationsManager(NetworkSession? networkSession = default) { public async System.Threading.Tasks.Task GetClassificationOnFileAsync(string fileId, GetClassificationOnFileHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new GetClassificationOnFileHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/files/", StringUtils.ToStringRepresentation(fileId), "/metadata/enterprise/securityClassification-6VMVochwUWo"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/files/", StringUtils.ToStringRepresentation(fileId), "/metadata/enterprise/securityClassification-6VMVochwUWo"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -77,7 +77,7 @@ public async System.Threading.Tasks.Task AddClassificationToFile requestBody = requestBody ?? new AddClassificationToFileRequestBody(); headers = headers ?? new AddClassificationToFileHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/files/", StringUtils.ToStringRepresentation(fileId), "/metadata/enterprise/securityClassification-6VMVochwUWo"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/files/", StringUtils.ToStringRepresentation(fileId), "/metadata/enterprise/securityClassification-6VMVochwUWo"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -110,7 +110,7 @@ public async System.Threading.Tasks.Task AddClassificationToFile public async System.Threading.Tasks.Task UpdateClassificationOnFileAsync(string fileId, IReadOnlyList requestBody, UpdateClassificationOnFileHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new UpdateClassificationOnFileHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/files/", StringUtils.ToStringRepresentation(fileId), "/metadata/enterprise/securityClassification-6VMVochwUWo"), method: "PUT", contentType: "application/json-patch+json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/files/", StringUtils.ToStringRepresentation(fileId), "/metadata/enterprise/securityClassification-6VMVochwUWo"), method: "PUT", contentType: "application/json-patch+json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -140,7 +140,7 @@ public async System.Threading.Tasks.Task UpdateClassificationOnF public async System.Threading.Tasks.Task DeleteClassificationFromFileAsync(string fileId, DeleteClassificationFromFileHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new DeleteClassificationFromFileHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/files/", StringUtils.ToStringRepresentation(fileId), "/metadata/enterprise/securityClassification-6VMVochwUWo"), method: "DELETE", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/files/", StringUtils.ToStringRepresentation(fileId), "/metadata/enterprise/securityClassification-6VMVochwUWo"), method: "DELETE", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); } } diff --git a/Box.Sdk.Gen/Managers/FileMetadata/FileMetadataManager.cs b/Box.Sdk.Gen/Managers/FileMetadata/FileMetadataManager.cs index 0a70c011..c9321484 100644 --- a/Box.Sdk.Gen/Managers/FileMetadata/FileMetadataManager.cs +++ b/Box.Sdk.Gen/Managers/FileMetadata/FileMetadataManager.cs @@ -37,7 +37,7 @@ public FileMetadataManager(NetworkSession? networkSession = default) { public async System.Threading.Tasks.Task GetFileMetadataAsync(string fileId, GetFileMetadataHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new GetFileMetadataHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/files/", StringUtils.ToStringRepresentation(fileId), "/metadata"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/files/", StringUtils.ToStringRepresentation(fileId), "/metadata"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -72,7 +72,7 @@ public async System.Threading.Tasks.Task GetFileMetadataAsync(string public async System.Threading.Tasks.Task GetFileMetadataByIdAsync(string fileId, GetFileMetadataByIdScope scope, string templateKey, GetFileMetadataByIdHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new GetFileMetadataByIdHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/files/", StringUtils.ToStringRepresentation(fileId), "/metadata/", StringUtils.ToStringRepresentation(scope), "/", StringUtils.ToStringRepresentation(templateKey)), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/files/", StringUtils.ToStringRepresentation(fileId), "/metadata/", StringUtils.ToStringRepresentation(scope), "/", StringUtils.ToStringRepresentation(templateKey)), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -113,7 +113,7 @@ public async System.Threading.Tasks.Task GetFileMetadataByIdAsync( public async System.Threading.Tasks.Task CreateFileMetadataByIdAsync(string fileId, CreateFileMetadataByIdScope scope, string templateKey, Dictionary requestBody, CreateFileMetadataByIdHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new CreateFileMetadataByIdHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/files/", StringUtils.ToStringRepresentation(fileId), "/metadata/", StringUtils.ToStringRepresentation(scope), "/", StringUtils.ToStringRepresentation(templateKey)), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/files/", StringUtils.ToStringRepresentation(fileId), "/metadata/", StringUtils.ToStringRepresentation(scope), "/", StringUtils.ToStringRepresentation(templateKey)), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -157,7 +157,7 @@ public async System.Threading.Tasks.Task CreateFileMetadataByIdAsy public async System.Threading.Tasks.Task UpdateFileMetadataByIdAsync(string fileId, UpdateFileMetadataByIdScope scope, string templateKey, IReadOnlyList requestBody, UpdateFileMetadataByIdHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new UpdateFileMetadataByIdHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/files/", StringUtils.ToStringRepresentation(fileId), "/metadata/", StringUtils.ToStringRepresentation(scope), "/", StringUtils.ToStringRepresentation(templateKey)), method: "PUT", contentType: "application/json-patch+json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/files/", StringUtils.ToStringRepresentation(fileId), "/metadata/", StringUtils.ToStringRepresentation(scope), "/", StringUtils.ToStringRepresentation(templateKey)), method: "PUT", contentType: "application/json-patch+json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -191,7 +191,7 @@ public async System.Threading.Tasks.Task UpdateFileMetadataByIdAsy public async System.Threading.Tasks.Task DeleteFileMetadataByIdAsync(string fileId, DeleteFileMetadataByIdScope scope, string templateKey, DeleteFileMetadataByIdHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new DeleteFileMetadataByIdHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/files/", StringUtils.ToStringRepresentation(fileId), "/metadata/", StringUtils.ToStringRepresentation(scope), "/", StringUtils.ToStringRepresentation(templateKey)), method: "DELETE", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/files/", StringUtils.ToStringRepresentation(fileId), "/metadata/", StringUtils.ToStringRepresentation(scope), "/", StringUtils.ToStringRepresentation(templateKey)), method: "DELETE", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); } } diff --git a/Box.Sdk.Gen/Managers/FileRequests/FileRequestsManager.cs b/Box.Sdk.Gen/Managers/FileRequests/FileRequestsManager.cs index b92cf9a0..ec010e22 100644 --- a/Box.Sdk.Gen/Managers/FileRequests/FileRequestsManager.cs +++ b/Box.Sdk.Gen/Managers/FileRequests/FileRequestsManager.cs @@ -35,7 +35,7 @@ public FileRequestsManager(NetworkSession? networkSession = default) { public async System.Threading.Tasks.Task GetFileRequestByIdAsync(string fileRequestId, GetFileRequestByIdHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new GetFileRequestByIdHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/file_requests/", StringUtils.ToStringRepresentation(fileRequestId)), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/file_requests/", StringUtils.ToStringRepresentation(fileRequestId)), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -65,7 +65,7 @@ public async System.Threading.Tasks.Task GetFileRequestByIdAsync(st public async System.Threading.Tasks.Task UpdateFileRequestByIdAsync(string fileRequestId, FileRequestUpdateRequest requestBody, UpdateFileRequestByIdHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new UpdateFileRequestByIdHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { { "if-match", StringUtils.ToStringRepresentation(headers.IfMatch) } }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/file_requests/", StringUtils.ToStringRepresentation(fileRequestId)), method: "PUT", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/file_requests/", StringUtils.ToStringRepresentation(fileRequestId)), method: "PUT", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -91,7 +91,7 @@ public async System.Threading.Tasks.Task UpdateFileRequestByIdAsync public async System.Threading.Tasks.Task DeleteFileRequestByIdAsync(string fileRequestId, DeleteFileRequestByIdHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new DeleteFileRequestByIdHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/file_requests/", StringUtils.ToStringRepresentation(fileRequestId)), method: "DELETE", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/file_requests/", StringUtils.ToStringRepresentation(fileRequestId)), method: "DELETE", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); } /// @@ -120,7 +120,7 @@ public async System.Threading.Tasks.Task DeleteFileRequestByIdAsync(string fileR public async System.Threading.Tasks.Task CreateFileRequestCopyAsync(string fileRequestId, FileRequestCopyRequest requestBody, CreateFileRequestCopyHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new CreateFileRequestCopyHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/file_requests/", StringUtils.ToStringRepresentation(fileRequestId), "/copy"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/file_requests/", StringUtils.ToStringRepresentation(fileRequestId), "/copy"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } diff --git a/Box.Sdk.Gen/Managers/FileVersionLegalHolds/FileVersionLegalHoldsManager.cs b/Box.Sdk.Gen/Managers/FileVersionLegalHolds/FileVersionLegalHoldsManager.cs index 2c349093..1680b411 100644 --- a/Box.Sdk.Gen/Managers/FileVersionLegalHolds/FileVersionLegalHoldsManager.cs +++ b/Box.Sdk.Gen/Managers/FileVersionLegalHolds/FileVersionLegalHoldsManager.cs @@ -30,7 +30,7 @@ public FileVersionLegalHoldsManager(NetworkSession? networkSession = default) { public async System.Threading.Tasks.Task GetFileVersionLegalHoldByIdAsync(string fileVersionLegalHoldId, GetFileVersionLegalHoldByIdHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new GetFileVersionLegalHoldByIdHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/file_version_legal_holds/", StringUtils.ToStringRepresentation(fileVersionLegalHoldId)), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/file_version_legal_holds/", StringUtils.ToStringRepresentation(fileVersionLegalHoldId)), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -69,7 +69,7 @@ public async System.Threading.Tasks.Task GetFileVersionLe headers = headers ?? new GetFileVersionLegalHoldsHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "policy_id", StringUtils.ToStringRepresentation(queryParams.PolicyId) }, { "marker", StringUtils.ToStringRepresentation(queryParams.Marker) }, { "limit", StringUtils.ToStringRepresentation(queryParams.Limit) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/file_version_legal_holds"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/file_version_legal_holds"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } diff --git a/Box.Sdk.Gen/Managers/FileVersionRetentions/FileVersionRetentionsManager.cs b/Box.Sdk.Gen/Managers/FileVersionRetentions/FileVersionRetentionsManager.cs index 036c4e01..1293428e 100644 --- a/Box.Sdk.Gen/Managers/FileVersionRetentions/FileVersionRetentionsManager.cs +++ b/Box.Sdk.Gen/Managers/FileVersionRetentions/FileVersionRetentionsManager.cs @@ -35,7 +35,7 @@ public async System.Threading.Tasks.Task GetFileVersionRe headers = headers ?? new GetFileVersionRetentionsHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "file_id", StringUtils.ToStringRepresentation(queryParams.FileId) }, { "file_version_id", StringUtils.ToStringRepresentation(queryParams.FileVersionId) }, { "policy_id", StringUtils.ToStringRepresentation(queryParams.PolicyId) }, { "disposition_action", StringUtils.ToStringRepresentation(queryParams.DispositionAction) }, { "disposition_before", StringUtils.ToStringRepresentation(queryParams.DispositionBefore) }, { "disposition_after", StringUtils.ToStringRepresentation(queryParams.DispositionAfter) }, { "limit", StringUtils.ToStringRepresentation(queryParams.Limit) }, { "marker", StringUtils.ToStringRepresentation(queryParams.Marker) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/file_version_retentions"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/file_version_retentions"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -60,7 +60,7 @@ public async System.Threading.Tasks.Task GetFileVersionRe public async System.Threading.Tasks.Task GetFileVersionRetentionByIdAsync(string fileVersionRetentionId, GetFileVersionRetentionByIdHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new GetFileVersionRetentionByIdHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/file_version_retentions/", StringUtils.ToStringRepresentation(fileVersionRetentionId)), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/file_version_retentions/", StringUtils.ToStringRepresentation(fileVersionRetentionId)), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } diff --git a/Box.Sdk.Gen/Managers/FileVersions/FileVersionsManager.cs b/Box.Sdk.Gen/Managers/FileVersions/FileVersionsManager.cs index a8b81696..defffd72 100644 --- a/Box.Sdk.Gen/Managers/FileVersions/FileVersionsManager.cs +++ b/Box.Sdk.Gen/Managers/FileVersions/FileVersionsManager.cs @@ -45,7 +45,7 @@ public async System.Threading.Tasks.Task GetFileVersionsAsync(stri headers = headers ?? new GetFileVersionsHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "fields", StringUtils.ToStringRepresentation(queryParams.Fields) }, { "limit", StringUtils.ToStringRepresentation(queryParams.Limit) }, { "offset", StringUtils.ToStringRepresentation(queryParams.Offset) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/files/", StringUtils.ToStringRepresentation(fileId), "/versions"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/files/", StringUtils.ToStringRepresentation(fileId), "/versions"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -82,7 +82,7 @@ public async System.Threading.Tasks.Task GetFileVersionByIdAsyn headers = headers ?? new GetFileVersionByIdHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "fields", StringUtils.ToStringRepresentation(queryParams.Fields) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/files/", StringUtils.ToStringRepresentation(fileId), "/versions/", StringUtils.ToStringRepresentation(fileVersionId)), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/files/", StringUtils.ToStringRepresentation(fileId), "/versions/", StringUtils.ToStringRepresentation(fileVersionId)), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -114,7 +114,7 @@ public async System.Threading.Tasks.Task GetFileVersionByIdAsyn public async System.Threading.Tasks.Task DeleteFileVersionByIdAsync(string fileId, string fileVersionId, DeleteFileVersionByIdHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new DeleteFileVersionByIdHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { { "if-match", StringUtils.ToStringRepresentation(headers.IfMatch) } }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/files/", StringUtils.ToStringRepresentation(fileId), "/versions/", StringUtils.ToStringRepresentation(fileVersionId)), method: "DELETE", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/files/", StringUtils.ToStringRepresentation(fileId), "/versions/", StringUtils.ToStringRepresentation(fileVersionId)), method: "DELETE", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); } /// @@ -150,7 +150,7 @@ public async System.Threading.Tasks.Task UpdateFileVersionByIdA requestBody = requestBody ?? new UpdateFileVersionByIdRequestBody(); headers = headers ?? new UpdateFileVersionByIdHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/files/", StringUtils.ToStringRepresentation(fileId), "/versions/", StringUtils.ToStringRepresentation(fileVersionId)), method: "PUT", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/files/", StringUtils.ToStringRepresentation(fileId), "/versions/", StringUtils.ToStringRepresentation(fileVersionId)), method: "PUT", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -200,7 +200,7 @@ public async System.Threading.Tasks.Task PromoteFileVersionAsyn headers = headers ?? new PromoteFileVersionHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "fields", StringUtils.ToStringRepresentation(queryParams.Fields) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/files/", StringUtils.ToStringRepresentation(fileId), "/versions/current"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/files/", StringUtils.ToStringRepresentation(fileId), "/versions/current"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } diff --git a/Box.Sdk.Gen/Managers/FileWatermarks/FileWatermarksManager.cs b/Box.Sdk.Gen/Managers/FileWatermarks/FileWatermarksManager.cs index 3c309c24..9d91d6a4 100644 --- a/Box.Sdk.Gen/Managers/FileWatermarks/FileWatermarksManager.cs +++ b/Box.Sdk.Gen/Managers/FileWatermarks/FileWatermarksManager.cs @@ -36,7 +36,7 @@ public FileWatermarksManager(NetworkSession? networkSession = default) { public async System.Threading.Tasks.Task GetFileWatermarkAsync(string fileId, GetFileWatermarkHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new GetFileWatermarkHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/files/", StringUtils.ToStringRepresentation(fileId), "/watermark"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/files/", StringUtils.ToStringRepresentation(fileId), "/watermark"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -65,7 +65,7 @@ public async System.Threading.Tasks.Task GetFileWatermarkAsync(string public async System.Threading.Tasks.Task UpdateFileWatermarkAsync(string fileId, UpdateFileWatermarkRequestBody requestBody, UpdateFileWatermarkHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new UpdateFileWatermarkHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/files/", StringUtils.ToStringRepresentation(fileId), "/watermark"), method: "PUT", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/files/", StringUtils.ToStringRepresentation(fileId), "/watermark"), method: "PUT", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -91,7 +91,7 @@ public async System.Threading.Tasks.Task UpdateFileWatermarkAsync(str public async System.Threading.Tasks.Task DeleteFileWatermarkAsync(string fileId, DeleteFileWatermarkHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new DeleteFileWatermarkHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/files/", StringUtils.ToStringRepresentation(fileId), "/watermark"), method: "DELETE", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/files/", StringUtils.ToStringRepresentation(fileId), "/watermark"), method: "DELETE", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); } } diff --git a/Box.Sdk.Gen/Managers/Files/FilesManager.cs b/Box.Sdk.Gen/Managers/Files/FilesManager.cs index 3b7907d8..52d317be 100644 --- a/Box.Sdk.Gen/Managers/Files/FilesManager.cs +++ b/Box.Sdk.Gen/Managers/Files/FilesManager.cs @@ -42,7 +42,7 @@ public async System.Threading.Tasks.Task GetFileByIdAsync(string fileI headers = headers ?? new GetFileByIdHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "fields", StringUtils.ToStringRepresentation(queryParams.Fields) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { { "if-none-match", StringUtils.ToStringRepresentation(headers.IfNoneMatch) }, { "boxapi", StringUtils.ToStringRepresentation(headers.Boxapi) }, { "x-rep-hints", StringUtils.ToStringRepresentation(headers.XRepHints) } }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/files/", StringUtils.ToStringRepresentation(fileId)), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/files/", StringUtils.ToStringRepresentation(fileId)), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -78,7 +78,7 @@ public async System.Threading.Tasks.Task UpdateFileByIdAsync(string fi headers = headers ?? new UpdateFileByIdHeaders(); 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) } }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/files/", StringUtils.ToStringRepresentation(fileId)), method: "PUT", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/files/", StringUtils.ToStringRepresentation(fileId)), method: "PUT", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -108,7 +108,7 @@ public async System.Threading.Tasks.Task UpdateFileByIdAsync(string fi public async System.Threading.Tasks.Task DeleteFileByIdAsync(string fileId, DeleteFileByIdHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new DeleteFileByIdHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { { "if-match", StringUtils.ToStringRepresentation(headers.IfMatch) } }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/files/", StringUtils.ToStringRepresentation(fileId)), method: "DELETE", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/files/", StringUtils.ToStringRepresentation(fileId)), method: "DELETE", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); } /// @@ -141,7 +141,7 @@ public async System.Threading.Tasks.Task CopyFileAsync(string fileId, headers = headers ?? new CopyFileHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "fields", StringUtils.ToStringRepresentation(queryParams.Fields) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/files/", StringUtils.ToStringRepresentation(fileId), "/copy"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/files/", StringUtils.ToStringRepresentation(fileId), "/copy"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -185,7 +185,7 @@ public async System.Threading.Tasks.Task CopyFileAsync(string fileId, headers = headers ?? new GetFileThumbnailByIdHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "min_height", StringUtils.ToStringRepresentation(queryParams.MinHeight) }, { "min_width", StringUtils.ToStringRepresentation(queryParams.MinWidth) }, { "max_height", StringUtils.ToStringRepresentation(queryParams.MaxHeight) }, { "max_width", StringUtils.ToStringRepresentation(queryParams.MaxWidth) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/files/", StringUtils.ToStringRepresentation(fileId), "/thumbnail.", StringUtils.ToStringRepresentation(extension)), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Binary) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/files/", StringUtils.ToStringRepresentation(fileId), "/thumbnail.", StringUtils.ToStringRepresentation(extension)), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Binary) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); if (StringUtils.ToStringRepresentation(response.Status) == "202") { return null; } diff --git a/Box.Sdk.Gen/Managers/FolderClassifications/FolderClassificationsManager.cs b/Box.Sdk.Gen/Managers/FolderClassifications/FolderClassificationsManager.cs index 7bda16d7..35aa5f14 100644 --- a/Box.Sdk.Gen/Managers/FolderClassifications/FolderClassificationsManager.cs +++ b/Box.Sdk.Gen/Managers/FolderClassifications/FolderClassificationsManager.cs @@ -45,7 +45,7 @@ public FolderClassificationsManager(NetworkSession? networkSession = default) { public async System.Threading.Tasks.Task GetClassificationOnFolderAsync(string folderId, GetClassificationOnFolderHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new GetClassificationOnFolderHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/folders/", StringUtils.ToStringRepresentation(folderId), "/metadata/enterprise/securityClassification-6VMVochwUWo"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/folders/", StringUtils.ToStringRepresentation(folderId), "/metadata/enterprise/securityClassification-6VMVochwUWo"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -83,7 +83,7 @@ public async System.Threading.Tasks.Task AddClassificationToFold requestBody = requestBody ?? new AddClassificationToFolderRequestBody(); headers = headers ?? new AddClassificationToFolderHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/folders/", StringUtils.ToStringRepresentation(folderId), "/metadata/enterprise/securityClassification-6VMVochwUWo"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/folders/", StringUtils.ToStringRepresentation(folderId), "/metadata/enterprise/securityClassification-6VMVochwUWo"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -119,7 +119,7 @@ public async System.Threading.Tasks.Task AddClassificationToFold public async System.Threading.Tasks.Task UpdateClassificationOnFolderAsync(string folderId, IReadOnlyList requestBody, UpdateClassificationOnFolderHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new UpdateClassificationOnFolderHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/folders/", StringUtils.ToStringRepresentation(folderId), "/metadata/enterprise/securityClassification-6VMVochwUWo"), method: "PUT", contentType: "application/json-patch+json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/folders/", StringUtils.ToStringRepresentation(folderId), "/metadata/enterprise/securityClassification-6VMVochwUWo"), method: "PUT", contentType: "application/json-patch+json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -152,7 +152,7 @@ public async System.Threading.Tasks.Task UpdateClassificationOnF public async System.Threading.Tasks.Task DeleteClassificationFromFolderAsync(string folderId, DeleteClassificationFromFolderHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new DeleteClassificationFromFolderHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/folders/", StringUtils.ToStringRepresentation(folderId), "/metadata/enterprise/securityClassification-6VMVochwUWo"), method: "DELETE", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/folders/", StringUtils.ToStringRepresentation(folderId), "/metadata/enterprise/securityClassification-6VMVochwUWo"), method: "DELETE", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); } } diff --git a/Box.Sdk.Gen/Managers/FolderLocks/FolderLocksManager.cs b/Box.Sdk.Gen/Managers/FolderLocks/FolderLocksManager.cs index 9f7ffe21..2cca0a2f 100644 --- a/Box.Sdk.Gen/Managers/FolderLocks/FolderLocksManager.cs +++ b/Box.Sdk.Gen/Managers/FolderLocks/FolderLocksManager.cs @@ -33,7 +33,7 @@ public async System.Threading.Tasks.Task GetFolderLocksAsync(GetFol headers = headers ?? new GetFolderLocksHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "folder_id", StringUtils.ToStringRepresentation(queryParams.FolderId) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/folder_locks"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/folder_locks"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -56,7 +56,7 @@ public async System.Threading.Tasks.Task GetFolderLocksAsync(GetFol public async System.Threading.Tasks.Task CreateFolderLockAsync(CreateFolderLockRequestBody requestBody, CreateFolderLockHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new CreateFolderLockHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/folder_locks"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/folder_locks"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -79,7 +79,7 @@ public async System.Threading.Tasks.Task CreateFolderLockAsync(Creat public async System.Threading.Tasks.Task DeleteFolderLockByIdAsync(string folderLockId, DeleteFolderLockByIdHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new DeleteFolderLockByIdHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/folder_locks/", StringUtils.ToStringRepresentation(folderLockId)), method: "DELETE", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/folder_locks/", StringUtils.ToStringRepresentation(folderLockId)), method: "DELETE", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); } } diff --git a/Box.Sdk.Gen/Managers/FolderMetadata/FolderMetadataManager.cs b/Box.Sdk.Gen/Managers/FolderMetadata/FolderMetadataManager.cs index 645237ae..8f033cf9 100644 --- a/Box.Sdk.Gen/Managers/FolderMetadata/FolderMetadataManager.cs +++ b/Box.Sdk.Gen/Managers/FolderMetadata/FolderMetadataManager.cs @@ -41,7 +41,7 @@ public FolderMetadataManager(NetworkSession? networkSession = default) { public async System.Threading.Tasks.Task GetFolderMetadataAsync(string folderId, GetFolderMetadataHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new GetFolderMetadataHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/folders/", StringUtils.ToStringRepresentation(folderId), "/metadata"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/folders/", StringUtils.ToStringRepresentation(folderId), "/metadata"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -79,7 +79,7 @@ public async System.Threading.Tasks.Task GetFolderMetadataAsync(strin public async System.Threading.Tasks.Task GetFolderMetadataByIdAsync(string folderId, GetFolderMetadataByIdScope scope, string templateKey, GetFolderMetadataByIdHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new GetFolderMetadataByIdHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/folders/", StringUtils.ToStringRepresentation(folderId), "/metadata/", StringUtils.ToStringRepresentation(scope), "/", StringUtils.ToStringRepresentation(templateKey)), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/folders/", StringUtils.ToStringRepresentation(folderId), "/metadata/", StringUtils.ToStringRepresentation(scope), "/", StringUtils.ToStringRepresentation(templateKey)), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -127,7 +127,7 @@ public async System.Threading.Tasks.Task GetFolderMetadataByIdAsyn public async System.Threading.Tasks.Task CreateFolderMetadataByIdAsync(string folderId, CreateFolderMetadataByIdScope scope, string templateKey, Dictionary requestBody, CreateFolderMetadataByIdHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new CreateFolderMetadataByIdHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/folders/", StringUtils.ToStringRepresentation(folderId), "/metadata/", StringUtils.ToStringRepresentation(scope), "/", StringUtils.ToStringRepresentation(templateKey)), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/folders/", StringUtils.ToStringRepresentation(folderId), "/metadata/", StringUtils.ToStringRepresentation(scope), "/", StringUtils.ToStringRepresentation(templateKey)), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -174,7 +174,7 @@ public async System.Threading.Tasks.Task CreateFolderMetadataByIdA public async System.Threading.Tasks.Task UpdateFolderMetadataByIdAsync(string folderId, UpdateFolderMetadataByIdScope scope, string templateKey, IReadOnlyList requestBody, UpdateFolderMetadataByIdHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new UpdateFolderMetadataByIdHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/folders/", StringUtils.ToStringRepresentation(folderId), "/metadata/", StringUtils.ToStringRepresentation(scope), "/", StringUtils.ToStringRepresentation(templateKey)), method: "PUT", contentType: "application/json-patch+json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/folders/", StringUtils.ToStringRepresentation(folderId), "/metadata/", StringUtils.ToStringRepresentation(scope), "/", StringUtils.ToStringRepresentation(templateKey)), method: "PUT", contentType: "application/json-patch+json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -211,7 +211,7 @@ public async System.Threading.Tasks.Task UpdateFolderMetadataByIdA public async System.Threading.Tasks.Task DeleteFolderMetadataByIdAsync(string folderId, DeleteFolderMetadataByIdScope scope, string templateKey, DeleteFolderMetadataByIdHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new DeleteFolderMetadataByIdHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/folders/", StringUtils.ToStringRepresentation(folderId), "/metadata/", StringUtils.ToStringRepresentation(scope), "/", StringUtils.ToStringRepresentation(templateKey)), method: "DELETE", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/folders/", StringUtils.ToStringRepresentation(folderId), "/metadata/", StringUtils.ToStringRepresentation(scope), "/", StringUtils.ToStringRepresentation(templateKey)), method: "DELETE", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); } } diff --git a/Box.Sdk.Gen/Managers/FolderWatermarks/FolderWatermarksManager.cs b/Box.Sdk.Gen/Managers/FolderWatermarks/FolderWatermarksManager.cs index 905fab1c..db9f8103 100644 --- a/Box.Sdk.Gen/Managers/FolderWatermarks/FolderWatermarksManager.cs +++ b/Box.Sdk.Gen/Managers/FolderWatermarks/FolderWatermarksManager.cs @@ -39,7 +39,7 @@ public FolderWatermarksManager(NetworkSession? networkSession = default) { public async System.Threading.Tasks.Task GetFolderWatermarkAsync(string folderId, GetFolderWatermarkHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new GetFolderWatermarkHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/folders/", StringUtils.ToStringRepresentation(folderId), "/watermark"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/folders/", StringUtils.ToStringRepresentation(folderId), "/watermark"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -71,7 +71,7 @@ public async System.Threading.Tasks.Task GetFolderWatermarkAsync(stri public async System.Threading.Tasks.Task UpdateFolderWatermarkAsync(string folderId, UpdateFolderWatermarkRequestBody requestBody, UpdateFolderWatermarkHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new UpdateFolderWatermarkHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/folders/", StringUtils.ToStringRepresentation(folderId), "/watermark"), method: "PUT", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/folders/", StringUtils.ToStringRepresentation(folderId), "/watermark"), method: "PUT", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -100,7 +100,7 @@ public async System.Threading.Tasks.Task UpdateFolderWatermarkAsync(s public async System.Threading.Tasks.Task DeleteFolderWatermarkAsync(string folderId, DeleteFolderWatermarkHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new DeleteFolderWatermarkHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/folders/", StringUtils.ToStringRepresentation(folderId), "/watermark"), method: "DELETE", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/folders/", StringUtils.ToStringRepresentation(folderId), "/watermark"), method: "DELETE", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); } } diff --git a/Box.Sdk.Gen/Managers/Folders/FoldersManager.cs b/Box.Sdk.Gen/Managers/Folders/FoldersManager.cs index 4df5a442..92bd0c26 100644 --- a/Box.Sdk.Gen/Managers/Folders/FoldersManager.cs +++ b/Box.Sdk.Gen/Managers/Folders/FoldersManager.cs @@ -54,7 +54,7 @@ public async System.Threading.Tasks.Task GetFolderByIdAsync(string f headers = headers ?? new GetFolderByIdHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "fields", StringUtils.ToStringRepresentation(queryParams.Fields) }, { "sort", StringUtils.ToStringRepresentation(queryParams.Sort?.Value) }, { "direction", StringUtils.ToStringRepresentation(queryParams.Direction?.Value) }, { "offset", StringUtils.ToStringRepresentation(queryParams.Offset) }, { "limit", StringUtils.ToStringRepresentation(queryParams.Limit) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { { "if-none-match", StringUtils.ToStringRepresentation(headers.IfNoneMatch) }, { "boxapi", StringUtils.ToStringRepresentation(headers.Boxapi) } }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/folders/", StringUtils.ToStringRepresentation(folderId)), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/folders/", StringUtils.ToStringRepresentation(folderId)), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -93,7 +93,7 @@ public async System.Threading.Tasks.Task UpdateFolderByIdAsync(strin headers = headers ?? new UpdateFolderByIdHeaders(); 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) } }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/folders/", StringUtils.ToStringRepresentation(folderId)), method: "PUT", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/folders/", StringUtils.ToStringRepresentation(folderId)), method: "PUT", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -128,7 +128,7 @@ public async System.Threading.Tasks.Task DeleteFolderByIdAsync(string folderId, headers = headers ?? new DeleteFolderByIdHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "recursive", StringUtils.ToStringRepresentation(queryParams.Recursive) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { { "if-match", StringUtils.ToStringRepresentation(headers.IfMatch) } }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/folders/", StringUtils.ToStringRepresentation(folderId)), method: "DELETE", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/folders/", StringUtils.ToStringRepresentation(folderId)), method: "DELETE", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); } /// @@ -165,7 +165,7 @@ public async System.Threading.Tasks.Task GetFolderItemsAsync(string folde headers = headers ?? new GetFolderItemsHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "fields", StringUtils.ToStringRepresentation(queryParams.Fields) }, { "usemarker", StringUtils.ToStringRepresentation(queryParams.Usemarker) }, { "marker", StringUtils.ToStringRepresentation(queryParams.Marker) }, { "offset", StringUtils.ToStringRepresentation(queryParams.Offset) }, { "limit", StringUtils.ToStringRepresentation(queryParams.Limit) }, { "sort", StringUtils.ToStringRepresentation(queryParams.Sort?.Value) }, { "direction", StringUtils.ToStringRepresentation(queryParams.Direction?.Value) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { { "boxapi", StringUtils.ToStringRepresentation(headers.Boxapi) } }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/folders/", StringUtils.ToStringRepresentation(folderId), "/items"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/folders/", StringUtils.ToStringRepresentation(folderId), "/items"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -189,7 +189,7 @@ public async System.Threading.Tasks.Task CreateFolderAsync(CreateFol headers = headers ?? new CreateFolderHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "fields", StringUtils.ToStringRepresentation(queryParams.Fields) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/folders"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/folders"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -227,7 +227,7 @@ public async System.Threading.Tasks.Task CopyFolderAsync(string fold headers = headers ?? new CopyFolderHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "fields", StringUtils.ToStringRepresentation(queryParams.Fields) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/folders/", StringUtils.ToStringRepresentation(folderId), "/copy"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/folders/", StringUtils.ToStringRepresentation(folderId), "/copy"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } diff --git a/Box.Sdk.Gen/Managers/Groups/GroupsManager.cs b/Box.Sdk.Gen/Managers/Groups/GroupsManager.cs index 6ce66a4f..a4af561a 100644 --- a/Box.Sdk.Gen/Managers/Groups/GroupsManager.cs +++ b/Box.Sdk.Gen/Managers/Groups/GroupsManager.cs @@ -33,7 +33,7 @@ public async System.Threading.Tasks.Task GetGroupsAsync(GetGroupsQueryPa headers = headers ?? new GetGroupsHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "filter_term", StringUtils.ToStringRepresentation(queryParams.FilterTerm) }, { "fields", StringUtils.ToStringRepresentation(queryParams.Fields) }, { "limit", StringUtils.ToStringRepresentation(queryParams.Limit) }, { "offset", StringUtils.ToStringRepresentation(queryParams.Offset) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/groups"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/groups"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -58,7 +58,7 @@ public async System.Threading.Tasks.Task CreateGroupAsync(CreateGroup headers = headers ?? new CreateGroupHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "fields", StringUtils.ToStringRepresentation(queryParams.Fields) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/groups"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/groups"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -85,7 +85,7 @@ public async System.Threading.Tasks.Task GetGroupByIdAsync(string gro headers = headers ?? new GetGroupByIdHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "fields", StringUtils.ToStringRepresentation(queryParams.Fields) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/groups/", StringUtils.ToStringRepresentation(groupId)), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/groups/", StringUtils.ToStringRepresentation(groupId)), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -116,7 +116,7 @@ public async System.Threading.Tasks.Task UpdateGroupByIdAsync(string headers = headers ?? new UpdateGroupByIdHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "fields", StringUtils.ToStringRepresentation(queryParams.Fields) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/groups/", StringUtils.ToStringRepresentation(groupId)), method: "PUT", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/groups/", StringUtils.ToStringRepresentation(groupId)), method: "PUT", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -137,7 +137,7 @@ public async System.Threading.Tasks.Task UpdateGroupByIdAsync(string public async System.Threading.Tasks.Task DeleteGroupByIdAsync(string groupId, DeleteGroupByIdHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new DeleteGroupByIdHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/groups/", StringUtils.ToStringRepresentation(groupId)), method: "DELETE", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/groups/", StringUtils.ToStringRepresentation(groupId)), method: "DELETE", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); } } diff --git a/Box.Sdk.Gen/Managers/IntegrationMappings/IntegrationMappingsManager.cs b/Box.Sdk.Gen/Managers/IntegrationMappings/IntegrationMappingsManager.cs index 2453930f..eaab5731 100644 --- a/Box.Sdk.Gen/Managers/IntegrationMappings/IntegrationMappingsManager.cs +++ b/Box.Sdk.Gen/Managers/IntegrationMappings/IntegrationMappingsManager.cs @@ -34,7 +34,7 @@ public async System.Threading.Tasks.Task GetSlackIntegratio headers = headers ?? new GetSlackIntegrationMappingHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "marker", StringUtils.ToStringRepresentation(queryParams.Marker) }, { "limit", StringUtils.ToStringRepresentation(queryParams.Limit) }, { "partner_item_type", StringUtils.ToStringRepresentation(queryParams.PartnerItemType) }, { "partner_item_id", StringUtils.ToStringRepresentation(queryParams.PartnerItemId) }, { "box_item_id", StringUtils.ToStringRepresentation(queryParams.BoxItemId) }, { "box_item_type", StringUtils.ToStringRepresentation(queryParams.BoxItemType) }, { "is_manually_created", StringUtils.ToStringRepresentation(queryParams.IsManuallyCreated) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/integration_mappings/slack"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/integration_mappings/slack"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -57,7 +57,7 @@ public async System.Threading.Tasks.Task GetSlackIntegratio public async System.Threading.Tasks.Task CreateSlackIntegrationMappingAsync(IntegrationMappingSlackCreateRequest requestBody, CreateSlackIntegrationMappingHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new CreateSlackIntegrationMappingHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/integration_mappings/slack"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/integration_mappings/slack"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -85,7 +85,7 @@ public async System.Threading.Tasks.Task UpdateSlackIntegrat requestBody = requestBody ?? new UpdateSlackIntegrationMappingByIdRequestBody(); headers = headers ?? new UpdateSlackIntegrationMappingByIdHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/integration_mappings/slack/", StringUtils.ToStringRepresentation(integrationMappingId)), method: "PUT", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/integration_mappings/slack/", StringUtils.ToStringRepresentation(integrationMappingId)), method: "PUT", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -109,7 +109,7 @@ public async System.Threading.Tasks.Task UpdateSlackIntegrat public async System.Threading.Tasks.Task DeleteSlackIntegrationMappingByIdAsync(string integrationMappingId, DeleteSlackIntegrationMappingByIdHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new DeleteSlackIntegrationMappingByIdHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/integration_mappings/slack/", StringUtils.ToStringRepresentation(integrationMappingId)), method: "DELETE", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/integration_mappings/slack/", StringUtils.ToStringRepresentation(integrationMappingId)), method: "DELETE", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); } } diff --git a/Box.Sdk.Gen/Managers/Invites/InvitesManager.cs b/Box.Sdk.Gen/Managers/Invites/InvitesManager.cs index eded1da8..c0eba372 100644 --- a/Box.Sdk.Gen/Managers/Invites/InvitesManager.cs +++ b/Box.Sdk.Gen/Managers/Invites/InvitesManager.cs @@ -43,7 +43,7 @@ public async System.Threading.Tasks.Task CreateInviteAsync(CreateInviteR headers = headers ?? new CreateInviteHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "fields", StringUtils.ToStringRepresentation(queryParams.Fields) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/invites"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/invites"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -68,7 +68,7 @@ public async System.Threading.Tasks.Task GetInviteByIdAsync(string invit headers = headers ?? new GetInviteByIdHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "fields", StringUtils.ToStringRepresentation(queryParams.Fields) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/invites/", StringUtils.ToStringRepresentation(inviteId)), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/invites/", StringUtils.ToStringRepresentation(inviteId)), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } diff --git a/Box.Sdk.Gen/Managers/LegalHoldPolicies/LegalHoldPoliciesManager.cs b/Box.Sdk.Gen/Managers/LegalHoldPolicies/LegalHoldPoliciesManager.cs index 53b480b7..c81b5be2 100644 --- a/Box.Sdk.Gen/Managers/LegalHoldPolicies/LegalHoldPoliciesManager.cs +++ b/Box.Sdk.Gen/Managers/LegalHoldPolicies/LegalHoldPoliciesManager.cs @@ -33,7 +33,7 @@ public async System.Threading.Tasks.Task GetLegalHoldPolicies headers = headers ?? new GetLegalHoldPoliciesHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "policy_name", StringUtils.ToStringRepresentation(queryParams.PolicyName) }, { "fields", StringUtils.ToStringRepresentation(queryParams.Fields) }, { "marker", StringUtils.ToStringRepresentation(queryParams.Marker) }, { "limit", StringUtils.ToStringRepresentation(queryParams.Limit) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/legal_hold_policies"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/legal_hold_policies"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -52,7 +52,7 @@ public async System.Threading.Tasks.Task GetLegalHoldPolicies public async System.Threading.Tasks.Task CreateLegalHoldPolicyAsync(CreateLegalHoldPolicyRequestBody requestBody, CreateLegalHoldPolicyHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new CreateLegalHoldPolicyHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/legal_hold_policies"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/legal_hold_policies"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -72,7 +72,7 @@ public async System.Threading.Tasks.Task CreateLegalHoldPolicyA public async System.Threading.Tasks.Task GetLegalHoldPolicyByIdAsync(string legalHoldPolicyId, GetLegalHoldPolicyByIdHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new GetLegalHoldPolicyByIdHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/legal_hold_policies/", StringUtils.ToStringRepresentation(legalHoldPolicyId)), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/legal_hold_policies/", StringUtils.ToStringRepresentation(legalHoldPolicyId)), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -96,7 +96,7 @@ public async System.Threading.Tasks.Task UpdateLegalHoldPolicyB requestBody = requestBody ?? new UpdateLegalHoldPolicyByIdRequestBody(); headers = headers ?? new UpdateLegalHoldPolicyByIdHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/legal_hold_policies/", StringUtils.ToStringRepresentation(legalHoldPolicyId)), method: "PUT", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/legal_hold_policies/", StringUtils.ToStringRepresentation(legalHoldPolicyId)), method: "PUT", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -119,7 +119,7 @@ public async System.Threading.Tasks.Task UpdateLegalHoldPolicyB public async System.Threading.Tasks.Task DeleteLegalHoldPolicyByIdAsync(string legalHoldPolicyId, DeleteLegalHoldPolicyByIdHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new DeleteLegalHoldPolicyByIdHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/legal_hold_policies/", StringUtils.ToStringRepresentation(legalHoldPolicyId)), method: "DELETE", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/legal_hold_policies/", StringUtils.ToStringRepresentation(legalHoldPolicyId)), method: "DELETE", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); } } diff --git a/Box.Sdk.Gen/Managers/LegalHoldPolicyAssignments/LegalHoldPolicyAssignmentsManager.cs b/Box.Sdk.Gen/Managers/LegalHoldPolicyAssignments/LegalHoldPolicyAssignmentsManager.cs index fcf01f38..906514b4 100644 --- a/Box.Sdk.Gen/Managers/LegalHoldPolicyAssignments/LegalHoldPolicyAssignmentsManager.cs +++ b/Box.Sdk.Gen/Managers/LegalHoldPolicyAssignments/LegalHoldPolicyAssignmentsManager.cs @@ -31,7 +31,7 @@ public async System.Threading.Tasks.Task GetLegalHol headers = headers ?? new GetLegalHoldPolicyAssignmentsHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "policy_id", StringUtils.ToStringRepresentation(queryParams.PolicyId) }, { "assign_to_type", StringUtils.ToStringRepresentation(queryParams.AssignToType) }, { "assign_to_id", StringUtils.ToStringRepresentation(queryParams.AssignToId) }, { "marker", StringUtils.ToStringRepresentation(queryParams.Marker) }, { "limit", StringUtils.ToStringRepresentation(queryParams.Limit) }, { "fields", StringUtils.ToStringRepresentation(queryParams.Fields) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/legal_hold_policy_assignments"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/legal_hold_policy_assignments"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -50,7 +50,7 @@ public async System.Threading.Tasks.Task GetLegalHol public async System.Threading.Tasks.Task CreateLegalHoldPolicyAssignmentAsync(CreateLegalHoldPolicyAssignmentRequestBody requestBody, CreateLegalHoldPolicyAssignmentHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new CreateLegalHoldPolicyAssignmentHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/legal_hold_policy_assignments"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/legal_hold_policy_assignments"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -70,7 +70,7 @@ public async System.Threading.Tasks.Task CreateLegalH public async System.Threading.Tasks.Task GetLegalHoldPolicyAssignmentByIdAsync(string legalHoldPolicyAssignmentId, GetLegalHoldPolicyAssignmentByIdHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new GetLegalHoldPolicyAssignmentByIdHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/legal_hold_policy_assignments/", StringUtils.ToStringRepresentation(legalHoldPolicyAssignmentId)), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/legal_hold_policy_assignments/", StringUtils.ToStringRepresentation(legalHoldPolicyAssignmentId)), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -93,7 +93,7 @@ public async System.Threading.Tasks.Task GetLegalHold public async System.Threading.Tasks.Task DeleteLegalHoldPolicyAssignmentByIdAsync(string legalHoldPolicyAssignmentId, DeleteLegalHoldPolicyAssignmentByIdHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new DeleteLegalHoldPolicyAssignmentByIdHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/legal_hold_policy_assignments/", StringUtils.ToStringRepresentation(legalHoldPolicyAssignmentId)), method: "DELETE", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/legal_hold_policy_assignments/", StringUtils.ToStringRepresentation(legalHoldPolicyAssignmentId)), method: "DELETE", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); } /// @@ -135,7 +135,7 @@ public async System.Threading.Tasks.Task GetLegalHoldPolicyAssignme headers = headers ?? new GetLegalHoldPolicyAssignmentFileOnHoldHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "marker", StringUtils.ToStringRepresentation(queryParams.Marker) }, { "limit", StringUtils.ToStringRepresentation(queryParams.Limit) }, { "fields", StringUtils.ToStringRepresentation(queryParams.Fields) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/legal_hold_policy_assignments/", StringUtils.ToStringRepresentation(legalHoldPolicyAssignmentId), "/files_on_hold"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/legal_hold_policy_assignments/", StringUtils.ToStringRepresentation(legalHoldPolicyAssignmentId), "/files_on_hold"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } diff --git a/Box.Sdk.Gen/Managers/ListCollaborations/ListCollaborationsManager.cs b/Box.Sdk.Gen/Managers/ListCollaborations/ListCollaborationsManager.cs index 8a915ce4..c02a0303 100644 --- a/Box.Sdk.Gen/Managers/ListCollaborations/ListCollaborationsManager.cs +++ b/Box.Sdk.Gen/Managers/ListCollaborations/ListCollaborationsManager.cs @@ -43,7 +43,7 @@ public async System.Threading.Tasks.Task GetFileCollaborationsAs headers = headers ?? new GetFileCollaborationsHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "fields", StringUtils.ToStringRepresentation(queryParams.Fields) }, { "limit", StringUtils.ToStringRepresentation(queryParams.Limit) }, { "marker", StringUtils.ToStringRepresentation(queryParams.Marker) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/files/", StringUtils.ToStringRepresentation(fileId), "/collaborations"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/files/", StringUtils.ToStringRepresentation(fileId), "/collaborations"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -76,7 +76,7 @@ public async System.Threading.Tasks.Task GetFolderCollaborations headers = headers ?? new GetFolderCollaborationsHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "fields", StringUtils.ToStringRepresentation(queryParams.Fields) }, { "limit", StringUtils.ToStringRepresentation(queryParams.Limit) }, { "marker", StringUtils.ToStringRepresentation(queryParams.Marker) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/folders/", StringUtils.ToStringRepresentation(folderId), "/collaborations"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/folders/", StringUtils.ToStringRepresentation(folderId), "/collaborations"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -96,7 +96,7 @@ public async System.Threading.Tasks.Task GetColla headers = headers ?? new GetCollaborationsHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "status", StringUtils.ToStringRepresentation(queryParams.Status?.Value) }, { "fields", StringUtils.ToStringRepresentation(queryParams.Fields) }, { "offset", StringUtils.ToStringRepresentation(queryParams.Offset) }, { "limit", StringUtils.ToStringRepresentation(queryParams.Limit) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/collaborations"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/collaborations"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -125,7 +125,7 @@ public async System.Threading.Tasks.Task GetGroup headers = headers ?? new GetGroupCollaborationsHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "limit", StringUtils.ToStringRepresentation(queryParams.Limit) }, { "offset", StringUtils.ToStringRepresentation(queryParams.Offset) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/groups/", StringUtils.ToStringRepresentation(groupId), "/collaborations"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/groups/", StringUtils.ToStringRepresentation(groupId), "/collaborations"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } diff --git a/Box.Sdk.Gen/Managers/Memberships/MembershipsManager.cs b/Box.Sdk.Gen/Managers/Memberships/MembershipsManager.cs index 7b82911f..d333a807 100644 --- a/Box.Sdk.Gen/Managers/Memberships/MembershipsManager.cs +++ b/Box.Sdk.Gen/Managers/Memberships/MembershipsManager.cs @@ -38,7 +38,7 @@ public async System.Threading.Tasks.Task GetUserMembershipsAsy headers = headers ?? new GetUserMembershipsHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "limit", StringUtils.ToStringRepresentation(queryParams.Limit) }, { "offset", StringUtils.ToStringRepresentation(queryParams.Offset) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/users/", StringUtils.ToStringRepresentation(userId), "/memberships"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/users/", StringUtils.ToStringRepresentation(userId), "/memberships"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -65,7 +65,7 @@ public async System.Threading.Tasks.Task GetGroupMembershipsAs headers = headers ?? new GetGroupMembershipsHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "limit", StringUtils.ToStringRepresentation(queryParams.Limit) }, { "offset", StringUtils.ToStringRepresentation(queryParams.Offset) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/groups/", StringUtils.ToStringRepresentation(groupId), "/memberships"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/groups/", StringUtils.ToStringRepresentation(groupId), "/memberships"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -90,7 +90,7 @@ public async System.Threading.Tasks.Task CreateGroupMembershipA headers = headers ?? new CreateGroupMembershipHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "fields", StringUtils.ToStringRepresentation(queryParams.Fields) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/group_memberships"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/group_memberships"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -117,7 +117,7 @@ public async System.Threading.Tasks.Task GetGroupMembershipById headers = headers ?? new GetGroupMembershipByIdHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "fields", StringUtils.ToStringRepresentation(queryParams.Fields) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/group_memberships/", StringUtils.ToStringRepresentation(groupMembershipId)), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/group_memberships/", StringUtils.ToStringRepresentation(groupMembershipId)), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -148,7 +148,7 @@ public async System.Threading.Tasks.Task UpdateGroupMembershipB headers = headers ?? new UpdateGroupMembershipByIdHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "fields", StringUtils.ToStringRepresentation(queryParams.Fields) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/group_memberships/", StringUtils.ToStringRepresentation(groupMembershipId)), method: "PUT", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/group_memberships/", StringUtils.ToStringRepresentation(groupMembershipId)), method: "PUT", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -170,7 +170,7 @@ public async System.Threading.Tasks.Task UpdateGroupMembershipB public async System.Threading.Tasks.Task DeleteGroupMembershipByIdAsync(string groupMembershipId, DeleteGroupMembershipByIdHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new DeleteGroupMembershipByIdHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/group_memberships/", StringUtils.ToStringRepresentation(groupMembershipId)), method: "DELETE", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/group_memberships/", StringUtils.ToStringRepresentation(groupMembershipId)), method: "DELETE", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); } } diff --git a/Box.Sdk.Gen/Managers/MetadataCascadePolicies/MetadataCascadePoliciesManager.cs b/Box.Sdk.Gen/Managers/MetadataCascadePolicies/MetadataCascadePoliciesManager.cs index b85e961c..5054253a 100644 --- a/Box.Sdk.Gen/Managers/MetadataCascadePolicies/MetadataCascadePoliciesManager.cs +++ b/Box.Sdk.Gen/Managers/MetadataCascadePolicies/MetadataCascadePoliciesManager.cs @@ -32,7 +32,7 @@ public async System.Threading.Tasks.Task GetMetadataCas headers = headers ?? new GetMetadataCascadePoliciesHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "folder_id", StringUtils.ToStringRepresentation(queryParams.FolderId) }, { "owner_enterprise_id", StringUtils.ToStringRepresentation(queryParams.OwnerEnterpriseId) }, { "marker", StringUtils.ToStringRepresentation(queryParams.Marker) }, { "offset", StringUtils.ToStringRepresentation(queryParams.Offset) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/metadata_cascade_policies"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/metadata_cascade_policies"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -56,7 +56,7 @@ public async System.Threading.Tasks.Task GetMetadataCas public async System.Threading.Tasks.Task CreateMetadataCascadePolicyAsync(CreateMetadataCascadePolicyRequestBody requestBody, CreateMetadataCascadePolicyHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new CreateMetadataCascadePolicyHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/metadata_cascade_policies"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/metadata_cascade_policies"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -76,7 +76,7 @@ public async System.Threading.Tasks.Task CreateMetadataCa public async System.Threading.Tasks.Task GetMetadataCascadePolicyByIdAsync(string metadataCascadePolicyId, GetMetadataCascadePolicyByIdHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new GetMetadataCascadePolicyByIdHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/metadata_cascade_policies/", StringUtils.ToStringRepresentation(metadataCascadePolicyId)), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/metadata_cascade_policies/", StringUtils.ToStringRepresentation(metadataCascadePolicyId)), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -96,7 +96,7 @@ public async System.Threading.Tasks.Task GetMetadataCasca public async System.Threading.Tasks.Task DeleteMetadataCascadePolicyByIdAsync(string metadataCascadePolicyId, DeleteMetadataCascadePolicyByIdHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new DeleteMetadataCascadePolicyByIdHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/metadata_cascade_policies/", StringUtils.ToStringRepresentation(metadataCascadePolicyId)), method: "DELETE", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/metadata_cascade_policies/", StringUtils.ToStringRepresentation(metadataCascadePolicyId)), method: "DELETE", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); } /// @@ -121,7 +121,7 @@ public async System.Threading.Tasks.Task DeleteMetadataCascadePolicyByIdAsync(st public async System.Threading.Tasks.Task ApplyMetadataCascadePolicyAsync(string metadataCascadePolicyId, ApplyMetadataCascadePolicyRequestBody requestBody, ApplyMetadataCascadePolicyHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new ApplyMetadataCascadePolicyHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/metadata_cascade_policies/", StringUtils.ToStringRepresentation(metadataCascadePolicyId), "/apply"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/metadata_cascade_policies/", StringUtils.ToStringRepresentation(metadataCascadePolicyId), "/apply"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); } } diff --git a/Box.Sdk.Gen/Managers/MetadataTemplates/MetadataTemplatesManager.cs b/Box.Sdk.Gen/Managers/MetadataTemplates/MetadataTemplatesManager.cs index deda690a..1b6be85b 100644 --- a/Box.Sdk.Gen/Managers/MetadataTemplates/MetadataTemplatesManager.cs +++ b/Box.Sdk.Gen/Managers/MetadataTemplates/MetadataTemplatesManager.cs @@ -32,7 +32,7 @@ public async System.Threading.Tasks.Task GetMetadataTemplates headers = headers ?? new GetMetadataTemplatesByInstanceIdHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "metadata_instance_id", StringUtils.ToStringRepresentation(queryParams.MetadataInstanceId) }, { "marker", StringUtils.ToStringRepresentation(queryParams.Marker) }, { "limit", StringUtils.ToStringRepresentation(queryParams.Limit) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/metadata_templates"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/metadata_templates"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -59,7 +59,7 @@ public async System.Threading.Tasks.Task GetMetadataTemplates public async System.Threading.Tasks.Task GetMetadataTemplateAsync(GetMetadataTemplateScope scope, string templateKey, GetMetadataTemplateHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new GetMetadataTemplateHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/metadata_templates/", StringUtils.ToStringRepresentation(scope), "/", StringUtils.ToStringRepresentation(templateKey), "/schema"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/metadata_templates/", StringUtils.ToStringRepresentation(scope), "/", StringUtils.ToStringRepresentation(templateKey), "/schema"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -92,7 +92,7 @@ public async System.Threading.Tasks.Task GetMetadataTemplateAs public async System.Threading.Tasks.Task UpdateMetadataTemplateAsync(UpdateMetadataTemplateScope scope, string templateKey, IReadOnlyList requestBody, UpdateMetadataTemplateHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new UpdateMetadataTemplateHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/metadata_templates/", StringUtils.ToStringRepresentation(scope), "/", StringUtils.ToStringRepresentation(templateKey), "/schema"), method: "PUT", contentType: "application/json-patch+json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/metadata_templates/", StringUtils.ToStringRepresentation(scope), "/", StringUtils.ToStringRepresentation(templateKey), "/schema"), method: "PUT", contentType: "application/json-patch+json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -117,7 +117,7 @@ public async System.Threading.Tasks.Task UpdateMetadataTemplat public async System.Threading.Tasks.Task DeleteMetadataTemplateAsync(DeleteMetadataTemplateScope scope, string templateKey, DeleteMetadataTemplateHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new DeleteMetadataTemplateHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/metadata_templates/", StringUtils.ToStringRepresentation(scope), "/", StringUtils.ToStringRepresentation(templateKey), "/schema"), method: "DELETE", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/metadata_templates/", StringUtils.ToStringRepresentation(scope), "/", StringUtils.ToStringRepresentation(templateKey), "/schema"), method: "DELETE", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); } /// @@ -136,7 +136,7 @@ public async System.Threading.Tasks.Task DeleteMetadataTemplateAsync(DeleteMetad public async System.Threading.Tasks.Task GetMetadataTemplateByIdAsync(string templateId, GetMetadataTemplateByIdHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new GetMetadataTemplateByIdHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/metadata_templates/", StringUtils.ToStringRepresentation(templateId)), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/metadata_templates/", StringUtils.ToStringRepresentation(templateId)), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -158,7 +158,7 @@ public async System.Threading.Tasks.Task GetGlobalMetadataTem headers = headers ?? new GetGlobalMetadataTemplatesHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "marker", StringUtils.ToStringRepresentation(queryParams.Marker) }, { "limit", StringUtils.ToStringRepresentation(queryParams.Limit) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/metadata_templates/global"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/metadata_templates/global"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -180,7 +180,7 @@ public async System.Threading.Tasks.Task GetEnterpriseMetadat headers = headers ?? new GetEnterpriseMetadataTemplatesHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "marker", StringUtils.ToStringRepresentation(queryParams.Marker) }, { "limit", StringUtils.ToStringRepresentation(queryParams.Limit) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/metadata_templates/enterprise"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/metadata_templates/enterprise"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -200,7 +200,7 @@ public async System.Threading.Tasks.Task GetEnterpriseMetadat public async System.Threading.Tasks.Task CreateMetadataTemplateAsync(CreateMetadataTemplateRequestBody requestBody, CreateMetadataTemplateHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new CreateMetadataTemplateHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/metadata_templates/schema"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/metadata_templates/schema"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } diff --git a/Box.Sdk.Gen/Managers/RecentItems/RecentItemsManager.cs b/Box.Sdk.Gen/Managers/RecentItems/RecentItemsManager.cs index e2f67742..7c58286c 100644 --- a/Box.Sdk.Gen/Managers/RecentItems/RecentItemsManager.cs +++ b/Box.Sdk.Gen/Managers/RecentItems/RecentItemsManager.cs @@ -33,7 +33,7 @@ public async System.Threading.Tasks.Task GetRecentItemsAsync(GetRec headers = headers ?? new GetRecentItemsHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "fields", StringUtils.ToStringRepresentation(queryParams.Fields) }, { "limit", StringUtils.ToStringRepresentation(queryParams.Limit) }, { "marker", StringUtils.ToStringRepresentation(queryParams.Marker) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/recent_items"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/recent_items"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } diff --git a/Box.Sdk.Gen/Managers/RetentionPolicies/RetentionPoliciesManager.cs b/Box.Sdk.Gen/Managers/RetentionPolicies/RetentionPoliciesManager.cs index a727ff6f..308f2477 100644 --- a/Box.Sdk.Gen/Managers/RetentionPolicies/RetentionPoliciesManager.cs +++ b/Box.Sdk.Gen/Managers/RetentionPolicies/RetentionPoliciesManager.cs @@ -32,7 +32,7 @@ public async System.Threading.Tasks.Task GetRetentionPolicies headers = headers ?? new GetRetentionPoliciesHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "policy_name", StringUtils.ToStringRepresentation(queryParams.PolicyName) }, { "policy_type", StringUtils.ToStringRepresentation(queryParams.PolicyType) }, { "created_by_user_id", StringUtils.ToStringRepresentation(queryParams.CreatedByUserId) }, { "fields", StringUtils.ToStringRepresentation(queryParams.Fields) }, { "limit", StringUtils.ToStringRepresentation(queryParams.Limit) }, { "marker", StringUtils.ToStringRepresentation(queryParams.Marker) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/retention_policies"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/retention_policies"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -51,7 +51,7 @@ public async System.Threading.Tasks.Task GetRetentionPolicies public async System.Threading.Tasks.Task CreateRetentionPolicyAsync(CreateRetentionPolicyRequestBody requestBody, CreateRetentionPolicyHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new CreateRetentionPolicyHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/retention_policies"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/retention_policies"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -76,7 +76,7 @@ public async System.Threading.Tasks.Task GetRetentionPolicyById headers = headers ?? new GetRetentionPolicyByIdHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "fields", StringUtils.ToStringRepresentation(queryParams.Fields) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/retention_policies/", StringUtils.ToStringRepresentation(retentionPolicyId)), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/retention_policies/", StringUtils.ToStringRepresentation(retentionPolicyId)), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -100,7 +100,7 @@ public async System.Threading.Tasks.Task UpdateRetentionPolicyB requestBody = requestBody ?? new UpdateRetentionPolicyByIdRequestBody(); headers = headers ?? new UpdateRetentionPolicyByIdHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/retention_policies/", StringUtils.ToStringRepresentation(retentionPolicyId)), method: "PUT", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/retention_policies/", StringUtils.ToStringRepresentation(retentionPolicyId)), method: "PUT", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -120,7 +120,7 @@ public async System.Threading.Tasks.Task UpdateRetentionPolicyB public async System.Threading.Tasks.Task DeleteRetentionPolicyByIdAsync(string retentionPolicyId, DeleteRetentionPolicyByIdHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new DeleteRetentionPolicyByIdHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/retention_policies/", StringUtils.ToStringRepresentation(retentionPolicyId)), method: "DELETE", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/retention_policies/", StringUtils.ToStringRepresentation(retentionPolicyId)), method: "DELETE", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); } } diff --git a/Box.Sdk.Gen/Managers/RetentionPolicyAssignments/RetentionPolicyAssignmentsManager.cs b/Box.Sdk.Gen/Managers/RetentionPolicyAssignments/RetentionPolicyAssignmentsManager.cs index f8360c9f..cc8495f0 100644 --- a/Box.Sdk.Gen/Managers/RetentionPolicyAssignments/RetentionPolicyAssignmentsManager.cs +++ b/Box.Sdk.Gen/Managers/RetentionPolicyAssignments/RetentionPolicyAssignmentsManager.cs @@ -37,7 +37,7 @@ public async System.Threading.Tasks.Task GetRetentio headers = headers ?? new GetRetentionPolicyAssignmentsHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "type", StringUtils.ToStringRepresentation(queryParams.Type?.Value) }, { "fields", StringUtils.ToStringRepresentation(queryParams.Fields) }, { "marker", StringUtils.ToStringRepresentation(queryParams.Marker) }, { "limit", StringUtils.ToStringRepresentation(queryParams.Limit) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/retention_policies/", StringUtils.ToStringRepresentation(retentionPolicyId), "/assignments"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/retention_policies/", StringUtils.ToStringRepresentation(retentionPolicyId), "/assignments"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -56,7 +56,7 @@ public async System.Threading.Tasks.Task GetRetentio public async System.Threading.Tasks.Task CreateRetentionPolicyAssignmentAsync(CreateRetentionPolicyAssignmentRequestBody requestBody, CreateRetentionPolicyAssignmentHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new CreateRetentionPolicyAssignmentHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/retention_policy_assignments"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/retention_policy_assignments"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -81,7 +81,7 @@ public async System.Threading.Tasks.Task GetRetention headers = headers ?? new GetRetentionPolicyAssignmentByIdHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "fields", StringUtils.ToStringRepresentation(queryParams.Fields) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/retention_policy_assignments/", StringUtils.ToStringRepresentation(retentionPolicyAssignmentId)), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/retention_policy_assignments/", StringUtils.ToStringRepresentation(retentionPolicyAssignmentId)), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -102,7 +102,7 @@ public async System.Threading.Tasks.Task GetRetention public async System.Threading.Tasks.Task DeleteRetentionPolicyAssignmentByIdAsync(string retentionPolicyAssignmentId, DeleteRetentionPolicyAssignmentByIdHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new DeleteRetentionPolicyAssignmentByIdHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/retention_policy_assignments/", StringUtils.ToStringRepresentation(retentionPolicyAssignmentId)), method: "DELETE", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/retention_policy_assignments/", StringUtils.ToStringRepresentation(retentionPolicyAssignmentId)), method: "DELETE", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); } /// @@ -126,7 +126,7 @@ public async System.Threading.Tasks.Task GetFilesUnderReten headers = headers ?? new GetFilesUnderRetentionPolicyAssignmentHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "marker", StringUtils.ToStringRepresentation(queryParams.Marker) }, { "limit", StringUtils.ToStringRepresentation(queryParams.Limit) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/retention_policy_assignments/", StringUtils.ToStringRepresentation(retentionPolicyAssignmentId), "/files_under_retention"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/retention_policy_assignments/", StringUtils.ToStringRepresentation(retentionPolicyAssignmentId), "/files_under_retention"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } diff --git a/Box.Sdk.Gen/Managers/Search/SearchManager.cs b/Box.Sdk.Gen/Managers/Search/SearchManager.cs index 4871ebd7..7eae0f14 100644 --- a/Box.Sdk.Gen/Managers/Search/SearchManager.cs +++ b/Box.Sdk.Gen/Managers/Search/SearchManager.cs @@ -34,7 +34,7 @@ public SearchManager(NetworkSession? networkSession = default) { public async System.Threading.Tasks.Task SearchByMetadataQueryAsync(MetadataQuery requestBody, SearchByMetadataQueryHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new SearchByMetadataQueryHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/metadata_queries/execute_read"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/metadata_queries/execute_read"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -56,7 +56,7 @@ public async System.Threading.Tasks.Task queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "query", StringUtils.ToStringRepresentation(queryParams.Query) }, { "scope", StringUtils.ToStringRepresentation(queryParams.Scope?.Value) }, { "file_extensions", StringUtils.ToStringRepresentation(queryParams.FileExtensions) }, { "created_at_range", StringUtils.ToStringRepresentation(queryParams.CreatedAtRange) }, { "updated_at_range", StringUtils.ToStringRepresentation(queryParams.UpdatedAtRange) }, { "size_range", StringUtils.ToStringRepresentation(queryParams.SizeRange) }, { "owner_user_ids", StringUtils.ToStringRepresentation(queryParams.OwnerUserIds) }, { "recent_updater_user_ids", StringUtils.ToStringRepresentation(queryParams.RecentUpdaterUserIds) }, { "ancestor_folder_ids", StringUtils.ToStringRepresentation(queryParams.AncestorFolderIds) }, { "content_types", StringUtils.ToStringRepresentation(queryParams.ContentTypes) }, { "type", StringUtils.ToStringRepresentation(queryParams.Type?.Value) }, { "trash_content", StringUtils.ToStringRepresentation(queryParams.TrashContent) }, { "mdfilters", StringUtils.ToStringRepresentation(queryParams.Mdfilters) }, { "sort", StringUtils.ToStringRepresentation(queryParams.Sort?.Value) }, { "direction", StringUtils.ToStringRepresentation(queryParams.Direction?.Value) }, { "limit", StringUtils.ToStringRepresentation(queryParams.Limit) }, { "include_recent_shared_links", StringUtils.ToStringRepresentation(queryParams.IncludeRecentSharedLinks) }, { "fields", StringUtils.ToStringRepresentation(queryParams.Fields) }, { "offset", StringUtils.ToStringRepresentation(queryParams.Offset) }, { "deleted_user_ids", StringUtils.ToStringRepresentation(queryParams.DeletedUserIds) }, { "deleted_at_range", StringUtils.ToStringRepresentation(queryParams.DeletedAtRange) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/search"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/search"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.DeserializeWithoutRawJson(NullableUtils.Unwrap(response.Data)); } diff --git a/Box.Sdk.Gen/Managers/SessionTermination/SessionTerminationManager.cs b/Box.Sdk.Gen/Managers/SessionTermination/SessionTerminationManager.cs index f77bf26c..f90b56d0 100644 --- a/Box.Sdk.Gen/Managers/SessionTermination/SessionTerminationManager.cs +++ b/Box.Sdk.Gen/Managers/SessionTermination/SessionTerminationManager.cs @@ -33,7 +33,7 @@ public SessionTerminationManager(NetworkSession? networkSession = default) { public async System.Threading.Tasks.Task TerminateUsersSessionsAsync(TerminateUsersSessionsRequestBody requestBody, TerminateUsersSessionsHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new TerminateUsersSessionsHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/users/terminate_sessions"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/users/terminate_sessions"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -55,7 +55,7 @@ public async System.Threading.Tasks.Task TerminateUse public async System.Threading.Tasks.Task TerminateGroupsSessionsAsync(TerminateGroupsSessionsRequestBody requestBody, TerminateGroupsSessionsHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new TerminateGroupsSessionsHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/groups/terminate_sessions"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/groups/terminate_sessions"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } diff --git a/Box.Sdk.Gen/Managers/SharedLinksFiles/SharedLinksFilesManager.cs b/Box.Sdk.Gen/Managers/SharedLinksFiles/SharedLinksFilesManager.cs index 92f13d53..d0c2d3f7 100644 --- a/Box.Sdk.Gen/Managers/SharedLinksFiles/SharedLinksFilesManager.cs +++ b/Box.Sdk.Gen/Managers/SharedLinksFiles/SharedLinksFilesManager.cs @@ -40,7 +40,7 @@ public async System.Threading.Tasks.Task FindFileForSharedLinkAsync(Fi queryParams = queryParams ?? new FindFileForSharedLinkQueryParams(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "fields", StringUtils.ToStringRepresentation(queryParams.Fields) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { { "if-none-match", StringUtils.ToStringRepresentation(headers.IfNoneMatch) }, { "boxapi", StringUtils.ToStringRepresentation(headers.Boxapi) } }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/shared_items"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/shared_items"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -70,7 +70,7 @@ public async System.Threading.Tasks.Task GetSharedLinkForFileAsync(str headers = headers ?? new GetSharedLinkForFileHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "fields", StringUtils.ToStringRepresentation(queryParams.Fields) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/files/", StringUtils.ToStringRepresentation(fileId), "#get_shared_link"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/files/", StringUtils.ToStringRepresentation(fileId), "#get_shared_link"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -104,7 +104,7 @@ public async System.Threading.Tasks.Task AddShareLinkToFileAsync(strin headers = headers ?? new AddShareLinkToFileHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "fields", StringUtils.ToStringRepresentation(queryParams.Fields) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/files/", StringUtils.ToStringRepresentation(fileId), "#add_shared_link"), method: "PUT", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/files/", StringUtils.ToStringRepresentation(fileId), "#add_shared_link"), method: "PUT", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -138,7 +138,7 @@ public async System.Threading.Tasks.Task UpdateSharedLinkOnFileAsync(s headers = headers ?? new UpdateSharedLinkOnFileHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "fields", StringUtils.ToStringRepresentation(queryParams.Fields) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/files/", StringUtils.ToStringRepresentation(fileId), "#update_shared_link"), method: "PUT", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/files/", StringUtils.ToStringRepresentation(fileId), "#update_shared_link"), method: "PUT", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -172,7 +172,7 @@ public async System.Threading.Tasks.Task RemoveSharedLinkFromFileAsync headers = headers ?? new RemoveSharedLinkFromFileHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "fields", StringUtils.ToStringRepresentation(queryParams.Fields) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/files/", StringUtils.ToStringRepresentation(fileId), "#remove_shared_link"), method: "PUT", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/files/", StringUtils.ToStringRepresentation(fileId), "#remove_shared_link"), method: "PUT", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } diff --git a/Box.Sdk.Gen/Managers/SharedLinksFolders/SharedLinksFoldersManager.cs b/Box.Sdk.Gen/Managers/SharedLinksFolders/SharedLinksFoldersManager.cs index 131e6e12..1cc33906 100644 --- a/Box.Sdk.Gen/Managers/SharedLinksFolders/SharedLinksFoldersManager.cs +++ b/Box.Sdk.Gen/Managers/SharedLinksFolders/SharedLinksFoldersManager.cs @@ -37,7 +37,7 @@ public async System.Threading.Tasks.Task FindFolderForSharedLinkAsyn queryParams = queryParams ?? new FindFolderForSharedLinkQueryParams(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "fields", StringUtils.ToStringRepresentation(queryParams.Fields) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { { "if-none-match", StringUtils.ToStringRepresentation(headers.IfNoneMatch) }, { "boxapi", StringUtils.ToStringRepresentation(headers.Boxapi) } }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/shared_items#folders"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/shared_items#folders"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -70,7 +70,7 @@ public async System.Threading.Tasks.Task GetSharedLinkForFolderAsync headers = headers ?? new GetSharedLinkForFolderHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "fields", StringUtils.ToStringRepresentation(queryParams.Fields) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/folders/", StringUtils.ToStringRepresentation(folderId), "#get_shared_link"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/folders/", StringUtils.ToStringRepresentation(folderId), "#get_shared_link"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -107,7 +107,7 @@ public async System.Threading.Tasks.Task AddShareLinkToFolderAsync(s headers = headers ?? new AddShareLinkToFolderHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "fields", StringUtils.ToStringRepresentation(queryParams.Fields) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/folders/", StringUtils.ToStringRepresentation(folderId), "#add_shared_link"), method: "PUT", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/folders/", StringUtils.ToStringRepresentation(folderId), "#add_shared_link"), method: "PUT", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -144,7 +144,7 @@ public async System.Threading.Tasks.Task UpdateSharedLinkOnFolderAsy headers = headers ?? new UpdateSharedLinkOnFolderHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "fields", StringUtils.ToStringRepresentation(queryParams.Fields) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/folders/", StringUtils.ToStringRepresentation(folderId), "#update_shared_link"), method: "PUT", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/folders/", StringUtils.ToStringRepresentation(folderId), "#update_shared_link"), method: "PUT", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -181,7 +181,7 @@ public async System.Threading.Tasks.Task RemoveSharedLinkFromFolderA headers = headers ?? new RemoveSharedLinkFromFolderHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "fields", StringUtils.ToStringRepresentation(queryParams.Fields) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/folders/", StringUtils.ToStringRepresentation(folderId), "#remove_shared_link"), method: "PUT", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/folders/", StringUtils.ToStringRepresentation(folderId), "#remove_shared_link"), method: "PUT", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } diff --git a/Box.Sdk.Gen/Managers/SharedLinksWebLinks/SharedLinksWebLinksManager.cs b/Box.Sdk.Gen/Managers/SharedLinksWebLinks/SharedLinksWebLinksManager.cs index d8a40a98..db678ca2 100644 --- a/Box.Sdk.Gen/Managers/SharedLinksWebLinks/SharedLinksWebLinksManager.cs +++ b/Box.Sdk.Gen/Managers/SharedLinksWebLinks/SharedLinksWebLinksManager.cs @@ -37,7 +37,7 @@ public async System.Threading.Tasks.Task FindWebLinkForSharedLinkAsync( queryParams = queryParams ?? new FindWebLinkForSharedLinkQueryParams(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "fields", StringUtils.ToStringRepresentation(queryParams.Fields) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { { "if-none-match", StringUtils.ToStringRepresentation(headers.IfNoneMatch) }, { "boxapi", StringUtils.ToStringRepresentation(headers.Boxapi) } }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/shared_items#web_links"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/shared_items#web_links"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -61,7 +61,7 @@ public async System.Threading.Tasks.Task GetSharedLinkForWebLinkAsync(s headers = headers ?? new GetSharedLinkForWebLinkHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "fields", StringUtils.ToStringRepresentation(queryParams.Fields) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/web_links/", StringUtils.ToStringRepresentation(webLinkId), "#get_shared_link"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/web_links/", StringUtils.ToStringRepresentation(webLinkId), "#get_shared_link"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -89,7 +89,7 @@ public async System.Threading.Tasks.Task AddShareLinkToWebLinkAsync(str headers = headers ?? new AddShareLinkToWebLinkHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "fields", StringUtils.ToStringRepresentation(queryParams.Fields) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/web_links/", StringUtils.ToStringRepresentation(webLinkId), "#add_shared_link"), method: "PUT", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/web_links/", StringUtils.ToStringRepresentation(webLinkId), "#add_shared_link"), method: "PUT", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -117,7 +117,7 @@ public async System.Threading.Tasks.Task UpdateSharedLinkOnWebLinkAsync headers = headers ?? new UpdateSharedLinkOnWebLinkHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "fields", StringUtils.ToStringRepresentation(queryParams.Fields) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/web_links/", StringUtils.ToStringRepresentation(webLinkId), "#update_shared_link"), method: "PUT", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/web_links/", StringUtils.ToStringRepresentation(webLinkId), "#update_shared_link"), method: "PUT", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -145,7 +145,7 @@ public async System.Threading.Tasks.Task RemoveSharedLinkFromWebLinkAsy headers = headers ?? new RemoveSharedLinkFromWebLinkHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "fields", StringUtils.ToStringRepresentation(queryParams.Fields) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/web_links/", StringUtils.ToStringRepresentation(webLinkId), "#remove_shared_link"), method: "PUT", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/web_links/", StringUtils.ToStringRepresentation(webLinkId), "#remove_shared_link"), method: "PUT", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } diff --git a/Box.Sdk.Gen/Managers/ShieldInformationBarrierReports/ShieldInformationBarrierReportsManager.cs b/Box.Sdk.Gen/Managers/ShieldInformationBarrierReports/ShieldInformationBarrierReportsManager.cs index 6f997a6b..23fc37f3 100644 --- a/Box.Sdk.Gen/Managers/ShieldInformationBarrierReports/ShieldInformationBarrierReportsManager.cs +++ b/Box.Sdk.Gen/Managers/ShieldInformationBarrierReports/ShieldInformationBarrierReportsManager.cs @@ -29,7 +29,7 @@ public async System.Threading.Tasks.Task GetShi headers = headers ?? new GetShieldInformationBarrierReportsHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "shield_information_barrier_id", StringUtils.ToStringRepresentation(queryParams.ShieldInformationBarrierId) }, { "marker", StringUtils.ToStringRepresentation(queryParams.Marker) }, { "limit", StringUtils.ToStringRepresentation(queryParams.Limit) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/shield_information_barrier_reports"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/shield_information_barrier_reports"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -48,7 +48,7 @@ public async System.Threading.Tasks.Task GetShi public async System.Threading.Tasks.Task CreateShieldInformationBarrierReportAsync(ShieldInformationBarrierReference requestBody, CreateShieldInformationBarrierReportHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new CreateShieldInformationBarrierReportHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/shield_information_barrier_reports"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/shield_information_barrier_reports"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -68,7 +68,7 @@ public async System.Threading.Tasks.Task CreateS public async System.Threading.Tasks.Task GetShieldInformationBarrierReportByIdAsync(string shieldInformationBarrierReportId, GetShieldInformationBarrierReportByIdHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new GetShieldInformationBarrierReportByIdHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/shield_information_barrier_reports/", StringUtils.ToStringRepresentation(shieldInformationBarrierReportId)), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/shield_information_barrier_reports/", StringUtils.ToStringRepresentation(shieldInformationBarrierReportId)), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } diff --git a/Box.Sdk.Gen/Managers/ShieldInformationBarrierSegmentMembers/ShieldInformationBarrierSegmentMembersManager.cs b/Box.Sdk.Gen/Managers/ShieldInformationBarrierSegmentMembers/ShieldInformationBarrierSegmentMembersManager.cs index c7430f14..d57a5fdd 100644 --- a/Box.Sdk.Gen/Managers/ShieldInformationBarrierSegmentMembers/ShieldInformationBarrierSegmentMembersManager.cs +++ b/Box.Sdk.Gen/Managers/ShieldInformationBarrierSegmentMembers/ShieldInformationBarrierSegmentMembersManager.cs @@ -31,7 +31,7 @@ public ShieldInformationBarrierSegmentMembersManager(NetworkSession? networkSess public async System.Threading.Tasks.Task GetShieldInformationBarrierSegmentMemberByIdAsync(string shieldInformationBarrierSegmentMemberId, GetShieldInformationBarrierSegmentMemberByIdHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new GetShieldInformationBarrierSegmentMemberByIdHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/shield_information_barrier_segment_members/", StringUtils.ToStringRepresentation(shieldInformationBarrierSegmentMemberId)), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/shield_information_barrier_segment_members/", StringUtils.ToStringRepresentation(shieldInformationBarrierSegmentMemberId)), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -52,7 +52,7 @@ public async System.Threading.Tasks.Task public async System.Threading.Tasks.Task DeleteShieldInformationBarrierSegmentMemberByIdAsync(string shieldInformationBarrierSegmentMemberId, DeleteShieldInformationBarrierSegmentMemberByIdHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new DeleteShieldInformationBarrierSegmentMemberByIdHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/shield_information_barrier_segment_members/", StringUtils.ToStringRepresentation(shieldInformationBarrierSegmentMemberId)), method: "DELETE", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/shield_information_barrier_segment_members/", StringUtils.ToStringRepresentation(shieldInformationBarrierSegmentMemberId)), method: "DELETE", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); } /// @@ -72,7 +72,7 @@ public async System.Threading.Tasks.Task headers = headers ?? new GetShieldInformationBarrierSegmentMembersHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "shield_information_barrier_segment_id", StringUtils.ToStringRepresentation(queryParams.ShieldInformationBarrierSegmentId) }, { "marker", StringUtils.ToStringRepresentation(queryParams.Marker) }, { "limit", StringUtils.ToStringRepresentation(queryParams.Limit) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/shield_information_barrier_segment_members"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/shield_information_barrier_segment_members"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -91,7 +91,7 @@ public async System.Threading.Tasks.Task public async System.Threading.Tasks.Task CreateShieldInformationBarrierSegmentMemberAsync(CreateShieldInformationBarrierSegmentMemberRequestBody requestBody, CreateShieldInformationBarrierSegmentMemberHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new CreateShieldInformationBarrierSegmentMemberHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/shield_information_barrier_segment_members"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/shield_information_barrier_segment_members"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } diff --git a/Box.Sdk.Gen/Managers/ShieldInformationBarrierSegmentRestrictions/ShieldInformationBarrierSegmentRestrictionsManager.cs b/Box.Sdk.Gen/Managers/ShieldInformationBarrierSegmentRestrictions/ShieldInformationBarrierSegmentRestrictionsManager.cs index a9461c88..4d443f95 100644 --- a/Box.Sdk.Gen/Managers/ShieldInformationBarrierSegmentRestrictions/ShieldInformationBarrierSegmentRestrictionsManager.cs +++ b/Box.Sdk.Gen/Managers/ShieldInformationBarrierSegmentRestrictions/ShieldInformationBarrierSegmentRestrictionsManager.cs @@ -31,7 +31,7 @@ public ShieldInformationBarrierSegmentRestrictionsManager(NetworkSession? networ public async System.Threading.Tasks.Task GetShieldInformationBarrierSegmentRestrictionByIdAsync(string shieldInformationBarrierSegmentRestrictionId, GetShieldInformationBarrierSegmentRestrictionByIdHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new GetShieldInformationBarrierSegmentRestrictionByIdHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/shield_information_barrier_segment_restrictions/", StringUtils.ToStringRepresentation(shieldInformationBarrierSegmentRestrictionId)), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/shield_information_barrier_segment_restrictions/", StringUtils.ToStringRepresentation(shieldInformationBarrierSegmentRestrictionId)), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -52,7 +52,7 @@ public async System.Threading.Tasks.Task headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/shield_information_barrier_segment_restrictions/", StringUtils.ToStringRepresentation(shieldInformationBarrierSegmentRestrictionId)), method: "DELETE", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/shield_information_barrier_segment_restrictions/", StringUtils.ToStringRepresentation(shieldInformationBarrierSegmentRestrictionId)), method: "DELETE", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); } /// @@ -72,7 +72,7 @@ public async System.Threading.Tasks.Task queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "shield_information_barrier_segment_id", StringUtils.ToStringRepresentation(queryParams.ShieldInformationBarrierSegmentId) }, { "marker", StringUtils.ToStringRepresentation(queryParams.Marker) }, { "limit", StringUtils.ToStringRepresentation(queryParams.Limit) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/shield_information_barrier_segment_restrictions"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/shield_information_barrier_segment_restrictions"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -92,7 +92,7 @@ public async System.Threading.Tasks.Task CreateShieldInformationBarrierSegmentRestrictionAsync(CreateShieldInformationBarrierSegmentRestrictionRequestBody requestBody, CreateShieldInformationBarrierSegmentRestrictionHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new CreateShieldInformationBarrierSegmentRestrictionHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/shield_information_barrier_segment_restrictions"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/shield_information_barrier_segment_restrictions"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } diff --git a/Box.Sdk.Gen/Managers/ShieldInformationBarrierSegments/ShieldInformationBarrierSegmentsManager.cs b/Box.Sdk.Gen/Managers/ShieldInformationBarrierSegments/ShieldInformationBarrierSegmentsManager.cs index ec60b0fc..26c16504 100644 --- a/Box.Sdk.Gen/Managers/ShieldInformationBarrierSegments/ShieldInformationBarrierSegmentsManager.cs +++ b/Box.Sdk.Gen/Managers/ShieldInformationBarrierSegments/ShieldInformationBarrierSegmentsManager.cs @@ -30,7 +30,7 @@ public ShieldInformationBarrierSegmentsManager(NetworkSession? networkSession = public async System.Threading.Tasks.Task GetShieldInformationBarrierSegmentByIdAsync(string shieldInformationBarrierSegmentId, GetShieldInformationBarrierSegmentByIdHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new GetShieldInformationBarrierSegmentByIdHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/shield_information_barrier_segments/", StringUtils.ToStringRepresentation(shieldInformationBarrierSegmentId)), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/shield_information_barrier_segments/", StringUtils.ToStringRepresentation(shieldInformationBarrierSegmentId)), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -51,7 +51,7 @@ public async System.Threading.Tasks.Task GetShi public async System.Threading.Tasks.Task DeleteShieldInformationBarrierSegmentByIdAsync(string shieldInformationBarrierSegmentId, DeleteShieldInformationBarrierSegmentByIdHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new DeleteShieldInformationBarrierSegmentByIdHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/shield_information_barrier_segments/", StringUtils.ToStringRepresentation(shieldInformationBarrierSegmentId)), method: "DELETE", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/shield_information_barrier_segments/", StringUtils.ToStringRepresentation(shieldInformationBarrierSegmentId)), method: "DELETE", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); } /// @@ -74,7 +74,7 @@ public async System.Threading.Tasks.Task Update requestBody = requestBody ?? new UpdateShieldInformationBarrierSegmentByIdRequestBody(); headers = headers ?? new UpdateShieldInformationBarrierSegmentByIdHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/shield_information_barrier_segments/", StringUtils.ToStringRepresentation(shieldInformationBarrierSegmentId)), method: "PUT", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/shield_information_barrier_segments/", StringUtils.ToStringRepresentation(shieldInformationBarrierSegmentId)), method: "PUT", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -95,7 +95,7 @@ public async System.Threading.Tasks.Task GetSh headers = headers ?? new GetShieldInformationBarrierSegmentsHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "shield_information_barrier_id", StringUtils.ToStringRepresentation(queryParams.ShieldInformationBarrierId) }, { "marker", StringUtils.ToStringRepresentation(queryParams.Marker) }, { "limit", StringUtils.ToStringRepresentation(queryParams.Limit) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/shield_information_barrier_segments"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/shield_information_barrier_segments"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -114,7 +114,7 @@ public async System.Threading.Tasks.Task GetSh public async System.Threading.Tasks.Task CreateShieldInformationBarrierSegmentAsync(CreateShieldInformationBarrierSegmentRequestBody requestBody, CreateShieldInformationBarrierSegmentHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new CreateShieldInformationBarrierSegmentHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/shield_information_barrier_segments"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/shield_information_barrier_segments"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } diff --git a/Box.Sdk.Gen/Managers/ShieldInformationBarriers/ShieldInformationBarriersManager.cs b/Box.Sdk.Gen/Managers/ShieldInformationBarriers/ShieldInformationBarriersManager.cs index 363ab8dd..28945a62 100644 --- a/Box.Sdk.Gen/Managers/ShieldInformationBarriers/ShieldInformationBarriersManager.cs +++ b/Box.Sdk.Gen/Managers/ShieldInformationBarriers/ShieldInformationBarriersManager.cs @@ -30,7 +30,7 @@ public ShieldInformationBarriersManager(NetworkSession? networkSession = default public async System.Threading.Tasks.Task GetShieldInformationBarrierByIdAsync(string shieldInformationBarrierId, GetShieldInformationBarrierByIdHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new GetShieldInformationBarrierByIdHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/shield_information_barriers/", StringUtils.ToStringRepresentation(shieldInformationBarrierId)), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/shield_information_barriers/", StringUtils.ToStringRepresentation(shieldInformationBarrierId)), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -49,7 +49,7 @@ public async System.Threading.Tasks.Task GetShieldInfo public async System.Threading.Tasks.Task UpdateShieldInformationBarrierStatusAsync(UpdateShieldInformationBarrierStatusRequestBody requestBody, UpdateShieldInformationBarrierStatusHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new UpdateShieldInformationBarrierStatusHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/shield_information_barriers/change_status"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/shield_information_barriers/change_status"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -71,7 +71,7 @@ public async System.Threading.Tasks.Task GetShieldInf headers = headers ?? new GetShieldInformationBarriersHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "marker", StringUtils.ToStringRepresentation(queryParams.Marker) }, { "limit", StringUtils.ToStringRepresentation(queryParams.Limit) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/shield_information_barriers"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/shield_information_barriers"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -92,7 +92,7 @@ public async System.Threading.Tasks.Task GetShieldInf public async System.Threading.Tasks.Task CreateShieldInformationBarrierAsync(CreateShieldInformationBarrierRequestBody requestBody, CreateShieldInformationBarrierHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new CreateShieldInformationBarrierHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/shield_information_barriers"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/shield_information_barriers"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } diff --git a/Box.Sdk.Gen/Managers/SignRequests/SignRequestsManager.cs b/Box.Sdk.Gen/Managers/SignRequests/SignRequestsManager.cs index c6346fa1..aa19d775 100644 --- a/Box.Sdk.Gen/Managers/SignRequests/SignRequestsManager.cs +++ b/Box.Sdk.Gen/Managers/SignRequests/SignRequestsManager.cs @@ -29,7 +29,7 @@ public SignRequestsManager(NetworkSession? networkSession = default) { public async System.Threading.Tasks.Task CancelSignRequestAsync(string signRequestId, CancelSignRequestHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new CancelSignRequestHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/sign_requests/", StringUtils.ToStringRepresentation(signRequestId), "/cancel"), method: "POST", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/sign_requests/", StringUtils.ToStringRepresentation(signRequestId), "/cancel"), method: "POST", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -49,7 +49,7 @@ public async System.Threading.Tasks.Task CancelSignRequestAsync(str public async System.Threading.Tasks.Task ResendSignRequestAsync(string signRequestId, ResendSignRequestHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new ResendSignRequestHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/sign_requests/", StringUtils.ToStringRepresentation(signRequestId), "/resend"), method: "POST", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/sign_requests/", StringUtils.ToStringRepresentation(signRequestId), "/resend"), method: "POST", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); } /// @@ -68,7 +68,7 @@ public async System.Threading.Tasks.Task ResendSignRequestAsync(string signReque public async System.Threading.Tasks.Task GetSignRequestByIdAsync(string signRequestId, GetSignRequestByIdHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new GetSignRequestByIdHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/sign_requests/", StringUtils.ToStringRepresentation(signRequestId)), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/sign_requests/", StringUtils.ToStringRepresentation(signRequestId)), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -90,7 +90,7 @@ public async System.Threading.Tasks.Task GetSignRequestsAsync(GetS headers = headers ?? new GetSignRequestsHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "marker", StringUtils.ToStringRepresentation(queryParams.Marker) }, { "limit", StringUtils.ToStringRepresentation(queryParams.Limit) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/sign_requests"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/sign_requests"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -110,7 +110,7 @@ public async System.Threading.Tasks.Task GetSignRequestsAsync(GetS public async System.Threading.Tasks.Task CreateSignRequestAsync(SignRequestCreateRequest requestBody, CreateSignRequestHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new CreateSignRequestHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/sign_requests"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/sign_requests"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } diff --git a/Box.Sdk.Gen/Managers/SignTemplates/SignTemplatesManager.cs b/Box.Sdk.Gen/Managers/SignTemplates/SignTemplatesManager.cs index eb6d4667..d83d198f 100644 --- a/Box.Sdk.Gen/Managers/SignTemplates/SignTemplatesManager.cs +++ b/Box.Sdk.Gen/Managers/SignTemplates/SignTemplatesManager.cs @@ -30,7 +30,7 @@ public async System.Threading.Tasks.Task GetSignTemplatesAsync(Ge headers = headers ?? new GetSignTemplatesHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "marker", StringUtils.ToStringRepresentation(queryParams.Marker) }, { "limit", StringUtils.ToStringRepresentation(queryParams.Limit) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/sign_templates"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/sign_templates"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -50,7 +50,7 @@ public async System.Threading.Tasks.Task GetSignTemplatesAsync(Ge public async System.Threading.Tasks.Task GetSignTemplateByIdAsync(string templateId, GetSignTemplateByIdHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new GetSignTemplateByIdHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/sign_templates/", StringUtils.ToStringRepresentation(templateId)), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/sign_templates/", StringUtils.ToStringRepresentation(templateId)), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } diff --git a/Box.Sdk.Gen/Managers/Skills/SkillsManager.cs b/Box.Sdk.Gen/Managers/Skills/SkillsManager.cs index 1fc1de8f..22ec2380 100644 --- a/Box.Sdk.Gen/Managers/Skills/SkillsManager.cs +++ b/Box.Sdk.Gen/Managers/Skills/SkillsManager.cs @@ -37,7 +37,7 @@ public SkillsManager(NetworkSession? networkSession = default) { public async System.Threading.Tasks.Task GetBoxSkillCardsOnFileAsync(string fileId, GetBoxSkillCardsOnFileHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new GetBoxSkillCardsOnFileHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/files/", StringUtils.ToStringRepresentation(fileId), "/metadata/global/boxSkillsCards"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/files/", StringUtils.ToStringRepresentation(fileId), "/metadata/global/boxSkillsCards"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -66,7 +66,7 @@ public async System.Threading.Tasks.Task GetBoxSkillCardsOnF public async System.Threading.Tasks.Task CreateBoxSkillCardsOnFileAsync(string fileId, CreateBoxSkillCardsOnFileRequestBody requestBody, CreateBoxSkillCardsOnFileHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new CreateBoxSkillCardsOnFileHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/files/", StringUtils.ToStringRepresentation(fileId), "/metadata/global/boxSkillsCards"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/files/", StringUtils.ToStringRepresentation(fileId), "/metadata/global/boxSkillsCards"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -95,7 +95,7 @@ public async System.Threading.Tasks.Task CreateBoxSkillCards public async System.Threading.Tasks.Task UpdateBoxSkillCardsOnFileAsync(string fileId, IReadOnlyList requestBody, UpdateBoxSkillCardsOnFileHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new UpdateBoxSkillCardsOnFileHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/files/", StringUtils.ToStringRepresentation(fileId), "/metadata/global/boxSkillsCards"), method: "PUT", contentType: "application/json-patch+json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/files/", StringUtils.ToStringRepresentation(fileId), "/metadata/global/boxSkillsCards"), method: "PUT", contentType: "application/json-patch+json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -121,7 +121,7 @@ public async System.Threading.Tasks.Task UpdateBoxSkillCards public async System.Threading.Tasks.Task DeleteBoxSkillCardsFromFileAsync(string fileId, DeleteBoxSkillCardsFromFileHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new DeleteBoxSkillCardsFromFileHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/files/", StringUtils.ToStringRepresentation(fileId), "/metadata/global/boxSkillsCards"), method: "DELETE", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/files/", StringUtils.ToStringRepresentation(fileId), "/metadata/global/boxSkillsCards"), method: "DELETE", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); } /// @@ -144,7 +144,7 @@ public async System.Threading.Tasks.Task DeleteBoxSkillCardsFromFileAsync(string public async System.Threading.Tasks.Task UpdateAllSkillCardsOnFileAsync(string skillId, UpdateAllSkillCardsOnFileRequestBody requestBody, UpdateAllSkillCardsOnFileHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new UpdateAllSkillCardsOnFileHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/skill_invocations/", StringUtils.ToStringRepresentation(skillId)), method: "PUT", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/skill_invocations/", StringUtils.ToStringRepresentation(skillId)), method: "PUT", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); } } diff --git a/Box.Sdk.Gen/Managers/StoragePolicies/StoragePoliciesManager.cs b/Box.Sdk.Gen/Managers/StoragePolicies/StoragePoliciesManager.cs index e0514d09..7b1158a2 100644 --- a/Box.Sdk.Gen/Managers/StoragePolicies/StoragePoliciesManager.cs +++ b/Box.Sdk.Gen/Managers/StoragePolicies/StoragePoliciesManager.cs @@ -31,7 +31,7 @@ public async System.Threading.Tasks.Task GetStoragePoliciesAsyn headers = headers ?? new GetStoragePoliciesHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "fields", StringUtils.ToStringRepresentation(queryParams.Fields) }, { "marker", StringUtils.ToStringRepresentation(queryParams.Marker) }, { "limit", StringUtils.ToStringRepresentation(queryParams.Limit) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/storage_policies"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/storage_policies"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -51,7 +51,7 @@ public async System.Threading.Tasks.Task GetStoragePoliciesAsyn public async System.Threading.Tasks.Task GetStoragePolicyByIdAsync(string storagePolicyId, GetStoragePolicyByIdHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new GetStoragePolicyByIdHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/storage_policies/", StringUtils.ToStringRepresentation(storagePolicyId)), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/storage_policies/", StringUtils.ToStringRepresentation(storagePolicyId)), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } diff --git a/Box.Sdk.Gen/Managers/StoragePolicyAssignments/StoragePolicyAssignmentsManager.cs b/Box.Sdk.Gen/Managers/StoragePolicyAssignments/StoragePolicyAssignmentsManager.cs index 4b2e0047..e881b6b0 100644 --- a/Box.Sdk.Gen/Managers/StoragePolicyAssignments/StoragePolicyAssignmentsManager.cs +++ b/Box.Sdk.Gen/Managers/StoragePolicyAssignments/StoragePolicyAssignmentsManager.cs @@ -30,7 +30,7 @@ public async System.Threading.Tasks.Task GetStoragePol headers = headers ?? new GetStoragePolicyAssignmentsHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "marker", StringUtils.ToStringRepresentation(queryParams.Marker) }, { "resolved_for_type", StringUtils.ToStringRepresentation(queryParams.ResolvedForType) }, { "resolved_for_id", StringUtils.ToStringRepresentation(queryParams.ResolvedForId) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/storage_policy_assignments"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/storage_policy_assignments"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -49,7 +49,7 @@ public async System.Threading.Tasks.Task GetStoragePol public async System.Threading.Tasks.Task CreateStoragePolicyAssignmentAsync(CreateStoragePolicyAssignmentRequestBody requestBody, CreateStoragePolicyAssignmentHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new CreateStoragePolicyAssignmentHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/storage_policy_assignments"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/storage_policy_assignments"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -69,7 +69,7 @@ public async System.Threading.Tasks.Task CreateStorageP public async System.Threading.Tasks.Task GetStoragePolicyAssignmentByIdAsync(string storagePolicyAssignmentId, GetStoragePolicyAssignmentByIdHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new GetStoragePolicyAssignmentByIdHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/storage_policy_assignments/", StringUtils.ToStringRepresentation(storagePolicyAssignmentId)), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/storage_policy_assignments/", StringUtils.ToStringRepresentation(storagePolicyAssignmentId)), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -92,7 +92,7 @@ public async System.Threading.Tasks.Task GetStoragePoli public async System.Threading.Tasks.Task UpdateStoragePolicyAssignmentByIdAsync(string storagePolicyAssignmentId, UpdateStoragePolicyAssignmentByIdRequestBody requestBody, UpdateStoragePolicyAssignmentByIdHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new UpdateStoragePolicyAssignmentByIdHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/storage_policy_assignments/", StringUtils.ToStringRepresentation(storagePolicyAssignmentId)), method: "PUT", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/storage_policy_assignments/", StringUtils.ToStringRepresentation(storagePolicyAssignmentId)), method: "PUT", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -119,7 +119,7 @@ public async System.Threading.Tasks.Task UpdateStorageP public async System.Threading.Tasks.Task DeleteStoragePolicyAssignmentByIdAsync(string storagePolicyAssignmentId, DeleteStoragePolicyAssignmentByIdHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new DeleteStoragePolicyAssignmentByIdHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/storage_policy_assignments/", StringUtils.ToStringRepresentation(storagePolicyAssignmentId)), method: "DELETE", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/storage_policy_assignments/", StringUtils.ToStringRepresentation(storagePolicyAssignmentId)), method: "DELETE", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); } } diff --git a/Box.Sdk.Gen/Managers/TaskAssignments/TaskAssignmentsManager.cs b/Box.Sdk.Gen/Managers/TaskAssignments/TaskAssignmentsManager.cs index 7def6d7e..aaff260a 100644 --- a/Box.Sdk.Gen/Managers/TaskAssignments/TaskAssignmentsManager.cs +++ b/Box.Sdk.Gen/Managers/TaskAssignments/TaskAssignmentsManager.cs @@ -30,7 +30,7 @@ public TaskAssignmentsManager(NetworkSession? networkSession = default) { public async System.Threading.Tasks.Task GetTaskAssignmentsAsync(string taskId, GetTaskAssignmentsHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new GetTaskAssignmentsHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/tasks/", StringUtils.ToStringRepresentation(taskId), "/assignments"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/tasks/", StringUtils.ToStringRepresentation(taskId), "/assignments"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -52,7 +52,7 @@ public async System.Threading.Tasks.Task GetTaskAssignmentsAsyn public async System.Threading.Tasks.Task CreateTaskAssignmentAsync(CreateTaskAssignmentRequestBody requestBody, CreateTaskAssignmentHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new CreateTaskAssignmentHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/task_assignments"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/task_assignments"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -72,7 +72,7 @@ public async System.Threading.Tasks.Task CreateTaskAssignmentAsy public async System.Threading.Tasks.Task GetTaskAssignmentByIdAsync(string taskAssignmentId, GetTaskAssignmentByIdHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new GetTaskAssignmentByIdHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/task_assignments/", StringUtils.ToStringRepresentation(taskAssignmentId)), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/task_assignments/", StringUtils.ToStringRepresentation(taskAssignmentId)), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -97,7 +97,7 @@ public async System.Threading.Tasks.Task UpdateTaskAssignmentByI requestBody = requestBody ?? new UpdateTaskAssignmentByIdRequestBody(); headers = headers ?? new UpdateTaskAssignmentByIdHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/task_assignments/", StringUtils.ToStringRepresentation(taskAssignmentId)), method: "PUT", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/task_assignments/", StringUtils.ToStringRepresentation(taskAssignmentId)), method: "PUT", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -117,7 +117,7 @@ public async System.Threading.Tasks.Task UpdateTaskAssignmentByI public async System.Threading.Tasks.Task DeleteTaskAssignmentByIdAsync(string taskAssignmentId, DeleteTaskAssignmentByIdHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new DeleteTaskAssignmentByIdHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/task_assignments/", StringUtils.ToStringRepresentation(taskAssignmentId)), method: "DELETE", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/task_assignments/", StringUtils.ToStringRepresentation(taskAssignmentId)), method: "DELETE", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); } } diff --git a/Box.Sdk.Gen/Managers/Tasks/TasksManager.cs b/Box.Sdk.Gen/Managers/Tasks/TasksManager.cs index a5b8fac0..08e2aee2 100644 --- a/Box.Sdk.Gen/Managers/Tasks/TasksManager.cs +++ b/Box.Sdk.Gen/Managers/Tasks/TasksManager.cs @@ -37,7 +37,7 @@ public TasksManager(NetworkSession? networkSession = default) { public async System.Threading.Tasks.Task GetFileTasksAsync(string fileId, GetFileTasksHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new GetFileTasksHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/files/", StringUtils.ToStringRepresentation(fileId), "/tasks"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/files/", StringUtils.ToStringRepresentation(fileId), "/tasks"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -57,7 +57,7 @@ public async System.Threading.Tasks.Task GetFileTasksAsync(string fileId, public async System.Threading.Tasks.Task CreateTaskAsync(CreateTaskRequestBody requestBody, CreateTaskHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new CreateTaskHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/tasks"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/tasks"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -77,7 +77,7 @@ public async System.Threading.Tasks.Task CreateTaskAsync(CreateTaskRequest public async System.Threading.Tasks.Task GetTaskByIdAsync(string taskId, GetTaskByIdHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new GetTaskByIdHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/tasks/", StringUtils.ToStringRepresentation(taskId)), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/tasks/", StringUtils.ToStringRepresentation(taskId)), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -102,7 +102,7 @@ public async System.Threading.Tasks.Task UpdateTaskByIdAsync(string taskId requestBody = requestBody ?? new UpdateTaskByIdRequestBody(); headers = headers ?? new UpdateTaskByIdHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/tasks/", StringUtils.ToStringRepresentation(taskId)), method: "PUT", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/tasks/", StringUtils.ToStringRepresentation(taskId)), method: "PUT", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -122,7 +122,7 @@ public async System.Threading.Tasks.Task UpdateTaskByIdAsync(string taskId public async System.Threading.Tasks.Task DeleteTaskByIdAsync(string taskId, DeleteTaskByIdHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new DeleteTaskByIdHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/tasks/", StringUtils.ToStringRepresentation(taskId)), method: "DELETE", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/tasks/", StringUtils.ToStringRepresentation(taskId)), method: "DELETE", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); } } diff --git a/Box.Sdk.Gen/Managers/TermsOfServiceUserStatuses/TermsOfServiceUserStatusesManager.cs b/Box.Sdk.Gen/Managers/TermsOfServiceUserStatuses/TermsOfServiceUserStatusesManager.cs index 18532ef1..8db4daa9 100644 --- a/Box.Sdk.Gen/Managers/TermsOfServiceUserStatuses/TermsOfServiceUserStatusesManager.cs +++ b/Box.Sdk.Gen/Managers/TermsOfServiceUserStatuses/TermsOfServiceUserStatusesManager.cs @@ -32,7 +32,7 @@ public async System.Threading.Tasks.Task GetTermsOfS headers = headers ?? new GetTermsOfServiceUserStatusesHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "tos_id", StringUtils.ToStringRepresentation(queryParams.TosId) }, { "user_id", StringUtils.ToStringRepresentation(queryParams.UserId) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/terms_of_service_user_statuses"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/terms_of_service_user_statuses"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -51,7 +51,7 @@ public async System.Threading.Tasks.Task GetTermsOfS public async System.Threading.Tasks.Task CreateTermsOfServiceStatusForUserAsync(CreateTermsOfServiceStatusForUserRequestBody requestBody, CreateTermsOfServiceStatusForUserHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new CreateTermsOfServiceStatusForUserHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/terms_of_service_user_statuses"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/terms_of_service_user_statuses"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -74,7 +74,7 @@ public async System.Threading.Tasks.Task CreateTermsOf public async System.Threading.Tasks.Task UpdateTermsOfServiceStatusForUserByIdAsync(string termsOfServiceUserStatusId, UpdateTermsOfServiceStatusForUserByIdRequestBody requestBody, UpdateTermsOfServiceStatusForUserByIdHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new UpdateTermsOfServiceStatusForUserByIdHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/terms_of_service_user_statuses/", StringUtils.ToStringRepresentation(termsOfServiceUserStatusId)), method: "PUT", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/terms_of_service_user_statuses/", StringUtils.ToStringRepresentation(termsOfServiceUserStatusId)), method: "PUT", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } diff --git a/Box.Sdk.Gen/Managers/TermsOfServices/TermsOfServicesManager.cs b/Box.Sdk.Gen/Managers/TermsOfServices/TermsOfServicesManager.cs index 74923855..e236db0c 100644 --- a/Box.Sdk.Gen/Managers/TermsOfServices/TermsOfServicesManager.cs +++ b/Box.Sdk.Gen/Managers/TermsOfServices/TermsOfServicesManager.cs @@ -32,7 +32,7 @@ public async System.Threading.Tasks.Task GetTermsOfServiceAsync headers = headers ?? new GetTermsOfServiceHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "tos_type", StringUtils.ToStringRepresentation(queryParams.TosType) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/terms_of_services"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/terms_of_services"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -52,7 +52,7 @@ public async System.Threading.Tasks.Task GetTermsOfServiceAsync public async System.Threading.Tasks.Task CreateTermsOfServiceAsync(CreateTermsOfServiceRequestBody requestBody, CreateTermsOfServiceHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new CreateTermsOfServiceHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/terms_of_services"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/terms_of_services"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -72,7 +72,7 @@ public async System.Threading.Tasks.Task CreateTermsOfServiceAsy public async System.Threading.Tasks.Task GetTermsOfServiceByIdAsync(string termsOfServiceId, GetTermsOfServiceByIdHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new GetTermsOfServiceByIdHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/terms_of_services/", StringUtils.ToStringRepresentation(termsOfServiceId)), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/terms_of_services/", StringUtils.ToStringRepresentation(termsOfServiceId)), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -95,7 +95,7 @@ public async System.Threading.Tasks.Task GetTermsOfServiceByIdAs public async System.Threading.Tasks.Task UpdateTermsOfServiceByIdAsync(string termsOfServiceId, UpdateTermsOfServiceByIdRequestBody requestBody, UpdateTermsOfServiceByIdHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new UpdateTermsOfServiceByIdHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/terms_of_services/", StringUtils.ToStringRepresentation(termsOfServiceId)), method: "PUT", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/terms_of_services/", StringUtils.ToStringRepresentation(termsOfServiceId)), method: "PUT", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } diff --git a/Box.Sdk.Gen/Managers/Transfer/TransferManager.cs b/Box.Sdk.Gen/Managers/Transfer/TransferManager.cs index 1c0acfc4..99bb6988 100644 --- a/Box.Sdk.Gen/Managers/Transfer/TransferManager.cs +++ b/Box.Sdk.Gen/Managers/Transfer/TransferManager.cs @@ -71,7 +71,7 @@ public async System.Threading.Tasks.Task TransferOwnedFolderAsync(st headers = headers ?? new TransferOwnedFolderHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "fields", StringUtils.ToStringRepresentation(queryParams.Fields) }, { "notify", StringUtils.ToStringRepresentation(queryParams.Notify) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/users/", StringUtils.ToStringRepresentation(userId), "/folders/0"), method: "PUT", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/users/", StringUtils.ToStringRepresentation(userId), "/folders/0"), method: "PUT", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } diff --git a/Box.Sdk.Gen/Managers/TrashedFiles/TrashedFilesManager.cs b/Box.Sdk.Gen/Managers/TrashedFiles/TrashedFilesManager.cs index da367c24..948236da 100644 --- a/Box.Sdk.Gen/Managers/TrashedFiles/TrashedFilesManager.cs +++ b/Box.Sdk.Gen/Managers/TrashedFiles/TrashedFilesManager.cs @@ -49,7 +49,7 @@ public async System.Threading.Tasks.Task RestoreFileFromTrash headers = headers ?? new RestoreFileFromTrashHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "fields", StringUtils.ToStringRepresentation(queryParams.Fields) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/files/", StringUtils.ToStringRepresentation(fileId)), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/files/", StringUtils.ToStringRepresentation(fileId)), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -90,7 +90,7 @@ public async System.Threading.Tasks.Task GetTrashedFileByIdAsync(stri headers = headers ?? new GetTrashedFileByIdHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "fields", StringUtils.ToStringRepresentation(queryParams.Fields) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/files/", StringUtils.ToStringRepresentation(fileId), "/trash"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/files/", StringUtils.ToStringRepresentation(fileId), "/trash"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -117,7 +117,7 @@ public async System.Threading.Tasks.Task GetTrashedFileByIdAsync(stri public async System.Threading.Tasks.Task DeleteTrashedFileByIdAsync(string fileId, DeleteTrashedFileByIdHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new DeleteTrashedFileByIdHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/files/", StringUtils.ToStringRepresentation(fileId), "/trash"), method: "DELETE", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/files/", StringUtils.ToStringRepresentation(fileId), "/trash"), method: "DELETE", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); } } diff --git a/Box.Sdk.Gen/Managers/TrashedFolders/TrashedFoldersManager.cs b/Box.Sdk.Gen/Managers/TrashedFolders/TrashedFoldersManager.cs index 37ce0834..c1d9789f 100644 --- a/Box.Sdk.Gen/Managers/TrashedFolders/TrashedFoldersManager.cs +++ b/Box.Sdk.Gen/Managers/TrashedFolders/TrashedFoldersManager.cs @@ -59,7 +59,7 @@ public async System.Threading.Tasks.Task RestoreFolderFromT headers = headers ?? new RestoreFolderFromTrashHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "fields", StringUtils.ToStringRepresentation(queryParams.Fields) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/folders/", StringUtils.ToStringRepresentation(folderId)), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/folders/", StringUtils.ToStringRepresentation(folderId)), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -103,7 +103,7 @@ public async System.Threading.Tasks.Task GetTrashedFolderByIdAsync( headers = headers ?? new GetTrashedFolderByIdHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "fields", StringUtils.ToStringRepresentation(queryParams.Fields) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/folders/", StringUtils.ToStringRepresentation(folderId), "/trash"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/folders/", StringUtils.ToStringRepresentation(folderId), "/trash"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -133,7 +133,7 @@ public async System.Threading.Tasks.Task GetTrashedFolderByIdAsync( public async System.Threading.Tasks.Task DeleteTrashedFolderByIdAsync(string folderId, DeleteTrashedFolderByIdHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new DeleteTrashedFolderByIdHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/folders/", StringUtils.ToStringRepresentation(folderId), "/trash"), method: "DELETE", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/folders/", StringUtils.ToStringRepresentation(folderId), "/trash"), method: "DELETE", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); } } diff --git a/Box.Sdk.Gen/Managers/TrashedItems/TrashedItemsManager.cs b/Box.Sdk.Gen/Managers/TrashedItems/TrashedItemsManager.cs index b8a29286..365edc9d 100644 --- a/Box.Sdk.Gen/Managers/TrashedItems/TrashedItemsManager.cs +++ b/Box.Sdk.Gen/Managers/TrashedItems/TrashedItemsManager.cs @@ -39,7 +39,7 @@ public async System.Threading.Tasks.Task GetTrashedItemsAsync(GetTrashedI headers = headers ?? new GetTrashedItemsHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "fields", StringUtils.ToStringRepresentation(queryParams.Fields) }, { "limit", StringUtils.ToStringRepresentation(queryParams.Limit) }, { "offset", StringUtils.ToStringRepresentation(queryParams.Offset) }, { "usemarker", StringUtils.ToStringRepresentation(queryParams.Usemarker) }, { "marker", StringUtils.ToStringRepresentation(queryParams.Marker) }, { "direction", StringUtils.ToStringRepresentation(queryParams.Direction?.Value) }, { "sort", StringUtils.ToStringRepresentation(queryParams.Sort?.Value) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/folders/trash/items"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/folders/trash/items"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } diff --git a/Box.Sdk.Gen/Managers/TrashedWebLinks/TrashedWebLinksManager.cs b/Box.Sdk.Gen/Managers/TrashedWebLinks/TrashedWebLinksManager.cs index 3d361411..6925b556 100644 --- a/Box.Sdk.Gen/Managers/TrashedWebLinks/TrashedWebLinksManager.cs +++ b/Box.Sdk.Gen/Managers/TrashedWebLinks/TrashedWebLinksManager.cs @@ -43,7 +43,7 @@ public async System.Threading.Tasks.Task RestoreWeblinkFro headers = headers ?? new RestoreWeblinkFromTrashHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "fields", StringUtils.ToStringRepresentation(queryParams.Fields) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/web_links/", StringUtils.ToStringRepresentation(webLinkId)), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/web_links/", StringUtils.ToStringRepresentation(webLinkId)), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -68,7 +68,7 @@ public async System.Threading.Tasks.Task GetTrashedWebLinkByIdAsyn headers = headers ?? new GetTrashedWebLinkByIdHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "fields", StringUtils.ToStringRepresentation(queryParams.Fields) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/web_links/", StringUtils.ToStringRepresentation(webLinkId), "/trash"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/web_links/", StringUtils.ToStringRepresentation(webLinkId), "/trash"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -89,7 +89,7 @@ public async System.Threading.Tasks.Task GetTrashedWebLinkByIdAsyn public async System.Threading.Tasks.Task DeleteTrashedWebLinkByIdAsync(string webLinkId, DeleteTrashedWebLinkByIdHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new DeleteTrashedWebLinkByIdHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/web_links/", StringUtils.ToStringRepresentation(webLinkId), "/trash"), method: "DELETE", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/web_links/", StringUtils.ToStringRepresentation(webLinkId), "/trash"), method: "DELETE", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); } } diff --git a/Box.Sdk.Gen/Managers/Uploads/UploadsManager.cs b/Box.Sdk.Gen/Managers/Uploads/UploadsManager.cs index 026afb4c..3b586040 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"), method: "POST", contentType: "multipart/form-data", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { 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 }}), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.UploadUrl, "/2.0/files/", StringUtils.ToStringRepresentation(fileId), "/content"), method: "POST", contentType: "multipart/form-data", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { 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 }}), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -72,7 +72,7 @@ public async System.Threading.Tasks.Task PreflightFileUploadCheckAsyn requestBody = requestBody ?? new PreflightFileUploadCheckRequestBody(); headers = headers ?? new PreflightFileUploadCheckHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/files/content"), method: "OPTIONS", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/files/content"), method: "OPTIONS", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(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"), method: "POST", contentType: "multipart/form-data", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { 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 }}), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.UploadUrl, "/2.0/files/content"), method: "POST", contentType: "multipart/form-data", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { 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 }}), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } diff --git a/Box.Sdk.Gen/Managers/UserCollaborations/UserCollaborationsManager.cs b/Box.Sdk.Gen/Managers/UserCollaborations/UserCollaborationsManager.cs index b2fea644..c9f4a088 100644 --- a/Box.Sdk.Gen/Managers/UserCollaborations/UserCollaborationsManager.cs +++ b/Box.Sdk.Gen/Managers/UserCollaborations/UserCollaborationsManager.cs @@ -36,7 +36,7 @@ public async System.Threading.Tasks.Task GetCollaborationByIdAsyn headers = headers ?? new GetCollaborationByIdHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "fields", StringUtils.ToStringRepresentation(queryParams.Fields) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/collaborations/", StringUtils.ToStringRepresentation(collaborationId)), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/collaborations/", StringUtils.ToStringRepresentation(collaborationId)), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -61,7 +61,7 @@ public async System.Threading.Tasks.Task GetCollaborationByIdAsyn public async System.Threading.Tasks.Task UpdateCollaborationByIdAsync(string collaborationId, UpdateCollaborationByIdRequestBody requestBody, UpdateCollaborationByIdHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new UpdateCollaborationByIdHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/collaborations/", StringUtils.ToStringRepresentation(collaborationId)), method: "PUT", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/collaborations/", StringUtils.ToStringRepresentation(collaborationId)), method: "PUT", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); if (StringUtils.ToStringRepresentation(response.Status) == "204") { return null; } @@ -84,7 +84,7 @@ public async System.Threading.Tasks.Task GetCollaborationByIdAsyn public async System.Threading.Tasks.Task DeleteCollaborationByIdAsync(string collaborationId, DeleteCollaborationByIdHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new DeleteCollaborationByIdHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/collaborations/", StringUtils.ToStringRepresentation(collaborationId)), method: "DELETE", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/collaborations/", StringUtils.ToStringRepresentation(collaborationId)), method: "DELETE", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); } /// @@ -120,7 +120,7 @@ public async System.Threading.Tasks.Task CreateCollaborationAsync headers = headers ?? new CreateCollaborationHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "fields", StringUtils.ToStringRepresentation(queryParams.Fields) }, { "notify", StringUtils.ToStringRepresentation(queryParams.Notify) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/collaborations"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/collaborations"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } diff --git a/Box.Sdk.Gen/Managers/Users/UsersManager.cs b/Box.Sdk.Gen/Managers/Users/UsersManager.cs index d5854b83..9b123876 100644 --- a/Box.Sdk.Gen/Managers/Users/UsersManager.cs +++ b/Box.Sdk.Gen/Managers/Users/UsersManager.cs @@ -37,7 +37,7 @@ public async System.Threading.Tasks.Task GetUsersAsync(GetUsersQueryParam headers = headers ?? new GetUsersHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "filter_term", StringUtils.ToStringRepresentation(queryParams.FilterTerm) }, { "user_type", StringUtils.ToStringRepresentation(queryParams.UserType) }, { "external_app_user_id", StringUtils.ToStringRepresentation(queryParams.ExternalAppUserId) }, { "fields", StringUtils.ToStringRepresentation(queryParams.Fields) }, { "offset", StringUtils.ToStringRepresentation(queryParams.Offset) }, { "limit", StringUtils.ToStringRepresentation(queryParams.Limit) }, { "usemarker", StringUtils.ToStringRepresentation(queryParams.Usemarker) }, { "marker", StringUtils.ToStringRepresentation(queryParams.Marker) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/users"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/users"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -63,7 +63,7 @@ public async System.Threading.Tasks.Task CreateUserAsync(CreateUserReq headers = headers ?? new CreateUserHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "fields", StringUtils.ToStringRepresentation(queryParams.Fields) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/users"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/users"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -93,7 +93,7 @@ public async System.Threading.Tasks.Task GetUserMeAsync(GetUserMeQuery headers = headers ?? new GetUserMeHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "fields", StringUtils.ToStringRepresentation(queryParams.Fields) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/users/me"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/users/me"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -128,7 +128,7 @@ public async System.Threading.Tasks.Task GetUserByIdAsync(string userI headers = headers ?? new GetUserByIdHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "fields", StringUtils.ToStringRepresentation(queryParams.Fields) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/users/", StringUtils.ToStringRepresentation(userId)), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/users/", StringUtils.ToStringRepresentation(userId)), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -159,7 +159,7 @@ public async System.Threading.Tasks.Task UpdateUserByIdAsync(string us headers = headers ?? new UpdateUserByIdHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "fields", StringUtils.ToStringRepresentation(queryParams.Fields) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/users/", StringUtils.ToStringRepresentation(userId)), method: "PUT", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/users/", StringUtils.ToStringRepresentation(userId)), method: "PUT", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -187,7 +187,7 @@ public async System.Threading.Tasks.Task DeleteUserByIdAsync(string userId, Dele headers = headers ?? new DeleteUserByIdHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "notify", StringUtils.ToStringRepresentation(queryParams.Notify) }, { "force", StringUtils.ToStringRepresentation(queryParams.Force) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/users/", StringUtils.ToStringRepresentation(userId)), method: "DELETE", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/users/", StringUtils.ToStringRepresentation(userId)), method: "DELETE", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); } } diff --git a/Box.Sdk.Gen/Managers/WebLinks/WebLinksManager.cs b/Box.Sdk.Gen/Managers/WebLinks/WebLinksManager.cs index 1c38ac12..222fba9b 100644 --- a/Box.Sdk.Gen/Managers/WebLinks/WebLinksManager.cs +++ b/Box.Sdk.Gen/Managers/WebLinks/WebLinksManager.cs @@ -29,7 +29,7 @@ public WebLinksManager(NetworkSession? networkSession = default) { public async System.Threading.Tasks.Task CreateWebLinkAsync(CreateWebLinkRequestBody requestBody, CreateWebLinkHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new CreateWebLinkHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/web_links"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/web_links"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -49,7 +49,7 @@ public async System.Threading.Tasks.Task CreateWebLinkAsync(CreateWebLi public async System.Threading.Tasks.Task GetWebLinkByIdAsync(string webLinkId, GetWebLinkByIdHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new GetWebLinkByIdHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { { "boxapi", StringUtils.ToStringRepresentation(headers.Boxapi) } }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/web_links/", StringUtils.ToStringRepresentation(webLinkId)), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/web_links/", StringUtils.ToStringRepresentation(webLinkId)), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -73,7 +73,7 @@ public async System.Threading.Tasks.Task UpdateWebLinkByIdAsync(string requestBody = requestBody ?? new UpdateWebLinkByIdRequestBody(); headers = headers ?? new UpdateWebLinkByIdHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/web_links/", StringUtils.ToStringRepresentation(webLinkId)), method: "PUT", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/web_links/", StringUtils.ToStringRepresentation(webLinkId)), method: "PUT", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -93,7 +93,7 @@ public async System.Threading.Tasks.Task UpdateWebLinkByIdAsync(string public async System.Threading.Tasks.Task DeleteWebLinkByIdAsync(string webLinkId, DeleteWebLinkByIdHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new DeleteWebLinkByIdHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/web_links/", StringUtils.ToStringRepresentation(webLinkId)), method: "DELETE", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/web_links/", StringUtils.ToStringRepresentation(webLinkId)), method: "DELETE", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); } } diff --git a/Box.Sdk.Gen/Managers/Webhooks/WebhooksManager.cs b/Box.Sdk.Gen/Managers/Webhooks/WebhooksManager.cs index f3c52130..7a1d44fb 100644 --- a/Box.Sdk.Gen/Managers/Webhooks/WebhooksManager.cs +++ b/Box.Sdk.Gen/Managers/Webhooks/WebhooksManager.cs @@ -38,7 +38,7 @@ public async System.Threading.Tasks.Task GetWebhooksAsync(GetWebhooksQ headers = headers ?? new GetWebhooksHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "marker", StringUtils.ToStringRepresentation(queryParams.Marker) }, { "limit", StringUtils.ToStringRepresentation(queryParams.Limit) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/webhooks"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/webhooks"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -57,7 +57,7 @@ public async System.Threading.Tasks.Task GetWebhooksAsync(GetWebhooksQ public async System.Threading.Tasks.Task CreateWebhookAsync(CreateWebhookRequestBody requestBody, CreateWebhookHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new CreateWebhookHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/webhooks"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/webhooks"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -77,7 +77,7 @@ public async System.Threading.Tasks.Task CreateWebhookAsync(CreateWebho public async System.Threading.Tasks.Task GetWebhookByIdAsync(string webhookId, GetWebhookByIdHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new GetWebhookByIdHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/webhooks/", StringUtils.ToStringRepresentation(webhookId)), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/webhooks/", StringUtils.ToStringRepresentation(webhookId)), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -101,7 +101,7 @@ public async System.Threading.Tasks.Task UpdateWebhookByIdAsync(string requestBody = requestBody ?? new UpdateWebhookByIdRequestBody(); headers = headers ?? new UpdateWebhookByIdHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/webhooks/", StringUtils.ToStringRepresentation(webhookId)), method: "PUT", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/webhooks/", StringUtils.ToStringRepresentation(webhookId)), method: "PUT", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -121,7 +121,7 @@ public async System.Threading.Tasks.Task UpdateWebhookByIdAsync(string public async System.Threading.Tasks.Task DeleteWebhookByIdAsync(string webhookId, DeleteWebhookByIdHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new DeleteWebhookByIdHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/webhooks/", StringUtils.ToStringRepresentation(webhookId)), method: "DELETE", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/webhooks/", StringUtils.ToStringRepresentation(webhookId)), method: "DELETE", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); } } diff --git a/Box.Sdk.Gen/Managers/Workflows/WorkflowsManager.cs b/Box.Sdk.Gen/Managers/Workflows/WorkflowsManager.cs index df4bd8ae..d7a2a7bf 100644 --- a/Box.Sdk.Gen/Managers/Workflows/WorkflowsManager.cs +++ b/Box.Sdk.Gen/Managers/Workflows/WorkflowsManager.cs @@ -35,7 +35,7 @@ public async System.Threading.Tasks.Task GetWorkflowsAsync(GetWorkflo headers = headers ?? new GetWorkflowsHeaders(); Dictionary queryParamsMap = Utils.PrepareParams(map: new Dictionary() { { "folder_id", StringUtils.ToStringRepresentation(queryParams.FolderId) }, { "trigger_type", StringUtils.ToStringRepresentation(queryParams.TriggerType) }, { "limit", StringUtils.ToStringRepresentation(queryParams.Limit) }, { "marker", StringUtils.ToStringRepresentation(queryParams.Marker) } }); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/workflows"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/workflows"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -61,7 +61,7 @@ public async System.Threading.Tasks.Task GetWorkflowsAsync(GetWorkflo public async System.Threading.Tasks.Task StartWorkflowAsync(string workflowId, StartWorkflowRequestBody requestBody, StartWorkflowHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new StartWorkflowHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/workflows/", StringUtils.ToStringRepresentation(workflowId), "/start"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/workflows/", StringUtils.ToStringRepresentation(workflowId), "/start"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); } } diff --git a/Box.Sdk.Gen/Managers/ZipDownloads/ZipDownloadsManager.cs b/Box.Sdk.Gen/Managers/ZipDownloads/ZipDownloadsManager.cs index 8318d774..cb7540c6 100644 --- a/Box.Sdk.Gen/Managers/ZipDownloads/ZipDownloadsManager.cs +++ b/Box.Sdk.Gen/Managers/ZipDownloads/ZipDownloadsManager.cs @@ -43,7 +43,7 @@ public ZipDownloadsManager(NetworkSession? networkSession = default) { public async System.Threading.Tasks.Task CreateZipDownloadAsync(ZipDownloadRequest requestBody, CreateZipDownloadHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new CreateZipDownloadHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/zip_downloads"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/zip_downloads"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } @@ -75,7 +75,7 @@ public async System.Threading.Tasks.Task CreateZipDownloadAsync(Zip public async System.Threading.Tasks.Task GetZipDownloadContentAsync(string downloadUrl, GetZipDownloadContentHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new GetZipDownloadContentHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: downloadUrl, method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Binary) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: downloadUrl, method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Binary) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return NullableUtils.Unwrap(response.Content); } @@ -106,7 +106,7 @@ public async System.Threading.Tasks.Task CreateZipDownloadAsync(Zip public async System.Threading.Tasks.Task GetZipDownloadStatusAsync(string statusUrl, GetZipDownloadStatusHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) { headers = headers ?? new GetZipDownloadStatusHeaders(); Dictionary headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary() { }, headers.ExtraHeaders)); - FetchResponse response = await HttpClientAdapter.FetchAsync(new FetchOptions(url: statusUrl, method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); + FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: statusUrl, method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false); return SimpleJsonSerializer.Deserialize(NullableUtils.Unwrap(response.Data)); } diff --git a/Box.Sdk.Gen/Networking/BoxNetworkClient/BoxNetworkClient.cs b/Box.Sdk.Gen/Networking/BoxNetworkClient/BoxNetworkClient.cs new file mode 100644 index 00000000..bb665ff4 --- /dev/null +++ b/Box.Sdk.Gen/Networking/BoxNetworkClient/BoxNetworkClient.cs @@ -0,0 +1,414 @@ +using Microsoft.Extensions.DependencyInjection; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Net; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Text.RegularExpressions; +using System.Threading; +using System.Threading.Tasks; + +namespace Box.Sdk.Gen.Internal +{ + class BoxNetworkClient : INetworkClient + { + static IHttpClientFactory _clientFactory; + + private static ProxyClient? _proxyClient; + + static BoxNetworkClient() + { + var serviceCollection = new ServiceCollection(); + + serviceCollection.AddHttpClient(); + + var httpClientFactory = serviceCollection.BuildServiceProvider().GetService(); + if (httpClientFactory == null) + { + throw new BoxSdkException("Unable to create HttpClient. Cannot get an IHttpClientFactory instance from a ServiceProvider."); + } + _clientFactory = httpClientFactory; + } + + /// + /// Executes http/s request. + /// + /// Request options of a request. + /// A http/s Response as a FetchResponse. + async Task INetworkClient.FetchAsync(FetchOptions options) + { + var networkSession = options.NetworkSession ?? new NetworkSession(); + + var client = GetOrCreateHttpClient(networkSession); + + var attempt = 1; + var cancellationToken = options.CancellationToken ?? default(System.Threading.CancellationToken); + + bool isStreamResponse = options.ResponseFormat == ResponseFormat.Binary; + + Stream? seekableStream = null; + if (options.FileStream != null && options.ContentType == ContentTypes.OctetStream) + { + // buffer the stream in memory in case we cannot rewind it + seekableStream = options.FileStream.CanSeek ? options.FileStream : await ToMemoryStreamAsync(options.FileStream).ConfigureAwait(false); + } + + while (true) + { + var request = await BuildHttpRequest(options, seekableStream).ConfigureAwait(false); + var result = await ExecuteRequest(client, request, isStreamResponse, cancellationToken).ConfigureAwait(false); + + if (result.IsSuccess) + { + var response = result.Value!; + + var url = response.RequestMessage?.RequestUri?.ToString() ?? request.RequestUri?.ToString() ?? options.Url; + var statusCode = (int)response.StatusCode; + var isRetryAfterPresent = response.Headers.Contains("retry-after"); + var isRetryAfterWithAcceptedPresent = isRetryAfterPresent && statusCode == 202; + + if (response.IsSuccessStatusCode && (!isRetryAfterWithAcceptedPresent || attempt >= networkSession.RetryAttempts)) + { + seekableStream?.Dispose(); + return isStreamResponse ? + new FetchResponse(status: statusCode, headers: response.Headers.ToDictionary(x => x.Key, x => x.Value.First())) { Url = url, Content = await response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false) } : + new FetchResponse(status: statusCode, headers: response.Headers.ToDictionary(x => x.Key, x => x.Value.First())) { Url = url, Data = JsonUtils.JsonToSerializedData(await response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false)) }; + } + + if (attempt >= networkSession.RetryAttempts) + { + seekableStream?.Dispose(); + throw new BoxSdkException($"Max retry attempts excedeed.", DateTimeOffset.UtcNow); + } + + if (statusCode == 401) + { + if (options.Auth != null) + { + await options.Auth.RefreshTokenAsync(networkSession).ConfigureAwait(false); + } + } + else if (statusCode == 429 || statusCode >= 500 || isRetryAfterWithAcceptedPresent) + { + var retryTimeout = isRetryAfterPresent ? + int.Parse(response.Headers.GetValues("retry-after").First()) : + networkSession.RetryStrategy.GetRetryTimeout(attempt); + + await System.Threading.Tasks.Task.Delay(TimeSpan.FromSeconds(retryTimeout)).ConfigureAwait(false); + } + else if (statusCode == 407) + { + throw new BoxSdkException($"Proxy authorization required. Check provided credentials in proxy configuration.", DateTimeOffset.UtcNow); + } + else + { + seekableStream?.Dispose(); + throw await BuildApiException(request, response, options, statusCode, cancellationToken).ConfigureAwait(false); + } + + response?.Dispose(); + } + else + { + if (!result.IsRetryable) + { + seekableStream?.Dispose(); + throw new BoxSdkException($"Request was not retried. Inner exception: {result.Exception?.ToString()}", DateTimeOffset.UtcNow); + } + else if (attempt >= networkSession.RetryAttempts) + { + seekableStream?.Dispose(); + throw new BoxSdkException($"Network error. Max retry attempts excedeed. {result.Exception?.ToString()}", DateTimeOffset.UtcNow); + } + + var retryTimeout = networkSession.RetryStrategy.GetRetryTimeout(attempt); + await System.Threading.Tasks.Task.Delay(TimeSpan.FromSeconds(retryTimeout)).ConfigureAwait(false); + + // reauth in case of terminated connection by the peer + if (options.Auth != null) + { + await options.Auth.RefreshTokenAsync(networkSession).ConfigureAwait(false); + } + } + + attempt++; + } + + } + + private static HttpClient GetOrCreateHttpClient(NetworkSession networkSession) + { + if (networkSession.proxyConfig == null) + { + return _clientFactory.CreateClient(); + } + else + { + //To handle proxy clients with different configurations better, we could use ConcurrentDictionary instead + var proxyKey = GenerateProxyKey(networkSession.proxyConfig); + if (_proxyClient == null || _proxyClient.ProxyKey != proxyKey) + { + var newClient = new ProxyClient(proxyKey, networkSession.proxyConfig); + _proxyClient = newClient; + return newClient.HttpClient; + } + return _proxyClient.HttpClient!; + } + } + + private static HttpClient CreateProxyClient(ProxyConfig proxyConfig) + { + var webProxy = new WebProxy(proxyConfig.Url) + { + UseDefaultCredentials = proxyConfig.UseDefaultCredentials + }; + + if (!proxyConfig.UseDefaultCredentials) + { + webProxy.Credentials = new NetworkCredential( + proxyConfig.Username, + proxyConfig.Password, + proxyConfig.Domain); + } + + var handler = new HttpClientHandler + { + Proxy = webProxy, + UseProxy = true, + PreAuthenticate = true + }; + + return new HttpClient(handler, disposeHandler: true); + } + + private static HttpMethod MapHttpMethod(string method) + { + if (!httpMethodsMap.TryGetValue(method.ToUpper(), out var tempMethod)) + { + throw new ArgumentException($"Provided HTTP method '{method}' is not supported.", nameof(method)); + } + + return tempMethod; + } + + private static string GenerateProxyKey(ProxyConfig proxyConfig) + { + return $"{proxyConfig.Url}_{proxyConfig.Domain}_{proxyConfig.Username}_{proxyConfig.Password}"; + } + + private static async Task BuildApiException(HttpRequestMessage request, HttpResponseMessage? response, FetchOptions options, + int statusCode, System.Threading.CancellationToken cancellationToken) + { + string responseContent; + Dictionary responseHeaders; + + if (response != null) + { + responseContent = await response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); + responseHeaders = response.Headers.Where(x => x.Value.Any()).ToDictionary(x => x.Key, x => x.Value.First()); + } + else + { + responseContent = "empty"; + responseHeaders = new Dictionary(); + } + + response?.Dispose(); + + var requestHeaders = request.Headers + .Where(x => x.Value.Any()) + .ToDictionary(x => x.Key, x => x.Value.First()); + + var requestInfo = new RequestInfo(request.Method.ToString(), request.RequestUri?.ToString(), options.Parameters, requestHeaders); + + var responseAsSerializedData = JsonUtils.JsonToSerializedData(responseContent); + var errorDetails = SimpleJsonSerializer.DeserializeWithoutRawJson(responseAsSerializedData); + + var responseInfo = new ResponseInfo(statusCode, responseHeaders, responseAsSerializedData, responseContent, errorDetails.Code, errorDetails.ContextInfo, + errorDetails.RequestId, errorDetails.HelpUrl); + + return new BoxApiException(responseContent, DateTimeOffset.UtcNow, requestInfo, responseInfo); + } + + private static async Task BuildHttpRequest(FetchOptions options, Stream? stream) + { + var httpRequest = new HttpRequestMessage + { + Method = MapHttpMethod(options.Method), + RequestUri = HttpUtils.BuildUri(options.Url, options.Parameters), + Content = BuildHttpContent(options, stream) + }; + + if (options.NetworkSession != null) + { + foreach (var header in options.NetworkSession.AdditionalHeaders) + { + httpRequest.Headers.Add(header.Key, header.Value); + } + } + + if (options.Headers != null) + { + foreach (var header in options.Headers) + { + //TODO make it more generic + if (header.Key == "content-range") + { + var headValue = header.Value; + httpRequest.Content!.Headers.Add(header.Key, headValue); + } + else + { + httpRequest.Headers.Add(header.Key, header.Value); + } + } + } + + if (options.ContentType != null && httpRequest.Content is StringContent) + { + httpRequest.Content!.Headers.ContentType = new MediaTypeHeaderValue(options.ContentType); + } + + foreach (var keyValuePair in SdkConsts.AnalyticsHeaders) + { + httpRequest.Headers.Add(keyValuePair.Key, keyValuePair.Value); + } + + if (options.Auth != null) + { + var authHeaderValue = await options.Auth.RetrieveAuthorizationHeaderAsync(options.NetworkSession).ConfigureAwait(false); + httpRequest.Headers.Add("Authorization", authHeaderValue); + } + + return httpRequest; + } + + private static async Task> ExecuteRequest(HttpClient client, HttpRequestMessage httpRequestMessage, bool isStreamResponse, + CancellationToken cancellationToken) + { + try + { + HttpCompletionOption completionOption = isStreamResponse ? + HttpCompletionOption.ResponseHeadersRead : + HttpCompletionOption.ResponseContentRead; + + var response = await client.SendAsync(httpRequestMessage, completionOption, cancellationToken).ConfigureAwait(false); + return Result.Ok(response); + } + catch (HttpRequestException ex) + { + string pattern = @"status code\s*'(\d+)'"; + Match match = Regex.Match(ex.Message, pattern); + if (match.Success) + { + string statusCode = match.Groups[1].Value; + + if (statusCode == "407") + { + return Result.Fail(ex, false); + } + } + return Result.Fail(ex); + } + catch (Exception ex) + { + return Result.Fail(ex); + } + } + + private static HttpContent? BuildHttpContent(FetchOptions options, Stream? stream) + { + HttpContent? httpContent; + + if (options.ContentType == ContentTypes.MultipartFormData) + { + var multipartContent = new MultipartFormDataContent(); + + if (options.MultipartData == null) + { + throw new BoxSdkException("Could not upload file. MultipartData on FetchOptions is null"); + } + + foreach (var part in options.MultipartData) + { + HttpContent partContent = part.FileStream != null ? + new ReusableContent(part.FileStream) : + part.Data != null ? + new StringContent(JsonUtils.SdToJson(part.Data)) : + throw new BoxSdkException($"HttpContent for MultipartData {part} not found"); + + // for avatar upload + if (part.ContentType != null && part.FileName != null) + { + partContent.Headers.ContentType = new MediaTypeHeaderValue(part.ContentType); + partContent.Headers.ContentDisposition = new ContentDispositionHeaderValue("form-data") + { + Name = "pic", + FileName = part.FileName + }; + } + + if (part.FileStream != null) + { + //TODO workaround for empty part.FileName + multipartContent.Add(partContent, part.PartName, "file"); + } + else + { + multipartContent.Add(partContent, part.PartName); + } + } + + httpContent = multipartContent; + } + else if (options.ContentType == ContentTypes.FormUrlEncoded && options.Data != null) + { + var deserialized = SimpleJsonSerializer.DeserializeWithoutRawJson>(options.Data); + httpContent = new FormUrlEncodedContent(deserialized); + } + else if (options.ContentType == ContentTypes.OctetStream && stream != null) + { + httpContent = new ReusableContent(stream); + } + else + { + httpContent = options.Data != null ? new StringContent(JsonUtils.SdToJson(options.Data)) : default; + } + + return httpContent; + } + + private static async Task ToMemoryStreamAsync(Stream inputStream) + { + var memoryStream = new MemoryStream(); + await inputStream.CopyToAsync(memoryStream).ConfigureAwait(false); + memoryStream.Position = 0; + return memoryStream; + } + + private class ProxyClient + { + public string ProxyKey { get; } + public HttpClient HttpClient { get; } + + public ProxyClient(string proxyKey, ProxyConfig proxyConfig) + { + ProxyKey = proxyKey; + HttpClient = CreateProxyClient(proxyConfig); + } + } + + private static Dictionary httpMethodsMap = new Dictionary() { + { "GET", HttpMethod.Get }, + { "POST", HttpMethod.Post }, + { "PUT", HttpMethod.Put }, + { "PATCH", HttpMethod.Patch }, + { "DELETE", HttpMethod.Delete }, + { "OPTIONS", HttpMethod.Options }, + { "HEAD", HttpMethod.Head }, + { "TRACE", HttpMethod.Trace }, + }; + } +} diff --git a/Box.Sdk.Gen/Networking/Fetch.cs b/Box.Sdk.Gen/Networking/DefaultNetworkClient/DefaultNetworkClient.cs similarity index 98% rename from Box.Sdk.Gen/Networking/Fetch.cs rename to Box.Sdk.Gen/Networking/DefaultNetworkClient/DefaultNetworkClient.cs index d29e0cdf..c4ded749 100644 --- a/Box.Sdk.Gen/Networking/Fetch.cs +++ b/Box.Sdk.Gen/Networking/DefaultNetworkClient/DefaultNetworkClient.cs @@ -22,13 +22,13 @@ static class ContentTypes /// /// Static HttpClient. /// - static class HttpClientAdapter + class DefaultNetworkClient : INetworkClient { static IHttpClientFactory _clientFactory; private static ProxyClient? _proxyClient; - static HttpClientAdapter() + static DefaultNetworkClient() { var serviceCollection = new ServiceCollection(); @@ -47,7 +47,7 @@ static HttpClientAdapter() /// /// Request options of a request. /// A http/s Response as a FetchResponse. - internal static async Task FetchAsync(FetchOptions options) + async Task INetworkClient.FetchAsync(FetchOptions options) { var networkSession = options.NetworkSession ?? new NetworkSession(); @@ -281,11 +281,6 @@ private static async Task BuildHttpRequest(FetchOptions opti httpRequest.Content!.Headers.ContentType = new MediaTypeHeaderValue(options.ContentType); } - foreach (var keyValuePair in SdkConsts.AnalyticsHeaders) - { - httpRequest.Headers.Add(keyValuePair.Key, keyValuePair.Value); - } - if (options.Auth != null) { var authHeaderValue = await options.Auth.RetrieveAuthorizationHeaderAsync(options.NetworkSession).ConfigureAwait(false); diff --git a/Box.Sdk.Gen/Networking/NetworkClient/INetworkClient.cs b/Box.Sdk.Gen/Networking/NetworkClient/INetworkClient.cs new file mode 100644 index 00000000..3bfbc257 --- /dev/null +++ b/Box.Sdk.Gen/Networking/NetworkClient/INetworkClient.cs @@ -0,0 +1,8 @@ +using Box.Sdk.Gen.Internal; + +namespace Box.Sdk.Gen { + public interface INetworkClient { + public System.Threading.Tasks.Task FetchAsync(FetchOptions options) => throw new System.NotImplementedException("This method needs to be implemented by the derived class before calling it."); + + } +} \ No newline at end of file diff --git a/Box.Sdk.Gen/Networking/NetworkSession.cs b/Box.Sdk.Gen/Networking/NetworkSession.cs index 97ecc633..bc7c6355 100644 --- a/Box.Sdk.Gen/Networking/NetworkSession.cs +++ b/Box.Sdk.Gen/Networking/NetworkSession.cs @@ -33,12 +33,26 @@ public class NetworkSession /// public ProxyConfig? proxyConfig { get; init; } + /// + /// Network client used to make API calls. + /// + public INetworkClient NetworkClient { get; init; } = new BoxNetworkClient(); + public NetworkSession(Dictionary? additionalHeaders = default, BaseUrls? baseUrls = null) { AdditionalHeaders = additionalHeaders ?? new Dictionary(); BaseUrls = baseUrls ?? new BaseUrls(); } + /// + /// Generate a fresh network session by duplicating the existing configuration and network parameters, + /// while also including a custom network client to be used for each API call. + /// + public NetworkSession WithNetworkClient(INetworkClient networkClient) + { + return new NetworkSession(this.AdditionalHeaders, this.BaseUrls) { RetryAttempts = this.RetryAttempts, RetryStrategy = this.RetryStrategy, proxyConfig = this.proxyConfig, NetworkClient = networkClient }; + } + /// /// Generate a fresh network session by duplicating the existing configuration and network parameters, /// while also including additional headers to be attached to every API call. @@ -48,7 +62,7 @@ public NetworkSession(Dictionary? additionalHeaders = default, B /// public NetworkSession WithAdditionalHeaders(Dictionary additionalHeaders) { - return new NetworkSession(DictionaryUtils.MergeDictionaries(this.AdditionalHeaders, additionalHeaders), this.BaseUrls) { RetryAttempts = this.RetryAttempts, RetryStrategy = this.RetryStrategy, proxyConfig = this.proxyConfig }; + return new NetworkSession(DictionaryUtils.MergeDictionaries(this.AdditionalHeaders, additionalHeaders), this.BaseUrls) { RetryAttempts = this.RetryAttempts, RetryStrategy = this.RetryStrategy, proxyConfig = this.proxyConfig, NetworkClient = this.NetworkClient}; } /// @@ -60,7 +74,7 @@ public NetworkSession WithAdditionalHeaders(Dictionary additiona /// public NetworkSession WithCustomBaseUrls(BaseUrls baseUrls) { - return new NetworkSession(this.AdditionalHeaders, baseUrls) { RetryAttempts = this.RetryAttempts, RetryStrategy = this.RetryStrategy, proxyConfig = this.proxyConfig }; + return new NetworkSession(this.AdditionalHeaders, baseUrls) { RetryAttempts = this.RetryAttempts, RetryStrategy = this.RetryStrategy, proxyConfig = this.proxyConfig, NetworkClient = this.NetworkClient}; } /// @@ -72,7 +86,7 @@ public NetworkSession WithCustomBaseUrls(BaseUrls baseUrls) /// public NetworkSession WithProxy(ProxyConfig config) { - return new NetworkSession(this.AdditionalHeaders, this.BaseUrls) { RetryAttempts = this.RetryAttempts, RetryStrategy = this.RetryStrategy, proxyConfig = config }; + return new NetworkSession(this.AdditionalHeaders, this.BaseUrls) { RetryAttempts = this.RetryAttempts, RetryStrategy = this.RetryStrategy, proxyConfig = config, NetworkClient = this.NetworkClient}; } } }