dropbox-sign 1.1.1 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (65) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +3 -2
  3. data/README.md +9 -4
  4. data/VERSION +1 -1
  5. data/docs/OAuthApi.md +0 -16
  6. data/docs/SignatureRequestApi.md +1 -1
  7. data/docs/SignatureRequestCreateEmbeddedRequest.md +1 -1
  8. data/docs/SignatureRequestSendRequest.md +2 -1
  9. data/docs/SignatureRequestSendWithTemplateRequest.md +1 -0
  10. data/docs/SignatureRequestUpdateRequest.md +1 -1
  11. data/docs/SubFormFieldsPerDocumentBase.md +2 -2
  12. data/docs/SubFormFieldsPerDocumentDateSigned.md +2 -0
  13. data/docs/SubFormFieldsPerDocumentDropdown.md +2 -0
  14. data/docs/SubFormFieldsPerDocumentFontEnum.md +9 -0
  15. data/docs/SubFormFieldsPerDocumentHyperlink.md +2 -0
  16. data/docs/SubFormFieldsPerDocumentText.md +3 -0
  17. data/docs/SubFormFieldsPerDocumentTextMerge.md +2 -0
  18. data/docs/SubWhiteLabelingOptions.md +1 -1
  19. data/docs/TemplateApi.md +102 -0
  20. data/docs/TemplateCreateEmbeddedDraftRequest.md +1 -1
  21. data/docs/TemplateCreateRequest.md +27 -0
  22. data/docs/TemplateCreateResponse.md +11 -0
  23. data/docs/TemplateCreateResponseTemplate.md +10 -0
  24. data/docs/UnclaimedDraftCreateEmbeddedRequest.md +1 -1
  25. data/docs/UnclaimedDraftCreateRequest.md +1 -1
  26. data/examples/OauthTokenGenerate.rb +0 -8
  27. data/examples/OauthTokenRefresh.rb +0 -8
  28. data/examples/TemplateCreate.rb +49 -0
  29. data/lib/dropbox-sign/api/signature_request_api.rb +2 -2
  30. data/lib/dropbox-sign/api/template_api.rb +109 -0
  31. data/lib/dropbox-sign/configuration.rb +1 -1
  32. data/lib/dropbox-sign/models/signature_request_create_embedded_request.rb +1 -1
  33. data/lib/dropbox-sign/models/signature_request_send_request.rb +15 -2
  34. data/lib/dropbox-sign/models/signature_request_send_with_template_request.rb +14 -1
  35. data/lib/dropbox-sign/models/signature_request_update_request.rb +1 -1
  36. data/lib/dropbox-sign/models/sub_form_fields_per_document_base.rb +2 -2
  37. data/lib/dropbox-sign/models/sub_form_fields_per_document_date_signed.rb +60 -4
  38. data/lib/dropbox-sign/models/sub_form_fields_per_document_dropdown.rb +60 -4
  39. data/lib/dropbox-sign/models/sub_form_fields_per_document_font_enum.rb +54 -0
  40. data/lib/dropbox-sign/models/sub_form_fields_per_document_hyperlink.rb +60 -4
  41. data/lib/dropbox-sign/models/sub_form_fields_per_document_text.rb +49 -4
  42. data/lib/dropbox-sign/models/sub_form_fields_per_document_text_merge.rb +60 -4
  43. data/lib/dropbox-sign/models/sub_white_labeling_options.rb +1 -1
  44. data/lib/dropbox-sign/models/template_create_embedded_draft_request.rb +1 -1
  45. data/lib/dropbox-sign/models/template_create_request.rb +509 -0
  46. data/lib/dropbox-sign/models/template_create_response.rb +263 -0
  47. data/lib/dropbox-sign/models/template_create_response_template.rb +252 -0
  48. data/lib/dropbox-sign/models/unclaimed_draft_create_embedded_request.rb +1 -1
  49. data/lib/dropbox-sign/models/unclaimed_draft_create_request.rb +1 -1
  50. data/lib/dropbox-sign/version.rb +1 -1
  51. data/lib/dropbox-sign.rb +4 -0
  52. data/openapi-config.yaml +1 -1
  53. data/openapi-sdk.yaml +1673 -1261
  54. data/spec/configuration_spec.rb +5 -7
  55. data/templates/configuration.mustache +1 -1
  56. data/templates/configuration_spec.mustache +5 -7
  57. data/test_fixtures/SignatureRequestCreateEmbeddedRequest.json +6 -2
  58. data/test_fixtures/SignatureRequestSendRequest.json +8 -2
  59. data/test_fixtures/SignatureRequestSendWithTemplateRequest.json +1 -0
  60. data/test_fixtures/TemplateCreateEmbeddedDraftRequest.json +3 -1
  61. data/test_fixtures/TemplateCreateRequest.json +120 -0
  62. data/test_fixtures/TemplateCreateResponse.json +7 -0
  63. data/test_fixtures/UnclaimedDraftCreateEmbeddedRequest.json +3 -1
  64. data/test_fixtures/UnclaimedDraftCreateRequest.json +3 -1
  65. metadata +23 -12
