docspring 4.1.0 → 4.3.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 +15 -0
- data/.travis.yml +1 -1
- data/AGENTS.md +5 -4
- data/CHANGELOG.md +67 -0
- data/Gemfile.lock +11 -10
- data/README.md +11 -6
- data/docs/Client.md +273 -105
- data/docs/CombinedPdf.md +1 -1
- data/docs/CreateCombinedPdfRequest.md +1 -1
- data/docs/CreateSubmissionRequest.md +5 -5
- data/docs/CreateTemplatePreviewRequest.md +18 -0
- data/docs/CreateTemplateRequest.md +14 -10
- data/docs/ErrorDetail.md +1 -1
- data/docs/ErrorInfo.md +4 -4
- data/docs/FieldGroup.md +2 -2
- data/docs/FieldGroupInput.md +1 -1
- data/docs/GenerateSubmissionFilesRequest.md +1 -1
- data/docs/GeneratedFile.md +2 -2
- data/docs/Submission.md +18 -18
- data/docs/SubmissionBatch.md +3 -3
- data/docs/SubmissionFiles.md +4 -0
- data/docs/SubmissionInput.md +5 -5
- data/docs/SubmissionList.md +1 -1
- data/docs/SubmissionSummary.md +54 -0
- data/docs/Template.md +21 -17
- data/docs/TemplateActor.md +1 -1
- data/docs/TemplateDiff.md +2 -2
- data/docs/TemplateDocument.md +12 -12
- data/docs/TemplateDocumentSummary.md +24 -0
- data/docs/TemplatePreview.md +32 -0
- data/docs/TemplatePreviewState.md +15 -0
- data/docs/TemplateSummary.md +5 -49
- data/docs/UpdateTemplateDocumentRequest.md +5 -5
- data/docs/UpdateTemplateRequest.md +10 -6
- data/docs/ValidateSubmissionRequest.md +5 -5
- data/docspring.gemspec +2 -2
- data/lib/docspring/api/client.rb +222 -49
- data/lib/docspring/api_client.rb +5 -3
- data/lib/docspring/api_error.rb +1 -1
- data/lib/docspring/api_model_base.rb +1 -1
- data/lib/docspring/configuration.rb +1 -1
- data/lib/docspring/date_time_values.rb +33 -0
- data/lib/docspring/models/add_template_fields_request.rb +1 -1
- data/lib/docspring/models/ai_field_naming_language.rb +1 -1
- data/lib/docspring/models/authentication_check.rb +1 -1
- data/lib/docspring/models/barcode_symbology.rb +1 -1
- data/lib/docspring/models/check_character.rb +1 -1
- data/lib/docspring/models/combined_field_type.rb +1 -1
- data/lib/docspring/models/combined_pdf.rb +2 -2
- data/lib/docspring/models/combined_pdf_files.rb +1 -1
- data/lib/docspring/models/combined_pdf_list.rb +1 -1
- data/lib/docspring/models/combined_pdf_source.rb +1 -1
- data/lib/docspring/models/combined_pdf_source_input.rb +1 -1
- data/lib/docspring/models/combined_pdf_source_pdf.rb +1 -1
- data/lib/docspring/models/combined_pdf_source_type.rb +1 -1
- data/lib/docspring/models/combined_pdf_state.rb +1 -1
- data/lib/docspring/models/copy_template_request.rb +1 -1
- data/lib/docspring/models/create_combined_pdf_request.rb +2 -2
- data/lib/docspring/models/create_custom_file_from_upload_request.rb +1 -1
- data/lib/docspring/models/create_folder_request.rb +1 -1
- data/lib/docspring/models/create_signature_request_event_request.rb +1 -1
- data/lib/docspring/models/create_signature_request_token_request.rb +1 -1
- data/lib/docspring/models/create_submission_batch_request.rb +1 -1
- data/lib/docspring/models/create_submission_request.rb +6 -6
- data/lib/docspring/models/create_template_preview_request.rb +187 -0
- data/lib/docspring/models/create_template_request.rb +32 -12
- data/lib/docspring/models/create_webhook_request.rb +1 -1
- data/lib/docspring/models/custom_file.rb +1 -1
- data/lib/docspring/models/custom_file_list.rb +1 -1
- data/lib/docspring/models/custom_file_source_pdf.rb +1 -1
- data/lib/docspring/models/error_code.rb +4 -2
- data/lib/docspring/models/error_detail.rb +2 -2
- data/lib/docspring/models/error_info.rb +5 -5
- data/lib/docspring/models/error_response.rb +1 -1
- data/lib/docspring/models/expiration_interval.rb +1 -1
- data/lib/docspring/models/field.rb +2 -2
- data/lib/docspring/models/field_comparison_condition.rb +1 -1
- data/lib/docspring/models/field_comparison_operator.rb +1 -1
- data/lib/docspring/models/field_dependency.rb +1 -1
- data/lib/docspring/models/field_dependency_input.rb +1 -1
- data/lib/docspring/models/field_display_type.rb +1 -1
- data/lib/docspring/models/field_equals_condition.rb +1 -1
- data/lib/docspring/models/field_equals_operator.rb +1 -1
- data/lib/docspring/models/field_group.rb +3 -3
- data/lib/docspring/models/field_group_input.rb +2 -2
- data/lib/docspring/models/field_group_type.rb +1 -1
- data/lib/docspring/models/field_in_condition.rb +1 -1
- data/lib/docspring/models/field_input.rb +2 -2
- data/lib/docspring/models/field_override.rb +1 -1
- data/lib/docspring/models/field_presence_condition.rb +1 -1
- data/lib/docspring/models/field_presence_operator.rb +1 -1
- data/lib/docspring/models/field_range_condition.rb +1 -1
- data/lib/docspring/models/field_reimport_state.rb +1 -1
- data/lib/docspring/models/field_setup_logic.rb +1 -1
- data/lib/docspring/models/field_setup_naming.rb +1 -1
- data/lib/docspring/models/field_setup_source.rb +1 -1
- data/lib/docspring/models/field_type.rb +1 -1
- data/lib/docspring/models/folder.rb +1 -1
- data/lib/docspring/models/folder_list.rb +1 -1
- data/lib/docspring/models/generate_files_format.rb +5 -2
- data/lib/docspring/models/generate_submission_files_request.rb +2 -2
- data/lib/docspring/models/generated_file.rb +4 -4
- data/lib/docspring/models/generated_file_state.rb +1 -1
- data/lib/docspring/models/html_engine_options.rb +1 -1
- data/lib/docspring/models/html_engine_options_input.rb +1 -1
- data/lib/docspring/models/image_gravity.rb +1 -1
- data/lib/docspring/models/image_scale_type.rb +1 -1
- data/lib/docspring/models/model_code_language.rb +3 -2
- data/lib/docspring/models/move_folder_request.rb +1 -1
- data/lib/docspring/models/move_template_request.rb +1 -1
- data/lib/docspring/models/number_condition_type.rb +1 -1
- data/lib/docspring/models/output_format.rb +4 -2
- data/lib/docspring/models/page_format.rb +1 -1
- data/lib/docspring/models/page_image.rb +1 -1
- data/lib/docspring/models/page_images.rb +1 -1
- data/lib/docspring/models/predefined_field.rb +1 -1
- data/lib/docspring/models/predefined_field_input.rb +1 -1
- data/lib/docspring/models/publish_template_version_request.rb +1 -1
- data/lib/docspring/models/remove_template_fields_request.rb +1 -1
- data/lib/docspring/models/rename_folder_request.rb +1 -1
- data/lib/docspring/models/reorder_template_fields_request.rb +1 -1
- data/lib/docspring/models/restore_template_version_request.rb +1 -1
- data/lib/docspring/models/shape_type.rb +1 -1
- data/lib/docspring/models/signature_request.rb +1 -1
- data/lib/docspring/models/signature_request_auth_second_factor_type.rb +1 -1
- data/lib/docspring/models/signature_request_auth_type.rb +1 -1
- data/lib/docspring/models/signature_request_event.rb +1 -1
- data/lib/docspring/models/signature_request_event_type.rb +1 -1
- data/lib/docspring/models/signature_request_input.rb +1 -1
- data/lib/docspring/models/signature_request_message_type.rb +1 -1
- data/lib/docspring/models/signature_request_state.rb +1 -1
- data/lib/docspring/models/signature_request_token.rb +1 -1
- data/lib/docspring/models/signature_request_token_type.rb +1 -1
- data/lib/docspring/models/string_condition_type.rb +1 -1
- data/lib/docspring/models/submission.rb +145 -145
- data/lib/docspring/models/submission_action.rb +1 -1
- data/lib/docspring/models/submission_action_state.rb +1 -1
- data/lib/docspring/models/submission_action_type.rb +1 -1
- data/lib/docspring/models/submission_batch.rb +5 -5
- data/lib/docspring/models/submission_batch_state.rb +1 -1
- data/lib/docspring/models/submission_files.rb +22 -2
- data/lib/docspring/models/submission_input.rb +6 -6
- data/lib/docspring/models/submission_list.rb +2 -2
- data/lib/docspring/models/submission_source.rb +1 -1
- data/lib/docspring/models/submission_source_pdf.rb +1 -1
- data/lib/docspring/models/submission_state.rb +1 -1
- data/lib/docspring/models/submission_summary.rb +601 -0
- data/lib/docspring/models/submission_validation.rb +1 -1
- data/lib/docspring/models/template.rb +131 -91
- data/lib/docspring/models/template_actor.rb +2 -2
- data/lib/docspring/models/template_actor_type.rb +1 -1
- data/lib/docspring/models/template_defaults.rb +1 -1
- data/lib/docspring/models/template_defaults_input.rb +1 -1
- data/lib/docspring/models/template_diff.rb +3 -3
- data/lib/docspring/models/template_diff_summary.rb +1 -1
- data/lib/docspring/models/template_document.rb +51 -51
- data/lib/docspring/models/template_document_state.rb +4 -2
- data/lib/docspring/models/template_document_summary.rb +260 -0
- data/lib/docspring/models/template_field_change.rb +1 -1
- data/lib/docspring/models/template_field_changes.rb +1 -1
- data/lib/docspring/models/template_field_dependency.rb +1 -1
- data/lib/docspring/models/template_field_dependency_action.rb +1 -1
- data/lib/docspring/models/template_field_dependency_condition.rb +1 -1
- data/lib/docspring/models/template_field_dependency_condition_input.rb +1 -1
- data/lib/docspring/models/template_field_dependency_input.rb +1 -1
- data/lib/docspring/models/template_field_dependency_match.rb +1 -1
- data/lib/docspring/models/template_field_dependency_operator.rb +1 -1
- data/lib/docspring/models/template_field_logic_status.rb +1 -1
- data/lib/docspring/models/template_field_move.rb +1 -1
- data/lib/docspring/models/template_fields.rb +1 -1
- data/lib/docspring/models/template_form_mode.rb +1 -1
- data/lib/docspring/models/template_model_code.rb +1 -1
- data/lib/docspring/models/template_page_ai_error.rb +1 -1
- data/lib/docspring/models/template_page_ai_naming_status.rb +1 -1
- data/lib/docspring/models/template_page_fields_status.rb +1 -1
- data/lib/docspring/models/template_page_image_status.rb +1 -1
- data/lib/docspring/models/template_page_images.rb +1 -1
- data/lib/docspring/models/template_page_processing_status.rb +1 -1
- data/lib/docspring/models/template_preview.rb +356 -0
- data/lib/docspring/models/template_preview_state.rb +42 -0
- data/lib/docspring/models/template_source_pdf.rb +1 -1
- data/lib/docspring/models/template_summary.rb +34 -574
- data/lib/docspring/models/template_summary_list.rb +1 -1
- data/lib/docspring/models/template_type.rb +3 -2
- data/lib/docspring/models/template_version.rb +1 -1
- data/lib/docspring/models/template_version_type.rb +1 -1
- data/lib/docspring/models/text_alignment.rb +1 -1
- data/lib/docspring/models/text_overflow.rb +1 -1
- data/lib/docspring/models/text_vertical_alignment.rb +1 -1
- data/lib/docspring/models/typeface.rb +1 -1
- data/lib/docspring/models/update_signature_request_request.rb +1 -1
- data/lib/docspring/models/update_template_document_request.rb +7 -7
- data/lib/docspring/models/update_template_fields_request.rb +1 -1
- data/lib/docspring/models/update_template_request.rb +31 -11
- data/lib/docspring/models/update_webhook_request.rb +1 -1
- data/lib/docspring/models/upload_method.rb +1 -1
- data/lib/docspring/models/upload_presign.rb +1 -1
- data/lib/docspring/models/url_source_pdf.rb +1 -1
- data/lib/docspring/models/validate_submission_request.rb +6 -6
- data/lib/docspring/models/webhook.rb +1 -1
- data/lib/docspring/models/webhook_event_type.rb +1 -1
- data/lib/docspring/models/webhook_list.rb +1 -1
- data/lib/docspring/models/webhook_mode.rb +1 -1
- data/lib/docspring/request_schemas.json +144 -10
- data/lib/docspring/version.rb +2 -2
- data/lib/docspring/webhook_signature.rb +45 -0
- data/lib/docspring.rb +7 -1
- data/spec/api/client_spec.rb +61 -25
- data/spec/models/add_template_fields_request_spec.rb +1 -1
- data/spec/models/ai_field_naming_language_spec.rb +1 -1
- data/spec/models/authentication_check_spec.rb +1 -1
- data/spec/models/barcode_symbology_spec.rb +1 -1
- data/spec/models/check_character_spec.rb +1 -1
- data/spec/models/combined_field_type_spec.rb +1 -1
- data/spec/models/combined_pdf_files_spec.rb +1 -1
- data/spec/models/combined_pdf_list_spec.rb +1 -1
- data/spec/models/combined_pdf_source_input_spec.rb +1 -1
- data/spec/models/combined_pdf_source_pdf_spec.rb +1 -1
- data/spec/models/combined_pdf_source_spec.rb +1 -1
- data/spec/models/combined_pdf_source_type_spec.rb +1 -1
- data/spec/models/combined_pdf_spec.rb +1 -1
- data/spec/models/combined_pdf_state_spec.rb +1 -1
- data/spec/models/copy_template_request_spec.rb +1 -1
- data/spec/models/create_combined_pdf_request_spec.rb +1 -1
- data/spec/models/create_custom_file_from_upload_request_spec.rb +1 -1
- data/spec/models/create_folder_request_spec.rb +1 -1
- data/spec/models/create_signature_request_event_request_spec.rb +1 -1
- data/spec/models/create_signature_request_token_request_spec.rb +1 -1
- data/spec/models/create_submission_batch_request_spec.rb +1 -1
- data/spec/models/create_submission_request_spec.rb +1 -1
- data/spec/models/create_template_preview_request_spec.rb +36 -0
- data/spec/models/create_template_request_spec.rb +13 -1
- data/spec/models/create_webhook_request_spec.rb +1 -1
- data/spec/models/custom_file_list_spec.rb +1 -1
- data/spec/models/custom_file_source_pdf_spec.rb +1 -1
- data/spec/models/custom_file_spec.rb +1 -1
- data/spec/models/error_code_spec.rb +1 -1
- data/spec/models/error_detail_spec.rb +1 -1
- data/spec/models/error_info_spec.rb +1 -1
- data/spec/models/error_response_spec.rb +1 -1
- data/spec/models/expiration_interval_spec.rb +1 -1
- data/spec/models/field_comparison_condition_spec.rb +1 -1
- data/spec/models/field_comparison_operator_spec.rb +1 -1
- data/spec/models/field_dependency_input_spec.rb +1 -1
- data/spec/models/field_dependency_spec.rb +1 -1
- data/spec/models/field_display_type_spec.rb +1 -1
- data/spec/models/field_equals_condition_spec.rb +1 -1
- data/spec/models/field_equals_operator_spec.rb +1 -1
- data/spec/models/field_group_input_spec.rb +1 -1
- data/spec/models/field_group_spec.rb +1 -1
- data/spec/models/field_group_type_spec.rb +1 -1
- data/spec/models/field_in_condition_spec.rb +1 -1
- data/spec/models/field_input_spec.rb +1 -1
- data/spec/models/field_override_spec.rb +1 -1
- data/spec/models/field_presence_condition_spec.rb +1 -1
- data/spec/models/field_presence_operator_spec.rb +1 -1
- data/spec/models/field_range_condition_spec.rb +1 -1
- data/spec/models/field_reimport_state_spec.rb +1 -1
- data/spec/models/field_setup_logic_spec.rb +1 -1
- data/spec/models/field_setup_naming_spec.rb +1 -1
- data/spec/models/field_setup_source_spec.rb +1 -1
- data/spec/models/field_spec.rb +1 -1
- data/spec/models/field_type_spec.rb +1 -1
- data/spec/models/folder_list_spec.rb +1 -1
- data/spec/models/folder_spec.rb +1 -1
- data/spec/models/generate_files_format_spec.rb +1 -1
- data/spec/models/generate_submission_files_request_spec.rb +1 -1
- data/spec/models/generated_file_spec.rb +1 -1
- data/spec/models/generated_file_state_spec.rb +1 -1
- data/spec/models/html_engine_options_input_spec.rb +1 -1
- data/spec/models/html_engine_options_spec.rb +1 -1
- data/spec/models/image_gravity_spec.rb +1 -1
- data/spec/models/image_scale_type_spec.rb +1 -1
- data/spec/models/model_code_language_spec.rb +1 -1
- data/spec/models/move_folder_request_spec.rb +1 -1
- data/spec/models/move_template_request_spec.rb +1 -1
- data/spec/models/number_condition_type_spec.rb +1 -1
- data/spec/models/output_format_spec.rb +1 -1
- data/spec/models/page_format_spec.rb +1 -1
- data/spec/models/page_image_spec.rb +1 -1
- data/spec/models/page_images_spec.rb +1 -1
- data/spec/models/predefined_field_input_spec.rb +1 -1
- data/spec/models/predefined_field_spec.rb +1 -1
- data/spec/models/publish_template_version_request_spec.rb +1 -1
- data/spec/models/remove_template_fields_request_spec.rb +1 -1
- data/spec/models/rename_folder_request_spec.rb +1 -1
- data/spec/models/reorder_template_fields_request_spec.rb +1 -1
- data/spec/models/restore_template_version_request_spec.rb +1 -1
- data/spec/models/shape_type_spec.rb +1 -1
- data/spec/models/signature_request_auth_second_factor_type_spec.rb +1 -1
- data/spec/models/signature_request_auth_type_spec.rb +1 -1
- data/spec/models/signature_request_event_spec.rb +1 -1
- data/spec/models/signature_request_event_type_spec.rb +1 -1
- data/spec/models/signature_request_input_spec.rb +1 -1
- data/spec/models/signature_request_message_type_spec.rb +1 -1
- data/spec/models/signature_request_spec.rb +1 -1
- data/spec/models/signature_request_state_spec.rb +1 -1
- data/spec/models/signature_request_token_spec.rb +1 -1
- data/spec/models/signature_request_token_type_spec.rb +1 -1
- data/spec/models/string_condition_type_spec.rb +1 -1
- data/spec/models/submission_action_spec.rb +1 -1
- data/spec/models/submission_action_state_spec.rb +1 -1
- data/spec/models/submission_action_type_spec.rb +1 -1
- data/spec/models/submission_batch_spec.rb +1 -1
- data/spec/models/submission_batch_state_spec.rb +1 -1
- data/spec/models/submission_files_spec.rb +13 -1
- data/spec/models/submission_input_spec.rb +1 -1
- data/spec/models/submission_list_spec.rb +1 -1
- data/spec/models/submission_source_pdf_spec.rb +1 -1
- data/spec/models/submission_source_spec.rb +1 -1
- data/spec/models/submission_spec.rb +13 -13
- data/spec/models/submission_state_spec.rb +1 -1
- data/spec/models/submission_summary_spec.rb +144 -0
- data/spec/models/submission_validation_spec.rb +1 -1
- data/spec/models/template_actor_spec.rb +1 -1
- data/spec/models/template_actor_type_spec.rb +1 -1
- data/spec/models/template_defaults_input_spec.rb +1 -1
- data/spec/models/template_defaults_spec.rb +1 -1
- data/spec/models/template_diff_spec.rb +1 -1
- data/spec/models/template_diff_summary_spec.rb +1 -1
- data/spec/models/template_document_spec.rb +6 -6
- data/spec/models/template_document_state_spec.rb +1 -1
- data/spec/models/template_document_summary_spec.rb +54 -0
- data/spec/models/template_field_change_spec.rb +1 -1
- data/spec/models/template_field_changes_spec.rb +1 -1
- data/spec/models/template_field_dependency_action_spec.rb +1 -1
- data/spec/models/template_field_dependency_condition_input_spec.rb +1 -1
- data/spec/models/template_field_dependency_condition_spec.rb +1 -1
- data/spec/models/template_field_dependency_input_spec.rb +1 -1
- data/spec/models/template_field_dependency_match_spec.rb +1 -1
- data/spec/models/template_field_dependency_operator_spec.rb +1 -1
- data/spec/models/template_field_dependency_spec.rb +1 -1
- data/spec/models/template_field_logic_status_spec.rb +1 -1
- data/spec/models/template_field_move_spec.rb +1 -1
- data/spec/models/template_fields_spec.rb +1 -1
- data/spec/models/template_form_mode_spec.rb +1 -1
- data/spec/models/template_model_code_spec.rb +1 -1
- data/spec/models/template_page_ai_error_spec.rb +1 -1
- data/spec/models/template_page_ai_naming_status_spec.rb +1 -1
- data/spec/models/template_page_fields_status_spec.rb +1 -1
- data/spec/models/template_page_image_status_spec.rb +1 -1
- data/spec/models/template_page_images_spec.rb +1 -1
- data/spec/models/template_page_processing_status_spec.rb +1 -1
- data/spec/models/template_preview_spec.rb +78 -0
- data/spec/models/template_preview_state_spec.rb +30 -0
- data/spec/models/template_source_pdf_spec.rb +1 -1
- data/spec/models/template_spec.rb +35 -23
- data/spec/models/template_summary_list_spec.rb +1 -1
- data/spec/models/template_summary_spec.rb +6 -138
- data/spec/models/template_type_spec.rb +1 -1
- data/spec/models/template_version_spec.rb +1 -1
- data/spec/models/template_version_type_spec.rb +1 -1
- data/spec/models/text_alignment_spec.rb +1 -1
- data/spec/models/text_overflow_spec.rb +1 -1
- data/spec/models/text_vertical_alignment_spec.rb +1 -1
- data/spec/models/typeface_spec.rb +1 -1
- data/spec/models/update_signature_request_request_spec.rb +1 -1
- data/spec/models/update_template_document_request_spec.rb +1 -1
- data/spec/models/update_template_fields_request_spec.rb +1 -1
- data/spec/models/update_template_request_spec.rb +13 -1
- data/spec/models/update_webhook_request_spec.rb +1 -1
- data/spec/models/upload_method_spec.rb +1 -1
- data/spec/models/upload_presign_spec.rb +1 -1
- data/spec/models/url_source_pdf_spec.rb +1 -1
- data/spec/models/validate_submission_request_spec.rb +1 -1
- data/spec/models/webhook_event_type_spec.rb +1 -1
- data/spec/models/webhook_list_spec.rb +1 -1
- data/spec/models/webhook_mode_spec.rb +1 -1
- data/spec/models/webhook_spec.rb +1 -1
- data/spec/spec_helper.rb +1 -1
- metadata +25 -2
data/lib/docspring/api_client.rb
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#DocSpring API
|
|
3
3
|
|
|
4
|
-
#Use DocSpring's API to
|
|
4
|
+
#Use DocSpring's API to fill PDF forms, generate PDFs and Word documents from HTML or Word templates, merge PDFs, and request legally binding e-signatures.
|
|
5
5
|
|
|
6
6
|
The version of the OpenAPI document: v2
|
|
7
7
|
|
|
@@ -16,6 +16,7 @@ require 'logger'
|
|
|
16
16
|
require 'tempfile'
|
|
17
17
|
require 'time'
|
|
18
18
|
require 'typhoeus'
|
|
19
|
+
require 'docspring/date_time_values'
|
|
19
20
|
require 'docspring/ethon_multipart_put_fix'
|
|
20
21
|
|
|
21
22
|
|
|
@@ -33,7 +34,7 @@ module DocSpring
|
|
|
33
34
|
# @option config [Configuration] Configuration for initializing the object, default to Configuration.default
|
|
34
35
|
def initialize(config = Configuration.default)
|
|
35
36
|
@config = config
|
|
36
|
-
@user_agent = "docspring-ruby-4.
|
|
37
|
+
@user_agent = "docspring-ruby-4.3.0"
|
|
37
38
|
@default_headers = {
|
|
38
39
|
'Content-Type' => 'application/json',
|
|
39
40
|
'User-Agent' => @user_agent
|
|
@@ -49,6 +50,7 @@ module DocSpring
|
|
|
49
50
|
# @return [Array<(Object, Integer, Hash)>] an array of 3 elements:
|
|
50
51
|
# the data deserialized from response body (may be a Tempfile or nil), response status code and response headers.
|
|
51
52
|
def call_api(http_method, path, opts = {})
|
|
53
|
+
opts = opts.merge(query_params: DateTimeValues.serialize(opts[:query_params], query: true)) if opts[:query_params]
|
|
52
54
|
if @config.client_side_validation
|
|
53
55
|
form_params = opts[:form_params] || {}
|
|
54
56
|
RequestValidator.validate!(opts[:operation], query: opts[:query_params] || {}, body: form_params.empty? ? opts[:body] : form_params)
|
|
@@ -365,7 +367,7 @@ end
|
|
|
365
367
|
else
|
|
366
368
|
local_body = object_to_hash(model)
|
|
367
369
|
end
|
|
368
|
-
local_body.to_json
|
|
370
|
+
DateTimeValues.serialize(local_body).to_json
|
|
369
371
|
end
|
|
370
372
|
|
|
371
373
|
# Convert object(non-array) to hash.
|
data/lib/docspring/api_error.rb
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#DocSpring API
|
|
3
3
|
|
|
4
|
-
#Use DocSpring's API to
|
|
4
|
+
#Use DocSpring's API to fill PDF forms, generate PDFs and Word documents from HTML or Word templates, merge PDFs, and request legally binding e-signatures.
|
|
5
5
|
|
|
6
6
|
The version of the OpenAPI document: v2
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#DocSpring API
|
|
3
3
|
|
|
4
|
-
#Use DocSpring's API to
|
|
4
|
+
#Use DocSpring's API to fill PDF forms, generate PDFs and Word documents from HTML or Word templates, merge PDFs, and request legally binding e-signatures.
|
|
5
5
|
|
|
6
6
|
The version of the OpenAPI document: v2
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#DocSpring API
|
|
3
3
|
|
|
4
|
-
#Use DocSpring's API to
|
|
4
|
+
#Use DocSpring's API to fill PDF forms, generate PDFs and Word documents from HTML or Word templates, merge PDFs, and request legally binding e-signatures.
|
|
5
5
|
|
|
6
6
|
The version of the OpenAPI document: v2
|
|
7
7
|
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'date'
|
|
4
|
+
require 'time'
|
|
5
|
+
|
|
6
|
+
module DocSpring
|
|
7
|
+
# Dates and times in a request (a query parameter like created_after, or a model's date-time attribute), sent as the
|
|
8
|
+
# API reads them: RFC 3339 strings. Without this, a Time was sent as Time#to_s ("2026-10-20 09:00:00 UTC"), which
|
|
9
|
+
# the API rejects.
|
|
10
|
+
module DateTimeValues
|
|
11
|
+
# The value with each Time, DateTime and Date in it (inside hashes and arrays too) as a string. A Time or DateTime
|
|
12
|
+
# is RFC 3339, with its UTC offset, and its fraction of a second when it has one. A Date in the query is midnight
|
|
13
|
+
# UTC on that day, since the API's date filters (created_after) take a date-time. In a body it stays a date
|
|
14
|
+
# ("2026-10-28"), as JSON sent it before: a template's date fields take that, and reject a date-time.
|
|
15
|
+
# Anything else is left as it is.
|
|
16
|
+
def self.serialize(value, query: false)
|
|
17
|
+
case value
|
|
18
|
+
when Hash then value.transform_values { |item| serialize(item, query: query) }
|
|
19
|
+
when Array then value.map { |item| serialize(item, query: query) }
|
|
20
|
+
else
|
|
21
|
+
# is_a?, not case/when: ActiveSupport::TimeWithZone says it's a Time only through is_a?
|
|
22
|
+
if value.is_a?(Time) || value.is_a?(DateTime)
|
|
23
|
+
time = value.is_a?(DateTime) ? value.to_time : value
|
|
24
|
+
time.subsec == 0 ? time.iso8601 : time.iso8601(6)
|
|
25
|
+
elsif value.is_a?(Date)
|
|
26
|
+
query ? Time.utc(value.year, value.month, value.day).iso8601 : value.iso8601
|
|
27
|
+
else
|
|
28
|
+
value
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#DocSpring API
|
|
3
3
|
|
|
4
|
-
#Use DocSpring's API to
|
|
4
|
+
#Use DocSpring's API to fill PDF forms, generate PDFs and Word documents from HTML or Word templates, merge PDFs, and request legally binding e-signatures.
|
|
5
5
|
|
|
6
6
|
The version of the OpenAPI document: v2
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#DocSpring API
|
|
3
3
|
|
|
4
|
-
#Use DocSpring's API to
|
|
4
|
+
#Use DocSpring's API to fill PDF forms, generate PDFs and Word documents from HTML or Word templates, merge PDFs, and request legally binding e-signatures.
|
|
5
5
|
|
|
6
6
|
The version of the OpenAPI document: v2
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#DocSpring API
|
|
3
3
|
|
|
4
|
-
#Use DocSpring's API to
|
|
4
|
+
#Use DocSpring's API to fill PDF forms, generate PDFs and Word documents from HTML or Word templates, merge PDFs, and request legally binding e-signatures.
|
|
5
5
|
|
|
6
6
|
The version of the OpenAPI document: v2
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#DocSpring API
|
|
3
3
|
|
|
4
|
-
#Use DocSpring's API to
|
|
4
|
+
#Use DocSpring's API to fill PDF forms, generate PDFs and Word documents from HTML or Word templates, merge PDFs, and request legally binding e-signatures.
|
|
5
5
|
|
|
6
6
|
The version of the OpenAPI document: v2
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#DocSpring API
|
|
3
3
|
|
|
4
|
-
#Use DocSpring's API to
|
|
4
|
+
#Use DocSpring's API to fill PDF forms, generate PDFs and Word documents from HTML or Word templates, merge PDFs, and request legally binding e-signatures.
|
|
5
5
|
|
|
6
6
|
The version of the OpenAPI document: v2
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#DocSpring API
|
|
3
3
|
|
|
4
|
-
#Use DocSpring's API to
|
|
4
|
+
#Use DocSpring's API to fill PDF forms, generate PDFs and Word documents from HTML or Word templates, merge PDFs, and request legally binding e-signatures.
|
|
5
5
|
|
|
6
6
|
The version of the OpenAPI document: v2
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#DocSpring API
|
|
3
3
|
|
|
4
|
-
#Use DocSpring's API to
|
|
4
|
+
#Use DocSpring's API to fill PDF forms, generate PDFs and Word documents from HTML or Word templates, merge PDFs, and request legally binding e-signatures.
|
|
5
5
|
|
|
6
6
|
The version of the OpenAPI document: v2
|
|
7
7
|
|
|
@@ -25,7 +25,7 @@ module DocSpring
|
|
|
25
25
|
# The PDFs to merge, in order.
|
|
26
26
|
attr_accessor :source_pdfs
|
|
27
27
|
|
|
28
|
-
# Your own data about the combined PDF, such as an ID from your app.
|
|
28
|
+
# Your own data about the combined PDF, such as an ID from your app. Its `pdf_filename` key names the PDF's file (`files.pdf.filename`, and its download): a `.pdf` ending is removed, each run of characters other than letters, digits, `-`, `_` and `.` becomes one `_`, and the first 128 characters are kept, then `.pdf` is added. Without it, the file is named after the combined PDF's ID (`com_1234567890abcdef01.pdf`).
|
|
29
29
|
attr_accessor :metadata
|
|
30
30
|
|
|
31
31
|
# Whether the PDF needs a password to open (`password`).
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#DocSpring API
|
|
3
3
|
|
|
4
|
-
#Use DocSpring's API to
|
|
4
|
+
#Use DocSpring's API to fill PDF forms, generate PDFs and Word documents from HTML or Word templates, merge PDFs, and request legally binding e-signatures.
|
|
5
5
|
|
|
6
6
|
The version of the OpenAPI document: v2
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#DocSpring API
|
|
3
3
|
|
|
4
|
-
#Use DocSpring's API to
|
|
4
|
+
#Use DocSpring's API to fill PDF forms, generate PDFs and Word documents from HTML or Word templates, merge PDFs, and request legally binding e-signatures.
|
|
5
5
|
|
|
6
6
|
The version of the OpenAPI document: v2
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#DocSpring API
|
|
3
3
|
|
|
4
|
-
#Use DocSpring's API to
|
|
4
|
+
#Use DocSpring's API to fill PDF forms, generate PDFs and Word documents from HTML or Word templates, merge PDFs, and request legally binding e-signatures.
|
|
5
5
|
|
|
6
6
|
The version of the OpenAPI document: v2
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#DocSpring API
|
|
3
3
|
|
|
4
|
-
#Use DocSpring's API to
|
|
4
|
+
#Use DocSpring's API to fill PDF forms, generate PDFs and Word documents from HTML or Word templates, merge PDFs, and request legally binding e-signatures.
|
|
5
5
|
|
|
6
6
|
The version of the OpenAPI document: v2
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#DocSpring API
|
|
3
3
|
|
|
4
|
-
#Use DocSpring's API to
|
|
4
|
+
#Use DocSpring's API to fill PDF forms, generate PDFs and Word documents from HTML or Word templates, merge PDFs, and request legally binding e-signatures.
|
|
5
5
|
|
|
6
6
|
The version of the OpenAPI document: v2
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#DocSpring API
|
|
3
3
|
|
|
4
|
-
#Use DocSpring's API to
|
|
4
|
+
#Use DocSpring's API to fill PDF forms, generate PDFs and Word documents from HTML or Word templates, merge PDFs, and request legally binding e-signatures.
|
|
5
5
|
|
|
6
6
|
The version of the OpenAPI document: v2
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#DocSpring API
|
|
3
3
|
|
|
4
|
-
#Use DocSpring's API to
|
|
4
|
+
#Use DocSpring's API to fill PDF forms, generate PDFs and Word documents from HTML or Word templates, merge PDFs, and request legally binding e-signatures.
|
|
5
5
|
|
|
6
6
|
The version of the OpenAPI document: v2
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#DocSpring API
|
|
3
3
|
|
|
4
|
-
#Use DocSpring's API to
|
|
4
|
+
#Use DocSpring's API to fill PDF forms, generate PDFs and Word documents from HTML or Word templates, merge PDFs, and request legally binding e-signatures.
|
|
5
5
|
|
|
6
6
|
The version of the OpenAPI document: v2
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#DocSpring API
|
|
3
3
|
|
|
4
|
-
#Use DocSpring's API to
|
|
4
|
+
#Use DocSpring's API to fill PDF forms, generate PDFs and Word documents from HTML or Word templates, merge PDFs, and request legally binding e-signatures.
|
|
5
5
|
|
|
6
6
|
The version of the OpenAPI document: v2
|
|
7
7
|
|
|
@@ -19,7 +19,7 @@ module DocSpring
|
|
|
19
19
|
# The PDFs to merge, in order.
|
|
20
20
|
attr_accessor :source_pdfs
|
|
21
21
|
|
|
22
|
-
# Your own data about the combined PDF, such as an ID from your app.
|
|
22
|
+
# Your own data about the combined PDF, such as an ID from your app. Its `pdf_filename` key names the PDF's file (`files.pdf.filename`, and its download): a `.pdf` ending is removed, each run of characters other than letters, digits, `-`, `_` and `.` becomes one `_`, and the first 128 characters are kept, then `.pdf` is added. Without it, the file is named after the combined PDF's ID (`com_1234567890abcdef01.pdf`).
|
|
23
23
|
attr_accessor :metadata
|
|
24
24
|
|
|
25
25
|
# A password that the PDF needs to be opened with. It's never returned; `has_password` says if it's set.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#DocSpring API
|
|
3
3
|
|
|
4
|
-
#Use DocSpring's API to
|
|
4
|
+
#Use DocSpring's API to fill PDF forms, generate PDFs and Word documents from HTML or Word templates, merge PDFs, and request legally binding e-signatures.
|
|
5
5
|
|
|
6
6
|
The version of the OpenAPI document: v2
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#DocSpring API
|
|
3
3
|
|
|
4
|
-
#Use DocSpring's API to
|
|
4
|
+
#Use DocSpring's API to fill PDF forms, generate PDFs and Word documents from HTML or Word templates, merge PDFs, and request legally binding e-signatures.
|
|
5
5
|
|
|
6
6
|
The version of the OpenAPI document: v2
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#DocSpring API
|
|
3
3
|
|
|
4
|
-
#Use DocSpring's API to
|
|
4
|
+
#Use DocSpring's API to fill PDF forms, generate PDFs and Word documents from HTML or Word templates, merge PDFs, and request legally binding e-signatures.
|
|
5
5
|
|
|
6
6
|
The version of the OpenAPI document: v2
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#DocSpring API
|
|
3
3
|
|
|
4
|
-
#Use DocSpring's API to
|
|
4
|
+
#Use DocSpring's API to fill PDF forms, generate PDFs and Word documents from HTML or Word templates, merge PDFs, and request legally binding e-signatures.
|
|
5
5
|
|
|
6
6
|
The version of the OpenAPI document: v2
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#DocSpring API
|
|
3
3
|
|
|
4
|
-
#Use DocSpring's API to
|
|
4
|
+
#Use DocSpring's API to fill PDF forms, generate PDFs and Word documents from HTML or Word templates, merge PDFs, and request legally binding e-signatures.
|
|
5
5
|
|
|
6
6
|
The version of the OpenAPI document: v2
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#DocSpring API
|
|
3
3
|
|
|
4
|
-
#Use DocSpring's API to
|
|
4
|
+
#Use DocSpring's API to fill PDF forms, generate PDFs and Word documents from HTML or Word templates, merge PDFs, and request legally binding e-signatures.
|
|
5
5
|
|
|
6
6
|
The version of the OpenAPI document: v2
|
|
7
7
|
|
|
@@ -22,16 +22,16 @@ module DocSpring
|
|
|
22
22
|
# `true` keeps the PDF's text and check fields fillable, and `false` flattens every field. Left out, the template decides: its `editable_submissions` setting, or each field's own Editable option. A response shows the template's setting when the request left this out. Can't be `true` with `signature_requests`.
|
|
23
23
|
attr_accessor :editable
|
|
24
24
|
|
|
25
|
-
# The values of the template's fields, by field name. Required for
|
|
25
|
+
# The values of the template's fields, by field name. Required for PDF and Word templates, unless `signature_requests` collects them (PDF templates only).
|
|
26
26
|
attr_accessor :data
|
|
27
27
|
|
|
28
|
-
# Your own data about the submission, such as an ID from your app. It isn't printed on the PDF.
|
|
28
|
+
# Your own data about the submission, such as an ID from your app. It isn't printed on the PDF. Two keys also change the PDF: `pdf_filename` names its file (`files.pdf.filename`, and its download), and `pdf_title` is its title in the PDF's document properties (and an HTML template's `<title>`, unless its HTML has one). Without `pdf_title`, the title is the template's name. In `pdf_filename`, a `.pdf` ending is removed, each run of characters other than letters, digits, `-`, `_` and `.` becomes one `_`, and the first 128 characters are kept, then `.pdf` is added. Without it, the file is named after the submission's ID (`sub_1234567890abcdef01.pdf`).
|
|
29
29
|
attr_accessor :metadata
|
|
30
30
|
|
|
31
|
-
# A password that the PDF needs to be opened with. It's never returned; `has_password` says if it's set.
|
|
31
|
+
# A password that the PDF needs to be opened with. It's never returned; `has_password` says if it's set. Word documents and OpenDocument files can't be password-protected, so a submission with a password can't make them.
|
|
32
32
|
attr_accessor :password
|
|
33
33
|
|
|
34
|
-
# What the submission makes: `pdf`, and `png` (an image of each page of the PDF, up to 100 pages) when you ask for it. Default `["pdf"]`. POST /submissions/{submission_id}/generate_files adds `png` to a processed submission.
|
|
34
|
+
# What the submission makes: `pdf`, `docx` (a Word document, from a Word template), `odt` (an OpenDocument file, the format LibreOffice uses, converted from a Word template's Word document), and `png` (an image of each page of the PDF, up to 100 pages, which adds `pdf`) when you ask for it. Default `["pdf"]`, or a Word template's `output_format`. POST /submissions/{submission_id}/generate_files adds `png`, and a Word template's submission's `pdf`, `docx` or `odt`, to a processed submission.
|
|
35
35
|
attr_accessor :output_formats
|
|
36
36
|
|
|
37
37
|
# Seconds after the PDF is generated until the submission expires, up to 10 years (315360000). Default the template's expiration setting. A submission that isn't processed, such as one with invalid data, is kept for at least 48 hours.
|
|
@@ -43,7 +43,7 @@ module DocSpring
|
|
|
43
43
|
# For an HTML template, HTML to use instead of the template's.
|
|
44
44
|
attr_accessor :html
|
|
45
45
|
|
|
46
|
-
# For an HTML template, CSS
|
|
46
|
+
# For an HTML template, SCSS (plain CSS works too) added after the template's styles, on the page and in its header and footer. It doesn't replace them: its rules come later, so they win over the template's rules of the same specificity.
|
|
47
47
|
attr_accessor :css
|
|
48
48
|
|
|
49
49
|
# The people who sign the PDF, and fill in their fields first. The PDF is generated once every signature request is completed. PDF templates only. Without `role`s, the first signature request is `Signer 1`, the second `Signer 2`, and so on. To leave a signer out, give every signature request its `role` and leave that one's out. Only the signers sign: a value for a signature or initials field in `data` makes the submission `invalid_data`.
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#DocSpring API
|
|
3
|
+
|
|
4
|
+
#Use DocSpring's API to fill PDF forms, generate PDFs and Word documents from HTML or Word templates, merge PDFs, and request legally binding e-signatures.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: v2
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.26.0-DOCSPRING
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module DocSpring
|
|
17
|
+
# The data to render the template with.
|
|
18
|
+
class CreateTemplatePreviewRequest < ApiModelBase
|
|
19
|
+
# The values of the template's fields, by field name, as you'd send them to create a submission. They're rendered as they are: they aren't checked against the template's fields. A value that a field can't print, such as an image URL that doesn't download, makes the preview's `state` `error`, with an `error_message`.
|
|
20
|
+
attr_accessor :data
|
|
21
|
+
|
|
22
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
23
|
+
def self.attribute_map
|
|
24
|
+
{
|
|
25
|
+
:'data' => :'data'
|
|
26
|
+
}
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
# Returns attribute mapping this model knows about
|
|
30
|
+
def self.acceptable_attribute_map
|
|
31
|
+
attribute_map
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
# Returns all the JSON keys this model knows about
|
|
35
|
+
def self.acceptable_attributes
|
|
36
|
+
acceptable_attribute_map.values
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
# Attribute type mapping.
|
|
40
|
+
def self.openapi_types
|
|
41
|
+
{
|
|
42
|
+
:'data' => :'Hash<String, Object>'
|
|
43
|
+
}
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# List of attributes with nullable: true
|
|
47
|
+
def self.openapi_nullable
|
|
48
|
+
Set.new([
|
|
49
|
+
])
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# Returns attribute type mapping
|
|
53
|
+
def self.acceptable_openapi_types
|
|
54
|
+
openapi_types
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# Returns the nullable attributes
|
|
58
|
+
def self.acceptable_openapi_nullable
|
|
59
|
+
openapi_nullable
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# Initializes the object
|
|
63
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
64
|
+
def initialize(attributes = {})
|
|
65
|
+
if (!attributes.is_a?(Hash))
|
|
66
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `DocSpring::CreateTemplatePreviewRequest` initialize method"
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
70
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
71
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
72
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
73
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `DocSpring::CreateTemplatePreviewRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
74
|
+
end
|
|
75
|
+
h[k.to_sym] = v
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
if attributes.key?(:'data')
|
|
79
|
+
if (value = attributes[:'data']).is_a?(Hash)
|
|
80
|
+
self.data = value
|
|
81
|
+
end
|
|
82
|
+
else
|
|
83
|
+
self.data = nil
|
|
84
|
+
end
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
88
|
+
# @return Array for valid properties with the reasons
|
|
89
|
+
def list_invalid_properties
|
|
90
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
91
|
+
invalid_properties = Array.new
|
|
92
|
+
if @data.nil?
|
|
93
|
+
invalid_properties.push('invalid value for "data", data cannot be nil.')
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
invalid_properties
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
# Check to see if the all the properties in the model are valid
|
|
100
|
+
# @return true if the model is valid
|
|
101
|
+
def valid?
|
|
102
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
103
|
+
return false if @data.nil?
|
|
104
|
+
true
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
# Custom attribute writer method with validation
|
|
108
|
+
# @param [Object] data Value to be assigned
|
|
109
|
+
def data=(data)
|
|
110
|
+
if data.nil?
|
|
111
|
+
fail ArgumentError, 'data cannot be nil'
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
@data = data
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
# Checks equality by comparing each attribute.
|
|
118
|
+
# @param [Object] Object to be compared
|
|
119
|
+
def ==(o)
|
|
120
|
+
return true if self.equal?(o)
|
|
121
|
+
self.class == o.class &&
|
|
122
|
+
data == o.data
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
# @see the `==` method
|
|
126
|
+
# @param [Object] Object to be compared
|
|
127
|
+
def eql?(o)
|
|
128
|
+
self == o
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
# Calculates hash code according to all attributes.
|
|
132
|
+
# @return [Integer] Hash code
|
|
133
|
+
def hash
|
|
134
|
+
[data].hash
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
# Builds the object from hash
|
|
138
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
139
|
+
# @return [Object] Returns the model itself
|
|
140
|
+
def self.build_from_hash(attributes)
|
|
141
|
+
return nil unless attributes.is_a?(Hash)
|
|
142
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
143
|
+
# include attributes inherited from allOf parents (the nearest declaration wins)
|
|
144
|
+
map = acceptable_attribute_map
|
|
145
|
+
transformed_hash = {}
|
|
146
|
+
acceptable_openapi_types.each_pair do |key, type|
|
|
147
|
+
if attributes.key?(map[key]) && attributes[map[key]].nil?
|
|
148
|
+
transformed_hash["#{key}"] = nil
|
|
149
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
150
|
+
# check to ensure the input is an array given that the attribute
|
|
151
|
+
# is documented as an array but the input is not
|
|
152
|
+
if attributes[map[key]].is_a?(Array)
|
|
153
|
+
transformed_hash["#{key}"] = attributes[map[key]].map { |v| _deserialize($1, v) }
|
|
154
|
+
end
|
|
155
|
+
elsif !attributes[map[key]].nil?
|
|
156
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[map[key]])
|
|
157
|
+
end
|
|
158
|
+
end
|
|
159
|
+
# Responses can include enum values added after this client was released, so the enum setters
|
|
160
|
+
# accept any value while the model is built from a response
|
|
161
|
+
allocate.tap do |model|
|
|
162
|
+
model.instance_variable_set(:@_skip_enum_validation, true)
|
|
163
|
+
model.send(:initialize, transformed_hash)
|
|
164
|
+
model.remove_instance_variable(:@_skip_enum_validation)
|
|
165
|
+
end
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
# Returns the object in the form of hash
|
|
169
|
+
# @return [Hash] Returns the object in the form of hash
|
|
170
|
+
def to_hash
|
|
171
|
+
hash = {}
|
|
172
|
+
# include attributes inherited from allOf parents (the nearest declaration wins)
|
|
173
|
+
self.class.acceptable_attribute_map.each_pair do |attr, param|
|
|
174
|
+
value = self.send(attr)
|
|
175
|
+
if value.nil?
|
|
176
|
+
is_nullable = self.class.acceptable_openapi_nullable.include?(attr)
|
|
177
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
178
|
+
end
|
|
179
|
+
|
|
180
|
+
hash[param] = _to_hash(value)
|
|
181
|
+
end
|
|
182
|
+
hash
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
end
|
|
186
|
+
|
|
187
|
+
end
|