indexea_client 0.0.9

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.
Files changed (301) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/README.md +3413 -0
  4. data/Rakefile +8 -0
  5. data/docs/AccountApi.md +685 -0
  6. data/docs/AccountBean.md +27 -0
  7. data/docs/AccountPasswdBody.md +8 -0
  8. data/docs/AccountPortraitBody.md +7 -0
  9. data/docs/AccountProfileBody.md +8 -0
  10. data/docs/AccountResetpwdBody.md +9 -0
  11. data/docs/AccountSigninBody.md +9 -0
  12. data/docs/AccountSignupBody.md +10 -0
  13. data/docs/AccountsFeedbackBody.md +8 -0
  14. data/docs/AccountsMessageBody.md +8 -0
  15. data/docs/AnalyzeObject.md +8 -0
  16. data/docs/AnalyzeToken.md +11 -0
  17. data/docs/AppBean.md +23 -0
  18. data/docs/AppCompanyBody.md +22 -0
  19. data/docs/AppIndexBody.md +7 -0
  20. data/docs/AppLogAccount.md +9 -0
  21. data/docs/AppLogBean.md +19 -0
  22. data/docs/AppLogsBean.md +9 -0
  23. data/docs/AppMentorBean.md +14 -0
  24. data/docs/AppOauthBody.md +7 -0
  25. data/docs/AppOauthBody1.md +7 -0
  26. data/docs/AppOauthresetsecretBody.md +7 -0
  27. data/docs/AppTokensBody.md +7 -0
  28. data/docs/AppTokensBody1.md +7 -0
  29. data/docs/AppWidgetBody.md +7 -0
  30. data/docs/AppsApi.md +1843 -0
  31. data/docs/AppsAppBody.md +8 -0
  32. data/docs/AppsBody.md +8 -0
  33. data/docs/AutoCompleteItem.md +9 -0
  34. data/docs/BlacklistBean.md +12 -0
  35. data/docs/Bulletin.md +15 -0
  36. data/docs/CompanyBean.md +24 -0
  37. data/docs/ContactForm.md +11 -0
  38. data/docs/CrawlerLog.md +14 -0
  39. data/docs/CrawlerLogs.md +8 -0
  40. data/docs/CrawlerTask.md +16 -0
  41. data/docs/FieldsApi.md +215 -0
  42. data/docs/GlobalApi.md +258 -0
  43. data/docs/GlobalOptionForm.md +8 -0
  44. data/docs/IndexBean.md +26 -0
  45. data/docs/IndexFieldBean.md +8 -0
  46. data/docs/IndexForm.md +15 -0
  47. data/docs/IndexRebuildForm.md +12 -0
  48. data/docs/IndexSettings.md +10 -0
  49. data/docs/IndexSettingsBody.md +7 -0
  50. data/docs/IndexStatBean.md +14 -0
  51. data/docs/IndexSynonymsflushBody.md +7 -0
  52. data/docs/IndexTask.md +13 -0
  53. data/docs/IndexTemplate.md +17 -0
  54. data/docs/IndexTemplates.md +8 -0
  55. data/docs/IndexUploadBody.md +7 -0
  56. data/docs/IndicesApi.md +1620 -0
  57. data/docs/IntelligentMapping.md +8 -0
  58. data/docs/KeywordBindingBean.md +14 -0
  59. data/docs/MentorForm.md +8 -0
  60. data/docs/Message.md +18 -0
  61. data/docs/MessageApi.md +262 -0
  62. data/docs/Messages.md +8 -0
  63. data/docs/OauthAppBean.md +20 -0
  64. data/docs/OpenidBean.md +10 -0
  65. data/docs/OptionForm.md +10 -0
  66. data/docs/OrdersIdentBody.md +7 -0
  67. data/docs/PayResult.md +9 -0
  68. data/docs/PaymentApi.md +788 -0
  69. data/docs/PaymentInvoice.md +15 -0
  70. data/docs/PaymentOrder.md +25 -0
  71. data/docs/PaymentRecord.md +13 -0
  72. data/docs/PaymentService.md +12 -0
  73. data/docs/QueriesApi.md +1821 -0
  74. data/docs/QueryActionBean.md +27 -0
  75. data/docs/QueryBean.md +22 -0
  76. data/docs/QueryForm.md +15 -0
  77. data/docs/QueryNode.md +10 -0
  78. data/docs/QuerySortField.md +9 -0
  79. data/docs/QueryVariableBean.md +17 -0
  80. data/docs/RecommendApi.md +365 -0
  81. data/docs/RecommendBean.md +18 -0
  82. data/docs/RecordFilter.md +10 -0
  83. data/docs/RecordsApi.md +286 -0
  84. data/docs/SearchApi.md +646 -0
  85. data/docs/SearchEstimateResult.md +11 -0
  86. data/docs/SearchWord.md +8 -0
  87. data/docs/StatIndexBean.md +14 -0
  88. data/docs/StatsApi.md +245 -0
  89. data/docs/SynonymsBean.md +14 -0
  90. data/docs/TokenBean.md +12 -0
  91. data/docs/TriggerBean.md +13 -0
  92. data/docs/TriggerLogBean.md +15 -0
  93. data/docs/ValueOfField.md +8 -0
  94. data/docs/WidgetBean.md +21 -0
  95. data/docs/WidgetForm.md +13 -0
  96. data/docs/WidgetLogo.md +7 -0
  97. data/docs/WidgetLogoBody.md +7 -0
  98. data/docs/WidgetStatusForm.md +8 -0
  99. data/docs/WidgetsApi.md +573 -0
  100. data/git_push.sh +55 -0
  101. data/indexea_client.gemspec +38 -0
  102. data/lib/indexea_client/api/account_api.rb +846 -0
  103. data/lib/indexea_client/api/apps_api.rb +2271 -0
  104. data/lib/indexea_client/api/fields_api.rb +289 -0
  105. data/lib/indexea_client/api/global_api.rb +326 -0
  106. data/lib/indexea_client/api/indices_api.rb +2076 -0
  107. data/lib/indexea_client/api/message_api.rb +337 -0
  108. data/lib/indexea_client/api/payment_api.rb +975 -0
  109. data/lib/indexea_client/api/queries_api.rb +2320 -0
  110. data/lib/indexea_client/api/recommend_api.rb +461 -0
  111. data/lib/indexea_client/api/records_api.rb +375 -0
  112. data/lib/indexea_client/api/search_api.rb +892 -0
  113. data/lib/indexea_client/api/stats_api.rb +312 -0
  114. data/lib/indexea_client/api/widgets_api.rb +741 -0
  115. data/lib/indexea_client/api_client.rb +391 -0
  116. data/lib/indexea_client/api_error.rb +57 -0
  117. data/lib/indexea_client/configuration.rb +205 -0
  118. data/lib/indexea_client/models/account_bean.rb +396 -0
  119. data/lib/indexea_client/models/account_passwd_body.rb +227 -0
  120. data/lib/indexea_client/models/account_portrait_body.rb +206 -0
  121. data/lib/indexea_client/models/account_profile_body.rb +228 -0
  122. data/lib/indexea_client/models/account_resetpwd_body.rb +240 -0
  123. data/lib/indexea_client/models/account_signin_body.rb +237 -0
  124. data/lib/indexea_client/models/account_signup_body.rb +254 -0
  125. data/lib/indexea_client/models/accounts_feedback_body.rb +262 -0
  126. data/lib/indexea_client/models/accounts_message_body.rb +226 -0
  127. data/lib/indexea_client/models/analyze_object.rb +216 -0
  128. data/lib/indexea_client/models/analyze_token.rb +243 -0
  129. data/lib/indexea_client/models/app_bean.rb +360 -0
  130. data/lib/indexea_client/models/app_company_body.rb +357 -0
  131. data/lib/indexea_client/models/app_index_body.rb +212 -0
  132. data/lib/indexea_client/models/app_log_account.rb +224 -0
  133. data/lib/indexea_client/models/app_log_bean.rb +318 -0
  134. data/lib/indexea_client/models/app_logs_bean.rb +229 -0
  135. data/lib/indexea_client/models/app_mentor_bean.rb +277 -0
  136. data/lib/indexea_client/models/app_oauth_body.rb +206 -0
  137. data/lib/indexea_client/models/app_oauth_body_1.rb +212 -0
  138. data/lib/indexea_client/models/app_oauthresetsecret_body.rb +212 -0
  139. data/lib/indexea_client/models/app_tokens_body.rb +212 -0
  140. data/lib/indexea_client/models/app_tokens_body_1.rb +212 -0
  141. data/lib/indexea_client/models/app_widget_body.rb +212 -0
  142. data/lib/indexea_client/models/apps_app_body.rb +216 -0
  143. data/lib/indexea_client/models/apps_body.rb +221 -0
  144. data/lib/indexea_client/models/auto_complete_item.rb +224 -0
  145. data/lib/indexea_client/models/blacklist_bean.rb +258 -0
  146. data/lib/indexea_client/models/bulletin.rb +312 -0
  147. data/lib/indexea_client/models/company_bean.rb +378 -0
  148. data/lib/indexea_client/models/contact_form.rb +258 -0
  149. data/lib/indexea_client/models/crawler_log.rb +270 -0
  150. data/lib/indexea_client/models/crawler_logs.rb +217 -0
  151. data/lib/indexea_client/models/crawler_task.rb +288 -0
  152. data/lib/indexea_client/models/global_option_form.rb +218 -0
  153. data/lib/indexea_client/models/index_bean.rb +390 -0
  154. data/lib/indexea_client/models/index_field_bean.rb +217 -0
  155. data/lib/indexea_client/models/index_form.rb +283 -0
  156. data/lib/indexea_client/models/index_rebuild_form.rb +254 -0
  157. data/lib/indexea_client/models/index_settings.rb +234 -0
  158. data/lib/indexea_client/models/index_settings_body.rb +212 -0
  159. data/lib/indexea_client/models/index_stat_bean.rb +270 -0
  160. data/lib/indexea_client/models/index_synonymsflush_body.rb +212 -0
  161. data/lib/indexea_client/models/index_task.rb +261 -0
  162. data/lib/indexea_client/models/index_template.rb +299 -0
  163. data/lib/indexea_client/models/index_templates.rb +219 -0
  164. data/lib/indexea_client/models/index_upload_body.rb +208 -0
  165. data/lib/indexea_client/models/intelligent_mapping.rb +217 -0
  166. data/lib/indexea_client/models/keyword_binding_bean.rb +274 -0
  167. data/lib/indexea_client/models/mentor_form.rb +220 -0
  168. data/lib/indexea_client/models/message.rb +306 -0
  169. data/lib/indexea_client/models/messages.rb +217 -0
  170. data/lib/indexea_client/models/oauth_app_bean.rb +329 -0
  171. data/lib/indexea_client/models/openid_bean.rb +238 -0
  172. data/lib/indexea_client/models/option_form.rb +287 -0
  173. data/lib/indexea_client/models/orders_ident_body.rb +206 -0
  174. data/lib/indexea_client/models/pay_result.rb +258 -0
  175. data/lib/indexea_client/models/payment_invoice.rb +283 -0
  176. data/lib/indexea_client/models/payment_order.rb +412 -0
  177. data/lib/indexea_client/models/payment_record.rb +261 -0
  178. data/lib/indexea_client/models/payment_service.rb +258 -0
  179. data/lib/indexea_client/models/query_action_bean.rb +391 -0
  180. data/lib/indexea_client/models/query_bean.rb +348 -0
  181. data/lib/indexea_client/models/query_form.rb +285 -0
  182. data/lib/indexea_client/models/query_node.rb +234 -0
  183. data/lib/indexea_client/models/query_sort_field.rb +264 -0
  184. data/lib/indexea_client/models/query_variable_bean.rb +335 -0
  185. data/lib/indexea_client/models/recommend_bean.rb +318 -0
  186. data/lib/indexea_client/models/record_filter.rb +242 -0
  187. data/lib/indexea_client/models/search_estimate_result.rb +242 -0
  188. data/lib/indexea_client/models/search_word.rb +218 -0
  189. data/lib/indexea_client/models/stat_index_bean.rb +270 -0
  190. data/lib/indexea_client/models/synonyms_bean.rb +274 -0
  191. data/lib/indexea_client/models/token_bean.rb +252 -0
  192. data/lib/indexea_client/models/trigger_bean.rb +263 -0
  193. data/lib/indexea_client/models/trigger_log_bean.rb +279 -0
  194. data/lib/indexea_client/models/value_of_field.rb +217 -0
  195. data/lib/indexea_client/models/widget_bean.rb +387 -0
  196. data/lib/indexea_client/models/widget_form.rb +328 -0
  197. data/lib/indexea_client/models/widget_logo.rb +206 -0
  198. data/lib/indexea_client/models/widget_logo_body.rb +206 -0
  199. data/lib/indexea_client/models/widget_status_form.rb +223 -0
  200. data/lib/indexea_client/version.rb +14 -0
  201. data/lib/indexea_client.rb +133 -0
  202. data/spec/api/account_api_spec.rb +200 -0
  203. data/spec/api/apps_api_spec.rb +492 -0
  204. data/spec/api/fields_api_spec.rb +86 -0
  205. data/spec/api/global_api_spec.rb +98 -0
  206. data/spec/api/indices_api_spec.rb +434 -0
  207. data/spec/api/message_api_spec.rb +96 -0
  208. data/spec/api/payment_api_spec.rb +227 -0
  209. data/spec/api/queries_api_spec.rb +482 -0
  210. data/spec/api/recommend_api_spec.rb +125 -0
  211. data/spec/api/records_api_spec.rb +107 -0
  212. data/spec/api/search_api_spec.rb +220 -0
  213. data/spec/api/stats_api_spec.rb +99 -0
  214. data/spec/api/widgets_api_spec.rb +174 -0
  215. data/spec/api_client_spec.rb +225 -0
  216. data/spec/base_object_spec.rb +109 -0
  217. data/spec/configuration_spec.rb +41 -0
  218. data/spec/models/account_bean_spec.rb +160 -0
  219. data/spec/models/account_passwd_body_spec.rb +46 -0
  220. data/spec/models/account_portrait_body_spec.rb +40 -0
  221. data/spec/models/account_profile_body_spec.rb +46 -0
  222. data/spec/models/account_resetpwd_body_spec.rb +52 -0
  223. data/spec/models/account_signin_body_spec.rb +52 -0
  224. data/spec/models/account_signup_body_spec.rb +58 -0
  225. data/spec/models/accounts_feedback_body_spec.rb +50 -0
  226. data/spec/models/accounts_message_body_spec.rb +46 -0
  227. data/spec/models/analyze_object_spec.rb +46 -0
  228. data/spec/models/analyze_token_spec.rb +64 -0
  229. data/spec/models/app_bean_spec.rb +136 -0
  230. data/spec/models/app_company_body_spec.rb +130 -0
  231. data/spec/models/app_index_body_spec.rb +40 -0
  232. data/spec/models/app_log_account_spec.rb +52 -0
  233. data/spec/models/app_log_bean_spec.rb +112 -0
  234. data/spec/models/app_logs_bean_spec.rb +52 -0
  235. data/spec/models/app_mentor_bean_spec.rb +82 -0
  236. data/spec/models/app_oauth_body_1_spec.rb +40 -0
  237. data/spec/models/app_oauth_body_spec.rb +40 -0
  238. data/spec/models/app_oauthresetsecret_body_spec.rb +40 -0
  239. data/spec/models/app_tokens_body_1_spec.rb +40 -0
  240. data/spec/models/app_tokens_body_spec.rb +40 -0
  241. data/spec/models/app_widget_body_spec.rb +40 -0
  242. data/spec/models/apps_app_body_spec.rb +46 -0
  243. data/spec/models/apps_body_spec.rb +46 -0
  244. data/spec/models/auto_complete_item_spec.rb +52 -0
  245. data/spec/models/blacklist_bean_spec.rb +70 -0
  246. data/spec/models/bulletin_spec.rb +92 -0
  247. data/spec/models/company_bean_spec.rb +142 -0
  248. data/spec/models/contact_form_spec.rb +64 -0
  249. data/spec/models/crawler_log_spec.rb +82 -0
  250. data/spec/models/crawler_logs_spec.rb +46 -0
  251. data/spec/models/crawler_task_spec.rb +94 -0
  252. data/spec/models/global_option_form_spec.rb +46 -0
  253. data/spec/models/index_bean_spec.rb +154 -0
  254. data/spec/models/index_field_bean_spec.rb +46 -0
  255. data/spec/models/index_form_spec.rb +88 -0
  256. data/spec/models/index_rebuild_form_spec.rb +70 -0
  257. data/spec/models/index_settings_body_spec.rb +40 -0
  258. data/spec/models/index_settings_spec.rb +58 -0
  259. data/spec/models/index_stat_bean_spec.rb +82 -0
  260. data/spec/models/index_synonymsflush_body_spec.rb +40 -0
  261. data/spec/models/index_task_spec.rb +76 -0
  262. data/spec/models/index_template_spec.rb +100 -0
  263. data/spec/models/index_templates_spec.rb +46 -0
  264. data/spec/models/index_upload_body_spec.rb +40 -0
  265. data/spec/models/intelligent_mapping_spec.rb +46 -0
  266. data/spec/models/keyword_binding_bean_spec.rb +82 -0
  267. data/spec/models/mentor_form_spec.rb +46 -0
  268. data/spec/models/message_spec.rb +106 -0
  269. data/spec/models/messages_spec.rb +46 -0
  270. data/spec/models/oauth_app_bean_spec.rb +118 -0
  271. data/spec/models/openid_bean_spec.rb +58 -0
  272. data/spec/models/option_form_spec.rb +62 -0
  273. data/spec/models/orders_ident_body_spec.rb +40 -0
  274. data/spec/models/pay_result_spec.rb +56 -0
  275. data/spec/models/payment_invoice_spec.rb +88 -0
  276. data/spec/models/payment_order_spec.rb +152 -0
  277. data/spec/models/payment_record_spec.rb +76 -0
  278. data/spec/models/payment_service_spec.rb +70 -0
  279. data/spec/models/query_action_bean_spec.rb +160 -0
  280. data/spec/models/query_bean_spec.rb +130 -0
  281. data/spec/models/query_form_spec.rb +88 -0
  282. data/spec/models/query_node_spec.rb +58 -0
  283. data/spec/models/query_sort_field_spec.rb +56 -0
  284. data/spec/models/query_variable_bean_spec.rb +104 -0
  285. data/spec/models/recommend_bean_spec.rb +106 -0
  286. data/spec/models/record_filter_spec.rb +58 -0
  287. data/spec/models/search_estimate_result_spec.rb +64 -0
  288. data/spec/models/search_word_spec.rb +46 -0
  289. data/spec/models/stat_index_bean_spec.rb +82 -0
  290. data/spec/models/synonyms_bean_spec.rb +82 -0
  291. data/spec/models/token_bean_spec.rb +70 -0
  292. data/spec/models/trigger_bean_spec.rb +76 -0
  293. data/spec/models/trigger_log_bean_spec.rb +88 -0
  294. data/spec/models/value_of_field_spec.rb +46 -0
  295. data/spec/models/widget_bean_spec.rb +132 -0
  296. data/spec/models/widget_form_spec.rb +84 -0
  297. data/spec/models/widget_logo_body_spec.rb +40 -0
  298. data/spec/models/widget_logo_spec.rb +40 -0
  299. data/spec/models/widget_status_form_spec.rb +46 -0
  300. data/spec/spec_helper.rb +110 -0
  301. metadata +501 -0
