square_connect 2.1.0.beta → 2.1.0.78
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +71 -8
- data/docs/BatchDeleteCatalogObjectsRequest.md +12 -0
- data/docs/BatchDeleteCatalogObjectsResponse.md +14 -0
- data/docs/BatchRetrieveCatalogObjectsRequest.md +13 -0
- data/docs/BatchRetrieveCatalogObjectsResponse.md +14 -0
- data/docs/BatchUpsertCatalogObjectsRequest.md +13 -0
- data/docs/BatchUpsertCatalogObjectsResponse.md +15 -0
- data/docs/CatalogApi.md +592 -0
- data/docs/CatalogCategory.md +12 -0
- data/docs/CatalogDiscount.md +17 -0
- data/docs/CatalogDiscountType.md +15 -0
- data/docs/CatalogIdMapping.md +13 -0
- data/docs/CatalogInfoRequest.md +11 -0
- data/docs/CatalogInfoResponse.md +13 -0
- data/docs/CatalogInfoResponseLimits.md +22 -0
- data/docs/CatalogItem.md +25 -0
- data/docs/CatalogItemModifierListInfo.md +16 -0
- data/docs/CatalogItemProductType.md +16 -0
- data/docs/CatalogItemVariation.md +23 -0
- data/docs/CatalogModifier.md +13 -0
- data/docs/CatalogModifierList.md +14 -0
- data/docs/CatalogModifierListSelectionType.md +13 -0
- data/docs/CatalogModifierOverride.md +13 -0
- data/docs/CatalogObject.md +27 -0
- data/docs/CatalogObjectBatch.md +12 -0
- data/docs/CatalogObjectType.md +18 -0
- data/docs/CatalogPricingType.md +13 -0
- data/docs/CatalogQuery.md +18 -0
- data/docs/CatalogQueryExact.md +13 -0
- data/docs/CatalogQueryItemsForModifierList.md +12 -0
- data/docs/CatalogQueryItemsForTax.md +12 -0
- data/docs/CatalogQueryPrefix.md +13 -0
- data/docs/CatalogQueryRange.md +14 -0
- data/docs/CatalogQuerySortedAttribute.md +14 -0
- data/docs/CatalogQueryText.md +12 -0
- data/docs/CatalogTax.md +17 -0
- data/docs/CatalogV1Id.md +13 -0
- data/docs/Checkout.md +4 -4
- data/docs/CreateCheckoutRequest.md +5 -5
- data/docs/DeleteCatalogObjectRequest.md +11 -0
- data/docs/DeleteCatalogObjectResponse.md +14 -0
- data/docs/ErrorCode.md +2 -0
- data/docs/InventoryAlertType.md +13 -0
- data/docs/ItemVariationLocationOverrides.md +17 -0
- data/docs/ListCatalogRequest.md +13 -0
- data/docs/ListCatalogResponse.md +14 -0
- data/docs/RetrieveCatalogObjectRequest.md +12 -0
- data/docs/RetrieveCatalogObjectResponse.md +14 -0
- data/docs/SearchCatalogObjectsRequest.md +18 -0
- data/docs/SearchCatalogObjectsResponse.md +15 -0
- data/docs/TaxCalculationPhase.md +13 -0
- data/docs/TaxInclusionType.md +13 -0
- data/docs/UpdateItemModifierListsRequest.md +14 -0
- data/docs/UpdateItemModifierListsResponse.md +13 -0
- data/docs/UpdateItemTaxesRequest.md +14 -0
- data/docs/UpdateItemTaxesResponse.md +13 -0
- data/docs/UpsertCatalogObjectRequest.md +13 -0
- data/docs/UpsertCatalogObjectResponse.md +14 -0
- data/docs/V1Item.md +1 -1
- data/docs/V1Variation.md +0 -1
- data/lib/square_connect.rb +54 -1
- data/lib/square_connect/api/catalog_api.rb +604 -0
- data/lib/square_connect/models/batch_delete_catalog_objects_request.rb +188 -0
- data/lib/square_connect/models/batch_delete_catalog_objects_response.rb +210 -0
- data/lib/square_connect/models/batch_retrieve_catalog_objects_request.rb +203 -0
- data/lib/square_connect/models/batch_retrieve_catalog_objects_response.rb +212 -0
- data/lib/square_connect/models/batch_upsert_catalog_objects_request.rb +222 -0
- data/lib/square_connect/models/batch_upsert_catalog_objects_response.rb +222 -0
- data/lib/square_connect/models/catalog_category.rb +210 -0
- data/lib/square_connect/models/catalog_discount.rb +293 -0
- data/lib/square_connect/models/catalog_discount_type.rb +21 -0
- data/lib/square_connect/models/catalog_id_mapping.rb +196 -0
- data/lib/square_connect/models/catalog_info_request.rb +176 -0
- data/lib/square_connect/models/catalog_info_response.rb +198 -0
- data/lib/square_connect/models/catalog_info_response_limits.rb +286 -0
- data/lib/square_connect/models/catalog_item.rb +379 -0
- data/lib/square_connect/models/catalog_item_modifier_list_info.rb +252 -0
- data/lib/square_connect/models/catalog_item_product_type.rb +22 -0
- data/lib/square_connect/models/catalog_item_variation.rb +343 -0
- data/lib/square_connect/models/catalog_modifier.rb +220 -0
- data/lib/square_connect/models/catalog_modifier_list.rb +265 -0
- data/lib/square_connect/models/catalog_modifier_list_selection_type.rb +19 -0
- data/lib/square_connect/models/catalog_modifier_override.rb +220 -0
- data/lib/square_connect/models/catalog_object.rb +404 -0
- data/lib/square_connect/models/catalog_object_batch.rb +188 -0
- data/lib/square_connect/models/catalog_object_type.rb +24 -0
- data/lib/square_connect/models/catalog_pricing_type.rb +19 -0
- data/lib/square_connect/models/catalog_query.rb +246 -0
- data/lib/square_connect/models/catalog_query_exact.rb +225 -0
- data/lib/square_connect/models/catalog_query_items_for_modifier_list.rb +193 -0
- data/lib/square_connect/models/catalog_query_items_for_tax.rb +193 -0
- data/lib/square_connect/models/catalog_query_prefix.rb +244 -0
- data/lib/square_connect/models/catalog_query_range.rb +230 -0
- data/lib/square_connect/models/catalog_query_sorted_attribute.rb +263 -0
- data/lib/square_connect/models/catalog_query_text.rb +193 -0
- data/lib/square_connect/models/catalog_tax.rb +305 -0
- data/lib/square_connect/models/catalog_v1_id.rb +196 -0
- data/lib/square_connect/models/checkout.rb +4 -4
- data/lib/square_connect/models/create_checkout_request.rb +5 -5
- data/lib/square_connect/models/delete_catalog_object_request.rb +176 -0
- data/lib/square_connect/models/delete_catalog_object_response.rb +210 -0
- data/lib/square_connect/models/error.rb +2 -2
- data/lib/square_connect/models/error_code.rb +2 -0
- data/lib/square_connect/models/inventory_alert_type.rb +19 -0
- data/lib/square_connect/models/item_variation_location_overrides.rb +281 -0
- data/lib/square_connect/models/list_catalog_request.rb +196 -0
- data/lib/square_connect/models/list_catalog_response.rb +210 -0
- data/lib/square_connect/models/retrieve_catalog_object_request.rb +186 -0
- data/lib/square_connect/models/retrieve_catalog_object_response.rb +210 -0
- data/lib/square_connect/models/search_catalog_objects_request.rb +269 -0
- data/lib/square_connect/models/search_catalog_objects_response.rb +222 -0
- data/lib/square_connect/models/tax_calculation_phase.rb +19 -0
- data/lib/square_connect/models/tax_inclusion_type.rb +19 -0
- data/lib/square_connect/models/update_item_modifier_lists_request.rb +217 -0
- data/lib/square_connect/models/update_item_modifier_lists_response.rb +198 -0
- data/lib/square_connect/models/update_item_taxes_request.rb +217 -0
- data/lib/square_connect/models/update_item_taxes_response.rb +198 -0
- data/lib/square_connect/models/{create_order_request.rb → upsert_catalog_object_request.rb} +14 -23
- data/lib/square_connect/models/upsert_catalog_object_response.rb +210 -0
- data/lib/square_connect/models/v1_item.rb +1 -1
- data/lib/square_connect/models/v1_variation.rb +1 -11
- data/lib/square_connect/version.rb +1 -1
- data/spec/api/catalog_api_spec.rb +611 -0
- data/spec/models/batch_delete_catalog_objects_request_spec.rb +39 -0
- data/spec/models/batch_delete_catalog_objects_response_spec.rb +51 -0
- data/spec/models/batch_retrieve_catalog_objects_request_spec.rb +45 -0
- data/spec/models/batch_retrieve_catalog_objects_response_spec.rb +51 -0
- data/spec/models/batch_upsert_catalog_objects_request_spec.rb +45 -0
- data/spec/models/batch_upsert_catalog_objects_response_spec.rb +57 -0
- data/spec/models/catalog_category_spec.rb +39 -0
- data/spec/models/catalog_discount_spec.rb +73 -0
- data/spec/models/catalog_discount_type_spec.rb +33 -0
- data/spec/models/catalog_id_mapping_spec.rb +45 -0
- data/spec/models/catalog_info_request_spec.rb +33 -0
- data/spec/models/catalog_info_response_limits_spec.rb +99 -0
- data/spec/models/catalog_info_response_spec.rb +45 -0
- data/spec/models/catalog_item_modifier_list_info_spec.rb +63 -0
- data/spec/models/catalog_item_product_type_spec.rb +33 -0
- data/spec/models/catalog_item_spec.rb +121 -0
- data/spec/models/catalog_item_variation_spec.rb +113 -0
- data/spec/models/catalog_modifier_list_selection_type_spec.rb +33 -0
- data/spec/models/catalog_modifier_list_spec.rb +55 -0
- data/spec/models/catalog_modifier_override_spec.rb +45 -0
- data/spec/models/catalog_modifier_spec.rb +45 -0
- data/spec/models/catalog_object_batch_spec.rb +39 -0
- data/spec/models/catalog_object_spec.rb +133 -0
- data/spec/models/catalog_object_type_spec.rb +33 -0
- data/spec/models/catalog_pricing_type_spec.rb +33 -0
- data/spec/models/catalog_query_exact_spec.rb +45 -0
- data/spec/models/catalog_query_items_for_modifier_list_spec.rb +39 -0
- data/spec/models/catalog_query_items_for_tax_spec.rb +39 -0
- data/spec/models/catalog_query_prefix_spec.rb +45 -0
- data/spec/models/catalog_query_range_spec.rb +51 -0
- data/spec/models/catalog_query_sorted_attribute_spec.rb +55 -0
- data/spec/models/catalog_query_spec.rb +75 -0
- data/spec/models/catalog_query_text_spec.rb +39 -0
- data/spec/models/catalog_tax_spec.rb +77 -0
- data/spec/models/catalog_v1_id_spec.rb +45 -0
- data/spec/models/delete_catalog_object_request_spec.rb +39 -0
- data/spec/models/delete_catalog_object_response_spec.rb +51 -0
- data/spec/models/inventory_alert_type_spec.rb +33 -0
- data/spec/models/item_variation_location_overrides_spec.rb +77 -0
- data/spec/models/list_catalog_request_spec.rb +45 -0
- data/spec/models/list_catalog_response_spec.rb +51 -0
- data/spec/models/retrieve_catalog_object_request_spec.rb +45 -0
- data/spec/models/retrieve_catalog_object_response_spec.rb +51 -0
- data/spec/models/search_catalog_objects_request_spec.rb +79 -0
- data/spec/models/search_catalog_objects_response_spec.rb +57 -0
- data/spec/models/tax_calculation_phase_spec.rb +33 -0
- data/spec/models/tax_inclusion_type_spec.rb +33 -0
- data/spec/models/update_item_modifier_lists_request_spec.rb +51 -0
- data/spec/models/update_item_modifier_lists_response_spec.rb +45 -0
- data/spec/models/update_item_taxes_request_spec.rb +51 -0
- data/spec/models/update_item_taxes_response_spec.rb +45 -0
- data/spec/models/{create_order_request_spec.rb → upsert_catalog_object_request_spec.rb} +7 -7
- data/spec/models/upsert_catalog_object_response_spec.rb +51 -0
- data/square_connect.gemspec +1 -1
- data/travis-ci/accounts.enc +0 -0
- metadata +222 -17
- data/docs/CreateOrderRequest.md +0 -13
- data/docs/V1LocationApi.md +0 -102
- data/lib/.DS_Store +0 -0
- data/lib/square_connect/.DS_Store +0 -0
- data/spec/.DS_Store +0 -0
- data/square_connect-2.0.2.gem +0 -0
- data/square_connect-2.1.0.gem +0 -0
- data/square_connect-2.1.0beta.gem +0 -0
@@ -0,0 +1,604 @@
|
|
1
|
+
=begin
|
2
|
+
#Square Connect API
|
3
|
+
|
4
|
+
OpenAPI spec version: 2.0
|
5
|
+
Contact: developers@squareup.com
|
6
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
7
|
+
|
8
|
+
=end
|
9
|
+
|
10
|
+
require "uri"
|
11
|
+
|
12
|
+
module SquareConnect
|
13
|
+
class CatalogApi
|
14
|
+
attr_accessor :api_client
|
15
|
+
|
16
|
+
def initialize(api_client = ApiClient.default)
|
17
|
+
@api_client = api_client
|
18
|
+
end
|
19
|
+
|
20
|
+
# BatchDeleteCatalogObjects
|
21
|
+
# Deletes a set of [CatalogItem](#type-catalogitem)s based on the provided list of target IDs and returns a set of successfully deleted IDs in the response. Deletion is a cascading event such that all children of the targeted object are also deleted. For example, deleting a CatalogItem will also delete all of its [CatalogItemVariation](#type-catalogitemvariation) children. `BatchDeleteCatalogObjects` succeeds even if only a portion of the targeted IDs can be deleted. The response will only include IDs that were actually deleted.
|
22
|
+
# @param body An object containing the fields to POST for the request. See the corresponding object definition for field details.
|
23
|
+
# @param [Hash] opts the optional parameters
|
24
|
+
# @return [BatchDeleteCatalogObjectsResponse]
|
25
|
+
def batch_delete_catalog_objects(body, opts = {})
|
26
|
+
data, _status_code, _headers = batch_delete_catalog_objects_with_http_info(body, opts)
|
27
|
+
return data
|
28
|
+
end
|
29
|
+
|
30
|
+
# BatchDeleteCatalogObjects
|
31
|
+
# Deletes a set of [CatalogItem](#type-catalogitem)s based on the provided list of target IDs and returns a set of successfully deleted IDs in the response. Deletion is a cascading event such that all children of the targeted object are also deleted. For example, deleting a CatalogItem will also delete all of its [CatalogItemVariation](#type-catalogitemvariation) children. `BatchDeleteCatalogObjects` succeeds even if only a portion of the targeted IDs can be deleted. The response will only include IDs that were actually deleted.
|
32
|
+
# @param body An object containing the fields to POST for the request. See the corresponding object definition for field details.
|
33
|
+
# @param [Hash] opts the optional parameters
|
34
|
+
# @return [Array<(BatchDeleteCatalogObjectsResponse, Fixnum, Hash)>] BatchDeleteCatalogObjectsResponse data, response status code and response headers
|
35
|
+
def batch_delete_catalog_objects_with_http_info(body, opts = {})
|
36
|
+
if @api_client.config.debugging
|
37
|
+
@api_client.config.logger.debug "Calling API: CatalogApi.batch_delete_catalog_objects ..."
|
38
|
+
end
|
39
|
+
# verify the required parameter 'body' is set
|
40
|
+
fail ArgumentError, "Missing the required parameter 'body' when calling CatalogApi.batch_delete_catalog_objects" if body.nil?
|
41
|
+
# resource path
|
42
|
+
local_var_path = "/v2/catalog/batch-delete".sub('{format}','json')
|
43
|
+
|
44
|
+
# query parameters
|
45
|
+
query_params = {}
|
46
|
+
|
47
|
+
# header parameters
|
48
|
+
header_params = {}
|
49
|
+
# HTTP header 'Accept' (if needed)
|
50
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
51
|
+
# HTTP header 'Content-Type'
|
52
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
53
|
+
|
54
|
+
# form parameters
|
55
|
+
form_params = {}
|
56
|
+
|
57
|
+
# http body (model)
|
58
|
+
post_body = @api_client.object_to_http_body(body)
|
59
|
+
auth_names = ['oauth2']
|
60
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
61
|
+
:header_params => header_params,
|
62
|
+
:query_params => query_params,
|
63
|
+
:form_params => form_params,
|
64
|
+
:body => post_body,
|
65
|
+
:auth_names => auth_names,
|
66
|
+
:return_type => 'BatchDeleteCatalogObjectsResponse')
|
67
|
+
if @api_client.config.debugging
|
68
|
+
@api_client.config.logger.debug "API called: CatalogApi#batch_delete_catalog_objects\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
69
|
+
end
|
70
|
+
return data, status_code, headers
|
71
|
+
end
|
72
|
+
|
73
|
+
# BatchRetrieveCatalogObjects
|
74
|
+
# Returns a set of objects based on the provided ID. [CatalogItem](#type-catalogitem)s returned in the set include all of the child information including: all [CatalogItemVariation](#type-catalogitemvariation) objects, references to its [CatalogModifierList](#type-catalogmodifierlist) objects, and the ids of any [CatalogTax](#type-catalogtax) objects that apply to it.
|
75
|
+
# @param body An object containing the fields to POST for the request. See the corresponding object definition for field details.
|
76
|
+
# @param [Hash] opts the optional parameters
|
77
|
+
# @return [BatchRetrieveCatalogObjectsResponse]
|
78
|
+
def batch_retrieve_catalog_objects(body, opts = {})
|
79
|
+
data, _status_code, _headers = batch_retrieve_catalog_objects_with_http_info(body, opts)
|
80
|
+
return data
|
81
|
+
end
|
82
|
+
|
83
|
+
# BatchRetrieveCatalogObjects
|
84
|
+
# Returns a set of objects based on the provided ID. [CatalogItem](#type-catalogitem)s returned in the set include all of the child information including: all [CatalogItemVariation](#type-catalogitemvariation) objects, references to its [CatalogModifierList](#type-catalogmodifierlist) objects, and the ids of any [CatalogTax](#type-catalogtax) objects that apply to it.
|
85
|
+
# @param body An object containing the fields to POST for the request. See the corresponding object definition for field details.
|
86
|
+
# @param [Hash] opts the optional parameters
|
87
|
+
# @return [Array<(BatchRetrieveCatalogObjectsResponse, Fixnum, Hash)>] BatchRetrieveCatalogObjectsResponse data, response status code and response headers
|
88
|
+
def batch_retrieve_catalog_objects_with_http_info(body, opts = {})
|
89
|
+
if @api_client.config.debugging
|
90
|
+
@api_client.config.logger.debug "Calling API: CatalogApi.batch_retrieve_catalog_objects ..."
|
91
|
+
end
|
92
|
+
# verify the required parameter 'body' is set
|
93
|
+
fail ArgumentError, "Missing the required parameter 'body' when calling CatalogApi.batch_retrieve_catalog_objects" if body.nil?
|
94
|
+
# resource path
|
95
|
+
local_var_path = "/v2/catalog/batch-retrieve".sub('{format}','json')
|
96
|
+
|
97
|
+
# query parameters
|
98
|
+
query_params = {}
|
99
|
+
|
100
|
+
# header parameters
|
101
|
+
header_params = {}
|
102
|
+
# HTTP header 'Accept' (if needed)
|
103
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
104
|
+
# HTTP header 'Content-Type'
|
105
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
106
|
+
|
107
|
+
# form parameters
|
108
|
+
form_params = {}
|
109
|
+
|
110
|
+
# http body (model)
|
111
|
+
post_body = @api_client.object_to_http_body(body)
|
112
|
+
auth_names = ['oauth2']
|
113
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
114
|
+
:header_params => header_params,
|
115
|
+
:query_params => query_params,
|
116
|
+
:form_params => form_params,
|
117
|
+
:body => post_body,
|
118
|
+
:auth_names => auth_names,
|
119
|
+
:return_type => 'BatchRetrieveCatalogObjectsResponse')
|
120
|
+
if @api_client.config.debugging
|
121
|
+
@api_client.config.logger.debug "API called: CatalogApi#batch_retrieve_catalog_objects\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
122
|
+
end
|
123
|
+
return data, status_code, headers
|
124
|
+
end
|
125
|
+
|
126
|
+
# BatchUpsertCatalogObjects
|
127
|
+
# Creates or updates up to 10,000 target objects based on the provided list of objects. The target objects are grouped into batches and each batch is inserted/updated in an all-or-nothing manner. If an object within a batch is malformed in some way, or violates a database constraint, the entire batch containing that item will be disregarded. However, other batches in the same request may still succeed. Each batch may contain up to 1,000 objects, and batches will be processed in order as long as the total object count for the request (items, variations, modifier lists, discounts, and taxes) is no more than 10,000.
|
128
|
+
# @param body An object containing the fields to POST for the request. See the corresponding object definition for field details.
|
129
|
+
# @param [Hash] opts the optional parameters
|
130
|
+
# @return [BatchUpsertCatalogObjectsResponse]
|
131
|
+
def batch_upsert_catalog_objects(body, opts = {})
|
132
|
+
data, _status_code, _headers = batch_upsert_catalog_objects_with_http_info(body, opts)
|
133
|
+
return data
|
134
|
+
end
|
135
|
+
|
136
|
+
# BatchUpsertCatalogObjects
|
137
|
+
# Creates or updates up to 10,000 target objects based on the provided list of objects. The target objects are grouped into batches and each batch is inserted/updated in an all-or-nothing manner. If an object within a batch is malformed in some way, or violates a database constraint, the entire batch containing that item will be disregarded. However, other batches in the same request may still succeed. Each batch may contain up to 1,000 objects, and batches will be processed in order as long as the total object count for the request (items, variations, modifier lists, discounts, and taxes) is no more than 10,000.
|
138
|
+
# @param body An object containing the fields to POST for the request. See the corresponding object definition for field details.
|
139
|
+
# @param [Hash] opts the optional parameters
|
140
|
+
# @return [Array<(BatchUpsertCatalogObjectsResponse, Fixnum, Hash)>] BatchUpsertCatalogObjectsResponse data, response status code and response headers
|
141
|
+
def batch_upsert_catalog_objects_with_http_info(body, opts = {})
|
142
|
+
if @api_client.config.debugging
|
143
|
+
@api_client.config.logger.debug "Calling API: CatalogApi.batch_upsert_catalog_objects ..."
|
144
|
+
end
|
145
|
+
# verify the required parameter 'body' is set
|
146
|
+
fail ArgumentError, "Missing the required parameter 'body' when calling CatalogApi.batch_upsert_catalog_objects" if body.nil?
|
147
|
+
# resource path
|
148
|
+
local_var_path = "/v2/catalog/batch-upsert".sub('{format}','json')
|
149
|
+
|
150
|
+
# query parameters
|
151
|
+
query_params = {}
|
152
|
+
|
153
|
+
# header parameters
|
154
|
+
header_params = {}
|
155
|
+
# HTTP header 'Accept' (if needed)
|
156
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
157
|
+
# HTTP header 'Content-Type'
|
158
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
159
|
+
|
160
|
+
# form parameters
|
161
|
+
form_params = {}
|
162
|
+
|
163
|
+
# http body (model)
|
164
|
+
post_body = @api_client.object_to_http_body(body)
|
165
|
+
auth_names = ['oauth2']
|
166
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
167
|
+
:header_params => header_params,
|
168
|
+
:query_params => query_params,
|
169
|
+
:form_params => form_params,
|
170
|
+
:body => post_body,
|
171
|
+
:auth_names => auth_names,
|
172
|
+
:return_type => 'BatchUpsertCatalogObjectsResponse')
|
173
|
+
if @api_client.config.debugging
|
174
|
+
@api_client.config.logger.debug "API called: CatalogApi#batch_upsert_catalog_objects\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
175
|
+
end
|
176
|
+
return data, status_code, headers
|
177
|
+
end
|
178
|
+
|
179
|
+
# CatalogInfo
|
180
|
+
# Returns information about the Square Catalog API, such as batch size limits for `BatchUpsertCatalogObjects`.
|
181
|
+
# @param [Hash] opts the optional parameters
|
182
|
+
# @return [CatalogInfoResponse]
|
183
|
+
def catalog_info(opts = {})
|
184
|
+
data, _status_code, _headers = catalog_info_with_http_info(opts)
|
185
|
+
return data
|
186
|
+
end
|
187
|
+
|
188
|
+
# CatalogInfo
|
189
|
+
# Returns information about the Square Catalog API, such as batch size limits for `BatchUpsertCatalogObjects`.
|
190
|
+
# @param [Hash] opts the optional parameters
|
191
|
+
# @return [Array<(CatalogInfoResponse, Fixnum, Hash)>] CatalogInfoResponse data, response status code and response headers
|
192
|
+
def catalog_info_with_http_info(opts = {})
|
193
|
+
if @api_client.config.debugging
|
194
|
+
@api_client.config.logger.debug "Calling API: CatalogApi.catalog_info ..."
|
195
|
+
end
|
196
|
+
# resource path
|
197
|
+
local_var_path = "/v2/catalog/info".sub('{format}','json')
|
198
|
+
|
199
|
+
# query parameters
|
200
|
+
query_params = {}
|
201
|
+
|
202
|
+
# header parameters
|
203
|
+
header_params = {}
|
204
|
+
# HTTP header 'Accept' (if needed)
|
205
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
206
|
+
# HTTP header 'Content-Type'
|
207
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
208
|
+
|
209
|
+
# form parameters
|
210
|
+
form_params = {}
|
211
|
+
|
212
|
+
# http body (model)
|
213
|
+
post_body = nil
|
214
|
+
auth_names = ['oauth2']
|
215
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
216
|
+
:header_params => header_params,
|
217
|
+
:query_params => query_params,
|
218
|
+
:form_params => form_params,
|
219
|
+
:body => post_body,
|
220
|
+
:auth_names => auth_names,
|
221
|
+
:return_type => 'CatalogInfoResponse')
|
222
|
+
if @api_client.config.debugging
|
223
|
+
@api_client.config.logger.debug "API called: CatalogApi#catalog_info\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
224
|
+
end
|
225
|
+
return data, status_code, headers
|
226
|
+
end
|
227
|
+
|
228
|
+
# DeleteCatalogObject
|
229
|
+
# Deletes a single [CatalogObject](#type-catalogobject) based on the provided ID and returns the set of successfully deleted IDs in the response. Deletion is a cascading event such that all children of the targeted object are also deleted. For example, deleting a [CatalogItem](#type-catalogitem) will also delete all of its [CatalogItemVariation](#type-catalogitemvariation) children.
|
230
|
+
# @param object_id The ID of the [CatalogObject](#type-catalogobject) to be deleted. When an object is deleted, other objects in the graph that depend on that object will be deleted as well (for example, deleting a [CatalogItem](#type-catalogitem) will delete its [CatalogItemVariation](#type-catalogitemvariation)s).
|
231
|
+
# @param [Hash] opts the optional parameters
|
232
|
+
# @return [DeleteCatalogObjectResponse]
|
233
|
+
def delete_catalog_object(object_id, opts = {})
|
234
|
+
data, _status_code, _headers = delete_catalog_object_with_http_info(object_id, opts)
|
235
|
+
return data
|
236
|
+
end
|
237
|
+
|
238
|
+
# DeleteCatalogObject
|
239
|
+
# Deletes a single [CatalogObject](#type-catalogobject) based on the provided ID and returns the set of successfully deleted IDs in the response. Deletion is a cascading event such that all children of the targeted object are also deleted. For example, deleting a [CatalogItem](#type-catalogitem) will also delete all of its [CatalogItemVariation](#type-catalogitemvariation) children.
|
240
|
+
# @param object_id The ID of the [CatalogObject](#type-catalogobject) to be deleted. When an object is deleted, other objects in the graph that depend on that object will be deleted as well (for example, deleting a [CatalogItem](#type-catalogitem) will delete its [CatalogItemVariation](#type-catalogitemvariation)s).
|
241
|
+
# @param [Hash] opts the optional parameters
|
242
|
+
# @return [Array<(DeleteCatalogObjectResponse, Fixnum, Hash)>] DeleteCatalogObjectResponse data, response status code and response headers
|
243
|
+
def delete_catalog_object_with_http_info(object_id, opts = {})
|
244
|
+
if @api_client.config.debugging
|
245
|
+
@api_client.config.logger.debug "Calling API: CatalogApi.delete_catalog_object ..."
|
246
|
+
end
|
247
|
+
# verify the required parameter 'object_id' is set
|
248
|
+
fail ArgumentError, "Missing the required parameter 'object_id' when calling CatalogApi.delete_catalog_object" if object_id.nil?
|
249
|
+
# resource path
|
250
|
+
local_var_path = "/v2/catalog/object/{object_id}".sub('{format}','json').sub('{' + 'object_id' + '}', object_id.to_s)
|
251
|
+
|
252
|
+
# query parameters
|
253
|
+
query_params = {}
|
254
|
+
|
255
|
+
# header parameters
|
256
|
+
header_params = {}
|
257
|
+
# HTTP header 'Accept' (if needed)
|
258
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
259
|
+
# HTTP header 'Content-Type'
|
260
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
261
|
+
|
262
|
+
# form parameters
|
263
|
+
form_params = {}
|
264
|
+
|
265
|
+
# http body (model)
|
266
|
+
post_body = nil
|
267
|
+
auth_names = ['oauth2']
|
268
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
|
269
|
+
:header_params => header_params,
|
270
|
+
:query_params => query_params,
|
271
|
+
:form_params => form_params,
|
272
|
+
:body => post_body,
|
273
|
+
:auth_names => auth_names,
|
274
|
+
:return_type => 'DeleteCatalogObjectResponse')
|
275
|
+
if @api_client.config.debugging
|
276
|
+
@api_client.config.logger.debug "API called: CatalogApi#delete_catalog_object\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
277
|
+
end
|
278
|
+
return data, status_code, headers
|
279
|
+
end
|
280
|
+
|
281
|
+
# ListCatalog
|
282
|
+
# Returns a list of [CatalogObject](#type-catalogobject)s that includes all objects of a set of desired types (for example, all [CatalogItem](#type-catalogitem) and [CatalogTax](#type-catalogtax) objects) in the catalog. The types parameter is specified as a comma-separated list of valid [CatalogObject](#type-catalogobject) types: `ITEM`, `ITEM_VARIATION`, `MODIFIER`, `MODIFIER_LIST`, `CATEGORY`, `DISCOUNT`, `TAX`.
|
283
|
+
# @param [Hash] opts the optional parameters
|
284
|
+
# @option opts [String] :cursor The pagination cursor returned in the previous response. Leave unset for an initial request. See [Paginating results](#paginatingresults) for more information.
|
285
|
+
# @option opts [String] :types An optional case-insensitive, comma-separated list of object types to retrieve, for example `ITEM,ITEM_VARIATION,CATEGORY`. The legal values are taken from the [CatalogObjectType](#type-catalogobjecttype) enumeration, namely `\"ITEM\"`, `\"ITEM_VARIATION\"`, `\"CATEGORY\"`, `\"DISCOUNT\"`, `\"TAX\"`, `\"MODIFIER\"`, or `\"MODIFIER_LIST\"`.
|
286
|
+
# @return [ListCatalogResponse]
|
287
|
+
def list_catalog(opts = {})
|
288
|
+
data, _status_code, _headers = list_catalog_with_http_info(opts)
|
289
|
+
return data
|
290
|
+
end
|
291
|
+
|
292
|
+
# ListCatalog
|
293
|
+
# Returns a list of [CatalogObject](#type-catalogobject)s that includes all objects of a set of desired types (for example, all [CatalogItem](#type-catalogitem) and [CatalogTax](#type-catalogtax) objects) in the catalog. The types parameter is specified as a comma-separated list of valid [CatalogObject](#type-catalogobject) types: `ITEM`, `ITEM_VARIATION`, `MODIFIER`, `MODIFIER_LIST`, `CATEGORY`, `DISCOUNT`, `TAX`.
|
294
|
+
# @param [Hash] opts the optional parameters
|
295
|
+
# @option opts [String] :cursor The pagination cursor returned in the previous response. Leave unset for an initial request. See [Paginating results](#paginatingresults) for more information.
|
296
|
+
# @option opts [String] :types An optional case-insensitive, comma-separated list of object types to retrieve, for example `ITEM,ITEM_VARIATION,CATEGORY`. The legal values are taken from the [CatalogObjectType](#type-catalogobjecttype) enumeration, namely `\"ITEM\"`, `\"ITEM_VARIATION\"`, `\"CATEGORY\"`, `\"DISCOUNT\"`, `\"TAX\"`, `\"MODIFIER\"`, or `\"MODIFIER_LIST\"`.
|
297
|
+
# @return [Array<(ListCatalogResponse, Fixnum, Hash)>] ListCatalogResponse data, response status code and response headers
|
298
|
+
def list_catalog_with_http_info(opts = {})
|
299
|
+
if @api_client.config.debugging
|
300
|
+
@api_client.config.logger.debug "Calling API: CatalogApi.list_catalog ..."
|
301
|
+
end
|
302
|
+
# resource path
|
303
|
+
local_var_path = "/v2/catalog/list".sub('{format}','json')
|
304
|
+
|
305
|
+
# query parameters
|
306
|
+
query_params = {}
|
307
|
+
query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
|
308
|
+
query_params[:'types'] = opts[:'types'] if !opts[:'types'].nil?
|
309
|
+
|
310
|
+
# header parameters
|
311
|
+
header_params = {}
|
312
|
+
# HTTP header 'Accept' (if needed)
|
313
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
314
|
+
# HTTP header 'Content-Type'
|
315
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
316
|
+
|
317
|
+
# form parameters
|
318
|
+
form_params = {}
|
319
|
+
|
320
|
+
# http body (model)
|
321
|
+
post_body = nil
|
322
|
+
auth_names = ['oauth2']
|
323
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
324
|
+
:header_params => header_params,
|
325
|
+
:query_params => query_params,
|
326
|
+
:form_params => form_params,
|
327
|
+
:body => post_body,
|
328
|
+
:auth_names => auth_names,
|
329
|
+
:return_type => 'ListCatalogResponse')
|
330
|
+
if @api_client.config.debugging
|
331
|
+
@api_client.config.logger.debug "API called: CatalogApi#list_catalog\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
332
|
+
end
|
333
|
+
return data, status_code, headers
|
334
|
+
end
|
335
|
+
|
336
|
+
# RetrieveCatalogObject
|
337
|
+
# Returns a single [CatalogItem](#type-catalogitem) as a [CatalogObject](#type-catalogobject) based on the provided ID. The returned object includes all of the relevant [CatalogItem](#type-catalogitem) information including: [CatalogItemVariation](#type-catalogitemvariation) children, references to its [CatalogModifierList](#type-catalogmodifierlist) objects, and the ids of any [CatalogTax](#type-catalogtax) objects that apply to it.
|
338
|
+
# @param object_id The object ID of any type of [CatalogObject](#type-catalogobject)s to be retrieved.
|
339
|
+
# @param [Hash] opts the optional parameters
|
340
|
+
# @option opts [BOOLEAN] :include_related_objects If `true`, the response will include additional objects that are related to the requested object, as follows: If the `object` field of the response contains a [CatalogItem](#type-catalogitem), its associated [CatalogCategory](#type-catalogcategory), [CatalogTax](#type-catalogtax)es, and [CatalogModifierList](#type-catalogmodifierlist)s will be returned in the `related_objects` field of the response. If the `object` field of the response contains a [CatalogItemVariation](#type-catalogitemvariation), its parent [CatalogItem](#type-catalogitem) will be returned in the `related_objects` field of the response.
|
341
|
+
# @return [RetrieveCatalogObjectResponse]
|
342
|
+
def retrieve_catalog_object(object_id, opts = {})
|
343
|
+
data, _status_code, _headers = retrieve_catalog_object_with_http_info(object_id, opts)
|
344
|
+
return data
|
345
|
+
end
|
346
|
+
|
347
|
+
# RetrieveCatalogObject
|
348
|
+
# Returns a single [CatalogItem](#type-catalogitem) as a [CatalogObject](#type-catalogobject) based on the provided ID. The returned object includes all of the relevant [CatalogItem](#type-catalogitem) information including: [CatalogItemVariation](#type-catalogitemvariation) children, references to its [CatalogModifierList](#type-catalogmodifierlist) objects, and the ids of any [CatalogTax](#type-catalogtax) objects that apply to it.
|
349
|
+
# @param object_id The object ID of any type of [CatalogObject](#type-catalogobject)s to be retrieved.
|
350
|
+
# @param [Hash] opts the optional parameters
|
351
|
+
# @option opts [BOOLEAN] :include_related_objects If `true`, the response will include additional objects that are related to the requested object, as follows: If the `object` field of the response contains a [CatalogItem](#type-catalogitem), its associated [CatalogCategory](#type-catalogcategory), [CatalogTax](#type-catalogtax)es, and [CatalogModifierList](#type-catalogmodifierlist)s will be returned in the `related_objects` field of the response. If the `object` field of the response contains a [CatalogItemVariation](#type-catalogitemvariation), its parent [CatalogItem](#type-catalogitem) will be returned in the `related_objects` field of the response.
|
352
|
+
# @return [Array<(RetrieveCatalogObjectResponse, Fixnum, Hash)>] RetrieveCatalogObjectResponse data, response status code and response headers
|
353
|
+
def retrieve_catalog_object_with_http_info(object_id, opts = {})
|
354
|
+
if @api_client.config.debugging
|
355
|
+
@api_client.config.logger.debug "Calling API: CatalogApi.retrieve_catalog_object ..."
|
356
|
+
end
|
357
|
+
# verify the required parameter 'object_id' is set
|
358
|
+
fail ArgumentError, "Missing the required parameter 'object_id' when calling CatalogApi.retrieve_catalog_object" if object_id.nil?
|
359
|
+
# resource path
|
360
|
+
local_var_path = "/v2/catalog/object/{object_id}".sub('{format}','json').sub('{' + 'object_id' + '}', object_id.to_s)
|
361
|
+
|
362
|
+
# query parameters
|
363
|
+
query_params = {}
|
364
|
+
query_params[:'include_related_objects'] = opts[:'include_related_objects'] if !opts[:'include_related_objects'].nil?
|
365
|
+
|
366
|
+
# header parameters
|
367
|
+
header_params = {}
|
368
|
+
# HTTP header 'Accept' (if needed)
|
369
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
370
|
+
# HTTP header 'Content-Type'
|
371
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
372
|
+
|
373
|
+
# form parameters
|
374
|
+
form_params = {}
|
375
|
+
|
376
|
+
# http body (model)
|
377
|
+
post_body = nil
|
378
|
+
auth_names = ['oauth2']
|
379
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
380
|
+
:header_params => header_params,
|
381
|
+
:query_params => query_params,
|
382
|
+
:form_params => form_params,
|
383
|
+
:body => post_body,
|
384
|
+
:auth_names => auth_names,
|
385
|
+
:return_type => 'RetrieveCatalogObjectResponse')
|
386
|
+
if @api_client.config.debugging
|
387
|
+
@api_client.config.logger.debug "API called: CatalogApi#retrieve_catalog_object\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
388
|
+
end
|
389
|
+
return data, status_code, headers
|
390
|
+
end
|
391
|
+
|
392
|
+
# SearchCatalogObjects
|
393
|
+
# Queries the targeted catalog using a variety of query types ([CatalogQuerySortedAttribute](#type-catalogquerysortedattribute), ([CatalogQueryExact](#type-catalogqueryexact, ([CatalogQueryRange](#type-catalogqueryrange), ([CatalogQueryText](#type-catalogquerytext), ([CatalogQueryItemsForTax](#type-catalogqueryitemsfortax), ([CatalogQueryItemsForModifierList](#type-catalogqueryitemsformodifierlist)).
|
394
|
+
# @param body An object containing the fields to POST for the request. See the corresponding object definition for field details.
|
395
|
+
# @param [Hash] opts the optional parameters
|
396
|
+
# @return [SearchCatalogObjectsResponse]
|
397
|
+
def search_catalog_objects(body, opts = {})
|
398
|
+
data, _status_code, _headers = search_catalog_objects_with_http_info(body, opts)
|
399
|
+
return data
|
400
|
+
end
|
401
|
+
|
402
|
+
# SearchCatalogObjects
|
403
|
+
# Queries the targeted catalog using a variety of query types ([CatalogQuerySortedAttribute](#type-catalogquerysortedattribute), ([CatalogQueryExact](#type-catalogqueryexact, ([CatalogQueryRange](#type-catalogqueryrange), ([CatalogQueryText](#type-catalogquerytext), ([CatalogQueryItemsForTax](#type-catalogqueryitemsfortax), ([CatalogQueryItemsForModifierList](#type-catalogqueryitemsformodifierlist)).
|
404
|
+
# @param body An object containing the fields to POST for the request. See the corresponding object definition for field details.
|
405
|
+
# @param [Hash] opts the optional parameters
|
406
|
+
# @return [Array<(SearchCatalogObjectsResponse, Fixnum, Hash)>] SearchCatalogObjectsResponse data, response status code and response headers
|
407
|
+
def search_catalog_objects_with_http_info(body, opts = {})
|
408
|
+
if @api_client.config.debugging
|
409
|
+
@api_client.config.logger.debug "Calling API: CatalogApi.search_catalog_objects ..."
|
410
|
+
end
|
411
|
+
# verify the required parameter 'body' is set
|
412
|
+
fail ArgumentError, "Missing the required parameter 'body' when calling CatalogApi.search_catalog_objects" if body.nil?
|
413
|
+
# resource path
|
414
|
+
local_var_path = "/v2/catalog/search".sub('{format}','json')
|
415
|
+
|
416
|
+
# query parameters
|
417
|
+
query_params = {}
|
418
|
+
|
419
|
+
# header parameters
|
420
|
+
header_params = {}
|
421
|
+
# HTTP header 'Accept' (if needed)
|
422
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
423
|
+
# HTTP header 'Content-Type'
|
424
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
425
|
+
|
426
|
+
# form parameters
|
427
|
+
form_params = {}
|
428
|
+
|
429
|
+
# http body (model)
|
430
|
+
post_body = @api_client.object_to_http_body(body)
|
431
|
+
auth_names = ['oauth2']
|
432
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
433
|
+
:header_params => header_params,
|
434
|
+
:query_params => query_params,
|
435
|
+
:form_params => form_params,
|
436
|
+
:body => post_body,
|
437
|
+
:auth_names => auth_names,
|
438
|
+
:return_type => 'SearchCatalogObjectsResponse')
|
439
|
+
if @api_client.config.debugging
|
440
|
+
@api_client.config.logger.debug "API called: CatalogApi#search_catalog_objects\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
441
|
+
end
|
442
|
+
return data, status_code, headers
|
443
|
+
end
|
444
|
+
|
445
|
+
# UpdateItemModifierLists
|
446
|
+
# Updates the [CatalogModifierList](#type-catalogmodifierlist) objects that apply to the targeted [CatalogItem](#type-catalogitem) without having to perform an upsert on the entire item.
|
447
|
+
# @param body An object containing the fields to POST for the request. See the corresponding object definition for field details.
|
448
|
+
# @param [Hash] opts the optional parameters
|
449
|
+
# @return [UpdateItemModifierListsResponse]
|
450
|
+
def update_item_modifier_lists(body, opts = {})
|
451
|
+
data, _status_code, _headers = update_item_modifier_lists_with_http_info(body, opts)
|
452
|
+
return data
|
453
|
+
end
|
454
|
+
|
455
|
+
# UpdateItemModifierLists
|
456
|
+
# Updates the [CatalogModifierList](#type-catalogmodifierlist) objects that apply to the targeted [CatalogItem](#type-catalogitem) without having to perform an upsert on the entire item.
|
457
|
+
# @param body An object containing the fields to POST for the request. See the corresponding object definition for field details.
|
458
|
+
# @param [Hash] opts the optional parameters
|
459
|
+
# @return [Array<(UpdateItemModifierListsResponse, Fixnum, Hash)>] UpdateItemModifierListsResponse data, response status code and response headers
|
460
|
+
def update_item_modifier_lists_with_http_info(body, opts = {})
|
461
|
+
if @api_client.config.debugging
|
462
|
+
@api_client.config.logger.debug "Calling API: CatalogApi.update_item_modifier_lists ..."
|
463
|
+
end
|
464
|
+
# verify the required parameter 'body' is set
|
465
|
+
fail ArgumentError, "Missing the required parameter 'body' when calling CatalogApi.update_item_modifier_lists" if body.nil?
|
466
|
+
# resource path
|
467
|
+
local_var_path = "/v2/catalog/update-item-modifier-lists".sub('{format}','json')
|
468
|
+
|
469
|
+
# query parameters
|
470
|
+
query_params = {}
|
471
|
+
|
472
|
+
# header parameters
|
473
|
+
header_params = {}
|
474
|
+
# HTTP header 'Accept' (if needed)
|
475
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
476
|
+
# HTTP header 'Content-Type'
|
477
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
478
|
+
|
479
|
+
# form parameters
|
480
|
+
form_params = {}
|
481
|
+
|
482
|
+
# http body (model)
|
483
|
+
post_body = @api_client.object_to_http_body(body)
|
484
|
+
auth_names = ['oauth2']
|
485
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
486
|
+
:header_params => header_params,
|
487
|
+
:query_params => query_params,
|
488
|
+
:form_params => form_params,
|
489
|
+
:body => post_body,
|
490
|
+
:auth_names => auth_names,
|
491
|
+
:return_type => 'UpdateItemModifierListsResponse')
|
492
|
+
if @api_client.config.debugging
|
493
|
+
@api_client.config.logger.debug "API called: CatalogApi#update_item_modifier_lists\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
494
|
+
end
|
495
|
+
return data, status_code, headers
|
496
|
+
end
|
497
|
+
|
498
|
+
# UpdateItemTaxes
|
499
|
+
# Updates the [CatalogTax](#type-catalogtax) objects that apply to the targeted [CatalogItem](#type-catalogitem) without having to perform an upsert on the entire item.
|
500
|
+
# @param body An object containing the fields to POST for the request. See the corresponding object definition for field details.
|
501
|
+
# @param [Hash] opts the optional parameters
|
502
|
+
# @return [UpdateItemTaxesResponse]
|
503
|
+
def update_item_taxes(body, opts = {})
|
504
|
+
data, _status_code, _headers = update_item_taxes_with_http_info(body, opts)
|
505
|
+
return data
|
506
|
+
end
|
507
|
+
|
508
|
+
# UpdateItemTaxes
|
509
|
+
# Updates the [CatalogTax](#type-catalogtax) objects that apply to the targeted [CatalogItem](#type-catalogitem) without having to perform an upsert on the entire item.
|
510
|
+
# @param body An object containing the fields to POST for the request. See the corresponding object definition for field details.
|
511
|
+
# @param [Hash] opts the optional parameters
|
512
|
+
# @return [Array<(UpdateItemTaxesResponse, Fixnum, Hash)>] UpdateItemTaxesResponse data, response status code and response headers
|
513
|
+
def update_item_taxes_with_http_info(body, opts = {})
|
514
|
+
if @api_client.config.debugging
|
515
|
+
@api_client.config.logger.debug "Calling API: CatalogApi.update_item_taxes ..."
|
516
|
+
end
|
517
|
+
# verify the required parameter 'body' is set
|
518
|
+
fail ArgumentError, "Missing the required parameter 'body' when calling CatalogApi.update_item_taxes" if body.nil?
|
519
|
+
# resource path
|
520
|
+
local_var_path = "/v2/catalog/update-item-taxes".sub('{format}','json')
|
521
|
+
|
522
|
+
# query parameters
|
523
|
+
query_params = {}
|
524
|
+
|
525
|
+
# header parameters
|
526
|
+
header_params = {}
|
527
|
+
# HTTP header 'Accept' (if needed)
|
528
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
529
|
+
# HTTP header 'Content-Type'
|
530
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
531
|
+
|
532
|
+
# form parameters
|
533
|
+
form_params = {}
|
534
|
+
|
535
|
+
# http body (model)
|
536
|
+
post_body = @api_client.object_to_http_body(body)
|
537
|
+
auth_names = ['oauth2']
|
538
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
539
|
+
:header_params => header_params,
|
540
|
+
:query_params => query_params,
|
541
|
+
:form_params => form_params,
|
542
|
+
:body => post_body,
|
543
|
+
:auth_names => auth_names,
|
544
|
+
:return_type => 'UpdateItemTaxesResponse')
|
545
|
+
if @api_client.config.debugging
|
546
|
+
@api_client.config.logger.debug "API called: CatalogApi#update_item_taxes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
547
|
+
end
|
548
|
+
return data, status_code, headers
|
549
|
+
end
|
550
|
+
|
551
|
+
# UpsertCatalogObject
|
552
|
+
# Creates or updates the target [CatalogObject](#type-catalogobject).
|
553
|
+
# @param body An object containing the fields to POST for the request. See the corresponding object definition for field details.
|
554
|
+
# @param [Hash] opts the optional parameters
|
555
|
+
# @return [UpsertCatalogObjectResponse]
|
556
|
+
def upsert_catalog_object(body, opts = {})
|
557
|
+
data, _status_code, _headers = upsert_catalog_object_with_http_info(body, opts)
|
558
|
+
return data
|
559
|
+
end
|
560
|
+
|
561
|
+
# UpsertCatalogObject
|
562
|
+
# Creates or updates the target [CatalogObject](#type-catalogobject).
|
563
|
+
# @param body An object containing the fields to POST for the request. See the corresponding object definition for field details.
|
564
|
+
# @param [Hash] opts the optional parameters
|
565
|
+
# @return [Array<(UpsertCatalogObjectResponse, Fixnum, Hash)>] UpsertCatalogObjectResponse data, response status code and response headers
|
566
|
+
def upsert_catalog_object_with_http_info(body, opts = {})
|
567
|
+
if @api_client.config.debugging
|
568
|
+
@api_client.config.logger.debug "Calling API: CatalogApi.upsert_catalog_object ..."
|
569
|
+
end
|
570
|
+
# verify the required parameter 'body' is set
|
571
|
+
fail ArgumentError, "Missing the required parameter 'body' when calling CatalogApi.upsert_catalog_object" if body.nil?
|
572
|
+
# resource path
|
573
|
+
local_var_path = "/v2/catalog/object".sub('{format}','json')
|
574
|
+
|
575
|
+
# query parameters
|
576
|
+
query_params = {}
|
577
|
+
|
578
|
+
# header parameters
|
579
|
+
header_params = {}
|
580
|
+
# HTTP header 'Accept' (if needed)
|
581
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
582
|
+
# HTTP header 'Content-Type'
|
583
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
584
|
+
|
585
|
+
# form parameters
|
586
|
+
form_params = {}
|
587
|
+
|
588
|
+
# http body (model)
|
589
|
+
post_body = @api_client.object_to_http_body(body)
|
590
|
+
auth_names = ['oauth2']
|
591
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
592
|
+
:header_params => header_params,
|
593
|
+
:query_params => query_params,
|
594
|
+
:form_params => form_params,
|
595
|
+
:body => post_body,
|
596
|
+
:auth_names => auth_names,
|
597
|
+
:return_type => 'UpsertCatalogObjectResponse')
|
598
|
+
if @api_client.config.debugging
|
599
|
+
@api_client.config.logger.debug "API called: CatalogApi#upsert_catalog_object\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
600
|
+
end
|
601
|
+
return data, status_code, headers
|
602
|
+
end
|
603
|
+
end
|
604
|
+
end
|