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,273 @@
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 'cgi'
14
+
15
+ module OpenapiClient
16
+ class ProjectsApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Create a new project
23
+ # Create a new project for internal linking optimization
24
+ # @param create_project_request [CreateProjectRequest]
25
+ # @param [Hash] opts the optional parameters
26
+ # @return [Project]
27
+ def create_project(create_project_request, opts = {})
28
+ data, _status_code, _headers = create_project_with_http_info(create_project_request, opts)
29
+ data
30
+ end
31
+
32
+ # Create a new project
33
+ # Create a new project for internal linking optimization
34
+ # @param create_project_request [CreateProjectRequest]
35
+ # @param [Hash] opts the optional parameters
36
+ # @return [Array<(Project, Integer, Hash)>] Project data, response status code and response headers
37
+ def create_project_with_http_info(create_project_request, opts = {})
38
+ if @api_client.config.debugging
39
+ @api_client.config.logger.debug 'Calling API: ProjectsApi.create_project ...'
40
+ end
41
+ # verify the required parameter 'create_project_request' is set
42
+ if @api_client.config.client_side_validation && create_project_request.nil?
43
+ fail ArgumentError, "Missing the required parameter 'create_project_request' when calling ProjectsApi.create_project"
44
+ end
45
+ # resource path
46
+ local_var_path = '/api/projects'
47
+
48
+ # query parameters
49
+ query_params = opts[:query_params] || {}
50
+
51
+ # header parameters
52
+ header_params = opts[:header_params] || {}
53
+ # HTTP header 'Accept' (if needed)
54
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
55
+ # HTTP header 'Content-Type'
56
+ content_type = @api_client.select_header_content_type(['application/json'])
57
+ if !content_type.nil?
58
+ header_params['Content-Type'] = content_type
59
+ end
60
+
61
+ # form parameters
62
+ form_params = opts[:form_params] || {}
63
+
64
+ # http body (model)
65
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(create_project_request)
66
+
67
+ # return_type
68
+ return_type = opts[:debug_return_type] || 'Project'
69
+
70
+ # auth_names
71
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
72
+
73
+ new_options = opts.merge(
74
+ :operation => :"ProjectsApi.create_project",
75
+ :header_params => header_params,
76
+ :query_params => query_params,
77
+ :form_params => form_params,
78
+ :body => post_body,
79
+ :auth_names => auth_names,
80
+ :return_type => return_type
81
+ )
82
+
83
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
84
+ if @api_client.config.debugging
85
+ @api_client.config.logger.debug "API called: ProjectsApi#create_project\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
86
+ end
87
+ return data, status_code, headers
88
+ end
89
+
90
+ # Delete a project
91
+ # Delete a project and all associated data
92
+ # @param project_id [String] Unique identifier for the project
93
+ # @param [Hash] opts the optional parameters
94
+ # @return [DeleteProject200Response]
95
+ def delete_project(project_id, opts = {})
96
+ data, _status_code, _headers = delete_project_with_http_info(project_id, opts)
97
+ data
98
+ end
99
+
100
+ # Delete a project
101
+ # Delete a project and all associated data
102
+ # @param project_id [String] Unique identifier for the project
103
+ # @param [Hash] opts the optional parameters
104
+ # @return [Array<(DeleteProject200Response, Integer, Hash)>] DeleteProject200Response data, response status code and response headers
105
+ def delete_project_with_http_info(project_id, opts = {})
106
+ if @api_client.config.debugging
107
+ @api_client.config.logger.debug 'Calling API: ProjectsApi.delete_project ...'
108
+ end
109
+ # verify the required parameter 'project_id' is set
110
+ if @api_client.config.client_side_validation && project_id.nil?
111
+ fail ArgumentError, "Missing the required parameter 'project_id' when calling ProjectsApi.delete_project"
112
+ end
113
+ # resource path
114
+ local_var_path = '/api/projects/{projectId}'.sub('{' + 'projectId' + '}', CGI.escape(project_id.to_s))
115
+
116
+ # query parameters
117
+ query_params = opts[:query_params] || {}
118
+
119
+ # header parameters
120
+ header_params = opts[:header_params] || {}
121
+ # HTTP header 'Accept' (if needed)
122
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
123
+
124
+ # form parameters
125
+ form_params = opts[:form_params] || {}
126
+
127
+ # http body (model)
128
+ post_body = opts[:debug_body]
129
+
130
+ # return_type
131
+ return_type = opts[:debug_return_type] || 'DeleteProject200Response'
132
+
133
+ # auth_names
134
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
135
+
136
+ new_options = opts.merge(
137
+ :operation => :"ProjectsApi.delete_project",
138
+ :header_params => header_params,
139
+ :query_params => query_params,
140
+ :form_params => form_params,
141
+ :body => post_body,
142
+ :auth_names => auth_names,
143
+ :return_type => return_type
144
+ )
145
+
146
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
147
+ if @api_client.config.debugging
148
+ @api_client.config.logger.debug "API called: ProjectsApi#delete_project\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
149
+ end
150
+ return data, status_code, headers
151
+ end
152
+
153
+ # Get project details
154
+ # Get detailed information about a specific project
155
+ # @param project_id [String] Unique identifier for the project
156
+ # @param [Hash] opts the optional parameters
157
+ # @return [Project]
158
+ def get_project(project_id, opts = {})
159
+ data, _status_code, _headers = get_project_with_http_info(project_id, opts)
160
+ data
161
+ end
162
+
163
+ # Get project details
164
+ # Get detailed information about a specific project
165
+ # @param project_id [String] Unique identifier for the project
166
+ # @param [Hash] opts the optional parameters
167
+ # @return [Array<(Project, Integer, Hash)>] Project data, response status code and response headers
168
+ def get_project_with_http_info(project_id, opts = {})
169
+ if @api_client.config.debugging
170
+ @api_client.config.logger.debug 'Calling API: ProjectsApi.get_project ...'
171
+ end
172
+ # verify the required parameter 'project_id' is set
173
+ if @api_client.config.client_side_validation && project_id.nil?
174
+ fail ArgumentError, "Missing the required parameter 'project_id' when calling ProjectsApi.get_project"
175
+ end
176
+ # resource path
177
+ local_var_path = '/api/projects/{projectId}'.sub('{' + 'projectId' + '}', CGI.escape(project_id.to_s))
178
+
179
+ # query parameters
180
+ query_params = opts[:query_params] || {}
181
+
182
+ # header parameters
183
+ header_params = opts[:header_params] || {}
184
+ # HTTP header 'Accept' (if needed)
185
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
186
+
187
+ # form parameters
188
+ form_params = opts[:form_params] || {}
189
+
190
+ # http body (model)
191
+ post_body = opts[:debug_body]
192
+
193
+ # return_type
194
+ return_type = opts[:debug_return_type] || 'Project'
195
+
196
+ # auth_names
197
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
198
+
199
+ new_options = opts.merge(
200
+ :operation => :"ProjectsApi.get_project",
201
+ :header_params => header_params,
202
+ :query_params => query_params,
203
+ :form_params => form_params,
204
+ :body => post_body,
205
+ :auth_names => auth_names,
206
+ :return_type => return_type
207
+ )
208
+
209
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
210
+ if @api_client.config.debugging
211
+ @api_client.config.logger.debug "API called: ProjectsApi#get_project\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
212
+ end
213
+ return data, status_code, headers
214
+ end
215
+
216
+ # List all projects
217
+ # Get a list of all projects for the authenticated user
218
+ # @param [Hash] opts the optional parameters
219
+ # @return [Array<Project>]
220
+ def list_projects(opts = {})
221
+ data, _status_code, _headers = list_projects_with_http_info(opts)
222
+ data
223
+ end
224
+
225
+ # List all projects
226
+ # Get a list of all projects for the authenticated user
227
+ # @param [Hash] opts the optional parameters
228
+ # @return [Array<(Array<Project>, Integer, Hash)>] Array<Project> data, response status code and response headers
229
+ def list_projects_with_http_info(opts = {})
230
+ if @api_client.config.debugging
231
+ @api_client.config.logger.debug 'Calling API: ProjectsApi.list_projects ...'
232
+ end
233
+ # resource path
234
+ local_var_path = '/api/projects'
235
+
236
+ # query parameters
237
+ query_params = opts[:query_params] || {}
238
+
239
+ # header parameters
240
+ header_params = opts[:header_params] || {}
241
+ # HTTP header 'Accept' (if needed)
242
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
243
+
244
+ # form parameters
245
+ form_params = opts[:form_params] || {}
246
+
247
+ # http body (model)
248
+ post_body = opts[:debug_body]
249
+
250
+ # return_type
251
+ return_type = opts[:debug_return_type] || 'Array<Project>'
252
+
253
+ # auth_names
254
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
255
+
256
+ new_options = opts.merge(
257
+ :operation => :"ProjectsApi.list_projects",
258
+ :header_params => header_params,
259
+ :query_params => query_params,
260
+ :form_params => form_params,
261
+ :body => post_body,
262
+ :auth_names => auth_names,
263
+ :return_type => return_type
264
+ )
265
+
266
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
267
+ if @api_client.config.debugging
268
+ @api_client.config.logger.debug "API called: ProjectsApi#list_projects\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
269
+ end
270
+ return data, status_code, headers
271
+ end
272
+ end
273
+ end
@@ -0,0 +1,242 @@
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 'cgi'
14
+
15
+ module OpenapiClient
16
+ class SuggestionsApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Generate link suggestions
23
+ # Generate new AI-powered link suggestions for a project
24
+ # @param project_id [String] Unique identifier for the project
25
+ # @param [Hash] opts the optional parameters
26
+ # @option opts [GenerateSuggestionsRequest] :generate_suggestions_request
27
+ # @return [GenerateSuggestions200Response]
28
+ def generate_suggestions(project_id, opts = {})
29
+ data, _status_code, _headers = generate_suggestions_with_http_info(project_id, opts)
30
+ data
31
+ end
32
+
33
+ # Generate link suggestions
34
+ # Generate new AI-powered link suggestions for a project
35
+ # @param project_id [String] Unique identifier for the project
36
+ # @param [Hash] opts the optional parameters
37
+ # @option opts [GenerateSuggestionsRequest] :generate_suggestions_request
38
+ # @return [Array<(GenerateSuggestions200Response, Integer, Hash)>] GenerateSuggestions200Response data, response status code and response headers
39
+ def generate_suggestions_with_http_info(project_id, opts = {})
40
+ if @api_client.config.debugging
41
+ @api_client.config.logger.debug 'Calling API: SuggestionsApi.generate_suggestions ...'
42
+ end
43
+ # verify the required parameter 'project_id' is set
44
+ if @api_client.config.client_side_validation && project_id.nil?
45
+ fail ArgumentError, "Missing the required parameter 'project_id' when calling SuggestionsApi.generate_suggestions"
46
+ end
47
+ # resource path
48
+ local_var_path = '/api/projects/{projectId}/suggestions'.sub('{' + 'projectId' + '}', CGI.escape(project_id.to_s))
49
+
50
+ # query parameters
51
+ query_params = opts[:query_params] || {}
52
+
53
+ # header parameters
54
+ header_params = opts[:header_params] || {}
55
+ # HTTP header 'Accept' (if needed)
56
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
57
+ # HTTP header 'Content-Type'
58
+ content_type = @api_client.select_header_content_type(['application/json'])
59
+ if !content_type.nil?
60
+ header_params['Content-Type'] = content_type
61
+ end
62
+
63
+ # form parameters
64
+ form_params = opts[:form_params] || {}
65
+
66
+ # http body (model)
67
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'generate_suggestions_request'])
68
+
69
+ # return_type
70
+ return_type = opts[:debug_return_type] || 'GenerateSuggestions200Response'
71
+
72
+ # auth_names
73
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
74
+
75
+ new_options = opts.merge(
76
+ :operation => :"SuggestionsApi.generate_suggestions",
77
+ :header_params => header_params,
78
+ :query_params => query_params,
79
+ :form_params => form_params,
80
+ :body => post_body,
81
+ :auth_names => auth_names,
82
+ :return_type => return_type
83
+ )
84
+
85
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
86
+ if @api_client.config.debugging
87
+ @api_client.config.logger.debug "API called: SuggestionsApi#generate_suggestions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
88
+ end
89
+ return data, status_code, headers
90
+ end
91
+
92
+ # Get link suggestions
93
+ # Get AI-generated link suggestions for a project
94
+ # @param project_id [String] Unique identifier for the project
95
+ # @param [Hash] opts the optional parameters
96
+ # @option opts [String] :status Filter suggestions by status
97
+ # @return [Array<Suggestion>]
98
+ def get_suggestions(project_id, opts = {})
99
+ data, _status_code, _headers = get_suggestions_with_http_info(project_id, opts)
100
+ data
101
+ end
102
+
103
+ # Get link suggestions
104
+ # Get AI-generated link suggestions for a project
105
+ # @param project_id [String] Unique identifier for the project
106
+ # @param [Hash] opts the optional parameters
107
+ # @option opts [String] :status Filter suggestions by status
108
+ # @return [Array<(Array<Suggestion>, Integer, Hash)>] Array<Suggestion> data, response status code and response headers
109
+ def get_suggestions_with_http_info(project_id, opts = {})
110
+ if @api_client.config.debugging
111
+ @api_client.config.logger.debug 'Calling API: SuggestionsApi.get_suggestions ...'
112
+ end
113
+ # verify the required parameter 'project_id' is set
114
+ if @api_client.config.client_side_validation && project_id.nil?
115
+ fail ArgumentError, "Missing the required parameter 'project_id' when calling SuggestionsApi.get_suggestions"
116
+ end
117
+ allowable_values = ["pending", "approved", "rejected", "implemented"]
118
+ if @api_client.config.client_side_validation && opts[:'status'] && !allowable_values.include?(opts[:'status'])
119
+ fail ArgumentError, "invalid value for \"status\", must be one of #{allowable_values}"
120
+ end
121
+ # resource path
122
+ local_var_path = '/api/projects/{projectId}/suggestions'.sub('{' + 'projectId' + '}', CGI.escape(project_id.to_s))
123
+
124
+ # query parameters
125
+ query_params = opts[:query_params] || {}
126
+ query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
127
+
128
+ # header parameters
129
+ header_params = opts[:header_params] || {}
130
+ # HTTP header 'Accept' (if needed)
131
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
132
+
133
+ # form parameters
134
+ form_params = opts[:form_params] || {}
135
+
136
+ # http body (model)
137
+ post_body = opts[:debug_body]
138
+
139
+ # return_type
140
+ return_type = opts[:debug_return_type] || 'Array<Suggestion>'
141
+
142
+ # auth_names
143
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
144
+
145
+ new_options = opts.merge(
146
+ :operation => :"SuggestionsApi.get_suggestions",
147
+ :header_params => header_params,
148
+ :query_params => query_params,
149
+ :form_params => form_params,
150
+ :body => post_body,
151
+ :auth_names => auth_names,
152
+ :return_type => return_type
153
+ )
154
+
155
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
156
+ if @api_client.config.debugging
157
+ @api_client.config.logger.debug "API called: SuggestionsApi#get_suggestions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
158
+ end
159
+ return data, status_code, headers
160
+ end
161
+
162
+ # Update suggestion status
163
+ # Update the status of a link suggestion
164
+ # @param project_id [String] Unique identifier for the project
165
+ # @param suggestion_id [String] Unique identifier for the suggestion
166
+ # @param update_suggestion_request [UpdateSuggestionRequest]
167
+ # @param [Hash] opts the optional parameters
168
+ # @return [Suggestion]
169
+ def update_suggestion(project_id, suggestion_id, update_suggestion_request, opts = {})
170
+ data, _status_code, _headers = update_suggestion_with_http_info(project_id, suggestion_id, update_suggestion_request, opts)
171
+ data
172
+ end
173
+
174
+ # Update suggestion status
175
+ # Update the status of a link suggestion
176
+ # @param project_id [String] Unique identifier for the project
177
+ # @param suggestion_id [String] Unique identifier for the suggestion
178
+ # @param update_suggestion_request [UpdateSuggestionRequest]
179
+ # @param [Hash] opts the optional parameters
180
+ # @return [Array<(Suggestion, Integer, Hash)>] Suggestion data, response status code and response headers
181
+ def update_suggestion_with_http_info(project_id, suggestion_id, update_suggestion_request, opts = {})
182
+ if @api_client.config.debugging
183
+ @api_client.config.logger.debug 'Calling API: SuggestionsApi.update_suggestion ...'
184
+ end
185
+ # verify the required parameter 'project_id' is set
186
+ if @api_client.config.client_side_validation && project_id.nil?
187
+ fail ArgumentError, "Missing the required parameter 'project_id' when calling SuggestionsApi.update_suggestion"
188
+ end
189
+ # verify the required parameter 'suggestion_id' is set
190
+ if @api_client.config.client_side_validation && suggestion_id.nil?
191
+ fail ArgumentError, "Missing the required parameter 'suggestion_id' when calling SuggestionsApi.update_suggestion"
192
+ end
193
+ # verify the required parameter 'update_suggestion_request' is set
194
+ if @api_client.config.client_side_validation && update_suggestion_request.nil?
195
+ fail ArgumentError, "Missing the required parameter 'update_suggestion_request' when calling SuggestionsApi.update_suggestion"
196
+ end
197
+ # resource path
198
+ local_var_path = '/api/projects/{projectId}/suggestions/{suggestionId}'.sub('{' + 'projectId' + '}', CGI.escape(project_id.to_s)).sub('{' + 'suggestionId' + '}', CGI.escape(suggestion_id.to_s))
199
+
200
+ # query parameters
201
+ query_params = opts[:query_params] || {}
202
+
203
+ # header parameters
204
+ header_params = opts[:header_params] || {}
205
+ # HTTP header 'Accept' (if needed)
206
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
207
+ # HTTP header 'Content-Type'
208
+ content_type = @api_client.select_header_content_type(['application/json'])
209
+ if !content_type.nil?
210
+ header_params['Content-Type'] = content_type
211
+ end
212
+
213
+ # form parameters
214
+ form_params = opts[:form_params] || {}
215
+
216
+ # http body (model)
217
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(update_suggestion_request)
218
+
219
+ # return_type
220
+ return_type = opts[:debug_return_type] || 'Suggestion'
221
+
222
+ # auth_names
223
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
224
+
225
+ new_options = opts.merge(
226
+ :operation => :"SuggestionsApi.update_suggestion",
227
+ :header_params => header_params,
228
+ :query_params => query_params,
229
+ :form_params => form_params,
230
+ :body => post_body,
231
+ :auth_names => auth_names,
232
+ :return_type => return_type
233
+ )
234
+
235
+ data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
236
+ if @api_client.config.debugging
237
+ @api_client.config.logger.debug "API called: SuggestionsApi#update_suggestion\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
238
+ end
239
+ return data, status_code, headers
240
+ end
241
+ end
242
+ end
@@ -0,0 +1,154 @@
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 'cgi'
14
+
15
+ module OpenapiClient
16
+ class WebhooksApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Get implementation instructions
23
+ # Get step-by-step instructions for implementing a link
24
+ # @param suggestion_id [String] ID of the suggestion to implement
25
+ # @param [Hash] opts the optional parameters
26
+ # @return [ImplementationInstructions]
27
+ def get_implementation_instructions(suggestion_id, opts = {})
28
+ data, _status_code, _headers = get_implementation_instructions_with_http_info(suggestion_id, opts)
29
+ data
30
+ end
31
+
32
+ # Get implementation instructions
33
+ # Get step-by-step instructions for implementing a link
34
+ # @param suggestion_id [String] ID of the suggestion to implement
35
+ # @param [Hash] opts the optional parameters
36
+ # @return [Array<(ImplementationInstructions, Integer, Hash)>] ImplementationInstructions data, response status code and response headers
37
+ def get_implementation_instructions_with_http_info(suggestion_id, opts = {})
38
+ if @api_client.config.debugging
39
+ @api_client.config.logger.debug 'Calling API: WebhooksApi.get_implementation_instructions ...'
40
+ end
41
+ # verify the required parameter 'suggestion_id' is set
42
+ if @api_client.config.client_side_validation && suggestion_id.nil?
43
+ fail ArgumentError, "Missing the required parameter 'suggestion_id' when calling WebhooksApi.get_implementation_instructions"
44
+ end
45
+ # resource path
46
+ local_var_path = '/api/webhook/implement-link'
47
+
48
+ # query parameters
49
+ query_params = opts[:query_params] || {}
50
+ query_params[:'suggestionId'] = suggestion_id
51
+
52
+ # header parameters
53
+ header_params = opts[:header_params] || {}
54
+ # HTTP header 'Accept' (if needed)
55
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
56
+
57
+ # form parameters
58
+ form_params = opts[:form_params] || {}
59
+
60
+ # http body (model)
61
+ post_body = opts[:debug_body]
62
+
63
+ # return_type
64
+ return_type = opts[:debug_return_type] || 'ImplementationInstructions'
65
+
66
+ # auth_names
67
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
68
+
69
+ new_options = opts.merge(
70
+ :operation => :"WebhooksApi.get_implementation_instructions",
71
+ :header_params => header_params,
72
+ :query_params => query_params,
73
+ :form_params => form_params,
74
+ :body => post_body,
75
+ :auth_names => auth_names,
76
+ :return_type => return_type
77
+ )
78
+
79
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
80
+ if @api_client.config.debugging
81
+ @api_client.config.logger.debug "API called: WebhooksApi#get_implementation_instructions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
82
+ end
83
+ return data, status_code, headers
84
+ end
85
+
86
+ # Report implementation status
87
+ # Report the status of a link implementation
88
+ # @param report_implementation_status_request [ReportImplementationStatusRequest]
89
+ # @param [Hash] opts the optional parameters
90
+ # @return [ReportImplementationStatus200Response]
91
+ def report_implementation_status(report_implementation_status_request, opts = {})
92
+ data, _status_code, _headers = report_implementation_status_with_http_info(report_implementation_status_request, opts)
93
+ data
94
+ end
95
+
96
+ # Report implementation status
97
+ # Report the status of a link implementation
98
+ # @param report_implementation_status_request [ReportImplementationStatusRequest]
99
+ # @param [Hash] opts the optional parameters
100
+ # @return [Array<(ReportImplementationStatus200Response, Integer, Hash)>] ReportImplementationStatus200Response data, response status code and response headers
101
+ def report_implementation_status_with_http_info(report_implementation_status_request, opts = {})
102
+ if @api_client.config.debugging
103
+ @api_client.config.logger.debug 'Calling API: WebhooksApi.report_implementation_status ...'
104
+ end
105
+ # verify the required parameter 'report_implementation_status_request' is set
106
+ if @api_client.config.client_side_validation && report_implementation_status_request.nil?
107
+ fail ArgumentError, "Missing the required parameter 'report_implementation_status_request' when calling WebhooksApi.report_implementation_status"
108
+ end
109
+ # resource path
110
+ local_var_path = '/api/webhook/implement-link'
111
+
112
+ # query parameters
113
+ query_params = opts[:query_params] || {}
114
+
115
+ # header parameters
116
+ header_params = opts[:header_params] || {}
117
+ # HTTP header 'Accept' (if needed)
118
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
119
+ # HTTP header 'Content-Type'
120
+ content_type = @api_client.select_header_content_type(['application/json'])
121
+ if !content_type.nil?
122
+ header_params['Content-Type'] = content_type
123
+ end
124
+
125
+ # form parameters
126
+ form_params = opts[:form_params] || {}
127
+
128
+ # http body (model)
129
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(report_implementation_status_request)
130
+
131
+ # return_type
132
+ return_type = opts[:debug_return_type] || 'ReportImplementationStatus200Response'
133
+
134
+ # auth_names
135
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
136
+
137
+ new_options = opts.merge(
138
+ :operation => :"WebhooksApi.report_implementation_status",
139
+ :header_params => header_params,
140
+ :query_params => query_params,
141
+ :form_params => form_params,
142
+ :body => post_body,
143
+ :auth_names => auth_names,
144
+ :return_type => return_type
145
+ )
146
+
147
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
148
+ if @api_client.config.debugging
149
+ @api_client.config.logger.debug "API called: WebhooksApi#report_implementation_status\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
150
+ end
151
+ return data, status_code, headers
152
+ end
153
+ end
154
+ end