@@ -31,12 +31,44 @@ module Dropbox::Sign
31
31
  # @return [String]
32
32
  attr_accessor :content_url
33
33
 
34
+ # Font family for the field.
35
+ # @return [String]
36
+ attr_accessor :font_family
37
+
38
+ # The initial px font size for the field contents. Can be any integer value between `7` and `49`. **NOTE**: Font size may be reduced during processing in order to fit the contents within the dimensions of the field.
39
+ # @return [Integer]
40
+ attr_accessor :font_size
41
+
42
+ class EnumAttributeValidator
43
+ attr_reader :datatype
44
+ attr_reader :allowable_values
45
+
46
+ def initialize(datatype, allowable_values)
47
+ @allowable_values = allowable_values.map do |value|
48
+ case datatype.to_s
49
+ when /Integer/i
50
+ value.to_i
51
+ when /Float/i
52
+ value.to_f
53
+ else
54
+ value
55
+ end
56
+ end
57
+ end
58
+
59
+ def valid?(value)
60
+ !value || allowable_values.include?(value)
61
+ end
62
+ end
63
+
34
64
  # Attribute mapping from ruby-style variable name to JSON key.
35
65
  def self.attribute_map
36
66
  {
37
67
  :'type' => :'type',
38
68
  :'content' => :'content',
39
- :'content_url' => :'content_url'
69
+ :'content_url' => :'content_url',
70
+ :'font_family' => :'font_family',
71
+ :'font_size' => :'font_size'
40
72
  }
41
73
  end
42
74
 
@@ -55,7 +87,9 @@ module Dropbox::Sign
55
87
  {
56
88
  :'type' => :'String',
57
89
  :'content' => :'String',
58
- :'content_url' => :'String'
90
+ :'content_url' => :'String',
91
+ :'font_family' => :'String',
92
+ :'font_size' => :'Integer'
59
93
  }
60
94
  end
61
95
 
@@ -116,6 +150,14 @@ module Dropbox::Sign
116
150
  if attributes.key?(:'content_url')
117
151
  self.content_url = attributes[:'content_url']
118
152
  end
153
+
154
+ if attributes.key?(:'font_family')
155
+ self.font_family = attributes[:'font_family']
156
+ end
157
+
158
+ if attributes.key?(:'font_size')
159
+ self.font_size = attributes[:'font_size']
160
+ end
119
161
  end
120
162
 
121
163
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -143,9 +185,21 @@ module Dropbox::Sign
143
185
  return false if @type.nil?
144
186
  return false if @content.nil?
145
187
  return false if @content_url.nil?
188
+ font_family_validator = EnumAttributeValidator.new('String', ["helvetica", "arial", "courier", "calibri", "cambria", "georgia", "times", "trebuchet", "verdana", "roboto", "robotoMono", "notoSans", "notoSerif", "notoCJK-JP-Regular", "notoHebrew-Regular", "notoSanThaiMerged"])
189
+ return false unless font_family_validator.valid?(@font_family)
146
190
  true && super
147
191
  end
148
192
 
193
+ # Custom attribute writer method checking allowed values (enum).
194
+ # @param [Object] font_family Object to be assigned
195
+ def font_family=(font_family)
196
+ validator = EnumAttributeValidator.new('String', ["helvetica", "arial", "courier", "calibri", "cambria", "georgia", "times", "trebuchet", "verdana", "roboto", "robotoMono", "notoSans", "notoSerif", "notoCJK-JP-Regular", "notoHebrew-Regular", "notoSanThaiMerged"])
197
+ unless validator.valid?(font_family)
198
+ fail ArgumentError, "invalid value for \"font_family\", must be one of #{validator.allowable_values}."
199
+ end
200
+ @font_family = font_family
201
+ end
202
+
149
203
  # Checks equality by comparing each attribute.
