rankvectors 1.0.0

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 (157) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/README.md +191 -0
  4. data/Rakefile +10 -0
  5. data/docs/AddCredits200Response.md +22 -0
  6. data/docs/AddCreditsRequest.md +20 -0
  7. data/docs/AutoRechargeSettings.md +22 -0
  8. data/docs/ChangeResult.md +24 -0
  9. data/docs/ContentVerification.md +22 -0
  10. data/docs/ContentVerificationApi.md +81 -0
  11. data/docs/Crawl.md +30 -0
  12. data/docs/CrawlingApi.md +155 -0
  13. data/docs/CreateProjectRequest.md +60 -0
  14. data/docs/CreditBalance.md +30 -0
  15. data/docs/CreditBalanceInfo.md +26 -0
  16. data/docs/CreditsApi.md +161 -0
  17. data/docs/CustomCredentials.md +20 -0
  18. data/docs/DeleteProject200Response.md +20 -0
  19. data/docs/Error.md +24 -0
  20. data/docs/GenerateSuggestions200Response.md +22 -0
  21. data/docs/GenerateSuggestionsRequest.md +18 -0
  22. data/docs/GetImplementation200Response.md +20 -0
  23. data/docs/Implementation.md +36 -0
  24. data/docs/ImplementationInstructions.md +28 -0
  25. data/docs/ImplementationRequest.md +26 -0
  26. data/docs/ImplementationResponse.md +22 -0
  27. data/docs/ImplementationResult.md +24 -0
  28. data/docs/ImplementationSummary.md +24 -0
  29. data/docs/ImplementationsApi.md +313 -0
  30. data/docs/LinkOpportunity.md +28 -0
  31. data/docs/ListImplementations200Response.md +24 -0
  32. data/docs/PageInfo.md +24 -0
  33. data/docs/PageLimitStatus.md +22 -0
  34. data/docs/PeriodCharges.md +22 -0
  35. data/docs/Project.md +70 -0
  36. data/docs/ProjectCount.md +20 -0
  37. data/docs/ProjectsApi.md +292 -0
  38. data/docs/ReportImplementationStatus200Response.md +20 -0
  39. data/docs/ReportImplementationStatusRequest.md +22 -0
  40. data/docs/Rollback.md +24 -0
  41. data/docs/RollbackImplementation200Response.md +22 -0
  42. data/docs/RollbackImplementationRequest.md +20 -0
  43. data/docs/SpendingLimitStatus.md +24 -0
  44. data/docs/StartCrawlRequest.md +18 -0
  45. data/docs/StepByStepInstructions.md +20 -0
  46. data/docs/Suggestion.md +38 -0
  47. data/docs/SuggestionsApi.md +235 -0
  48. data/docs/UpdateSuggestionRequest.md +18 -0
  49. data/docs/UsageHistoryItem.md +26 -0
  50. data/docs/VerifyContent200Response.md +20 -0
  51. data/docs/VerifyContentRequest.md +20 -0
  52. data/docs/WebhooksApi.md +151 -0
  53. data/git_push.sh +57 -0
  54. data/lib/openapi_client/api/content_verification_api.rb +96 -0
  55. data/lib/openapi_client/api/crawling_api.rb +155 -0
  56. data/lib/openapi_client/api/credits_api.rb +168 -0
  57. data/lib/openapi_client/api/implementations_api.rb +332 -0
  58. data/lib/openapi_client/api/projects_api.rb +273 -0
  59. data/lib/openapi_client/api/suggestions_api.rb +242 -0
  60. data/lib/openapi_client/api/webhooks_api.rb +154 -0
  61. data/lib/openapi_client/api_client.rb +393 -0
  62. data/lib/openapi_client/api_error.rb +58 -0
  63. data/lib/openapi_client/configuration.rb +316 -0
  64. data/lib/openapi_client/models/add_credits200_response.rb +238 -0
  65. data/lib/openapi_client/models/add_credits_request.rb +259 -0
  66. data/lib/openapi_client/models/auto_recharge_settings.rb +292 -0
  67. data/lib/openapi_client/models/change_result.rb +328 -0
  68. data/lib/openapi_client/models/content_verification.rb +274 -0
  69. data/lib/openapi_client/models/crawl.rb +373 -0
  70. data/lib/openapi_client/models/create_project_request.rb +541 -0
  71. data/lib/openapi_client/models/credit_balance.rb +379 -0
  72. data/lib/openapi_client/models/credit_balance_info.rb +329 -0
  73. data/lib/openapi_client/models/custom_credentials.rb +265 -0
  74. data/lib/openapi_client/models/delete_project200_response.rb +229 -0
  75. data/lib/openapi_client/models/error.rb +268 -0
  76. data/lib/openapi_client/models/generate_suggestions200_response.rb +261 -0
  77. data/lib/openapi_client/models/generate_suggestions_request.rb +249 -0
  78. data/lib/openapi_client/models/get_implementation200_response.rb +229 -0
  79. data/lib/openapi_client/models/implementation.rb +454 -0
  80. data/lib/openapi_client/models/implementation_instructions.rb +372 -0
  81. data/lib/openapi_client/models/implementation_request.rb +362 -0
  82. data/lib/openapi_client/models/implementation_response.rb +293 -0
  83. data/lib/openapi_client/models/implementation_result.rb +268 -0
  84. data/lib/openapi_client/models/implementation_summary.rb +319 -0
  85. data/lib/openapi_client/models/link_opportunity.rb +355 -0
  86. data/lib/openapi_client/models/list_implementations200_response.rb +251 -0
  87. data/lib/openapi_client/models/page_info.rb +285 -0
  88. data/lib/openapi_client/models/page_limit_status.rb +292 -0
  89. data/lib/openapi_client/models/period_charges.rb +292 -0
  90. data/lib/openapi_client/models/project.rb +634 -0
  91. data/lib/openapi_client/models/project_count.rb +230 -0
  92. data/lib/openapi_client/models/report_implementation_status200_response.rb +229 -0
  93. data/lib/openapi_client/models/report_implementation_status_request.rb +316 -0
  94. data/lib/openapi_client/models/rollback.rb +302 -0
  95. data/lib/openapi_client/models/rollback_implementation200_response.rb +239 -0
  96. data/lib/openapi_client/models/rollback_implementation_request.rb +247 -0
  97. data/lib/openapi_client/models/spending_limit_status.rb +319 -0
  98. data/lib/openapi_client/models/start_crawl_request.rb +249 -0
  99. data/lib/openapi_client/models/step_by_step_instructions.rb +267 -0
  100. data/lib/openapi_client/models/suggestion.rb +497 -0
  101. data/lib/openapi_client/models/update_suggestion_request.rb +262 -0
  102. data/lib/openapi_client/models/usage_history_item.rb +331 -0
  103. data/lib/openapi_client/models/verify_content200_response.rb +229 -0
  104. data/lib/openapi_client/models/verify_content_request.rb +265 -0
  105. data/lib/openapi_client/version.rb +15 -0
  106. data/lib/openapi_client.rb +87 -0
  107. data/openapi_client.gemspec +39 -0
  108. data/spec/api/content_verification_api_spec.rb +48 -0
  109. data/spec/api/crawling_api_spec.rb +60 -0
  110. data/spec/api/credits_api_spec.rb +63 -0
  111. data/spec/api/implementations_api_spec.rb +91 -0
  112. data/spec/api/projects_api_spec.rb +82 -0
  113. data/spec/api/suggestions_api_spec.rb +75 -0
  114. data/spec/api/webhooks_api_spec.rb +59 -0
  115. data/spec/models/add_credits200_response_spec.rb +48 -0
  116. data/spec/models/add_credits_request_spec.rb +42 -0
  117. data/spec/models/auto_recharge_settings_spec.rb +48 -0
  118. data/spec/models/change_result_spec.rb +62 -0
  119. data/spec/models/content_verification_spec.rb +48 -0
  120. data/spec/models/crawl_spec.rb +76 -0
  121. data/spec/models/create_project_request_spec.rb +170 -0
  122. data/spec/models/credit_balance_info_spec.rb +60 -0
  123. data/spec/models/credit_balance_spec.rb +72 -0
  124. data/spec/models/custom_credentials_spec.rb +42 -0
  125. data/spec/models/delete_project200_response_spec.rb +42 -0
  126. data/spec/models/error_spec.rb +54 -0
  127. data/spec/models/generate_suggestions200_response_spec.rb +48 -0
  128. data/spec/models/generate_suggestions_request_spec.rb +36 -0
  129. data/spec/models/get_implementation200_response_spec.rb +42 -0
  130. data/spec/models/implementation_instructions_spec.rb +66 -0
  131. data/spec/models/implementation_request_spec.rb +68 -0
  132. data/spec/models/implementation_response_spec.rb +48 -0
  133. data/spec/models/implementation_result_spec.rb +54 -0
  134. data/spec/models/implementation_spec.rb +102 -0
  135. data/spec/models/implementation_summary_spec.rb +54 -0
  136. data/spec/models/link_opportunity_spec.rb +66 -0
  137. data/spec/models/list_implementations200_response_spec.rb +54 -0
  138. data/spec/models/page_info_spec.rb +54 -0
  139. data/spec/models/page_limit_status_spec.rb +48 -0
  140. data/spec/models/period_charges_spec.rb +48 -0
  141. data/spec/models/project_count_spec.rb +42 -0
  142. data/spec/models/project_spec.rb +200 -0
  143. data/spec/models/report_implementation_status200_response_spec.rb +42 -0
  144. data/spec/models/report_implementation_status_request_spec.rb +52 -0
  145. data/spec/models/rollback_implementation200_response_spec.rb +48 -0
  146. data/spec/models/rollback_implementation_request_spec.rb +42 -0
  147. data/spec/models/rollback_spec.rb +54 -0
  148. data/spec/models/spending_limit_status_spec.rb +54 -0
  149. data/spec/models/start_crawl_request_spec.rb +36 -0
  150. data/spec/models/step_by_step_instructions_spec.rb +42 -0
  151. data/spec/models/suggestion_spec.rb +100 -0
  152. data/spec/models/update_suggestion_request_spec.rb +40 -0
  153. data/spec/models/usage_history_item_spec.rb +60 -0
  154. data/spec/models/verify_content200_response_spec.rb +42 -0
  155. data/spec/models/verify_content_request_spec.rb +42 -0
  156. data/spec/spec_helper.rb +111 -0
  157. metadata +288 -0
