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