Class: PDFGeneratorAPI::TemplatesApi
- Inherits:
-
Object
- Object
- PDFGeneratorAPI::TemplatesApi
- Defined in:
- lib/pdf_generator_api_client/api/templates_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#copy_template(template_id, opts = {}) ⇒ InlineObject16
Copy template Creates a copy of a template to the workspace specified in authentication parameters.
-
#copy_template_with_http_info(template_id, opts = {}) ⇒ Array<(InlineObject16, Integer, Hash)>
Copy template Creates a copy of a template to the workspace specified in authentication parameters.
-
#create_template(template_definition_new, opts = {}) ⇒ InlineObject16
Create template Creates a new template.
-
#create_template_with_http_info(template_definition_new, opts = {}) ⇒ Array<(InlineObject16, Integer, Hash)>
Create template Creates a new template.
-
#delete_template(template_id, opts = {}) ⇒ nil
Delete template Deletes the template from workspace.
-
#delete_template_with_http_info(template_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Delete template Deletes the template from workspace.
-
#get_template(template_id, opts = {}) ⇒ InlineObject16
Get template Returns template configuration.
-
#get_template_data(template_id, opts = {}) ⇒ InlineObject2
Get template data fields Returns all data fields used in the template.
-
#get_template_data_with_http_info(template_id, opts = {}) ⇒ Array<(InlineObject2, Integer, Hash)>
Get template data fields Returns all data fields used in the template.
-
#get_template_schema(opts = {}) ⇒ Object
Get schema Returns Template JSON Schema which defines the structure of the Template Definition.
-
#get_template_schema_with_http_info(opts = {}) ⇒ Array<(Object, Integer, Hash)>
Get schema Returns Template JSON Schema which defines the structure of the Template Definition.
-
#get_template_with_http_info(template_id, opts = {}) ⇒ Array<(InlineObject16, Integer, Hash)>
Get template Returns template configuration.
-
#get_templates(opts = {}) ⇒ InlineObject4
Get templates Returns a list of templates available for the authenticated workspace.
-
#get_templates_with_http_info(opts = {}) ⇒ Array<(InlineObject4, Integer, Hash)>
Get templates Returns a list of templates available for the authenticated workspace.
-
#import_template(import_template_request, opts = {}) ⇒ InlineObject16
Import template Creates a template from existing PDF.
-
#import_template_with_http_info(import_template_request, opts = {}) ⇒ Array<(InlineObject16, Integer, Hash)>
Import template Creates a template from existing PDF.
-
#initialize(api_client = ApiClient.default) ⇒ TemplatesApi
constructor
A new instance of TemplatesApi.
-
#open_editor(template_id, open_editor_request, opts = {}) ⇒ InlineObject3
Open editor Returns an unique URL which you can use to redirect your user to the editor from your application or use the generated URL as iframe source to show the editor within your application.
-
#open_editor_with_http_info(template_id, open_editor_request, opts = {}) ⇒ Array<(InlineObject3, Integer, Hash)>
Open editor Returns an unique URL which you can use to redirect your user to the editor from your application or use the generated URL as iframe source to show the editor within your application.
-
#update_template(template_id, template_definition_new, opts = {}) ⇒ InlineObject16
Update template Updates template configuration.
-
#update_template_with_http_info(template_id, template_definition_new, opts = {}) ⇒ Array<(InlineObject16, Integer, Hash)>
Update template Updates template configuration.
-
#validate_template(template_definition_new, opts = {}) ⇒ InlineObject1
Validate template Validates if the provided template configuration matches the template JSON schema.
-
#validate_template_with_http_info(template_definition_new, opts = {}) ⇒ Array<(InlineObject1, Integer, Hash)>
Validate template Validates if the provided template configuration matches the template JSON schema.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ TemplatesApi
Returns a new instance of TemplatesApi.
19 20 21 |
# File 'lib/pdf_generator_api_client/api/templates_api.rb', line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/pdf_generator_api_client/api/templates_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#copy_template(template_id, opts = {}) ⇒ InlineObject16
Copy template Creates a copy of a template to the workspace specified in authentication parameters.
28 29 30 31 |
# File 'lib/pdf_generator_api_client/api/templates_api.rb', line 28 def copy_template(template_id, opts = {}) data, _status_code, _headers = copy_template_with_http_info(template_id, opts) data end |
#copy_template_with_http_info(template_id, opts = {}) ⇒ Array<(InlineObject16, Integer, Hash)>
Copy template Creates a copy of a template to the workspace specified in authentication parameters.
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
# File 'lib/pdf_generator_api_client/api/templates_api.rb', line 39 def copy_template_with_http_info(template_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TemplatesApi.copy_template ...' end # verify the required parameter 'template_id' is set if @api_client.config.client_side_validation && template_id.nil? fail ArgumentError, "Missing the required parameter 'template_id' when calling TemplatesApi.copy_template" end # resource path local_var_path = '/templates/{templateId}/copy'.sub('{' + 'templateId' + '}', CGI.escape(template_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'copy_template_request']) # return_type return_type = opts[:debug_return_type] || 'InlineObject16' # auth_names auth_names = opts[:debug_auth_names] || ['JSONWebTokenAuth'] = opts.merge( :operation => :"TemplatesApi.copy_template", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: TemplatesApi#copy_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#create_template(template_definition_new, opts = {}) ⇒ InlineObject16
Create template Creates a new template. If template configuration is not specified in the request body then an empty template is created. Template is placed to the workspace specified in authentication params. Template configuration must be sent in the request body.
97 98 99 100 |
# File 'lib/pdf_generator_api_client/api/templates_api.rb', line 97 def create_template(template_definition_new, opts = {}) data, _status_code, _headers = create_template_with_http_info(template_definition_new, opts) data end |
#create_template_with_http_info(template_definition_new, opts = {}) ⇒ Array<(InlineObject16, Integer, Hash)>
Create template Creates a new template. If template configuration is not specified in the request body then an empty template is created. Template is placed to the workspace specified in authentication params. Template configuration must be sent in the request body.
107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 |
# File 'lib/pdf_generator_api_client/api/templates_api.rb', line 107 def create_template_with_http_info(template_definition_new, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TemplatesApi.create_template ...' end # verify the required parameter 'template_definition_new' is set if @api_client.config.client_side_validation && template_definition_new.nil? fail ArgumentError, "Missing the required parameter 'template_definition_new' when calling TemplatesApi.create_template" end # resource path local_var_path = '/templates' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(template_definition_new) # return_type return_type = opts[:debug_return_type] || 'InlineObject16' # auth_names auth_names = opts[:debug_auth_names] || ['JSONWebTokenAuth'] = opts.merge( :operation => :"TemplatesApi.create_template", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: TemplatesApi#create_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#delete_template(template_id, opts = {}) ⇒ nil
Delete template Deletes the template from workspace
165 166 167 168 |
# File 'lib/pdf_generator_api_client/api/templates_api.rb', line 165 def delete_template(template_id, opts = {}) delete_template_with_http_info(template_id, opts) nil end |
#delete_template_with_http_info(template_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Delete template Deletes the template from workspace
175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 |
# File 'lib/pdf_generator_api_client/api/templates_api.rb', line 175 def delete_template_with_http_info(template_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TemplatesApi.delete_template ...' end # verify the required parameter 'template_id' is set if @api_client.config.client_side_validation && template_id.nil? fail ArgumentError, "Missing the required parameter 'template_id' when calling TemplatesApi.delete_template" end # resource path local_var_path = '/templates/{templateId}'.sub('{' + 'templateId' + '}', CGI.escape(template_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || ['JSONWebTokenAuth'] = opts.merge( :operation => :"TemplatesApi.delete_template", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: TemplatesApi#delete_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_template(template_id, opts = {}) ⇒ InlineObject16
Get template Returns template configuration
228 229 230 231 |
# File 'lib/pdf_generator_api_client/api/templates_api.rb', line 228 def get_template(template_id, opts = {}) data, _status_code, _headers = get_template_with_http_info(template_id, opts) data end |
#get_template_data(template_id, opts = {}) ⇒ InlineObject2
Get template data fields Returns all data fields used in the template. Returns structured JSON data that can be used to check which data fields are used in template or autogenerate sample data.
291 292 293 294 |
# File 'lib/pdf_generator_api_client/api/templates_api.rb', line 291 def get_template_data(template_id, opts = {}) data, _status_code, _headers = get_template_data_with_http_info(template_id, opts) data end |
#get_template_data_with_http_info(template_id, opts = {}) ⇒ Array<(InlineObject2, Integer, Hash)>
Get template data fields Returns all data fields used in the template. Returns structured JSON data that can be used to check which data fields are used in template or autogenerate sample data.
301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 |
# File 'lib/pdf_generator_api_client/api/templates_api.rb', line 301 def get_template_data_with_http_info(template_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TemplatesApi.get_template_data ...' end # verify the required parameter 'template_id' is set if @api_client.config.client_side_validation && template_id.nil? fail ArgumentError, "Missing the required parameter 'template_id' when calling TemplatesApi.get_template_data" end # resource path local_var_path = '/templates/{templateId}/data'.sub('{' + 'templateId' + '}', CGI.escape(template_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'InlineObject2' # auth_names auth_names = opts[:debug_auth_names] || ['JSONWebTokenAuth'] = opts.merge( :operation => :"TemplatesApi.get_template_data", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: TemplatesApi#get_template_data\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_template_schema(opts = {}) ⇒ Object
Get schema Returns Template JSON Schema which defines the structure of the Template Definition.
353 354 355 356 |
# File 'lib/pdf_generator_api_client/api/templates_api.rb', line 353 def get_template_schema(opts = {}) data, _status_code, _headers = get_template_schema_with_http_info(opts) data end |
#get_template_schema_with_http_info(opts = {}) ⇒ Array<(Object, Integer, Hash)>
Get schema Returns Template JSON Schema which defines the structure of the Template Definition.
362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 |
# File 'lib/pdf_generator_api_client/api/templates_api.rb', line 362 def get_template_schema_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TemplatesApi.get_template_schema ...' end # resource path local_var_path = '/templates/schema' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Object' # auth_names auth_names = opts[:debug_auth_names] || ['JSONWebTokenAuth'] = opts.merge( :operation => :"TemplatesApi.get_template_schema", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: TemplatesApi#get_template_schema\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_template_with_http_info(template_id, opts = {}) ⇒ Array<(InlineObject16, Integer, Hash)>
Get template Returns template configuration
238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 |
# File 'lib/pdf_generator_api_client/api/templates_api.rb', line 238 def get_template_with_http_info(template_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TemplatesApi.get_template ...' end # verify the required parameter 'template_id' is set if @api_client.config.client_side_validation && template_id.nil? fail ArgumentError, "Missing the required parameter 'template_id' when calling TemplatesApi.get_template" end # resource path local_var_path = '/templates/{templateId}'.sub('{' + 'templateId' + '}', CGI.escape(template_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'InlineObject16' # auth_names auth_names = opts[:debug_auth_names] || ['JSONWebTokenAuth'] = opts.merge( :operation => :"TemplatesApi.get_template", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: TemplatesApi#get_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_templates(opts = {}) ⇒ InlineObject4
Get templates Returns a list of templates available for the authenticated workspace
415 416 417 418 |
# File 'lib/pdf_generator_api_client/api/templates_api.rb', line 415 def get_templates(opts = {}) data, _status_code, _headers = get_templates_with_http_info(opts) data end |
#get_templates_with_http_info(opts = {}) ⇒ Array<(InlineObject4, Integer, Hash)>
Get templates Returns a list of templates available for the authenticated workspace
429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 |
# File 'lib/pdf_generator_api_client/api/templates_api.rb', line 429 def get_templates_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TemplatesApi.get_templates ...' end allowable_values = ["private", "organization", ""] if @api_client.config.client_side_validation && opts[:'access'] && !allowable_values.include?(opts[:'access']) fail ArgumentError, "invalid value for \"access\", must be one of #{allowable_values}" end # resource path local_var_path = '/templates' # query parameters query_params = opts[:query_params] || {} query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil? query_params[:'tags'] = opts[:'tags'] if !opts[:'tags'].nil? query_params[:'access'] = opts[:'access'] if !opts[:'access'].nil? query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'InlineObject4' # auth_names auth_names = opts[:debug_auth_names] || ['JSONWebTokenAuth'] = opts.merge( :operation => :"TemplatesApi.get_templates", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: TemplatesApi#get_templates\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#import_template(import_template_request, opts = {}) ⇒ InlineObject16
Import template Creates a template from existing PDF
487 488 489 490 |
# File 'lib/pdf_generator_api_client/api/templates_api.rb', line 487 def import_template(import_template_request, opts = {}) data, _status_code, _headers = import_template_with_http_info(import_template_request, opts) data end |
#import_template_with_http_info(import_template_request, opts = {}) ⇒ Array<(InlineObject16, Integer, Hash)>
Import template Creates a template from existing PDF
497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 |
# File 'lib/pdf_generator_api_client/api/templates_api.rb', line 497 def import_template_with_http_info(import_template_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TemplatesApi.import_template ...' end # verify the required parameter 'import_template_request' is set if @api_client.config.client_side_validation && import_template_request.nil? fail ArgumentError, "Missing the required parameter 'import_template_request' when calling TemplatesApi.import_template" end # resource path local_var_path = '/templates/import' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(import_template_request) # return_type return_type = opts[:debug_return_type] || 'InlineObject16' # auth_names auth_names = opts[:debug_auth_names] || ['JSONWebTokenAuth'] = opts.merge( :operation => :"TemplatesApi.import_template", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: TemplatesApi#import_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#open_editor(template_id, open_editor_request, opts = {}) ⇒ InlineObject3
Open editor Returns an unique URL which you can use to redirect your user to the editor from your application or use the generated URL as iframe source to show the editor within your application. When using iframe, make sure that your browser allows third-party cookies.
556 557 558 559 |
# File 'lib/pdf_generator_api_client/api/templates_api.rb', line 556 def open_editor(template_id, open_editor_request, opts = {}) data, _status_code, _headers = open_editor_with_http_info(template_id, open_editor_request, opts) data end |
#open_editor_with_http_info(template_id, open_editor_request, opts = {}) ⇒ Array<(InlineObject3, Integer, Hash)>
Open editor Returns an unique URL which you can use to redirect your user to the editor from your application or use the generated URL as iframe source to show the editor within your application. When using iframe, make sure that your browser allows third-party cookies.
567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 |
# File 'lib/pdf_generator_api_client/api/templates_api.rb', line 567 def open_editor_with_http_info(template_id, open_editor_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TemplatesApi.open_editor ...' end # verify the required parameter 'template_id' is set if @api_client.config.client_side_validation && template_id.nil? fail ArgumentError, "Missing the required parameter 'template_id' when calling TemplatesApi.open_editor" end # verify the required parameter 'open_editor_request' is set if @api_client.config.client_side_validation && open_editor_request.nil? fail ArgumentError, "Missing the required parameter 'open_editor_request' when calling TemplatesApi.open_editor" end # resource path local_var_path = '/templates/{templateId}/editor'.sub('{' + 'templateId' + '}', CGI.escape(template_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(open_editor_request) # return_type return_type = opts[:debug_return_type] || 'InlineObject3' # auth_names auth_names = opts[:debug_auth_names] || ['JSONWebTokenAuth'] = opts.merge( :operation => :"TemplatesApi.open_editor", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: TemplatesApi#open_editor\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#update_template(template_id, template_definition_new, opts = {}) ⇒ InlineObject16
Update template Updates template configuration. The template configuration for pages and layout must be complete as the entire configuration is replaced and not merged.
630 631 632 633 |
# File 'lib/pdf_generator_api_client/api/templates_api.rb', line 630 def update_template(template_id, template_definition_new, opts = {}) data, _status_code, _headers = update_template_with_http_info(template_id, template_definition_new, opts) data end |
#update_template_with_http_info(template_id, template_definition_new, opts = {}) ⇒ Array<(InlineObject16, Integer, Hash)>
Update template Updates template configuration. The template configuration for pages and layout must be complete as the entire configuration is replaced and not merged.
641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 |
# File 'lib/pdf_generator_api_client/api/templates_api.rb', line 641 def update_template_with_http_info(template_id, template_definition_new, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TemplatesApi.update_template ...' end # verify the required parameter 'template_id' is set if @api_client.config.client_side_validation && template_id.nil? fail ArgumentError, "Missing the required parameter 'template_id' when calling TemplatesApi.update_template" end # verify the required parameter 'template_definition_new' is set if @api_client.config.client_side_validation && template_definition_new.nil? fail ArgumentError, "Missing the required parameter 'template_definition_new' when calling TemplatesApi.update_template" end # resource path local_var_path = '/templates/{templateId}'.sub('{' + 'templateId' + '}', CGI.escape(template_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(template_definition_new) # return_type return_type = opts[:debug_return_type] || 'InlineObject16' # auth_names auth_names = opts[:debug_auth_names] || ['JSONWebTokenAuth'] = opts.merge( :operation => :"TemplatesApi.update_template", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:PUT, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: TemplatesApi#update_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#validate_template(template_definition_new, opts = {}) ⇒ InlineObject1
Validate template Validates if the provided template configuration matches the template JSON schema.
703 704 705 706 |
# File 'lib/pdf_generator_api_client/api/templates_api.rb', line 703 def validate_template(template_definition_new, opts = {}) data, _status_code, _headers = validate_template_with_http_info(template_definition_new, opts) data end |
#validate_template_with_http_info(template_definition_new, opts = {}) ⇒ Array<(InlineObject1, Integer, Hash)>
Validate template Validates if the provided template configuration matches the template JSON schema.
713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 |
# File 'lib/pdf_generator_api_client/api/templates_api.rb', line 713 def validate_template_with_http_info(template_definition_new, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TemplatesApi.validate_template ...' end # verify the required parameter 'template_definition_new' is set if @api_client.config.client_side_validation && template_definition_new.nil? fail ArgumentError, "Missing the required parameter 'template_definition_new' when calling TemplatesApi.validate_template" end # resource path local_var_path = '/templates/validate' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(template_definition_new) # return_type return_type = opts[:debug_return_type] || 'InlineObject1' # auth_names auth_names = opts[:debug_auth_names] || ['JSONWebTokenAuth'] = opts.merge( :operation => :"TemplatesApi.validate_template", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: TemplatesApi#validate_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |