ultracart_api 4.1.253 → 4.1.255
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 +4 -4
- data/README.md +11 -2
- data/docs/SfvbApi.md +177 -11
- data/docs/SfvbApprovalParams.md +2 -0
- data/docs/SfvbCliLocation.md +20 -0
- data/docs/SfvbFileContentResult.md +22 -0
- data/docs/SfvbFilesContentRequest.md +18 -0
- data/docs/SfvbFilesContentResponse.md +20 -0
- data/docs/SfvbMenusResponse.md +1 -1
- data/docs/SfvbPageListResponse.md +5 -1
- data/docs/SfvbPageResponse.md +2 -0
- data/docs/SfvbPageSummary.md +4 -0
- data/docs/SfvbWhoamiResponse.md +2 -0
- data/lib/ultracart_api/api/sfvb_api.rb +223 -18
- data/lib/ultracart_api/models/sfvb_approval_create_request.rb +2 -2
- data/lib/ultracart_api/models/sfvb_approval_params.rb +11 -1
- data/lib/ultracart_api/models/sfvb_cli_location.rb +230 -0
- data/lib/ultracart_api/models/sfvb_file_content_result.rb +238 -0
- data/lib/ultracart_api/models/sfvb_files_content_request.rb +222 -0
- data/lib/ultracart_api/models/sfvb_files_content_response.rb +234 -0
- data/lib/ultracart_api/models/sfvb_menus_response.rb +1 -1
- data/lib/ultracart_api/models/sfvb_page_list_response.rb +24 -4
- data/lib/ultracart_api/models/sfvb_page_response.rb +11 -1
- data/lib/ultracart_api/models/sfvb_page_summary.rb +20 -1
- data/lib/ultracart_api/models/sfvb_whoami_response.rb +10 -1
- data/lib/ultracart_api/version.rb +1 -1
- data/lib/ultracart_api.rb +4 -0
- metadata +10 -2
|
@@ -7466,6 +7466,81 @@ module UltracartClient
|
|
|
7466
7466
|
return data, status_code, headers
|
|
7467
7467
|
end
|
|
7468
7468
|
|
|
7469
|
+
# Read several storefront files
|
|
7470
|
+
# The current content of up to 50 files in one call, each answered exactly as the single file read answers it. A file that can't be read carries its own error and the others are still read. When the response reaches its size limit, the paths not yet read come back in remaining_paths; send them again. Only reads - a POST because the list of paths can be long.
|
|
7471
|
+
# @param storefront_oid [Integer]
|
|
7472
|
+
# @param files_request [SfvbFilesContentRequest] The files to read
|
|
7473
|
+
# @param [Hash] opts the optional parameters
|
|
7474
|
+
# @return [SfvbFilesContentResponse]
|
|
7475
|
+
def get_sfvb_file_contents(storefront_oid, files_request, opts = {})
|
|
7476
|
+
data, _status_code, _headers = get_sfvb_file_contents_with_http_info(storefront_oid, files_request, opts)
|
|
7477
|
+
data
|
|
7478
|
+
end
|
|
7479
|
+
|
|
7480
|
+
# Read several storefront files
|
|
7481
|
+
# The current content of up to 50 files in one call, each answered exactly as the single file read answers it. A file that can't be read carries its own error and the others are still read. When the response reaches its size limit, the paths not yet read come back in remaining_paths; send them again. Only reads - a POST because the list of paths can be long.
|
|
7482
|
+
# @param storefront_oid [Integer]
|
|
7483
|
+
# @param files_request [SfvbFilesContentRequest] The files to read
|
|
7484
|
+
# @param [Hash] opts the optional parameters
|
|
7485
|
+
# @return [Array<(SfvbFilesContentResponse, Integer, Hash)>] SfvbFilesContentResponse data, response status code and response headers
|
|
7486
|
+
def get_sfvb_file_contents_with_http_info(storefront_oid, files_request, opts = {})
|
|
7487
|
+
if @api_client.config.debugging
|
|
7488
|
+
@api_client.config.logger.debug 'Calling API: SfvbApi.get_sfvb_file_contents ...'
|
|
7489
|
+
end
|
|
7490
|
+
# verify the required parameter 'storefront_oid' is set
|
|
7491
|
+
if @api_client.config.client_side_validation && storefront_oid.nil?
|
|
7492
|
+
fail ArgumentError, "Missing the required parameter 'storefront_oid' when calling SfvbApi.get_sfvb_file_contents"
|
|
7493
|
+
end
|
|
7494
|
+
# verify the required parameter 'files_request' is set
|
|
7495
|
+
if @api_client.config.client_side_validation && files_request.nil?
|
|
7496
|
+
fail ArgumentError, "Missing the required parameter 'files_request' when calling SfvbApi.get_sfvb_file_contents"
|
|
7497
|
+
end
|
|
7498
|
+
# resource path
|
|
7499
|
+
local_var_path = '/sfvb/storefronts/{storefront_oid}/files/content'.sub('{' + 'storefront_oid' + '}', CGI.escape(storefront_oid.to_s))
|
|
7500
|
+
|
|
7501
|
+
# query parameters
|
|
7502
|
+
query_params = opts[:query_params] || {}
|
|
7503
|
+
|
|
7504
|
+
# header parameters
|
|
7505
|
+
header_params = opts[:header_params] || {}
|
|
7506
|
+
header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
|
|
7507
|
+
# HTTP header 'Accept' (if needed)
|
|
7508
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
7509
|
+
# HTTP header 'Content-Type'
|
|
7510
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
7511
|
+
if !content_type.nil?
|
|
7512
|
+
header_params['Content-Type'] = content_type
|
|
7513
|
+
end
|
|
7514
|
+
|
|
7515
|
+
# form parameters
|
|
7516
|
+
form_params = opts[:form_params] || {}
|
|
7517
|
+
|
|
7518
|
+
# http body (model)
|
|
7519
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(files_request)
|
|
7520
|
+
|
|
7521
|
+
# return_type
|
|
7522
|
+
return_type = opts[:debug_return_type] || 'SfvbFilesContentResponse'
|
|
7523
|
+
|
|
7524
|
+
# auth_names
|
|
7525
|
+
auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']
|
|
7526
|
+
|
|
7527
|
+
new_options = opts.merge(
|
|
7528
|
+
:operation => :"SfvbApi.get_sfvb_file_contents",
|
|
7529
|
+
:header_params => header_params,
|
|
7530
|
+
:query_params => query_params,
|
|
7531
|
+
:form_params => form_params,
|
|
7532
|
+
:body => post_body,
|
|
7533
|
+
:auth_names => auth_names,
|
|
7534
|
+
:return_type => return_type
|
|
7535
|
+
)
|
|
7536
|
+
|
|
7537
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
7538
|
+
if @api_client.config.debugging
|
|
7539
|
+
@api_client.config.logger.debug "API called: SfvbApi#get_sfvb_file_contents\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
7540
|
+
end
|
|
7541
|
+
return data, status_code, headers
|
|
7542
|
+
end
|
|
7543
|
+
|
|
7469
7544
|
# Get a URL to upload a binary asset to
|
|
7470
7545
|
# 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.
|
|
7471
7546
|
# @param storefront_oid [Integer]
|
|
@@ -8785,9 +8860,10 @@ module UltracartClient
|
|
|
8785
8860
|
end
|
|
8786
8861
|
|
|
8787
8862
|
# List a storefront's store menus
|
|
8788
|
-
# The menus a menu element's menuName can name, sorted by code
|
|
8863
|
+
# The menus a menu element's menuName can name, sorted by code. Without include_entries each menu is listed without its entries; with include_entries=true each carries the tree the single-menu read returns, so one call reads every menu. A code the active theme's templates ask for but nothing has created is included with unconfigured true - that code renders an empty list today, and writing it creates it. A menu no template names is marked undeclared, which usually means a menuName is misspelled.
|
|
8789
8864
|
# @param storefront_oid [Integer]
|
|
8790
8865
|
# @param [Hash] opts the optional parameters
|
|
8866
|
+
# @option opts [Boolean] :include_entries True to include each menu's entries
|
|
8791
8867
|
# @return [SfvbMenusResponse]
|
|
8792
8868
|
def get_sfvb_menus(storefront_oid, opts = {})
|
|
8793
8869
|
data, _status_code, _headers = get_sfvb_menus_with_http_info(storefront_oid, opts)
|
|
@@ -8795,9 +8871,10 @@ module UltracartClient
|
|
|
8795
8871
|
end
|
|
8796
8872
|
|
|
8797
8873
|
# List a storefront's store menus
|
|
8798
|
-
# The menus a menu element's menuName can name, sorted by code
|
|
8874
|
+
# The menus a menu element's menuName can name, sorted by code. Without include_entries each menu is listed without its entries; with include_entries=true each carries the tree the single-menu read returns, so one call reads every menu. A code the active theme's templates ask for but nothing has created is included with unconfigured true - that code renders an empty list today, and writing it creates it. A menu no template names is marked undeclared, which usually means a menuName is misspelled.
|
|
8799
8875
|
# @param storefront_oid [Integer]
|
|
8800
8876
|
# @param [Hash] opts the optional parameters
|
|
8877
|
+
# @option opts [Boolean] :include_entries True to include each menu's entries
|
|
8801
8878
|
# @return [Array<(SfvbMenusResponse, Integer, Hash)>] SfvbMenusResponse data, response status code and response headers
|
|
8802
8879
|
def get_sfvb_menus_with_http_info(storefront_oid, opts = {})
|
|
8803
8880
|
if @api_client.config.debugging
|
|
@@ -8812,6 +8889,7 @@ module UltracartClient
|
|
|
8812
8889
|
|
|
8813
8890
|
# query parameters
|
|
8814
8891
|
query_params = opts[:query_params] || {}
|
|
8892
|
+
query_params[:'include_entries'] = opts[:'include_entries'] if !opts[:'include_entries'].nil?
|
|
8815
8893
|
|
|
8816
8894
|
# header parameters
|
|
8817
8895
|
header_params = opts[:header_params] || {}
|
|
@@ -9135,23 +9213,25 @@ module UltracartClient
|
|
|
9135
9213
|
end
|
|
9136
9214
|
|
|
9137
9215
|
# Read a page's attributes and images
|
|
9138
|
-
# What the pageattribute and pageimage elements render for this page. These are not in any file, which is why a page folder can be empty and its elements still render something. Attributes and image codes a template declares but nothing has set are included, so the response describes what the page can show rather than only what has been saved.
|
|
9216
|
+
# What the pageattribute and pageimage elements render for this page. These are not in any file, which is why a page folder can be empty and its elements still render something. Attributes and image codes a template declares but nothing has set are included, so the response describes what the page can show rather than only what has been saved. Name the page by path or by catalog_group_oid, not both. The oid is the id the page list and menu reads return, and it stays the same when the page moves.
|
|
9139
9217
|
# @param storefront_oid [Integer]
|
|
9140
|
-
# @param path [String] Page path, for example /catalog/dispensers/
|
|
9141
9218
|
# @param [Hash] opts the optional parameters
|
|
9219
|
+
# @option opts [String] :path Page path, for example /catalog/dispensers/. Required unless catalog_group_oid is given.
|
|
9220
|
+
# @option opts [Integer] :catalog_group_oid The page's id, in place of path
|
|
9142
9221
|
# @return [SfvbPageResponse]
|
|
9143
|
-
def get_sfvb_page(storefront_oid,
|
|
9144
|
-
data, _status_code, _headers = get_sfvb_page_with_http_info(storefront_oid,
|
|
9222
|
+
def get_sfvb_page(storefront_oid, opts = {})
|
|
9223
|
+
data, _status_code, _headers = get_sfvb_page_with_http_info(storefront_oid, opts)
|
|
9145
9224
|
data
|
|
9146
9225
|
end
|
|
9147
9226
|
|
|
9148
9227
|
# Read a page's attributes and images
|
|
9149
|
-
# What the pageattribute and pageimage elements render for this page. These are not in any file, which is why a page folder can be empty and its elements still render something. Attributes and image codes a template declares but nothing has set are included, so the response describes what the page can show rather than only what has been saved.
|
|
9228
|
+
# What the pageattribute and pageimage elements render for this page. These are not in any file, which is why a page folder can be empty and its elements still render something. Attributes and image codes a template declares but nothing has set are included, so the response describes what the page can show rather than only what has been saved. Name the page by path or by catalog_group_oid, not both. The oid is the id the page list and menu reads return, and it stays the same when the page moves.
|
|
9150
9229
|
# @param storefront_oid [Integer]
|
|
9151
|
-
# @param path [String] Page path, for example /catalog/dispensers/
|
|
9152
9230
|
# @param [Hash] opts the optional parameters
|
|
9231
|
+
# @option opts [String] :path Page path, for example /catalog/dispensers/. Required unless catalog_group_oid is given.
|
|
9232
|
+
# @option opts [Integer] :catalog_group_oid The page's id, in place of path
|
|
9153
9233
|
# @return [Array<(SfvbPageResponse, Integer, Hash)>] SfvbPageResponse data, response status code and response headers
|
|
9154
|
-
def get_sfvb_page_with_http_info(storefront_oid,
|
|
9234
|
+
def get_sfvb_page_with_http_info(storefront_oid, opts = {})
|
|
9155
9235
|
if @api_client.config.debugging
|
|
9156
9236
|
@api_client.config.logger.debug 'Calling API: SfvbApi.get_sfvb_page ...'
|
|
9157
9237
|
end
|
|
@@ -9159,16 +9239,13 @@ module UltracartClient
|
|
|
9159
9239
|
if @api_client.config.client_side_validation && storefront_oid.nil?
|
|
9160
9240
|
fail ArgumentError, "Missing the required parameter 'storefront_oid' when calling SfvbApi.get_sfvb_page"
|
|
9161
9241
|
end
|
|
9162
|
-
# verify the required parameter 'path' is set
|
|
9163
|
-
if @api_client.config.client_side_validation && path.nil?
|
|
9164
|
-
fail ArgumentError, "Missing the required parameter 'path' when calling SfvbApi.get_sfvb_page"
|
|
9165
|
-
end
|
|
9166
9242
|
# resource path
|
|
9167
9243
|
local_var_path = '/sfvb/storefronts/{storefront_oid}/pages'.sub('{' + 'storefront_oid' + '}', CGI.escape(storefront_oid.to_s))
|
|
9168
9244
|
|
|
9169
9245
|
# query parameters
|
|
9170
9246
|
query_params = opts[:query_params] || {}
|
|
9171
|
-
query_params[:'path'] = path
|
|
9247
|
+
query_params[:'path'] = opts[:'path'] if !opts[:'path'].nil?
|
|
9248
|
+
query_params[:'catalog_group_oid'] = opts[:'catalog_group_oid'] if !opts[:'catalog_group_oid'].nil?
|
|
9172
9249
|
|
|
9173
9250
|
# header parameters
|
|
9174
9251
|
header_params = opts[:header_params] || {}
|
|
@@ -13085,6 +13162,125 @@ module UltracartClient
|
|
|
13085
13162
|
return data, status_code, headers
|
|
13086
13163
|
end
|
|
13087
13164
|
|
|
13165
|
+
# Add the caller's address to this StoreFront CLI sign-in
|
|
13166
|
+
# Spends an approved cli.location approval, named in the Approval-Id header, from the address it was asked for. From then on the sign-in may be used from that address until it ends. An approval asked for from another address is refused with sfvb.approval_mismatch.
|
|
13167
|
+
# @param [Hash] opts the optional parameters
|
|
13168
|
+
# @option opts [String] :approval_id The approval_id of an approved cli.location request asked for from this address. See POST /sfvb/location/approval.
|
|
13169
|
+
# @return [nil]
|
|
13170
|
+
def insert_sfvb_location(opts = {})
|
|
13171
|
+
insert_sfvb_location_with_http_info(opts)
|
|
13172
|
+
nil
|
|
13173
|
+
end
|
|
13174
|
+
|
|
13175
|
+
# Add the caller's address to this StoreFront CLI sign-in
|
|
13176
|
+
# Spends an approved cli.location approval, named in the Approval-Id header, from the address it was asked for. From then on the sign-in may be used from that address until it ends. An approval asked for from another address is refused with sfvb.approval_mismatch.
|
|
13177
|
+
# @param [Hash] opts the optional parameters
|
|
13178
|
+
# @option opts [String] :approval_id The approval_id of an approved cli.location request asked for from this address. See POST /sfvb/location/approval.
|
|
13179
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
|
13180
|
+
def insert_sfvb_location_with_http_info(opts = {})
|
|
13181
|
+
if @api_client.config.debugging
|
|
13182
|
+
@api_client.config.logger.debug 'Calling API: SfvbApi.insert_sfvb_location ...'
|
|
13183
|
+
end
|
|
13184
|
+
# resource path
|
|
13185
|
+
local_var_path = '/sfvb/location'
|
|
13186
|
+
|
|
13187
|
+
# query parameters
|
|
13188
|
+
query_params = opts[:query_params] || {}
|
|
13189
|
+
|
|
13190
|
+
# header parameters
|
|
13191
|
+
header_params = opts[:header_params] || {}
|
|
13192
|
+
header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
|
|
13193
|
+
# HTTP header 'Accept' (if needed)
|
|
13194
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
13195
|
+
header_params[:'Approval-Id'] = opts[:'approval_id'] if !opts[:'approval_id'].nil?
|
|
13196
|
+
|
|
13197
|
+
# form parameters
|
|
13198
|
+
form_params = opts[:form_params] || {}
|
|
13199
|
+
|
|
13200
|
+
# http body (model)
|
|
13201
|
+
post_body = opts[:debug_body]
|
|
13202
|
+
|
|
13203
|
+
# return_type
|
|
13204
|
+
return_type = opts[:debug_return_type]
|
|
13205
|
+
|
|
13206
|
+
# auth_names
|
|
13207
|
+
auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']
|
|
13208
|
+
|
|
13209
|
+
new_options = opts.merge(
|
|
13210
|
+
:operation => :"SfvbApi.insert_sfvb_location",
|
|
13211
|
+
:header_params => header_params,
|
|
13212
|
+
:query_params => query_params,
|
|
13213
|
+
:form_params => form_params,
|
|
13214
|
+
:body => post_body,
|
|
13215
|
+
:auth_names => auth_names,
|
|
13216
|
+
:return_type => return_type
|
|
13217
|
+
)
|
|
13218
|
+
|
|
13219
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
13220
|
+
if @api_client.config.debugging
|
|
13221
|
+
@api_client.config.logger.debug "API called: SfvbApi#insert_sfvb_location\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
13222
|
+
end
|
|
13223
|
+
return data, status_code, headers
|
|
13224
|
+
end
|
|
13225
|
+
|
|
13226
|
+
# Ask to use this StoreFront CLI sign-in from the caller's address
|
|
13227
|
+
# For a StoreFront CLI sign-in refused with sfvb.location_approval_required. Asks the person who signed in to approve the address this call comes from (a cli.location approval). Show them approval_url and user_code, poll GET approvals/{approval_id}, and once it is approved call POST location from the same address with the approval_id in the Approval-Id header. Asking again returns the pending request (200). The person is also emailed, so a request they didn't expect warns them.
|
|
13228
|
+
# @param [Hash] opts the optional parameters
|
|
13229
|
+
# @return [SfvbApproval]
|
|
13230
|
+
def insert_sfvb_location_approval(opts = {})
|
|
13231
|
+
data, _status_code, _headers = insert_sfvb_location_approval_with_http_info(opts)
|
|
13232
|
+
data
|
|
13233
|
+
end
|
|
13234
|
+
|
|
13235
|
+
# Ask to use this StoreFront CLI sign-in from the caller's address
|
|
13236
|
+
# For a StoreFront CLI sign-in refused with sfvb.location_approval_required. Asks the person who signed in to approve the address this call comes from (a cli.location approval). Show them approval_url and user_code, poll GET approvals/{approval_id}, and once it is approved call POST location from the same address with the approval_id in the Approval-Id header. Asking again returns the pending request (200). The person is also emailed, so a request they didn't expect warns them.
|
|
13237
|
+
# @param [Hash] opts the optional parameters
|
|
13238
|
+
# @return [Array<(SfvbApproval, Integer, Hash)>] SfvbApproval data, response status code and response headers
|
|
13239
|
+
def insert_sfvb_location_approval_with_http_info(opts = {})
|
|
13240
|
+
if @api_client.config.debugging
|
|
13241
|
+
@api_client.config.logger.debug 'Calling API: SfvbApi.insert_sfvb_location_approval ...'
|
|
13242
|
+
end
|
|
13243
|
+
# resource path
|
|
13244
|
+
local_var_path = '/sfvb/location/approval'
|
|
13245
|
+
|
|
13246
|
+
# query parameters
|
|
13247
|
+
query_params = opts[:query_params] || {}
|
|
13248
|
+
|
|
13249
|
+
# header parameters
|
|
13250
|
+
header_params = opts[:header_params] || {}
|
|
13251
|
+
header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
|
|
13252
|
+
# HTTP header 'Accept' (if needed)
|
|
13253
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
13254
|
+
|
|
13255
|
+
# form parameters
|
|
13256
|
+
form_params = opts[:form_params] || {}
|
|
13257
|
+
|
|
13258
|
+
# http body (model)
|
|
13259
|
+
post_body = opts[:debug_body]
|
|
13260
|
+
|
|
13261
|
+
# return_type
|
|
13262
|
+
return_type = opts[:debug_return_type] || 'SfvbApproval'
|
|
13263
|
+
|
|
13264
|
+
# auth_names
|
|
13265
|
+
auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']
|
|
13266
|
+
|
|
13267
|
+
new_options = opts.merge(
|
|
13268
|
+
:operation => :"SfvbApi.insert_sfvb_location_approval",
|
|
13269
|
+
:header_params => header_params,
|
|
13270
|
+
:query_params => query_params,
|
|
13271
|
+
:form_params => form_params,
|
|
13272
|
+
:body => post_body,
|
|
13273
|
+
:auth_names => auth_names,
|
|
13274
|
+
:return_type => return_type
|
|
13275
|
+
)
|
|
13276
|
+
|
|
13277
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
13278
|
+
if @api_client.config.debugging
|
|
13279
|
+
@api_client.config.logger.debug "API called: SfvbApi#insert_sfvb_location_approval\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
13280
|
+
end
|
|
13281
|
+
return data, status_code, headers
|
|
13282
|
+
end
|
|
13283
|
+
|
|
13088
13284
|
# Create a page
|
|
13089
13285
|
# 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.
|
|
13090
13286
|
# @param storefront_oid [Integer]
|
|
@@ -14687,10 +14883,13 @@ module UltracartClient
|
|
|
14687
14883
|
end
|
|
14688
14884
|
|
|
14689
14885
|
# List the storefront's pages
|
|
14690
|
-
# Every page with its settings, sorted by path with the root first. Hidden pages are included. Pass under to list one page and everything below it. Read from the same cached catalog the admin page tree uses, so a page created a moment ago can take a moment to appear here - read it directly with the single-page read to confirm a write.
|
|
14886
|
+
# Every page with its settings, sorted by path with the root first. Hidden pages are included. Pass under to list one page and everything below it. Read from the same cached catalog the admin page tree uses, so a page created a moment ago can take a moment to appear here - read it directly with the single-page read to confirm a write. Pass detail=true to get each page's single-page read in detail as well, at most 25 pages a call. Page through with offset and limit, following next_offset until it is omitted.
|
|
14691
14887
|
# @param storefront_oid [Integer]
|
|
14692
14888
|
# @param [Hash] opts the optional parameters
|
|
14693
14889
|
# @option opts [String] :under Only this page and the pages below it, for example /lp/
|
|
14890
|
+
# @option opts [Boolean] :detail True to include each page's single-page read, a window at a time
|
|
14891
|
+
# @option opts [Integer] :offset Where the window starts, with detail=true. Default 0.
|
|
14892
|
+
# @option opts [Integer] :limit Pages in the window, 1 to 25, with detail=true. Default 25.
|
|
14694
14893
|
# @return [SfvbPageListResponse]
|
|
14695
14894
|
def list_sfvb_pages(storefront_oid, opts = {})
|
|
14696
14895
|
data, _status_code, _headers = list_sfvb_pages_with_http_info(storefront_oid, opts)
|
|
@@ -14698,10 +14897,13 @@ module UltracartClient
|
|
|
14698
14897
|
end
|
|
14699
14898
|
|
|
14700
14899
|
# List the storefront's pages
|
|
14701
|
-
# Every page with its settings, sorted by path with the root first. Hidden pages are included. Pass under to list one page and everything below it. Read from the same cached catalog the admin page tree uses, so a page created a moment ago can take a moment to appear here - read it directly with the single-page read to confirm a write.
|
|
14900
|
+
# Every page with its settings, sorted by path with the root first. Hidden pages are included. Pass under to list one page and everything below it. Read from the same cached catalog the admin page tree uses, so a page created a moment ago can take a moment to appear here - read it directly with the single-page read to confirm a write. Pass detail=true to get each page's single-page read in detail as well, at most 25 pages a call. Page through with offset and limit, following next_offset until it is omitted.
|
|
14702
14901
|
# @param storefront_oid [Integer]
|
|
14703
14902
|
# @param [Hash] opts the optional parameters
|
|
14704
14903
|
# @option opts [String] :under Only this page and the pages below it, for example /lp/
|
|
14904
|
+
# @option opts [Boolean] :detail True to include each page's single-page read, a window at a time
|
|
14905
|
+
# @option opts [Integer] :offset Where the window starts, with detail=true. Default 0.
|
|
14906
|
+
# @option opts [Integer] :limit Pages in the window, 1 to 25, with detail=true. Default 25.
|
|
14705
14907
|
# @return [Array<(SfvbPageListResponse, Integer, Hash)>] SfvbPageListResponse data, response status code and response headers
|
|
14706
14908
|
def list_sfvb_pages_with_http_info(storefront_oid, opts = {})
|
|
14707
14909
|
if @api_client.config.debugging
|
|
@@ -14717,6 +14919,9 @@ module UltracartClient
|
|
|
14717
14919
|
# query parameters
|
|
14718
14920
|
query_params = opts[:query_params] || {}
|
|
14719
14921
|
query_params[:'under'] = opts[:'under'] if !opts[:'under'].nil?
|
|
14922
|
+
query_params[:'detail'] = opts[:'detail'] if !opts[:'detail'].nil?
|
|
14923
|
+
query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
|
|
14924
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
|
14720
14925
|
|
|
14721
14926
|
# header parameters
|
|
14722
14927
|
header_params = opts[:header_params] || {}
|
|
@@ -21588,7 +21793,7 @@ module UltracartClient
|
|
|
21588
21793
|
end
|
|
21589
21794
|
|
|
21590
21795
|
# Change the storefront's faceted search configuration
|
|
21591
|
-
# A partial update. Turn facets on or off, change their headings, and replace the Cost facet's price breaks; facets left out and every other search setting are unchanged. Facets cannot be reordered - the order is fixed. Turning facets on or off, or changing the price breaks, starts a search index rebuild, reported in rebuild. dry_run checks the change and reports it, and the rebuild it would start, without saving. Needs sfvb_publish, because facets show on every search and category page at once.
|
|
21796
|
+
# A partial update. Turn facets on or off, change their headings, and replace the Cost facet's price breaks; facets left out and every other search setting are unchanged. Facets cannot be reordered - the order is fixed. Turning facets on or off, or changing the price breaks, starts a search index rebuild, reported in rebuild. dry_run checks the change and reports it, and the rebuild it would start, without saving. Needs sfvb_publish, because facets show on every search and category page at once. Changes are limited to 30 an hour and 100 a day per storefront, and those that start a rebuild to 6 an hour and 20 a day (429, nothing saved).
|
|
21592
21797
|
# @param storefront_oid [Integer]
|
|
21593
21798
|
# @param search_facets_request [SfvbSearchFacetsRequest] The facets and price breaks to change
|
|
21594
21799
|
# @param [Hash] opts the optional parameters
|
|
@@ -21600,7 +21805,7 @@ module UltracartClient
|
|
|
21600
21805
|
end
|
|
21601
21806
|
|
|
21602
21807
|
# Change the storefront's faceted search configuration
|
|
21603
|
-
# A partial update. Turn facets on or off, change their headings, and replace the Cost facet's price breaks; facets left out and every other search setting are unchanged. Facets cannot be reordered - the order is fixed. Turning facets on or off, or changing the price breaks, starts a search index rebuild, reported in rebuild. dry_run checks the change and reports it, and the rebuild it would start, without saving. Needs sfvb_publish, because facets show on every search and category page at once.
|
|
21808
|
+
# A partial update. Turn facets on or off, change their headings, and replace the Cost facet's price breaks; facets left out and every other search setting are unchanged. Facets cannot be reordered - the order is fixed. Turning facets on or off, or changing the price breaks, starts a search index rebuild, reported in rebuild. dry_run checks the change and reports it, and the rebuild it would start, without saving. Needs sfvb_publish, because facets show on every search and category page at once. Changes are limited to 30 an hour and 100 a day per storefront, and those that start a rebuild to 6 an hour and 20 a day (429, nothing saved).
|
|
21604
21809
|
# @param storefront_oid [Integer]
|
|
21605
21810
|
# @param search_facets_request [SfvbSearchFacetsRequest] The facets and price breaks to change
|
|
21606
21811
|
# @param [Hash] opts the optional parameters
|
|
@@ -283,7 +283,7 @@ module UltracartClient
|
|
|
283
283
|
# Check to see if the all the properties in the model are valid
|
|
284
284
|
# @return true if the model is valid
|
|
285
285
|
def valid?
|
|
286
|
-
action_validator = EnumAttributeValidator.new('String', ["file.delete", "blog_post.delete", "file.put_script", "file.put_template", "redirect.delete_batch", "experiment.start", "experiment.end", "upsell.enable", "item.attribute_batch", "item.pricing", "item.preorder", "item.variations", "item.default_page", "twilio_account.delete", "sending_domain.delete", "sequence_step.delete", "sequence_step.move", "sequence_step.enable_postcard", "segment.update", "smart_attribution.change", "smart_attribution.delete", "tracking_provider.change", "tracking_provider.clear", "tracking_html.put", "affiliate_network.change", "affiliate_network.delete", "site_seo.change", "transactional_email.update", "comms_settings.update", "comms_list.import", "postcard.test_mail", "flow.backfill", "page.move"])
|
|
286
|
+
action_validator = EnumAttributeValidator.new('String', ["file.delete", "blog_post.delete", "file.put_script", "file.put_template", "redirect.delete_batch", "experiment.start", "experiment.end", "upsell.enable", "item.attribute_batch", "item.pricing", "item.preorder", "item.variations", "item.default_page", "twilio_account.delete", "sending_domain.delete", "sequence_step.delete", "sequence_step.move", "sequence_step.enable_postcard", "segment.update", "smart_attribution.change", "smart_attribution.delete", "tracking_provider.change", "tracking_provider.clear", "tracking_html.put", "affiliate_network.change", "affiliate_network.delete", "site_seo.change", "transactional_email.update", "comms_settings.update", "comms_list.import", "postcard.test_mail", "flow.backfill", "page.move", "cli.location"])
|
|
287
287
|
return false unless action_validator.valid?(@action)
|
|
288
288
|
true
|
|
289
289
|
end
|
|
@@ -291,7 +291,7 @@ module UltracartClient
|
|
|
291
291
|
# Custom attribute writer method checking allowed values (enum).
|
|
292
292
|
# @param [Object] action Object to be assigned
|
|
293
293
|
def action=(action)
|
|
294
|
-
validator = EnumAttributeValidator.new('String', ["file.delete", "blog_post.delete", "file.put_script", "file.put_template", "redirect.delete_batch", "experiment.start", "experiment.end", "upsell.enable", "item.attribute_batch", "item.pricing", "item.preorder", "item.variations", "item.default_page", "twilio_account.delete", "sending_domain.delete", "sequence_step.delete", "sequence_step.move", "sequence_step.enable_postcard", "segment.update", "smart_attribution.change", "smart_attribution.delete", "tracking_provider.change", "tracking_provider.clear", "tracking_html.put", "affiliate_network.change", "affiliate_network.delete", "site_seo.change", "transactional_email.update", "comms_settings.update", "comms_list.import", "postcard.test_mail", "flow.backfill", "page.move"])
|
|
294
|
+
validator = EnumAttributeValidator.new('String', ["file.delete", "blog_post.delete", "file.put_script", "file.put_template", "redirect.delete_batch", "experiment.start", "experiment.end", "upsell.enable", "item.attribute_batch", "item.pricing", "item.preorder", "item.variations", "item.default_page", "twilio_account.delete", "sending_domain.delete", "sequence_step.delete", "sequence_step.move", "sequence_step.enable_postcard", "segment.update", "smart_attribution.change", "smart_attribution.delete", "tracking_provider.change", "tracking_provider.clear", "tracking_html.put", "affiliate_network.change", "affiliate_network.delete", "site_seo.change", "transactional_email.update", "comms_settings.update", "comms_list.import", "postcard.test_mail", "flow.backfill", "page.move", "cli.location"])
|
|
295
295
|
unless validator.valid?(action)
|
|
296
296
|
fail ArgumentError, "invalid value for \"action\", must be one of #{validator.allowable_values}."
|
|
297
297
|
end
|
|
@@ -42,6 +42,9 @@ module UltracartClient
|
|
|
42
42
|
# For experiment.end, the experiment to end.
|
|
43
43
|
attr_accessor :experiment_oid
|
|
44
44
|
|
|
45
|
+
# For cli.location, the IPv4 address the StoreFront CLI sign-in asks to be used from. Set by the server from the caller's own address, never by the caller.
|
|
46
|
+
attr_accessor :ip
|
|
47
|
+
|
|
45
48
|
# For item.attribute_batch, how many items the batch would change when it was requested. Set by the server.
|
|
46
49
|
attr_accessor :item_count
|
|
47
50
|
|
|
@@ -136,6 +139,7 @@ module UltracartClient
|
|
|
136
139
|
:'domain' => :'domain',
|
|
137
140
|
:'esp_twilio_uuid' => :'esp_twilio_uuid',
|
|
138
141
|
:'experiment_oid' => :'experiment_oid',
|
|
142
|
+
:'ip' => :'ip',
|
|
139
143
|
:'item_count' => :'item_count',
|
|
140
144
|
:'merchant_item_oid' => :'merchant_item_oid',
|
|
141
145
|
:'new_path' => :'new_path',
|
|
@@ -176,6 +180,7 @@ module UltracartClient
|
|
|
176
180
|
:'domain' => :'String',
|
|
177
181
|
:'esp_twilio_uuid' => :'String',
|
|
178
182
|
:'experiment_oid' => :'Integer',
|
|
183
|
+
:'ip' => :'String',
|
|
179
184
|
:'item_count' => :'Integer',
|
|
180
185
|
:'merchant_item_oid' => :'Integer',
|
|
181
186
|
:'new_path' => :'String',
|
|
@@ -258,6 +263,10 @@ module UltracartClient
|
|
|
258
263
|
self.experiment_oid = attributes[:'experiment_oid']
|
|
259
264
|
end
|
|
260
265
|
|
|
266
|
+
if attributes.key?(:'ip')
|
|
267
|
+
self.ip = attributes[:'ip']
|
|
268
|
+
end
|
|
269
|
+
|
|
261
270
|
if attributes.key?(:'item_count')
|
|
262
271
|
self.item_count = attributes[:'item_count']
|
|
263
272
|
end
|
|
@@ -378,6 +387,7 @@ module UltracartClient
|
|
|
378
387
|
domain == o.domain &&
|
|
379
388
|
esp_twilio_uuid == o.esp_twilio_uuid &&
|
|
380
389
|
experiment_oid == o.experiment_oid &&
|
|
390
|
+
ip == o.ip &&
|
|
381
391
|
item_count == o.item_count &&
|
|
382
392
|
merchant_item_oid == o.merchant_item_oid &&
|
|
383
393
|
new_path == o.new_path &&
|
|
@@ -409,7 +419,7 @@ module UltracartClient
|
|
|
409
419
|
# Calculates hash code according to all attributes.
|
|
410
420
|
# @return [Integer] Hash code
|
|
411
421
|
def hash
|
|
412
|
-
[affiliate_network_oid, after_step_uuid, attribute_names, blog_post_oid, branch_step_uuid, content_sha256, domain, esp_twilio_uuid, experiment_oid, item_count, merchant_item_oid, new_path, pages_moved, path, redirect_old_url, request_sha256, rows_sha256, rule_count, segment_uuid, sequence_uuid, side, slot, step_uuid, tracking_provider, upsell_kind, upsell_oid, version, widget_id, winner_variation_number].hash
|
|
422
|
+
[affiliate_network_oid, after_step_uuid, attribute_names, blog_post_oid, branch_step_uuid, content_sha256, domain, esp_twilio_uuid, experiment_oid, ip, item_count, merchant_item_oid, new_path, pages_moved, path, redirect_old_url, request_sha256, rows_sha256, rule_count, segment_uuid, sequence_uuid, side, slot, step_uuid, tracking_provider, upsell_kind, upsell_oid, version, widget_id, winner_variation_number].hash
|
|
413
423
|
end
|
|
414
424
|
|
|
415
425
|
# Builds the object from hash
|
|
@@ -0,0 +1,230 @@
|
|
|
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 SfvbCliLocation
|
|
18
|
+
# The IPv4 address this call came from, as UltraCart sees it.
|
|
19
|
+
attr_accessor :ip
|
|
20
|
+
|
|
21
|
+
# True when the sign-in may be used from this address. When false (omitted), ask for approval with POST /sfvb/location/approval.
|
|
22
|
+
attr_accessor :trusted
|
|
23
|
+
|
|
24
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
25
|
+
def self.attribute_map
|
|
26
|
+
{
|
|
27
|
+
:'ip' => :'ip',
|
|
28
|
+
:'trusted' => :'trusted'
|
|
29
|
+
}
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Returns all the JSON keys this model knows about
|
|
33
|
+
def self.acceptable_attributes
|
|
34
|
+
attribute_map.values
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# Attribute type mapping.
|
|
38
|
+
def self.openapi_types
|
|
39
|
+
{
|
|
40
|
+
:'ip' => :'String',
|
|
41
|
+
:'trusted' => :'Boolean'
|
|
42
|
+
}
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# List of attributes with nullable: true
|
|
46
|
+
def self.openapi_nullable
|
|
47
|
+
Set.new([
|
|
48
|
+
])
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
# Initializes the object
|
|
52
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
53
|
+
def initialize(attributes = {})
|
|
54
|
+
if (!attributes.is_a?(Hash))
|
|
55
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::SfvbCliLocation` initialize method"
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
59
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
60
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
61
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::SfvbCliLocation`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
62
|
+
end
|
|
63
|
+
h[k.to_sym] = v
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
if attributes.key?(:'ip')
|
|
67
|
+
self.ip = attributes[:'ip']
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
if attributes.key?(:'trusted')
|
|
71
|
+
self.trusted = attributes[:'trusted']
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
76
|
+
# @return Array for valid properties with the reasons
|
|
77
|
+
def list_invalid_properties
|
|
78
|
+
invalid_properties = Array.new
|
|
79
|
+
invalid_properties
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
# Check to see if the all the properties in the model are valid
|
|
83
|
+
# @return true if the model is valid
|
|
84
|
+
def valid?
|
|
85
|
+
true
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
# Checks equality by comparing each attribute.
|
|
89
|
+
# @param [Object] Object to be compared
|
|
90
|
+
def ==(o)
|
|
91
|
+
return true if self.equal?(o)
|
|
92
|
+
self.class == o.class &&
|
|
93
|
+
ip == o.ip &&
|
|
94
|
+
trusted == o.trusted
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
# @see the `==` method
|
|
98
|
+
# @param [Object] Object to be compared
|
|
99
|
+
def eql?(o)
|
|
100
|
+
self == o
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
# Calculates hash code according to all attributes.
|
|
104
|
+
# @return [Integer] Hash code
|
|
105
|
+
def hash
|
|
106
|
+
[ip, trusted].hash
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
# Builds the object from hash
|
|
110
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
111
|
+
# @return [Object] Returns the model itself
|
|
112
|
+
def self.build_from_hash(attributes)
|
|
113
|
+
new.build_from_hash(attributes)
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
# Builds the object from hash
|
|
117
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
118
|
+
# @return [Object] Returns the model itself
|
|
119
|
+
def build_from_hash(attributes)
|
|
120
|
+
return nil unless attributes.is_a?(Hash)
|
|
121
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
122
|
+
self.class.openapi_types.each_pair do |key, type|
|
|
123
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
|
124
|
+
self.send("#{key}=", nil)
|
|
125
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
126
|
+
# check to ensure the input is an array given that the attribute
|
|
127
|
+
# is documented as an array but the input is not
|
|
128
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
129
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
130
|
+
end
|
|
131
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
132
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
133
|
+
end
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
self
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
# Deserializes the data based on type
|
|
140
|
+
# @param string type Data type
|
|
141
|
+
# @param string value Value to be deserialized
|
|
142
|
+
# @return [Object] Deserialized data
|
|
143
|
+
def _deserialize(type, value)
|
|
144
|
+
case type.to_sym
|
|
145
|
+
when :Time
|
|
146
|
+
Time.parse(value)
|
|
147
|
+
when :Date
|
|
148
|
+
Date.parse(value)
|
|
149
|
+
when :String
|
|
150
|
+
value.to_s
|
|
151
|
+
when :Integer
|
|
152
|
+
value.to_i
|
|
153
|
+
when :Float
|
|
154
|
+
value.to_f
|
|
155
|
+
when :Boolean
|
|
156
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
157
|
+
true
|
|
158
|
+
else
|
|
159
|
+
false
|
|
160
|
+
end
|
|
161
|
+
when :Object
|
|
162
|
+
# generic object (usually a Hash), return directly
|
|
163
|
+
value
|
|
164
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
165
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
166
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
167
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
168
|
+
k_type = Regexp.last_match[:k_type]
|
|
169
|
+
v_type = Regexp.last_match[:v_type]
|
|
170
|
+
{}.tap do |hash|
|
|
171
|
+
value.each do |k, v|
|
|
172
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
173
|
+
end
|
|
174
|
+
end
|
|
175
|
+
else # model
|
|
176
|
+
# models (e.g. Pet) or oneOf
|
|
177
|
+
klass = UltracartClient.const_get(type)
|
|
178
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
179
|
+
end
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
# Returns the string representation of the object
|
|
183
|
+
# @return [String] String presentation of the object
|
|
184
|
+
def to_s
|
|
185
|
+
to_hash.to_s
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
189
|
+
# @return [Hash] Returns the object in the form of hash
|
|
190
|
+
def to_body
|
|
191
|
+
to_hash
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
# Returns the object in the form of hash
|
|
195
|
+
# @return [Hash] Returns the object in the form of hash
|
|
196
|
+
def to_hash
|
|
197
|
+
hash = {}
|
|
198
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
199
|
+
value = self.send(attr)
|
|
200
|
+
if value.nil?
|
|
201
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
202
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
203
|
+
end
|
|
204
|
+
|
|
205
|
+
hash[param] = _to_hash(value)
|
|
206
|
+
end
|
|
207
|
+
hash
|
|
208
|
+
end
|
|
209
|
+
|
|
210
|
+
# Outputs non-array value in the form of hash
|
|
211
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
212
|
+
# @param [Object] value Any valid value
|
|
213
|
+
# @return [Hash] Returns the value in the form of hash
|
|
214
|
+
def _to_hash(value)
|
|
215
|
+
if value.is_a?(Array)
|
|
216
|
+
value.compact.map { |v| _to_hash(v) }
|
|
217
|
+
elsif value.is_a?(Hash)
|
|
218
|
+
{}.tap do |hash|
|
|
219
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
220
|
+
end
|
|
221
|
+
elsif value.respond_to? :to_hash
|
|
222
|
+
value.to_hash
|
|
223
|
+
else
|
|
224
|
+
value
|
|
225
|
+
end
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
end
|
|
229
|
+
|
|
230
|
+
end
|