square_connect 2.20190313.1.282 → 2.20190327.1.292
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +12 -0
- data/README.md +5 -4
- data/docs/Address.md +1 -1
- data/docs/BatchRetrieveInventoryChangesRequest.md +2 -2
- data/docs/Card.md +1 -1
- data/docs/CatalogDiscount.md +1 -1
- data/docs/CatalogImage.md +14 -0
- data/docs/CatalogItem.md +2 -2
- data/docs/CatalogItemVariation.md +2 -2
- data/docs/CatalogModifierList.md +1 -1
- data/docs/CatalogObject.md +3 -1
- data/docs/CatalogObjectType.md +1 -0
- data/docs/CatalogQuerySortedAttribute.md +1 -1
- data/docs/CatalogTax.md +2 -2
- data/docs/CreateOrderRequestTax.md +1 -1
- data/docs/Customer.md +1 -1
- data/docs/CustomerCreationSourceFilter.md +2 -2
- data/docs/CustomerSort.md +2 -2
- data/docs/CustomersApi.md +5 -5
- data/docs/Employee.md +1 -1
- data/docs/Error.md +1 -1
- data/docs/InventoryAdjustment.md +2 -2
- data/docs/InventoryChange.md +1 -1
- data/docs/InventoryCount.md +1 -1
- data/docs/InventoryPhysicalCount.md +1 -1
- data/docs/InventoryTransfer.md +1 -1
- data/docs/ItemVariationLocationOverrides.md +2 -2
- data/docs/ListAdditionalRecipientReceivableRefundsRequest.md +1 -1
- data/docs/ListAdditionalRecipientReceivablesRequest.md +1 -1
- data/docs/ListCustomersRequest.md +2 -2
- data/docs/ListEmployeesRequest.md +1 -1
- data/docs/ListRefundsRequest.md +1 -1
- data/docs/ListTransactionsRequest.md +1 -1
- data/docs/Location.md +5 -5
- data/docs/Money.md +1 -1
- data/docs/ObtainTokenRequest.md +6 -6
- data/docs/ObtainTokenResponse.md +2 -2
- data/docs/OrderFulfillment.md +2 -2
- data/docs/OrderFulfillmentPickupDetails.md +1 -1
- data/docs/OrderLineItemDiscount.md +2 -2
- data/docs/OrderLineItemTax.md +2 -2
- data/docs/Refund.md +1 -1
- data/docs/RegisterDomainResponse.md +1 -1
- data/docs/SearchCatalogObjectsRequest.md +1 -1
- data/docs/Shift.md +1 -1
- data/docs/ShiftFilter.md +1 -1
- data/docs/ShiftSort.md +2 -2
- data/docs/ShiftWorkday.md +1 -1
- data/docs/SourceApplication.md +1 -1
- data/docs/Tender.md +1 -1
- data/docs/TenderCardDetails.md +2 -2
- data/docs/Transaction.md +1 -1
- data/docs/V1Payment.md +1 -1
- data/docs/WorkweekConfig.md +1 -1
- data/lib/square_connect.rb +1 -0
- data/lib/square_connect/api/apple_pay_api.rb +1 -1
- data/lib/square_connect/api/catalog_api.rb +11 -11
- data/lib/square_connect/api/checkout_api.rb +1 -1
- data/lib/square_connect/api/customers_api.rb +14 -14
- data/lib/square_connect/api/employees_api.rb +2 -2
- data/lib/square_connect/api/inventory_api.rb +7 -7
- data/lib/square_connect/api/labor_api.rb +14 -14
- data/lib/square_connect/api/locations_api.rb +1 -1
- data/lib/square_connect/api/mobile_authorization_api.rb +1 -1
- data/lib/square_connect/api/o_auth_api.rb +3 -3
- data/lib/square_connect/api/orders_api.rb +2 -2
- data/lib/square_connect/api/reporting_api.rb +2 -2
- data/lib/square_connect/api/transactions_api.rb +7 -7
- data/lib/square_connect/api/v1_employees_api.rb +16 -16
- data/lib/square_connect/api/v1_items_api.rb +40 -40
- data/lib/square_connect/api/v1_locations_api.rb +2 -2
- data/lib/square_connect/api/v1_transactions_api.rb +11 -11
- data/lib/square_connect/api_client.rb +1 -1
- data/lib/square_connect/models/address.rb +1 -1
- data/lib/square_connect/models/batch_retrieve_inventory_changes_request.rb +2 -2
- data/lib/square_connect/models/card.rb +1 -1
- data/lib/square_connect/models/catalog_discount.rb +1 -1
- data/lib/square_connect/models/catalog_image.rb +206 -0
- data/lib/square_connect/models/catalog_item.rb +2 -2
- data/lib/square_connect/models/catalog_item_variation.rb +2 -2
- data/lib/square_connect/models/catalog_modifier_list.rb +1 -1
- data/lib/square_connect/models/catalog_object.rb +27 -7
- data/lib/square_connect/models/catalog_object_type.rb +1 -0
- data/lib/square_connect/models/catalog_query_sorted_attribute.rb +1 -1
- data/lib/square_connect/models/catalog_tax.rb +2 -2
- data/lib/square_connect/models/create_order_request_tax.rb +1 -1
- data/lib/square_connect/models/customer.rb +1 -1
- data/lib/square_connect/models/customer_creation_source_filter.rb +2 -2
- data/lib/square_connect/models/customer_sort.rb +2 -2
- data/lib/square_connect/models/employee.rb +1 -1
- data/lib/square_connect/models/error.rb +1 -1
- data/lib/square_connect/models/inventory_adjustment.rb +2 -2
- data/lib/square_connect/models/inventory_change.rb +1 -1
- data/lib/square_connect/models/inventory_count.rb +1 -1
- data/lib/square_connect/models/inventory_physical_count.rb +1 -1
- data/lib/square_connect/models/inventory_transfer.rb +1 -1
- data/lib/square_connect/models/item_variation_location_overrides.rb +2 -2
- data/lib/square_connect/models/list_additional_recipient_receivable_refunds_request.rb +1 -1
- data/lib/square_connect/models/list_additional_recipient_receivables_request.rb +1 -1
- data/lib/square_connect/models/list_customers_request.rb +2 -2
- data/lib/square_connect/models/list_employees_request.rb +1 -1
- data/lib/square_connect/models/list_refunds_request.rb +1 -1
- data/lib/square_connect/models/list_transactions_request.rb +1 -1
- data/lib/square_connect/models/location.rb +5 -5
- data/lib/square_connect/models/money.rb +1 -1
- data/lib/square_connect/models/obtain_token_request.rb +20 -5
- data/lib/square_connect/models/obtain_token_response.rb +2 -2
- data/lib/square_connect/models/order_fulfillment.rb +2 -2
- data/lib/square_connect/models/order_fulfillment_pickup_details.rb +1 -1
- data/lib/square_connect/models/order_line_item_discount.rb +2 -2
- data/lib/square_connect/models/order_line_item_tax.rb +2 -2
- data/lib/square_connect/models/refund.rb +1 -1
- data/lib/square_connect/models/register_domain_response.rb +1 -1
- data/lib/square_connect/models/search_catalog_objects_request.rb +1 -1
- data/lib/square_connect/models/shift.rb +1 -1
- data/lib/square_connect/models/shift_filter.rb +1 -1
- data/lib/square_connect/models/shift_sort.rb +2 -2
- data/lib/square_connect/models/shift_workday.rb +1 -1
- data/lib/square_connect/models/source_application.rb +1 -1
- data/lib/square_connect/models/tender.rb +1 -1
- data/lib/square_connect/models/tender_card_details.rb +2 -2
- data/lib/square_connect/models/transaction.rb +1 -1
- data/lib/square_connect/models/v1_payment.rb +1 -1
- data/lib/square_connect/models/workweek_config.rb +1 -1
- data/lib/square_connect/version.rb +1 -1
- data/spec/models/catalog_image_spec.rb +51 -0
- metadata +6 -2
@@ -30,7 +30,7 @@ module SquareConnect
|
|
30
30
|
@config = config
|
31
31
|
|
32
32
|
# Construct user agent string. Returns slightly different string for JRuby
|
33
|
-
@user_agent = "Square-Connect-Ruby/2.
|
33
|
+
@user_agent = "Square-Connect-Ruby/2.20190327.1"
|
34
34
|
|
35
35
|
@default_headers = {
|
36
36
|
'Content-Type' => "application/json",
|
@@ -45,7 +45,7 @@ module SquareConnect
|
|
45
45
|
# The address's postal code.
|
46
46
|
attr_accessor :postal_code
|
47
47
|
|
48
|
-
# The address's country, in ISO 3166-1-alpha-2 format.
|
48
|
+
# The address's country, in ISO 3166-1-alpha-2 format. See [Country](#type-country) for possible values
|
49
49
|
attr_accessor :country
|
50
50
|
|
51
51
|
# Optional first name when it's representing recipient.
|
@@ -18,10 +18,10 @@ module SquareConnect
|
|
18
18
|
# Filters results by [Location](#type-location) ID. Only applied when set. Default: unset.
|
19
19
|
attr_accessor :location_ids
|
20
20
|
|
21
|
-
# Filters results by [InventoryChangeType](#type-inventorychangetype). Default: [`PHYSICAL_COUNT`, `ADJUSTMENT`]. `TRANSFER` is not supported as a filter.
|
21
|
+
# Filters results by [InventoryChangeType](#type-inventorychangetype). Default: [`PHYSICAL_COUNT`, `ADJUSTMENT`]. `TRANSFER` is not supported as a filter. See [InventoryChangeType](#type-inventorychangetype) for possible values
|
22
22
|
attr_accessor :types
|
23
23
|
|
24
|
-
# Filters `ADJUSTMENT` query results by [InventoryState](#type-inventorystate). Only applied when set. Default: unset.
|
24
|
+
# Filters `ADJUSTMENT` query results by [InventoryState](#type-inventorystate). Only applied when set. Default: unset. See [InventoryState](#type-inventorystate) for possible values
|
25
25
|
attr_accessor :states
|
26
26
|
|
27
27
|
# Provided as an RFC 3339 timestamp. Returns results whose `created_at` or `calculated_at` value is after the given time. Default: UNIX epoch (`1970-01-01T00:00:00Z`).
|
@@ -15,7 +15,7 @@ module SquareConnect
|
|
15
15
|
# Unique ID for this card. Generated by Square.
|
16
16
|
attr_accessor :id
|
17
17
|
|
18
|
-
# The card's brand (such as `VISA`). See [CardBrand](#type-cardbrand) for
|
18
|
+
# The card's brand (such as `VISA`). See [CardBrand](#type-cardbrand) for possible values
|
19
19
|
attr_accessor :card_brand
|
20
20
|
|
21
21
|
# The last 4 digits of the card number.
|
@@ -15,7 +15,7 @@ module SquareConnect
|
|
15
15
|
# The discount's name. Searchable. This field has max length of 255 Unicode code points.
|
16
16
|
attr_accessor :name
|
17
17
|
|
18
|
-
# Indicates whether the discount is a fixed amount or percentage, or entered at the time of sale. See [CatalogDiscountType](#type-catalogdiscounttype) for
|
18
|
+
# Indicates whether the discount is a fixed amount or percentage, or entered at the time of sale. See [CatalogDiscountType](#type-catalogdiscounttype) for possible values
|
19
19
|
attr_accessor :discount_type
|
20
20
|
|
21
21
|
# The percentage of the discount as a string representation of a decimal number, using a `.` as the decimal separator and without a `%` sign. A value of `7.5` corresponds to `7.5%`. Specify a percentage of `0` if `discount_type` is `VARIABLE_PERCENTAGE`. Do not include this field for amount-based or variable discounts.
|
@@ -0,0 +1,206 @@
|
|
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
|
+
# An image file to use in Square catalogs. Can be associated with catalog items, item variations, and categories.
|
14
|
+
class CatalogImage
|
15
|
+
# The internal name of this image. Identifies this image in calls to the Connect APIs.
|
16
|
+
attr_accessor :name
|
17
|
+
|
18
|
+
# The URL of this image. Generated by Square after an image is uploaded to the CreateCatalogImage endpoint.
|
19
|
+
attr_accessor :url
|
20
|
+
|
21
|
+
# A caption that describes what is shown in the image. Displayed in the Square Online Store.
|
22
|
+
attr_accessor :caption
|
23
|
+
|
24
|
+
|
25
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
26
|
+
def self.attribute_map
|
27
|
+
{
|
28
|
+
:'name' => :'name',
|
29
|
+
:'url' => :'url',
|
30
|
+
:'caption' => :'caption'
|
31
|
+
}
|
32
|
+
end
|
33
|
+
|
34
|
+
# Attribute type mapping.
|
35
|
+
def self.swagger_types
|
36
|
+
{
|
37
|
+
:'name' => :'String',
|
38
|
+
:'url' => :'String',
|
39
|
+
:'caption' => :'String'
|
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?(:'name')
|
52
|
+
self.name = attributes[:'name']
|
53
|
+
end
|
54
|
+
|
55
|
+
if attributes.has_key?(:'url')
|
56
|
+
self.url = attributes[:'url']
|
57
|
+
end
|
58
|
+
|
59
|
+
if attributes.has_key?(:'caption')
|
60
|
+
self.caption = attributes[:'caption']
|
61
|
+
end
|
62
|
+
|
63
|
+
end
|
64
|
+
|
65
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
66
|
+
# @return Array for valid properies with the reasons
|
67
|
+
def list_invalid_properties
|
68
|
+
invalid_properties = Array.new
|
69
|
+
return invalid_properties
|
70
|
+
end
|
71
|
+
|
72
|
+
# Check to see if the all the properties in the model are valid
|
73
|
+
# @return true if the model is valid
|
74
|
+
def valid?
|
75
|
+
return true
|
76
|
+
end
|
77
|
+
|
78
|
+
# Checks equality by comparing each attribute.
|
79
|
+
# @param [Object] Object to be compared
|
80
|
+
def ==(o)
|
81
|
+
return true if self.equal?(o)
|
82
|
+
self.class == o.class &&
|
83
|
+
name == o.name &&
|
84
|
+
url == o.url &&
|
85
|
+
caption == o.caption
|
86
|
+
end
|
87
|
+
|
88
|
+
# @see the `==` method
|
89
|
+
# @param [Object] Object to be compared
|
90
|
+
def eql?(o)
|
91
|
+
self == o
|
92
|
+
end
|
93
|
+
|
94
|
+
# Calculates hash code according to all attributes.
|
95
|
+
# @return [Fixnum] Hash code
|
96
|
+
def hash
|
97
|
+
[name, url, caption].hash
|
98
|
+
end
|
99
|
+
|
100
|
+
# Builds the object from hash
|
101
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
102
|
+
# @return [Object] Returns the model itself
|
103
|
+
def build_from_hash(attributes)
|
104
|
+
return nil unless attributes.is_a?(Hash)
|
105
|
+
self.class.swagger_types.each_pair do |key, type|
|
106
|
+
if type =~ /\AArray<(.*)>/i
|
107
|
+
# check to ensure the input is an array given that the the attribute
|
108
|
+
# is documented as an array but the input is not
|
109
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
110
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
111
|
+
end
|
112
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
113
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
114
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
115
|
+
end
|
116
|
+
|
117
|
+
self
|
118
|
+
end
|
119
|
+
|
120
|
+
# Deserializes the data based on type
|
121
|
+
# @param string type Data type
|
122
|
+
# @param string value Value to be deserialized
|
123
|
+
# @return [Object] Deserialized data
|
124
|
+
def _deserialize(type, value)
|
125
|
+
case type.to_sym
|
126
|
+
when :DateTime
|
127
|
+
DateTime.parse(value)
|
128
|
+
when :Date
|
129
|
+
Date.parse(value)
|
130
|
+
when :String
|
131
|
+
value.to_s
|
132
|
+
when :Integer
|
133
|
+
value.to_i
|
134
|
+
when :Float
|
135
|
+
value.to_f
|
136
|
+
when :BOOLEAN
|
137
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
138
|
+
true
|
139
|
+
else
|
140
|
+
false
|
141
|
+
end
|
142
|
+
when :Object
|
143
|
+
# generic object (usually a Hash), return directly
|
144
|
+
value
|
145
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
146
|
+
inner_type = Regexp.last_match[:inner_type]
|
147
|
+
value.map { |v| _deserialize(inner_type, v) }
|
148
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
149
|
+
k_type = Regexp.last_match[:k_type]
|
150
|
+
v_type = Regexp.last_match[:v_type]
|
151
|
+
{}.tap do |hash|
|
152
|
+
value.each do |k, v|
|
153
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
154
|
+
end
|
155
|
+
end
|
156
|
+
else # model
|
157
|
+
temp_model = SquareConnect.const_get(type).new
|
158
|
+
temp_model.build_from_hash(value)
|
159
|
+
end
|
160
|
+
end
|
161
|
+
|
162
|
+
# Returns the string representation of the object
|
163
|
+
# @return [String] String presentation of the object
|
164
|
+
def to_s
|
165
|
+
to_hash.to_s
|
166
|
+
end
|
167
|
+
|
168
|
+
# to_body is an alias to to_hash (backward compatibility)
|
169
|
+
# @return [Hash] Returns the object in the form of hash
|
170
|
+
def to_body
|
171
|
+
to_hash
|
172
|
+
end
|
173
|
+
|
174
|
+
# Returns the object in the form of hash
|
175
|
+
# @return [Hash] Returns the object in the form of hash
|
176
|
+
def to_hash
|
177
|
+
hash = {}
|
178
|
+
self.class.attribute_map.each_pair do |attr, param|
|
179
|
+
value = self.send(attr)
|
180
|
+
next if value.nil?
|
181
|
+
hash[param] = _to_hash(value)
|
182
|
+
end
|
183
|
+
hash
|
184
|
+
end
|
185
|
+
|
186
|
+
# Outputs non-array value in the form of hash
|
187
|
+
# For object, use to_hash. Otherwise, just return the value
|
188
|
+
# @param [Object] value Any valid value
|
189
|
+
# @return [Hash] Returns the value in the form of hash
|
190
|
+
def _to_hash(value)
|
191
|
+
if value.is_a?(Array)
|
192
|
+
value.compact.map{ |v| _to_hash(v) }
|
193
|
+
elsif value.is_a?(Hash)
|
194
|
+
{}.tap do |hash|
|
195
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
196
|
+
end
|
197
|
+
elsif value.respond_to? :to_hash
|
198
|
+
value.to_hash
|
199
|
+
else
|
200
|
+
value
|
201
|
+
end
|
202
|
+
end
|
203
|
+
|
204
|
+
end
|
205
|
+
|
206
|
+
end
|
@@ -42,13 +42,13 @@ module SquareConnect
|
|
42
42
|
# A set of [CatalogItemModifierListInfo](#type-catalogitemmodifierlistinfo) objects representing the modifier lists that apply to this item, along with the overrides and min and max limits that are specific to this item. [CatalogModifierList](#type-catalogmodifierlist)s may also be added to or deleted from an item using `UpdateItemModifierLists`.
|
43
43
|
attr_accessor :modifier_list_info
|
44
44
|
|
45
|
-
# The URL of an image representing this item.
|
45
|
+
# __Deprecated__. The URL of an image representing this item. Deprecated in favor of `image_id` in [`CatalogObject`](#type-catalogobject).
|
46
46
|
attr_accessor :image_url
|
47
47
|
|
48
48
|
# A list of [CatalogObject](#type-catalogobject)s containing the [CatalogItemVariation](#type-catalogitemvariation)s for this item.
|
49
49
|
attr_accessor :variations
|
50
50
|
|
51
|
-
# The product type of the item. May not be changed once an item has been created. Only items of product type `REGULAR` may be created by this API; items with other product types are read-only. See [CatalogItemProductType](#type-catalogitemproducttype) for
|
51
|
+
# The product type of the item. May not be changed once an item has been created. Only items of product type `REGULAR` may be created by this API; items with other product types are read-only. See [CatalogItemProductType](#type-catalogitemproducttype) for possible values
|
52
52
|
attr_accessor :product_type
|
53
53
|
|
54
54
|
# If `false`, the Square Point of Sale app will present the [CatalogItem](#type-catalogitem)'s details screen immediately, allowing the merchant to choose [CatalogModifier](#type-catalogmodifier)s before adding the item to the cart. This is the default behavior. If `true`, the Square Point of Sale app will immediately add the item to the cart with the pre-selected modifiers, and merchants can edit modifiers by drilling down onto the item's details. Third-party clients are encouraged to implement similar behaviors.
|
@@ -27,7 +27,7 @@ module SquareConnect
|
|
27
27
|
# The order in which this item variation should be displayed. This value is read-only. On writes, the ordinal for each item variation within a parent [CatalogItem](#type-catalogitem) is set according to the item variations's position. On reads, the value is not guaranteed to be sequential or unique.
|
28
28
|
attr_accessor :ordinal
|
29
29
|
|
30
|
-
# Indicates whether the item variation's price is fixed or determined at the time of sale. See [CatalogPricingType](#type-catalogpricingtype) for
|
30
|
+
# Indicates whether the item variation's price is fixed or determined at the time of sale. See [CatalogPricingType](#type-catalogpricingtype) for possible values
|
31
31
|
attr_accessor :pricing_type
|
32
32
|
|
33
33
|
# The item variation's price, if fixed pricing is used.
|
@@ -39,7 +39,7 @@ module SquareConnect
|
|
39
39
|
# If `true`, inventory tracking is active for the variation.
|
40
40
|
attr_accessor :track_inventory
|
41
41
|
|
42
|
-
# Indicates whether the item variation displays an alert when its inventory quantity is less than or equal to its `inventory_alert_threshold`. See [InventoryAlertType](#type-inventoryalerttype) for
|
42
|
+
# Indicates whether the item variation displays an alert when its inventory quantity is less than or equal to its `inventory_alert_threshold`. See [InventoryAlertType](#type-inventoryalerttype) for possible values
|
43
43
|
attr_accessor :inventory_alert_type
|
44
44
|
|
45
45
|
# If the inventory quantity for the variation is less than or equal to this value and `inventory_alert_type` is `LOW_QUANTITY`, the variation displays an alert in the merchant dashboard. This value is always an integer.
|
@@ -15,7 +15,7 @@ module SquareConnect
|
|
15
15
|
# The [CatalogModifierList](#type-catalogmodifierlist)'s name. Searchable. This field has max length of 255 Unicode code points.
|
16
16
|
attr_accessor :name
|
17
17
|
|
18
|
-
# Indicates whether multiple options from the [CatalogModifierList](#type-catalogmodifierlist) can be applied to a single [CatalogItem](#type-catalogitem). See [CatalogModifierListSelectionType](#type-catalogmodifierlistselectiontype) for
|
18
|
+
# Indicates whether multiple options from the [CatalogModifierList](#type-catalogmodifierlist) can be applied to a single [CatalogItem](#type-catalogitem). See [CatalogModifierListSelectionType](#type-catalogmodifierlistselectiontype) for possible values
|
19
19
|
attr_accessor :selection_type
|
20
20
|
|
21
21
|
# The options included in the [CatalogModifierList](#type-catalogmodifierlist). You must include at least one [CatalogModifier](#type-catalogmodifier). Each [CatalogObject](#type-catalogobject) must have type `MODIFIER` and contain [CatalogModifier](#type-catalogmodifier) data.
|
@@ -12,7 +12,7 @@ require 'date'
|
|
12
12
|
module SquareConnect
|
13
13
|
# The wrapper object for object types in the Catalog data model. The type of a particular `CatalogObject` is determined by the value of `type` and only the corresponding data field may be set. - if type = `ITEM`, only `item_data` will be populated and it will contain a valid [CatalogItem](#type-catalogitem) object. - if type = `ITEM_VARIATION`, only `item_variation_data` will be populated and it will contain a valid [CatalogItemVariation](#type-catalogitemvariation) object. - if type = `MODIFIER`, only `modifier_data` will be populated and it will contain a valid [CatalogModifier](#type-catalogmodifier) object. - if type = `MODIFIER_LIST`, only `modifier_list_data` will be populated and it will contain a valid [CatalogModifierList](#type-catalogmodifierlist) object. - if type = `CATEGORY`, only `category_data` will be populated and it will contain a valid [CatalogCategory](#type-catalogcategory) object. - if type = `DISCOUNT`, only `discount_data` will be populated and it will contain a valid [CatalogDiscount](#type-catalogdiscount) object. - if type = `TAX`, only `tax_data` will be populated and it will contain a valid [CatalogTax](#type-catalogtax) object. For a more detailed discussion of the Catalog data model, please see the [Catalog Overview](/products/catalog/overview).
|
14
14
|
class CatalogObject
|
15
|
-
# The type of this object. Each object type has expected properties expressed in a structured format within its corresponding `*_data` field below.
|
15
|
+
# The type of this object. Each object type has expected properties expressed in a structured format within its corresponding `*_data` field below. See [CatalogObjectType](#type-catalogobjecttype) for possible values
|
16
16
|
attr_accessor :type
|
17
17
|
|
18
18
|
# An identifier to reference this object in the catalog. When a new CatalogObject is inserted, the client should set the id to a temporary identifier starting with a `'#'` character. Other objects being inserted or updated within the same request may use this identifier to refer to the new object. When the server receives the new object, it will supply a unique identifier that replaces the temporary identifier for all future references.
|
@@ -39,6 +39,9 @@ module SquareConnect
|
|
39
39
|
# A list of locations where the object is not present, even if `present_at_all_locations` is `true`.
|
40
40
|
attr_accessor :absent_at_location_ids
|
41
41
|
|
42
|
+
# Identifies the `CatalogImage` attached to this `CatalogObject`.
|
43
|
+
attr_accessor :image_id
|
44
|
+
|
42
45
|
# Structured data for a [CatalogItem](#type-catalogitem), set for CatalogObjects of type `ITEM`.
|
43
46
|
attr_accessor :item_data
|
44
47
|
|
@@ -60,6 +63,9 @@ module SquareConnect
|
|
60
63
|
# Structured data for a [CatalogModifier](#type-catalogmodifier), set for CatalogObjects of type `MODIFIER`.
|
61
64
|
attr_accessor :modifier_data
|
62
65
|
|
66
|
+
# Structured data for a [CatalogImage](#type-catalogimage), set for CatalogObjects of type `IMAGE`.
|
67
|
+
attr_accessor :image_data
|
68
|
+
|
63
69
|
class EnumAttributeValidator
|
64
70
|
attr_reader :datatype
|
65
71
|
attr_reader :allowable_values
|
@@ -94,13 +100,15 @@ module SquareConnect
|
|
94
100
|
:'present_at_all_locations' => :'present_at_all_locations',
|
95
101
|
:'present_at_location_ids' => :'present_at_location_ids',
|
96
102
|
:'absent_at_location_ids' => :'absent_at_location_ids',
|
103
|
+
:'image_id' => :'image_id',
|
97
104
|
:'item_data' => :'item_data',
|
98
105
|
:'category_data' => :'category_data',
|
99
106
|
:'item_variation_data' => :'item_variation_data',
|
100
107
|
:'tax_data' => :'tax_data',
|
101
108
|
:'discount_data' => :'discount_data',
|
102
109
|
:'modifier_list_data' => :'modifier_list_data',
|
103
|
-
:'modifier_data' => :'modifier_data'
|
110
|
+
:'modifier_data' => :'modifier_data',
|
111
|
+
:'image_data' => :'image_data'
|
104
112
|
}
|
105
113
|
end
|
106
114
|
|
@@ -116,13 +124,15 @@ module SquareConnect
|
|
116
124
|
:'present_at_all_locations' => :'BOOLEAN',
|
117
125
|
:'present_at_location_ids' => :'Array<String>',
|
118
126
|
:'absent_at_location_ids' => :'Array<String>',
|
127
|
+
:'image_id' => :'String',
|
119
128
|
:'item_data' => :'CatalogItem',
|
120
129
|
:'category_data' => :'CatalogCategory',
|
121
130
|
:'item_variation_data' => :'CatalogItemVariation',
|
122
131
|
:'tax_data' => :'CatalogTax',
|
123
132
|
:'discount_data' => :'CatalogDiscount',
|
124
133
|
:'modifier_list_data' => :'CatalogModifierList',
|
125
|
-
:'modifier_data' => :'CatalogModifier'
|
134
|
+
:'modifier_data' => :'CatalogModifier',
|
135
|
+
:'image_data' => :'CatalogImage'
|
126
136
|
}
|
127
137
|
end
|
128
138
|
|
@@ -176,6 +186,10 @@ module SquareConnect
|
|
176
186
|
end
|
177
187
|
end
|
178
188
|
|
189
|
+
if attributes.has_key?(:'image_id')
|
190
|
+
self.image_id = attributes[:'image_id']
|
191
|
+
end
|
192
|
+
|
179
193
|
if attributes.has_key?(:'item_data')
|
180
194
|
self.item_data = attributes[:'item_data']
|
181
195
|
end
|
@@ -204,6 +218,10 @@ module SquareConnect
|
|
204
218
|
self.modifier_data = attributes[:'modifier_data']
|
205
219
|
end
|
206
220
|
|
221
|
+
if attributes.has_key?(:'image_data')
|
222
|
+
self.image_data = attributes[:'image_data']
|
223
|
+
end
|
224
|
+
|
207
225
|
end
|
208
226
|
|
209
227
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -229,7 +247,7 @@ module SquareConnect
|
|
229
247
|
# @return true if the model is valid
|
230
248
|
def valid?
|
231
249
|
return false if @type.nil?
|
232
|
-
type_validator = EnumAttributeValidator.new('String', ["ITEM", "CATEGORY", "ITEM_VARIATION", "TAX", "DISCOUNT", "MODIFIER_LIST", "MODIFIER"])
|
250
|
+
type_validator = EnumAttributeValidator.new('String', ["ITEM", "IMAGE", "CATEGORY", "ITEM_VARIATION", "TAX", "DISCOUNT", "MODIFIER_LIST", "MODIFIER"])
|
233
251
|
return false unless type_validator.valid?(@type)
|
234
252
|
return false if @id.nil?
|
235
253
|
return false if @id.to_s.length < 1
|
@@ -239,7 +257,7 @@ module SquareConnect
|
|
239
257
|
# Custom attribute writer method checking allowed values (enum).
|
240
258
|
# @param [Object] type Object to be assigned
|
241
259
|
def type=(type)
|
242
|
-
validator = EnumAttributeValidator.new('String', ["ITEM", "CATEGORY", "ITEM_VARIATION", "TAX", "DISCOUNT", "MODIFIER_LIST", "MODIFIER"])
|
260
|
+
validator = EnumAttributeValidator.new('String', ["ITEM", "IMAGE", "CATEGORY", "ITEM_VARIATION", "TAX", "DISCOUNT", "MODIFIER_LIST", "MODIFIER"])
|
243
261
|
unless validator.valid?(type)
|
244
262
|
fail ArgumentError, "invalid value for 'type', must be one of #{validator.allowable_values}."
|
245
263
|
end
|
@@ -274,13 +292,15 @@ module SquareConnect
|
|
274
292
|
present_at_all_locations == o.present_at_all_locations &&
|
275
293
|
present_at_location_ids == o.present_at_location_ids &&
|
276
294
|
absent_at_location_ids == o.absent_at_location_ids &&
|
295
|
+
image_id == o.image_id &&
|
277
296
|
item_data == o.item_data &&
|
278
297
|
category_data == o.category_data &&
|
279
298
|
item_variation_data == o.item_variation_data &&
|
280
299
|
tax_data == o.tax_data &&
|
281
300
|
discount_data == o.discount_data &&
|
282
301
|
modifier_list_data == o.modifier_list_data &&
|
283
|
-
modifier_data == o.modifier_data
|
302
|
+
modifier_data == o.modifier_data &&
|
303
|
+
image_data == o.image_data
|
284
304
|
end
|
285
305
|
|
286
306
|
# @see the `==` method
|
@@ -292,7 +312,7 @@ module SquareConnect
|
|
292
312
|
# Calculates hash code according to all attributes.
|
293
313
|
# @return [Fixnum] Hash code
|
294
314
|
def hash
|
295
|
-
[type, id, updated_at, version, is_deleted, catalog_v1_ids, present_at_all_locations, present_at_location_ids, absent_at_location_ids, item_data, category_data, item_variation_data, tax_data, discount_data, modifier_list_data, modifier_data].hash
|
315
|
+
[type, id, updated_at, version, is_deleted, catalog_v1_ids, present_at_all_locations, present_at_location_ids, absent_at_location_ids, image_id, item_data, category_data, item_variation_data, tax_data, discount_data, modifier_list_data, modifier_data, image_data].hash
|
296
316
|
end
|
297
317
|
|
298
318
|
# Builds the object from hash
|
@@ -18,7 +18,7 @@ module SquareConnect
|
|
18
18
|
# The first attribute value to be returned by the query. Ascending sorts will return only objects with this value or greater, while descending sorts will return only objects with this value or less. If unset, start at the beginning (for ascending sorts) or end (for descending sorts).
|
19
19
|
attr_accessor :initial_attribute_value
|
20
20
|
|
21
|
-
# The desired [SortOrder](#type-sortorder), `\"ASC\"` (ascending) or `\"DESC\"` (descending).
|
21
|
+
# The desired [SortOrder](#type-sortorder), `\"ASC\"` (ascending) or `\"DESC\"` (descending). See [SortOrder](#type-sortorder) for possible values
|
22
22
|
attr_accessor :sort_order
|
23
23
|
|
24
24
|
class EnumAttributeValidator
|