150
204
  # @param [Object] Object to be compared
151
205
  def ==(o)
@@ -153,7 +207,9 @@ module Dropbox::Sign
153
207
  self.class == o.class &&
154
208
  type == o.type &&
155
209
  content == o.content &&
156
- content_url == o.content_url && super(o)
210
+ content_url == o.content_url &&
211
+ font_family == o.font_family &&
212
+ font_size == o.font_size && super(o)
157
213
  end
158
214
 
159
215
  # @see the `==` method
@@ -165,7 +221,7 @@ module Dropbox::Sign
165
221
  # Calculates hash code according to all attributes.
166
222
  # @return [Integer] Hash code
167
223
  def hash
168
- [type, content, content_url].hash
224
+ [type, content, content_url, font_family, font_size].hash
169
225
  end
170
226
 
171
227
  # Builds the object from hash
@@ -49,6 +49,18 @@ module Dropbox::Sign
49
49
  # @return [String]
50
50
  attr_accessor :validation_custom_regex_format_label
51
51
 
52
+ # Content of a `me_now` text field
53
+ # @return [String]
54
+ attr_accessor :content
55
+
56
+ # Font family for the field.
57
+ # @return [String]
58
+ attr_accessor :font_family
59
+
60
+ # The initial px font size for the field contents. Can be any integer value between `7` and `49`. **NOTE**: Font size may be reduced during processing in order to fit the contents within the dimensions of the field.
61
+ # @return [Integer]
62
+ attr_accessor :font_size
63
+
52
64
  class EnumAttributeValidator
53
65
  attr_reader :datatype
54
66
  attr_reader :allowable_values
@@ -81,7 +93,10 @@ module Dropbox::Sign
81
93
  :'masked' => :'masked',
82
94
  :'validation_type' => :'validation_type',
83
95
  :'validation_custom_regex' => :'validation_custom_regex',
84
- :'validation_custom_regex_format_label' => :'validation_custom_regex_format_label'
96
+ :'validation_custom_regex_format_label' => :'validation_custom_regex_format_label',
97
+ :'content' => :'content',
98
+ :'font_family' => :'font_family',
99
+ :'font_size' => :'font_size'
85
100
  }
86
101
  end
87
102
 
@@ -105,7 +120,10 @@ module Dropbox::Sign
105
120
  :'masked' => :'Boolean',
106
121
  :'validation_type' => :'String',
107
122
  :'validation_custom_regex' => :'String',
108
- :'validation_custom_regex_format_label' => :'String'
123
+ :'validation_custom_regex_format_label' => :'String',
124
+ :'content' => :'String',
125
+ :'font_family' => :'String',
126
+ :'font_size' => :'Integer'
109
127
  }
110
128
  end
111
129
 
@@ -186,6 +204,18 @@ module Dropbox::Sign
186
204
  if attributes.key?(:'validation_custom_regex_format_label')
187
205
  self.validation_custom_regex_format_label = attributes[:'validation_custom_regex_format_label']
188
206
  end
207
+
208
+ if attributes.key?(:'content')
209
+ self.content = attributes[:'content']
210
+ end
211
+
212
+ if attributes.key?(:'font_family')
213
+ self.font_family = attributes[:'font_family']
214
+ end
215
+
216
+ if attributes.key?(:'font_size')
217
+ self.font_size = attributes[:'font_size']
218
+ end
189
219
  end
190
220
 
191
221
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -205,6 +235,8 @@ module Dropbox::Sign
205
235
  return false if @type.nil?
206
236
  validation_type_validator = EnumAttributeValidator.new('String', ["numbers_only", "letters_only", "phone_number", "bank_routing_number", "bank_account_number", "email_address", "zip_code", "social_security_number", "employer_identification_number", "custom_regex"])
207
237
  return false unless validation_type_validator.valid?(@validation_type)
238
+ font_family_validator = EnumAttributeValidator.new('String', ["helvetica", "arial", "courier", "calibri", "cambria", "georgia", "times", "trebuchet", "verdana", "roboto", "robotoMono", "notoSans", "notoSerif", "notoCJK-JP-Regular", "notoHebrew-Regular", "notoSanThaiMerged"])
239
+ return false unless font_family_validator.valid?(@font_family)
208
240
  true && super
