dropbox-sign 1.1.2 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +3 -3
  3. data/README.md +9 -4
  4. data/VERSION +1 -1
  5. data/docs/OAuthApi.md +0 -16
  6. data/docs/SignatureRequestApi.md +5 -4
  7. data/docs/SignatureRequestSendRequest.md +1 -0
  8. data/docs/SignatureRequestSendWithTemplateRequest.md +1 -0
  9. data/docs/SignatureRequestUpdateRequest.md +1 -1
  10. data/docs/SubFormFieldsPerDocumentBase.md +1 -1
  11. data/docs/SubFormFieldsPerDocumentDateSigned.md +2 -0
  12. data/docs/SubFormFieldsPerDocumentDropdown.md +2 -0
  13. data/docs/SubFormFieldsPerDocumentFontEnum.md +9 -0
  14. data/docs/SubFormFieldsPerDocumentHyperlink.md +2 -0
  15. data/docs/SubFormFieldsPerDocumentText.md +3 -0
  16. data/docs/SubFormFieldsPerDocumentTextMerge.md +2 -0
  17. data/docs/SubWhiteLabelingOptions.md +1 -1
  18. data/docs/TemplateApi.md +106 -3
  19. data/docs/TemplateCreateRequest.md +27 -0
  20. data/docs/TemplateCreateResponse.md +11 -0
  21. data/docs/TemplateCreateResponseTemplate.md +10 -0
  22. data/docs/UnclaimedDraftCreateEmbeddedWithTemplateRequest.md +1 -0
  23. data/examples/OauthTokenGenerate.rb +0 -8
  24. data/examples/OauthTokenRefresh.rb +0 -8
  25. data/examples/TemplateCreate.rb +49 -0
  26. data/lib/dropbox-sign/api/signature_request_api.rb +5 -2
  27. data/lib/dropbox-sign/api/template_api.rb +112 -0
  28. data/lib/dropbox-sign/models/signature_request_send_request.rb +14 -1
  29. data/lib/dropbox-sign/models/signature_request_send_with_template_request.rb +14 -1
  30. data/lib/dropbox-sign/models/signature_request_update_request.rb +1 -1
  31. data/lib/dropbox-sign/models/sub_form_fields_per_document_base.rb +1 -1
  32. data/lib/dropbox-sign/models/sub_form_fields_per_document_date_signed.rb +60 -4
  33. data/lib/dropbox-sign/models/sub_form_fields_per_document_dropdown.rb +60 -4
  34. data/lib/dropbox-sign/models/sub_form_fields_per_document_font_enum.rb +54 -0
  35. data/lib/dropbox-sign/models/sub_form_fields_per_document_hyperlink.rb +60 -4
  36. data/lib/dropbox-sign/models/sub_form_fields_per_document_text.rb +49 -4
  37. data/lib/dropbox-sign/models/sub_form_fields_per_document_text_merge.rb +60 -4
  38. data/lib/dropbox-sign/models/sub_white_labeling_options.rb +1 -1
  39. data/lib/dropbox-sign/models/template_create_request.rb +509 -0
  40. data/lib/dropbox-sign/models/template_create_response.rb +263 -0
  41. data/lib/dropbox-sign/models/template_create_response_template.rb +252 -0
  42. data/lib/dropbox-sign/models/unclaimed_draft_create_embedded_with_template_request.rb +17 -4
  43. data/lib/dropbox-sign/version.rb +1 -1
  44. data/lib/dropbox-sign.rb +4 -0
  45. data/openapi-config.yaml +1 -1
  46. data/openapi-sdk.yaml +912 -434
  47. data/test_fixtures/SignatureRequestCreateEmbeddedRequest.json +6 -2
  48. data/test_fixtures/SignatureRequestSendRequest.json +8 -2
  49. data/test_fixtures/SignatureRequestSendWithTemplateRequest.json +1 -0
  50. data/test_fixtures/TemplateCreateEmbeddedDraftRequest.json +3 -1
  51. data/test_fixtures/TemplateCreateRequest.json +120 -0
  52. data/test_fixtures/TemplateCreateResponse.json +7 -0
  53. data/test_fixtures/UnclaimedDraftCreateEmbeddedRequest.json +3 -1
  54. data/test_fixtures/UnclaimedDraftCreateEmbeddedWithTemplateRequest.json +2 -1
  55. data/test_fixtures/UnclaimedDraftCreateRequest.json +3 -1
  56. metadata +20 -9
