square_connect 2.1.0.beta → 2.1.0.78

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.
Files changed (188) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +71 -8
  3. data/docs/BatchDeleteCatalogObjectsRequest.md +12 -0
  4. data/docs/BatchDeleteCatalogObjectsResponse.md +14 -0
  5. data/docs/BatchRetrieveCatalogObjectsRequest.md +13 -0
  6. data/docs/BatchRetrieveCatalogObjectsResponse.md +14 -0
  7. data/docs/BatchUpsertCatalogObjectsRequest.md +13 -0
  8. data/docs/BatchUpsertCatalogObjectsResponse.md +15 -0
  9. data/docs/CatalogApi.md +592 -0
  10. data/docs/CatalogCategory.md +12 -0
  11. data/docs/CatalogDiscount.md +17 -0
  12. data/docs/CatalogDiscountType.md +15 -0
  13. data/docs/CatalogIdMapping.md +13 -0
  14. data/docs/CatalogInfoRequest.md +11 -0
  15. data/docs/CatalogInfoResponse.md +13 -0
  16. data/docs/CatalogInfoResponseLimits.md +22 -0
  17. data/docs/CatalogItem.md +25 -0
  18. data/docs/CatalogItemModifierListInfo.md +16 -0
  19. data/docs/CatalogItemProductType.md +16 -0
  20. data/docs/CatalogItemVariation.md +23 -0
  21. data/docs/CatalogModifier.md +13 -0
  22. data/docs/CatalogModifierList.md +14 -0
  23. data/docs/CatalogModifierListSelectionType.md +13 -0
  24. data/docs/CatalogModifierOverride.md +13 -0
  25. data/docs/CatalogObject.md +27 -0
  26. data/docs/CatalogObjectBatch.md +12 -0
  27. data/docs/CatalogObjectType.md +18 -0
  28. data/docs/CatalogPricingType.md +13 -0
  29. data/docs/CatalogQuery.md +18 -0
  30. data/docs/CatalogQueryExact.md +13 -0
  31. data/docs/CatalogQueryItemsForModifierList.md +12 -0
  32. data/docs/CatalogQueryItemsForTax.md +12 -0
  33. data/docs/CatalogQueryPrefix.md +13 -0
  34. data/docs/CatalogQueryRange.md +14 -0
  35. data/docs/CatalogQuerySortedAttribute.md +14 -0
  36. data/docs/CatalogQueryText.md +12 -0
  37. data/docs/CatalogTax.md +17 -0
  38. data/docs/CatalogV1Id.md +13 -0
  39. data/docs/Checkout.md +4 -4
  40. data/docs/CreateCheckoutRequest.md +5 -5
  41. data/docs/DeleteCatalogObjectRequest.md +11 -0
  42. data/docs/DeleteCatalogObjectResponse.md +14 -0
  43. data/docs/ErrorCode.md +2 -0
  44. data/docs/InventoryAlertType.md +13 -0
  45. data/docs/ItemVariationLocationOverrides.md +17 -0
  46. data/docs/ListCatalogRequest.md +13 -0
  47. data/docs/ListCatalogResponse.md +14 -0
  48. data/docs/RetrieveCatalogObjectRequest.md +12 -0
  49. data/docs/RetrieveCatalogObjectResponse.md +14 -0
  50. data/docs/SearchCatalogObjectsRequest.md +18 -0
  51. data/docs/SearchCatalogObjectsResponse.md +15 -0
  52. data/docs/TaxCalculationPhase.md +13 -0
  53. data/docs/TaxInclusionType.md +13 -0
  54. data/docs/UpdateItemModifierListsRequest.md +14 -0
  55. data/docs/UpdateItemModifierListsResponse.md +13 -0
  56. data/docs/UpdateItemTaxesRequest.md +14 -0
  57. data/docs/UpdateItemTaxesResponse.md +13 -0
  58. data/docs/UpsertCatalogObjectRequest.md +13 -0
  59. data/docs/UpsertCatalogObjectResponse.md +14 -0
  60. data/docs/V1Item.md +1 -1
  61. data/docs/V1Variation.md +0 -1
  62. data/lib/square_connect.rb +54 -1
  63. data/lib/square_connect/api/catalog_api.rb +604 -0
  64. data/lib/square_connect/models/batch_delete_catalog_objects_request.rb +188 -0
  65. data/lib/square_connect/models/batch_delete_catalog_objects_response.rb +210 -0
  66. data/lib/square_connect/models/batch_retrieve_catalog_objects_request.rb +203 -0
  67. data/lib/square_connect/models/batch_retrieve_catalog_objects_response.rb +212 -0
  68. data/lib/square_connect/models/batch_upsert_catalog_objects_request.rb +222 -0
  69. data/lib/square_connect/models/batch_upsert_catalog_objects_response.rb +222 -0
  70. data/lib/square_connect/models/catalog_category.rb +210 -0
  71. data/lib/square_connect/models/catalog_discount.rb +293 -0
  72. data/lib/square_connect/models/catalog_discount_type.rb +21 -0
  73. data/lib/square_connect/models/catalog_id_mapping.rb +196 -0
  74. data/lib/square_connect/models/catalog_info_request.rb +176 -0
  75. data/lib/square_connect/models/catalog_info_response.rb +198 -0
  76. data/lib/square_connect/models/catalog_info_response_limits.rb +286 -0
  77. data/lib/square_connect/models/catalog_item.rb +379 -0
  78. data/lib/square_connect/models/catalog_item_modifier_list_info.rb +252 -0
  79. data/lib/square_connect/models/catalog_item_product_type.rb +22 -0
  80. data/lib/square_connect/models/catalog_item_variation.rb +343 -0
  81. data/lib/square_connect/models/catalog_modifier.rb +220 -0
  82. data/lib/square_connect/models/catalog_modifier_list.rb +265 -0
  83. data/lib/square_connect/models/catalog_modifier_list_selection_type.rb +19 -0
  84. data/lib/square_connect/models/catalog_modifier_override.rb +220 -0
  85. data/lib/square_connect/models/catalog_object.rb +404 -0
  86. data/lib/square_connect/models/catalog_object_batch.rb +188 -0
  87. data/lib/square_connect/models/catalog_object_type.rb +24 -0
  88. data/lib/square_connect/models/catalog_pricing_type.rb +19 -0
  89. data/lib/square_connect/models/catalog_query.rb +246 -0
  90. data/lib/square_connect/models/catalog_query_exact.rb +225 -0
  91. data/lib/square_connect/models/catalog_query_items_for_modifier_list.rb +193 -0
  92. data/lib/square_connect/models/catalog_query_items_for_tax.rb +193 -0
  93. data/lib/square_connect/models/catalog_query_prefix.rb +244 -0
  94. data/lib/square_connect/models/catalog_query_range.rb +230 -0
  95. data/lib/square_connect/models/catalog_query_sorted_attribute.rb +263 -0
  96. data/lib/square_connect/models/catalog_query_text.rb +193 -0
  97. data/lib/square_connect/models/catalog_tax.rb +305 -0
  98. data/lib/square_connect/models/catalog_v1_id.rb +196 -0
  99. data/lib/square_connect/models/checkout.rb +4 -4
  100. data/lib/square_connect/models/create_checkout_request.rb +5 -5
  101. data/lib/square_connect/models/delete_catalog_object_request.rb +176 -0
  102. data/lib/square_connect/models/delete_catalog_object_response.rb +210 -0
  103. data/lib/square_connect/models/error.rb +2 -2
  104. data/lib/square_connect/models/error_code.rb +2 -0
  105. data/lib/square_connect/models/inventory_alert_type.rb +19 -0
  106. data/lib/square_connect/models/item_variation_location_overrides.rb +281 -0
  107. data/lib/square_connect/models/list_catalog_request.rb +196 -0
  108. data/lib/square_connect/models/list_catalog_response.rb +210 -0
  109. data/lib/square_connect/models/retrieve_catalog_object_request.rb +186 -0
  110. data/lib/square_connect/models/retrieve_catalog_object_response.rb +210 -0
  111. data/lib/square_connect/models/search_catalog_objects_request.rb +269 -0
  112. data/lib/square_connect/models/search_catalog_objects_response.rb +222 -0
  113. data/lib/square_connect/models/tax_calculation_phase.rb +19 -0
  114. data/lib/square_connect/models/tax_inclusion_type.rb +19 -0
  115. data/lib/square_connect/models/update_item_modifier_lists_request.rb +217 -0
  116. data/lib/square_connect/models/update_item_modifier_lists_response.rb +198 -0
  117. data/lib/square_connect/models/update_item_taxes_request.rb +217 -0
  118. data/lib/square_connect/models/update_item_taxes_response.rb +198 -0
  119. data/lib/square_connect/models/{create_order_request.rb → upsert_catalog_object_request.rb} +14 -23
  120. data/lib/square_connect/models/upsert_catalog_object_response.rb +210 -0
  121. data/lib/square_connect/models/v1_item.rb +1 -1
  122. data/lib/square_connect/models/v1_variation.rb +1 -11
  123. data/lib/square_connect/version.rb +1 -1
  124. data/spec/api/catalog_api_spec.rb +611 -0
  125. data/spec/models/batch_delete_catalog_objects_request_spec.rb +39 -0
  126. data/spec/models/batch_delete_catalog_objects_response_spec.rb +51 -0
  127. data/spec/models/batch_retrieve_catalog_objects_request_spec.rb +45 -0
  128. data/spec/models/batch_retrieve_catalog_objects_response_spec.rb +51 -0
  129. data/spec/models/batch_upsert_catalog_objects_request_spec.rb +45 -0
  130. data/spec/models/batch_upsert_catalog_objects_response_spec.rb +57 -0
  131. data/spec/models/catalog_category_spec.rb +39 -0
  132. data/spec/models/catalog_discount_spec.rb +73 -0
  133. data/spec/models/catalog_discount_type_spec.rb +33 -0
  134. data/spec/models/catalog_id_mapping_spec.rb +45 -0
  135. data/spec/models/catalog_info_request_spec.rb +33 -0
  136. data/spec/models/catalog_info_response_limits_spec.rb +99 -0
  137. data/spec/models/catalog_info_response_spec.rb +45 -0
  138. data/spec/models/catalog_item_modifier_list_info_spec.rb +63 -0
  139. data/spec/models/catalog_item_product_type_spec.rb +33 -0
  140. data/spec/models/catalog_item_spec.rb +121 -0
  141. data/spec/models/catalog_item_variation_spec.rb +113 -0
  142. data/spec/models/catalog_modifier_list_selection_type_spec.rb +33 -0
  143. data/spec/models/catalog_modifier_list_spec.rb +55 -0
  144. data/spec/models/catalog_modifier_override_spec.rb +45 -0
  145. data/spec/models/catalog_modifier_spec.rb +45 -0
  146. data/spec/models/catalog_object_batch_spec.rb +39 -0
  147. data/spec/models/catalog_object_spec.rb +133 -0
  148. data/spec/models/catalog_object_type_spec.rb +33 -0
  149. data/spec/models/catalog_pricing_type_spec.rb +33 -0
  150. data/spec/models/catalog_query_exact_spec.rb +45 -0
  151. data/spec/models/catalog_query_items_for_modifier_list_spec.rb +39 -0
  152. data/spec/models/catalog_query_items_for_tax_spec.rb +39 -0
  153. data/spec/models/catalog_query_prefix_spec.rb +45 -0
  154. data/spec/models/catalog_query_range_spec.rb +51 -0
  155. data/spec/models/catalog_query_sorted_attribute_spec.rb +55 -0
  156. data/spec/models/catalog_query_spec.rb +75 -0
  157. data/spec/models/catalog_query_text_spec.rb +39 -0
  158. data/spec/models/catalog_tax_spec.rb +77 -0
  159. data/spec/models/catalog_v1_id_spec.rb +45 -0
  160. data/spec/models/delete_catalog_object_request_spec.rb +39 -0
  161. data/spec/models/delete_catalog_object_response_spec.rb +51 -0
  162. data/spec/models/inventory_alert_type_spec.rb +33 -0
  163. data/spec/models/item_variation_location_overrides_spec.rb +77 -0
  164. data/spec/models/list_catalog_request_spec.rb +45 -0
  165. data/spec/models/list_catalog_response_spec.rb +51 -0
  166. data/spec/models/retrieve_catalog_object_request_spec.rb +45 -0
  167. data/spec/models/retrieve_catalog_object_response_spec.rb +51 -0
  168. data/spec/models/search_catalog_objects_request_spec.rb +79 -0
  169. data/spec/models/search_catalog_objects_response_spec.rb +57 -0
  170. data/spec/models/tax_calculation_phase_spec.rb +33 -0
  171. data/spec/models/tax_inclusion_type_spec.rb +33 -0
  172. data/spec/models/update_item_modifier_lists_request_spec.rb +51 -0
  173. data/spec/models/update_item_modifier_lists_response_spec.rb +45 -0
  174. data/spec/models/update_item_taxes_request_spec.rb +51 -0
  175. data/spec/models/update_item_taxes_response_spec.rb +45 -0
  176. data/spec/models/{create_order_request_spec.rb → upsert_catalog_object_request_spec.rb} +7 -7
  177. data/spec/models/upsert_catalog_object_response_spec.rb +51 -0
  178. data/square_connect.gemspec +1 -1
  179. data/travis-ci/accounts.enc +0 -0
  180. metadata +222 -17
  181. data/docs/CreateOrderRequest.md +0 -13
  182. data/docs/V1LocationApi.md +0 -102
  183. data/lib/.DS_Store +0 -0
  184. data/lib/square_connect/.DS_Store +0 -0
  185. data/spec/.DS_Store +0 -0
  186. data/square_connect-2.0.2.gem +0 -0
  187. data/square_connect-2.1.0.gem +0 -0
  188. data/square_connect-2.1.0beta.gem +0 -0
