square_connect 2.5.2.188 → 2.6.0.192

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b822c4b0439d5388d6cba2bb2e0af3ad62135e29933fdbf943f5b2c10f3927ef
4
- data.tar.gz: c163e603c4419d938bb6e668cc6422ceb5b86bc09f712812f038345cd024a63b
3
+ metadata.gz: 44c5c14d775fbda599f00c128ba2cf43e8aede3c53b2ca7c78f5fd4e5e8e996c
4
+ data.tar.gz: 599714d8420ee476a26117cd6cddc9e700dcb859b80c3cc289a97b98dc4e990f
5
5
  SHA512:
6
- metadata.gz: 98c9401964d6d5ba555c194a90f5fd356e9170f841db5c83ec73bb264cb3736cee889da2f6eb5412f89778c69ab79f467cd2e995d66b643d2e304bbb7972aabd
7
- data.tar.gz: bad35d45242ded843b9a698c21d7b4390040b749adcbdace0f7e73ad94376d7700af947db2a9d715766b5de7eebf3e2a151e7188097c97d8d862e1c7c78c81c0
6
+ metadata.gz: e569156270e4859310ceb35f0e54eecb9a3ea5581ce6a8e54f9a058ed7dd3ba95c867c6b2c24fc6f936c0199dd88ad28782e683bbf95955978f17c1f82d9e299
7
+ data.tar.gz: 7b63c3db8f224fdf5886d024f31e8f0a54ef27bc7f256f16300aef0e58980ca0f7306df5c1c17a9a4e469c5d0ca874c13e3fe35c777c02a207dc62ce71d24daf
data/CHANGES.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Change Log
2
2
 
3
+ ## Version 2.6.0 (2018-03-27)
4
+
5
+ ### Improvements: Orders API
6
+
7
+ * `BatchRetrieveOrders` will now return uncharged orders.
8
+
9
+ ### New features: Orders API
10
+
11
+ * For Catalog-backed line items, setting `CreateOrderRequestLineItem.base_price_money` will now override
12
+ the catalog item variation's price.
13
+ * `CreateOrderRequestModifier`s may now be created ad hoc using the new `name` and `base_price_money` fields.
14
+
3
15
  ## Version 2.5.2 (2018-01-06)
4
16
 
5
17
  * `OTHER` enum value is added to `Type` on `V1SettlementEntry`
data/README.md CHANGED
@@ -10,7 +10,7 @@ for the specification and template files we used to generate this.
10
10
  This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
11
11
 
12
12
  - API version: 2.0
13
- - Package version: 2.5.2
13
+ - Package version: 2.6.0
14
14
  - Build package: io.swagger.codegen.languages.RubyClientCodegen
15
15
 
