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,634 @@
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 Project
18
+ # Unique project identifier
19
+ attr_accessor :id
20
+
21
+ # Project name
22
+ attr_accessor :name
23
+
24
+ # Website domain URL
25
+ attr_accessor :domain
26
+
27
+ # User who owns the project
28
+ attr_accessor :user_id
29
+
30
+ # Natural language prompt for crawling
31
+ attr_accessor :prompt
32
+
33
+ # Search query for targeted crawling
34
+ attr_accessor :search_query
35
+
36
+ # How to handle sitemaps
37
+ attr_accessor :sitemap_mode
38
+
39
+ # Whether to include subdomains
40
+ attr_accessor :include_subdomains
41
+
42
+ # Whether to ignore URL query parameters
43
+ attr_accessor :ignore_query_params
44
+
45
+ # Maximum crawl depth
46
+ attr_accessor :max_discovery_depth
47
+
48
+ # Paths to exclude from crawling
49
+ attr_accessor :exclude_paths
50
+
51
+ # Specific paths to include
52
+ attr_accessor :include_paths
53
+
54
+ # Whether to crawl the entire domain
55
+ attr_accessor :crawl_entire_domain
56
+
57
+ # Whether to allow external links
58
+ attr_accessor :allow_external_links
59
+
60
+ # Maximum number of pages to crawl
61
+ attr_accessor :max_pages
62
+
63
+ # Delay between crawl requests (ms)
64
+ attr_accessor :crawl_delay
65
+
66
+ # Maximum concurrent crawl requests
67
+ attr_accessor :crawl_max_concurrency
68
+
69
+ # Whether to extract only main content
70
+ attr_accessor :only_main_content
71
+
72
+ # Custom headers for crawling
73
+ attr_accessor :custom_headers
74
+
75
+ # Wait time for page load (ms)
76
+ attr_accessor :wait_for
77
+
78
+ # Whether to block ads
79
+ attr_accessor :block_ads
80
+
81
+ # Proxy mode for crawling
82
+ attr_accessor :proxy_mode
83
+
84
+ # Whether to use AI reranking
85
+ attr_accessor :use_reranking
86
+
87
+ # Whether to enable change tracking
88
+ attr_accessor :enable_change_tracking
89
+
90
+ # Project creation timestamp
91
+ attr_accessor :created_at
92
+
93
+ # Last update timestamp
94
+ attr_accessor :updated_at
95
+
96
+ attr_accessor :_count
97
+
98
+ class EnumAttributeValidator
99
+ attr_reader :datatype
100
+ attr_reader :allowable_values
101
+
102
+ def initialize(datatype, allowable_values)
103
+ @allowable_values = allowable_values.map do |value|
104
+ case datatype.to_s
105
+ when /Integer/i
106
+ value.to_i
107
+ when /Float/i
108
+ value.to_f
109
+ else
110
+ value
111
+ end
112
+ end
113
+ end
114
+
115
+ def valid?(value)
116
+ !value || allowable_values.include?(value)
117
+ end
118
+ end
119
+
120
+ # Attribute mapping from ruby-style variable name to JSON key.
121
+ def self.attribute_map
122
+ {
123
+ :'id' => :'id',
124
+ :'name' => :'name',
125
+ :'domain' => :'domain',
126
+ :'user_id' => :'userId',
127
+ :'prompt' => :'prompt',
128
+ :'search_query' => :'searchQuery',
129
+ :'sitemap_mode' => :'sitemapMode',
130
+ :'include_subdomains' => :'includeSubdomains',
131
+ :'ignore_query_params' => :'ignoreQueryParams',
132
+ :'max_discovery_depth' => :'maxDiscoveryDepth',
133
+ :'exclude_paths' => :'excludePaths',
134
+ :'include_paths' => :'includePaths',
135
+ :'crawl_entire_domain' => :'crawlEntireDomain',
136
+ :'allow_external_links' => :'allowExternalLinks',
137
+ :'max_pages' => :'maxPages',
138
+ :'crawl_delay' => :'crawlDelay',
139
+ :'crawl_max_concurrency' => :'crawlMaxConcurrency',
140
+ :'only_main_content' => :'onlyMainContent',
141
+ :'custom_headers' => :'customHeaders',
142
+ :'wait_for' => :'waitFor',
143
+ :'block_ads' => :'blockAds',
144
+ :'proxy_mode' => :'proxyMode',
145
+ :'use_reranking' => :'useReranking',
146
+ :'enable_change_tracking' => :'enableChangeTracking',
147
+ :'created_at' => :'createdAt',
148
+ :'updated_at' => :'updatedAt',
149
+ :'_count' => :'_count'
150
+ }
151
+ end
152
+
153
+ # Returns attribute mapping this model knows about
154
+ def self.acceptable_attribute_map
155
+ attribute_map
156
+ end
157
+
158
+ # Returns all the JSON keys this model knows about
159
+ def self.acceptable_attributes
160
+ acceptable_attribute_map.values
161
+ end
162
+
163
+ # Attribute type mapping.
164
+ def self.openapi_types
165
+ {
166
+ :'id' => :'String',
167
+ :'name' => :'String',
168
+ :'domain' => :'String',
169
+ :'user_id' => :'String',
170
+ :'prompt' => :'String',
171
+ :'search_query' => :'String',
172
+ :'sitemap_mode' => :'String',
173
+ :'include_subdomains' => :'Boolean',
174
+ :'ignore_query_params' => :'Boolean',
175
+ :'max_discovery_depth' => :'Integer',
176
+ :'exclude_paths' => :'Array<String>',
177
+ :'include_paths' => :'Array<String>',
178
+ :'crawl_entire_domain' => :'Boolean',
179
+ :'allow_external_links' => :'Boolean',
180
+ :'max_pages' => :'Integer',
181
+ :'crawl_delay' => :'Integer',
182
+ :'crawl_max_concurrency' => :'Integer',
183
+ :'only_main_content' => :'Boolean',
184
+ :'custom_headers' => :'Hash<String, String>',
185
+ :'wait_for' => :'Integer',
186
+ :'block_ads' => :'Boolean',
187
+ :'proxy_mode' => :'String',
188
+ :'use_reranking' => :'Boolean',
189
+ :'enable_change_tracking' => :'Boolean',
190
+ :'created_at' => :'Time',
191
+ :'updated_at' => :'Time',
192
+ :'_count' => :'ProjectCount'
193
+ }
194
+ end
195
+
196
+ # List of attributes with nullable: true
197
+ def self.openapi_nullable
198
+ Set.new([
199
+ ])
200
+ end
201
+
202
+ # Initializes the object
203
+ # @param [Hash] attributes Model attributes in the form of hash
204
+ def initialize(attributes = {})
205
+ if (!attributes.is_a?(Hash))
206
+ fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::Project` initialize method"
207
+ end
208
+
209
+ # check to see if the attribute exists and convert string to symbol for hash key
210
+ acceptable_attribute_map = self.class.acceptable_attribute_map
211
+ attributes = attributes.each_with_object({}) { |(k, v), h|
212
+ if (!acceptable_attribute_map.key?(k.to_sym))
213
+ fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::Project`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
214
+ end
215
+ h[k.to_sym] = v
216
+ }
217
+
218
+ if attributes.key?(:'id')
219
+ self.id = attributes[:'id']
220
+ else
221
+ self.id = nil
222
+ end
223
+
224
+ if attributes.key?(:'name')
225
+ self.name = attributes[:'name']
226
+ else
227
+ self.name = nil
228
+ end
229
+
230
+ if attributes.key?(:'domain')
231
+ self.domain = attributes[:'domain']
232
+ else
233
+ self.domain = nil
234
+ end
235
+
236
+ if attributes.key?(:'user_id')
237
+ self.user_id = attributes[:'user_id']
238
+ else
239
+ self.user_id = nil
240
+ end
241
+
242
+ if attributes.key?(:'prompt')
243
+ self.prompt = attributes[:'prompt']
244
+ end
245
+
246
+ if attributes.key?(:'search_query')
247
+ self.search_query = attributes[:'search_query']
248
+ end
249
+
250
+ if attributes.key?(:'sitemap_mode')
251
+ self.sitemap_mode = attributes[:'sitemap_mode']
252
+ end
253
+
254
+ if attributes.key?(:'include_subdomains')
255
+ self.include_subdomains = attributes[:'include_subdomains']
256
+ end
257
+
258
+ if attributes.key?(:'ignore_query_params')
259
+ self.ignore_query_params = attributes[:'ignore_query_params']
260
+ end
261
+
262
+ if attributes.key?(:'max_discovery_depth')
263
+ self.max_discovery_depth = attributes[:'max_discovery_depth']
264
+ end
265
+
266
+ if attributes.key?(:'exclude_paths')
267
+ if (value = attributes[:'exclude_paths']).is_a?(Array)
268
+ self.exclude_paths = value
269
+ end
270
+ end
271
+
272
+ if attributes.key?(:'include_paths')
273
+ if (value = attributes[:'include_paths']).is_a?(Array)
274
+ self.include_paths = value
275
+ end
276
+ end
277
+
278
+ if attributes.key?(:'crawl_entire_domain')
279
+ self.crawl_entire_domain = attributes[:'crawl_entire_domain']
280
+ end
281
+
282
+ if attributes.key?(:'allow_external_links')
283
+ self.allow_external_links = attributes[:'allow_external_links']
284
+ end
285
+
286
+ if attributes.key?(:'max_pages')
287
+ self.max_pages = attributes[:'max_pages']
288
+ end
289
+
290
+ if attributes.key?(:'crawl_delay')
291
+ self.crawl_delay = attributes[:'crawl_delay']
292
+ end
293
+
294
+ if attributes.key?(:'crawl_max_concurrency')
295
+ self.crawl_max_concurrency = attributes[:'crawl_max_concurrency']
296
+ end
297
+
298
+ if attributes.key?(:'only_main_content')
299
+ self.only_main_content = attributes[:'only_main_content']
300
+ end
301
+
302
+ if attributes.key?(:'custom_headers')
303
+ if (value = attributes[:'custom_headers']).is_a?(Hash)
304
+ self.custom_headers = value
305
+ end
306
+ end
307
+
308
+ if attributes.key?(:'wait_for')
309
+ self.wait_for = attributes[:'wait_for']
310
+ end
311
+
312
+ if attributes.key?(:'block_ads')
313
+ self.block_ads = attributes[:'block_ads']
314
+ end
315
+
316
+ if attributes.key?(:'proxy_mode')
317
+ self.proxy_mode = attributes[:'proxy_mode']
318
+ end
319
+
320
+ if attributes.key?(:'use_reranking')
321
+ self.use_reranking = attributes[:'use_reranking']
322
+ end
323
+
324
+ if attributes.key?(:'enable_change_tracking')
325
+ self.enable_change_tracking = attributes[:'enable_change_tracking']
326
+ end
327
+
328
+ if attributes.key?(:'created_at')
329
+ self.created_at = attributes[:'created_at']
330
+ else
331
+ self.created_at = nil
332
+ end
333
+
334
+ if attributes.key?(:'updated_at')
335
+ self.updated_at = attributes[:'updated_at']
336
+ else
337
+ self.updated_at = nil
338
+ end
339
+
340
+ if attributes.key?(:'_count')
341
+ self._count = attributes[:'_count']
342
+ end
343
+ end
344
+
345
+ # Show invalid properties with the reasons. Usually used together with valid?
346
+ # @return Array for valid properties with the reasons
347
+ def list_invalid_properties
348
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
349
+ invalid_properties = Array.new
350
+ if @id.nil?
351
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
352
+ end
353
+
354
+ if @name.nil?
355
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
356
+ end
357
+
358
+ if @domain.nil?
359
+ invalid_properties.push('invalid value for "domain", domain cannot be nil.')
360
+ end
361
+
362
+ if @user_id.nil?
363
+ invalid_properties.push('invalid value for "user_id", user_id cannot be nil.')
364
+ end
365
+
366
+ if @created_at.nil?
367
+ invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
368
+ end
369
+
370
+ if @updated_at.nil?
371
+ invalid_properties.push('invalid value for "updated_at", updated_at cannot be nil.')
372
+ end
373
+
374
+ invalid_properties
375
+ end
376
+
377
+ # Check to see if the all the properties in the model are valid
378
+ # @return true if the model is valid
379
+ def valid?
380
+ warn '[DEPRECATED] the `valid?` method is obsolete'
381
+ return false if @id.nil?
382
+ return false if @name.nil?
383
+ return false if @domain.nil?
384
+ return false if @user_id.nil?
385
+ sitemap_mode_validator = EnumAttributeValidator.new('String', ["include", "exclude", "only"])
386
+ return false unless sitemap_mode_validator.valid?(@sitemap_mode)
387
+ proxy_mode_validator = EnumAttributeValidator.new('String', ["auto", "residential", "datacenter"])
388
+ return false unless proxy_mode_validator.valid?(@proxy_mode)
389
+ return false if @created_at.nil?
390
+ return false if @updated_at.nil?
391
+ true
392
+ end
393
+
394
+ # Custom attribute writer method with validation
395
+ # @param [Object] id Value to be assigned
396
+ def id=(id)
397
+ if id.nil?
398
+ fail ArgumentError, 'id cannot be nil'
399
+ end
400
+
401
+ @id = id
402
+ end
403
+
404
+ # Custom attribute writer method with validation
405
+ # @param [Object] name Value to be assigned
406
+ def name=(name)
407
+ if name.nil?
408
+ fail ArgumentError, 'name cannot be nil'
409
+ end
410
+
411
+ @name = name
412
+ end
413
+
414
+ # Custom attribute writer method with validation
415
+ # @param [Object] domain Value to be assigned
416
+ def domain=(domain)
417
+ if domain.nil?
418
+ fail ArgumentError, 'domain cannot be nil'
419
+ end
420
+
421
+ @domain = domain
422
+ end
423
+
424
+ # Custom attribute writer method with validation
425
+ # @param [Object] user_id Value to be assigned
426
+ def user_id=(user_id)
427
+ if user_id.nil?
428
+ fail ArgumentError, 'user_id cannot be nil'
429
+ end
430
+
431
+ @user_id = user_id
432
+ end
433
+
434
+ # Custom attribute writer method checking allowed values (enum).
435
+ # @param [Object] sitemap_mode Object to be assigned
436
+ def sitemap_mode=(sitemap_mode)
437
+ validator = EnumAttributeValidator.new('String', ["include", "exclude", "only"])
438
+ unless validator.valid?(sitemap_mode)
439
+ fail ArgumentError, "invalid value for \"sitemap_mode\", must be one of #{validator.allowable_values}."
440
+ end
441
+ @sitemap_mode = sitemap_mode
442
+ end
443
+
444
+ # Custom attribute writer method checking allowed values (enum).
445
+ # @param [Object] proxy_mode Object to be assigned
446
+ def proxy_mode=(proxy_mode)
447
+ validator = EnumAttributeValidator.new('String', ["auto", "residential", "datacenter"])
448
+ unless validator.valid?(proxy_mode)
449
+ fail ArgumentError, "invalid value for \"proxy_mode\", must be one of #{validator.allowable_values}."
450
+ end
451
+ @proxy_mode = proxy_mode
452
+ end
453
+
454
+ # Custom attribute writer method with validation
455
+ # @param [Object] created_at Value to be assigned
456
+ def created_at=(created_at)
457
+ if created_at.nil?
458
+ fail ArgumentError, 'created_at cannot be nil'
459
+ end
460
+
461
+ @created_at = created_at
462
+ end
463
+
464
+ # Custom attribute writer method with validation
465
+ # @param [Object] updated_at Value to be assigned
466
+ def updated_at=(updated_at)
467
+ if updated_at.nil?
468
+ fail ArgumentError, 'updated_at cannot be nil'
469
+ end
470
+
471
+ @updated_at = updated_at
472
+ end
473
+
474
+ # Checks equality by comparing each attribute.
475
+ # @param [Object] Object to be compared
476
+ def ==(o)
477
+ return true if self.equal?(o)
478
+ self.class == o.class &&
479
+ id == o.id &&
480
+ name == o.name &&
481
+ domain == o.domain &&
482
+ user_id == o.user_id &&
483
+ prompt == o.prompt &&
484
+ search_query == o.search_query &&
485
+ sitemap_mode == o.sitemap_mode &&
486
+ include_subdomains == o.include_subdomains &&
487
+ ignore_query_params == o.ignore_query_params &&
488
+ max_discovery_depth == o.max_discovery_depth &&
489
+ exclude_paths == o.exclude_paths &&
490
+ include_paths == o.include_paths &&
491
+ crawl_entire_domain == o.crawl_entire_domain &&
492
+ allow_external_links == o.allow_external_links &&
493
+ max_pages == o.max_pages &&
494
+ crawl_delay == o.crawl_delay &&
495
+ crawl_max_concurrency == o.crawl_max_concurrency &&
496
+ only_main_content == o.only_main_content &&
497
+ custom_headers == o.custom_headers &&
498
+ wait_for == o.wait_for &&
499
+ block_ads == o.block_ads &&
500
+ proxy_mode == o.proxy_mode &&
501
+ use_reranking == o.use_reranking &&
502
+ enable_change_tracking == o.enable_change_tracking &&
503
+ created_at == o.created_at &&
504
+ updated_at == o.updated_at &&
505
+ _count == o._count
506
+ end
507
+
508
+ # @see the `==` method
509
+ # @param [Object] Object to be compared
510
+ def eql?(o)
511
+ self == o
512
+ end
513
+
514
+ # Calculates hash code according to all attributes.
515
+ # @return [Integer] Hash code
516
+ def hash
517
+ [id, name, domain, user_id, 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, created_at, updated_at, _count].hash
518
+ end
519
+
520
+ # Builds the object from hash
521
+ # @param [Hash] attributes Model attributes in the form of hash
522
+ # @return [Object] Returns the model itself
523
+ def self.build_from_hash(attributes)
524
+ return nil unless attributes.is_a?(Hash)
525
+ attributes = attributes.transform_keys(&:to_sym)
526
+ transformed_hash = {}
527
+ openapi_types.each_pair do |key, type|
528
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
529
+ transformed_hash["#{key}"] = nil
530
+ elsif type =~ /\AArray<(.*)>/i
531
+ # check to ensure the input is an array given that the attribute
532
+ # is documented as an array but the input is not
533
+ if attributes[attribute_map[key]].is_a?(Array)
534
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
535
+ end
536
+ elsif !attributes[attribute_map[key]].nil?
537
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
538
+ end
539
+ end
540
+ new(transformed_hash)
541
+ end
542
+
543
+ # Deserializes the data based on type
544
+ # @param string type Data type
545
+ # @param string value Value to be deserialized
546
+ # @return [Object] Deserialized data
547
+ def self._deserialize(type, value)
548
+ case type.to_sym
549
+ when :Time
550
+ Time.parse(value)
551
+ when :Date
552
+ Date.parse(value)
553
+ when :String
554
+ value.to_s
555
+ when :Integer
556
+ value.to_i
557
+ when :Float
558
+ value.to_f
559
+ when :Boolean
560
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
561
+ true
562
+ else
563
+ false
564
+ end
565
+ when :Object
566
+ # generic object (usually a Hash), return directly
567
+ value
568
+ when /\AArray<(?<inner_type>.+)>\z/
569
+ inner_type = Regexp.last_match[:inner_type]
570
+ value.map { |v| _deserialize(inner_type, v) }
571
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
572
+ k_type = Regexp.last_match[:k_type]
573
+ v_type = Regexp.last_match[:v_type]
574
+ {}.tap do |hash|
575
+ value.each do |k, v|
576
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
577
+ end
578
+ end
579
+ else # model
580
+ # models (e.g. Pet) or oneOf
581
+ klass = OpenapiClient.const_get(type)
582
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
583
+ end
584
+ end
585
+
586
+ # Returns the string representation of the object
587
+ # @return [String] String presentation of the object
588
+ def to_s
589
+ to_hash.to_s
590
+ end
591
+
592
+ # to_body is an alias to to_hash (backward compatibility)
593
+ # @return [Hash] Returns the object in the form of hash
594
+ def to_body
595
+ to_hash
596
+ end
597
+
598
+ # Returns the object in the form of hash
599
+ # @return [Hash] Returns the object in the form of hash
600
+ def to_hash
601
+ hash = {}
602
+ self.class.attribute_map.each_pair do |attr, param|
603
+ value = self.send(attr)
604
+ if value.nil?
605
+ is_nullable = self.class.openapi_nullable.include?(attr)
606
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
607
+ end
608
+
609
+ hash[param] = _to_hash(value)
610
+ end
611
+ hash
612
+ end
613
+
614
+ # Outputs non-array value in the form of hash
615
+ # For object, use to_hash. Otherwise, just return the value
616
+ # @param [Object] value Any valid value
617
+ # @return [Hash] Returns the value in the form of hash
618
+ def _to_hash(value)
619
+ if value.is_a?(Array)
620
+ value.compact.map { |v| _to_hash(v) }
621
+ elsif value.is_a?(Hash)
622
+ {}.tap do |hash|
623
+ value.each { |k, v| hash[k] = _to_hash(v) }
624
+ end
625
+ elsif value.respond_to? :to_hash
626
+ value.to_hash
627
+ else
628
+ value
629
+ end
630
+ end
631
+
632
+ end
633
+
634
+ end