requestsproxy-rest 0.0.1
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 +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,187 @@
|
|
|
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
|
+
# `ListValue` is a wrapper around a repeated field of values. The JSON representation for `ListValue` is JSON array.
|
|
17
|
+
class ProtobufListValue
|
|
18
|
+
# Repeated field of dynamically typed values.
|
|
19
|
+
attr_accessor :values
|
|
20
|
+
|
|
21
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
22
|
+
def self.attribute_map
|
|
23
|
+
{
|
|
24
|
+
:'values' => :'values'
|
|
25
|
+
}
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# Attribute type mapping.
|
|
29
|
+
def self.swagger_types
|
|
30
|
+
{
|
|
31
|
+
:'values' => :'Array<ProtobufValue>'
|
|
32
|
+
}
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# Initializes the object
|
|
36
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
37
|
+
def initialize(attributes = {})
|
|
38
|
+
return unless attributes.is_a?(Hash)
|
|
39
|
+
|
|
40
|
+
# convert string to symbol for hash key
|
|
41
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
|
42
|
+
|
|
43
|
+
if attributes.has_key?(:'values')
|
|
44
|
+
if (value = attributes[:'values']).is_a?(Array)
|
|
45
|
+
self.values = value
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
51
|
+
# @return Array for valid properties with the reasons
|
|
52
|
+
def list_invalid_properties
|
|
53
|
+
invalid_properties = Array.new
|
|
54
|
+
invalid_properties
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# Check to see if the all the properties in the model are valid
|
|
58
|
+
# @return true if the model is valid
|
|
59
|
+
def valid?
|
|
60
|
+
true
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
# Checks equality by comparing each attribute.
|
|
64
|
+
# @param [Object] Object to be compared
|
|
65
|
+
def ==(o)
|
|
66
|
+
return true if self.equal?(o)
|
|
67
|
+
self.class == o.class &&
|
|
68
|
+
values == o.values
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# @see the `==` method
|
|
72
|
+
# @param [Object] Object to be compared
|
|
73
|
+
def eql?(o)
|
|
74
|
+
self == o
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
# Calculates hash code according to all attributes.
|
|
78
|
+
# @return [Fixnum] Hash code
|
|
79
|
+
def hash
|
|
80
|
+
[values].hash
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# Builds the object from hash
|
|
84
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
85
|
+
# @return [Object] Returns the model itself
|
|
86
|
+
def build_from_hash(attributes)
|
|
87
|
+
return nil unless attributes.is_a?(Hash)
|
|
88
|
+
self.class.swagger_types.each_pair do |key, type|
|
|
89
|
+
if type =~ /\AArray<(.*)>/i
|
|
90
|
+
# check to ensure the input is an array given that the the attribute
|
|
91
|
+
# is documented as an array but the input is not
|
|
92
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
93
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
94
|
+
end
|
|
95
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
96
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
97
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
self
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
# Deserializes the data based on type
|
|
104
|
+
# @param string type Data type
|
|
105
|
+
# @param string value Value to be deserialized
|
|
106
|
+
# @return [Object] Deserialized data
|
|
107
|
+
def _deserialize(type, value)
|
|
108
|
+
case type.to_sym
|
|
109
|
+
when :DateTime
|
|
110
|
+
DateTime.parse(value)
|
|
111
|
+
when :Date
|
|
112
|
+
Date.parse(value)
|
|
113
|
+
when :String
|
|
114
|
+
value.to_s
|
|
115
|
+
when :Integer
|
|
116
|
+
value.to_i
|
|
117
|
+
when :Float
|
|
118
|
+
value.to_f
|
|
119
|
+
when :BOOLEAN
|
|
120
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
121
|
+
true
|
|
122
|
+
else
|
|
123
|
+
false
|
|
124
|
+
end
|
|
125
|
+
when :Object
|
|
126
|
+
# generic object (usually a Hash), return directly
|
|
127
|
+
value
|
|
128
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
129
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
130
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
131
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
132
|
+
k_type = Regexp.last_match[:k_type]
|
|
133
|
+
v_type = Regexp.last_match[:v_type]
|
|
134
|
+
{}.tap do |hash|
|
|
135
|
+
value.each do |k, v|
|
|
136
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
137
|
+
end
|
|
138
|
+
end
|
|
139
|
+
else # model
|
|
140
|
+
temp_model = Requestsproxy.const_get(type).new
|
|
141
|
+
temp_model.build_from_hash(value)
|
|
142
|
+
end
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
# Returns the string representation of the object
|
|
146
|
+
# @return [String] String presentation of the object
|
|
147
|
+
def to_s
|
|
148
|
+
to_hash.to_s
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
152
|
+
# @return [Hash] Returns the object in the form of hash
|
|
153
|
+
def to_body
|
|
154
|
+
to_hash
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
# Returns the object in the form of hash
|
|
158
|
+
# @return [Hash] Returns the object in the form of hash
|
|
159
|
+
def to_hash
|
|
160
|
+
hash = {}
|
|
161
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
162
|
+
value = self.send(attr)
|
|
163
|
+
next if value.nil?
|
|
164
|
+
hash[param] = _to_hash(value)
|
|
165
|
+
end
|
|
166
|
+
hash
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
# Outputs non-array value in the form of hash
|
|
170
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
171
|
+
# @param [Object] value Any valid value
|
|
172
|
+
# @return [Hash] Returns the value in the form of hash
|
|
173
|
+
def _to_hash(value)
|
|
174
|
+
if value.is_a?(Array)
|
|
175
|
+
value.compact.map { |v| _to_hash(v) }
|
|
176
|
+
elsif value.is_a?(Hash)
|
|
177
|
+
{}.tap do |hash|
|
|
178
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
179
|
+
end
|
|
180
|
+
elsif value.respond_to? :to_hash
|
|
181
|
+
value.to_hash
|
|
182
|
+
else
|
|
183
|
+
value
|
|
184
|
+
end
|
|
185
|
+
end
|
|
186
|
+
end
|
|
187
|
+
end
|
|
@@ -0,0 +1,29 @@
|
|
|
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 ProtobufNullValue
|
|
17
|
+
|
|
18
|
+
NULL_VALUE = 'NULL_VALUE'.freeze
|
|
19
|
+
|
|
20
|
+
# Builds the enum from string
|
|
21
|
+
# @param [String] The enum value in the form of the string
|
|
22
|
+
# @return [String] The enum value
|
|
23
|
+
def build_from_hash(value)
|
|
24
|
+
constantValues = ProtobufNullValue.constants.select { |c| ProtobufNullValue::const_get(c) == value }
|
|
25
|
+
raise "Invalid ENUM value #{value} for class #ProtobufNullValue" if constantValues.empty?
|
|
26
|
+
value
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
@@ -0,0 +1,187 @@
|
|
|
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
|
+
# `Struct` represents a structured data value, consisting of fields which map to dynamically typed values. In some languages, `Struct` might be supported by a native representation. For example, in scripting languages like JS a struct is represented as an object. The details of that representation are described together with the proto support for the language. The JSON representation for `Struct` is JSON object.
|
|
17
|
+
class ProtobufStruct
|
|
18
|
+
# Unordered map of dynamically typed values.
|
|
19
|
+
attr_accessor :fields
|
|
20
|
+
|
|
21
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
22
|
+
def self.attribute_map
|
|
23
|
+
{
|
|
24
|
+
:'fields' => :'fields'
|
|
25
|
+
}
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# Attribute type mapping.
|
|
29
|
+
def self.swagger_types
|
|
30
|
+
{
|
|
31
|
+
:'fields' => :'Hash<String, ProtobufValue>'
|
|
32
|
+
}
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# Initializes the object
|
|
36
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
37
|
+
def initialize(attributes = {})
|
|
38
|
+
return unless attributes.is_a?(Hash)
|
|
39
|
+
|
|
40
|
+
# convert string to symbol for hash key
|
|
41
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
|
42
|
+
|
|
43
|
+
if attributes.has_key?(:'fields')
|
|
44
|
+
if (value = attributes[:'fields']).is_a?(Hash)
|
|
45
|
+
self.fields = value
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
51
|
+
# @return Array for valid properties with the reasons
|
|
52
|
+
def list_invalid_properties
|
|
53
|
+
invalid_properties = Array.new
|
|
54
|
+
invalid_properties
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# Check to see if the all the properties in the model are valid
|
|
58
|
+
# @return true if the model is valid
|
|
59
|
+
def valid?
|
|
60
|
+
true
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
# Checks equality by comparing each attribute.
|
|
64
|
+
# @param [Object] Object to be compared
|
|
65
|
+
def ==(o)
|
|
66
|
+
return true if self.equal?(o)
|
|
67
|
+
self.class == o.class &&
|
|
68
|
+
fields == o.fields
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# @see the `==` method
|
|
72
|
+
# @param [Object] Object to be compared
|
|
73
|
+
def eql?(o)
|
|
74
|
+
self == o
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
# Calculates hash code according to all attributes.
|
|
78
|
+
# @return [Fixnum] Hash code
|
|
79
|
+
def hash
|
|
80
|
+
[fields].hash
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# Builds the object from hash
|
|
84
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
85
|
+
# @return [Object] Returns the model itself
|
|
86
|
+
def build_from_hash(attributes)
|
|
87
|
+
return nil unless attributes.is_a?(Hash)
|
|
88
|
+
self.class.swagger_types.each_pair do |key, type|
|
|
89
|
+
if type =~ /\AArray<(.*)>/i
|
|
90
|
+
# check to ensure the input is an array given that the the attribute
|
|
91
|
+
# is documented as an array but the input is not
|
|
92
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
93
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
94
|
+
end
|
|
95
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
96
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
97
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
self
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
# Deserializes the data based on type
|
|
104
|
+
# @param string type Data type
|
|
105
|
+
# @param string value Value to be deserialized
|
|
106
|
+
# @return [Object] Deserialized data
|
|
107
|
+
def _deserialize(type, value)
|
|
108
|
+
case type.to_sym
|
|
109
|
+
when :DateTime
|
|
110
|
+
DateTime.parse(value)
|
|
111
|
+
when :Date
|
|
112
|
+
Date.parse(value)
|
|
113
|
+
when :String
|
|
114
|
+
value.to_s
|
|
115
|
+
when :Integer
|
|
116
|
+
value.to_i
|
|
117
|
+
when :Float
|
|
118
|
+
value.to_f
|
|
119
|
+
when :BOOLEAN
|
|
120
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
121
|
+
true
|
|
122
|
+
else
|
|
123
|
+
false
|
|
124
|
+
end
|
|
125
|
+
when :Object
|
|
126
|
+
# generic object (usually a Hash), return directly
|
|
127
|
+
value
|
|
128
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
129
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
130
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
131
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
132
|
+
k_type = Regexp.last_match[:k_type]
|
|
133
|
+
v_type = Regexp.last_match[:v_type]
|
|
134
|
+
{}.tap do |hash|
|
|
135
|
+
value.each do |k, v|
|
|
136
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
137
|
+
end
|
|
138
|
+
end
|
|
139
|
+
else # model
|
|
140
|
+
temp_model = Requestsproxy.const_get(type).new
|
|
141
|
+
temp_model.build_from_hash(value)
|
|
142
|
+
end
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
# Returns the string representation of the object
|
|
146
|
+
# @return [String] String presentation of the object
|
|
147
|
+
def to_s
|
|
148
|
+
to_hash.to_s
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
152
|
+
# @return [Hash] Returns the object in the form of hash
|
|
153
|
+
def to_body
|
|
154
|
+
to_hash
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
# Returns the object in the form of hash
|
|
158
|
+
# @return [Hash] Returns the object in the form of hash
|
|
159
|
+
def to_hash
|
|
160
|
+
hash = {}
|
|
161
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
162
|
+
value = self.send(attr)
|
|
163
|
+
next if value.nil?
|
|
164
|
+
hash[param] = _to_hash(value)
|
|
165
|
+
end
|
|
166
|
+
hash
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
# Outputs non-array value in the form of hash
|
|
170
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
171
|
+
# @param [Object] value Any valid value
|
|
172
|
+
# @return [Hash] Returns the value in the form of hash
|
|
173
|
+
def _to_hash(value)
|
|
174
|
+
if value.is_a?(Array)
|
|
175
|
+
value.compact.map { |v| _to_hash(v) }
|
|
176
|
+
elsif value.is_a?(Hash)
|
|
177
|
+
{}.tap do |hash|
|
|
178
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
179
|
+
end
|
|
180
|
+
elsif value.respond_to? :to_hash
|
|
181
|
+
value.to_hash
|
|
182
|
+
else
|
|
183
|
+
value
|
|
184
|
+
end
|
|
185
|
+
end
|
|
186
|
+
end
|
|
187
|
+
end
|
|
@@ -0,0 +1,235 @@
|
|
|
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
|
+
# `Value` represents a dynamically typed value which can be either null, a number, a string, a boolean, a recursive struct value, or a list of values. A producer of value is expected to set one of that variants, absence of any variant indicates an error. The JSON representation for `Value` is JSON value.
|
|
17
|
+
class ProtobufValue
|
|
18
|
+
# Represents a null value.
|
|
19
|
+
attr_accessor :null_value
|
|
20
|
+
|
|
21
|
+
# Represents a double value.
|
|
22
|
+
attr_accessor :number_value
|
|
23
|
+
|
|
24
|
+
# Represents a string value.
|
|
25
|
+
attr_accessor :string_value
|
|
26
|
+
|
|
27
|
+
# Represents a boolean value.
|
|
28
|
+
attr_accessor :bool_value
|
|
29
|
+
|
|
30
|
+
# Represents a structured value.
|
|
31
|
+
attr_accessor :struct_value
|
|
32
|
+
|
|
33
|
+
# Represents a repeated `Value`.
|
|
34
|
+
attr_accessor :list_value
|
|
35
|
+
|
|
36
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
37
|
+
def self.attribute_map
|
|
38
|
+
{
|
|
39
|
+
:'null_value' => :'null_value',
|
|
40
|
+
:'number_value' => :'number_value',
|
|
41
|
+
:'string_value' => :'string_value',
|
|
42
|
+
:'bool_value' => :'bool_value',
|
|
43
|
+
:'struct_value' => :'struct_value',
|
|
44
|
+
:'list_value' => :'list_value'
|
|
45
|
+
}
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# Attribute type mapping.
|
|
49
|
+
def self.swagger_types
|
|
50
|
+
{
|
|
51
|
+
:'null_value' => :'ProtobufNullValue',
|
|
52
|
+
:'number_value' => :'Float',
|
|
53
|
+
:'string_value' => :'String',
|
|
54
|
+
:'bool_value' => :'BOOLEAN',
|
|
55
|
+
:'struct_value' => :'ProtobufStruct',
|
|
56
|
+
:'list_value' => :'ProtobufListValue'
|
|
57
|
+
}
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# Initializes the object
|
|
61
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
62
|
+
def initialize(attributes = {})
|
|
63
|
+
return unless attributes.is_a?(Hash)
|
|
64
|
+
|
|
65
|
+
# convert string to symbol for hash key
|
|
66
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
|
67
|
+
|
|
68
|
+
if attributes.has_key?(:'null_value')
|
|
69
|
+
self.null_value = attributes[:'null_value']
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
if attributes.has_key?(:'number_value')
|
|
73
|
+
self.number_value = attributes[:'number_value']
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
if attributes.has_key?(:'string_value')
|
|
77
|
+
self.string_value = attributes[:'string_value']
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
if attributes.has_key?(:'bool_value')
|
|
81
|
+
self.bool_value = attributes[:'bool_value']
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
if attributes.has_key?(:'struct_value')
|
|
85
|
+
self.struct_value = attributes[:'struct_value']
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
if attributes.has_key?(:'list_value')
|
|
89
|
+
self.list_value = attributes[:'list_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
|
+
invalid_properties
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
# Check to see if the all the properties in the model are valid
|
|
101
|
+
# @return true if the model is valid
|
|
102
|
+
def valid?
|
|
103
|
+
true
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
# Checks equality by comparing each attribute.
|
|
107
|
+
# @param [Object] Object to be compared
|
|
108
|
+
def ==(o)
|
|
109
|
+
return true if self.equal?(o)
|
|
110
|
+
self.class == o.class &&
|
|
111
|
+
null_value == o.null_value &&
|
|
112
|
+
number_value == o.number_value &&
|
|
113
|
+
string_value == o.string_value &&
|
|
114
|
+
bool_value == o.bool_value &&
|
|
115
|
+
struct_value == o.struct_value &&
|
|
116
|
+
list_value == o.list_value
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
# @see the `==` method
|
|
120
|
+
# @param [Object] Object to be compared
|
|
121
|
+
def eql?(o)
|
|
122
|
+
self == o
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
# Calculates hash code according to all attributes.
|
|
126
|
+
# @return [Fixnum] Hash code
|
|
127
|
+
def hash
|
|
128
|
+
[null_value, number_value, string_value, bool_value, struct_value, list_value].hash
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
# Builds the object from hash
|
|
132
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
133
|
+
# @return [Object] Returns the model itself
|
|
134
|
+
def build_from_hash(attributes)
|
|
135
|
+
return nil unless attributes.is_a?(Hash)
|
|
136
|
+
self.class.swagger_types.each_pair do |key, type|
|
|
137
|
+
if type =~ /\AArray<(.*)>/i
|
|
138
|
+
# check to ensure the input is an array given that the the attribute
|
|
139
|
+
# is documented as an array but the input is not
|
|
140
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
141
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
142
|
+
end
|
|
143
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
144
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
145
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
self
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
# Deserializes the data based on type
|
|
152
|
+
# @param string type Data type
|
|
153
|
+
# @param string value Value to be deserialized
|
|
154
|
+
# @return [Object] Deserialized data
|
|
155
|
+
def _deserialize(type, value)
|
|
156
|
+
case type.to_sym
|
|
157
|
+
when :DateTime
|
|
158
|
+
DateTime.parse(value)
|
|
159
|
+
when :Date
|
|
160
|
+
Date.parse(value)
|
|
161
|
+
when :String
|
|
162
|
+
value.to_s
|
|
163
|
+
when :Integer
|
|
164
|
+
value.to_i
|
|
165
|
+
when :Float
|
|
166
|
+
value.to_f
|
|
167
|
+
when :BOOLEAN
|
|
168
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
169
|
+
true
|
|
170
|
+
else
|
|
171
|
+
false
|
|
172
|
+
end
|
|
173
|
+
when :Object
|
|
174
|
+
# generic object (usually a Hash), return directly
|
|
175
|
+
value
|
|
176
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
177
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
178
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
179
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
180
|
+
k_type = Regexp.last_match[:k_type]
|
|
181
|
+
v_type = Regexp.last_match[:v_type]
|
|
182
|
+
{}.tap do |hash|
|
|
183
|
+
value.each do |k, v|
|
|
184
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
185
|
+
end
|
|
186
|
+
end
|
|
187
|
+
else # model
|
|
188
|
+
temp_model = Requestsproxy.const_get(type).new
|
|
189
|
+
temp_model.build_from_hash(value)
|
|
190
|
+
end
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
# Returns the string representation of the object
|
|
194
|
+
# @return [String] String presentation of the object
|
|
195
|
+
def to_s
|
|
196
|
+
to_hash.to_s
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
200
|
+
# @return [Hash] Returns the object in the form of hash
|
|
201
|
+
def to_body
|
|
202
|
+
to_hash
|
|
203
|
+
end
|
|
204
|
+
|
|
205
|
+
# Returns the object in the form of hash
|
|
206
|
+
# @return [Hash] Returns the object in the form of hash
|
|
207
|
+
def to_hash
|
|
208
|
+
hash = {}
|
|
209
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
210
|
+
value = self.send(attr)
|
|
211
|
+
next if value.nil?
|
|
212
|
+
hash[param] = _to_hash(value)
|
|
213
|
+
end
|
|
214
|
+
hash
|
|
215
|
+
end
|
|
216
|
+
|
|
217
|
+
# Outputs non-array value in the form of hash
|
|
218
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
219
|
+
# @param [Object] value Any valid value
|
|
220
|
+
# @return [Hash] Returns the value in the form of hash
|
|
221
|
+
def _to_hash(value)
|
|
222
|
+
if value.is_a?(Array)
|
|
223
|
+
value.compact.map { |v| _to_hash(v) }
|
|
224
|
+
elsif value.is_a?(Hash)
|
|
225
|
+
{}.tap do |hash|
|
|
226
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
227
|
+
end
|
|
228
|
+
elsif value.respond_to? :to_hash
|
|
229
|
+
value.to_hash
|
|
230
|
+
else
|
|
231
|
+
value
|
|
232
|
+
end
|
|
233
|
+
end
|
|
234
|
+
end
|
|
235
|
+
end
|