ultracart_api 4.1.143 → 4.1.144

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 54ade983866a0b9b2b6cee229755b5822f1af894ce784427515055fa35af03ba
4
- data.tar.gz: 45d7d529bfccac5c15c2c0e81861fd831d38b433b24803c570d81e8288eb7d95
3
+ metadata.gz: 13b9d39d06ac6b0264998815c54095b46e5f2937017216b655170327a16c8fec
4
+ data.tar.gz: e6dc9b0d31c8b1406bb234d666668b21ab36ec5ea897ff32df8a845784e62af6
5
5
  SHA512:
6
- metadata.gz: 6b79c1bf97aafa3e69a280935ef778fb955a4688cb59cb23f70ba5b2bad743a19c9c700371e14fed6257a6e3a16367e2ba0c1e1267723bcaffa8e4de5b0058a6
7
- data.tar.gz: 748a3308394172826f99191041a51e5cff02a8d49d945d6fe8a72680f3541c257ffe1436026541c801cf82a85158ae7d376830511ce1f374b09763e28bbc23b8
6
+ metadata.gz: 7898973f5918fa512d645190944553db8e00efddab71b7ad128647e234decdb4f1cb40604f7844ca92e02d28bfd2ade4b3cae38e12c9696a6fb915142f5042b1
7
+ data.tar.gz: 2dcfdb984be83191ad63ba1e1d0f7e79155cb7ddaa7bc16e918a9ec77395b93636153c8e82b98e6682c186d36717ba5de9ad22f8bcdb290045c55e3195353c7c
data/README.md CHANGED
@@ -7,7 +7,7 @@ Note: Every method has a sample for every language. See https://github.com/Ultr
7
7
  This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
8
8
 
9
9
  - API version: 2.0.0
10
- - Package version: 4.1.143
10
+ - Package version: 4.1.144
11
11
  - Build package: org.openapitools.codegen.languages.RubyClientCodegen
