ultracart_api 4.1.176 → 4.1.177

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.
@@ -266,6 +266,87 @@ module UltracartClient
266
266
  return data, status_code, headers
267
267
  end
268
268
 
269
+ # Attach an image to a blog post
270
+ # Three calls, like the admin blog editor's upload. Request an upload URL with files/upload_url, send the bytes to it, then attach with the key and a filename. No storefront file is created, and the key is redeemed, so it cannot be used twice. default_image replaces the post's default image and code replaces the image with that code; with neither, the image is added for use in the body at the url the response reports. JPEG, PNG, GIF or WebP, checked by content. A post that is not a draft needs sfvb_publish.
271
+ # @param storefront_oid [Integer]
272
+ # @param blog_post_oid [Integer]
273
+ # @param blog_post_image_request [SfvbBlogPostImageRequest] Image to attach
274
+ # @param [Hash] opts the optional parameters
275
+ # @return [SfvbBlogPostDetail]
276
+ def attach_sfvb_blog_post_image(storefront_oid, blog_post_oid, blog_post_image_request, opts = {})
277
+ data, _status_code, _headers = attach_sfvb_blog_post_image_with_http_info(storefront_oid, blog_post_oid, blog_post_image_request, opts)
278
+ data
279
+ end
280
+
281
+ # Attach an image to a blog post
282
+ # Three calls, like the admin blog editor's upload. Request an upload URL with files/upload_url, send the bytes to it, then attach with the key and a filename. No storefront file is created, and the key is redeemed, so it cannot be used twice. default_image replaces the post's default image and code replaces the image with that code; with neither, the image is added for use in the body at the url the response reports. JPEG, PNG, GIF or WebP, checked by content. A post that is not a draft needs sfvb_publish.
283
+ # @param storefront_oid [Integer]
284
+ # @param blog_post_oid [Integer]
285
+ # @param blog_post_image_request [SfvbBlogPostImageRequest] Image to attach
286
+ # @param [Hash] opts the optional parameters
287
+ # @return [Array<(SfvbBlogPostDetail, Integer, Hash)>] SfvbBlogPostDetail data, response status code and response headers
288
+ def attach_sfvb_blog_post_image_with_http_info(storefront_oid, blog_post_oid, blog_post_image_request, opts = {})
289
+ if @api_client.config.debugging
290
+ @api_client.config.logger.debug 'Calling API: SfvbApi.attach_sfvb_blog_post_image ...'
291
+ end
292
+ # verify the required parameter 'storefront_oid' is set
293
+ if @api_client.config.client_side_validation && storefront_oid.nil?
294
+ fail ArgumentError, "Missing the required parameter 'storefront_oid' when calling SfvbApi.attach_sfvb_blog_post_image"
295
+ end
296
+ # verify the required parameter 'blog_post_oid' is set
297
+ if @api_client.config.client_side_validation && blog_post_oid.nil?
298
+ fail ArgumentError, "Missing the required parameter 'blog_post_oid' when calling SfvbApi.attach_sfvb_blog_post_image"
299
+ end
300
+ # verify the required parameter 'blog_post_image_request' is set
301
+ if @api_client.config.client_side_validation && blog_post_image_request.nil?
302
+ fail ArgumentError, "Missing the required parameter 'blog_post_image_request' when calling SfvbApi.attach_sfvb_blog_post_image"
303
+ end
304
+ # resource path
305
+ local_var_path = '/sfvb/storefronts/{storefront_oid}/blog_posts/{blog_post_oid}/images/attach'.sub('{' + 'storefront_oid' + '}', CGI.escape(storefront_oid.to_s)).sub('{' + 'blog_post_oid' + '}', CGI.escape(blog_post_oid.to_s))
306
+
307
+ # query parameters
308
+ query_params = opts[:query_params] || {}
309
+
310
+ # header parameters
311
+ header_params = opts[:header_params] || {}
312
+ header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
313
+ # HTTP header 'Accept' (if needed)
314
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
315
+ # HTTP header 'Content-Type'
316
+ content_type = @api_client.select_header_content_type(['application/json; charset=UTF-8'])
317
+ if !content_type.nil?
318
+ header_params['Content-Type'] = content_type
319
+ end
320
+
321
+ # form parameters
322
+ form_params = opts[:form_params] || {}
323
+
324
+ # http body (model)
325
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(blog_post_image_request)
326
+
327
+ # return_type
328
+ return_type = opts[:debug_return_type] || 'SfvbBlogPostDetail'
329
+
330
+ # auth_names
331
+ auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']
332
+
333
+ new_options = opts.merge(
334
+ :operation => :"SfvbApi.attach_sfvb_blog_post_image",
335
+ :header_params => header_params,
336
+ :query_params => query_params,
337
+ :form_params => form_params,
338
+ :body => post_body,
339
+ :auth_names => auth_names,
340
+ :return_type => return_type
341
+ )
342
+
343
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
344
+ if @api_client.config.debugging
345
+ @api_client.config.logger.debug "API called: SfvbApi#attach_sfvb_blog_post_image\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
346
+ end
347
+ return data, status_code, headers
348
+ end
349
+
269
350
  # Compile CJSON to Velocity
