appmarketapi-rest 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (108) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +7 -0
  3. data/README.md +126 -0
  4. data/Rakefile +8 -0
  5. data/appmarketapi-rest.gemspec +45 -0
  6. data/docs/AppMarketAPIApi.md +388 -0
  7. data/docs/AppmarketapiApplication.md +22 -0
  8. data/docs/AppmarketapiApplicationCategories.md +8 -0
  9. data/docs/AppmarketapiApplicationFlowImages.md +8 -0
  10. data/docs/AppmarketapiApplicationIcon.md +8 -0
  11. data/docs/AppmarketapiApplicationMode.md +7 -0
  12. data/docs/AppmarketapiApplicationPromotion.md +8 -0
  13. data/docs/AppmarketapiApplicationSupportedPlatforms.md +8 -0
  14. data/docs/AppmarketapiApplicationTestUsers.md +8 -0
  15. data/docs/AppmarketapiAuthorizeApplicationRequest.md +11 -0
  16. data/docs/AppmarketapiAuthorizeApplicationResponse.md +8 -0
  17. data/docs/AppmarketapiCategory.md +8 -0
  18. data/docs/AppmarketapiCreateApplicationRequest.md +9 -0
  19. data/docs/AppmarketapiCreateApplicationResponse.md +9 -0
  20. data/docs/AppmarketapiCreateDeveloperRequest.md +11 -0
  21. data/docs/AppmarketapiCreateDeveloperResponse.md +11 -0
  22. data/docs/AppmarketapiCurrentApplicationMode.md +8 -0
  23. data/docs/AppmarketapiDeauthorizeApplicationRequest.md +10 -0
  24. data/docs/AppmarketapiDeauthorizeApplicationResponse.md +7 -0
  25. data/docs/AppmarketapiDeveloper.md +10 -0
  26. data/docs/AppmarketapiExtendedApplication.md +9 -0
  27. data/docs/AppmarketapiFlowImage.md +9 -0
  28. data/docs/AppmarketapiGetApplicationIdResponse.md +8 -0
  29. data/docs/AppmarketapiGetApplicationResponse.md +9 -0
  30. data/docs/AppmarketapiGetApplicationsResponse.md +8 -0
  31. data/docs/AppmarketapiPlatform.md +8 -0
  32. data/docs/AppmarketapiSectionError.md +9 -0
  33. data/docs/AppmarketapiUpdateApplicationMetadata.md +14 -0
  34. data/docs/AppmarketapiUpdateApplicationRequest.md +16 -0
  35. data/docs/AppmarketapiUpdateApplicationResponse.md +17 -0
  36. data/docs/AppmarketapiUser.md +9 -0
  37. data/git_push.sh +55 -0
  38. data/lib/appmarketapi-rest.rb +70 -0
  39. data/lib/appmarketapi-rest/api/app_market_api_api.rb +450 -0
  40. data/lib/appmarketapi-rest/api_client.rb +388 -0
  41. data/lib/appmarketapi-rest/api_error.rb +38 -0
  42. data/lib/appmarketapi-rest/configuration.rb +202 -0
  43. data/lib/appmarketapi-rest/models/appmarketapi_application.rb +317 -0
  44. data/lib/appmarketapi-rest/models/appmarketapi_application_categories.rb +185 -0
  45. data/lib/appmarketapi-rest/models/appmarketapi_application_flow_images.rb +185 -0
  46. data/lib/appmarketapi-rest/models/appmarketapi_application_icon.rb +183 -0
  47. data/lib/appmarketapi-rest/models/appmarketapi_application_mode.rb +32 -0
  48. data/lib/appmarketapi-rest/models/appmarketapi_application_promotion.rb +183 -0
  49. data/lib/appmarketapi-rest/models/appmarketapi_application_supported_platforms.rb +185 -0
  50. data/lib/appmarketapi-rest/models/appmarketapi_application_test_users.rb +185 -0
  51. data/lib/appmarketapi-rest/models/appmarketapi_authorize_application_request.rb +210 -0
  52. data/lib/appmarketapi-rest/models/appmarketapi_authorize_application_response.rb +183 -0
  53. data/lib/appmarketapi-rest/models/appmarketapi_category.rb +183 -0
  54. data/lib/appmarketapi-rest/models/appmarketapi_create_application_request.rb +192 -0
  55. data/lib/appmarketapi-rest/models/appmarketapi_create_application_response.rb +192 -0
  56. data/lib/appmarketapi-rest/models/appmarketapi_create_developer_request.rb +210 -0
  57. data/lib/appmarketapi-rest/models/appmarketapi_create_developer_response.rb +210 -0
  58. data/lib/appmarketapi-rest/models/appmarketapi_current_application_mode.rb +183 -0
  59. data/lib/appmarketapi-rest/models/appmarketapi_deauthorize_application_request.rb +201 -0
  60. data/lib/appmarketapi-rest/models/appmarketapi_deauthorize_application_response.rb +174 -0
  61. data/lib/appmarketapi-rest/models/appmarketapi_developer.rb +201 -0
  62. data/lib/appmarketapi-rest/models/appmarketapi_extended_application.rb +192 -0
  63. data/lib/appmarketapi-rest/models/appmarketapi_flow_image.rb +192 -0
  64. data/lib/appmarketapi-rest/models/appmarketapi_get_application_id_response.rb +183 -0
  65. data/lib/appmarketapi-rest/models/appmarketapi_get_application_response.rb +192 -0
  66. data/lib/appmarketapi-rest/models/appmarketapi_get_applications_response.rb +185 -0
  67. data/lib/appmarketapi-rest/models/appmarketapi_platform.rb +183 -0
  68. data/lib/appmarketapi-rest/models/appmarketapi_section_error.rb +192 -0
  69. data/lib/appmarketapi-rest/models/appmarketapi_update_application_metadata.rb +237 -0
  70. data/lib/appmarketapi-rest/models/appmarketapi_update_application_request.rb +255 -0
  71. data/lib/appmarketapi-rest/models/appmarketapi_update_application_response.rb +266 -0
  72. data/lib/appmarketapi-rest/models/appmarketapi_user.rb +194 -0
  73. data/lib/appmarketapi-rest/version.rb +15 -0
  74. data/spec/api/app_market_api_api_spec.rb +122 -0
  75. data/spec/api_client_spec.rb +226 -0
  76. data/spec/configuration_spec.rb +42 -0
  77. data/spec/models/appmarketapi_application_categories_spec.rb +41 -0
  78. data/spec/models/appmarketapi_application_flow_images_spec.rb +41 -0
  79. data/spec/models/appmarketapi_application_icon_spec.rb +41 -0
  80. data/spec/models/appmarketapi_application_mode_spec.rb +35 -0
  81. data/spec/models/appmarketapi_application_promotion_spec.rb +41 -0
  82. data/spec/models/appmarketapi_application_spec.rb +125 -0
  83. data/spec/models/appmarketapi_application_supported_platforms_spec.rb +41 -0
  84. data/spec/models/appmarketapi_application_test_users_spec.rb +41 -0
  85. data/spec/models/appmarketapi_authorize_application_request_spec.rb +59 -0
  86. data/spec/models/appmarketapi_authorize_application_response_spec.rb +41 -0
  87. data/spec/models/appmarketapi_category_spec.rb +41 -0
  88. data/spec/models/appmarketapi_create_application_request_spec.rb +47 -0
  89. data/spec/models/appmarketapi_create_application_response_spec.rb +47 -0
  90. data/spec/models/appmarketapi_create_developer_request_spec.rb +59 -0
  91. data/spec/models/appmarketapi_create_developer_response_spec.rb +59 -0
  92. data/spec/models/appmarketapi_current_application_mode_spec.rb +41 -0
  93. data/spec/models/appmarketapi_deauthorize_application_request_spec.rb +53 -0
  94. data/spec/models/appmarketapi_deauthorize_application_response_spec.rb +35 -0
  95. data/spec/models/appmarketapi_developer_spec.rb +53 -0
  96. data/spec/models/appmarketapi_extended_application_spec.rb +47 -0
  97. data/spec/models/appmarketapi_flow_image_spec.rb +47 -0
  98. data/spec/models/appmarketapi_get_application_id_response_spec.rb +41 -0
  99. data/spec/models/appmarketapi_get_application_response_spec.rb +47 -0
  100. data/spec/models/appmarketapi_get_applications_response_spec.rb +41 -0
  101. data/spec/models/appmarketapi_platform_spec.rb +41 -0
  102. data/spec/models/appmarketapi_section_error_spec.rb +47 -0
  103. data/spec/models/appmarketapi_update_application_metadata_spec.rb +77 -0
  104. data/spec/models/appmarketapi_update_application_request_spec.rb +89 -0
  105. data/spec/models/appmarketapi_update_application_response_spec.rb +95 -0
  106. data/spec/models/appmarketapi_user_spec.rb +47 -0
  107. data/spec/spec_helper.rb +111 -0
  108. metadata +364 -0