209
241
  end
210
242
 
@@ -218,6 +250,16 @@ module Dropbox::Sign
218
250
  @validation_type = validation_type
219
251
  end
220
252
 
253
+ # Custom attribute writer method checking allowed values (enum).
254
+ # @param [Object] font_family Object to be assigned
255
+ def font_family=(font_family)
256
+ validator = EnumAttributeValidator.new('String', ["helvetica", "arial", "courier", "calibri", "cambria", "georgia", "times", "trebuchet", "verdana", "roboto", "robotoMono", "notoSans", "notoSerif", "notoCJK-JP-Regular", "notoHebrew-Regular", "notoSanThaiMerged"])
257
+ unless validator.valid?(font_family)
258
+ fail ArgumentError, "invalid value for \"font_family\", must be one of #{validator.allowable_values}."
259
+ end
260
+ @font_family = font_family
261
+ end
262
+
221
263
  # Checks equality by comparing each attribute.
222
264
  # @param [Object] Object to be compared
223
265
  def ==(o)
@@ -230,7 +272,10 @@ module Dropbox::Sign
230
272
  masked == o.masked &&
231
273
  validation_type == o.validation_type &&
232
274
  validation_custom_regex == o.validation_custom_regex &&
233
- validation_custom_regex_format_label == o.validation_custom_regex_format_label && super(o)
275
+ validation_custom_regex_format_label == o.validation_custom_regex_format_label &&
276
+ content == o.content &&
277
+ font_family == o.font_family &&
278
+ font_size == o.font_size && super(o)
234
279
  end
235
280
 
236
281
  # @see the `==` method
@@ -242,7 +287,7 @@ module Dropbox::Sign
242
287
  # Calculates hash code according to all attributes.
243
288
  # @return [Integer] Hash code
244
289
  def hash
245
- [type, placeholder, auto_fill_type, link_id, masked, validation_type, validation_custom_regex, validation_custom_regex_format_label].hash
290
+ [type, placeholder, auto_fill_type, link_id, masked, validation_type, validation_custom_regex, validation_custom_regex_format_label, content, font_family, font_size].hash
246
291
  end
247
292
 
248
293
  # Builds the object from hash
@@ -23,10 +23,42 @@ module Dropbox::Sign
23
23
  # @return [String]
24
24
  attr_accessor :type
25
25
 
26
+ # Font family for the field.
27
+ # @return [String]
28
+ attr_accessor :font_family
29
+
30
+ # The initial px font size for the field contents. Can be any integer value between `7` and `49`. **NOTE**: Font size may be reduced during processing in order to fit the contents within the dimensions of the field.
31
+ # @return [Integer]
32
+ attr_accessor :font_size
33
+
34
+ class EnumAttributeValidator
35
+ attr_reader :datatype
36
+ attr_reader :allowable_values
37
+
38
+ def initialize(datatype, allowable_values)
39
+ @allowable_values = allowable_values.map do |value|
40
+ case datatype.to_s
41
+ when /Integer/i
42
+ value.to_i
43
+ when /Float/i
44
+ value.to_f
45
+ else
46
+ value
47
+ end
48
+ end
49
+ end
50
+
51
+ def valid?(value)
52
+ !value || allowable_values.include?(value)
53
+ end
54
+ end
55
+
26
56
  # Attribute mapping from ruby-style variable name to JSON key.
27
57
  def self.attribute_map
28
58
  {
29
- :'type' => :'type'
59
+ :'type' => :'type',
60
+ :'font_family' => :'font_family',
61
+ :'font_size' => :'font_size'
30
62
  }
31
63
  end
32
64
 
@@ -43,7 +75,9 @@ module Dropbox::Sign
43
75
  # Attribute type mapping.
44
76
  def self.openapi_types
45
77
  {
46
- :'type' => :'String'
78
+ :'type' => :'String',
79
+ :'font_family' => :'String',
80
+ :'font_size' => :'Integer'
47
81
  }
48
82
  end
49
83
 
@@ -96,6 +130,14 @@ module Dropbox::Sign
96
130
  else
97
131
  self.type = 'text-merge'
98
132
  end
133
+
134
+ if attributes.key?(:'font_family')
135
+ self.font_family = attributes[:'font_family']
136
+ end
137
+
138
+ if attributes.key?(:'font_size')
139
+ self.font_size = attributes[:'font_size']
140
+ end
99
141
  end
100
142
 