@@ -0,0 +1,237 @@
1
+ =begin
2
+ #Indexea OpenAPI
3
+
4
+ #OpenAPI of Indexea
5
+
6
+ OpenAPI spec version: 1.0.0
7
+ Contact: indexea.com@gmail.com
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 3.0.54
10
+ =end
11
+
12
+ require 'date'
13
+
14
+ module IndexeaClient
15
+ # 登录表单
16
+ class AccountSigninBody
17
+ attr_accessor :account
18
+
19
+ attr_accessor :pwd
20
+
21
+ attr_accessor :keep_login
22
+
23
+ # Attribute mapping from ruby-style variable name to JSON key.
24
+ def self.attribute_map
25
+ {
26
+ :'account' => :'account',
27
+ :'pwd' => :'pwd',
28
+ :'keep_login' => :'keep_login'
29
+ }
30
+ end
31
+
32
+ # Attribute type mapping.
33
+ def self.openapi_types
34
+ {
35
+ :'account' => :'Object',
36
+ :'pwd' => :'Object',
37
+ :'keep_login' => :'Object'
38
+ }
39
+ end
40
+
41
+ # List of attributes with nullable: true
42
+ def self.openapi_nullable
43
+ Set.new([
44
+ ])
45
+ end
46
+
47
+ # Initializes the object
48
+ # @param [Hash] attributes Model attributes in the form of hash
49
+ def initialize(attributes = {})
50
+ if (!attributes.is_a?(Hash))
51
+ fail ArgumentError, "The input argument (attributes) must be a hash in `IndexeaClient::AccountSigninBody` initialize method"
52
+ end
53
+
54
+ # check to see if the attribute exists and convert string to symbol for hash key
55
+ attributes = attributes.each_with_object({}) { |(k, v), h|
56
+ if (!self.class.attribute_map.key?(k.to_sym))
57
+ fail ArgumentError, "`#{k}` is not a valid attribute in `IndexeaClient::AccountSigninBody`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
58
+ end
59
+ h[k.to_sym] = v
60
+ }
61
+
62
+ if attributes.key?(:'account')
63
+ self.account = attributes[:'account']
64
+ end
65
+
66
+ if attributes.key?(:'pwd')
67
+ self.pwd = attributes[:'pwd']
68
+ end
69
+
70
+ if attributes.key?(:'keep_login')
71
+ self.keep_login = attributes[:'keep_login']
72
+ else
73
+ self.keep_login = false
74
+ end
75
+ end
76
+
77
+ # Show invalid properties with the reasons. Usually used together with valid?
78
+ # @return Array for valid properties with the reasons
79
+ def list_invalid_properties
80
+ invalid_properties = Array.new
81
+ if @account.nil?
82
+ invalid_properties.push('invalid value for "account", account cannot be nil.')
83
+ end
84
+
85
+ if @pwd.nil?
86
+ invalid_properties.push('invalid value for "pwd", pwd cannot be nil.')
87
+ end
88
+
89
+ invalid_properties
90
+ end
91
+
92
+ # Check to see if the all the properties in the model are valid
93
+ # @return true if the model is valid
94
+ def valid?
95
+ return false if @account.nil?
96
+ return false if @pwd.nil?
97
+ true
98
+ end
99
+
100
+ # Checks equality by comparing each attribute.
101
+ # @param [Object] Object to be compared
102
+ def ==(o)
103
+ return true if self.equal?(o)
104
+ self.class == o.class &&
105
+ account == o.account &&
106
+ pwd == o.pwd &&
107
+ keep_login == o.keep_login
108
+ end
109
+
110
+ # @see the `==` method
111
+ # @param [Object] Object to be compared
112
+ def eql?(o)
113
+ self == o
114
+ end
115
+
116
+ # Calculates hash code according to all attributes.
117
+ # @return [Integer] Hash code
118
+ def hash
119
+ [account, pwd, keep_login].hash
120
+ end
121
+
122
+ # Builds the object from hash
123
+ # @param [Hash] attributes Model attributes in the form of hash
124
+ # @return [Object] Returns the model itself
125
+ def self.build_from_hash(attributes)
126
+ new.build_from_hash(attributes)
127
+ end
128
+
129
+ # Builds the object from hash
130
+ # @param [Hash] attributes Model attributes in the form of hash
131
+ # @return [Object] Returns the model itself
132
+ def build_from_hash(attributes)
133
+ return nil unless attributes.is_a?(Hash)
134
+ self.class.openapi_types.each_pair do |key, type|
135
+ if type =~ /\AArray<(.*)>/i
136
+ # check to ensure the input is an array given that the attribute
137
+ # is documented as an array but the input is not
138
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
139
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
140
+ end
141
+ elsif !attributes[self.class.attribute_map[key]].nil?
142
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
143
+ elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
144
+ self.send("#{key}=", nil)
145
+ end
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
+ IndexeaClient.const_get(type).build_from_hash(value)
189
+ end
190
+ end
191
+
192
+ # Returns the string representation of the object
193
+ # @return [String] String presentation of the object
194
+ def to_s
195
+ to_hash.to_s
196
+ end
197
+
198
+ # to_body is an alias to to_hash (backward compatibility)
199
+ # @return [Hash] Returns the object in the form of hash
200
+ def to_body
201
+ to_hash
202
+ end
203
+
204
+ # Returns the object in the form of hash
205
+ # @return [Hash] Returns the object in the form of hash
206
+ def to_hash
207
+ hash = {}
208
+ self.class.attribute_map.each_pair do |attr, param|
209
+ value = self.send(attr)
210
+ if value.nil?
211
+ is_nullable = self.class.openapi_nullable.include?(attr)
212
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
213
+ end
214
+
215
+ hash[param] = _to_hash(value)
216
+ end
217
+ hash
218
+ end
219
+
220
+ # Outputs non-array value in the form of hash
221
+ # For object, use to_hash. Otherwise, just return the value
222
+ # @param [Object] value Any valid value
223
+ # @return [Hash] Returns the value in the form of hash
224
+ def _to_hash(value)
225
+ if value.is_a?(Array)
226
+ value.compact.map { |v| _to_hash(v) }
227
+ elsif value.is_a?(Hash)
228
+ {}.tap do |hash|
229
+ value.each { |k, v| hash[k] = _to_hash(v) }
230
+ end
231
+ elsif value.respond_to? :to_hash
232
+ value.to_hash
233
+ else
234
+ value
235
+ end
236
+ end end
237
+ end
@@ -0,0 +1,254 @@
1
+ =begin
2
+ #Indexea OpenAPI
3
+
4
+ #OpenAPI of Indexea
5
+
6
+ OpenAPI spec version: 1.0.0
7
+ Contact: indexea.com@gmail.com
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 3.0.54
10
+ =end
11
+
12
+ require 'date'
13
+
14
+ module IndexeaClient
15
+ # 注册表单
16
+ class AccountSignupBody
17
+ attr_accessor :account
18
+
19
+ attr_accessor :pwd
20
+
21
+ attr_accessor :name
22
+
23
+ attr_accessor :activate_code
24
+
25
+ # Attribute mapping from ruby-style variable name to JSON key.
26
+ def self.attribute_map
27
+ {
28
+ :'account' => :'account',
29
+ :'pwd' => :'pwd',
30
+ :'name' => :'name',
31
+ :'activate_code' => :'activate_code'
32
+ }
33
+ end
34
+
35
+ # Attribute type mapping.
36
+ def self.openapi_types
37
+ {
38
+ :'account' => :'Object',
39
+ :'pwd' => :'Object',
40
+ :'name' => :'Object',
41
+ :'activate_code' => :'Object'
42
+ }
43
+ end
44
+
45
+ # List of attributes with nullable: true
46
+ def self.openapi_nullable
47
+ Set.new([
48
+ ])
49
+ end
50
+
51
+ # Initializes the object
52
+ # @param [Hash] attributes Model attributes in the form of hash
53
+ def initialize(attributes = {})
54
+ if (!attributes.is_a?(Hash))
55
+ fail ArgumentError, "The input argument (attributes) must be a hash in `IndexeaClient::AccountSignupBody` initialize method"
56
+ end
57
+
58
+ # check to see if the attribute exists and convert string to symbol for hash key
59
+ attributes = attributes.each_with_object({}) { |(k, v), h|
60
+ if (!self.class.attribute_map.key?(k.to_sym))
61
+ fail ArgumentError, "`#{k}` is not a valid attribute in `IndexeaClient::AccountSignupBody`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
62
+ end
63
+ h[k.to_sym] = v
64
+ }
65
+
66
+ if attributes.key?(:'account')
67
+ self.account = attributes[:'account']
68
+ end
69
+
70
+ if attributes.key?(:'pwd')
71
+ self.pwd = attributes[:'pwd']
72
+ end
73
+
74
+ if attributes.key?(:'name')
75
+ self.name = attributes[:'name']
76
+ end
77
+
78
+ if attributes.key?(:'activate_code')
79
+ self.activate_code = attributes[:'activate_code']
80
+ end
81
+ end
82
+
83
+ # Show invalid properties with the reasons. Usually used together with valid?
84
+ # @return Array for valid properties with the reasons
85
+ def list_invalid_properties
86
+ invalid_properties = Array.new
87
+ if @account.nil?
88
+ invalid_properties.push('invalid value for "account", account cannot be nil.')
89
+ end
90
+
91
+ if @pwd.nil?
92
+ invalid_properties.push('invalid value for "pwd", pwd cannot be nil.')
93
+ end
94
+
95
+ if @name.nil?
96
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
97
+ end
98
+
99
+ if @activate_code.nil?
100
+ invalid_properties.push('invalid value for "activate_code", activate_code cannot be nil.')
101
+ end
102
+
103
+ invalid_properties
104
+ end
105
+
106
+ # Check to see if the all the properties in the model are valid
107
+ # @return true if the model is valid
108
+ def valid?
109
+ return false if @account.nil?
110
+ return false if @pwd.nil?
111
+ return false if @name.nil?
112
+ return false if @activate_code.nil?
113
+ true
114
+ end
115
+
116
+ # Checks equality by comparing each attribute.
117
+ # @param [Object] Object to be compared
118
+ def ==(o)
119
+ return true if self.equal?(o)
120
+ self.class == o.class &&
121
+ account == o.account &&
122
+ pwd == o.pwd &&
123
+ name == o.name &&
124
+ activate_code == o.activate_code
125
+ end
126
+
127
+ # @see the `==` method
128
+ # @param [Object] Object to be compared
129
+ def eql?(o)
130
+ self == o
131
+ end
132
+
133
+ # Calculates hash code according to all attributes.
134
+ # @return [Integer] Hash code
135
+ def hash
136
+ [account, pwd, name, activate_code].hash
137
+ end
138
+
139
+ # Builds the object from hash
140
+ # @param [Hash] attributes Model attributes in the form of hash
141
+ # @return [Object] Returns the model itself
142
+ def self.build_from_hash(attributes)
143
+ new.build_from_hash(attributes)
144
+ end
145
+
146
+ # Builds the object from hash
147
+ # @param [Hash] attributes Model attributes in the form of hash
148
+ # @return [Object] Returns the model itself
149
+ def build_from_hash(attributes)
150
+ return nil unless attributes.is_a?(Hash)
151
+ self.class.openapi_types.each_pair do |key, type|
152
+ if type =~ /\AArray<(.*)>/i
153
+ # check to ensure the input is an array given that the attribute
154
+ # is documented as an array but the input is not
155
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
156
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
157
+ end
158
+ elsif !attributes[self.class.attribute_map[key]].nil?
159
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
160
+ elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
161
+ self.send("#{key}=", nil)
162
+ end
163
+ end
164
+
165
+ self
166
+ end
167
+
168
+ # Deserializes the data based on type
169
+ # @param string type Data type
170
+ # @param string value Value to be deserialized
171
+ # @return [Object] Deserialized data
172
+ def _deserialize(type, value)
173
+ case type.to_sym
174
+ when :DateTime
175
+ DateTime.parse(value)
176
+ when :Date
177
+ Date.parse(value)
178
+ when :String
179
+ value.to_s
180
+ when :Integer
181
+ value.to_i
182
+ when :Float
183
+ value.to_f
184
+ when :Boolean
185
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
186
+ true
187
+ else
188
+ false
189
+ end
190
+ when :Object
191
+ # generic object (usually a Hash), return directly
192
+ value
193
+ when /\AArray<(?<inner_type>.+)>\z/
194
+ inner_type = Regexp.last_match[:inner_type]
195
+ value.map { |v| _deserialize(inner_type, v) }
196
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
197
+ k_type = Regexp.last_match[:k_type]
198
+ v_type = Regexp.last_match[:v_type]
199
+ {}.tap do |hash|
200
+ value.each do |k, v|
201
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
202
+ end
203
+ end
204
+ else # model
205
+ IndexeaClient.const_get(type).build_from_hash(value)
206
+ end
207
+ end
208
+
209
+ # Returns the string representation of the object
210
+ # @return [String] String presentation of the object
211
+ def to_s
212
+ to_hash.to_s
213
+ end
214
+
215
+ # to_body is an alias to to_hash (backward compatibility)
216
+ # @return [Hash] Returns the object in the form of hash
217
+ def to_body
218
+ to_hash
219
+ end
220
+
221
+ # Returns the object in the form of hash
222
+ # @return [Hash] Returns the object in the form of hash
223
+ def to_hash
224
+ hash = {}
225
+ self.class.attribute_map.each_pair do |attr, param|
226
+ value = self.send(attr)
227
+ if value.nil?
228
+ is_nullable = self.class.openapi_nullable.include?(attr)
229
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
230
+ end
231
+
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 end
254
+ end