mencoro 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 (401) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/README.md +304 -0
  4. data/Rakefile +10 -0
  5. data/docs/AcceptedJobResource.md +22 -0
  6. data/docs/AccountApi.md +141 -0
  7. data/docs/AiResponseReportResource.md +28 -0
  8. data/docs/AiResponseResource.md +36 -0
  9. data/docs/AnalyticsApi.md +1320 -0
  10. data/docs/ApplyClusteringJobOutcome.md +26 -0
  11. data/docs/ApplyClusteringJobOutcomeClustersInner.md +22 -0
  12. data/docs/ApplyClusteringJobOutcomeFailedInner.md +22 -0
  13. data/docs/ApplyClusteringJobOutcomeSkippedClustersInner.md +20 -0
  14. data/docs/ApplyClusteringJobOutcomeSuccessfulInner.md +20 -0
  15. data/docs/AsyncJobResource.md +24 -0
  16. data/docs/BatchChangeTrackedQueryCheckFrequencyRequestData.md +20 -0
  17. data/docs/BatchChangeTrackedQueryPassesRequestData.md +20 -0
  18. data/docs/BatchCreateQueryClustersOutcome.md +20 -0
  19. data/docs/BatchCreateQueryClustersOutcomeFailedInner.md +22 -0
  20. data/docs/BatchCreateQueryClustersOutcomeSuccessfulInner.md +20 -0
  21. data/docs/BatchCreateQueryClustersRequestData.md +18 -0
  22. data/docs/BatchCreateTrackedQueriesRequestData.md +30 -0
  23. data/docs/BatchCreateTrackedQueriesResultResource.md +20 -0
  24. data/docs/BatchCreateTrackedQueriesResultResourceFailedInner.md +26 -0
  25. data/docs/BatchCreateTrackedQueriesResultResourceSuccessfulInner.md +24 -0
  26. data/docs/BatchForceCheckTrackedQueries200Response.md +20 -0
  27. data/docs/BatchForceCheckTrackedQueries200ResponseFailedInner.md +22 -0
  28. data/docs/BatchPauseTrackedQueries200Response.md +20 -0
  29. data/docs/BatchPauseTrackedQueries200ResponseFailedInner.md +22 -0
  30. data/docs/BatchPauseTrackedQueries200ResponseSuccessfulInner.md +18 -0
  31. data/docs/BatchResumeTrackedQueries200Response.md +20 -0
  32. data/docs/BatchTargetsRequestData.md +18 -0
  33. data/docs/BatchWriteOutcome.md +20 -0
  34. data/docs/BatchWriteOutcomeFailedInner.md +22 -0
  35. data/docs/BillingApi.md +77 -0
  36. data/docs/BrandProfileResource.md +24 -0
  37. data/docs/BulkAddClustersToTrackedQueries200Response.md +20 -0
  38. data/docs/BulkAddClustersToTrackedQueriesRequest.md +20 -0
  39. data/docs/BulkRemoveClustersFromTrackedQueries200Response.md +20 -0
  40. data/docs/BulkRemoveClustersFromTrackedQueriesRequest.md +20 -0
  41. data/docs/CapturesApi.md +267 -0
  42. data/docs/ChangeMemberRoleRequest.md +18 -0
  43. data/docs/ChangeTrackedQueryCheckFrequencyRequestData.md +18 -0
  44. data/docs/ChangeTrackedQueryPassesRequestData.md +18 -0
  45. data/docs/CitationResource.md +36 -0
  46. data/docs/ClusterMembershipRequestData.md +18 -0
  47. data/docs/ClustersApi.md +465 -0
  48. data/docs/CompetitorResource.md +24 -0
  49. data/docs/CreateCompetitorRequest.md +22 -0
  50. data/docs/CreateInvitation200Response.md +22 -0
  51. data/docs/CreateInvitation201Response.md +32 -0
  52. data/docs/CreateInvitationRequest.md +20 -0
  53. data/docs/CreateOrganization201Response.md +22 -0
  54. data/docs/CreateOrganizationRequest.md +18 -0
  55. data/docs/CreateProjectRequest.md +24 -0
  56. data/docs/CreateProjectRequestCompetitorsInner.md +22 -0
  57. data/docs/CreateQueryCluster409Response.md +22 -0
  58. data/docs/CreateQueryClusterRequest.md +18 -0
  59. data/docs/DeleteQueryCluster200Response.md +22 -0
  60. data/docs/DiscoveryApi.md +311 -0
  61. data/docs/EntitlementsResource.md +38 -0
  62. data/docs/GetAvailableFilters200Response.md +22 -0
  63. data/docs/GetAvailableFilters200ResponseClustersInner.md +20 -0
  64. data/docs/GetMeStats200Response.md +20 -0
  65. data/docs/GetMeStats200ResponseOrganizations.md +18 -0
  66. data/docs/GetMeStats200ResponseProjects.md +20 -0
  67. data/docs/GetMembershipStats200Response.md +30 -0
  68. data/docs/GetMentionSamples400Response.md +24 -0
  69. data/docs/GetMentionSamples400ResponseDetailsValueInner.md +22 -0
  70. data/docs/GetMetricGlossary200Response.md +18 -0
  71. data/docs/GetMetricGlossary200ResponseMetricsInner.md +30 -0
  72. data/docs/GetOrganizationOverview200Response.md +20 -0
  73. data/docs/GetOrganizationOverview200ResponseAggregate.md +30 -0
  74. data/docs/GetOrganizationOverview200ResponseProjectsInner.md +32 -0
  75. data/docs/GetOrganizationStats200Response.md +22 -0
  76. data/docs/GetOrganizationStats200ResponseInvitations.md +18 -0
  77. data/docs/GetOrganizationStats200ResponseMembers.md +18 -0
  78. data/docs/GetOrganizationStats200ResponseProjects.md +20 -0
  79. data/docs/GetShareOfVoiceFormula200Response.md +24 -0
  80. data/docs/GetTrackingCoverage200Response.md +30 -0
  81. data/docs/GetTrackingCoverage200ResponseSampleInner.md +28 -0
  82. data/docs/InvitationResource.md +30 -0
  83. data/docs/InvitationsApi.md +243 -0
  84. data/docs/JobsApi.md +79 -0
  85. data/docs/KeywordListingResource.md +88 -0
  86. data/docs/KeywordListingResourceMentionTypeCounts.md +26 -0
  87. data/docs/ListAiResponses200Response.md +20 -0
  88. data/docs/ListCompetitors200Response.md +20 -0
  89. data/docs/ListInvitations200Response.md +20 -0
  90. data/docs/ListKeywordListings200Response.md +24 -0
  91. data/docs/ListMembers200Response.md +20 -0
  92. data/docs/ListOrganizations200Response.md +20 -0
  93. data/docs/ListProjects200Response.md +20 -0
  94. data/docs/ListQueryClusters200Response.md +20 -0
  95. data/docs/ListSearchSnapshots200Response.md +20 -0
  96. data/docs/ListShoppingSnapshots200Response.md +20 -0
  97. data/docs/MeResource.md +34 -0
  98. data/docs/MemberResource.md +28 -0
  99. data/docs/MembersApi.md +391 -0
  100. data/docs/OperationEffect.md +22 -0
  101. data/docs/OrganizationOperationsApi.md +77 -0
  102. data/docs/OrganizationResource.md +32 -0
  103. data/docs/OrganizationsApi.md +807 -0
  104. data/docs/PreviewOrganizationOperation200Response.md +34 -0
  105. data/docs/PreviewOrganizationOperation200ResponseOrganization.md +20 -0
  106. data/docs/PreviewOrganizationOperationRequest.md +24 -0
  107. data/docs/ProjectDetailResource.md +32 -0
  108. data/docs/ProjectDetailResourceCompetitorsInner.md +24 -0
  109. data/docs/ProjectResource.md +50 -0
  110. data/docs/ProjectedMonthlyChecksResource.md +20 -0
  111. data/docs/ProjectsApi.md +999 -0
  112. data/docs/QueryClusterResource.md +22 -0
  113. data/docs/ReportAiResponseRequest.md +22 -0
  114. data/docs/SearchResultResource.md +32 -0
  115. data/docs/SearchSnapshotResource.md +28 -0
  116. data/docs/SearchTrackedQueries200Response.md +20 -0
  117. data/docs/ShoppingOfferResource.md +38 -0
  118. data/docs/ShoppingSnapshotResource.md +28 -0
  119. data/docs/StartBrandDiscoveryJobRequest.md +20 -0
  120. data/docs/StartBrandNameSuggestionJobRequest.md +24 -0
  121. data/docs/StartClusteringJobRequestData.md +22 -0
  122. data/docs/StartKeywordDiscoveryJobRequest.md +24 -0
  123. data/docs/StartPromptDiscoveryJobRequest.md +24 -0
  124. data/docs/SubmittedChecksResource.md +20 -0
  125. data/docs/SubscriptionResource.md +42 -0
  126. data/docs/TrackedQueriesApi.md +1549 -0
  127. data/docs/TrackedQueryCountResource.md +20 -0
  128. data/docs/TrackedQueryDetailResource.md +38 -0
  129. data/docs/TrackedQueryResource.md +52 -0
  130. data/docs/TrackedQueryUsageResource.md +18 -0
  131. data/docs/UpdateOrganizationRequest.md +22 -0
  132. data/docs/UpdateProjectBrandProfileRequest.md +20 -0
  133. data/docs/UpdateProjectRequest.md +18 -0
  134. data/git_push.sh +57 -0
  135. data/lib/mencoro/api/account_api.rb +136 -0
  136. data/lib/mencoro/api/analytics_api.rb +1555 -0
  137. data/lib/mencoro/api/billing_api.rb +85 -0
  138. data/lib/mencoro/api/captures_api.rb +338 -0
  139. data/lib/mencoro/api/clusters_api.rb +548 -0
  140. data/lib/mencoro/api/discovery_api.rb +360 -0
  141. data/lib/mencoro/api/invitations_api.rb +302 -0
  142. data/lib/mencoro/api/jobs_api.rb +91 -0
  143. data/lib/mencoro/api/members_api.rb +453 -0
  144. data/lib/mencoro/api/organization_operations_api.rb +90 -0
  145. data/lib/mencoro/api/organizations_api.rb +835 -0
  146. data/lib/mencoro/api/projects_api.rb +1158 -0
  147. data/lib/mencoro/api/tracked_queries_api.rb +1792 -0
  148. data/lib/mencoro/api_client.rb +441 -0
  149. data/lib/mencoro/api_error.rb +58 -0
  150. data/lib/mencoro/api_model_base.rb +88 -0
  151. data/lib/mencoro/configuration.rb +392 -0
  152. data/lib/mencoro/models/accepted_job_resource.rb +220 -0
  153. data/lib/mencoro/models/ai_response_report_resource.rb +311 -0
  154. data/lib/mencoro/models/ai_response_resource.rb +412 -0
  155. data/lib/mencoro/models/apply_clustering_job_outcome.rb +199 -0
  156. data/lib/mencoro/models/apply_clustering_job_outcome_clusters_inner.rb +165 -0
  157. data/lib/mencoro/models/apply_clustering_job_outcome_failed_inner.rb +165 -0
  158. data/lib/mencoro/models/apply_clustering_job_outcome_skipped_clusters_inner.rb +156 -0
  159. data/lib/mencoro/models/apply_clustering_job_outcome_successful_inner.rb +158 -0
  160. data/lib/mencoro/models/async_job_resource.rb +256 -0
  161. data/lib/mencoro/models/batch_change_tracked_query_check_frequency_request_data.rb +237 -0
  162. data/lib/mencoro/models/batch_change_tracked_query_passes_request_data.rb +231 -0
  163. data/lib/mencoro/models/batch_create_query_clusters_outcome.rb +163 -0
  164. data/lib/mencoro/models/batch_create_query_clusters_outcome_failed_inner.rb +165 -0
  165. data/lib/mencoro/models/batch_create_query_clusters_outcome_successful_inner.rb +156 -0
  166. data/lib/mencoro/models/batch_create_query_clusters_request_data.rb +186 -0
  167. data/lib/mencoro/models/batch_create_tracked_queries_request_data.rb +399 -0
  168. data/lib/mencoro/models/batch_create_tracked_queries_result_resource.rb +163 -0
  169. data/lib/mencoro/models/batch_create_tracked_queries_result_resource_failed_inner.rb +183 -0
  170. data/lib/mencoro/models/batch_create_tracked_queries_result_resource_successful_inner.rb +174 -0
  171. data/lib/mencoro/models/batch_force_check_tracked_queries200_response.rb +162 -0
  172. data/lib/mencoro/models/batch_force_check_tracked_queries200_response_failed_inner.rb +165 -0
  173. data/lib/mencoro/models/batch_pause_tracked_queries200_response.rb +162 -0
  174. data/lib/mencoro/models/batch_pause_tracked_queries200_response_failed_inner.rb +165 -0
  175. data/lib/mencoro/models/batch_pause_tracked_queries200_response_successful_inner.rb +147 -0
  176. data/lib/mencoro/models/batch_resume_tracked_queries200_response.rb +162 -0
  177. data/lib/mencoro/models/batch_targets_request_data.rb +186 -0
  178. data/lib/mencoro/models/batch_write_outcome.rb +163 -0
  179. data/lib/mencoro/models/batch_write_outcome_failed_inner.rb +166 -0
  180. data/lib/mencoro/models/brand_profile_resource.rb +235 -0
  181. data/lib/mencoro/models/bulk_add_clusters_to_tracked_queries200_response.rb +162 -0
  182. data/lib/mencoro/models/bulk_add_clusters_to_tracked_queries_request.rb +218 -0
  183. data/lib/mencoro/models/bulk_remove_clusters_from_tracked_queries200_response.rb +162 -0
  184. data/lib/mencoro/models/bulk_remove_clusters_from_tracked_queries_request.rb +218 -0
  185. data/lib/mencoro/models/change_member_role_request.rb +181 -0
  186. data/lib/mencoro/models/change_tracked_query_check_frequency_request_data.rb +190 -0
  187. data/lib/mencoro/models/change_tracked_query_passes_request_data.rb +184 -0
  188. data/lib/mencoro/models/citation_resource.rb +306 -0
  189. data/lib/mencoro/models/cluster_membership_request_data.rb +186 -0
  190. data/lib/mencoro/models/competitor_resource.rb +250 -0
  191. data/lib/mencoro/models/create_competitor_request.rb +247 -0
  192. data/lib/mencoro/models/create_invitation200_response.rb +202 -0
  193. data/lib/mencoro/models/create_invitation201_response.rb +347 -0
  194. data/lib/mencoro/models/create_invitation_request.rb +192 -0
  195. data/lib/mencoro/models/create_organization201_response.rb +166 -0
  196. data/lib/mencoro/models/create_organization_request.rb +175 -0
  197. data/lib/mencoro/models/create_project_request.rb +307 -0
  198. data/lib/mencoro/models/create_project_request_competitors_inner.rb +256 -0
  199. data/lib/mencoro/models/create_query_cluster409_response.rb +165 -0
  200. data/lib/mencoro/models/create_query_cluster_request.rb +167 -0
  201. data/lib/mencoro/models/delete_query_cluster200_response.rb +168 -0
  202. data/lib/mencoro/models/entitlements_resource.rb +328 -0
  203. data/lib/mencoro/models/get_available_filters200_response.rb +173 -0
  204. data/lib/mencoro/models/get_available_filters200_response_clusters_inner.rb +157 -0
  205. data/lib/mencoro/models/get_me_stats200_response.rb +156 -0
  206. data/lib/mencoro/models/get_me_stats200_response_organizations.rb +167 -0
  207. data/lib/mencoro/models/get_me_stats200_response_projects.rb +196 -0
  208. data/lib/mencoro/models/get_membership_stats200_response.rb +322 -0
  209. data/lib/mencoro/models/get_mention_samples400_response.rb +231 -0
  210. data/lib/mencoro/models/get_mention_samples400_response_details_value_inner.rb +168 -0
  211. data/lib/mencoro/models/get_metric_glossary200_response.rb +149 -0
  212. data/lib/mencoro/models/get_metric_glossary200_response_metrics_inner.rb +240 -0
  213. data/lib/mencoro/models/get_organization_overview200_response.rb +158 -0
  214. data/lib/mencoro/models/get_organization_overview200_response_aggregate.rb +209 -0
  215. data/lib/mencoro/models/get_organization_overview200_response_projects_inner.rb +218 -0
  216. data/lib/mencoro/models/get_organization_stats200_response.rb +165 -0
  217. data/lib/mencoro/models/get_organization_stats200_response_invitations.rb +167 -0
  218. data/lib/mencoro/models/get_organization_stats200_response_members.rb +167 -0
  219. data/lib/mencoro/models/get_organization_stats200_response_projects.rb +196 -0
  220. data/lib/mencoro/models/get_share_of_voice_formula200_response.rb +182 -0
  221. data/lib/mencoro/models/get_tracking_coverage200_response.rb +209 -0
  222. data/lib/mencoro/models/get_tracking_coverage200_response_sample_inner.rb +229 -0
  223. data/lib/mencoro/models/invitation_resource.rb +331 -0
  224. data/lib/mencoro/models/keyword_listing_resource.rb +798 -0
  225. data/lib/mencoro/models/keyword_listing_resource_mention_type_counts.rb +184 -0
  226. data/lib/mencoro/models/list_ai_responses200_response.rb +159 -0
  227. data/lib/mencoro/models/list_competitors200_response.rb +159 -0
  228. data/lib/mencoro/models/list_invitations200_response.rb +158 -0
  229. data/lib/mencoro/models/list_keyword_listings200_response.rb +180 -0
  230. data/lib/mencoro/models/list_members200_response.rb +158 -0
  231. data/lib/mencoro/models/list_organizations200_response.rb +158 -0
  232. data/lib/mencoro/models/list_projects200_response.rb +159 -0
  233. data/lib/mencoro/models/list_query_clusters200_response.rb +159 -0
  234. data/lib/mencoro/models/list_search_snapshots200_response.rb +159 -0
  235. data/lib/mencoro/models/list_shopping_snapshots200_response.rb +159 -0
  236. data/lib/mencoro/models/me_resource.rb +394 -0
  237. data/lib/mencoro/models/member_resource.rb +322 -0
  238. data/lib/mencoro/models/operation_effect.rb +204 -0
  239. data/lib/mencoro/models/organization_resource.rb +326 -0
  240. data/lib/mencoro/models/preview_organization_operation200_response.rb +236 -0
  241. data/lib/mencoro/models/preview_organization_operation200_response_organization.rb +158 -0
  242. data/lib/mencoro/models/preview_organization_operation_request.rb +213 -0
  243. data/lib/mencoro/models/project_detail_resource.rb +380 -0
  244. data/lib/mencoro/models/project_detail_resource_competitors_inner.rb +178 -0
  245. data/lib/mencoro/models/project_resource.rb +422 -0
  246. data/lib/mencoro/models/projected_monthly_checks_resource.rb +211 -0
  247. data/lib/mencoro/models/query_cluster_resource.rb +229 -0
  248. data/lib/mencoro/models/report_ai_response_request.rb +227 -0
  249. data/lib/mencoro/models/search_result_resource.rb +284 -0
  250. data/lib/mencoro/models/search_snapshot_resource.rb +302 -0
  251. data/lib/mencoro/models/search_tracked_queries200_response.rb +158 -0
  252. data/lib/mencoro/models/shopping_offer_resource.rb +381 -0
  253. data/lib/mencoro/models/shopping_snapshot_resource.rb +302 -0
  254. data/lib/mencoro/models/start_brand_discovery_job_request.rb +185 -0
  255. data/lib/mencoro/models/start_brand_name_suggestion_job_request.rb +287 -0
  256. data/lib/mencoro/models/start_clustering_job_request_data.rb +249 -0
  257. data/lib/mencoro/models/start_keyword_discovery_job_request.rb +266 -0
  258. data/lib/mencoro/models/start_prompt_discovery_job_request.rb +276 -0
  259. data/lib/mencoro/models/submitted_checks_resource.rb +195 -0
  260. data/lib/mencoro/models/subscription_resource.rb +362 -0
  261. data/lib/mencoro/models/tracked_query_count_resource.rb +193 -0
  262. data/lib/mencoro/models/tracked_query_detail_resource.rb +440 -0
  263. data/lib/mencoro/models/tracked_query_resource.rb +492 -0
  264. data/lib/mencoro/models/tracked_query_usage_resource.rb +175 -0
  265. data/lib/mencoro/models/update_organization_request.rb +195 -0
  266. data/lib/mencoro/models/update_project_brand_profile_request.rb +218 -0
  267. data/lib/mencoro/models/update_project_request.rb +182 -0
  268. data/lib/mencoro/version.rb +15 -0
  269. data/lib/mencoro.rb +169 -0
  270. data/mencoro.gemspec +41 -0
  271. data/spec/api/account_api_spec.rb +57 -0
  272. data/spec/api/analytics_api_spec.rb +318 -0
  273. data/spec/api/billing_api_spec.rb +47 -0
  274. data/spec/api/captures_api_spec.rb +93 -0
  275. data/spec/api/clusters_api_spec.rb +126 -0
  276. data/spec/api/discovery_api_spec.rb +94 -0
  277. data/spec/api/invitations_api_spec.rb +83 -0
  278. data/spec/api/jobs_api_spec.rb +48 -0
  279. data/spec/api/members_api_spec.rb +111 -0
  280. data/spec/api/organization_operations_api_spec.rb +47 -0
  281. data/spec/api/organizations_api_spec.rb +181 -0
  282. data/spec/api/projects_api_spec.rb +229 -0
  283. data/spec/api/tracked_queries_api_spec.rb +344 -0
  284. data/spec/models/accepted_job_resource_spec.rb +48 -0
  285. data/spec/models/ai_response_report_resource_spec.rb +70 -0
  286. data/spec/models/ai_response_resource_spec.rb +90 -0
  287. data/spec/models/apply_clustering_job_outcome_clusters_inner_spec.rb +48 -0
  288. data/spec/models/apply_clustering_job_outcome_failed_inner_spec.rb +48 -0
  289. data/spec/models/apply_clustering_job_outcome_skipped_clusters_inner_spec.rb +42 -0
  290. data/spec/models/apply_clustering_job_outcome_spec.rb +60 -0
  291. data/spec/models/apply_clustering_job_outcome_successful_inner_spec.rb +42 -0
  292. data/spec/models/async_job_resource_spec.rb +62 -0
  293. data/spec/models/batch_change_tracked_query_check_frequency_request_data_spec.rb +46 -0
  294. data/spec/models/batch_change_tracked_query_passes_request_data_spec.rb +42 -0
  295. data/spec/models/batch_create_query_clusters_outcome_failed_inner_spec.rb +48 -0
  296. data/spec/models/batch_create_query_clusters_outcome_spec.rb +42 -0
  297. data/spec/models/batch_create_query_clusters_outcome_successful_inner_spec.rb +42 -0
  298. data/spec/models/batch_create_query_clusters_request_data_spec.rb +36 -0
  299. data/spec/models/batch_create_tracked_queries_request_data_spec.rb +80 -0
  300. data/spec/models/batch_create_tracked_queries_result_resource_failed_inner_spec.rb +60 -0
  301. data/spec/models/batch_create_tracked_queries_result_resource_spec.rb +42 -0
  302. data/spec/models/batch_create_tracked_queries_result_resource_successful_inner_spec.rb +54 -0
  303. data/spec/models/batch_force_check_tracked_queries200_response_failed_inner_spec.rb +48 -0
  304. data/spec/models/batch_force_check_tracked_queries200_response_spec.rb +42 -0
  305. data/spec/models/batch_pause_tracked_queries200_response_failed_inner_spec.rb +48 -0
  306. data/spec/models/batch_pause_tracked_queries200_response_spec.rb +42 -0
  307. data/spec/models/batch_pause_tracked_queries200_response_successful_inner_spec.rb +36 -0
  308. data/spec/models/batch_resume_tracked_queries200_response_spec.rb +42 -0
  309. data/spec/models/batch_targets_request_data_spec.rb +36 -0
  310. data/spec/models/batch_write_outcome_failed_inner_spec.rb +48 -0
  311. data/spec/models/batch_write_outcome_spec.rb +42 -0
  312. data/spec/models/brand_profile_resource_spec.rb +54 -0
  313. data/spec/models/bulk_add_clusters_to_tracked_queries200_response_spec.rb +42 -0
  314. data/spec/models/bulk_add_clusters_to_tracked_queries_request_spec.rb +42 -0
  315. data/spec/models/bulk_remove_clusters_from_tracked_queries200_response_spec.rb +42 -0
  316. data/spec/models/bulk_remove_clusters_from_tracked_queries_request_spec.rb +42 -0
  317. data/spec/models/change_member_role_request_spec.rb +40 -0
  318. data/spec/models/change_tracked_query_check_frequency_request_data_spec.rb +40 -0
  319. data/spec/models/change_tracked_query_passes_request_data_spec.rb +36 -0
  320. data/spec/models/citation_resource_spec.rb +90 -0
  321. data/spec/models/cluster_membership_request_data_spec.rb +36 -0
  322. data/spec/models/competitor_resource_spec.rb +54 -0
  323. data/spec/models/create_competitor_request_spec.rb +48 -0
  324. data/spec/models/create_invitation200_response_spec.rb +52 -0
  325. data/spec/models/create_invitation201_response_spec.rb +86 -0
  326. data/spec/models/create_invitation_request_spec.rb +46 -0
  327. data/spec/models/create_organization201_response_spec.rb +48 -0
  328. data/spec/models/create_organization_request_spec.rb +36 -0
  329. data/spec/models/create_project_request_competitors_inner_spec.rb +48 -0
  330. data/spec/models/create_project_request_spec.rb +54 -0
  331. data/spec/models/create_query_cluster409_response_spec.rb +48 -0
  332. data/spec/models/create_query_cluster_request_spec.rb +36 -0
  333. data/spec/models/delete_query_cluster200_response_spec.rb +48 -0
  334. data/spec/models/entitlements_resource_spec.rb +104 -0
  335. data/spec/models/get_available_filters200_response_clusters_inner_spec.rb +42 -0
  336. data/spec/models/get_available_filters200_response_spec.rb +48 -0
  337. data/spec/models/get_me_stats200_response_organizations_spec.rb +36 -0
  338. data/spec/models/get_me_stats200_response_projects_spec.rb +42 -0
  339. data/spec/models/get_me_stats200_response_spec.rb +42 -0
  340. data/spec/models/get_membership_stats200_response_spec.rb +72 -0
  341. data/spec/models/get_mention_samples400_response_details_value_inner_spec.rb +48 -0
  342. data/spec/models/get_mention_samples400_response_spec.rb +54 -0
  343. data/spec/models/get_metric_glossary200_response_metrics_inner_spec.rb +76 -0
  344. data/spec/models/get_metric_glossary200_response_spec.rb +36 -0
  345. data/spec/models/get_organization_overview200_response_aggregate_spec.rb +72 -0
  346. data/spec/models/get_organization_overview200_response_projects_inner_spec.rb +78 -0
  347. data/spec/models/get_organization_overview200_response_spec.rb +42 -0
  348. data/spec/models/get_organization_stats200_response_invitations_spec.rb +36 -0
  349. data/spec/models/get_organization_stats200_response_members_spec.rb +36 -0
  350. data/spec/models/get_organization_stats200_response_projects_spec.rb +42 -0
  351. data/spec/models/get_organization_stats200_response_spec.rb +48 -0
  352. data/spec/models/get_share_of_voice_formula200_response_spec.rb +54 -0
  353. data/spec/models/get_tracking_coverage200_response_sample_inner_spec.rb +70 -0
  354. data/spec/models/get_tracking_coverage200_response_spec.rb +72 -0
  355. data/spec/models/invitation_resource_spec.rb +80 -0
  356. data/spec/models/keyword_listing_resource_mention_type_counts_spec.rb +60 -0
  357. data/spec/models/keyword_listing_resource_spec.rb +262 -0
  358. data/spec/models/list_ai_responses200_response_spec.rb +42 -0
  359. data/spec/models/list_competitors200_response_spec.rb +42 -0
  360. data/spec/models/list_invitations200_response_spec.rb +42 -0
  361. data/spec/models/list_keyword_listings200_response_spec.rb +54 -0
  362. data/spec/models/list_members200_response_spec.rb +42 -0
  363. data/spec/models/list_organizations200_response_spec.rb +42 -0
  364. data/spec/models/list_projects200_response_spec.rb +42 -0
  365. data/spec/models/list_query_clusters200_response_spec.rb +42 -0
  366. data/spec/models/list_search_snapshots200_response_spec.rb +42 -0
  367. data/spec/models/list_shopping_snapshots200_response_spec.rb +42 -0
  368. data/spec/models/me_resource_spec.rb +92 -0
  369. data/spec/models/member_resource_spec.rb +74 -0
  370. data/spec/models/operation_effect_spec.rb +48 -0
  371. data/spec/models/organization_resource_spec.rb +86 -0
  372. data/spec/models/preview_organization_operation200_response_organization_spec.rb +42 -0
  373. data/spec/models/preview_organization_operation200_response_spec.rb +84 -0
  374. data/spec/models/preview_organization_operation_request_spec.rb +58 -0
  375. data/spec/models/project_detail_resource_competitors_inner_spec.rb +54 -0
  376. data/spec/models/project_detail_resource_spec.rb +82 -0
  377. data/spec/models/project_resource_spec.rb +136 -0
  378. data/spec/models/projected_monthly_checks_resource_spec.rb +42 -0
  379. data/spec/models/query_cluster_resource_spec.rb +48 -0
  380. data/spec/models/report_ai_response_request_spec.rb +52 -0
  381. data/spec/models/search_result_resource_spec.rb +78 -0
  382. data/spec/models/search_snapshot_resource_spec.rb +66 -0
  383. data/spec/models/search_tracked_queries200_response_spec.rb +42 -0
  384. data/spec/models/shopping_offer_resource_spec.rb +96 -0
  385. data/spec/models/shopping_snapshot_resource_spec.rb +66 -0
  386. data/spec/models/start_brand_discovery_job_request_spec.rb +42 -0
  387. data/spec/models/start_brand_name_suggestion_job_request_spec.rb +54 -0
  388. data/spec/models/start_clustering_job_request_data_spec.rb +52 -0
  389. data/spec/models/start_keyword_discovery_job_request_spec.rb +54 -0
  390. data/spec/models/start_prompt_discovery_job_request_spec.rb +54 -0
  391. data/spec/models/submitted_checks_resource_spec.rb +42 -0
  392. data/spec/models/subscription_resource_spec.rb +120 -0
  393. data/spec/models/tracked_query_count_resource_spec.rb +42 -0
  394. data/spec/models/tracked_query_detail_resource_spec.rb +108 -0
  395. data/spec/models/tracked_query_resource_spec.rb +150 -0
  396. data/spec/models/tracked_query_usage_resource_spec.rb +36 -0
  397. data/spec/models/update_organization_request_spec.rb +48 -0
  398. data/spec/models/update_project_brand_profile_request_spec.rb +42 -0
  399. data/spec/models/update_project_request_spec.rb +36 -0
  400. data/spec/spec_helper.rb +111 -0
  401. metadata +641 -0