101
143
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -113,15 +155,29 @@ module Dropbox::Sign
113
155
  # @return true if the model is valid
114
156
  def valid?
115
157
  return false if @type.nil?
158
+ font_family_validator = EnumAttributeValidator.new('String', ["helvetica", "arial", "courier", "calibri", "cambria", "georgia", "times", "trebuchet", "verdana", "roboto", "robotoMono", "notoSans", "notoSerif", "notoCJK-JP-Regular", "notoHebrew-Regular", "notoSanThaiMerged"])
159
+ return false unless font_family_validator.valid?(@font_family)
116
160
  true && super
117
161
  end
118
162
 
163
+ # Custom attribute writer method checking allowed values (enum).
164
+ # @param [Object] font_family Object to be assigned
165
+ def font_family=(font_family)
166
+ validator = EnumAttributeValidator.new('String', ["helvetica", "arial", "courier", "calibri", "cambria", "georgia", "times", "trebuchet", "verdana", "roboto", "robotoMono", "notoSans", "notoSerif", "notoCJK-JP-Regular", "notoHebrew-Regular", "notoSanThaiMerged"])
167
+ unless validator.valid?(font_family)
168
+ fail ArgumentError, "invalid value for \"font_family\", must be one of #{validator.allowable_values}."
169
+ end
170
+ @font_family = font_family
171
+ end
172
+
119
173
  # Checks equality by comparing each attribute.
120
174
  # @param [Object] Object to be compared
121
175
  def ==(o)
122
176
  return true if self.equal?(o)
123
177
  self.class == o.class &&
124
- type == o.type && super(o)
178
+ type == o.type &&
179
+ font_family == o.font_family &&
180
+ font_size == o.font_size && super(o)
125
181
  end
126
182
 
127
183
  # @see the `==` method
@@ -133,7 +189,7 @@ module Dropbox::Sign
133
189
  # Calculates hash code according to all attributes.
134
190
  # @return [Integer] Hash code
135
191
  def hash
136
- [type].hash
192
+ [type, font_family, font_size].hash
137
193
  end
138
194
 
139
195
  # Builds the object from hash
@@ -17,7 +17,7 @@ module Dropbox
17
17
  end
18
18
 
19
19
  module Dropbox::Sign
20
- # An array of elements and values serialized to a string, to be used to customize the app's signer page. (Only applies to some API plans) Take a look at our [white labeling guide](/api/reference/white-labeling/) to learn more.
20
+ # An array of elements and values serialized to a string, to be used to customize the app's signer page. (Only applies to some API plans) Take a look at our [white labeling guide](https://developers.hellosign.com/api/reference/premium-branding/) to learn more.
21
21
  class SubWhiteLabelingOptions
22
22
  # @return [String]
23
23
  attr_accessor :header_background_color
@@ -68,7 +68,7 @@ module Dropbox::Sign
68
68
  # @return [Array<SubFormFieldRule>]
69
69
  attr_accessor :form_field_rules
70
70
 
71
- # The fields that should appear on the document, expressed as an array of objects. (We're currently fixing a bug where this property only accepts a two-dimensional array. You can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE**: Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge`
71
+ # The fields that should appear on the document, expressed as an array of objects. (For more details you can read about it here: [Using Form Fields per Document](/docs/openapi/form-fields-per-document).) **NOTE**: Fields like **text**, **dropdown**, **checkbox**, **radio**, and **hyperlink** have additional required and optional parameters. Check out the list of [additional parameters](/api/reference/constants/#form-fields-per-document) for these field types. * Text Field use `SubFormFieldsPerDocumentText` * Dropdown Field use `SubFormFieldsPerDocumentDropdown` * Hyperlink Field use `SubFormFieldsPerDocumentHyperlink` * Checkbox Field use `SubFormFieldsPerDocumentCheckbox` * Radio Field use `SubFormFieldsPerDocumentRadio` * Signature Field use `SubFormFieldsPerDocumentSignature` * Date Signed Field use `SubFormFieldsPerDocumentDateSigned` * Initials Field use `SubFormFieldsPerDocumentInitials` * Text Merge Field use `SubFormFieldsPerDocumentTextMerge` * Checkbox Merge Field use `SubFormFieldsPerDocumentCheckboxMerge`
72
72
  # @return [Array<SubFormFieldsPerDocumentBase>]
73
73
  attr_accessor :form_fields_per_document
74
74