Class: Shotstack::EditApi
- Inherits:
-
Object
- Object
- Shotstack::EditApi
- Defined in:
- lib/shotstack/api/edit_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#delete_template(id, opts = {}) ⇒ nil
Delete Template Delete a template by its template id.
-
#delete_template_with_http_info(id, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Delete Template Delete a template by its template id.
-
#get_render(id, opts = {}) ⇒ RenderResponse
Get Render Status Get the rendering status, temporary asset url and details of a render by ID.
-
#get_render_with_http_info(id, opts = {}) ⇒ Array<(RenderResponse, Integer, Hash)>
Get Render Status Get the rendering status, temporary asset url and details of a render by ID.
-
#get_template(id, opts = {}) ⇒ TemplateDataResponse
Retrieve Template Retrieve a template by template id.
-
#get_template_with_http_info(id, opts = {}) ⇒ Array<(TemplateDataResponse, Integer, Hash)>
Retrieve Template Retrieve a template by template id.
-
#get_templates(opts = {}) ⇒ TemplateListResponse
List Templates Retrieve a list of templates stored against a users account and stage.
-
#get_templates_with_http_info(opts = {}) ⇒ Array<(TemplateListResponse, Integer, Hash)>
List Templates Retrieve a list of templates stored against a users account and stage.
-
#initialize(api_client = ApiClient.default) ⇒ EditApi
constructor
A new instance of EditApi.
-
#post_render(edit, opts = {}) ⇒ QueuedResponse
Render Asset Queue and render the contents of an [Edit](#tocs_edit) as a video, image or audio file.
-
#post_render_with_http_info(edit, opts = {}) ⇒ Array<(QueuedResponse, Integer, Hash)>
Render Asset Queue and render the contents of an [Edit](#tocs_edit) as a video, image or audio file.
-
#post_template(template, opts = {}) ⇒ TemplateResponse
Create Template Save an [Edit](#tocs_edit) as a re-usable template.
-
#post_template_render(template_render, opts = {}) ⇒ QueuedResponse
Render Template Render an asset from a template id and optional merge fields.
-
#post_template_render_with_http_info(template_render, opts = {}) ⇒ Array<(QueuedResponse, Integer, Hash)>
Render Template Render an asset from a template id and optional merge fields.
-
#post_template_with_http_info(template, opts = {}) ⇒ Array<(TemplateResponse, Integer, Hash)>
Create Template Save an [Edit](#tocs_edit) as a re-usable template.
-
#probe(url, opts = {}) ⇒ ProbeResponse
Inspect Media Inspects any media asset (image, video, audio) on the internet using a hosted version of [FFprobe](ffmpeg.org/ffprobe.html).
-
#probe_with_http_info(url, opts = {}) ⇒ Array<(ProbeResponse, Integer, Hash)>
Inspect Media Inspects any media asset (image, video, audio) on the internet using a hosted version of [FFprobe](ffmpeg.org/ffprobe.html).
-
#put_template(id, template, opts = {}) ⇒ TemplateResponse
Update Template Update an existing template by template id.
-
#put_template_with_http_info(id, template, opts = {}) ⇒ Array<(TemplateResponse, Integer, Hash)>
Update Template Update an existing template by template id.
Constructor Details
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/shotstack/api/edit_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#delete_template(id, opts = {}) ⇒ nil
Delete Template Delete a template by its template id. **Base URL:** <a href="#">api.shotstack.io/edit/version</a>
27 28 29 30 |
# File 'lib/shotstack/api/edit_api.rb', line 27 def delete_template(id, opts = {}) delete_template_with_http_info(id, opts) nil end |
#delete_template_with_http_info(id, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Delete Template Delete a template by its template id. **Base URL:** <a href="#">api.shotstack.io/edit/version</a>
37 38 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 |
# File 'lib/shotstack/api/edit_api.rb', line 37 def delete_template_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EditApi.delete_template ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling EditApi.delete_template" end pattern = Regexp.new(/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/) if @api_client.config.client_side_validation && id !~ pattern fail ArgumentError, "invalid value for 'id' when calling EditApi.delete_template, must conform to the pattern #{pattern}." end # resource path local_var_path = '/templates/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # 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] || ['DeveloperKey'] = opts.merge( :operation => :"EditApi.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: EditApi#delete_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_render(id, opts = {}) ⇒ RenderResponse
Get Render Status Get the rendering status, temporary asset url and details of a render by ID. **Base URL:** <a href="#">api.shotstack.io/edit/version</a>
95 96 97 98 |
# File 'lib/shotstack/api/edit_api.rb', line 95 def get_render(id, opts = {}) data, _status_code, _headers = get_render_with_http_info(id, opts) data end |
#get_render_with_http_info(id, opts = {}) ⇒ Array<(RenderResponse, Integer, Hash)>
Get Render Status Get the rendering status, temporary asset url and details of a render by ID. **Base URL:** <a href="#">api.shotstack.io/edit/version</a>
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 159 160 |
# File 'lib/shotstack/api/edit_api.rb', line 107 def get_render_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EditApi.get_render ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling EditApi.get_render" end pattern = Regexp.new(/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/) if @api_client.config.client_side_validation && id !~ pattern fail ArgumentError, "invalid value for 'id' when calling EditApi.get_render, must conform to the pattern #{pattern}." end # resource path local_var_path = '/render/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'data'] = opts[:'data'] if !opts[:'data'].nil? query_params[:'merged'] = opts[:'merged'] if !opts[:'merged'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'RenderResponse' # auth_names auth_names = opts[:debug_auth_names] || ['DeveloperKey'] = opts.merge( :operation => :"EditApi.get_render", :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: EditApi#get_render\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_template(id, opts = {}) ⇒ TemplateDataResponse
Retrieve Template Retrieve a template by template id. **Base URL:** <a href="#">api.shotstack.io/edit/version</a>
167 168 169 170 |
# File 'lib/shotstack/api/edit_api.rb', line 167 def get_template(id, opts = {}) data, _status_code, _headers = get_template_with_http_info(id, opts) data end |
#get_template_with_http_info(id, opts = {}) ⇒ Array<(TemplateDataResponse, Integer, Hash)>
Retrieve Template Retrieve a template by template id. **Base URL:** <a href="#">api.shotstack.io/edit/version</a>
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 222 223 224 225 226 227 228 |
# File 'lib/shotstack/api/edit_api.rb', line 177 def get_template_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EditApi.get_template ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling EditApi.get_template" end pattern = Regexp.new(/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/) if @api_client.config.client_side_validation && id !~ pattern fail ArgumentError, "invalid value for 'id' when calling EditApi.get_template, must conform to the pattern #{pattern}." end # resource path local_var_path = '/templates/{id}'.sub('{' + 'id' + '}', CGI.escape(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']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'TemplateDataResponse' # auth_names auth_names = opts[:debug_auth_names] || ['DeveloperKey'] = opts.merge( :operation => :"EditApi.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: EditApi#get_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_templates(opts = {}) ⇒ TemplateListResponse
List Templates Retrieve a list of templates stored against a users account and stage. **Base URL:** <a href="#">api.shotstack.io/edit/version</a>
234 235 236 237 |
# File 'lib/shotstack/api/edit_api.rb', line 234 def get_templates(opts = {}) data, _status_code, _headers = get_templates_with_http_info(opts) data end |
#get_templates_with_http_info(opts = {}) ⇒ Array<(TemplateListResponse, Integer, Hash)>
List Templates Retrieve a list of templates stored against a users account and stage. **Base URL:** <a href="#">api.shotstack.io/edit/version</a>
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 285 |
# File 'lib/shotstack/api/edit_api.rb', line 243 def get_templates_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EditApi.get_templates ...' 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']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'TemplateListResponse' # auth_names auth_names = opts[:debug_auth_names] || ['DeveloperKey'] = opts.merge( :operation => :"EditApi.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: EditApi#get_templates\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#post_render(edit, opts = {}) ⇒ QueuedResponse
Render Asset Queue and render the contents of an [Edit](#tocs_edit) as a video, image or audio file. **Base URL:** <a href="#">api.shotstack.io/edit/version</a>
292 293 294 295 |
# File 'lib/shotstack/api/edit_api.rb', line 292 def post_render(edit, opts = {}) data, _status_code, _headers = post_render_with_http_info(edit, opts) data end |
#post_render_with_http_info(edit, opts = {}) ⇒ Array<(QueuedResponse, Integer, Hash)>
Render Asset Queue and render the contents of an [Edit](#tocs_edit) as a video, image or audio file. **Base URL:** <a href="#">api.shotstack.io/edit/version</a>
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 348 349 350 351 352 353 |
# File 'lib/shotstack/api/edit_api.rb', line 302 def post_render_with_http_info(edit, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EditApi.post_render ...' end # verify the required parameter 'edit' is set if @api_client.config.client_side_validation && edit.nil? fail ArgumentError, "Missing the required parameter 'edit' when calling EditApi.post_render" end # resource path local_var_path = '/render' # 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']) # 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(edit) # return_type return_type = opts[:debug_return_type] || 'QueuedResponse' # auth_names auth_names = opts[:debug_auth_names] || ['DeveloperKey'] = opts.merge( :operation => :"EditApi.post_render", :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: EditApi#post_render\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#post_template(template, opts = {}) ⇒ TemplateResponse
Create Template Save an [Edit](#tocs_edit) as a re-usable template. Templates can be retrieved and modified in your application before being rendered. [Merge fields](#tocs_mergefield) can be also used to merge data in to a template and [render](#render-template) it in a single request. **Base URL:** <a href="#">api.shotstack.io/edit/version</a>
360 361 362 363 |
# File 'lib/shotstack/api/edit_api.rb', line 360 def post_template(template, opts = {}) data, _status_code, _headers = post_template_with_http_info(template, opts) data end |
#post_template_render(template_render, opts = {}) ⇒ QueuedResponse
Render Template Render an asset from a template id and optional merge fields. Merge fields can be used to replace placeholder variables within the [Edit](#tocs_edit). **Base URL:** <a href="#">api.shotstack.io/edit/version</a>
428 429 430 431 |
# File 'lib/shotstack/api/edit_api.rb', line 428 def post_template_render(template_render, opts = {}) data, _status_code, _headers = post_template_render_with_http_info(template_render, opts) data end |
#post_template_render_with_http_info(template_render, opts = {}) ⇒ Array<(QueuedResponse, Integer, Hash)>
Render Template Render an asset from a template id and optional merge fields. Merge fields can be used to replace placeholder variables within the [Edit](#tocs_edit). **Base URL:** <a href="#">api.shotstack.io/edit/version</a>
438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 |
# File 'lib/shotstack/api/edit_api.rb', line 438 def post_template_render_with_http_info(template_render, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EditApi.post_template_render ...' end # verify the required parameter 'template_render' is set if @api_client.config.client_side_validation && template_render.nil? fail ArgumentError, "Missing the required parameter 'template_render' when calling EditApi.post_template_render" end # resource path local_var_path = '/templates/render' # 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']) # 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_render) # return_type return_type = opts[:debug_return_type] || 'QueuedResponse' # auth_names auth_names = opts[:debug_auth_names] || ['DeveloperKey'] = opts.merge( :operation => :"EditApi.post_template_render", :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: EditApi#post_template_render\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#post_template_with_http_info(template, opts = {}) ⇒ Array<(TemplateResponse, Integer, Hash)>
Create Template Save an [Edit](#tocs_edit) as a re-usable template. Templates can be retrieved and modified in your application before being rendered. [Merge fields](#tocs_mergefield) can be also used to merge data in to a template and [render](#render-template) it in a single request. **Base URL:** <a href="#">api.shotstack.io/edit/version</a>
370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 |
# File 'lib/shotstack/api/edit_api.rb', line 370 def post_template_with_http_info(template, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EditApi.post_template ...' end # verify the required parameter 'template' is set if @api_client.config.client_side_validation && template.nil? fail ArgumentError, "Missing the required parameter 'template' when calling EditApi.post_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']) # 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) # return_type return_type = opts[:debug_return_type] || 'TemplateResponse' # auth_names auth_names = opts[:debug_auth_names] || ['DeveloperKey'] = opts.merge( :operation => :"EditApi.post_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: EditApi#post_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#probe(url, opts = {}) ⇒ ProbeResponse
Inspect Media Inspects any media asset (image, video, audio) on the internet using a hosted version of [FFprobe](ffmpeg.org/ffprobe.html). The probe endpoint returns useful information about an asset such as width, height, duration, rotation, framerate, etc… **Base URL:** <a href="#">api.shotstack.io/edit/version</a>
496 497 498 499 |
# File 'lib/shotstack/api/edit_api.rb', line 496 def probe(url, opts = {}) data, _status_code, _headers = probe_with_http_info(url, opts) data end |
#probe_with_http_info(url, opts = {}) ⇒ Array<(ProbeResponse, Integer, Hash)>
Inspect Media Inspects any media asset (image, video, audio) on the internet using a hosted version of [FFprobe](ffmpeg.org/ffprobe.html). The probe endpoint returns useful information about an asset such as width, height, duration, rotation, framerate, etc… **Base URL:** <a href="#">api.shotstack.io/edit/version</a>
506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 |
# File 'lib/shotstack/api/edit_api.rb', line 506 def probe_with_http_info(url, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EditApi.probe ...' end # verify the required parameter 'url' is set if @api_client.config.client_side_validation && url.nil? fail ArgumentError, "Missing the required parameter 'url' when calling EditApi.probe" end # resource path local_var_path = '/probe/{url}'.sub('{' + 'url' + '}', CGI.escape(url.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']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'ProbeResponse' # auth_names auth_names = opts[:debug_auth_names] || ['DeveloperKey'] = opts.merge( :operation => :"EditApi.probe", :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: EditApi#probe\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#put_template(id, template, opts = {}) ⇒ TemplateResponse
Update Template Update an existing template by template id. **Base URL:** <a href="#">api.shotstack.io/edit/version</a>
560 561 562 563 |
# File 'lib/shotstack/api/edit_api.rb', line 560 def put_template(id, template, opts = {}) data, _status_code, _headers = put_template_with_http_info(id, template, opts) data end |
#put_template_with_http_info(id, template, opts = {}) ⇒ Array<(TemplateResponse, Integer, Hash)>
Update Template Update an existing template by template id. **Base URL:** <a href="#">api.shotstack.io/edit/version</a>
571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 |
# File 'lib/shotstack/api/edit_api.rb', line 571 def put_template_with_http_info(id, template, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EditApi.put_template ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling EditApi.put_template" end pattern = Regexp.new(/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/) if @api_client.config.client_side_validation && id !~ pattern fail ArgumentError, "invalid value for 'id' when calling EditApi.put_template, must conform to the pattern #{pattern}." end # verify the required parameter 'template' is set if @api_client.config.client_side_validation && template.nil? fail ArgumentError, "Missing the required parameter 'template' when calling EditApi.put_template" end # resource path local_var_path = '/templates/{id}'.sub('{' + 'id' + '}', CGI.escape(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']) # 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) # return_type return_type = opts[:debug_return_type] || 'TemplateResponse' # auth_names auth_names = opts[:debug_auth_names] || ['DeveloperKey'] = opts.merge( :operation => :"EditApi.put_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: EditApi#put_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |