ultracart_api 4.1.135 → 4.1.136

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8b487dcc970f593d8627f732555a09cf616b945dcbe97e747fe61eed8ccf656b
4
- data.tar.gz: 67e2d656f6b4bbe9b71de89c645de13d9b3e0cce2ec15b5f6ee9d77d44679785
3
+ metadata.gz: 9ab1f7526673cdcb1a99d61bf3befc9b24ebb910c4fe4917c529a4826a18dbd3
4
+ data.tar.gz: 2e63388dec8bcdb0a7bb9abfadebd8dc1048755da6928a27d9b8de5ca2bec676
5
5
  SHA512:
6
- metadata.gz: f0b8a863515e2a3784404f468f5e7c1c9567c024b2adad79db0f46a979ef39ca59294d1e0e6b1b5e1085316cf1ae97fed9d321493cf0107ba33c60b050daf773
7
- data.tar.gz: 9f81939e39f51cfe6420e3f5b0997342d9c32b032539534845b6f1e1d24bc1935e046b1e2f0af6a2c6d5e1f1fa3d47e22ebeba6a2259c391b0c547870a429ecd
6
+ metadata.gz: da5f2c3d2c64a380d5ae5b04dd2c53cad336723e9814751bdb9f02ca73816f2618bfb8f2b2246423cb86918b25c6878a7699294f6a119899b66ac98ee5ae70ad
7
+ data.tar.gz: 89747bb0a739ce9dd9006e6c5e25c0763b8f5f9e1bcdcc8677f54b49c480627820b683acba615d86bde23bb1e9a030000406697dd925e21e9ac67e66491e4ab7
data/README.md CHANGED
@@ -7,7 +7,7 @@ Note: Every method has a sample for every language. See https://github.com/Ultr
7
7
  This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
8
8
 
9
9
  - API version: 2.0.0
10
- - Package version: 4.1.135
10
+ - Package version: 4.1.136
11
11
  - Build package: org.openapitools.codegen.languages.RubyClientCodegen
