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,185 @@
|
|
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 RequestsproxyFeaturesResponse
|
17
|
+
attr_accessor :features
|
18
|
+
|
19
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
20
|
+
def self.attribute_map
|
21
|
+
{
|
22
|
+
:'features' => :'features'
|
23
|
+
}
|
24
|
+
end
|
25
|
+
|
26
|
+
# Attribute type mapping.
|
27
|
+
def self.swagger_types
|
28
|
+
{
|
29
|
+
:'features' => :'Array<RequestsproxyFeature>'
|
30
|
+
}
|
31
|
+
end
|
32
|
+
|
33
|
+
# Initializes the object
|
34
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
35
|
+
def initialize(attributes = {})
|
36
|
+
return unless attributes.is_a?(Hash)
|
37
|
+
|
38
|
+
# convert string to symbol for hash key
|
39
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
40
|
+
|
41
|
+
if attributes.has_key?(:'features')
|
42
|
+
if (value = attributes[:'features']).is_a?(Array)
|
43
|
+
self.features = value
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
49
|
+
# @return Array for valid properties with the reasons
|
50
|
+
def list_invalid_properties
|
51
|
+
invalid_properties = Array.new
|
52
|
+
invalid_properties
|
53
|
+
end
|
54
|
+
|
55
|
+
# Check to see if the all the properties in the model are valid
|
56
|
+
# @return true if the model is valid
|
57
|
+
def valid?
|
58
|
+
true
|
59
|
+
end
|
60
|
+
|
61
|
+
# Checks equality by comparing each attribute.
|
62
|
+
# @param [Object] Object to be compared
|
63
|
+
def ==(o)
|
64
|
+
return true if self.equal?(o)
|
65
|
+
self.class == o.class &&
|
66
|
+
features == o.features
|
67
|
+
end
|
68
|
+
|
69
|
+
# @see the `==` method
|
70
|
+
# @param [Object] Object to be compared
|
71
|
+
def eql?(o)
|
72
|
+
self == o
|
73
|
+
end
|
74
|
+
|
75
|
+
# Calculates hash code according to all attributes.
|
76
|
+
# @return [Fixnum] Hash code
|
77
|
+
def hash
|
78
|
+
[features].hash
|
79
|
+
end
|
80
|
+
|
81
|
+
# Builds the object from hash
|
82
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
83
|
+
# @return [Object] Returns the model itself
|
84
|
+
def build_from_hash(attributes)
|
85
|
+
return nil unless attributes.is_a?(Hash)
|
86
|
+
self.class.swagger_types.each_pair do |key, type|
|
87
|
+
if type =~ /\AArray<(.*)>/i
|
88
|
+
# check to ensure the input is an array given that the the attribute
|
89
|
+
# is documented as an array but the input is not
|
90
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
91
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
92
|
+
end
|
93
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
94
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
95
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
96
|
+
end
|
97
|
+
|
98
|
+
self
|
99
|
+
end
|
100
|
+
|
101
|
+
# Deserializes the data based on type
|
102
|
+
# @param string type Data type
|
103
|
+
# @param string value Value to be deserialized
|
104
|
+
# @return [Object] Deserialized data
|
105
|
+
def _deserialize(type, value)
|
106
|
+
case type.to_sym
|
107
|
+
when :DateTime
|
108
|
+
DateTime.parse(value)
|
109
|
+
when :Date
|
110
|
+
Date.parse(value)
|
111
|
+
when :String
|
112
|
+
value.to_s
|
113
|
+
when :Integer
|
114
|
+
value.to_i
|
115
|
+
when :Float
|
116
|
+
value.to_f
|
117
|
+
when :BOOLEAN
|
118
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
119
|
+
true
|
120
|
+
else
|
121
|
+
false
|
122
|
+
end
|
123
|
+
when :Object
|
124
|
+
# generic object (usually a Hash), return directly
|
125
|
+
value
|
126
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
127
|
+
inner_type = Regexp.last_match[:inner_type]
|
128
|
+
value.map { |v| _deserialize(inner_type, v) }
|
129
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
130
|
+
k_type = Regexp.last_match[:k_type]
|
131
|
+
v_type = Regexp.last_match[:v_type]
|
132
|
+
{}.tap do |hash|
|
133
|
+
value.each do |k, v|
|
134
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
135
|
+
end
|
136
|
+
end
|
137
|
+
else # model
|
138
|
+
temp_model = Requestsproxy.const_get(type).new
|
139
|
+
temp_model.build_from_hash(value)
|
140
|
+
end
|
141
|
+
end
|
142
|
+
|
143
|
+
# Returns the string representation of the object
|
144
|
+
# @return [String] String presentation of the object
|
145
|
+
def to_s
|
146
|
+
to_hash.to_s
|
147
|
+
end
|
148
|
+
|
149
|
+
# to_body is an alias to to_hash (backward compatibility)
|
150
|
+
# @return [Hash] Returns the object in the form of hash
|
151
|
+
def to_body
|
152
|
+
to_hash
|
153
|
+
end
|
154
|
+
|
155
|
+
# Returns the object in the form of hash
|
156
|
+
# @return [Hash] Returns the object in the form of hash
|
157
|
+
def to_hash
|
158
|
+
hash = {}
|
159
|
+
self.class.attribute_map.each_pair do |attr, param|
|
160
|
+
value = self.send(attr)
|
161
|
+
next if value.nil?
|
162
|
+
hash[param] = _to_hash(value)
|
163
|
+
end
|
164
|
+
hash
|
165
|
+
end
|
166
|
+
|
167
|
+
# Outputs non-array value in the form of hash
|
168
|
+
# For object, use to_hash. Otherwise, just return the value
|
169
|
+
# @param [Object] value Any valid value
|
170
|
+
# @return [Hash] Returns the value in the form of hash
|
171
|
+
def _to_hash(value)
|
172
|
+
if value.is_a?(Array)
|
173
|
+
value.compact.map { |v| _to_hash(v) }
|
174
|
+
elsif value.is_a?(Hash)
|
175
|
+
{}.tap do |hash|
|
176
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
177
|
+
end
|
178
|
+
elsif value.respond_to? :to_hash
|
179
|
+
value.to_hash
|
180
|
+
else
|
181
|
+
value
|
182
|
+
end
|
183
|
+
end
|
184
|
+
end
|
185
|
+
end
|
@@ -0,0 +1,201 @@
|
|
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 RequestsproxyImageData
|
17
|
+
attr_accessor :id
|
18
|
+
|
19
|
+
attr_accessor :thumb_url
|
20
|
+
|
21
|
+
attr_accessor :original_url
|
22
|
+
|
23
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
24
|
+
def self.attribute_map
|
25
|
+
{
|
26
|
+
:'id' => :'id',
|
27
|
+
:'thumb_url' => :'thumb_url',
|
28
|
+
:'original_url' => :'original_url'
|
29
|
+
}
|
30
|
+
end
|
31
|
+
|
32
|
+
# Attribute type mapping.
|
33
|
+
def self.swagger_types
|
34
|
+
{
|
35
|
+
:'id' => :'Integer',
|
36
|
+
:'thumb_url' => :'String',
|
37
|
+
:'original_url' => :'String'
|
38
|
+
}
|
39
|
+
end
|
40
|
+
|
41
|
+
# Initializes the object
|
42
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
43
|
+
def initialize(attributes = {})
|
44
|
+
return unless attributes.is_a?(Hash)
|
45
|
+
|
46
|
+
# convert string to symbol for hash key
|
47
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
48
|
+
|
49
|
+
if attributes.has_key?(:'id')
|
50
|
+
self.id = attributes[:'id']
|
51
|
+
end
|
52
|
+
|
53
|
+
if attributes.has_key?(:'thumb_url')
|
54
|
+
self.thumb_url = attributes[:'thumb_url']
|
55
|
+
end
|
56
|
+
|
57
|
+
if attributes.has_key?(:'original_url')
|
58
|
+
self.original_url = attributes[:'original_url']
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
63
|
+
# @return Array for valid properties with the reasons
|
64
|
+
def list_invalid_properties
|
65
|
+
invalid_properties = Array.new
|
66
|
+
invalid_properties
|
67
|
+
end
|
68
|
+
|
69
|
+
# Check to see if the all the properties in the model are valid
|
70
|
+
# @return true if the model is valid
|
71
|
+
def valid?
|
72
|
+
true
|
73
|
+
end
|
74
|
+
|
75
|
+
# Checks equality by comparing each attribute.
|
76
|
+
# @param [Object] Object to be compared
|
77
|
+
def ==(o)
|
78
|
+
return true if self.equal?(o)
|
79
|
+
self.class == o.class &&
|
80
|
+
id == o.id &&
|
81
|
+
thumb_url == o.thumb_url &&
|
82
|
+
original_url == o.original_url
|
83
|
+
end
|
84
|
+
|
85
|
+
# @see the `==` method
|
86
|
+
# @param [Object] Object to be compared
|
87
|
+
def eql?(o)
|
88
|
+
self == o
|
89
|
+
end
|
90
|
+
|
91
|
+
# Calculates hash code according to all attributes.
|
92
|
+
# @return [Fixnum] Hash code
|
93
|
+
def hash
|
94
|
+
[id, thumb_url, original_url].hash
|
95
|
+
end
|
96
|
+
|
97
|
+
# Builds the object from hash
|
98
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
99
|
+
# @return [Object] Returns the model itself
|
100
|
+
def build_from_hash(attributes)
|
101
|
+
return nil unless attributes.is_a?(Hash)
|
102
|
+
self.class.swagger_types.each_pair do |key, type|
|
103
|
+
if type =~ /\AArray<(.*)>/i
|
104
|
+
# check to ensure the input is an array given that the the attribute
|
105
|
+
# is documented as an array but the input is not
|
106
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
107
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
108
|
+
end
|
109
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
110
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
111
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
112
|
+
end
|
113
|
+
|
114
|
+
self
|
115
|
+
end
|
116
|
+
|
117
|
+
# Deserializes the data based on type
|
118
|
+
# @param string type Data type
|
119
|
+
# @param string value Value to be deserialized
|
120
|
+
# @return [Object] Deserialized data
|
121
|
+
def _deserialize(type, value)
|
122
|
+
case type.to_sym
|
123
|
+
when :DateTime
|
124
|
+
DateTime.parse(value)
|
125
|
+
when :Date
|
126
|
+
Date.parse(value)
|
127
|
+
when :String
|
128
|
+
value.to_s
|
129
|
+
when :Integer
|
130
|
+
value.to_i
|
131
|
+
when :Float
|
132
|
+
value.to_f
|
133
|
+
when :BOOLEAN
|
134
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
135
|
+
true
|
136
|
+
else
|
137
|
+
false
|
138
|
+
end
|
139
|
+
when :Object
|
140
|
+
# generic object (usually a Hash), return directly
|
141
|
+
value
|
142
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
143
|
+
inner_type = Regexp.last_match[:inner_type]
|
144
|
+
value.map { |v| _deserialize(inner_type, v) }
|
145
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
146
|
+
k_type = Regexp.last_match[:k_type]
|
147
|
+
v_type = Regexp.last_match[:v_type]
|
148
|
+
{}.tap do |hash|
|
149
|
+
value.each do |k, v|
|
150
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
151
|
+
end
|
152
|
+
end
|
153
|
+
else # model
|
154
|
+
temp_model = Requestsproxy.const_get(type).new
|
155
|
+
temp_model.build_from_hash(value)
|
156
|
+
end
|
157
|
+
end
|
158
|
+
|
159
|
+
# Returns the string representation of the object
|
160
|
+
# @return [String] String presentation of the object
|
161
|
+
def to_s
|
162
|
+
to_hash.to_s
|
163
|
+
end
|
164
|
+
|
165
|
+
# to_body is an alias to to_hash (backward compatibility)
|
166
|
+
# @return [Hash] Returns the object in the form of hash
|
167
|
+
def to_body
|
168
|
+
to_hash
|
169
|
+
end
|
170
|
+
|
171
|
+
# Returns the object in the form of hash
|
172
|
+
# @return [Hash] Returns the object in the form of hash
|
173
|
+
def to_hash
|
174
|
+
hash = {}
|
175
|
+
self.class.attribute_map.each_pair do |attr, param|
|
176
|
+
value = self.send(attr)
|
177
|
+
next if value.nil?
|
178
|
+
hash[param] = _to_hash(value)
|
179
|
+
end
|
180
|
+
hash
|
181
|
+
end
|
182
|
+
|
183
|
+
# Outputs non-array value in the form of hash
|
184
|
+
# For object, use to_hash. Otherwise, just return the value
|
185
|
+
# @param [Object] value Any valid value
|
186
|
+
# @return [Hash] Returns the value in the form of hash
|
187
|
+
def _to_hash(value)
|
188
|
+
if value.is_a?(Array)
|
189
|
+
value.compact.map { |v| _to_hash(v) }
|
190
|
+
elsif value.is_a?(Hash)
|
191
|
+
{}.tap do |hash|
|
192
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
193
|
+
end
|
194
|
+
elsif value.respond_to? :to_hash
|
195
|
+
value.to_hash
|
196
|
+
else
|
197
|
+
value
|
198
|
+
end
|
199
|
+
end
|
200
|
+
end
|
201
|
+
end
|
@@ -0,0 +1,185 @@
|
|
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 RequestsproxyOrdersResponse
|
17
|
+
attr_accessor :purchases
|
18
|
+
|
19
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
20
|
+
def self.attribute_map
|
21
|
+
{
|
22
|
+
:'purchases' => :'purchases'
|
23
|
+
}
|
24
|
+
end
|
25
|
+
|
26
|
+
# Attribute type mapping.
|
27
|
+
def self.swagger_types
|
28
|
+
{
|
29
|
+
:'purchases' => :'Array<RequestsproxyPurchase>'
|
30
|
+
}
|
31
|
+
end
|
32
|
+
|
33
|
+
# Initializes the object
|
34
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
35
|
+
def initialize(attributes = {})
|
36
|
+
return unless attributes.is_a?(Hash)
|
37
|
+
|
38
|
+
# convert string to symbol for hash key
|
39
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
40
|
+
|
41
|
+
if attributes.has_key?(:'purchases')
|
42
|
+
if (value = attributes[:'purchases']).is_a?(Array)
|
43
|
+
self.purchases = value
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
49
|
+
# @return Array for valid properties with the reasons
|
50
|
+
def list_invalid_properties
|
51
|
+
invalid_properties = Array.new
|
52
|
+
invalid_properties
|
53
|
+
end
|
54
|
+
|
55
|
+
# Check to see if the all the properties in the model are valid
|
56
|
+
# @return true if the model is valid
|
57
|
+
def valid?
|
58
|
+
true
|
59
|
+
end
|
60
|
+
|
61
|
+
# Checks equality by comparing each attribute.
|
62
|
+
# @param [Object] Object to be compared
|
63
|
+
def ==(o)
|
64
|
+
return true if self.equal?(o)
|
65
|
+
self.class == o.class &&
|
66
|
+
purchases == o.purchases
|
67
|
+
end
|
68
|
+
|
69
|
+
# @see the `==` method
|
70
|
+
# @param [Object] Object to be compared
|
71
|
+
def eql?(o)
|
72
|
+
self == o
|
73
|
+
end
|
74
|
+
|
75
|
+
# Calculates hash code according to all attributes.
|
76
|
+
# @return [Fixnum] Hash code
|
77
|
+
def hash
|
78
|
+
[purchases].hash
|
79
|
+
end
|
80
|
+
|
81
|
+
# Builds the object from hash
|
82
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
83
|
+
# @return [Object] Returns the model itself
|
84
|
+
def build_from_hash(attributes)
|
85
|
+
return nil unless attributes.is_a?(Hash)
|
86
|
+
self.class.swagger_types.each_pair do |key, type|
|
87
|
+
if type =~ /\AArray<(.*)>/i
|
88
|
+
# check to ensure the input is an array given that the the attribute
|
89
|
+
# is documented as an array but the input is not
|
90
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
91
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
92
|
+
end
|
93
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
94
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
95
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
96
|
+
end
|
97
|
+
|
98
|
+
self
|
99
|
+
end
|
100
|
+
|
101
|
+
# Deserializes the data based on type
|
102
|
+
# @param string type Data type
|
103
|
+
# @param string value Value to be deserialized
|
104
|
+
# @return [Object] Deserialized data
|
105
|
+
def _deserialize(type, value)
|
106
|
+
case type.to_sym
|
107
|
+
when :DateTime
|
108
|
+
DateTime.parse(value)
|
109
|
+
when :Date
|
110
|
+
Date.parse(value)
|
111
|
+
when :String
|
112
|
+
value.to_s
|
113
|
+
when :Integer
|
114
|
+
value.to_i
|
115
|
+
when :Float
|
116
|
+
value.to_f
|
117
|
+
when :BOOLEAN
|
118
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
119
|
+
true
|
120
|
+
else
|
121
|
+
false
|
122
|
+
end
|
123
|
+
when :Object
|
124
|
+
# generic object (usually a Hash), return directly
|
125
|
+
value
|
126
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
127
|
+
inner_type = Regexp.last_match[:inner_type]
|
128
|
+
value.map { |v| _deserialize(inner_type, v) }
|
129
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
130
|
+
k_type = Regexp.last_match[:k_type]
|
131
|
+
v_type = Regexp.last_match[:v_type]
|
132
|
+
{}.tap do |hash|
|
133
|
+
value.each do |k, v|
|
134
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
135
|
+
end
|
136
|
+
end
|
137
|
+
else # model
|
138
|
+
temp_model = Requestsproxy.const_get(type).new
|
139
|
+
temp_model.build_from_hash(value)
|
140
|
+
end
|
141
|
+
end
|
142
|
+
|
143
|
+
# Returns the string representation of the object
|
144
|
+
# @return [String] String presentation of the object
|
145
|
+
def to_s
|
146
|
+
to_hash.to_s
|
147
|
+
end
|
148
|
+
|
149
|
+
# to_body is an alias to to_hash (backward compatibility)
|
150
|
+
# @return [Hash] Returns the object in the form of hash
|
151
|
+
def to_body
|
152
|
+
to_hash
|
153
|
+
end
|
154
|
+
|
155
|
+
# Returns the object in the form of hash
|
156
|
+
# @return [Hash] Returns the object in the form of hash
|
157
|
+
def to_hash
|
158
|
+
hash = {}
|
159
|
+
self.class.attribute_map.each_pair do |attr, param|
|
160
|
+
value = self.send(attr)
|
161
|
+
next if value.nil?
|
162
|
+
hash[param] = _to_hash(value)
|
163
|
+
end
|
164
|
+
hash
|
165
|
+
end
|
166
|
+
|
167
|
+
# Outputs non-array value in the form of hash
|
168
|
+
# For object, use to_hash. Otherwise, just return the value
|
169
|
+
# @param [Object] value Any valid value
|
170
|
+
# @return [Hash] Returns the value in the form of hash
|
171
|
+
def _to_hash(value)
|
172
|
+
if value.is_a?(Array)
|
173
|
+
value.compact.map { |v| _to_hash(v) }
|
174
|
+
elsif value.is_a?(Hash)
|
175
|
+
{}.tap do |hash|
|
176
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
177
|
+
end
|
178
|
+
elsif value.respond_to? :to_hash
|
179
|
+
value.to_hash
|
180
|
+
else
|
181
|
+
value
|
182
|
+
end
|
183
|
+
end
|
184
|
+
end
|
185
|
+
end
|