ultracart_api 3.4.0 → 3.4.4

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.
@@ -160,6 +160,61 @@ module UltracartClient
160
160
  end
161
161
  return data, status_code, headers
162
162
  end
163
+ # Retrieve integration log summaries
164
+ # Retrieves a set of integration log summaries from the account based on a query object.
165
+ # @param integration_log_summaries_query Integration log summaries query
166
+ # @param [Hash] opts the optional parameters
167
+ # @return [IntegrationLogSummaryQueryResponse]
168
+ def get_integration_log_summaries_query(integration_log_summaries_query, opts = {})
169
+ data, _status_code, _headers = get_integration_log_summaries_query_with_http_info(integration_log_summaries_query, opts)
170
+ data
171
+ end
172
+
173
+ # Retrieve integration log summaries
174
+ # Retrieves a set of integration log summaries from the account based on a query object.
175
+ # @param integration_log_summaries_query Integration log summaries query
176
+ # @param [Hash] opts the optional parameters
177
+ # @return [Array<(IntegrationLogSummaryQueryResponse, Fixnum, Hash)>] IntegrationLogSummaryQueryResponse data, response status code and response headers
178
+ def get_integration_log_summaries_query_with_http_info(integration_log_summaries_query, opts = {})
179
+ if @api_client.config.debugging
180
+ @api_client.config.logger.debug 'Calling API: IntegrationLogApi.get_integration_log_summaries_query ...'
181
+ end
182
+ # verify the required parameter 'integration_log_summaries_query' is set
183
+ if @api_client.config.client_side_validation && integration_log_summaries_query.nil?
184
+ fail ArgumentError, "Missing the required parameter 'integration_log_summaries_query' when calling IntegrationLogApi.get_integration_log_summaries_query"
185
+ end
186
+ # resource path
187
+ local_var_path = '/integration_log/summary/query'
188
+
189
+ # query parameters
190
+ query_params = {}
191
+
192
+ # header parameters
193
+ header_params = {}
194
+ header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
195
+ # HTTP header 'Accept' (if needed)
196
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
197
+ # HTTP header 'Content-Type'
198
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
199
+
200
+ # form parameters
201
+ form_params = {}
202
+
203
+ # http body (model)
204
+ post_body = @api_client.object_to_http_body(integration_log_summaries_query)
205
+ auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey']
206
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
207
+ :header_params => header_params,
208
+ :query_params => query_params,
209
+ :form_params => form_params,
210
+ :body => post_body,
211
+ :auth_names => auth_names,
212
+ :return_type => 'IntegrationLogSummaryQueryResponse')
213
+ if @api_client.config.debugging
214
+ @api_client.config.logger.debug "API called: IntegrationLogApi#get_integration_log_summaries_query\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
215
+ end
216
+ return data, status_code, headers
217
+ end
163
218
  # Retrieve integration logs
164
219
  # Retrieves a set of integration logs from the account based on a query object.
165
220
  # @param integration_log_query Integration log query