@@ -0,0 +1,541 @@
1
+ =begin
2
+ #RankVectors API
3
+
4
+ #Intelligent internal linking optimization API using AI. RankVectors helps you automatically discover and implement optimal internal links across your website to improve SEO performance and user experience. ## Key Features - **AI-Powered Analysis**: Uses OpenAI embeddings to find optimal linking opportunities - **Smart Crawling**: Automatically crawls and analyzes your website content - **Automated Implementation**: Implement links via webhooks or manual instructions - **Credit-Based System**: Pay-per-use model with transparent pricing - **Multi-Platform Support**: Works with any CMS or platform via REST API ## Getting Started 1. Create a project with your website URL 2. Start a crawl to analyze your content 3. Generate AI-powered link suggestions 4. Implement suggestions via API or webhook 5. Track performance and manage credits ## Authentication All API endpoints require authentication using your RankVectors API key. Include your API key in the `Authorization` header: ``` Authorization: Bearer YOUR_API_KEY ``` Get your API key from your RankVectors dashboard: Settings → API Keys
5
+
6
+ The version of the OpenAPI document: 1.2.0
7
+ Contact: support@rankvectors.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.16.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module OpenapiClient
17
+ class CreateProjectRequest
18
+ # Project name
19
+ attr_accessor :name
20
+
21
+ # Website domain URL
22
+ attr_accessor :domain
23
+
24
+ # Natural language prompt for crawling
25
+ attr_accessor :prompt
26
+
27
+ # Search query for targeted crawling
28
+ attr_accessor :search_query
29
+
30
+ # How to handle sitemaps
31
+ attr_accessor :sitemap_mode
32
+
33
+ # Whether to include subdomains
34
+ attr_accessor :include_subdomains
35
+
36
+ # Whether to ignore URL query parameters
37
+ attr_accessor :ignore_query_params
38
+
39
+ # Maximum crawl depth
40
+ attr_accessor :max_discovery_depth
41
+
42
+ # Paths to exclude from crawling
43
+ attr_accessor :exclude_paths
44
+
45
+ # Specific paths to include
46
+ attr_accessor :include_paths
47
+
48
+ # Whether to crawl the entire domain
49
+ attr_accessor :crawl_entire_domain
50
+
51
+ # Whether to allow external links
52
+ attr_accessor :allow_external_links
53
+
54
+ # Maximum number of pages to crawl
55
+ attr_accessor :max_pages
56
+
57
+ # Delay between crawl requests (ms)
58
+ attr_accessor :crawl_delay
59
+
60
+ # Maximum concurrent crawl requests
61
+ attr_accessor :crawl_max_concurrency
62
+
63
+ # Whether to extract only main content
64
+ attr_accessor :only_main_content
65
+
66
+ # Custom headers for crawling
67
+ attr_accessor :custom_headers
68
+
69
+ # Wait time for page load (ms)
70
+ attr_accessor :wait_for
71
+
72
+ # Whether to block ads
73
+ attr_accessor :block_ads
74
+
75
+ # Proxy mode for crawling
76
+ attr_accessor :proxy_mode
77
+
78
+ # Whether to use AI reranking
79
+ attr_accessor :use_reranking
80
+
81
+ # Whether to enable change tracking
82
+ attr_accessor :enable_change_tracking
83
+
84
+ class EnumAttributeValidator
85
+ attr_reader :datatype
86
+ attr_reader :allowable_values
87
+
88
+ def initialize(datatype, allowable_values)
89
+ @allowable_values = allowable_values.map do |value|
90
+ case datatype.to_s
91
+ when /Integer/i
92
+ value.to_i
93
+ when /Float/i
94
+ value.to_f
95
+ else
96
+ value
97
+ end
98
+ end
99
+ end
100
+
101
+ def valid?(value)
102
+ !value || allowable_values.include?(value)
103
+ end
104
+ end
105
+
106
+ # Attribute mapping from ruby-style variable name to JSON key.
107
+ def self.attribute_map
108
+ {
109
+ :'name' => :'name',
110
+ :'domain' => :'domain',
111
+ :'prompt' => :'prompt',
112
+ :'search_query' => :'searchQuery',
113
+ :'sitemap_mode' => :'sitemapMode',
114
+ :'include_subdomains' => :'includeSubdomains',
115
+ :'ignore_query_params' => :'ignoreQueryParams',
116
+ :'max_discovery_depth' => :'maxDiscoveryDepth',
117
+ :'exclude_paths' => :'excludePaths',
118
+ :'include_paths' => :'includePaths',
119
+ :'crawl_entire_domain' => :'crawlEntireDomain',
120
+ :'allow_external_links' => :'allowExternalLinks',
121
+ :'max_pages' => :'maxPages',
122
+ :'crawl_delay' => :'crawlDelay',
123
+ :'crawl_max_concurrency' => :'crawlMaxConcurrency',
124
+ :'only_main_content' => :'onlyMainContent',
125
+ :'custom_headers' => :'customHeaders',
126
+ :'wait_for' => :'waitFor',
127
+ :'block_ads' => :'blockAds',
128
+ :'proxy_mode' => :'proxyMode',
129
+ :'use_reranking' => :'useReranking',
130
+ :'enable_change_tracking' => :'enableChangeTracking'
131
+ }
132
+ end
133
+
134
+ # Returns attribute mapping this model knows about
135
+ def self.acceptable_attribute_map
136
+ attribute_map
137
+ end
138
+
139
+ # Returns all the JSON keys this model knows about
140
+ def self.acceptable_attributes
141
+ acceptable_attribute_map.values
142
+ end
143
+
144
+ # Attribute type mapping.
145
+ def self.openapi_types
146
+ {
147
+ :'name' => :'String',
148
+ :'domain' => :'String',
149
+ :'prompt' => :'String',
150
+ :'search_query' => :'String',
151
+ :'sitemap_mode' => :'String',
152
+ :'include_subdomains' => :'Boolean',
153
+ :'ignore_query_params' => :'Boolean',
154
+ :'max_discovery_depth' => :'Integer',
155
+ :'exclude_paths' => :'Array<String>',
156
+ :'include_paths' => :'Array<String>',
157
+ :'crawl_entire_domain' => :'Boolean',
158
+ :'allow_external_links' => :'Boolean',
159
+ :'max_pages' => :'Integer',
160
+ :'crawl_delay' => :'Integer',
161
+ :'crawl_max_concurrency' => :'Integer',
162
+ :'only_main_content' => :'Boolean',
163
+ :'custom_headers' => :'Hash<String, String>',
164
+ :'wait_for' => :'Integer',
165
+ :'block_ads' => :'Boolean',
166
+ :'proxy_mode' => :'String',
167
+ :'use_reranking' => :'Boolean',
168
+ :'enable_change_tracking' => :'Boolean'
169
+ }
170
+ end
171
+
172
+ # List of attributes with nullable: true
173
+ def self.openapi_nullable
174
+ Set.new([
175
+ ])
176
+ end
177
+
178
+ # Initializes the object
179
+ # @param [Hash] attributes Model attributes in the form of hash
180
+ def initialize(attributes = {})
181
+ if (!attributes.is_a?(Hash))
182
+ fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::CreateProjectRequest` initialize method"
183
+ end
184
+
185
+ # check to see if the attribute exists and convert string to symbol for hash key
186
+ acceptable_attribute_map = self.class.acceptable_attribute_map
187
+ attributes = attributes.each_with_object({}) { |(k, v), h|
188
+ if (!acceptable_attribute_map.key?(k.to_sym))
189
+ fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::CreateProjectRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
190
+ end
191
+ h[k.to_sym] = v
192
+ }
193
+
194
+ if attributes.key?(:'name')
195
+ self.name = attributes[:'name']
196
+ else
197
+ self.name = nil
198
+ end
199
+
200
+ if attributes.key?(:'domain')
201
+ self.domain = attributes[:'domain']
202
+ else
203
+ self.domain = nil
204
+ end
205
+
206
+ if attributes.key?(:'prompt')
207
+ self.prompt = attributes[:'prompt']
208
+ end
209
+
210
+ if attributes.key?(:'search_query')
211
+ self.search_query = attributes[:'search_query']
212
+ end
213
+
214
+ if attributes.key?(:'sitemap_mode')
215
+ self.sitemap_mode = attributes[:'sitemap_mode']
216
+ else
217
+ self.sitemap_mode = 'include'
218
+ end
219
+
220
+ if attributes.key?(:'include_subdomains')
221
+ self.include_subdomains = attributes[:'include_subdomains']
222
+ else
223
+ self.include_subdomains = true
224
+ end
225
+
226
+ if attributes.key?(:'ignore_query_params')
227
+ self.ignore_query_params = attributes[:'ignore_query_params']
228
+ else
229
+ self.ignore_query_params = true
230
+ end
231
+
232
+ if attributes.key?(:'max_discovery_depth')
233
+ self.max_discovery_depth = attributes[:'max_discovery_depth']
234
+ end
235
+
236
+ if attributes.key?(:'exclude_paths')
237
+ if (value = attributes[:'exclude_paths']).is_a?(Array)
238
+ self.exclude_paths = value
239
+ end
240
+ end
241
+
242
+ if attributes.key?(:'include_paths')
243
+ if (value = attributes[:'include_paths']).is_a?(Array)
244
+ self.include_paths = value
245
+ end
246
+ end
247
+
248
+ if attributes.key?(:'crawl_entire_domain')
249
+ self.crawl_entire_domain = attributes[:'crawl_entire_domain']
250
+ else
251
+ self.crawl_entire_domain = false
252
+ end
253
+
254
+ if attributes.key?(:'allow_external_links')
255
+ self.allow_external_links = attributes[:'allow_external_links']
256
+ else
257
+ self.allow_external_links = false
258
+ end
259
+
260
+ if attributes.key?(:'max_pages')
261
+ self.max_pages = attributes[:'max_pages']
262
+ else
263
+ self.max_pages = 100
264
+ end
265
+
266
+ if attributes.key?(:'crawl_delay')
267
+ self.crawl_delay = attributes[:'crawl_delay']
268
+ end
269
+
270
+ if attributes.key?(:'crawl_max_concurrency')
271
+ self.crawl_max_concurrency = attributes[:'crawl_max_concurrency']
272
+ end
273
+
274
+ if attributes.key?(:'only_main_content')
275
+ self.only_main_content = attributes[:'only_main_content']
276
+ else
277
+ self.only_main_content = true
278
+ end
279
+
280
+ if attributes.key?(:'custom_headers')
281
+ if (value = attributes[:'custom_headers']).is_a?(Hash)
282
+ self.custom_headers = value
283
+ end
284
+ end
285
+
286
+ if attributes.key?(:'wait_for')
287
+ self.wait_for = attributes[:'wait_for']
288
+ else
289
+ self.wait_for = 0
290
+ end
291
+
292
+ if attributes.key?(:'block_ads')
293
+ self.block_ads = attributes[:'block_ads']
294
+ else
295
+ self.block_ads = true
296
+ end
297
+
298
+ if attributes.key?(:'proxy_mode')
299
+ self.proxy_mode = attributes[:'proxy_mode']
300
+ else
301
+ self.proxy_mode = 'auto'
302
+ end
303
+
304
+ if attributes.key?(:'use_reranking')
305
+ self.use_reranking = attributes[:'use_reranking']
306
+ else
307
+ self.use_reranking = true
308
+ end
309
+
310
+ if attributes.key?(:'enable_change_tracking')
311
+ self.enable_change_tracking = attributes[:'enable_change_tracking']
312
+ else
313
+ self.enable_change_tracking = false
314
+ end
315
+ end
316
+
317
+ # Show invalid properties with the reasons. Usually used together with valid?
318
+ # @return Array for valid properties with the reasons
319
+ def list_invalid_properties
320
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
321
+ invalid_properties = Array.new
322
+ if @name.nil?
323
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
324
+ end
325
+
326
+ if @domain.nil?
327
+ invalid_properties.push('invalid value for "domain", domain cannot be nil.')
328
+ end
329
+
330
+ invalid_properties
331
+ end
332
+
333
+ # Check to see if the all the properties in the model are valid
334
+ # @return true if the model is valid
335
+ def valid?
336
+ warn '[DEPRECATED] the `valid?` method is obsolete'
337
+ return false if @name.nil?
338
+ return false if @domain.nil?
339
+ sitemap_mode_validator = EnumAttributeValidator.new('String', ["include", "exclude", "only"])
340
+ return false unless sitemap_mode_validator.valid?(@sitemap_mode)
341
+ proxy_mode_validator = EnumAttributeValidator.new('String', ["auto", "residential", "datacenter"])
342
+ return false unless proxy_mode_validator.valid?(@proxy_mode)
343
+ true
344
+ end
345
+
346
+ # Custom attribute writer method with validation
347
+ # @param [Object] name Value to be assigned
348
+ def name=(name)
349
+ if name.nil?
350
+ fail ArgumentError, 'name cannot be nil'
351
+ end
352
+
353
+ @name = name
354
+ end
355
+
356
+ # Custom attribute writer method with validation
357
+ # @param [Object] domain Value to be assigned
358
+ def domain=(domain)
359
+ if domain.nil?
360
+ fail ArgumentError, 'domain cannot be nil'
361
+ end
362
+
363
+ @domain = domain
364
+ end
365
+
366
+ # Custom attribute writer method checking allowed values (enum).
367
+ # @param [Object] sitemap_mode Object to be assigned
368
+ def sitemap_mode=(sitemap_mode)
369
+ validator = EnumAttributeValidator.new('String', ["include", "exclude", "only"])
370
+ unless validator.valid?(sitemap_mode)
371
+ fail ArgumentError, "invalid value for \"sitemap_mode\", must be one of #{validator.allowable_values}."
372
+ end
373
+ @sitemap_mode = sitemap_mode
374
+ end
375
+
376
+ # Custom attribute writer method checking allowed values (enum).
377
+ # @param [Object] proxy_mode Object to be assigned
378
+ def proxy_mode=(proxy_mode)
379
+ validator = EnumAttributeValidator.new('String', ["auto", "residential", "datacenter"])
380
+ unless validator.valid?(proxy_mode)
381
+ fail ArgumentError, "invalid value for \"proxy_mode\", must be one of #{validator.allowable_values}."
382
+ end
383
+ @proxy_mode = proxy_mode
384
+ end
385
+
386
+ # Checks equality by comparing each attribute.
387
+ # @param [Object] Object to be compared
388
+ def ==(o)
389
+ return true if self.equal?(o)
390
+ self.class == o.class &&
391
+ name == o.name &&
392
+ domain == o.domain &&
393
+ prompt == o.prompt &&
394
+ search_query == o.search_query &&
395
+ sitemap_mode == o.sitemap_mode &&
396
+ include_subdomains == o.include_subdomains &&
397
+ ignore_query_params == o.ignore_query_params &&
398
+ max_discovery_depth == o.max_discovery_depth &&
399
+ exclude_paths == o.exclude_paths &&
400
+ include_paths == o.include_paths &&
401
+ crawl_entire_domain == o.crawl_entire_domain &&
402
+ allow_external_links == o.allow_external_links &&
403
+ max_pages == o.max_pages &&
404
+ crawl_delay == o.crawl_delay &&
405
+ crawl_max_concurrency == o.crawl_max_concurrency &&
406
+ only_main_content == o.only_main_content &&
407
+ custom_headers == o.custom_headers &&
408
+ wait_for == o.wait_for &&
409
+ block_ads == o.block_ads &&
410
+ proxy_mode == o.proxy_mode &&
411
+ use_reranking == o.use_reranking &&
412
+ enable_change_tracking == o.enable_change_tracking
413
+ end
414
+
415
+ # @see the `==` method
416
+ # @param [Object] Object to be compared
417
+ def eql?(o)
418
+ self == o
419
+ end
420
+
421
+ # Calculates hash code according to all attributes.
422
+ # @return [Integer] Hash code
423
+ def hash
424
+ [name, domain, prompt, search_query, sitemap_mode, include_subdomains, ignore_query_params, max_discovery_depth, exclude_paths, include_paths, crawl_entire_domain, allow_external_links, max_pages, crawl_delay, crawl_max_concurrency, only_main_content, custom_headers, wait_for, block_ads, proxy_mode, use_reranking, enable_change_tracking].hash
425
+ end
426
+
427
+ # Builds the object from hash
428
+ # @param [Hash] attributes Model attributes in the form of hash
429
+ # @return [Object] Returns the model itself
430
+ def self.build_from_hash(attributes)
431
+ return nil unless attributes.is_a?(Hash)
432
+ attributes = attributes.transform_keys(&:to_sym)
433
+ transformed_hash = {}
434
+ openapi_types.each_pair do |key, type|
435
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
436
+ transformed_hash["#{key}"] = nil
437
+ elsif type =~ /\AArray<(.*)>/i
438
+ # check to ensure the input is an array given that the attribute
439
+ # is documented as an array but the input is not
440
+ if attributes[attribute_map[key]].is_a?(Array)
441
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
442
+ end
443
+ elsif !attributes[attribute_map[key]].nil?
444
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
445
+ end
446
+ end
447
+ new(transformed_hash)
448
+ end
449
+
450
+ # Deserializes the data based on type
451
+ # @param string type Data type
452
+ # @param string value Value to be deserialized
453
+ # @return [Object] Deserialized data
454
+ def self._deserialize(type, value)
455
+ case type.to_sym
456
+ when :Time
457
+ Time.parse(value)
458
+ when :Date
459
+ Date.parse(value)
460
+ when :String
461
+ value.to_s
462
+ when :Integer
463
+ value.to_i
464
+ when :Float
465
+ value.to_f
466
+ when :Boolean
467
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
468
+ true
469
+ else
470
+ false
471
+ end
472
+ when :Object
473
+ # generic object (usually a Hash), return directly
474
+ value
475
+ when /\AArray<(?<inner_type>.+)>\z/
476
+ inner_type = Regexp.last_match[:inner_type]
477
+ value.map { |v| _deserialize(inner_type, v) }
478
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
479
+ k_type = Regexp.last_match[:k_type]
480
+ v_type = Regexp.last_match[:v_type]
481
+ {}.tap do |hash|
482
+ value.each do |k, v|
483
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
484
+ end
485
+ end
486
+ else # model
487
+ # models (e.g. Pet) or oneOf
488
+ klass = OpenapiClient.const_get(type)
489
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
490
+ end
491
+ end
492
+
493
+ # Returns the string representation of the object
494
+ # @return [String] String presentation of the object
495
+ def to_s
496
+ to_hash.to_s
497
+ end
498
+
499
+ # to_body is an alias to to_hash (backward compatibility)
500
+ # @return [Hash] Returns the object in the form of hash
501
+ def to_body
502
+ to_hash
503
+ end
504
+
505
+ # Returns the object in the form of hash
506
+ # @return [Hash] Returns the object in the form of hash
507
+ def to_hash
508
+ hash = {}
509
+ self.class.attribute_map.each_pair do |attr, param|
510
+ value = self.send(attr)
511
+ if value.nil?
512
+ is_nullable = self.class.openapi_nullable.include?(attr)
513
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
514
+ end
515
+
516
+ hash[param] = _to_hash(value)
517
+ end
518
+ hash
519
+ end
520
+
521
+ # Outputs non-array value in the form of hash
522
+ # For object, use to_hash. Otherwise, just return the value
523
+ # @param [Object] value Any valid value
524
+ # @return [Hash] Returns the value in the form of hash
525
+ def _to_hash(value)
526
+ if value.is_a?(Array)
527
+ value.compact.map { |v| _to_hash(v) }
528
+ elsif value.is_a?(Hash)
529
+ {}.tap do |hash|
530
+ value.each { |k, v| hash[k] = _to_hash(v) }
531
+ end
532
+ elsif value.respond_to? :to_hash
533
+ value.to_hash
534
+ else
535
+ value
536
+ end
537
+ end
538
+
539
+ end
540
+
541
+ end