@@ -0,0 +1,210 @@
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 'date'
11
+
12
+ module SquareConnect
13
+ #
14
+ class UpsertCatalogObjectResponse
15
+ # The set of [Error](#type-error)s encountered.
16
+ attr_accessor :errors
17
+
18
+ # The created [CatalogObject](#type-catalogobject).
19
+ attr_accessor :catalog_object
20
+
21
+ # The mapping between client and server IDs for this Upsert.
22
+ attr_accessor :id_mappings
23
+
24
+
25
+ # Attribute mapping from ruby-style variable name to JSON key.
26
+ def self.attribute_map
27
+ {
28
+ :'errors' => :'errors',
29
+ :'catalog_object' => :'catalog_object',
30
+ :'id_mappings' => :'id_mappings'
31
+ }
32
+ end
33
+
34
+ # Attribute type mapping.
35
+ def self.swagger_types
36
+ {
37
+ :'errors' => :'Array<Error>',
38
+ :'catalog_object' => :'CatalogObject',
39
+ :'id_mappings' => :'Array<CatalogIdMapping>'
40
+ }
41
+ end
42
+
43
+ # Initializes the object
44
+ # @param [Hash] attributes Model attributes in the form of hash
45
+ def initialize(attributes = {})
46
+ return unless attributes.is_a?(Hash)
47
+
48
+ # convert string to symbol for hash key
49
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
50
+
51
+ if attributes.has_key?(:'errors')
52
+ if (value = attributes[:'errors']).is_a?(Array)
53
+ self.errors = value
54
+ end
55
+ end
56
+
57
+ if attributes.has_key?(:'catalog_object')
58
+ self.catalog_object = attributes[:'catalog_object']
59
+ end
60
+
61
+ if attributes.has_key?(:'id_mappings')
62
+ if (value = attributes[:'id_mappings']).is_a?(Array)
63
+ self.id_mappings = value
64
+ end
65
+ end
66
+
67
+ end
68
+
69
+ # Show invalid properties with the reasons. Usually used together with valid?
70
+ # @return Array for valid properies with the reasons
71
+ def list_invalid_properties
72
+ invalid_properties = Array.new
73
+ return invalid_properties
74
+ end
75
+
76
+ # Check to see if the all the properties in the model are valid
77
+ # @return true if the model is valid
78
+ def valid?
79
+ return true
80
+ end
81
+
82
+ # Checks equality by comparing each attribute.
83
+ # @param [Object] Object to be compared
84
+ def ==(o)
85
+ return true if self.equal?(o)
86
+ self.class == o.class &&
87
+ errors == o.errors &&
88
+ catalog_object == o.catalog_object &&
89
+ id_mappings == o.id_mappings
90
+ end
91
+
92
+ # @see the `==` method
93
+ # @param [Object] Object to be compared
94
+ def eql?(o)
95
+ self == o
96
+ end
97
+
98
+ # Calculates hash code according to all attributes.
99
+ # @return [Fixnum] Hash code
100
+ def hash
101
+ [errors, catalog_object, id_mappings].hash
102
+ end
103
+
104
+ # Builds the object from hash
105
+ # @param [Hash] attributes Model attributes in the form of hash
106
+ # @return [Object] Returns the model itself
107
+ def build_from_hash(attributes)
108
+ return nil unless attributes.is_a?(Hash)
109
+ self.class.swagger_types.each_pair do |key, type|
110
+ if type =~ /\AArray<(.*)>/i
111
+ # check to ensure the input is an array given that the the attribute
112
+ # is documented as an array but the input is not
113
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
114
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
115
+ end
116
+ elsif !attributes[self.class.attribute_map[key]].nil?
117
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
118
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
119
+ end
120
+
121
+ self
122
+ end
123
+
124
+ # Deserializes the data based on type
125
+ # @param string type Data type
126
+ # @param string value Value to be deserialized
127
+ # @return [Object] Deserialized data
128
+ def _deserialize(type, value)
129
+ case type.to_sym
130
+ when :DateTime
131
+ DateTime.parse(value)
132
+ when :Date
133
+ Date.parse(value)
134
+ when :String
135
+ value.to_s
136
+ when :Integer
137
+ value.to_i
138
+ when :Float
139
+ value.to_f
140
+ when :BOOLEAN
141
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
142
+ true
143
+ else
144
+ false
145
+ end
146
+ when :Object
147
+ # generic object (usually a Hash), return directly
148
+ value
149
+ when /\AArray<(?<inner_type>.+)>\z/
150
+ inner_type = Regexp.last_match[:inner_type]
151
+ value.map { |v| _deserialize(inner_type, v) }
152
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
153
+ k_type = Regexp.last_match[:k_type]
154
+ v_type = Regexp.last_match[:v_type]
155
+ {}.tap do |hash|
156
+ value.each do |k, v|
157
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
158
+ end
159
+ end
160
+ else # model
161
+ temp_model = SquareConnect.const_get(type).new
162
+ temp_model.build_from_hash(value)
163
+ end
164
+ end
165
+
166
+ # Returns the string representation of the object
167
+ # @return [String] String presentation of the object
168
+ def to_s
169
+ to_hash.to_s
170
+ end
171
+
172
+ # to_body is an alias to to_hash (backward compatibility)
173
+ # @return [Hash] Returns the object in the form of hash
174
+ def to_body
175
+ to_hash
176
+ end
177
+
178
+ # Returns the object in the form of hash
179
+ # @return [Hash] Returns the object in the form of hash
180
+ def to_hash
181
+ hash = {}
182
+ self.class.attribute_map.each_pair do |attr, param|
183
+ value = self.send(attr)
184
+ next if value.nil?
185
+ hash[param] = _to_hash(value)
186
+ end
187
+ hash
188
+ end
189
+
190
+ # Outputs non-array value in the form of hash
191
+ # For object, use to_hash. Otherwise, just return the value
192
+ # @param [Object] value Any valid value
193
+ # @return [Hash] Returns the value in the form of hash
194
+ def _to_hash(value)
195
+ if value.is_a?(Array)
196
+ value.compact.map{ |v| _to_hash(v) }
197
+ elsif value.is_a?(Hash)
198
+ {}.tap do |hash|
199
+ value.each { |k, v| hash[k] = _to_hash(v) }
200
+ end
201
+ elsif value.respond_to? :to_hash
202
+ value.to_hash
203
+ else
204
+ value
205
+ end
206
+ end
207
+
208
+ end
209
+
210
+ end
@@ -106,7 +106,7 @@ module SquareConnect
106
106
  :'color' => :'String',