270
351
  # Compiles a container document to Velocity without storing anything. Supply theme_oid to compile with the theme's inherit groups applied; omit it to compile standalone.
271
352
  # @param compile_request [SfvbCompileRequest] CJSON to compile
@@ -470,6 +551,76 @@ module UltracartClient
470
551
  return data, status_code, headers
471
552
  end
472
553
 
554
+ # Delete a blog post
555
+ # Takes the post off every page and deletes it. There is no undo. A post that is not a draft needs sfvb_publish.
556
+ # @param storefront_oid [Integer]
557
+ # @param blog_post_oid [Integer]
558
+ # @param [Hash] opts the optional parameters
559
+ # @return [nil]
560
+ def delete_sfvb_blog_post(storefront_oid, blog_post_oid, opts = {})
561
+ delete_sfvb_blog_post_with_http_info(storefront_oid, blog_post_oid, opts)
562
+ nil
563
+ end
564
+
565
+ # Delete a blog post
566
+ # Takes the post off every page and deletes it. There is no undo. A post that is not a draft needs sfvb_publish.
567
+ # @param storefront_oid [Integer]
568
+ # @param blog_post_oid [Integer]
569
+ # @param [Hash] opts the optional parameters
570
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
571
+ def delete_sfvb_blog_post_with_http_info(storefront_oid, blog_post_oid, opts = {})
572
+ if @api_client.config.debugging
573
+ @api_client.config.logger.debug 'Calling API: SfvbApi.delete_sfvb_blog_post ...'
574
+ end
575
+ # verify the required parameter 'storefront_oid' is set
576
+ if @api_client.config.client_side_validation && storefront_oid.nil?
577
+ fail ArgumentError, "Missing the required parameter 'storefront_oid' when calling SfvbApi.delete_sfvb_blog_post"
578
+ end
579
+ # verify the required parameter 'blog_post_oid' is set
580
+ if @api_client.config.client_side_validation && blog_post_oid.nil?
581
+ fail ArgumentError, "Missing the required parameter 'blog_post_oid' when calling SfvbApi.delete_sfvb_blog_post"
582
+ end
583
+ # resource path
584
+ local_var_path = '/sfvb/storefronts/{storefront_oid}/blog_posts/{blog_post_oid}'.sub('{' + 'storefront_oid' + '}', CGI.escape(storefront_oid.to_s)).sub('{' + 'blog_post_oid' + '}', CGI.escape(blog_post_oid.to_s))
585
+
586
+ # query parameters
587
+ query_params = opts[:query_params] || {}
588
+
589
+ # header parameters
590
+ header_params = opts[:header_params] || {}
591
+ header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
592
+ # HTTP header 'Accept' (if needed)
593
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
594
+
595
+ # form parameters
596
+ form_params = opts[:form_params] || {}
597
+
598
+ # http body (model)
599
+ post_body = opts[:debug_body]
600
+
601
+ # return_type
602
+ return_type = opts[:debug_return_type]
603
+
604
+ # auth_names
605
+ auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']
606
+
607
+ new_options = opts.merge(
608
+ :operation => :"SfvbApi.delete_sfvb_blog_post",
609
+ :header_params => header_params,
610
+ :query_params => query_params,
611
+ :form_params => form_params,
612
+ :body => post_body,
613
+ :auth_names => auth_names,
614
+ :return_type => return_type
615
+ )
616
+
617
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
618
+ if @api_client.config.debugging
619
+ @api_client.config.logger.debug "API called: SfvbApi#delete_sfvb_blog_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
620
+ end
621
+ return data, status_code, headers
622
+ end
623
+
473
624
  # Delete a storefront file
474
625
  # Recoverable from the recycle bin.
475
626
  # @param storefront_oid [Integer]
@@ -844,6 +995,87 @@ module UltracartClient
844
995
  return data, status_code, headers
845
996
  end
846
997
 
998
+ # Detach an image from a blog post
999
+ # Name exactly one of default_image, code or blog_post_multimedia_oid. Removes the image from the post and deletes its stored copy. Take it out of the body too, or the body keeps a broken image. A post that is not a draft needs sfvb_publish.
1000
+ # @param storefront_oid [Integer]
1001
+ # @param blog_post_oid [Integer]
1002
+ # @param blog_post_image_request [SfvbBlogPostImageRequest] Image to detach
1003
+ # @param [Hash] opts the optional parameters
1004
+ # @return [SfvbBlogPostDetail]
1005
+ def detach_sfvb_blog_post_image(storefront_oid, blog_post_oid, blog_post_image_request, opts = {})
1006
+ data, _status_code, _headers = detach_sfvb_blog_post_image_with_http_info(storefront_oid, blog_post_oid, blog_post_image_request, opts)
1007
+ data
1008
+ end
1009
+
1010
+ # Detach an image from a blog post
1011
+ # Name exactly one of default_image, code or blog_post_multimedia_oid. Removes the image from the post and deletes its stored copy. Take it out of the body too, or the body keeps a broken image. A post that is not a draft needs sfvb_publish.
1012
+ # @param storefront_oid [Integer]
1013
+ # @param blog_post_oid [Integer]
1014
+ # @param blog_post_image_request [SfvbBlogPostImageRequest] Image to detach
1015
+ # @param [Hash] opts the optional parameters
1016
+ # @return [Array<(SfvbBlogPostDetail, Integer, Hash)>] SfvbBlogPostDetail data, response status code and response headers
1017
+ def detach_sfvb_blog_post_image_with_http_info(storefront_oid, blog_post_oid, blog_post_image_request, opts = {})
1018
+ if @api_client.config.debugging
1019
+ @api_client.config.logger.debug 'Calling API: SfvbApi.detach_sfvb_blog_post_image ...'
1020
+ end
1021
+ # verify the required parameter 'storefront_oid' is set
1022
+ if @api_client.config.client_side_validation && storefront_oid.nil?
1023
+ fail ArgumentError, "Missing the required parameter 'storefront_oid' when calling SfvbApi.detach_sfvb_blog_post_image"
1024
+ end
1025
+ # verify the required parameter 'blog_post_oid' is set
1026
+ if @api_client.config.client_side_validation && blog_post_oid.nil?
1027
+ fail ArgumentError, "Missing the required parameter 'blog_post_oid' when calling SfvbApi.detach_sfvb_blog_post_image"
1028
+ end
1029
+ # verify the required parameter 'blog_post_image_request' is set
1030
+ if @api_client.config.client_side_validation && blog_post_image_request.nil?
1031
+ fail ArgumentError, "Missing the required parameter 'blog_post_image_request' when calling SfvbApi.detach_sfvb_blog_post_image"
1032
+ end
1033
+ # resource path
1034
+ local_var_path = '/sfvb/storefronts/{storefront_oid}/blog_posts/{blog_post_oid}/images/detach'.sub('{' + 'storefront_oid' + '}', CGI.escape(storefront_oid.to_s)).sub('{' + 'blog_post_oid' + '}', CGI.escape(blog_post_oid.to_s))
1035
+
1036
+ # query parameters
1037
+ query_params = opts[:query_params] || {}
1038
+
1039
+ # header parameters
1040
+ header_params = opts[:header_params] || {}
1041
+ header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
1042
+ # HTTP header 'Accept' (if needed)
1043
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1044
+ # HTTP header 'Content-Type'
1045
+ content_type = @api_client.select_header_content_type(['application/json; charset=UTF-8'])
1046
+ if !content_type.nil?
1047
+ header_params['Content-Type'] = content_type
1048
+ end
1049
+
1050
+ # form parameters
1051
+ form_params = opts[:form_params] || {}
1052
+
1053
+ # http body (model)
1054
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(blog_post_image_request)
1055
+
1056
+ # return_type
1057
+ return_type = opts[:debug_return_type] || 'SfvbBlogPostDetail'
1058
+
1059
+ # auth_names
1060
+ auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']
1061
+
1062
+ new_options = opts.merge(
1063
+ :operation => :"SfvbApi.detach_sfvb_blog_post_image",
1064
+ :header_params => header_params,
1065
+ :query_params => query_params,
1066
+ :form_params => form_params,
1067
+ :body => post_body,
1068
+ :auth_names => auth_names,
1069
+ :return_type => return_type
1070
+ )
1071
+
1072
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
1073
+ if @api_client.config.debugging
1074
+ @api_client.config.logger.debug "API called: SfvbApi#detach_sfvb_blog_post_image\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1075
+ end
1076
+ return data, status_code, headers
1077
+ end
1078
+
847
1079
  # Disable an upsell offer
