ultracart_api 4.1.4 → 4.1.6

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: 7f73cdbb14f7434757e125f441e7177359ed026f60e7289828d3140794743701
4
- data.tar.gz: 6749494d14fd1bce606f95c178229622137981d48b2448ea2db11c044a7adb43
3
+ metadata.gz: ed8c71b6e4bad744845429cdd519ad937699ac4684eb127332c7c69b4d3245ce
4
+ data.tar.gz: e63ba4ff933c97f8dd0b3d9cc98e7cca19f2fe0e4169066e448524fc2f777053
5
5
  SHA512:
6
- metadata.gz: a35199b5568393b6f8e69353771dbc1cc9fbfbe300b1bf281106c7b36636a48b38f97f3f7e1582a57b501bfd16ede57f85ba8b6cdbc0907df3f6298a2573d1e6
7
- data.tar.gz: 8603ec97f9a44dc3e15f5d2442e46f734b65785be3d3eea59685ca4cdb1e140034b3345b640c11ddbed7c2a16626aa36d29f2f334b4fd00f8cd874426e9af4da
6
+ metadata.gz: 0146a01bde61c58a2dd303c057f3aafab80c4a953df104fca9bf40ee6cbf7f1b69884f49cfca99c708eeb46e14562e69ca05d7f06449178375c42eccb8fc9b73
7
+ data.tar.gz: 5e01eb34847239d3e5b4acdae31ca2dfc4e4ff9c041ffa0415819e7266e9d3e82780cb368dee46e25b6d3e9774bd643ed0c545782f35be4fa4a407da903a557a
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.4
10
+ - Package version: 4.1.6
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.4'
19
+ gem 'ultracart_api', '4.1.6'
20
20
  ```
21
21
 
22
22
  install:
@@ -334,6 +334,7 @@ Class | Method | HTTP request | Description
334
334
  *UltracartClient::OrderApi* | [**is_refundable_order**](docs/OrderApi.md#is_refundable_order) | **GET** /order/orders/{order_id}/refundable | Determine if an order can be refunded
335
335
  *UltracartClient::OrderApi* | [**process_payment**](docs/OrderApi.md#process_payment) | **POST** /order/orders/{order_id}/process_payment | Process payment
336
336
  *UltracartClient::OrderApi* | [**refund_order**](docs/OrderApi.md#refund_order) | **PUT** /order/orders/{order_id}/refund | Refund an order
337
+ *UltracartClient::OrderApi* | [**refund_order_completely**](docs/OrderApi.md#refund_order_completely) | **PUT** /order/orders/{order_id}/refund_completely | Refund an order completely
337
338
  *UltracartClient::OrderApi* | [**replacement**](docs/OrderApi.md#replacement) | **POST** /order/orders/{order_id}/replacement | Replacement order
338
339
  *UltracartClient::OrderApi* | [**resend_receipt**](docs/OrderApi.md#resend_receipt) | **POST** /order/orders/{order_id}/resend_receipt | Resend receipt
339
340
  *UltracartClient::OrderApi* | [**resend_shipment_confirmation**](docs/OrderApi.md#resend_shipment_confirmation) | **POST** /order/orders/{order_id}/resend_shipment_confirmation | Resend shipment confirmation
@@ -696,6 +697,7 @@ Class | Method | HTTP request | Description
696
697
  - [UltracartClient::ChannelPartnerOrder](docs/ChannelPartnerOrder.md)
697
698
  - [UltracartClient::ChannelPartnerOrderItem](docs/ChannelPartnerOrderItem.md)
698
699
  - [UltracartClient::ChannelPartnerOrderItemOption](docs/ChannelPartnerOrderItemOption.md)
700
+ - [UltracartClient::ChannelPartnerOrderItemProperty](docs/ChannelPartnerOrderItemProperty.md)
699
701
  - [UltracartClient::ChannelPartnerOrderTransaction](docs/ChannelPartnerOrderTransaction.md)
700
702
  - [UltracartClient::ChannelPartnerOrderTransactionDetail](docs/ChannelPartnerOrderTransactionDetail.md)
701
703
  - [UltracartClient::ChannelPartnerShipToPreference](docs/ChannelPartnerShipToPreference.md)
@@ -1516,6 +1518,8 @@ Not every change is committed to every SDK.
1516
1518
 
1517
1519
  | Version | Date | Comments |
1518
1520
  | --: | :-: | --- |
1521
+ | 4.1.6 | 04/16/2025 | added channel partner order item properties |
1522
+ | 4.1.5 | 03/28/2025 | added paypal fastlane constants for payments |
1519
1523
  | 4.1.4 | 03/07/2025 | updated github readme.md |
1520
1524
  | 4.1.3 | 03/07/2025 | updated github readme.md files |
1521
1525
  | 4.1.2 | 03/05/2025 | added ChannelPartnerOrder.use_prior_payment_information_from_order_id |
@@ -9,6 +9,7 @@
9
9
  | **auto_order_schedule** | **String** | The frequency schedule for this item if this item is part of an auto (recurring) order | [optional] |
10
10
  | **merchant_item_id** | **String** | Item ID | [optional] |
11
11
  | **options** | [**Array<ChannelPartnerOrderItemOption>**](ChannelPartnerOrderItemOption.md) | Item options | [optional] |
12
+ | **properties** | [**Array<ChannelPartnerOrderItemProperty>**](ChannelPartnerOrderItemProperty.md) | Properties | [optional] |
12
13
  | **quantity** | **Float** | Quantity | [optional] |
13
14
  | **upsell** | **Boolean** | True if this item was an upsell item. | [optional] |
14
15
 
@@ -23,6 +24,7 @@ instance = UltracartClient::ChannelPartnerOrderItem.new(
23
24
  auto_order_schedule: null,
24
25
  merchant_item_id: null,
25
26
  options: null,
27
+ properties: null,
26
28
  quantity: null,
27
29
  upsell: null
28
30
  )
@@ -0,0 +1,24 @@
1
+ # UltracartClient::ChannelPartnerOrderItemProperty
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **display** | **Boolean** | True if this property is displayed to the customer | [optional] |
8
+ | **expiration_dts** | **String** | The date/time that the property expires and is deleted | [optional] |
9
+ | **name** | **String** | Name | [optional] |
10
+ | **value** | **String** | Value | [optional] |
11
+
12
+ ## Example
13
+
14
+ ```ruby
15
+ require 'ultracart_api'
16
+
17
+ instance = UltracartClient::ChannelPartnerOrderItemProperty.new(
18
+ display: null,
19
+ expiration_dts: null,
20
+ name: null,
21
+ value: null
22
+ )
23
+ ```
24
+
data/docs/OrderApi.md CHANGED
@@ -25,6 +25,7 @@ All URIs are relative to *https://secure.ultracart.com/rest/v2*
25
25
  | [**is_refundable_order**](OrderApi.md#is_refundable_order) | **GET** /order/orders/{order_id}/refundable | Determine if an order can be refunded |
26
26
  | [**process_payment**](OrderApi.md#process_payment) | **POST** /order/orders/{order_id}/process_payment | Process payment |
27
27
  | [**refund_order**](OrderApi.md#refund_order) | **PUT** /order/orders/{order_id}/refund | Refund an order |
28
+ | [**refund_order_completely**](OrderApi.md#refund_order_completely) | **PUT** /order/orders/{order_id}/refund_completely | Refund an order completely |
28
29
  | [**replacement**](OrderApi.md#replacement) | **POST** /order/orders/{order_id}/replacement | Replacement order |
29
30
  | [**resend_receipt**](OrderApi.md#resend_receipt) | **POST** /order/orders/{order_id}/resend_receipt | Resend receipt |
30
31
  | [**resend_shipment_confirmation**](OrderApi.md#resend_shipment_confirmation) | **POST** /order/orders/{order_id}/resend_shipment_confirmation | Resend shipment confirmation |
@@ -1650,6 +1651,97 @@ end
1650
1651
  - **Accept**: application/json
1651
1652
 
1652
1653
 
1654
+ ## refund_order_completely
1655
+
1656
+ > <OrderResponse> refund_order_completely(order_id, opts)
1657
+
1658
+ Refund an order completely
1659
+
1660
+ Perform a refund operation on an order and then update the order if successful.
1661
+
1662
+ ### Examples
1663
+
1664
+ ```ruby
1665
+ require 'time'
1666
+ require 'ultracart_api'
1667
+ require 'json'
1668
+ require 'yaml'
1669
+ require_relative '../constants' # https://github.com/UltraCart/sdk_samples/blob/master/ruby/constants.rb
1670
+
1671
+ # This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
1672
+ # As such, this might not be the best way to use this object.
1673
+ # Please see https://github.com/UltraCart/sdk_samples for working examples.
1674
+
1675
+ api = UltracartClient::OrderApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
1676
+ order_id = 'order_id_example' # String | The order id to refund.
1677
+ opts = {
1678
+ reject_after_refund: true, # Boolean | Reject order after refund
1679
+ skip_customer_notification: true, # Boolean | Skip customer email notification
1680
+ auto_order_cancel: true, # Boolean | Cancel associated auto orders
1681
+ manual_refund: true, # Boolean | Consider a manual refund done externally
1682
+ reverse_affiliate_transactions: true, # Boolean | Reverse affiliate transactions
1683
+ issue_store_credit: true, # Boolean | Issue a store credit instead of refunding the original payment method, loyalty must be configured on merchant account
1684
+ auto_order_cancel_reason: 'auto_order_cancel_reason_example', # String | Reason for auto orders cancellation
1685
+ refund_reason: 'refund_reason_example', # String | Reason for refund
1686
+ reject_reason: 'reject_reason_example' # String | Reason for reject
1687
+ }
1688
+
1689
+ begin
1690
+ # Refund an order completely
1691
+ result = api_instance.refund_order_completely(order_id, opts)
1692
+ p result
1693
+ rescue UltracartClient::ApiError => e
1694
+ puts "Error when calling OrderApi->refund_order_completely: #{e}"
1695
+ end
1696
+ ```
1697
+
1698
+ #### Using the refund_order_completely_with_http_info variant
1699
+
1700
+ This returns an Array which contains the response data, status code and headers.
1701
+
1702
+ > <Array(<OrderResponse>, Integer, Hash)> refund_order_completely_with_http_info(order_id, opts)
1703
+
1704
+ ```ruby
1705
+ begin
1706
+ # Refund an order completely
1707
+ data, status_code, headers = api_instance.refund_order_completely_with_http_info(order_id, opts)
1708
+ p status_code # => 2xx
1709
+ p headers # => { ... }
1710
+ p data # => <OrderResponse>
1711
+ rescue UltracartClient::ApiError => e
1712
+ puts "Error when calling OrderApi->refund_order_completely_with_http_info: #{e}"
1713
+ end
1714
+ ```
1715
+
1716
+ ### Parameters
1717
+
1718
+ | Name | Type | Description | Notes |
1719
+ | ---- | ---- | ----------- | ----- |
1720
+ | **order_id** | **String** | The order id to refund. | |
1721
+ | **reject_after_refund** | **Boolean** | Reject order after refund | [optional][default to false] |
1722
+ | **skip_customer_notification** | **Boolean** | Skip customer email notification | [optional][default to false] |
1723
+ | **auto_order_cancel** | **Boolean** | Cancel associated auto orders | [optional][default to false] |
1724
+ | **manual_refund** | **Boolean** | Consider a manual refund done externally | [optional][default to false] |
1725
+ | **reverse_affiliate_transactions** | **Boolean** | Reverse affiliate transactions | [optional][default to true] |
1726
+ | **issue_store_credit** | **Boolean** | Issue a store credit instead of refunding the original payment method, loyalty must be configured on merchant account | [optional][default to false] |
1727
+ | **auto_order_cancel_reason** | **String** | Reason for auto orders cancellation | [optional] |
1728
+ | **refund_reason** | **String** | Reason for refund | [optional] |
1729
+ | **reject_reason** | **String** | Reason for reject | [optional] |
1730
+
1731
+ ### Return type
1732
+
1733
+ [**OrderResponse**](OrderResponse.md)
1734
+
1735
+ ### Authorization
1736
+
1737
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
1738
+
1739
+ ### HTTP request headers
1740
+
1741
+ - **Content-Type**: Not defined
1742
+ - **Accept**: application/json
1743
+
1744
+
1653
1745
  ## replacement
1654
1746
 
1655
1747
  > <OrderReplacementResponse> replacement(order_id, replacement)
@@ -1579,6 +1579,97 @@ module UltracartClient
1579
1579
  return data, status_code, headers
1580
1580
  end
1581
1581
 
1582
+ # Refund an order completely
1583
+ # Perform a refund operation on an order and then update the order if successful.
1584
+ # @param order_id [String] The order id to refund.
1585
+ # @param [Hash] opts the optional parameters
1586
+ # @option opts [Boolean] :reject_after_refund Reject order after refund (default to false)
1587
+ # @option opts [Boolean] :skip_customer_notification Skip customer email notification (default to false)
1588
+ # @option opts [Boolean] :auto_order_cancel Cancel associated auto orders (default to false)
1589
+ # @option opts [Boolean] :manual_refund Consider a manual refund done externally (default to false)
1590
+ # @option opts [Boolean] :reverse_affiliate_transactions Reverse affiliate transactions (default to true)
1591
+ # @option opts [Boolean] :issue_store_credit Issue a store credit instead of refunding the original payment method, loyalty must be configured on merchant account (default to false)
1592
+ # @option opts [String] :auto_order_cancel_reason Reason for auto orders cancellation
1593
+ # @option opts [String] :refund_reason Reason for refund
1594
+ # @option opts [String] :reject_reason Reason for reject
1595
+ # @return [OrderResponse]
1596
+ def refund_order_completely(order_id, opts = {})
1597
+ data, _status_code, _headers = refund_order_completely_with_http_info(order_id, opts)
1598
+ data
1599
+ end
1600
+
1601
+ # Refund an order completely
1602
+ # Perform a refund operation on an order and then update the order if successful.
1603
+ # @param order_id [String] The order id to refund.
1604
+ # @param [Hash] opts the optional parameters
1605
+ # @option opts [Boolean] :reject_after_refund Reject order after refund (default to false)
1606
+ # @option opts [Boolean] :skip_customer_notification Skip customer email notification (default to false)
1607
+ # @option opts [Boolean] :auto_order_cancel Cancel associated auto orders (default to false)
1608
+ # @option opts [Boolean] :manual_refund Consider a manual refund done externally (default to false)
1609
+ # @option opts [Boolean] :reverse_affiliate_transactions Reverse affiliate transactions (default to true)
1610
+ # @option opts [Boolean] :issue_store_credit Issue a store credit instead of refunding the original payment method, loyalty must be configured on merchant account (default to false)
1611
+ # @option opts [String] :auto_order_cancel_reason Reason for auto orders cancellation
1612
+ # @option opts [String] :refund_reason Reason for refund
1613
+ # @option opts [String] :reject_reason Reason for reject
1614
+ # @return [Array<(OrderResponse, Integer, Hash)>] OrderResponse data, response status code and response headers
1615
+ def refund_order_completely_with_http_info(order_id, opts = {})
1616
+ if @api_client.config.debugging
1617
+ @api_client.config.logger.debug 'Calling API: OrderApi.refund_order_completely ...'
1618
+ end
1619
+ # verify the required parameter 'order_id' is set
1620
+ if @api_client.config.client_side_validation && order_id.nil?
1621
+ fail ArgumentError, "Missing the required parameter 'order_id' when calling OrderApi.refund_order_completely"
1622
+ end
1623
+ # resource path
1624
+ local_var_path = '/order/orders/{order_id}/refund_completely'.sub('{' + 'order_id' + '}', CGI.escape(order_id.to_s))
1625
+
1626
+ # query parameters
1627
+ query_params = opts[:query_params] || {}
1628
+ query_params[:'reject_after_refund'] = opts[:'reject_after_refund'] if !opts[:'reject_after_refund'].nil?
1629
+ query_params[:'skip_customer_notification'] = opts[:'skip_customer_notification'] if !opts[:'skip_customer_notification'].nil?
1630
+ query_params[:'auto_order_cancel'] = opts[:'auto_order_cancel'] if !opts[:'auto_order_cancel'].nil?
1631
+ query_params[:'manual_refund'] = opts[:'manual_refund'] if !opts[:'manual_refund'].nil?
1632
+ query_params[:'reverse_affiliate_transactions'] = opts[:'reverse_affiliate_transactions'] if !opts[:'reverse_affiliate_transactions'].nil?
1633
+ query_params[:'issue_store_credit'] = opts[:'issue_store_credit'] if !opts[:'issue_store_credit'].nil?
1634
+ query_params[:'auto_order_cancel_reason'] = opts[:'auto_order_cancel_reason'] if !opts[:'auto_order_cancel_reason'].nil?
1635
+ query_params[:'refund_reason'] = opts[:'refund_reason'] if !opts[:'refund_reason'].nil?
1636
+ query_params[:'reject_reason'] = opts[:'reject_reason'] if !opts[:'reject_reason'].nil?
1637
+
1638
+ # header parameters
1639
+ header_params = opts[:header_params] || {}
1640
+ header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
1641
+ # HTTP header 'Accept' (if needed)
1642
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1643
+
1644
+ # form parameters
1645
+ form_params = opts[:form_params] || {}
1646
+
1647
+ # http body (model)
1648
+ post_body = opts[:debug_body]
1649
+
1650
+ # return_type
1651
+ return_type = opts[:debug_return_type] || 'OrderResponse'
1652
+
1653
+ # auth_names
1654
+ auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']
1655
+
1656
+ new_options = opts.merge(
1657
+ :operation => :"OrderApi.refund_order_completely",
1658
+ :header_params => header_params,
1659
+ :query_params => query_params,
1660
+ :form_params => form_params,
1661
+ :body => post_body,
1662
+ :auth_names => auth_names,
1663
+ :return_type => return_type
1664
+ )
1665
+
1666
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
1667
+ if @api_client.config.debugging
1668
+ @api_client.config.logger.debug "API called: OrderApi#refund_order_completely\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1669
+ end
1670
+ return data, status_code, headers
1671
+ end
1672
+
1582
1673
  # Replacement order
1583
1674
  # Create a replacement order based upon a previous order
1584
1675
  # @param order_id [String] The order id to generate a replacement for.
@@ -1103,7 +1103,7 @@ module UltracartClient
1103
1103
  return false if !@email.nil? && @email.to_s.length > 100
1104
1104
  return false if !@gift_email.nil? && @gift_email.to_s.length > 100
1105
1105
  return false if !@gift_message.nil? && @gift_message.to_s.length > 10000
1106
- payment_method_validator = EnumAttributeValidator.new('String', ["Affirm", "Amazon", "Check", "COD", "Credit Card", "eCheck", "LoanHero", "Money Order", "PayPal", "Purchase Order", "Quote Request", "Wire Transfer"])
1106
+ payment_method_validator = EnumAttributeValidator.new('String', ["Affirm", "Amazon", "Check", "COD", "Credit Card", "eCheck", "LoanHero", "Money Order", "PayPal", "Purchase Order", "Quote Request", "Wire Transfer", "PayPal Fastlane"])
1107
1107
  return false unless payment_method_validator.valid?(@payment_method)
1108
1108
  return false if !@screen_branding_theme_code.nil? && @screen_branding_theme_code.to_s.length > 10
1109
1109
  return false if !@shipto_address1.nil? && @shipto_address1.to_s.length > 50
@@ -1375,7 +1375,7 @@ module UltracartClient
1375
1375
  # Custom attribute writer method checking allowed values (enum).
1376
1376
  # @param [Object] payment_method Object to be assigned
1377
1377
  def payment_method=(payment_method)
1378
- validator = EnumAttributeValidator.new('String', ["Affirm", "Amazon", "Check", "COD", "Credit Card", "eCheck", "LoanHero", "Money Order", "PayPal", "Purchase Order", "Quote Request", "Wire Transfer"])
1378
+ validator = EnumAttributeValidator.new('String', ["Affirm", "Amazon", "Check", "COD", "Credit Card", "eCheck", "LoanHero", "Money Order", "PayPal", "Purchase Order", "Quote Request", "Wire Transfer", "PayPal Fastlane"])
1379
1379
  unless validator.valid?(payment_method)
1380
1380
  fail ArgumentError, "invalid value for \"payment_method\", must be one of #{validator.allowable_values}."
1381
1381
  end
@@ -30,6 +30,9 @@ module UltracartClient
30
30
  # Item options
31
31
  attr_accessor :options
32
32
 
33
+ # Properties
34
+ attr_accessor :properties
35
+
33
36
  # Quantity
34
37
  attr_accessor :quantity
35
38
 
@@ -66,6 +69,7 @@ module UltracartClient
66
69
  :'auto_order_schedule' => :'auto_order_schedule',
67
70
  :'merchant_item_id' => :'merchant_item_id',
68
71
  :'options' => :'options',
72
+ :'properties' => :'properties',
69
73
  :'quantity' => :'quantity',
70
74
  :'upsell' => :'upsell'
71
75
  }
@@ -84,6 +88,7 @@ module UltracartClient
84
88
  :'auto_order_schedule' => :'String',
85
89
  :'merchant_item_id' => :'String',
86
90
  :'options' => :'Array<ChannelPartnerOrderItemOption>',
91
+ :'properties' => :'Array<ChannelPartnerOrderItemProperty>',
87
92
  :'quantity' => :'Float',
88
93
  :'upsell' => :'Boolean'
89
94
  }
@@ -132,6 +137,12 @@ module UltracartClient
132
137
  end
133
138
  end
134
139
 
140
+ if attributes.key?(:'properties')
141
+ if (value = attributes[:'properties']).is_a?(Array)
142
+ self.properties = value
143
+ end
144
+ end
145
+
135
146
  if attributes.key?(:'quantity')
136
147
  self.quantity = attributes[:'quantity']
137
148
  end
@@ -191,6 +202,7 @@ module UltracartClient
191
202
  auto_order_schedule == o.auto_order_schedule &&
192
203
  merchant_item_id == o.merchant_item_id &&
193
204
  options == o.options &&
205
+ properties == o.properties &&
194
206
  quantity == o.quantity &&
195
207
  upsell == o.upsell
196
208
  end
@@ -204,7 +216,7 @@ module UltracartClient
204
216
  # Calculates hash code according to all attributes.
205
217
  # @return [Integer] Hash code
206
218
  def hash
207
- [arbitrary_unit_cost, auto_order_last_rebill_dts, auto_order_schedule, merchant_item_id, options, quantity, upsell].hash
219
+ [arbitrary_unit_cost, auto_order_last_rebill_dts, auto_order_schedule, merchant_item_id, options, properties, quantity, upsell].hash
208
220
  end
209
221
 
210
222
  # Builds the object from hash
@@ -0,0 +1,280 @@
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 ChannelPartnerOrderItemProperty
18
+ # True if this property is displayed to the customer
19
+ attr_accessor :display
20
+
21
+ # The date/time that the property expires and is deleted
22
+ attr_accessor :expiration_dts
23
+
24
+ # Name
25
+ attr_accessor :name
26
+
27
+ # Value
28
+ attr_accessor :value
29
+
30
+ # Attribute mapping from ruby-style variable name to JSON key.
31
+ def self.attribute_map
32
+ {
33
+ :'display' => :'display',
34
+ :'expiration_dts' => :'expiration_dts',
35
+ :'name' => :'name',
36
+ :'value' => :'value'
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
+ :'display' => :'Boolean',
49
+ :'expiration_dts' => :'String',
50
+ :'name' => :'String',
51
+ :'value' => :'String'
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::ChannelPartnerOrderItemProperty` 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::ChannelPartnerOrderItemProperty`. 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?(:'display')
77
+ self.display = attributes[:'display']
78
+ end
79
+
80
+ if attributes.key?(:'expiration_dts')
81
+ self.expiration_dts = attributes[:'expiration_dts']
82
+ end
83
+
84
+ if attributes.key?(:'name')
85
+ self.name = attributes[:'name']
86
+ end
87
+
88
+ if attributes.key?(:'value')
89
+ self.value = attributes[:'value']
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
+ if !@name.nil? && @name.to_s.length > 100
98
+ invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 100.')
99
+ end
100
+
101
+ if !@value.nil? && @value.to_s.length > 3800
102
+ invalid_properties.push('invalid value for "value", the character length must be smaller than or equal to 3800.')
103
+ end
104
+
105
+ invalid_properties
106
+ end
107
+
108
+ # Check to see if the all the properties in the model are valid
109
+ # @return true if the model is valid
110
+ def valid?
111
+ return false if !@name.nil? && @name.to_s.length > 100
112
+ return false if !@value.nil? && @value.to_s.length > 3800
113
+ true
114
+ end
115
+
116
+ # Custom attribute writer method with validation
117
+ # @param [Object] name Value to be assigned
118
+ def name=(name)
119
+ if !name.nil? && name.to_s.length > 100
120
+ fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 100.'
121
+ end
122
+
123
+ @name = name
124
+ end
125
+
126
+ # Custom attribute writer method with validation
127
+ # @param [Object] value Value to be assigned
128
+ def value=(value)
129
+ if !value.nil? && value.to_s.length > 3800
130
+ fail ArgumentError, 'invalid value for "value", the character length must be smaller than or equal to 3800.'
131
+ end
132
+
133
+ @value = value
134
+ end
135
+
136
+ # Checks equality by comparing each attribute.
137
+ # @param [Object] Object to be compared
138
+ def ==(o)
139
+ return true if self.equal?(o)
140
+ self.class == o.class &&
141
+ display == o.display &&
142
+ expiration_dts == o.expiration_dts &&
143
+ name == o.name &&
144
+ value == o.value
145
+ end
146
+
147
+ # @see the `==` method
148
+ # @param [Object] Object to be compared
149
+ def eql?(o)
150
+ self == o
151
+ end
152
+
153
+ # Calculates hash code according to all attributes.
154
+ # @return [Integer] Hash code
155
+ def hash
156
+ [display, expiration_dts, name, value].hash
157
+ end
158
+
159
+ # Builds the object from hash
160
+ # @param [Hash] attributes Model attributes in the form of hash
161
+ # @return [Object] Returns the model itself
162
+ def self.build_from_hash(attributes)
163
+ new.build_from_hash(attributes)
164
+ end
165
+
166
+ # Builds the object from hash
167
+ # @param [Hash] attributes Model attributes in the form of hash
168
+ # @return [Object] Returns the model itself
169
+ def build_from_hash(attributes)
170
+ return nil unless attributes.is_a?(Hash)
171
+ attributes = attributes.transform_keys(&:to_sym)
172
+ self.class.openapi_types.each_pair do |key, type|
173
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
174
+ self.send("#{key}=", nil)
175
+ elsif type =~ /\AArray<(.*)>/i
176
+ # check to ensure the input is an array given that the attribute
177
+ # is documented as an array but the input is not
178
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
179
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
180
+ end
181
+ elsif !attributes[self.class.attribute_map[key]].nil?
182
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
183
+ end
184
+ end
185
+
186
+ self
187
+ end
188
+
189
+ # Deserializes the data based on type
190
+ # @param string type Data type
191
+ # @param string value Value to be deserialized
192
+ # @return [Object] Deserialized data
193
+ def _deserialize(type, value)
194
+ case type.to_sym
195
+ when :Time
196
+ Time.parse(value)
197
+ when :Date
198
+ Date.parse(value)
199
+ when :String
200
+ value.to_s
201
+ when :Integer
202
+ value.to_i
203
+ when :Float
204
+ value.to_f
205
+ when :Boolean
206
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
207
+ true
208
+ else
209
+ false
210
+ end
211
+ when :Object
212
+ # generic object (usually a Hash), return directly
213
+ value
214
+ when /\AArray<(?<inner_type>.+)>\z/
215
+ inner_type = Regexp.last_match[:inner_type]
216
+ value.map { |v| _deserialize(inner_type, v) }
217
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
218
+ k_type = Regexp.last_match[:k_type]
219
+ v_type = Regexp.last_match[:v_type]
220
+ {}.tap do |hash|
221
+ value.each do |k, v|
222
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
223
+ end
224
+ end
225
+ else # model
226
+ # models (e.g. Pet) or oneOf
227
+ klass = UltracartClient.const_get(type)
228
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
229
+ end
230
+ end
231
+
232
+ # Returns the string representation of the object
233
+ # @return [String] String presentation of the object
234
+ def to_s
235
+ to_hash.to_s
236
+ end
237
+
238
+ # to_body is an alias to to_hash (backward compatibility)
239
+ # @return [Hash] Returns the object in the form of hash
240
+ def to_body
241
+ to_hash
242
+ end
243
+
244
+ # Returns the object in the form of hash
245
+ # @return [Hash] Returns the object in the form of hash
246
+ def to_hash
247
+ hash = {}
248
+ self.class.attribute_map.each_pair do |attr, param|
249
+ value = self.send(attr)
250
+ if value.nil?
251
+ is_nullable = self.class.openapi_nullable.include?(attr)
252
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
253
+ end
254
+
255
+ hash[param] = _to_hash(value)
256
+ end
257
+ hash
258
+ end
259
+
260
+ # Outputs non-array value in the form of hash
261
+ # For object, use to_hash. Otherwise, just return the value
262
+ # @param [Object] value Any valid value
263
+ # @return [Hash] Returns the value in the form of hash
264
+ def _to_hash(value)
265
+ if value.is_a?(Array)
266
+ value.compact.map { |v| _to_hash(v) }
267
+ elsif value.is_a?(Hash)
268
+ {}.tap do |hash|
269
+ value.each { |k, v| hash[k] = _to_hash(v) }
270
+ end
271
+ elsif value.respond_to? :to_hash
272
+ value.to_hash
273
+ else
274
+ value
275
+ end
276
+ end
277
+
278
+ end
279
+
280
+ end
@@ -260,7 +260,7 @@ module UltracartClient
260
260
  # Check to see if the all the properties in the model are valid
261
261
  # @return true if the model is valid
262
262
  def valid?
263
- payment_method_validator = EnumAttributeValidator.new('String', ["Affirm", "Amazon", "Amazon Pay", "Amazon SC", "Cash", "Check", "COD", "Credit Card", "eBay", "eCheck", "Google Shopping", "Insurance", "Link", "LoanHero", "Money Order", "PayPal", "Purchase Order", "Quote Request", "Unknown", "Wire Transfer", "Walmart", "Shop.com", "Sezzle", "Venmo", "Apple Pay", "Google Pay", "Health Benefit Card"])
263
+ payment_method_validator = EnumAttributeValidator.new('String', ["Affirm", "Amazon", "Amazon Pay", "Amazon SC", "Cash", "Check", "COD", "Credit Card", "eBay", "eCheck", "Google Shopping", "Insurance", "Link", "LoanHero", "Money Order", "PayPal", "Purchase Order", "Quote Request", "Unknown", "Wire Transfer", "Walmart", "Shop.com", "Sezzle", "Venmo", "Apple Pay", "Google Pay", "Health Benefit Card", "PayPal Fastlane"])
264
264
  return false unless payment_method_validator.valid?(@payment_method)
265
265
  payment_status_validator = EnumAttributeValidator.new('String', ["Unprocessed", "Authorized", "Capture Failed", "Processed", "Declined", "Voided", "Refunded", "Skipped"])
266
266
  return false unless payment_status_validator.valid?(@payment_status)
@@ -270,7 +270,7 @@ module UltracartClient
270
270
  # Custom attribute writer method checking allowed values (enum).
271
271
  # @param [Object] payment_method Object to be assigned
272
272
  def payment_method=(payment_method)
273
- validator = EnumAttributeValidator.new('String', ["Affirm", "Amazon", "Amazon Pay", "Amazon SC", "Cash", "Check", "COD", "Credit Card", "eBay", "eCheck", "Google Shopping", "Insurance", "Link", "LoanHero", "Money Order", "PayPal", "Purchase Order", "Quote Request", "Unknown", "Wire Transfer", "Walmart", "Shop.com", "Sezzle", "Venmo", "Apple Pay", "Google Pay", "Health Benefit Card"])
273
+ validator = EnumAttributeValidator.new('String', ["Affirm", "Amazon", "Amazon Pay", "Amazon SC", "Cash", "Check", "COD", "Credit Card", "eBay", "eCheck", "Google Shopping", "Insurance", "Link", "LoanHero", "Money Order", "PayPal", "Purchase Order", "Quote Request", "Unknown", "Wire Transfer", "Walmart", "Shop.com", "Sezzle", "Venmo", "Apple Pay", "Google Pay", "Health Benefit Card", "PayPal Fastlane"])
274
274
  unless validator.valid?(payment_method)
275
275
  fail ArgumentError, "invalid value for \"payment_method\", must be one of #{validator.allowable_values}."
276
276
  end
@@ -530,7 +530,7 @@ module UltracartClient
530
530
  return false if !@email.nil? && @email.to_s.length > 100
531
531
  return false if !@first_name.nil? && @first_name.to_s.length > 30
532
532
  return false if !@last_name.nil? && @last_name.to_s.length > 30
533
- payment_method_validator = EnumAttributeValidator.new('String', ["Affirm", "Amazon", "Amazon SC", "Cash", "Check", "COD", "Credit Card", "eCheck", "LoanHero", "Money Order", "PayPal", "Purchase Order", "Quote Request", "Unknown", "Wire Transfer", "Venmo", "Apple Pay", " Google Pay"])
533
+ payment_method_validator = EnumAttributeValidator.new('String', ["Affirm", "Amazon", "Amazon SC", "Cash", "Check", "COD", "Credit Card", "eCheck", "LoanHero", "Money Order", "PayPal", "Purchase Order", "Quote Request", "Unknown", "Wire Transfer", "Venmo", "Apple Pay", " Google Pay", "PayPal Fastlane"])
534
534
  return false unless payment_method_validator.valid?(@payment_method)
535
535
  return false if !@phone.nil? && @phone.to_s.length > 25
536
536
  return false if !@postal_code.nil? && @postal_code.to_s.length > 20
@@ -625,7 +625,7 @@ module UltracartClient
625
625
  # Custom attribute writer method checking allowed values (enum).
626
626
  # @param [Object] payment_method Object to be assigned
627
627
  def payment_method=(payment_method)
628
- validator = EnumAttributeValidator.new('String', ["Affirm", "Amazon", "Amazon SC", "Cash", "Check", "COD", "Credit Card", "eCheck", "LoanHero", "Money Order", "PayPal", "Purchase Order", "Quote Request", "Unknown", "Wire Transfer", "Venmo", "Apple Pay", " Google Pay"])
628
+ validator = EnumAttributeValidator.new('String', ["Affirm", "Amazon", "Amazon SC", "Cash", "Check", "COD", "Credit Card", "eCheck", "LoanHero", "Money Order", "PayPal", "Purchase Order", "Quote Request", "Unknown", "Wire Transfer", "Venmo", "Apple Pay", " Google Pay", "PayPal Fastlane"])
629
629
  unless validator.valid?(payment_method)
630
630
  fail ArgumentError, "invalid value for \"payment_method\", must be one of #{validator.allowable_values}."
631
631
  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.4'
14
+ VERSION = '4.1.6'
15
15
  end
data/lib/ultracart_api.rb CHANGED
@@ -128,6 +128,7 @@ require 'ultracart_api/models/channel_partner_import_response'
128
128
  require 'ultracart_api/models/channel_partner_order'
129
129
  require 'ultracart_api/models/channel_partner_order_item'
130
130
  require 'ultracart_api/models/channel_partner_order_item_option'
131
+ require 'ultracart_api/models/channel_partner_order_item_property'
131
132
  require 'ultracart_api/models/channel_partner_order_transaction'
132
133
  require 'ultracart_api/models/channel_partner_order_transaction_detail'
133
134
  require 'ultracart_api/models/channel_partner_ship_to_preference'
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.4
4
+ version: 4.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - UltraCart
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-03-07 00:00:00.000000000 Z
11
+ date: 2025-04-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus
@@ -175,6 +175,7 @@ files:
175
175
  - docs/ChannelPartnerOrder.md
176
176
  - docs/ChannelPartnerOrderItem.md
177
177
  - docs/ChannelPartnerOrderItemOption.md
178
+ - docs/ChannelPartnerOrderItemProperty.md
178
179
  - docs/ChannelPartnerOrderTransaction.md
179
180
  - docs/ChannelPartnerOrderTransactionDetail.md
180
181
  - docs/ChannelPartnerShipToPreference.md
@@ -1075,6 +1076,7 @@ files:
1075
1076
  - lib/ultracart_api/models/channel_partner_order.rb
1076
1077
  - lib/ultracart_api/models/channel_partner_order_item.rb
1077
1078
  - lib/ultracart_api/models/channel_partner_order_item_option.rb
1079
+ - lib/ultracart_api/models/channel_partner_order_item_property.rb
1078
1080
  - lib/ultracart_api/models/channel_partner_order_transaction.rb
1079
1081
  - lib/ultracart_api/models/channel_partner_order_transaction_detail.rb
1080
1082
  - lib/ultracart_api/models/channel_partner_ship_to_preference.rb