@@ -137,6 +137,115 @@ module Dropbox::Sign
137
137
  return data, status_code, headers
138
138
  end
139
139
 
140
+ # Create Template
141
+ # Creates a template that can then be used.
142
+ # @param template_create_request [TemplateCreateRequest]
143
+ # @param [Hash] opts the optional parameters
144
+ # @return [TemplateCreateResponse]
145
+ def template_create(template_create_request, opts = {})
146
+ data, _status_code, _headers = template_create_with_http_info(template_create_request, opts)
147
+ data
148
+ end
149
+
150
+ # Create Template
151
+ # Creates a template that can then be used.
152
+ # @param template_create_request [TemplateCreateRequest]
153
+ # @param [Hash] opts the optional parameters
154
+ # @return [Array<(TemplateCreateResponse, Integer, Hash)>] TemplateCreateResponse data, response status code and response headers
155
+ def template_create_with_http_info(template_create_request, opts = {})
156
+ if @api_client.config.debugging
157
+ @api_client.config.logger.debug 'Calling API: TemplateApi.template_create ...'
158
+ end
159
+ # verify the required parameter 'template_create_request' is set
160
+ if @api_client.config.client_side_validation && template_create_request.nil?
161
+ fail ArgumentError, "Missing the required parameter 'template_create_request' when calling TemplateApi.template_create"
162
+ end
163
+ # resource path
164
+ local_var_path = '/template/create'
165
+
166
+ # query parameters
167
+ query_params = opts[:query_params] || {}
168
+
169
+ # header parameters
170
+ header_params = opts[:header_params] || {}
171
+ # HTTP header 'Accept' (if needed)
172
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
173
+ # HTTP header 'Content-Type'
174
+ content_type = @api_client.select_header_content_type(['application/json', 'multipart/form-data'])
175
+ if !content_type.nil?
176
+ header_params['Content-Type'] = content_type
177
+ end
178
+
179
+ post_body = {}
180
+ form_params = opts[:form_params] || {}
181
+ result = @api_client.generate_form_data(
182
+ template_create_request,
183
+ Dropbox::Sign::TemplateCreateRequest.openapi_types
184
+ )
185
+
186
+ # form parameters
187
+ if result[:has_file]
188
+ form_params = opts[:form_params] || result[:params]
189
+ header_params['Content-Type'] = 'multipart/form-data'
190
+ else
191
+ # http body (model)
192
+ post_body = opts[:debug_body] || result[:params]
193
+ end
194
+
195
+ # return_type
196
+ return_type = opts[:debug_return_type] || 'TemplateCreateResponse'
197
+
198
+ # auth_names
199
+ auth_names = opts[:debug_auth_names] || ['api_key', 'oauth2']
200
+
201
+ new_options = opts.merge(
202
+ :operation => :"TemplateApi.template_create",
203
+ :header_params => header_params,
204
+ :query_params => query_params,
205
+ :form_params => form_params,
206
+ :body => post_body,
207
+ :auth_names => auth_names,
208
+ :return_type => return_type
209
+ )
210
+
211
+ begin
212
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
213
+ rescue Dropbox::Sign::ApiError => e
214
+ if e.code === 200
215
+ body = @api_client.convert_to_type(
216
+ JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0],
217
+ "Dropbox::Sign::TemplateCreateResponse"
218
+ )
219
+
220
+ fail ApiError.new(:code => e.code,
221
+ :response_headers => e.response_headers,
222
+ :response_body => body),
223
+ e.message
224
+ end
225
+
226
+ range_code = "4XX".split('').first
227
+ range_code_left = "#{range_code}00".to_i
228
+ range_code_right = "#{range_code}99".to_i
229
+ if e.code >= range_code_left && e.code <= range_code_right
230
+ body = @api_client.convert_to_type(
231
+ JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0],
232
+ "Dropbox::Sign::ErrorResponse"
233
+ )
234
+
235
+ fail ApiError.new(:code => e.code,
236
+ :response_headers => e.response_headers,
237
+ :response_body => body),
238
+ e.message
239
+ end
240
+
241
+ end
242
+
243
+ if @api_client.config.debugging
244
+ @api_client.config.logger.debug "API called: TemplateApi#template_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
245
+ end
246
+ return data, status_code, headers
247
+ end
248
+
140
249
  # Create Embedded Template Draft
