ultracart_api 3.9.8 → 3.10.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,195 @@
1
+ =begin
2
+ #UltraCart Rest API V2
3
+
4
+ #UltraCart REST API Version 2
5
+
6
+ OpenAPI spec version: 2.0.0
7
+ Contact: support@ultracart.com
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.15-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module UltracartClient
16
+ class ChannelPartnerOrderTransactionDetail
17
+ # The name of the item option.
18
+ attr_accessor :name
19
+
20
+ # The value of the item option.
21
+ attr_accessor :value
22
+
23
+ # Attribute mapping from ruby-style variable name to JSON key.
24
+ def self.attribute_map
25
+ {
26
+ :'name' => :'name',
27
+ :'value' => :'value'
28
+ }
29
+ end
30
+
31
+ # Attribute type mapping.
32
+ def self.swagger_types
33
+ {
34
+ :'name' => :'String',
35
+ :'value' => :'String'
36
+ }
37
+ end
38
+
39
+ # Initializes the object
40
+ # @param [Hash] attributes Model attributes in the form of hash
41
+ def initialize(attributes = {})
42
+ return unless attributes.is_a?(Hash)
43
+
44
+ # convert string to symbol for hash key
45
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
46
+
47
+ if attributes.has_key?(:'name')
48
+ self.name = attributes[:'name']
49
+ end
50
+
51
+ if attributes.has_key?(:'value')
52
+ self.value = attributes[:'value']
53
+ end
54
+ end
55
+
56
+ # Show invalid properties with the reasons. Usually used together with valid?
57
+ # @return Array for valid properties with the reasons
58
+ def list_invalid_properties
59
+ invalid_properties = Array.new
60
+ invalid_properties
61
+ end
62
+
63
+ # Check to see if the all the properties in the model are valid
64
+ # @return true if the model is valid
65
+ def valid?
66
+ true
67
+ end
68
+
69
+ # Checks equality by comparing each attribute.
70
+ # @param [Object] Object to be compared
71
+ def ==(o)
72
+ return true if self.equal?(o)
73
+ self.class == o.class &&
74
+ name == o.name &&
75
+ value == o.value
76
+ end
77
+
78
+ # @see the `==` method
79
+ # @param [Object] Object to be compared
80
+ def eql?(o)
81
+ self == o
82
+ end
83
+
84
+ # Calculates hash code according to all attributes.
85
+ # @return [Fixnum] Hash code
86
+ def hash
87
+ [name, value].hash
88
+ end
89
+
90
+ # Builds the object from hash
91
+ # @param [Hash] attributes Model attributes in the form of hash
92
+ # @return [Object] Returns the model itself
93
+ def build_from_hash(attributes)
94
+ return nil unless attributes.is_a?(Hash)
95
+ self.class.swagger_types.each_pair do |key, type|
96
+ if type =~ /\AArray<(.*)>/i
97
+ # check to ensure the input is an array given that the attribute
98
+ # is documented as an array but the input is not
99
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
100
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
101
+ end
102
+ elsif !attributes[self.class.attribute_map[key]].nil?
103
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
104
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
105
+ end
106
+
107
+ self
108
+ end
109
+
110
+ # Deserializes the data based on type
111
+ # @param string type Data type
112
+ # @param string value Value to be deserialized
113
+ # @return [Object] Deserialized data
114
+ def _deserialize(type, value)
115
+ case type.to_sym
116
+ when :DateTime
117
+ DateTime.parse(value)
118
+ when :Date
119
+ Date.parse(value)
120
+ when :String
121
+ value.to_s
122
+ when :Integer
123
+ value.to_i
124
+ when :Float
125
+ value.to_f
126
+ when :BOOLEAN
127
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
128
+ true
129
+ else
130
+ false
131
+ end
132
+ when :Object
133
+ # generic object (usually a Hash), return directly
134
+ value
135
+ when /\AArray<(?<inner_type>.+)>\z/
136
+ inner_type = Regexp.last_match[:inner_type]
137
+ value.map { |v| _deserialize(inner_type, v) }
138
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
139
+ k_type = Regexp.last_match[:k_type]
140
+ v_type = Regexp.last_match[:v_type]
141
+ {}.tap do |hash|
142
+ value.each do |k, v|
143
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
144
+ end
145
+ end
146
+ else # model
147
+ temp_model = UltracartClient.const_get(type).new
148
+ temp_model.build_from_hash(value)
149
+ end
150
+ end
151
+
152
+ # Returns the string representation of the object
153
+ # @return [String] String presentation of the object
154
+ def to_s
155
+ to_hash.to_s
156
+ end
157
+
158
+ # to_body is an alias to to_hash (backward compatibility)
159
+ # @return [Hash] Returns the object in the form of hash
160
+ def to_body
161
+ to_hash
162
+ end
163
+
164
+ # Returns the object in the form of hash
165
+ # @return [Hash] Returns the object in the form of hash
166
+ def to_hash
167
+ hash = {}
168
+ self.class.attribute_map.each_pair do |attr, param|
169
+ value = self.send(attr)
170
+ next if value.nil?
171
+ hash[param] = _to_hash(value)
172
+ end
173
+ hash
174
+ end
175
+
176
+ # Outputs non-array value in the form of hash
177
+ # For object, use to_hash. Otherwise, just return the value
178
+ # @param [Object] value Any valid value
179
+ # @return [Hash] Returns the value in the form of hash
180
+ def _to_hash(value)
181
+ if value.is_a?(Array)
182
+ value.compact.map { |v| _to_hash(v) }
183
+ elsif value.is_a?(Hash)
184
+ {}.tap do |hash|
185
+ value.each { |k, v| hash[k] = _to_hash(v) }
186
+ end
187
+ elsif value.respond_to? :to_hash
188
+ value.to_hash
189
+ else
190
+ value
191
+ end
192
+ end
193
+
194
+ end
195
+ end
@@ -0,0 +1,195 @@
1
+ =begin
2
+ #UltraCart Rest API V2
3
+
4
+ #UltraCart REST API Version 2
5
+
6
+ OpenAPI spec version: 2.0.0
7
+ Contact: support@ultracart.com
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.15-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module UltracartClient
16
+ class ChannelPartnerShippingEstimate
17
+ # The total estimate for this shipping method based on the provided order.
18
+ attr_accessor :shipping_handling_total
19
+
20
+ # The name of the shipping method
21
+ attr_accessor :shipping_method
22
+
23
+ # Attribute mapping from ruby-style variable name to JSON key.
24
+ def self.attribute_map
25
+ {
26
+ :'shipping_handling_total' => :'shipping_handling_total',
27
+ :'shipping_method' => :'shipping_method'
28
+ }
29
+ end
30
+
31
+ # Attribute type mapping.
32
+ def self.swagger_types
33
+ {
34
+ :'shipping_handling_total' => :'Float',
35
+ :'shipping_method' => :'String'
36
+ }
37
+ end
38
+
39
+ # Initializes the object
40
+ # @param [Hash] attributes Model attributes in the form of hash
41
+ def initialize(attributes = {})
42
+ return unless attributes.is_a?(Hash)
43
+
44
+ # convert string to symbol for hash key
45
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
46
+
47
+ if attributes.has_key?(:'shipping_handling_total')
48
+ self.shipping_handling_total = attributes[:'shipping_handling_total']
49
+ end
50
+
51
+ if attributes.has_key?(:'shipping_method')
52
+ self.shipping_method = attributes[:'shipping_method']
53
+ end
54
+ end
55
+
56
+ # Show invalid properties with the reasons. Usually used together with valid?
57
+ # @return Array for valid properties with the reasons
58
+ def list_invalid_properties
59
+ invalid_properties = Array.new
60
+ invalid_properties
61
+ end
62
+
63
+ # Check to see if the all the properties in the model are valid
64
+ # @return true if the model is valid
65
+ def valid?
66
+ true
67
+ end
68
+
69
+ # Checks equality by comparing each attribute.
70
+ # @param [Object] Object to be compared
71
+ def ==(o)
72
+ return true if self.equal?(o)
73
+ self.class == o.class &&
74
+ shipping_handling_total == o.shipping_handling_total &&
75
+ shipping_method == o.shipping_method
76
+ end
77
+
78
+ # @see the `==` method
79
+ # @param [Object] Object to be compared
80
+ def eql?(o)
81
+ self == o
82
+ end
83
+
84
+ # Calculates hash code according to all attributes.
85
+ # @return [Fixnum] Hash code
86
+ def hash
87
+ [shipping_handling_total, shipping_method].hash
88
+ end
89
+
90
+ # Builds the object from hash
91
+ # @param [Hash] attributes Model attributes in the form of hash
92
+ # @return [Object] Returns the model itself
93
+ def build_from_hash(attributes)
94
+ return nil unless attributes.is_a?(Hash)
95
+ self.class.swagger_types.each_pair do |key, type|
96
+ if type =~ /\AArray<(.*)>/i
97
+ # check to ensure the input is an array given that the attribute
98
+ # is documented as an array but the input is not
99
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
100
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
101
+ end
102
+ elsif !attributes[self.class.attribute_map[key]].nil?
103
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
104
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
105
+ end
106
+
107
+ self
108
+ end
109
+
110
+ # Deserializes the data based on type
111
+ # @param string type Data type
112
+ # @param string value Value to be deserialized
113
+ # @return [Object] Deserialized data
114
+ def _deserialize(type, value)
115
+ case type.to_sym
116
+ when :DateTime
117
+ DateTime.parse(value)
118
+ when :Date
119
+ Date.parse(value)
120
+ when :String
121
+ value.to_s
122
+ when :Integer
123
+ value.to_i
124
+ when :Float
125
+ value.to_f
126
+ when :BOOLEAN
127
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
128
+ true
129
+ else
130
+ false
131
+ end
132
+ when :Object
133
+ # generic object (usually a Hash), return directly
134
+ value
135
+ when /\AArray<(?<inner_type>.+)>\z/
136
+ inner_type = Regexp.last_match[:inner_type]
137
+ value.map { |v| _deserialize(inner_type, v) }
138
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
139
+ k_type = Regexp.last_match[:k_type]
140
+ v_type = Regexp.last_match[:v_type]
141
+ {}.tap do |hash|
142
+ value.each do |k, v|
143
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
144
+ end
145
+ end
146
+ else # model
147
+ temp_model = UltracartClient.const_get(type).new
148
+ temp_model.build_from_hash(value)
149
+ end
150
+ end
151
+
152
+ # Returns the string representation of the object
153
+ # @return [String] String presentation of the object
154
+ def to_s
155
+ to_hash.to_s
156
+ end
157
+
158
+ # to_body is an alias to to_hash (backward compatibility)
159
+ # @return [Hash] Returns the object in the form of hash
160
+ def to_body
161
+ to_hash
162
+ end
163
+
164
+ # Returns the object in the form of hash
165
+ # @return [Hash] Returns the object in the form of hash
166
+ def to_hash
167
+ hash = {}
168
+ self.class.attribute_map.each_pair do |attr, param|
169
+ value = self.send(attr)
170
+ next if value.nil?
171
+ hash[param] = _to_hash(value)
172
+ end
173
+ hash
174
+ end
175
+
176
+ # Outputs non-array value in the form of hash
177
+ # For object, use to_hash. Otherwise, just return the value
178
+ # @param [Object] value Any valid value
179
+ # @return [Hash] Returns the value in the form of hash
180
+ def _to_hash(value)
181
+ if value.is_a?(Array)
182
+ value.compact.map { |v| _to_hash(v) }
183
+ elsif value.is_a?(Hash)
184
+ {}.tap do |hash|
185
+ value.each { |k, v| hash[k] = _to_hash(v) }
186
+ end
187
+ elsif value.respond_to? :to_hash
188
+ value.to_hash
189
+ else
190
+ value
191
+ end
192
+ end
193
+
194
+ end
195
+ end
@@ -11,5 +11,5 @@ Swagger Codegen version: 2.4.15-SNAPSHOT
11
11
  =end