848
1080
  # Switches the offer off. Disabling one that is switched on is a live change and needs sfvb_publish. An offer that is already off is returned unchanged. There is no delete.
849
1081
  # @param storefront_oid [Integer]
@@ -1431,6 +1663,76 @@ module UltracartClient
1431
1663
  return data, status_code, headers
1432
1664
  end
1433
1665
 
1666
+ # Read a blog post
1667
+ # The whole post - body, excerpt, tags, images and where it is shown. An image's url is the address to use for it in the body.
1668
+ # @param storefront_oid [Integer]
1669
+ # @param blog_post_oid [Integer]
1670
+ # @param [Hash] opts the optional parameters
1671
+ # @return [SfvbBlogPostDetail]
1672
+ def get_sfvb_blog_post(storefront_oid, blog_post_oid, opts = {})
1673
+ data, _status_code, _headers = get_sfvb_blog_post_with_http_info(storefront_oid, blog_post_oid, opts)
1674
+ data
1675
+ end
1676
+
1677
+ # Read a blog post
1678
+ # The whole post - body, excerpt, tags, images and where it is shown. An image&#39;s url is the address to use for it in the body.
1679
+ # @param storefront_oid [Integer]
1680
+ # @param blog_post_oid [Integer]
1681
+ # @param [Hash] opts the optional parameters
1682
+ # @return [Array<(SfvbBlogPostDetail, Integer, Hash)>] SfvbBlogPostDetail data, response status code and response headers
1683
+ def get_sfvb_blog_post_with_http_info(storefront_oid, blog_post_oid, opts = {})
1684
+ if @api_client.config.debugging
1685
+ @api_client.config.logger.debug 'Calling API: SfvbApi.get_sfvb_blog_post ...'
1686
+ end
1687
+ # verify the required parameter 'storefront_oid' is set
1688
+ if @api_client.config.client_side_validation && storefront_oid.nil?
1689
+ fail ArgumentError, "Missing the required parameter 'storefront_oid' when calling SfvbApi.get_sfvb_blog_post"
1690
+ end
1691
+ # verify the required parameter 'blog_post_oid' is set
1692
+ if @api_client.config.client_side_validation && blog_post_oid.nil?
1693
+ fail ArgumentError, "Missing the required parameter 'blog_post_oid' when calling SfvbApi.get_sfvb_blog_post"
1694
+ end
1695
+ # resource path
1696
+ local_var_path = '/sfvb/storefronts/{storefront_oid}/blog_posts/{blog_post_oid}'.sub('{' + 'storefront_oid' + '}', CGI.escape(storefront_oid.to_s)).sub('{' + 'blog_post_oid' + '}', CGI.escape(blog_post_oid.to_s))
1697
+
1698
+ # query parameters
1699
+ query_params = opts[:query_params] || {}
1700
+
1701
+ # header parameters
1702
+ header_params = opts[:header_params] || {}
1703
+ header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
1704
+ # HTTP header 'Accept' (if needed)
1705
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1706
+
1707
+ # form parameters
1708
+ form_params = opts[:form_params] || {}
1709
+
1710
+ # http body (model)
1711
+ post_body = opts[:debug_body]
1712
+
1713
+ # return_type
1714
+ return_type = opts[:debug_return_type] || 'SfvbBlogPostDetail'
1715
+
1716
+ # auth_names
1717
+ auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']
1718
+
1719
+ new_options = opts.merge(
1720
+ :operation => :"SfvbApi.get_sfvb_blog_post",
1721
+ :header_params => header_params,
1722
+ :query_params => query_params,
1723
+ :form_params => form_params,
1724
+ :body => post_body,
1725
+ :auth_names => auth_names,
1726
+ :return_type => return_type
1727
+ )
1728
+
1729
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1730
+ if @api_client.config.debugging
1731
+ @api_client.config.logger.debug "API called: SfvbApi#get_sfvb_blog_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1732
+ end
1733
+ return data, status_code, headers
1734
+ end
1735
+
1434
1736
  # Element types used by a container