16
16
  For more information, please visit [https://squareup.com/developers](https://squareup.com/developers)
@@ -10,7 +10,7 @@ Name | Type | Description | Notes
10
10
  **item_id** | **String** | The ID of the [CatalogItem](#type-catalogitem) associated with this item variation. Searchable. | [optional]
11
11
  **name** | **String** | The item variation's name. Searchable. | [optional]
12
12
  **sku** | **String** | The item variation's SKU, if any. Searchable. | [optional]
13
- **upc** | **String** | The item variation's UPC, if any. Searchable. | [optional]
13
+ **upc** | **String** | The item variation's UPC, if any. Searchable in the Connect API. This field is only exposed in the Connect API. It is not exposed in Square's Dashboard, Square Point of Sale app or Retail Point of Sale app. | [optional]
14
14
  **ordinal** | **Integer** | 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. | [optional]
15
15
  **pricing_type** | **String** | Indicates whether the item variation's price is fixed or determined at the time of sale. See [CatalogPricingType](#type-catalogpricingtype) for all possible values. | [optional]
16
16
  **price_money** | [**Money**](Money.md) | The item variation's price, if fixed pricing is used. | [optional]
@@ -7,9 +7,9 @@ Represents a line item to include in an order. Each line item describes a differ
7
7
  ## Properties
8
8
  Name | Type | Description | Notes
9
9
  ------------ | ------------- | ------------- | -------------
10
- **name** | **String** | Only used for ad hoc line items. The name of the line item. This value cannot exceed 500 characters. Do not provide a value for this field if you provide values in catalog_object_id. | [optional]
10
+ **name** | **String** | Only used for ad hoc line items. The name of the line item. This value cannot exceed 500 characters. Do not provide a value for this field if you provide a value for `catalog_object_id`. | [optional]
11
11
  **quantity** | **String** | The quantity to purchase, as a string representation of a number. This string must have a positive integer value. |
12
- **base_price_money** | [**Money**](Money.md) | Only used for ad hoc line items. The base price for a single unit of the line item's associated variation. Do not provide a value for this field if you provide a value for the `catalog_object_id`. | [optional]
12
+ **base_price_money** | [**Money**](Money.md) | The base price for a single unit of the line item. `base_price_money` is required for ad hoc line items and variable priced [CatalogItemVariation](#type-catalogitemvariation)s. If both `catalog_object_id` and `base_price_money` are set, `base_price_money` will override the CatalogItemVariation's price. | [optional]
13
13
  **variation_name** | **String** | Only used for ad hoc line items. The variation name of the line item. This value cannot exceed 255 characters. If this value is not set for an ad hoc line item, the default value of `Regular` is used. Do not provide a value for this field if you provide a value for the `catalog_object_id`. | [optional]
14
14
  **note** | **String** | The note of the line item. This value cannot exceed 50 characters. | [optional]
15
15
  **catalog_object_id** | **String** | Only used for Catalog line items. The catalog object ID for an existing [CatalogItemVariation](#type-catalogitemvariation). Do not provide a value for this field if you provide a value for `name` and `base_price_money`. | [optional]
@@ -2,11 +2,13 @@
2
2
 
3
3
  ### Description
4
4
 
5
- Represents a modifier applied to a single line item.
5
+ Represents a modifier applied to a single line item. Modifiers can reference existing objects in a merchant catalog or be constructed ad hoc at the time of purchase by providing a name and price.
6
6
 
7
7
  ## Properties
8
8
  Name | Type | Description | Notes
9
9
  ------------ | ------------- | ------------- | -------------
10
- **catalog_object_id** | **String** | The catalog object ID of a [CatalogModifier](#type-catalogmodifier). |
10
+ **catalog_object_id** | **String** | The catalog object ID of a [CatalogModifier](#type-catalogmodifier). | [optional]
11
+ **name** | **String** | Only used for ad hoc modifiers. The name of the modifier. `name` cannot exceed 255 characters. Do not provide a value for `name` if you provide a value for `catalog_object_id`. | [optional]
12
+ **base_price_money** | [**Money**](Money.md) | Only used for ad hoc modifiers. The base price for the modifier. Do not provide a value for `base_price_money` if you provide a value for `catalog_object_id`. | [optional]
11
13
 
12
14
 
@@ -8,7 +8,7 @@ Represents a tax that can apply to either a single line item or an entire order.
8
8
  Name | Type | Description | Notes
9
9
  ------------ | ------------- | ------------- | -------------
10
10
  **catalog_object_id** | **String** | Only used for catalog taxes. The catalog object ID of an existing [CatalogTax](#type-catalogtax). Do not provide a value for this field if you provide values in other fields for an ad hoc tax. | [optional]
11
- **name** | **String** | Only used for ad hoc taxes. The tax's name. Do not provide a value for this field if you set catalog_object_id. | [optional]
11
+ **name** | **String** | Only used for ad hoc taxes. The tax's name. Do not provide a value for this field if you set `catalog_object_id`. | [optional]
12
12
  **type** | **String** | Only used for ad hoc taxes. Indicates the calculation method used to apply the line item tax. Default: `ADDITIVE`; See [OrderLineItemTaxType](#type-orderlineitemtaxtype) for possible values. | [optional]
13
13
  **percentage** | **String** | Only used for ad hoc taxes. The percentage of the tax, as a string representation of a decimal number. A value of `7.25` corresponds to a percentage of 7.25%. This value range between 0.0 up to 100.0 | [optional]
14
14
 
@@ -8,9 +8,9 @@ Contains all information related to a single order to process with Square, inclu
8
8
  Name | Type | Description | Notes
9
9
  ------------ | ------------- | ------------- | -------------
10
10
  **id** | **String** | The order's unique ID. This value is only present for Order objects created by the Orders API through the [CreateOrder](#endpoint-createorder) endpoint. | [optional]
11
- **location_id** | **String** | The ID of the merchant location this order is associated with. | [optional]
11
+ **location_id** | **String** | The ID of the merchant location this order is associated with. |
12
12
  **reference_id** | **String** | A client specified identifier to associate an entity in another system with this order. | [optional]
13
- **line_items** | [**Array<OrderLineItem>**](OrderLineItem.md) | The line items included in the order. Every order has at least one line item. | [optional]
13
+ **line_items** | [**Array<OrderLineItem>**](OrderLineItem.md) | The line items included in the order. Every order has at least one line item. |
14
14
  **total_money** | [**Money**](Money.md) | The total amount of money to collect for the order. | [optional]
15
15
  **total_tax_money** | [**Money**](Money.md) | The total tax amount of money to collect for the order. | [optional]
16
16
  **total_discount_money** | [**Money**](Money.md) | The total discount amount of money to collect for the order. | [optional]
@@ -8,7 +8,7 @@ Represents a line item in an order. Each line item describes a different product
8
8
  Name | Type | Description | Notes
9
9
  ------------ | ------------- | ------------- | -------------
10
10
  **name** | **String** | The name of the line item. | [optional]
11
- **quantity** | **String** | The quantity purchased, as a string representation of a number. | [optional]
11
+ **quantity** | **String** | The quantity purchased, as a string representation of a number. |
12
12
  **note** | **String** | The note of the line item. | [optional]
13
13
  **catalog_object_id** | **String** | The [CatalogItemVariation](#type-catalogitemvariation) id applied to this line item. | [optional]
14
14
  **variation_name** | **String** | The name of the variation applied to this line item. | [optional]
@@ -13,7 +13,7 @@ Method | HTTP request | Description
13
13
 
14
14
  BatchRetrieveOrders
15
15
 
16
- Retrieves a set of [Order](#type-order)s by their IDs. Only orders that have been successfully charged are included in the response. If any of the order IDs in the request do not exist, or are associated with uncharged orders, then those orders will not be included in the set of orders in the response. Note that in the future, uncharged orders may be returned by this endpoint.
16
+ Retrieves a set of [Order](#type-order)s by their IDs. If a provided Order ID does not exist, it is ignored instead of resulting in an error.
17
17
 
18
18
  ### Example
19
19
  ```ruby
@@ -18,7 +18,7 @@ module SquareConnect
18
18
  end
19
19
 
20
20
  # BatchRetrieveOrders
21
- # Retrieves a set of [Order](#type-order)s by their IDs. Only orders that have been successfully charged are included in the response. If any of the order IDs in the request do not exist, or are associated with uncharged orders, then those orders will not be included in the set of orders in the response. Note that in the future, uncharged orders may be returned by this endpoint.
21
+ # Retrieves a set of [Order](#type-order)s by their IDs. If a provided Order ID does not exist, it is ignored instead of resulting in an error.
22
22
  # @param location_id The ID of the orders' associated location.
23
23
  # @param body An object containing the fields to POST for the request. See the corresponding object definition for field details.
24
24
  # @param [Hash] opts the optional parameters
@@ -29,7 +29,7 @@ module SquareConnect
29
29
  end
30
30
 
31
31
  # BatchRetrieveOrders
32
- # Retrieves a set of [Order](#type-order)s by their IDs. Only orders that have been successfully charged are included in the response. If any of the order IDs in the request do not exist, or are associated with uncharged orders, then those orders will not be included in the set of orders in the response. Note that in the future, uncharged orders may be returned by this endpoint.
32
+ # Retrieves a set of [Order](#type-order)s by their IDs. If a provided Order ID does not exist, it is ignored instead of resulting in an error.
33
33
  # @param location_id The ID of the orders' associated location.
34
34
  # @param body An object containing the fields to POST for the request. See the corresponding object definition for field details.
35
35
  # @param [Hash] opts the optional parameters
@@ -21,7 +21,7 @@ module SquareConnect
21
21
  # The item variation's SKU, if any. Searchable.
22
22
  attr_accessor :sku
23
23
 
24
- # The item variation's UPC, if any. Searchable.
24
+ # The item variation's UPC, if any. Searchable in the Connect API. This field is only exposed in the Connect API. It is not exposed in Square's Dashboard, Square Point of Sale app or Retail Point of Sale app.
25
25
  attr_accessor :upc
26
26
 
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.
@@ -12,13 +12,13 @@ require 'date'
12
12
  module SquareConnect
13
13
  # Represents a line item to include in an order. Each line item describes a different product to purchase, with its own quantity and price details. Line items can either reference objects from the merchant's catalog, or can alternatively specify a name and price instead.
14
14
  class CreateOrderRequestLineItem
15
- # Only used for ad hoc line items. The name of the line item. This value cannot exceed 500 characters. Do not provide a value for this field if you provide values in catalog_object_id.
15
+ # Only used for ad hoc line items. The name of the line item. This value cannot exceed 500 characters. Do not provide a value for this field if you provide a value for `catalog_object_id`.
16
16
  attr_accessor :name
17
17
 
18
18
  # The quantity to purchase, as a string representation of a number. This string must have a positive integer value.
19
19
  attr_accessor :quantity
20
20
 
21
- # Only used for ad hoc line items. The base price for a single unit of the line item's associated variation. Do not provide a value for this field if you provide a value for the `catalog_object_id`.
21
+ # The base price for a single unit of the line item. `base_price_money` is required for ad hoc line items and variable priced [CatalogItemVariation](#type-catalogitemvariation)s. If both `catalog_object_id` and `base_price_money` are set, `base_price_money` will override the CatalogItemVariation's price.
22
22
  attr_accessor :base_price_money
23
23
 
24
24
  # Only used for ad hoc line items. The variation name of the line item. This value cannot exceed 255 characters. If this value is not set for an ad hoc line item, the default value of `Regular` is used. Do not provide a value for this field if you provide a value for the `catalog_object_id`.
@@ -10,23 +10,33 @@ Generated by: https://github.com/swagger-api/swagger-codegen.git
10
10
  require 'date'
11
11
 
12
12
  module SquareConnect
13
- # Represents a modifier applied to a single line item.
13
+ # Represents a modifier applied to a single line item. Modifiers can reference existing objects in a merchant catalog or be constructed ad hoc at the time of purchase by providing a name and price.
14
14
  class CreateOrderRequestModifier
15
15
  # The catalog object ID of a [CatalogModifier](#type-catalogmodifier).
16
16
  attr_accessor :catalog_object_id
17
17
 
18
+ # Only used for ad hoc modifiers. The name of the modifier. `name` cannot exceed 255 characters. Do not provide a value for `name` if you provide a value for `catalog_object_id`.
19
+ attr_accessor :name
20
+
21
+ # Only used for ad hoc modifiers. The base price for the modifier. Do not provide a value for `base_price_money` if you provide a value for `catalog_object_id`.
22
+ attr_accessor :base_price_money
23
+
18
24
 
19
25
  # Attribute mapping from ruby-style variable name to JSON key.
20
26
  def self.attribute_map
21
27
  {
22
- :'catalog_object_id' => :'catalog_object_id'
28
+ :'catalog_object_id' => :'catalog_object_id',
29
+ :'name' => :'name',
30
+ :'base_price_money' => :'base_price_money'
23
31
  }
24
32
  end
25
33
 
26
34
  # Attribute type mapping.
27
35
  def self.swagger_types
28
36
  {
29
- :'catalog_object_id' => :'String'
37
+ :'catalog_object_id' => :'String',
38
+ :'name' => :'String',
39
+ :'base_price_money' => :'Money'
30
40
  }
31
41
  end
32
42
 
@@ -42,22 +52,26 @@ module SquareConnect
42
52
  self.catalog_object_id = attributes[:'catalog_object_id']
43
53
  end
44
54
 
55
+ if attributes.has_key?(:'name')
56
+ self.name = attributes[:'name']
57
+ end
58
+
59
+ if attributes.has_key?(:'base_price_money')
60
+ self.base_price_money = attributes[:'base_price_money']
61
+ end
62
+
45
63
  end
46
64
 
47
65
  # Show invalid properties with the reasons. Usually used together with valid?
48
66
  # @return Array for valid properies with the reasons
49
67
  def list_invalid_properties
50
68
  invalid_properties = Array.new
51
- if @catalog_object_id.nil?
52
- invalid_properties.push("invalid value for 'catalog_object_id', catalog_object_id cannot be nil.")
53
- end
54
-
55
- if @catalog_object_id.to_s.length > 192
69
+ if !@catalog_object_id.nil? && @catalog_object_id.to_s.length > 192
56
70
  invalid_properties.push("invalid value for 'catalog_object_id', the character length must be smaller than or equal to 192.")
57
71
  end
58
72
 
59
- if @catalog_object_id.to_s.length < 1
60
- invalid_properties.push("invalid value for 'catalog_object_id', the character length must be great than or equal to 1.")
73
+ if !@name.nil? && @name.to_s.length > 255
74
+ invalid_properties.push("invalid value for 'name', the character length must be smaller than or equal to 255.")
61
75
  end
62
76
 
63
77
  return invalid_properties
@@ -66,28 +80,31 @@ module SquareConnect
66
80
  # Check to see if the all the properties in the model are valid
67
81
  # @return true if the model is valid
68
82
  def valid?
69
- return false if @catalog_object_id.nil?
70
- return false if @catalog_object_id.to_s.length > 192
71
- return false if @catalog_object_id.to_s.length < 1
83
+ return false if !@catalog_object_id.nil? && @catalog_object_id.to_s.length > 192
84
+ return false if !@name.nil? && @name.to_s.length > 255
72
85
  return true
73
86
  end
74
87
 
75
88
  # Custom attribute writer method with validation
76
89
  # @param [Object] catalog_object_id Value to be assigned
77
90
  def catalog_object_id=(catalog_object_id)
78
- if catalog_object_id.nil?
79
- fail ArgumentError, "catalog_object_id cannot be nil"
80
- end
81
91
 
82
- if catalog_object_id.to_s.length > 192
92
+ if !catalog_object_id.nil? && catalog_object_id.to_s.length > 192
83
93
  fail ArgumentError, "invalid value for 'catalog_object_id', the character length must be smaller than or equal to 192."
84
94
  end
85
95
 
86
- if catalog_object_id.to_s.length < 1
87
- fail ArgumentError, "invalid value for 'catalog_object_id', the character length must be great than or equal to 1."
96
+ @catalog_object_id = catalog_object_id
97
+ end
98
+
99
+ # Custom attribute writer method with validation
100
+ # @param [Object] name Value to be assigned
101
+ def name=(name)
102
+
103
+ if !name.nil? && name.to_s.length > 255
104
+ fail ArgumentError, "invalid value for 'name', the character length must be smaller than or equal to 255."
88
105
  end
89
106
 
90
- @catalog_object_id = catalog_object_id
107
+ @name = name
91
108
  end
92
109
 
93
110
  # Checks equality by comparing each attribute.
@@ -95,7 +112,9 @@ module SquareConnect
95
112
  def ==(o)
96
113
  return true if self.equal?(o)
97
114
  self.class == o.class &&
98
- catalog_object_id == o.catalog_object_id
115
+ catalog_object_id == o.catalog_object_id &&
116
+ name == o.name &&
117
+ base_price_money == o.base_price_money
99
118
  end
100
119
 
101
120
  # @see the `==` method
@@ -107,7 +126,7 @@ module SquareConnect
107
126
  # Calculates hash code according to all attributes.
108
127
  # @return [Fixnum] Hash code
109
128
  def hash
110
- [catalog_object_id].hash
129
+ [catalog_object_id, name, base_price_money].hash
111
130
  end
112
131
 
113
132
  # Builds the object from hash
@@ -15,7 +15,7 @@ module SquareConnect
15
15
  # Only used for catalog taxes. The catalog object ID of an existing [CatalogTax](#type-catalogtax). Do not provide a value for this field if you provide values in other fields for an ad hoc tax.
16
16
  attr_accessor :catalog_object_id
17
17
 
18
- # Only used for ad hoc taxes. The tax's name. Do not provide a value for this field if you set catalog_object_id.
18
+ # Only used for ad hoc taxes. The tax's name. Do not provide a value for this field if you set `catalog_object_id`.
19
19
  attr_accessor :name
20
20
 
21
21
  # Only used for ad hoc taxes. Indicates the calculation method used to apply the line item tax. Default: `ADDITIVE`; See [OrderLineItemTaxType](#type-orderlineitemtaxtype) for possible values.
@@ -104,15 +104,60 @@ module SquareConnect
104
104
  # @return Array for valid properies with the reasons
105
105
  def list_invalid_properties
106
106
  invalid_properties = Array.new
107
+ if @location_id.nil?
108
+ invalid_properties.push("invalid value for 'location_id', location_id cannot be nil.")
109
+ end
110
+
111
+ if @location_id.to_s.length < 1
112
+ invalid_properties.push("invalid value for 'location_id', the character length must be great than or equal to 1.")
113
+ end
114
+
115
+ if !@reference_id.nil? && @reference_id.to_s.length > 40
116
+ invalid_properties.push("invalid value for 'reference_id', the character length must be smaller than or equal to 40.")
117
+ end
118
+
119
+ if @line_items.nil?
120
+ invalid_properties.push("invalid value for 'line_items', line_items cannot be nil.")
121
+ end
122
+
107
123
  return invalid_properties
108
124
  end
109
125
 
110
126
  # Check to see if the all the properties in the model are valid
111
127
  # @return true if the model is valid
112
128
  def valid?
129
+ return false if @location_id.nil?
130
+ return false if @location_id.to_s.length < 1
131
+ return false if !@reference_id.nil? && @reference_id.to_s.length > 40
132
+ return false if @line_items.nil?
113
133
  return true
114
134
  end
115
135
 
136
+ # Custom attribute writer method with validation
137
+ # @param [Object] location_id Value to be assigned
138
+ def location_id=(location_id)
139
+ if location_id.nil?
140
+ fail ArgumentError, "location_id cannot be nil"
141
+ end
142
+
143
+ if location_id.to_s.length < 1
144
+ fail ArgumentError, "invalid value for 'location_id', the character length must be great than or equal to 1."
145
+ end
146
+
147
+ @location_id = location_id
148
+ end
149
+
150
+ # Custom attribute writer method with validation
151
+ # @param [Object] reference_id Value to be assigned
152
+ def reference_id=(reference_id)
153
+
154
+ if !reference_id.nil? && reference_id.to_s.length > 40
155
+ fail ArgumentError, "invalid value for 'reference_id', the character length must be smaller than or equal to 40."
156
+ end
157
+
158
+ @reference_id = reference_id
159
+ end
160
+
116
161
  # Checks equality by comparing each attribute.
117
162
  # @param [Object] Object to be compared
118
163
  def ==(o)
@@ -162,15 +162,112 @@ module SquareConnect
162
162
  # @return Array for valid properies with the reasons
163
163
  def list_invalid_properties
164
164
  invalid_properties = Array.new
165
+ if !@name.nil? && @name.to_s.length > 500
166
+ invalid_properties.push("invalid value for 'name', the character length must be smaller than or equal to 500.")
167
+ end
168
+
169
+ if @quantity.nil?
170
+ invalid_properties.push("invalid value for 'quantity', quantity cannot be nil.")
171
+ end
172
+
173
+ if @quantity.to_s.length > 5
174
+ invalid_properties.push("invalid value for 'quantity', the character length must be smaller than or equal to 5.")
175
+ end
176
+
177
+ if @quantity.to_s.length < 1
178
+ invalid_properties.push("invalid value for 'quantity', the character length must be great than or equal to 1.")
179
+ end
180
+
181
+ if !@note.nil? && @note.to_s.length > 50
182
+ invalid_properties.push("invalid value for 'note', the character length must be smaller than or equal to 50.")
183
+ end
184
+
185
+ if !@catalog_object_id.nil? && @catalog_object_id.to_s.length > 192
186
+ invalid_properties.push("invalid value for 'catalog_object_id', the character length must be smaller than or equal to 192.")
187
+ end
188
+
189
+ if !@variation_name.nil? && @variation_name.to_s.length > 255
190
+ invalid_properties.push("invalid value for 'variation_name', the character length must be smaller than or equal to 255.")
191
+ end
192
+
165
193
  return invalid_properties
166
194
  end
167
195
 
168
196
  # Check to see if the all the properties in the model are valid
169
197
  # @return true if the model is valid
170
198
  def valid?
199
+ return false if !@name.nil? && @name.to_s.length > 500
200
+ return false if @quantity.nil?
201
+ return false if @quantity.to_s.length > 5
202
+ return false if @quantity.to_s.length < 1
203
+ return false if !@note.nil? && @note.to_s.length > 50
204
+ return false if !@catalog_object_id.nil? && @catalog_object_id.to_s.length > 192
205
+ return false if !@variation_name.nil? && @variation_name.to_s.length > 255
171
206
  return true
172
207
  end
173
208
 
209
+ # Custom attribute writer method with validation
210
+ # @param [Object] name Value to be assigned
211
+ def name=(name)
212
+
213
+ if !name.nil? && name.to_s.length > 500
214
+ fail ArgumentError, "invalid value for 'name', the character length must be smaller than or equal to 500."
215
+ end
216
+
217
+ @name = name
218
+ end
219
+
220
+ # Custom attribute writer method with validation
221
+ # @param [Object] quantity Value to be assigned
222
+ def quantity=(quantity)
223
+ if quantity.nil?
224
+ fail ArgumentError, "quantity cannot be nil"
225
+ end
226
+
227
+ if quantity.to_s.length > 5
228
+ fail ArgumentError, "invalid value for 'quantity', the character length must be smaller than or equal to 5."
229
+ end
230
+
231
+ if quantity.to_s.length < 1
232
+ fail ArgumentError, "invalid value for 'quantity', the character length must be great than or equal to 1."
233
+ end
234
+
235
+ @quantity = quantity
236
+ end
237
+
238
+ # Custom attribute writer method with validation
239
+ # @param [Object] note Value to be assigned
240
+ def note=(note)
241
+
242
+ if !note.nil? && note.to_s.length > 50
243
+ fail ArgumentError, "invalid value for 'note', the character length must be smaller than or equal to 50."
244
+ end
245
+
246
+ @note = note
247
+ end
248
+
249
+ # Custom attribute writer method with validation
250
+ # @param [Object] catalog_object_id Value to be assigned
251
+ def catalog_object_id=(catalog_object_id)
252
+
253
+ if !catalog_object_id.nil? && catalog_object_id.to_s.length > 192
254
+ fail ArgumentError, "invalid value for 'catalog_object_id', the character length must be smaller than or equal to 192."
255
+ end
256
+
257
+ @catalog_object_id = catalog_object_id
258
+ end
259
+
260
+ # Custom attribute writer method with validation
261
+ # @param [Object] variation_name Value to be assigned
262
+ def variation_name=(variation_name)
263
+
264
+ if !variation_name.nil? && variation_name.to_s.length > 255
265
+ fail ArgumentError, "invalid value for 'variation_name', the character length must be smaller than or equal to 255."
266
+ end
267
+
268
+ @variation_name = variation_name
269
+ end
270
+
174
271
  # Checks equality by comparing each attribute.
175
272
  # @param [Object] Object to be compared
176
273
  def ==(o)
@@ -123,19 +123,56 @@ module SquareConnect
123
123
  # @return Array for valid properies with the reasons
124
124
  def list_invalid_properties
125
125
  invalid_properties = Array.new
126
+ if !@catalog_object_id.nil? && @catalog_object_id.to_s.length > 192
127
+ invalid_properties.push("invalid value for 'catalog_object_id', the character length must be smaller than or equal to 192.")
128
+ end
129
+
130
+ if !@name.nil? && @name.to_s.length > 255
131
+ invalid_properties.push("invalid value for 'name', the character length must be smaller than or equal to 255.")
132
+ end
133
+
134
+ if !@percentage.nil? && @percentage.to_s.length > 10
135
+ invalid_properties.push("invalid value for 'percentage', the character length must be smaller than or equal to 10.")
136
+ end
137
+
126
138
  return invalid_properties
127
139
  end
128
140
 
129
141
  # Check to see if the all the properties in the model are valid
130
142
  # @return true if the model is valid
131
143
  def valid?
144
+ return false if !@catalog_object_id.nil? && @catalog_object_id.to_s.length > 192
145
+ return false if !@name.nil? && @name.to_s.length > 255
132
146
  type_validator = EnumAttributeValidator.new('String', ["UNKNOWN_DISCOUNT", "FIXED_PERCENTAGE", "FIXED_AMOUNT", "VARIABLE_PERCENTAGE", "VARIABLE_AMOUNT"])
133
147
  return false unless type_validator.valid?(@type)
148
+ return false if !@percentage.nil? && @percentage.to_s.length > 10
134
149
  scope_validator = EnumAttributeValidator.new('String', ["OTHER_DISCOUNT_SCOPE", "LINE_ITEM", "ORDER"])
135
150
  return false unless scope_validator.valid?(@scope)
136
151
  return true
137
152
  end
138
153
 
154
+ # Custom attribute writer method with validation
155
+ # @param [Object] catalog_object_id Value to be assigned
156
+ def catalog_object_id=(catalog_object_id)
157
+
158
+ if !catalog_object_id.nil? && catalog_object_id.to_s.length > 192
159
+ fail ArgumentError, "invalid value for 'catalog_object_id', the character length must be smaller than or equal to 192."
160
+ end
161
+
162
+ @catalog_object_id = catalog_object_id
163
+ end
164
+
165
+ # Custom attribute writer method with validation
166
+ # @param [Object] name Value to be assigned
167
+ def name=(name)
168
+
169
+ if !name.nil? && name.to_s.length > 255
170
+ fail ArgumentError, "invalid value for 'name', the character length must be smaller than or equal to 255."
171
+ end
172
+
173
+ @name = name
174
+ end
175
+
139
176
  # Custom attribute writer method checking allowed values (enum).
140
177
  # @param [Object] type Object to be assigned
141
178
  def type=(type)
@@ -146,6 +183,17 @@ module SquareConnect
146
183
  @type = type
147
184
  end
148
185
 
186
+ # Custom attribute writer method with validation
187
+ # @param [Object] percentage Value to be assigned
188
+ def percentage=(percentage)
189
+
190
+ if !percentage.nil? && percentage.to_s.length > 10
191
+ fail ArgumentError, "invalid value for 'percentage', the character length must be smaller than or equal to 10."
192
+ end
193
+
194
+ @percentage = percentage
195
+ end
196
+
149
197
  # Custom attribute writer method checking allowed values (enum).
150
198
  # @param [Object] scope Object to be assigned
151
199
  def scope=(scope)
@@ -75,15 +75,47 @@ module SquareConnect
75
75
  # @return Array for valid properies with the reasons
76
76
  def list_invalid_properties
77
77
  invalid_properties = Array.new
78
+ if !@catalog_object_id.nil? && @catalog_object_id.to_s.length > 192
79
+ invalid_properties.push("invalid value for 'catalog_object_id', the character length must be smaller than or equal to 192.")
80
+ end
81
+
82
+ if !@name.nil? && @name.to_s.length > 255
83
+ invalid_properties.push("invalid value for 'name', the character length must be smaller than or equal to 255.")
84
+ end
85
+
78
86
  return invalid_properties
79
87
  end
80
88
 
81
89
  # Check to see if the all the properties in the model are valid
82
90
  # @return true if the model is valid
83
91
  def valid?
92
+ return false if !@catalog_object_id.nil? && @catalog_object_id.to_s.length > 192
93
+ return false if !@name.nil? && @name.to_s.length > 255
84
94
  return true
85
95
  end
86
96
 
97
+ # Custom attribute writer method with validation
98
+ # @param [Object] catalog_object_id Value to be assigned
99
+ def catalog_object_id=(catalog_object_id)
100
+
101
+ if !catalog_object_id.nil? && catalog_object_id.to_s.length > 192
102
+ fail ArgumentError, "invalid value for 'catalog_object_id', the character length must be smaller than or equal to 192."
103
+ end
104
+
105
+ @catalog_object_id = catalog_object_id
106
+ end
107
+
108
+ # Custom attribute writer method with validation
109
+ # @param [Object] name Value to be assigned
110
+ def name=(name)
111
+
112
+ if !name.nil? && name.to_s.length > 255
113
+ fail ArgumentError, "invalid value for 'name', the character length must be smaller than or equal to 255."
114
+ end
115
+
116
+ @name = name
117
+ end
118
+
87
119
  # Checks equality by comparing each attribute.
88
120
  # @param [Object] Object to be compared
89
121
  def ==(o)
@@ -105,17 +105,54 @@ module SquareConnect
105
105
  # @return Array for valid properies with the reasons
106
106
  def list_invalid_properties
107
107
  invalid_properties = Array.new
108
+ if !@catalog_object_id.nil? && @catalog_object_id.to_s.length > 192
109
+ invalid_properties.push("invalid value for 'catalog_object_id', the character length must be smaller than or equal to 192.")
110
+ end
111
+
112
+ if !@name.nil? && @name.to_s.length > 255
113
+ invalid_properties.push("invalid value for 'name', the character length must be smaller than or equal to 255.")
114
+ end
115
+
116
+ if !@percentage.nil? && @percentage.to_s.length > 10
117
+ invalid_properties.push("invalid value for 'percentage', the character length must be smaller than or equal to 10.")
118
+ end
119
+
108
120
  return invalid_properties
109
121
  end
110
122
 
111
123
  # Check to see if the all the properties in the model are valid
112
124
  # @return true if the model is valid
113
125
  def valid?
126
+ return false if !@catalog_object_id.nil? && @catalog_object_id.to_s.length > 192
127
+ return false if !@name.nil? && @name.to_s.length > 255
114
128
  type_validator = EnumAttributeValidator.new('String', ["UNKNOWN_TAX", "ADDITIVE", "INCLUSIVE"])
115
129
  return false unless type_validator.valid?(@type)
130
+ return false if !@percentage.nil? && @percentage.to_s.length > 10
116
131
  return true
117
132
  end
118
133
 
134
+ # Custom attribute writer method with validation
135
+ # @param [Object] catalog_object_id Value to be assigned
136
+ def catalog_object_id=(catalog_object_id)
137
+
138
+ if !catalog_object_id.nil? && catalog_object_id.to_s.length > 192
139
+ fail ArgumentError, "invalid value for 'catalog_object_id', the character length must be smaller than or equal to 192."
140
+ end
141
+
142
+ @catalog_object_id = catalog_object_id
143
+ end
144
+
145
+ # Custom attribute writer method with validation
146
+ # @param [Object] name Value to be assigned
147
+ def name=(name)
148
+
149
+ if !name.nil? && name.to_s.length > 255
150
+ fail ArgumentError, "invalid value for 'name', the character length must be smaller than or equal to 255."
151
+ end
152
+
153
+ @name = name
154
+ end
155
+
119
156
  # Custom attribute writer method checking allowed values (enum).
120
157
  # @param [Object] type Object to be assigned
121
158
  def type=(type)
@@ -126,6 +163,17 @@ module SquareConnect
126
163
  @type = type
127
164
  end
128
165
 
166
+ # Custom attribute writer method with validation
167
+ # @param [Object] percentage Value to be assigned
168
+ def percentage=(percentage)
169
+
170
+ if !percentage.nil? && percentage.to_s.length > 10
171
+ fail ArgumentError, "invalid value for 'percentage', the character length must be smaller than or equal to 10."
172
+ end
173
+
174
+ @percentage = percentage
175
+ end
176
+
129
177
  # Checks equality by comparing each attribute.
130
178
  # @param [Object] Object to be compared
131
179
  def ==(o)
@@ -12,7 +12,7 @@ require 'date'
12
12
  module SquareConnect
13
13
 
14
14
  class V1Refund
15
- # The type of refund
15
+ # The type of refund
16
16
  attr_accessor :type
17
17
 
18
18
  # The merchant-specified reason for the refund.
@@ -30,7 +30,7 @@ module SquareConnect
30
30
  # The Square-issued ID of the payment the refund is applied to.
31
31
  attr_accessor :payment_id
32
32
 
33
- #
33
+ #
34
34
  attr_accessor :merchant_id
35
35
 
36
36
  class EnumAttributeValidator
@@ -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.5.2"
11
+ VERSION = "2.6.0"
12
12
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: square_connect
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.2.188
4
+ version: 2.6.0.192
5
5
  platform: ruby
6
6
  authors:
7
7
  - Square, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-02-07 00:00:00.000000000 Z
11
+ date: 2018-03-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus
@@ -806,7 +806,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
806
806
  version: '0'
807
807
  requirements: []
808
808
  rubyforge_project:
809
- rubygems_version: 2.7.5
809
+ rubygems_version: 2.7.6
810
810
  signing_key:
811
811
  specification_version: 4
812
812
  summary: Square Connect API Ruby Gem