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,355 @@
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 LinkOpportunity
18
+ # AI-calculated relevance score (0-1)
19
+ attr_accessor :relevance_score
20
+
21
+ # Suggested anchor text
22
+ attr_accessor :anchor_text
23
+
24
+ # Context where the link should be placed
25
+ attr_accessor :context
26
+
27
+ attr_accessor :source_page
28
+
29
+ attr_accessor :target_page
30
+
31
+ # AI reasoning for the suggestion
32
+ attr_accessor :reasoning
33
+
34
+ # Attribute mapping from ruby-style variable name to JSON key.
35
+ def self.attribute_map
36
+ {
37
+ :'relevance_score' => :'relevanceScore',
38
+ :'anchor_text' => :'anchorText',
39
+ :'context' => :'context',
40
+ :'source_page' => :'sourcePage',
41
+ :'target_page' => :'targetPage',
42
+ :'reasoning' => :'reasoning'
43
+ }
44
+ end
45
+
46
+ # Returns attribute mapping this model knows about
47
+ def self.acceptable_attribute_map
48
+ attribute_map
49
+ end
50
+
51
+ # Returns all the JSON keys this model knows about
52
+ def self.acceptable_attributes
53
+ acceptable_attribute_map.values
54
+ end
55
+
56
+ # Attribute type mapping.
57
+ def self.openapi_types
58
+ {
59
+ :'relevance_score' => :'Float',
60
+ :'anchor_text' => :'String',
61
+ :'context' => :'String',
62
+ :'source_page' => :'PageInfo',
63
+ :'target_page' => :'PageInfo',
64
+ :'reasoning' => :'String'
65
+ }
66
+ end
67
+
68
+ # List of attributes with nullable: true
69
+ def self.openapi_nullable
70
+ Set.new([
71
+ ])
72
+ end
73
+
74
+ # Initializes the object
75
+ # @param [Hash] attributes Model attributes in the form of hash
76
+ def initialize(attributes = {})
77
+ if (!attributes.is_a?(Hash))
78
+ fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::LinkOpportunity` initialize method"
79
+ end
80
+
81
+ # check to see if the attribute exists and convert string to symbol for hash key
82
+ acceptable_attribute_map = self.class.acceptable_attribute_map
83
+ attributes = attributes.each_with_object({}) { |(k, v), h|
84
+ if (!acceptable_attribute_map.key?(k.to_sym))
85
+ fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::LinkOpportunity`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
86
+ end
87
+ h[k.to_sym] = v
88
+ }
89
+
90
+ if attributes.key?(:'relevance_score')
91
+ self.relevance_score = attributes[:'relevance_score']
92
+ else
93
+ self.relevance_score = nil
94
+ end
95
+
96
+ if attributes.key?(:'anchor_text')
97
+ self.anchor_text = attributes[:'anchor_text']
98
+ else
99
+ self.anchor_text = nil
100
+ end
101
+
102
+ if attributes.key?(:'context')
103
+ self.context = attributes[:'context']
104
+ end
105
+
106
+ if attributes.key?(:'source_page')
107
+ self.source_page = attributes[:'source_page']
108
+ else
109
+ self.source_page = nil
110
+ end
111
+
112
+ if attributes.key?(:'target_page')
113
+ self.target_page = attributes[:'target_page']
114
+ else
115
+ self.target_page = nil
116
+ end
117
+
118
+ if attributes.key?(:'reasoning')
119
+ self.reasoning = attributes[:'reasoning']
120
+ end
121
+ end
122
+
123
+ # Show invalid properties with the reasons. Usually used together with valid?
124
+ # @return Array for valid properties with the reasons
125
+ def list_invalid_properties
126
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
127
+ invalid_properties = Array.new
128
+ if @relevance_score.nil?
129
+ invalid_properties.push('invalid value for "relevance_score", relevance_score cannot be nil.')
130
+ end
131
+
132
+ if @relevance_score > 1
133
+ invalid_properties.push('invalid value for "relevance_score", must be smaller than or equal to 1.')
134
+ end
135
+
136
+ if @relevance_score < 0
137
+ invalid_properties.push('invalid value for "relevance_score", must be greater than or equal to 0.')
138
+ end
139
+
140
+ if @anchor_text.nil?
141
+ invalid_properties.push('invalid value for "anchor_text", anchor_text cannot be nil.')
142
+ end
143
+
144
+ if @source_page.nil?
145
+ invalid_properties.push('invalid value for "source_page", source_page cannot be nil.')
146
+ end
147
+
148
+ if @target_page.nil?
149
+ invalid_properties.push('invalid value for "target_page", target_page cannot be nil.')
150
+ end
151
+
152
+ invalid_properties
153
+ end
154
+
155
+ # Check to see if the all the properties in the model are valid
156
+ # @return true if the model is valid
157
+ def valid?
158
+ warn '[DEPRECATED] the `valid?` method is obsolete'
159
+ return false if @relevance_score.nil?
160
+ return false if @relevance_score > 1
161
+ return false if @relevance_score < 0
162
+ return false if @anchor_text.nil?
163
+ return false if @source_page.nil?
164
+ return false if @target_page.nil?
165
+ true
166
+ end
167
+
168
+ # Custom attribute writer method with validation
169
+ # @param [Object] relevance_score Value to be assigned
170
+ def relevance_score=(relevance_score)
171
+ if relevance_score.nil?
172
+ fail ArgumentError, 'relevance_score cannot be nil'
173
+ end
174
+
175
+ if relevance_score > 1
176
+ fail ArgumentError, 'invalid value for "relevance_score", must be smaller than or equal to 1.'
177
+ end
178
+
179
+ if relevance_score < 0
180
+ fail ArgumentError, 'invalid value for "relevance_score", must be greater than or equal to 0.'
181
+ end
182
+
183
+ @relevance_score = relevance_score
184
+ end
185
+
186
+ # Custom attribute writer method with validation
187
+ # @param [Object] anchor_text Value to be assigned
188
+ def anchor_text=(anchor_text)
189
+ if anchor_text.nil?
190
+ fail ArgumentError, 'anchor_text cannot be nil'
191
+ end
192
+
193
+ @anchor_text = anchor_text
194
+ end
195
+
196
+ # Custom attribute writer method with validation
197
+ # @param [Object] source_page Value to be assigned
198
+ def source_page=(source_page)
199
+ if source_page.nil?
200
+ fail ArgumentError, 'source_page cannot be nil'
201
+ end
202
+
203
+ @source_page = source_page
204
+ end
205
+
206
+ # Custom attribute writer method with validation
207
+ # @param [Object] target_page Value to be assigned
208
+ def target_page=(target_page)
209
+ if target_page.nil?
210
+ fail ArgumentError, 'target_page cannot be nil'
211
+ end
212
+
213
+ @target_page = target_page
214
+ end
215
+
216
+ # Checks equality by comparing each attribute.
217
+ # @param [Object] Object to be compared
218
+ def ==(o)
219
+ return true if self.equal?(o)
220
+ self.class == o.class &&
221
+ relevance_score == o.relevance_score &&
222
+ anchor_text == o.anchor_text &&
223
+ context == o.context &&
224
+ source_page == o.source_page &&
225
+ target_page == o.target_page &&
226
+ reasoning == o.reasoning
227
+ end
228
+
229
+ # @see the `==` method
230
+ # @param [Object] Object to be compared
231
+ def eql?(o)
232
+ self == o
233
+ end
234
+
235
+ # Calculates hash code according to all attributes.
236
+ # @return [Integer] Hash code
237
+ def hash
238
+ [relevance_score, anchor_text, context, source_page, target_page, reasoning].hash
239
+ end
240
+
241
+ # Builds the object from hash
242
+ # @param [Hash] attributes Model attributes in the form of hash
243
+ # @return [Object] Returns the model itself
244
+ def self.build_from_hash(attributes)
245
+ return nil unless attributes.is_a?(Hash)
246
+ attributes = attributes.transform_keys(&:to_sym)
247
+ transformed_hash = {}
248
+ openapi_types.each_pair do |key, type|
249
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
250
+ transformed_hash["#{key}"] = nil
251
+ elsif type =~ /\AArray<(.*)>/i
252
+ # check to ensure the input is an array given that the attribute
253
+ # is documented as an array but the input is not
254
+ if attributes[attribute_map[key]].is_a?(Array)
255
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
256
+ end
257
+ elsif !attributes[attribute_map[key]].nil?
258
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
259
+ end
260
+ end
261
+ new(transformed_hash)
262
+ end
263
+
264
+ # Deserializes the data based on type
265
+ # @param string type Data type
266
+ # @param string value Value to be deserialized
267
+ # @return [Object] Deserialized data
268
+ def self._deserialize(type, value)
269
+ case type.to_sym
270
+ when :Time
271
+ Time.parse(value)
272
+ when :Date
273
+ Date.parse(value)
274
+ when :String
275
+ value.to_s
276
+ when :Integer
277
+ value.to_i
278
+ when :Float
279
+ value.to_f
280
+ when :Boolean
281
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
282
+ true
283
+ else
284
+ false
285
+ end
286
+ when :Object
287
+ # generic object (usually a Hash), return directly
288
+ value
289
+ when /\AArray<(?<inner_type>.+)>\z/
290
+ inner_type = Regexp.last_match[:inner_type]
291
+ value.map { |v| _deserialize(inner_type, v) }
292
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
293
+ k_type = Regexp.last_match[:k_type]
294
+ v_type = Regexp.last_match[:v_type]
295
+ {}.tap do |hash|
296
+ value.each do |k, v|
297
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
298
+ end
299
+ end
300
+ else # model
301
+ # models (e.g. Pet) or oneOf
302
+ klass = OpenapiClient.const_get(type)
303
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
304
+ end
305
+ end
306
+
307
+ # Returns the string representation of the object
308
+ # @return [String] String presentation of the object
309
+ def to_s
310
+ to_hash.to_s
311
+ end
312
+
313
+ # to_body is an alias to to_hash (backward compatibility)
314
+ # @return [Hash] Returns the object in the form of hash
315
+ def to_body
316
+ to_hash
317
+ end
318
+
319
+ # Returns the object in the form of hash
320
+ # @return [Hash] Returns the object in the form of hash
321
+ def to_hash
322
+ hash = {}
323
+ self.class.attribute_map.each_pair do |attr, param|
324
+ value = self.send(attr)
325
+ if value.nil?
326
+ is_nullable = self.class.openapi_nullable.include?(attr)
327
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
328
+ end
329
+
330
+ hash[param] = _to_hash(value)
331
+ end
332
+ hash
333
+ end
334
+
335
+ # Outputs non-array value in the form of hash
336
+ # For object, use to_hash. Otherwise, just return the value
337
+ # @param [Object] value Any valid value
338
+ # @return [Hash] Returns the value in the form of hash
339
+ def _to_hash(value)
340
+ if value.is_a?(Array)
341
+ value.compact.map { |v| _to_hash(v) }
342
+ elsif value.is_a?(Hash)
343
+ {}.tap do |hash|
344
+ value.each { |k, v| hash[k] = _to_hash(v) }
345
+ end
346
+ elsif value.respond_to? :to_hash
347
+ value.to_hash
348
+ else
349
+ value
350
+ end
351
+ end
352
+
353
+ end
354
+
355
+ end
@@ -0,0 +1,251 @@
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 ListImplementations200Response
18
+ attr_accessor :success
19
+
20
+ attr_accessor :implementations
21
+
22
+ # Number of implementations returned
23
+ attr_accessor :count
24
+
25
+ # Applied filters
26
+ attr_accessor :filters
27
+
28
+ # Attribute mapping from ruby-style variable name to JSON key.
29
+ def self.attribute_map
30
+ {
31
+ :'success' => :'success',
32
+ :'implementations' => :'implementations',
33
+ :'count' => :'count',
34
+ :'filters' => :'filters'
35
+ }
36
+ end
37
+
38
+ # Returns attribute mapping this model knows about
39
+ def self.acceptable_attribute_map
40
+ attribute_map
41
+ end
42
+
43
+ # Returns all the JSON keys this model knows about
44
+ def self.acceptable_attributes
45
+ acceptable_attribute_map.values
46
+ end
47
+
48
+ # Attribute type mapping.
49
+ def self.openapi_types
50
+ {
51
+ :'success' => :'Boolean',
52
+ :'implementations' => :'Array<Implementation>',
53
+ :'count' => :'Integer',
54
+ :'filters' => :'Object'
55
+ }
56
+ end
57
+
58
+ # List of attributes with nullable: true
59
+ def self.openapi_nullable
60
+ Set.new([
61
+ ])
62
+ end
63
+
64
+ # Initializes the object
65
+ # @param [Hash] attributes Model attributes in the form of hash
66
+ def initialize(attributes = {})
67
+ if (!attributes.is_a?(Hash))
68
+ fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::ListImplementations200Response` initialize method"
69
+ end
70
+
71
+ # check to see if the attribute exists and convert string to symbol for hash key
72
+ acceptable_attribute_map = self.class.acceptable_attribute_map
73
+ attributes = attributes.each_with_object({}) { |(k, v), h|
74
+ if (!acceptable_attribute_map.key?(k.to_sym))
75
+ fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::ListImplementations200Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
76
+ end
77
+ h[k.to_sym] = v
78
+ }
79
+
80
+ if attributes.key?(:'success')
81
+ self.success = attributes[:'success']
82
+ end
83
+
84
+ if attributes.key?(:'implementations')
85
+ if (value = attributes[:'implementations']).is_a?(Array)
86
+ self.implementations = value
87
+ end
88
+ end
89
+
90
+ if attributes.key?(:'count')
91
+ self.count = attributes[:'count']
92
+ end
93
+
94
+ if attributes.key?(:'filters')
95
+ self.filters = attributes[:'filters']
96
+ end
97
+ end
98
+
99
+ # Show invalid properties with the reasons. Usually used together with valid?
100
+ # @return Array for valid properties with the reasons
101
+ def list_invalid_properties
102
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
103
+ invalid_properties = Array.new
104
+ invalid_properties
105
+ end
106
+
107
+ # Check to see if the all the properties in the model are valid
108
+ # @return true if the model is valid
109
+ def valid?
110
+ warn '[DEPRECATED] the `valid?` method is obsolete'
111
+ true
112
+ end
113
+
114
+ # Checks equality by comparing each attribute.
115
+ # @param [Object] Object to be compared
116
+ def ==(o)
117
+ return true if self.equal?(o)
118
+ self.class == o.class &&
119
+ success == o.success &&
120
+ implementations == o.implementations &&
121
+ count == o.count &&
122
+ filters == o.filters
123
+ end
124
+
125
+ # @see the `==` method
126
+ # @param [Object] Object to be compared
127
+ def eql?(o)
128
+ self == o
129
+ end
130
+
131
+ # Calculates hash code according to all attributes.
132
+ # @return [Integer] Hash code
133
+ def hash
134
+ [success, implementations, count, filters].hash
135
+ end
136
+
137
+ # Builds the object from hash
138
+ # @param [Hash] attributes Model attributes in the form of hash
139
+ # @return [Object] Returns the model itself
140
+ def self.build_from_hash(attributes)
141
+ return nil unless attributes.is_a?(Hash)
142
+ attributes = attributes.transform_keys(&:to_sym)
143
+ transformed_hash = {}
144
+ openapi_types.each_pair do |key, type|
145
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
146
+ transformed_hash["#{key}"] = nil
147
+ elsif type =~ /\AArray<(.*)>/i
148
+ # check to ensure the input is an array given that the attribute
149
+ # is documented as an array but the input is not
150
+ if attributes[attribute_map[key]].is_a?(Array)
151
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
152
+ end
153
+ elsif !attributes[attribute_map[key]].nil?
154
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
155
+ end
156
+ end
157
+ new(transformed_hash)
158
+ end
159
+
160
+ # Deserializes the data based on type
161
+ # @param string type Data type
162
+ # @param string value Value to be deserialized
163
+ # @return [Object] Deserialized data
164
+ def self._deserialize(type, value)
165
+ case type.to_sym
166
+ when :Time
167
+ Time.parse(value)
168
+ when :Date
169
+ Date.parse(value)
170
+ when :String
171
+ value.to_s
172
+ when :Integer
173
+ value.to_i
174
+ when :Float
175
+ value.to_f
176
+ when :Boolean
177
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
178
+ true
179
+ else
180
+ false
181
+ end
182
+ when :Object
183
+ # generic object (usually a Hash), return directly
184
+ value
185
+ when /\AArray<(?<inner_type>.+)>\z/
186
+ inner_type = Regexp.last_match[:inner_type]
187
+ value.map { |v| _deserialize(inner_type, v) }
188
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
189
+ k_type = Regexp.last_match[:k_type]
190
+ v_type = Regexp.last_match[:v_type]
191
+ {}.tap do |hash|
192
+ value.each do |k, v|
193
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
194
+ end
195
+ end
196
+ else # model
197
+ # models (e.g. Pet) or oneOf
198
+ klass = OpenapiClient.const_get(type)
199
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
200
+ end
201
+ end
202
+
203
+ # Returns the string representation of the object
204
+ # @return [String] String presentation of the object
205
+ def to_s
206
+ to_hash.to_s
207
+ end
208
+
209
+ # to_body is an alias to to_hash (backward compatibility)
210
+ # @return [Hash] Returns the object in the form of hash
211
+ def to_body
212
+ to_hash
213
+ end
214
+
215
+ # Returns the object in the form of hash
216
+ # @return [Hash] Returns the object in the form of hash
217
+ def to_hash
218
+ hash = {}
219
+ self.class.attribute_map.each_pair do |attr, param|
220
+ value = self.send(attr)
221
+ if value.nil?
222
+ is_nullable = self.class.openapi_nullable.include?(attr)
223
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
224
+ end
225
+
226
+ hash[param] = _to_hash(value)
227
+ end
228
+ hash
229
+ end
230
+
231
+ # Outputs non-array value in the form of hash
232
+ # For object, use to_hash. Otherwise, just return the value
233
+ # @param [Object] value Any valid value
234
+ # @return [Hash] Returns the value in the form of hash
235
+ def _to_hash(value)
236
+ if value.is_a?(Array)
237
+ value.compact.map { |v| _to_hash(v) }
238
+ elsif value.is_a?(Hash)
239
+ {}.tap do |hash|
240
+ value.each { |k, v| hash[k] = _to_hash(v) }
241
+ end
242
+ elsif value.respond_to? :to_hash
243
+ value.to_hash
244
+ else
245
+ value
246
+ end
247
+ end
248
+
249
+ end
250
+
251
+ end