docspring 4.0.0 → 4.1.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 +84 -0
- data/.travis.yml +1 -1
- data/CHANGELOG.md +24 -0
- data/Gemfile.lock +2 -2
- data/README.md +10 -1
- data/docs/AddTemplateFieldsRequest.md +18 -0
- data/docs/Client.md +704 -33
- data/docs/CreateSubmissionBatchRequest.md +2 -0
- data/docs/CreateSubmissionRequest.md +2 -0
- data/docs/CreateTemplateRequest.md +10 -2
- 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 +3 -1
- data/docs/SubmissionFiles.md +3 -1
- data/docs/SubmissionInput.md +2 -0
- data/docs/SubmissionValidation.md +24 -0
- data/docs/Template.md +6 -0
- data/docs/TemplateDiff.md +30 -0
- data/docs/TemplateDiffSummary.md +28 -0
- data/docs/TemplateDocument.md +3 -3
- 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/UpdateTemplateDocumentRequest.md +6 -2
- data/docs/UpdateTemplateFieldsRequest.md +18 -0
- data/docs/UpdateTemplateRequest.md +6 -0
- data/docs/ValidateSubmissionRequest.md +38 -0
- data/lib/docspring/api/client.rb +666 -18
- data/lib/docspring/api_client.rb +1 -1
- data/lib/docspring/models/add_template_fields_request.rb +187 -0
- data/lib/docspring/models/create_submission_batch_request.rb +23 -1
- data/lib/docspring/models/create_submission_request.rb +23 -1
- data/lib/docspring/models/create_template_request.rb +48 -3
- 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 +31 -2
- data/lib/docspring/models/submission_files.rb +13 -4
- data/lib/docspring/models/submission_input.rb +23 -1
- data/lib/docspring/models/submission_validation.rb +234 -0
- data/lib/docspring/models/template.rb +74 -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 +3 -3
- data/lib/docspring/models/template_document_state.rb +3 -1
- 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/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 +38 -1
- data/lib/docspring/models/validate_submission_request.rb +288 -0
- data/lib/docspring/request_schemas.json +3364 -1584
- data/lib/docspring/version.rb +1 -1
- data/lib/docspring.rb +28 -0
- data/spec/api/client_spec.rb +128 -9
- 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_request_spec.rb +24 -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 +6 -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_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_spec.rb +18 -0
- 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 +18 -0
- data/spec/models/validate_submission_request_spec.rb +96 -0
- metadata +113 -1
|
@@ -0,0 +1,1109 @@
|
|
|
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
|
+
# A field of a template: the name of a value in submission data, and how and where it prints. Fields with the same `name` share one value and the settings the descriptions say are shared. A PDF template's fields are placed on its pages: `x`, `y`, `width` and `height` are in units where every page is 2480 wide, measured from the top-left corner of the field's `page`. To convert from PDF points, multiply by 2480 and divide by the page's width in points (`document.page_dimensions` on the template). An HTML template's fields are all on page 1, and their placement and style settings aren't used.
|
|
18
|
+
class FieldInput < ApiModelBase
|
|
19
|
+
# The field's name, the key of its value in submission data. A `/` nests the key in objects and arrays (`client/address`, `items/0/price`); write a literal `/` as `~1` and `~` as `~0`. Fields with the same name share one value and their shared settings, and array indexes inside a name are ignored for settings, so `items/0/price` and `items/1/price` share settings but not values. A `#` and a line number (`notes#0`, `notes#1`) splits one value over several fields as lines of text, and names that start with `@@` print submission details such as `@@date`.
|
|
20
|
+
attr_accessor :name
|
|
21
|
+
|
|
22
|
+
# The number of the page the field is on, starting at 1. A field added without one goes on page 1, and a field moved to another page without a new `y` keeps its place on the page.
|
|
23
|
+
attr_accessor :page
|
|
24
|
+
|
|
25
|
+
# The data type of the field's value: `string`, `number`, `boolean`, `date`, `address`, `country`, `email`, `url`, `image`, `signature`, `initials`, `barcode`, or `combined` (made from other fields' values, never sent in submission data). It sets how the value is validated and which `display_type`s the field can use. `object` and `array` are the types of field groups (the template's `field_groups`), not of fields. Shared by every field with the same `name`.
|
|
26
|
+
attr_accessor :type
|
|
27
|
+
|
|
28
|
+
# The field prints fixed content, its `default`, instead of a value from submission data, and it's left out of the template's data schema and forms. Static check marks and shapes always print unless `hidden`, and a static number field's `default` can be a formula. Shared by every field with the same `name`.
|
|
29
|
+
attr_accessor :static
|
|
30
|
+
|
|
31
|
+
# Text and check display only: prints the field as a fillable PDF form field instead of flat content (a text field with an `option_list` becomes a dropdown). A submission's `editable` option, when set, overrides this for every field. Shared by every field with the same `name`.
|
|
32
|
+
attr_accessor :editable
|
|
33
|
+
|
|
34
|
+
# The value used when a submission leaves the field out, and the value forms are pre-filled with. A required field still needs a value in each submission. An image field's default is an image URL, a number field's can be a formula, and a static field's is the content it prints. Shared by every field with the same `name`.
|
|
35
|
+
attr_accessor :default
|
|
36
|
+
|
|
37
|
+
# The field's title in the template's data schema and on forms. When it's empty, a title is made from the field's name. Shared by every field with the same `name`.
|
|
38
|
+
attr_accessor :title
|
|
39
|
+
|
|
40
|
+
# Help text for the field, added to the template's data schema and shown on forms. Shared by every field with the same `name`.
|
|
41
|
+
attr_accessor :description
|
|
42
|
+
|
|
43
|
+
# Placeholder text for the field's input on forms, added to the template's data schema as `x-placeholder`. Shared by every field with the same `name`.
|
|
44
|
+
attr_accessor :placeholder
|
|
45
|
+
|
|
46
|
+
# Text for your own use, added to the template's data schema as `x-metadata`. DocSpring doesn't use it. Shared by every field with the same `name`.
|
|
47
|
+
attr_accessor :metadata
|
|
48
|
+
|
|
49
|
+
# Whether each submission must include a value for the field. A submission without one fails validation, and no PDF is generated. Shared by every field with the same `name`.
|
|
50
|
+
attr_accessor :required
|
|
51
|
+
|
|
52
|
+
# String fields only: a comma-separated list of the values the field accepts. It's added to the template's data schema as an `enum`, forms show it as a select list, and an `editable` field becomes a dropdown. Shared by every field with the same `name`.
|
|
53
|
+
attr_accessor :option_list
|
|
54
|
+
|
|
55
|
+
# Combined fields only: a comma-separated list of the names of the fields whose values are combined, in order. Shared by every field with the same `name`.
|
|
56
|
+
attr_accessor :combined_field_names
|
|
57
|
+
|
|
58
|
+
# Combined fields only: `separator` joins the values with `combined_field_separator`, and `format` puts them into `combined_field_format`. Shared by every field with the same `name`.
|
|
59
|
+
attr_accessor :combined_field_type
|
|
60
|
+
|
|
61
|
+
# Combined fields only: the text placed between the values when `combined_field_type` is `separator`. Empty values are skipped. Defaults to a space. Shared by every field with the same `name`.
|
|
62
|
+
attr_accessor :combined_field_separator
|
|
63
|
+
|
|
64
|
+
# Combined fields only: the text for `combined_field_type` `format`, where `$0`, `$1` and so on are replaced with the values of `combined_field_names` in order, such as `Full name: $0, Occupation: $1`. Shared by every field with the same `name`.
|
|
65
|
+
attr_accessor :combined_field_format
|
|
66
|
+
|
|
67
|
+
# Number fields only: the value must be a whole number. Shared by every field with the same `name`.
|
|
68
|
+
attr_accessor :integer
|
|
69
|
+
|
|
70
|
+
# Number fields only: the smallest value allowed. Shared by every field with the same `name`.
|
|
71
|
+
attr_accessor :minimum
|
|
72
|
+
|
|
73
|
+
# Number fields only: the largest value allowed. Shared by every field with the same `name`.
|
|
74
|
+
attr_accessor :maximum
|
|
75
|
+
|
|
76
|
+
# Number fields only: the value must be greater than `minimum`, not equal to it. Shared by every field with the same `name`.
|
|
77
|
+
attr_accessor :exclusive_minimum
|
|
78
|
+
|
|
79
|
+
# Number fields only: the value must be less than `maximum`, not equal to it. Shared by every field with the same `name`.
|
|
80
|
+
attr_accessor :exclusive_maximum
|
|
81
|
+
|
|
82
|
+
# Date fields only: the value is a date and time (`YYYY-MM-DDThh:mm:ss.fffZ`) instead of a date (`YYYY-MM-DD`), and it prints with the template's date-time format unless `date_time_format` is set. Shared by every field with the same `name`.
|
|
83
|
+
attr_accessor :include_time
|
|
84
|
+
|
|
85
|
+
# Signature and initials fields only: lets signers draw their signature on forms and in data requests. Shared by every field with the same `name`.
|
|
86
|
+
attr_accessor :signature_allow_draw
|
|
87
|
+
|
|
88
|
+
# Signature and initials fields only: lets signers type their name and choose a script font instead of drawing, on forms and in data requests. Shared by every field with the same `name`.
|
|
89
|
+
attr_accessor :signature_allow_type
|
|
90
|
+
|
|
91
|
+
# Barcode fields only: the barcode format, which the value must match. `code_128` and `pdf417` take any ASCII text; `code_39` and `code_93` take capital letters, digits, spaces and `- . $ / + %`; `code_25` takes digits; `ean_13` takes 12 digits, `ean_8` 7 digits and `upc_a` 11 digits (the check digit is added). Shared by every field with the same `name`.
|
|
92
|
+
attr_accessor :barcode_symbology
|
|
93
|
+
|
|
94
|
+
# Leaves the field off the PDF. It stays in the template's data schema (marked `x-hidden`) and on forms, so other fields, such as combined fields, can use its value. A hidden static check mark or shape isn't printed.
|
|
95
|
+
attr_accessor :hidden
|
|
96
|
+
|
|
97
|
+
# The distance from the page's left edge to the field's left edge. Positions and sizes are in units where every page is 2480 wide: one unit is the page's width in points divided by 2480 (about 0.247 points on a US Letter page).
|
|
98
|
+
attr_accessor :x
|
|
99
|
+
|
|
100
|
+
# The distance from the top edge of the field's `page` down to the field's top edge, in the units of `x`. A page is 2480 times its height divided by its width units tall: about 3209 for US Letter and 3508 for A4.
|
|
101
|
+
attr_accessor :y
|
|
102
|
+
|
|
103
|
+
# The field's width, in the units of `x`. A check mark is sized to the field's width.
|
|
104
|
+
attr_accessor :width
|
|
105
|
+
|
|
106
|
+
# The field's height, in the units of `x`. The template editor keeps check marks, QR codes, and square and circle shapes square, with `height` equal to `width`.
|
|
107
|
+
attr_accessor :height
|
|
108
|
+
|
|
109
|
+
# Rotates the field clockwise by this many degrees, from -360 to 360 (negative turns it counterclockwise).
|
|
110
|
+
attr_accessor :rotation
|
|
111
|
+
|
|
112
|
+
# How the value appears on the PDF: `text`, `check` (a check mark), `shape`, `qrcode`, `barcode`, or `image` (image, signature and initials fields). Check marks and shapes print only when the value meets the field's `condition`, and the field's `type` limits which display types it can use.
|
|
113
|
+
attr_accessor :display_type
|
|
114
|
+
|
|
115
|
+
# The opacity of the field's content and background, from 0 (invisible) to 1. QR codes and barcodes always print at full opacity.
|
|
116
|
+
attr_accessor :opacity
|
|
117
|
+
|
|
118
|
+
# Date fields only: how the date prints, as a strftime format such as `%m/%d/%Y`, or a calculation such as `@years_since`, `@years_until` or `@diff_years` (also months, weeks, days, hours, minutes and seconds), counted to when the PDF is generated. Empty uses the template's date format, or its date-time format with `include_time`.
|
|
119
|
+
attr_accessor :date_time_format
|
|
120
|
+
|
|
121
|
+
# Text display only: the font, one of `Helvetica`, `Arial`, `Calibri`, `Open Sans`, `Roboto`, `Lato`, `Poppins`, `Public Sans`, `Questrial`, `Times New Roman`, `Dancing Script`, `Lovtony Script`, or the monospace `Courier`, `Inconsolata`, `Menlo`, `Roboto Mono` and `Ubuntu Mono`. Empty uses the template's default typeface.
|
|
122
|
+
attr_accessor :typeface
|
|
123
|
+
|
|
124
|
+
# Text display only: the font size in points. Empty uses the template's default font size.
|
|
125
|
+
attr_accessor :font_size
|
|
126
|
+
|
|
127
|
+
# Text display only: extra space between characters, in points. Empty uses the template's default.
|
|
128
|
+
attr_accessor :character_spacing
|
|
129
|
+
|
|
130
|
+
# Text display only: prints the text in bold.
|
|
131
|
+
attr_accessor :bold
|
|
132
|
+
|
|
133
|
+
# Text display only: prints the text in capital letters.
|
|
134
|
+
attr_accessor :uppercase
|
|
135
|
+
|
|
136
|
+
# Text display only: draws a line through the text.
|
|
137
|
+
attr_accessor :strikethrough
|
|
138
|
+
|
|
139
|
+
# Text display only: keeps the spaces at the start of the text and of each line, so text can be lined up with spaces.
|
|
140
|
+
attr_accessor :keep_leading_spaces
|
|
141
|
+
|
|
142
|
+
# Text display only: what happens to text that doesn't fit the field. `shrink_to_fit` makes the font smaller, down to 5 points; `truncate` cuts the text off and returns the rest in the submission's `truncated_text`.
|
|
143
|
+
attr_accessor :overflow
|
|
144
|
+
|
|
145
|
+
# Text display only: wraps the text over as many lines as fit in the field's height instead of printing one line, and forms show a multi-line input.
|
|
146
|
+
attr_accessor :multiline
|
|
147
|
+
|
|
148
|
+
# Text display only, with `multiline`: spreads the text over exactly this many evenly spaced lines in the field's height (up to 300), to line up with lines printed on the form. Empty uses the font's normal line spacing.
|
|
149
|
+
attr_accessor :multiline_lines
|
|
150
|
+
|
|
151
|
+
# Text display only: the fewest characters the value can have, added to the template's data schema. Not used for date, address, country or number fields, or fields with an `option_list`.
|
|
152
|
+
attr_accessor :min_length
|
|
153
|
+
|
|
154
|
+
# Text display only: the most characters the value can have, added to the template's data schema; it also limits an `editable` field. Not used for date, address, country or number fields, or fields with an `option_list`.
|
|
155
|
+
attr_accessor :max_length
|
|
156
|
+
|
|
157
|
+
# Text display only, with a monospace `typeface` (`Courier`, `Inconsolata`, `Menlo`, `Roboto Mono` or `Ubuntu Mono`): adds the number of characters that fit in the field to the template's data schema as its maximum length.
|
|
158
|
+
attr_accessor :auto_calculate_max_length
|
|
159
|
+
|
|
160
|
+
# Text display only: the text color, as a hex code such as `444444`. Empty uses the template's default text color.
|
|
161
|
+
attr_accessor :color
|
|
162
|
+
|
|
163
|
+
# Text display only: the name of a data field whose value, a hex code such as `FF0000`, sets the text color for each submission. That field is added to the template's data schema, with `color` as its default.
|
|
164
|
+
attr_accessor :color_field_name
|
|
165
|
+
|
|
166
|
+
# Makes the `color_field_name` field required. When it isn't required and a submission leaves it out, `color` is used.
|
|
167
|
+
attr_accessor :color_field_required
|
|
168
|
+
|
|
169
|
+
# Text and check display only: a color that fills the field's area behind its content, as a hex code, to cover what the page shows there. Check fields print it even when unchecked; text fields print it only when they have a value.
|
|
170
|
+
attr_accessor :background_color
|
|
171
|
+
|
|
172
|
+
# Text and check display only: the name of a data field whose value, a hex code, sets the background color for each submission. That field is added to the template's data schema, with `background_color` as its default.
|
|
173
|
+
attr_accessor :background_color_field_name
|
|
174
|
+
|
|
175
|
+
# Makes the `background_color_field_name` field required. When it isn't required and a submission leaves it out, `background_color` is used.
|
|
176
|
+
attr_accessor :background_color_field_required
|
|
177
|
+
|
|
178
|
+
# Text display only: how the text is aligned across the field: `left`, `center`, `right` or `justify` (both edges of every line of multiline text except the last of each paragraph).
|
|
179
|
+
attr_accessor :alignment
|
|
180
|
+
|
|
181
|
+
# Text display only: how the text is aligned vertically in the field: `bottom`, `center` or `top`.
|
|
182
|
+
attr_accessor :v_alignment
|
|
183
|
+
|
|
184
|
+
# Text display only: splits the field into `comb_number_of_cells` boxes of equal width and prints one character, centered, in each.
|
|
185
|
+
attr_accessor :comb
|
|
186
|
+
|
|
187
|
+
# With `comb`: how many boxes the field has. The value's maximum length in the template's data schema is this plus `comb_value_offset`.
|
|
188
|
+
attr_accessor :comb_number_of_cells
|
|
189
|
+
|
|
190
|
+
# With `comb`: the position, from 0, of the first character of the value that this field prints. For an SSN printed in boxes of 3, 2 and 4 digits, three fields named `ssn` use offsets 0, 3 and 5.
|
|
191
|
+
attr_accessor :comb_value_offset
|
|
192
|
+
|
|
193
|
+
# Shape display only: `square`, `rectangle`, `circle`, `ellipse`, `triangle` or `polygon`. A square or circle uses the smaller of `width` and `height`.
|
|
194
|
+
attr_accessor :shape_type
|
|
195
|
+
|
|
196
|
+
# Shape display only, with `shape_type` `polygon`: the number of sides, 3 to 12.
|
|
197
|
+
attr_accessor :shape_sides
|
|
198
|
+
|
|
199
|
+
# Shape display only: the width of the shape's border, in points.
|
|
200
|
+
attr_accessor :shape_border_width
|
|
201
|
+
|
|
202
|
+
# Shape display only: the shape's border color, as a hex code. Null draws no border.
|
|
203
|
+
attr_accessor :shape_border_color
|
|
204
|
+
|
|
205
|
+
# Shape display only: the name of a data field whose value, a hex code, sets the border color for each submission. That field is added to the template's data schema, with `shape_border_color` as its default.
|
|
206
|
+
attr_accessor :shape_border_color_field_name
|
|
207
|
+
|
|
208
|
+
# Makes the `shape_border_color_field_name` field required. When it isn't required and a submission leaves it out, `shape_border_color` is used.
|
|
209
|
+
attr_accessor :shape_border_color_field_required
|
|
210
|
+
|
|
211
|
+
# Shape display only: the color that fills the shape, as a hex code. Null leaves it unfilled.
|
|
212
|
+
attr_accessor :shape_fill_color
|
|
213
|
+
|
|
214
|
+
# Shape display only: the name of a data field whose value, a hex code, sets the fill color for each submission. That field is added to the template's data schema, with `shape_fill_color` as its default.
|
|
215
|
+
attr_accessor :shape_fill_color_field_name
|
|
216
|
+
|
|
217
|
+
# Makes the `shape_fill_color_field_name` field required. When it isn't required and a submission leaves it out, `shape_fill_color` is used.
|
|
218
|
+
attr_accessor :shape_fill_color_field_required
|
|
219
|
+
|
|
220
|
+
# Check display only: the character printed, as an HTML entity: `✓` (✓), `✔` (✔, the default), `✖` (✖), `✗` (✗) or `✘` (✘).
|
|
221
|
+
attr_accessor :check_character
|
|
222
|
+
|
|
223
|
+
# Check display only: the check mark's color, as a hex code. Empty uses the template's default check color.
|
|
224
|
+
attr_accessor :check_color
|
|
225
|
+
|
|
226
|
+
# Check display only: the name of a data field whose value, a hex code, sets the check mark's color for each submission. That field is added to the template's data schema, with `check_color` as its default.
|
|
227
|
+
attr_accessor :check_color_field_name
|
|
228
|
+
|
|
229
|
+
# Makes the `check_color_field_name` field required. When it isn't required and a submission leaves it out, `check_color` is used.
|
|
230
|
+
attr_accessor :check_color_field_required
|
|
231
|
+
|
|
232
|
+
# QR code display only: the QR code's color, as a hex code, printed on a white background. Empty prints it in black.
|
|
233
|
+
attr_accessor :qrcode_color
|
|
234
|
+
|
|
235
|
+
# QR code display only: the name of a data field whose value, a hex code, sets the QR code's color for each submission. That field is added to the template's data schema, with `qrcode_color` as its default.
|
|
236
|
+
attr_accessor :qrcode_color_field_name
|
|
237
|
+
|
|
238
|
+
# Makes the `qrcode_color_field_name` field required. When it isn't required and a submission leaves it out, `qrcode_color` is used.
|
|
239
|
+
attr_accessor :qrcode_color_field_required
|
|
240
|
+
|
|
241
|
+
# Boolean fields with text display: the text printed when the value is `true`. Empty uses the template's `true_text`; when neither is set, nothing prints.
|
|
242
|
+
attr_accessor :true_text
|
|
243
|
+
|
|
244
|
+
# Boolean fields with text display: the text printed when the value is `false`. Empty uses the template's `false_text`; when neither is set, nothing prints.
|
|
245
|
+
attr_accessor :false_text
|
|
246
|
+
|
|
247
|
+
# Check and shape display only: the value a string or number field's value is compared with, by `string_condition_type` or `number_condition_type`, to decide whether the check mark or shape prints. Boolean fields print when `true` (see `invert_boolean_condition`), and other types print when they have a value.
|
|
248
|
+
attr_accessor :condition
|
|
249
|
+
|
|
250
|
+
# String fields with check or shape display: how the value is compared with `condition`: `equals`, `contains`, `starts_with`, `ends_with`, or `regex`, where `condition` is a regular expression the value must match.
|
|
251
|
+
attr_accessor :string_condition_type
|
|
252
|
+
|
|
253
|
+
# Number fields with check or shape display: how the value is compared with `condition`: `equals`, `gt` (greater than), `gte` (greater than or equal to), `lt` (less than), `lte` (less than or equal to), or `range`, between `number_condition_range_min` and `number_condition_range_max`.
|
|
254
|
+
attr_accessor :number_condition_type
|
|
255
|
+
|
|
256
|
+
# With `number_condition_type` `range`: the lower end of the range, included unless `number_condition_range_exclusive_min` is set.
|
|
257
|
+
attr_accessor :number_condition_range_min
|
|
258
|
+
|
|
259
|
+
# With `number_condition_type` `range`: the upper end of the range, included unless `number_condition_range_exclusive_max` is set.
|
|
260
|
+
attr_accessor :number_condition_range_max
|
|
261
|
+
|
|
262
|
+
# With `number_condition_type` `range`: leaves `number_condition_range_min` itself out of the range.
|
|
263
|
+
attr_accessor :number_condition_range_exclusive_min
|
|
264
|
+
|
|
265
|
+
# With `number_condition_type` `range`: leaves `number_condition_range_max` itself out of the range.
|
|
266
|
+
attr_accessor :number_condition_range_exclusive_max
|
|
267
|
+
|
|
268
|
+
# Boolean fields with check or shape display: prints the check mark or shape when the value is `false` or missing, instead of `true`.
|
|
269
|
+
attr_accessor :invert_boolean_condition
|
|
270
|
+
|
|
271
|
+
# Number fields only: forms show a currency input, and the template's data schema gives the field `format: currency`. It doesn't change how the number prints.
|
|
272
|
+
attr_accessor :currency
|
|
273
|
+
|
|
274
|
+
# Number fields with text display: prints the number with this many decimal places, from 0 (rounds to a whole number) to 99. Empty prints the number as it was sent.
|
|
275
|
+
attr_accessor :decimal_places
|
|
276
|
+
|
|
277
|
+
# Image fields only: how the image is resized to the field. `fit` keeps its proportions and fits it inside the field, which can leave empty space; `fill` keeps its proportions and crops it to fill the field; `stretch` stretches it to the field's size. Signatures and initials always fit.
|
|
278
|
+
attr_accessor :image_scale_type
|
|
279
|
+
|
|
280
|
+
# Image, signature and initials fields: where the image sits in the field with `fit`, or which part is kept with `fill`: `NorthWest` (top left), `North`, `NorthEast`, `West`, `Center`, `East`, `SouthWest`, `South` or `SouthEast` (bottom right). It also aligns typed signatures, and isn't used with `stretch`.
|
|
281
|
+
attr_accessor :image_gravity
|
|
282
|
+
|
|
283
|
+
# The field's own conditional logic rule: when other fields' values meet its conditions, the field is shown, made required, or both. Null when it has none. The template's rules (`field_dependencies`) can apply to the field too. Shared by every field with the same `name`.
|
|
284
|
+
attr_accessor :dependencies
|
|
285
|
+
|
|
286
|
+
# The field's ID. Required when updating a field. When adding one, leave it out for the next free ID.
|
|
287
|
+
attr_accessor :id
|
|
288
|
+
|
|
289
|
+
class EnumAttributeValidator
|
|
290
|
+
attr_reader :datatype
|
|
291
|
+
attr_reader :allowable_values
|
|
292
|
+
|
|
293
|
+
def initialize(datatype, allowable_values)
|
|
294
|
+
@allowable_values = allowable_values.map do |value|
|
|
295
|
+
case datatype.to_s
|
|
296
|
+
when /Integer/i
|
|
297
|
+
value.to_i
|
|
298
|
+
when /Float/i
|
|
299
|
+
value.to_f
|
|
300
|
+
else
|
|
301
|
+
value
|
|
302
|
+
end
|
|
303
|
+
end
|
|
304
|
+
end
|
|
305
|
+
|
|
306
|
+
def valid?(value)
|
|
307
|
+
!value || allowable_values.include?(value)
|
|
308
|
+
end
|
|
309
|
+
end
|
|
310
|
+
|
|
311
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
312
|
+
def self.attribute_map
|
|
313
|
+
{
|
|
314
|
+
:'name' => :'name',
|
|
315
|
+
:'page' => :'page',
|
|
316
|
+
:'type' => :'type',
|
|
317
|
+
:'static' => :'static',
|
|
318
|
+
:'editable' => :'editable',
|
|
319
|
+
:'default' => :'default',
|
|
320
|
+
:'title' => :'title',
|
|
321
|
+
:'description' => :'description',
|
|
322
|
+
:'placeholder' => :'placeholder',
|
|
323
|
+
:'metadata' => :'metadata',
|
|
324
|
+
:'required' => :'required',
|
|
325
|
+
:'option_list' => :'option_list',
|
|
326
|
+
:'combined_field_names' => :'combined_field_names',
|
|
327
|
+
:'combined_field_type' => :'combined_field_type',
|
|
328
|
+
:'combined_field_separator' => :'combined_field_separator',
|
|
329
|
+
:'combined_field_format' => :'combined_field_format',
|
|
330
|
+
:'integer' => :'integer',
|
|
331
|
+
:'minimum' => :'minimum',
|
|
332
|
+
:'maximum' => :'maximum',
|
|
333
|
+
:'exclusive_minimum' => :'exclusive_minimum',
|
|
334
|
+
:'exclusive_maximum' => :'exclusive_maximum',
|
|
335
|
+
:'include_time' => :'include_time',
|
|
336
|
+
:'signature_allow_draw' => :'signature_allow_draw',
|
|
337
|
+
:'signature_allow_type' => :'signature_allow_type',
|
|
338
|
+
:'barcode_symbology' => :'barcode_symbology',
|
|
339
|
+
:'hidden' => :'hidden',
|
|
340
|
+
:'x' => :'x',
|
|
341
|
+
:'y' => :'y',
|
|
342
|
+
:'width' => :'width',
|
|
343
|
+
:'height' => :'height',
|
|
344
|
+
:'rotation' => :'rotation',
|
|
345
|
+
:'display_type' => :'display_type',
|
|
346
|
+
:'opacity' => :'opacity',
|
|
347
|
+
:'date_time_format' => :'date_time_format',
|
|
348
|
+
:'typeface' => :'typeface',
|
|
349
|
+
:'font_size' => :'font_size',
|
|
350
|
+
:'character_spacing' => :'character_spacing',
|
|
351
|
+
:'bold' => :'bold',
|
|
352
|
+
:'uppercase' => :'uppercase',
|
|
353
|
+
:'strikethrough' => :'strikethrough',
|
|
354
|
+
:'keep_leading_spaces' => :'keep_leading_spaces',
|
|
355
|
+
:'overflow' => :'overflow',
|
|
356
|
+
:'multiline' => :'multiline',
|
|
357
|
+
:'multiline_lines' => :'multiline_lines',
|
|
358
|
+
:'min_length' => :'min_length',
|
|
359
|
+
:'max_length' => :'max_length',
|
|
360
|
+
:'auto_calculate_max_length' => :'auto_calculate_max_length',
|
|
361
|
+
:'color' => :'color',
|
|
362
|
+
:'color_field_name' => :'color_field_name',
|
|
363
|
+
:'color_field_required' => :'color_field_required',
|
|
364
|
+
:'background_color' => :'background_color',
|
|
365
|
+
:'background_color_field_name' => :'background_color_field_name',
|
|
366
|
+
:'background_color_field_required' => :'background_color_field_required',
|
|
367
|
+
:'alignment' => :'alignment',
|
|
368
|
+
:'v_alignment' => :'v_alignment',
|
|
369
|
+
:'comb' => :'comb',
|
|
370
|
+
:'comb_number_of_cells' => :'comb_number_of_cells',
|
|
371
|
+
:'comb_value_offset' => :'comb_value_offset',
|
|
372
|
+
:'shape_type' => :'shape_type',
|
|
373
|
+
:'shape_sides' => :'shape_sides',
|
|
374
|
+
:'shape_border_width' => :'shape_border_width',
|
|
375
|
+
:'shape_border_color' => :'shape_border_color',
|
|
376
|
+
:'shape_border_color_field_name' => :'shape_border_color_field_name',
|
|
377
|
+
:'shape_border_color_field_required' => :'shape_border_color_field_required',
|
|
378
|
+
:'shape_fill_color' => :'shape_fill_color',
|
|
379
|
+
:'shape_fill_color_field_name' => :'shape_fill_color_field_name',
|
|
380
|
+
:'shape_fill_color_field_required' => :'shape_fill_color_field_required',
|
|
381
|
+
:'check_character' => :'check_character',
|
|
382
|
+
:'check_color' => :'check_color',
|
|
383
|
+
:'check_color_field_name' => :'check_color_field_name',
|
|
384
|
+
:'check_color_field_required' => :'check_color_field_required',
|
|
385
|
+
:'qrcode_color' => :'qrcode_color',
|
|
386
|
+
:'qrcode_color_field_name' => :'qrcode_color_field_name',
|
|
387
|
+
:'qrcode_color_field_required' => :'qrcode_color_field_required',
|
|
388
|
+
:'true_text' => :'true_text',
|
|
389
|
+
:'false_text' => :'false_text',
|
|
390
|
+
:'condition' => :'condition',
|
|
391
|
+
:'string_condition_type' => :'string_condition_type',
|
|
392
|
+
:'number_condition_type' => :'number_condition_type',
|
|
393
|
+
:'number_condition_range_min' => :'number_condition_range_min',
|
|
394
|
+
:'number_condition_range_max' => :'number_condition_range_max',
|
|
395
|
+
:'number_condition_range_exclusive_min' => :'number_condition_range_exclusive_min',
|
|
396
|
+
:'number_condition_range_exclusive_max' => :'number_condition_range_exclusive_max',
|
|
397
|
+
:'invert_boolean_condition' => :'invert_boolean_condition',
|
|
398
|
+
:'currency' => :'currency',
|
|
399
|
+
:'decimal_places' => :'decimal_places',
|
|
400
|
+
:'image_scale_type' => :'image_scale_type',
|
|
401
|
+
:'image_gravity' => :'image_gravity',
|
|
402
|
+
:'dependencies' => :'dependencies',
|
|
403
|
+
:'id' => :'id'
|
|
404
|
+
}
|
|
405
|
+
end
|
|
406
|
+
|
|
407
|
+
# Returns attribute mapping this model knows about
|
|
408
|
+
def self.acceptable_attribute_map
|
|
409
|
+
attribute_map
|
|
410
|
+
end
|
|
411
|
+
|
|
412
|
+
# Returns all the JSON keys this model knows about
|
|
413
|
+
def self.acceptable_attributes
|
|
414
|
+
acceptable_attribute_map.values
|
|
415
|
+
end
|
|
416
|
+
|
|
417
|
+
# Attribute type mapping.
|
|
418
|
+
def self.openapi_types
|
|
419
|
+
{
|
|
420
|
+
:'name' => :'String',
|
|
421
|
+
:'page' => :'Integer',
|
|
422
|
+
:'type' => :'FieldType',
|
|
423
|
+
:'static' => :'Boolean',
|
|
424
|
+
:'editable' => :'Boolean',
|
|
425
|
+
:'default' => :'String',
|
|
426
|
+
:'title' => :'String',
|
|
427
|
+
:'description' => :'String',
|
|
428
|
+
:'placeholder' => :'String',
|
|
429
|
+
:'metadata' => :'String',
|
|
430
|
+
:'required' => :'Boolean',
|
|
431
|
+
:'option_list' => :'String',
|
|
432
|
+
:'combined_field_names' => :'String',
|
|
433
|
+
:'combined_field_type' => :'CombinedFieldType',
|
|
434
|
+
:'combined_field_separator' => :'String',
|
|
435
|
+
:'combined_field_format' => :'String',
|
|
436
|
+
:'integer' => :'Boolean',
|
|
437
|
+
:'minimum' => :'Float',
|
|
438
|
+
:'maximum' => :'Float',
|
|
439
|
+
:'exclusive_minimum' => :'Boolean',
|
|
440
|
+
:'exclusive_maximum' => :'Boolean',
|
|
441
|
+
:'include_time' => :'Boolean',
|
|
442
|
+
:'signature_allow_draw' => :'Boolean',
|
|
443
|
+
:'signature_allow_type' => :'Boolean',
|
|
444
|
+
:'barcode_symbology' => :'BarcodeSymbology',
|
|
445
|
+
:'hidden' => :'Boolean',
|
|
446
|
+
:'x' => :'Float',
|
|
447
|
+
:'y' => :'Float',
|
|
448
|
+
:'width' => :'Float',
|
|
449
|
+
:'height' => :'Float',
|
|
450
|
+
:'rotation' => :'Float',
|
|
451
|
+
:'display_type' => :'FieldDisplayType',
|
|
452
|
+
:'opacity' => :'Float',
|
|
453
|
+
:'date_time_format' => :'String',
|
|
454
|
+
:'typeface' => :'Typeface',
|
|
455
|
+
:'font_size' => :'Integer',
|
|
456
|
+
:'character_spacing' => :'Float',
|
|
457
|
+
:'bold' => :'Boolean',
|
|
458
|
+
:'uppercase' => :'Boolean',
|
|
459
|
+
:'strikethrough' => :'Boolean',
|
|
460
|
+
:'keep_leading_spaces' => :'Boolean',
|
|
461
|
+
:'overflow' => :'TextOverflow',
|
|
462
|
+
:'multiline' => :'Boolean',
|
|
463
|
+
:'multiline_lines' => :'Integer',
|
|
464
|
+
:'min_length' => :'Float',
|
|
465
|
+
:'max_length' => :'Integer',
|
|
466
|
+
:'auto_calculate_max_length' => :'Boolean',
|
|
467
|
+
:'color' => :'String',
|
|
468
|
+
:'color_field_name' => :'String',
|
|
469
|
+
:'color_field_required' => :'Boolean',
|
|
470
|
+
:'background_color' => :'String',
|
|
471
|
+
:'background_color_field_name' => :'String',
|
|
472
|
+
:'background_color_field_required' => :'Boolean',
|
|
473
|
+
:'alignment' => :'TextAlignment',
|
|
474
|
+
:'v_alignment' => :'TextVerticalAlignment',
|
|
475
|
+
:'comb' => :'Boolean',
|
|
476
|
+
:'comb_number_of_cells' => :'Integer',
|
|
477
|
+
:'comb_value_offset' => :'Integer',
|
|
478
|
+
:'shape_type' => :'ShapeType',
|
|
479
|
+
:'shape_sides' => :'Integer',
|
|
480
|
+
:'shape_border_width' => :'Integer',
|
|
481
|
+
:'shape_border_color' => :'String',
|
|
482
|
+
:'shape_border_color_field_name' => :'String',
|
|
483
|
+
:'shape_border_color_field_required' => :'Boolean',
|
|
484
|
+
:'shape_fill_color' => :'String',
|
|
485
|
+
:'shape_fill_color_field_name' => :'String',
|
|
486
|
+
:'shape_fill_color_field_required' => :'Boolean',
|
|
487
|
+
:'check_character' => :'CheckCharacter',
|
|
488
|
+
:'check_color' => :'String',
|
|
489
|
+
:'check_color_field_name' => :'String',
|
|
490
|
+
:'check_color_field_required' => :'Boolean',
|
|
491
|
+
:'qrcode_color' => :'String',
|
|
492
|
+
:'qrcode_color_field_name' => :'String',
|
|
493
|
+
:'qrcode_color_field_required' => :'Boolean',
|
|
494
|
+
:'true_text' => :'String',
|
|
495
|
+
:'false_text' => :'String',
|
|
496
|
+
:'condition' => :'String',
|
|
497
|
+
:'string_condition_type' => :'StringConditionType',
|
|
498
|
+
:'number_condition_type' => :'NumberConditionType',
|
|
499
|
+
:'number_condition_range_min' => :'Float',
|
|
500
|
+
:'number_condition_range_max' => :'Float',
|
|
501
|
+
:'number_condition_range_exclusive_min' => :'Boolean',
|
|
502
|
+
:'number_condition_range_exclusive_max' => :'Boolean',
|
|
503
|
+
:'invert_boolean_condition' => :'Boolean',
|
|
504
|
+
:'currency' => :'Boolean',
|
|
505
|
+
:'decimal_places' => :'Integer',
|
|
506
|
+
:'image_scale_type' => :'ImageScaleType',
|
|
507
|
+
:'image_gravity' => :'ImageGravity',
|
|
508
|
+
:'dependencies' => :'FieldDependencyInput',
|
|
509
|
+
:'id' => :'Integer'
|
|
510
|
+
}
|
|
511
|
+
end
|
|
512
|
+
|
|
513
|
+
# List of attributes with nullable: true
|
|
514
|
+
def self.openapi_nullable
|
|
515
|
+
Set.new([
|
|
516
|
+
:'name',
|
|
517
|
+
:'default',
|
|
518
|
+
:'option_list',
|
|
519
|
+
:'minimum',
|
|
520
|
+
:'maximum',
|
|
521
|
+
:'include_time',
|
|
522
|
+
:'date_time_format',
|
|
523
|
+
:'typeface',
|
|
524
|
+
:'font_size',
|
|
525
|
+
:'multiline_lines',
|
|
526
|
+
:'max_length',
|
|
527
|
+
:'color',
|
|
528
|
+
:'color_field_name',
|
|
529
|
+
:'background_color',
|
|
530
|
+
:'background_color_field_name',
|
|
531
|
+
:'shape_border_color_field_name',
|
|
532
|
+
:'shape_fill_color',
|
|
533
|
+
:'shape_fill_color_field_name',
|
|
534
|
+
:'check_color',
|
|
535
|
+
:'check_color_field_name',
|
|
536
|
+
:'qrcode_color',
|
|
537
|
+
:'qrcode_color_field_name',
|
|
538
|
+
:'true_text',
|
|
539
|
+
:'false_text',
|
|
540
|
+
:'condition',
|
|
541
|
+
:'number_condition_range_min',
|
|
542
|
+
:'number_condition_range_max',
|
|
543
|
+
:'decimal_places',
|
|
544
|
+
:'dependencies',
|
|
545
|
+
])
|
|
546
|
+
end
|
|
547
|
+
|
|
548
|
+
# Returns attribute type mapping
|
|
549
|
+
def self.acceptable_openapi_types
|
|
550
|
+
openapi_types
|
|
551
|
+
end
|
|
552
|
+
|
|
553
|
+
# Returns the nullable attributes
|
|
554
|
+
def self.acceptable_openapi_nullable
|
|
555
|
+
openapi_nullable
|
|
556
|
+
end
|
|
557
|
+
|
|
558
|
+
# Initializes the object
|
|
559
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
560
|
+
def initialize(attributes = {})
|
|
561
|
+
if (!attributes.is_a?(Hash))
|
|
562
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `DocSpring::FieldInput` initialize method"
|
|
563
|
+
end
|
|
564
|
+
|
|
565
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
566
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
567
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
568
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
569
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `DocSpring::FieldInput`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
570
|
+
end
|
|
571
|
+
h[k.to_sym] = v
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
if attributes.key?(:'name')
|
|
575
|
+
self.name = attributes[:'name']
|
|
576
|
+
end
|
|
577
|
+
|
|
578
|
+
if attributes.key?(:'page')
|
|
579
|
+
self.page = attributes[:'page']
|
|
580
|
+
end
|
|
581
|
+
|
|
582
|
+
if attributes.key?(:'type')
|
|
583
|
+
self.type = attributes[:'type']
|
|
584
|
+
end
|
|
585
|
+
|
|
586
|
+
if attributes.key?(:'static')
|
|
587
|
+
self.static = attributes[:'static']
|
|
588
|
+
end
|
|
589
|
+
|
|
590
|
+
if attributes.key?(:'editable')
|
|
591
|
+
self.editable = attributes[:'editable']
|
|
592
|
+
end
|
|
593
|
+
|
|
594
|
+
if attributes.key?(:'default')
|
|
595
|
+
self.default = attributes[:'default']
|
|
596
|
+
end
|
|
597
|
+
|
|
598
|
+
if attributes.key?(:'title')
|
|
599
|
+
self.title = attributes[:'title']
|
|
600
|
+
end
|
|
601
|
+
|
|
602
|
+
if attributes.key?(:'description')
|
|
603
|
+
self.description = attributes[:'description']
|
|
604
|
+
end
|
|
605
|
+
|
|
606
|
+
if attributes.key?(:'placeholder')
|
|
607
|
+
self.placeholder = attributes[:'placeholder']
|
|
608
|
+
end
|
|
609
|
+
|
|
610
|
+
if attributes.key?(:'metadata')
|
|
611
|
+
self.metadata = attributes[:'metadata']
|
|
612
|
+
end
|
|
613
|
+
|
|
614
|
+
if attributes.key?(:'required')
|
|
615
|
+
self.required = attributes[:'required']
|
|
616
|
+
end
|
|
617
|
+
|
|
618
|
+
if attributes.key?(:'option_list')
|
|
619
|
+
self.option_list = attributes[:'option_list']
|
|
620
|
+
end
|
|
621
|
+
|
|
622
|
+
if attributes.key?(:'combined_field_names')
|
|
623
|
+
self.combined_field_names = attributes[:'combined_field_names']
|
|
624
|
+
end
|
|
625
|
+
|
|
626
|
+
if attributes.key?(:'combined_field_type')
|
|
627
|
+
self.combined_field_type = attributes[:'combined_field_type']
|
|
628
|
+
end
|
|
629
|
+
|
|
630
|
+
if attributes.key?(:'combined_field_separator')
|
|
631
|
+
self.combined_field_separator = attributes[:'combined_field_separator']
|
|
632
|
+
end
|
|
633
|
+
|
|
634
|
+
if attributes.key?(:'combined_field_format')
|
|
635
|
+
self.combined_field_format = attributes[:'combined_field_format']
|
|
636
|
+
end
|
|
637
|
+
|
|
638
|
+
if attributes.key?(:'integer')
|
|
639
|
+
self.integer = attributes[:'integer']
|
|
640
|
+
end
|
|
641
|
+
|
|
642
|
+
if attributes.key?(:'minimum')
|
|
643
|
+
self.minimum = attributes[:'minimum']
|
|
644
|
+
end
|
|
645
|
+
|
|
646
|
+
if attributes.key?(:'maximum')
|
|
647
|
+
self.maximum = attributes[:'maximum']
|
|
648
|
+
end
|
|
649
|
+
|
|
650
|
+
if attributes.key?(:'exclusive_minimum')
|
|
651
|
+
self.exclusive_minimum = attributes[:'exclusive_minimum']
|
|
652
|
+
end
|
|
653
|
+
|
|
654
|
+
if attributes.key?(:'exclusive_maximum')
|
|
655
|
+
self.exclusive_maximum = attributes[:'exclusive_maximum']
|
|
656
|
+
end
|
|
657
|
+
|
|
658
|
+
if attributes.key?(:'include_time')
|
|
659
|
+
self.include_time = attributes[:'include_time']
|
|
660
|
+
end
|
|
661
|
+
|
|
662
|
+
if attributes.key?(:'signature_allow_draw')
|
|
663
|
+
self.signature_allow_draw = attributes[:'signature_allow_draw']
|
|
664
|
+
end
|
|
665
|
+
|
|
666
|
+
if attributes.key?(:'signature_allow_type')
|
|
667
|
+
self.signature_allow_type = attributes[:'signature_allow_type']
|
|
668
|
+
end
|
|
669
|
+
|
|
670
|
+
if attributes.key?(:'barcode_symbology')
|
|
671
|
+
self.barcode_symbology = attributes[:'barcode_symbology']
|
|
672
|
+
end
|
|
673
|
+
|
|
674
|
+
if attributes.key?(:'hidden')
|
|
675
|
+
self.hidden = attributes[:'hidden']
|
|
676
|
+
end
|
|
677
|
+
|
|
678
|
+
if attributes.key?(:'x')
|
|
679
|
+
self.x = attributes[:'x']
|
|
680
|
+
end
|
|
681
|
+
|
|
682
|
+
if attributes.key?(:'y')
|
|
683
|
+
self.y = attributes[:'y']
|
|
684
|
+
end
|
|
685
|
+
|
|
686
|
+
if attributes.key?(:'width')
|
|
687
|
+
self.width = attributes[:'width']
|
|
688
|
+
end
|
|
689
|
+
|
|
690
|
+
if attributes.key?(:'height')
|
|
691
|
+
self.height = attributes[:'height']
|
|
692
|
+
end
|
|
693
|
+
|
|
694
|
+
if attributes.key?(:'rotation')
|
|
695
|
+
self.rotation = attributes[:'rotation']
|
|
696
|
+
end
|
|
697
|
+
|
|
698
|
+
if attributes.key?(:'display_type')
|
|
699
|
+
self.display_type = attributes[:'display_type']
|
|
700
|
+
end
|
|
701
|
+
|
|
702
|
+
if attributes.key?(:'opacity')
|
|
703
|
+
self.opacity = attributes[:'opacity']
|
|
704
|
+
end
|
|
705
|
+
|
|
706
|
+
if attributes.key?(:'date_time_format')
|
|
707
|
+
self.date_time_format = attributes[:'date_time_format']
|
|
708
|
+
end
|
|
709
|
+
|
|
710
|
+
if attributes.key?(:'typeface')
|
|
711
|
+
self.typeface = attributes[:'typeface']
|
|
712
|
+
end
|
|
713
|
+
|
|
714
|
+
if attributes.key?(:'font_size')
|
|
715
|
+
self.font_size = attributes[:'font_size']
|
|
716
|
+
end
|
|
717
|
+
|
|
718
|
+
if attributes.key?(:'character_spacing')
|
|
719
|
+
self.character_spacing = attributes[:'character_spacing']
|
|
720
|
+
end
|
|
721
|
+
|
|
722
|
+
if attributes.key?(:'bold')
|
|
723
|
+
self.bold = attributes[:'bold']
|
|
724
|
+
end
|
|
725
|
+
|
|
726
|
+
if attributes.key?(:'uppercase')
|
|
727
|
+
self.uppercase = attributes[:'uppercase']
|
|
728
|
+
end
|
|
729
|
+
|
|
730
|
+
if attributes.key?(:'strikethrough')
|
|
731
|
+
self.strikethrough = attributes[:'strikethrough']
|
|
732
|
+
end
|
|
733
|
+
|
|
734
|
+
if attributes.key?(:'keep_leading_spaces')
|
|
735
|
+
self.keep_leading_spaces = attributes[:'keep_leading_spaces']
|
|
736
|
+
end
|
|
737
|
+
|
|
738
|
+
if attributes.key?(:'overflow')
|
|
739
|
+
self.overflow = attributes[:'overflow']
|
|
740
|
+
end
|
|
741
|
+
|
|
742
|
+
if attributes.key?(:'multiline')
|
|
743
|
+
self.multiline = attributes[:'multiline']
|
|
744
|
+
end
|
|
745
|
+
|
|
746
|
+
if attributes.key?(:'multiline_lines')
|
|
747
|
+
self.multiline_lines = attributes[:'multiline_lines']
|
|
748
|
+
end
|
|
749
|
+
|
|
750
|
+
if attributes.key?(:'min_length')
|
|
751
|
+
self.min_length = attributes[:'min_length']
|
|
752
|
+
end
|
|
753
|
+
|
|
754
|
+
if attributes.key?(:'max_length')
|
|
755
|
+
self.max_length = attributes[:'max_length']
|
|
756
|
+
end
|
|
757
|
+
|
|
758
|
+
if attributes.key?(:'auto_calculate_max_length')
|
|
759
|
+
self.auto_calculate_max_length = attributes[:'auto_calculate_max_length']
|
|
760
|
+
end
|
|
761
|
+
|
|
762
|
+
if attributes.key?(:'color')
|
|
763
|
+
self.color = attributes[:'color']
|
|
764
|
+
end
|
|
765
|
+
|
|
766
|
+
if attributes.key?(:'color_field_name')
|
|
767
|
+
self.color_field_name = attributes[:'color_field_name']
|
|
768
|
+
end
|
|
769
|
+
|
|
770
|
+
if attributes.key?(:'color_field_required')
|
|
771
|
+
self.color_field_required = attributes[:'color_field_required']
|
|
772
|
+
end
|
|
773
|
+
|
|
774
|
+
if attributes.key?(:'background_color')
|
|
775
|
+
self.background_color = attributes[:'background_color']
|
|
776
|
+
end
|
|
777
|
+
|
|
778
|
+
if attributes.key?(:'background_color_field_name')
|
|
779
|
+
self.background_color_field_name = attributes[:'background_color_field_name']
|
|
780
|
+
end
|
|
781
|
+
|
|
782
|
+
if attributes.key?(:'background_color_field_required')
|
|
783
|
+
self.background_color_field_required = attributes[:'background_color_field_required']
|
|
784
|
+
end
|
|
785
|
+
|
|
786
|
+
if attributes.key?(:'alignment')
|
|
787
|
+
self.alignment = attributes[:'alignment']
|
|
788
|
+
end
|
|
789
|
+
|
|
790
|
+
if attributes.key?(:'v_alignment')
|
|
791
|
+
self.v_alignment = attributes[:'v_alignment']
|
|
792
|
+
end
|
|
793
|
+
|
|
794
|
+
if attributes.key?(:'comb')
|
|
795
|
+
self.comb = attributes[:'comb']
|
|
796
|
+
end
|
|
797
|
+
|
|
798
|
+
if attributes.key?(:'comb_number_of_cells')
|
|
799
|
+
self.comb_number_of_cells = attributes[:'comb_number_of_cells']
|
|
800
|
+
end
|
|
801
|
+
|
|
802
|
+
if attributes.key?(:'comb_value_offset')
|
|
803
|
+
self.comb_value_offset = attributes[:'comb_value_offset']
|
|
804
|
+
end
|
|
805
|
+
|
|
806
|
+
if attributes.key?(:'shape_type')
|
|
807
|
+
self.shape_type = attributes[:'shape_type']
|
|
808
|
+
end
|
|
809
|
+
|
|
810
|
+
if attributes.key?(:'shape_sides')
|
|
811
|
+
self.shape_sides = attributes[:'shape_sides']
|
|
812
|
+
end
|
|
813
|
+
|
|
814
|
+
if attributes.key?(:'shape_border_width')
|
|
815
|
+
self.shape_border_width = attributes[:'shape_border_width']
|
|
816
|
+
end
|
|
817
|
+
|
|
818
|
+
if attributes.key?(:'shape_border_color')
|
|
819
|
+
self.shape_border_color = attributes[:'shape_border_color']
|
|
820
|
+
end
|
|
821
|
+
|
|
822
|
+
if attributes.key?(:'shape_border_color_field_name')
|
|
823
|
+
self.shape_border_color_field_name = attributes[:'shape_border_color_field_name']
|
|
824
|
+
end
|
|
825
|
+
|
|
826
|
+
if attributes.key?(:'shape_border_color_field_required')
|
|
827
|
+
self.shape_border_color_field_required = attributes[:'shape_border_color_field_required']
|
|
828
|
+
end
|
|
829
|
+
|
|
830
|
+
if attributes.key?(:'shape_fill_color')
|
|
831
|
+
self.shape_fill_color = attributes[:'shape_fill_color']
|
|
832
|
+
end
|
|
833
|
+
|
|
834
|
+
if attributes.key?(:'shape_fill_color_field_name')
|
|
835
|
+
self.shape_fill_color_field_name = attributes[:'shape_fill_color_field_name']
|
|
836
|
+
end
|
|
837
|
+
|
|
838
|
+
if attributes.key?(:'shape_fill_color_field_required')
|
|
839
|
+
self.shape_fill_color_field_required = attributes[:'shape_fill_color_field_required']
|
|
840
|
+
end
|
|
841
|
+
|
|
842
|
+
if attributes.key?(:'check_character')
|
|
843
|
+
self.check_character = attributes[:'check_character']
|
|
844
|
+
end
|
|
845
|
+
|
|
846
|
+
if attributes.key?(:'check_color')
|
|
847
|
+
self.check_color = attributes[:'check_color']
|
|
848
|
+
end
|
|
849
|
+
|
|
850
|
+
if attributes.key?(:'check_color_field_name')
|
|
851
|
+
self.check_color_field_name = attributes[:'check_color_field_name']
|
|
852
|
+
end
|
|
853
|
+
|
|
854
|
+
if attributes.key?(:'check_color_field_required')
|
|
855
|
+
self.check_color_field_required = attributes[:'check_color_field_required']
|
|
856
|
+
end
|
|
857
|
+
|
|
858
|
+
if attributes.key?(:'qrcode_color')
|
|
859
|
+
self.qrcode_color = attributes[:'qrcode_color']
|
|
860
|
+
end
|
|
861
|
+
|
|
862
|
+
if attributes.key?(:'qrcode_color_field_name')
|
|
863
|
+
self.qrcode_color_field_name = attributes[:'qrcode_color_field_name']
|
|
864
|
+
end
|
|
865
|
+
|
|
866
|
+
if attributes.key?(:'qrcode_color_field_required')
|
|
867
|
+
self.qrcode_color_field_required = attributes[:'qrcode_color_field_required']
|
|
868
|
+
end
|
|
869
|
+
|
|
870
|
+
if attributes.key?(:'true_text')
|
|
871
|
+
self.true_text = attributes[:'true_text']
|
|
872
|
+
end
|
|
873
|
+
|
|
874
|
+
if attributes.key?(:'false_text')
|
|
875
|
+
self.false_text = attributes[:'false_text']
|
|
876
|
+
end
|
|
877
|
+
|
|
878
|
+
if attributes.key?(:'condition')
|
|
879
|
+
self.condition = attributes[:'condition']
|
|
880
|
+
end
|
|
881
|
+
|
|
882
|
+
if attributes.key?(:'string_condition_type')
|
|
883
|
+
self.string_condition_type = attributes[:'string_condition_type']
|
|
884
|
+
end
|
|
885
|
+
|
|
886
|
+
if attributes.key?(:'number_condition_type')
|
|
887
|
+
self.number_condition_type = attributes[:'number_condition_type']
|
|
888
|
+
end
|
|
889
|
+
|
|
890
|
+
if attributes.key?(:'number_condition_range_min')
|
|
891
|
+
self.number_condition_range_min = attributes[:'number_condition_range_min']
|
|
892
|
+
end
|
|
893
|
+
|
|
894
|
+
if attributes.key?(:'number_condition_range_max')
|
|
895
|
+
self.number_condition_range_max = attributes[:'number_condition_range_max']
|
|
896
|
+
end
|
|
897
|
+
|
|
898
|
+
if attributes.key?(:'number_condition_range_exclusive_min')
|
|
899
|
+
self.number_condition_range_exclusive_min = attributes[:'number_condition_range_exclusive_min']
|
|
900
|
+
end
|
|
901
|
+
|
|
902
|
+
if attributes.key?(:'number_condition_range_exclusive_max')
|
|
903
|
+
self.number_condition_range_exclusive_max = attributes[:'number_condition_range_exclusive_max']
|
|
904
|
+
end
|
|
905
|
+
|
|
906
|
+
if attributes.key?(:'invert_boolean_condition')
|
|
907
|
+
self.invert_boolean_condition = attributes[:'invert_boolean_condition']
|
|
908
|
+
end
|
|
909
|
+
|
|
910
|
+
if attributes.key?(:'currency')
|
|
911
|
+
self.currency = attributes[:'currency']
|
|
912
|
+
end
|
|
913
|
+
|
|
914
|
+
if attributes.key?(:'decimal_places')
|
|
915
|
+
self.decimal_places = attributes[:'decimal_places']
|
|
916
|
+
end
|
|
917
|
+
|
|
918
|
+
if attributes.key?(:'image_scale_type')
|
|
919
|
+
self.image_scale_type = attributes[:'image_scale_type']
|
|
920
|
+
end
|
|
921
|
+
|
|
922
|
+
if attributes.key?(:'image_gravity')
|
|
923
|
+
self.image_gravity = attributes[:'image_gravity']
|
|
924
|
+
end
|
|
925
|
+
|
|
926
|
+
if attributes.key?(:'dependencies')
|
|
927
|
+
self.dependencies = attributes[:'dependencies']
|
|
928
|
+
end
|
|
929
|
+
|
|
930
|
+
if attributes.key?(:'id')
|
|
931
|
+
self.id = attributes[:'id']
|
|
932
|
+
end
|
|
933
|
+
end
|
|
934
|
+
|
|
935
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
936
|
+
# @return Array for valid properties with the reasons
|
|
937
|
+
def list_invalid_properties
|
|
938
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
939
|
+
invalid_properties = Array.new
|
|
940
|
+
invalid_properties
|
|
941
|
+
end
|
|
942
|
+
|
|
943
|
+
# Check to see if the all the properties in the model are valid
|
|
944
|
+
# @return true if the model is valid
|
|
945
|
+
def valid?
|
|
946
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
947
|
+
true
|
|
948
|
+
end
|
|
949
|
+
|
|
950
|
+
# Checks equality by comparing each attribute.
|
|
951
|
+
# @param [Object] Object to be compared
|
|
952
|
+
def ==(o)
|
|
953
|
+
return true if self.equal?(o)
|
|
954
|
+
self.class == o.class &&
|
|
955
|
+
name == o.name &&
|
|
956
|
+
page == o.page &&
|
|
957
|
+
type == o.type &&
|
|
958
|
+
static == o.static &&
|
|
959
|
+
editable == o.editable &&
|
|
960
|
+
default == o.default &&
|
|
961
|
+
title == o.title &&
|
|
962
|
+
description == o.description &&
|
|
963
|
+
placeholder == o.placeholder &&
|
|
964
|
+
metadata == o.metadata &&
|
|
965
|
+
required == o.required &&
|
|
966
|
+
option_list == o.option_list &&
|
|
967
|
+
combined_field_names == o.combined_field_names &&
|
|
968
|
+
combined_field_type == o.combined_field_type &&
|
|
969
|
+
combined_field_separator == o.combined_field_separator &&
|
|
970
|
+
combined_field_format == o.combined_field_format &&
|
|
971
|
+
integer == o.integer &&
|
|
972
|
+
minimum == o.minimum &&
|
|
973
|
+
maximum == o.maximum &&
|
|
974
|
+
exclusive_minimum == o.exclusive_minimum &&
|
|
975
|
+
exclusive_maximum == o.exclusive_maximum &&
|
|
976
|
+
include_time == o.include_time &&
|
|
977
|
+
signature_allow_draw == o.signature_allow_draw &&
|
|
978
|
+
signature_allow_type == o.signature_allow_type &&
|
|
979
|
+
barcode_symbology == o.barcode_symbology &&
|
|
980
|
+
hidden == o.hidden &&
|
|
981
|
+
x == o.x &&
|
|
982
|
+
y == o.y &&
|
|
983
|
+
width == o.width &&
|
|
984
|
+
height == o.height &&
|
|
985
|
+
rotation == o.rotation &&
|
|
986
|
+
display_type == o.display_type &&
|
|
987
|
+
opacity == o.opacity &&
|
|
988
|
+
date_time_format == o.date_time_format &&
|
|
989
|
+
typeface == o.typeface &&
|
|
990
|
+
font_size == o.font_size &&
|
|
991
|
+
character_spacing == o.character_spacing &&
|
|
992
|
+
bold == o.bold &&
|
|
993
|
+
uppercase == o.uppercase &&
|
|
994
|
+
strikethrough == o.strikethrough &&
|
|
995
|
+
keep_leading_spaces == o.keep_leading_spaces &&
|
|
996
|
+
overflow == o.overflow &&
|
|
997
|
+
multiline == o.multiline &&
|
|
998
|
+
multiline_lines == o.multiline_lines &&
|
|
999
|
+
min_length == o.min_length &&
|
|
1000
|
+
max_length == o.max_length &&
|
|
1001
|
+
auto_calculate_max_length == o.auto_calculate_max_length &&
|
|
1002
|
+
color == o.color &&
|
|
1003
|
+
color_field_name == o.color_field_name &&
|
|
1004
|
+
color_field_required == o.color_field_required &&
|
|
1005
|
+
background_color == o.background_color &&
|
|
1006
|
+
background_color_field_name == o.background_color_field_name &&
|
|
1007
|
+
background_color_field_required == o.background_color_field_required &&
|
|
1008
|
+
alignment == o.alignment &&
|
|
1009
|
+
v_alignment == o.v_alignment &&
|
|
1010
|
+
comb == o.comb &&
|
|
1011
|
+
comb_number_of_cells == o.comb_number_of_cells &&
|
|
1012
|
+
comb_value_offset == o.comb_value_offset &&
|
|
1013
|
+
shape_type == o.shape_type &&
|
|
1014
|
+
shape_sides == o.shape_sides &&
|
|
1015
|
+
shape_border_width == o.shape_border_width &&
|
|
1016
|
+
shape_border_color == o.shape_border_color &&
|
|
1017
|
+
shape_border_color_field_name == o.shape_border_color_field_name &&
|
|
1018
|
+
shape_border_color_field_required == o.shape_border_color_field_required &&
|
|
1019
|
+
shape_fill_color == o.shape_fill_color &&
|
|
1020
|
+
shape_fill_color_field_name == o.shape_fill_color_field_name &&
|
|
1021
|
+
shape_fill_color_field_required == o.shape_fill_color_field_required &&
|
|
1022
|
+
check_character == o.check_character &&
|
|
1023
|
+
check_color == o.check_color &&
|
|
1024
|
+
check_color_field_name == o.check_color_field_name &&
|
|
1025
|
+
check_color_field_required == o.check_color_field_required &&
|
|
1026
|
+
qrcode_color == o.qrcode_color &&
|
|
1027
|
+
qrcode_color_field_name == o.qrcode_color_field_name &&
|
|
1028
|
+
qrcode_color_field_required == o.qrcode_color_field_required &&
|
|
1029
|
+
true_text == o.true_text &&
|
|
1030
|
+
false_text == o.false_text &&
|
|
1031
|
+
condition == o.condition &&
|
|
1032
|
+
string_condition_type == o.string_condition_type &&
|
|
1033
|
+
number_condition_type == o.number_condition_type &&
|
|
1034
|
+
number_condition_range_min == o.number_condition_range_min &&
|
|
1035
|
+
number_condition_range_max == o.number_condition_range_max &&
|
|
1036
|
+
number_condition_range_exclusive_min == o.number_condition_range_exclusive_min &&
|
|
1037
|
+
number_condition_range_exclusive_max == o.number_condition_range_exclusive_max &&
|
|
1038
|
+
invert_boolean_condition == o.invert_boolean_condition &&
|
|
1039
|
+
currency == o.currency &&
|
|
1040
|
+
decimal_places == o.decimal_places &&
|
|
1041
|
+
image_scale_type == o.image_scale_type &&
|
|
1042
|
+
image_gravity == o.image_gravity &&
|
|
1043
|
+
dependencies == o.dependencies &&
|
|
1044
|
+
id == o.id
|
|
1045
|
+
end
|
|
1046
|
+
|
|
1047
|
+
# @see the `==` method
|
|
1048
|
+
# @param [Object] Object to be compared
|
|
1049
|
+
def eql?(o)
|
|
1050
|
+
self == o
|
|
1051
|
+
end
|
|
1052
|
+
|
|
1053
|
+
# Calculates hash code according to all attributes.
|
|
1054
|
+
# @return [Integer] Hash code
|
|
1055
|
+
def hash
|
|
1056
|
+
[name, page, type, static, editable, default, title, description, placeholder, metadata, required, option_list, combined_field_names, combined_field_type, combined_field_separator, combined_field_format, integer, minimum, maximum, exclusive_minimum, exclusive_maximum, include_time, signature_allow_draw, signature_allow_type, barcode_symbology, hidden, x, y, width, height, rotation, display_type, opacity, date_time_format, typeface, font_size, character_spacing, bold, uppercase, strikethrough, keep_leading_spaces, overflow, multiline, multiline_lines, min_length, max_length, auto_calculate_max_length, color, color_field_name, color_field_required, background_color, background_color_field_name, background_color_field_required, alignment, v_alignment, comb, comb_number_of_cells, comb_value_offset, shape_type, shape_sides, shape_border_width, shape_border_color, shape_border_color_field_name, shape_border_color_field_required, shape_fill_color, shape_fill_color_field_name, shape_fill_color_field_required, check_character, check_color, check_color_field_name, check_color_field_required, qrcode_color, qrcode_color_field_name, qrcode_color_field_required, true_text, false_text, condition, string_condition_type, number_condition_type, number_condition_range_min, number_condition_range_max, number_condition_range_exclusive_min, number_condition_range_exclusive_max, invert_boolean_condition, currency, decimal_places, image_scale_type, image_gravity, dependencies, id].hash
|
|
1057
|
+
end
|
|
1058
|
+
|
|
1059
|
+
# Builds the object from hash
|
|
1060
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
1061
|
+
# @return [Object] Returns the model itself
|
|
1062
|
+
def self.build_from_hash(attributes)
|
|
1063
|
+
return nil unless attributes.is_a?(Hash)
|
|
1064
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
1065
|
+
# include attributes inherited from allOf parents (the nearest declaration wins)
|
|
1066
|
+
map = acceptable_attribute_map
|
|
1067
|
+
transformed_hash = {}
|
|
1068
|
+
acceptable_openapi_types.each_pair do |key, type|
|
|
1069
|
+
if attributes.key?(map[key]) && attributes[map[key]].nil?
|
|
1070
|
+
transformed_hash["#{key}"] = nil
|
|
1071
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
1072
|
+
# check to ensure the input is an array given that the attribute
|
|
1073
|
+
# is documented as an array but the input is not
|
|
1074
|
+
if attributes[map[key]].is_a?(Array)
|
|
1075
|
+
transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
|
|
1076
|
+
end
|
|
1077
|
+
elsif !attributes[map[key]].nil?
|
|
1078
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
|
|
1079
|
+
end
|
|
1080
|
+
end
|
|
1081
|
+
# Responses can include enum values added after this client was released, so the enum setters
|
|
1082
|
+
# accept any value while the model is built from a response
|
|
1083
|
+
allocate.tap do |model|
|
|
1084
|
+
model.instance_variable_set(:@_skip_enum_validation, true)
|
|
1085
|
+
model.send(:initialize, transformed_hash)
|
|
1086
|
+
model.remove_instance_variable(:@_skip_enum_validation)
|
|
1087
|
+
end
|
|
1088
|
+
end
|
|
1089
|
+
|
|
1090
|
+
# Returns the object in the form of hash
|
|
1091
|
+
# @return [Hash] Returns the object in the form of hash
|
|
1092
|
+
def to_hash
|
|
1093
|
+
hash = {}
|
|
1094
|
+
# include attributes inherited from allOf parents (the nearest declaration wins)
|
|
1095
|
+
self.class.acceptable_attribute_map.each_pair do |attr, param|
|
|
1096
|
+
value = self.send(attr)
|
|
1097
|
+
if value.nil?
|
|
1098
|
+
is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
|
|
1099
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
1100
|
+
end
|
|
1101
|
+
|
|
1102
|
+
hash[param] = _to_hash(value)
|
|
1103
|
+
end
|
|
1104
|
+
hash
|
|
1105
|
+
end
|
|
1106
|
+
|
|
1107
|
+
end
|
|
1108
|
+
|
|
1109
|
+
end
|