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,387 @@
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
+ # UI组件详情
16
+ class WidgetBean
17
+ attr_accessor :id
18
+
19
+ attr_accessor :ident
20
+
21
+ attr_accessor :account
22
+
23
+ attr_accessor :app
24
+
25
+ attr_accessor :name
26
+
27
+ attr_accessor :type
28
+
29
+ attr_accessor :sub_type
30
+
31
+ attr_accessor :intro
32
+
33
+ attr_accessor :queries
34
+
35
+ # 组件布局
36
+ attr_accessor :layout
37
+
38
+ # 组件设置参数
39
+ attr_accessor :settings
40
+
41
+ attr_accessor :download_url
42
+
43
+ attr_accessor :created_at
44
+
45
+ attr_accessor :updated_at
46
+
47
+ attr_accessor :status
48
+
49
+ class EnumAttributeValidator
50
+ attr_reader :datatype
51
+ attr_reader :allowable_values
52
+
53
+ def initialize(datatype, allowable_values)
54
+ @allowable_values = allowable_values.map do |value|
55
+ case datatype.to_s
56
+ when /Integer/i
57
+ value.to_i
58
+ when /Float/i
59
+ value.to_f
60
+ else
61
+ value
62
+ end
63
+ end
64
+ end
65
+
66
+ def valid?(value)
67
+ !value || allowable_values.include?(value)
68
+ end
69
+ end
70
+
71
+ # Attribute mapping from ruby-style variable name to JSON key.
72
+ def self.attribute_map
73
+ {
74
+ :'id' => :'id',
75
+ :'ident' => :'ident',
76
+ :'account' => :'account',
77
+ :'app' => :'app',
78
+ :'name' => :'name',
79
+ :'type' => :'type',
80
+ :'sub_type' => :'sub_type',
81
+ :'intro' => :'intro',
82
+ :'queries' => :'queries',
83
+ :'layout' => :'layout',
84
+ :'settings' => :'settings',
85
+ :'download_url' => :'download_url',
86
+ :'created_at' => :'created_at',
87
+ :'updated_at' => :'updated_at',
88
+ :'status' => :'status'
89
+ }
90
+ end
91
+
92
+ # Attribute type mapping.
93
+ def self.openapi_types
94
+ {
95
+ :'id' => :'Object',
96
+ :'ident' => :'Object',
97
+ :'account' => :'Object',
98
+ :'app' => :'Object',
99
+ :'name' => :'Object',
100
+ :'type' => :'Object',
101
+ :'sub_type' => :'Object',
102
+ :'intro' => :'Object',
103
+ :'queries' => :'Object',
104
+ :'layout' => :'Object',
105
+ :'settings' => :'Object',
106
+ :'download_url' => :'Object',
107
+ :'created_at' => :'Object',
108
+ :'updated_at' => :'Object',
109
+ :'status' => :'Object'
110
+ }
111
+ end
112
+
113
+ # List of attributes with nullable: true
114
+ def self.openapi_nullable
115
+ Set.new([
116
+ ])
117
+ end
118
+
119
+ # Initializes the object
120
+ # @param [Hash] attributes Model attributes in the form of hash
121
+ def initialize(attributes = {})
122
+ if (!attributes.is_a?(Hash))
123
+ fail ArgumentError, "The input argument (attributes) must be a hash in `IndexeaClient::WidgetBean` initialize method"
124
+ end
125
+
126
+ # check to see if the attribute exists and convert string to symbol for hash key
127
+ attributes = attributes.each_with_object({}) { |(k, v), h|
128
+ if (!self.class.attribute_map.key?(k.to_sym))
129
+ fail ArgumentError, "`#{k}` is not a valid attribute in `IndexeaClient::WidgetBean`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
130
+ end
131
+ h[k.to_sym] = v
132
+ }
133
+
134
+ if attributes.key?(:'id')
135
+ self.id = attributes[:'id']
136
+ end
137
+
138
+ if attributes.key?(:'ident')
139
+ self.ident = attributes[:'ident']
140
+ end
141
+
142
+ if attributes.key?(:'account')
143
+ self.account = attributes[:'account']
144
+ end
145
+
146
+ if attributes.key?(:'app')
147
+ self.app = attributes[:'app']
148
+ end
149
+
150
+ if attributes.key?(:'name')
151
+ self.name = attributes[:'name']
152
+ end
153
+
154
+ if attributes.key?(:'type')
155
+ self.type = attributes[:'type']
156
+ else
157
+ self.type = 'web'
158
+ end
159
+
160
+ if attributes.key?(:'sub_type')
161
+ self.sub_type = attributes[:'sub_type']
162
+ else
163
+ self.sub_type = 'None'
164
+ end
165
+
166
+ if attributes.key?(:'intro')
167
+ self.intro = attributes[:'intro']
168
+ end
169
+
170
+ if attributes.key?(:'queries')
171
+ if (value = attributes[:'queries']).is_a?(Array)
172
+ self.queries = value
173
+ end
174
+ end
175
+
176
+ if attributes.key?(:'layout')
177
+ self.layout = attributes[:'layout']
178
+ end
179
+
180
+ if attributes.key?(:'settings')
181
+ self.settings = attributes[:'settings']
182
+ end
183
+
184
+ if attributes.key?(:'download_url')
185
+ self.download_url = attributes[:'download_url']
186
+ end
187
+
188
+ if attributes.key?(:'created_at')
189
+ self.created_at = attributes[:'created_at']
190
+ end
191
+
192
+ if attributes.key?(:'updated_at')
193
+ self.updated_at = attributes[:'updated_at']
194
+ end
195
+
196
+ if attributes.key?(:'status')
197
+ self.status = attributes[:'status']
198
+ end
199
+ end
200
+
201
+ # Show invalid properties with the reasons. Usually used together with valid?
202
+ # @return Array for valid properties with the reasons
203
+ def list_invalid_properties
204
+ invalid_properties = Array.new
205
+ invalid_properties
206
+ end
207
+
208
+ # Check to see if the all the properties in the model are valid
209
+ # @return true if the model is valid
210
+ def valid?
211
+ type_validator = EnumAttributeValidator.new('Object', ['web', 'mobile', 'desktop', 'widget'])
212
+ return false unless type_validator.valid?(@type)
213
+ sub_type_validator = EnumAttributeValidator.new('Object', ['None', 'SearchBox', 'SearchDialog', 'QueryBox'])
214
+ return false unless sub_type_validator.valid?(@sub_type)
215
+ true
216
+ end
217
+
218
+ # Custom attribute writer method checking allowed values (enum).
219
+ # @param [Object] type Object to be assigned
220
+ def type=(type)
221
+ validator = EnumAttributeValidator.new('Object', ['web', 'mobile', 'desktop', 'widget'])
222
+ unless validator.valid?(type)
223
+ fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
224
+ end
225
+ @type = type
226
+ end
227
+
228
+ # Custom attribute writer method checking allowed values (enum).
229
+ # @param [Object] sub_type Object to be assigned
230
+ def sub_type=(sub_type)
231
+ validator = EnumAttributeValidator.new('Object', ['None', 'SearchBox', 'SearchDialog', 'QueryBox'])
232
+ unless validator.valid?(sub_type)
233
+ fail ArgumentError, "invalid value for \"sub_type\", must be one of #{validator.allowable_values}."
234
+ end
235
+ @sub_type = sub_type
236
+ end
237
+
238
+ # Checks equality by comparing each attribute.
239
+ # @param [Object] Object to be compared
240
+ def ==(o)
241
+ return true if self.equal?(o)
242
+ self.class == o.class &&
243
+ id == o.id &&
244
+ ident == o.ident &&
245
+ account == o.account &&
246
+ app == o.app &&
247
+ name == o.name &&
248
+ type == o.type &&
249
+ sub_type == o.sub_type &&
250
+ intro == o.intro &&
251
+ queries == o.queries &&
252
+ layout == o.layout &&
253
+ settings == o.settings &&
254
+ download_url == o.download_url &&
255
+ created_at == o.created_at &&
256
+ updated_at == o.updated_at &&
257
+ status == o.status
258
+ end
259
+
260
+ # @see the `==` method
261
+ # @param [Object] Object to be compared
262
+ def eql?(o)
263
+ self == o
264
+ end
265
+
266
+ # Calculates hash code according to all attributes.
267
+ # @return [Integer] Hash code
268
+ def hash
269
+ [id, ident, account, app, name, type, sub_type, intro, queries, layout, settings, download_url, created_at, updated_at, status].hash
270
+ end
271
+
272
+ # Builds the object from hash
273
+ # @param [Hash] attributes Model attributes in the form of hash
274
+ # @return [Object] Returns the model itself
275
+ def self.build_from_hash(attributes)
276
+ new.build_from_hash(attributes)
277
+ end
278
+
279
+ # Builds the object from hash
280
+ # @param [Hash] attributes Model attributes in the form of hash
281
+ # @return [Object] Returns the model itself
282
+ def build_from_hash(attributes)
283
+ return nil unless attributes.is_a?(Hash)
284
+ self.class.openapi_types.each_pair do |key, type|
285
+ if type =~ /\AArray<(.*)>/i
286
+ # check to ensure the input is an array given that the attribute
287
+ # is documented as an array but the input is not
288
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
289
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
290
+ end
291
+ elsif !attributes[self.class.attribute_map[key]].nil?
292
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
293
+ elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
294
+ self.send("#{key}=", nil)
295
+ end
296
+ end
297
+
298
+ self
299
+ end
300
+
301
+ # Deserializes the data based on type
302
+ # @param string type Data type
303
+ # @param string value Value to be deserialized
304
+ # @return [Object] Deserialized data
305
+ def _deserialize(type, value)
306
+ case type.to_sym
307
+ when :DateTime
308
+ DateTime.parse(value)
309
+ when :Date
310
+ Date.parse(value)
311
+ when :String
312
+ value.to_s
313
+ when :Integer
314
+ value.to_i
315
+ when :Float
316
+ value.to_f
317
+ when :Boolean
318
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
319
+ true
320
+ else
321
+ false
322
+ end
323
+ when :Object
324
+ # generic object (usually a Hash), return directly
325
+ value
326
+ when /\AArray<(?<inner_type>.+)>\z/
327
+ inner_type = Regexp.last_match[:inner_type]
328
+ value.map { |v| _deserialize(inner_type, v) }
329
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
330
+ k_type = Regexp.last_match[:k_type]
331
+ v_type = Regexp.last_match[:v_type]
332
+ {}.tap do |hash|
333
+ value.each do |k, v|
334
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
335
+ end
336
+ end
337
+ else # model
338
+ IndexeaClient.const_get(type).build_from_hash(value)
339
+ end
340
+ end
341
+
342
+ # Returns the string representation of the object
343
+ # @return [String] String presentation of the object
344
+ def to_s
345
+ to_hash.to_s
346
+ end
347
+
348
+ # to_body is an alias to to_hash (backward compatibility)
349
+ # @return [Hash] Returns the object in the form of hash
350
+ def to_body
351
+ to_hash
352
+ end
353
+
354
+ # Returns the object in the form of hash
355
+ # @return [Hash] Returns the object in the form of hash
356
+ def to_hash
357
+ hash = {}
358
+ self.class.attribute_map.each_pair do |attr, param|
359
+ value = self.send(attr)
360
+ if value.nil?
361
+ is_nullable = self.class.openapi_nullable.include?(attr)
362
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
363
+ end
364
+
365
+ hash[param] = _to_hash(value)
366
+ end
367
+ hash
368
+ end
369
+
370
+ # Outputs non-array value in the form of hash
371
+ # For object, use to_hash. Otherwise, just return the value
372
+ # @param [Object] value Any valid value
373
+ # @return [Hash] Returns the value in the form of hash
374
+ def _to_hash(value)
375
+ if value.is_a?(Array)
376
+ value.compact.map { |v| _to_hash(v) }
377
+ elsif value.is_a?(Hash)
378
+ {}.tap do |hash|
379
+ value.each { |k, v| hash[k] = _to_hash(v) }
380
+ end
381
+ elsif value.respond_to? :to_hash
382
+ value.to_hash
383
+ else
384
+ value
385
+ end
386
+ end end
387
+ end
@@ -0,0 +1,328 @@
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
+ # UI组件表单
16
+ class WidgetForm
17
+ attr_accessor :name
18
+
19
+ attr_accessor :type
20
+
21
+ attr_accessor :sub_type
22
+
23
+ attr_accessor :intro
24
+
25
+ attr_accessor :queries
26
+
27
+ attr_accessor :layout
28
+
29
+ attr_accessor :status
30
+
31
+ class EnumAttributeValidator
32
+ attr_reader :datatype
33
+ attr_reader :allowable_values
34
+
35
+ def initialize(datatype, allowable_values)
36
+ @allowable_values = allowable_values.map do |value|
37
+ case datatype.to_s
38
+ when /Integer/i
39
+ value.to_i
40
+ when /Float/i
41
+ value.to_f
42
+ else
43
+ value
44
+ end
45
+ end
46
+ end
47
+
48
+ def valid?(value)
49
+ !value || allowable_values.include?(value)
50
+ end
51
+ end
52
+
53
+ # Attribute mapping from ruby-style variable name to JSON key.
54
+ def self.attribute_map
55
+ {
56
+ :'name' => :'name',
57
+ :'type' => :'type',
58
+ :'sub_type' => :'sub_type',
59
+ :'intro' => :'intro',
60
+ :'queries' => :'queries',
61
+ :'layout' => :'layout',
62
+ :'status' => :'status'
63
+ }
64
+ end
65
+
66
+ # Attribute type mapping.
67
+ def self.openapi_types
68
+ {
69
+ :'name' => :'Object',
70
+ :'type' => :'Object',
71
+ :'sub_type' => :'Object',
72
+ :'intro' => :'Object',
73
+ :'queries' => :'Object',
74
+ :'layout' => :'Object',
75
+ :'status' => :'Object'
76
+ }
77
+ end
78
+
79
+ # List of attributes with nullable: true
80
+ def self.openapi_nullable
81
+ Set.new([
82
+ ])
83
+ end
84
+
85
+ # Initializes the object
86
+ # @param [Hash] attributes Model attributes in the form of hash
87
+ def initialize(attributes = {})
88
+ if (!attributes.is_a?(Hash))
89
+ fail ArgumentError, "The input argument (attributes) must be a hash in `IndexeaClient::WidgetForm` initialize method"
90
+ end
91
+
92
+ # check to see if the attribute exists and convert string to symbol for hash key
93
+ attributes = attributes.each_with_object({}) { |(k, v), h|
94
+ if (!self.class.attribute_map.key?(k.to_sym))
95
+ fail ArgumentError, "`#{k}` is not a valid attribute in `IndexeaClient::WidgetForm`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
96
+ end
97
+ h[k.to_sym] = v
98
+ }
99
+
100
+ if attributes.key?(:'name')
101
+ self.name = attributes[:'name']
102
+ end
103
+
104
+ if attributes.key?(:'type')
105
+ self.type = attributes[:'type']
106
+ else
107
+ self.type = 'web'
108
+ end
109
+
110
+ if attributes.key?(:'sub_type')
111
+ self.sub_type = attributes[:'sub_type']
112
+ else
113
+ self.sub_type = 'None'
114
+ end
115
+
116
+ if attributes.key?(:'intro')
117
+ self.intro = attributes[:'intro']
118
+ end
119
+
120
+ if attributes.key?(:'queries')
121
+ if (value = attributes[:'queries']).is_a?(Array)
122
+ self.queries = value
123
+ end
124
+ end
125
+
126
+ if attributes.key?(:'layout')
127
+ self.layout = attributes[:'layout']
128
+ end
129
+
130
+ if attributes.key?(:'status')
131
+ self.status = attributes[:'status']
132
+ end
133
+ end
134
+
135
+ # Show invalid properties with the reasons. Usually used together with valid?
136
+ # @return Array for valid properties with the reasons
137
+ def list_invalid_properties
138
+ invalid_properties = Array.new
139
+ if @name.nil?
140
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
141
+ end
142
+
143
+ if @type.nil?
144
+ invalid_properties.push('invalid value for "type", type cannot be nil.')
145
+ end
146
+
147
+ if @queries.nil?
148
+ invalid_properties.push('invalid value for "queries", queries cannot be nil.')
149
+ end
150
+
151
+ invalid_properties
152
+ end
153
+
154
+ # Check to see if the all the properties in the model are valid
155
+ # @return true if the model is valid
156
+ def valid?
157
+ return false if @name.nil?
158
+ return false if @type.nil?
159
+ type_validator = EnumAttributeValidator.new('Object', ['web', 'mobile', 'desktop', 'widget'])
160
+ return false unless type_validator.valid?(@type)
161
+ sub_type_validator = EnumAttributeValidator.new('Object', ['None', 'SearchBox', 'SearchDialog', 'QueryBox'])
162
+ return false unless sub_type_validator.valid?(@sub_type)
163
+ return false if @queries.nil?
164
+ true
165
+ end
166
+
167
+ # Custom attribute writer method checking allowed values (enum).
168
+ # @param [Object] type Object to be assigned
169
+ def type=(type)
170
+ validator = EnumAttributeValidator.new('Object', ['web', 'mobile', 'desktop', 'widget'])
171
+ unless validator.valid?(type)
172
+ fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
173
+ end
174
+ @type = type
175
+ end
176
+
177
+ # Custom attribute writer method checking allowed values (enum).
178
+ # @param [Object] sub_type Object to be assigned
179
+ def sub_type=(sub_type)
180
+ validator = EnumAttributeValidator.new('Object', ['None', 'SearchBox', 'SearchDialog', 'QueryBox'])
181
+ unless validator.valid?(sub_type)
182
+ fail ArgumentError, "invalid value for \"sub_type\", must be one of #{validator.allowable_values}."
183
+ end
184
+ @sub_type = sub_type
185
+ end
186
+
187
+ # Checks equality by comparing each attribute.
188
+ # @param [Object] Object to be compared
189
+ def ==(o)
190
+ return true if self.equal?(o)
191
+ self.class == o.class &&
192
+ name == o.name &&
193
+ type == o.type &&
194
+ sub_type == o.sub_type &&
195
+ intro == o.intro &&
196
+ queries == o.queries &&
197
+ layout == o.layout &&
198
+ status == o.status
199
+ end
200
+
201
+ # @see the `==` method
202
+ # @param [Object] Object to be compared
203
+ def eql?(o)
204
+ self == o
205
+ end
206
+
207
+ # Calculates hash code according to all attributes.
208
+ # @return [Integer] Hash code
209
+ def hash
210
+ [name, type, sub_type, intro, queries, layout, status].hash
211
+ end
212
+
213
+ # Builds the object from hash
214
+ # @param [Hash] attributes Model attributes in the form of hash
215
+ # @return [Object] Returns the model itself
216
+ def self.build_from_hash(attributes)
217
+ new.build_from_hash(attributes)
218
+ end
219
+
220
+ # Builds the object from hash
221
+ # @param [Hash] attributes Model attributes in the form of hash
222
+ # @return [Object] Returns the model itself
223
+ def build_from_hash(attributes)
224
+ return nil unless attributes.is_a?(Hash)
225
+ self.class.openapi_types.each_pair do |key, type|
226
+ if type =~ /\AArray<(.*)>/i
227
+ # check to ensure the input is an array given that the attribute
228
+ # is documented as an array but the input is not
229
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
230
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
231
+ end
232
+ elsif !attributes[self.class.attribute_map[key]].nil?
233
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
234
+ elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
235
+ self.send("#{key}=", nil)
236
+ end
237
+ end
238
+
239
+ self
240
+ end
241
+
242
+ # Deserializes the data based on type
243
+ # @param string type Data type
244
+ # @param string value Value to be deserialized
245
+ # @return [Object] Deserialized data
246
+ def _deserialize(type, value)
247
+ case type.to_sym
248
+ when :DateTime
249
+ DateTime.parse(value)
250
+ when :Date
251
+ Date.parse(value)
252
+ when :String
253
+ value.to_s
254
+ when :Integer
255
+ value.to_i
256
+ when :Float
257
+ value.to_f
258
+ when :Boolean
259
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
260
+ true
261
+ else
262
+ false
263
+ end
264
+ when :Object
265
+ # generic object (usually a Hash), return directly
266
+ value
267
+ when /\AArray<(?<inner_type>.+)>\z/
268
+ inner_type = Regexp.last_match[:inner_type]
269
+ value.map { |v| _deserialize(inner_type, v) }
270
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
271
+ k_type = Regexp.last_match[:k_type]
272
+ v_type = Regexp.last_match[:v_type]
273
+ {}.tap do |hash|
274
+ value.each do |k, v|
275
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
276
+ end
277
+ end
278
+ else # model
279
+ IndexeaClient.const_get(type).build_from_hash(value)
280
+ end
281
+ end
282
+
283
+ # Returns the string representation of the object
284
+ # @return [String] String presentation of the object
285
+ def to_s
286
+ to_hash.to_s
287
+ end
288
+
289
+ # to_body is an alias to to_hash (backward compatibility)
290
+ # @return [Hash] Returns the object in the form of hash
291
+ def to_body
292
+ to_hash
293
+ end
294
+
295
+ # Returns the object in the form of hash
296
+ # @return [Hash] Returns the object in the form of hash
297
+ def to_hash
298
+ hash = {}
299
+ self.class.attribute_map.each_pair do |attr, param|
300
+ value = self.send(attr)
301
+ if value.nil?
302
+ is_nullable = self.class.openapi_nullable.include?(attr)
303
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
304
+ end
305
+
306
+ hash[param] = _to_hash(value)
307
+ end
308
+ hash
309
+ end
310
+
311
+ # Outputs non-array value in the form of hash
312
+ # For object, use to_hash. Otherwise, just return the value
313
+ # @param [Object] value Any valid value
314
+ # @return [Hash] Returns the value in the form of hash
315
+ def _to_hash(value)
316
+ if value.is_a?(Array)
317
+ value.compact.map { |v| _to_hash(v) }
318
+ elsif value.is_a?(Hash)
319
+ {}.tap do |hash|
320
+ value.each { |k, v| hash[k] = _to_hash(v) }
321
+ end
322
+ elsif value.respond_to? :to_hash
323
+ value.to_hash
324
+ else
325
+ value
326
+ end
327
+ end end
328
+ end