Skip to content

Commit 1d2e579

Browse files
committed
feat: add signer language, cancel sign request reason (box/box-openapi#584)
1 parent 5b3e1a5 commit 1d2e579

21 files changed

Lines changed: 187 additions & 29 deletions

File tree

.codegen.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{ "engineHash": "bfb97cc", "specHash": "ccdb456", "version": "10.5.0" }
1+
{ "engineHash": "bfb97cc", "specHash": "77eac4b", "version": "10.5.0" }

Box.Sdk.Gen.Net/Managers/Folders/GetFolderByIdQueryParams.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,10 @@ public class GetFolderByIdQueryParams {
6767
/// <summary>
6868
/// The offset of the item at which to begin the response.
6969
///
70-
/// Queries with offset parameter value
71-
/// exceeding 10000 will be rejected
72-
/// with a 400 response.
70+
/// Offset-based pagination is not guaranteed to work reliably for high offset values and may fail for large datasets. In
71+
/// those cases, reduce the number of items in the folder (for example, by
72+
/// restructuring the folder into smaller subfolders) before retrying the
73+
/// request.
7374
/// </summary>
7475
public long? Offset { get; init; }
7576

Box.Sdk.Gen.Net/Managers/Folders/GetFolderItemsQueryParams.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,8 @@ public class GetFolderItemsQueryParams {
4848
/// <summary>
4949
/// The offset of the item at which to begin the response.
5050
///
51-
/// Queries with offset parameter value
52-
/// exceeding 10000 will be rejected
53-
/// with a 400 response.
51+
/// Offset-based pagination is not guaranteed to work reliably for high offset values and may fail for large datasets. In
52+
/// those cases, use marker-based pagination by setting `usemarker` to `true`.
5453
/// </summary>
5554
public long? Offset { get; init; }
5655

Box.Sdk.Gen.Net/Managers/SignRequests/ISignRequestsManager.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,16 @@ public interface ISignRequestsManager {
1414
/// The ID of the signature request.
1515
/// Example: "33243242"
1616
/// </param>
17+
/// <param name="requestBody">
18+
/// Request body of cancelSignRequest method
19+
/// </param>
1720
/// <param name="headers">
1821
/// Headers of cancelSignRequest method
1922
/// </param>
2023
/// <param name="cancellationToken">
2124
/// Token used for request cancellation.
2225
/// </param>
23-
public System.Threading.Tasks.Task<SignRequest> CancelSignRequestAsync(string signRequestId, CancelSignRequestHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) => throw new System.NotImplementedException("This method needs to be implemented by the derived class before calling it.");
26+
public System.Threading.Tasks.Task<SignRequest> CancelSignRequestAsync(string signRequestId, SignRequestCancelRequest? requestBody = null, CancelSignRequestHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) => throw new System.NotImplementedException("This method needs to be implemented by the derived class before calling it.");
2427

2528
/// <summary>
2629
/// Resends a signature request email to all outstanding signers.

Box.Sdk.Gen.Net/Managers/SignRequests/SignRequestsManager.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,19 @@ public SignRequestsManager(NetworkSession? networkSession = default) {
2121
/// The ID of the signature request.
2222
/// Example: "33243242"
2323
/// </param>
24+
/// <param name="requestBody">
25+
/// Request body of cancelSignRequest method
26+
/// </param>
2427
/// <param name="headers">
2528
/// Headers of cancelSignRequest method
2629
/// </param>
2730
/// <param name="cancellationToken">
2831
/// Token used for request cancellation.
2932
/// </param>
30-
public async System.Threading.Tasks.Task<SignRequest> CancelSignRequestAsync(string signRequestId, CancelSignRequestHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) {
33+
public async System.Threading.Tasks.Task<SignRequest> CancelSignRequestAsync(string signRequestId, SignRequestCancelRequest? requestBody = null, CancelSignRequestHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) {
3134
headers = headers ?? new CancelSignRequestHeaders();
3235
Dictionary<string, string> headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary<string, string?>() { }, headers.ExtraHeaders));
33-
FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/sign_requests/", NullableUtils.Unwrap(StringUtils.ToStringRepresentation(signRequestId)), "/cancel"), method: "POST", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false);
36+
FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/sign_requests/", NullableUtils.Unwrap(StringUtils.ToStringRepresentation(signRequestId)), "/cancel"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = requestBody != null ? SimpleJsonSerializer.Serialize(requestBody) : null, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false);
3437
return SimpleJsonSerializer.Deserialize<SignRequest>(NullableUtils.Unwrap(response.Data));
3538
}
3639

Box.Sdk.Gen.Net/Schemas/AiExtractStructuredResponse/AiExtractStructuredResponse.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public class AiExtractStructuredResponse : ISerializable {
2424
public string? CompletionReason { get; init; }
2525

2626
/// <summary>
27-
/// The confidence score numeric values for each extracted field as a JSON dictionary. This can be empty if no field could be extracted.
27+
/// The confidence score levels and numeric values for each extracted field as a JSON dictionary. This can be empty if no field could be extracted.
2828
/// </summary>
2929
[JsonPropertyName("confidence_score")]
3030
[JsonConverter(typeof(DictionaryObjectValuesConverter))]
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
using Box.Sdk.Gen;
2+
using System.Text.Json.Serialization;
3+
using System.Collections.Generic;
4+
using Box.Sdk.Gen.Internal;
5+
6+
namespace Box.Sdk.Gen.Schemas {
7+
public class SignRequestCancelRequest : ISerializable {
8+
/// <summary>
9+
/// An optional reason for cancelling the sign request.
10+
/// </summary>
11+
[JsonPropertyName("reason")]
12+
public string? Reason { get; init; }
13+
14+
public SignRequestCancelRequest() {
15+
16+
}
17+
internal string? RawJson { get; set; } = default;
18+
19+
void ISerializable.SetJson(string json) {
20+
RawJson = json;
21+
}
22+
23+
string? ISerializable.GetJson() {
24+
return RawJson;
25+
}
26+
27+
/// <summary>
28+
/// Returns raw json response returned from the API.
29+
/// </summary>
30+
public Dictionary<string, object?>? GetRawData() {
31+
return SimpleJsonSerializer.GetAllFields(this);
32+
}
33+
34+
}
35+
}

Box.Sdk.Gen.Net/Schemas/SignRequestCreateSigner/SignRequestCreateSigner.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ public class SignRequestCreateSigner : ISerializable {
4141
[JsonPropertyName("_issuppress_notificationsSet")]
4242
protected bool _isSuppressNotificationsSet { get; set; }
4343

44+
[JsonInclude]
45+
[JsonPropertyName("_islanguageSet")]
46+
protected bool _isLanguageSet { get; set; }
47+
4448
protected string? _email { get; set; }
4549

4650
protected string? _embedUrlExternalUserId { get; set; }
@@ -59,6 +63,8 @@ public class SignRequestCreateSigner : ISerializable {
5963

6064
protected bool? _suppressNotifications { get; set; }
6165

66+
protected string? _language { get; set; }
67+
6268
/// <summary>
6369
/// Email address of the signer.
6470
/// The email address of the signer is required when making signature requests, except when using templates that are configured to include emails.
@@ -158,6 +164,13 @@ public class SignRequestCreateSigner : ISerializable {
158164
[JsonPropertyName("suppress_notifications")]
159165
public bool? SuppressNotifications { get => _suppressNotifications; init { _suppressNotifications = value; _isSuppressNotificationsSet = true; } }
160166

167+
/// <summary>
168+
/// The language of the user, formatted in modified version of the
169+
/// [ISO 639-1](https://developer.box.com/guides/api-calls/language-codes) format.
170+
/// </summary>
171+
[JsonPropertyName("language")]
172+
public string? Language { get => _language; init { _language = value; _isLanguageSet = true; } }
173+
161174
public SignRequestCreateSigner() {
162175

163176
}

Box.Sdk.Gen.NetFramework/Managers/Folders/GetFolderByIdQueryParams.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,10 @@ public class GetFolderByIdQueryParams {
6767
/// <summary>
6868
/// The offset of the item at which to begin the response.
6969
///
70-
/// Queries with offset parameter value
71-
/// exceeding 10000 will be rejected
72-
/// with a 400 response.
70+
/// Offset-based pagination is not guaranteed to work reliably for high offset values and may fail for large datasets. In
71+
/// those cases, reduce the number of items in the folder (for example, by
72+
/// restructuring the folder into smaller subfolders) before retrying the
73+
/// request.
7374
/// </summary>
7475
public long? Offset { get; set; }
7576

Box.Sdk.Gen.NetFramework/Managers/Folders/GetFolderItemsQueryParams.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,8 @@ public class GetFolderItemsQueryParams {
4848
/// <summary>
4949
/// The offset of the item at which to begin the response.
5050
///
51-
/// Queries with offset parameter value
52-
/// exceeding 10000 will be rejected
53-
/// with a 400 response.
51+
/// Offset-based pagination is not guaranteed to work reliably for high offset values and may fail for large datasets. In
52+
/// those cases, use marker-based pagination by setting `usemarker` to `true`.
5453
/// </summary>
5554
public long? Offset { get; set; }
5655

0 commit comments

Comments
 (0)