pdf_generator_api_client 4.0.25
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 +7 -0
- data/Gemfile +9 -0
- data/README.md +519 -0
- data/Rakefile +10 -0
- data/docs/AccessibilityOption.md +15 -0
- data/docs/AddWatermarkRequest.md +49 -0
- data/docs/AssetsApi.md +77 -0
- data/docs/AsyncOutputParam.md +15 -0
- data/docs/CallbackParam.md +20 -0
- data/docs/Component.md +34 -0
- data/docs/ConversionApi.md +217 -0
- data/docs/ConvertHTML2PDFRequest.md +26 -0
- data/docs/ConvertPDF2ImageRequest.md +32 -0
- data/docs/ConvertURL2PDFRequest.md +26 -0
- data/docs/CopyTemplateRequest.md +18 -0
- data/docs/CreateEInvoiceRequest.md +22 -0
- data/docs/CreateFacturXEInvoiceRequest.md +26 -0
- data/docs/CreateFacturXEInvoiceRequestTemplate.md +22 -0
- data/docs/CreateWorkspaceRequest.md +18 -0
- data/docs/DataBatchInner.md +20 -0
- data/docs/Document.md +26 -0
- data/docs/DocumentsApi.md +646 -0
- data/docs/EInvoicesApi.md +284 -0
- data/docs/EncryptAndDecryptBase64.md +26 -0
- data/docs/EncryptAndDecryptUrl.md +26 -0
- data/docs/EncryptDocumentRequest.md +49 -0
- data/docs/ExtractFormFieldsRequest.md +49 -0
- data/docs/FillFormFieldsRequest.md +49 -0
- data/docs/FormActionDownload.md +18 -0
- data/docs/FormActionSend.md +18 -0
- data/docs/FormActionSendSendDocument.md +20 -0
- data/docs/FormActionSendSendDocumentHeadersInner.md +20 -0
- data/docs/FormActionStore.md +18 -0
- data/docs/FormConfiguration.md +22 -0
- data/docs/FormConfigurationNew.md +26 -0
- data/docs/FormConfigurationNewActionsInner.md +22 -0
- data/docs/FormFieldsBase64.md +20 -0
- data/docs/FormFieldsInner.md +24 -0
- data/docs/FormFieldsUrl.md +20 -0
- data/docs/FormFillBase64.md +24 -0
- data/docs/FormFillUrl.md +24 -0
- data/docs/FormatParam.md +15 -0
- data/docs/FormsApi.md +639 -0
- data/docs/GenerateDocumentAsynchronousRequest.md +32 -0
- data/docs/GenerateDocumentBatchAsynchronousRequest.md +30 -0
- data/docs/GenerateDocumentBatchRequest.md +28 -0
- data/docs/GenerateDocumentRequest.md +30 -0
- data/docs/GenerateQRCode201Response.md +20 -0
- data/docs/GenerateQRCode201ResponseMeta.md +20 -0
- data/docs/GenerateQRCodeRequest.md +26 -0
- data/docs/GetStatus200Response.md +28 -0
- data/docs/GetTemplateLibrary200Response.md +18 -0
- data/docs/GetTemplateVersion422Response.md +18 -0
- data/docs/ImportFormBase64.md +20 -0
- data/docs/ImportFormRequest.md +49 -0
- data/docs/ImportFormUrl.md +20 -0
- data/docs/ImportTemplateBase64.md +20 -0
- data/docs/ImportTemplateRequest.md +49 -0
- data/docs/ImportTemplateUrl.md +20 -0
- data/docs/ImportTemplateUrlTemplate.md +18 -0
- data/docs/InlineObject.md +20 -0
- data/docs/InlineObject1.md +18 -0
- data/docs/InlineObject10.md +20 -0
- data/docs/InlineObject10Meta.md +24 -0
- data/docs/InlineObject11.md +20 -0
- data/docs/InlineObject11Meta.md +26 -0
- data/docs/InlineObject12.md +20 -0
- data/docs/InlineObject12Meta.md +28 -0
- data/docs/InlineObject12MetaStats.md +20 -0
- data/docs/InlineObject13.md +20 -0
- data/docs/InlineObject14.md +18 -0
- data/docs/InlineObject14ResponseValue.md +46 -0
- data/docs/InlineObject14ResponseValueDefault.md +51 -0
- data/docs/InlineObject14ResponseValueValue.md +51 -0
- data/docs/InlineObject15.md +20 -0
- data/docs/InlineObject16.md +20 -0
- data/docs/InlineObject17.md +18 -0
- data/docs/InlineObject18.md +20 -0
- data/docs/InlineObject18Meta.md +18 -0
- data/docs/InlineObject19.md +18 -0
- data/docs/InlineObject1Response.md +18 -0
- data/docs/InlineObject2.md +18 -0
- data/docs/InlineObject20.md +18 -0
- data/docs/InlineObject20Response.md +18 -0
- data/docs/InlineObject21.md +18 -0
- data/docs/InlineObject22.md +18 -0
- data/docs/InlineObject23.md +18 -0
- data/docs/InlineObject24.md +18 -0
- data/docs/InlineObject25.md +20 -0
- data/docs/InlineObject26.md +18 -0
- data/docs/InlineObject27.md +18 -0
- data/docs/InlineObject3.md +18 -0
- data/docs/InlineObject4.md +20 -0
- data/docs/InlineObject5.md +20 -0
- data/docs/InlineObject6.md +20 -0
- data/docs/InlineObject7.md +18 -0
- data/docs/InlineObject7Response.md +18 -0
- data/docs/InlineObject8.md +18 -0
- data/docs/InlineObject9.md +20 -0
- data/docs/InlineObject9Meta.md +26 -0
- data/docs/InlineObjectMeta.md +20 -0
- data/docs/KeyFieldParam.md +15 -0
- data/docs/MakeAccessibleBase64.md +26 -0
- data/docs/MakeAccessibleRequest.md +49 -0
- data/docs/MakeAccessibleUrl.md +26 -0
- data/docs/MetadataParam.md +20 -0
- data/docs/MiscApi.md +74 -0
- data/docs/OpenEditorRequest.md +20 -0
- data/docs/OpenEditorRequestData.md +49 -0
- data/docs/OptimizeBase64.md +22 -0
- data/docs/OptimizeDocumentRequest.md +49 -0
- data/docs/OptimizeUrl.md +22 -0
- data/docs/OutputParam.md +15 -0
- data/docs/PaginationMeta.md +22 -0
- data/docs/PromoteTemplateVersion200Response.md +18 -0
- data/docs/PublicTemplateLibraryItem.md +26 -0
- data/docs/ServicesApi.md +497 -0
- data/docs/StatusParam.md +15 -0
- data/docs/StoreDocumentRequest.md +24 -0
- data/docs/Template.md +28 -0
- data/docs/TemplateDefinition.md +32 -0
- data/docs/TemplateDefinitionDataSettings.md +20 -0
- data/docs/TemplateDefinitionEditor.md +18 -0
- data/docs/TemplateDefinitionNew.md +34 -0
- data/docs/TemplateDefinitionNewDataSettings.md +22 -0
- data/docs/TemplateDefinitionNewEditor.md +18 -0
- data/docs/TemplateDefinitionNewLayout.md +34 -0
- data/docs/TemplateDefinitionNewLayoutMargins.md +24 -0
- data/docs/TemplateDefinitionNewLayoutRepeatLayout.md +22 -0
- data/docs/TemplateDefinitionNewPagesInner.md +32 -0
- data/docs/TemplateDefinitionNewPagesInnerMargins.md +20 -0
- data/docs/TemplateDefinitionPagesInner.md +24 -0
- data/docs/TemplateLibraryApi.md +139 -0
- data/docs/TemplateParam.md +22 -0
- data/docs/TemplateParamData.md +49 -0
- data/docs/TemplateParamId.md +49 -0
- data/docs/TemplateVersion.md +36 -0
- data/docs/TemplateVersionCollection.md +20 -0
- data/docs/TemplateVersionCollectionMeta.md +22 -0
- data/docs/TemplateVersionsApi.md +298 -0
- data/docs/TemplatesApi.md +791 -0
- data/docs/WatermarkBase64.md +24 -0
- data/docs/WatermarkFileUrlWatermark.md +20 -0
- data/docs/WatermarkImage.md +26 -0
- data/docs/WatermarkImageContentBase64.md +24 -0
- data/docs/WatermarkImageContentUrl.md +24 -0
- data/docs/WatermarkPosition.md +15 -0
- data/docs/WatermarkText.md +28 -0
- data/docs/Workspace.md +24 -0
- data/docs/WorkspacesApi.md +292 -0
- data/git_push.sh +57 -0
- data/lib/pdf_generator_api_client/api/assets_api.rb +90 -0
- data/lib/pdf_generator_api_client/api/conversion_api.rb +226 -0
- data/lib/pdf_generator_api_client/api/documents_api.rb +623 -0
- data/lib/pdf_generator_api_client/api/e_invoices_api.rb +283 -0
- data/lib/pdf_generator_api_client/api/forms_api.rb +604 -0
- data/lib/pdf_generator_api_client/api/misc_api.rb +79 -0
- data/lib/pdf_generator_api_client/api/services_api.rb +498 -0
- data/lib/pdf_generator_api_client/api/template_library_api.rb +145 -0
- data/lib/pdf_generator_api_client/api/template_versions_api.rb +298 -0
- data/lib/pdf_generator_api_client/api/templates_api.rb +766 -0
- data/lib/pdf_generator_api_client/api/workspaces_api.rb +275 -0
- data/lib/pdf_generator_api_client/api_client.rb +393 -0
- data/lib/pdf_generator_api_client/api_error.rb +58 -0
- data/lib/pdf_generator_api_client/configuration.rb +309 -0
- data/lib/pdf_generator_api_client/models/accessibility_option.rb +47 -0
- data/lib/pdf_generator_api_client/models/add_watermark_request.rb +105 -0
- data/lib/pdf_generator_api_client/models/async_output_param.rb +41 -0
- data/lib/pdf_generator_api_client/models/callback_param.rb +232 -0
- data/lib/pdf_generator_api_client/models/component.rb +336 -0
- data/lib/pdf_generator_api_client/models/convert_html2_pdf_request.rb +324 -0
- data/lib/pdf_generator_api_client/models/convert_pdf2_image_request.rb +422 -0
- data/lib/pdf_generator_api_client/models/convert_url2_pdf_request.rb +324 -0
- data/lib/pdf_generator_api_client/models/copy_template_request.rb +221 -0
- data/lib/pdf_generator_api_client/models/create_e_invoice_request.rb +308 -0
- data/lib/pdf_generator_api_client/models/create_factur_xe_invoice_request.rb +315 -0
- data/lib/pdf_generator_api_client/models/create_factur_xe_invoice_request_template.rb +242 -0
- data/lib/pdf_generator_api_client/models/create_workspace_request.rb +221 -0
- data/lib/pdf_generator_api_client/models/data_batch_inner.rb +231 -0
- data/lib/pdf_generator_api_client/models/document.rb +261 -0
- data/lib/pdf_generator_api_client/models/encrypt_and_decrypt_base64.rb +331 -0
- data/lib/pdf_generator_api_client/models/encrypt_and_decrypt_url.rb +331 -0
- data/lib/pdf_generator_api_client/models/encrypt_document_request.rb +105 -0
- data/lib/pdf_generator_api_client/models/extract_form_fields_request.rb +105 -0
- data/lib/pdf_generator_api_client/models/fill_form_fields_request.rb +105 -0
- data/lib/pdf_generator_api_client/models/form_action_download.rb +221 -0
- data/lib/pdf_generator_api_client/models/form_action_send.rb +221 -0
- data/lib/pdf_generator_api_client/models/form_action_send_send_document.rb +250 -0
- data/lib/pdf_generator_api_client/models/form_action_send_send_document_headers_inner.rb +283 -0
- data/lib/pdf_generator_api_client/models/form_action_store.rb +221 -0
- data/lib/pdf_generator_api_client/models/form_configuration.rb +290 -0
- data/lib/pdf_generator_api_client/models/form_configuration_new.rb +264 -0
- data/lib/pdf_generator_api_client/models/form_configuration_new_actions_inner.rb +105 -0
- data/lib/pdf_generator_api_client/models/form_fields_base64.rb +271 -0
- data/lib/pdf_generator_api_client/models/form_fields_inner.rb +286 -0
- data/lib/pdf_generator_api_client/models/form_fields_url.rb +271 -0
- data/lib/pdf_generator_api_client/models/form_fill_base64.rb +321 -0
- data/lib/pdf_generator_api_client/models/form_fill_url.rb +321 -0
- data/lib/pdf_generator_api_client/models/format_param.rb +40 -0
- data/lib/pdf_generator_api_client/models/generate_document_asynchronous_request.rb +318 -0
- data/lib/pdf_generator_api_client/models/generate_document_batch_asynchronous_request.rb +308 -0
- data/lib/pdf_generator_api_client/models/generate_document_batch_request.rb +299 -0
- data/lib/pdf_generator_api_client/models/generate_document_request.rb +309 -0
- data/lib/pdf_generator_api_client/models/generate_qr_code201_response.rb +230 -0
- data/lib/pdf_generator_api_client/models/generate_qr_code201_response_meta.rb +231 -0
- data/lib/pdf_generator_api_client/models/generate_qr_code_request.rb +316 -0
- data/lib/pdf_generator_api_client/models/get_status200_response.rb +299 -0
- data/lib/pdf_generator_api_client/models/get_template_library200_response.rb +222 -0
- data/lib/pdf_generator_api_client/models/get_template_version422_response.rb +220 -0
- data/lib/pdf_generator_api_client/models/import_form_base64.rb +247 -0
- data/lib/pdf_generator_api_client/models/import_form_request.rb +105 -0
- data/lib/pdf_generator_api_client/models/import_form_url.rb +247 -0
- data/lib/pdf_generator_api_client/models/import_template_base64.rb +264 -0
- data/lib/pdf_generator_api_client/models/import_template_request.rb +105 -0
- data/lib/pdf_generator_api_client/models/import_template_url.rb +264 -0
- data/lib/pdf_generator_api_client/models/import_template_url_template.rb +238 -0
- data/lib/pdf_generator_api_client/models/inline_object.rb +230 -0
- data/lib/pdf_generator_api_client/models/inline_object1.rb +220 -0
- data/lib/pdf_generator_api_client/models/inline_object10.rb +232 -0
- data/lib/pdf_generator_api_client/models/inline_object10_meta.rb +251 -0
- data/lib/pdf_generator_api_client/models/inline_object11.rb +230 -0
- data/lib/pdf_generator_api_client/models/inline_object11_meta.rb +261 -0
- data/lib/pdf_generator_api_client/models/inline_object12.rb +230 -0
- data/lib/pdf_generator_api_client/models/inline_object12_meta.rb +270 -0
- data/lib/pdf_generator_api_client/models/inline_object12_meta_stats.rb +231 -0
- data/lib/pdf_generator_api_client/models/inline_object13.rb +265 -0
- data/lib/pdf_generator_api_client/models/inline_object14.rb +223 -0
- data/lib/pdf_generator_api_client/models/inline_object14_response_value.rb +401 -0
- data/lib/pdf_generator_api_client/models/inline_object14_response_value_default.rb +107 -0
- data/lib/pdf_generator_api_client/models/inline_object14_response_value_value.rb +107 -0
- data/lib/pdf_generator_api_client/models/inline_object15.rb +231 -0
- data/lib/pdf_generator_api_client/models/inline_object16.rb +229 -0
- data/lib/pdf_generator_api_client/models/inline_object17.rb +220 -0
- data/lib/pdf_generator_api_client/models/inline_object18.rb +230 -0
- data/lib/pdf_generator_api_client/models/inline_object18_meta.rb +221 -0
- data/lib/pdf_generator_api_client/models/inline_object19.rb +221 -0
- data/lib/pdf_generator_api_client/models/inline_object1_response.rb +223 -0
- data/lib/pdf_generator_api_client/models/inline_object2.rb +220 -0
- data/lib/pdf_generator_api_client/models/inline_object20.rb +220 -0
- data/lib/pdf_generator_api_client/models/inline_object20_response.rb +221 -0
- data/lib/pdf_generator_api_client/models/inline_object21.rb +255 -0
- data/lib/pdf_generator_api_client/models/inline_object22.rb +255 -0
- data/lib/pdf_generator_api_client/models/inline_object23.rb +255 -0
- data/lib/pdf_generator_api_client/models/inline_object24.rb +255 -0
- data/lib/pdf_generator_api_client/models/inline_object25.rb +231 -0
- data/lib/pdf_generator_api_client/models/inline_object26.rb +221 -0
- data/lib/pdf_generator_api_client/models/inline_object27.rb +221 -0
- data/lib/pdf_generator_api_client/models/inline_object3.rb +220 -0
- data/lib/pdf_generator_api_client/models/inline_object4.rb +231 -0
- data/lib/pdf_generator_api_client/models/inline_object5.rb +231 -0
- data/lib/pdf_generator_api_client/models/inline_object6.rb +231 -0
- data/lib/pdf_generator_api_client/models/inline_object7.rb +220 -0
- data/lib/pdf_generator_api_client/models/inline_object7_response.rb +220 -0
- data/lib/pdf_generator_api_client/models/inline_object8.rb +220 -0
- data/lib/pdf_generator_api_client/models/inline_object9.rb +230 -0
- data/lib/pdf_generator_api_client/models/inline_object9_meta.rb +261 -0
- data/lib/pdf_generator_api_client/models/inline_object_meta.rb +231 -0
- data/lib/pdf_generator_api_client/models/key_field_param.rb +40 -0
- data/lib/pdf_generator_api_client/models/make_accessible_base64.rb +315 -0
- data/lib/pdf_generator_api_client/models/make_accessible_request.rb +105 -0
- data/lib/pdf_generator_api_client/models/make_accessible_url.rb +315 -0
- data/lib/pdf_generator_api_client/models/metadata_param.rb +236 -0
- data/lib/pdf_generator_api_client/models/open_editor_request.rb +264 -0
- data/lib/pdf_generator_api_client/models/open_editor_request_data.rb +106 -0
- data/lib/pdf_generator_api_client/models/optimize_base64.rb +294 -0
- data/lib/pdf_generator_api_client/models/optimize_document_request.rb +105 -0
- data/lib/pdf_generator_api_client/models/optimize_url.rb +294 -0
- data/lib/pdf_generator_api_client/models/output_param.rb +42 -0
- data/lib/pdf_generator_api_client/models/pagination_meta.rb +239 -0
- data/lib/pdf_generator_api_client/models/promote_template_version200_response.rb +220 -0
- data/lib/pdf_generator_api_client/models/public_template_library_item.rb +265 -0
- data/lib/pdf_generator_api_client/models/status_param.rb +40 -0
- data/lib/pdf_generator_api_client/models/store_document_request.rb +289 -0
- data/lib/pdf_generator_api_client/models/template.rb +274 -0
- data/lib/pdf_generator_api_client/models/template_definition.rb +292 -0
- data/lib/pdf_generator_api_client/models/template_definition_data_settings.rb +234 -0
- data/lib/pdf_generator_api_client/models/template_definition_editor.rb +221 -0
- data/lib/pdf_generator_api_client/models/template_definition_new.rb +324 -0
- data/lib/pdf_generator_api_client/models/template_definition_new_data_settings.rb +245 -0
- data/lib/pdf_generator_api_client/models/template_definition_new_editor.rb +221 -0
- data/lib/pdf_generator_api_client/models/template_definition_new_layout.rb +377 -0
- data/lib/pdf_generator_api_client/models/template_definition_new_layout_margins.rb +248 -0
- data/lib/pdf_generator_api_client/models/template_definition_new_layout_repeat_layout.rb +276 -0
- data/lib/pdf_generator_api_client/models/template_definition_new_pages_inner.rb +295 -0
- data/lib/pdf_generator_api_client/models/template_definition_new_pages_inner_margins.rb +231 -0
- data/lib/pdf_generator_api_client/models/template_definition_pages_inner.rb +251 -0
- data/lib/pdf_generator_api_client/models/template_param.rb +240 -0
- data/lib/pdf_generator_api_client/models/template_param_data.rb +105 -0
- data/lib/pdf_generator_api_client/models/template_param_id.rb +106 -0
- data/lib/pdf_generator_api_client/models/template_version.rb +301 -0
- data/lib/pdf_generator_api_client/models/template_version_collection.rb +231 -0
- data/lib/pdf_generator_api_client/models/template_version_collection_meta.rb +238 -0
- data/lib/pdf_generator_api_client/models/watermark_base64.rb +320 -0
- data/lib/pdf_generator_api_client/models/watermark_file_url_watermark.rb +229 -0
- data/lib/pdf_generator_api_client/models/watermark_image.rb +104 -0
- data/lib/pdf_generator_api_client/models/watermark_image_content_base64.rb +351 -0
- data/lib/pdf_generator_api_client/models/watermark_image_content_url.rb +351 -0
- data/lib/pdf_generator_api_client/models/watermark_position.rb +47 -0
- data/lib/pdf_generator_api_client/models/watermark_text.rb +403 -0
- data/lib/pdf_generator_api_client/models/workspace.rb +250 -0
- data/lib/pdf_generator_api_client/version.rb +15 -0
- data/lib/pdf_generator_api_client.rb +185 -0
- data/pdf_generator_api_client.gemspec +39 -0
- data/spec/api/assets_api_spec.rb +47 -0
- data/spec/api/conversion_api_spec.rb +71 -0
- data/spec/api/documents_api_spec.rb +147 -0
- data/spec/api/e_invoices_api_spec.rb +82 -0
- data/spec/api/forms_api_spec.rb +144 -0
- data/spec/api/misc_api_spec.rb +46 -0
- data/spec/api/services_api_spec.rb +119 -0
- data/spec/api/template_library_api_spec.rb +59 -0
- data/spec/api/template_versions_api_spec.rb +88 -0
- data/spec/api/templates_api_spec.rb +173 -0
- data/spec/api/workspaces_api_spec.rb +84 -0
- data/spec/models/accessibility_option_spec.rb +30 -0
- data/spec/models/add_watermark_request_spec.rb +32 -0
- data/spec/models/async_output_param_spec.rb +30 -0
- data/spec/models/callback_param_spec.rb +42 -0
- data/spec/models/component_spec.rb +88 -0
- data/spec/models/convert_html2_pdf_request_spec.rb +72 -0
- data/spec/models/convert_pdf2_image_request_spec.rb +86 -0
- data/spec/models/convert_url2_pdf_request_spec.rb +72 -0
- data/spec/models/copy_template_request_spec.rb +36 -0
- data/spec/models/create_e_invoice_request_spec.rb +56 -0
- data/spec/models/create_factur_xe_invoice_request_spec.rb +64 -0
- data/spec/models/create_factur_xe_invoice_request_template_spec.rb +48 -0
- data/spec/models/create_workspace_request_spec.rb +36 -0
- data/spec/models/data_batch_inner_spec.rb +42 -0
- data/spec/models/document_spec.rb +60 -0
- data/spec/models/encrypt_and_decrypt_base64_spec.rb +64 -0
- data/spec/models/encrypt_and_decrypt_url_spec.rb +64 -0
- data/spec/models/encrypt_document_request_spec.rb +32 -0
- data/spec/models/extract_form_fields_request_spec.rb +32 -0
- data/spec/models/fill_form_fields_request_spec.rb +32 -0
- data/spec/models/form_action_download_spec.rb +36 -0
- data/spec/models/form_action_send_send_document_headers_inner_spec.rb +42 -0
- data/spec/models/form_action_send_send_document_spec.rb +42 -0
- data/spec/models/form_action_send_spec.rb +36 -0
- data/spec/models/form_action_store_spec.rb +36 -0
- data/spec/models/form_configuration_new_actions_inner_spec.rb +21 -0
- data/spec/models/form_configuration_new_spec.rb +60 -0
- data/spec/models/form_configuration_spec.rb +48 -0
- data/spec/models/form_fields_base64_spec.rb +42 -0
- data/spec/models/form_fields_inner_spec.rb +58 -0
- data/spec/models/form_fields_url_spec.rb +42 -0
- data/spec/models/form_fill_base64_spec.rb +58 -0
- data/spec/models/form_fill_url_spec.rb +58 -0
- data/spec/models/format_param_spec.rb +30 -0
- data/spec/models/generate_document_asynchronous_request_spec.rb +78 -0
- data/spec/models/generate_document_batch_asynchronous_request_spec.rb +72 -0
- data/spec/models/generate_document_batch_request_spec.rb +66 -0
- data/spec/models/generate_document_request_spec.rb +72 -0
- data/spec/models/generate_qr_code201_response_meta_spec.rb +42 -0
- data/spec/models/generate_qr_code201_response_spec.rb +42 -0
- data/spec/models/generate_qr_code_request_spec.rb +64 -0
- data/spec/models/get_status200_response_spec.rb +66 -0
- data/spec/models/get_template_library200_response_spec.rb +36 -0
- data/spec/models/get_template_version422_response_spec.rb +36 -0
- data/spec/models/import_form_base64_spec.rb +42 -0
- data/spec/models/import_form_request_spec.rb +32 -0
- data/spec/models/import_form_url_spec.rb +42 -0
- data/spec/models/import_template_base64_spec.rb +42 -0
- data/spec/models/import_template_request_spec.rb +32 -0
- data/spec/models/import_template_url_spec.rb +42 -0
- data/spec/models/import_template_url_template_spec.rb +36 -0
- data/spec/models/inline_object10_meta_spec.rb +54 -0
- data/spec/models/inline_object10_spec.rb +42 -0
- data/spec/models/inline_object11_meta_spec.rb +60 -0
- data/spec/models/inline_object11_spec.rb +42 -0
- data/spec/models/inline_object12_meta_spec.rb +66 -0
- data/spec/models/inline_object12_meta_stats_spec.rb +42 -0
- data/spec/models/inline_object12_spec.rb +42 -0
- data/spec/models/inline_object13_spec.rb +46 -0
- data/spec/models/inline_object14_response_value_default_spec.rb +32 -0
- data/spec/models/inline_object14_response_value_spec.rb +124 -0
- data/spec/models/inline_object14_response_value_value_spec.rb +32 -0
- data/spec/models/inline_object14_spec.rb +36 -0
- data/spec/models/inline_object15_spec.rb +42 -0
- data/spec/models/inline_object16_spec.rb +42 -0
- data/spec/models/inline_object17_spec.rb +36 -0
- data/spec/models/inline_object18_meta_spec.rb +36 -0
- data/spec/models/inline_object18_spec.rb +42 -0
- data/spec/models/inline_object19_spec.rb +36 -0
- data/spec/models/inline_object1_response_spec.rb +36 -0
- data/spec/models/inline_object1_spec.rb +36 -0
- data/spec/models/inline_object20_response_spec.rb +36 -0
- data/spec/models/inline_object20_spec.rb +36 -0
- data/spec/models/inline_object21_spec.rb +40 -0
- data/spec/models/inline_object22_spec.rb +40 -0
- data/spec/models/inline_object23_spec.rb +40 -0
- data/spec/models/inline_object24_spec.rb +40 -0
- data/spec/models/inline_object25_spec.rb +42 -0
- data/spec/models/inline_object26_spec.rb +36 -0
- data/spec/models/inline_object27_spec.rb +36 -0
- data/spec/models/inline_object2_spec.rb +36 -0
- data/spec/models/inline_object3_spec.rb +36 -0
- data/spec/models/inline_object4_spec.rb +42 -0
- data/spec/models/inline_object5_spec.rb +42 -0
- data/spec/models/inline_object6_spec.rb +42 -0
- data/spec/models/inline_object7_response_spec.rb +36 -0
- data/spec/models/inline_object7_spec.rb +36 -0
- data/spec/models/inline_object8_spec.rb +36 -0
- data/spec/models/inline_object9_meta_spec.rb +60 -0
- data/spec/models/inline_object9_spec.rb +42 -0
- data/spec/models/inline_object_meta_spec.rb +42 -0
- data/spec/models/inline_object_spec.rb +42 -0
- data/spec/models/key_field_param_spec.rb +30 -0
- data/spec/models/make_accessible_base64_spec.rb +64 -0
- data/spec/models/make_accessible_request_spec.rb +32 -0
- data/spec/models/make_accessible_url_spec.rb +64 -0
- data/spec/models/metadata_param_spec.rb +42 -0
- data/spec/models/open_editor_request_data_spec.rb +32 -0
- data/spec/models/open_editor_request_spec.rb +46 -0
- data/spec/models/optimize_base64_spec.rb +52 -0
- data/spec/models/optimize_document_request_spec.rb +32 -0
- data/spec/models/optimize_url_spec.rb +52 -0
- data/spec/models/output_param_spec.rb +30 -0
- data/spec/models/pagination_meta_spec.rb +48 -0
- data/spec/models/promote_template_version200_response_spec.rb +36 -0
- data/spec/models/public_template_library_item_spec.rb +60 -0
- data/spec/models/status_param_spec.rb +30 -0
- data/spec/models/store_document_request_spec.rb +58 -0
- data/spec/models/template_definition_data_settings_spec.rb +42 -0
- data/spec/models/template_definition_editor_spec.rb +36 -0
- data/spec/models/template_definition_new_data_settings_spec.rb +48 -0
- data/spec/models/template_definition_new_editor_spec.rb +36 -0
- data/spec/models/template_definition_new_layout_margins_spec.rb +54 -0
- data/spec/models/template_definition_new_layout_repeat_layout_spec.rb +52 -0
- data/spec/models/template_definition_new_layout_spec.rb +100 -0
- data/spec/models/template_definition_new_pages_inner_margins_spec.rb +42 -0
- data/spec/models/template_definition_new_pages_inner_spec.rb +78 -0
- data/spec/models/template_definition_new_spec.rb +84 -0
- data/spec/models/template_definition_pages_inner_spec.rb +54 -0
- data/spec/models/template_definition_spec.rb +78 -0
- data/spec/models/template_param_data_spec.rb +32 -0
- data/spec/models/template_param_id_spec.rb +32 -0
- data/spec/models/template_param_spec.rb +48 -0
- data/spec/models/template_spec.rb +66 -0
- data/spec/models/template_version_collection_meta_spec.rb +48 -0
- data/spec/models/template_version_collection_spec.rb +42 -0
- data/spec/models/template_version_spec.rb +90 -0
- data/spec/models/watermark_base64_spec.rb +58 -0
- data/spec/models/watermark_file_url_watermark_spec.rb +42 -0
- data/spec/models/watermark_image_content_base64_spec.rb +54 -0
- data/spec/models/watermark_image_content_url_spec.rb +54 -0
- data/spec/models/watermark_image_spec.rb +21 -0
- data/spec/models/watermark_position_spec.rb +30 -0
- data/spec/models/watermark_text_spec.rb +66 -0
- data/spec/models/workspace_spec.rb +54 -0
- data/spec/spec_helper.rb +111 -0
- metadata +679 -0
|
@@ -0,0 +1,309 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#PDF Generator API
|
|
3
|
+
|
|
4
|
+
## Introduction [PDF Generator API](https://pdfgeneratorapi.com) allows you easily generate transactional PDF documents and reduce the development and support costs by enabling your users to create and manage their document templates using a browser-based drag-and-drop document editor. The PDF Generator API features a web API architecture, allowing you to code in the language of your choice. This API supports the JSON media type, and uses UTF-8 character encoding. ## Base URL The base URL for all the API endpoints is `https://us1.pdfgeneratorapi.com/api/v4` For example * `https://us1.pdfgeneratorapi.com/api/v4/templates` * `https://us1.pdfgeneratorapi.com/api/v4/workspaces` * `https://us1.pdfgeneratorapi.com/api/v4/templates/123123` ## Editor PDF Generator API comes with a powerful drag & drop editor that allows to create any kind of document templates, from barcode labels to invoices, quotes and reports. You can find tutorials and videos from our [Support Portal](https://support.pdfgeneratorapi.com). * [Component specification](https://support.pdfgeneratorapi.com/en/category/components-1ffseaj/) * [Expression Language documentation](https://support.pdfgeneratorapi.com/en/category/expression-language-q203pa/) * [Frequently asked questions and answers](https://support.pdfgeneratorapi.com/en/category/qanda-1ov519d/) ## Definitions ### Organization Organization is a group of workspaces owned by your account. ### Workspace Workspace contains templates. Each workspace has access to their own templates and organization default templates. ### Master Workspace Master Workspace is the main/default workspace of your Organization. The Master Workspace identifier is the email you signed up with. ### Default Template Default template is a template that is available for all workspaces by default. You can set the template access type under Page Setup. If template has \"Organization\" access then your users can use them from the \"New\" menu in the Editor. ### Data Field Data Field is a placeholder for the specific data in your JSON data set. In this example JSON you can access the buyer name using Data Field `{paymentDetails::buyerName}`. The separator between depth levels is :: (two colons). When designing the template you don’t have to know every Data Field, our editor automatically extracts all the available fields from your data set and provides an easy way to insert them into the template. ``` { \"documentNumber\": 1, \"paymentDetails\": { \"method\": \"Credit Card\", \"buyerName\": \"John Smith\" }, \"items\": [ { \"id\": 1, \"name\": \"Item one\" } ] } ``` ## Rate limiting Our API endpoints use IP-based rate limiting and allow you to make up to 2 requests per second and 60 requests per minute. If you make more requests, you will receive a response with HTTP code 429. Response headers contain additional values: | Header | Description | |--------|--------------------------------| | X-RateLimit-Limit | Maximum requests per minute | | X-RateLimit-Remaining | The requests remaining in the current minute | | Retry-After | How many seconds you need to wait until you are allowed to make requests | * * * * * # Libraries and SDKs ## Postman Collection We have created a [Postman Collection](https://www.postman.com/pdfgeneratorapi/workspace/pdf-generator-api-public-workspace/overview) so you can easily test all the API endpoints without developing and code. ## Client Libraries All our Client Libraries are auto-generated using [OpenAPI Generator](https://openapi-generator.tech/) which uses the OpenAPI v3 specification to automatically generate a client library in specific programming language. * [PHP Client](https://github.com/pdfgeneratorapi/php-client) * [Java Client](https://github.com/pdfgeneratorapi/java-client) * [Ruby Client](https://github.com/pdfgeneratorapi/ruby-client) * [Python Client](https://github.com/pdfgeneratorapi/python-client) * [Javascript Client](https://github.com/pdfgeneratorapi/javascript-client) We have validated the generated libraries, but let us know if you find any anomalies in the client code. ## Model Context Protocol (MCP) Server Integrate document generation directly into your AI agents and LLM applications using our official Model Context Protocol (MCP) Server. The MCP server provides a standardized interface that allows AI assistants (like Claude Desktop and other MCP-compatible clients) to securely interact with the PDF Generator API. With it, your AI applications can automatically fetch workspaces, retrieve templates, merge data, and generate PDF documents on the fly. [Get PDF Generator API MCP Server](https://github.com/pdfgeneratorapi/mcp-server) * * * * * # Authentication The PDF Generator API uses __JSON Web Tokens (JWT)__ to authenticate all API requests. These tokens offer a method to establish secure server-to-server authentication by transferring a compact JSON object with a signed payload of your account’s API Key and Secret. When authenticating to the PDF Generator API, a JWT should be generated uniquely by a __server-side application__ and included as a __Bearer Token__ in the header of each request. <SecurityDefinitions /> ## Accessing your API Key and Secret You can find your __API Key__ and __API Secret__ from the __Account Settings__ page after you login to PDF Generator API [here](https://pdfgeneratorapi.com/login). ## Creating a JWT JSON Web Tokens are composed of three sections: a header, a payload (containing a claim set), and a signature. The header and payload are JSON objects, which are serialized to UTF-8 bytes, then encoded using base64url encoding. The JWT's header, payload, and signature are concatenated with periods (.). As a result, a JWT typically takes the following form: ``` {Base64url encoded header}.{Base64url encoded payload}.{Base64url encoded signature} ``` We recommend and support libraries provided on [jwt.io](https://jwt.io/). While other libraries can create JWT, these recommended libraries are the most robust. ### Header Property `alg` defines which signing algorithm is being used. PDF Generator API users HS256. Property `typ` defines the type of token and it is always JWT. ``` { \"alg\": \"HS256\", \"typ\": \"JWT\" } ``` ### Payload The second part of the token is the payload, which contains the claims or the pieces of information being passed about the user and any metadata required. It is mandatory to specify the following claims: * issuer (`iss`): Your API key * subject (`sub`): Workspace identifier * expiration time (`exp`): Timestamp (unix epoch time) until the token is valid. It is highly recommended to set the exp timestamp for a short period, i.e. a matter of seconds. This way, if a token is intercepted or shared, the token will only be valid for a short period of time. ``` { \"iss\": \"ad54aaff89ffdfeff178bb8a8f359b29fcb20edb56250b9f584aa2cb0162ed4a\", \"sub\": \"demo.example@actualreports.com\", \"exp\": 1586112639 } ``` ### Payload for Partners Our partners can send their unique identifier (provided by us) in JWT's partner_id claim. If the `partner_id` value is specified in the JWT, the organization making the request is automatically connected to the partner account. * Partner ID (`partner_id`): Unique identifier provide by PDF Generator API team ``` { \"iss\": \"ad54aaff89ffdfeff178bb8a8f359b29fcb20edb56250b9f584aa2cb0162ed4a\", \"sub\": \"demo.example@actualreports.com\", \"partner_id\": \"my-partner-identifier\", \"exp\": 1586112639 } ``` ### Signature To create the signature part you have to take the encoded header, the encoded payload, a secret, the algorithm specified in the header, and sign that. The signature is used to verify the message wasn't changed along the way, and, in the case of tokens signed with a private key, it can also verify that the sender of the JWT is who it says it is. ``` HMACSHA256( base64UrlEncode(header) + \".\" + base64UrlEncode(payload), API_SECRET) ``` ### Putting all together The output is three Base64-URL strings separated by dots. The following shows a JWT that has the previous header and payload encoded, and it is signed with a secret. ``` eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJhZDU0YWFmZjg5ZmZkZmVmZjE3OGJiOGE4ZjM1OWIyOWZjYjIwZWRiNTYyNTBiOWY1ODRhYTJjYjAxNjJlZDRhIiwic3ViIjoiZGVtby5leGFtcGxlQGFjdHVhbHJlcG9ydHMuY29tIn0.SxO-H7UYYYsclS8RGWO1qf0z1cB1m73wF9FLl9RCc1Q // Base64 encoded header: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9 // Base64 encoded payload: eyJpc3MiOiJhZDU0YWFmZjg5ZmZkZmVmZjE3OGJiOGE4ZjM1OWIyOWZjYjIwZWRiNTYyNTBiOWY1ODRhYTJjYjAxNjJlZDRhIiwic3ViIjoiZGVtby5leGFtcGxlQGFjdHVhbHJlcG9ydHMuY29tIn0 // Signature: SxO-H7UYYYsclS8RGWO1qf0z1cB1m73wF9FLl9RCc1Q ``` ## Temporary JWTs You can create a temporary token in [Account Settings](https://pdfgeneratorapi.com/account/organization) page after you login to PDF Generator API. The generated token uses your email address as the subject (`sub`) value and is valid for __15 minutes__. You can also use [jwt.io](https://jwt.io/) to generate test tokens for your API calls. These test tokens should never be used in production applications. * * * * * # Error codes | Code | Description | |--------|--------------------------------| | 401 | Unauthorized | | 402 | Payment Required | | 403 | Forbidden | | 404 | Not Found | | 422 | Unprocessable Entity | | 429 | Too Many Requests | | 500 | Internal Server Error | ## 401 Unauthorized | Description | |-------------------------------------------------------------------------| | Authentication failed: request expired | | Authentication failed: workspace missing | | Authentication failed: key missing | | Authentication failed: property 'iss' (issuer) missing in JWT | | Authentication failed: property 'sub' (subject) missing in JWT | | Authentication failed: property 'exp' (expiration time) missing in JWT | | Authentication failed: incorrect signature | ## 402 Payment Required | Description | |-------------------------------------------------------------------------| | Your account is suspended, please upgrade your account | ## 403 Forbidden | Description | |-------------------------------------------------------------------------| | Your account has exceeded the monthly document generation limit. | | Access not granted: You cannot delete master workspace via API | | Access not granted: Template is not accessible by this organization | | Your session has expired, please close and reopen the editor. | ## 404 Entity not found | Description | |-------------------------------------------------------------------------| | Entity not found | | Resource not found | | None of the templates is available for the workspace. | ## 422 Unprocessable Entity | Description | |-------------------------------------------------------------------------| | Unable to parse JSON, please check formatting | | Required parameter missing | | Required parameter missing: template definition not defined | | Required parameter missing: template not defined | ## 429 Too Many Requests | Description | |-------------------------------------------------------------------------| | You can make up to 2 requests per second and 60 requests per minute. | * * * * *
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 4.0.25
|
|
7
|
+
Contact: support@pdfgeneratorapi.com
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.14.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
module PDFGeneratorAPI
|
|
14
|
+
class Configuration
|
|
15
|
+
# Defines url scheme
|
|
16
|
+
attr_accessor :scheme
|
|
17
|
+
|
|
18
|
+
# Defines url host
|
|
19
|
+
attr_accessor :host
|
|
20
|
+
|
|
21
|
+
# Defines url base path
|
|
22
|
+
attr_accessor :base_path
|
|
23
|
+
|
|
24
|
+
# Define server configuration index
|
|
25
|
+
attr_accessor :server_index
|
|
26
|
+
|
|
27
|
+
# Define server operation configuration index
|
|
28
|
+
attr_accessor :server_operation_index
|
|
29
|
+
|
|
30
|
+
# Default server variables
|
|
31
|
+
attr_accessor :server_variables
|
|
32
|
+
|
|
33
|
+
# Default server operation variables
|
|
34
|
+
attr_accessor :server_operation_variables
|
|
35
|
+
|
|
36
|
+
# Defines API keys used with API Key authentications.
|
|
37
|
+
#
|
|
38
|
+
# @return [Hash] key: parameter name, value: parameter value (API key)
|
|
39
|
+
#
|
|
40
|
+
# @example parameter name is "api_key", API key is "xxx" (e.g. "api_key=xxx" in query string)
|
|
41
|
+
# config.api_key['api_key'] = 'xxx'
|
|
42
|
+
attr_accessor :api_key
|
|
43
|
+
|
|
44
|
+
# Defines API key prefixes used with API Key authentications.
|
|
45
|
+
#
|
|
46
|
+
# @return [Hash] key: parameter name, value: API key prefix
|
|
47
|
+
#
|
|
48
|
+
# @example parameter name is "Authorization", API key prefix is "Token" (e.g. "Authorization: Token xxx" in headers)
|
|
49
|
+
# config.api_key_prefix['api_key'] = 'Token'
|
|
50
|
+
attr_accessor :api_key_prefix
|
|
51
|
+
|
|
52
|
+
# Defines the username used with HTTP basic authentication.
|
|
53
|
+
#
|
|
54
|
+
# @return [String]
|
|
55
|
+
attr_accessor :username
|
|
56
|
+
|
|
57
|
+
# Defines the password used with HTTP basic authentication.
|
|
58
|
+
#
|
|
59
|
+
# @return [String]
|
|
60
|
+
attr_accessor :password
|
|
61
|
+
|
|
62
|
+
# Defines the access token (Bearer) used with OAuth2.
|
|
63
|
+
attr_accessor :access_token
|
|
64
|
+
|
|
65
|
+
# Defines a Proc used to fetch or refresh access tokens (Bearer) used with OAuth2.
|
|
66
|
+
# Overrides the access_token if set
|
|
67
|
+
# @return [Proc]
|
|
68
|
+
attr_accessor :access_token_getter
|
|
69
|
+
|
|
70
|
+
# Set this to return data as binary instead of downloading a temp file. When enabled (set to true)
|
|
71
|
+
# HTTP responses with return type `File` will be returned as a stream of binary data.
|
|
72
|
+
# Default to false.
|
|
73
|
+
attr_accessor :return_binary_data
|
|
74
|
+
|
|
75
|
+
# Set this to enable/disable debugging. When enabled (set to true), HTTP request/response
|
|
76
|
+
# details will be logged with `logger.debug` (see the `logger` attribute).
|
|
77
|
+
# Default to false.
|
|
78
|
+
#
|
|
79
|
+
# @return [true, false]
|
|
80
|
+
attr_accessor :debugging
|
|
81
|
+
|
|
82
|
+
# Set this to ignore operation servers for the API client. This is useful when you need to
|
|
83
|
+
# send requests to a different server than the one specified in the OpenAPI document.
|
|
84
|
+
# Will default to the base url defined in the spec but can be overridden by setting
|
|
85
|
+
# `scheme`, `host`, `base_path` directly.
|
|
86
|
+
# Default to false.
|
|
87
|
+
# @return [true, false]
|
|
88
|
+
attr_accessor :ignore_operation_servers
|
|
89
|
+
|
|
90
|
+
# Defines the logger used for debugging.
|
|
91
|
+
# Default to `Rails.logger` (when in Rails) or logging to STDOUT.
|
|
92
|
+
#
|
|
93
|
+
# @return [#debug]
|
|
94
|
+
attr_accessor :logger
|
|
95
|
+
|
|
96
|
+
# Defines the temporary folder to store downloaded files
|
|
97
|
+
# (for API endpoints that have file response).
|
|
98
|
+
# Default to use `Tempfile`.
|
|
99
|
+
#
|
|
100
|
+
# @return [String]
|
|
101
|
+
attr_accessor :temp_folder_path
|
|
102
|
+
|
|
103
|
+
# The time limit for HTTP request in seconds.
|
|
104
|
+
# Default to 0 (never times out).
|
|
105
|
+
attr_accessor :timeout
|
|
106
|
+
|
|
107
|
+
# Set this to false to skip client side validation in the operation.
|
|
108
|
+
# Default to true.
|
|
109
|
+
# @return [true, false]
|
|
110
|
+
attr_accessor :client_side_validation
|
|
111
|
+
|
|
112
|
+
### TLS/SSL setting
|
|
113
|
+
# Set this to false to skip verifying SSL certificate when calling API from https server.
|
|
114
|
+
# Default to true.
|
|
115
|
+
#
|
|
116
|
+
# @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks.
|
|
117
|
+
#
|
|
118
|
+
# @return [true, false]
|
|
119
|
+
attr_accessor :verify_ssl
|
|
120
|
+
|
|
121
|
+
### TLS/SSL setting
|
|
122
|
+
# Set this to false to skip verifying SSL host name
|
|
123
|
+
# Default to true.
|
|
124
|
+
#
|
|
125
|
+
# @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks.
|
|
126
|
+
#
|
|
127
|
+
# @return [true, false]
|
|
128
|
+
attr_accessor :verify_ssl_host
|
|
129
|
+
|
|
130
|
+
### TLS/SSL setting
|
|
131
|
+
# Set this to customize the certificate file to verify the peer.
|
|
132
|
+
#
|
|
133
|
+
# @return [String] the path to the certificate file
|
|
134
|
+
#
|
|
135
|
+
# @see The `cainfo` option of Typhoeus, `--cert` option of libcurl. Related source code:
|
|
136
|
+
# https://github.com/typhoeus/typhoeus/blob/master/lib/typhoeus/easy_factory.rb#L145
|
|
137
|
+
attr_accessor :ssl_ca_cert
|
|
138
|
+
|
|
139
|
+
### TLS/SSL setting
|
|
140
|
+
# Client certificate file (for client certificate)
|
|
141
|
+
attr_accessor :cert_file
|
|
142
|
+
|
|
143
|
+
### TLS/SSL setting
|
|
144
|
+
# Client private key file (for client certificate)
|
|
145
|
+
attr_accessor :key_file
|
|
146
|
+
|
|
147
|
+
# Set this to customize parameters encoding of array parameter with multi collectionFormat.
|
|
148
|
+
# Default to nil.
|
|
149
|
+
#
|
|
150
|
+
# @see The params_encoding option of Ethon. Related source code:
|
|
151
|
+
# https://github.com/typhoeus/ethon/blob/master/lib/ethon/easy/queryable.rb#L96
|
|
152
|
+
attr_accessor :params_encoding
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
attr_accessor :inject_format
|
|
156
|
+
|
|
157
|
+
attr_accessor :force_ending_format
|
|
158
|
+
|
|
159
|
+
def initialize
|
|
160
|
+
@scheme = 'https'
|
|
161
|
+
@host = 'us1.pdfgeneratorapi.com'
|
|
162
|
+
@base_path = '/api/v4'
|
|
163
|
+
@server_index = nil
|
|
164
|
+
@server_operation_index = {}
|
|
165
|
+
@server_variables = {}
|
|
166
|
+
@server_operation_variables = {}
|
|
167
|
+
@api_key = {}
|
|
168
|
+
@api_key_prefix = {}
|
|
169
|
+
@client_side_validation = true
|
|
170
|
+
@verify_ssl = true
|
|
171
|
+
@verify_ssl_host = true
|
|
172
|
+
@cert_file = nil
|
|
173
|
+
@key_file = nil
|
|
174
|
+
@timeout = 0
|
|
175
|
+
@params_encoding = nil
|
|
176
|
+
@debugging = false
|
|
177
|
+
@ignore_operation_servers = false
|
|
178
|
+
@inject_format = false
|
|
179
|
+
@force_ending_format = false
|
|
180
|
+
@logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
|
|
181
|
+
|
|
182
|
+
yield(self) if block_given?
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
# The default Configuration object.
|
|
186
|
+
def self.default
|
|
187
|
+
@@default ||= Configuration.new
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
def configure
|
|
191
|
+
yield(self) if block_given?
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
def scheme=(scheme)
|
|
195
|
+
# remove :// from scheme
|
|
196
|
+
@scheme = scheme.sub(/:\/\//, '')
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
def host=(host)
|
|
200
|
+
# remove http(s):// and anything after a slash
|
|
201
|
+
@host = host.sub(/https?:\/\//, '').split('/').first
|
|
202
|
+
end
|
|
203
|
+
|
|
204
|
+
def base_path=(base_path)
|
|
205
|
+
# Add leading and trailing slashes to base_path
|
|
206
|
+
@base_path = "/#{base_path}".gsub(/\/+/, '/')
|
|
207
|
+
@base_path = '' if @base_path == '/'
|
|
208
|
+
end
|
|
209
|
+
|
|
210
|
+
# Returns base URL for specified operation based on server settings
|
|
211
|
+
def base_url(operation = nil)
|
|
212
|
+
return "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') if ignore_operation_servers
|
|
213
|
+
if operation_server_settings.key?(operation) then
|
|
214
|
+
index = server_operation_index.fetch(operation, server_index)
|
|
215
|
+
server_url(index.nil? ? 0 : index, server_operation_variables.fetch(operation, server_variables), operation_server_settings[operation])
|
|
216
|
+
else
|
|
217
|
+
server_index.nil? ? "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') : server_url(server_index, server_variables, nil)
|
|
218
|
+
end
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
# Gets API key (with prefix if set).
|
|
222
|
+
# @param [String] param_name the parameter name of API key auth
|
|
223
|
+
def api_key_with_prefix(param_name, param_alias = nil)
|
|
224
|
+
key = @api_key[param_name]
|
|
225
|
+
key = @api_key.fetch(param_alias, key) unless param_alias.nil?
|
|
226
|
+
if @api_key_prefix[param_name]
|
|
227
|
+
"#{@api_key_prefix[param_name]} #{key}"
|
|
228
|
+
else
|
|
229
|
+
key
|
|
230
|
+
end
|
|
231
|
+
end
|
|
232
|
+
|
|
233
|
+
# Gets access_token using access_token_getter or uses the static access_token
|
|
234
|
+
def access_token_with_refresh
|
|
235
|
+
return access_token if access_token_getter.nil?
|
|
236
|
+
access_token_getter.call
|
|
237
|
+
end
|
|
238
|
+
|
|
239
|
+
# Gets Basic Auth token string
|
|
240
|
+
def basic_auth_token
|
|
241
|
+
'Basic ' + ["#{username}:#{password}"].pack('m').delete("\r\n")
|
|
242
|
+
end
|
|
243
|
+
|
|
244
|
+
# Returns Auth Settings hash for api client.
|
|
245
|
+
def auth_settings
|
|
246
|
+
{
|
|
247
|
+
'JSONWebTokenAuth' =>
|
|
248
|
+
{
|
|
249
|
+
type: 'bearer',
|
|
250
|
+
in: 'header',
|
|
251
|
+
format: 'JWT',
|
|
252
|
+
key: 'Authorization',
|
|
253
|
+
value: "Bearer #{access_token_with_refresh}"
|
|
254
|
+
},
|
|
255
|
+
}
|
|
256
|
+
end
|
|
257
|
+
|
|
258
|
+
# Returns an array of Server setting
|
|
259
|
+
def server_settings
|
|
260
|
+
[
|
|
261
|
+
{
|
|
262
|
+
url: "https://us1.pdfgeneratorapi.com/api/v4",
|
|
263
|
+
description: "No description provided",
|
|
264
|
+
}
|
|
265
|
+
]
|
|
266
|
+
end
|
|
267
|
+
|
|
268
|
+
def operation_server_settings
|
|
269
|
+
{
|
|
270
|
+
}
|
|
271
|
+
end
|
|
272
|
+
|
|
273
|
+
# Returns URL based on server settings
|
|
274
|
+
#
|
|
275
|
+
# @param index array index of the server settings
|
|
276
|
+
# @param variables hash of variable and the corresponding value
|
|
277
|
+
def server_url(index, variables = {}, servers = nil)
|
|
278
|
+
servers = server_settings if servers == nil
|
|
279
|
+
|
|
280
|
+
# check array index out of bound
|
|
281
|
+
if (index.nil? || index < 0 || index >= servers.size)
|
|
282
|
+
fail ArgumentError, "Invalid index #{index} when selecting the server. Must not be nil and must be less than #{servers.size}"
|
|
283
|
+
end
|
|
284
|
+
|
|
285
|
+
server = servers[index]
|
|
286
|
+
url = server[:url]
|
|
287
|
+
|
|
288
|
+
return url unless server.key? :variables
|
|
289
|
+
|
|
290
|
+
# go through variable and assign a value
|
|
291
|
+
server[:variables].each do |name, variable|
|
|
292
|
+
if variables.key?(name)
|
|
293
|
+
if (!server[:variables][name].key?(:enum_values) || server[:variables][name][:enum_values].include?(variables[name]))
|
|
294
|
+
url.gsub! "{" + name.to_s + "}", variables[name]
|
|
295
|
+
else
|
|
296
|
+
fail ArgumentError, "The variable `#{name}` in the server URL has invalid value #{variables[name]}. Must be #{server[:variables][name][:enum_values]}."
|
|
297
|
+
end
|
|
298
|
+
else
|
|
299
|
+
# use default value
|
|
300
|
+
url.gsub! "{" + name.to_s + "}", server[:variables][name][:default_value]
|
|
301
|
+
end
|
|
302
|
+
end
|
|
303
|
+
|
|
304
|
+
url
|
|
305
|
+
end
|
|
306
|
+
|
|
307
|
+
|
|
308
|
+
end
|
|
309
|
+
end
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#PDF Generator API
|
|
3
|
+
|
|
4
|
+
## Introduction [PDF Generator API](https://pdfgeneratorapi.com) allows you easily generate transactional PDF documents and reduce the development and support costs by enabling your users to create and manage their document templates using a browser-based drag-and-drop document editor. The PDF Generator API features a web API architecture, allowing you to code in the language of your choice. This API supports the JSON media type, and uses UTF-8 character encoding. ## Base URL The base URL for all the API endpoints is `https://us1.pdfgeneratorapi.com/api/v4` For example * `https://us1.pdfgeneratorapi.com/api/v4/templates` * `https://us1.pdfgeneratorapi.com/api/v4/workspaces` * `https://us1.pdfgeneratorapi.com/api/v4/templates/123123` ## Editor PDF Generator API comes with a powerful drag & drop editor that allows to create any kind of document templates, from barcode labels to invoices, quotes and reports. You can find tutorials and videos from our [Support Portal](https://support.pdfgeneratorapi.com). * [Component specification](https://support.pdfgeneratorapi.com/en/category/components-1ffseaj/) * [Expression Language documentation](https://support.pdfgeneratorapi.com/en/category/expression-language-q203pa/) * [Frequently asked questions and answers](https://support.pdfgeneratorapi.com/en/category/qanda-1ov519d/) ## Definitions ### Organization Organization is a group of workspaces owned by your account. ### Workspace Workspace contains templates. Each workspace has access to their own templates and organization default templates. ### Master Workspace Master Workspace is the main/default workspace of your Organization. The Master Workspace identifier is the email you signed up with. ### Default Template Default template is a template that is available for all workspaces by default. You can set the template access type under Page Setup. If template has \"Organization\" access then your users can use them from the \"New\" menu in the Editor. ### Data Field Data Field is a placeholder for the specific data in your JSON data set. In this example JSON you can access the buyer name using Data Field `{paymentDetails::buyerName}`. The separator between depth levels is :: (two colons). When designing the template you don’t have to know every Data Field, our editor automatically extracts all the available fields from your data set and provides an easy way to insert them into the template. ``` { \"documentNumber\": 1, \"paymentDetails\": { \"method\": \"Credit Card\", \"buyerName\": \"John Smith\" }, \"items\": [ { \"id\": 1, \"name\": \"Item one\" } ] } ``` ## Rate limiting Our API endpoints use IP-based rate limiting and allow you to make up to 2 requests per second and 60 requests per minute. If you make more requests, you will receive a response with HTTP code 429. Response headers contain additional values: | Header | Description | |--------|--------------------------------| | X-RateLimit-Limit | Maximum requests per minute | | X-RateLimit-Remaining | The requests remaining in the current minute | | Retry-After | How many seconds you need to wait until you are allowed to make requests | * * * * * # Libraries and SDKs ## Postman Collection We have created a [Postman Collection](https://www.postman.com/pdfgeneratorapi/workspace/pdf-generator-api-public-workspace/overview) so you can easily test all the API endpoints without developing and code. ## Client Libraries All our Client Libraries are auto-generated using [OpenAPI Generator](https://openapi-generator.tech/) which uses the OpenAPI v3 specification to automatically generate a client library in specific programming language. * [PHP Client](https://github.com/pdfgeneratorapi/php-client) * [Java Client](https://github.com/pdfgeneratorapi/java-client) * [Ruby Client](https://github.com/pdfgeneratorapi/ruby-client) * [Python Client](https://github.com/pdfgeneratorapi/python-client) * [Javascript Client](https://github.com/pdfgeneratorapi/javascript-client) We have validated the generated libraries, but let us know if you find any anomalies in the client code. ## Model Context Protocol (MCP) Server Integrate document generation directly into your AI agents and LLM applications using our official Model Context Protocol (MCP) Server. The MCP server provides a standardized interface that allows AI assistants (like Claude Desktop and other MCP-compatible clients) to securely interact with the PDF Generator API. With it, your AI applications can automatically fetch workspaces, retrieve templates, merge data, and generate PDF documents on the fly. [Get PDF Generator API MCP Server](https://github.com/pdfgeneratorapi/mcp-server) * * * * * # Authentication The PDF Generator API uses __JSON Web Tokens (JWT)__ to authenticate all API requests. These tokens offer a method to establish secure server-to-server authentication by transferring a compact JSON object with a signed payload of your account’s API Key and Secret. When authenticating to the PDF Generator API, a JWT should be generated uniquely by a __server-side application__ and included as a __Bearer Token__ in the header of each request. <SecurityDefinitions /> ## Accessing your API Key and Secret You can find your __API Key__ and __API Secret__ from the __Account Settings__ page after you login to PDF Generator API [here](https://pdfgeneratorapi.com/login). ## Creating a JWT JSON Web Tokens are composed of three sections: a header, a payload (containing a claim set), and a signature. The header and payload are JSON objects, which are serialized to UTF-8 bytes, then encoded using base64url encoding. The JWT's header, payload, and signature are concatenated with periods (.). As a result, a JWT typically takes the following form: ``` {Base64url encoded header}.{Base64url encoded payload}.{Base64url encoded signature} ``` We recommend and support libraries provided on [jwt.io](https://jwt.io/). While other libraries can create JWT, these recommended libraries are the most robust. ### Header Property `alg` defines which signing algorithm is being used. PDF Generator API users HS256. Property `typ` defines the type of token and it is always JWT. ``` { \"alg\": \"HS256\", \"typ\": \"JWT\" } ``` ### Payload The second part of the token is the payload, which contains the claims or the pieces of information being passed about the user and any metadata required. It is mandatory to specify the following claims: * issuer (`iss`): Your API key * subject (`sub`): Workspace identifier * expiration time (`exp`): Timestamp (unix epoch time) until the token is valid. It is highly recommended to set the exp timestamp for a short period, i.e. a matter of seconds. This way, if a token is intercepted or shared, the token will only be valid for a short period of time. ``` { \"iss\": \"ad54aaff89ffdfeff178bb8a8f359b29fcb20edb56250b9f584aa2cb0162ed4a\", \"sub\": \"demo.example@actualreports.com\", \"exp\": 1586112639 } ``` ### Payload for Partners Our partners can send their unique identifier (provided by us) in JWT's partner_id claim. If the `partner_id` value is specified in the JWT, the organization making the request is automatically connected to the partner account. * Partner ID (`partner_id`): Unique identifier provide by PDF Generator API team ``` { \"iss\": \"ad54aaff89ffdfeff178bb8a8f359b29fcb20edb56250b9f584aa2cb0162ed4a\", \"sub\": \"demo.example@actualreports.com\", \"partner_id\": \"my-partner-identifier\", \"exp\": 1586112639 } ``` ### Signature To create the signature part you have to take the encoded header, the encoded payload, a secret, the algorithm specified in the header, and sign that. The signature is used to verify the message wasn't changed along the way, and, in the case of tokens signed with a private key, it can also verify that the sender of the JWT is who it says it is. ``` HMACSHA256( base64UrlEncode(header) + \".\" + base64UrlEncode(payload), API_SECRET) ``` ### Putting all together The output is three Base64-URL strings separated by dots. The following shows a JWT that has the previous header and payload encoded, and it is signed with a secret. ``` eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJhZDU0YWFmZjg5ZmZkZmVmZjE3OGJiOGE4ZjM1OWIyOWZjYjIwZWRiNTYyNTBiOWY1ODRhYTJjYjAxNjJlZDRhIiwic3ViIjoiZGVtby5leGFtcGxlQGFjdHVhbHJlcG9ydHMuY29tIn0.SxO-H7UYYYsclS8RGWO1qf0z1cB1m73wF9FLl9RCc1Q // Base64 encoded header: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9 // Base64 encoded payload: eyJpc3MiOiJhZDU0YWFmZjg5ZmZkZmVmZjE3OGJiOGE4ZjM1OWIyOWZjYjIwZWRiNTYyNTBiOWY1ODRhYTJjYjAxNjJlZDRhIiwic3ViIjoiZGVtby5leGFtcGxlQGFjdHVhbHJlcG9ydHMuY29tIn0 // Signature: SxO-H7UYYYsclS8RGWO1qf0z1cB1m73wF9FLl9RCc1Q ``` ## Temporary JWTs You can create a temporary token in [Account Settings](https://pdfgeneratorapi.com/account/organization) page after you login to PDF Generator API. The generated token uses your email address as the subject (`sub`) value and is valid for __15 minutes__. You can also use [jwt.io](https://jwt.io/) to generate test tokens for your API calls. These test tokens should never be used in production applications. * * * * * # Error codes | Code | Description | |--------|--------------------------------| | 401 | Unauthorized | | 402 | Payment Required | | 403 | Forbidden | | 404 | Not Found | | 422 | Unprocessable Entity | | 429 | Too Many Requests | | 500 | Internal Server Error | ## 401 Unauthorized | Description | |-------------------------------------------------------------------------| | Authentication failed: request expired | | Authentication failed: workspace missing | | Authentication failed: key missing | | Authentication failed: property 'iss' (issuer) missing in JWT | | Authentication failed: property 'sub' (subject) missing in JWT | | Authentication failed: property 'exp' (expiration time) missing in JWT | | Authentication failed: incorrect signature | ## 402 Payment Required | Description | |-------------------------------------------------------------------------| | Your account is suspended, please upgrade your account | ## 403 Forbidden | Description | |-------------------------------------------------------------------------| | Your account has exceeded the monthly document generation limit. | | Access not granted: You cannot delete master workspace via API | | Access not granted: Template is not accessible by this organization | | Your session has expired, please close and reopen the editor. | ## 404 Entity not found | Description | |-------------------------------------------------------------------------| | Entity not found | | Resource not found | | None of the templates is available for the workspace. | ## 422 Unprocessable Entity | Description | |-------------------------------------------------------------------------| | Unable to parse JSON, please check formatting | | Required parameter missing | | Required parameter missing: template definition not defined | | Required parameter missing: template not defined | ## 429 Too Many Requests | Description | |-------------------------------------------------------------------------| | You can make up to 2 requests per second and 60 requests per minute. | * * * * *
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 4.0.25
|
|
7
|
+
Contact: support@pdfgeneratorapi.com
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.14.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module PDFGeneratorAPI
|
|
17
|
+
class AccessibilityOption
|
|
18
|
+
CLEAR_STRUCTURE = "clear_structure".freeze
|
|
19
|
+
CLEAR_BOOKMARKS = "clear_bookmarks".freeze
|
|
20
|
+
EMBED_FONT = "embed_font".freeze
|
|
21
|
+
ADD_MISSING_UNICODE = "add_missing_unicode".freeze
|
|
22
|
+
ADD_TAGS = "add_tags".freeze
|
|
23
|
+
SET_LANGUAGE = "set_language".freeze
|
|
24
|
+
SET_TITLE = "set_title".freeze
|
|
25
|
+
SET_DISPLAY_DOC_TITLE = "set_display_doc_title".freeze
|
|
26
|
+
SET_PDF_UA_STANDARD = "set_pdf_ua_standard".freeze
|
|
27
|
+
|
|
28
|
+
def self.all_vars
|
|
29
|
+
@all_vars ||= [CLEAR_STRUCTURE, CLEAR_BOOKMARKS, EMBED_FONT, ADD_MISSING_UNICODE, ADD_TAGS, SET_LANGUAGE, SET_TITLE, SET_DISPLAY_DOC_TITLE, SET_PDF_UA_STANDARD].freeze
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Builds the enum from string
|
|
33
|
+
# @param [String] The enum value in the form of the string
|
|
34
|
+
# @return [String] The enum value
|
|
35
|
+
def self.build_from_hash(value)
|
|
36
|
+
new.build_from_hash(value)
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
# Builds the enum from string
|
|
40
|
+
# @param [String] The enum value in the form of the string
|
|
41
|
+
# @return [String] The enum value
|
|
42
|
+
def build_from_hash(value)
|
|
43
|
+
return value if AccessibilityOption.all_vars.include?(value)
|
|
44
|
+
raise "Invalid ENUM value #{value} for class #AccessibilityOption"
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#PDF Generator API
|
|
3
|
+
|
|
4
|
+
## Introduction [PDF Generator API](https://pdfgeneratorapi.com) allows you easily generate transactional PDF documents and reduce the development and support costs by enabling your users to create and manage their document templates using a browser-based drag-and-drop document editor. The PDF Generator API features a web API architecture, allowing you to code in the language of your choice. This API supports the JSON media type, and uses UTF-8 character encoding. ## Base URL The base URL for all the API endpoints is `https://us1.pdfgeneratorapi.com/api/v4` For example * `https://us1.pdfgeneratorapi.com/api/v4/templates` * `https://us1.pdfgeneratorapi.com/api/v4/workspaces` * `https://us1.pdfgeneratorapi.com/api/v4/templates/123123` ## Editor PDF Generator API comes with a powerful drag & drop editor that allows to create any kind of document templates, from barcode labels to invoices, quotes and reports. You can find tutorials and videos from our [Support Portal](https://support.pdfgeneratorapi.com). * [Component specification](https://support.pdfgeneratorapi.com/en/category/components-1ffseaj/) * [Expression Language documentation](https://support.pdfgeneratorapi.com/en/category/expression-language-q203pa/) * [Frequently asked questions and answers](https://support.pdfgeneratorapi.com/en/category/qanda-1ov519d/) ## Definitions ### Organization Organization is a group of workspaces owned by your account. ### Workspace Workspace contains templates. Each workspace has access to their own templates and organization default templates. ### Master Workspace Master Workspace is the main/default workspace of your Organization. The Master Workspace identifier is the email you signed up with. ### Default Template Default template is a template that is available for all workspaces by default. You can set the template access type under Page Setup. If template has \"Organization\" access then your users can use them from the \"New\" menu in the Editor. ### Data Field Data Field is a placeholder for the specific data in your JSON data set. In this example JSON you can access the buyer name using Data Field `{paymentDetails::buyerName}`. The separator between depth levels is :: (two colons). When designing the template you don’t have to know every Data Field, our editor automatically extracts all the available fields from your data set and provides an easy way to insert them into the template. ``` { \"documentNumber\": 1, \"paymentDetails\": { \"method\": \"Credit Card\", \"buyerName\": \"John Smith\" }, \"items\": [ { \"id\": 1, \"name\": \"Item one\" } ] } ``` ## Rate limiting Our API endpoints use IP-based rate limiting and allow you to make up to 2 requests per second and 60 requests per minute. If you make more requests, you will receive a response with HTTP code 429. Response headers contain additional values: | Header | Description | |--------|--------------------------------| | X-RateLimit-Limit | Maximum requests per minute | | X-RateLimit-Remaining | The requests remaining in the current minute | | Retry-After | How many seconds you need to wait until you are allowed to make requests | * * * * * # Libraries and SDKs ## Postman Collection We have created a [Postman Collection](https://www.postman.com/pdfgeneratorapi/workspace/pdf-generator-api-public-workspace/overview) so you can easily test all the API endpoints without developing and code. ## Client Libraries All our Client Libraries are auto-generated using [OpenAPI Generator](https://openapi-generator.tech/) which uses the OpenAPI v3 specification to automatically generate a client library in specific programming language. * [PHP Client](https://github.com/pdfgeneratorapi/php-client) * [Java Client](https://github.com/pdfgeneratorapi/java-client) * [Ruby Client](https://github.com/pdfgeneratorapi/ruby-client) * [Python Client](https://github.com/pdfgeneratorapi/python-client) * [Javascript Client](https://github.com/pdfgeneratorapi/javascript-client) We have validated the generated libraries, but let us know if you find any anomalies in the client code. ## Model Context Protocol (MCP) Server Integrate document generation directly into your AI agents and LLM applications using our official Model Context Protocol (MCP) Server. The MCP server provides a standardized interface that allows AI assistants (like Claude Desktop and other MCP-compatible clients) to securely interact with the PDF Generator API. With it, your AI applications can automatically fetch workspaces, retrieve templates, merge data, and generate PDF documents on the fly. [Get PDF Generator API MCP Server](https://github.com/pdfgeneratorapi/mcp-server) * * * * * # Authentication The PDF Generator API uses __JSON Web Tokens (JWT)__ to authenticate all API requests. These tokens offer a method to establish secure server-to-server authentication by transferring a compact JSON object with a signed payload of your account’s API Key and Secret. When authenticating to the PDF Generator API, a JWT should be generated uniquely by a __server-side application__ and included as a __Bearer Token__ in the header of each request. <SecurityDefinitions /> ## Accessing your API Key and Secret You can find your __API Key__ and __API Secret__ from the __Account Settings__ page after you login to PDF Generator API [here](https://pdfgeneratorapi.com/login). ## Creating a JWT JSON Web Tokens are composed of three sections: a header, a payload (containing a claim set), and a signature. The header and payload are JSON objects, which are serialized to UTF-8 bytes, then encoded using base64url encoding. The JWT's header, payload, and signature are concatenated with periods (.). As a result, a JWT typically takes the following form: ``` {Base64url encoded header}.{Base64url encoded payload}.{Base64url encoded signature} ``` We recommend and support libraries provided on [jwt.io](https://jwt.io/). While other libraries can create JWT, these recommended libraries are the most robust. ### Header Property `alg` defines which signing algorithm is being used. PDF Generator API users HS256. Property `typ` defines the type of token and it is always JWT. ``` { \"alg\": \"HS256\", \"typ\": \"JWT\" } ``` ### Payload The second part of the token is the payload, which contains the claims or the pieces of information being passed about the user and any metadata required. It is mandatory to specify the following claims: * issuer (`iss`): Your API key * subject (`sub`): Workspace identifier * expiration time (`exp`): Timestamp (unix epoch time) until the token is valid. It is highly recommended to set the exp timestamp for a short period, i.e. a matter of seconds. This way, if a token is intercepted or shared, the token will only be valid for a short period of time. ``` { \"iss\": \"ad54aaff89ffdfeff178bb8a8f359b29fcb20edb56250b9f584aa2cb0162ed4a\", \"sub\": \"demo.example@actualreports.com\", \"exp\": 1586112639 } ``` ### Payload for Partners Our partners can send their unique identifier (provided by us) in JWT's partner_id claim. If the `partner_id` value is specified in the JWT, the organization making the request is automatically connected to the partner account. * Partner ID (`partner_id`): Unique identifier provide by PDF Generator API team ``` { \"iss\": \"ad54aaff89ffdfeff178bb8a8f359b29fcb20edb56250b9f584aa2cb0162ed4a\", \"sub\": \"demo.example@actualreports.com\", \"partner_id\": \"my-partner-identifier\", \"exp\": 1586112639 } ``` ### Signature To create the signature part you have to take the encoded header, the encoded payload, a secret, the algorithm specified in the header, and sign that. The signature is used to verify the message wasn't changed along the way, and, in the case of tokens signed with a private key, it can also verify that the sender of the JWT is who it says it is. ``` HMACSHA256( base64UrlEncode(header) + \".\" + base64UrlEncode(payload), API_SECRET) ``` ### Putting all together The output is three Base64-URL strings separated by dots. The following shows a JWT that has the previous header and payload encoded, and it is signed with a secret. ``` eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJhZDU0YWFmZjg5ZmZkZmVmZjE3OGJiOGE4ZjM1OWIyOWZjYjIwZWRiNTYyNTBiOWY1ODRhYTJjYjAxNjJlZDRhIiwic3ViIjoiZGVtby5leGFtcGxlQGFjdHVhbHJlcG9ydHMuY29tIn0.SxO-H7UYYYsclS8RGWO1qf0z1cB1m73wF9FLl9RCc1Q // Base64 encoded header: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9 // Base64 encoded payload: eyJpc3MiOiJhZDU0YWFmZjg5ZmZkZmVmZjE3OGJiOGE4ZjM1OWIyOWZjYjIwZWRiNTYyNTBiOWY1ODRhYTJjYjAxNjJlZDRhIiwic3ViIjoiZGVtby5leGFtcGxlQGFjdHVhbHJlcG9ydHMuY29tIn0 // Signature: SxO-H7UYYYsclS8RGWO1qf0z1cB1m73wF9FLl9RCc1Q ``` ## Temporary JWTs You can create a temporary token in [Account Settings](https://pdfgeneratorapi.com/account/organization) page after you login to PDF Generator API. The generated token uses your email address as the subject (`sub`) value and is valid for __15 minutes__. You can also use [jwt.io](https://jwt.io/) to generate test tokens for your API calls. These test tokens should never be used in production applications. * * * * * # Error codes | Code | Description | |--------|--------------------------------| | 401 | Unauthorized | | 402 | Payment Required | | 403 | Forbidden | | 404 | Not Found | | 422 | Unprocessable Entity | | 429 | Too Many Requests | | 500 | Internal Server Error | ## 401 Unauthorized | Description | |-------------------------------------------------------------------------| | Authentication failed: request expired | | Authentication failed: workspace missing | | Authentication failed: key missing | | Authentication failed: property 'iss' (issuer) missing in JWT | | Authentication failed: property 'sub' (subject) missing in JWT | | Authentication failed: property 'exp' (expiration time) missing in JWT | | Authentication failed: incorrect signature | ## 402 Payment Required | Description | |-------------------------------------------------------------------------| | Your account is suspended, please upgrade your account | ## 403 Forbidden | Description | |-------------------------------------------------------------------------| | Your account has exceeded the monthly document generation limit. | | Access not granted: You cannot delete master workspace via API | | Access not granted: Template is not accessible by this organization | | Your session has expired, please close and reopen the editor. | ## 404 Entity not found | Description | |-------------------------------------------------------------------------| | Entity not found | | Resource not found | | None of the templates is available for the workspace. | ## 422 Unprocessable Entity | Description | |-------------------------------------------------------------------------| | Unable to parse JSON, please check formatting | | Required parameter missing | | Required parameter missing: template definition not defined | | Required parameter missing: template not defined | ## 429 Too Many Requests | Description | |-------------------------------------------------------------------------| | You can make up to 2 requests per second and 60 requests per minute. | * * * * *
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 4.0.25
|
|
7
|
+
Contact: support@pdfgeneratorapi.com
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.14.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module PDFGeneratorAPI
|
|
17
|
+
module AddWatermarkRequest
|
|
18
|
+
class << self
|
|
19
|
+
# List of class defined in oneOf (OpenAPI v3)
|
|
20
|
+
def openapi_one_of
|
|
21
|
+
[
|
|
22
|
+
:'WatermarkBase64',
|
|
23
|
+
:'WatermarkFileUrl'
|
|
24
|
+
]
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
# Builds the object
|
|
28
|
+
# @param [Mixed] Data to be matched against the list of oneOf items
|
|
29
|
+
# @return [Object] Returns the model or the data itself
|
|
30
|
+
def build(data)
|
|
31
|
+
# Go through the list of oneOf items and attempt to identify the appropriate one.
|
|
32
|
+
# Note:
|
|
33
|
+
# - We do not attempt to check whether exactly one item matches.
|
|
34
|
+
# - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
|
|
35
|
+
# due to the way the deserialization is made in the base_object template (it just casts without verifying).
|
|
36
|
+
# - TODO: scalar values are de facto behaving as if they were nullable.
|
|
37
|
+
# - TODO: logging when debugging is set.
|
|
38
|
+
openapi_one_of.each do |klass|
|
|
39
|
+
begin
|
|
40
|
+
next if klass == :AnyType # "nullable: true"
|
|
41
|
+
typed_data = find_and_cast_into_type(klass, data)
|
|
42
|
+
return typed_data if typed_data
|
|
43
|
+
rescue # rescue all errors so we keep iterating even if the current item lookup raises
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
openapi_one_of.include?(:AnyType) ? data : nil
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
private
|
|
51
|
+
|
|
52
|
+
SchemaMismatchError = Class.new(StandardError)
|
|
53
|
+
|
|
54
|
+
# Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse.
|
|
55
|
+
def find_and_cast_into_type(klass, data)
|
|
56
|
+
return if data.nil?
|
|
57
|
+
|
|
58
|
+
case klass.to_s
|
|
59
|
+
when 'Boolean'
|
|
60
|
+
return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass)
|
|
61
|
+
when 'Float'
|
|
62
|
+
return data if data.instance_of?(Float)
|
|
63
|
+
when 'Integer'
|
|
64
|
+
return data if data.instance_of?(Integer)
|
|
65
|
+
when 'Time'
|
|
66
|
+
return Time.parse(data)
|
|
67
|
+
when 'Date'
|
|
68
|
+
return Date.iso8601(data)
|
|
69
|
+
when 'String'
|
|
70
|
+
return data if data.instance_of?(String)
|
|
71
|
+
when 'Object' # "type: object"
|
|
72
|
+
return data if data.instance_of?(Hash)
|
|
73
|
+
when /\AArray<(?<sub_type>.+)>\z/ # "type: array"
|
|
74
|
+
if data.instance_of?(Array)
|
|
75
|
+
sub_type = Regexp.last_match[:sub_type]
|
|
76
|
+
return data.map { |item| find_and_cast_into_type(sub_type, item) }
|
|
77
|
+
end
|
|
78
|
+
when /\AHash<String, (?<sub_type>.+)>\z/ # "type: object" with "additionalProperties: { ... }"
|
|
79
|
+
if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) }
|
|
80
|
+
sub_type = Regexp.last_match[:sub_type]
|
|
81
|
+
return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) }
|
|
82
|
+
end
|
|
83
|
+
else # model
|
|
84
|
+
const = PDFGeneratorAPI.const_get(klass)
|
|
85
|
+
if const
|
|
86
|
+
if const.respond_to?(:openapi_one_of) # nested oneOf model
|
|
87
|
+
model = const.build(data)
|
|
88
|
+
return model if model
|
|
89
|
+
else
|
|
90
|
+
# raise if data contains keys that are not known to the model
|
|
91
|
+
raise if const.respond_to?(:acceptable_attributes) && !(data.keys - const.acceptable_attributes).empty?
|
|
92
|
+
model = const.build_from_hash(data)
|
|
93
|
+
return model if model
|
|
94
|
+
end
|
|
95
|
+
end
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
raise # if no match by now, raise
|
|
99
|
+
rescue
|
|
100
|
+
raise SchemaMismatchError, "#{data} doesn't match the #{klass} type"
|
|
101
|
+
end
|
|
102
|
+
end
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
end
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#PDF Generator API
|
|
3
|
+
|
|
4
|
+
## Introduction [PDF Generator API](https://pdfgeneratorapi.com) allows you easily generate transactional PDF documents and reduce the development and support costs by enabling your users to create and manage their document templates using a browser-based drag-and-drop document editor. The PDF Generator API features a web API architecture, allowing you to code in the language of your choice. This API supports the JSON media type, and uses UTF-8 character encoding. ## Base URL The base URL for all the API endpoints is `https://us1.pdfgeneratorapi.com/api/v4` For example * `https://us1.pdfgeneratorapi.com/api/v4/templates` * `https://us1.pdfgeneratorapi.com/api/v4/workspaces` * `https://us1.pdfgeneratorapi.com/api/v4/templates/123123` ## Editor PDF Generator API comes with a powerful drag & drop editor that allows to create any kind of document templates, from barcode labels to invoices, quotes and reports. You can find tutorials and videos from our [Support Portal](https://support.pdfgeneratorapi.com). * [Component specification](https://support.pdfgeneratorapi.com/en/category/components-1ffseaj/) * [Expression Language documentation](https://support.pdfgeneratorapi.com/en/category/expression-language-q203pa/) * [Frequently asked questions and answers](https://support.pdfgeneratorapi.com/en/category/qanda-1ov519d/) ## Definitions ### Organization Organization is a group of workspaces owned by your account. ### Workspace Workspace contains templates. Each workspace has access to their own templates and organization default templates. ### Master Workspace Master Workspace is the main/default workspace of your Organization. The Master Workspace identifier is the email you signed up with. ### Default Template Default template is a template that is available for all workspaces by default. You can set the template access type under Page Setup. If template has \"Organization\" access then your users can use them from the \"New\" menu in the Editor. ### Data Field Data Field is a placeholder for the specific data in your JSON data set. In this example JSON you can access the buyer name using Data Field `{paymentDetails::buyerName}`. The separator between depth levels is :: (two colons). When designing the template you don’t have to know every Data Field, our editor automatically extracts all the available fields from your data set and provides an easy way to insert them into the template. ``` { \"documentNumber\": 1, \"paymentDetails\": { \"method\": \"Credit Card\", \"buyerName\": \"John Smith\" }, \"items\": [ { \"id\": 1, \"name\": \"Item one\" } ] } ``` ## Rate limiting Our API endpoints use IP-based rate limiting and allow you to make up to 2 requests per second and 60 requests per minute. If you make more requests, you will receive a response with HTTP code 429. Response headers contain additional values: | Header | Description | |--------|--------------------------------| | X-RateLimit-Limit | Maximum requests per minute | | X-RateLimit-Remaining | The requests remaining in the current minute | | Retry-After | How many seconds you need to wait until you are allowed to make requests | * * * * * # Libraries and SDKs ## Postman Collection We have created a [Postman Collection](https://www.postman.com/pdfgeneratorapi/workspace/pdf-generator-api-public-workspace/overview) so you can easily test all the API endpoints without developing and code. ## Client Libraries All our Client Libraries are auto-generated using [OpenAPI Generator](https://openapi-generator.tech/) which uses the OpenAPI v3 specification to automatically generate a client library in specific programming language. * [PHP Client](https://github.com/pdfgeneratorapi/php-client) * [Java Client](https://github.com/pdfgeneratorapi/java-client) * [Ruby Client](https://github.com/pdfgeneratorapi/ruby-client) * [Python Client](https://github.com/pdfgeneratorapi/python-client) * [Javascript Client](https://github.com/pdfgeneratorapi/javascript-client) We have validated the generated libraries, but let us know if you find any anomalies in the client code. ## Model Context Protocol (MCP) Server Integrate document generation directly into your AI agents and LLM applications using our official Model Context Protocol (MCP) Server. The MCP server provides a standardized interface that allows AI assistants (like Claude Desktop and other MCP-compatible clients) to securely interact with the PDF Generator API. With it, your AI applications can automatically fetch workspaces, retrieve templates, merge data, and generate PDF documents on the fly. [Get PDF Generator API MCP Server](https://github.com/pdfgeneratorapi/mcp-server) * * * * * # Authentication The PDF Generator API uses __JSON Web Tokens (JWT)__ to authenticate all API requests. These tokens offer a method to establish secure server-to-server authentication by transferring a compact JSON object with a signed payload of your account’s API Key and Secret. When authenticating to the PDF Generator API, a JWT should be generated uniquely by a __server-side application__ and included as a __Bearer Token__ in the header of each request. <SecurityDefinitions /> ## Accessing your API Key and Secret You can find your __API Key__ and __API Secret__ from the __Account Settings__ page after you login to PDF Generator API [here](https://pdfgeneratorapi.com/login). ## Creating a JWT JSON Web Tokens are composed of three sections: a header, a payload (containing a claim set), and a signature. The header and payload are JSON objects, which are serialized to UTF-8 bytes, then encoded using base64url encoding. The JWT's header, payload, and signature are concatenated with periods (.). As a result, a JWT typically takes the following form: ``` {Base64url encoded header}.{Base64url encoded payload}.{Base64url encoded signature} ``` We recommend and support libraries provided on [jwt.io](https://jwt.io/). While other libraries can create JWT, these recommended libraries are the most robust. ### Header Property `alg` defines which signing algorithm is being used. PDF Generator API users HS256. Property `typ` defines the type of token and it is always JWT. ``` { \"alg\": \"HS256\", \"typ\": \"JWT\" } ``` ### Payload The second part of the token is the payload, which contains the claims or the pieces of information being passed about the user and any metadata required. It is mandatory to specify the following claims: * issuer (`iss`): Your API key * subject (`sub`): Workspace identifier * expiration time (`exp`): Timestamp (unix epoch time) until the token is valid. It is highly recommended to set the exp timestamp for a short period, i.e. a matter of seconds. This way, if a token is intercepted or shared, the token will only be valid for a short period of time. ``` { \"iss\": \"ad54aaff89ffdfeff178bb8a8f359b29fcb20edb56250b9f584aa2cb0162ed4a\", \"sub\": \"demo.example@actualreports.com\", \"exp\": 1586112639 } ``` ### Payload for Partners Our partners can send their unique identifier (provided by us) in JWT's partner_id claim. If the `partner_id` value is specified in the JWT, the organization making the request is automatically connected to the partner account. * Partner ID (`partner_id`): Unique identifier provide by PDF Generator API team ``` { \"iss\": \"ad54aaff89ffdfeff178bb8a8f359b29fcb20edb56250b9f584aa2cb0162ed4a\", \"sub\": \"demo.example@actualreports.com\", \"partner_id\": \"my-partner-identifier\", \"exp\": 1586112639 } ``` ### Signature To create the signature part you have to take the encoded header, the encoded payload, a secret, the algorithm specified in the header, and sign that. The signature is used to verify the message wasn't changed along the way, and, in the case of tokens signed with a private key, it can also verify that the sender of the JWT is who it says it is. ``` HMACSHA256( base64UrlEncode(header) + \".\" + base64UrlEncode(payload), API_SECRET) ``` ### Putting all together The output is three Base64-URL strings separated by dots. The following shows a JWT that has the previous header and payload encoded, and it is signed with a secret. ``` eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJhZDU0YWFmZjg5ZmZkZmVmZjE3OGJiOGE4ZjM1OWIyOWZjYjIwZWRiNTYyNTBiOWY1ODRhYTJjYjAxNjJlZDRhIiwic3ViIjoiZGVtby5leGFtcGxlQGFjdHVhbHJlcG9ydHMuY29tIn0.SxO-H7UYYYsclS8RGWO1qf0z1cB1m73wF9FLl9RCc1Q // Base64 encoded header: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9 // Base64 encoded payload: eyJpc3MiOiJhZDU0YWFmZjg5ZmZkZmVmZjE3OGJiOGE4ZjM1OWIyOWZjYjIwZWRiNTYyNTBiOWY1ODRhYTJjYjAxNjJlZDRhIiwic3ViIjoiZGVtby5leGFtcGxlQGFjdHVhbHJlcG9ydHMuY29tIn0 // Signature: SxO-H7UYYYsclS8RGWO1qf0z1cB1m73wF9FLl9RCc1Q ``` ## Temporary JWTs You can create a temporary token in [Account Settings](https://pdfgeneratorapi.com/account/organization) page after you login to PDF Generator API. The generated token uses your email address as the subject (`sub`) value and is valid for __15 minutes__. You can also use [jwt.io](https://jwt.io/) to generate test tokens for your API calls. These test tokens should never be used in production applications. * * * * * # Error codes | Code | Description | |--------|--------------------------------| | 401 | Unauthorized | | 402 | Payment Required | | 403 | Forbidden | | 404 | Not Found | | 422 | Unprocessable Entity | | 429 | Too Many Requests | | 500 | Internal Server Error | ## 401 Unauthorized | Description | |-------------------------------------------------------------------------| | Authentication failed: request expired | | Authentication failed: workspace missing | | Authentication failed: key missing | | Authentication failed: property 'iss' (issuer) missing in JWT | | Authentication failed: property 'sub' (subject) missing in JWT | | Authentication failed: property 'exp' (expiration time) missing in JWT | | Authentication failed: incorrect signature | ## 402 Payment Required | Description | |-------------------------------------------------------------------------| | Your account is suspended, please upgrade your account | ## 403 Forbidden | Description | |-------------------------------------------------------------------------| | Your account has exceeded the monthly document generation limit. | | Access not granted: You cannot delete master workspace via API | | Access not granted: Template is not accessible by this organization | | Your session has expired, please close and reopen the editor. | ## 404 Entity not found | Description | |-------------------------------------------------------------------------| | Entity not found | | Resource not found | | None of the templates is available for the workspace. | ## 422 Unprocessable Entity | Description | |-------------------------------------------------------------------------| | Unable to parse JSON, please check formatting | | Required parameter missing | | Required parameter missing: template definition not defined | | Required parameter missing: template not defined | ## 429 Too Many Requests | Description | |-------------------------------------------------------------------------| | You can make up to 2 requests per second and 60 requests per minute. | * * * * *
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 4.0.25
|
|
7
|
+
Contact: support@pdfgeneratorapi.com
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.14.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module PDFGeneratorAPI
|
|
17
|
+
class AsyncOutputParam
|
|
18
|
+
BASE64 = "base64".freeze
|
|
19
|
+
URL = "url".freeze
|
|
20
|
+
VIEWER = "viewer".freeze
|
|
21
|
+
|
|
22
|
+
def self.all_vars
|
|
23
|
+
@all_vars ||= [BASE64, URL, VIEWER].freeze
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
# Builds the enum from string
|
|
27
|
+
# @param [String] The enum value in the form of the string
|
|
28
|
+
# @return [String] The enum value
|
|
29
|
+
def self.build_from_hash(value)
|
|
30
|
+
new.build_from_hash(value)
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Builds the enum from string
|
|
34
|
+
# @param [String] The enum value in the form of the string
|
|
35
|
+
# @return [String] The enum value
|
|
36
|
+
def build_from_hash(value)
|
|
37
|
+
return value if AsyncOutputParam.all_vars.include?(value)
|
|
38
|
+
raise "Invalid ENUM value #{value} for class #AsyncOutputParam"
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|