requestsproxy-rest 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +7 -0
- data/README.md +149 -0
- data/Rakefile +8 -0
- data/docs/ProtobufListValue.md +8 -0
- data/docs/ProtobufNullValue.md +7 -0
- data/docs/ProtobufStruct.md +8 -0
- data/docs/ProtobufValue.md +13 -0
- data/docs/RequestsproxyAccountStarRatingResponse.md +9 -0
- data/docs/RequestsproxyApi.md +1008 -0
- data/docs/RequestsproxyAuthInfoResponse.md +9 -0
- data/docs/RequestsproxyCategory.md +9 -0
- data/docs/RequestsproxyComment.md +11 -0
- data/docs/RequestsproxyCoupon.md +8 -0
- data/docs/RequestsproxyCreateDynamicCouponsCodesResponse.md +9 -0
- data/docs/RequestsproxyCreateWebhookParams.md +9 -0
- data/docs/RequestsproxyDynamicCouponError.md +9 -0
- data/docs/RequestsproxyDynamicCouponsResponse.md +8 -0
- data/docs/RequestsproxyDynamicCouponsStatisticsResponse.md +8 -0
- data/docs/RequestsproxyDynamicCouponsStats.md +9 -0
- data/docs/RequestsproxyFeature.md +12 -0
- data/docs/RequestsproxyFeaturesResponse.md +8 -0
- data/docs/RequestsproxyImageData.md +10 -0
- data/docs/RequestsproxyOrdersResponse.md +8 -0
- data/docs/RequestsproxyPagination.md +10 -0
- data/docs/RequestsproxyProductImage.md +11 -0
- data/docs/RequestsproxyProductResponse.md +19 -0
- data/docs/RequestsproxyProductSpecs.md +9 -0
- data/docs/RequestsproxyProductStarRatingResponse.md +10 -0
- data/docs/RequestsproxyProductsResponse.md +8 -0
- data/docs/RequestsproxyProductsStarRatingResponse.md +8 -0
- data/docs/RequestsproxyPromotedProduct.md +10 -0
- data/docs/RequestsproxyPromotedProductsResponse.md +8 -0
- data/docs/RequestsproxyPurchase.md +16 -0
- data/docs/RequestsproxyResponse.md +28 -0
- data/docs/RequestsproxyReview.md +24 -0
- data/docs/RequestsproxyReviewCustomField.md +11 -0
- data/docs/RequestsproxyReviewResponse.md +8 -0
- data/docs/RequestsproxyReviewsResponse.md +8 -0
- data/docs/RequestsproxyStatus.md +9 -0
- data/docs/RequestsproxyTopReview.md +13 -0
- data/docs/RequestsproxyTopReviewsResponse.md +8 -0
- data/docs/RequestsproxyUserResponse.md +11 -0
- data/docs/RequestsproxyWebhook.md +11 -0
- data/docs/RequestsproxyWebhookEvent.md +9 -0
- data/docs/RequestsproxyWebhookEventsResponse.md +8 -0
- data/docs/RequestsproxyWebhookResponse.md +8 -0
- data/docs/RequestsproxyWebhooksResponse.md +8 -0
- data/git_push.sh +55 -0
- data/lib/requestsproxy-rest.rb +83 -0
- data/lib/requestsproxy-rest/api/requestsproxy_api.rb +1161 -0
- data/lib/requestsproxy-rest/api_client.rb +388 -0
- data/lib/requestsproxy-rest/api_error.rb +38 -0
- data/lib/requestsproxy-rest/configuration.rb +202 -0
- data/lib/requestsproxy-rest/models/protobuf_list_value.rb +187 -0
- data/lib/requestsproxy-rest/models/protobuf_null_value.rb +29 -0
- data/lib/requestsproxy-rest/models/protobuf_struct.rb +187 -0
- data/lib/requestsproxy-rest/models/protobuf_value.rb +235 -0
- data/lib/requestsproxy-rest/models/requestsproxy_account_star_rating_response.rb +192 -0
- data/lib/requestsproxy-rest/models/requestsproxy_auth_info_response.rb +194 -0
- data/lib/requestsproxy-rest/models/requestsproxy_category.rb +192 -0
- data/lib/requestsproxy-rest/models/requestsproxy_comment.rb +210 -0
- data/lib/requestsproxy-rest/models/requestsproxy_coupon.rb +183 -0
- data/lib/requestsproxy-rest/models/requestsproxy_create_dynamic_coupons_codes_response.rb +194 -0
- data/lib/requestsproxy-rest/models/requestsproxy_create_webhook_params.rb +192 -0
- data/lib/requestsproxy-rest/models/requestsproxy_dynamic_coupon_error.rb +192 -0
- data/lib/requestsproxy-rest/models/requestsproxy_dynamic_coupons_response.rb +185 -0
- data/lib/requestsproxy-rest/models/requestsproxy_dynamic_coupons_statistics_response.rb +183 -0
- data/lib/requestsproxy-rest/models/requestsproxy_dynamic_coupons_stats.rb +192 -0
- data/lib/requestsproxy-rest/models/requestsproxy_feature.rb +219 -0
- data/lib/requestsproxy-rest/models/requestsproxy_features_response.rb +185 -0
- data/lib/requestsproxy-rest/models/requestsproxy_image_data.rb +201 -0
- data/lib/requestsproxy-rest/models/requestsproxy_orders_response.rb +185 -0
- data/lib/requestsproxy-rest/models/requestsproxy_pagination.rb +201 -0
- data/lib/requestsproxy-rest/models/requestsproxy_product_image.rb +210 -0
- data/lib/requestsproxy-rest/models/requestsproxy_product_response.rb +286 -0
- data/lib/requestsproxy-rest/models/requestsproxy_product_specs.rb +192 -0
- data/lib/requestsproxy-rest/models/requestsproxy_product_star_rating_response.rb +201 -0
- data/lib/requestsproxy-rest/models/requestsproxy_products_response.rb +185 -0
- data/lib/requestsproxy-rest/models/requestsproxy_products_star_rating_response.rb +185 -0
- data/lib/requestsproxy-rest/models/requestsproxy_promoted_product.rb +201 -0
- data/lib/requestsproxy-rest/models/requestsproxy_promoted_products_response.rb +185 -0
- data/lib/requestsproxy-rest/models/requestsproxy_purchase.rb +255 -0
- data/lib/requestsproxy-rest/models/requestsproxy_response.rb +363 -0
- data/lib/requestsproxy-rest/models/requestsproxy_review.rb +331 -0
- data/lib/requestsproxy-rest/models/requestsproxy_review_custom_field.rb +210 -0
- data/lib/requestsproxy-rest/models/requestsproxy_review_response.rb +183 -0
- data/lib/requestsproxy-rest/models/requestsproxy_reviews_response.rb +185 -0
- data/lib/requestsproxy-rest/models/requestsproxy_status.rb +192 -0
- data/lib/requestsproxy-rest/models/requestsproxy_top_review.rb +228 -0
- data/lib/requestsproxy-rest/models/requestsproxy_top_reviews_response.rb +185 -0
- data/lib/requestsproxy-rest/models/requestsproxy_user_response.rb +210 -0
- data/lib/requestsproxy-rest/models/requestsproxy_webhook.rb +210 -0
- data/lib/requestsproxy-rest/models/requestsproxy_webhook_event.rb +192 -0
- data/lib/requestsproxy-rest/models/requestsproxy_webhook_events_response.rb +185 -0
- data/lib/requestsproxy-rest/models/requestsproxy_webhook_response.rb +183 -0
- data/lib/requestsproxy-rest/models/requestsproxy_webhooks_response.rb +185 -0
- data/lib/requestsproxy-rest/version.rb +15 -0
- data/requestsproxy-rest.gemspec +45 -0
- data/spec/api/requestsproxy_api_spec.rb +271 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/protobuf_list_value_spec.rb +41 -0
- data/spec/models/protobuf_null_value_spec.rb +35 -0
- data/spec/models/protobuf_struct_spec.rb +41 -0
- data/spec/models/protobuf_value_spec.rb +71 -0
- data/spec/models/requestsproxy_account_star_rating_response_spec.rb +47 -0
- data/spec/models/requestsproxy_auth_info_response_spec.rb +47 -0
- data/spec/models/requestsproxy_category_spec.rb +47 -0
- data/spec/models/requestsproxy_comment_spec.rb +59 -0
- data/spec/models/requestsproxy_coupon_spec.rb +41 -0
- data/spec/models/requestsproxy_create_dynamic_coupons_codes_response_spec.rb +47 -0
- data/spec/models/requestsproxy_create_webhook_params_spec.rb +47 -0
- data/spec/models/requestsproxy_dynamic_coupon_error_spec.rb +47 -0
- data/spec/models/requestsproxy_dynamic_coupons_response_spec.rb +41 -0
- data/spec/models/requestsproxy_dynamic_coupons_statistics_response_spec.rb +41 -0
- data/spec/models/requestsproxy_dynamic_coupons_stats_spec.rb +47 -0
- data/spec/models/requestsproxy_feature_spec.rb +65 -0
- data/spec/models/requestsproxy_features_response_spec.rb +41 -0
- data/spec/models/requestsproxy_image_data_spec.rb +53 -0
- data/spec/models/requestsproxy_orders_response_spec.rb +41 -0
- data/spec/models/requestsproxy_pagination_spec.rb +53 -0
- data/spec/models/requestsproxy_product_image_spec.rb +59 -0
- data/spec/models/requestsproxy_product_response_spec.rb +107 -0
- data/spec/models/requestsproxy_product_specs_spec.rb +47 -0
- data/spec/models/requestsproxy_product_star_rating_response_spec.rb +53 -0
- data/spec/models/requestsproxy_products_response_spec.rb +41 -0
- data/spec/models/requestsproxy_products_star_rating_response_spec.rb +41 -0
- data/spec/models/requestsproxy_promoted_product_spec.rb +53 -0
- data/spec/models/requestsproxy_promoted_products_response_spec.rb +41 -0
- data/spec/models/requestsproxy_purchase_spec.rb +89 -0
- data/spec/models/requestsproxy_response_spec.rb +161 -0
- data/spec/models/requestsproxy_review_custom_field_spec.rb +59 -0
- data/spec/models/requestsproxy_review_response_spec.rb +41 -0
- data/spec/models/requestsproxy_review_spec.rb +137 -0
- data/spec/models/requestsproxy_reviews_response_spec.rb +41 -0
- data/spec/models/requestsproxy_status_spec.rb +47 -0
- data/spec/models/requestsproxy_top_review_spec.rb +71 -0
- data/spec/models/requestsproxy_top_reviews_response_spec.rb +41 -0
- data/spec/models/requestsproxy_user_response_spec.rb +59 -0
- data/spec/models/requestsproxy_webhook_event_spec.rb +47 -0
- data/spec/models/requestsproxy_webhook_events_response_spec.rb +41 -0
- data/spec/models/requestsproxy_webhook_response_spec.rb +41 -0
- data/spec/models/requestsproxy_webhook_spec.rb +59 -0
- data/spec/models/requestsproxy_webhooks_response_spec.rb +41 -0
- data/spec/spec_helper.rb +111 -0
- metadata +416 -0
@@ -0,0 +1,255 @@
|
|
1
|
+
=begin
|
2
|
+
#requestsproxy.proto
|
3
|
+
|
4
|
+
#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
|
5
|
+
|
6
|
+
OpenAPI spec version: version not set
|
7
|
+
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
Swagger Codegen version: 2.4.0-SNAPSHOT
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module Requestsproxy
|
16
|
+
class RequestsproxyPurchase
|
17
|
+
attr_accessor :id
|
18
|
+
|
19
|
+
attr_accessor :user_email
|
20
|
+
|
21
|
+
attr_accessor :user_name
|
22
|
+
|
23
|
+
attr_accessor :order_id
|
24
|
+
|
25
|
+
attr_accessor :external_product_id
|
26
|
+
|
27
|
+
attr_accessor :product_url
|
28
|
+
|
29
|
+
attr_accessor :order_date
|
30
|
+
|
31
|
+
attr_accessor :product_description
|
32
|
+
|
33
|
+
attr_accessor :created_at
|
34
|
+
|
35
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
36
|
+
def self.attribute_map
|
37
|
+
{
|
38
|
+
:'id' => :'id',
|
39
|
+
:'user_email' => :'user_email',
|
40
|
+
:'user_name' => :'user_name',
|
41
|
+
:'order_id' => :'order_id',
|
42
|
+
:'external_product_id' => :'external_product_id',
|
43
|
+
:'product_url' => :'product_url',
|
44
|
+
:'order_date' => :'order_date',
|
45
|
+
:'product_description' => :'product_description',
|
46
|
+
:'created_at' => :'created_at'
|
47
|
+
}
|
48
|
+
end
|
49
|
+
|
50
|
+
# Attribute type mapping.
|
51
|
+
def self.swagger_types
|
52
|
+
{
|
53
|
+
:'id' => :'Integer',
|
54
|
+
:'user_email' => :'String',
|
55
|
+
:'user_name' => :'String',
|
56
|
+
:'order_id' => :'String',
|
57
|
+
:'external_product_id' => :'String',
|
58
|
+
:'product_url' => :'String',
|
59
|
+
:'order_date' => :'DateTime',
|
60
|
+
:'product_description' => :'String',
|
61
|
+
:'created_at' => :'DateTime'
|
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?(:'id')
|
74
|
+
self.id = attributes[:'id']
|
75
|
+
end
|
76
|
+
|
77
|
+
if attributes.has_key?(:'user_email')
|
78
|
+
self.user_email = attributes[:'user_email']
|
79
|
+
end
|
80
|
+
|
81
|
+
if attributes.has_key?(:'user_name')
|
82
|
+
self.user_name = attributes[:'user_name']
|
83
|
+
end
|
84
|
+
|
85
|
+
if attributes.has_key?(:'order_id')
|
86
|
+
self.order_id = attributes[:'order_id']
|
87
|
+
end
|
88
|
+
|
89
|
+
if attributes.has_key?(:'external_product_id')
|
90
|
+
self.external_product_id = attributes[:'external_product_id']
|
91
|
+
end
|
92
|
+
|
93
|
+
if attributes.has_key?(:'product_url')
|
94
|
+
self.product_url = attributes[:'product_url']
|
95
|
+
end
|
96
|
+
|
97
|
+
if attributes.has_key?(:'order_date')
|
98
|
+
self.order_date = attributes[:'order_date']
|
99
|
+
end
|
100
|
+
|
101
|
+
if attributes.has_key?(:'product_description')
|
102
|
+
self.product_description = attributes[:'product_description']
|
103
|
+
end
|
104
|
+
|
105
|
+
if attributes.has_key?(:'created_at')
|
106
|
+
self.created_at = attributes[:'created_at']
|
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
|
+
id == o.id &&
|
129
|
+
user_email == o.user_email &&
|
130
|
+
user_name == o.user_name &&
|
131
|
+
order_id == o.order_id &&
|
132
|
+
external_product_id == o.external_product_id &&
|
133
|
+
product_url == o.product_url &&
|
134
|
+
order_date == o.order_date &&
|
135
|
+
product_description == o.product_description &&
|
136
|
+
created_at == o.created_at
|
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
|
+
[id, user_email, user_name, order_id, external_product_id, product_url, order_date, product_description, created_at].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 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 = Requestsproxy.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
|
+
end
|
255
|
+
end
|
@@ -0,0 +1,363 @@
|
|
1
|
+
=begin
|
2
|
+
#requestsproxy.proto
|
3
|
+
|
4
|
+
#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
|
5
|
+
|
6
|
+
OpenAPI spec version: version not set
|
7
|
+
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
Swagger Codegen version: 2.4.0-SNAPSHOT
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module Requestsproxy
|
16
|
+
class RequestsproxyResponse
|
17
|
+
attr_accessor :status
|
18
|
+
|
19
|
+
attr_accessor :pagination
|
20
|
+
|
21
|
+
attr_accessor :reviews
|
22
|
+
|
23
|
+
attr_accessor :user
|
24
|
+
|
25
|
+
attr_accessor :features
|
26
|
+
|
27
|
+
attr_accessor :orders
|
28
|
+
|
29
|
+
attr_accessor :promoted_products
|
30
|
+
|
31
|
+
attr_accessor :dynamic_coupons
|
32
|
+
|
33
|
+
attr_accessor :dynamic_coupons_statistics
|
34
|
+
|
35
|
+
attr_accessor :create_dynamic_coupons
|
36
|
+
|
37
|
+
attr_accessor :webhook_events
|
38
|
+
|
39
|
+
attr_accessor :webhooks
|
40
|
+
|
41
|
+
attr_accessor :webhook
|
42
|
+
|
43
|
+
attr_accessor :account_star_rating
|
44
|
+
|
45
|
+
attr_accessor :product_star_rating
|
46
|
+
|
47
|
+
attr_accessor :top_reviews
|
48
|
+
|
49
|
+
attr_accessor :product
|
50
|
+
|
51
|
+
attr_accessor :products
|
52
|
+
|
53
|
+
attr_accessor :products_star_rating
|
54
|
+
|
55
|
+
attr_accessor :review
|
56
|
+
|
57
|
+
attr_accessor :auth_info
|
58
|
+
|
59
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
60
|
+
def self.attribute_map
|
61
|
+
{
|
62
|
+
:'status' => :'status',
|
63
|
+
:'pagination' => :'pagination',
|
64
|
+
:'reviews' => :'reviews',
|
65
|
+
:'user' => :'user',
|
66
|
+
:'features' => :'features',
|
67
|
+
:'orders' => :'orders',
|
68
|
+
:'promoted_products' => :'promoted_products',
|
69
|
+
:'dynamic_coupons' => :'dynamic_coupons',
|
70
|
+
:'dynamic_coupons_statistics' => :'dynamic_coupons_statistics',
|
71
|
+
:'create_dynamic_coupons' => :'create_dynamic_coupons',
|
72
|
+
:'webhook_events' => :'webhook_events',
|
73
|
+
:'webhooks' => :'webhooks',
|
74
|
+
:'webhook' => :'webhook',
|
75
|
+
:'account_star_rating' => :'account_star_rating',
|
76
|
+
:'product_star_rating' => :'product_star_rating',
|
77
|
+
:'top_reviews' => :'top_reviews',
|
78
|
+
:'product' => :'product',
|
79
|
+
:'products' => :'products',
|
80
|
+
:'products_star_rating' => :'products_star_rating',
|
81
|
+
:'review' => :'review',
|
82
|
+
:'auth_info' => :'auth_info'
|
83
|
+
}
|
84
|
+
end
|
85
|
+
|
86
|
+
# Attribute type mapping.
|
87
|
+
def self.swagger_types
|
88
|
+
{
|
89
|
+
:'status' => :'RequestsproxyStatus',
|
90
|
+
:'pagination' => :'RequestsproxyPagination',
|
91
|
+
:'reviews' => :'RequestsproxyReviewsResponse',
|
92
|
+
:'user' => :'RequestsproxyUserResponse',
|
93
|
+
:'features' => :'RequestsproxyFeaturesResponse',
|
94
|
+
:'orders' => :'RequestsproxyOrdersResponse',
|
95
|
+
:'promoted_products' => :'RequestsproxyPromotedProductsResponse',
|
96
|
+
:'dynamic_coupons' => :'RequestsproxyDynamicCouponsResponse',
|
97
|
+
:'dynamic_coupons_statistics' => :'RequestsproxyDynamicCouponsStatisticsResponse',
|
98
|
+
:'create_dynamic_coupons' => :'RequestsproxyCreateDynamicCouponsCodesResponse',
|
99
|
+
:'webhook_events' => :'RequestsproxyWebhookEventsResponse',
|
100
|
+
:'webhooks' => :'RequestsproxyWebhooksResponse',
|
101
|
+
:'webhook' => :'RequestsproxyWebhookResponse',
|
102
|
+
:'account_star_rating' => :'RequestsproxyAccountStarRatingResponse',
|
103
|
+
:'product_star_rating' => :'RequestsproxyProductStarRatingResponse',
|
104
|
+
:'top_reviews' => :'RequestsproxyTopReviewsResponse',
|
105
|
+
:'product' => :'RequestsproxyProductResponse',
|
106
|
+
:'products' => :'RequestsproxyProductsResponse',
|
107
|
+
:'products_star_rating' => :'RequestsproxyProductsStarRatingResponse',
|
108
|
+
:'review' => :'RequestsproxyReviewResponse',
|
109
|
+
:'auth_info' => :'RequestsproxyAuthInfoResponse'
|
110
|
+
}
|
111
|
+
end
|
112
|
+
|
113
|
+
# Initializes the object
|
114
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
115
|
+
def initialize(attributes = {})
|
116
|
+
return unless attributes.is_a?(Hash)
|
117
|
+
|
118
|
+
# convert string to symbol for hash key
|
119
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
120
|
+
|
121
|
+
if attributes.has_key?(:'status')
|
122
|
+
self.status = attributes[:'status']
|
123
|
+
end
|
124
|
+
|
125
|
+
if attributes.has_key?(:'pagination')
|
126
|
+
self.pagination = attributes[:'pagination']
|
127
|
+
end
|
128
|
+
|
129
|
+
if attributes.has_key?(:'reviews')
|
130
|
+
self.reviews = attributes[:'reviews']
|
131
|
+
end
|
132
|
+
|
133
|
+
if attributes.has_key?(:'user')
|
134
|
+
self.user = attributes[:'user']
|
135
|
+
end
|
136
|
+
|
137
|
+
if attributes.has_key?(:'features')
|
138
|
+
self.features = attributes[:'features']
|
139
|
+
end
|
140
|
+
|
141
|
+
if attributes.has_key?(:'orders')
|
142
|
+
self.orders = attributes[:'orders']
|
143
|
+
end
|
144
|
+
|
145
|
+
if attributes.has_key?(:'promoted_products')
|
146
|
+
self.promoted_products = attributes[:'promoted_products']
|
147
|
+
end
|
148
|
+
|
149
|
+
if attributes.has_key?(:'dynamic_coupons')
|
150
|
+
self.dynamic_coupons = attributes[:'dynamic_coupons']
|
151
|
+
end
|
152
|
+
|
153
|
+
if attributes.has_key?(:'dynamic_coupons_statistics')
|
154
|
+
self.dynamic_coupons_statistics = attributes[:'dynamic_coupons_statistics']
|
155
|
+
end
|
156
|
+
|
157
|
+
if attributes.has_key?(:'create_dynamic_coupons')
|
158
|
+
self.create_dynamic_coupons = attributes[:'create_dynamic_coupons']
|
159
|
+
end
|
160
|
+
|
161
|
+
if attributes.has_key?(:'webhook_events')
|
162
|
+
self.webhook_events = attributes[:'webhook_events']
|
163
|
+
end
|
164
|
+
|
165
|
+
if attributes.has_key?(:'webhooks')
|
166
|
+
self.webhooks = attributes[:'webhooks']
|
167
|
+
end
|
168
|
+
|
169
|
+
if attributes.has_key?(:'webhook')
|
170
|
+
self.webhook = attributes[:'webhook']
|
171
|
+
end
|
172
|
+
|
173
|
+
if attributes.has_key?(:'account_star_rating')
|
174
|
+
self.account_star_rating = attributes[:'account_star_rating']
|
175
|
+
end
|
176
|
+
|
177
|
+
if attributes.has_key?(:'product_star_rating')
|
178
|
+
self.product_star_rating = attributes[:'product_star_rating']
|
179
|
+
end
|
180
|
+
|
181
|
+
if attributes.has_key?(:'top_reviews')
|
182
|
+
self.top_reviews = attributes[:'top_reviews']
|
183
|
+
end
|
184
|
+
|
185
|
+
if attributes.has_key?(:'product')
|
186
|
+
self.product = attributes[:'product']
|
187
|
+
end
|
188
|
+
|
189
|
+
if attributes.has_key?(:'products')
|
190
|
+
self.products = attributes[:'products']
|
191
|
+
end
|
192
|
+
|
193
|
+
if attributes.has_key?(:'products_star_rating')
|
194
|
+
self.products_star_rating = attributes[:'products_star_rating']
|
195
|
+
end
|
196
|
+
|
197
|
+
if attributes.has_key?(:'review')
|
198
|
+
self.review = attributes[:'review']
|
199
|
+
end
|
200
|
+
|
201
|
+
if attributes.has_key?(:'auth_info')
|
202
|
+
self.auth_info = attributes[:'auth_info']
|
203
|
+
end
|
204
|
+
end
|
205
|
+
|
206
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
207
|
+
# @return Array for valid properties with the reasons
|
208
|
+
def list_invalid_properties
|
209
|
+
invalid_properties = Array.new
|
210
|
+
invalid_properties
|
211
|
+
end
|
212
|
+
|
213
|
+
# Check to see if the all the properties in the model are valid
|
214
|
+
# @return true if the model is valid
|
215
|
+
def valid?
|
216
|
+
true
|
217
|
+
end
|
218
|
+
|
219
|
+
# Checks equality by comparing each attribute.
|
220
|
+
# @param [Object] Object to be compared
|
221
|
+
def ==(o)
|
222
|
+
return true if self.equal?(o)
|
223
|
+
self.class == o.class &&
|
224
|
+
status == o.status &&
|
225
|
+
pagination == o.pagination &&
|
226
|
+
reviews == o.reviews &&
|
227
|
+
user == o.user &&
|
228
|
+
features == o.features &&
|
229
|
+
orders == o.orders &&
|
230
|
+
promoted_products == o.promoted_products &&
|
231
|
+
dynamic_coupons == o.dynamic_coupons &&
|
232
|
+
dynamic_coupons_statistics == o.dynamic_coupons_statistics &&
|
233
|
+
create_dynamic_coupons == o.create_dynamic_coupons &&
|
234
|
+
webhook_events == o.webhook_events &&
|
235
|
+
webhooks == o.webhooks &&
|
236
|
+
webhook == o.webhook &&
|
237
|
+
account_star_rating == o.account_star_rating &&
|
238
|
+
product_star_rating == o.product_star_rating &&
|
239
|
+
top_reviews == o.top_reviews &&
|
240
|
+
product == o.product &&
|
241
|
+
products == o.products &&
|
242
|
+
products_star_rating == o.products_star_rating &&
|
243
|
+
review == o.review &&
|
244
|
+
auth_info == o.auth_info
|
245
|
+
end
|
246
|
+
|
247
|
+
# @see the `==` method
|
248
|
+
# @param [Object] Object to be compared
|
249
|
+
def eql?(o)
|
250
|
+
self == o
|
251
|
+
end
|
252
|
+
|
253
|
+
# Calculates hash code according to all attributes.
|
254
|
+
# @return [Fixnum] Hash code
|
255
|
+
def hash
|
256
|
+
[status, pagination, reviews, user, features, orders, promoted_products, dynamic_coupons, dynamic_coupons_statistics, create_dynamic_coupons, webhook_events, webhooks, webhook, account_star_rating, product_star_rating, top_reviews, product, products, products_star_rating, review, auth_info].hash
|
257
|
+
end
|
258
|
+
|
259
|
+
# Builds the object from hash
|
260
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
261
|
+
# @return [Object] Returns the model itself
|
262
|
+
def build_from_hash(attributes)
|
263
|
+
return nil unless attributes.is_a?(Hash)
|
264
|
+
self.class.swagger_types.each_pair do |key, type|
|
265
|
+
if type =~ /\AArray<(.*)>/i
|
266
|
+
# check to ensure the input is an array given that the the attribute
|
267
|
+
# is documented as an array but the input is not
|
268
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
269
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
270
|
+
end
|
271
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
272
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
273
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
274
|
+
end
|
275
|
+
|
276
|
+
self
|
277
|
+
end
|
278
|
+
|
279
|
+
# Deserializes the data based on type
|
280
|
+
# @param string type Data type
|
281
|
+
# @param string value Value to be deserialized
|
282
|
+
# @return [Object] Deserialized data
|
283
|
+
def _deserialize(type, value)
|
284
|
+
case type.to_sym
|
285
|
+
when :DateTime
|
286
|
+
DateTime.parse(value)
|
287
|
+
when :Date
|
288
|
+
Date.parse(value)
|
289
|
+
when :String
|
290
|
+
value.to_s
|
291
|
+
when :Integer
|
292
|
+
value.to_i
|
293
|
+
when :Float
|
294
|
+
value.to_f
|
295
|
+
when :BOOLEAN
|
296
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
297
|
+
true
|
298
|
+
else
|
299
|
+
false
|
300
|
+
end
|
301
|
+
when :Object
|
302
|
+
# generic object (usually a Hash), return directly
|
303
|
+
value
|
304
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
305
|
+
inner_type = Regexp.last_match[:inner_type]
|
306
|
+
value.map { |v| _deserialize(inner_type, v) }
|
307
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
308
|
+
k_type = Regexp.last_match[:k_type]
|
309
|
+
v_type = Regexp.last_match[:v_type]
|
310
|
+
{}.tap do |hash|
|
311
|
+
value.each do |k, v|
|
312
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
313
|
+
end
|
314
|
+
end
|
315
|
+
else # model
|
316
|
+
temp_model = Requestsproxy.const_get(type).new
|
317
|
+
temp_model.build_from_hash(value)
|
318
|
+
end
|
319
|
+
end
|
320
|
+
|
321
|
+
# Returns the string representation of the object
|
322
|
+
# @return [String] String presentation of the object
|
323
|
+
def to_s
|
324
|
+
to_hash.to_s
|
325
|
+
end
|
326
|
+
|
327
|
+
# to_body is an alias to to_hash (backward compatibility)
|
328
|
+
# @return [Hash] Returns the object in the form of hash
|
329
|
+
def to_body
|
330
|
+
to_hash
|
331
|
+
end
|
332
|
+
|
333
|
+
# Returns the object in the form of hash
|
334
|
+
# @return [Hash] Returns the object in the form of hash
|
335
|
+
def to_hash
|
336
|
+
hash = {}
|
337
|
+
self.class.attribute_map.each_pair do |attr, param|
|
338
|
+
value = self.send(attr)
|
339
|
+
next if value.nil?
|
340
|
+
hash[param] = _to_hash(value)
|
341
|
+
end
|
342
|
+
hash
|
343
|
+
end
|
344
|
+
|
345
|
+
# Outputs non-array value in the form of hash
|
346
|
+
# For object, use to_hash. Otherwise, just return the value
|
347
|
+
# @param [Object] value Any valid value
|
348
|
+
# @return [Hash] Returns the value in the form of hash
|
349
|
+
def _to_hash(value)
|
350
|
+
if value.is_a?(Array)
|
351
|
+
value.compact.map { |v| _to_hash(v) }
|
352
|
+
elsif value.is_a?(Hash)
|
353
|
+
{}.tap do |hash|
|
354
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
355
|
+
end
|
356
|
+
elsif value.respond_to? :to_hash
|
357
|
+
value.to_hash
|
358
|
+
else
|
359
|
+
value
|
360
|
+
end
|
361
|
+
end
|
362
|
+
end
|
363
|
+
end
|