@@ -0,0 +1,237 @@
1
+ =begin
2
+ #appmarketapi.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 Appmarketapi
16
+ class AppmarketapiUpdateApplicationMetadata
17
+ attr_accessor :name
18
+
19
+ attr_accessor :short_description
20
+
21
+ attr_accessor :long_description
22
+
23
+ attr_accessor :image_url
24
+
25
+ attr_accessor :support_url
26
+
27
+ attr_accessor :support_email
28
+
29
+ attr_accessor :redirect_url
30
+
31
+ # Attribute mapping from ruby-style variable name to JSON key.
32
+ def self.attribute_map
33
+ {
34
+ :'name' => :'name',
35
+ :'short_description' => :'short_description',
36
+ :'long_description' => :'long_description',
37
+ :'image_url' => :'image_url',
38
+ :'support_url' => :'support_url',
39
+ :'support_email' => :'support_email',
40
+ :'redirect_url' => :'redirect_url'
41
+ }
42
+ end
43
+
44
+ # Attribute type mapping.
45
+ def self.swagger_types
46
+ {
47
+ :'name' => :'String',
48
+ :'short_description' => :'String',
49
+ :'long_description' => :'String',
50
+ :'image_url' => :'String',
51
+ :'support_url' => :'String',
52
+ :'support_email' => :'String',
53
+ :'redirect_url' => :'String'
54
+ }
55
+ end
56
+
57
+ # Initializes the object
58
+ # @param [Hash] attributes Model attributes in the form of hash
59
+ def initialize(attributes = {})
60
+ return unless attributes.is_a?(Hash)
61
+
62
+ # convert string to symbol for hash key
63
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
64
+
65
+ if attributes.has_key?(:'name')
66
+ self.name = attributes[:'name']
67
+ end
68
+
69
+ if attributes.has_key?(:'short_description')
70
+ self.short_description = attributes[:'short_description']
71
+ end
72
+
73
+ if attributes.has_key?(:'long_description')
74
+ self.long_description = attributes[:'long_description']
75
+ end
76
+
77
+ if attributes.has_key?(:'image_url')
78
+ self.image_url = attributes[:'image_url']
79
+ end
80
+
81
+ if attributes.has_key?(:'support_url')
82
+ self.support_url = attributes[:'support_url']
83
+ end
84
+
85
+ if attributes.has_key?(:'support_email')
86
+ self.support_email = attributes[:'support_email']
87
+ end
88
+
89
+ if attributes.has_key?(:'redirect_url')
90
+ self.redirect_url = attributes[:'redirect_url']
91
+ end
92
+ end
93
+
94
+ # Show invalid properties with the reasons. Usually used together with valid?
95
+ # @return Array for valid properties with the reasons
96
+ def list_invalid_properties
97
+ invalid_properties = Array.new
98
+ invalid_properties
99
+ end
100
+
101
+ # Check to see if the all the properties in the model are valid
102
+ # @return true if the model is valid
103
+ def valid?
104
+ true
105
+ end
106
+
107
+ # Checks equality by comparing each attribute.
108
+ # @param [Object] Object to be compared
109
+ def ==(o)
110
+ return true if self.equal?(o)
111
+ self.class == o.class &&
112
+ name == o.name &&
113
+ short_description == o.short_description &&
114
+ long_description == o.long_description &&
115
+ image_url == o.image_url &&
116
+ support_url == o.support_url &&
117
+ support_email == o.support_email &&
118
+ redirect_url == o.redirect_url
119
+ end
120
+
121
+ # @see the `==` method
122
+ # @param [Object] Object to be compared
123
+ def eql?(o)
124
+ self == o
125
+ end
126
+
127
+ # Calculates hash code according to all attributes.
128
+ # @return [Fixnum] Hash code
129
+ def hash
130
+ [name, short_description, long_description, image_url, support_url, support_email, redirect_url].hash
131
+ end
132
+
133
+ # Builds the object from hash
134
+ # @param [Hash] attributes Model attributes in the form of hash
135
+ # @return [Object] Returns the model itself
136
+ def build_from_hash(attributes)
137
+ return nil unless attributes.is_a?(Hash)
138
+ self.class.swagger_types.each_pair do |key, type|
139
+ if type =~ /\AArray<(.*)>/i
140
+ # check to ensure the input is an array given that the the attribute
141
+ # is documented as an array but the input is not
142
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
143
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
144
+ end
145
+ elsif !attributes[self.class.attribute_map[key]].nil?
146
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
147
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
148
+ end
149
+
150
+ self
151
+ end
152
+
153
+ # Deserializes the data based on type
154
+ # @param string type Data type
155
+ # @param string value Value to be deserialized
156
+ # @return [Object] Deserialized data
157
+ def _deserialize(type, value)
158
+ case type.to_sym
159
+ when :DateTime
160
+ DateTime.parse(value)
161
+ when :Date
162
+ Date.parse(value)
163
+ when :String
164
+ value.to_s
165
+ when :Integer
166
+ value.to_i
167
+ when :Float
168
+ value.to_f
169
+ when :BOOLEAN
170
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
171
+ true
172
+ else
173
+ false
174
+ end
175
+ when :Object
176
+ # generic object (usually a Hash), return directly
177
+ value
178
+ when /\AArray<(?<inner_type>.+)>\z/
179
+ inner_type = Regexp.last_match[:inner_type]
180
+ value.map { |v| _deserialize(inner_type, v) }
181
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
182
+ k_type = Regexp.last_match[:k_type]
183
+ v_type = Regexp.last_match[:v_type]
184
+ {}.tap do |hash|
185
+ value.each do |k, v|
186
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
187
+ end
188
+ end
189
+ else # model
190
+ temp_model = Appmarketapi.const_get(type).new
191
+ temp_model.build_from_hash(value)
192
+ end
193
+ end
194
+
195
+ # Returns the string representation of the object
196
+ # @return [String] String presentation of the object
197
+ def to_s
198
+ to_hash.to_s
199
+ end
200
+
201
+ # to_body is an alias to to_hash (backward compatibility)
202
+ # @return [Hash] Returns the object in the form of hash
203
+ def to_body
204
+ to_hash
205
+ end
206
+
207
+ # Returns the object in the form of hash
208
+ # @return [Hash] Returns the object in the form of hash
209
+ def to_hash
210
+ hash = {}
211
+ self.class.attribute_map.each_pair do |attr, param|
212
+ value = self.send(attr)
213
+ next if value.nil?
214
+ hash[param] = _to_hash(value)
215
+ end
216
+ hash
217
+ end
218
+
219
+ # Outputs non-array value in the form of hash
220
+ # For object, use to_hash. Otherwise, just return the value
221
+ # @param [Object] value Any valid value
222
+ # @return [Hash] Returns the value in the form of hash
223
+ def _to_hash(value)
224
+ if value.is_a?(Array)
225
+ value.compact.map { |v| _to_hash(v) }
226
+ elsif value.is_a?(Hash)
227
+ {}.tap do |hash|
228
+ value.each { |k, v| hash[k] = _to_hash(v) }
229
+ end
230
+ elsif value.respond_to? :to_hash
231
+ value.to_hash
232
+ else
233
+ value
234
+ end
235
+ end
236
+ end
237
+ end
@@ -0,0 +1,255 @@
1
+ =begin
2
+ #appmarketapi.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 Appmarketapi
16
+ class AppmarketapiUpdateApplicationRequest
17
+ attr_accessor :application_id
18
+
19
+ attr_accessor :application_metadata
20
+
21
+ attr_accessor :application_icon
22
+
23
+ attr_accessor :application_promotion
24
+
25
+ attr_accessor :application_mode
26
+
27
+ attr_accessor :application_categories
28
+
29
+ attr_accessor :application_flow_images
30
+
31
+ attr_accessor :application_test_users
32
+
33
+ attr_accessor :application_supported_platforms
34
+
35
+ # Attribute mapping from ruby-style variable name to JSON key.
36
+ def self.attribute_map
37
+ {
38
+ :'application_id' => :'application_id',
39
+ :'application_metadata' => :'application_metadata',
40
+ :'application_icon' => :'application_icon',
41
+ :'application_promotion' => :'application_promotion',
42
+ :'application_mode' => :'application_mode',
43
+ :'application_categories' => :'application_categories',
44
+ :'application_flow_images' => :'application_flow_images',
45
+ :'application_test_users' => :'application_test_users',
46
+ :'application_supported_platforms' => :'application_supported_platforms'
47
+ }
48
+ end
49
+
50
+ # Attribute type mapping.
51
+ def self.swagger_types
52
+ {
53
+ :'application_id' => :'String',
54
+ :'application_metadata' => :'AppmarketapiUpdateApplicationMetadata',
55
+ :'application_icon' => :'AppmarketapiApplicationIcon',
56
+ :'application_promotion' => :'AppmarketapiApplicationPromotion',
57
+ :'application_mode' => :'AppmarketapiCurrentApplicationMode',
58
+ :'application_categories' => :'AppmarketapiApplicationCategories',
59
+ :'application_flow_images' => :'AppmarketapiApplicationFlowImages',
60
+ :'application_test_users' => :'AppmarketapiApplicationTestUsers',
61
+ :'application_supported_platforms' => :'AppmarketapiApplicationSupportedPlatforms'
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?(:'application_id')
74
+ self.application_id = attributes[:'application_id']
75
+ end
76
+
77
+ if attributes.has_key?(:'application_metadata')
78
+ self.application_metadata = attributes[:'application_metadata']
79
+ end
80
+
81
+ if attributes.has_key?(:'application_icon')
82
+ self.application_icon = attributes[:'application_icon']
83
+ end
84
+
85
+ if attributes.has_key?(:'application_promotion')
86
+ self.application_promotion = attributes[:'application_promotion']
87
+ end
88
+
89
+ if attributes.has_key?(:'application_mode')
90
+ self.application_mode = attributes[:'application_mode']
91
+ end
92
+
93
+ if attributes.has_key?(:'application_categories')
94
+ self.application_categories = attributes[:'application_categories']
95
+ end
96
+
97
+ if attributes.has_key?(:'application_flow_images')
98
+ self.application_flow_images = attributes[:'application_flow_images']
99
+ end
100
+
101
+ if attributes.has_key?(:'application_test_users')
102
+ self.application_test_users = attributes[:'application_test_users']
103
+ end
104
+
105
+ if attributes.has_key?(:'application_supported_platforms')
106
+ self.application_supported_platforms = attributes[:'application_supported_platforms']
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
+ application_id == o.application_id &&
129
+ application_metadata == o.application_metadata &&
130
+ application_icon == o.application_icon &&
131
+ application_promotion == o.application_promotion &&
132
+ application_mode == o.application_mode &&
133
+ application_categories == o.application_categories &&
134
+ application_flow_images == o.application_flow_images &&
135
+ application_test_users == o.application_test_users &&
136
+ application_supported_platforms == o.application_supported_platforms
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
+ [application_id, application_metadata, application_icon, application_promotion, application_mode, application_categories, application_flow_images, application_test_users, application_supported_platforms].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 = Appmarketapi.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