Skip to content

Commit d563886

Browse files
box-sdk-buildbox-sdk-build
andauthored
feat: Add Box Sign shared requests (box/box-openapi#504) (#384)
Co-authored-by: box-sdk-build <[email protected]>
1 parent d6995ad commit d563886

10 files changed

+60
-2
lines changed

.codegen.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{ "engineHash": "b5ed925", "specHash": "99792c6", "version": "1.6.0" }
1+
{ "engineHash": "b5ed925", "specHash": "3dc3f1e", "version": "1.6.0" }

Box.Sdk.Gen/Managers/SignRequests/CancelSignRequestHeaders.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using Box.Sdk.Gen;
22
using System.Collections.Generic;
33
using System.Collections.ObjectModel;
4+
using System;
45
using Box.Sdk.Gen.Internal;
56
using Box.Sdk.Gen.Schemas;
67

Box.Sdk.Gen/Managers/SignRequests/CreateSignRequestHeaders.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using Box.Sdk.Gen;
22
using System.Collections.Generic;
33
using System.Collections.ObjectModel;
4+
using System;
45
using Box.Sdk.Gen.Internal;
56
using Box.Sdk.Gen.Schemas;
67

Box.Sdk.Gen/Managers/SignRequests/GetSignRequestByIdHeaders.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using Box.Sdk.Gen;
22
using System.Collections.Generic;
33
using System.Collections.ObjectModel;
4+
using System;
45
using Box.Sdk.Gen.Internal;
56
using Box.Sdk.Gen.Schemas;
67

Box.Sdk.Gen/Managers/SignRequests/GetSignRequestsHeaders.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using Box.Sdk.Gen;
22
using System.Collections.Generic;
33
using System.Collections.ObjectModel;
4+
using System;
45
using Box.Sdk.Gen.Internal;
56
using Box.Sdk.Gen.Schemas;
67

Box.Sdk.Gen/Managers/SignRequests/GetSignRequestsQueryParams.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using Box.Sdk.Gen;
22
using System.Collections.Generic;
33
using System.Collections.ObjectModel;
4+
using System;
45
using Box.Sdk.Gen.Internal;
56
using Box.Sdk.Gen.Schemas;
67

@@ -19,6 +20,20 @@ public class GetSignRequestsQueryParams {
1920
/// </summary>
2021
public long? Limit { get; init; }
2122

23+
/// <summary>
24+
/// A list of sender emails to filter the signature requests by sender.
25+
/// If provided, `shared_requests` must be set to `true`.
26+
/// </summary>
27+
public IReadOnlyList<string>? Senders { get; init; }
28+
29+
/// <summary>
30+
/// If set to `true`, only includes requests that user is not an owner,
31+
/// but user is a collaborator. Collaborator access is determined by the
32+
/// user access level of the sign files of the request.
33+
/// Default is `false`. Must be set to `true` if `senders` are provided.
34+
/// </summary>
35+
public bool? SharedRequests { get; init; }
36+
2237
public GetSignRequestsQueryParams() {
2338

2439
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using Box.Sdk.Gen;
22
using System.Collections.Generic;
33
using System.Collections.ObjectModel;
4+
using System;
45
using Box.Sdk.Gen.Internal;
56
using Box.Sdk.Gen.Schemas;
67

Box.Sdk.Gen/Managers/SignRequests/ResendSignRequestHeaders.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using Box.Sdk.Gen;
22
using System.Collections.Generic;
33
using System.Collections.ObjectModel;
4+
using System;
45
using Box.Sdk.Gen.Internal;
56
using Box.Sdk.Gen.Schemas;
67

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using Box.Sdk.Gen;
22
using System.Collections.Generic;
33
using System.Collections.ObjectModel;
4+
using System;
45
using Box.Sdk.Gen.Internal;
56
using Box.Sdk.Gen.Schemas;
67

@@ -88,7 +89,7 @@ public async System.Threading.Tasks.Task<SignRequest> GetSignRequestByIdAsync(st
8889
public async System.Threading.Tasks.Task<SignRequests> GetSignRequestsAsync(GetSignRequestsQueryParams? queryParams = default, GetSignRequestsHeaders? headers = default, System.Threading.CancellationToken? cancellationToken = null) {
8990
queryParams = queryParams ?? new GetSignRequestsQueryParams();
9091
headers = headers ?? new GetSignRequestsHeaders();
91-
Dictionary<string, string> queryParamsMap = Utils.PrepareParams(map: new Dictionary<string, string?>() { { "marker", StringUtils.ToStringRepresentation(queryParams.Marker) }, { "limit", StringUtils.ToStringRepresentation(queryParams.Limit) } });
92+
Dictionary<string, string> queryParamsMap = Utils.PrepareParams(map: new Dictionary<string, string?>() { { "marker", StringUtils.ToStringRepresentation(queryParams.Marker) }, { "limit", StringUtils.ToStringRepresentation(queryParams.Limit) }, { "senders", StringUtils.ToStringRepresentation(queryParams.Senders) }, { "shared_requests", StringUtils.ToStringRepresentation(queryParams.SharedRequests) } });
9293
Dictionary<string, string> headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary<string, string?>() { }, headers.ExtraHeaders));
9394
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);
9495
return SimpleJsonSerializer.Deserialize<SignRequests>(NullableUtils.Unwrap(response.Data));

Box.Sdk.Gen/Schemas/SignRequest/SignRequest.cs

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,30 @@ public class SignRequest : SignRequestBase, ISerializable {
2020
[JsonPropertyName("_isauto_expire_atSet")]
2121
protected bool _isAutoExpireAtSet { get; set; }
2222

23+
[JsonInclude]
24+
[JsonPropertyName("_iscollaborator_levelSet")]
25+
protected bool _isCollaboratorLevelSet { get; set; }
26+
27+
[JsonInclude]
28+
[JsonPropertyName("_issender_emailSet")]
29+
protected bool _isSenderEmailSet { get; set; }
30+
31+
[JsonInclude]
32+
[JsonPropertyName("_issender_idSet")]
33+
protected bool _isSenderIdSet { get; set; }
34+
2335
protected string? _signatureColor { get; set; }
2436

2537
protected string? _prepareUrl { get; set; }
2638

2739
protected System.DateTimeOffset? _autoExpireAt { get; set; }
2840

41+
protected string? _collaboratorLevel { get; set; }
42+
43+
protected string? _senderEmail { get; set; }
44+
45+
protected long? _senderId { get; set; }
46+
2947
/// <summary>
3048
/// object type
3149
/// </summary>
@@ -95,6 +113,24 @@ public class SignRequest : SignRequestBase, ISerializable {
95113
[JsonPropertyName("parent_folder")]
96114
public FolderMini? ParentFolder { get; init; }
97115

116+
/// <summary>
117+
/// The collaborator level of the user to the sign request. Values can include "owner", "editor", and "viewer"
118+
/// </summary>
119+
[JsonPropertyName("collaborator_level")]
120+
public string? CollaboratorLevel { get => _collaboratorLevel; init { _collaboratorLevel = value; _isCollaboratorLevelSet = true; } }
121+
122+
/// <summary>
123+
/// The email address of the sender of the sign request.
124+
/// </summary>
125+
[JsonPropertyName("sender_email")]
126+
public string? SenderEmail { get => _senderEmail; init { _senderEmail = value; _isSenderEmailSet = true; } }
127+
128+
/// <summary>
129+
/// The user ID of the sender of the sign request.
130+
/// </summary>
131+
[JsonPropertyName("sender_id")]
132+
public long? SenderId { get => _senderId; init { _senderId = value; _isSenderIdSet = true; } }
133+
98134
public SignRequest() {
99135

100136
}

0 commit comments

Comments
 (0)