12
12
 
13
13
  module UltracartClient
14
- VERSION = '3.9.8'
14
+ VERSION = '3.10.0'
15
15
  end
data/lib/ultracart_api.rb CHANGED
@@ -113,6 +113,15 @@ require 'ultracart_api/models/cart_taxes'
113
113
  require 'ultracart_api/models/cart_upsell_after'
114
114
  require 'ultracart_api/models/cart_validation_request'
115
115
  require 'ultracart_api/models/cart_validation_response'
116
+ require 'ultracart_api/models/channel_partner_cancel_response'
117
+ require 'ultracart_api/models/channel_partner_estimate_shipping_response'
118
+ require 'ultracart_api/models/channel_partner_import_response'
119
+ require 'ultracart_api/models/channel_partner_order'
120
+ require 'ultracart_api/models/channel_partner_order_item'
121
+ require 'ultracart_api/models/channel_partner_order_item_option'
122
+ require 'ultracart_api/models/channel_partner_order_transaction'
123
+ require 'ultracart_api/models/channel_partner_order_transaction_detail'
124
+ require 'ultracart_api/models/channel_partner_shipping_estimate'
116
125
  require 'ultracart_api/models/chargeback_dispute'
117
126
  require 'ultracart_api/models/chargeback_dispute_response'