141
250
  # The first step in an embedded template workflow. Creates a draft template that can then be further set up in the template 'edit' stage.
142
251
  # @param template_create_embedded_draft_request [TemplateCreateEmbeddedDraftRequest]
@@ -512,6 +621,7 @@ module Dropbox::Sign
512
621
  # Obtain a copy of the current documents specified by the `template_id` parameter. Returns a JSON object with a url to the file (PDFs only). If the files are currently being prepared, a status code of `409` will be returned instead. In this case please wait for the `template_created` callback event.
513
622
  # @param template_id [String] The id of the template files to retrieve.
514
623
  # @param [Hash] opts the optional parameters
624
+ # @option opts [Integer] :force_download By default when opening the &#x60;file_url&#x60; a browser will download the PDF and save it locally. When set to &#x60;0&#x60; the PDF file will be displayed in the browser. (default to 1)
515
625
  # @return [FileResponse]
516
626
  def template_files_as_file_url(template_id, opts = {})
517
627
  data, _status_code, _headers = template_files_as_file_url_with_http_info(template_id, opts)
@@ -522,6 +632,7 @@ module Dropbox::Sign
522
632
  # Obtain a copy of the current documents specified by the &#x60;template_id&#x60; parameter. Returns a JSON object with a url to the file (PDFs only). If the files are currently being prepared, a status code of &#x60;409&#x60; will be returned instead. In this case please wait for the &#x60;template_created&#x60; callback event.
523
633
  # @param template_id [String] The id of the template files to retrieve.
524
634
  # @param [Hash] opts the optional parameters
635
+ # @option opts [Integer] :force_download By default when opening the &#x60;file_url&#x60; a browser will download the PDF and save it locally. When set to &#x60;0&#x60; the PDF file will be displayed in the browser.
525
636
  # @return [Array<(FileResponse, Integer, Hash)>] FileResponse data, response status code and response headers
526
637
  def template_files_as_file_url_with_http_info(template_id, opts = {})
527
638
  if @api_client.config.debugging
@@ -536,6 +647,7 @@ module Dropbox::Sign
536
647
 
537
648
  # query parameters
538
649
  query_params = opts[:query_params] || {}
650
+ query_params[:'force_download'] = opts[:'force_download'] if !opts[:'force_download'].nil?
539
651
 
540
652
  # header parameters
541
653
  header_params = opts[:header_params] || {}
@@ -81,6 +81,10 @@ module Dropbox::Sign
81
81
  # @return [Boolean]
82
82
  attr_accessor :is_qualified_signature
83
83
 
84
+ # Send with a value of `true` if you wish to enable [electronic identification (eID)](https://www.hellosign.com/features/electronic-id), which requires the signer to verify their identity with an eID provider to sign a document.<br> **Note**: eID is only available on the Premium API plan. Cannot be used in `test_mode`. Only works on requests with one signer.
85
+ # @return [Boolean]
86
+ attr_accessor :is_eid
87
+
84
88
  # The custom message in the email that will be sent to the signers.
85
89
  # @return [String]
86
90
  attr_accessor :message
@@ -135,6 +139,7 @@ module Dropbox::Sign
135
139
  :'form_fields_per_document' => :'form_fields_per_document',
136
140
  :'hide_text_tags' => :'hide_text_tags',
137
141
  :'is_qualified_signature' => :'is_qualified_signature',