1435
1737
  # @param compile_request [SfvbCompileRequest] CJSON to inspect
1436
1738
  # @param [Hash] opts the optional parameters
@@ -3180,6 +3482,81 @@ module UltracartClient
3180
3482
  return data, status_code, headers
3181
3483
  end
3182
3484
 
3485
+ # Create a blog post
3486
+ # title and url_part are required. The post is a draft unless visibility says otherwise, and anything but a draft needs sfvb_publish. The body and excerpt are refused with sfvb.unsafe_html if they could run script, and a url_part another post uses is refused with a 409 and sfvb.blog_post_exists. Assign the post to a page with pages/blog_posts/add, or let the page's selectors choose it.
3487
+ # @param storefront_oid [Integer]
3488
+ # @param blog_post_request [SfvbBlogPostRequest] The blog post to create
3489
+ # @param [Hash] opts the optional parameters
3490
+ # @return [SfvbBlogPostDetail]
3491
+ def insert_sfvb_blog_post(storefront_oid, blog_post_request, opts = {})
3492
+ data, _status_code, _headers = insert_sfvb_blog_post_with_http_info(storefront_oid, blog_post_request, opts)
3493
+ data
3494
+ end
3495
+
3496
+ # Create a blog post
3497
+ # title and url_part are required. The post is a draft unless visibility says otherwise, and anything but a draft needs sfvb_publish. The body and excerpt are refused with sfvb.unsafe_html if they could run script, and a url_part another post uses is refused with a 409 and sfvb.blog_post_exists. Assign the post to a page with pages/blog_posts/add, or let the page&#39;s selectors choose it.
3498
+ # @param storefront_oid [Integer]
3499
+ # @param blog_post_request [SfvbBlogPostRequest] The blog post to create
3500
+ # @param [Hash] opts the optional parameters
3501
+ # @return [Array<(SfvbBlogPostDetail, Integer, Hash)>] SfvbBlogPostDetail data, response status code and response headers
3502
+ def insert_sfvb_blog_post_with_http_info(storefront_oid, blog_post_request, opts = {})
3503
+ if @api_client.config.debugging
3504
+ @api_client.config.logger.debug 'Calling API: SfvbApi.insert_sfvb_blog_post ...'
3505
+ end
3506
+ # verify the required parameter 'storefront_oid' is set
3507
+ if @api_client.config.client_side_validation && storefront_oid.nil?
3508
+ fail ArgumentError, "Missing the required parameter 'storefront_oid' when calling SfvbApi.insert_sfvb_blog_post"
3509
+ end
3510
+ # verify the required parameter 'blog_post_request' is set
3511
+ if @api_client.config.client_side_validation && blog_post_request.nil?
3512
+ fail ArgumentError, "Missing the required parameter 'blog_post_request' when calling SfvbApi.insert_sfvb_blog_post"
3513
+ end
3514
+ # resource path
3515
+ local_var_path = '/sfvb/storefronts/{storefront_oid}/blog_posts'.sub('{' + 'storefront_oid' + '}', CGI.escape(storefront_oid.to_s))
3516
+
3517
+ # query parameters
3518
+ query_params = opts[:query_params] || {}
3519
+
3520
+ # header parameters
3521
+ header_params = opts[:header_params] || {}
3522
+ header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
3523
+ # HTTP header 'Accept' (if needed)
3524
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
3525
+ # HTTP header 'Content-Type'
3526
+ content_type = @api_client.select_header_content_type(['application/json; charset=UTF-8'])
3527
+ if !content_type.nil?
3528
+ header_params['Content-Type'] = content_type
3529
+ end
3530
+
3531
+ # form parameters
3532
+ form_params = opts[:form_params] || {}
3533
+
3534
+ # http body (model)
3535
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(blog_post_request)
3536
+
3537
+ # return_type
3538
+ return_type = opts[:debug_return_type] || 'SfvbBlogPostDetail'
3539
+
3540
+ # auth_names
3541
+ auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']
3542
+
3543
+ new_options = opts.merge(
3544
+ :operation => :"SfvbApi.insert_sfvb_blog_post",
3545
+ :header_params => header_params,
3546
+ :query_params => query_params,
3547
+ :form_params => form_params,
3548
+ :body => post_body,
3549
+ :auth_names => auth_names,
3550
+ :return_type => return_type
3551
+ )
3552
+
3553
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
3554
+ if @api_client.config.debugging
3555
+ @api_client.config.logger.debug "API called: SfvbApi#insert_sfvb_blog_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
3556
+ end
3557
+ return data, status_code, headers
3558
+ end
3559
+
3183
3560
  # Create a page