12
12
  - For more information, please visit [http://www.ultracart.com/api/](http://www.ultracart.com/api/)
13
13
 
@@ -16,7 +16,7 @@ This SDK is automatically generated by the [OpenAPI Generator](https://openapi-g
16
16
  gemfile:
17
17
 
18
18
  ```shell
19
- gem 'ultracart_api', '4.1.135'
19
+ gem 'ultracart_api', '4.1.136'
20
20
  ```
21
21
 
22
22
  install:
@@ -315,12 +315,14 @@ Class | Method | HTTP request | Description
315
315
  *UltracartClient::CouponApi* | [**upload_coupon_codes**](docs/CouponApi.md#upload_coupon_codes) | **POST** /coupon/coupons/{coupon_oid}/upload_codes | Upload one-time codes for a coupon
316
316
  *UltracartClient::CustomerApi* | [**add_customer_store_credit**](docs/CustomerApi.md#add_customer_store_credit) | **POST** /customer/customers/{customer_profile_oid}/store_credit | Adds store credit to a customer
317
317
  *UltracartClient::CustomerApi* | [**adjust_internal_certificate**](docs/CustomerApi.md#adjust_internal_certificate) | **POST** /customer/customers/{customer_profile_oid}/adjust_cashback_balance | Updates the cashback balance for a customer by updating the internal gift certificate used, creating the gift certificate if needed.
318
+ *UltracartClient::CustomerApi* | [**adjust_loyalty_points**](docs/CustomerApi.md#adjust_loyalty_points) | **POST** /customer/customers/{customer_profile_oid}/adjust_loyalty_points | Adjusts the loyalty points for a customer by adding a record to the loyalty ledger.
318
319
  *UltracartClient::CustomerApi* | [**delete_customer**](docs/CustomerApi.md#delete_customer) | **DELETE** /customer/customers/{customer_profile_oid} | Delete a customer
319
320
  *UltracartClient::CustomerApi* | [**delete_wish_list_item**](docs/CustomerApi.md#delete_wish_list_item) | **DELETE** /customer/customers/{customer_profile_oid}/wishlist/{customer_wishlist_item_oid} | Delete a customer wishlist item
320
321
  *UltracartClient::CustomerApi* | [**get_customer**](docs/CustomerApi.md#get_customer) | **GET** /customer/customers/{customer_profile_oid} | Retrieve a customer
321
322
  *UltracartClient::CustomerApi* | [**get_customer_by_email**](docs/CustomerApi.md#get_customer_by_email) | **GET** /customer/customers/by_email/{email} | Retrieve a customer by Email
322
323
  *UltracartClient::CustomerApi* | [**get_customer_editor_values**](docs/CustomerApi.md#get_customer_editor_values) | **GET** /customer/editor_values | Retrieve values needed for a customer profile editor
323
324
  *UltracartClient::CustomerApi* | [**get_customer_email_lists**](docs/CustomerApi.md#get_customer_email_lists) | **GET** /customer/email_lists | Retrieve all email lists across all storefronts
325
+ *UltracartClient::CustomerApi* | [**get_customer_loyalty**](docs/CustomerApi.md#get_customer_loyalty) | **GET** /customer/customers/{customer_profile_oid}/loyalty | Retrieve the loyalty points, ledger and redemptions for a customer
324
326
  *UltracartClient::CustomerApi* | [**get_customer_store_credit**](docs/CustomerApi.md#get_customer_store_credit) | **GET** /customer/customers/{customer_profile_oid}/store_credit | Retrieve the customer store credit accumulated through loyalty programs
325
327
  *UltracartClient::CustomerApi* | [**get_customer_wish_list**](docs/CustomerApi.md#get_customer_wish_list) | **GET** /customer/customers/{customer_profile_oid}/wishlist | Retrieve wishlist items for customer
326
328
  *UltracartClient::CustomerApi* | [**get_customer_wish_list_item**](docs/CustomerApi.md#get_customer_wish_list_item) | **GET** /customer/customers/{customer_profile_oid}/wishlist/{customer_wishlist_item_oid} | Retrieve wishlist item for customer
@@ -734,6 +736,8 @@ Class | Method | HTTP request | Description
734
736
  - [UltracartClient::AddLibraryItemRequest](docs/AddLibraryItemRequest.md)
735
737
  - [UltracartClient::AdjustInternalCertificateRequest](docs/AdjustInternalCertificateRequest.md)
736
738
  - [UltracartClient::AdjustInternalCertificateResponse](docs/AdjustInternalCertificateResponse.md)
739
+ - [UltracartClient::AdjustLoyaltyPointsRequest](docs/AdjustLoyaltyPointsRequest.md)
740
+ - [UltracartClient::AdjustLoyaltyPointsResponse](docs/AdjustLoyaltyPointsResponse.md)
737
741
  - [UltracartClient::Affiliate](docs/Affiliate.md)
738
742
  - [UltracartClient::AffiliateAttribute](docs/AffiliateAttribute.md)
739
743
  - [UltracartClient::AffiliateClick](docs/AffiliateClick.md)
@@ -1166,6 +1170,7 @@ Class | Method | HTTP request | Description
1166
1170
  - [UltracartClient::CustomerLoyalty](docs/CustomerLoyalty.md)
1167
1171
  - [UltracartClient::CustomerLoyaltyLedger](docs/CustomerLoyaltyLedger.md)
1168
1172
  - [UltracartClient::CustomerLoyaltyRedemption](docs/CustomerLoyaltyRedemption.md)
1173
+ - [UltracartClient::CustomerLoyaltyResponse](docs/CustomerLoyaltyResponse.md)
1169
1174
  - [UltracartClient::CustomerMagicLinkResponse](docs/CustomerMagicLinkResponse.md)
1170
1175
  - [UltracartClient::CustomerMergeRequest](docs/CustomerMergeRequest.md)
1171
1176
  - [UltracartClient::CustomerOrdersSummary](docs/CustomerOrdersSummary.md)
@@ -1836,6 +1841,7 @@ Not every change is committed to every SDK.
1836
1841
 
1837
1842
  | Version | Date | Comments |
1838
1843
  | --: | :-: | --- |
1844
+ | 4.1.136 | 08/24/2026 | customer api - adjust method for loyalty points |
1839
1845
  | 4.1.135 | 08/21/2026 | conversation pbx - support send text operation as a menu item froma different phone number |
1840
1846
  | 4.1.134 | 08/21/2026 | conversation - pbx menu mapping for send text |
1841
1847
  | 4.1.133 | 08/20/2026 | conversations - pbx agent setting for creating tickets in zoho desk for outgoing calls |
@@ -0,0 +1,24 @@
1
+ # UltracartClient::AdjustLoyaltyPointsRequest
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **description** | **String** | Description of this adjustment, 200 characters max | [optional] |
8
+ | **loyalty_points** | **Integer** | The number of loyalty points to add to the ledger. Use a negative number to debit points. Required and may not be zero. | [optional] |
9
+ | **order_id** | **String** | Optional order id if this adjustment is related to a particular order | [optional] |
10
+ | **vesting_days** | **Integer** | Optional days required for this adjustment to vest. Leave null to use the merchant configured default. Use zero for immediate vesting. | [optional] |
11
+
12
+ ## Example
13
+
14
+ ```ruby
15
+ require 'ultracart_api'
16
+
17
+ instance = UltracartClient::AdjustLoyaltyPointsRequest.new(
18
+ description: null,
19
+ loyalty_points: null,
20
+ order_id: null,
21
+ vesting_days: null
22
+ )
23
+ ```
24
+
@@ -0,0 +1,30 @@
1
+ # UltracartClient::AdjustLoyaltyPointsResponse
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **current_points** | **Integer** | The current (vested) points balance after the adjustment was made | [optional] |
8
+ | **error** | [**Error**](Error.md) | | [optional] |
9
+ | **loyalty_points** | **Integer** | The loyalty points adjustment that was written to the ledger | [optional] |
10
+ | **metadata** | [**ResponseMetadata**](ResponseMetadata.md) | | [optional] |
11
+ | **pending_points** | **Integer** | The pending (unvested) points balance after the adjustment was made | [optional] |
12
+ | **success** | **Boolean** | Indicates if API call was successful | [optional] |
13
+ | **warning** | [**Warning**](Warning.md) | | [optional] |
14
+
15
+ ## Example
16
+
17
+ ```ruby
18
+ require 'ultracart_api'
19
+
20
+ instance = UltracartClient::AdjustLoyaltyPointsResponse.new(
21
+ current_points: null,
22
+ error: null,
23
+ loyalty_points: null,
24
+ metadata: null,
25
+ pending_points: null,
26
+ success: null,
27
+ warning: null
28
+ )
29
+ ```
30
+
data/docs/CustomerApi.md CHANGED
@@ -6,12 +6,14 @@ All URIs are relative to *https://secure.ultracart.com/rest/v2*
6
6
  | ------ | ------------ | ----------- |
7
7
  | [**add_customer_store_credit**](CustomerApi.md#add_customer_store_credit) | **POST** /customer/customers/{customer_profile_oid}/store_credit | Adds store credit to a customer |
8
8
  | [**adjust_internal_certificate**](CustomerApi.md#adjust_internal_certificate) | **POST** /customer/customers/{customer_profile_oid}/adjust_cashback_balance | Updates the cashback balance for a customer by updating the internal gift certificate used, creating the gift certificate if needed. |
9
+ | [**adjust_loyalty_points**](CustomerApi.md#adjust_loyalty_points) | **POST** /customer/customers/{customer_profile_oid}/adjust_loyalty_points | Adjusts the loyalty points for a customer by adding a record to the loyalty ledger. |
9
10
  | [**delete_customer**](CustomerApi.md#delete_customer) | **DELETE** /customer/customers/{customer_profile_oid} | Delete a customer |
10
11
  | [**delete_wish_list_item**](CustomerApi.md#delete_wish_list_item) | **DELETE** /customer/customers/{customer_profile_oid}/wishlist/{customer_wishlist_item_oid} | Delete a customer wishlist item |
11
12
  | [**get_customer**](CustomerApi.md#get_customer) | **GET** /customer/customers/{customer_profile_oid} | Retrieve a customer |
12
13
  | [**get_customer_by_email**](CustomerApi.md#get_customer_by_email) | **GET** /customer/customers/by_email/{email} | Retrieve a customer by Email |
13
14
  | [**get_customer_editor_values**](CustomerApi.md#get_customer_editor_values) | **GET** /customer/editor_values | Retrieve values needed for a customer profile editor |
14
15
  | [**get_customer_email_lists**](CustomerApi.md#get_customer_email_lists) | **GET** /customer/email_lists | Retrieve all email lists across all storefronts |
16
+ | [**get_customer_loyalty**](CustomerApi.md#get_customer_loyalty) | **GET** /customer/customers/{customer_profile_oid}/loyalty | Retrieve the loyalty points, ledger and redemptions for a customer |
15
17
  | [**get_customer_store_credit**](CustomerApi.md#get_customer_store_credit) | **GET** /customer/customers/{customer_profile_oid}/store_credit | Retrieve the customer store credit accumulated through loyalty programs |
16
18
  | [**get_customer_wish_list**](CustomerApi.md#get_customer_wish_list) | **GET** /customer/customers/{customer_profile_oid}/wishlist | Retrieve wishlist items for customer |
17
19
  | [**get_customer_wish_list_item**](CustomerApi.md#get_customer_wish_list_item) | **GET** /customer/customers/{customer_profile_oid}/wishlist/{customer_wishlist_item_oid} | Retrieve wishlist item for customer |
@@ -249,6 +251,60 @@ end
249
251
  - **Accept**: application/json
250
252
 
251
253
 
254
+ ## adjust_loyalty_points
255
+
256
+ > <AdjustLoyaltyPointsResponse> adjust_loyalty_points(customer_profile_oid, adjust_loyalty_points_request)
257
+
258
+ Adjusts the loyalty points for a customer by adding a record to the loyalty ledger.
259
+
260
+ Adjusts the loyalty points for a customer by adding a record to the loyalty ledger. The loyalty ledger is append only. Records are never updated or deleted, so a correction is made by posting a second adjustment with the opposite sign.
261
+
262
+
263
+ ### Examples
264
+
265
+
266
+ (No example for this operation).
267
+
268
+
269
+ #### Using the adjust_loyalty_points_with_http_info variant
270
+
271
+ This returns an Array which contains the response data, status code and headers.
272
+
273
+ > <Array(<AdjustLoyaltyPointsResponse>, Integer, Hash)> adjust_loyalty_points_with_http_info(customer_profile_oid, adjust_loyalty_points_request)
274
+
275
+ ```ruby
276
+ begin
277
+ # Adjusts the loyalty points for a customer by adding a record to the loyalty ledger.
278
+ data, status_code, headers = api_instance.adjust_loyalty_points_with_http_info(customer_profile_oid, adjust_loyalty_points_request)
279
+ p status_code # => 2xx
280
+ p headers # => { ... }
281
+ p data # => <AdjustLoyaltyPointsResponse>
282
+ rescue UltracartClient::ApiError => e
283
+ puts "Error when calling CustomerApi->adjust_loyalty_points_with_http_info: #{e}"
284
+ end
285
+ ```
286
+
287
+ ### Parameters
288
+
289
+ | Name | Type | Description | Notes |
290
+ | ---- | ---- | ----------- | ----- |
291
+ | **customer_profile_oid** | **Integer** | The customer profile oid | |
292
+ | **adjust_loyalty_points_request** | [**AdjustLoyaltyPointsRequest**](AdjustLoyaltyPointsRequest.md) | adjustLoyaltyPointsRequest | |
293
+
294
+ ### Return type
295
+
296
+ [**AdjustLoyaltyPointsResponse**](AdjustLoyaltyPointsResponse.md)
297
+
298
+ ### Authorization
299
+
300
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
301
+
302
+ ### HTTP request headers
303
+
304
+ - **Content-Type**: application/json; charset=UTF-8
305
+ - **Accept**: application/json
306
+
307
+
252
308
  ## delete_customer
253
309
 
254
310
  > delete_customer(customer_profile_oid)
@@ -765,6 +821,59 @@ This endpoint does not need any parameter.
765
821
  - **Accept**: application/json
766
822
 
767
823
 
824
+ ## get_customer_loyalty
825
+
826
+ > <CustomerLoyaltyResponse> get_customer_loyalty(customer_profile_oid)
827
+
828
+ Retrieve the loyalty points, ledger and redemptions for a customer
829
+
830
+ Retrieve the loyalty points, ledger and redemptions for a customer. This is a convenience method that returns the same information as expanding loyalty on the customer object, without having to retrieve the entire customer.
831
+
832
+
833
+ ### Examples
834
+
835
+
836
+ (No example for this operation).
837
+
838
+
839
+ #### Using the get_customer_loyalty_with_http_info variant
840
+
841
+ This returns an Array which contains the response data, status code and headers.
842
+
843
+ > <Array(<CustomerLoyaltyResponse>, Integer, Hash)> get_customer_loyalty_with_http_info(customer_profile_oid)
844
+
845
+ ```ruby
846
+ begin
847
+ # Retrieve the loyalty points, ledger and redemptions for a customer
848
+ data, status_code, headers = api_instance.get_customer_loyalty_with_http_info(customer_profile_oid)
849
+ p status_code # => 2xx
850
+ p headers # => { ... }
851
+ p data # => <CustomerLoyaltyResponse>
852
+ rescue UltracartClient::ApiError => e
853
+ puts "Error when calling CustomerApi->get_customer_loyalty_with_http_info: #{e}"
854
+ end
855
+ ```
856
+
857
+ ### Parameters
858
+
859
+ | Name | Type | Description | Notes |
860
+ | ---- | ---- | ----------- | ----- |
861
+ | **customer_profile_oid** | **Integer** | The customer oid to retrieve. | |
862
+
863
+ ### Return type
864
+
865
+ [**CustomerLoyaltyResponse**](CustomerLoyaltyResponse.md)
866
+
867
+ ### Authorization
868
+
869
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
870
+
871
+ ### HTTP request headers
872
+
873
+ - **Content-Type**: Not defined
874
+ - **Accept**: application/json
875
+
876
+
768
877
  ## get_customer_store_credit
769
878
 
770
879
  > <CustomerStoreCreditResponse> get_customer_store_credit(customer_profile_oid)
@@ -0,0 +1,26 @@
1
+ # UltracartClient::CustomerLoyaltyResponse
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **customer_loyalty** | [**CustomerLoyalty**](CustomerLoyalty.md) | | [optional] |
8
+ | **error** | [**Error**](Error.md) | | [optional] |
9
+ | **metadata** | [**ResponseMetadata**](ResponseMetadata.md) | | [optional] |
10
+ | **success** | **Boolean** | Indicates if API call was successful | [optional] |
11
+ | **warning** | [**Warning**](Warning.md) | | [optional] |
12
+
13
+ ## Example
14
+
15
+ ```ruby
16
+ require 'ultracart_api'
17
+
18
+ instance = UltracartClient::CustomerLoyaltyResponse.new(
19
+ customer_loyalty: null,
20
+ error: null,
21
+ metadata: null,
22
+ success: null,
23
+ warning: null
24
+ )
25
+ ```
26
+
@@ -182,6 +182,81 @@ module UltracartClient
182
182
  return data, status_code, headers
183
183
  end
184
184
 
185
+ # Adjusts the loyalty points for a customer by adding a record to the loyalty ledger.
186
+ # Adjusts the loyalty points for a customer by adding a record to the loyalty ledger. The loyalty ledger is append only. Records are never updated or deleted, so a correction is made by posting a second adjustment with the opposite sign.
187
+ # @param customer_profile_oid [Integer] The customer profile oid
188
+ # @param adjust_loyalty_points_request [AdjustLoyaltyPointsRequest] adjustLoyaltyPointsRequest
189
+ # @param [Hash] opts the optional parameters
190
+ # @return [AdjustLoyaltyPointsResponse]
191
+ def adjust_loyalty_points(customer_profile_oid, adjust_loyalty_points_request, opts = {})
192
+ data, _status_code, _headers = adjust_loyalty_points_with_http_info(customer_profile_oid, adjust_loyalty_points_request, opts)
193
+ data
194
+ end
195
+
196
+ # Adjusts the loyalty points for a customer by adding a record to the loyalty ledger.
197
+ # Adjusts the loyalty points for a customer by adding a record to the loyalty ledger. The loyalty ledger is append only. Records are never updated or deleted, so a correction is made by posting a second adjustment with the opposite sign.
198
+ # @param customer_profile_oid [Integer] The customer profile oid
199
+ # @param adjust_loyalty_points_request [AdjustLoyaltyPointsRequest] adjustLoyaltyPointsRequest
200
+ # @param [Hash] opts the optional parameters
201
+ # @return [Array<(AdjustLoyaltyPointsResponse, Integer, Hash)>] AdjustLoyaltyPointsResponse data, response status code and response headers
202
+ def adjust_loyalty_points_with_http_info(customer_profile_oid, adjust_loyalty_points_request, opts = {})
203
+ if @api_client.config.debugging
204
+ @api_client.config.logger.debug 'Calling API: CustomerApi.adjust_loyalty_points ...'
205
+ end
206
+ # verify the required parameter 'customer_profile_oid' is set
207
+ if @api_client.config.client_side_validation && customer_profile_oid.nil?
208
+ fail ArgumentError, "Missing the required parameter 'customer_profile_oid' when calling CustomerApi.adjust_loyalty_points"
209
+ end
210
+ # verify the required parameter 'adjust_loyalty_points_request' is set
211
+ if @api_client.config.client_side_validation && adjust_loyalty_points_request.nil?
212
+ fail ArgumentError, "Missing the required parameter 'adjust_loyalty_points_request' when calling CustomerApi.adjust_loyalty_points"
213
+ end
214
+ # resource path
215
+ local_var_path = '/customer/customers/{customer_profile_oid}/adjust_loyalty_points'.sub('{' + 'customer_profile_oid' + '}', CGI.escape(customer_profile_oid.to_s))
216
+
217
+ # query parameters
218
+ query_params = opts[:query_params] || {}
219
+
220
+ # header parameters
221
+ header_params = opts[:header_params] || {}
222
+ header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
223
+ # HTTP header 'Accept' (if needed)
224
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
225
+ # HTTP header 'Content-Type'
226
+ content_type = @api_client.select_header_content_type(['application/json; charset=UTF-8'])
227
+ if !content_type.nil?
228
+ header_params['Content-Type'] = content_type
229
+ end
230
+
231
+ # form parameters
232
+ form_params = opts[:form_params] || {}
233
+
234
+ # http body (model)
235
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(adjust_loyalty_points_request)
236
+
237
+ # return_type
238
+ return_type = opts[:debug_return_type] || 'AdjustLoyaltyPointsResponse'
239
+
240
+ # auth_names
241
+ auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']
242
+
243
+ new_options = opts.merge(
244
+ :operation => :"CustomerApi.adjust_loyalty_points",
245
+ :header_params => header_params,
246
+ :query_params => query_params,
247
+ :form_params => form_params,
248
+ :body => post_body,
249
+ :auth_names => auth_names,
250
+ :return_type => return_type
251
+ )
252
+
253
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
254
+ if @api_client.config.debugging
255
+ @api_client.config.logger.debug "API called: CustomerApi#adjust_loyalty_points\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
256
+ end
257
+ return data, status_code, headers
258
+ end
259
+
185
260
  # Delete a customer
186
261
  # Delete a customer on the UltraCart account.
187
262
  # @param customer_profile_oid [Integer] The customer_profile_oid to delete.
@@ -566,6 +641,70 @@ module UltracartClient
566
641
  return data, status_code, headers
567
642
  end
568
643
 
644
+ # Retrieve the loyalty points, ledger and redemptions for a customer
645
+ # Retrieve the loyalty points, ledger and redemptions for a customer. This is a convenience method that returns the same information as expanding loyalty on the customer object, without having to retrieve the entire customer.
646
+ # @param customer_profile_oid [Integer] The customer oid to retrieve.
647
+ # @param [Hash] opts the optional parameters
648
+ # @return [CustomerLoyaltyResponse]
649
+ def get_customer_loyalty(customer_profile_oid, opts = {})
650
+ data, _status_code, _headers = get_customer_loyalty_with_http_info(customer_profile_oid, opts)
651
+ data
652
+ end
653
+
654
+ # Retrieve the loyalty points, ledger and redemptions for a customer
655
+ # Retrieve the loyalty points, ledger and redemptions for a customer. This is a convenience method that returns the same information as expanding loyalty on the customer object, without having to retrieve the entire customer.
656
+ # @param customer_profile_oid [Integer] The customer oid to retrieve.
657
+ # @param [Hash] opts the optional parameters
658
+ # @return [Array<(CustomerLoyaltyResponse, Integer, Hash)>] CustomerLoyaltyResponse data, response status code and response headers
659
+ def get_customer_loyalty_with_http_info(customer_profile_oid, opts = {})
660
+ if @api_client.config.debugging
661
+ @api_client.config.logger.debug 'Calling API: CustomerApi.get_customer_loyalty ...'
662
+ end
663
+ # verify the required parameter 'customer_profile_oid' is set
664
+ if @api_client.config.client_side_validation && customer_profile_oid.nil?
665
+ fail ArgumentError, "Missing the required parameter 'customer_profile_oid' when calling CustomerApi.get_customer_loyalty"
666
+ end
667
+ # resource path
668
+ local_var_path = '/customer/customers/{customer_profile_oid}/loyalty'.sub('{' + 'customer_profile_oid' + '}', CGI.escape(customer_profile_oid.to_s))
669
+
670
+ # query parameters
671
+ query_params = opts[:query_params] || {}
672
+
673
+ # header parameters
674
+ header_params = opts[:header_params] || {}
675
+ header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
676
+ # HTTP header 'Accept' (if needed)
677
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
678
+
679
+ # form parameters
680
+ form_params = opts[:form_params] || {}
681
+
682
+ # http body (model)
683
+ post_body = opts[:debug_body]
684
+
685
+ # return_type
686
+ return_type = opts[:debug_return_type] || 'CustomerLoyaltyResponse'
687
+
688
+ # auth_names
689
+ auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']
690
+
691
+ new_options = opts.merge(
692
+ :operation => :"CustomerApi.get_customer_loyalty",
693
+ :header_params => header_params,
694
+ :query_params => query_params,
695
+ :form_params => form_params,
696
+ :body => post_body,
697
+ :auth_names => auth_names,
698
+ :return_type => return_type
699
+ )
700
+
701
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
702
+ if @api_client.config.debugging
703
+ @api_client.config.logger.debug "API called: CustomerApi#get_customer_loyalty\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
704
+ end
705
+ return data, status_code, headers
706
+ end
707
+
569
708
  # Retrieve the customer store credit accumulated through loyalty programs
570
709
  # Retrieve the customer store credit accumulated through loyalty programs
571
710
  # @param customer_profile_oid [Integer] The customer oid to retrieve.
@@ -0,0 +1,250 @@
1
+ =begin
2
+ #UltraCart Rest API V2
3
+
4
+ #UltraCart REST API Version 2
5
+
6
+ The version of the OpenAPI document: 2.0.0
7
+ Contact: support@ultracart.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 6.0.1-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module UltracartClient
17
+ class AdjustLoyaltyPointsRequest
18
+ # Description of this adjustment, 200 characters max
19
+ attr_accessor :description
20
+
21
+ # The number of loyalty points to add to the ledger. Use a negative number to debit points. Required and may not be zero.
22
+ attr_accessor :loyalty_points
23
+
24
+ # Optional order id if this adjustment is related to a particular order
25
+ attr_accessor :order_id
26
+
27
+ # Optional days required for this adjustment to vest. Leave null to use the merchant configured default. Use zero for immediate vesting.
28
+ attr_accessor :vesting_days
29
+
30
+ # Attribute mapping from ruby-style variable name to JSON key.
31
+ def self.attribute_map
32
+ {
33
+ :'description' => :'description',
34
+ :'loyalty_points' => :'loyalty_points',
35
+ :'order_id' => :'order_id',
36
+ :'vesting_days' => :'vesting_days'
37
+ }
38
+ end
39
+
40
+ # Returns all the JSON keys this model knows about
41
+ def self.acceptable_attributes
42
+ attribute_map.values
43
+ end
44
+
45
+ # Attribute type mapping.
46
+ def self.openapi_types
47
+ {
48
+ :'description' => :'String',
49
+ :'loyalty_points' => :'Integer',
50
+ :'order_id' => :'String',
51
+ :'vesting_days' => :'Integer'
52
+ }
53
+ end
54
+
55
+ # List of attributes with nullable: true
56
+ def self.openapi_nullable
57
+ Set.new([
58
+ ])
59
+ end
60
+
61
+ # Initializes the object
62
+ # @param [Hash] attributes Model attributes in the form of hash
63
+ def initialize(attributes = {})
64
+ if (!attributes.is_a?(Hash))
65
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::AdjustLoyaltyPointsRequest` initialize method"
66
+ end
67
+
68
+ # check to see if the attribute exists and convert string to symbol for hash key
69
+ attributes = attributes.each_with_object({}) { |(k, v), h|
70
+ if (!self.class.attribute_map.key?(k.to_sym))
71
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::AdjustLoyaltyPointsRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
72
+ end
73
+ h[k.to_sym] = v
74
+ }
75
+
76
+ if attributes.key?(:'description')
77
+ self.description = attributes[:'description']
78
+ end
79
+
80
+ if attributes.key?(:'loyalty_points')
81
+ self.loyalty_points = attributes[:'loyalty_points']
82
+ end
83
+
84
+ if attributes.key?(:'order_id')
85
+ self.order_id = attributes[:'order_id']
86
+ end
87
+
88
+ if attributes.key?(:'vesting_days')
89
+ self.vesting_days = attributes[:'vesting_days']
90
+ end
91
+ end
92
+
93
+ # Show invalid properties with the reasons. Usually used together with valid?
94
+ # @return Array for valid properties with the reasons
95
+ def list_invalid_properties
96
+ invalid_properties = Array.new
97
+ invalid_properties
98
+ end
99
+
100
+ # Check to see if the all the properties in the model are valid
101
+ # @return true if the model is valid
102
+ def valid?
103
+ true
104
+ end
105
+
106
+ # Checks equality by comparing each attribute.
107
+ # @param [Object] Object to be compared
108
+ def ==(o)
109
+ return true if self.equal?(o)
110
+ self.class == o.class &&
111
+ description == o.description &&
112
+ loyalty_points == o.loyalty_points &&
113
+ order_id == o.order_id &&
114
+ vesting_days == o.vesting_days
115
+ end
116
+
117
+ # @see the `==` method
118
+ # @param [Object] Object to be compared
119
+ def eql?(o)
120
+ self == o
121
+ end
122
+
123
+ # Calculates hash code according to all attributes.
124
+ # @return [Integer] Hash code
125
+ def hash
126
+ [description, loyalty_points, order_id, vesting_days].hash
127
+ end
128
+
129
+ # Builds the object from hash
130
+ # @param [Hash] attributes Model attributes in the form of hash
131
+ # @return [Object] Returns the model itself
132
+ def self.build_from_hash(attributes)
133
+ new.build_from_hash(attributes)
134
+ end
135
+
136
+ # Builds the object from hash
137
+ # @param [Hash] attributes Model attributes in the form of hash
138
+ # @return [Object] Returns the model itself
139
+ def build_from_hash(attributes)
140
+ return nil unless attributes.is_a?(Hash)
141
+ attributes = attributes.transform_keys(&:to_sym)
142
+ self.class.openapi_types.each_pair do |key, type|
143
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
144
+ self.send("#{key}=", nil)
145
+ elsif type =~ /\AArray<(.*)>/i
146
+ # check to ensure the input is an array given that the attribute
147
+ # is documented as an array but the input is not
148
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
149
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
150
+ end
151
+ elsif !attributes[self.class.attribute_map[key]].nil?
152
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
153
+ end
154
+ end
155
+
156
+ self
157
+ end
158
+
159
+ # Deserializes the data based on type
160
+ # @param string type Data type
161
+ # @param string value Value to be deserialized
162
+ # @return [Object] Deserialized data
163
+ def _deserialize(type, value)
164
+ case type.to_sym
165
+ when :Time
166
+ Time.parse(value)
167
+ when :Date
168
+ Date.parse(value)
169
+ when :String
170
+ value.to_s
171
+ when :Integer
172
+ value.to_i
173
+ when :Float
174
+ value.to_f
175
+ when :Boolean
176
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
177
+ true
178
+ else
179
+ false
180
+ end
181
+ when :Object
182
+ # generic object (usually a Hash), return directly
183
+ value
184
+ when /\AArray<(?<inner_type>.+)>\z/
185
+ inner_type = Regexp.last_match[:inner_type]
186
+ value.map { |v| _deserialize(inner_type, v) }
187
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
188
+ k_type = Regexp.last_match[:k_type]
189
+ v_type = Regexp.last_match[:v_type]
190
+ {}.tap do |hash|
191
+ value.each do |k, v|
192
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
193
+ end
194
+ end
195
+ else # model
196
+ # models (e.g. Pet) or oneOf
197
+ klass = UltracartClient.const_get(type)
198
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
199
+ end
200
+ end
201
+
202
+ # Returns the string representation of the object
203
+ # @return [String] String presentation of the object
204
+ def to_s
205
+ to_hash.to_s
206
+ end
207
+
208
+ # to_body is an alias to to_hash (backward compatibility)
209
+ # @return [Hash] Returns the object in the form of hash
210
+ def to_body
211
+ to_hash
212
+ end
213
+
214
+ # Returns the object in the form of hash
215
+ # @return [Hash] Returns the object in the form of hash
216
+ def to_hash
217
+ hash = {}
218
+ self.class.attribute_map.each_pair do |attr, param|
219
+ value = self.send(attr)
220
+ if value.nil?
221
+ is_nullable = self.class.openapi_nullable.include?(attr)
222
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
223
+ end
224
+
225
+ hash[param] = _to_hash(value)
226
+ end
227
+ hash
228
+ end
229
+
230
+ # Outputs non-array value in the form of hash
231
+ # For object, use to_hash. Otherwise, just return the value
232
+ # @param [Object] value Any valid value
233
+ # @return [Hash] Returns the value in the form of hash
234
+ def _to_hash(value)
235
+ if value.is_a?(Array)
236
+ value.compact.map { |v| _to_hash(v) }
237
+ elsif value.is_a?(Hash)
238
+ {}.tap do |hash|
239
+ value.each { |k, v| hash[k] = _to_hash(v) }
240
+ end
241
+ elsif value.respond_to? :to_hash
242
+ value.to_hash
243
+ else
244
+ value
245
+ end
246
+ end
247
+
248
+ end
249
+
250
+ end
@@ -0,0 +1,277 @@
1
+ =begin
2
+ #UltraCart Rest API V2
3
+
4
+ #UltraCart REST API Version 2
5
+
6
+ The version of the OpenAPI document: 2.0.0
7
+ Contact: support@ultracart.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 6.0.1-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module UltracartClient
17
+ class AdjustLoyaltyPointsResponse
18
+ # The current (vested) points balance after the adjustment was made
19
+ attr_accessor :current_points
20
+
21
+ attr_accessor :error
22
+
23
+ # The loyalty points adjustment that was written to the ledger
24
+ attr_accessor :loyalty_points
25
+
26
+ attr_accessor :metadata
27
+
28
+ # The pending (unvested) points balance after the adjustment was made
29
+ attr_accessor :pending_points
30
+
31
+ # Indicates if API call was successful
32
+ attr_accessor :success
33
+
34
+ attr_accessor :warning
35
+
36
+ # Attribute mapping from ruby-style variable name to JSON key.
37
+ def self.attribute_map
38
+ {
39
+ :'current_points' => :'current_points',
40
+ :'error' => :'error',
41
+ :'loyalty_points' => :'loyalty_points',
42
+ :'metadata' => :'metadata',
43
+ :'pending_points' => :'pending_points',
44
+ :'success' => :'success',
45
+ :'warning' => :'warning'
46
+ }
47
+ end
48
+
49
+ # Returns all the JSON keys this model knows about
50
+ def self.acceptable_attributes
51
+ attribute_map.values
52
+ end
53
+
54
+ # Attribute type mapping.
55
+ def self.openapi_types
56
+ {
57
+ :'current_points' => :'Integer',
58
+ :'error' => :'Error',
59
+ :'loyalty_points' => :'Integer',
60
+ :'metadata' => :'ResponseMetadata',
61
+ :'pending_points' => :'Integer',
62
+ :'success' => :'Boolean',
63
+ :'warning' => :'Warning'
64
+ }
65
+ end
66
+
67
+ # List of attributes with nullable: true
68
+ def self.openapi_nullable
69
+ Set.new([
70
+ ])
71
+ end
72
+
73
+ # Initializes the object
74
+ # @param [Hash] attributes Model attributes in the form of hash
75
+ def initialize(attributes = {})
76
+ if (!attributes.is_a?(Hash))
77
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::AdjustLoyaltyPointsResponse` initialize method"
78
+ end
79
+
80
+ # check to see if the attribute exists and convert string to symbol for hash key
81
+ attributes = attributes.each_with_object({}) { |(k, v), h|
82
+ if (!self.class.attribute_map.key?(k.to_sym))
83
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::AdjustLoyaltyPointsResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
84
+ end
85
+ h[k.to_sym] = v
86
+ }
87
+
88
+ if attributes.key?(:'current_points')
89
+ self.current_points = attributes[:'current_points']
90
+ end
91
+
92
+ if attributes.key?(:'error')
93
+ self.error = attributes[:'error']
94
+ end
95
+
96
+ if attributes.key?(:'loyalty_points')
97
+ self.loyalty_points = attributes[:'loyalty_points']
98
+ end
99
+
100
+ if attributes.key?(:'metadata')
101
+ self.metadata = attributes[:'metadata']
102
+ end
103
+
104
+ if attributes.key?(:'pending_points')
105
+ self.pending_points = attributes[:'pending_points']
106
+ end
107
+
108
+ if attributes.key?(:'success')
109
+ self.success = attributes[:'success']
110
+ end
111
+
112
+ if attributes.key?(:'warning')
113
+ self.warning = attributes[:'warning']
114
+ end
115
+ end
116
+
117
+ # Show invalid properties with the reasons. Usually used together with valid?
118
+ # @return Array for valid properties with the reasons
119
+ def list_invalid_properties
120
+ invalid_properties = Array.new
121
+ invalid_properties
122
+ end
123
+
124
+ # Check to see if the all the properties in the model are valid
125
+ # @return true if the model is valid
126
+ def valid?
127
+ true
128
+ end
129
+
130
+ # Checks equality by comparing each attribute.
131
+ # @param [Object] Object to be compared
132
+ def ==(o)
133
+ return true if self.equal?(o)
134
+ self.class == o.class &&
135
+ current_points == o.current_points &&
136
+ error == o.error &&
137
+ loyalty_points == o.loyalty_points &&
138
+ metadata == o.metadata &&
139
+ pending_points == o.pending_points &&
140
+ success == o.success &&
141
+ warning == o.warning
142
+ end
143
+
144
+ # @see the `==` method
145
+ # @param [Object] Object to be compared
146
+ def eql?(o)
147
+ self == o
148
+ end
149
+
150
+ # Calculates hash code according to all attributes.
151
+ # @return [Integer] Hash code
152
+ def hash
153
+ [current_points, error, loyalty_points, metadata, pending_points, success, warning].hash
154
+ end
155
+
156
+ # Builds the object from hash
157
+ # @param [Hash] attributes Model attributes in the form of hash
158
+ # @return [Object] Returns the model itself
159
+ def self.build_from_hash(attributes)
160
+ new.build_from_hash(attributes)
161
+ end
162
+
163
+ # Builds the object from hash
164
+ # @param [Hash] attributes Model attributes in the form of hash
165
+ # @return [Object] Returns the model itself
166
+ def build_from_hash(attributes)
167
+ return nil unless attributes.is_a?(Hash)
168
+ attributes = attributes.transform_keys(&:to_sym)
169
+ self.class.openapi_types.each_pair do |key, type|
170
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
171
+ self.send("#{key}=", nil)
172
+ elsif type =~ /\AArray<(.*)>/i
173
+ # check to ensure the input is an array given that the attribute
174
+ # is documented as an array but the input is not
175
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
176
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
177
+ end
178
+ elsif !attributes[self.class.attribute_map[key]].nil?
179
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
180
+ end
181
+ end
182
+
183
+ self
184
+ end
185
+
186
+ # Deserializes the data based on type
187
+ # @param string type Data type
188
+ # @param string value Value to be deserialized
189
+ # @return [Object] Deserialized data
190
+ def _deserialize(type, value)
191
+ case type.to_sym
192
+ when :Time
193
+ Time.parse(value)
194
+ when :Date
195
+ Date.parse(value)
196
+ when :String
197
+ value.to_s
198
+ when :Integer
199
+ value.to_i
200
+ when :Float
201
+ value.to_f
202
+ when :Boolean
203
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
204
+ true
205
+ else
206
+ false
207
+ end
208
+ when :Object
209
+ # generic object (usually a Hash), return directly
210
+ value
211
+ when /\AArray<(?<inner_type>.+)>\z/
212
+ inner_type = Regexp.last_match[:inner_type]
213
+ value.map { |v| _deserialize(inner_type, v) }
214
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
215
+ k_type = Regexp.last_match[:k_type]
216
+ v_type = Regexp.last_match[:v_type]
217
+ {}.tap do |hash|
218
+ value.each do |k, v|
219
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
220
+ end
221
+ end
222
+ else # model
223
+ # models (e.g. Pet) or oneOf
224
+ klass = UltracartClient.const_get(type)
225
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
226
+ end
227
+ end
228
+
229
+ # Returns the string representation of the object
230
+ # @return [String] String presentation of the object
231
+ def to_s
232
+ to_hash.to_s
233
+ end
234
+
235
+ # to_body is an alias to to_hash (backward compatibility)
236
+ # @return [Hash] Returns the object in the form of hash
237
+ def to_body
238
+ to_hash
239
+ end
240
+
241
+ # Returns the object in the form of hash
242
+ # @return [Hash] Returns the object in the form of hash
243
+ def to_hash
244
+ hash = {}
245
+ self.class.attribute_map.each_pair do |attr, param|
246
+ value = self.send(attr)
247
+ if value.nil?
248
+ is_nullable = self.class.openapi_nullable.include?(attr)
249
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
250
+ end
251
+
252
+ hash[param] = _to_hash(value)
253
+ end
254
+ hash
255
+ end
256
+
257
+ # Outputs non-array value in the form of hash
258
+ # For object, use to_hash. Otherwise, just return the value
259
+ # @param [Object] value Any valid value
260
+ # @return [Hash] Returns the value in the form of hash
261
+ def _to_hash(value)
262
+ if value.is_a?(Array)
263
+ value.compact.map { |v| _to_hash(v) }
264
+ elsif value.is_a?(Hash)
265
+ {}.tap do |hash|
266
+ value.each { |k, v| hash[k] = _to_hash(v) }
267
+ end
268
+ elsif value.respond_to? :to_hash
269
+ value.to_hash
270
+ else
271
+ value
272
+ end
273
+ end
274
+
275
+ end
276
+
277
+ end
@@ -0,0 +1,256 @@
1
+ =begin
2
+ #UltraCart Rest API V2
3
+
4
+ #UltraCart REST API Version 2
5
+
6
+ The version of the OpenAPI document: 2.0.0
7
+ Contact: support@ultracart.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 6.0.1-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module UltracartClient
17
+ class CustomerLoyaltyResponse
18
+ attr_accessor :customer_loyalty
19
+
20
+ attr_accessor :error
21
+
22
+ attr_accessor :metadata
23
+
24
+ # Indicates if API call was successful
25
+ attr_accessor :success
26
+
27
+ attr_accessor :warning
28
+
29
+ # Attribute mapping from ruby-style variable name to JSON key.
30
+ def self.attribute_map
31
+ {
32
+ :'customer_loyalty' => :'customer_loyalty',
33
+ :'error' => :'error',
34
+ :'metadata' => :'metadata',
35
+ :'success' => :'success',
36
+ :'warning' => :'warning'
37
+ }
38
+ end
39
+
40
+ # Returns all the JSON keys this model knows about
41
+ def self.acceptable_attributes
42
+ attribute_map.values
43
+ end
44
+
45
+ # Attribute type mapping.
46
+ def self.openapi_types
47
+ {
48
+ :'customer_loyalty' => :'CustomerLoyalty',
49
+ :'error' => :'Error',
50
+ :'metadata' => :'ResponseMetadata',
51
+ :'success' => :'Boolean',
52
+ :'warning' => :'Warning'
53
+ }
54
+ end
55
+
56
+ # List of attributes with nullable: true
57
+ def self.openapi_nullable
58
+ Set.new([
59
+ ])
60
+ end
61
+
62
+ # Initializes the object
63
+ # @param [Hash] attributes Model attributes in the form of hash
64
+ def initialize(attributes = {})
65
+ if (!attributes.is_a?(Hash))
66
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::CustomerLoyaltyResponse` initialize method"
67
+ end
68
+
69
+ # check to see if the attribute exists and convert string to symbol for hash key
70
+ attributes = attributes.each_with_object({}) { |(k, v), h|
71
+ if (!self.class.attribute_map.key?(k.to_sym))
72
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::CustomerLoyaltyResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
73
+ end
74
+ h[k.to_sym] = v
75
+ }
76
+
77
+ if attributes.key?(:'customer_loyalty')
78
+ self.customer_loyalty = attributes[:'customer_loyalty']
79
+ end
80
+
81
+ if attributes.key?(:'error')
82
+ self.error = attributes[:'error']
83
+ end
84
+
85
+ if attributes.key?(:'metadata')
86
+ self.metadata = attributes[:'metadata']
87
+ end
88
+
89
+ if attributes.key?(:'success')
90
+ self.success = attributes[:'success']
91
+ end
92
+
93
+ if attributes.key?(:'warning')
94
+ self.warning = attributes[:'warning']
95
+ end
96
+ end
97
+
98
+ # Show invalid properties with the reasons. Usually used together with valid?
99
+ # @return Array for valid properties with the reasons
100
+ def list_invalid_properties
101
+ invalid_properties = Array.new
102
+ invalid_properties
103
+ end
104
+
105
+ # Check to see if the all the properties in the model are valid
106
+ # @return true if the model is valid
107
+ def valid?
108
+ true
109
+ end
110
+
111
+ # Checks equality by comparing each attribute.
112
+ # @param [Object] Object to be compared
113
+ def ==(o)
114
+ return true if self.equal?(o)
115
+ self.class == o.class &&
116
+ customer_loyalty == o.customer_loyalty &&
117
+ error == o.error &&
118
+ metadata == o.metadata &&
119
+ success == o.success &&
120
+ warning == o.warning
121
+ end
122
+
123
+ # @see the `==` method
124
+ # @param [Object] Object to be compared
125
+ def eql?(o)
126
+ self == o
127
+ end
128
+
129
+ # Calculates hash code according to all attributes.
130
+ # @return [Integer] Hash code
131
+ def hash
132
+ [customer_loyalty, error, metadata, success, warning].hash
133
+ end
134
+
135
+ # Builds the object from hash
136
+ # @param [Hash] attributes Model attributes in the form of hash
137
+ # @return [Object] Returns the model itself
138
+ def self.build_from_hash(attributes)
139
+ new.build_from_hash(attributes)
140
+ end
141
+
142
+ # Builds the object from hash
143
+ # @param [Hash] attributes Model attributes in the form of hash
144
+ # @return [Object] Returns the model itself
145
+ def build_from_hash(attributes)
146
+ return nil unless attributes.is_a?(Hash)
147
+ attributes = attributes.transform_keys(&:to_sym)
148
+ self.class.openapi_types.each_pair do |key, type|
149
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
150
+ self.send("#{key}=", nil)
151
+ elsif type =~ /\AArray<(.*)>/i
152
+ # check to ensure the input is an array given that the attribute
153
+ # is documented as an array but the input is not
154
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
155
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
156
+ end
157
+ elsif !attributes[self.class.attribute_map[key]].nil?
158
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
159
+ end
160
+ end
161
+
162
+ self
163
+ end
164
+
165
+ # Deserializes the data based on type
166
+ # @param string type Data type
167
+ # @param string value Value to be deserialized
168
+ # @return [Object] Deserialized data
169
+ def _deserialize(type, value)
170
+ case type.to_sym
171
+ when :Time
172
+ Time.parse(value)
173
+ when :Date
174
+ Date.parse(value)
175
+ when :String
176
+ value.to_s
177
+ when :Integer
178
+ value.to_i
179
+ when :Float
180
+ value.to_f
181
+ when :Boolean
182
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
183
+ true
184
+ else
185
+ false
186
+ end
187
+ when :Object
188
+ # generic object (usually a Hash), return directly
189
+ value
190
+ when /\AArray<(?<inner_type>.+)>\z/
191
+ inner_type = Regexp.last_match[:inner_type]
192
+ value.map { |v| _deserialize(inner_type, v) }
193
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
194
+ k_type = Regexp.last_match[:k_type]
195
+ v_type = Regexp.last_match[:v_type]
196
+ {}.tap do |hash|
197
+ value.each do |k, v|
198
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
199
+ end
200
+ end
201
+ else # model
202
+ # models (e.g. Pet) or oneOf
203
+ klass = UltracartClient.const_get(type)
204
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
205
+ end
206
+ end
207
+
208
+ # Returns the string representation of the object
209
+ # @return [String] String presentation of the object
210
+ def to_s
211
+ to_hash.to_s
212
+ end
213
+
214
+ # to_body is an alias to to_hash (backward compatibility)
215
+ # @return [Hash] Returns the object in the form of hash
216
+ def to_body
217
+ to_hash
218
+ end
219
+
220
+ # Returns the object in the form of hash
221
+ # @return [Hash] Returns the object in the form of hash
222
+ def to_hash
223
+ hash = {}
224
+ self.class.attribute_map.each_pair do |attr, param|
225
+ value = self.send(attr)
226
+ if value.nil?
227
+ is_nullable = self.class.openapi_nullable.include?(attr)
228
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
229
+ end
230
+
231
+ hash[param] = _to_hash(value)
232
+ end
233
+ hash
234
+ end
235
+
236
+ # Outputs non-array value in the form of hash
237
+ # For object, use to_hash. Otherwise, just return the value
238
+ # @param [Object] value Any valid value
239
+ # @return [Hash] Returns the value in the form of hash
240
+ def _to_hash(value)
241
+ if value.is_a?(Array)
242
+ value.compact.map { |v| _to_hash(v) }
243
+ elsif value.is_a?(Hash)
244
+ {}.tap do |hash|
245
+ value.each { |k, v| hash[k] = _to_hash(v) }
246
+ end
247
+ elsif value.respond_to? :to_hash
248
+ value.to_hash
249
+ else
250
+ value
251
+ end
252
+ end
253
+
254
+ end
255
+
256
+ end
@@ -11,5 +11,5 @@ OpenAPI Generator version: 6.0.1-SNAPSHOT
11
11
  =end
12
12
 
13
13
  module UltracartClient
14
- VERSION = '4.1.135'
14
+ VERSION = '4.1.136'
15
15
  end
data/lib/ultracart_api.rb CHANGED
@@ -29,6 +29,8 @@ require 'ultracart_api/models/activity'
29
29
  require 'ultracart_api/models/add_library_item_request'
30
30
  require 'ultracart_api/models/adjust_internal_certificate_request'
31
31
  require 'ultracart_api/models/adjust_internal_certificate_response'
32
+ require 'ultracart_api/models/adjust_loyalty_points_request'
33
+ require 'ultracart_api/models/adjust_loyalty_points_response'
32
34
  require 'ultracart_api/models/affiliate'
33
35
  require 'ultracart_api/models/affiliate_attribute'
34
36
  require 'ultracart_api/models/affiliate_click'
@@ -461,6 +463,7 @@ require 'ultracart_api/models/customer_email_suppression_result'
461
463
  require 'ultracart_api/models/customer_loyalty'
462
464
  require 'ultracart_api/models/customer_loyalty_ledger'
463
465
  require 'ultracart_api/models/customer_loyalty_redemption'
466
+ require 'ultracart_api/models/customer_loyalty_response'
464
467
  require 'ultracart_api/models/customer_magic_link_response'
465
468
  require 'ultracart_api/models/customer_merge_request'
466
469
  require 'ultracart_api/models/customer_orders_summary'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ultracart_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.135
4
+ version: 4.1.136
5
5
  platform: ruby
6
6
  authors:
7
7
  - UltraCart
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-08-21 00:00:00.000000000 Z
11
+ date: 2026-08-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus
@@ -73,6 +73,8 @@ files:
73
73
  - docs/AddLibraryItemRequest.md
74
74
  - docs/AdjustInternalCertificateRequest.md
75
75
  - docs/AdjustInternalCertificateResponse.md
76
+ - docs/AdjustLoyaltyPointsRequest.md
77
+ - docs/AdjustLoyaltyPointsResponse.md
76
78
  - docs/Affiliate.md
77
79
  - docs/AffiliateApi.md
78
80
  - docs/AffiliateAttribute.md
@@ -514,6 +516,7 @@ files:
514
516
  - docs/CustomerLoyalty.md
515
517
  - docs/CustomerLoyaltyLedger.md
516
518
  - docs/CustomerLoyaltyRedemption.md
519
+ - docs/CustomerLoyaltyResponse.md
517
520
  - docs/CustomerMagicLinkResponse.md
518
521
  - docs/CustomerMergeRequest.md
519
522
  - docs/CustomerOrdersSummary.md
@@ -1163,6 +1166,8 @@ files:
1163
1166
  - lib/ultracart_api/models/add_library_item_request.rb
1164
1167
  - lib/ultracart_api/models/adjust_internal_certificate_request.rb
1165
1168
  - lib/ultracart_api/models/adjust_internal_certificate_response.rb
1169
+ - lib/ultracart_api/models/adjust_loyalty_points_request.rb
1170
+ - lib/ultracart_api/models/adjust_loyalty_points_response.rb
1166
1171
  - lib/ultracart_api/models/affiliate.rb
1167
1172
  - lib/ultracart_api/models/affiliate_attribute.rb
1168
1173
  - lib/ultracart_api/models/affiliate_click.rb
@@ -1595,6 +1600,7 @@ files:
1595
1600
  - lib/ultracart_api/models/customer_loyalty.rb
1596
1601
  - lib/ultracart_api/models/customer_loyalty_ledger.rb
1597
1602
  - lib/ultracart_api/models/customer_loyalty_redemption.rb
1603
+ - lib/ultracart_api/models/customer_loyalty_response.rb
1598
1604
  - lib/ultracart_api/models/customer_magic_link_response.rb
1599
1605
  - lib/ultracart_api/models/customer_merge_request.rb
1600
1606
  - lib/ultracart_api/models/customer_orders_summary.rb