142
+ :'is_eid' => :'is_eid',
138
143
  :'message' => :'message',
139
144
  :'metadata' => :'metadata',
140
145
  :'signing_options' => :'signing_options',
@@ -176,6 +181,7 @@ module Dropbox::Sign
176
181
  :'form_fields_per_document' => :'Array<SubFormFieldsPerDocumentBase>',
177
182
  :'hide_text_tags' => :'Boolean',
178
183
  :'is_qualified_signature' => :'Boolean',
184
+ :'is_eid' => :'Boolean',
179
185
  :'message' => :'String',
180
186
  :'metadata' => :'Hash<String, Object>',
181
187
  :'signing_options' => :'SubSigningOptions',
@@ -322,6 +328,12 @@ module Dropbox::Sign
322
328
  self.is_qualified_signature = false
323
329
  end
324
330
 
331
+ if attributes.key?(:'is_eid')
332
+ self.is_eid = attributes[:'is_eid']
333
+ else
334
+ self.is_eid = false
335
+ end
336
+
325
337
  if attributes.key?(:'message')
326
338
  self.message = attributes[:'message']
327
339
  end
@@ -450,6 +462,7 @@ module Dropbox::Sign
450
462
  form_fields_per_document == o.form_fields_per_document &&
451
463
  hide_text_tags == o.hide_text_tags &&
452
464
  is_qualified_signature == o.is_qualified_signature &&
465
+ is_eid == o.is_eid &&
453
466
  message == o.message &&
454
467
  metadata == o.metadata &&
455
468
  signing_options == o.signing_options &&
@@ -470,7 +483,7 @@ module Dropbox::Sign
470
483
  # Calculates hash code according to all attributes.
471
484
  # @return [Integer] Hash code
472
485
  def hash
473
- [files, file_urls, signers, grouped_signers, allow_decline, allow_reassign, attachments, cc_email_addresses, client_id, custom_fields, field_options, form_field_groups, form_field_rules, form_fields_per_document, hide_text_tags, is_qualified_signature, message, metadata, signing_options, signing_redirect_url, subject, test_mode, title, use_text_tags, expires_at].hash
486
+ [files, file_urls, signers, grouped_signers, allow_decline, allow_reassign, attachments, cc_email_addresses, client_id, custom_fields, field_options, form_field_groups, form_field_rules, form_fields_per_document, hide_text_tags, is_qualified_signature, is_eid, message, metadata, signing_options, signing_redirect_url, subject, test_mode, title, use_text_tags, expires_at].hash
474
487
  end
475
488
 
476
489
  # Builds the object from hash
@@ -54,6 +54,10 @@ module Dropbox::Sign
54
54
  # @return [Boolean]
55
55
  attr_accessor :is_qualified_signature
56
56
 
57
+ # Send with a value of `true` if you wish to enable [electronic identification (eID)](https://www.hellosign.com/features/electronic-id), which requires the signer to verify their identity with an eID provider to sign a document.<br> **Note**: eID is only available on the Premium API plan. Cannot be used in `test_mode`. Only works on requests with one signer.
58
+ # @return [Boolean]
59
+ attr_accessor :is_eid
60
+
57
61
  # The custom message in the email that will be sent to the signers.
58
62
  # @return [String]
59
63
  attr_accessor :message
@@ -93,6 +97,7 @@ module Dropbox::Sign
93
97
  :'files' => :'files',
94
98
  :'file_urls' => :'file_urls',
95
99
  :'is_qualified_signature' => :'is_qualified_signature',
100
+ :'is_eid' => :'is_eid',
96
101
  :'message' => :'message',
97
102
  :'metadata' => :'metadata',
98
103
  :'signing_options' => :'signing_options',
@@ -125,6 +130,7 @@ module Dropbox::Sign
125
130
  :'files' => :'Array<File>',
126
131
  :'file_urls' => :'Array<String>',
127
132
  :'is_qualified_signature' => :'Boolean',
133
+ :'is_eid' => :'Boolean',
128
134
  :'message' => :'String',
129
135
  :'metadata' => :'Hash<String, Object>',
130
136
  :'signing_options' => :'SubSigningOptions',
@@ -228,6 +234,12 @@ module Dropbox::Sign
228
234
  self.is_qualified_signature = false
229
235
  end
230
236
 
237
+ if attributes.key?(:'is_eid')
238
+ self.is_eid = attributes[:'is_eid']
239
+ else
240
+ self.is_eid = false
241
+ end
242
+
231
243
  if attributes.key?(:'message')
232
244
  self.message = attributes[:'message']
233
245
  end
@@ -349,6 +361,7 @@ module Dropbox::Sign
349
361
  files == o.files &&
350
362
  file_urls == o.file_urls &&
351
363
  is_qualified_signature == o.is_qualified_signature &&
364
+ is_eid == o.is_eid &&
352
365
  message == o.message &&
353
366
  metadata == o.metadata &&
354
367
  signing_options == o.signing_options &&
@@ -367,7 +380,7 @@ module Dropbox::Sign
367
380
  # Calculates hash code according to all attributes.
368
381
  # @return [Integer] Hash code
369
382
  def hash
370
- [template_ids, signers, allow_decline, ccs, client_id, custom_fields, files, file_urls, is_qualified_signature, message, metadata, signing_options, signing_redirect_url, subject, test_mode, title].hash
383
+ [template_ids, signers, allow_decline, ccs, client_id, custom_fields, files, file_urls, is_qualified_signature, is_eid, message, metadata, signing_options, signing_redirect_url, subject, test_mode, title].hash
371
384
  end
372
385
 
373
386
  # Builds the object from hash
@@ -22,7 +22,7 @@ module Dropbox::Sign
22
22
  # @return [String]
23
23
  attr_accessor :signature_id
24
24
 
25
- # The new email address for the recipient. **NOTE**: Optional if `name` is provided.
25
+ # The new email address for the recipient. This will generate a new `signature_id` value. **NOTE**: Optional if `name` is provided.
26
26
  # @return [String]
27
27
  attr_accessor :email_address
28
28
 
@@ -35,7 +35,7 @@ module Dropbox::Sign
35
35
  # @return [Boolean]
36
36
  attr_accessor :required
37
37
 
38
- # Signer index identified by the offset in the signers parameter (0-based indexing), indicating which signer should fill out the field. **NOTE**: If type is `text-merge` or `checkbox-merge`, you must set this to sender in order to use pre-filled data.
38
+ # Signer index identified by the offset in the signers parameter (0-based indexing), indicating which signer should fill out the field. **NOTE**: To set the value of the field as the preparer you must set this to `me_now` **NOTE**: If type is `text-merge` or `checkbox-merge`, you must set this to sender in order to use pre-filled data.
39
39
  # @return [Integer, String]
40
40
  attr_accessor :signer
41
41
 
@@ -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 = 'date_signed'
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
@@ -31,12 +31,44 @@ module Dropbox::Sign
31
31
  # @return [String]
32
32
  attr_accessor :content
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
  :'options' => :'options',
39
- :'content' => :'content'
69
+ :'content' => :'content',
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
  :'options' => :'Array<String>',
58
- :'content' => :'String'
90
+ :'content' => :'String',
91
+ :'font_family' => :'String',
92
+ :'font_size' => :'Integer'
59
93
  }
60
94
  end
61
95
 
@@ -118,6 +152,14 @@ module Dropbox::Sign
118
152
  if attributes.key?(:'content')
119
153
  self.content = attributes[:'content']
120
154
  end
155
+
156
+ if attributes.key?(:'font_family')
157
+ self.font_family = attributes[:'font_family']
158
+ end
159
+
160
+ if attributes.key?(:'font_size')
161
+ self.font_size = attributes[:'font_size']
162
+ end
121
163
  end
122
164
 
123
165
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -145,6 +187,8 @@ module Dropbox::Sign
145
187
  return false if @type.nil?
146
188
  return false if @options.nil?
147
189
  return false if @options.length < 1