107
107
  :'abbreviation' => :'String',
108
108
  :'visibility' => :'String',
109
- :'available_online' => :'String',
109
+ :'available_online' => :'BOOLEAN',
110
110
  :'master_image' => :'V1ItemImage',
111
111
  :'category' => :'V1Category',
112
112
  :'variations' => :'Array<V1Variation>',
@@ -21,9 +21,6 @@ module SquareConnect
21
21
  # The ID of the variation's associated item.
22
22
  attr_accessor :item_id
23
23
 
24
- # ndicates the variation's list position when displayed in Square Register and the merchant dashboard. If more than one variation for the same item has the same ordinal value, those variations are displayed in alphabetical order
25
- attr_accessor :ordinal
26
-
27
24
  # Indicates whether the item variation's price is fixed or determined at the time of sale.
28
25
  attr_accessor :pricing_type
29
26
 
@@ -73,7 +70,6 @@ module SquareConnect
73
70
  :'id' => :'id',
74
71
  :'name' => :'name',
75
72
  :'item_id' => :'item_id',
76
- :'ordinal' => :'ordinal',
77
73
  :'pricing_type' => :'pricing_type',
78
74
  :'price_money' => :'price_money',
79
75
  :'sku' => :'sku',
@@ -90,7 +86,6 @@ module SquareConnect
90
86
  :'id' => :'String',
