docspring 4.0.0 → 4.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.openapi-generator/FILES +99 -0
- data/.travis.yml +1 -1
- data/AGENTS.md +3 -2
- data/CHANGELOG.md +64 -0
- data/Gemfile.lock +9 -9
- data/README.md +14 -1
- data/docs/AddTemplateFieldsRequest.md +18 -0
- data/docs/Client.md +917 -80
- data/docs/CombinedPdf.md +1 -1
- data/docs/CreateCombinedPdfRequest.md +1 -1
- data/docs/CreateSubmissionBatchRequest.md +2 -0
- data/docs/CreateSubmissionRequest.md +4 -2
- data/docs/CreateTemplatePreviewRequest.md +18 -0
- data/docs/CreateTemplateRequest.md +13 -3
- data/docs/ErrorDetail.md +1 -1
- data/docs/ErrorInfo.md +4 -4
- data/docs/Field.md +198 -0
- data/docs/FieldDependency.md +22 -0
- data/docs/FieldDependencyInput.md +22 -0
- data/docs/FieldGroup.md +32 -0
- data/docs/FieldGroupInput.md +30 -0
- data/docs/FieldGroupType.md +15 -0
- data/docs/FieldInput.md +196 -0
- data/docs/FieldType.md +15 -0
- data/docs/GenerateFilesFormat.md +15 -0
- data/docs/GenerateSubmissionFilesRequest.md +18 -0
- data/docs/OutputFormat.md +15 -0
- data/docs/PageImage.md +34 -0
- data/docs/PageImages.md +24 -0
- data/docs/PredefinedField.md +30 -0
- data/docs/PredefinedFieldInput.md +30 -0
- data/docs/RemoveTemplateFieldsRequest.md +18 -0
- data/docs/ReorderTemplateFieldsRequest.md +18 -0
- data/docs/Submission.md +16 -14
- data/docs/SubmissionFiles.md +3 -1
- data/docs/SubmissionInput.md +4 -2
- data/docs/SubmissionList.md +1 -1
- data/docs/SubmissionSummary.md +54 -0
- data/docs/SubmissionValidation.md +24 -0
- data/docs/Template.md +18 -10
- data/docs/TemplateActor.md +1 -1
- data/docs/TemplateDiff.md +30 -0
- data/docs/TemplateDiffSummary.md +28 -0
- data/docs/TemplateDocument.md +6 -6
- data/docs/TemplateDocumentSummary.md +24 -0
- data/docs/TemplateFieldChange.md +24 -0
- data/docs/TemplateFieldChanges.md +24 -0
- data/docs/TemplateFieldDependency.md +1 -1
- data/docs/TemplateFieldDependencyInput.md +1 -1
- data/docs/TemplateFieldMove.md +22 -0
- data/docs/TemplateFields.md +22 -0
- data/docs/TemplatePageImages.md +24 -0
- data/docs/TemplatePreview.md +32 -0
- data/docs/TemplatePreviewState.md +15 -0
- data/docs/TemplateSummary.md +2 -48
- data/docs/UpdateTemplateDocumentRequest.md +6 -2
- data/docs/UpdateTemplateFieldsRequest.md +18 -0
- data/docs/UpdateTemplateRequest.md +10 -2
- data/docs/ValidateSubmissionRequest.md +38 -0
- data/lib/docspring/api/client.rb +869 -51
- data/lib/docspring/api_client.rb +4 -2
- data/lib/docspring/date_time_values.rb +33 -0
- data/lib/docspring/models/add_template_fields_request.rb +187 -0
- data/lib/docspring/models/combined_pdf.rb +1 -1
- data/lib/docspring/models/create_combined_pdf_request.rb +1 -1
- data/lib/docspring/models/create_submission_batch_request.rb +23 -1
- data/lib/docspring/models/create_submission_request.rb +25 -3
- data/lib/docspring/models/create_template_preview_request.rb +187 -0
- data/lib/docspring/models/create_template_request.rb +59 -4
- data/lib/docspring/models/error_code.rb +3 -1
- data/lib/docspring/models/error_detail.rb +1 -1
- data/lib/docspring/models/error_info.rb +4 -4
- data/lib/docspring/models/field.rb +2217 -0
- data/lib/docspring/models/field_dependency.rb +246 -0
- data/lib/docspring/models/field_dependency_input.rb +246 -0
- data/lib/docspring/models/field_group.rb +368 -0
- data/lib/docspring/models/field_group_input.rb +247 -0
- data/lib/docspring/models/field_group_type.rb +41 -0
- data/lib/docspring/models/field_input.rb +1109 -0
- data/lib/docspring/models/field_type.rb +54 -0
- data/lib/docspring/models/generate_files_format.rb +40 -0
- data/lib/docspring/models/generate_submission_files_request.rb +187 -0
- data/lib/docspring/models/output_format.rb +41 -0
- data/lib/docspring/models/page_image.rb +359 -0
- data/lib/docspring/models/page_images.rb +248 -0
- data/lib/docspring/models/predefined_field.rb +287 -0
- data/lib/docspring/models/predefined_field_input.rb +287 -0
- data/lib/docspring/models/remove_template_fields_request.rb +187 -0
- data/lib/docspring/models/reorder_template_fields_request.rb +187 -0
- data/lib/docspring/models/submission.rb +146 -117
- data/lib/docspring/models/submission_files.rb +13 -4
- data/lib/docspring/models/submission_input.rb +25 -3
- data/lib/docspring/models/submission_list.rb +1 -1
- data/lib/docspring/models/submission_summary.rb +601 -0
- data/lib/docspring/models/submission_validation.rb +234 -0
- data/lib/docspring/models/template.rb +169 -83
- data/lib/docspring/models/template_actor.rb +1 -1
- data/lib/docspring/models/template_diff.rb +321 -0
- data/lib/docspring/models/template_diff_summary.rb +320 -0
- data/lib/docspring/models/template_document.rb +44 -44
- data/lib/docspring/models/template_document_state.rb +3 -1
- data/lib/docspring/models/template_document_summary.rb +260 -0
- data/lib/docspring/models/template_field_change.rb +266 -0
- data/lib/docspring/models/template_field_changes.rb +274 -0
- data/lib/docspring/models/template_field_dependency.rb +1 -1
- data/lib/docspring/models/template_field_dependency_input.rb +1 -1
- data/lib/docspring/models/template_field_move.rb +239 -0
- data/lib/docspring/models/template_fields.rb +227 -0
- data/lib/docspring/models/template_page_images.rb +254 -0
- data/lib/docspring/models/template_preview.rb +356 -0
- data/lib/docspring/models/template_preview_state.rb +42 -0
- data/lib/docspring/models/template_summary.rb +5 -572
- data/lib/docspring/models/update_template_document_request.rb +23 -20
- data/lib/docspring/models/update_template_fields_request.rb +187 -0
- data/lib/docspring/models/update_template_request.rb +53 -6
- data/lib/docspring/models/validate_submission_request.rb +288 -0
- data/lib/docspring/request_schemas.json +3465 -1588
- data/lib/docspring/version.rb +1 -1
- data/lib/docspring/webhook_signature.rb +45 -0
- data/lib/docspring.rb +34 -0
- data/spec/api/client_spec.rb +167 -13
- data/spec/models/add_template_fields_request_spec.rb +36 -0
- data/spec/models/create_submission_batch_request_spec.rb +6 -0
- data/spec/models/create_submission_request_spec.rb +6 -0
- data/spec/models/create_template_preview_request_spec.rb +36 -0
- data/spec/models/create_template_request_spec.rb +30 -0
- data/spec/models/field_dependency_input_spec.rb +48 -0
- data/spec/models/field_dependency_spec.rb +48 -0
- data/spec/models/field_group_input_spec.rb +72 -0
- data/spec/models/field_group_spec.rb +78 -0
- data/spec/models/field_group_type_spec.rb +30 -0
- data/spec/models/field_input_spec.rb +570 -0
- data/spec/models/field_spec.rb +576 -0
- data/spec/models/field_type_spec.rb +30 -0
- data/spec/models/generate_files_format_spec.rb +30 -0
- data/spec/models/generate_submission_files_request_spec.rb +36 -0
- data/spec/models/output_format_spec.rb +30 -0
- data/spec/models/page_image_spec.rb +84 -0
- data/spec/models/page_images_spec.rb +54 -0
- data/spec/models/predefined_field_input_spec.rb +72 -0
- data/spec/models/predefined_field_spec.rb +72 -0
- data/spec/models/remove_template_fields_request_spec.rb +36 -0
- data/spec/models/reorder_template_fields_request_spec.rb +36 -0
- data/spec/models/submission_files_spec.rb +6 -0
- data/spec/models/submission_input_spec.rb +6 -0
- data/spec/models/submission_spec.rb +17 -11
- data/spec/models/submission_summary_spec.rb +144 -0
- data/spec/models/submission_validation_spec.rb +54 -0
- data/spec/models/template_diff_spec.rb +72 -0
- data/spec/models/template_diff_summary_spec.rb +66 -0
- data/spec/models/template_document_spec.rb +5 -5
- data/spec/models/template_document_summary_spec.rb +54 -0
- data/spec/models/template_field_change_spec.rb +54 -0
- data/spec/models/template_field_changes_spec.rb +54 -0
- data/spec/models/template_field_move_spec.rb +48 -0
- data/spec/models/template_fields_spec.rb +48 -0
- data/spec/models/template_page_images_spec.rb +54 -0
- data/spec/models/template_preview_spec.rb +78 -0
- data/spec/models/template_preview_state_spec.rb +30 -0
- data/spec/models/template_spec.rb +34 -10
- data/spec/models/template_summary_spec.rb +0 -138
- data/spec/models/update_template_document_request_spec.rb +12 -0
- data/spec/models/update_template_fields_request_spec.rb +36 -0
- data/spec/models/update_template_request_spec.rb +24 -0
- data/spec/models/validate_submission_request_spec.rb +96 -0
- metadata +135 -1
|
@@ -14,12 +14,18 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module DocSpring
|
|
17
|
-
# The new PDF
|
|
17
|
+
# The new PDF, as one of `cache_id`, `document_url` and `document_base64`.
|
|
18
18
|
class UpdateTemplateDocumentRequest < ApiModelBase
|
|
19
19
|
# The `fields.key` of the new PDF, uploaded with the presigned upload (GET /uploads/presign).
|
|
20
20
|
attr_accessor :cache_id
|
|
21
21
|
|
|
22
|
-
#
|
|
22
|
+
# An https:// link to the template's PDF (up to 100 MB), instead of `cache_id`. DocSpring downloads it after responding, following redirects to other https:// links: the template's `document.state` is `downloading` until then (sync.api hosts wait for it). If it can't be downloaded, the state is `download_failed` and `document.error_message` says why.
|
|
23
|
+
attr_accessor :document_url
|
|
24
|
+
|
|
25
|
+
# The template's PDF, encoded as base64 (a `data:` URI works too), instead of `cache_id`. Up to 7 MB before it's encoded: send a larger file with `cache_id` or `document_url`.
|
|
26
|
+
attr_accessor :document_base64
|
|
27
|
+
|
|
28
|
+
# The PDF's file name, for a `cache_id` (presigned uploads don't send one) or `document_base64`. A `document_url`'s is the last part of its path unless you set it.
|
|
23
29
|
attr_accessor :filename
|
|
24
30
|
|
|
25
31
|
# Replace all of the template's fields with the fillable fields in the new PDF, once DocSpring has processed it (`document.field_reimport_state`). As on a first upload, the default typeface, font size, bold and color are taken from the PDF's fields; the template's other settings are kept. If the PDF has no fillable fields, the template keeps its fields. A locked template can't re-import its fields.
|
|
@@ -29,6 +35,8 @@ module DocSpring
|
|
|
29
35
|
def self.attribute_map
|
|
30
36
|
{
|
|
31
37
|
:'cache_id' => :'cache_id',
|
|
38
|
+
:'document_url' => :'document_url',
|
|
39
|
+
:'document_base64' => :'document_base64',
|
|
32
40
|
:'filename' => :'filename',
|
|
33
41
|
:'reimport_fields' => :'reimport_fields'
|
|
34
42
|
}
|
|
@@ -48,6 +56,8 @@ module DocSpring
|
|
|
48
56
|
def self.openapi_types
|
|
49
57
|
{
|
|
50
58
|
:'cache_id' => :'String',
|
|
59
|
+
:'document_url' => :'String',
|
|
60
|
+
:'document_base64' => :'String',
|
|
51
61
|
:'filename' => :'String',
|
|
52
62
|
:'reimport_fields' => :'Boolean'
|
|
53
63
|
}
|
|
@@ -87,8 +97,14 @@ module DocSpring
|
|
|
87
97
|
|
|
88
98
|
if attributes.key?(:'cache_id')
|
|
89
99
|
self.cache_id = attributes[:'cache_id']
|
|
90
|
-
|
|
91
|
-
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
if attributes.key?(:'document_url')
|
|
103
|
+
self.document_url = attributes[:'document_url']
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
if attributes.key?(:'document_base64')
|
|
107
|
+
self.document_base64 = attributes[:'document_base64']
|
|
92
108
|
end
|
|
93
109
|
|
|
94
110
|
if attributes.key?(:'filename')
|
|
@@ -105,10 +121,6 @@ module DocSpring
|
|
|
105
121
|
def list_invalid_properties
|
|
106
122
|
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
107
123
|
invalid_properties = Array.new
|
|
108
|
-
if @cache_id.nil?
|
|
109
|
-
invalid_properties.push('invalid value for "cache_id", cache_id cannot be nil.')
|
|
110
|
-
end
|
|
111
|
-
|
|
112
124
|
invalid_properties
|
|
113
125
|
end
|
|
114
126
|
|
|
@@ -116,26 +128,17 @@ module DocSpring
|
|
|
116
128
|
# @return true if the model is valid
|
|
117
129
|
def valid?
|
|
118
130
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
119
|
-
return false if @cache_id.nil?
|
|
120
131
|
true
|
|
121
132
|
end
|
|
122
133
|
|
|
123
|
-
# Custom attribute writer method with validation
|
|
124
|
-
# @param [Object] cache_id Value to be assigned
|
|
125
|
-
def cache_id=(cache_id)
|
|
126
|
-
if cache_id.nil?
|
|
127
|
-
fail ArgumentError, 'cache_id cannot be nil'
|
|
128
|
-
end
|
|
129
|
-
|
|
130
|
-
@cache_id = cache_id
|
|
131
|
-
end
|
|
132
|
-
|
|
133
134
|
# Checks equality by comparing each attribute.
|
|
134
135
|
# @param [Object] Object to be compared
|
|
135
136
|
def ==(o)
|
|
136
137
|
return true if self.equal?(o)
|
|
137
138
|
self.class == o.class &&
|
|
138
139
|
cache_id == o.cache_id &&
|
|
140
|
+
document_url == o.document_url &&
|
|
141
|
+
document_base64 == o.document_base64 &&
|
|
139
142
|
filename == o.filename &&
|
|
140
143
|
reimport_fields == o.reimport_fields
|
|
141
144
|
end
|
|
@@ -149,7 +152,7 @@ module DocSpring
|
|
|
149
152
|
# Calculates hash code according to all attributes.
|
|
150
153
|
# @return [Integer] Hash code
|
|
151
154
|
def hash
|
|
152
|
-
[cache_id, filename, reimport_fields].hash
|
|
155
|
+
[cache_id, document_url, document_base64, filename, reimport_fields].hash
|
|
153
156
|
end
|
|
154
157
|
|
|
155
158
|
# Builds the object from hash
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#DocSpring API
|
|
3
|
+
|
|
4
|
+
#Use DocSpring's API to programmatically fill out PDF forms, convert HTML to PDFs, merge PDFs, or request legally binding e-signatures.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: v2
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.26.0-DOCSPRING
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module DocSpring
|
|
17
|
+
# The fields to change in the template's draft.
|
|
18
|
+
class UpdateTemplateFieldsRequest < ApiModelBase
|
|
19
|
+
# The changes, each with the `id` of the field it changes. Settings left out keep their values. Changing a shared setting changes it for every field with the same name. Renaming a field moves it to the shared settings of its new name, and conditional logic and formulas that use the old name follow it when no other field has that name.
|
|
20
|
+
attr_accessor :fields
|
|
21
|
+
|
|
22
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
23
|
+
def self.attribute_map
|
|
24
|
+
{
|
|
25
|
+
:'fields' => :'fields'
|
|
26
|
+
}
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
# Returns attribute mapping this model knows about
|
|
30
|
+
def self.acceptable_attribute_map
|
|
31
|
+
attribute_map
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
# Returns all the JSON keys this model knows about
|
|
35
|
+
def self.acceptable_attributes
|
|
36
|
+
acceptable_attribute_map.values
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
# Attribute type mapping.
|
|
40
|
+
def self.openapi_types
|
|
41
|
+
{
|
|
42
|
+
:'fields' => :'Array<FieldInput>'
|
|
43
|
+
}
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# List of attributes with nullable: true
|
|
47
|
+
def self.openapi_nullable
|
|
48
|
+
Set.new([
|
|
49
|
+
])
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# Returns attribute type mapping
|
|
53
|
+
def self.acceptable_openapi_types
|
|
54
|
+
openapi_types
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# Returns the nullable attributes
|
|
58
|
+
def self.acceptable_openapi_nullable
|
|
59
|
+
openapi_nullable
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# Initializes the object
|
|
63
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
64
|
+
def initialize(attributes = {})
|
|
65
|
+
if (!attributes.is_a?(Hash))
|
|
66
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `DocSpring::UpdateTemplateFieldsRequest` initialize method"
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
70
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
71
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
72
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
73
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `DocSpring::UpdateTemplateFieldsRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
74
|
+
end
|
|
75
|
+
h[k.to_sym] = v
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
if attributes.key?(:'fields')
|
|
79
|
+
if (value = attributes[:'fields']).is_a?(Array)
|
|
80
|
+
self.fields = value
|
|
81
|
+
end
|
|
82
|
+
else
|
|
83
|
+
self.fields = nil
|
|
84
|
+
end
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
88
|
+
# @return Array for valid properties with the reasons
|
|
89
|
+
def list_invalid_properties
|
|
90
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
91
|
+
invalid_properties = Array.new
|
|
92
|
+
if @fields.nil?
|
|
93
|
+
invalid_properties.push('invalid value for "fields", fields cannot be nil.')
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
invalid_properties
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
# Check to see if the all the properties in the model are valid
|
|
100
|
+
# @return true if the model is valid
|
|
101
|
+
def valid?
|
|
102
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
103
|
+
return false if @fields.nil?
|
|
104
|
+
true
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
# Custom attribute writer method with validation
|
|
108
|
+
# @param [Object] fields Value to be assigned
|
|
109
|
+
def fields=(fields)
|
|
110
|
+
if fields.nil?
|
|
111
|
+
fail ArgumentError, 'fields cannot be nil'
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
@fields = fields
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
# Checks equality by comparing each attribute.
|
|
118
|
+
# @param [Object] Object to be compared
|
|
119
|
+
def ==(o)
|
|
120
|
+
return true if self.equal?(o)
|
|
121
|
+
self.class == o.class &&
|
|
122
|
+
fields == o.fields
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
# @see the `==` method
|
|
126
|
+
# @param [Object] Object to be compared
|
|
127
|
+
def eql?(o)
|
|
128
|
+
self == o
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
# Calculates hash code according to all attributes.
|
|
132
|
+
# @return [Integer] Hash code
|
|
133
|
+
def hash
|
|
134
|
+
[fields].hash
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
# Builds the object from hash
|
|
138
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
139
|
+
# @return [Object] Returns the model itself
|
|
140
|
+
def self.build_from_hash(attributes)
|
|
141
|
+
return nil unless attributes.is_a?(Hash)
|
|
142
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
143
|
+
# include attributes inherited from allOf parents (the nearest declaration wins)
|
|
144
|
+
map = acceptable_attribute_map
|
|
145
|
+
transformed_hash = {}
|
|
146
|
+
acceptable_openapi_types.each_pair do |key, type|
|
|
147
|
+
if attributes.key?(map[key]) && attributes[map[key]].nil?
|
|
148
|
+
transformed_hash["#{key}"] = nil
|
|
149
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
150
|
+
# check to ensure the input is an array given that the attribute
|
|
151
|
+
# is documented as an array but the input is not
|
|
152
|
+
if attributes[map[key]].is_a?(Array)
|
|
153
|
+
transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
|
|
154
|
+
end
|
|
155
|
+
elsif !attributes[map[key]].nil?
|
|
156
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
|
|
157
|
+
end
|
|
158
|
+
end
|
|
159
|
+
# Responses can include enum values added after this client was released, so the enum setters
|
|
160
|
+
# accept any value while the model is built from a response
|
|
161
|
+
allocate.tap do |model|
|
|
162
|
+
model.instance_variable_set(:@_skip_enum_validation, true)
|
|
163
|
+
model.send(:initialize, transformed_hash)
|
|
164
|
+
model.remove_instance_variable(:@_skip_enum_validation)
|
|
165
|
+
end
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
# Returns the object in the form of hash
|
|
169
|
+
# @return [Hash] Returns the object in the form of hash
|
|
170
|
+
def to_hash
|
|
171
|
+
hash = {}
|
|
172
|
+
# include attributes inherited from allOf parents (the nearest declaration wins)
|
|
173
|
+
self.class.acceptable_attribute_map.each_pair do |attr, param|
|
|
174
|
+
value = self.send(attr)
|
|
175
|
+
if value.nil?
|
|
176
|
+
is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
|
|
177
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
178
|
+
end
|
|
179
|
+
|
|
180
|
+
hash[param] = _to_hash(value)
|
|
181
|
+
end
|
|
182
|
+
hash
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
end
|
|
186
|
+
|
|
187
|
+
end
|
|
@@ -46,7 +46,7 @@ module DocSpring
|
|
|
46
46
|
# Generate PDFs whose text and check fields stay fillable ("Generate Editable PDFs"). A submission's `editable` overrides it.
|
|
47
47
|
attr_accessor :editable_submissions
|
|
48
48
|
|
|
49
|
-
# The sites
|
|
49
|
+
# The sites that can embed the template's live signature requests and its embedded template editor: a host such as `app.example.com`, with an optional leading wildcard (`*.example.com`), port (`localhost:3000`) or scheme (`https://app.example.com`; without one, `http` and `https` both work). Browsers open a live signature request in a frame only on these sites (and DocSpring's), so with an empty list it can't be embedded anywhere; a test signature request can be embedded on any site. The embedded template editor loads only for a page on one of these sites (by its Referer or Origin header), and on any site when the list is empty. Forms embedded on a page (Visual Forms JS and the simple form) aren't restricted.
|
|
50
50
|
attr_accessor :embed_domains
|
|
51
51
|
|
|
52
52
|
# Allow the embedded template editor to change sensitive template settings (webhooks, redirect URL, encryption, public access, expiration and so on).
|
|
@@ -97,6 +97,15 @@ module DocSpring
|
|
|
97
97
|
# The template's conditional logic rules. Setting them replaces all of the rules.
|
|
98
98
|
attr_accessor :field_dependencies
|
|
99
99
|
|
|
100
|
+
# Changes to the settings of the template's field groups, each with the `name` of the group it changes. Settings left out keep their values, and groups left out are unchanged.
|
|
101
|
+
attr_accessor :field_groups
|
|
102
|
+
|
|
103
|
+
# The field names that people using the embedded template editor choose from, each with the data type and settings a field gets when it's given that name. Setting it replaces the whole list; an empty list turns them off.
|
|
104
|
+
attr_accessor :predefined_fields
|
|
105
|
+
|
|
106
|
+
# Sample submission data that sets `predefined_fields`: each value becomes a predefined field, with a type that fits it (`string`, `number`, `boolean`, `date`, `email` or `url`) and `required_in_template` true. Nested objects and arrays become names with `/`, such as `customer/email`. Without `predefined_fields` in the same request, it replaces them; with them, it adds to them and sets the types of the ones it has values for.
|
|
107
|
+
attr_accessor :predefined_fields_sample_data
|
|
108
|
+
|
|
100
109
|
# The HTML of an HTML template, as a Liquid template. Null for PDF templates.
|
|
101
110
|
attr_accessor :html
|
|
102
111
|
|
|
@@ -112,6 +121,9 @@ module DocSpring
|
|
|
112
121
|
# Null resets the options to their defaults.
|
|
113
122
|
attr_accessor :html_engine_options
|
|
114
123
|
|
|
124
|
+
# Whether an HTML template HTML-escapes the values it prints. When true, `{{ value }}` prints a value as text, so a `<` or `&` in it is printed as that character, and `{{ value | raw }}` prints a value as HTML. New HTML templates default to true. Templates created before October 2026, or with API v1, default to false, which prints every value as HTML. Null for PDF templates.
|
|
125
|
+
attr_accessor :html_escape_data
|
|
126
|
+
|
|
115
127
|
class EnumAttributeValidator
|
|
116
128
|
attr_reader :datatype
|
|
117
129
|
attr_reader :allowable_values
|
|
@@ -164,11 +176,15 @@ module DocSpring
|
|
|
164
176
|
:'slack_webhook_url' => :'slack_webhook_url',
|
|
165
177
|
:'defaults' => :'defaults',
|
|
166
178
|
:'field_dependencies' => :'field_dependencies',
|
|
179
|
+
:'field_groups' => :'field_groups',
|
|
180
|
+
:'predefined_fields' => :'predefined_fields',
|
|
181
|
+
:'predefined_fields_sample_data' => :'predefined_fields_sample_data',
|
|
167
182
|
:'html' => :'html',
|
|
168
183
|
:'scss' => :'scss',
|
|
169
184
|
:'header_html' => :'header_html',
|
|
170
185
|
:'footer_html' => :'footer_html',
|
|
171
|
-
:'html_engine_options' => :'html_engine_options'
|
|
186
|
+
:'html_engine_options' => :'html_engine_options',
|
|
187
|
+
:'html_escape_data' => :'html_escape_data'
|
|
172
188
|
}
|
|
173
189
|
end
|
|
174
190
|
|
|
@@ -212,11 +228,15 @@ module DocSpring
|
|
|
212
228
|
:'slack_webhook_url' => :'String',
|
|
213
229
|
:'defaults' => :'TemplateDefaultsInput',
|
|
214
230
|
:'field_dependencies' => :'Array<TemplateFieldDependencyInput>',
|
|
231
|
+
:'field_groups' => :'Array<FieldGroupInput>',
|
|
232
|
+
:'predefined_fields' => :'Array<PredefinedFieldInput>',
|
|
233
|
+
:'predefined_fields_sample_data' => :'Hash<String, Object>',
|
|
215
234
|
:'html' => :'String',
|
|
216
235
|
:'scss' => :'String',
|
|
217
236
|
:'header_html' => :'String',
|
|
218
237
|
:'footer_html' => :'String',
|
|
219
|
-
:'html_engine_options' => :'HtmlEngineOptionsInput'
|
|
238
|
+
:'html_engine_options' => :'HtmlEngineOptionsInput',
|
|
239
|
+
:'html_escape_data' => :'Boolean'
|
|
220
240
|
}
|
|
221
241
|
end
|
|
222
242
|
|
|
@@ -228,11 +248,12 @@ module DocSpring
|
|
|
228
248
|
:'encrypt_pdfs_password',
|
|
229
249
|
:'redirect_url',
|
|
230
250
|
:'slack_webhook_url',
|
|
251
|
+
:'predefined_fields_sample_data',
|
|
231
252
|
:'html',
|
|
232
253
|
:'scss',
|
|
233
254
|
:'header_html',
|
|
234
255
|
:'footer_html',
|
|
235
|
-
:'html_engine_options'
|
|
256
|
+
:'html_engine_options',
|
|
236
257
|
])
|
|
237
258
|
end
|
|
238
259
|
|
|
@@ -374,6 +395,24 @@ module DocSpring
|
|
|
374
395
|
end
|
|
375
396
|
end
|
|
376
397
|
|
|
398
|
+
if attributes.key?(:'field_groups')
|
|
399
|
+
if (value = attributes[:'field_groups']).is_a?(Array)
|
|
400
|
+
self.field_groups = value
|
|
401
|
+
end
|
|
402
|
+
end
|
|
403
|
+
|
|
404
|
+
if attributes.key?(:'predefined_fields')
|
|
405
|
+
if (value = attributes[:'predefined_fields']).is_a?(Array)
|
|
406
|
+
self.predefined_fields = value
|
|
407
|
+
end
|
|
408
|
+
end
|
|
409
|
+
|
|
410
|
+
if attributes.key?(:'predefined_fields_sample_data')
|
|
411
|
+
if (value = attributes[:'predefined_fields_sample_data']).is_a?(Hash) || value.nil?
|
|
412
|
+
self.predefined_fields_sample_data = value
|
|
413
|
+
end
|
|
414
|
+
end
|
|
415
|
+
|
|
377
416
|
if attributes.key?(:'html')
|
|
378
417
|
self.html = attributes[:'html']
|
|
379
418
|
end
|
|
@@ -393,6 +432,10 @@ module DocSpring
|
|
|
393
432
|
if attributes.key?(:'html_engine_options')
|
|
394
433
|
self.html_engine_options = attributes[:'html_engine_options']
|
|
395
434
|
end
|
|
435
|
+
|
|
436
|
+
if attributes.key?(:'html_escape_data')
|
|
437
|
+
self.html_escape_data = attributes[:'html_escape_data']
|
|
438
|
+
end
|
|
396
439
|
end
|
|
397
440
|
|
|
398
441
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -442,11 +485,15 @@ module DocSpring
|
|
|
442
485
|
slack_webhook_url == o.slack_webhook_url &&
|
|
443
486
|
defaults == o.defaults &&
|
|
444
487
|
field_dependencies == o.field_dependencies &&
|
|
488
|
+
field_groups == o.field_groups &&
|
|
489
|
+
predefined_fields == o.predefined_fields &&
|
|
490
|
+
predefined_fields_sample_data == o.predefined_fields_sample_data &&
|
|
445
491
|
html == o.html &&
|
|
446
492
|
scss == o.scss &&
|
|
447
493
|
header_html == o.header_html &&
|
|
448
494
|
footer_html == o.footer_html &&
|
|
449
|
-
html_engine_options == o.html_engine_options
|
|
495
|
+
html_engine_options == o.html_engine_options &&
|
|
496
|
+
html_escape_data == o.html_escape_data
|
|
450
497
|
end
|
|
451
498
|
|
|
452
499
|
# @see the `==` method
|
|
@@ -458,7 +505,7 @@ module DocSpring
|
|
|
458
505
|
# Calculates hash code according to all attributes.
|
|
459
506
|
# @return [Integer] Hash code
|
|
460
507
|
def hash
|
|
461
|
-
[name, description, parent_folder_id, locked, add_signature_request_submission_id_footers, ai_field_naming_language, allow_additional_properties, allow_skipping_optional_fields, default_form_mode, editable_submissions, embed_domains, embed_edit_allow_settings, embed_edit_allow_versioning, embed_edit_allow_document_replacement, encrypt_pdfs, encrypt_pdfs_password, expire_submissions, expire_after, expiration_interval, merge_audit_trail_pdf, parse_dates_using_template_date_format, public_submissions, public_web_form, redirect_url, slack_webhook_url, defaults, field_dependencies, html, scss, header_html, footer_html, html_engine_options].hash
|
|
508
|
+
[name, description, parent_folder_id, locked, add_signature_request_submission_id_footers, ai_field_naming_language, allow_additional_properties, allow_skipping_optional_fields, default_form_mode, editable_submissions, embed_domains, embed_edit_allow_settings, embed_edit_allow_versioning, embed_edit_allow_document_replacement, encrypt_pdfs, encrypt_pdfs_password, expire_submissions, expire_after, expiration_interval, merge_audit_trail_pdf, parse_dates_using_template_date_format, public_submissions, public_web_form, redirect_url, slack_webhook_url, defaults, field_dependencies, field_groups, predefined_fields, predefined_fields_sample_data, html, scss, header_html, footer_html, html_engine_options, html_escape_data].hash
|
|
462
509
|
end
|
|
463
510
|
|
|
464
511
|
# Builds the object from hash
|