190
+ 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"])
191
+ return false unless font_family_validator.valid?(@font_family)
148
192
  true && super
149
193
  end
150
194
 
@@ -162,6 +206,16 @@ module Dropbox::Sign
162
206
  @options = options
163
207
  end
164
208
 
209
+ # Custom attribute writer method checking allowed values (enum).
210
+ # @param [Object] font_family Object to be assigned
211
+ def font_family=(font_family)
212
+ validator = EnumAttributeValidator.new('String', ["helvetica", "arial", "courier", "calibri", "cambria", "georgia", "times", "trebuchet", "verdana", "roboto", "robotoMono", "notoSans", "notoSerif", "notoCJK-JP-Regular", "notoHebrew-Regular", "notoSanThaiMerged"])
213
+ unless validator.valid?(font_family)
214
+ fail ArgumentError, "invalid value for \"font_family\", must be one of #{validator.allowable_values}."
215
+ end
216
+ @font_family = font_family
217
+ end
218
+
165
219
  # Checks equality by comparing each attribute.
166
220
  # @param [Object] Object to be compared
167
221
  def ==(o)
@@ -169,7 +223,9 @@ module Dropbox::Sign
169
223
  self.class == o.class &&
170
224
  type == o.type &&
171
225
  options == o.options &&
172
- content == o.content && super(o)
226
+ content == o.content &&
227
+ font_family == o.font_family &&
228
+ font_size == o.font_size && super(o)
173
229
  end
174
230
 
175
231
  # @see the `==` method
@@ -181,7 +237,7 @@ module Dropbox::Sign
181
237
  # Calculates hash code according to all attributes.
182
238
  # @return [Integer] Hash code
183
239
  def hash
184
- [type, options, content].hash
240
+ [type, options, content, font_family, font_size].hash
185
241
  end
186
242
 
187
243
  # Builds the object from hash
@@ -0,0 +1,54 @@
1
+ =begin
2
+ #Dropbox Sign API
3
+
4
+ #Dropbox Sign v3 API
5
+
6
+ The version of the OpenAPI document: 3.0.0
7
+ Contact: apisupport@hellosign.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.3.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Dropbox
17
+ end
18
+
19
+ module Dropbox::Sign
20
+ class SubFormFieldsPerDocumentFontEnum
21
+ HELVETICA = "helvetica".freeze
22
+ ARIAL = "arial".freeze
23
+ COURIER = "courier".freeze
24
+ CALIBRI = "calibri".freeze
25
+ CAMBRIA = "cambria".freeze
26
+ GEORGIA = "georgia".freeze
27
+ TIMES = "times".freeze
28
+ TREBUCHET = "trebuchet".freeze
29
+ VERDANA = "verdana".freeze
30
+ ROBOTO = "roboto".freeze
31
+ ROBOTO_MONO = "robotoMono".freeze
32
+ NOTO_SANS = "notoSans".freeze
33
+ NOTO_SERIF = "notoSerif".freeze
34
+ NOTO_CJK_JP_REGULAR = "notoCJK-JP-Regular".freeze
35
+ NOTO_HEBREW_REGULAR = "notoHebrew-Regular".freeze
36
+ NOTO_SAN_THAI_MERGED = "notoSanThaiMerged".freeze
37
+
38
+ # Builds the enum from string
39
+ # @param [String] The enum value in the form of the string
40
+ # @return [String] The enum value
41
+ def self.build_from_hash(value)
42
+ new.build_from_hash(value)
43
+ end
44
+
45
+ # Builds the enum from string
46
+ # @param [String] The enum value in the form of the string
47
+ # @return [String] The enum value
48
+ def build_from_hash(value)
49
+ constantValues = SubFormFieldsPerDocumentFontEnum.constants.select { |c| SubFormFieldsPerDocumentFontEnum::const_get(c) == value }
50
+ raise "Invalid ENUM value #{value} for class #SubFormFieldsPerDocumentFontEnum" if constantValues.empty?
51
+ value
52
+ end
53
+ end
54
+ end
@@ -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