3184
3561
  # Creates the page and its folder, the way the store admin's add page does. The parent page must already exist, and the last part of the path may only contain letters, digits, hyphens and underscores - it is refused, not cleaned. A path that already has a page is refused with a 409 and the code sfvb.page_exists. Without a group_template the page inherits its parent's templates, or catalog_group.vm directly under the root. Set attributes and images afterwards with the page attribute and image endpoints, and push the body to the page folder. Always needs sfvb_publish, because the page is live as soon as it exists. Deleting, moving and renaming pages stay in the store admin.
3185
3562
  # @param storefront_oid [Integer]
@@ -6657,6 +7034,87 @@ module UltracartClient
6657
7034
  return data, status_code, headers
6658
7035
  end
6659
7036
 
7037
+ # Change a blog post
7038
+ # Only the fields sent change; tags, when sent, replaces every tag. The post's images and attributes are left alone. Publish or unpublish with visibility. A post that is not a draft before or after the change needs sfvb_publish. The same content rules as create apply.
7039
+ # @param storefront_oid [Integer]
7040
+ # @param blog_post_oid [Integer]
7041
+ # @param blog_post_request [SfvbBlogPostRequest] The fields to change
7042
+ # @param [Hash] opts the optional parameters
7043
+ # @return [SfvbBlogPostDetail]
7044
+ def update_sfvb_blog_post(storefront_oid, blog_post_oid, blog_post_request, opts = {})
7045
+ data, _status_code, _headers = update_sfvb_blog_post_with_http_info(storefront_oid, blog_post_oid, blog_post_request, opts)
7046
+ data
7047
+ end
7048
+
7049
+ # Change a blog post
7050
+ # Only the fields sent change; tags, when sent, replaces every tag. The post&#39;s images and attributes are left alone. Publish or unpublish with visibility. A post that is not a draft before or after the change needs sfvb_publish. The same content rules as create apply.
7051
+ # @param storefront_oid [Integer]
7052
+ # @param blog_post_oid [Integer]
7053
+ # @param blog_post_request [SfvbBlogPostRequest] The fields to change
7054
+ # @param [Hash] opts the optional parameters
7055
+ # @return [Array<(SfvbBlogPostDetail, Integer, Hash)>] SfvbBlogPostDetail data, response status code and response headers
7056
+ def update_sfvb_blog_post_with_http_info(storefront_oid, blog_post_oid, blog_post_request, opts = {})
7057
+ if @api_client.config.debugging
7058
+ @api_client.config.logger.debug 'Calling API: SfvbApi.update_sfvb_blog_post ...'
7059
+ end
7060
+ # verify the required parameter 'storefront_oid' is set
7061
+ if @api_client.config.client_side_validation && storefront_oid.nil?
7062
+ fail ArgumentError, "Missing the required parameter 'storefront_oid' when calling SfvbApi.update_sfvb_blog_post"
7063
+ end
7064
+ # verify the required parameter 'blog_post_oid' is set
7065
+ if @api_client.config.client_side_validation && blog_post_oid.nil?
7066
+ fail ArgumentError, "Missing the required parameter 'blog_post_oid' when calling SfvbApi.update_sfvb_blog_post"
7067
+ end
7068
+ # verify the required parameter 'blog_post_request' is set
7069
+ if @api_client.config.client_side_validation && blog_post_request.nil?
7070
+ fail ArgumentError, "Missing the required parameter 'blog_post_request' when calling SfvbApi.update_sfvb_blog_post"
7071
+ end
7072
+ # resource path
7073
+ local_var_path = '/sfvb/storefronts/{storefront_oid}/blog_posts/{blog_post_oid}'.sub('{' + 'storefront_oid' + '}', CGI.escape(storefront_oid.to_s)).sub('{' + 'blog_post_oid' + '}', CGI.escape(blog_post_oid.to_s))
7074
+
7075
+ # query parameters
7076
+ query_params = opts[:query_params] || {}
7077
+
7078
+ # header parameters
7079
+ header_params = opts[:header_params] || {}
7080
+ header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
7081
+ # HTTP header 'Accept' (if needed)
7082
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
7083
+ # HTTP header 'Content-Type'
7084
+ content_type = @api_client.select_header_content_type(['application/json; charset=UTF-8'])
7085
+ if !content_type.nil?
7086
+ header_params['Content-Type'] = content_type
7087
+ end
7088
+
7089
+ # form parameters
7090
+ form_params = opts[:form_params] || {}
7091
+
7092
+ # http body (model)
7093
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(blog_post_request)
7094
+
7095
+ # return_type
7096
+ return_type = opts[:debug_return_type] || 'SfvbBlogPostDetail'
7097
+
7098
+ # auth_names
7099
+ auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']
7100
+
7101
+ new_options = opts.merge(
7102
+ :operation => :"SfvbApi.update_sfvb_blog_post",
7103
+ :header_params => header_params,
7104
+ :query_params => query_params,
7105
+ :form_params => form_params,
7106
+ :body => post_body,
7107
+ :auth_names => auth_names,
7108
+ :return_type => return_type
7109
+ )
7110
+
7111
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
7112
+ if @api_client.config.debugging
7113
+ @api_client.config.logger.debug "API called: SfvbApi#update_sfvb_blog_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
7114
+ end
7115
+ return data, status_code, headers
7116
+ end
7117
+
6660
7118
  # Update an upsell offer
6661
7119
  # A full replace. Send back the whole offer you read, changed, with its hash_sha256 in If-Match. Read only fields are ignored and a writable field left out is cleared. Changing an offer that is switched on, switching one on, or changing upsell_item_id_javascript or offsite_content_url needs sfvb_publish. Settings the API does not show, such as the offer's screenshots, are kept.
6662
7120
  # @param storefront_oid [Integer]