Class: DocSpring::Template
- Inherits:
-
Object
- Object
- DocSpring::Template
- Defined in:
- lib/docspring/models/template.rb
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#add_data_request_submission_id_footers ⇒ Object
Returns the value of attribute add_data_request_submission_id_footers.
-
#allow_additional_properties ⇒ Object
Returns the value of attribute allow_additional_properties.
-
#defaults ⇒ Object
Returns the value of attribute defaults.
-
#demo ⇒ Object
Returns the value of attribute demo.
-
#description ⇒ Object
Returns the value of attribute description.
-
#document_filename ⇒ Object
Returns the value of attribute document_filename.
-
#document_md5 ⇒ Object
Returns the value of attribute document_md5.
-
#document_parse_error ⇒ Object
Returns the value of attribute document_parse_error.
-
#document_processed ⇒ Object
Returns the value of attribute document_processed.
-
#document_state ⇒ Object
Returns the value of attribute document_state.
-
#document_url ⇒ Object
Returns the value of attribute document_url.
-
#editable_submissions ⇒ Object
Returns the value of attribute editable_submissions.
-
#embed_domains ⇒ Object
Returns the value of attribute embed_domains.
-
#encrypt_pdfs ⇒ Object
Returns the value of attribute encrypt_pdfs.
-
#encrypt_pdfs_password ⇒ Object
Returns the value of attribute encrypt_pdfs_password.
-
#expiration_interval ⇒ Object
Returns the value of attribute expiration_interval.
-
#expire_after ⇒ Object
Returns the value of attribute expire_after.
-
#expire_submissions ⇒ Object
Returns the value of attribute expire_submissions.
-
#external_predefined_fields_template_id ⇒ Object
Returns the value of attribute external_predefined_fields_template_id.
-
#external_predefined_fields_template_name ⇒ Object
Returns the value of attribute external_predefined_fields_template_name.
-
#field_order ⇒ Object
Returns the value of attribute field_order.
-
#fields ⇒ Object
Returns the value of attribute fields.
-
#first_template ⇒ Object
Returns the value of attribute first_template.
-
#footer_html ⇒ Object
Returns the value of attribute footer_html.
-
#header_html ⇒ Object
Returns the value of attribute header_html.
-
#html ⇒ Object
Returns the value of attribute html.
-
#html_engine_options ⇒ Object
Returns the value of attribute html_engine_options.
-
#id ⇒ Object
Returns the value of attribute id.
-
#last_changed_at ⇒ Object
Returns the value of attribute last_changed_at.
-
#last_changed_by_id ⇒ Object
Returns the value of attribute last_changed_by_id.
-
#last_changed_by_type ⇒ Object
Returns the value of attribute last_changed_by_type.
-
#latest_version ⇒ Object
Returns the value of attribute latest_version.
-
#locked ⇒ Object
Returns the value of attribute locked.
-
#merge_audit_trail_pdf ⇒ Object
Returns the value of attribute merge_audit_trail_pdf.
-
#name ⇒ Object
Returns the value of attribute name.
-
#page_count ⇒ Object
Returns the value of attribute page_count.
-
#page_dimensions ⇒ Object
Returns the value of attribute page_dimensions.
-
#parent_folder_id ⇒ Object
Returns the value of attribute parent_folder_id.
-
#path ⇒ Object
Returns the value of attribute path.
-
#permanent_document_url ⇒ Object
Returns the value of attribute permanent_document_url.
-
#predefined_fields ⇒ Object
Returns the value of attribute predefined_fields.
-
#public_submissions ⇒ Object
Returns the value of attribute public_submissions.
-
#public_web_form ⇒ Object
Returns the value of attribute public_web_form.
-
#redirect_url ⇒ Object
Returns the value of attribute redirect_url.
-
#scss ⇒ Object
Returns the value of attribute scss.
-
#shared_field_data ⇒ Object
Returns the value of attribute shared_field_data.
-
#slack_webhook_url ⇒ Object
Returns the value of attribute slack_webhook_url.
-
#template_type ⇒ Object
Returns the value of attribute template_type.
-
#updated_at ⇒ Object
Returns the value of attribute updated_at.
-
#version ⇒ Object
Returns the value of attribute version.
-
#version_published_at ⇒ Object
Returns the value of attribute version_published_at.
-
#versions ⇒ Object
Returns the value of attribute versions.
-
#webhook_url ⇒ Object
Returns the value of attribute webhook_url.
Class Method Summary collapse
-
._deserialize(type, value) ⇒ Object
Deserializes the data based on type.
-
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about.
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.build_from_hash(attributes) ⇒ Object
Builds the object from hash.
-
.openapi_nullable ⇒ Object
List of attributes with nullable: true.
-
.openapi_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
-
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ Template
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility).
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Constructor Details
permalink #initialize(attributes = {}) ⇒ Template
Initializes the object
305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 |
# File 'lib/docspring/models/template.rb', line 305 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `DocSpring::Template` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| if (!self.class.attribute_map.key?(k.to_sym)) fail ArgumentError, "`#{k}` is not a valid attribute in `DocSpring::Template`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'add_data_request_submission_id_footers') self. = attributes[:'add_data_request_submission_id_footers'] else self. = nil end if attributes.key?(:'allow_additional_properties') self.allow_additional_properties = attributes[:'allow_additional_properties'] else self.allow_additional_properties = nil end if attributes.key?(:'description') self.description = attributes[:'description'] else self.description = nil end if attributes.key?(:'document_filename') self.document_filename = attributes[:'document_filename'] else self.document_filename = nil end if attributes.key?(:'document_md5') self.document_md5 = attributes[:'document_md5'] else self.document_md5 = nil end if attributes.key?(:'document_parse_error') self.document_parse_error = attributes[:'document_parse_error'] else self.document_parse_error = nil end if attributes.key?(:'document_processed') self.document_processed = attributes[:'document_processed'] else self.document_processed = nil end if attributes.key?(:'document_state') self.document_state = attributes[:'document_state'] else self.document_state = nil end if attributes.key?(:'document_url') self.document_url = attributes[:'document_url'] else self.document_url = nil end if attributes.key?(:'editable_submissions') self.editable_submissions = attributes[:'editable_submissions'] else self.editable_submissions = nil end if attributes.key?(:'embed_domains') self. = attributes[:'embed_domains'] else self. = nil end if attributes.key?(:'encrypt_pdfs_password') self.encrypt_pdfs_password = attributes[:'encrypt_pdfs_password'] else self.encrypt_pdfs_password = nil end if attributes.key?(:'encrypt_pdfs') self.encrypt_pdfs = attributes[:'encrypt_pdfs'] else self.encrypt_pdfs = nil end if attributes.key?(:'expiration_interval') self.expiration_interval = attributes[:'expiration_interval'] else self.expiration_interval = nil end if attributes.key?(:'expire_after') self.expire_after = attributes[:'expire_after'] else self.expire_after = nil end if attributes.key?(:'expire_submissions') self.expire_submissions = attributes[:'expire_submissions'] else self.expire_submissions = nil end if attributes.key?(:'external_predefined_fields_template_id') self.external_predefined_fields_template_id = attributes[:'external_predefined_fields_template_id'] else self.external_predefined_fields_template_id = nil end if attributes.key?(:'external_predefined_fields_template_name') self.external_predefined_fields_template_name = attributes[:'external_predefined_fields_template_name'] else self.external_predefined_fields_template_name = nil end if attributes.key?(:'first_template') self.first_template = attributes[:'first_template'] else self.first_template = nil end if attributes.key?(:'id') self.id = attributes[:'id'] else self.id = nil end if attributes.key?(:'locked') self.locked = attributes[:'locked'] else self.locked = nil end if attributes.key?(:'merge_audit_trail_pdf') self.merge_audit_trail_pdf = attributes[:'merge_audit_trail_pdf'] else self.merge_audit_trail_pdf = nil end if attributes.key?(:'name') self.name = attributes[:'name'] else self.name = nil end if attributes.key?(:'page_count') self.page_count = attributes[:'page_count'] else self.page_count = nil end if attributes.key?(:'page_dimensions') if (value = attributes[:'page_dimensions']).is_a?(Array) self.page_dimensions = value end else self.page_dimensions = nil end if attributes.key?(:'parent_folder_id') self.parent_folder_id = attributes[:'parent_folder_id'] else self.parent_folder_id = nil end if attributes.key?(:'path') self.path = attributes[:'path'] else self.path = nil end if attributes.key?(:'permanent_document_url') self.permanent_document_url = attributes[:'permanent_document_url'] else self.permanent_document_url = nil end if attributes.key?(:'public_submissions') self.public_submissions = attributes[:'public_submissions'] else self.public_submissions = nil end if attributes.key?(:'public_web_form') self.public_web_form = attributes[:'public_web_form'] else self.public_web_form = nil end if attributes.key?(:'redirect_url') self.redirect_url = attributes[:'redirect_url'] else self.redirect_url = nil end if attributes.key?(:'slack_webhook_url') self.slack_webhook_url = attributes[:'slack_webhook_url'] else self.slack_webhook_url = nil end if attributes.key?(:'template_type') self.template_type = attributes[:'template_type'] else self.template_type = nil end if attributes.key?(:'updated_at') self.updated_at = attributes[:'updated_at'] else self.updated_at = nil end if attributes.key?(:'version_published_at') self.version_published_at = attributes[:'version_published_at'] else self.version_published_at = nil end if attributes.key?(:'version') self.version = attributes[:'version'] else self.version = nil end if attributes.key?(:'webhook_url') self.webhook_url = attributes[:'webhook_url'] else self.webhook_url = nil end if attributes.key?(:'demo') self.demo = attributes[:'demo'] else self.demo = nil end if attributes.key?(:'latest_version') self.latest_version = attributes[:'latest_version'] else self.latest_version = nil end if attributes.key?(:'last_changed_at') self.last_changed_at = attributes[:'last_changed_at'] else self.last_changed_at = nil end if attributes.key?(:'last_changed_by_type') self.last_changed_by_type = attributes[:'last_changed_by_type'] else self.last_changed_by_type = nil end if attributes.key?(:'last_changed_by_id') self.last_changed_by_id = attributes[:'last_changed_by_id'] else self.last_changed_by_id = nil end if attributes.key?(:'defaults') self.defaults = attributes[:'defaults'] else self.defaults = nil end if attributes.key?(:'field_order') if (value = attributes[:'field_order']).is_a?(Array) self.field_order = value end else self.field_order = nil end if attributes.key?(:'fields') self.fields = attributes[:'fields'] else self.fields = nil end if attributes.key?(:'footer_html') self. = attributes[:'footer_html'] else self. = nil end if attributes.key?(:'header_html') self.header_html = attributes[:'header_html'] else self.header_html = nil end if attributes.key?(:'html_engine_options') self. = attributes[:'html_engine_options'] else self. = nil end if attributes.key?(:'html') self.html = attributes[:'html'] else self.html = nil end if attributes.key?(:'predefined_fields') if (value = attributes[:'predefined_fields']).is_a?(Array) self.predefined_fields = value end else self.predefined_fields = nil end if attributes.key?(:'scss') self.scss = attributes[:'scss'] else self.scss = nil end if attributes.key?(:'shared_field_data') self.shared_field_data = attributes[:'shared_field_data'] else self.shared_field_data = nil end if attributes.key?(:'versions') if (value = attributes[:'versions']).is_a?(Array) self.versions = value end else self.versions = nil end end |
Instance Attribute Details
permalink #add_data_request_submission_id_footers ⇒ Object
Returns the value of attribute add_data_request_submission_id_footers.
18 19 20 |
# File 'lib/docspring/models/template.rb', line 18 def @add_data_request_submission_id_footers end |
permalink #allow_additional_properties ⇒ Object
Returns the value of attribute allow_additional_properties.
20 21 22 |
# File 'lib/docspring/models/template.rb', line 20 def allow_additional_properties @allow_additional_properties end |
permalink #defaults ⇒ Object
Returns the value of attribute defaults.
102 103 104 |
# File 'lib/docspring/models/template.rb', line 102 def defaults @defaults end |
permalink #demo ⇒ Object
Returns the value of attribute demo.
92 93 94 |
# File 'lib/docspring/models/template.rb', line 92 def demo @demo end |
permalink #description ⇒ Object
Returns the value of attribute description.
22 23 24 |
# File 'lib/docspring/models/template.rb', line 22 def description @description end |
permalink #document_filename ⇒ Object
Returns the value of attribute document_filename.
24 25 26 |
# File 'lib/docspring/models/template.rb', line 24 def document_filename @document_filename end |
permalink #document_md5 ⇒ Object
Returns the value of attribute document_md5.
26 27 28 |
# File 'lib/docspring/models/template.rb', line 26 def document_md5 @document_md5 end |
permalink #document_parse_error ⇒ Object
Returns the value of attribute document_parse_error.
28 29 30 |
# File 'lib/docspring/models/template.rb', line 28 def document_parse_error @document_parse_error end |
permalink #document_processed ⇒ Object
Returns the value of attribute document_processed.
30 31 32 |
# File 'lib/docspring/models/template.rb', line 30 def document_processed @document_processed end |
permalink #document_state ⇒ Object
Returns the value of attribute document_state.
32 33 34 |
# File 'lib/docspring/models/template.rb', line 32 def document_state @document_state end |
permalink #document_url ⇒ Object
Returns the value of attribute document_url.
34 35 36 |
# File 'lib/docspring/models/template.rb', line 34 def document_url @document_url end |
permalink #editable_submissions ⇒ Object
Returns the value of attribute editable_submissions.
36 37 38 |
# File 'lib/docspring/models/template.rb', line 36 def editable_submissions @editable_submissions end |
permalink #embed_domains ⇒ Object
Returns the value of attribute embed_domains.
38 39 40 |
# File 'lib/docspring/models/template.rb', line 38 def @embed_domains end |
permalink #encrypt_pdfs ⇒ Object
Returns the value of attribute encrypt_pdfs.
42 43 44 |
# File 'lib/docspring/models/template.rb', line 42 def encrypt_pdfs @encrypt_pdfs end |
permalink #encrypt_pdfs_password ⇒ Object
Returns the value of attribute encrypt_pdfs_password.
40 41 42 |
# File 'lib/docspring/models/template.rb', line 40 def encrypt_pdfs_password @encrypt_pdfs_password end |
permalink #expiration_interval ⇒ Object
Returns the value of attribute expiration_interval.
44 45 46 |
# File 'lib/docspring/models/template.rb', line 44 def expiration_interval @expiration_interval end |
permalink #expire_after ⇒ Object
Returns the value of attribute expire_after.
46 47 48 |
# File 'lib/docspring/models/template.rb', line 46 def expire_after @expire_after end |
permalink #expire_submissions ⇒ Object
Returns the value of attribute expire_submissions.
48 49 50 |
# File 'lib/docspring/models/template.rb', line 48 def expire_submissions @expire_submissions end |
permalink #external_predefined_fields_template_id ⇒ Object
Returns the value of attribute external_predefined_fields_template_id.
50 51 52 |
# File 'lib/docspring/models/template.rb', line 50 def external_predefined_fields_template_id @external_predefined_fields_template_id end |
permalink #external_predefined_fields_template_name ⇒ Object
Returns the value of attribute external_predefined_fields_template_name.
52 53 54 |
# File 'lib/docspring/models/template.rb', line 52 def external_predefined_fields_template_name @external_predefined_fields_template_name end |
permalink #field_order ⇒ Object
Returns the value of attribute field_order.
104 105 106 |
# File 'lib/docspring/models/template.rb', line 104 def field_order @field_order end |
permalink #fields ⇒ Object
Returns the value of attribute fields.
106 107 108 |
# File 'lib/docspring/models/template.rb', line 106 def fields @fields end |
permalink #first_template ⇒ Object
Returns the value of attribute first_template.
54 55 56 |
# File 'lib/docspring/models/template.rb', line 54 def first_template @first_template end |
permalink #footer_html ⇒ Object
Returns the value of attribute footer_html.
108 109 110 |
# File 'lib/docspring/models/template.rb', line 108 def @footer_html end |
permalink #header_html ⇒ Object
Returns the value of attribute header_html.
110 111 112 |
# File 'lib/docspring/models/template.rb', line 110 def header_html @header_html end |
permalink #html ⇒ Object
Returns the value of attribute html.
114 115 116 |
# File 'lib/docspring/models/template.rb', line 114 def html @html end |
permalink #html_engine_options ⇒ Object
Returns the value of attribute html_engine_options.
112 113 114 |
# File 'lib/docspring/models/template.rb', line 112 def @html_engine_options end |
permalink #id ⇒ Object
Returns the value of attribute id.
56 57 58 |
# File 'lib/docspring/models/template.rb', line 56 def id @id end |
permalink #last_changed_at ⇒ Object
Returns the value of attribute last_changed_at.
96 97 98 |
# File 'lib/docspring/models/template.rb', line 96 def last_changed_at @last_changed_at end |
permalink #last_changed_by_id ⇒ Object
Returns the value of attribute last_changed_by_id.
100 101 102 |
# File 'lib/docspring/models/template.rb', line 100 def last_changed_by_id @last_changed_by_id end |
permalink #last_changed_by_type ⇒ Object
Returns the value of attribute last_changed_by_type.
98 99 100 |
# File 'lib/docspring/models/template.rb', line 98 def last_changed_by_type @last_changed_by_type end |
permalink #latest_version ⇒ Object
Returns the value of attribute latest_version.
94 95 96 |
# File 'lib/docspring/models/template.rb', line 94 def latest_version @latest_version end |
permalink #locked ⇒ Object
Returns the value of attribute locked.
58 59 60 |
# File 'lib/docspring/models/template.rb', line 58 def locked @locked end |
permalink #merge_audit_trail_pdf ⇒ Object
Returns the value of attribute merge_audit_trail_pdf.
60 61 62 |
# File 'lib/docspring/models/template.rb', line 60 def merge_audit_trail_pdf @merge_audit_trail_pdf end |
permalink #name ⇒ Object
Returns the value of attribute name.
62 63 64 |
# File 'lib/docspring/models/template.rb', line 62 def name @name end |
permalink #page_count ⇒ Object
Returns the value of attribute page_count.
64 65 66 |
# File 'lib/docspring/models/template.rb', line 64 def page_count @page_count end |
permalink #page_dimensions ⇒ Object
Returns the value of attribute page_dimensions.
66 67 68 |
# File 'lib/docspring/models/template.rb', line 66 def page_dimensions @page_dimensions end |
permalink #parent_folder_id ⇒ Object
Returns the value of attribute parent_folder_id.
68 69 70 |
# File 'lib/docspring/models/template.rb', line 68 def parent_folder_id @parent_folder_id end |
permalink #path ⇒ Object
Returns the value of attribute path.
70 71 72 |
# File 'lib/docspring/models/template.rb', line 70 def path @path end |
permalink #permanent_document_url ⇒ Object
Returns the value of attribute permanent_document_url.
72 73 74 |
# File 'lib/docspring/models/template.rb', line 72 def permanent_document_url @permanent_document_url end |
permalink #predefined_fields ⇒ Object
Returns the value of attribute predefined_fields.
116 117 118 |
# File 'lib/docspring/models/template.rb', line 116 def predefined_fields @predefined_fields end |
permalink #public_submissions ⇒ Object
Returns the value of attribute public_submissions.
74 75 76 |
# File 'lib/docspring/models/template.rb', line 74 def public_submissions @public_submissions end |
permalink #public_web_form ⇒ Object
Returns the value of attribute public_web_form.
76 77 78 |
# File 'lib/docspring/models/template.rb', line 76 def public_web_form @public_web_form end |
permalink #redirect_url ⇒ Object
Returns the value of attribute redirect_url.
78 79 80 |
# File 'lib/docspring/models/template.rb', line 78 def redirect_url @redirect_url end |
permalink #scss ⇒ Object
Returns the value of attribute scss.
118 119 120 |
# File 'lib/docspring/models/template.rb', line 118 def scss @scss end |
permalink #shared_field_data ⇒ Object
Returns the value of attribute shared_field_data.
120 121 122 |
# File 'lib/docspring/models/template.rb', line 120 def shared_field_data @shared_field_data end |
permalink #slack_webhook_url ⇒ Object
Returns the value of attribute slack_webhook_url.
80 81 82 |
# File 'lib/docspring/models/template.rb', line 80 def slack_webhook_url @slack_webhook_url end |
permalink #template_type ⇒ Object
Returns the value of attribute template_type.
82 83 84 |
# File 'lib/docspring/models/template.rb', line 82 def template_type @template_type end |
permalink #updated_at ⇒ Object
Returns the value of attribute updated_at.
84 85 86 |
# File 'lib/docspring/models/template.rb', line 84 def updated_at @updated_at end |
permalink #version ⇒ Object
Returns the value of attribute version.
88 89 90 |
# File 'lib/docspring/models/template.rb', line 88 def version @version end |
permalink #version_published_at ⇒ Object
Returns the value of attribute version_published_at.
86 87 88 |
# File 'lib/docspring/models/template.rb', line 86 def version_published_at @version_published_at end |
permalink #versions ⇒ Object
Returns the value of attribute versions.
122 123 124 |
# File 'lib/docspring/models/template.rb', line 122 def versions @versions end |
permalink #webhook_url ⇒ Object
Returns the value of attribute webhook_url.
90 91 92 |
# File 'lib/docspring/models/template.rb', line 90 def webhook_url @webhook_url end |
Class Method Details
permalink ._deserialize(type, value) ⇒ Object
Deserializes the data based on type
920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 |
# File 'lib/docspring/models/template.rb', line 920 def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) when :Date Date.parse(value) when :String value.to_s when :Integer value.to_i when :Float value.to_f when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else false end when :Object # generic object (usually a Hash), return directly value when /\AArray<(?<inner_type>.+)>\z/ inner_type = Regexp.last_match[:inner_type] value.map { |v| _deserialize(inner_type, v) } when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/ k_type = Regexp.last_match[:k_type] v_type = Regexp.last_match[:v_type] {}.tap do |hash| value.each do |k, v| hash[_deserialize(k_type, k)] = _deserialize(v_type, v) end end else # model # models (e.g. Pet) or oneOf klass = DocSpring.const_get(type) klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end |
permalink .acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
206 207 208 |
# File 'lib/docspring/models/template.rb', line 206 def self.acceptable_attributes attribute_map.values end |
permalink .attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 |
# File 'lib/docspring/models/template.rb', line 147 def self.attribute_map { :'add_data_request_submission_id_footers' => :'add_data_request_submission_id_footers', :'allow_additional_properties' => :'allow_additional_properties', :'description' => :'description', :'document_filename' => :'document_filename', :'document_md5' => :'document_md5', :'document_parse_error' => :'document_parse_error', :'document_processed' => :'document_processed', :'document_state' => :'document_state', :'document_url' => :'document_url', :'editable_submissions' => :'editable_submissions', :'embed_domains' => :'embed_domains', :'encrypt_pdfs_password' => :'encrypt_pdfs_password', :'encrypt_pdfs' => :'encrypt_pdfs', :'expiration_interval' => :'expiration_interval', :'expire_after' => :'expire_after', :'expire_submissions' => :'expire_submissions', :'external_predefined_fields_template_id' => :'external_predefined_fields_template_id', :'external_predefined_fields_template_name' => :'external_predefined_fields_template_name', :'first_template' => :'first_template', :'id' => :'id', :'locked' => :'locked', :'merge_audit_trail_pdf' => :'merge_audit_trail_pdf', :'name' => :'name', :'page_count' => :'page_count', :'page_dimensions' => :'page_dimensions', :'parent_folder_id' => :'parent_folder_id', :'path' => :'path', :'permanent_document_url' => :'permanent_document_url', :'public_submissions' => :'public_submissions', :'public_web_form' => :'public_web_form', :'redirect_url' => :'redirect_url', :'slack_webhook_url' => :'slack_webhook_url', :'template_type' => :'template_type', :'updated_at' => :'updated_at', :'version_published_at' => :'version_published_at', :'version' => :'version', :'webhook_url' => :'webhook_url', :'demo' => :'demo', :'latest_version' => :'latest_version', :'last_changed_at' => :'last_changed_at', :'last_changed_by_type' => :'last_changed_by_type', :'last_changed_by_id' => :'last_changed_by_id', :'defaults' => :'defaults', :'field_order' => :'field_order', :'fields' => :'fields', :'footer_html' => :'footer_html', :'header_html' => :'header_html', :'html_engine_options' => :'html_engine_options', :'html' => :'html', :'predefined_fields' => :'predefined_fields', :'scss' => :'scss', :'shared_field_data' => :'shared_field_data', :'versions' => :'versions' } end |
permalink .build_from_hash(attributes) ⇒ Object
Builds the object from hash
896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 |
# File 'lib/docspring/models/template.rb', line 896 def self.build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) transformed_hash = {} openapi_types.each_pair do |key, type| if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[attribute_map[key]].is_a?(Array) transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end elsif !attributes[attribute_map[key]].nil? transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end new(transformed_hash) end |
permalink .openapi_nullable ⇒ Object
List of attributes with nullable: true
270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 |
# File 'lib/docspring/models/template.rb', line 270 def self.openapi_nullable Set.new([ :'description', :'document_filename', :'document_md5', :'document_url', :'embed_domains', :'encrypt_pdfs_password', :'external_predefined_fields_template_id', :'external_predefined_fields_template_name', :'id', :'name', :'page_dimensions', :'parent_folder_id', :'path', :'permanent_document_url', :'redirect_url', :'slack_webhook_url', :'updated_at', :'version_published_at', :'version', :'webhook_url', :'latest_version', :'last_changed_at', :'last_changed_by_type', :'last_changed_by_id', :'footer_html', :'header_html', :'html', :'scss', ]) end |
permalink .openapi_types ⇒ Object
Attribute type mapping.
211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 |
# File 'lib/docspring/models/template.rb', line 211 def self.openapi_types { :'add_data_request_submission_id_footers' => :'Boolean', :'allow_additional_properties' => :'Boolean', :'description' => :'String', :'document_filename' => :'String', :'document_md5' => :'String', :'document_parse_error' => :'Boolean', :'document_processed' => :'Boolean', :'document_state' => :'String', :'document_url' => :'String', :'editable_submissions' => :'Boolean', :'embed_domains' => :'String', :'encrypt_pdfs_password' => :'String', :'encrypt_pdfs' => :'Boolean', :'expiration_interval' => :'String', :'expire_after' => :'Integer', :'expire_submissions' => :'Boolean', :'external_predefined_fields_template_id' => :'String', :'external_predefined_fields_template_name' => :'String', :'first_template' => :'Boolean', :'id' => :'String', :'locked' => :'Boolean', :'merge_audit_trail_pdf' => :'Boolean', :'name' => :'String', :'page_count' => :'Integer', :'page_dimensions' => :'Array<Array<Float>>', :'parent_folder_id' => :'String', :'path' => :'String', :'permanent_document_url' => :'String', :'public_submissions' => :'Boolean', :'public_web_form' => :'Boolean', :'redirect_url' => :'String', :'slack_webhook_url' => :'String', :'template_type' => :'String', :'updated_at' => :'String', :'version_published_at' => :'String', :'version' => :'String', :'webhook_url' => :'String', :'demo' => :'Boolean', :'latest_version' => :'String', :'last_changed_at' => :'String', :'last_changed_by_type' => :'String', :'last_changed_by_id' => :'String', :'defaults' => :'Object', :'field_order' => :'Array<Array<Float>>', :'fields' => :'Object', :'footer_html' => :'String', :'header_html' => :'String', :'html_engine_options' => :'Object', :'html' => :'String', :'predefined_fields' => :'Array<Object>', :'scss' => :'String', :'shared_field_data' => :'Object', :'versions' => :'Array<Object>' } end |
Instance Method Details
permalink #==(o) ⇒ Object
Checks equality by comparing each attribute.
823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 |
# File 'lib/docspring/models/template.rb', line 823 def ==(o) return true if self.equal?(o) self.class == o.class && == o. && allow_additional_properties == o.allow_additional_properties && description == o.description && document_filename == o.document_filename && document_md5 == o.document_md5 && document_parse_error == o.document_parse_error && document_processed == o.document_processed && document_state == o.document_state && document_url == o.document_url && editable_submissions == o.editable_submissions && == o. && encrypt_pdfs_password == o.encrypt_pdfs_password && encrypt_pdfs == o.encrypt_pdfs && expiration_interval == o.expiration_interval && expire_after == o.expire_after && expire_submissions == o.expire_submissions && external_predefined_fields_template_id == o.external_predefined_fields_template_id && external_predefined_fields_template_name == o.external_predefined_fields_template_name && first_template == o.first_template && id == o.id && locked == o.locked && merge_audit_trail_pdf == o.merge_audit_trail_pdf && name == o.name && page_count == o.page_count && page_dimensions == o.page_dimensions && parent_folder_id == o.parent_folder_id && path == o.path && permanent_document_url == o.permanent_document_url && public_submissions == o.public_submissions && public_web_form == o.public_web_form && redirect_url == o.redirect_url && slack_webhook_url == o.slack_webhook_url && template_type == o.template_type && updated_at == o.updated_at && version_published_at == o.version_published_at && version == o.version && webhook_url == o.webhook_url && demo == o.demo && latest_version == o.latest_version && last_changed_at == o.last_changed_at && last_changed_by_type == o.last_changed_by_type && last_changed_by_id == o.last_changed_by_id && defaults == o.defaults && field_order == o.field_order && fields == o.fields && == o. && header_html == o.header_html && == o. && html == o.html && predefined_fields == o.predefined_fields && scss == o.scss && shared_field_data == o.shared_field_data && versions == o.versions end |
permalink #_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value
991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 |
# File 'lib/docspring/models/template.rb', line 991 def _to_hash(value) if value.is_a?(Array) value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } end elsif value.respond_to? :to_hash value.to_hash else value end end |
permalink #eql?(o) ⇒ Boolean
883 884 885 |
# File 'lib/docspring/models/template.rb', line 883 def eql?(o) self == o end |
permalink #hash ⇒ Integer
Calculates hash code according to all attributes.
889 890 891 |
# File 'lib/docspring/models/template.rb', line 889 def hash [, allow_additional_properties, description, document_filename, document_md5, document_parse_error, document_processed, document_state, document_url, editable_submissions, , encrypt_pdfs_password, encrypt_pdfs, expiration_interval, expire_after, expire_submissions, external_predefined_fields_template_id, external_predefined_fields_template_name, first_template, id, locked, merge_audit_trail_pdf, name, page_count, page_dimensions, parent_folder_id, path, permanent_document_url, public_submissions, public_web_form, redirect_url, slack_webhook_url, template_type, updated_at, version_published_at, version, webhook_url, demo, latest_version, last_changed_at, last_changed_by_type, last_changed_by_id, defaults, field_order, fields, , header_html, , html, predefined_fields, scss, shared_field_data, versions].hash end |
permalink #list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 |
# File 'lib/docspring/models/template.rb', line 647 def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @add_data_request_submission_id_footers.nil? invalid_properties.push('invalid value for "add_data_request_submission_id_footers", add_data_request_submission_id_footers cannot be nil.') end if @allow_additional_properties.nil? invalid_properties.push('invalid value for "allow_additional_properties", allow_additional_properties cannot be nil.') end if @document_parse_error.nil? invalid_properties.push('invalid value for "document_parse_error", document_parse_error cannot be nil.') end if @document_processed.nil? invalid_properties.push('invalid value for "document_processed", document_processed cannot be nil.') end if @document_state.nil? invalid_properties.push('invalid value for "document_state", document_state cannot be nil.') end if @editable_submissions.nil? invalid_properties.push('invalid value for "editable_submissions", editable_submissions cannot be nil.') end if @encrypt_pdfs.nil? invalid_properties.push('invalid value for "encrypt_pdfs", encrypt_pdfs cannot be nil.') end if @expiration_interval.nil? invalid_properties.push('invalid value for "expiration_interval", expiration_interval cannot be nil.') end if @expire_after.nil? invalid_properties.push('invalid value for "expire_after", expire_after cannot be nil.') end if @expire_submissions.nil? invalid_properties.push('invalid value for "expire_submissions", expire_submissions cannot be nil.') end if @first_template.nil? invalid_properties.push('invalid value for "first_template", first_template cannot be nil.') end if @locked.nil? invalid_properties.push('invalid value for "locked", locked cannot be nil.') end if @merge_audit_trail_pdf.nil? invalid_properties.push('invalid value for "merge_audit_trail_pdf", merge_audit_trail_pdf cannot be nil.') end if @page_count.nil? invalid_properties.push('invalid value for "page_count", page_count cannot be nil.') end if @public_submissions.nil? invalid_properties.push('invalid value for "public_submissions", public_submissions cannot be nil.') end if @public_web_form.nil? invalid_properties.push('invalid value for "public_web_form", public_web_form cannot be nil.') end if @template_type.nil? invalid_properties.push('invalid value for "template_type", template_type cannot be nil.') end if @demo.nil? invalid_properties.push('invalid value for "demo", demo cannot be nil.') end if @defaults.nil? invalid_properties.push('invalid value for "defaults", defaults cannot be nil.') end if @field_order.nil? invalid_properties.push('invalid value for "field_order", field_order cannot be nil.') end if @fields.nil? invalid_properties.push('invalid value for "fields", fields cannot be nil.') end if @html_engine_options.nil? invalid_properties.push('invalid value for "html_engine_options", html_engine_options cannot be nil.') end if @predefined_fields.nil? invalid_properties.push('invalid value for "predefined_fields", predefined_fields cannot be nil.') end if @shared_field_data.nil? invalid_properties.push('invalid value for "shared_field_data", shared_field_data cannot be nil.') end if @versions.nil? invalid_properties.push('invalid value for "versions", versions cannot be nil.') end invalid_properties end |
permalink #to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
967 968 969 |
# File 'lib/docspring/models/template.rb', line 967 def to_body to_hash end |
permalink #to_hash ⇒ Hash
Returns the object in the form of hash
973 974 975 976 977 978 979 980 981 982 983 984 985 |
# File 'lib/docspring/models/template.rb', line 973 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) if value.nil? is_nullable = self.class.openapi_nullable.include?(attr) next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) end hash[param] = _to_hash(value) end hash end |
permalink #to_s ⇒ String
Returns the string representation of the object
961 962 963 |
# File 'lib/docspring/models/template.rb', line 961 def to_s to_hash.to_s end |
permalink #valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 |
# File 'lib/docspring/models/template.rb', line 755 def valid? warn '[DEPRECATED] the `valid?` method is obsolete' return false if @add_data_request_submission_id_footers.nil? return false if @allow_additional_properties.nil? return false if @document_parse_error.nil? return false if @document_processed.nil? return false if @document_state.nil? document_state_validator = EnumAttributeValidator.new('String', ["pending", "processed", "password_required", "malformed_pdf", "unknown_error"]) return false unless document_state_validator.valid?(@document_state) return false if @editable_submissions.nil? return false if @encrypt_pdfs.nil? return false if @expiration_interval.nil? return false if @expire_after.nil? return false if @expire_submissions.nil? return false if @first_template.nil? return false if @locked.nil? return false if @merge_audit_trail_pdf.nil? return false if @page_count.nil? return false if @public_submissions.nil? return false if @public_web_form.nil? return false if @template_type.nil? template_type_validator = EnumAttributeValidator.new('String', ["pdf", "html"]) return false unless template_type_validator.valid?(@template_type) return false if @demo.nil? last_changed_by_type_validator = EnumAttributeValidator.new('String', ["user", "api"]) return false unless last_changed_by_type_validator.valid?(@last_changed_by_type) return false if @defaults.nil? return false if @field_order.nil? return false if @fields.nil? return false if @html_engine_options.nil? return false if @predefined_fields.nil? return false if @shared_field_data.nil? return false if @versions.nil? true end |