-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathField.cs
More file actions
137 lines (118 loc) · 3.65 KB
/
Field.cs
File metadata and controls
137 lines (118 loc) · 3.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
using System.Collections.Generic;
using System.Runtime.Serialization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using SignNow.Net.Interfaces;
using SignNow.Net.Model.FieldContents;
namespace SignNow.Net.Model
{
/// <summary>
/// signNow fields metadata.
/// </summary>
public class Field: ISignNowField
{
/// <summary>
/// Unique identifier of field.
/// </summary>
[JsonProperty("id")]
internal string Id { get; set; }
/// <summary>
/// Field type.
/// </summary>
[JsonProperty("type")]
[JsonConverter(typeof(StringEnumConverter))]
public FieldType Type { get; set; }
/// <summary>
/// <see cref="SignNow.Net.Model.Role"/> identity.
/// </summary>
/// TODO: Use Role model instead of RoleId + RoleName
[JsonProperty("role_id")]
internal string RoleId { get; set; }
/// <summary>
/// Signer role name.
/// </summary>
[JsonProperty("role")]
internal string RoleName { get; set; }
/// <summary>
/// Field attributes: name, label, x/y coordinates, width, height...
/// </summary>
[JsonProperty("json_attributes")]
public FieldJsonAttributes JsonAttributes { get; set; }
/// <summary>
/// Document owner email.
/// </summary>
[JsonProperty("originator")]
internal string Owner { get; set; }
/// <summary>
/// Signer email.
/// </summary>
[JsonProperty("fulfiller")]
internal string Signer { get; set; }
/// <summary>
/// Field request ID
/// </summary>
[JsonProperty("field_request_id")]
public string FieldRequestId { get; internal set; }
/// <summary>
/// Identity of specific element for corresponding field type.
/// </summary>
[JsonProperty("element_id")]
public string ElementId { get; set; }
/// <summary>
/// Radio group elements initial state for Radiobuttons field type.
/// </summary>
[JsonProperty("radio", NullValueHandling = NullValueHandling.Ignore)]
internal IReadOnlyCollection<RadioContent> RadioGroup { get; set; }
}
/// <summary>
/// Represents all types of signNow fields.
/// </summary>
public enum FieldType
{
/// <summary>
/// Text box, Dropdown box, Data-Time picker.
/// </summary>
[EnumMember(Value = "text")]
Text,
/// <summary>
/// Signature fields.
/// </summary>
[EnumMember(Value = "signature")]
Signature,
/// <summary>
/// Stamp fields.
/// </summary>
[EnumMember(Value = "stamp")]
Stamp,
/// <summary>
/// Initials fields.
/// </summary>
[EnumMember(Value = "initials")]
Initials,
/// <summary>
/// Check box.
/// </summary>
[EnumMember(Value = "checkbox")]
Checkbox,
/// <summary>
/// Enumeration list.
/// </summary>
[EnumMember(Value = "enumeration")]
Enumeration,
/// <summary>
/// Radio button group with Radio elements included.
/// </summary>
[EnumMember(Value = "radiobutton")]
RadioButton,
/// <summary>
/// Document's attachment which can be downloaded by URL.
/// </summary>
[EnumMember(Value = "attachment")]
Attachment,
/// <summary>
/// Hyperlink field with Url and label.
/// </summary>
[EnumMember(Value = "hyperlink")]
Hyperlink
}
}