@@ -0,0 +1,256 @@
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 IntegrationLogSummary
17
+ attr_accessor :critical
18
+
19
+ attr_accessor :error
20
+
21
+ attr_accessor :events
22
+
23
+ attr_accessor :log_type
24
+
25
+ attr_accessor :logger_id
26
+
27
+ attr_accessor :logger_name
28
+
29
+ attr_accessor :success
30
+
31
+ attr_accessor :view_url
32
+
33
+ attr_accessor :warning
34
+
35
+ # Attribute mapping from ruby-style variable name to JSON key.
36
+ def self.attribute_map
37
+ {
38
+ :'critical' => :'critical',
39
+ :'error' => :'error',
40
+ :'events' => :'events',
41
+ :'log_type' => :'log_type',
42
+ :'logger_id' => :'logger_id',
43
+ :'logger_name' => :'logger_name',
44
+ :'success' => :'success',
45
+ :'view_url' => :'view_url',
46
+ :'warning' => :'warning'
47
+ }
48
+ end
49
+
50
+ # Attribute type mapping.
51
+ def self.swagger_types
52
+ {
53
+ :'critical' => :'Integer',
54
+ :'error' => :'Integer',
55
+ :'events' => :'Integer',
56
+ :'log_type' => :'String',
57
+ :'logger_id' => :'String',
58
+ :'logger_name' => :'String',
59
+ :'success' => :'Integer',
60
+ :'view_url' => :'String',
61
+ :'warning' => :'Integer'
62
+ }
63
+ end
64
+
65
+ # Initializes the object
66
+ # @param [Hash] attributes Model attributes in the form of hash
67
+ def initialize(attributes = {})
68
+ return unless attributes.is_a?(Hash)
69
+
70
+ # convert string to symbol for hash key
71
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
72
+
73
+ if attributes.has_key?(:'critical')
74
+ self.critical = attributes[:'critical']
75
+ end
76
+
77
+ if attributes.has_key?(:'error')
78
+ self.error = attributes[:'error']
79
+ end
80
+
81
+ if attributes.has_key?(:'events')
82
+ self.events = attributes[:'events']
83
+ end
84
+
85
+ if attributes.has_key?(:'log_type')
86
+ self.log_type = attributes[:'log_type']
87
+ end
88
+
89
+ if attributes.has_key?(:'logger_id')
90
+ self.logger_id = attributes[:'logger_id']
91
+ end
92
+
93
+ if attributes.has_key?(:'logger_name')
94
+ self.logger_name = attributes[:'logger_name']
95
+ end
96
+
97
+ if attributes.has_key?(:'success')
98
+ self.success = attributes[:'success']
99
+ end
100
+
101
+ if attributes.has_key?(:'view_url')
102
+ self.view_url = attributes[:'view_url']
103
+ end
104
+
105
+ if attributes.has_key?(:'warning')
106
+ self.warning = attributes[:'warning']
107
+ end
108
+ end
109
+
110
+ # Show invalid properties with the reasons. Usually used together with valid?
111
+ # @return Array for valid properties with the reasons
112
+ def list_invalid_properties
113
+ invalid_properties = Array.new
114
+ invalid_properties
115
+ end
116
+
117
+ # Check to see if the all the properties in the model are valid
118
+ # @return true if the model is valid
119
+ def valid?
120
+ true
121
+ end
122
+
123
+ # Checks equality by comparing each attribute.
124
+ # @param [Object] Object to be compared
125
+ def ==(o)
126
+ return true if self.equal?(o)
127
+ self.class == o.class &&
128
+ critical == o.critical &&
129
+ error == o.error &&
130
+ events == o.events &&
131
+ log_type == o.log_type &&
132
+ logger_id == o.logger_id &&
133
+ logger_name == o.logger_name &&
134
+ success == o.success &&
135
+ view_url == o.view_url &&
136
+ warning == o.warning
137
+ end
138
+
139
+ # @see the `==` method
140
+ # @param [Object] Object to be compared
141
+ def eql?(o)
142
+ self == o
143
+ end
144
+
145
+ # Calculates hash code according to all attributes.
146
+ # @return [Fixnum] Hash code
147
+ def hash
148
+ [critical, error, events, log_type, logger_id, logger_name, success, view_url, warning].hash
149
+ end
150
+
151
+ # Builds the object from hash
152
+ # @param [Hash] attributes Model attributes in the form of hash
153
+ # @return [Object] Returns the model itself
154
+ def build_from_hash(attributes)
155
+ return nil unless attributes.is_a?(Hash)
156
+ self.class.swagger_types.each_pair do |key, type|
157
+ if type =~ /\AArray<(.*)>/i
158
+ # check to ensure the input is an array given that the attribute
159
+ # is documented as an array but the input is not
160
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
161
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
162
+ end
163
+ elsif !attributes[self.class.attribute_map[key]].nil?
164
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
165
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
166
+ end
167
+
168
+ self
169
+ end
170
+
171
+ # Deserializes the data based on type
172
+ # @param string type Data type
173
+ # @param string value Value to be deserialized
174
+ # @return [Object] Deserialized data
175
+ def _deserialize(type, value)
176
+ case type.to_sym
177
+ when :DateTime
178
+ DateTime.parse(value)
179
+ when :Date
180
+ Date.parse(value)
181
+ when :String
182
+ value.to_s
183
+ when :Integer
184
+ value.to_i
185
+ when :Float
186
+ value.to_f
187
+ when :BOOLEAN
188
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
189
+ true
190
+ else
191
+ false
192
+ end
193
+ when :Object
194
+ # generic object (usually a Hash), return directly
195
+ value
196
+ when /\AArray<(?<inner_type>.+)>\z/
197
+ inner_type = Regexp.last_match[:inner_type]
198
+ value.map { |v| _deserialize(inner_type, v) }
199
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
200
+ k_type = Regexp.last_match[:k_type]
201
+ v_type = Regexp.last_match[:v_type]
202
+ {}.tap do |hash|
203
+ value.each do |k, v|
204
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
205
+ end
206
+ end
207
+ else # model
208
+ temp_model = UltracartClient.const_get(type).new
209
+ temp_model.build_from_hash(value)
210
+ end
211
+ end
212
+
213
+ # Returns the string representation of the object
214
+ # @return [String] String presentation of the object
215
+ def to_s
216
+ to_hash.to_s
217
+ end
218
+
219
+ # to_body is an alias to to_hash (backward compatibility)
220
+ # @return [Hash] Returns the object in the form of hash
221
+ def to_body
222
+ to_hash
223
+ end
224
+
225
+ # Returns the object in the form of hash
226
+ # @return [Hash] Returns the object in the form of hash
227
+ def to_hash
228
+ hash = {}
229
+ self.class.attribute_map.each_pair do |attr, param|
230
+ value = self.send(attr)
231
+ next if value.nil?
232
+ hash[param] = _to_hash(value)
233
+ end
234
+ hash
235
+ end
236
+
237
+ # Outputs non-array value in the form of hash
238
+ # For object, use to_hash. Otherwise, just return the value
239
+ # @param [Object] value Any valid value
240
+ # @return [Hash] Returns the value in the form of hash
241
+ def _to_hash(value)
242
+ if value.is_a?(Array)
243
+ value.compact.map { |v| _to_hash(v) }
244
+ elsif value.is_a?(Hash)
245
+ {}.tap do |hash|
246
+ value.each { |k, v| hash[k] = _to_hash(v) }
247
+ end
248
+ elsif value.respond_to? :to_hash
249
+ value.to_hash
250
+ else
251
+ value
252
+ end
253
+ end
254
+
255
+ end
256
+ 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 IntegrationLogSummaryQueryRequest
17
+ # Log date/time begin
18
+ attr_accessor :log_dts_begin
19
+
20
+ # Log date/time end
21
+ attr_accessor :log_dts_end
22
+
23
+ # Attribute mapping from ruby-style variable name to JSON key.
24
+ def self.attribute_map
25
+ {
26
+ :'log_dts_begin' => :'log_dts_begin',
27
+ :'log_dts_end' => :'log_dts_end'
28
+ }
29
+ end
30
+
31
+ # Attribute type mapping.
32
+ def self.swagger_types
33
+ {
34
+ :'log_dts_begin' => :'String',
35
+ :'log_dts_end' => :'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?(:'log_dts_begin')
48
+ self.log_dts_begin = attributes[:'log_dts_begin']
49
+ end
50
+
51
+ if attributes.has_key?(:'log_dts_end')
52
+ self.log_dts_end = attributes[:'log_dts_end']
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
+ log_dts_begin == o.log_dts_begin &&
75
+ log_dts_end == o.log_dts_end
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
+ [log_dts_begin, log_dts_end].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