118
127
  require 'ultracart_api/models/chargeback_disputes_response'
@@ -675,6 +684,7 @@ require 'ultracart_api/models/weight'
675
684
  # APIs
676
685
  require 'ultracart_api/api/affiliate_api'
677
686
  require 'ultracart_api/api/auto_order_api'
687
+ require 'ultracart_api/api/channel_partner_api'
678
688
  require 'ultracart_api/api/chargeback_api'
679
689
  require 'ultracart_api/api/checkout_api'
680
690
  require 'ultracart_api/api/configuration_api'
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: 3.9.8
4
+ version: 3.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - UltraCart
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-04-26 00:00:00.000000000 Z
11
+ date: 2022-05-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus
@@ -319,6 +319,16 @@ files:
319
319
  - docs/CartUpsellAfter.md
320
320
  - docs/CartValidationRequest.md
321
321
  - docs/CartValidationResponse.md
322
+ - docs/ChannelPartnerApi.md
323
+ - docs/ChannelPartnerCancelResponse.md
324
+ - docs/ChannelPartnerEstimateShippingResponse.md
325
+ - docs/ChannelPartnerImportResponse.md
326
+ - docs/ChannelPartnerOrder.md
327
+ - docs/ChannelPartnerOrderItem.md
328
+ - docs/ChannelPartnerOrderItemOption.md
329
+ - docs/ChannelPartnerOrderTransaction.md
330
+ - docs/ChannelPartnerOrderTransactionDetail.md
331
+ - docs/ChannelPartnerShippingEstimate.md
322
332
  - docs/ChargebackApi.md