91
87
  :'name' => :'String',
92
88
  :'item_id' => :'String',
93
- :'ordinal' => :'String',
94
89
  :'pricing_type' => :'String',
95
90
  :'price_money' => :'V1Money',
96
91
  :'sku' => :'String',
@@ -121,10 +116,6 @@ module SquareConnect
121
116
  self.item_id = attributes[:'item_id']
122
117
  end
123
118
 
124
- if attributes.has_key?(:'ordinal')
125
- self.ordinal = attributes[:'ordinal']
126
- end
127
-
128
119
  if attributes.has_key?(:'pricing_type')
129
120
  self.pricing_type = attributes[:'pricing_type']
130
121
  end
@@ -200,7 +191,6 @@ module SquareConnect
200
191
  id == o.id &&
201
192
  name == o.name &&
202
193
  item_id == o.item_id &&
203
- ordinal == o.ordinal &&
204
194
  pricing_type == o.pricing_type &&
205
195
  price_money == o.price_money &&
206
196
  sku == o.sku &&
@@ -219,7 +209,7 @@ module SquareConnect
219
209
  # Calculates hash code according to all attributes.
220
210
  # @return [Fixnum] Hash code
221
211
  def hash
222
- [id, name, item_id, ordinal, pricing_type, price_money, sku, track_inventory, inventory_alert_type, inventory_alert_threshold, user_data].hash
212
+ [id, name, item_id, pricing_type, price_money, sku, track_inventory, inventory_alert_type, inventory_alert_threshold, user_data].hash
223
213
  end
224
214
 
225
215
  # Builds the object from hash
@@ -8,5 +8,5 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git
8
8
  =end
9
9
 
10
10
  module SquareConnect
11
- VERSION = "2.1.0.beta"
11
+ VERSION = "2.1.0"
12
12
  end