@@ -0,0 +1,1792 @@
1
+ =begin
2
+ #Mencoro API
3
+
4
+ #Public API for Mencoro customers. Authenticate with an API key: `Authorization: Bearer mencoro_sk_...`.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ Contact: support@mencoro.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.24.0
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module Mencoro
16
+ class TrackedQueriesApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Add a tracked query to clusters
23
+ # Minimum role: manager. Adds the tracked query to every cluster named in \"queryClusterIds\" and answers with the query in its new state. Membership is a set: a cluster the query already belongs to is skipped, not reported as an error, and the response still lists it. Clusters the query belongs to and this call does not name are left alone — this adds, it does not replace the membership. Every cluster must belong to the project in the path; one that does not is rejected with its field named, and nothing is written. The \"Idempotency-Key\" header is required, and a repeat of the same key and body returns the recorded answer without adding anything again.
24
+ # @param organization_id [String]
25
+ # @param project_id [String]
26
+ # @param tracked_query_id [String] Must belong to the project in the path.
27
+ # @param idempotency_key [String] A client-chosen key, unique per operation, so a lost response can be retried without repeating the write.
28
+ # @param cluster_membership_request_data [ClusterMembershipRequestData]
29
+ # @param [Hash] opts the optional parameters
30
+ # @return [TrackedQueryDetailResource]
31
+ def add_clusters_to_tracked_query(organization_id, project_id, tracked_query_id, idempotency_key, cluster_membership_request_data, opts = {})
32
+ data, _status_code, _headers = add_clusters_to_tracked_query_with_http_info(organization_id, project_id, tracked_query_id, idempotency_key, cluster_membership_request_data, opts)
33
+ data
34
+ end
35
+
36
+ # Add a tracked query to clusters
37
+ # Minimum role: manager. Adds the tracked query to every cluster named in \"queryClusterIds\" and answers with the query in its new state. Membership is a set: a cluster the query already belongs to is skipped, not reported as an error, and the response still lists it. Clusters the query belongs to and this call does not name are left alone — this adds, it does not replace the membership. Every cluster must belong to the project in the path; one that does not is rejected with its field named, and nothing is written. The \"Idempotency-Key\" header is required, and a repeat of the same key and body returns the recorded answer without adding anything again.
38
+ # @param organization_id [String]
39
+ # @param project_id [String]
40
+ # @param tracked_query_id [String] Must belong to the project in the path.
41
+ # @param idempotency_key [String] A client-chosen key, unique per operation, so a lost response can be retried without repeating the write.
42
+ # @param cluster_membership_request_data [ClusterMembershipRequestData]
43
+ # @param [Hash] opts the optional parameters
44
+ # @return [Array<(TrackedQueryDetailResource, Integer, Hash)>] TrackedQueryDetailResource data, response status code and response headers
45
+ def add_clusters_to_tracked_query_with_http_info(organization_id, project_id, tracked_query_id, idempotency_key, cluster_membership_request_data, opts = {})
46
+ if @api_client.config.debugging
47
+ @api_client.config.logger.debug 'Calling API: TrackedQueriesApi.add_clusters_to_tracked_query ...'
48
+ end
49
+ # verify the required parameter 'organization_id' is set
50
+ if @api_client.config.client_side_validation && organization_id.nil?
51
+ fail ArgumentError, "Missing the required parameter 'organization_id' when calling TrackedQueriesApi.add_clusters_to_tracked_query"
52
+ end
53
+ # verify the required parameter 'project_id' is set
54
+ if @api_client.config.client_side_validation && project_id.nil?
55
+ fail ArgumentError, "Missing the required parameter 'project_id' when calling TrackedQueriesApi.add_clusters_to_tracked_query"
56
+ end
57
+ # verify the required parameter 'tracked_query_id' is set
58
+ if @api_client.config.client_side_validation && tracked_query_id.nil?
59
+ fail ArgumentError, "Missing the required parameter 'tracked_query_id' when calling TrackedQueriesApi.add_clusters_to_tracked_query"
60
+ end
61
+ # verify the required parameter 'idempotency_key' is set
62
+ if @api_client.config.client_side_validation && idempotency_key.nil?
63
+ fail ArgumentError, "Missing the required parameter 'idempotency_key' when calling TrackedQueriesApi.add_clusters_to_tracked_query"
64
+ end
65
+ # verify the required parameter 'cluster_membership_request_data' is set
66
+ if @api_client.config.client_side_validation && cluster_membership_request_data.nil?
67
+ fail ArgumentError, "Missing the required parameter 'cluster_membership_request_data' when calling TrackedQueriesApi.add_clusters_to_tracked_query"
68
+ end
69
+ # resource path
70
+ local_var_path = '/api/v1/organizations/{organizationId}/projects/{projectId}/tracked-queries/{trackedQueryId}/clusters'.sub('{organizationId}', CGI.escape(organization_id.to_s)).sub('{projectId}', CGI.escape(project_id.to_s)).sub('{trackedQueryId}', CGI.escape(tracked_query_id.to_s))
71
+
72
+ # query parameters
73
+ query_params = opts[:query_params] || {}
74
+
75
+ # header parameters
76
+ header_params = opts[:header_params] || {}
77
+ # HTTP header 'Accept' (if needed)
78
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
79
+ # HTTP header 'Content-Type'
80
+ content_type = @api_client.select_header_content_type(['application/json'])
81
+ if !content_type.nil?
82
+ header_params['Content-Type'] = content_type
83
+ end
84
+ header_params[:'Idempotency-Key'] = idempotency_key
85
+
86
+ # form parameters
87
+ form_params = opts[:form_params] || {}
88
+
89
+ # http body (model)
90
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(cluster_membership_request_data)
91
+
92
+ # return_type
93
+ return_type = opts[:debug_return_type] || 'TrackedQueryDetailResource'
94
+
95
+ # auth_names
96
+ auth_names = opts[:debug_auth_names] || ['ApiKey']
97
+
98
+ new_options = opts.merge(
99
+ :operation => :"TrackedQueriesApi.add_clusters_to_tracked_query",
100
+ :header_params => header_params,
101
+ :query_params => query_params,
102
+ :form_params => form_params,
103
+ :body => post_body,
104
+ :auth_names => auth_names,
105
+ :return_type => return_type
106
+ )
107
+
108
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
109
+ if @api_client.config.debugging
110
+ @api_client.config.logger.debug "API called: TrackedQueriesApi#add_clusters_to_tracked_query\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
111
+ end
112
+ return data, status_code, headers
113
+ end
114
+
115
+ # Change how often several tracked queries are checked
116
+ # Minimum role: manager. Sets the same check frequency on every tracked query named in `ids`, at most 100 distinct ids per call. The organization must be active and the project must not be archived. Partial success: an id that is not a tracked query of this project — unknown, malformed, already deleted, or belonging to somewhere else — is reported under `failed` with `tracked_query_not_found` while the rest are changed, and the call still answers 200. Nothing is rolled back because an item failed. Setting the frequency a query already has is accepted and changes nothing. This does NOT run a check and does not reschedule one already in flight. It never changes more than the ids it is given: there is no \"change everything matching a filter\" mode. The Idempotency-Key header is required; a retry with the same key and the same body returns this same answer without applying anything again.
117
+ # @param organization_id [String]
118
+ # @param project_id [String]
119
+ # @param idempotency_key [String] A client-chosen key, unique per operation. Replaying it returns the first answer instead of applying anything again.
120
+ # @param batch_change_tracked_query_check_frequency_request_data [BatchChangeTrackedQueryCheckFrequencyRequestData]
121
+ # @param [Hash] opts the optional parameters
122
+ # @return [BatchWriteOutcome]
123
+ def batch_change_tracked_queries_check_frequency(organization_id, project_id, idempotency_key, batch_change_tracked_query_check_frequency_request_data, opts = {})
124
+ data, _status_code, _headers = batch_change_tracked_queries_check_frequency_with_http_info(organization_id, project_id, idempotency_key, batch_change_tracked_query_check_frequency_request_data, opts)
125
+ data
126
+ end
127
+
128
+ # Change how often several tracked queries are checked
129
+ # Minimum role: manager. Sets the same check frequency on every tracked query named in &#x60;ids&#x60;, at most 100 distinct ids per call. The organization must be active and the project must not be archived. Partial success: an id that is not a tracked query of this project — unknown, malformed, already deleted, or belonging to somewhere else — is reported under &#x60;failed&#x60; with &#x60;tracked_query_not_found&#x60; while the rest are changed, and the call still answers 200. Nothing is rolled back because an item failed. Setting the frequency a query already has is accepted and changes nothing. This does NOT run a check and does not reschedule one already in flight. It never changes more than the ids it is given: there is no \&quot;change everything matching a filter\&quot; mode. The Idempotency-Key header is required; a retry with the same key and the same body returns this same answer without applying anything again.
130
+ # @param organization_id [String]
131
+ # @param project_id [String]
132
+ # @param idempotency_key [String] A client-chosen key, unique per operation. Replaying it returns the first answer instead of applying anything again.
133
+ # @param batch_change_tracked_query_check_frequency_request_data [BatchChangeTrackedQueryCheckFrequencyRequestData]
134
+ # @param [Hash] opts the optional parameters
135
+ # @return [Array<(BatchWriteOutcome, Integer, Hash)>] BatchWriteOutcome data, response status code and response headers
136
+ def batch_change_tracked_queries_check_frequency_with_http_info(organization_id, project_id, idempotency_key, batch_change_tracked_query_check_frequency_request_data, opts = {})
137
+ if @api_client.config.debugging
138
+ @api_client.config.logger.debug 'Calling API: TrackedQueriesApi.batch_change_tracked_queries_check_frequency ...'
139
+ end
140
+ # verify the required parameter 'organization_id' is set
141
+ if @api_client.config.client_side_validation && organization_id.nil?
142
+ fail ArgumentError, "Missing the required parameter 'organization_id' when calling TrackedQueriesApi.batch_change_tracked_queries_check_frequency"
143
+ end
144
+ # verify the required parameter 'project_id' is set
145
+ if @api_client.config.client_side_validation && project_id.nil?
146
+ fail ArgumentError, "Missing the required parameter 'project_id' when calling TrackedQueriesApi.batch_change_tracked_queries_check_frequency"
147
+ end
148
+ # verify the required parameter 'idempotency_key' is set
149
+ if @api_client.config.client_side_validation && idempotency_key.nil?
150
+ fail ArgumentError, "Missing the required parameter 'idempotency_key' when calling TrackedQueriesApi.batch_change_tracked_queries_check_frequency"
151
+ end
152
+ # verify the required parameter 'batch_change_tracked_query_check_frequency_request_data' is set
153
+ if @api_client.config.client_side_validation && batch_change_tracked_query_check_frequency_request_data.nil?
154
+ fail ArgumentError, "Missing the required parameter 'batch_change_tracked_query_check_frequency_request_data' when calling TrackedQueriesApi.batch_change_tracked_queries_check_frequency"
155
+ end
156
+ # resource path
157
+ local_var_path = '/api/v1/organizations/{organizationId}/projects/{projectId}/tracked-queries/batch/check-frequency'.sub('{organizationId}', CGI.escape(organization_id.to_s)).sub('{projectId}', CGI.escape(project_id.to_s))
158
+
159
+ # query parameters
160
+ query_params = opts[:query_params] || {}
161
+
162
+ # header parameters
163
+ header_params = opts[:header_params] || {}
164
+ # HTTP header 'Accept' (if needed)
165
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
166
+ # HTTP header 'Content-Type'
167
+ content_type = @api_client.select_header_content_type(['application/json'])
168
+ if !content_type.nil?
169
+ header_params['Content-Type'] = content_type
170
+ end
171
+ header_params[:'Idempotency-Key'] = idempotency_key
172
+
173
+ # form parameters
174
+ form_params = opts[:form_params] || {}
175
+
176
+ # http body (model)
177
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(batch_change_tracked_query_check_frequency_request_data)
178
+
179
+ # return_type
180
+ return_type = opts[:debug_return_type] || 'BatchWriteOutcome'
181
+
182
+ # auth_names
183
+ auth_names = opts[:debug_auth_names] || ['ApiKey']
184
+
185
+ new_options = opts.merge(
186
+ :operation => :"TrackedQueriesApi.batch_change_tracked_queries_check_frequency",
187
+ :header_params => header_params,
188
+ :query_params => query_params,
189
+ :form_params => form_params,
190
+ :body => post_body,
191
+ :auth_names => auth_names,
192
+ :return_type => return_type
193
+ )
194
+
195
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
196
+ if @api_client.config.debugging
197
+ @api_client.config.logger.debug "API called: TrackedQueriesApi#batch_change_tracked_queries_check_frequency\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
198
+ end
199
+ return data, status_code, headers
200
+ end
201
+
202
+ # Change how many passes several tracked queries run per check
203
+ # Minimum role: manager. Sets the same passes-per-check on every tracked query named in `ids`, at most 100 distinct ids per call. The organization must be active and the project must not be archived. Partial success, and two distinct reasons appear under `failed`: an id that is not a tracked query of this project answers `tracked_query_not_found`, and a `google_serp` or `google_shopping` query asked for more than one pass answers `n_passes_not_supported_for_engine` — those engines run a single pass. Both leave the rest of the batch changed and the call still answers 200. Setting the value back to 1 is always allowed, so a batch that lowers sampling never fails on engine grounds. This does NOT run a check and does not change history already captured. More passes cost proportionally more of the plan's check budget. It never changes more than the ids it is given: there is no \"change everything matching a filter\" mode. The Idempotency-Key header is required; a retry with the same key and the same body returns this same answer without applying anything again.
204
+ # @param organization_id [String]
205
+ # @param project_id [String]
206
+ # @param idempotency_key [String] A client-chosen key, unique per operation. Replaying it returns the first answer instead of applying anything again.
207
+ # @param batch_change_tracked_query_passes_request_data [BatchChangeTrackedQueryPassesRequestData]
208
+ # @param [Hash] opts the optional parameters
209
+ # @return [BatchWriteOutcome]
210
+ def batch_change_tracked_queries_n_passes(organization_id, project_id, idempotency_key, batch_change_tracked_query_passes_request_data, opts = {})
211
+ data, _status_code, _headers = batch_change_tracked_queries_n_passes_with_http_info(organization_id, project_id, idempotency_key, batch_change_tracked_query_passes_request_data, opts)
212
+ data
213
+ end
214
+
215
+ # Change how many passes several tracked queries run per check
216
+ # Minimum role: manager. Sets the same passes-per-check on every tracked query named in &#x60;ids&#x60;, at most 100 distinct ids per call. The organization must be active and the project must not be archived. Partial success, and two distinct reasons appear under &#x60;failed&#x60;: an id that is not a tracked query of this project answers &#x60;tracked_query_not_found&#x60;, and a &#x60;google_serp&#x60; or &#x60;google_shopping&#x60; query asked for more than one pass answers &#x60;n_passes_not_supported_for_engine&#x60; — those engines run a single pass. Both leave the rest of the batch changed and the call still answers 200. Setting the value back to 1 is always allowed, so a batch that lowers sampling never fails on engine grounds. This does NOT run a check and does not change history already captured. More passes cost proportionally more of the plan&#39;s check budget. It never changes more than the ids it is given: there is no \&quot;change everything matching a filter\&quot; mode. The Idempotency-Key header is required; a retry with the same key and the same body returns this same answer without applying anything again.
217
+ # @param organization_id [String]
218
+ # @param project_id [String]
219
+ # @param idempotency_key [String] A client-chosen key, unique per operation. Replaying it returns the first answer instead of applying anything again.
220
+ # @param batch_change_tracked_query_passes_request_data [BatchChangeTrackedQueryPassesRequestData]
221
+ # @param [Hash] opts the optional parameters
222
+ # @return [Array<(BatchWriteOutcome, Integer, Hash)>] BatchWriteOutcome data, response status code and response headers
223
+ def batch_change_tracked_queries_n_passes_with_http_info(organization_id, project_id, idempotency_key, batch_change_tracked_query_passes_request_data, opts = {})
224
+ if @api_client.config.debugging
225
+ @api_client.config.logger.debug 'Calling API: TrackedQueriesApi.batch_change_tracked_queries_n_passes ...'
226
+ end
227
+ # verify the required parameter 'organization_id' is set
228
+ if @api_client.config.client_side_validation && organization_id.nil?
229
+ fail ArgumentError, "Missing the required parameter 'organization_id' when calling TrackedQueriesApi.batch_change_tracked_queries_n_passes"
230
+ end
231
+ # verify the required parameter 'project_id' is set
232
+ if @api_client.config.client_side_validation && project_id.nil?
233
+ fail ArgumentError, "Missing the required parameter 'project_id' when calling TrackedQueriesApi.batch_change_tracked_queries_n_passes"
234
+ end
235
+ # verify the required parameter 'idempotency_key' is set
236
+ if @api_client.config.client_side_validation && idempotency_key.nil?
237
+ fail ArgumentError, "Missing the required parameter 'idempotency_key' when calling TrackedQueriesApi.batch_change_tracked_queries_n_passes"
238
+ end
239
+ # verify the required parameter 'batch_change_tracked_query_passes_request_data' is set
240
+ if @api_client.config.client_side_validation && batch_change_tracked_query_passes_request_data.nil?
241
+ fail ArgumentError, "Missing the required parameter 'batch_change_tracked_query_passes_request_data' when calling TrackedQueriesApi.batch_change_tracked_queries_n_passes"
242
+ end
243
+ # resource path
244
+ local_var_path = '/api/v1/organizations/{organizationId}/projects/{projectId}/tracked-queries/batch/passes'.sub('{organizationId}', CGI.escape(organization_id.to_s)).sub('{projectId}', CGI.escape(project_id.to_s))
245
+
246
+ # query parameters
247
+ query_params = opts[:query_params] || {}
248
+
249
+ # header parameters
250
+ header_params = opts[:header_params] || {}
251
+ # HTTP header 'Accept' (if needed)
252
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
253
+ # HTTP header 'Content-Type'
254
+ content_type = @api_client.select_header_content_type(['application/json'])
255
+ if !content_type.nil?
256
+ header_params['Content-Type'] = content_type
257
+ end
258
+ header_params[:'Idempotency-Key'] = idempotency_key
259
+
260
+ # form parameters
261
+ form_params = opts[:form_params] || {}
262
+
263
+ # http body (model)
264
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(batch_change_tracked_query_passes_request_data)
265
+
266
+ # return_type
267
+ return_type = opts[:debug_return_type] || 'BatchWriteOutcome'
268
+
269
+ # auth_names
270
+ auth_names = opts[:debug_auth_names] || ['ApiKey']
271
+
272
+ new_options = opts.merge(
273
+ :operation => :"TrackedQueriesApi.batch_change_tracked_queries_n_passes",
274
+ :header_params => header_params,
275
+ :query_params => query_params,
276
+ :form_params => form_params,
277
+ :body => post_body,
278
+ :auth_names => auth_names,
279
+ :return_type => return_type
280
+ )
281
+
282
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
283
+ if @api_client.config.debugging
284
+ @api_client.config.logger.debug "API called: TrackedQueriesApi#batch_change_tracked_queries_n_passes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
285
+ end
286
+ return data, status_code, headers
287
+ end
288
+
289
+ # Create tracked queries
290
+ # Minimum role: manager. Creates the cross product of `queryTexts` x `engines` x `countries`: three texts, two engines and two countries create twelve tracked queries, not three. At most 100 combinations per call. The organization must be active and the project must not be archived. Partial success: the response lists, per combination, either the id it was created under or why nothing was created for it, and the status code never reports item-level outcomes. A combination the project already tracks is NOT created again and NOT re-identified — it appears under `failed` with `tracked_query_already_exists`, keeps the id it already had, and has any `queryClusterIds` in this request merged into it. Query text is normalised before it is compared and stored (lower-cased, whitespace collapsed, leading list markers stripped), so two texts differing only in those respects are one tracked query: the first of them owns the outcome and every later one appears under `failed` with `duplicate_combination_in_request`, naming the entry it repeats. `nPasses` applies to AI engines only: `google_serp` and `google_shopping` rows are always created with one pass, whatever is sent. Google AI Mode is unavailable in a few countries and those combinations are reported under `failed` rather than created. Creating a tracked query does not run a check: the first check happens on the normal schedule for the `checkFrequency` chosen. The Idempotency-Key header is required; a retry with the same key and the same body returns this same answer without creating anything again.
291
+ # @param organization_id [String]
292
+ # @param project_id [String]
293
+ # @param idempotency_key [String] A client-chosen key, unique per operation. Replaying it returns the first answer instead of creating anything again.
294
+ # @param batch_create_tracked_queries_request_data [BatchCreateTrackedQueriesRequestData]
295
+ # @param [Hash] opts the optional parameters
296
+ # @return [BatchCreateTrackedQueriesResultResource]
297
+ def batch_create_tracked_queries(organization_id, project_id, idempotency_key, batch_create_tracked_queries_request_data, opts = {})
298
+ data, _status_code, _headers = batch_create_tracked_queries_with_http_info(organization_id, project_id, idempotency_key, batch_create_tracked_queries_request_data, opts)
299
+ data
300
+ end
301
+
302
+ # Create tracked queries
303
+ # Minimum role: manager. Creates the cross product of &#x60;queryTexts&#x60; x &#x60;engines&#x60; x &#x60;countries&#x60;: three texts, two engines and two countries create twelve tracked queries, not three. At most 100 combinations per call. The organization must be active and the project must not be archived. Partial success: the response lists, per combination, either the id it was created under or why nothing was created for it, and the status code never reports item-level outcomes. A combination the project already tracks is NOT created again and NOT re-identified — it appears under &#x60;failed&#x60; with &#x60;tracked_query_already_exists&#x60;, keeps the id it already had, and has any &#x60;queryClusterIds&#x60; in this request merged into it. Query text is normalised before it is compared and stored (lower-cased, whitespace collapsed, leading list markers stripped), so two texts differing only in those respects are one tracked query: the first of them owns the outcome and every later one appears under &#x60;failed&#x60; with &#x60;duplicate_combination_in_request&#x60;, naming the entry it repeats. &#x60;nPasses&#x60; applies to AI engines only: &#x60;google_serp&#x60; and &#x60;google_shopping&#x60; rows are always created with one pass, whatever is sent. Google AI Mode is unavailable in a few countries and those combinations are reported under &#x60;failed&#x60; rather than created. Creating a tracked query does not run a check: the first check happens on the normal schedule for the &#x60;checkFrequency&#x60; chosen. The Idempotency-Key header is required; a retry with the same key and the same body returns this same answer without creating anything again.
304
+ # @param organization_id [String]
305
+ # @param project_id [String]
306
+ # @param idempotency_key [String] A client-chosen key, unique per operation. Replaying it returns the first answer instead of creating anything again.
307
+ # @param batch_create_tracked_queries_request_data [BatchCreateTrackedQueriesRequestData]
308
+ # @param [Hash] opts the optional parameters
309
+ # @return [Array<(BatchCreateTrackedQueriesResultResource, Integer, Hash)>] BatchCreateTrackedQueriesResultResource data, response status code and response headers
310
+ def batch_create_tracked_queries_with_http_info(organization_id, project_id, idempotency_key, batch_create_tracked_queries_request_data, opts = {})
311
+ if @api_client.config.debugging
312
+ @api_client.config.logger.debug 'Calling API: TrackedQueriesApi.batch_create_tracked_queries ...'
313
+ end
314
+ # verify the required parameter 'organization_id' is set
315
+ if @api_client.config.client_side_validation && organization_id.nil?
316
+ fail ArgumentError, "Missing the required parameter 'organization_id' when calling TrackedQueriesApi.batch_create_tracked_queries"
317
+ end
318
+ # verify the required parameter 'project_id' is set
319
+ if @api_client.config.client_side_validation && project_id.nil?
320
+ fail ArgumentError, "Missing the required parameter 'project_id' when calling TrackedQueriesApi.batch_create_tracked_queries"
321
+ end
322
+ # verify the required parameter 'idempotency_key' is set
323
+ if @api_client.config.client_side_validation && idempotency_key.nil?
324
+ fail ArgumentError, "Missing the required parameter 'idempotency_key' when calling TrackedQueriesApi.batch_create_tracked_queries"
325
+ end
326
+ # verify the required parameter 'batch_create_tracked_queries_request_data' is set
327
+ if @api_client.config.client_side_validation && batch_create_tracked_queries_request_data.nil?
328
+ fail ArgumentError, "Missing the required parameter 'batch_create_tracked_queries_request_data' when calling TrackedQueriesApi.batch_create_tracked_queries"
329
+ end
330
+ # resource path
331
+ local_var_path = '/api/v1/organizations/{organizationId}/projects/{projectId}/tracked-queries'.sub('{organizationId}', CGI.escape(organization_id.to_s)).sub('{projectId}', CGI.escape(project_id.to_s))
332
+
333
+ # query parameters
334
+ query_params = opts[:query_params] || {}
335
+
336
+ # header parameters
337
+ header_params = opts[:header_params] || {}
338
+ # HTTP header 'Accept' (if needed)
339
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
340
+ # HTTP header 'Content-Type'
341
+ content_type = @api_client.select_header_content_type(['application/json'])
342
+ if !content_type.nil?
343
+ header_params['Content-Type'] = content_type
344
+ end
345
+ header_params[:'Idempotency-Key'] = idempotency_key
346
+
347
+ # form parameters
348
+ form_params = opts[:form_params] || {}
349
+
350
+ # http body (model)
351
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(batch_create_tracked_queries_request_data)
352
+
353
+ # return_type
354
+ return_type = opts[:debug_return_type] || 'BatchCreateTrackedQueriesResultResource'
355
+
356
+ # auth_names
357
+ auth_names = opts[:debug_auth_names] || ['ApiKey']
358
+
359
+ new_options = opts.merge(
360
+ :operation => :"TrackedQueriesApi.batch_create_tracked_queries",
361
+ :header_params => header_params,
362
+ :query_params => query_params,
363
+ :form_params => form_params,
364
+ :body => post_body,
365
+ :auth_names => auth_names,
366
+ :return_type => return_type
367
+ )
368
+
369
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
370
+ if @api_client.config.debugging
371
+ @api_client.config.logger.debug "API called: TrackedQueriesApi#batch_create_tracked_queries\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
372
+ end
373
+ return data, status_code, headers
374
+ end
375
+
376
+ # Check several tracked queries now
377
+ # Minimum role: manager. Asks for a fresh check of up to 100 named tracked queries straight away, ignoring how recently each was last checked. Answers 200 with per-item results and NO job id: a check that is already in flight for a query is reused rather than started again, so there is no id this operation could hand back that is guaranteed to exist. Follow progress on the tracked query itself — its lastCheckedAt advances when the check completes. A successful item means the check was accepted for submission with budget available for it at that moment; it does not mean the check has run. A checked query costs one budget unit per pass (nPasses), and items that do not fit the remaining budget are reported as failed with `check_budget_forecast_exhausted`, or `subscription_not_found` when the organization has no entitled subscription — they are never reported as successful. That budget figure is a forecast for this batch, and a pessimistic one: a tracked query already being checked is joined to the check in flight and costs nothing, but it is still debited here, so an item refused this way may have fitted. Resubmit it in a later batch rather than treating the refusal as a statement about your subscription. A paused query is reported as failed with `tracked_query_already_paused`: paused queries are never checked. An id that is not a tracked query of this project is reported as failed with `tracked_query_not_found`, exactly as an id that does not exist. Requires an Idempotency-Key header; a retry must repeat the same ids in the same order.
378
+ # @param organization_id [String]
379
+ # @param project_id [String]
380
+ # @param idempotency_key [String] Repeating a request with the same key and the same ids answers with the first attempt&#39;s result instead of submitting again.
381
+ # @param batch_targets_request_data [BatchTargetsRequestData]
382
+ # @param [Hash] opts the optional parameters
383
+ # @return [BatchForceCheckTrackedQueries200Response]
384
+ def batch_force_check_tracked_queries(organization_id, project_id, idempotency_key, batch_targets_request_data, opts = {})
385
+ data, _status_code, _headers = batch_force_check_tracked_queries_with_http_info(organization_id, project_id, idempotency_key, batch_targets_request_data, opts)
386
+ data
387
+ end
388
+
389
+ # Check several tracked queries now
390
+ # Minimum role: manager. Asks for a fresh check of up to 100 named tracked queries straight away, ignoring how recently each was last checked. Answers 200 with per-item results and NO job id: a check that is already in flight for a query is reused rather than started again, so there is no id this operation could hand back that is guaranteed to exist. Follow progress on the tracked query itself — its lastCheckedAt advances when the check completes. A successful item means the check was accepted for submission with budget available for it at that moment; it does not mean the check has run. A checked query costs one budget unit per pass (nPasses), and items that do not fit the remaining budget are reported as failed with &#x60;check_budget_forecast_exhausted&#x60;, or &#x60;subscription_not_found&#x60; when the organization has no entitled subscription — they are never reported as successful. That budget figure is a forecast for this batch, and a pessimistic one: a tracked query already being checked is joined to the check in flight and costs nothing, but it is still debited here, so an item refused this way may have fitted. Resubmit it in a later batch rather than treating the refusal as a statement about your subscription. A paused query is reported as failed with &#x60;tracked_query_already_paused&#x60;: paused queries are never checked. An id that is not a tracked query of this project is reported as failed with &#x60;tracked_query_not_found&#x60;, exactly as an id that does not exist. Requires an Idempotency-Key header; a retry must repeat the same ids in the same order.
391
+ # @param organization_id [String]
392
+ # @param project_id [String]
393
+ # @param idempotency_key [String] Repeating a request with the same key and the same ids answers with the first attempt&#39;s result instead of submitting again.
394
+ # @param batch_targets_request_data [BatchTargetsRequestData]
395
+ # @param [Hash] opts the optional parameters
396
+ # @return [Array<(BatchForceCheckTrackedQueries200Response, Integer, Hash)>] BatchForceCheckTrackedQueries200Response data, response status code and response headers
397
+ def batch_force_check_tracked_queries_with_http_info(organization_id, project_id, idempotency_key, batch_targets_request_data, opts = {})
398
+ if @api_client.config.debugging
399
+ @api_client.config.logger.debug 'Calling API: TrackedQueriesApi.batch_force_check_tracked_queries ...'
400
+ end
401
+ # verify the required parameter 'organization_id' is set
402
+ if @api_client.config.client_side_validation && organization_id.nil?
403
+ fail ArgumentError, "Missing the required parameter 'organization_id' when calling TrackedQueriesApi.batch_force_check_tracked_queries"
404
+ end
405
+ # verify the required parameter 'project_id' is set
406
+ if @api_client.config.client_side_validation && project_id.nil?
407
+ fail ArgumentError, "Missing the required parameter 'project_id' when calling TrackedQueriesApi.batch_force_check_tracked_queries"
408
+ end
409
+ # verify the required parameter 'idempotency_key' is set
410
+ if @api_client.config.client_side_validation && idempotency_key.nil?
411
+ fail ArgumentError, "Missing the required parameter 'idempotency_key' when calling TrackedQueriesApi.batch_force_check_tracked_queries"
412
+ end
413
+ # verify the required parameter 'batch_targets_request_data' is set
414
+ if @api_client.config.client_side_validation && batch_targets_request_data.nil?
415
+ fail ArgumentError, "Missing the required parameter 'batch_targets_request_data' when calling TrackedQueriesApi.batch_force_check_tracked_queries"
416
+ end
417
+ # resource path
418
+ local_var_path = '/api/v1/organizations/{organizationId}/projects/{projectId}/tracked-queries/check'.sub('{organizationId}', CGI.escape(organization_id.to_s)).sub('{projectId}', CGI.escape(project_id.to_s))
419
+
420
+ # query parameters
421
+ query_params = opts[:query_params] || {}
422
+
423
+ # header parameters
424
+ header_params = opts[:header_params] || {}
425
+ # HTTP header 'Accept' (if needed)
426
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
427
+ # HTTP header 'Content-Type'
428
+ content_type = @api_client.select_header_content_type(['application/json'])
429
+ if !content_type.nil?
430
+ header_params['Content-Type'] = content_type
431
+ end
432
+ header_params[:'Idempotency-Key'] = idempotency_key
433
+
434
+ # form parameters
435
+ form_params = opts[:form_params] || {}
436
+
437
+ # http body (model)
438
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(batch_targets_request_data)
439
+
440
+ # return_type
441
+ return_type = opts[:debug_return_type] || 'BatchForceCheckTrackedQueries200Response'
442
+
443
+ # auth_names
444
+ auth_names = opts[:debug_auth_names] || ['ApiKey']
445
+
446
+ new_options = opts.merge(
447
+ :operation => :"TrackedQueriesApi.batch_force_check_tracked_queries",
448
+ :header_params => header_params,
449
+ :query_params => query_params,
450
+ :form_params => form_params,
451
+ :body => post_body,
452
+ :auth_names => auth_names,
453
+ :return_type => return_type
454
+ )
455
+
456
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
457
+ if @api_client.config.debugging
458
+ @api_client.config.logger.debug "API called: TrackedQueriesApi#batch_force_check_tracked_queries\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
459
+ end
460
+ return data, status_code, headers
461
+ end
462
+
463
+ # Pause several tracked queries
464
+ # Minimum role: manager. Pauses up to 100 tracked queries of one project, each independently. Always answers 200 when the batch itself was processed: read `failed` to find out which items were not paused, never the status code. Items are never rolled back because a later one failed. An id that is already paused is reported as successful — pausing asserts a state, not a transition. An id that is not a tracked query of this project is reported as failed with `tracked_query_not_found`, exactly as an id that does not exist at all, and nothing is written for it. Pausing does not cancel a check that is already running. Requires an Idempotency-Key header; a retry must repeat the same ids in the same order to be recognised as a retry rather than refused as a reused key.
465
+ # @param organization_id [String]
466
+ # @param project_id [String]
467
+ # @param idempotency_key [String] Repeating a request with the same key and the same ids answers with the first attempt&#39;s result.
468
+ # @param batch_targets_request_data [BatchTargetsRequestData]
469
+ # @param [Hash] opts the optional parameters
470
+ # @return [BatchPauseTrackedQueries200Response]
471
+ def batch_pause_tracked_queries(organization_id, project_id, idempotency_key, batch_targets_request_data, opts = {})
472
+ data, _status_code, _headers = batch_pause_tracked_queries_with_http_info(organization_id, project_id, idempotency_key, batch_targets_request_data, opts)
473
+ data
474
+ end
475
+
476
+ # Pause several tracked queries
477
+ # Minimum role: manager. Pauses up to 100 tracked queries of one project, each independently. Always answers 200 when the batch itself was processed: read &#x60;failed&#x60; to find out which items were not paused, never the status code. Items are never rolled back because a later one failed. An id that is already paused is reported as successful — pausing asserts a state, not a transition. An id that is not a tracked query of this project is reported as failed with &#x60;tracked_query_not_found&#x60;, exactly as an id that does not exist at all, and nothing is written for it. Pausing does not cancel a check that is already running. Requires an Idempotency-Key header; a retry must repeat the same ids in the same order to be recognised as a retry rather than refused as a reused key.
478
+ # @param organization_id [String]
479
+ # @param project_id [String]
480
+ # @param idempotency_key [String] Repeating a request with the same key and the same ids answers with the first attempt&#39;s result.
481
+ # @param batch_targets_request_data [BatchTargetsRequestData]
482
+ # @param [Hash] opts the optional parameters
483
+ # @return [Array<(BatchPauseTrackedQueries200Response, Integer, Hash)>] BatchPauseTrackedQueries200Response data, response status code and response headers
484
+ def batch_pause_tracked_queries_with_http_info(organization_id, project_id, idempotency_key, batch_targets_request_data, opts = {})
485
+ if @api_client.config.debugging
486
+ @api_client.config.logger.debug 'Calling API: TrackedQueriesApi.batch_pause_tracked_queries ...'
487
+ end
488
+ # verify the required parameter 'organization_id' is set
489
+ if @api_client.config.client_side_validation && organization_id.nil?
490
+ fail ArgumentError, "Missing the required parameter 'organization_id' when calling TrackedQueriesApi.batch_pause_tracked_queries"
491
+ end
492
+ # verify the required parameter 'project_id' is set
493
+ if @api_client.config.client_side_validation && project_id.nil?
494
+ fail ArgumentError, "Missing the required parameter 'project_id' when calling TrackedQueriesApi.batch_pause_tracked_queries"
495
+ end
496
+ # verify the required parameter 'idempotency_key' is set
497
+ if @api_client.config.client_side_validation && idempotency_key.nil?
498
+ fail ArgumentError, "Missing the required parameter 'idempotency_key' when calling TrackedQueriesApi.batch_pause_tracked_queries"
499
+ end
500
+ # verify the required parameter 'batch_targets_request_data' is set
501
+ if @api_client.config.client_side_validation && batch_targets_request_data.nil?
502
+ fail ArgumentError, "Missing the required parameter 'batch_targets_request_data' when calling TrackedQueriesApi.batch_pause_tracked_queries"
503
+ end
504
+ # resource path
505
+ local_var_path = '/api/v1/organizations/{organizationId}/projects/{projectId}/tracked-queries/batch/pause'.sub('{organizationId}', CGI.escape(organization_id.to_s)).sub('{projectId}', CGI.escape(project_id.to_s))
506
+
507
+ # query parameters
508
+ query_params = opts[:query_params] || {}
509
+
510
+ # header parameters
511
+ header_params = opts[:header_params] || {}
512
+ # HTTP header 'Accept' (if needed)
513
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
514
+ # HTTP header 'Content-Type'
515
+ content_type = @api_client.select_header_content_type(['application/json'])
516
+ if !content_type.nil?
517
+ header_params['Content-Type'] = content_type
518
+ end
519
+ header_params[:'Idempotency-Key'] = idempotency_key
520
+
521
+ # form parameters
522
+ form_params = opts[:form_params] || {}
523
+
524
+ # http body (model)
525
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(batch_targets_request_data)
526
+
527
+ # return_type
528
+ return_type = opts[:debug_return_type] || 'BatchPauseTrackedQueries200Response'
529
+
530
+ # auth_names
531
+ auth_names = opts[:debug_auth_names] || ['ApiKey']
532
+
533
+ new_options = opts.merge(
534
+ :operation => :"TrackedQueriesApi.batch_pause_tracked_queries",
535
+ :header_params => header_params,
536
+ :query_params => query_params,
537
+ :form_params => form_params,
538
+ :body => post_body,
539
+ :auth_names => auth_names,
540
+ :return_type => return_type
541
+ )
542
+
543
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
544
+ if @api_client.config.debugging
545
+ @api_client.config.logger.debug "API called: TrackedQueriesApi#batch_pause_tracked_queries\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
546
+ end
547
+ return data, status_code, headers
548
+ end
549
+
550
+ # Resume several tracked queries
551
+ # Minimum role: manager. Puts up to 100 paused tracked queries of one project back under the scheduler, each independently. Always answers 200 when the batch itself was processed: read `failed` to find out which items were not resumed, never the status code. Items are never rolled back because a later one failed. An id that is already active is reported as successful — resuming asserts a state, not a transition. An id that is not a tracked query of this project is reported as failed with `tracked_query_not_found`, exactly as an id that does not exist at all, and nothing is written for it. No check is run by this operation and nothing is back-filled for the time the queries spent paused. Requires an Idempotency-Key header; a retry must repeat the same ids in the same order to be recognised as a retry rather than refused as a reused key.
552
+ # @param organization_id [String]
553
+ # @param project_id [String]
554
+ # @param idempotency_key [String] Repeating a request with the same key and the same ids answers with the first attempt&#39;s result.
555
+ # @param batch_targets_request_data [BatchTargetsRequestData]
556
+ # @param [Hash] opts the optional parameters
557
+ # @return [BatchResumeTrackedQueries200Response]
558
+ def batch_resume_tracked_queries(organization_id, project_id, idempotency_key, batch_targets_request_data, opts = {})
559
+ data, _status_code, _headers = batch_resume_tracked_queries_with_http_info(organization_id, project_id, idempotency_key, batch_targets_request_data, opts)
560
+ data
561
+ end
562
+
563
+ # Resume several tracked queries
564
+ # Minimum role: manager. Puts up to 100 paused tracked queries of one project back under the scheduler, each independently. Always answers 200 when the batch itself was processed: read &#x60;failed&#x60; to find out which items were not resumed, never the status code. Items are never rolled back because a later one failed. An id that is already active is reported as successful — resuming asserts a state, not a transition. An id that is not a tracked query of this project is reported as failed with &#x60;tracked_query_not_found&#x60;, exactly as an id that does not exist at all, and nothing is written for it. No check is run by this operation and nothing is back-filled for the time the queries spent paused. Requires an Idempotency-Key header; a retry must repeat the same ids in the same order to be recognised as a retry rather than refused as a reused key.
565
+ # @param organization_id [String]
566
+ # @param project_id [String]
567
+ # @param idempotency_key [String] Repeating a request with the same key and the same ids answers with the first attempt&#39;s result.
568
+ # @param batch_targets_request_data [BatchTargetsRequestData]
569
+ # @param [Hash] opts the optional parameters
570
+ # @return [Array<(BatchResumeTrackedQueries200Response, Integer, Hash)>] BatchResumeTrackedQueries200Response data, response status code and response headers
571
+ def batch_resume_tracked_queries_with_http_info(organization_id, project_id, idempotency_key, batch_targets_request_data, opts = {})
572
+ if @api_client.config.debugging
573
+ @api_client.config.logger.debug 'Calling API: TrackedQueriesApi.batch_resume_tracked_queries ...'
574
+ end
575
+ # verify the required parameter 'organization_id' is set
576
+ if @api_client.config.client_side_validation && organization_id.nil?
577
+ fail ArgumentError, "Missing the required parameter 'organization_id' when calling TrackedQueriesApi.batch_resume_tracked_queries"
578
+ end
579
+ # verify the required parameter 'project_id' is set
580
+ if @api_client.config.client_side_validation && project_id.nil?
581
+ fail ArgumentError, "Missing the required parameter 'project_id' when calling TrackedQueriesApi.batch_resume_tracked_queries"
582
+ end
583
+ # verify the required parameter 'idempotency_key' is set
584
+ if @api_client.config.client_side_validation && idempotency_key.nil?
585
+ fail ArgumentError, "Missing the required parameter 'idempotency_key' when calling TrackedQueriesApi.batch_resume_tracked_queries"
586
+ end
587
+ # verify the required parameter 'batch_targets_request_data' is set
588
+ if @api_client.config.client_side_validation && batch_targets_request_data.nil?
589
+ fail ArgumentError, "Missing the required parameter 'batch_targets_request_data' when calling TrackedQueriesApi.batch_resume_tracked_queries"
590
+ end
591
+ # resource path
592
+ local_var_path = '/api/v1/organizations/{organizationId}/projects/{projectId}/tracked-queries/batch/resume'.sub('{organizationId}', CGI.escape(organization_id.to_s)).sub('{projectId}', CGI.escape(project_id.to_s))
593
+
594
+ # query parameters
595
+ query_params = opts[:query_params] || {}
596
+
597
+ # header parameters
598
+ header_params = opts[:header_params] || {}
599
+ # HTTP header 'Accept' (if needed)
600
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
601
+ # HTTP header 'Content-Type'
602
+ content_type = @api_client.select_header_content_type(['application/json'])
603
+ if !content_type.nil?
604
+ header_params['Content-Type'] = content_type
605
+ end
606
+ header_params[:'Idempotency-Key'] = idempotency_key
607
+
608
+ # form parameters
609
+ form_params = opts[:form_params] || {}
610
+
611
+ # http body (model)
612
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(batch_targets_request_data)
613
+
614
+ # return_type
615
+ return_type = opts[:debug_return_type] || 'BatchResumeTrackedQueries200Response'
616
+
617
+ # auth_names
618
+ auth_names = opts[:debug_auth_names] || ['ApiKey']
619
+
620
+ new_options = opts.merge(
621
+ :operation => :"TrackedQueriesApi.batch_resume_tracked_queries",
622
+ :header_params => header_params,
623
+ :query_params => query_params,
624
+ :form_params => form_params,
625
+ :body => post_body,
626
+ :auth_names => auth_names,
627
+ :return_type => return_type
628
+ )
629
+
630
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
631
+ if @api_client.config.debugging
632
+ @api_client.config.logger.debug "API called: TrackedQueriesApi#batch_resume_tracked_queries\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
633
+ end
634
+ return data, status_code, headers
635
+ end
636
+
637
+ # Add many tracked queries to clusters
638
+ # Minimum role: manager. Adds every tracked query named in \"ids\" to every cluster named in \"queryClusterIds\". At most 100 distinct tracked queries per call; duplicates in \"ids\" are collapsed. Partial success: the answer is 200 with a per-item \"successful\" and \"failed\" list even when some items failed, nothing is rolled back, and an id that is not a tracked query of this project is reported as a failed item rather than dropped. Clusters not named are left alone — this adds, it does not replace membership. Every cluster must belong to the project in the path; one that does not is rejected with its field named and nothing is written at all. The \"Idempotency-Key\" header is required, and a repeat of the same key and body returns the recorded answer without running the batch again.
639
+ # @param organization_id [String]
640
+ # @param project_id [String]
641
+ # @param idempotency_key [String] A client-chosen key, unique per operation, so a lost response can be retried without repeating the batch.
642
+ # @param bulk_add_clusters_to_tracked_queries_request [BulkAddClustersToTrackedQueriesRequest]
643
+ # @param [Hash] opts the optional parameters
644
+ # @return [BulkAddClustersToTrackedQueries200Response]
645
+ def bulk_add_clusters_to_tracked_queries(organization_id, project_id, idempotency_key, bulk_add_clusters_to_tracked_queries_request, opts = {})
646
+ data, _status_code, _headers = bulk_add_clusters_to_tracked_queries_with_http_info(organization_id, project_id, idempotency_key, bulk_add_clusters_to_tracked_queries_request, opts)
647
+ data
648
+ end
649
+
650
+ # Add many tracked queries to clusters
651
+ # Minimum role: manager. Adds every tracked query named in \&quot;ids\&quot; to every cluster named in \&quot;queryClusterIds\&quot;. At most 100 distinct tracked queries per call; duplicates in \&quot;ids\&quot; are collapsed. Partial success: the answer is 200 with a per-item \&quot;successful\&quot; and \&quot;failed\&quot; list even when some items failed, nothing is rolled back, and an id that is not a tracked query of this project is reported as a failed item rather than dropped. Clusters not named are left alone — this adds, it does not replace membership. Every cluster must belong to the project in the path; one that does not is rejected with its field named and nothing is written at all. The \&quot;Idempotency-Key\&quot; header is required, and a repeat of the same key and body returns the recorded answer without running the batch again.
652
+ # @param organization_id [String]
653
+ # @param project_id [String]
654
+ # @param idempotency_key [String] A client-chosen key, unique per operation, so a lost response can be retried without repeating the batch.
655
+ # @param bulk_add_clusters_to_tracked_queries_request [BulkAddClustersToTrackedQueriesRequest]
656
+ # @param [Hash] opts the optional parameters
657
+ # @return [Array<(BulkAddClustersToTrackedQueries200Response, Integer, Hash)>] BulkAddClustersToTrackedQueries200Response data, response status code and response headers
658
+ def bulk_add_clusters_to_tracked_queries_with_http_info(organization_id, project_id, idempotency_key, bulk_add_clusters_to_tracked_queries_request, opts = {})
659
+ if @api_client.config.debugging
660
+ @api_client.config.logger.debug 'Calling API: TrackedQueriesApi.bulk_add_clusters_to_tracked_queries ...'
661
+ end
662
+ # verify the required parameter 'organization_id' is set
663
+ if @api_client.config.client_side_validation && organization_id.nil?
664
+ fail ArgumentError, "Missing the required parameter 'organization_id' when calling TrackedQueriesApi.bulk_add_clusters_to_tracked_queries"
665
+ end
666
+ # verify the required parameter 'project_id' is set
667
+ if @api_client.config.client_side_validation && project_id.nil?
668
+ fail ArgumentError, "Missing the required parameter 'project_id' when calling TrackedQueriesApi.bulk_add_clusters_to_tracked_queries"
669
+ end
670
+ # verify the required parameter 'idempotency_key' is set
671
+ if @api_client.config.client_side_validation && idempotency_key.nil?
672
+ fail ArgumentError, "Missing the required parameter 'idempotency_key' when calling TrackedQueriesApi.bulk_add_clusters_to_tracked_queries"
673
+ end
674
+ # verify the required parameter 'bulk_add_clusters_to_tracked_queries_request' is set
675
+ if @api_client.config.client_side_validation && bulk_add_clusters_to_tracked_queries_request.nil?
676
+ fail ArgumentError, "Missing the required parameter 'bulk_add_clusters_to_tracked_queries_request' when calling TrackedQueriesApi.bulk_add_clusters_to_tracked_queries"
677
+ end
678
+ # resource path
679
+ local_var_path = '/api/v1/organizations/{organizationId}/projects/{projectId}/tracked-queries/bulk/clusters'.sub('{organizationId}', CGI.escape(organization_id.to_s)).sub('{projectId}', CGI.escape(project_id.to_s))
680
+
681
+ # query parameters
682
+ query_params = opts[:query_params] || {}
683
+
684
+ # header parameters
685
+ header_params = opts[:header_params] || {}
686
+ # HTTP header 'Accept' (if needed)
687
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
688
+ # HTTP header 'Content-Type'
689
+ content_type = @api_client.select_header_content_type(['application/json'])
690
+ if !content_type.nil?
691
+ header_params['Content-Type'] = content_type
692
+ end
693
+ header_params[:'Idempotency-Key'] = idempotency_key
694
+
695
+ # form parameters
696
+ form_params = opts[:form_params] || {}
697
+
698
+ # http body (model)
699
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(bulk_add_clusters_to_tracked_queries_request)
700
+
701
+ # return_type
702
+ return_type = opts[:debug_return_type] || 'BulkAddClustersToTrackedQueries200Response'
703
+
704
+ # auth_names
705
+ auth_names = opts[:debug_auth_names] || ['ApiKey']
706
+
707
+ new_options = opts.merge(
708
+ :operation => :"TrackedQueriesApi.bulk_add_clusters_to_tracked_queries",
709
+ :header_params => header_params,
710
+ :query_params => query_params,
711
+ :form_params => form_params,
712
+ :body => post_body,
713
+ :auth_names => auth_names,
714
+ :return_type => return_type
715
+ )
716
+
717
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
718
+ if @api_client.config.debugging
719
+ @api_client.config.logger.debug "API called: TrackedQueriesApi#bulk_add_clusters_to_tracked_queries\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
720
+ end
721
+ return data, status_code, headers
722
+ end
723
+
724
+ # Delete tracked queries
725
+ # Minimum role: manager. Permanently deletes the tracked queries named in `ids`, at most 100 distinct ids per call. The organization must be active and the project must not be archived. Deletion is hard and cannot be undone: the tracked query is removed along with its captured answers, matches, search pages and rank history, and any check already in flight for it is cancelled. Those cascades run in the background, so a 200 means the tracked queries were deleted, not that every derived record has finished being purged. Partial success: an id that is not a tracked query of this project — unknown, malformed, already deleted, or belonging to somewhere else — is reported under `failed` with `tracked_query_not_found` while the rest are deleted. It never deletes more than the ids it is given: there is no \"delete everything matching a filter\" mode. The Idempotency-Key header is required; a retry with the same key and the same body returns this same answer without deleting anything again.
726
+ # @param organization_id [String]
727
+ # @param project_id [String]
728
+ # @param idempotency_key [String] A client-chosen key, unique per operation. Replaying it returns the first answer instead of deleting anything again.
729
+ # @param batch_targets_request_data [BatchTargetsRequestData]
730
+ # @param [Hash] opts the optional parameters
731
+ # @return [BatchWriteOutcome]
732
+ def bulk_delete_tracked_queries(organization_id, project_id, idempotency_key, batch_targets_request_data, opts = {})
733
+ data, _status_code, _headers = bulk_delete_tracked_queries_with_http_info(organization_id, project_id, idempotency_key, batch_targets_request_data, opts)
734
+ data
735
+ end
736
+
737
+ # Delete tracked queries
738
+ # Minimum role: manager. Permanently deletes the tracked queries named in &#x60;ids&#x60;, at most 100 distinct ids per call. The organization must be active and the project must not be archived. Deletion is hard and cannot be undone: the tracked query is removed along with its captured answers, matches, search pages and rank history, and any check already in flight for it is cancelled. Those cascades run in the background, so a 200 means the tracked queries were deleted, not that every derived record has finished being purged. Partial success: an id that is not a tracked query of this project — unknown, malformed, already deleted, or belonging to somewhere else — is reported under &#x60;failed&#x60; with &#x60;tracked_query_not_found&#x60; while the rest are deleted. It never deletes more than the ids it is given: there is no \&quot;delete everything matching a filter\&quot; mode. The Idempotency-Key header is required; a retry with the same key and the same body returns this same answer without deleting anything again.
739
+ # @param organization_id [String]
740
+ # @param project_id [String]
741
+ # @param idempotency_key [String] A client-chosen key, unique per operation. Replaying it returns the first answer instead of deleting anything again.
742
+ # @param batch_targets_request_data [BatchTargetsRequestData]
743
+ # @param [Hash] opts the optional parameters
744
+ # @return [Array<(BatchWriteOutcome, Integer, Hash)>] BatchWriteOutcome data, response status code and response headers
745
+ def bulk_delete_tracked_queries_with_http_info(organization_id, project_id, idempotency_key, batch_targets_request_data, opts = {})
746
+ if @api_client.config.debugging
747
+ @api_client.config.logger.debug 'Calling API: TrackedQueriesApi.bulk_delete_tracked_queries ...'
748
+ end
749
+ # verify the required parameter 'organization_id' is set
750
+ if @api_client.config.client_side_validation && organization_id.nil?
751
+ fail ArgumentError, "Missing the required parameter 'organization_id' when calling TrackedQueriesApi.bulk_delete_tracked_queries"
752
+ end
753
+ # verify the required parameter 'project_id' is set
754
+ if @api_client.config.client_side_validation && project_id.nil?
755
+ fail ArgumentError, "Missing the required parameter 'project_id' when calling TrackedQueriesApi.bulk_delete_tracked_queries"
756
+ end
757
+ # verify the required parameter 'idempotency_key' is set
758
+ if @api_client.config.client_side_validation && idempotency_key.nil?
759
+ fail ArgumentError, "Missing the required parameter 'idempotency_key' when calling TrackedQueriesApi.bulk_delete_tracked_queries"
760
+ end
761
+ # verify the required parameter 'batch_targets_request_data' is set
762
+ if @api_client.config.client_side_validation && batch_targets_request_data.nil?
763
+ fail ArgumentError, "Missing the required parameter 'batch_targets_request_data' when calling TrackedQueriesApi.bulk_delete_tracked_queries"
764
+ end
765
+ # resource path
766
+ local_var_path = '/api/v1/organizations/{organizationId}/projects/{projectId}/tracked-queries/bulk-delete'.sub('{organizationId}', CGI.escape(organization_id.to_s)).sub('{projectId}', CGI.escape(project_id.to_s))
767
+
768
+ # query parameters
769
+ query_params = opts[:query_params] || {}
770
+
771
+ # header parameters
772
+ header_params = opts[:header_params] || {}
773
+ # HTTP header 'Accept' (if needed)
774
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
775
+ # HTTP header 'Content-Type'
776
+ content_type = @api_client.select_header_content_type(['application/json'])
777
+ if !content_type.nil?
778
+ header_params['Content-Type'] = content_type
779
+ end
780
+ header_params[:'Idempotency-Key'] = idempotency_key
781
+
782
+ # form parameters
783
+ form_params = opts[:form_params] || {}
784
+
785
+ # http body (model)
786
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(batch_targets_request_data)
787
+
788
+ # return_type
789
+ return_type = opts[:debug_return_type] || 'BatchWriteOutcome'
790
+
791
+ # auth_names
792
+ auth_names = opts[:debug_auth_names] || ['ApiKey']
793
+
794
+ new_options = opts.merge(
795
+ :operation => :"TrackedQueriesApi.bulk_delete_tracked_queries",
796
+ :header_params => header_params,
797
+ :query_params => query_params,
798
+ :form_params => form_params,
799
+ :body => post_body,
800
+ :auth_names => auth_names,
801
+ :return_type => return_type
802
+ )
803
+
804
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
805
+ if @api_client.config.debugging
806
+ @api_client.config.logger.debug "API called: TrackedQueriesApi#bulk_delete_tracked_queries\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
807
+ end
808
+ return data, status_code, headers
809
+ end
810
+
811
+ # Remove many tracked queries from clusters
812
+ # Minimum role: manager. Removes every tracked query named in \"ids\" from every cluster named in \"queryClusterIds\". At most 100 distinct tracked queries per call; duplicates in \"ids\" are collapsed. Partial success: the answer is 200 with a per-item \"successful\" and \"failed\" list even when some items failed, nothing is rolled back, and an id that is not a tracked query of this project is reported as a failed item rather than dropped. Neither the clusters nor the tracked queries are deleted: only the membership between them. Every cluster must belong to the project in the path; one that does not is rejected with its field named and nothing is written at all. NOTE: this DELETE requires a request body — some HTTP client libraries and proxies strip bodies from DELETE, and a stripped body is refused with a validation error rather than interpreted as \"remove everything\". The \"Idempotency-Key\" header is required, and a repeat of the same key and body returns the recorded answer without running the batch again.
813
+ # @param organization_id [String]
814
+ # @param project_id [String]
815
+ # @param idempotency_key [String] A client-chosen key, unique per operation, so a lost response can be retried without repeating the batch.
816
+ # @param bulk_remove_clusters_from_tracked_queries_request [BulkRemoveClustersFromTrackedQueriesRequest] Required. A DELETE with no body is rejected.
817
+ # @param [Hash] opts the optional parameters
818
+ # @return [BulkRemoveClustersFromTrackedQueries200Response]
819
+ def bulk_remove_clusters_from_tracked_queries(organization_id, project_id, idempotency_key, bulk_remove_clusters_from_tracked_queries_request, opts = {})
820
+ data, _status_code, _headers = bulk_remove_clusters_from_tracked_queries_with_http_info(organization_id, project_id, idempotency_key, bulk_remove_clusters_from_tracked_queries_request, opts)
821
+ data
822
+ end
823
+
824
+ # Remove many tracked queries from clusters
825
+ # Minimum role: manager. Removes every tracked query named in \&quot;ids\&quot; from every cluster named in \&quot;queryClusterIds\&quot;. At most 100 distinct tracked queries per call; duplicates in \&quot;ids\&quot; are collapsed. Partial success: the answer is 200 with a per-item \&quot;successful\&quot; and \&quot;failed\&quot; list even when some items failed, nothing is rolled back, and an id that is not a tracked query of this project is reported as a failed item rather than dropped. Neither the clusters nor the tracked queries are deleted: only the membership between them. Every cluster must belong to the project in the path; one that does not is rejected with its field named and nothing is written at all. NOTE: this DELETE requires a request body — some HTTP client libraries and proxies strip bodies from DELETE, and a stripped body is refused with a validation error rather than interpreted as \&quot;remove everything\&quot;. The \&quot;Idempotency-Key\&quot; header is required, and a repeat of the same key and body returns the recorded answer without running the batch again.
826
+ # @param organization_id [String]
827
+ # @param project_id [String]
828
+ # @param idempotency_key [String] A client-chosen key, unique per operation, so a lost response can be retried without repeating the batch.
829
+ # @param bulk_remove_clusters_from_tracked_queries_request [BulkRemoveClustersFromTrackedQueriesRequest] Required. A DELETE with no body is rejected.
830
+ # @param [Hash] opts the optional parameters
831
+ # @return [Array<(BulkRemoveClustersFromTrackedQueries200Response, Integer, Hash)>] BulkRemoveClustersFromTrackedQueries200Response data, response status code and response headers
832
+ def bulk_remove_clusters_from_tracked_queries_with_http_info(organization_id, project_id, idempotency_key, bulk_remove_clusters_from_tracked_queries_request, opts = {})
833
+ if @api_client.config.debugging
834
+ @api_client.config.logger.debug 'Calling API: TrackedQueriesApi.bulk_remove_clusters_from_tracked_queries ...'
835
+ end
836
+ # verify the required parameter 'organization_id' is set
837
+ if @api_client.config.client_side_validation && organization_id.nil?
838
+ fail ArgumentError, "Missing the required parameter 'organization_id' when calling TrackedQueriesApi.bulk_remove_clusters_from_tracked_queries"
839
+ end
840
+ # verify the required parameter 'project_id' is set
841
+ if @api_client.config.client_side_validation && project_id.nil?
842
+ fail ArgumentError, "Missing the required parameter 'project_id' when calling TrackedQueriesApi.bulk_remove_clusters_from_tracked_queries"
843
+ end
844
+ # verify the required parameter 'idempotency_key' is set
845
+ if @api_client.config.client_side_validation && idempotency_key.nil?
846
+ fail ArgumentError, "Missing the required parameter 'idempotency_key' when calling TrackedQueriesApi.bulk_remove_clusters_from_tracked_queries"
847
+ end
848
+ # verify the required parameter 'bulk_remove_clusters_from_tracked_queries_request' is set
849
+ if @api_client.config.client_side_validation && bulk_remove_clusters_from_tracked_queries_request.nil?
850
+ fail ArgumentError, "Missing the required parameter 'bulk_remove_clusters_from_tracked_queries_request' when calling TrackedQueriesApi.bulk_remove_clusters_from_tracked_queries"
851
+ end
852
+ # resource path
853
+ local_var_path = '/api/v1/organizations/{organizationId}/projects/{projectId}/tracked-queries/bulk/clusters'.sub('{organizationId}', CGI.escape(organization_id.to_s)).sub('{projectId}', CGI.escape(project_id.to_s))
854
+
855
+ # query parameters
856
+ query_params = opts[:query_params] || {}
857
+
858
+ # header parameters
859
+ header_params = opts[:header_params] || {}
860
+ # HTTP header 'Accept' (if needed)
861
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
862
+ # HTTP header 'Content-Type'
863
+ content_type = @api_client.select_header_content_type(['application/json'])
864
+ if !content_type.nil?
865
+ header_params['Content-Type'] = content_type
866
+ end
867
+ header_params[:'Idempotency-Key'] = idempotency_key
868
+
869
+ # form parameters
870
+ form_params = opts[:form_params] || {}
871
+
872
+ # http body (model)
873
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(bulk_remove_clusters_from_tracked_queries_request)
874
+
875
+ # return_type
876
+ return_type = opts[:debug_return_type] || 'BulkRemoveClustersFromTrackedQueries200Response'
877
+
878
+ # auth_names
879
+ auth_names = opts[:debug_auth_names] || ['ApiKey']
880
+
881
+ new_options = opts.merge(
882
+ :operation => :"TrackedQueriesApi.bulk_remove_clusters_from_tracked_queries",
883
+ :header_params => header_params,
884
+ :query_params => query_params,
885
+ :form_params => form_params,
886
+ :body => post_body,
887
+ :auth_names => auth_names,
888
+ :return_type => return_type
889
+ )
890
+
891
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
892
+ if @api_client.config.debugging
893
+ @api_client.config.logger.debug "API called: TrackedQueriesApi#bulk_remove_clusters_from_tracked_queries\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
894
+ end
895
+ return data, status_code, headers
896
+ end
897
+
898
+ # Change how often a tracked query is checked
899
+ # Minimum role: manager. Sets how often one tracked query is checked while it is active. The organization must be active and the project must not be archived. Setting the frequency it already has is accepted and changes nothing. This does NOT run a check, does not backfill history, and does not reschedule a check already in flight: the new cadence applies from the next time the query is considered. A paused query keeps the setting but is not checked until it is resumed. A tracked query belonging to another project answers 404, the same answer an unknown id gets. The Idempotency-Key header is required; a retry with the same key and the same body returns this same answer without applying anything again.
900
+ # @param organization_id [String]
901
+ # @param project_id [String]
902
+ # @param tracked_query_id [String] Must belong to the project in the path.
903
+ # @param idempotency_key [String] A client-chosen key, unique per operation. Replaying it returns the first answer instead of applying anything again.
904
+ # @param change_tracked_query_check_frequency_request_data [ChangeTrackedQueryCheckFrequencyRequestData]
905
+ # @param [Hash] opts the optional parameters
906
+ # @return [TrackedQueryDetailResource]
907
+ def change_tracked_query_check_frequency(organization_id, project_id, tracked_query_id, idempotency_key, change_tracked_query_check_frequency_request_data, opts = {})
908
+ data, _status_code, _headers = change_tracked_query_check_frequency_with_http_info(organization_id, project_id, tracked_query_id, idempotency_key, change_tracked_query_check_frequency_request_data, opts)
909
+ data
910
+ end
911
+
912
+ # Change how often a tracked query is checked
913
+ # Minimum role: manager. Sets how often one tracked query is checked while it is active. The organization must be active and the project must not be archived. Setting the frequency it already has is accepted and changes nothing. This does NOT run a check, does not backfill history, and does not reschedule a check already in flight: the new cadence applies from the next time the query is considered. A paused query keeps the setting but is not checked until it is resumed. A tracked query belonging to another project answers 404, the same answer an unknown id gets. The Idempotency-Key header is required; a retry with the same key and the same body returns this same answer without applying anything again.
914
+ # @param organization_id [String]
915
+ # @param project_id [String]
916
+ # @param tracked_query_id [String] Must belong to the project in the path.
917
+ # @param idempotency_key [String] A client-chosen key, unique per operation. Replaying it returns the first answer instead of applying anything again.
918
+ # @param change_tracked_query_check_frequency_request_data [ChangeTrackedQueryCheckFrequencyRequestData]
919
+ # @param [Hash] opts the optional parameters
920
+ # @return [Array<(TrackedQueryDetailResource, Integer, Hash)>] TrackedQueryDetailResource data, response status code and response headers
921
+ def change_tracked_query_check_frequency_with_http_info(organization_id, project_id, tracked_query_id, idempotency_key, change_tracked_query_check_frequency_request_data, opts = {})
922
+ if @api_client.config.debugging
923
+ @api_client.config.logger.debug 'Calling API: TrackedQueriesApi.change_tracked_query_check_frequency ...'
924
+ end
925
+ # verify the required parameter 'organization_id' is set
926
+ if @api_client.config.client_side_validation && organization_id.nil?
927
+ fail ArgumentError, "Missing the required parameter 'organization_id' when calling TrackedQueriesApi.change_tracked_query_check_frequency"
928
+ end
929
+ # verify the required parameter 'project_id' is set
930
+ if @api_client.config.client_side_validation && project_id.nil?
931
+ fail ArgumentError, "Missing the required parameter 'project_id' when calling TrackedQueriesApi.change_tracked_query_check_frequency"
932
+ end
933
+ # verify the required parameter 'tracked_query_id' is set
934
+ if @api_client.config.client_side_validation && tracked_query_id.nil?
935
+ fail ArgumentError, "Missing the required parameter 'tracked_query_id' when calling TrackedQueriesApi.change_tracked_query_check_frequency"
936
+ end
937
+ # verify the required parameter 'idempotency_key' is set
938
+ if @api_client.config.client_side_validation && idempotency_key.nil?
939
+ fail ArgumentError, "Missing the required parameter 'idempotency_key' when calling TrackedQueriesApi.change_tracked_query_check_frequency"
940
+ end
941
+ # verify the required parameter 'change_tracked_query_check_frequency_request_data' is set
942
+ if @api_client.config.client_side_validation && change_tracked_query_check_frequency_request_data.nil?
943
+ fail ArgumentError, "Missing the required parameter 'change_tracked_query_check_frequency_request_data' when calling TrackedQueriesApi.change_tracked_query_check_frequency"
944
+ end
945
+ # resource path
946
+ local_var_path = '/api/v1/organizations/{organizationId}/projects/{projectId}/tracked-queries/{trackedQueryId}/check-frequency'.sub('{organizationId}', CGI.escape(organization_id.to_s)).sub('{projectId}', CGI.escape(project_id.to_s)).sub('{trackedQueryId}', CGI.escape(tracked_query_id.to_s))
947
+
948
+ # query parameters
949
+ query_params = opts[:query_params] || {}
950
+
951
+ # header parameters
952
+ header_params = opts[:header_params] || {}
953
+ # HTTP header 'Accept' (if needed)
954
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
955
+ # HTTP header 'Content-Type'
956
+ content_type = @api_client.select_header_content_type(['application/json'])
957
+ if !content_type.nil?
958
+ header_params['Content-Type'] = content_type
959
+ end
960
+ header_params[:'Idempotency-Key'] = idempotency_key
961
+
962
+ # form parameters
963
+ form_params = opts[:form_params] || {}
964
+
965
+ # http body (model)
966
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(change_tracked_query_check_frequency_request_data)
967
+
968
+ # return_type
969
+ return_type = opts[:debug_return_type] || 'TrackedQueryDetailResource'
970
+
971
+ # auth_names
972
+ auth_names = opts[:debug_auth_names] || ['ApiKey']
973
+
974
+ new_options = opts.merge(
975
+ :operation => :"TrackedQueriesApi.change_tracked_query_check_frequency",
976
+ :header_params => header_params,
977
+ :query_params => query_params,
978
+ :form_params => form_params,
979
+ :body => post_body,
980
+ :auth_names => auth_names,
981
+ :return_type => return_type
982
+ )
983
+
984
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
985
+ if @api_client.config.debugging
986
+ @api_client.config.logger.debug "API called: TrackedQueriesApi#change_tracked_query_check_frequency\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
987
+ end
988
+ return data, status_code, headers
989
+ end
990
+
991
+ # Change how many passes a tracked query runs per check
992
+ # Minimum role: manager. Sets how many times one tracked query is asked per check. AI engines are not deterministic, so several passes are averaged; `google_serp` and `google_shopping` run a single pass and refuse any value above one with 409 `n_passes_not_supported_for_engine`. Setting the value back to 1 is always allowed. The organization must be active and the project must not be archived. Setting the value it already has is accepted and changes nothing. This does NOT run a check and does not change history already captured: it applies from the next check. More passes cost proportionally more of the plan's check budget. A tracked query belonging to another project answers 404, the same answer an unknown id gets. The Idempotency-Key header is required; a retry with the same key and the same body returns this same answer without applying anything again.
993
+ # @param organization_id [String]
994
+ # @param project_id [String]
995
+ # @param tracked_query_id [String] Must belong to the project in the path.
996
+ # @param idempotency_key [String] A client-chosen key, unique per operation. Replaying it returns the first answer instead of applying anything again.
997
+ # @param change_tracked_query_passes_request_data [ChangeTrackedQueryPassesRequestData]
998
+ # @param [Hash] opts the optional parameters
999
+ # @return [TrackedQueryDetailResource]
1000
+ def change_tracked_query_n_passes(organization_id, project_id, tracked_query_id, idempotency_key, change_tracked_query_passes_request_data, opts = {})
1001
+ data, _status_code, _headers = change_tracked_query_n_passes_with_http_info(organization_id, project_id, tracked_query_id, idempotency_key, change_tracked_query_passes_request_data, opts)
1002
+ data
1003
+ end
1004
+
1005
+ # Change how many passes a tracked query runs per check
1006
+ # Minimum role: manager. Sets how many times one tracked query is asked per check. AI engines are not deterministic, so several passes are averaged; &#x60;google_serp&#x60; and &#x60;google_shopping&#x60; run a single pass and refuse any value above one with 409 &#x60;n_passes_not_supported_for_engine&#x60;. Setting the value back to 1 is always allowed. The organization must be active and the project must not be archived. Setting the value it already has is accepted and changes nothing. This does NOT run a check and does not change history already captured: it applies from the next check. More passes cost proportionally more of the plan&#39;s check budget. A tracked query belonging to another project answers 404, the same answer an unknown id gets. The Idempotency-Key header is required; a retry with the same key and the same body returns this same answer without applying anything again.
1007
+ # @param organization_id [String]
1008
+ # @param project_id [String]
1009
+ # @param tracked_query_id [String] Must belong to the project in the path.
1010
+ # @param idempotency_key [String] A client-chosen key, unique per operation. Replaying it returns the first answer instead of applying anything again.
1011
+ # @param change_tracked_query_passes_request_data [ChangeTrackedQueryPassesRequestData]
1012
+ # @param [Hash] opts the optional parameters
1013
+ # @return [Array<(TrackedQueryDetailResource, Integer, Hash)>] TrackedQueryDetailResource data, response status code and response headers
1014
+ def change_tracked_query_n_passes_with_http_info(organization_id, project_id, tracked_query_id, idempotency_key, change_tracked_query_passes_request_data, opts = {})
1015
+ if @api_client.config.debugging
1016
+ @api_client.config.logger.debug 'Calling API: TrackedQueriesApi.change_tracked_query_n_passes ...'
1017
+ end
1018
+ # verify the required parameter 'organization_id' is set
1019
+ if @api_client.config.client_side_validation && organization_id.nil?
1020
+ fail ArgumentError, "Missing the required parameter 'organization_id' when calling TrackedQueriesApi.change_tracked_query_n_passes"
1021
+ end
1022
+ # verify the required parameter 'project_id' is set
1023
+ if @api_client.config.client_side_validation && project_id.nil?
1024
+ fail ArgumentError, "Missing the required parameter 'project_id' when calling TrackedQueriesApi.change_tracked_query_n_passes"
1025
+ end
1026
+ # verify the required parameter 'tracked_query_id' is set
1027
+ if @api_client.config.client_side_validation && tracked_query_id.nil?
1028
+ fail ArgumentError, "Missing the required parameter 'tracked_query_id' when calling TrackedQueriesApi.change_tracked_query_n_passes"
1029
+ end
1030
+ # verify the required parameter 'idempotency_key' is set
1031
+ if @api_client.config.client_side_validation && idempotency_key.nil?
1032
+ fail ArgumentError, "Missing the required parameter 'idempotency_key' when calling TrackedQueriesApi.change_tracked_query_n_passes"
1033
+ end
1034
+ # verify the required parameter 'change_tracked_query_passes_request_data' is set
1035
+ if @api_client.config.client_side_validation && change_tracked_query_passes_request_data.nil?
1036
+ fail ArgumentError, "Missing the required parameter 'change_tracked_query_passes_request_data' when calling TrackedQueriesApi.change_tracked_query_n_passes"
1037
+ end
1038
+ # resource path
1039
+ local_var_path = '/api/v1/organizations/{organizationId}/projects/{projectId}/tracked-queries/{trackedQueryId}/passes'.sub('{organizationId}', CGI.escape(organization_id.to_s)).sub('{projectId}', CGI.escape(project_id.to_s)).sub('{trackedQueryId}', CGI.escape(tracked_query_id.to_s))
1040
+
1041
+ # query parameters
1042
+ query_params = opts[:query_params] || {}
1043
+
1044
+ # header parameters
1045
+ header_params = opts[:header_params] || {}
1046
+ # HTTP header 'Accept' (if needed)
1047
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1048
+ # HTTP header 'Content-Type'
1049
+ content_type = @api_client.select_header_content_type(['application/json'])
1050
+ if !content_type.nil?
1051
+ header_params['Content-Type'] = content_type
1052
+ end
1053
+ header_params[:'Idempotency-Key'] = idempotency_key
1054
+
1055
+ # form parameters
1056
+ form_params = opts[:form_params] || {}
1057
+
1058
+ # http body (model)
1059
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(change_tracked_query_passes_request_data)
1060
+
1061
+ # return_type
1062
+ return_type = opts[:debug_return_type] || 'TrackedQueryDetailResource'
1063
+
1064
+ # auth_names
1065
+ auth_names = opts[:debug_auth_names] || ['ApiKey']
1066
+
1067
+ new_options = opts.merge(
1068
+ :operation => :"TrackedQueriesApi.change_tracked_query_n_passes",
1069
+ :header_params => header_params,
1070
+ :query_params => query_params,
1071
+ :form_params => form_params,
1072
+ :body => post_body,
1073
+ :auth_names => auth_names,
1074
+ :return_type => return_type
1075
+ )
1076
+
1077
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
1078
+ if @api_client.config.debugging
1079
+ @api_client.config.logger.debug "API called: TrackedQueriesApi#change_tracked_query_n_passes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1080
+ end
1081
+ return data, status_code, headers
1082
+ end
1083
+
1084
+ # Count a project's tracked queries and price checking them
1085
+ # Minimum role: viewer. Two numbers about one project: how many tracked queries it holds, and what force-checking that same set would cost. Omit `status` to count every tracked query whatever its status; send `active` or `paused` to count and price only those. `checkCost` is a PRICED DRY RUN expressed in check budget units — one unit per pass, the same unit the plan allowance is counted in, so it is directly comparable with `checksAvailable` from the entitlements operation — and it is the sum of each matched tracked query's configured passes. Asking reserves nothing, debits nothing and starts no check. It is deliberately NOT a forecast of what the check-all operation will consume: that operation skips paused queries, skips a query whose check is already pending or running, re-runs a check awaiting retry without charging for it again, and stops at whatever budget is left — none of which is subtracted here. Count with `status=active` for the figure closest to a full check-all. Both numbers are read from the write model, so a tracked query created moments ago is already in them; that is why they can be AHEAD of the `total` returned by the tracked-queries listing, which counts a search projection, and ahead of the keyword listings, which read projections refreshed in the background. Summing the unfiltered count over every project of an organization, archived projects included, reproduces countOrganizationTrackedQueries, which counts through the same counter in the same store. An archived project still answers, because this is a read, but no check can be submitted there while it stays archived, so its cost is hypothetical. For a month of scheduled rounds across the whole organization instead of one round over one project, read getOrganizationProjectedMonthlyChecks. No monetary amount is published or implied: the cost of a check is published only in budget units.
1086
+ # @param organization_id [String]
1087
+ # @param project_id [String]
1088
+ # @param [Hash] opts the optional parameters
1089
+ # @option opts [String] :status Restrict both numbers to one status. Lower-case; an unknown value is rejected, not ignored. Omitted, every status is counted and priced.
1090
+ # @return [TrackedQueryCountResource]
1091
+ def count_tracked_queries(organization_id, project_id, opts = {})
1092
+ data, _status_code, _headers = count_tracked_queries_with_http_info(organization_id, project_id, opts)
1093
+ data
1094
+ end
1095
+
1096
+ # Count a project&#39;s tracked queries and price checking them
1097
+ # Minimum role: viewer. Two numbers about one project: how many tracked queries it holds, and what force-checking that same set would cost. Omit &#x60;status&#x60; to count every tracked query whatever its status; send &#x60;active&#x60; or &#x60;paused&#x60; to count and price only those. &#x60;checkCost&#x60; is a PRICED DRY RUN expressed in check budget units — one unit per pass, the same unit the plan allowance is counted in, so it is directly comparable with &#x60;checksAvailable&#x60; from the entitlements operation — and it is the sum of each matched tracked query&#39;s configured passes. Asking reserves nothing, debits nothing and starts no check. It is deliberately NOT a forecast of what the check-all operation will consume: that operation skips paused queries, skips a query whose check is already pending or running, re-runs a check awaiting retry without charging for it again, and stops at whatever budget is left — none of which is subtracted here. Count with &#x60;status&#x3D;active&#x60; for the figure closest to a full check-all. Both numbers are read from the write model, so a tracked query created moments ago is already in them; that is why they can be AHEAD of the &#x60;total&#x60; returned by the tracked-queries listing, which counts a search projection, and ahead of the keyword listings, which read projections refreshed in the background. Summing the unfiltered count over every project of an organization, archived projects included, reproduces countOrganizationTrackedQueries, which counts through the same counter in the same store. An archived project still answers, because this is a read, but no check can be submitted there while it stays archived, so its cost is hypothetical. For a month of scheduled rounds across the whole organization instead of one round over one project, read getOrganizationProjectedMonthlyChecks. No monetary amount is published or implied: the cost of a check is published only in budget units.
1098
+ # @param organization_id [String]
1099
+ # @param project_id [String]
1100
+ # @param [Hash] opts the optional parameters
1101
+ # @option opts [String] :status Restrict both numbers to one status. Lower-case; an unknown value is rejected, not ignored. Omitted, every status is counted and priced.
1102
+ # @return [Array<(TrackedQueryCountResource, Integer, Hash)>] TrackedQueryCountResource data, response status code and response headers
1103
+ def count_tracked_queries_with_http_info(organization_id, project_id, opts = {})
1104
+ if @api_client.config.debugging
1105
+ @api_client.config.logger.debug 'Calling API: TrackedQueriesApi.count_tracked_queries ...'
1106
+ end
1107
+ # verify the required parameter 'organization_id' is set
1108
+ if @api_client.config.client_side_validation && organization_id.nil?
1109
+ fail ArgumentError, "Missing the required parameter 'organization_id' when calling TrackedQueriesApi.count_tracked_queries"
1110
+ end
1111
+ # verify the required parameter 'project_id' is set
1112
+ if @api_client.config.client_side_validation && project_id.nil?
1113
+ fail ArgumentError, "Missing the required parameter 'project_id' when calling TrackedQueriesApi.count_tracked_queries"
1114
+ end
1115
+ allowable_values = ["active", "paused"]
1116
+ if @api_client.config.client_side_validation && opts[:'status'] && !allowable_values.include?(opts[:'status'])
1117
+ fail ArgumentError, "invalid value for \"status\", must be one of #{allowable_values}"
1118
+ end
1119
+ # resource path
1120
+ local_var_path = '/api/v1/organizations/{organizationId}/projects/{projectId}/tracked-queries/count'.sub('{organizationId}', CGI.escape(organization_id.to_s)).sub('{projectId}', CGI.escape(project_id.to_s))
1121
+
1122
+ # query parameters
1123
+ query_params = opts[:query_params] || {}
1124
+ query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
1125
+
1126
+ # header parameters
1127
+ header_params = opts[:header_params] || {}
1128
+ # HTTP header 'Accept' (if needed)
1129
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1130
+
1131
+ # form parameters
1132
+ form_params = opts[:form_params] || {}
1133
+
1134
+ # http body (model)
1135
+ post_body = opts[:debug_body]
1136
+
1137
+ # return_type
1138
+ return_type = opts[:debug_return_type] || 'TrackedQueryCountResource'
1139
+
1140
+ # auth_names
1141
+ auth_names = opts[:debug_auth_names] || ['ApiKey']
1142
+
1143
+ new_options = opts.merge(
1144
+ :operation => :"TrackedQueriesApi.count_tracked_queries",
1145
+ :header_params => header_params,
1146
+ :query_params => query_params,
1147
+ :form_params => form_params,
1148
+ :body => post_body,
1149
+ :auth_names => auth_names,
1150
+ :return_type => return_type
1151
+ )
1152
+
1153
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1154
+ if @api_client.config.debugging
1155
+ @api_client.config.logger.debug "API called: TrackedQueriesApi#count_tracked_queries\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1156
+ end
1157
+ return data, status_code, headers
1158
+ end
1159
+
1160
+ # Check every eligible tracked query of a project now
1161
+ # Minimum role: manager. Submits a fresh check for every eligible tracked query of the project, ignoring how recently each was last checked, least-recently-checked first, and at most 1000 tracked queries per call. Eligible is narrower than active: a paused query is skipped, and so is one whose check is already pending or running for the same engine. A query whose check is awaiting a retry is included and, WHEN THE ENGINE HAS NOT CHANGED SINCE, costs nothing extra, because its first submission already paid for it; if the engine did change, the pending run is replaced and the replacement is paid for. What is left is trimmed to what the organization's remaining check budget can pay for — a check costs one budget unit per pass. While a subscription is cancelled but still inside its paid grace window nothing is submitted at all and `submitted` is 0; name the queries explicitly through the check operation to run them in that window. CALLING AGAIN DOES NOT CONTINUE WHERE THIS CALL STOPPED: submissions are handed to a worker, and a tracked query stops being selected only once that worker has started its check, so a second call made before the queue drains selects and submits the same tracked queries again. That is safe while the first check is still running — the duplicate is collapsed, and nothing is checked or charged twice — but a check that has already finished is run again and charged again, because this operation ignores staleness by design. To cover a project with more than 1000 eligible tracked queries, wait for the submitted wave to be picked up — each tracked query's lastCheckedAt advances when its check completes — and call again then. The response lists the tracked queries submitted and carries NO job id: a check already in flight is reused rather than started again, so no id could be guaranteed to exist. Submission is accepted, not completed: a listed tracked query can still lose the last budget units to another caller before the worker reaches it. The request takes no body, and any field sent is rejected. Requires an Idempotency-Key header.
1162
+ # @param organization_id [String]
1163
+ # @param project_id [String]
1164
+ # @param idempotency_key [String] Repeating a request with the same key answers with the first attempt&#39;s result instead of submitting a second wave.
1165
+ # @param [Hash] opts the optional parameters
1166
+ # @return [SubmittedChecksResource]
1167
+ def force_check_all_active_tracked_queries(organization_id, project_id, idempotency_key, opts = {})
1168
+ data, _status_code, _headers = force_check_all_active_tracked_queries_with_http_info(organization_id, project_id, idempotency_key, opts)
1169
+ data
1170
+ end
1171
+
1172
+ # Check every eligible tracked query of a project now
1173
+ # Minimum role: manager. Submits a fresh check for every eligible tracked query of the project, ignoring how recently each was last checked, least-recently-checked first, and at most 1000 tracked queries per call. Eligible is narrower than active: a paused query is skipped, and so is one whose check is already pending or running for the same engine. A query whose check is awaiting a retry is included and, WHEN THE ENGINE HAS NOT CHANGED SINCE, costs nothing extra, because its first submission already paid for it; if the engine did change, the pending run is replaced and the replacement is paid for. What is left is trimmed to what the organization&#39;s remaining check budget can pay for — a check costs one budget unit per pass. While a subscription is cancelled but still inside its paid grace window nothing is submitted at all and &#x60;submitted&#x60; is 0; name the queries explicitly through the check operation to run them in that window. CALLING AGAIN DOES NOT CONTINUE WHERE THIS CALL STOPPED: submissions are handed to a worker, and a tracked query stops being selected only once that worker has started its check, so a second call made before the queue drains selects and submits the same tracked queries again. That is safe while the first check is still running — the duplicate is collapsed, and nothing is checked or charged twice — but a check that has already finished is run again and charged again, because this operation ignores staleness by design. To cover a project with more than 1000 eligible tracked queries, wait for the submitted wave to be picked up — each tracked query&#39;s lastCheckedAt advances when its check completes — and call again then. The response lists the tracked queries submitted and carries NO job id: a check already in flight is reused rather than started again, so no id could be guaranteed to exist. Submission is accepted, not completed: a listed tracked query can still lose the last budget units to another caller before the worker reaches it. The request takes no body, and any field sent is rejected. Requires an Idempotency-Key header.
1174
+ # @param organization_id [String]
1175
+ # @param project_id [String]
1176
+ # @param idempotency_key [String] Repeating a request with the same key answers with the first attempt&#39;s result instead of submitting a second wave.
1177
+ # @param [Hash] opts the optional parameters
1178
+ # @return [Array<(SubmittedChecksResource, Integer, Hash)>] SubmittedChecksResource data, response status code and response headers
1179
+ def force_check_all_active_tracked_queries_with_http_info(organization_id, project_id, idempotency_key, opts = {})
1180
+ if @api_client.config.debugging
1181
+ @api_client.config.logger.debug 'Calling API: TrackedQueriesApi.force_check_all_active_tracked_queries ...'
1182
+ end
1183
+ # verify the required parameter 'organization_id' is set
1184
+ if @api_client.config.client_side_validation && organization_id.nil?
1185
+ fail ArgumentError, "Missing the required parameter 'organization_id' when calling TrackedQueriesApi.force_check_all_active_tracked_queries"
1186
+ end
1187
+ # verify the required parameter 'project_id' is set
1188
+ if @api_client.config.client_side_validation && project_id.nil?
1189
+ fail ArgumentError, "Missing the required parameter 'project_id' when calling TrackedQueriesApi.force_check_all_active_tracked_queries"
1190
+ end
1191
+ # verify the required parameter 'idempotency_key' is set
1192
+ if @api_client.config.client_side_validation && idempotency_key.nil?
1193
+ fail ArgumentError, "Missing the required parameter 'idempotency_key' when calling TrackedQueriesApi.force_check_all_active_tracked_queries"
1194
+ end
1195
+ # resource path
1196
+ local_var_path = '/api/v1/organizations/{organizationId}/projects/{projectId}/tracked-queries/check-all'.sub('{organizationId}', CGI.escape(organization_id.to_s)).sub('{projectId}', CGI.escape(project_id.to_s))
1197
+
1198
+ # query parameters
1199
+ query_params = opts[:query_params] || {}
1200
+
1201
+ # header parameters
1202
+ header_params = opts[:header_params] || {}
1203
+ # HTTP header 'Accept' (if needed)
1204
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1205
+ header_params[:'Idempotency-Key'] = idempotency_key
1206
+
1207
+ # form parameters
1208
+ form_params = opts[:form_params] || {}
1209
+
1210
+ # http body (model)
1211
+ post_body = opts[:debug_body]
1212
+
1213
+ # return_type
1214
+ return_type = opts[:debug_return_type] || 'SubmittedChecksResource'
1215
+
1216
+ # auth_names
1217
+ auth_names = opts[:debug_auth_names] || ['ApiKey']
1218
+
1219
+ new_options = opts.merge(
1220
+ :operation => :"TrackedQueriesApi.force_check_all_active_tracked_queries",
1221
+ :header_params => header_params,
1222
+ :query_params => query_params,
1223
+ :form_params => form_params,
1224
+ :body => post_body,
1225
+ :auth_names => auth_names,
1226
+ :return_type => return_type
1227
+ )
1228
+
1229
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
1230
+ if @api_client.config.debugging
1231
+ @api_client.config.logger.debug "API called: TrackedQueriesApi#force_check_all_active_tracked_queries\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1232
+ end
1233
+ return data, status_code, headers
1234
+ end
1235
+
1236
+ # Get a tracked query
1237
+ # Minimum role: viewer. The configuration of one tracked query: the text sent to the engine, the engine, locale and country it is asked in, the clusters it belongs to, and how often it is checked. A lastCheckedAt of null means no check has completed yet — it is not a check that found nothing. A tracked query belonging to another project answers 404, the same answer an unknown id gets, so the API never confirms that an inaccessible tracked query exists. Rank positions, share of voice and sentiment are not part of this response: they belong to a date window and are served by the analytics endpoints.
1238
+ # @param organization_id [String]
1239
+ # @param project_id [String]
1240
+ # @param tracked_query_id [String] Must belong to the project in the path.
1241
+ # @param [Hash] opts the optional parameters
1242
+ # @return [TrackedQueryDetailResource]
1243
+ def get_tracked_query(organization_id, project_id, tracked_query_id, opts = {})
1244
+ data, _status_code, _headers = get_tracked_query_with_http_info(organization_id, project_id, tracked_query_id, opts)
1245
+ data
1246
+ end
1247
+
1248
+ # Get a tracked query
1249
+ # Minimum role: viewer. The configuration of one tracked query: the text sent to the engine, the engine, locale and country it is asked in, the clusters it belongs to, and how often it is checked. A lastCheckedAt of null means no check has completed yet — it is not a check that found nothing. A tracked query belonging to another project answers 404, the same answer an unknown id gets, so the API never confirms that an inaccessible tracked query exists. Rank positions, share of voice and sentiment are not part of this response: they belong to a date window and are served by the analytics endpoints.
1250
+ # @param organization_id [String]
1251
+ # @param project_id [String]
1252
+ # @param tracked_query_id [String] Must belong to the project in the path.
1253
+ # @param [Hash] opts the optional parameters
1254
+ # @return [Array<(TrackedQueryDetailResource, Integer, Hash)>] TrackedQueryDetailResource data, response status code and response headers
1255
+ def get_tracked_query_with_http_info(organization_id, project_id, tracked_query_id, opts = {})
1256
+ if @api_client.config.debugging
1257
+ @api_client.config.logger.debug 'Calling API: TrackedQueriesApi.get_tracked_query ...'
1258
+ end
1259
+ # verify the required parameter 'organization_id' is set
1260
+ if @api_client.config.client_side_validation && organization_id.nil?
1261
+ fail ArgumentError, "Missing the required parameter 'organization_id' when calling TrackedQueriesApi.get_tracked_query"
1262
+ end
1263
+ # verify the required parameter 'project_id' is set
1264
+ if @api_client.config.client_side_validation && project_id.nil?
1265
+ fail ArgumentError, "Missing the required parameter 'project_id' when calling TrackedQueriesApi.get_tracked_query"
1266
+ end
1267
+ # verify the required parameter 'tracked_query_id' is set
1268
+ if @api_client.config.client_side_validation && tracked_query_id.nil?
1269
+ fail ArgumentError, "Missing the required parameter 'tracked_query_id' when calling TrackedQueriesApi.get_tracked_query"
1270
+ end
1271
+ # resource path
1272
+ local_var_path = '/api/v1/organizations/{organizationId}/projects/{projectId}/tracked-queries/{trackedQueryId}'.sub('{organizationId}', CGI.escape(organization_id.to_s)).sub('{projectId}', CGI.escape(project_id.to_s)).sub('{trackedQueryId}', CGI.escape(tracked_query_id.to_s))
1273
+
1274
+ # query parameters
1275
+ query_params = opts[:query_params] || {}
1276
+
1277
+ # header parameters
1278
+ header_params = opts[:header_params] || {}
1279
+ # HTTP header 'Accept' (if needed)
1280
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1281
+
1282
+ # form parameters
1283
+ form_params = opts[:form_params] || {}
1284
+
1285
+ # http body (model)
1286
+ post_body = opts[:debug_body]
1287
+
1288
+ # return_type
1289
+ return_type = opts[:debug_return_type] || 'TrackedQueryDetailResource'
1290
+
1291
+ # auth_names
1292
+ auth_names = opts[:debug_auth_names] || ['ApiKey']
1293
+
1294
+ new_options = opts.merge(
1295
+ :operation => :"TrackedQueriesApi.get_tracked_query",
1296
+ :header_params => header_params,
1297
+ :query_params => query_params,
1298
+ :form_params => form_params,
1299
+ :body => post_body,
1300
+ :auth_names => auth_names,
1301
+ :return_type => return_type
1302
+ )
1303
+
1304
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1305
+ if @api_client.config.debugging
1306
+ @api_client.config.logger.debug "API called: TrackedQueriesApi#get_tracked_query\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1307
+ end
1308
+ return data, status_code, headers
1309
+ end
1310
+
1311
+ # Pause a tracked query
1312
+ # Minimum role: manager. Stops the scheduler from checking this tracked query; it keeps its configuration, its clusters and every result already collected, and nothing is deleted. Pausing a query that is already paused succeeds and answers the same body — this is a PUT asserting a state, not a transition, so it is safe to repeat. It does NOT cancel a check that is already running: a check in flight when the pause lands still completes and still consumes the budget unit it reserved. The request takes no body, and any field sent is rejected. Requires an Idempotency-Key header.
1313
+ # @param organization_id [String]
1314
+ # @param project_id [String]
1315
+ # @param tracked_query_id [String] Must belong to the project in the path.
1316
+ # @param idempotency_key [String] Repeating a request with the same key answers with the first attempt&#39;s result instead of pausing again.
1317
+ # @param [Hash] opts the optional parameters
1318
+ # @return [TrackedQueryDetailResource]
1319
+ def pause_tracked_query(organization_id, project_id, tracked_query_id, idempotency_key, opts = {})
1320
+ data, _status_code, _headers = pause_tracked_query_with_http_info(organization_id, project_id, tracked_query_id, idempotency_key, opts)
1321
+ data
1322
+ end
1323
+
1324
+ # Pause a tracked query
1325
+ # Minimum role: manager. Stops the scheduler from checking this tracked query; it keeps its configuration, its clusters and every result already collected, and nothing is deleted. Pausing a query that is already paused succeeds and answers the same body — this is a PUT asserting a state, not a transition, so it is safe to repeat. It does NOT cancel a check that is already running: a check in flight when the pause lands still completes and still consumes the budget unit it reserved. The request takes no body, and any field sent is rejected. Requires an Idempotency-Key header.
1326
+ # @param organization_id [String]
1327
+ # @param project_id [String]
1328
+ # @param tracked_query_id [String] Must belong to the project in the path.
1329
+ # @param idempotency_key [String] Repeating a request with the same key answers with the first attempt&#39;s result instead of pausing again.
1330
+ # @param [Hash] opts the optional parameters
1331
+ # @return [Array<(TrackedQueryDetailResource, Integer, Hash)>] TrackedQueryDetailResource data, response status code and response headers
1332
+ def pause_tracked_query_with_http_info(organization_id, project_id, tracked_query_id, idempotency_key, opts = {})
1333
+ if @api_client.config.debugging
1334
+ @api_client.config.logger.debug 'Calling API: TrackedQueriesApi.pause_tracked_query ...'
1335
+ end
1336
+ # verify the required parameter 'organization_id' is set
1337
+ if @api_client.config.client_side_validation && organization_id.nil?
1338
+ fail ArgumentError, "Missing the required parameter 'organization_id' when calling TrackedQueriesApi.pause_tracked_query"
1339
+ end
1340
+ # verify the required parameter 'project_id' is set
1341
+ if @api_client.config.client_side_validation && project_id.nil?
1342
+ fail ArgumentError, "Missing the required parameter 'project_id' when calling TrackedQueriesApi.pause_tracked_query"
1343
+ end
1344
+ # verify the required parameter 'tracked_query_id' is set
1345
+ if @api_client.config.client_side_validation && tracked_query_id.nil?
1346
+ fail ArgumentError, "Missing the required parameter 'tracked_query_id' when calling TrackedQueriesApi.pause_tracked_query"
1347
+ end
1348
+ # verify the required parameter 'idempotency_key' is set
1349
+ if @api_client.config.client_side_validation && idempotency_key.nil?
1350
+ fail ArgumentError, "Missing the required parameter 'idempotency_key' when calling TrackedQueriesApi.pause_tracked_query"
1351
+ end
1352
+ # resource path
1353
+ local_var_path = '/api/v1/organizations/{organizationId}/projects/{projectId}/tracked-queries/{trackedQueryId}/pause'.sub('{organizationId}', CGI.escape(organization_id.to_s)).sub('{projectId}', CGI.escape(project_id.to_s)).sub('{trackedQueryId}', CGI.escape(tracked_query_id.to_s))
1354
+
1355
+ # query parameters
1356
+ query_params = opts[:query_params] || {}
1357
+
1358
+ # header parameters
1359
+ header_params = opts[:header_params] || {}
1360
+ # HTTP header 'Accept' (if needed)
1361
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1362
+ header_params[:'Idempotency-Key'] = idempotency_key
1363
+
1364
+ # form parameters
1365
+ form_params = opts[:form_params] || {}
1366
+
1367
+ # http body (model)
1368
+ post_body = opts[:debug_body]
1369
+
1370
+ # return_type
1371
+ return_type = opts[:debug_return_type] || 'TrackedQueryDetailResource'
1372
+
1373
+ # auth_names
1374
+ auth_names = opts[:debug_auth_names] || ['ApiKey']
1375
+
1376
+ new_options = opts.merge(
1377
+ :operation => :"TrackedQueriesApi.pause_tracked_query",
1378
+ :header_params => header_params,
1379
+ :query_params => query_params,
1380
+ :form_params => form_params,
1381
+ :body => post_body,
1382
+ :auth_names => auth_names,
1383
+ :return_type => return_type
1384
+ )
1385
+
1386
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
1387
+ if @api_client.config.debugging
1388
+ @api_client.config.logger.debug "API called: TrackedQueriesApi#pause_tracked_query\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1389
+ end
1390
+ return data, status_code, headers
1391
+ end
1392
+
1393
+ # Remove a tracked query from clusters
1394
+ # Minimum role: manager. Removes the tracked query from every cluster named in \"queryClusterIds\" and answers with the query in its new state. A cluster the query does not belong to is skipped, not reported as an error. Neither the clusters nor the tracked query are deleted: only the membership between them. Every cluster must belong to the project in the path. NOTE: this DELETE requires a request body — some HTTP client libraries and proxies strip bodies from DELETE, and a stripped body is refused with a validation error rather than interpreted as \"remove all clusters\". The \"Idempotency-Key\" header is required, and a repeat of the same key and body returns the recorded answer without removing anything again.
1395
+ # @param organization_id [String]
1396
+ # @param project_id [String]
1397
+ # @param tracked_query_id [String] Must belong to the project in the path.
1398
+ # @param idempotency_key [String] A client-chosen key, unique per operation, so a lost response can be retried without repeating the write.
1399
+ # @param cluster_membership_request_data [ClusterMembershipRequestData] Required. A DELETE with no body is rejected.
1400
+ # @param [Hash] opts the optional parameters
1401
+ # @return [TrackedQueryDetailResource]
1402
+ def remove_clusters_from_tracked_query(organization_id, project_id, tracked_query_id, idempotency_key, cluster_membership_request_data, opts = {})
1403
+ data, _status_code, _headers = remove_clusters_from_tracked_query_with_http_info(organization_id, project_id, tracked_query_id, idempotency_key, cluster_membership_request_data, opts)
1404
+ data
1405
+ end
1406
+
1407
+ # Remove a tracked query from clusters
1408
+ # Minimum role: manager. Removes the tracked query from every cluster named in \&quot;queryClusterIds\&quot; and answers with the query in its new state. A cluster the query does not belong to is skipped, not reported as an error. Neither the clusters nor the tracked query are deleted: only the membership between them. Every cluster must belong to the project in the path. NOTE: this DELETE requires a request body — some HTTP client libraries and proxies strip bodies from DELETE, and a stripped body is refused with a validation error rather than interpreted as \&quot;remove all clusters\&quot;. The \&quot;Idempotency-Key\&quot; header is required, and a repeat of the same key and body returns the recorded answer without removing anything again.
1409
+ # @param organization_id [String]
1410
+ # @param project_id [String]
1411
+ # @param tracked_query_id [String] Must belong to the project in the path.
1412
+ # @param idempotency_key [String] A client-chosen key, unique per operation, so a lost response can be retried without repeating the write.
1413
+ # @param cluster_membership_request_data [ClusterMembershipRequestData] Required. A DELETE with no body is rejected.
1414
+ # @param [Hash] opts the optional parameters
1415
+ # @return [Array<(TrackedQueryDetailResource, Integer, Hash)>] TrackedQueryDetailResource data, response status code and response headers
1416
+ def remove_clusters_from_tracked_query_with_http_info(organization_id, project_id, tracked_query_id, idempotency_key, cluster_membership_request_data, opts = {})
1417
+ if @api_client.config.debugging
1418
+ @api_client.config.logger.debug 'Calling API: TrackedQueriesApi.remove_clusters_from_tracked_query ...'
1419
+ end
1420
+ # verify the required parameter 'organization_id' is set
1421
+ if @api_client.config.client_side_validation && organization_id.nil?
1422
+ fail ArgumentError, "Missing the required parameter 'organization_id' when calling TrackedQueriesApi.remove_clusters_from_tracked_query"
1423
+ end
1424
+ # verify the required parameter 'project_id' is set
1425
+ if @api_client.config.client_side_validation && project_id.nil?
1426
+ fail ArgumentError, "Missing the required parameter 'project_id' when calling TrackedQueriesApi.remove_clusters_from_tracked_query"
1427
+ end
1428
+ # verify the required parameter 'tracked_query_id' is set
1429
+ if @api_client.config.client_side_validation && tracked_query_id.nil?
1430
+ fail ArgumentError, "Missing the required parameter 'tracked_query_id' when calling TrackedQueriesApi.remove_clusters_from_tracked_query"
1431
+ end
1432
+ # verify the required parameter 'idempotency_key' is set
1433
+ if @api_client.config.client_side_validation && idempotency_key.nil?
1434
+ fail ArgumentError, "Missing the required parameter 'idempotency_key' when calling TrackedQueriesApi.remove_clusters_from_tracked_query"
1435
+ end
1436
+ # verify the required parameter 'cluster_membership_request_data' is set
1437
+ if @api_client.config.client_side_validation && cluster_membership_request_data.nil?
1438
+ fail ArgumentError, "Missing the required parameter 'cluster_membership_request_data' when calling TrackedQueriesApi.remove_clusters_from_tracked_query"
1439
+ end
1440
+ # resource path
1441
+ local_var_path = '/api/v1/organizations/{organizationId}/projects/{projectId}/tracked-queries/{trackedQueryId}/clusters'.sub('{organizationId}', CGI.escape(organization_id.to_s)).sub('{projectId}', CGI.escape(project_id.to_s)).sub('{trackedQueryId}', CGI.escape(tracked_query_id.to_s))
1442
+
1443
+ # query parameters
1444
+ query_params = opts[:query_params] || {}
1445
+
1446
+ # header parameters
1447
+ header_params = opts[:header_params] || {}
1448
+ # HTTP header 'Accept' (if needed)
1449
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1450
+ # HTTP header 'Content-Type'
1451
+ content_type = @api_client.select_header_content_type(['application/json'])
1452
+ if !content_type.nil?
1453
+ header_params['Content-Type'] = content_type
1454
+ end
1455
+ header_params[:'Idempotency-Key'] = idempotency_key
1456
+
1457
+ # form parameters
1458
+ form_params = opts[:form_params] || {}
1459
+
1460
+ # http body (model)
1461
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(cluster_membership_request_data)
1462
+
1463
+ # return_type
1464
+ return_type = opts[:debug_return_type] || 'TrackedQueryDetailResource'
1465
+
1466
+ # auth_names
1467
+ auth_names = opts[:debug_auth_names] || ['ApiKey']
1468
+
1469
+ new_options = opts.merge(
1470
+ :operation => :"TrackedQueriesApi.remove_clusters_from_tracked_query",
1471
+ :header_params => header_params,
1472
+ :query_params => query_params,
1473
+ :form_params => form_params,
1474
+ :body => post_body,
1475
+ :auth_names => auth_names,
1476
+ :return_type => return_type
1477
+ )
1478
+
1479
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
1480
+ if @api_client.config.debugging
1481
+ @api_client.config.logger.debug "API called: TrackedQueriesApi#remove_clusters_from_tracked_query\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1482
+ end
1483
+ return data, status_code, headers
1484
+ end
1485
+
1486
+ # Report a problem with a captured AI answer
1487
+ # Minimum role: viewer — deliberately lower than the other tracked-query writes, because a report changes nothing a viewer cannot already read. The key still needs the \"write\" capability. The report is forwarded to the team that reviews the scrape run behind the capture; it does not change the capture, the tracked query, or any metric derived from them, and nothing in this API will show the report afterwards. A 200 means the report was accepted for review, not that anything was corrected, and there is no identifier to poll. A capture that belongs to another tracked query or project answers 404, the same answer an unknown id gets. A capture that cannot be routed back to its scrape run answers 409 \"ai_check_session_unavailable\", and it cannot be reported. That code covers two moments, which behave differently for your key: when the capture carries no scrape run at all the refusal is decided BEFORE anything is sent, so the idempotency key is left unused and the same key answers the same way however often it is presented; when the review system itself rejects the run — its own retention having elapsed — the refusal comes after the forward was attempted, so the key is spent like any outcome we cannot confirm. You can tell them apart without guessing: retry the same key, and a reply of \"operation_outcome_uncertain\" means the refusal came from the review system. Delivery is at-most-once: the \"Idempotency-Key\" header is required and a repeat of the same key and body returns the recorded answer, but a delivery whose outcome is unknown refuses replay on that key rather than risk filing the report twice.
1488
+ # @param organization_id [String]
1489
+ # @param project_id [String]
1490
+ # @param tracked_query_id [String] Must belong to the project in the path.
1491
+ # @param ai_response_id [String] A capture id from the AI responses listing. Must belong to the tracked query in the path.
1492
+ # @param idempotency_key [String] A client-chosen key, unique per report, so a lost response can be retried without filing the report twice.
1493
+ # @param report_ai_response_request [ReportAiResponseRequest]
1494
+ # @param [Hash] opts the optional parameters
1495
+ # @return [AiResponseReportResource]
1496
+ def report_ai_response(organization_id, project_id, tracked_query_id, ai_response_id, idempotency_key, report_ai_response_request, opts = {})
1497
+ data, _status_code, _headers = report_ai_response_with_http_info(organization_id, project_id, tracked_query_id, ai_response_id, idempotency_key, report_ai_response_request, opts)
1498
+ data
1499
+ end
1500
+
1501
+ # Report a problem with a captured AI answer
1502
+ # Minimum role: viewer — deliberately lower than the other tracked-query writes, because a report changes nothing a viewer cannot already read. The key still needs the \&quot;write\&quot; capability. The report is forwarded to the team that reviews the scrape run behind the capture; it does not change the capture, the tracked query, or any metric derived from them, and nothing in this API will show the report afterwards. A 200 means the report was accepted for review, not that anything was corrected, and there is no identifier to poll. A capture that belongs to another tracked query or project answers 404, the same answer an unknown id gets. A capture that cannot be routed back to its scrape run answers 409 \&quot;ai_check_session_unavailable\&quot;, and it cannot be reported. That code covers two moments, which behave differently for your key: when the capture carries no scrape run at all the refusal is decided BEFORE anything is sent, so the idempotency key is left unused and the same key answers the same way however often it is presented; when the review system itself rejects the run — its own retention having elapsed — the refusal comes after the forward was attempted, so the key is spent like any outcome we cannot confirm. You can tell them apart without guessing: retry the same key, and a reply of \&quot;operation_outcome_uncertain\&quot; means the refusal came from the review system. Delivery is at-most-once: the \&quot;Idempotency-Key\&quot; header is required and a repeat of the same key and body returns the recorded answer, but a delivery whose outcome is unknown refuses replay on that key rather than risk filing the report twice.
1503
+ # @param organization_id [String]
1504
+ # @param project_id [String]
1505
+ # @param tracked_query_id [String] Must belong to the project in the path.
1506
+ # @param ai_response_id [String] A capture id from the AI responses listing. Must belong to the tracked query in the path.
1507
+ # @param idempotency_key [String] A client-chosen key, unique per report, so a lost response can be retried without filing the report twice.
1508
+ # @param report_ai_response_request [ReportAiResponseRequest]
1509
+ # @param [Hash] opts the optional parameters
1510
+ # @return [Array<(AiResponseReportResource, Integer, Hash)>] AiResponseReportResource data, response status code and response headers
1511
+ def report_ai_response_with_http_info(organization_id, project_id, tracked_query_id, ai_response_id, idempotency_key, report_ai_response_request, opts = {})
1512
+ if @api_client.config.debugging
1513
+ @api_client.config.logger.debug 'Calling API: TrackedQueriesApi.report_ai_response ...'
1514
+ end
1515
+ # verify the required parameter 'organization_id' is set
1516
+ if @api_client.config.client_side_validation && organization_id.nil?
1517
+ fail ArgumentError, "Missing the required parameter 'organization_id' when calling TrackedQueriesApi.report_ai_response"
1518
+ end
1519
+ # verify the required parameter 'project_id' is set
1520
+ if @api_client.config.client_side_validation && project_id.nil?
1521
+ fail ArgumentError, "Missing the required parameter 'project_id' when calling TrackedQueriesApi.report_ai_response"
1522
+ end
1523
+ # verify the required parameter 'tracked_query_id' is set
1524
+ if @api_client.config.client_side_validation && tracked_query_id.nil?
1525
+ fail ArgumentError, "Missing the required parameter 'tracked_query_id' when calling TrackedQueriesApi.report_ai_response"
1526
+ end
1527
+ # verify the required parameter 'ai_response_id' is set
1528
+ if @api_client.config.client_side_validation && ai_response_id.nil?
1529
+ fail ArgumentError, "Missing the required parameter 'ai_response_id' when calling TrackedQueriesApi.report_ai_response"
1530
+ end
1531
+ # verify the required parameter 'idempotency_key' is set
1532
+ if @api_client.config.client_side_validation && idempotency_key.nil?
1533
+ fail ArgumentError, "Missing the required parameter 'idempotency_key' when calling TrackedQueriesApi.report_ai_response"
1534
+ end
1535
+ # verify the required parameter 'report_ai_response_request' is set
1536
+ if @api_client.config.client_side_validation && report_ai_response_request.nil?
1537
+ fail ArgumentError, "Missing the required parameter 'report_ai_response_request' when calling TrackedQueriesApi.report_ai_response"
1538
+ end
1539
+ # resource path
1540
+ local_var_path = '/api/v1/organizations/{organizationId}/projects/{projectId}/tracked-queries/{trackedQueryId}/responses/{aiResponseId}/report'.sub('{organizationId}', CGI.escape(organization_id.to_s)).sub('{projectId}', CGI.escape(project_id.to_s)).sub('{trackedQueryId}', CGI.escape(tracked_query_id.to_s)).sub('{aiResponseId}', CGI.escape(ai_response_id.to_s))
1541
+
1542
+ # query parameters
1543
+ query_params = opts[:query_params] || {}
1544
+
1545
+ # header parameters
1546
+ header_params = opts[:header_params] || {}
1547
+ # HTTP header 'Accept' (if needed)
1548
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1549
+ # HTTP header 'Content-Type'
1550
+ content_type = @api_client.select_header_content_type(['application/json'])
1551
+ if !content_type.nil?
1552
+ header_params['Content-Type'] = content_type
1553
+ end
1554
+ header_params[:'Idempotency-Key'] = idempotency_key
1555
+
1556
+ # form parameters
1557
+ form_params = opts[:form_params] || {}
1558
+
1559
+ # http body (model)
1560
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(report_ai_response_request)
1561
+
1562
+ # return_type
1563
+ return_type = opts[:debug_return_type] || 'AiResponseReportResource'
1564
+
1565
+ # auth_names
1566
+ auth_names = opts[:debug_auth_names] || ['ApiKey']
1567
+
1568
+ new_options = opts.merge(
1569
+ :operation => :"TrackedQueriesApi.report_ai_response",
1570
+ :header_params => header_params,
1571
+ :query_params => query_params,
1572
+ :form_params => form_params,
1573
+ :body => post_body,
1574
+ :auth_names => auth_names,
1575
+ :return_type => return_type
1576
+ )
1577
+
1578
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
1579
+ if @api_client.config.debugging
1580
+ @api_client.config.logger.debug "API called: TrackedQueriesApi#report_ai_response\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1581
+ end
1582
+ return data, status_code, headers
1583
+ end
1584
+
1585
+ # Resume a tracked query
1586
+ # Minimum role: manager. Puts a paused tracked query back under the scheduler. Resuming a query that is already active succeeds and answers the same body — this is a PUT asserting a state, not a transition. It does NOT run a check: the query is checked when it next falls due under its own checkFrequency, and results collected while it was paused are unaffected. Nothing is back-filled for the time it spent paused. The request takes no body, and any field sent is rejected. Requires an Idempotency-Key header.
1587
+ # @param organization_id [String]
1588
+ # @param project_id [String]
1589
+ # @param tracked_query_id [String] Must belong to the project in the path.
1590
+ # @param idempotency_key [String] Repeating a request with the same key answers with the first attempt&#39;s result instead of resuming again.
1591
+ # @param [Hash] opts the optional parameters
1592
+ # @return [TrackedQueryDetailResource]
1593
+ def resume_tracked_query(organization_id, project_id, tracked_query_id, idempotency_key, opts = {})
1594
+ data, _status_code, _headers = resume_tracked_query_with_http_info(organization_id, project_id, tracked_query_id, idempotency_key, opts)
1595
+ data
1596
+ end
1597
+
1598
+ # Resume a tracked query
1599
+ # Minimum role: manager. Puts a paused tracked query back under the scheduler. Resuming a query that is already active succeeds and answers the same body — this is a PUT asserting a state, not a transition. It does NOT run a check: the query is checked when it next falls due under its own checkFrequency, and results collected while it was paused are unaffected. Nothing is back-filled for the time it spent paused. The request takes no body, and any field sent is rejected. Requires an Idempotency-Key header.
1600
+ # @param organization_id [String]
1601
+ # @param project_id [String]
1602
+ # @param tracked_query_id [String] Must belong to the project in the path.
1603
+ # @param idempotency_key [String] Repeating a request with the same key answers with the first attempt&#39;s result instead of resuming again.
1604
+ # @param [Hash] opts the optional parameters
1605
+ # @return [Array<(TrackedQueryDetailResource, Integer, Hash)>] TrackedQueryDetailResource data, response status code and response headers
1606
+ def resume_tracked_query_with_http_info(organization_id, project_id, tracked_query_id, idempotency_key, opts = {})
1607
+ if @api_client.config.debugging
1608
+ @api_client.config.logger.debug 'Calling API: TrackedQueriesApi.resume_tracked_query ...'
1609
+ end
1610
+ # verify the required parameter 'organization_id' is set
1611
+ if @api_client.config.client_side_validation && organization_id.nil?
1612
+ fail ArgumentError, "Missing the required parameter 'organization_id' when calling TrackedQueriesApi.resume_tracked_query"
1613
+ end
1614
+ # verify the required parameter 'project_id' is set
1615
+ if @api_client.config.client_side_validation && project_id.nil?
1616
+ fail ArgumentError, "Missing the required parameter 'project_id' when calling TrackedQueriesApi.resume_tracked_query"
1617
+ end
1618
+ # verify the required parameter 'tracked_query_id' is set
1619
+ if @api_client.config.client_side_validation && tracked_query_id.nil?
1620
+ fail ArgumentError, "Missing the required parameter 'tracked_query_id' when calling TrackedQueriesApi.resume_tracked_query"
1621
+ end
1622
+ # verify the required parameter 'idempotency_key' is set
1623
+ if @api_client.config.client_side_validation && idempotency_key.nil?
1624
+ fail ArgumentError, "Missing the required parameter 'idempotency_key' when calling TrackedQueriesApi.resume_tracked_query"
1625
+ end
1626
+ # resource path
1627
+ local_var_path = '/api/v1/organizations/{organizationId}/projects/{projectId}/tracked-queries/{trackedQueryId}/resume'.sub('{organizationId}', CGI.escape(organization_id.to_s)).sub('{projectId}', CGI.escape(project_id.to_s)).sub('{trackedQueryId}', CGI.escape(tracked_query_id.to_s))
1628
+
1629
+ # query parameters
1630
+ query_params = opts[:query_params] || {}
1631
+
1632
+ # header parameters
1633
+ header_params = opts[:header_params] || {}
1634
+ # HTTP header 'Accept' (if needed)
1635
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1636
+ header_params[:'Idempotency-Key'] = idempotency_key
1637
+
1638
+ # form parameters
1639
+ form_params = opts[:form_params] || {}
1640
+
1641
+ # http body (model)
1642
+ post_body = opts[:debug_body]
1643
+
1644
+ # return_type
1645
+ return_type = opts[:debug_return_type] || 'TrackedQueryDetailResource'
1646
+
1647
+ # auth_names
1648
+ auth_names = opts[:debug_auth_names] || ['ApiKey']
1649
+
1650
+ new_options = opts.merge(
1651
+ :operation => :"TrackedQueriesApi.resume_tracked_query",
1652
+ :header_params => header_params,
1653
+ :query_params => query_params,
1654
+ :form_params => form_params,
1655
+ :body => post_body,
1656
+ :auth_names => auth_names,
1657
+ :return_type => return_type
1658
+ )
1659
+
1660
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
1661
+ if @api_client.config.debugging
1662
+ @api_client.config.logger.debug "API called: TrackedQueriesApi#resume_tracked_query\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1663
+ end
1664
+ return data, status_code, headers
1665
+ end
1666
+
1667
+ # Search a project's tracked queries
1668
+ # Minimum role: viewer. One row per tracked query — a single keyword on a single engine in a single country — carrying the metrics of its most recent completed check. Filter by status, engine, country and a free-text search over the keyword, and sort by any of the returned metrics. Positions (lastSerpPosition, lastMentionPosition, lastLinkPosition, lastShoppingPosition) are 1-based ranks, so LOWER is better; lastShareOfVoice and lastPositivityIndex are percentages from 0 to 100, where HIGHER is better. Every nullable field means \"not known yet\" rather than zero: a null position is a query with no data for that surface, a null lastPositivityIndex is a check with no mentions to score, and a null lastCheckedAt is a query that has never been checked — none of them is a score of zero. This listing reads a projection refreshed by background subscribers, not the write model, so a tracked query created or changed moments ago may not appear here yet or may still show its previous settings. It catches up on its own; nothing is lost. If you need to read back what you just wrote, the creation response carries the new ids and the single tracked-query operation reads the write model directly. total counts the tracked queries the filters match, not the rows on this page. A limit above the maximum is rejected, never clamped, and a filter this endpoint does not support is rejected rather than ignored.Send `Accept: text/csv` to receive the same page as a CSV download instead of JSON: same filters, same authorization, same page window and the same maximum of 100 rows — it is this page in another format, not a bulk export, so a whole collection is still read by paging. The CSV carries no `total`, because a table whose every row is a record has nowhere to put one; read it from the JSON representation of the same request. A list-valued field is joined into one cell with `; ` as a display projection — parse the JSON if you need the structure. Cells beginning with `=`, `+`, `-` or `@` are prefixed with an apostrophe so a spreadsheet treats them as text rather than running them as formulas.
1669
+ # @param organization_id [String]
1670
+ # @param project_id [String]
1671
+ # @param [Hash] opts the optional parameters
1672
+ # @option opts [Integer] :limit Page size. A value above the maximum is rejected, never clamped. (default to 20)
1673
+ # @option opts [Integer] :offset (default to 0)
1674
+ # @option opts [String] :search Free-text search over the keyword.
1675
+ # @option opts [String] :status
1676
+ # @option opts [Array<String>] :engines Repeatable, or comma-separated.
1677
+ # @option opts [Array<String>] :countries ISO-3166 alpha-2 codes or English names. Must be configured on the project.
1678
+ # @option opts [String] :sort_by (default to 'queryText')
1679
+ # @option opts [String] :sort_order (default to 'desc')
1680
+ # @return [SearchTrackedQueries200Response]
1681
+ def search_tracked_queries(organization_id, project_id, opts = {})
1682
+ data, _status_code, _headers = search_tracked_queries_with_http_info(organization_id, project_id, opts)
1683
+ data
1684
+ end
1685
+
1686
+ # Search a project&#39;s tracked queries
1687
+ # Minimum role: viewer. One row per tracked query — a single keyword on a single engine in a single country — carrying the metrics of its most recent completed check. Filter by status, engine, country and a free-text search over the keyword, and sort by any of the returned metrics. Positions (lastSerpPosition, lastMentionPosition, lastLinkPosition, lastShoppingPosition) are 1-based ranks, so LOWER is better; lastShareOfVoice and lastPositivityIndex are percentages from 0 to 100, where HIGHER is better. Every nullable field means \&quot;not known yet\&quot; rather than zero: a null position is a query with no data for that surface, a null lastPositivityIndex is a check with no mentions to score, and a null lastCheckedAt is a query that has never been checked — none of them is a score of zero. This listing reads a projection refreshed by background subscribers, not the write model, so a tracked query created or changed moments ago may not appear here yet or may still show its previous settings. It catches up on its own; nothing is lost. If you need to read back what you just wrote, the creation response carries the new ids and the single tracked-query operation reads the write model directly. total counts the tracked queries the filters match, not the rows on this page. A limit above the maximum is rejected, never clamped, and a filter this endpoint does not support is rejected rather than ignored.Send &#x60;Accept: text/csv&#x60; to receive the same page as a CSV download instead of JSON: same filters, same authorization, same page window and the same maximum of 100 rows — it is this page in another format, not a bulk export, so a whole collection is still read by paging. The CSV carries no &#x60;total&#x60;, because a table whose every row is a record has nowhere to put one; read it from the JSON representation of the same request. A list-valued field is joined into one cell with &#x60;; &#x60; as a display projection — parse the JSON if you need the structure. Cells beginning with &#x60;&#x3D;&#x60;, &#x60;+&#x60;, &#x60;-&#x60; or &#x60;@&#x60; are prefixed with an apostrophe so a spreadsheet treats them as text rather than running them as formulas.
1688
+ # @param organization_id [String]
1689
+ # @param project_id [String]
1690
+ # @param [Hash] opts the optional parameters
1691
+ # @option opts [Integer] :limit Page size. A value above the maximum is rejected, never clamped. (default to 20)
1692
+ # @option opts [Integer] :offset (default to 0)
1693
+ # @option opts [String] :search Free-text search over the keyword.
1694
+ # @option opts [String] :status
1695
+ # @option opts [Array<String>] :engines Repeatable, or comma-separated.
1696
+ # @option opts [Array<String>] :countries ISO-3166 alpha-2 codes or English names. Must be configured on the project.
1697
+ # @option opts [String] :sort_by (default to 'queryText')
1698
+ # @option opts [String] :sort_order (default to 'desc')
1699
+ # @return [Array<(SearchTrackedQueries200Response, Integer, Hash)>] SearchTrackedQueries200Response data, response status code and response headers
1700
+ def search_tracked_queries_with_http_info(organization_id, project_id, opts = {})
1701
+ if @api_client.config.debugging
1702
+ @api_client.config.logger.debug 'Calling API: TrackedQueriesApi.search_tracked_queries ...'
1703
+ end
1704
+ # verify the required parameter 'organization_id' is set
1705
+ if @api_client.config.client_side_validation && organization_id.nil?
1706
+ fail ArgumentError, "Missing the required parameter 'organization_id' when calling TrackedQueriesApi.search_tracked_queries"
1707
+ end
1708
+ # verify the required parameter 'project_id' is set
1709
+ if @api_client.config.client_side_validation && project_id.nil?
1710
+ fail ArgumentError, "Missing the required parameter 'project_id' when calling TrackedQueriesApi.search_tracked_queries"
1711
+ end
1712
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
1713
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling TrackedQueriesApi.search_tracked_queries, must be smaller than or equal to 100.'
1714
+ end
1715
+
1716
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
1717
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling TrackedQueriesApi.search_tracked_queries, must be greater than or equal to 1.'
1718
+ end
1719
+
1720
+ if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0
1721
+ fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling TrackedQueriesApi.search_tracked_queries, must be greater than or equal to 0.'
1722
+ end
1723
+
1724
+ if @api_client.config.client_side_validation && !opts[:'search'].nil? && opts[:'search'].to_s.length > 100
1725
+ fail ArgumentError, 'invalid value for "opts[:"search"]" when calling TrackedQueriesApi.search_tracked_queries, the character length must be smaller than or equal to 100.'
1726
+ end
1727
+
1728
+ allowable_values = ["active", "paused"]
1729
+ if @api_client.config.client_side_validation && opts[:'status'] && !allowable_values.include?(opts[:'status'])
1730
+ fail ArgumentError, "invalid value for \"status\", must be one of #{allowable_values}"
1731
+ end
1732
+ allowable_values = ["chatgpt", "perplexity", "google_ai_overview", "google_ai_mode", "google_serp", "google_shopping"]
1733
+ if @api_client.config.client_side_validation && opts[:'engines'] && !opts[:'engines'].all? { |item| allowable_values.include?(item) }
1734
+ fail ArgumentError, "invalid value for \"engines\", must include one of #{allowable_values}"
1735
+ end
1736
+ allowable_values = ["queryText", "lastSerpPosition", "lastMentionPosition", "lastShoppingPosition", "lastShareOfVoice", "lastPositivityIndex", "lastMentionCount", "lastCheckedAt"]
1737
+ if @api_client.config.client_side_validation && opts[:'sort_by'] && !allowable_values.include?(opts[:'sort_by'])
1738
+ fail ArgumentError, "invalid value for \"sort_by\", must be one of #{allowable_values}"
1739
+ end
1740
+ allowable_values = ["asc", "desc"]
1741
+ if @api_client.config.client_side_validation && opts[:'sort_order'] && !allowable_values.include?(opts[:'sort_order'])
1742
+ fail ArgumentError, "invalid value for \"sort_order\", must be one of #{allowable_values}"
1743
+ end
1744
+ # resource path
1745
+ local_var_path = '/api/v1/organizations/{organizationId}/projects/{projectId}/tracked-queries'.sub('{organizationId}', CGI.escape(organization_id.to_s)).sub('{projectId}', CGI.escape(project_id.to_s))
1746
+
1747
+ # query parameters
1748
+ query_params = opts[:query_params] || {}
1749
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
1750
+ query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
1751
+ query_params[:'search'] = opts[:'search'] if !opts[:'search'].nil?
1752
+ query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
1753
+ query_params[:'engines'] = @api_client.build_collection_param(opts[:'engines'], :multi) if !opts[:'engines'].nil?
1754
+ query_params[:'countries'] = @api_client.build_collection_param(opts[:'countries'], :multi) if !opts[:'countries'].nil?
1755
+ query_params[:'sortBy'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?
1756
+ query_params[:'sortOrder'] = opts[:'sort_order'] if !opts[:'sort_order'].nil?
1757
+
1758
+ # header parameters
1759
+ header_params = opts[:header_params] || {}
1760
+ # HTTP header 'Accept' (if needed)
1761
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/csv']) unless header_params['Accept']
1762
+
1763
+ # form parameters
1764
+ form_params = opts[:form_params] || {}
1765
+
1766
+ # http body (model)
1767
+ post_body = opts[:debug_body]
1768
+
1769
+ # return_type
1770
+ return_type = opts[:debug_return_type] || 'SearchTrackedQueries200Response'
1771
+
1772
+ # auth_names
1773
+ auth_names = opts[:debug_auth_names] || ['ApiKey']
1774
+
1775
+ new_options = opts.merge(
1776
+ :operation => :"TrackedQueriesApi.search_tracked_queries",
1777
+ :header_params => header_params,
1778
+ :query_params => query_params,
1779
+ :form_params => form_params,
1780
+ :body => post_body,
1781
+ :auth_names => auth_names,
1782
+ :return_type => return_type
1783
+ )
1784
+
1785
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1786
+ if @api_client.config.debugging
1787
+ @api_client.config.logger.debug "API called: TrackedQueriesApi#search_tracked_queries\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1788
+ end
1789
+ return data, status_code, headers
1790
+ end
1791
+ end
1792
+ end