2
2
using Newtonsoft . Json ;
3
3
using Newtonsoft . Json . Converters ;
4
4
using SignNow . Net . Internal . Extensions ;
5
+ using SignNow . Net . Internal . Helpers . Converters ;
5
6
using SignNow . Net . Model . Requests ;
6
7
7
8
namespace SignNow . Net . Model
@@ -14,6 +15,20 @@ public class EmbeddedInvite
14
15
private string email { get ; set ; }
15
16
private uint signingOrder { get ; set ; }
16
17
18
+ private string prefillSignatureName { get ; set ; }
19
+ private bool forceNewSignature { get ; set ; }
20
+
21
+ private string requiredPresetSignatureName { get ; set ; }
22
+
23
+ /// <summary>
24
+ /// Prefilled text in the Signature field, disabled for editing by signer.
25
+ /// Cannot be used together with prefill_signature_name and/or force_new_signature.
26
+ /// </summary>
27
+ private bool isPrefilledSignatureName { get ; set ; }
28
+
29
+ private bool isRequiredPresetEnabled { get ; set ; }
30
+
31
+
17
32
/// <summary>
18
33
/// Signer's email address.
19
34
/// </summary>
@@ -25,13 +40,13 @@ public string Email
25
40
}
26
41
27
42
/// <summary>
28
- /// Signer's role ID .
43
+ /// Signer's role id in the document .
29
44
/// </summary>
30
45
[ JsonProperty ( "role_id" ) ]
31
46
public string RoleId { get ; set ; }
32
47
33
48
/// <summary>
34
- /// Order of signing. Cannot be 0.
49
+ /// The order of signing. Cannot be 0.
35
50
/// </summary>
36
51
[ JsonProperty ( "order" ) ]
37
52
public uint SigningOrder
@@ -48,11 +63,128 @@ public uint SigningOrder
48
63
}
49
64
}
50
65
66
+ /// <summary>
67
+ /// Sets the language of the signing session for the signer.
68
+ /// </summary>
69
+ [ JsonProperty ( "language" ) ]
70
+ [ JsonConverter ( typeof ( StringEnumConverter ) ) ]
71
+ public Lang Language { get ; set ; }
72
+
51
73
/// <summary>
52
74
/// Signer authentication method.
53
75
/// </summary>
54
76
[ JsonProperty ( "auth_method" ) ]
55
77
[ JsonConverter ( typeof ( StringEnumConverter ) ) ]
56
78
public EmbeddedAuthType AuthMethod { get ; set ; } = EmbeddedAuthType . None ;
79
+
80
+ /// <summary>
81
+ /// Signer's first name.
82
+ /// </summary>
83
+ [ JsonProperty ( "first_name" , NullValueHandling = NullValueHandling . Ignore ) ]
84
+ public string Firstname { get ; set ; }
85
+
86
+ /// <summary>
87
+ /// Signer's last name.
88
+ /// </summary>
89
+ [ JsonProperty ( "last_name" , NullValueHandling = NullValueHandling . Ignore ) ]
90
+ public string Lastname { get ; set ; }
91
+
92
+ /// <summary>
93
+ /// Prefilled text in the Signature field.
94
+ /// </summary>
95
+ /// <exception cref="ArgumentException">String lenght cannot be greater than 255 characters</exception>
96
+ /// <exception cref="ArgumentException">Cannot be used together with Required preset for Signature name</exception>
97
+ [ JsonProperty ( "prefill_signature_name" , NullValueHandling = NullValueHandling . Ignore ) ]
98
+ public string PrefillSignatureName
99
+ {
100
+ get { return prefillSignatureName ; }
101
+ set
102
+ {
103
+ if ( value . Length > 255 )
104
+ {
105
+ throw new ArgumentException (
106
+ "Prefilled text in the Signature field can be maximum 255 characters." ,
107
+ nameof ( PrefillSignatureName ) ) ;
108
+ }
109
+
110
+ if ( isRequiredPresetEnabled )
111
+ {
112
+ throw new ArgumentException (
113
+ "Required preset for Signature name is set. Cannot be used together with" ,
114
+ nameof ( PrefillSignatureName ) ) ;
115
+ }
116
+
117
+ prefillSignatureName = value ;
118
+ isPrefilledSignatureName = true ;
119
+ }
120
+ }
121
+
122
+ /// <exception cref="ArgumentException">Cannot be used together with Required preset for Signature name</exception>
123
+ [ JsonProperty ( "force_new_signature" , NullValueHandling = NullValueHandling . Ignore ) ]
124
+ [ JsonConverter ( typeof ( BoolToIntJsonConverter ) ) ]
125
+ public bool ForceNewSignature
126
+ {
127
+ get { return forceNewSignature ; }
128
+ set
129
+ {
130
+ if ( isRequiredPresetEnabled )
131
+ {
132
+ throw new ArgumentException (
133
+ "Required preset for Signature name is set. Cannot be used together with" ,
134
+ nameof ( ForceNewSignature ) ) ;
135
+ }
136
+
137
+ forceNewSignature = value ;
138
+
139
+ if ( value )
140
+ {
141
+ isPrefilledSignatureName = true ;
142
+ }
143
+ }
144
+ }
145
+
146
+ /// <summary>
147
+ /// Prefilled text in the Signature field, disabled for editing by signer.
148
+ /// </summary>
149
+ /// <exception cref="ArgumentException">Cannot be used together with prefill for Signature name</exception>
150
+ [ JsonProperty ( "required_preset_signature_name" , NullValueHandling = NullValueHandling . Ignore ) ]
151
+ public string RequiredPresetSignatureName
152
+ {
153
+ get { return requiredPresetSignatureName ; }
154
+ set
155
+ {
156
+ if ( isPrefilledSignatureName )
157
+ {
158
+ throw new ArgumentException (
159
+ "Prefill for Signature name or Force new signature is set. Cannot be used together with" ,
160
+ nameof ( RequiredPresetSignatureName ) ) ;
161
+ }
162
+
163
+ requiredPresetSignatureName = value ;
164
+ isRequiredPresetEnabled = true ;
165
+ }
166
+ }
167
+
168
+ /// <summary>
169
+ /// The link that opens after the signing session has been completed.
170
+ /// </summary>
171
+ [ JsonProperty ( "redirect_uri" , NullValueHandling = NullValueHandling . Ignore ) ]
172
+ [ JsonConverter ( typeof ( StringToUriJsonConverter ) ) ]
173
+ public Uri RedirectUrl { get ; set ; }
174
+
175
+ /// <summary>
176
+ /// The link that opens after the signing session has been declined by the signer.
177
+ /// </summary>
178
+ [ JsonProperty ( "decline_redirect_uri" , NullValueHandling = NullValueHandling . Ignore ) ]
179
+ [ JsonConverter ( typeof ( StringToUriJsonConverter ) ) ]
180
+ public Uri DeclineRedirectUrl { get ; set ; }
181
+
182
+ /// <summary>
183
+ /// Determines whether to open the redirect link in the new tab in the browser, or in the same tab after the signing session.
184
+ /// Possible values: blank - opens the link in the new tab, self - opens the link in the same tab, default value.
185
+ /// </summary>
186
+ [ JsonProperty ( "redirect_target" , NullValueHandling = NullValueHandling . Ignore ) ]
187
+ [ JsonConverter ( typeof ( StringEnumConverter ) ) ]
188
+ public RedirectTarget RedirectTarget { get ; set ; }
57
189
}
58
190
}
0 commit comments