12
12
  - For more information, please visit [http://www.ultracart.com/api/](http://www.ultracart.com/api/)
13
13
 
@@ -16,7 +16,7 @@ This SDK is automatically generated by the [OpenAPI Generator](https://openapi-g
16
16
  gemfile:
17
17
 
18
18
  ```shell
19
- gem 'ultracart_api', '4.1.143'
19
+ gem 'ultracart_api', '4.1.144'
20
20
  ```
21
21
 
22
22
  install:
@@ -474,12 +474,14 @@ Class | Method | HTTP request | Description
474
474
  *UltracartClient::SfvbApi* | [**create_sfvb_preview_session**](docs/SfvbApi.md#create_sfvb_preview_session) | **POST** /sfvb/storefronts/{storefront_oid}/preview_sessions | Create a preview session
475
475
  *UltracartClient::SfvbApi* | [**delete_sfvb_file**](docs/SfvbApi.md#delete_sfvb_file) | **DELETE** /sfvb/storefronts/{storefront_oid}/files | Delete a storefront file
476
476
  *UltracartClient::SfvbApi* | [**delete_sfvb_preview_session**](docs/SfvbApi.md#delete_sfvb_preview_session) | **DELETE** /sfvb/storefronts/{storefront_oid}/preview_sessions/{preview_session_id} | Delete a preview session
477
+ *UltracartClient::SfvbApi* | [**download_sfvb_file**](docs/SfvbApi.md#download_sfvb_file) | **GET** /sfvb/storefronts/{storefront_oid}/files/download | Read a storefront file's raw bytes
477
478
  *UltracartClient::SfvbApi* | [**duplicate_sfvb_theme**](docs/SfvbApi.md#duplicate_sfvb_theme) | **POST** /sfvb/storefronts/{storefront_oid}/themes/{theme_oid}/duplicate | Duplicate a theme
478
479
  *UltracartClient::SfvbApi* | [**get_sfvb_cjson_used_elements**](docs/SfvbApi.md#get_sfvb_cjson_used_elements) | **POST** /sfvb/cjson/elements | Element types used by a container
479
480
  *UltracartClient::SfvbApi* | [**get_sfvb_container**](docs/SfvbApi.md#get_sfvb_container) | **GET** /sfvb/storefronts/{storefront_oid}/containers/{owner_type}/{owner_object_id} | Read a container stored outside the file system
480
481
  *UltracartClient::SfvbApi* | [**get_sfvb_container_version**](docs/SfvbApi.md#get_sfvb_container_version) | **GET** /sfvb/storefronts/{storefront_oid}/container_versions/{container_history_oid} | Read the CJSON stored in one container history entry
481
482
  *UltracartClient::SfvbApi* | [**get_sfvb_element**](docs/SfvbApi.md#get_sfvb_element) | **GET** /sfvb/elements/{element_type} | Configuration schema for one element type
482
483
  *UltracartClient::SfvbApi* | [**get_sfvb_file_content**](docs/SfvbApi.md#get_sfvb_file_content) | **GET** /sfvb/storefronts/{storefront_oid}/files/content | Read a storefront file
484
+ *UltracartClient::SfvbApi* | [**get_sfvb_file_upload_url**](docs/SfvbApi.md#get_sfvb_file_upload_url) | **GET** /sfvb/storefronts/{storefront_oid}/files/upload_url/{extension} | Get a URL to upload a binary asset to
483
485
  *UltracartClient::SfvbApi* | [**get_sfvb_library_entry**](docs/SfvbApi.md#get_sfvb_library_entry) | **GET** /sfvb/storefronts/{storefront_oid}/library/{library_oid} | Read one library entry including its CJSON
484
486
  *UltracartClient::SfvbApi* | [**get_sfvb_preview_url**](docs/SfvbApi.md#get_sfvb_preview_url) | **GET** /sfvb/storefronts/{storefront_oid}/preview_sessions/{preview_session_id}/url | URL that renders a preview session
485
487
  *UltracartClient::SfvbApi* | [**get_sfvb_theme**](docs/SfvbApi.md#get_sfvb_theme) | **GET** /sfvb/storefronts/{storefront_oid}/themes/{theme_oid} | Get a theme
@@ -503,6 +505,7 @@ Class | Method | HTTP request | Description
503
505
  *UltracartClient::SfvbApi* | [**revert_sfvb_file**](docs/SfvbApi.md#revert_sfvb_file) | **POST** /sfvb/storefronts/{storefront_oid}/files/revert | Revert a storefront file to an earlier version
504
506
  *UltracartClient::SfvbApi* | [**search_sfvb_files**](docs/SfvbApi.md#search_sfvb_files) | **POST** /sfvb/storefronts/{storefront_oid}/files/search | Search storefront files
505
507
  *UltracartClient::SfvbApi* | [**search_sfvb_library**](docs/SfvbApi.md#search_sfvb_library) | **GET** /sfvb/storefronts/{storefront_oid}/library | Search the element library
508
+ *UltracartClient::SfvbApi* | [**upload_sfvb_file**](docs/SfvbApi.md#upload_sfvb_file) | **POST** /sfvb/storefronts/{storefront_oid}/files/upload | Store a binary asset that was already uploaded
506
509
  *UltracartClient::SfvbApi* | [**validate_sfvb_cjson**](docs/SfvbApi.md#validate_sfvb_cjson) | **POST** /sfvb/cjson/validate | Validate CJSON
507
510
  *UltracartClient::SfvbApi* | [**validate_sfvb_velocity**](docs/SfvbApi.md#validate_sfvb_velocity) | **POST** /sfvb/storefronts/{storefront_oid}/themes/{theme_oid}/velocity/validate | Validate a Velocity template against a theme
508
511
  *UltracartClient::SsoApi* | [**get_sso_session_user**](docs/SsoApi.md#get_sso_session_user) | **GET** /sso/session/user | Get single sign on session user
@@ -1732,6 +1735,8 @@ Class | Method | HTTP request | Description
1732
1735
  - [UltracartClient::SfvbFileRevertRequest](docs/SfvbFileRevertRequest.md)
1733
1736
  - [UltracartClient::SfvbFileSearchRequest](docs/SfvbFileSearchRequest.md)
1734
1737
  - [UltracartClient::SfvbFileSearchResponse](docs/SfvbFileSearchResponse.md)
1738
+ - [UltracartClient::SfvbFileUploadRequest](docs/SfvbFileUploadRequest.md)
1739
+ - [UltracartClient::SfvbFileUploadUrlResponse](docs/SfvbFileUploadUrlResponse.md)
1735
1740
  - [UltracartClient::SfvbFileVersion](docs/SfvbFileVersion.md)
1736
1741
  - [UltracartClient::SfvbFileVersionsResponse](docs/SfvbFileVersionsResponse.md)
1737
1742
  - [UltracartClient::SfvbFileWriteRequest](docs/SfvbFileWriteRequest.md)
@@ -1922,6 +1927,7 @@ Not every change is committed to every SDK.
1922
1927
 
1923
1928
  | Version | Date | Comments |
1924
1929
  | --: | :-: | --- |
1930
+ | 4.1.144 | 09/02/2026 | sfvb - internal testing |
1925
1931
  | 4.1.143 | 09/02/2026 | sfvb - internal development |
1926
1932
  | 4.1.142 | 08/26/2026 | sfvb - internal test |
1927
1933
  | 4.1.141 | 08/26/2026 | sfvb - internal testing |
data/docs/SfvbApi.md CHANGED
@@ -8,12 +8,14 @@ All URIs are relative to *https://secure.ultracart.com/rest/v2*
8
8
  | [**create_sfvb_preview_session**](SfvbApi.md#create_sfvb_preview_session) | **POST** /sfvb/storefronts/{storefront_oid}/preview_sessions | Create a preview session |
9
9
  | [**delete_sfvb_file**](SfvbApi.md#delete_sfvb_file) | **DELETE** /sfvb/storefronts/{storefront_oid}/files | Delete a storefront file |
10
10
  | [**delete_sfvb_preview_session**](SfvbApi.md#delete_sfvb_preview_session) | **DELETE** /sfvb/storefronts/{storefront_oid}/preview_sessions/{preview_session_id} | Delete a preview session |
11
+ | [**download_sfvb_file**](SfvbApi.md#download_sfvb_file) | **GET** /sfvb/storefronts/{storefront_oid}/files/download | Read a storefront file's raw bytes |
11
12
  | [**duplicate_sfvb_theme**](SfvbApi.md#duplicate_sfvb_theme) | **POST** /sfvb/storefronts/{storefront_oid}/themes/{theme_oid}/duplicate | Duplicate a theme |
12
13
  | [**get_sfvb_cjson_used_elements**](SfvbApi.md#get_sfvb_cjson_used_elements) | **POST** /sfvb/cjson/elements | Element types used by a container |
13
14
  | [**get_sfvb_container**](SfvbApi.md#get_sfvb_container) | **GET** /sfvb/storefronts/{storefront_oid}/containers/{owner_type}/{owner_object_id} | Read a container stored outside the file system |
14
15
  | [**get_sfvb_container_version**](SfvbApi.md#get_sfvb_container_version) | **GET** /sfvb/storefronts/{storefront_oid}/container_versions/{container_history_oid} | Read the CJSON stored in one container history entry |
15
16
  | [**get_sfvb_element**](SfvbApi.md#get_sfvb_element) | **GET** /sfvb/elements/{element_type} | Configuration schema for one element type |
16
17
  | [**get_sfvb_file_content**](SfvbApi.md#get_sfvb_file_content) | **GET** /sfvb/storefronts/{storefront_oid}/files/content | Read a storefront file |
18
+ | [**get_sfvb_file_upload_url**](SfvbApi.md#get_sfvb_file_upload_url) | **GET** /sfvb/storefronts/{storefront_oid}/files/upload_url/{extension} | Get a URL to upload a binary asset to |
17
19
  | [**get_sfvb_library_entry**](SfvbApi.md#get_sfvb_library_entry) | **GET** /sfvb/storefronts/{storefront_oid}/library/{library_oid} | Read one library entry including its CJSON |
18
20
  | [**get_sfvb_preview_url**](SfvbApi.md#get_sfvb_preview_url) | **GET** /sfvb/storefronts/{storefront_oid}/preview_sessions/{preview_session_id}/url | URL that renders a preview session |
19
21
  | [**get_sfvb_theme**](SfvbApi.md#get_sfvb_theme) | **GET** /sfvb/storefronts/{storefront_oid}/themes/{theme_oid} | Get a theme |
@@ -37,6 +39,7 @@ All URIs are relative to *https://secure.ultracart.com/rest/v2*
37
39
  | [**revert_sfvb_file**](SfvbApi.md#revert_sfvb_file) | **POST** /sfvb/storefronts/{storefront_oid}/files/revert | Revert a storefront file to an earlier version |
38
40
  | [**search_sfvb_files**](SfvbApi.md#search_sfvb_files) | **POST** /sfvb/storefronts/{storefront_oid}/files/search | Search storefront files |
39
41
  | [**search_sfvb_library**](SfvbApi.md#search_sfvb_library) | **GET** /sfvb/storefronts/{storefront_oid}/library | Search the element library |
42
+ | [**upload_sfvb_file**](SfvbApi.md#upload_sfvb_file) | **POST** /sfvb/storefronts/{storefront_oid}/files/upload | Store a binary asset that was already uploaded |
40
43
  | [**validate_sfvb_cjson**](SfvbApi.md#validate_sfvb_cjson) | **POST** /sfvb/cjson/validate | Validate CJSON |
41
44
  | [**validate_sfvb_velocity**](SfvbApi.md#validate_sfvb_velocity) | **POST** /sfvb/storefronts/{storefront_oid}/themes/{theme_oid}/velocity/validate | Validate a Velocity template against a theme |
42
45
 
@@ -256,6 +259,60 @@ nil (empty response body)
256
259
  - **Accept**: application/json
257
260
 
258
261
 
262
+ ## download_sfvb_file
263
+
264
+ > download_sfvb_file(storefront_oid, opts)
265
+
266
+ Read a storefront file's raw bytes
267
+
268
+ Returns the file itself rather than a JSON envelope, for any type including binaries that files/content refuses. Use this to verify what you uploaded, and note it is the only way to read a file inside a theme that is not active - such a file is served to nobody until the theme is promoted, so it has no public URL to fetch instead. On success the body is the file; on failure it is the usual JSON error object, so do not assume the content type without checking the status.
269
+
270
+
271
+ ### Examples
272
+
273
+
274
+ (No example for this operation).
275
+
276
+
277
+ #### Using the download_sfvb_file_with_http_info variant
278
+
279
+ This returns an Array which contains the response data (`nil` in this case), status code and headers.
280
+
281
+ > <Array(nil, Integer, Hash)> download_sfvb_file_with_http_info(storefront_oid, opts)
282
+
283
+ ```ruby
284
+ begin
285
+ # Read a storefront file's raw bytes
286
+ data, status_code, headers = api_instance.download_sfvb_file_with_http_info(storefront_oid, opts)
287
+ p status_code # => 2xx
288
+ p headers # => { ... }
289
+ p data # => nil
290
+ rescue UltracartClient::ApiError => e
291
+ puts "Error when calling SfvbApi->download_sfvb_file_with_http_info: #{e}"
292
+ end
293
+ ```
294
+
295
+ ### Parameters
296
+
297
+ | Name | Type | Description | Notes |
298
+ | ---- | ---- | ----------- | ----- |
299
+ | **storefront_oid** | **Integer** | | |
300
+ | **path** | **String** | | [optional] |
301
+
302
+ ### Return type
303
+
304
+ nil (empty response body)
305
+
306
+ ### Authorization
307
+
308
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
309
+
310
+ ### HTTP request headers
311
+
312
+ - **Content-Type**: Not defined
313
+ - **Accept**: application/octet-stream
314
+
315
+
259
316
  ## duplicate_sfvb_theme
260
317
 
261
318
  > <SfvbThemeJobResponse> duplicate_sfvb_theme(storefront_oid, theme_oid, duplicate_request)
@@ -532,7 +589,7 @@ end
532
589
 
533
590
  Read a storefront file
534
591
 
535
- Returns the current content, or an earlier version when version is supplied. The content hash is returned as an ETag; send it back as If-Match when writing.
592
+ Returns the current content, or an earlier version when version is supplied. Send the body's hash_sha256 back as If-Match when writing. The ETag header carries the same hash, but a compressing proxy may append a suffix such as -gzip to it, so prefer the body value.
536
593
 
537
594
 
538
595
  ### Examples
@@ -581,6 +638,60 @@ end
581
638
  - **Accept**: application/json
582
639
 
583
640
 
641
+ ## get_sfvb_file_upload_url
642
+
643
+ > <SfvbFileUploadUrlResponse> get_sfvb_file_upload_url(storefront_oid, extension)
644
+
645
+ Get a URL to upload a binary asset to
646
+
647
+ Binary content does not travel through this API as JSON, so uploading an image, font, video or PDF is two steps. Ask here for a URL, PUT the raw bytes straight to it, then call uploadSfvbFile quoting the key you were given. The bytes never pass through the API server. The extension is checked against the accepted type list before a URL is issued, so an unsupported type fails here rather than after you have sent the file. The URL is short lived and the key is bound to your account.
648
+
649
+
650
+ ### Examples
651
+
652
+
653
+ (No example for this operation).
654
+
655
+
656
+ #### Using the get_sfvb_file_upload_url_with_http_info variant
657
+
658
+ This returns an Array which contains the response data, status code and headers.
659
+
660
+ > <Array(<SfvbFileUploadUrlResponse>, Integer, Hash)> get_sfvb_file_upload_url_with_http_info(storefront_oid, extension)
661
+
662
+ ```ruby
663
+ begin
664
+ # Get a URL to upload a binary asset to
665
+ data, status_code, headers = api_instance.get_sfvb_file_upload_url_with_http_info(storefront_oid, extension)
666
+ p status_code # => 2xx
667
+ p headers # => { ... }
668
+ p data # => <SfvbFileUploadUrlResponse>
669
+ rescue UltracartClient::ApiError => e
670
+ puts "Error when calling SfvbApi->get_sfvb_file_upload_url_with_http_info: #{e}"
671
+ end
672
+ ```
673
+
674
+ ### Parameters
675
+
676
+ | Name | Type | Description | Notes |
677
+ | ---- | ---- | ----------- | ----- |
678
+ | **storefront_oid** | **Integer** | | |
679
+ | **extension** | **String** | | |
680
+
681
+ ### Return type
682
+
683
+ [**SfvbFileUploadUrlResponse**](SfvbFileUploadUrlResponse.md)
684
+
685
+ ### Authorization
686
+
687
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
688
+
689
+ ### HTTP request headers
690
+
691
+ - **Content-Type**: Not defined
692
+ - **Accept**: application/json
693
+
694
+
584
695
  ## get_sfvb_library_entry
585
696
 
586
697
  > <SfvbLibraryEntry> get_sfvb_library_entry(storefront_oid, library_oid)
@@ -1824,6 +1935,61 @@ end
1824
1935
  - **Accept**: application/json
1825
1936
 
1826
1937
 
1938
+ ## upload_sfvb_file
1939
+
1940
+ > <SfvbFileWriteResponse> upload_sfvb_file(storefront_oid, file_upload_request, opts)
1941
+
1942
+ Store a binary asset that was already uploaded
1943
+
1944
+ The second half of the two step upload. The bytes are fetched from the key, checked against the extension they claim to be, and written exactly as a text write is - so the same If-Match precondition, the same read only refusal and the same publish gate apply. An SVG is sanitized before it is stored. Writing outside /themes/ requires sfvb_publish, because anything served off the storefront root is live by definition.
1945
+
1946
+
1947
+ ### Examples
1948
+
1949
+
1950
+ (No example for this operation).
1951
+
1952
+
1953
+ #### Using the upload_sfvb_file_with_http_info variant
1954
+
1955
+ This returns an Array which contains the response data, status code and headers.
1956
+
1957
+ > <Array(<SfvbFileWriteResponse>, Integer, Hash)> upload_sfvb_file_with_http_info(storefront_oid, file_upload_request, opts)
1958
+
1959
+ ```ruby
1960
+ begin
1961
+ # Store a binary asset that was already uploaded
1962
+ data, status_code, headers = api_instance.upload_sfvb_file_with_http_info(storefront_oid, file_upload_request, opts)
1963
+ p status_code # => 2xx
1964
+ p headers # => { ... }
1965
+ p data # => <SfvbFileWriteResponse>
1966
+ rescue UltracartClient::ApiError => e
1967
+ puts "Error when calling SfvbApi->upload_sfvb_file_with_http_info: #{e}"
1968
+ end
1969
+ ```
1970
+
1971
+ ### Parameters
1972
+
1973
+ | Name | Type | Description | Notes |
1974
+ | ---- | ---- | ----------- | ----- |
1975
+ | **storefront_oid** | **Integer** | | |
1976
+ | **file_upload_request** | [**SfvbFileUploadRequest**](SfvbFileUploadRequest.md) | Where to store the uploaded bytes | |
1977
+ | **if_match** | **String** | Content hash from the last read. Required when the file already exists; 428 when absent, 412 when stale. | [optional] |
1978
+
1979
+ ### Return type
1980
+
1981
+ [**SfvbFileWriteResponse**](SfvbFileWriteResponse.md)
1982
+
1983
+ ### Authorization
1984
+
1985
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
1986
+
1987
+ ### HTTP request headers
1988
+
1989
+ - **Content-Type**: application/json
1990
+ - **Accept**: application/json
1991
+
1992
+
1827
1993
  ## validate_sfvb_cjson
1828
1994
 
1829
1995
  > <SfvbValidationResponse> validate_sfvb_cjson(validate_request)
@@ -7,7 +7,7 @@
7
7
  | **auto_compiled** | **Boolean** | True when this file is compiler output and must not be edited directly. | [optional] |
8
8
  | **content** | **String** | UTF-8 content. Only text/* files can be read this way. | [optional] |
9
9
  | **fs_file_oid** | **Integer** | StoreFront file system file oid. | [optional] |
10
- | **hash_sha256** | **String** | SHA-256 of the content. Also returned as the ETag header; send it back as If-Match when writing. | [optional] |
10
+ | **hash_sha256** | **String** | SHA-256 of the content. Send this back as If-Match when writing. The ETag header carries the same hash, but a compressing proxy may append a suffix such as -gzip to it, so this body value is the authoritative one. Both forms are accepted on write. | [optional] |
11
11
  | **mime_type** | **String** | Mime type. | [optional] |
12
12
  | **path** | **String** | Full path of the file. | [optional] |
13
13
  | **size** | **Integer** | Size in bytes. | [optional] |
@@ -0,0 +1,24 @@
1
+ # UltracartClient::SfvbFileUploadRequest
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **comment** | **String** | Optional comment recorded against the version this write creates. | [optional] |
8
+ | **create_if_missing** | **Boolean** | Create the file if it does not exist. Defaults to true. | [optional] |
9
+ | **key** | **String** | The key returned when the upload URL was issued. | [optional] |
10
+ | **path** | **String** | Storefront path to write, for example /assets/imgs/hero.jpg. The extension must match the one the upload URL was issued for, and must match the bytes. | [optional] |
11
+
12
+ ## Example
13
+
14
+ ```ruby
15
+ require 'ultracart_api'
16
+
17
+ instance = UltracartClient::SfvbFileUploadRequest.new(
18
+ comment: null,
19
+ create_if_missing: null,
20
+ key: null,
21
+ path: null
22
+ )
23
+ ```
24
+
@@ -0,0 +1,24 @@
1
+ # UltracartClient::SfvbFileUploadUrlResponse
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **expires_in_seconds** | **Integer** | Seconds until the upload URL stops working. Ask for a new one rather than holding this across a long job. | [optional] |
8
+ | **http_method** | **String** | HTTP method the upload URL expects. | [optional] |
9
+ | **key** | **String** | Quote this back to the upload endpoint once the bytes are in place. It identifies the uploaded object and is bound to your account. | [optional] |
10
+ | **upload_url** | **String** | Send the raw bytes to this URL. It is short lived and single use, and it is not part of this API - do not send an Authorization header with it. | [optional] |
11
+
12
+ ## Example
13
+
14
+ ```ruby
15
+ require 'ultracart_api'
16
+
17
+ instance = UltracartClient::SfvbFileUploadUrlResponse.new(
18
+ expires_in_seconds: null,
19
+ http_method: null,
20
+ key: null,
21
+ upload_url: null
22
+ )
23
+ ```
24
+
@@ -7,6 +7,7 @@
7
7
  | **compiled_path** | **String** | Path of the compiled output, when writing a .cjson under a theme triggered a compile. | [optional] |
8
8
  | **file** | [**SfvbFileEntry**](SfvbFileEntry.md) | | [optional] |
9
9
  | **hash_sha256** | **String** | New SHA-256. Use as the next If-Match value. | [optional] |
10
+ | **public_url** | **String** | Where a shopper&#39;s browser will fetch this file, for use in an img src or a background image. Present only for a path outside /themes/, which is served straight off the storefront root. A file inside a theme is absent here because its public URL depends on which theme is active, and guessing it would be worse than omitting it. | [optional] |
10
11
  | **validation** | [**SfvbValidationResponse**](SfvbValidationResponse.md) | | [optional] |
11
12
  | **velocity_errors** | **String** | Velocity errors recorded by the store. Present means the file was written but is not valid. | [optional] |
12
13
  | **version** | **Integer** | New version number. | [optional] |
@@ -20,6 +21,7 @@ instance = UltracartClient::SfvbFileWriteResponse.new(
20
21
  compiled_path: null,
21
22
  file: null,
22
23
  hash_sha256: null,
24
+ public_url: null,
23
25
  validation: null,
24
26
  velocity_errors: null,
25
27
  version: null
@@ -309,6 +309,73 @@ module UltracartClient
309
309
  return data, status_code, headers
310
310
  end
311
311
 
312
+ # Read a storefront file's raw bytes
313
+ # Returns the file itself rather than a JSON envelope, for any type including binaries that files/content refuses. Use this to verify what you uploaded, and note it is the only way to read a file inside a theme that is not active - such a file is served to nobody until the theme is promoted, so it has no public URL to fetch instead. On success the body is the file; on failure it is the usual JSON error object, so do not assume the content type without checking the status.
314
+ # @param storefront_oid [Integer]
315
+ # @param [Hash] opts the optional parameters
316
+ # @option opts [String] :path
317
+ # @return [nil]
318
+ def download_sfvb_file(storefront_oid, opts = {})
319
+ download_sfvb_file_with_http_info(storefront_oid, opts)
320
+ nil
321
+ end
322
+
323
+ # Read a storefront file&#39;s raw bytes
324
+ # Returns the file itself rather than a JSON envelope, for any type including binaries that files/content refuses. Use this to verify what you uploaded, and note it is the only way to read a file inside a theme that is not active - such a file is served to nobody until the theme is promoted, so it has no public URL to fetch instead. On success the body is the file; on failure it is the usual JSON error object, so do not assume the content type without checking the status.
325
+ # @param storefront_oid [Integer]
326
+ # @param [Hash] opts the optional parameters
327
+ # @option opts [String] :path
328
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
329
+ def download_sfvb_file_with_http_info(storefront_oid, opts = {})
330
+ if @api_client.config.debugging
331
+ @api_client.config.logger.debug 'Calling API: SfvbApi.download_sfvb_file ...'
332
+ end
333
+ # verify the required parameter 'storefront_oid' is set
334
+ if @api_client.config.client_side_validation && storefront_oid.nil?
335
+ fail ArgumentError, "Missing the required parameter 'storefront_oid' when calling SfvbApi.download_sfvb_file"
336
+ end
337
+ # resource path
338
+ local_var_path = '/sfvb/storefronts/{storefront_oid}/files/download'.sub('{' + 'storefront_oid' + '}', CGI.escape(storefront_oid.to_s))
339
+
340
+ # query parameters
341
+ query_params = opts[:query_params] || {}
342
+ query_params[:'path'] = opts[:'path'] if !opts[:'path'].nil?
343
+
344
+ # header parameters
345
+ header_params = opts[:header_params] || {}
346
+ header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
347
+ # HTTP header 'Accept' (if needed)
348
+ header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream'])
349
+
350
+ # form parameters
351
+ form_params = opts[:form_params] || {}
352
+
353
+ # http body (model)
354
+ post_body = opts[:debug_body]
355
+
356
+ # return_type
357
+ return_type = opts[:debug_return_type]
358
+
359
+ # auth_names
360
+ auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']
361
+
362
+ new_options = opts.merge(
363
+ :operation => :"SfvbApi.download_sfvb_file",
364
+ :header_params => header_params,
365
+ :query_params => query_params,
366
+ :form_params => form_params,
367
+ :body => post_body,
368
+ :auth_names => auth_names,
369
+ :return_type => return_type
370
+ )
371
+
372
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
373
+ if @api_client.config.debugging
374
+ @api_client.config.logger.debug "API called: SfvbApi#download_sfvb_file\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
375
+ end
376
+ return data, status_code, headers
377
+ end
378
+
312
379
  # Duplicate a theme
313
380
  # Copies a theme into a new one and returns a job handle to poll. Asynchronous, because copying a theme copies every file in it. Needs sfvb_write rather than sfvb_publish, because the job explicitly does not activate what it creates, so the worst outcome of a mistaken call is a spare theme. This is how you get somewhere safe to work - duplicate, edit the copy with an ordinary write scope, and let a human promote it.
314
381
  # @param storefront_oid [Integer]
@@ -678,7 +745,7 @@ module UltracartClient
678
745
  end
679
746
 
680
747
  # Read a storefront file
681
- # Returns the current content, or an earlier version when version is supplied. The content hash is returned as an ETag; send it back as If-Match when writing.
748
+ # Returns the current content, or an earlier version when version is supplied. Send the body's hash_sha256 back as If-Match when writing. The ETag header carries the same hash, but a compressing proxy may append a suffix such as -gzip to it, so prefer the body value.
682
749
  # @param storefront_oid [Integer]
683
750
  # @param [Hash] opts the optional parameters
684
751
  # @option opts [String] :path
@@ -690,7 +757,7 @@ module UltracartClient
690
757
  end
691
758
 
692
759
  # Read a storefront file
693
- # Returns the current content, or an earlier version when version is supplied. The content hash is returned as an ETag; send it back as If-Match when writing.
760
+ # Returns the current content, or an earlier version when version is supplied. Send the body&#39;s hash_sha256 back as If-Match when writing. The ETag header carries the same hash, but a compressing proxy may append a suffix such as -gzip to it, so prefer the body value.
694
761
  # @param storefront_oid [Integer]
695
762
  # @param [Hash] opts the optional parameters
696
763
  # @option opts [String] :path
@@ -747,6 +814,76 @@ module UltracartClient
747
814
  return data, status_code, headers
748
815
  end
749
816
 
817
+ # Get a URL to upload a binary asset to
818
+ # Binary content does not travel through this API as JSON, so uploading an image, font, video or PDF is two steps. Ask here for a URL, PUT the raw bytes straight to it, then call uploadSfvbFile quoting the key you were given. The bytes never pass through the API server. The extension is checked against the accepted type list before a URL is issued, so an unsupported type fails here rather than after you have sent the file. The URL is short lived and the key is bound to your account.
819
+ # @param storefront_oid [Integer]
820
+ # @param extension [String]
821
+ # @param [Hash] opts the optional parameters
822
+ # @return [SfvbFileUploadUrlResponse]
823
+ def get_sfvb_file_upload_url(storefront_oid, extension, opts = {})
824
+ data, _status_code, _headers = get_sfvb_file_upload_url_with_http_info(storefront_oid, extension, opts)
825
+ data
826
+ end
827
+
828
+ # Get a URL to upload a binary asset to
829
+ # Binary content does not travel through this API as JSON, so uploading an image, font, video or PDF is two steps. Ask here for a URL, PUT the raw bytes straight to it, then call uploadSfvbFile quoting the key you were given. The bytes never pass through the API server. The extension is checked against the accepted type list before a URL is issued, so an unsupported type fails here rather than after you have sent the file. The URL is short lived and the key is bound to your account.
830
+ # @param storefront_oid [Integer]
831
+ # @param extension [String]
832
+ # @param [Hash] opts the optional parameters
833
+ # @return [Array<(SfvbFileUploadUrlResponse, Integer, Hash)>] SfvbFileUploadUrlResponse data, response status code and response headers
834
+ def get_sfvb_file_upload_url_with_http_info(storefront_oid, extension, opts = {})
835
+ if @api_client.config.debugging
836
+ @api_client.config.logger.debug 'Calling API: SfvbApi.get_sfvb_file_upload_url ...'
837
+ end
838
+ # verify the required parameter 'storefront_oid' is set
839
+ if @api_client.config.client_side_validation && storefront_oid.nil?
840
+ fail ArgumentError, "Missing the required parameter 'storefront_oid' when calling SfvbApi.get_sfvb_file_upload_url"
841
+ end
842
+ # verify the required parameter 'extension' is set
843
+ if @api_client.config.client_side_validation && extension.nil?
844
+ fail ArgumentError, "Missing the required parameter 'extension' when calling SfvbApi.get_sfvb_file_upload_url"
845
+ end
846
+ # resource path
847
+ local_var_path = '/sfvb/storefronts/{storefront_oid}/files/upload_url/{extension}'.sub('{' + 'storefront_oid' + '}', CGI.escape(storefront_oid.to_s)).sub('{' + 'extension' + '}', CGI.escape(extension.to_s))
848
+
849
+ # query parameters
850
+ query_params = opts[:query_params] || {}
851
+
852
+ # header parameters
853
+ header_params = opts[:header_params] || {}
854
+ header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
855
+ # HTTP header 'Accept' (if needed)
856
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
857
+
858
+ # form parameters
859
+ form_params = opts[:form_params] || {}
860
+
861
+ # http body (model)
862
+ post_body = opts[:debug_body]
863
+
864
+ # return_type
865
+ return_type = opts[:debug_return_type] || 'SfvbFileUploadUrlResponse'
866
+
867
+ # auth_names
868
+ auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']
869
+
870
+ new_options = opts.merge(
871
+ :operation => :"SfvbApi.get_sfvb_file_upload_url",
872
+ :header_params => header_params,
873
+ :query_params => query_params,
874
+ :form_params => form_params,
875
+ :body => post_body,
876
+ :auth_names => auth_names,
877
+ :return_type => return_type
878
+ )
879
+
880
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
881
+ if @api_client.config.debugging
882
+ @api_client.config.logger.debug "API called: SfvbApi#get_sfvb_file_upload_url\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
883
+ end
884
+ return data, status_code, headers
885
+ end
886
+
750
887
  # Read one library entry including its CJSON
751
888
  # Returns the fragment as authored. If it references images or other storefront files those paths will not resolve on this storefront until the entry is installed, so use install rather than this when the intent is to place the fragment.
752
889
  # @param storefront_oid [Integer]
@@ -2412,6 +2549,84 @@ module UltracartClient
2412
2549
  return data, status_code, headers
2413
2550
  end
2414
2551
 
2552
+ # Store a binary asset that was already uploaded
2553
+ # The second half of the two step upload. The bytes are fetched from the key, checked against the extension they claim to be, and written exactly as a text write is - so the same If-Match precondition, the same read only refusal and the same publish gate apply. An SVG is sanitized before it is stored. Writing outside /themes/ requires sfvb_publish, because anything served off the storefront root is live by definition.
2554
+ # @param storefront_oid [Integer]
2555
+ # @param file_upload_request [SfvbFileUploadRequest] Where to store the uploaded bytes
2556
+ # @param [Hash] opts the optional parameters
2557
+ # @option opts [String] :if_match Content hash from the last read. Required when the file already exists; 428 when absent, 412 when stale.
2558
+ # @return [SfvbFileWriteResponse]
2559
+ def upload_sfvb_file(storefront_oid, file_upload_request, opts = {})
2560
+ data, _status_code, _headers = upload_sfvb_file_with_http_info(storefront_oid, file_upload_request, opts)
2561
+ data
2562
+ end
2563
+
2564
+ # Store a binary asset that was already uploaded
2565
+ # The second half of the two step upload. The bytes are fetched from the key, checked against the extension they claim to be, and written exactly as a text write is - so the same If-Match precondition, the same read only refusal and the same publish gate apply. An SVG is sanitized before it is stored. Writing outside /themes/ requires sfvb_publish, because anything served off the storefront root is live by definition.
2566
+ # @param storefront_oid [Integer]
2567
+ # @param file_upload_request [SfvbFileUploadRequest] Where to store the uploaded bytes
2568
+ # @param [Hash] opts the optional parameters
2569
+ # @option opts [String] :if_match Content hash from the last read. Required when the file already exists; 428 when absent, 412 when stale.
2570
+ # @return [Array<(SfvbFileWriteResponse, Integer, Hash)>] SfvbFileWriteResponse data, response status code and response headers
2571
+ def upload_sfvb_file_with_http_info(storefront_oid, file_upload_request, opts = {})
2572
+ if @api_client.config.debugging
2573
+ @api_client.config.logger.debug 'Calling API: SfvbApi.upload_sfvb_file ...'
2574
+ end
2575
+ # verify the required parameter 'storefront_oid' is set
2576
+ if @api_client.config.client_side_validation && storefront_oid.nil?
2577
+ fail ArgumentError, "Missing the required parameter 'storefront_oid' when calling SfvbApi.upload_sfvb_file"
2578
+ end
2579
+ # verify the required parameter 'file_upload_request' is set
2580
+ if @api_client.config.client_side_validation && file_upload_request.nil?
2581
+ fail ArgumentError, "Missing the required parameter 'file_upload_request' when calling SfvbApi.upload_sfvb_file"
2582
+ end
2583
+ # resource path
2584
+ local_var_path = '/sfvb/storefronts/{storefront_oid}/files/upload'.sub('{' + 'storefront_oid' + '}', CGI.escape(storefront_oid.to_s))
2585
+
2586
+ # query parameters
2587
+ query_params = opts[:query_params] || {}
2588
+
2589
+ # header parameters
2590
+ header_params = opts[:header_params] || {}
2591
+ header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
2592
+ # HTTP header 'Accept' (if needed)
2593
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
2594
+ # HTTP header 'Content-Type'
2595
+ content_type = @api_client.select_header_content_type(['application/json'])
2596
+ if !content_type.nil?
2597
+ header_params['Content-Type'] = content_type
2598
+ end
2599
+ header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?
2600
+
2601
+ # form parameters
2602
+ form_params = opts[:form_params] || {}
2603
+
2604
+ # http body (model)
2605
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(file_upload_request)
2606
+
2607
+ # return_type
2608
+ return_type = opts[:debug_return_type] || 'SfvbFileWriteResponse'
2609
+
2610
+ # auth_names
2611
+ auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']
2612
+
2613
+ new_options = opts.merge(
2614
+ :operation => :"SfvbApi.upload_sfvb_file",
2615
+ :header_params => header_params,
2616
+ :query_params => query_params,
2617
+ :form_params => form_params,
2618
+ :body => post_body,
2619
+ :auth_names => auth_names,
2620
+ :return_type => return_type
2621
+ )
2622
+
2623
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
2624
+ if @api_client.config.debugging
2625
+ @api_client.config.logger.debug "API called: SfvbApi#upload_sfvb_file\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2626
+ end
2627
+ return data, status_code, headers
2628
+ end
2629
+
2415
2630
  # Validate CJSON
2416
2631
  # Runs the structural schema, the contextual business rules for the destination owner type, and the quality lint. A document that fails returns HTTP 200 with valid false rather than a transport error - the request was well formed, the document was not.
2417
2632
  # @param validate_request [SfvbValidateRequest] CJSON to validate
@@ -24,7 +24,7 @@ module UltracartClient
24
24
  # StoreFront file system file oid.
25
25
  attr_accessor :fs_file_oid
26
26
 
27
- # SHA-256 of the content. Also returned as the ETag header; send it back as If-Match when writing.
27
+ # SHA-256 of the content. Send this back as If-Match when writing. The ETag header carries the same hash, but a compressing proxy may append a suffix such as -gzip to it, so this body value is the authoritative one. Both forms are accepted on write.
28
28
  attr_accessor :hash_sha256
29
29
 
30
30
  # Mime type.
@@ -0,0 +1,250 @@
1
+ =begin
2
+ #UltraCart Rest API V2
3
+
4
+ #UltraCart REST API Version 2
5
+
6
+ The version of the OpenAPI document: 2.0.0
7
+ Contact: support@ultracart.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 6.0.1-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module UltracartClient
17
+ class SfvbFileUploadRequest
18
+ # Optional comment recorded against the version this write creates.
19
+ attr_accessor :comment
20
+
21
+ # Create the file if it does not exist. Defaults to true.
22
+ attr_accessor :create_if_missing
23
+
24
+ # The key returned when the upload URL was issued.
25
+ attr_accessor :key
26
+
27
+ # Storefront path to write, for example /assets/imgs/hero.jpg. The extension must match the one the upload URL was issued for, and must match the bytes.
28
+ attr_accessor :path
29
+
30
+ # Attribute mapping from ruby-style variable name to JSON key.
31
+ def self.attribute_map
32
+ {
33
+ :'comment' => :'comment',
34
+ :'create_if_missing' => :'create_if_missing',
35
+ :'key' => :'key',
36
+ :'path' => :'path'
37
+ }
38
+ end
39
+
40
+ # Returns all the JSON keys this model knows about
41
+ def self.acceptable_attributes
42
+ attribute_map.values
43
+ end
44
+
45
+ # Attribute type mapping.
46
+ def self.openapi_types
47
+ {
48
+ :'comment' => :'String',
49
+ :'create_if_missing' => :'Boolean',
50
+ :'key' => :'String',
51
+ :'path' => :'String'
52
+ }
53
+ end
54
+
55
+ # List of attributes with nullable: true
56
+ def self.openapi_nullable
57
+ Set.new([
58
+ ])
59
+ end
60
+
61
+ # Initializes the object
62
+ # @param [Hash] attributes Model attributes in the form of hash
63
+ def initialize(attributes = {})
64
+ if (!attributes.is_a?(Hash))
65
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::SfvbFileUploadRequest` initialize method"
66
+ end
67
+
68
+ # check to see if the attribute exists and convert string to symbol for hash key
69
+ attributes = attributes.each_with_object({}) { |(k, v), h|
70
+ if (!self.class.attribute_map.key?(k.to_sym))
71
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::SfvbFileUploadRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
72
+ end
73
+ h[k.to_sym] = v
74
+ }
75
+
76
+ if attributes.key?(:'comment')
77
+ self.comment = attributes[:'comment']
78
+ end
79
+
80
+ if attributes.key?(:'create_if_missing')
81
+ self.create_if_missing = attributes[:'create_if_missing']
82
+ end
83
+
84
+ if attributes.key?(:'key')
85
+ self.key = attributes[:'key']
86
+ end
87
+
88
+ if attributes.key?(:'path')
89
+ self.path = attributes[:'path']
90
+ end
91
+ end
92
+
93
+ # Show invalid properties with the reasons. Usually used together with valid?
94
+ # @return Array for valid properties with the reasons
95
+ def list_invalid_properties
96
+ invalid_properties = Array.new
97
+ invalid_properties
98
+ end
99
+
100
+ # Check to see if the all the properties in the model are valid
101
+ # @return true if the model is valid
102
+ def valid?
103
+ true
104
+ end
105
+
106
+ # Checks equality by comparing each attribute.
107
+ # @param [Object] Object to be compared
108
+ def ==(o)
109
+ return true if self.equal?(o)
110
+ self.class == o.class &&
111
+ comment == o.comment &&
112
+ create_if_missing == o.create_if_missing &&
113
+ key == o.key &&
114
+ path == o.path
115
+ end
116
+
117
+ # @see the `==` method
118
+ # @param [Object] Object to be compared
119
+ def eql?(o)
120
+ self == o
121
+ end
122
+
123
+ # Calculates hash code according to all attributes.
124
+ # @return [Integer] Hash code
125
+ def hash
126
+ [comment, create_if_missing, key, path].hash
127
+ end
128
+
129
+ # Builds the object from hash
130
+ # @param [Hash] attributes Model attributes in the form of hash
131
+ # @return [Object] Returns the model itself
132
+ def self.build_from_hash(attributes)
133
+ new.build_from_hash(attributes)
134
+ end
135
+
136
+ # Builds the object from hash
137
+ # @param [Hash] attributes Model attributes in the form of hash
138
+ # @return [Object] Returns the model itself
139
+ def build_from_hash(attributes)
140
+ return nil unless attributes.is_a?(Hash)
141
+ attributes = attributes.transform_keys(&:to_sym)
142
+ self.class.openapi_types.each_pair do |key, type|
143
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
144
+ self.send("#{key}=", nil)
145
+ elsif type =~ /\AArray<(.*)>/i
146
+ # check to ensure the input is an array given that the attribute
147
+ # is documented as an array but the input is not
148
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
149
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
150
+ end
151
+ elsif !attributes[self.class.attribute_map[key]].nil?
152
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
153
+ end
154
+ end
155
+
156
+ self
157
+ end
158
+
159
+ # Deserializes the data based on type
160
+ # @param string type Data type
161
+ # @param string value Value to be deserialized
162
+ # @return [Object] Deserialized data
163
+ def _deserialize(type, value)
164
+ case type.to_sym
165
+ when :Time
166
+ Time.parse(value)
167
+ when :Date
168
+ Date.parse(value)
169
+ when :String
170
+ value.to_s
171
+ when :Integer
172
+ value.to_i
173
+ when :Float
174
+ value.to_f
175
+ when :Boolean
176
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
177
+ true
178
+ else
179
+ false
180
+ end
181
+ when :Object
182
+ # generic object (usually a Hash), return directly
183
+ value
184
+ when /\AArray<(?<inner_type>.+)>\z/
185
+ inner_type = Regexp.last_match[:inner_type]
186
+ value.map { |v| _deserialize(inner_type, v) }
187
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
188
+ k_type = Regexp.last_match[:k_type]
189
+ v_type = Regexp.last_match[:v_type]
190
+ {}.tap do |hash|
191
+ value.each do |k, v|
192
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
193
+ end
194
+ end
195
+ else # model
196
+ # models (e.g. Pet) or oneOf
197
+ klass = UltracartClient.const_get(type)
198
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
199
+ end
200
+ end
201
+
202
+ # Returns the string representation of the object
203
+ # @return [String] String presentation of the object
204
+ def to_s
205
+ to_hash.to_s
206
+ end
207
+
208
+ # to_body is an alias to to_hash (backward compatibility)
209
+ # @return [Hash] Returns the object in the form of hash
210
+ def to_body
211
+ to_hash
212
+ end
213
+
214
+ # Returns the object in the form of hash
215
+ # @return [Hash] Returns the object in the form of hash
216
+ def to_hash
217
+ hash = {}
218
+ self.class.attribute_map.each_pair do |attr, param|
219
+ value = self.send(attr)
220
+ if value.nil?
221
+ is_nullable = self.class.openapi_nullable.include?(attr)
222
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
223
+ end
224
+
225
+ hash[param] = _to_hash(value)
226
+ end
227
+ hash
228
+ end
229
+
230
+ # Outputs non-array value in the form of hash
231
+ # For object, use to_hash. Otherwise, just return the value
232
+ # @param [Object] value Any valid value
233
+ # @return [Hash] Returns the value in the form of hash
234
+ def _to_hash(value)
235
+ if value.is_a?(Array)
236
+ value.compact.map { |v| _to_hash(v) }
237
+ elsif value.is_a?(Hash)
238
+ {}.tap do |hash|
239
+ value.each { |k, v| hash[k] = _to_hash(v) }
240
+ end
241
+ elsif value.respond_to? :to_hash
242
+ value.to_hash
243
+ else
244
+ value
245
+ end
246
+ end
247
+
248
+ end
249
+
250
+ end
@@ -0,0 +1,250 @@
1
+ =begin
2
+ #UltraCart Rest API V2
3
+
4
+ #UltraCart REST API Version 2
5
+
6
+ The version of the OpenAPI document: 2.0.0
7
+ Contact: support@ultracart.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 6.0.1-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module UltracartClient
17
+ class SfvbFileUploadUrlResponse
18
+ # Seconds until the upload URL stops working. Ask for a new one rather than holding this across a long job.
19
+ attr_accessor :expires_in_seconds
20
+
21
+ # HTTP method the upload URL expects.
22
+ attr_accessor :http_method
23
+
24
+ # Quote this back to the upload endpoint once the bytes are in place. It identifies the uploaded object and is bound to your account.
25
+ attr_accessor :key
26
+
27
+ # Send the raw bytes to this URL. It is short lived and single use, and it is not part of this API - do not send an Authorization header with it.
28
+ attr_accessor :upload_url
29
+
30
+ # Attribute mapping from ruby-style variable name to JSON key.
31
+ def self.attribute_map
32
+ {
33
+ :'expires_in_seconds' => :'expires_in_seconds',
34
+ :'http_method' => :'http_method',
35
+ :'key' => :'key',
36
+ :'upload_url' => :'upload_url'
37
+ }
38
+ end
39
+
40
+ # Returns all the JSON keys this model knows about
41
+ def self.acceptable_attributes
42
+ attribute_map.values
43
+ end
44
+
45
+ # Attribute type mapping.
46
+ def self.openapi_types
47
+ {
48
+ :'expires_in_seconds' => :'Integer',
49
+ :'http_method' => :'String',
50
+ :'key' => :'String',
51
+ :'upload_url' => :'String'
52
+ }
53
+ end
54
+
55
+ # List of attributes with nullable: true
56
+ def self.openapi_nullable
57
+ Set.new([
58
+ ])
59
+ end
60
+
61
+ # Initializes the object
62
+ # @param [Hash] attributes Model attributes in the form of hash
63
+ def initialize(attributes = {})
64
+ if (!attributes.is_a?(Hash))
65
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::SfvbFileUploadUrlResponse` initialize method"
66
+ end
67
+
68
+ # check to see if the attribute exists and convert string to symbol for hash key
69
+ attributes = attributes.each_with_object({}) { |(k, v), h|
70
+ if (!self.class.attribute_map.key?(k.to_sym))
71
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::SfvbFileUploadUrlResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
72
+ end
73
+ h[k.to_sym] = v
74
+ }
75
+
76
+ if attributes.key?(:'expires_in_seconds')
77
+ self.expires_in_seconds = attributes[:'expires_in_seconds']
78
+ end
79
+
80
+ if attributes.key?(:'http_method')
81
+ self.http_method = attributes[:'http_method']
82
+ end
83
+
84
+ if attributes.key?(:'key')
85
+ self.key = attributes[:'key']
86
+ end
87
+
88
+ if attributes.key?(:'upload_url')
89
+ self.upload_url = attributes[:'upload_url']
90
+ end
91
+ end
92
+
93
+ # Show invalid properties with the reasons. Usually used together with valid?
94
+ # @return Array for valid properties with the reasons
95
+ def list_invalid_properties
96
+ invalid_properties = Array.new
97
+ invalid_properties
98
+ end
99
+
100
+ # Check to see if the all the properties in the model are valid
101
+ # @return true if the model is valid
102
+ def valid?
103
+ true
104
+ end
105
+
106
+ # Checks equality by comparing each attribute.
107
+ # @param [Object] Object to be compared
108
+ def ==(o)
109
+ return true if self.equal?(o)
110
+ self.class == o.class &&
111
+ expires_in_seconds == o.expires_in_seconds &&
112
+ http_method == o.http_method &&
113
+ key == o.key &&
114
+ upload_url == o.upload_url
115
+ end
116
+
117
+ # @see the `==` method
118
+ # @param [Object] Object to be compared
119
+ def eql?(o)
120
+ self == o
121
+ end
122
+
123
+ # Calculates hash code according to all attributes.
124
+ # @return [Integer] Hash code
125
+ def hash
126
+ [expires_in_seconds, http_method, key, upload_url].hash
127
+ end
128
+
129
+ # Builds the object from hash
130
+ # @param [Hash] attributes Model attributes in the form of hash
131
+ # @return [Object] Returns the model itself
132
+ def self.build_from_hash(attributes)
133
+ new.build_from_hash(attributes)
134
+ end
135
+
136
+ # Builds the object from hash
137
+ # @param [Hash] attributes Model attributes in the form of hash
138
+ # @return [Object] Returns the model itself
139
+ def build_from_hash(attributes)
140
+ return nil unless attributes.is_a?(Hash)
141
+ attributes = attributes.transform_keys(&:to_sym)
142
+ self.class.openapi_types.each_pair do |key, type|
143
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
144
+ self.send("#{key}=", nil)
145
+ elsif type =~ /\AArray<(.*)>/i
146
+ # check to ensure the input is an array given that the attribute
147
+ # is documented as an array but the input is not
148
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
149
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
150
+ end
151
+ elsif !attributes[self.class.attribute_map[key]].nil?
152
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
153
+ end
154
+ end
155
+
156
+ self
157
+ end
158
+
159
+ # Deserializes the data based on type
160
+ # @param string type Data type
161
+ # @param string value Value to be deserialized
162
+ # @return [Object] Deserialized data
163
+ def _deserialize(type, value)
164
+ case type.to_sym
165
+ when :Time
166
+ Time.parse(value)
167
+ when :Date
168
+ Date.parse(value)
169
+ when :String
170
+ value.to_s
171
+ when :Integer
172
+ value.to_i
173
+ when :Float
174
+ value.to_f
175
+ when :Boolean
176
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
177
+ true
178
+ else
179
+ false
180
+ end
181
+ when :Object
182
+ # generic object (usually a Hash), return directly
183
+ value
184
+ when /\AArray<(?<inner_type>.+)>\z/
185
+ inner_type = Regexp.last_match[:inner_type]
186
+ value.map { |v| _deserialize(inner_type, v) }
187
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
188
+ k_type = Regexp.last_match[:k_type]
189
+ v_type = Regexp.last_match[:v_type]
190
+ {}.tap do |hash|
191
+ value.each do |k, v|
192
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
193
+ end
194
+ end
195
+ else # model
196
+ # models (e.g. Pet) or oneOf
197
+ klass = UltracartClient.const_get(type)
198
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
199
+ end
200
+ end
201
+
202
+ # Returns the string representation of the object
203
+ # @return [String] String presentation of the object
204
+ def to_s
205
+ to_hash.to_s
206
+ end
207
+
208
+ # to_body is an alias to to_hash (backward compatibility)
209
+ # @return [Hash] Returns the object in the form of hash
210
+ def to_body
211
+ to_hash
212
+ end
213
+
214
+ # Returns the object in the form of hash
215
+ # @return [Hash] Returns the object in the form of hash
216
+ def to_hash
217
+ hash = {}
218
+ self.class.attribute_map.each_pair do |attr, param|
219
+ value = self.send(attr)
220
+ if value.nil?
221
+ is_nullable = self.class.openapi_nullable.include?(attr)
222
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
223
+ end
224
+
225
+ hash[param] = _to_hash(value)
226
+ end
227
+ hash
228
+ end
229
+
230
+ # Outputs non-array value in the form of hash
231
+ # For object, use to_hash. Otherwise, just return the value
232
+ # @param [Object] value Any valid value
233
+ # @return [Hash] Returns the value in the form of hash
234
+ def _to_hash(value)
235
+ if value.is_a?(Array)
236
+ value.compact.map { |v| _to_hash(v) }
237
+ elsif value.is_a?(Hash)
238
+ {}.tap do |hash|
239
+ value.each { |k, v| hash[k] = _to_hash(v) }
240
+ end
241
+ elsif value.respond_to? :to_hash
242
+ value.to_hash
243
+ else
244
+ value
245
+ end
246
+ end
247
+
248
+ end
249
+
250
+ end
@@ -23,6 +23,9 @@ module UltracartClient
23
23
  # New SHA-256. Use as the next If-Match value.
24
24
  attr_accessor :hash_sha256
25
25
 
26
+ # Where a shopper's browser will fetch this file, for use in an img src or a background image. Present only for a path outside /themes/, which is served straight off the storefront root. A file inside a theme is absent here because its public URL depends on which theme is active, and guessing it would be worse than omitting it.
27
+ attr_accessor :public_url
28
+
26
29
  attr_accessor :validation
27
30
 
28
31
  # Velocity errors recorded by the store. Present means the file was written but is not valid.
@@ -37,6 +40,7 @@ module UltracartClient
37
40
  :'compiled_path' => :'compiled_path',
38
41
  :'file' => :'file',
39
42
  :'hash_sha256' => :'hash_sha256',
43
+ :'public_url' => :'public_url',
40
44
  :'validation' => :'validation',
41
45
  :'velocity_errors' => :'velocity_errors',
42
46
  :'version' => :'version'
@@ -54,6 +58,7 @@ module UltracartClient
54
58
  :'compiled_path' => :'String',
55
59
  :'file' => :'SfvbFileEntry',
56
60
  :'hash_sha256' => :'String',
61
+ :'public_url' => :'String',
57
62
  :'validation' => :'SfvbValidationResponse',
58
63
  :'velocity_errors' => :'String',
59
64
  :'version' => :'Integer'
@@ -93,6 +98,10 @@ module UltracartClient
93
98
  self.hash_sha256 = attributes[:'hash_sha256']
94
99
  end
95
100
 
101
+ if attributes.key?(:'public_url')
102
+ self.public_url = attributes[:'public_url']
103
+ end
104
+
96
105
  if attributes.key?(:'validation')
97
106
  self.validation = attributes[:'validation']
98
107
  end
@@ -127,6 +136,7 @@ module UltracartClient
127
136
  compiled_path == o.compiled_path &&
128
137
  file == o.file &&
129
138
  hash_sha256 == o.hash_sha256 &&
139
+ public_url == o.public_url &&
130
140
  validation == o.validation &&
131
141
  velocity_errors == o.velocity_errors &&
132
142
  version == o.version
@@ -141,7 +151,7 @@ module UltracartClient
141
151
  # Calculates hash code according to all attributes.
142
152
  # @return [Integer] Hash code
143
153
  def hash
144
- [compiled_path, file, hash_sha256, validation, velocity_errors, version].hash
154
+ [compiled_path, file, hash_sha256, public_url, validation, velocity_errors, version].hash
145
155
  end
146
156
 
147
157
  # Builds the object from hash
@@ -11,5 +11,5 @@ OpenAPI Generator version: 6.0.1-SNAPSHOT
11
11
  =end
12
12
 
13
13
  module UltracartClient
14
- VERSION = '4.1.143'
14
+ VERSION = '4.1.144'
15
15
  end
data/lib/ultracart_api.rb CHANGED
@@ -989,6 +989,8 @@ require 'ultracart_api/models/sfvb_file_entry'
989
989
  require 'ultracart_api/models/sfvb_file_revert_request'
990
990
  require 'ultracart_api/models/sfvb_file_search_request'
991
991
  require 'ultracart_api/models/sfvb_file_search_response'
992
+ require 'ultracart_api/models/sfvb_file_upload_request'
993
+ require 'ultracart_api/models/sfvb_file_upload_url_response'
992
994
  require 'ultracart_api/models/sfvb_file_version'
993
995
  require 'ultracart_api/models/sfvb_file_versions_response'
994
996
  require 'ultracart_api/models/sfvb_file_write_request'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ultracart_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.143
4
+ version: 4.1.144
5
5
  platform: ruby
6
6
  authors:
7
7
  - UltraCart
@@ -1051,6 +1051,8 @@ files:
1051
1051
  - docs/SfvbFileRevertRequest.md
1052
1052
  - docs/SfvbFileSearchRequest.md
1053
1053
  - docs/SfvbFileSearchResponse.md
1054
+ - docs/SfvbFileUploadRequest.md
1055
+ - docs/SfvbFileUploadUrlResponse.md
1054
1056
  - docs/SfvbFileVersion.md
1055
1057
  - docs/SfvbFileVersionsResponse.md
1056
1058
  - docs/SfvbFileWriteRequest.md
@@ -2173,6 +2175,8 @@ files:
2173
2175
  - lib/ultracart_api/models/sfvb_file_revert_request.rb
2174
2176
  - lib/ultracart_api/models/sfvb_file_search_request.rb
2175
2177
  - lib/ultracart_api/models/sfvb_file_search_response.rb
2178
+ - lib/ultracart_api/models/sfvb_file_upload_request.rb
2179
+ - lib/ultracart_api/models/sfvb_file_upload_url_response.rb
2176
2180
  - lib/ultracart_api/models/sfvb_file_version.rb
2177
2181
  - lib/ultracart_api/models/sfvb_file_versions_response.rb
2178
2182
  - lib/ultracart_api/models/sfvb_file_write_request.rb