@@ -0,0 +1,611 @@
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 'spec_helper'
11
+ require 'json'
12
+ require 'securerandom'
13
+
14
+ # Unit tests for SquareConnect::CatalogApi
15
+ # Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
16
+ # Please update as you see appropriate
17
+ describe 'CatalogApi' do
18
+
19
+ let(:beverages_client_id) { '#Beverages' }
20
+ let(:beverages) do
21
+ {
22
+ type: SquareConnect::CatalogObjectType::CATEGORY,
23
+ id: beverages_client_id,
24
+ category_data: {
25
+ name: 'Beverages'
26
+ }
27
+ }
28
+ end
29
+
30
+ let(:sales_tax_client_id) { '#SalesTax' }
31
+ let(:sales_tax) do
32
+ {
33
+ type: SquareConnect::CatalogObjectType::TAX,
34
+ id: sales_tax_client_id,
35
+ present_at_all_locations: true,
36
+ tax_data: {
37
+ name: 'Sales Tax',
38
+ calculation_phase: SquareConnect::TaxCalculationPhase::SUBTOTAL_PHASE,
39
+ inclusion_type: SquareConnect::TaxInclusionType::ADDITIVE,
40
+ percentage: '5.0',
41
+ applies_to_custom_amounts: true,
42
+ enabled: true
43
+ }
44
+ }
45
+ end
46
+
47
+ let(:milks_client_id) { '#Milks' }
48
+ let(:whole_milk_client_id) { '#WholeMilk' }
49
+ let(:skim_milk_client_id) { '#SkimMilk' }
50
+ let(:soy_milk_client_id) { '#SoymMilk' }
51
+ let(:milks) do
52
+ {
53
+ type: SquareConnect::CatalogObjectType::MODIFIER_LIST,
54
+ id: milks_client_id,
55
+ modifier_list_data: {
56
+ name: 'Milks',
57
+ modifiers: [
58
+ {
59
+ type: SquareConnect::CatalogObjectType::MODIFIER,
60
+ id: whole_milk_client_id,
61
+ modifier_data: {
62
+ name: 'Whole Milk'
63
+ }
64
+ },
65
+ {
66
+ type: SquareConnect::CatalogObjectType::MODIFIER,
67
+ id: skim_milk_client_id,
68
+ modifier_data: {
69
+ name: 'Skim Milk'
70
+ }
71
+ },
72
+ {
73
+ type: SquareConnect::CatalogObjectType::MODIFIER,
74
+ id: soy_milk_client_id,
75
+ modifier_data: {
76
+ name: 'Soy Milk',
77
+ price_money: {
78
+ amount: 50,
79
+ currency: SquareConnect::Currency::USD
80
+ }
81
+ }
82
+ },
83
+ ]
84
+ }
85
+ }
86
+ end
87
+
88
+ let(:syrups_client_id) { '#Syrups' }
89
+ let(:hazelnut_client_id) { '#Hazelnut' }
90
+ let(:vanilla_client_id) { '#Vanilla' }
91
+ let(:chocolate_client_id) { '#Chocolate' }
92
+ let(:syrups) do
93
+ {
94
+ type: SquareConnect::CatalogObjectType::MODIFIER_LIST,
95
+ id: syrups_client_id,
96
+ modifier_list_data: {
97
+ name: 'Syrups',
98
+ modifiers: [
99
+ {
100
+ type: SquareConnect::CatalogObjectType::MODIFIER,
101
+ id: hazelnut_client_id,
102
+ modifier_data: {
103
+ name: 'Hazelnut'
104
+ }
105
+ },
106
+ {
107
+ type: SquareConnect::CatalogObjectType::MODIFIER,
108
+ id: vanilla_client_id,
109
+ modifier_data: {
110
+ name: 'Vanilla'
111
+ }
112
+ },
113
+ {
114
+ type: SquareConnect::CatalogObjectType::MODIFIER,
115
+ id: chocolate_client_id,
116
+ modifier_data: {
117
+ name: 'Chocolate'
118
+ }
119
+ },
120
+ ]
121
+ }
122
+ }
123
+ end
124
+
125
+ let(:coffee_client_id) { '#Coffee' }
126
+ let(:small_coffee_client_id) { '#SmallCoffee' }
127
+ let(:large_coffee_client_id) { '#LargeCoffee' }
128
+ let(:coffee) do
129
+ {
130
+ type: SquareConnect::CatalogObjectType::ITEM,
131
+ id: coffee_client_id,
132
+ present_at_all_locations: true,
133
+ item_data: {
134
+ name: 'Coffee',
135
+ description: 'Hot bean juice',
136
+ abbreviation: 'Co',
137
+ category_id: beverages_client_id,
138
+ modifier_list_info: [
139
+ {
140
+ modifier_list_id: milks_client_id
141
+ }
142
+ ],
143
+ tax_ids: [sales_tax_client_id],
144
+ variations: [
145
+ {
146
+ type: SquareConnect::CatalogObjectType::ITEM_VARIATION,
147
+ id: small_coffee_client_id,
148
+ present_at_all_locations: true,
149
+ item_variation_data: {
150
+ item_id: coffee_client_id,
151
+ name: 'Small',
152
+ pricing_type: SquareConnect::CatalogPricingType::FIXED_PRICING,
153
+ price_money: {
154
+ amount: 195,
155
+ currency: SquareConnect::Currency::USD
156
+ }
157
+ }
158
+ },
159
+ {
160
+ type: SquareConnect::CatalogObjectType::ITEM_VARIATION,
161
+ id: large_coffee_client_id,
162
+ present_at_all_locations: true,
163
+ item_variation_data: {
164
+ item_id: coffee_client_id,
165
+ name: 'Large',
166
+ pricing_type: SquareConnect::CatalogPricingType::FIXED_PRICING,
167
+ price_money: {
168
+ amount: 250,
169
+ currency: SquareConnect::Currency::USD
170
+ }
171
+ }
172
+ }
173
+ ]
174
+ }
175
+ }
176
+ end
177
+
178
+ let(:tea_client_id) { '#Tea' }
179
+ let(:small_tea_client_id) { '#SmallTea' }
180
+ let(:large_tea_client_id) { '#LargeTea' }
181
+ let(:tea) do
182
+ {
183
+ type: SquareConnect::CatalogObjectType::ITEM,
184
+ id: tea_client_id,
185
+ present_at_all_locations: true,
186
+ item_data: {
187
+ name: 'Tea',
188
+ description: 'Hot leaf juice',
189
+ abbreviation: 'Te',
190
+ category_id: beverages_client_id,
191
+ tax_ids: [sales_tax_client_id],
192
+ variations: [
193
+ {
194
+ type: SquareConnect::CatalogObjectType::ITEM_VARIATION,
195
+ id: small_tea_client_id,
196
+ present_at_all_locations: true,
197
+ item_variation_data: {
198
+ item_id: tea_client_id,
199
+ name: 'Small',
200
+ pricing_type: SquareConnect::CatalogPricingType::FIXED_PRICING,
201
+ price_money: {
202
+ amount: 150,
203
+ currency: SquareConnect::Currency::USD
204
+ }
205
+ }
206
+ },
207
+ {
208
+ type: SquareConnect::CatalogObjectType::ITEM_VARIATION,
209
+ id: large_tea_client_id,
210
+ present_at_all_locations: true,
211
+ item_variation_data: {
212
+ item_id: tea_client_id,
213
+ name: 'Large',
214
+ pricing_type: SquareConnect::CatalogPricingType::FIXED_PRICING,
215
+ price_money: {
216
+ amount: 200,
217
+ currency: SquareConnect::Currency::USD
218
+ }
219
+ }
220
+ }
221
+ ]
222
+ }
223
+ }
224
+ end
225
+
226
+ let(:object_definitions) { [beverages, milks, syrups, coffee, tea, sales_tax] }
227
+
228
+ let(:accounts) { load_accounts() }
229
+ let(:account) { accounts['US-Prod'] }
230
+ let(:instance) do
231
+ configuration = SquareConnect::Configuration.new do |config|
232
+ config.access_token = account["access_token"]
233
+ end
234
+ client = SquareConnect::ApiClient.new(configuration)
235
+
236
+ SquareConnect::CatalogApi.new(client)
237
+ end
238
+
239
+ let!(:id_map) do
240
+ # Set a unique idempotency key for each request
241
+ body = SquareConnect::BatchUpsertCatalogObjectsRequest.new
242
+ body.idempotency_key = SecureRandom.uuid
243
+ body.batches = [{
244
+ objects: object_definitions
245
+ }]
246
+
247
+ # Batch upsert the objects
248
+ response = instance.batch_upsert_catalog_objects(body)
249
+
250
+ mapping = response.id_mappings.map do |id_mapping|
251
+ [id_mapping.client_object_id, id_mapping.object_id]
252
+ end
253
+
254
+ mapping.to_h
255
+ end
256
+
257
+ let(:coffee_id) { id_map[coffee_client_id] }
258
+ let(:small_coffee_id) { id_map[small_coffee_client_id] }
259
+ let(:large_coffee_id) { id_map[large_coffee_client_id] }
260
+ let(:small_tea_id) { id_map[small_tea_client_id] }
261
+ let(:sales_tax_id) { id_map[sales_tax_client_id] }
262
+ let(:beverages_id) { id_map[beverages_client_id] }
263
+ let(:milks_id) { id_map[milks_client_id] }
264
+ let(:syrups_id) { id_map[syrups_client_id] }
265
+
266
+ after(:each) { delete_test_catalog }
267
+
268
+ def delete_test_catalog
269
+ opts = {}
270
+ objects_to_delete = []
271
+
272
+ begin
273
+ response = instance.list_catalog(opts)
274
+ objects_to_delete += response.objects.map(&:id)
275
+ opts[:cursor] = response.cursor
276
+ end while opts[:cursor]
277
+
278
+ objects_to_delete.each_slice(200) do |object_ids|
279
+ body = SquareConnect::BatchDeleteCatalogObjectsRequest.new
280
+ body.object_ids = object_ids
281
+ instance.batch_delete_catalog_objects(body)
282
+ end
283
+ end
284
+
285
+ describe 'instance' do
286
+ it 'should create an instance of CatalogApi' do
287
+ expect(instance).to be_instance_of(SquareConnect::CatalogApi)
288
+ end
289
+ end
290
+
291
+ describe '#batch_delete_catalog_objects test' do
292
+ it 'should delete a set of items based on the provided list of target IDs and return the deleted objects' do
293
+ body = SquareConnect::BatchDeleteCatalogObjectsRequest.new
294
+ body.object_ids = [coffee_id, small_tea_id]
295
+ response = instance.batch_delete_catalog_objects(body)
296
+
297
+ expect(response.deleted_object_ids.size).to eq(4)
298
+ expect(response.deleted_object_ids).to include(coffee_id)
299
+ expect(response.deleted_object_ids).to include(small_coffee_id)
300
+ expect(response.deleted_object_ids).to include(large_coffee_id)
301
+ expect(response.deleted_object_ids).to include(small_tea_id)
302
+ end
303
+ end
304
+
305
+ describe '#batch_retrieve_catalog_objects test' do
306
+ it 'should return a set of objects based on the provided ID.' do
307
+ body = SquareConnect::BatchRetrieveCatalogObjectsRequest.new
308
+ body.object_ids = [coffee_id, sales_tax_id]
309
+ response = instance.batch_retrieve_catalog_objects(body)
310
+
311
+ expect(response.objects.size).to eq(2)
312
+
313
+ actual_coffee = response.objects[0]
314
+ expect(actual_coffee.type).to eq(SquareConnect::CatalogObjectType::ITEM)
315
+ expect(actual_coffee.id).to eq(coffee_id)
316
+ expect(actual_coffee.updated_at.to_s.empty?).to be false
317
+ expect(actual_coffee.version.to_s.empty?).to be false
318
+ expect(actual_coffee.is_deleted).to be false
319
+ expect(actual_coffee.catalog_v1_ids).to be_nil
320
+ expect(actual_coffee.present_at_all_locations).to be true
321
+ expect(actual_coffee.present_at_location_ids).to be_nil
322
+ expect(actual_coffee.absent_at_location_ids).to be_nil
323
+
324
+ expect(actual_coffee.item_data.name).to eq("Coffee")
325
+ expect(actual_coffee.item_data.description).to eq("Hot bean juice")
326
+ expect(actual_coffee.item_data.abbreviation).to eq("Co")
327
+ expect(actual_coffee.item_data.label_color).to be_nil
328
+ expect(actual_coffee.item_data.available_online).to be_nil
329
+ expect(actual_coffee.item_data.available_for_pickup).to be_nil
330
+ expect(actual_coffee.item_data.available_electronically).to be_nil
331
+ expect(actual_coffee.item_data.category_id).to eq(beverages_id)
332
+ expect(actual_coffee.item_data.tax_ids.size).to eq(1)
333
+ expect(actual_coffee.item_data.tax_ids[0]).to eq(sales_tax_id)
334
+ expect(actual_coffee.item_data.modifier_list_info.size).to eq(1)
335
+ expect(actual_coffee.item_data.modifier_list_info[0].modifier_list_id).to eq(milks_id)
336
+ expect(actual_coffee.item_data.modifier_list_info[0].modifier_overrides).to be_nil
337
+ expect(actual_coffee.item_data.modifier_list_info[0].min_selected_modifiers).to be_nil
338
+ expect(actual_coffee.item_data.modifier_list_info[0].max_selected_modifiers).to be_nil
339
+ expect(actual_coffee.item_data.modifier_list_info[0].enabled).to be_nil
340
+ expect(actual_coffee.item_data.image_url).to be_nil
341
+
342
+ expect(actual_coffee.item_data.variations.size).to eq(2)
343
+
344
+ expect(actual_coffee.item_data.variations[0].item_variation_data.name).to eq("Small")
345
+ expect(actual_coffee.item_data.variations[0].item_variation_data.pricing_type).to eq(SquareConnect::CatalogPricingType::FIXED_PRICING)
346
+ expect(actual_coffee.item_data.variations[0].item_variation_data.price_money.amount).to eq(195)
347
+ expect(actual_coffee.item_data.variations[0].item_variation_data.price_money.currency).to eq(SquareConnect::Currency::USD)
348
+
349
+ expect(actual_coffee.item_data.variations[1].item_variation_data.name).to eq("Large")
350
+ expect(actual_coffee.item_data.variations[1].item_variation_data.pricing_type).to eq(SquareConnect::CatalogPricingType::FIXED_PRICING)
351
+ expect(actual_coffee.item_data.variations[1].item_variation_data.price_money.amount).to eq(250)
352
+ expect(actual_coffee.item_data.variations[1].item_variation_data.price_money.currency).to eq(SquareConnect::Currency::USD)
353
+
354
+ expect(actual_coffee.category_data).to be_nil
355
+ expect(actual_coffee.item_variation_data).to be_nil
356
+ expect(actual_coffee.tax_data).to be_nil
357
+ expect(actual_coffee.discount_data).to be_nil
358
+ expect(actual_coffee.modifier_list_data).to be_nil
359
+ expect(actual_coffee.modifier_data).to be_nil
360
+
361
+ actual_sales_tax = response.objects[1]
362
+ expect(actual_sales_tax.type).to eq(SquareConnect::CatalogObjectType::TAX)
363
+ expect(actual_sales_tax.id).to eq(sales_tax_id)
364
+ expect(actual_sales_tax.tax_data.name).to eq("Sales Tax")
365
+ end
366
+ end
367
+
368
+ describe '#batch_upsert_catalog_objects test' do
369
+ it 'should upsert target objects based on the provided payload and return created/updated objects' do
370
+ batches = []
371
+
372
+ num_objects = 0
373
+ (0..2).each do |batch_num|
374
+ batch = SquareConnect::CatalogObjectBatch.new
375
+ batch.objects = []
376
+ batches.push(batch)
377
+
378
+ (0..100).each do |i|
379
+ item_id = "#Item-#{batch_num}-#{i}"
380
+ variation_id = "#ItemVariation-#{batch_num}-#{i}"
381
+
382
+ batch.objects.push({
383
+ type: SquareConnect::CatalogObjectType::ITEM,
384
+ id: item_id,
385
+ itemData: {
386
+ name: "Item-#{batch_num}-#{i}",
387
+ variations: [
388
+ {
389
+ type: SquareConnect::CatalogObjectType::ITEM_VARIATION,
390
+ id: variation_id,
391
+ item_variation_data: {
392
+ item_id: item_id,
393
+ name: 'Regular',
394
+ pricing_type: SquareConnect::CatalogPricingType::VARIABLE_PRICING
395
+ }
396
+ }
397
+ ]
398
+ }
399
+ })
400
+ num_objects = num_objects + 1
401
+ end
402
+ end
403
+
404
+ body = SquareConnect::BatchUpsertCatalogObjectsRequest.new
405
+ body.idempotency_key = SecureRandom.uuid
406
+ body.batches = batches
407
+
408
+ response = instance.batch_upsert_catalog_objects(body)
409
+
410
+ expect(response.objects.size).to eq(num_objects)
411
+ end
412
+ end
413
+
414
+ describe '#catalog_info' do
415
+ it 'should return information about Square Catalog API' do
416
+ result = instance.catalog_info()
417
+ expect(result.limits.batch_upsert_max_objects_per_batch).to eq(1000)
418
+ expect(result.limits.batch_upsert_max_total_objects).to eq(10000)
419
+ expect(result.limits.batch_retrieve_max_object_ids).to eq(1000)
420
+ expect(result.limits.search_max_page_limit).to eq(1000)
421
+ expect(result.limits.batch_delete_max_object_ids).to eq(200)
422
+ expect(result.limits.update_item_taxes_max_item_ids).to eq(1000)
423
+ expect(result.limits.update_item_taxes_max_taxes_to_enable).to eq(1000)
424
+ expect(result.limits.update_item_taxes_max_taxes_to_disable).to eq(1000)
425
+ expect(result.limits.update_item_modifier_lists_max_item_ids).to eq(1000)
426
+ expect(result.limits.update_item_modifier_lists_max_modifier_lists_to_enable).to eq(1000)
427
+ expect(result.limits.update_item_modifier_lists_max_modifier_lists_to_disable).to eq(1000)
428
+ end
429
+ end
430
+
431
+ describe '#delete_catalog_object' do
432
+ it 'should delete a single catalog object based on the provided ID and return a set of the successfully deleted object ids' do
433
+ response = instance.delete_catalog_object(coffee_id)
434
+
435
+ expect(response.deleted_object_ids.size).to eq(3)
436
+ expect(response.deleted_object_ids).to include(coffee_id)
437
+ expect(response.deleted_object_ids).to include(small_coffee_id)
438
+ expect(response.deleted_object_ids).to include(large_coffee_id)
439
+ end
440
+ end
441
+
442
+ describe '#list_catalog' do
443
+ it 'should return a list of catalog objects of the desired type' do
444
+ opts = {}
445
+ all_objects = []
446
+
447
+ while true do
448
+ response = instance.list_catalog(opts)
449
+ response.objects.each do |obj|
450
+ all_objects.push(obj.id)
451
+ end
452
+
453
+ break if response.cursor.to_s.empty?
454
+ opts[:cursor] = response.cursor
455
+ end
456
+
457
+ expect(all_objects.size).to eq(object_definitions.size)
458
+ end
459
+ end
460
+
461
+ describe '#retrieve_catalog_object' do
462
+ it 'should returns a single CatalogItem as a CatalogObject based on the provided ID.' do
463
+ object_id = id_map[coffee_client_id]
464
+ opts = {
465
+ include_related_objects: true
466
+ }
467
+ response = instance.retrieve_catalog_object(object_id, opts)
468
+
469
+ expect(response.object.id).to eq(object_id)
470
+ expect(response.related_objects.size).to eq(3)
471
+
472
+ got_milks = false
473
+ got_sales_tax = false
474
+ got_beverages = false
475
+ response.related_objects.each do |related_object|
476
+ if related_object.type == SquareConnect::CatalogObjectType::MODIFIER_LIST && related_object.modifier_list_data.name == 'Milks'
477
+ got_milks = true
478
+ end
479
+ if related_object.type == SquareConnect::CatalogObjectType::TAX && related_object.tax_data.name == 'Sales Tax'
480
+ got_sales_tax = true
481
+ end
482
+ if related_object.type == SquareConnect::CatalogObjectType::CATEGORY && related_object.category_data.name == 'Beverages'
483
+ got_beverages = true
484
+ end
485
+ end
486
+
487
+ expect(got_milks).to be true
488
+ expect(got_sales_tax).to be true
489
+ expect(got_beverages).to be true
490
+ end
491
+ end
492
+
493
+ describe '#search_catalog_objects' do
494
+ it 'should return all objects with name starting with "Sm" when searching by prefix' do
495
+ body = {
496
+ query: {
497
+ prefix_query: {
498
+ attribute_name: 'name',
499
+ attribute_prefix: 'Sm'
500
+ }
501
+ },
502
+ include_deleted_objects: false,
503
+ include_related_objects: false
504
+ }
505
+ response = instance.search_catalog_objects(body)
506
+
507
+ expect(response.objects.size).to eq(2)
508
+ expect(response.objects[0].type).to eq(SquareConnect::CatalogObjectType::ITEM_VARIATION)
509
+ expect(response.objects[0].item_variation_data.name).to eq("Small")
510
+
511
+ expect(response.objects[1].type).to eq(SquareConnect::CatalogObjectType::ITEM_VARIATION)
512
+ expect(response.objects[1].item_variation_data.name).to eq("Small")
513
+ end
514
+
515
+ it 'should return all objects with a certain tax definition when searching by items_for_tax' do
516
+ body = {
517
+ query: {
518
+ items_for_tax_query: {
519
+ tax_ids: [sales_tax_id]
520
+ }
521
+ },
522
+ include_deleted_objects: false,
523
+ include_related_objects: false
524
+ }
525
+ response = instance.search_catalog_objects(body)
526
+
527
+ expect(response.objects.size).to eq(2)
528
+ expect(response.objects[0].type).to eq(SquareConnect::CatalogObjectType::ITEM)
529
+ expect(response.objects[1].type).to eq(SquareConnect::CatalogObjectType::ITEM)
530
+
531
+ got_coffee = false
532
+ got_tea = false
533
+ response.objects.each do |obj|
534
+ if obj.item_data.name == 'Coffee'
535
+ got_coffee = true
536
+ end
537
+ if obj.item_data.name == 'Tea'
538
+ got_tea = true
539
+ end
540
+ end
541
+
542
+ expect(got_coffee).to be true
543
+ expect(got_tea).to be true
544
+ end
545
+ end
546
+
547
+ describe '#update_item_modifier_lists' do
548
+ it 'should update all CatalogModifierList instances belonging to a specific CatalogItem' do
549
+ opts = {
550
+ include_related_objects: false
551
+ }
552
+ object_before = instance.retrieve_catalog_object(coffee_id, opts)
553
+ expect(object_before.object.item_data.modifier_list_info.size).to eq(1)
554
+ expect(object_before.object.item_data.modifier_list_info[0].modifier_list_id).to eq(milks_id)
555
+
556
+ body = SquareConnect::UpdateItemModifierListsRequest.new
557
+ body.item_ids = [ coffee_id ]
558
+ body.modifier_lists_to_disable = [ milks_id ]
559
+ body.modifier_lists_to_enable = [ syrups_id ]
560
+ response = instance.update_item_modifier_lists(body)
561
+
562
+ object_after = instance.retrieve_catalog_object(coffee_id, opts)
563
+ expect(object_after.object.item_data.modifier_list_info.size).to eq(1)
564
+ expect(object_after.object.item_data.modifier_list_info[0].modifier_list_id).to eq(syrups_id)
565
+ end
566
+ end
567
+
568
+ describe '#update_item_taxes' do
569
+ it 'should update all CatalogTax instances that apply to a specific CatalogItem' do
570
+ opts = {
571
+ include_related_objects: false
572
+ }
573
+ object_before = instance.retrieve_catalog_object(coffee_id, opts)
574
+ expect(object_before.object.item_data.tax_ids.size).to eq(1)
575
+
576
+ body = SquareConnect::UpdateItemTaxesRequest.new
577
+ body.item_ids = [ coffee_id ]
578
+ body.taxes_to_disable = [ sales_tax_id ]
579
+ response = instance.update_item_taxes(body)
580
+
581
+ object_after = instance.retrieve_catalog_object(coffee_id, opts)
582
+ expect(object_after.object.item_data.tax_ids).to be_nil
583
+ end
584
+ end
585
+
586
+ describe '#upsert_catalog_object' do
587
+ it 'should create a new discount object when it does not exist on the server' do
588
+ body = SquareConnect::UpsertCatalogObjectRequest.new
589
+ body.idempotency_key = SecureRandom.uuid
590
+ body.object = {
591
+ type: SquareConnect::CatalogObjectType::DISCOUNT,
592
+ id: '#Discount',
593
+ discount_data: {
594
+ name: 'Half off',
595
+ percentage: '50.0'
596
+ }
597
+ }
598
+ response = instance.upsert_catalog_object(body)
599
+
600
+ expect(response.catalog_object.discount_data.name).to eq("Half off")
601
+ expect(response.catalog_object.id.empty?).to be false
602
+ expect(response.catalog_object.updated_at.empty?).to be false
603
+ expect(response.catalog_object.version).to be > 0
604
+ expect(response.catalog_object.is_deleted).to be false
605
+
606
+ expect(response.id_mappings.size).to eq(1)
607
+ expect(response.id_mappings[0].client_object_id).to eq('#Discount')
608
+ end
609
+ end
610
+
611
+ end