323
333
  - docs/ChargebackDispute.md
324
334
  - docs/ChargebackDisputeResponse.md
@@ -897,6 +907,7 @@ files:
897
907
  - lib/ultracart_api.rb
898
908
  - lib/ultracart_api/api/affiliate_api.rb
899
909
  - lib/ultracart_api/api/auto_order_api.rb
910
+ - lib/ultracart_api/api/channel_partner_api.rb
900
911
  - lib/ultracart_api/api/chargeback_api.rb
901
912
  - lib/ultracart_api/api/checkout_api.rb
902
913
  - lib/ultracart_api/api/configuration_api.rb
@@ -1012,6 +1023,15 @@ files:
1012
1023
  - lib/ultracart_api/models/cart_upsell_after.rb
1013
1024
  - lib/ultracart_api/models/cart_validation_request.rb
1014
1025
  - lib/ultracart_api/models/cart_validation_response.rb
1026
+ - lib/ultracart_api/models/channel_partner_cancel_response.rb
1027
+ - lib/ultracart_api/models/channel_partner_estimate_shipping_response.rb
1028
+ - lib/ultracart_api/models/channel_partner_import_response.rb
1029
+ - lib/ultracart_api/models/channel_partner_order.rb
1030
+ - lib/ultracart_api/models/channel_partner_order_item.rb
1031
+ - lib/ultracart_api/models/channel_partner_order_item_option.rb
1032
+ - lib/ultracart_api/models/channel_partner_order_transaction.rb
1033
+ - lib/ultracart_api/models/channel_partner_order_transaction_detail.rb
1034
+ - lib/ultracart_api/models/channel_partner_shipping_estimate.rb
1015
1035
  - lib/ultracart_api/models/chargeback_dispute.rb
1016
1036
  - lib/ultracart_api/models/chargeback_dispute_response.rb
1017
1037
  - lib/ultracart_api/models/chargeback_disputes_response.rb