Class: PdfServices::DocumentGeneration::Internal

Inherits:
Operation show all
Defined in:
lib/pdfservices/operations/document_generation/internal.rb

Constant Summary collapse

INTERNAL_OPTIONS =
%i[output_format json_data_for_merge fragments notifiers].freeze

Constants inherited from Operation

Operation::OPERATION_ENDPOINT

Constants inherited from Base::Operation

Base::Operation::ASSETS_ENDPOINT, Base::Operation::BASE_ENDPOINT, Base::Operation::STATUS

Instance Method Summary collapse

Methods inherited from Operation

#external_class, #internal_class, #request_headers

Methods inherited from Base::Operation

#handle_response, #initialize, #poll_document_result, #upload_asset

Constructor Details

This class inherits a constructor from PdfServices::Base::Operation

Instance Method Details

#execute(template_path, options = {}, &block) ⇒ Object



8
9
10
11
12
13
14
15
16
17
# File 'lib/pdfservices/operations/document_generation/internal.rb', line 8

def execute(template_path, options = {}, &block)
  validate_options(options)
  asset = upload_asset(template_path)

  response = @api.post(OPERATION_ENDPOINT,
                       body: request_body(asset.id, options),
                       headers: request_headers)

  handle_response(response, asset, &block)
end