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,1158 @@
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 ProjectsApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Archive a project
23
+ # Minimum role: manager, in an active organization. Requires the \"write\" capability. Archiving stops a project from being modified: its name, brand profile and competitors are refused with 409 until it is restored. What is NOT done: nothing is deleted. Tracked queries, captured responses, mentions and every metric already collected stay exactly as they are, and restoreProject brings the project back with all of it. Archiving is recorded as done by the caller, not by an organization cascade, so restoring the organization later will not restore this project — restore it explicitly. This endpoint takes no body, and one carrying fields is refused. Archiving an already archived project answers 409, unless the call is a retry carrying the key that archived it. Send an Idempotency-Key; a retry with the same key returns the recorded answer.
24
+ # @param organization_id [String]
25
+ # @param project_id [String]
26
+ # @param idempotency_key [String]
27
+ # @param [Hash] opts the optional parameters
28
+ # @return [ProjectDetailResource]
29
+ def archive_project(organization_id, project_id, idempotency_key, opts = {})
30
+ data, _status_code, _headers = archive_project_with_http_info(organization_id, project_id, idempotency_key, opts)
31
+ data
32
+ end
33
+
34
+ # Archive a project
35
+ # Minimum role: manager, in an active organization. Requires the \"write\" capability. Archiving stops a project from being modified: its name, brand profile and competitors are refused with 409 until it is restored. What is NOT done: nothing is deleted. Tracked queries, captured responses, mentions and every metric already collected stay exactly as they are, and restoreProject brings the project back with all of it. Archiving is recorded as done by the caller, not by an organization cascade, so restoring the organization later will not restore this project — restore it explicitly. This endpoint takes no body, and one carrying fields is refused. Archiving an already archived project answers 409, unless the call is a retry carrying the key that archived it. Send an Idempotency-Key; a retry with the same key returns the recorded answer.
36
+ # @param organization_id [String]
37
+ # @param project_id [String]
38
+ # @param idempotency_key [String]
39
+ # @param [Hash] opts the optional parameters
40
+ # @return [Array<(ProjectDetailResource, Integer, Hash)>] ProjectDetailResource data, response status code and response headers
41
+ def archive_project_with_http_info(organization_id, project_id, idempotency_key, opts = {})
42
+ if @api_client.config.debugging
43
+ @api_client.config.logger.debug 'Calling API: ProjectsApi.archive_project ...'
44
+ end
45
+ # verify the required parameter 'organization_id' is set
46
+ if @api_client.config.client_side_validation && organization_id.nil?
47
+ fail ArgumentError, "Missing the required parameter 'organization_id' when calling ProjectsApi.archive_project"
48
+ end
49
+ # verify the required parameter 'project_id' is set
50
+ if @api_client.config.client_side_validation && project_id.nil?
51
+ fail ArgumentError, "Missing the required parameter 'project_id' when calling ProjectsApi.archive_project"
52
+ end
53
+ # verify the required parameter 'idempotency_key' is set
54
+ if @api_client.config.client_side_validation && idempotency_key.nil?
55
+ fail ArgumentError, "Missing the required parameter 'idempotency_key' when calling ProjectsApi.archive_project"
56
+ end
57
+ if @api_client.config.client_side_validation && idempotency_key.to_s.length > 255
58
+ fail ArgumentError, 'invalid value for "idempotency_key" when calling ProjectsApi.archive_project, the character length must be smaller than or equal to 255.'
59
+ end
60
+
61
+ if @api_client.config.client_side_validation && idempotency_key.to_s.length < 8
62
+ fail ArgumentError, 'invalid value for "idempotency_key" when calling ProjectsApi.archive_project, the character length must be greater than or equal to 8.'
63
+ end
64
+
65
+ # resource path
66
+ local_var_path = '/api/v1/organizations/{organizationId}/projects/{projectId}/archive'.sub('{organizationId}', CGI.escape(organization_id.to_s)).sub('{projectId}', CGI.escape(project_id.to_s))
67
+
68
+ # query parameters
69
+ query_params = opts[:query_params] || {}
70
+
71
+ # header parameters
72
+ header_params = opts[:header_params] || {}
73
+ # HTTP header 'Accept' (if needed)
74
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
75
+ header_params[:'Idempotency-Key'] = idempotency_key
76
+
77
+ # form parameters
78
+ form_params = opts[:form_params] || {}
79
+
80
+ # http body (model)
81
+ post_body = opts[:debug_body]
82
+
83
+ # return_type
84
+ return_type = opts[:debug_return_type] || 'ProjectDetailResource'
85
+
86
+ # auth_names
87
+ auth_names = opts[:debug_auth_names] || ['ApiKey']
88
+
89
+ new_options = opts.merge(
90
+ :operation => :"ProjectsApi.archive_project",
91
+ :header_params => header_params,
92
+ :query_params => query_params,
93
+ :form_params => form_params,
94
+ :body => post_body,
95
+ :auth_names => auth_names,
96
+ :return_type => return_type
97
+ )
98
+
99
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
100
+ if @api_client.config.debugging
101
+ @api_client.config.logger.debug "API called: ProjectsApi#archive_project\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
102
+ end
103
+ return data, status_code, headers
104
+ end
105
+
106
+ # Add a competitor to a project
107
+ # Minimum role: manager, on an active organization and a project that is not archived. Creates one competitor with the domains and brand names its mentions are matched against. Both lists are required and neither may be empty: a competitor that matches on nothing would never be found in an answer. A domain may be sent as a full URL or as a bare host; a URL is reduced to its host and a leading \"www.\" is dropped. Duplicates are collapsed. The id is assigned by the server and cannot be chosen, and neither the auto-generated brand description nor the internal brand monitoring profile id can be set — sending either is refused as an unknown field. Adding a competitor does NOT re-match the answers already captured: it applies to checks from here on. A project whose brand monitoring profile has not been created yet answers 404. An Idempotency-Key header is required.
108
+ # @param organization_id [String]
109
+ # @param project_id [String] Must belong to the organization in the path.
110
+ # @param idempotency_key [String] Unique per attempt. Without it a lost response cannot be retried without risking a second competitor.
111
+ # @param create_competitor_request [CreateCompetitorRequest]
112
+ # @param [Hash] opts the optional parameters
113
+ # @return [CompetitorResource]
114
+ def create_competitor(organization_id, project_id, idempotency_key, create_competitor_request, opts = {})
115
+ data, _status_code, _headers = create_competitor_with_http_info(organization_id, project_id, idempotency_key, create_competitor_request, opts)
116
+ data
117
+ end
118
+
119
+ # Add a competitor to a project
120
+ # Minimum role: manager, on an active organization and a project that is not archived. Creates one competitor with the domains and brand names its mentions are matched against. Both lists are required and neither may be empty: a competitor that matches on nothing would never be found in an answer. A domain may be sent as a full URL or as a bare host; a URL is reduced to its host and a leading \&quot;www.\&quot; is dropped. Duplicates are collapsed. The id is assigned by the server and cannot be chosen, and neither the auto-generated brand description nor the internal brand monitoring profile id can be set — sending either is refused as an unknown field. Adding a competitor does NOT re-match the answers already captured: it applies to checks from here on. A project whose brand monitoring profile has not been created yet answers 404. An Idempotency-Key header is required.
121
+ # @param organization_id [String]
122
+ # @param project_id [String] Must belong to the organization in the path.
123
+ # @param idempotency_key [String] Unique per attempt. Without it a lost response cannot be retried without risking a second competitor.
124
+ # @param create_competitor_request [CreateCompetitorRequest]
125
+ # @param [Hash] opts the optional parameters
126
+ # @return [Array<(CompetitorResource, Integer, Hash)>] CompetitorResource data, response status code and response headers
127
+ def create_competitor_with_http_info(organization_id, project_id, idempotency_key, create_competitor_request, opts = {})
128
+ if @api_client.config.debugging
129
+ @api_client.config.logger.debug 'Calling API: ProjectsApi.create_competitor ...'
130
+ end
131
+ # verify the required parameter 'organization_id' is set
132
+ if @api_client.config.client_side_validation && organization_id.nil?
133
+ fail ArgumentError, "Missing the required parameter 'organization_id' when calling ProjectsApi.create_competitor"
134
+ end
135
+ # verify the required parameter 'project_id' is set
136
+ if @api_client.config.client_side_validation && project_id.nil?
137
+ fail ArgumentError, "Missing the required parameter 'project_id' when calling ProjectsApi.create_competitor"
138
+ end
139
+ # verify the required parameter 'idempotency_key' is set
140
+ if @api_client.config.client_side_validation && idempotency_key.nil?
141
+ fail ArgumentError, "Missing the required parameter 'idempotency_key' when calling ProjectsApi.create_competitor"
142
+ end
143
+ # verify the required parameter 'create_competitor_request' is set
144
+ if @api_client.config.client_side_validation && create_competitor_request.nil?
145
+ fail ArgumentError, "Missing the required parameter 'create_competitor_request' when calling ProjectsApi.create_competitor"
146
+ end
147
+ # resource path
148
+ local_var_path = '/api/v1/organizations/{organizationId}/projects/{projectId}/competitors'.sub('{organizationId}', CGI.escape(organization_id.to_s)).sub('{projectId}', CGI.escape(project_id.to_s))
149
+
150
+ # query parameters
151
+ query_params = opts[:query_params] || {}
152
+
153
+ # header parameters
154
+ header_params = opts[:header_params] || {}
155
+ # HTTP header 'Accept' (if needed)
156
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
157
+ # HTTP header 'Content-Type'
158
+ content_type = @api_client.select_header_content_type(['application/json'])
159
+ if !content_type.nil?
160
+ header_params['Content-Type'] = content_type
161
+ end
162
+ header_params[:'Idempotency-Key'] = idempotency_key
163
+
164
+ # form parameters
165
+ form_params = opts[:form_params] || {}
166
+
167
+ # http body (model)
168
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(create_competitor_request)
169
+
170
+ # return_type
171
+ return_type = opts[:debug_return_type] || 'CompetitorResource'
172
+
173
+ # auth_names
174
+ auth_names = opts[:debug_auth_names] || ['ApiKey']
175
+
176
+ new_options = opts.merge(
177
+ :operation => :"ProjectsApi.create_competitor",
178
+ :header_params => header_params,
179
+ :query_params => query_params,
180
+ :form_params => form_params,
181
+ :body => post_body,
182
+ :auth_names => auth_names,
183
+ :return_type => return_type
184
+ )
185
+
186
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
187
+ if @api_client.config.debugging
188
+ @api_client.config.logger.debug "API called: ProjectsApi#create_competitor\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
189
+ end
190
+ return data, status_code, headers
191
+ end
192
+
193
+ # Create a project and the brand monitoring profile its checks run against
194
+ # Minimum role: manager, in an active organization. Requires the \"write\" capability. Creates the project, the brand monitoring profile holding the domains and brand names to watch, and one competitor per entry of `competitors`, in a single call. The project id is minted by the server; a caller-supplied id is rejected as an unknown field. What is NOT done: no tracked queries are created, no check is run and no scraping is scheduled — a new project has nothing collected against it until tracked queries are added. Each website entry may be a full URL or a bare domain: a URL is reduced to its host with any leading \"www.\" removed, so \"https://www.acme.com/pricing\" is stored as \"acme.com\". Duplicate domains and duplicate brand names are collapsed, exactly as the stored value objects do. Send an Idempotency-Key: a retry with the same key and the same body returns this same project instead of creating a second one.
195
+ # @param organization_id [String]
196
+ # @param idempotency_key [String]
197
+ # @param create_project_request [CreateProjectRequest]
198
+ # @param [Hash] opts the optional parameters
199
+ # @return [ProjectDetailResource]
200
+ def create_project(organization_id, idempotency_key, create_project_request, opts = {})
201
+ data, _status_code, _headers = create_project_with_http_info(organization_id, idempotency_key, create_project_request, opts)
202
+ data
203
+ end
204
+
205
+ # Create a project and the brand monitoring profile its checks run against
206
+ # Minimum role: manager, in an active organization. Requires the \&quot;write\&quot; capability. Creates the project, the brand monitoring profile holding the domains and brand names to watch, and one competitor per entry of &#x60;competitors&#x60;, in a single call. The project id is minted by the server; a caller-supplied id is rejected as an unknown field. What is NOT done: no tracked queries are created, no check is run and no scraping is scheduled — a new project has nothing collected against it until tracked queries are added. Each website entry may be a full URL or a bare domain: a URL is reduced to its host with any leading \&quot;www.\&quot; removed, so \&quot;https://www.acme.com/pricing\&quot; is stored as \&quot;acme.com\&quot;. Duplicate domains and duplicate brand names are collapsed, exactly as the stored value objects do. Send an Idempotency-Key: a retry with the same key and the same body returns this same project instead of creating a second one.
207
+ # @param organization_id [String]
208
+ # @param idempotency_key [String]
209
+ # @param create_project_request [CreateProjectRequest]
210
+ # @param [Hash] opts the optional parameters
211
+ # @return [Array<(ProjectDetailResource, Integer, Hash)>] ProjectDetailResource data, response status code and response headers
212
+ def create_project_with_http_info(organization_id, idempotency_key, create_project_request, opts = {})
213
+ if @api_client.config.debugging
214
+ @api_client.config.logger.debug 'Calling API: ProjectsApi.create_project ...'
215
+ end
216
+ # verify the required parameter 'organization_id' is set
217
+ if @api_client.config.client_side_validation && organization_id.nil?
218
+ fail ArgumentError, "Missing the required parameter 'organization_id' when calling ProjectsApi.create_project"
219
+ end
220
+ # verify the required parameter 'idempotency_key' is set
221
+ if @api_client.config.client_side_validation && idempotency_key.nil?
222
+ fail ArgumentError, "Missing the required parameter 'idempotency_key' when calling ProjectsApi.create_project"
223
+ end
224
+ if @api_client.config.client_side_validation && idempotency_key.to_s.length > 255
225
+ fail ArgumentError, 'invalid value for "idempotency_key" when calling ProjectsApi.create_project, the character length must be smaller than or equal to 255.'
226
+ end
227
+
228
+ if @api_client.config.client_side_validation && idempotency_key.to_s.length < 8
229
+ fail ArgumentError, 'invalid value for "idempotency_key" when calling ProjectsApi.create_project, the character length must be greater than or equal to 8.'
230
+ end
231
+
232
+ # verify the required parameter 'create_project_request' is set
233
+ if @api_client.config.client_side_validation && create_project_request.nil?
234
+ fail ArgumentError, "Missing the required parameter 'create_project_request' when calling ProjectsApi.create_project"
235
+ end
236
+ # resource path
237
+ local_var_path = '/api/v1/organizations/{organizationId}/projects'.sub('{organizationId}', CGI.escape(organization_id.to_s))
238
+
239
+ # query parameters
240
+ query_params = opts[:query_params] || {}
241
+
242
+ # header parameters
243
+ header_params = opts[:header_params] || {}
244
+ # HTTP header 'Accept' (if needed)
245
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
246
+ # HTTP header 'Content-Type'
247
+ content_type = @api_client.select_header_content_type(['application/json'])
248
+ if !content_type.nil?
249
+ header_params['Content-Type'] = content_type
250
+ end
251
+ header_params[:'Idempotency-Key'] = idempotency_key
252
+
253
+ # form parameters
254
+ form_params = opts[:form_params] || {}
255
+
256
+ # http body (model)
257
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(create_project_request)
258
+
259
+ # return_type
260
+ return_type = opts[:debug_return_type] || 'ProjectDetailResource'
261
+
262
+ # auth_names
263
+ auth_names = opts[:debug_auth_names] || ['ApiKey']
264
+
265
+ new_options = opts.merge(
266
+ :operation => :"ProjectsApi.create_project",
267
+ :header_params => header_params,
268
+ :query_params => query_params,
269
+ :form_params => form_params,
270
+ :body => post_body,
271
+ :auth_names => auth_names,
272
+ :return_type => return_type
273
+ )
274
+
275
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
276
+ if @api_client.config.debugging
277
+ @api_client.config.logger.debug "API called: ProjectsApi#create_project\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
278
+ end
279
+ return data, status_code, headers
280
+ end
281
+
282
+ # Remove a competitor from a project
283
+ # Minimum role: manager, on an active organization and a project that is not archived. Removes the competitor and, asynchronously, every stored mention, search result and shopping result attributed to it, in AI answers and search captures already taken. This is permanent and it changes historical analytics: share of voice and competitor co-occurrence recomputed after the cascade will not include it. A 200 means the competitor is gone; the cascade runs on the event bus and finishes shortly afterwards. The response body is the competitor as it was immediately before removal, because it can no longer be read back. The request takes no body, and sending one is refused. A competitor belonging to another project answers 404, the same answer an unknown id gets. An Idempotency-Key header is required.
284
+ # @param organization_id [String]
285
+ # @param project_id [String] Must belong to the organization in the path.
286
+ # @param competitor_id [String] Must belong to the project in the path.
287
+ # @param idempotency_key [String] Unique per attempt. A retry carrying the same key is answered from the record instead of running again.
288
+ # @param [Hash] opts the optional parameters
289
+ # @return [CompetitorResource]
290
+ def delete_competitor(organization_id, project_id, competitor_id, idempotency_key, opts = {})
291
+ data, _status_code, _headers = delete_competitor_with_http_info(organization_id, project_id, competitor_id, idempotency_key, opts)
292
+ data
293
+ end
294
+
295
+ # Remove a competitor from a project
296
+ # Minimum role: manager, on an active organization and a project that is not archived. Removes the competitor and, asynchronously, every stored mention, search result and shopping result attributed to it, in AI answers and search captures already taken. This is permanent and it changes historical analytics: share of voice and competitor co-occurrence recomputed after the cascade will not include it. A 200 means the competitor is gone; the cascade runs on the event bus and finishes shortly afterwards. The response body is the competitor as it was immediately before removal, because it can no longer be read back. The request takes no body, and sending one is refused. A competitor belonging to another project answers 404, the same answer an unknown id gets. An Idempotency-Key header is required.
297
+ # @param organization_id [String]
298
+ # @param project_id [String] Must belong to the organization in the path.
299
+ # @param competitor_id [String] Must belong to the project in the path.
300
+ # @param idempotency_key [String] Unique per attempt. A retry carrying the same key is answered from the record instead of running again.
301
+ # @param [Hash] opts the optional parameters
302
+ # @return [Array<(CompetitorResource, Integer, Hash)>] CompetitorResource data, response status code and response headers
303
+ def delete_competitor_with_http_info(organization_id, project_id, competitor_id, idempotency_key, opts = {})
304
+ if @api_client.config.debugging
305
+ @api_client.config.logger.debug 'Calling API: ProjectsApi.delete_competitor ...'
306
+ end
307
+ # verify the required parameter 'organization_id' is set
308
+ if @api_client.config.client_side_validation && organization_id.nil?
309
+ fail ArgumentError, "Missing the required parameter 'organization_id' when calling ProjectsApi.delete_competitor"
310
+ end
311
+ # verify the required parameter 'project_id' is set
312
+ if @api_client.config.client_side_validation && project_id.nil?
313
+ fail ArgumentError, "Missing the required parameter 'project_id' when calling ProjectsApi.delete_competitor"
314
+ end
315
+ # verify the required parameter 'competitor_id' is set
316
+ if @api_client.config.client_side_validation && competitor_id.nil?
317
+ fail ArgumentError, "Missing the required parameter 'competitor_id' when calling ProjectsApi.delete_competitor"
318
+ end
319
+ # verify the required parameter 'idempotency_key' is set
320
+ if @api_client.config.client_side_validation && idempotency_key.nil?
321
+ fail ArgumentError, "Missing the required parameter 'idempotency_key' when calling ProjectsApi.delete_competitor"
322
+ end
323
+ # resource path
324
+ local_var_path = '/api/v1/organizations/{organizationId}/projects/{projectId}/competitors/{competitorId}'.sub('{organizationId}', CGI.escape(organization_id.to_s)).sub('{projectId}', CGI.escape(project_id.to_s)).sub('{competitorId}', CGI.escape(competitor_id.to_s))
325
+
326
+ # query parameters
327
+ query_params = opts[:query_params] || {}
328
+
329
+ # header parameters
330
+ header_params = opts[:header_params] || {}
331
+ # HTTP header 'Accept' (if needed)
332
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
333
+ header_params[:'Idempotency-Key'] = idempotency_key
334
+
335
+ # form parameters
336
+ form_params = opts[:form_params] || {}
337
+
338
+ # http body (model)
339
+ post_body = opts[:debug_body]
340
+
341
+ # return_type
342
+ return_type = opts[:debug_return_type] || 'CompetitorResource'
343
+
344
+ # auth_names
345
+ auth_names = opts[:debug_auth_names] || ['ApiKey']
346
+
347
+ new_options = opts.merge(
348
+ :operation => :"ProjectsApi.delete_competitor",
349
+ :header_params => header_params,
350
+ :query_params => query_params,
351
+ :form_params => form_params,
352
+ :body => post_body,
353
+ :auth_names => auth_names,
354
+ :return_type => return_type
355
+ )
356
+
357
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
358
+ if @api_client.config.debugging
359
+ @api_client.config.logger.debug "API called: ProjectsApi#delete_competitor\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
360
+ end
361
+ return data, status_code, headers
362
+ end
363
+
364
+ # Get a project's brand monitoring profile
365
+ # Minimum role: viewer. The brand identity every check of this project is matched against: the tracked brand terms, the website domains, and the generated description of what the brand does. A null description means it has not been generated yet — the generator runs asynchronously after the names or domains change — which is not the same as an empty one. An empty brandNames or websiteDomains array means the profile exists and names nothing; a project whose profile has not been created at all answers 404.
366
+ # @param organization_id [String]
367
+ # @param project_id [String] Must belong to the organization in the path.
368
+ # @param [Hash] opts the optional parameters
369
+ # @return [BrandProfileResource]
370
+ def get_brand_profile(organization_id, project_id, opts = {})
371
+ data, _status_code, _headers = get_brand_profile_with_http_info(organization_id, project_id, opts)
372
+ data
373
+ end
374
+
375
+ # Get a project&#39;s brand monitoring profile
376
+ # Minimum role: viewer. The brand identity every check of this project is matched against: the tracked brand terms, the website domains, and the generated description of what the brand does. A null description means it has not been generated yet — the generator runs asynchronously after the names or domains change — which is not the same as an empty one. An empty brandNames or websiteDomains array means the profile exists and names nothing; a project whose profile has not been created at all answers 404.
377
+ # @param organization_id [String]
378
+ # @param project_id [String] Must belong to the organization in the path.
379
+ # @param [Hash] opts the optional parameters
380
+ # @return [Array<(BrandProfileResource, Integer, Hash)>] BrandProfileResource data, response status code and response headers
381
+ def get_brand_profile_with_http_info(organization_id, project_id, opts = {})
382
+ if @api_client.config.debugging
383
+ @api_client.config.logger.debug 'Calling API: ProjectsApi.get_brand_profile ...'
384
+ end
385
+ # verify the required parameter 'organization_id' is set
386
+ if @api_client.config.client_side_validation && organization_id.nil?
387
+ fail ArgumentError, "Missing the required parameter 'organization_id' when calling ProjectsApi.get_brand_profile"
388
+ end
389
+ # verify the required parameter 'project_id' is set
390
+ if @api_client.config.client_side_validation && project_id.nil?
391
+ fail ArgumentError, "Missing the required parameter 'project_id' when calling ProjectsApi.get_brand_profile"
392
+ end
393
+ # resource path
394
+ local_var_path = '/api/v1/organizations/{organizationId}/projects/{projectId}/brand-profile'.sub('{organizationId}', CGI.escape(organization_id.to_s)).sub('{projectId}', CGI.escape(project_id.to_s))
395
+
396
+ # query parameters
397
+ query_params = opts[:query_params] || {}
398
+
399
+ # header parameters
400
+ header_params = opts[:header_params] || {}
401
+ # HTTP header 'Accept' (if needed)
402
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
403
+
404
+ # form parameters
405
+ form_params = opts[:form_params] || {}
406
+
407
+ # http body (model)
408
+ post_body = opts[:debug_body]
409
+
410
+ # return_type
411
+ return_type = opts[:debug_return_type] || 'BrandProfileResource'
412
+
413
+ # auth_names
414
+ auth_names = opts[:debug_auth_names] || ['ApiKey']
415
+
416
+ new_options = opts.merge(
417
+ :operation => :"ProjectsApi.get_brand_profile",
418
+ :header_params => header_params,
419
+ :query_params => query_params,
420
+ :form_params => form_params,
421
+ :body => post_body,
422
+ :auth_names => auth_names,
423
+ :return_type => return_type
424
+ )
425
+
426
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
427
+ if @api_client.config.debugging
428
+ @api_client.config.logger.debug "API called: ProjectsApi#get_brand_profile\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
429
+ end
430
+ return data, status_code, headers
431
+ end
432
+
433
+ # Get a project and its brand monitoring configuration
434
+ # Minimum role: viewer. Returns the project together with the domains and brand names it is monitored for and the competitors it is measured against. A project that exists but belongs to another organization answers 404, never 403. A project that has been created but not yet configured for brand monitoring reports empty `websiteDomains`, `brandNames` and `competitors`. Headline metrics are not part of this response: use `listProjects` for the per-project figures, or `getProjectMetrics` for a window.
435
+ # @param organization_id [String]
436
+ # @param project_id [String]
437
+ # @param [Hash] opts the optional parameters
438
+ # @return [ProjectDetailResource]
439
+ def get_project(organization_id, project_id, opts = {})
440
+ data, _status_code, _headers = get_project_with_http_info(organization_id, project_id, opts)
441
+ data
442
+ end
443
+
444
+ # Get a project and its brand monitoring configuration
445
+ # Minimum role: viewer. Returns the project together with the domains and brand names it is monitored for and the competitors it is measured against. A project that exists but belongs to another organization answers 404, never 403. A project that has been created but not yet configured for brand monitoring reports empty &#x60;websiteDomains&#x60;, &#x60;brandNames&#x60; and &#x60;competitors&#x60;. Headline metrics are not part of this response: use &#x60;listProjects&#x60; for the per-project figures, or &#x60;getProjectMetrics&#x60; for a window.
446
+ # @param organization_id [String]
447
+ # @param project_id [String]
448
+ # @param [Hash] opts the optional parameters
449
+ # @return [Array<(ProjectDetailResource, Integer, Hash)>] ProjectDetailResource data, response status code and response headers
450
+ def get_project_with_http_info(organization_id, project_id, opts = {})
451
+ if @api_client.config.debugging
452
+ @api_client.config.logger.debug 'Calling API: ProjectsApi.get_project ...'
453
+ end
454
+ # verify the required parameter 'organization_id' is set
455
+ if @api_client.config.client_side_validation && organization_id.nil?
456
+ fail ArgumentError, "Missing the required parameter 'organization_id' when calling ProjectsApi.get_project"
457
+ end
458
+ # verify the required parameter 'project_id' is set
459
+ if @api_client.config.client_side_validation && project_id.nil?
460
+ fail ArgumentError, "Missing the required parameter 'project_id' when calling ProjectsApi.get_project"
461
+ end
462
+ # resource path
463
+ local_var_path = '/api/v1/organizations/{organizationId}/projects/{projectId}'.sub('{organizationId}', CGI.escape(organization_id.to_s)).sub('{projectId}', CGI.escape(project_id.to_s))
464
+
465
+ # query parameters
466
+ query_params = opts[:query_params] || {}
467
+
468
+ # header parameters
469
+ header_params = opts[:header_params] || {}
470
+ # HTTP header 'Accept' (if needed)
471
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
472
+
473
+ # form parameters
474
+ form_params = opts[:form_params] || {}
475
+
476
+ # http body (model)
477
+ post_body = opts[:debug_body]
478
+
479
+ # return_type
480
+ return_type = opts[:debug_return_type] || 'ProjectDetailResource'
481
+
482
+ # auth_names
483
+ auth_names = opts[:debug_auth_names] || ['ApiKey']
484
+
485
+ new_options = opts.merge(
486
+ :operation => :"ProjectsApi.get_project",
487
+ :header_params => header_params,
488
+ :query_params => query_params,
489
+ :form_params => form_params,
490
+ :body => post_body,
491
+ :auth_names => auth_names,
492
+ :return_type => return_type
493
+ )
494
+
495
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
496
+ if @api_client.config.debugging
497
+ @api_client.config.logger.debug "API called: ProjectsApi#get_project\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
498
+ end
499
+ return data, status_code, headers
500
+ end
501
+
502
+ # List the competitors tracked by a project
503
+ # Minimum role: viewer. The competitors configured on the project, one page at a time, with the website domains and brand names each one is matched against. `total` counts every competitor of the project, not the size of this page, so a project with more than `limit` competitors needs `offset` to read them all. Ordering is by id, which for a UUID v7 is roughly creation order, and `sortOrder` chooses its direction; there is no other sort key and no text search, and sending `sortBy` or `search` is rejected rather than ignored. A project whose brand monitoring profile has not been created yet answers 200 with an empty collection, which means \"nothing configured yet\" rather than \"no competitors found\". Internal fields the pipeline writes — the auto-generated brand description used by the mention classifier, and the internal brand monitoring profile id — are not part of this contract.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.
504
+ # @param organization_id [String]
505
+ # @param project_id [String]
506
+ # @param [Hash] opts the optional parameters
507
+ # @option opts [Integer] :limit Page size. A larger value is rejected, never silently reduced. (default to 20)
508
+ # @option opts [Integer] :offset Number of competitors to skip before the page starts. (default to 0)
509
+ # @option opts [String] :sort_order Direction of the id ordering. An unknown value is rejected, not replaced by the default. (default to 'asc')
510
+ # @return [ListCompetitors200Response]
511
+ def list_competitors(organization_id, project_id, opts = {})
512
+ data, _status_code, _headers = list_competitors_with_http_info(organization_id, project_id, opts)
513
+ data
514
+ end
515
+
516
+ # List the competitors tracked by a project
517
+ # Minimum role: viewer. The competitors configured on the project, one page at a time, with the website domains and brand names each one is matched against. &#x60;total&#x60; counts every competitor of the project, not the size of this page, so a project with more than &#x60;limit&#x60; competitors needs &#x60;offset&#x60; to read them all. Ordering is by id, which for a UUID v7 is roughly creation order, and &#x60;sortOrder&#x60; chooses its direction; there is no other sort key and no text search, and sending &#x60;sortBy&#x60; or &#x60;search&#x60; is rejected rather than ignored. A project whose brand monitoring profile has not been created yet answers 200 with an empty collection, which means \&quot;nothing configured yet\&quot; rather than \&quot;no competitors found\&quot;. Internal fields the pipeline writes — the auto-generated brand description used by the mention classifier, and the internal brand monitoring profile id — are not part of this contract.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.
518
+ # @param organization_id [String]
519
+ # @param project_id [String]
520
+ # @param [Hash] opts the optional parameters
521
+ # @option opts [Integer] :limit Page size. A larger value is rejected, never silently reduced. (default to 20)
522
+ # @option opts [Integer] :offset Number of competitors to skip before the page starts. (default to 0)
523
+ # @option opts [String] :sort_order Direction of the id ordering. An unknown value is rejected, not replaced by the default. (default to 'asc')
524
+ # @return [Array<(ListCompetitors200Response, Integer, Hash)>] ListCompetitors200Response data, response status code and response headers
525
+ def list_competitors_with_http_info(organization_id, project_id, opts = {})
526
+ if @api_client.config.debugging
527
+ @api_client.config.logger.debug 'Calling API: ProjectsApi.list_competitors ...'
528
+ end
529
+ # verify the required parameter 'organization_id' is set
530
+ if @api_client.config.client_side_validation && organization_id.nil?
531
+ fail ArgumentError, "Missing the required parameter 'organization_id' when calling ProjectsApi.list_competitors"
532
+ end
533
+ # verify the required parameter 'project_id' is set
534
+ if @api_client.config.client_side_validation && project_id.nil?
535
+ fail ArgumentError, "Missing the required parameter 'project_id' when calling ProjectsApi.list_competitors"
536
+ end
537
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
538
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ProjectsApi.list_competitors, must be smaller than or equal to 100.'
539
+ end
540
+
541
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
542
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ProjectsApi.list_competitors, must be greater than or equal to 1.'
543
+ end
544
+
545
+ if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0
546
+ fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling ProjectsApi.list_competitors, must be greater than or equal to 0.'
547
+ end
548
+
549
+ allowable_values = ["asc", "desc"]
550
+ if @api_client.config.client_side_validation && opts[:'sort_order'] && !allowable_values.include?(opts[:'sort_order'])
551
+ fail ArgumentError, "invalid value for \"sort_order\", must be one of #{allowable_values}"
552
+ end
553
+ # resource path
554
+ local_var_path = '/api/v1/organizations/{organizationId}/projects/{projectId}/competitors'.sub('{organizationId}', CGI.escape(organization_id.to_s)).sub('{projectId}', CGI.escape(project_id.to_s))
555
+
556
+ # query parameters
557
+ query_params = opts[:query_params] || {}
558
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
559
+ query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
560
+ query_params[:'sortOrder'] = opts[:'sort_order'] if !opts[:'sort_order'].nil?
561
+
562
+ # header parameters
563
+ header_params = opts[:header_params] || {}
564
+ # HTTP header 'Accept' (if needed)
565
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/csv']) unless header_params['Accept']
566
+
567
+ # form parameters
568
+ form_params = opts[:form_params] || {}
569
+
570
+ # http body (model)
571
+ post_body = opts[:debug_body]
572
+
573
+ # return_type
574
+ return_type = opts[:debug_return_type] || 'ListCompetitors200Response'
575
+
576
+ # auth_names
577
+ auth_names = opts[:debug_auth_names] || ['ApiKey']
578
+
579
+ new_options = opts.merge(
580
+ :operation => :"ProjectsApi.list_competitors",
581
+ :header_params => header_params,
582
+ :query_params => query_params,
583
+ :form_params => form_params,
584
+ :body => post_body,
585
+ :auth_names => auth_names,
586
+ :return_type => return_type
587
+ )
588
+
589
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
590
+ if @api_client.config.debugging
591
+ @api_client.config.logger.debug "API called: ProjectsApi#list_competitors\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
592
+ end
593
+ return data, status_code, headers
594
+ end
595
+
596
+ # List an organization's projects
597
+ # Minimum role: viewer. Metrics come from the same read model the application uses, so the figures match what the product shows. A null metric means \"not known yet\", never zero.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.
598
+ # @param organization_id [String]
599
+ # @param [Hash] opts the optional parameters
600
+ # @option opts [Integer] :limit Page size. A larger value is rejected, never silently reduced. (default to 20)
601
+ # @option opts [Integer] :offset Rows to skip before the page starts. Page by advancing it in steps of &#x60;limit&#x60; until it reaches &#x60;total&#x60;. (default to 0)
602
+ # @option opts [String] :search
603
+ # @option opts [String] :status
604
+ # @option opts [String] :sort_by (default to 'createdAt')
605
+ # @option opts [String] :sort_order (default to 'desc')
606
+ # @return [ListProjects200Response]
607
+ def list_projects(organization_id, opts = {})
608
+ data, _status_code, _headers = list_projects_with_http_info(organization_id, opts)
609
+ data
610
+ end
611
+
612
+ # List an organization&#39;s projects
613
+ # Minimum role: viewer. Metrics come from the same read model the application uses, so the figures match what the product shows. A null metric means \&quot;not known yet\&quot;, never zero.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.
614
+ # @param organization_id [String]
615
+ # @param [Hash] opts the optional parameters
616
+ # @option opts [Integer] :limit Page size. A larger value is rejected, never silently reduced. (default to 20)
617
+ # @option opts [Integer] :offset Rows to skip before the page starts. Page by advancing it in steps of &#x60;limit&#x60; until it reaches &#x60;total&#x60;. (default to 0)
618
+ # @option opts [String] :search
619
+ # @option opts [String] :status
620
+ # @option opts [String] :sort_by (default to 'createdAt')
621
+ # @option opts [String] :sort_order (default to 'desc')
622
+ # @return [Array<(ListProjects200Response, Integer, Hash)>] ListProjects200Response data, response status code and response headers
623
+ def list_projects_with_http_info(organization_id, opts = {})
624
+ if @api_client.config.debugging
625
+ @api_client.config.logger.debug 'Calling API: ProjectsApi.list_projects ...'
626
+ end
627
+ # verify the required parameter 'organization_id' is set
628
+ if @api_client.config.client_side_validation && organization_id.nil?
629
+ fail ArgumentError, "Missing the required parameter 'organization_id' when calling ProjectsApi.list_projects"
630
+ end
631
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
632
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ProjectsApi.list_projects, must be smaller than or equal to 100.'
633
+ end
634
+
635
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
636
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ProjectsApi.list_projects, must be greater than or equal to 1.'
637
+ end
638
+
639
+ if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0
640
+ fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling ProjectsApi.list_projects, must be greater than or equal to 0.'
641
+ end
642
+
643
+ if @api_client.config.client_side_validation && !opts[:'search'].nil? && opts[:'search'].to_s.length > 100
644
+ fail ArgumentError, 'invalid value for "opts[:"search"]" when calling ProjectsApi.list_projects, the character length must be smaller than or equal to 100.'
645
+ end
646
+
647
+ allowable_values = ["active", "archived"]
648
+ if @api_client.config.client_side_validation && opts[:'status'] && !allowable_values.include?(opts[:'status'])
649
+ fail ArgumentError, "invalid value for \"status\", must be one of #{allowable_values}"
650
+ end
651
+ allowable_values = ["createdAt", "name", "trackedQueryCount", "avgSerpPosition", "avgShoppingPosition", "avgMentionPosition", "avgLinkPosition", "mentionRate", "serpRate", "shoppingRate", "positivityIndex", "shareOfVoice", "serpPositionStability", "shoppingPositionStability", "lastRankDetectedAt"]
652
+ if @api_client.config.client_side_validation && opts[:'sort_by'] && !allowable_values.include?(opts[:'sort_by'])
653
+ fail ArgumentError, "invalid value for \"sort_by\", must be one of #{allowable_values}"
654
+ end
655
+ allowable_values = ["asc", "desc"]
656
+ if @api_client.config.client_side_validation && opts[:'sort_order'] && !allowable_values.include?(opts[:'sort_order'])
657
+ fail ArgumentError, "invalid value for \"sort_order\", must be one of #{allowable_values}"
658
+ end
659
+ # resource path
660
+ local_var_path = '/api/v1/organizations/{organizationId}/projects'.sub('{organizationId}', CGI.escape(organization_id.to_s))
661
+
662
+ # query parameters
663
+ query_params = opts[:query_params] || {}
664
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
665
+ query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
666
+ query_params[:'search'] = opts[:'search'] if !opts[:'search'].nil?
667
+ query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
668
+ query_params[:'sortBy'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?
669
+ query_params[:'sortOrder'] = opts[:'sort_order'] if !opts[:'sort_order'].nil?
670
+
671
+ # header parameters
672
+ header_params = opts[:header_params] || {}
673
+ # HTTP header 'Accept' (if needed)
674
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/csv']) unless header_params['Accept']
675
+
676
+ # form parameters
677
+ form_params = opts[:form_params] || {}
678
+
679
+ # http body (model)
680
+ post_body = opts[:debug_body]
681
+
682
+ # return_type
683
+ return_type = opts[:debug_return_type] || 'ListProjects200Response'
684
+
685
+ # auth_names
686
+ auth_names = opts[:debug_auth_names] || ['ApiKey']
687
+
688
+ new_options = opts.merge(
689
+ :operation => :"ProjectsApi.list_projects",
690
+ :header_params => header_params,
691
+ :query_params => query_params,
692
+ :form_params => form_params,
693
+ :body => post_body,
694
+ :auth_names => auth_names,
695
+ :return_type => return_type
696
+ )
697
+
698
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
699
+ if @api_client.config.debugging
700
+ @api_client.config.logger.debug "API called: ProjectsApi#list_projects\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
701
+ end
702
+ return data, status_code, headers
703
+ end
704
+
705
+ # List the keyword clusters of a project
706
+ # Minimum role: viewer. The keyword clusters configured on a project, one page at a time. Each cluster id is exactly what the analytics operations accept in their queryClusterIds filter — pass the id, never the name. Names are unique within a project and are stored lower-cased, so the listing is ordered by name with no ties and paging over it neither repeats nor skips a cluster. `total` counts every cluster in the project, not the size of the page returned. A cluster carries no metrics of its own and no membership count: for the tracked queries inside a cluster, filter the tracked-query operations by its id. An empty list means the project has no clusters configured, which is not an error and is not a statement about whether any data has been collected.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.
707
+ # @param organization_id [String]
708
+ # @param project_id [String]
709
+ # @param [Hash] opts the optional parameters
710
+ # @option opts [Integer] :limit Page size. A larger value is rejected, never silently reduced. (default to 20)
711
+ # @option opts [Integer] :offset Number of clusters to skip before the page starts. (default to 0)
712
+ # @option opts [String] :sort_order Direction of the name ordering. An unknown value is rejected, not replaced by the default. (default to 'asc')
713
+ # @return [ListQueryClusters200Response]
714
+ def list_query_clusters(organization_id, project_id, opts = {})
715
+ data, _status_code, _headers = list_query_clusters_with_http_info(organization_id, project_id, opts)
716
+ data
717
+ end
718
+
719
+ # List the keyword clusters of a project
720
+ # Minimum role: viewer. The keyword clusters configured on a project, one page at a time. Each cluster id is exactly what the analytics operations accept in their queryClusterIds filter — pass the id, never the name. Names are unique within a project and are stored lower-cased, so the listing is ordered by name with no ties and paging over it neither repeats nor skips a cluster. &#x60;total&#x60; counts every cluster in the project, not the size of the page returned. A cluster carries no metrics of its own and no membership count: for the tracked queries inside a cluster, filter the tracked-query operations by its id. An empty list means the project has no clusters configured, which is not an error and is not a statement about whether any data has been collected.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.
721
+ # @param organization_id [String]
722
+ # @param project_id [String]
723
+ # @param [Hash] opts the optional parameters
724
+ # @option opts [Integer] :limit Page size. A larger value is rejected, never silently reduced. (default to 20)
725
+ # @option opts [Integer] :offset Number of clusters to skip before the page starts. (default to 0)
726
+ # @option opts [String] :sort_order Direction of the name ordering. An unknown value is rejected, not replaced by the default. (default to 'asc')
727
+ # @return [Array<(ListQueryClusters200Response, Integer, Hash)>] ListQueryClusters200Response data, response status code and response headers
728
+ def list_query_clusters_with_http_info(organization_id, project_id, opts = {})
729
+ if @api_client.config.debugging
730
+ @api_client.config.logger.debug 'Calling API: ProjectsApi.list_query_clusters ...'
731
+ end
732
+ # verify the required parameter 'organization_id' is set
733
+ if @api_client.config.client_side_validation && organization_id.nil?
734
+ fail ArgumentError, "Missing the required parameter 'organization_id' when calling ProjectsApi.list_query_clusters"
735
+ end
736
+ # verify the required parameter 'project_id' is set
737
+ if @api_client.config.client_side_validation && project_id.nil?
738
+ fail ArgumentError, "Missing the required parameter 'project_id' when calling ProjectsApi.list_query_clusters"
739
+ end
740
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
741
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ProjectsApi.list_query_clusters, must be smaller than or equal to 100.'
742
+ end
743
+
744
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
745
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ProjectsApi.list_query_clusters, must be greater than or equal to 1.'
746
+ end
747
+
748
+ if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0
749
+ fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling ProjectsApi.list_query_clusters, must be greater than or equal to 0.'
750
+ end
751
+
752
+ allowable_values = ["asc", "desc"]
753
+ if @api_client.config.client_side_validation && opts[:'sort_order'] && !allowable_values.include?(opts[:'sort_order'])
754
+ fail ArgumentError, "invalid value for \"sort_order\", must be one of #{allowable_values}"
755
+ end
756
+ # resource path
757
+ local_var_path = '/api/v1/organizations/{organizationId}/projects/{projectId}/clusters'.sub('{organizationId}', CGI.escape(organization_id.to_s)).sub('{projectId}', CGI.escape(project_id.to_s))
758
+
759
+ # query parameters
760
+ query_params = opts[:query_params] || {}
761
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
762
+ query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
763
+ query_params[:'sortOrder'] = opts[:'sort_order'] if !opts[:'sort_order'].nil?
764
+
765
+ # header parameters
766
+ header_params = opts[:header_params] || {}
767
+ # HTTP header 'Accept' (if needed)
768
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/csv']) unless header_params['Accept']
769
+
770
+ # form parameters
771
+ form_params = opts[:form_params] || {}
772
+
773
+ # http body (model)
774
+ post_body = opts[:debug_body]
775
+
776
+ # return_type
777
+ return_type = opts[:debug_return_type] || 'ListQueryClusters200Response'
778
+
779
+ # auth_names
780
+ auth_names = opts[:debug_auth_names] || ['ApiKey']
781
+
782
+ new_options = opts.merge(
783
+ :operation => :"ProjectsApi.list_query_clusters",
784
+ :header_params => header_params,
785
+ :query_params => query_params,
786
+ :form_params => form_params,
787
+ :body => post_body,
788
+ :auth_names => auth_names,
789
+ :return_type => return_type
790
+ )
791
+
792
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
793
+ if @api_client.config.debugging
794
+ @api_client.config.logger.debug "API called: ProjectsApi#list_query_clusters\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
795
+ end
796
+ return data, status_code, headers
797
+ end
798
+
799
+ # Restore an archived project
800
+ # Minimum role: manager, in an active organization. Requires the \"write\" capability. Brings an archived project back to active, with every tracked query, capture and metric it had when it was archived. What is NOT done: no check is run and no scraping is scheduled as a result — collection resumes on the project's own schedule. Restoring clears the record of who archived the project, so a project restored here is treated as an ordinary active project by any later organization archive. A project archived because its organization was archived cannot be restored on its own: restore the organization, which restores them all. Restoring a project that is already active answers 409, unless the call is a retry carrying the key that restored it. This endpoint takes no body, and one carrying fields is refused. Send an Idempotency-Key; a retry with the same key returns the recorded answer.
801
+ # @param organization_id [String]
802
+ # @param project_id [String]
803
+ # @param idempotency_key [String]
804
+ # @param [Hash] opts the optional parameters
805
+ # @return [ProjectDetailResource]
806
+ def restore_project(organization_id, project_id, idempotency_key, opts = {})
807
+ data, _status_code, _headers = restore_project_with_http_info(organization_id, project_id, idempotency_key, opts)
808
+ data
809
+ end
810
+
811
+ # Restore an archived project
812
+ # Minimum role: manager, in an active organization. Requires the \&quot;write\&quot; capability. Brings an archived project back to active, with every tracked query, capture and metric it had when it was archived. What is NOT done: no check is run and no scraping is scheduled as a result — collection resumes on the project&#39;s own schedule. Restoring clears the record of who archived the project, so a project restored here is treated as an ordinary active project by any later organization archive. A project archived because its organization was archived cannot be restored on its own: restore the organization, which restores them all. Restoring a project that is already active answers 409, unless the call is a retry carrying the key that restored it. This endpoint takes no body, and one carrying fields is refused. Send an Idempotency-Key; a retry with the same key returns the recorded answer.
813
+ # @param organization_id [String]
814
+ # @param project_id [String]
815
+ # @param idempotency_key [String]
816
+ # @param [Hash] opts the optional parameters
817
+ # @return [Array<(ProjectDetailResource, Integer, Hash)>] ProjectDetailResource data, response status code and response headers
818
+ def restore_project_with_http_info(organization_id, project_id, idempotency_key, opts = {})
819
+ if @api_client.config.debugging
820
+ @api_client.config.logger.debug 'Calling API: ProjectsApi.restore_project ...'
821
+ end
822
+ # verify the required parameter 'organization_id' is set
823
+ if @api_client.config.client_side_validation && organization_id.nil?
824
+ fail ArgumentError, "Missing the required parameter 'organization_id' when calling ProjectsApi.restore_project"
825
+ end
826
+ # verify the required parameter 'project_id' is set
827
+ if @api_client.config.client_side_validation && project_id.nil?
828
+ fail ArgumentError, "Missing the required parameter 'project_id' when calling ProjectsApi.restore_project"
829
+ end
830
+ # verify the required parameter 'idempotency_key' is set
831
+ if @api_client.config.client_side_validation && idempotency_key.nil?
832
+ fail ArgumentError, "Missing the required parameter 'idempotency_key' when calling ProjectsApi.restore_project"
833
+ end
834
+ if @api_client.config.client_side_validation && idempotency_key.to_s.length > 255
835
+ fail ArgumentError, 'invalid value for "idempotency_key" when calling ProjectsApi.restore_project, the character length must be smaller than or equal to 255.'
836
+ end
837
+
838
+ if @api_client.config.client_side_validation && idempotency_key.to_s.length < 8
839
+ fail ArgumentError, 'invalid value for "idempotency_key" when calling ProjectsApi.restore_project, the character length must be greater than or equal to 8.'
840
+ end
841
+
842
+ # resource path
843
+ local_var_path = '/api/v1/organizations/{organizationId}/projects/{projectId}/restore'.sub('{organizationId}', CGI.escape(organization_id.to_s)).sub('{projectId}', CGI.escape(project_id.to_s))
844
+
845
+ # query parameters
846
+ query_params = opts[:query_params] || {}
847
+
848
+ # header parameters
849
+ header_params = opts[:header_params] || {}
850
+ # HTTP header 'Accept' (if needed)
851
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
852
+ header_params[:'Idempotency-Key'] = idempotency_key
853
+
854
+ # form parameters
855
+ form_params = opts[:form_params] || {}
856
+
857
+ # http body (model)
858
+ post_body = opts[:debug_body]
859
+
860
+ # return_type
861
+ return_type = opts[:debug_return_type] || 'ProjectDetailResource'
862
+
863
+ # auth_names
864
+ auth_names = opts[:debug_auth_names] || ['ApiKey']
865
+
866
+ new_options = opts.merge(
867
+ :operation => :"ProjectsApi.restore_project",
868
+ :header_params => header_params,
869
+ :query_params => query_params,
870
+ :form_params => form_params,
871
+ :body => post_body,
872
+ :auth_names => auth_names,
873
+ :return_type => return_type
874
+ )
875
+
876
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
877
+ if @api_client.config.debugging
878
+ @api_client.config.logger.debug "API called: ProjectsApi#restore_project\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
879
+ end
880
+ return data, status_code, headers
881
+ end
882
+
883
+ # Replace a competitor
884
+ # Minimum role: manager, on an active organization and a project that is not archived. Replaces the competitor's name, domains and brand names: the lists sent become the lists stored, so a term left out is removed. Both lists are required and neither may be empty — a competitor that matches on nothing would never be found in an answer. A domain may be sent as a full URL or as a bare host; a URL is reduced to its host and a leading \"www.\" is dropped. Duplicates are collapsed. The auto-generated brand description cannot be set, and sending it is refused as an unknown field. Changing the matching rules does NOT re-match the answers already captured: it applies to checks from here on. A competitor belonging to another project answers 404, the same answer an unknown id gets. An Idempotency-Key header is required.
885
+ # @param organization_id [String]
886
+ # @param project_id [String] Must belong to the organization in the path.
887
+ # @param competitor_id [String] Must belong to the project in the path.
888
+ # @param idempotency_key [String] Unique per attempt. A retry carrying the same key and the same body is answered from the record instead of running again.
889
+ # @param create_competitor_request [CreateCompetitorRequest]
890
+ # @param [Hash] opts the optional parameters
891
+ # @return [CompetitorResource]
892
+ def update_competitor(organization_id, project_id, competitor_id, idempotency_key, create_competitor_request, opts = {})
893
+ data, _status_code, _headers = update_competitor_with_http_info(organization_id, project_id, competitor_id, idempotency_key, create_competitor_request, opts)
894
+ data
895
+ end
896
+
897
+ # Replace a competitor
898
+ # Minimum role: manager, on an active organization and a project that is not archived. Replaces the competitor&#39;s name, domains and brand names: the lists sent become the lists stored, so a term left out is removed. Both lists are required and neither may be empty — a competitor that matches on nothing would never be found in an answer. A domain may be sent as a full URL or as a bare host; a URL is reduced to its host and a leading \&quot;www.\&quot; is dropped. Duplicates are collapsed. The auto-generated brand description cannot be set, and sending it is refused as an unknown field. Changing the matching rules does NOT re-match the answers already captured: it applies to checks from here on. A competitor belonging to another project answers 404, the same answer an unknown id gets. An Idempotency-Key header is required.
899
+ # @param organization_id [String]
900
+ # @param project_id [String] Must belong to the organization in the path.
901
+ # @param competitor_id [String] Must belong to the project in the path.
902
+ # @param idempotency_key [String] Unique per attempt. A retry carrying the same key and the same body is answered from the record instead of running again.
903
+ # @param create_competitor_request [CreateCompetitorRequest]
904
+ # @param [Hash] opts the optional parameters
905
+ # @return [Array<(CompetitorResource, Integer, Hash)>] CompetitorResource data, response status code and response headers
906
+ def update_competitor_with_http_info(organization_id, project_id, competitor_id, idempotency_key, create_competitor_request, opts = {})
907
+ if @api_client.config.debugging
908
+ @api_client.config.logger.debug 'Calling API: ProjectsApi.update_competitor ...'
909
+ end
910
+ # verify the required parameter 'organization_id' is set
911
+ if @api_client.config.client_side_validation && organization_id.nil?
912
+ fail ArgumentError, "Missing the required parameter 'organization_id' when calling ProjectsApi.update_competitor"
913
+ end
914
+ # verify the required parameter 'project_id' is set
915
+ if @api_client.config.client_side_validation && project_id.nil?
916
+ fail ArgumentError, "Missing the required parameter 'project_id' when calling ProjectsApi.update_competitor"
917
+ end
918
+ # verify the required parameter 'competitor_id' is set
919
+ if @api_client.config.client_side_validation && competitor_id.nil?
920
+ fail ArgumentError, "Missing the required parameter 'competitor_id' when calling ProjectsApi.update_competitor"
921
+ end
922
+ # verify the required parameter 'idempotency_key' is set
923
+ if @api_client.config.client_side_validation && idempotency_key.nil?
924
+ fail ArgumentError, "Missing the required parameter 'idempotency_key' when calling ProjectsApi.update_competitor"
925
+ end
926
+ # verify the required parameter 'create_competitor_request' is set
927
+ if @api_client.config.client_side_validation && create_competitor_request.nil?
928
+ fail ArgumentError, "Missing the required parameter 'create_competitor_request' when calling ProjectsApi.update_competitor"
929
+ end
930
+ # resource path
931
+ local_var_path = '/api/v1/organizations/{organizationId}/projects/{projectId}/competitors/{competitorId}'.sub('{organizationId}', CGI.escape(organization_id.to_s)).sub('{projectId}', CGI.escape(project_id.to_s)).sub('{competitorId}', CGI.escape(competitor_id.to_s))
932
+
933
+ # query parameters
934
+ query_params = opts[:query_params] || {}
935
+
936
+ # header parameters
937
+ header_params = opts[:header_params] || {}
938
+ # HTTP header 'Accept' (if needed)
939
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
940
+ # HTTP header 'Content-Type'
941
+ content_type = @api_client.select_header_content_type(['application/json'])
942
+ if !content_type.nil?
943
+ header_params['Content-Type'] = content_type
944
+ end
945
+ header_params[:'Idempotency-Key'] = idempotency_key
946
+
947
+ # form parameters
948
+ form_params = opts[:form_params] || {}
949
+
950
+ # http body (model)
951
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(create_competitor_request)
952
+
953
+ # return_type
954
+ return_type = opts[:debug_return_type] || 'CompetitorResource'
955
+
956
+ # auth_names
957
+ auth_names = opts[:debug_auth_names] || ['ApiKey']
958
+
959
+ new_options = opts.merge(
960
+ :operation => :"ProjectsApi.update_competitor",
961
+ :header_params => header_params,
962
+ :query_params => query_params,
963
+ :form_params => form_params,
964
+ :body => post_body,
965
+ :auth_names => auth_names,
966
+ :return_type => return_type
967
+ )
968
+
969
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
970
+ if @api_client.config.debugging
971
+ @api_client.config.logger.debug "API called: ProjectsApi#update_competitor\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
972
+ end
973
+ return data, status_code, headers
974
+ end
975
+
976
+ # Rename a project
977
+ # Minimum role: manager, in an active organization. Requires the \"write\" capability. `name` is the only writable field and it is required. What is NOT done: the monitored domains and brand names are not touched (use updateProjectBrandProfile) and competitors are not touched, added or removed (use the competitor endpoints). Sending `websiteDomains`, `brandNames` or `competitors` here is refused with the field named, never applied in part and never ignored. Renaming a project changes nothing about the data already collected against it. A project that belongs to another organization answers 404, never 403. An archived project answers 409: restore it first — unless the call is a retry carrying the key of a rename that already succeeded, which is answered from the record whatever the project's state is now. Send an Idempotency-Key; a retry with the same key and body returns the recorded answer.
978
+ # @param organization_id [String]
979
+ # @param project_id [String]
980
+ # @param idempotency_key [String]
981
+ # @param update_project_request [UpdateProjectRequest]
982
+ # @param [Hash] opts the optional parameters
983
+ # @return [ProjectDetailResource]
984
+ def update_project(organization_id, project_id, idempotency_key, update_project_request, opts = {})
985
+ data, _status_code, _headers = update_project_with_http_info(organization_id, project_id, idempotency_key, update_project_request, opts)
986
+ data
987
+ end
988
+
989
+ # Rename a project
990
+ # Minimum role: manager, in an active organization. Requires the \&quot;write\&quot; capability. &#x60;name&#x60; is the only writable field and it is required. What is NOT done: the monitored domains and brand names are not touched (use updateProjectBrandProfile) and competitors are not touched, added or removed (use the competitor endpoints). Sending &#x60;websiteDomains&#x60;, &#x60;brandNames&#x60; or &#x60;competitors&#x60; here is refused with the field named, never applied in part and never ignored. Renaming a project changes nothing about the data already collected against it. A project that belongs to another organization answers 404, never 403. An archived project answers 409: restore it first — unless the call is a retry carrying the key of a rename that already succeeded, which is answered from the record whatever the project&#39;s state is now. Send an Idempotency-Key; a retry with the same key and body returns the recorded answer.
991
+ # @param organization_id [String]
992
+ # @param project_id [String]
993
+ # @param idempotency_key [String]
994
+ # @param update_project_request [UpdateProjectRequest]
995
+ # @param [Hash] opts the optional parameters
996
+ # @return [Array<(ProjectDetailResource, Integer, Hash)>] ProjectDetailResource data, response status code and response headers
997
+ def update_project_with_http_info(organization_id, project_id, idempotency_key, update_project_request, opts = {})
998
+ if @api_client.config.debugging
999
+ @api_client.config.logger.debug 'Calling API: ProjectsApi.update_project ...'
1000
+ end
1001
+ # verify the required parameter 'organization_id' is set
1002
+ if @api_client.config.client_side_validation && organization_id.nil?
1003
+ fail ArgumentError, "Missing the required parameter 'organization_id' when calling ProjectsApi.update_project"
1004
+ end
1005
+ # verify the required parameter 'project_id' is set
1006
+ if @api_client.config.client_side_validation && project_id.nil?
1007
+ fail ArgumentError, "Missing the required parameter 'project_id' when calling ProjectsApi.update_project"
1008
+ end
1009
+ # verify the required parameter 'idempotency_key' is set
1010
+ if @api_client.config.client_side_validation && idempotency_key.nil?
1011
+ fail ArgumentError, "Missing the required parameter 'idempotency_key' when calling ProjectsApi.update_project"
1012
+ end
1013
+ if @api_client.config.client_side_validation && idempotency_key.to_s.length > 255
1014
+ fail ArgumentError, 'invalid value for "idempotency_key" when calling ProjectsApi.update_project, the character length must be smaller than or equal to 255.'
1015
+ end
1016
+
1017
+ if @api_client.config.client_side_validation && idempotency_key.to_s.length < 8
1018
+ fail ArgumentError, 'invalid value for "idempotency_key" when calling ProjectsApi.update_project, the character length must be greater than or equal to 8.'
1019
+ end
1020
+
1021
+ # verify the required parameter 'update_project_request' is set
1022
+ if @api_client.config.client_side_validation && update_project_request.nil?
1023
+ fail ArgumentError, "Missing the required parameter 'update_project_request' when calling ProjectsApi.update_project"
1024
+ end
1025
+ # resource path
1026
+ local_var_path = '/api/v1/organizations/{organizationId}/projects/{projectId}'.sub('{organizationId}', CGI.escape(organization_id.to_s)).sub('{projectId}', CGI.escape(project_id.to_s))
1027
+
1028
+ # query parameters
1029
+ query_params = opts[:query_params] || {}
1030
+
1031
+ # header parameters
1032
+ header_params = opts[:header_params] || {}
1033
+ # HTTP header 'Accept' (if needed)
1034
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1035
+ # HTTP header 'Content-Type'
1036
+ content_type = @api_client.select_header_content_type(['application/json'])
1037
+ if !content_type.nil?
1038
+ header_params['Content-Type'] = content_type
1039
+ end
1040
+ header_params[:'Idempotency-Key'] = idempotency_key
1041
+
1042
+ # form parameters
1043
+ form_params = opts[:form_params] || {}
1044
+
1045
+ # http body (model)
1046
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(update_project_request)
1047
+
1048
+ # return_type
1049
+ return_type = opts[:debug_return_type] || 'ProjectDetailResource'
1050
+
1051
+ # auth_names
1052
+ auth_names = opts[:debug_auth_names] || ['ApiKey']
1053
+
1054
+ new_options = opts.merge(
1055
+ :operation => :"ProjectsApi.update_project",
1056
+ :header_params => header_params,
1057
+ :query_params => query_params,
1058
+ :form_params => form_params,
1059
+ :body => post_body,
1060
+ :auth_names => auth_names,
1061
+ :return_type => return_type
1062
+ )
1063
+
1064
+ data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
1065
+ if @api_client.config.debugging
1066
+ @api_client.config.logger.debug "API called: ProjectsApi#update_project\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1067
+ end
1068
+ return data, status_code, headers
1069
+ end
1070
+
1071
+ # Replace a project's brand monitoring profile
1072
+ # Minimum role: manager, on an active organization and a project that is not archived. Replaces the brand terms and website domains every check of this project is matched against: the lists sent become the lists stored, so a term left out is removed. Both lists are required and neither may be empty — a project must keep at least one brand name and one domain to match anything. A domain may be sent as a full URL or as a bare host; a URL is reduced to its host and a leading \"www.\" is dropped, which is the form the profile is read back in. Duplicates, including two URLs that reduce to the same host, are collapsed. This operation does NOT touch the project name or its competitors, which are separate resources, and it does not regenerate the brand description: that runs asynchronously afterwards, so the description in the response is the one stored at the time of the write. An Idempotency-Key header is required.
1073
+ # @param organization_id [String]
1074
+ # @param project_id [String] Must belong to the organization in the path.
1075
+ # @param idempotency_key [String] Unique per attempt. A retry carrying the same key and the same body is answered from the record instead of running again.
1076
+ # @param update_project_brand_profile_request [UpdateProjectBrandProfileRequest]
1077
+ # @param [Hash] opts the optional parameters
1078
+ # @return [BrandProfileResource]
1079
+ def update_project_brand_profile(organization_id, project_id, idempotency_key, update_project_brand_profile_request, opts = {})
1080
+ data, _status_code, _headers = update_project_brand_profile_with_http_info(organization_id, project_id, idempotency_key, update_project_brand_profile_request, opts)
1081
+ data
1082
+ end
1083
+
1084
+ # Replace a project&#39;s brand monitoring profile
1085
+ # Minimum role: manager, on an active organization and a project that is not archived. Replaces the brand terms and website domains every check of this project is matched against: the lists sent become the lists stored, so a term left out is removed. Both lists are required and neither may be empty — a project must keep at least one brand name and one domain to match anything. A domain may be sent as a full URL or as a bare host; a URL is reduced to its host and a leading \&quot;www.\&quot; is dropped, which is the form the profile is read back in. Duplicates, including two URLs that reduce to the same host, are collapsed. This operation does NOT touch the project name or its competitors, which are separate resources, and it does not regenerate the brand description: that runs asynchronously afterwards, so the description in the response is the one stored at the time of the write. An Idempotency-Key header is required.
1086
+ # @param organization_id [String]
1087
+ # @param project_id [String] Must belong to the organization in the path.
1088
+ # @param idempotency_key [String] Unique per attempt. A retry carrying the same key and the same body is answered from the record instead of running again.
1089
+ # @param update_project_brand_profile_request [UpdateProjectBrandProfileRequest]
1090
+ # @param [Hash] opts the optional parameters
1091
+ # @return [Array<(BrandProfileResource, Integer, Hash)>] BrandProfileResource data, response status code and response headers
1092
+ def update_project_brand_profile_with_http_info(organization_id, project_id, idempotency_key, update_project_brand_profile_request, opts = {})
1093
+ if @api_client.config.debugging
1094
+ @api_client.config.logger.debug 'Calling API: ProjectsApi.update_project_brand_profile ...'
1095
+ end
1096
+ # verify the required parameter 'organization_id' is set
1097
+ if @api_client.config.client_side_validation && organization_id.nil?
1098
+ fail ArgumentError, "Missing the required parameter 'organization_id' when calling ProjectsApi.update_project_brand_profile"
1099
+ end
1100
+ # verify the required parameter 'project_id' is set
1101
+ if @api_client.config.client_side_validation && project_id.nil?
1102
+ fail ArgumentError, "Missing the required parameter 'project_id' when calling ProjectsApi.update_project_brand_profile"
1103
+ end
1104
+ # verify the required parameter 'idempotency_key' is set
1105
+ if @api_client.config.client_side_validation && idempotency_key.nil?
1106
+ fail ArgumentError, "Missing the required parameter 'idempotency_key' when calling ProjectsApi.update_project_brand_profile"
1107
+ end
1108
+ # verify the required parameter 'update_project_brand_profile_request' is set
1109
+ if @api_client.config.client_side_validation && update_project_brand_profile_request.nil?
1110
+ fail ArgumentError, "Missing the required parameter 'update_project_brand_profile_request' when calling ProjectsApi.update_project_brand_profile"
1111
+ end
1112
+ # resource path
1113
+ local_var_path = '/api/v1/organizations/{organizationId}/projects/{projectId}/brand-profile'.sub('{organizationId}', CGI.escape(organization_id.to_s)).sub('{projectId}', CGI.escape(project_id.to_s))
1114
+
1115
+ # query parameters
1116
+ query_params = opts[:query_params] || {}
1117
+
1118
+ # header parameters
1119
+ header_params = opts[:header_params] || {}
1120
+ # HTTP header 'Accept' (if needed)
1121
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1122
+ # HTTP header 'Content-Type'
1123
+ content_type = @api_client.select_header_content_type(['application/json'])
1124
+ if !content_type.nil?
1125
+ header_params['Content-Type'] = content_type
1126
+ end
1127
+ header_params[:'Idempotency-Key'] = idempotency_key
1128
+
1129
+ # form parameters
1130
+ form_params = opts[:form_params] || {}
1131
+
1132
+ # http body (model)
1133
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(update_project_brand_profile_request)
1134
+
1135
+ # return_type
1136
+ return_type = opts[:debug_return_type] || 'BrandProfileResource'
1137
+
1138
+ # auth_names
1139
+ auth_names = opts[:debug_auth_names] || ['ApiKey']
1140
+
1141
+ new_options = opts.merge(
1142
+ :operation => :"ProjectsApi.update_project_brand_profile",
1143
+ :header_params => header_params,
1144
+ :query_params => query_params,
1145
+ :form_params => form_params,
1146
+ :body => post_body,
1147
+ :auth_names => auth_names,
1148
+ :return_type => return_type
1149
+ )
1150
+
1151
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
1152
+ if @api_client.config.debugging
1153
+ @api_client.config.logger.debug "API called: ProjectsApi#update_project_brand_profile\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1154
+ end
1155
+ return data, status_code, headers
1156
+ end
1157
+ end
1158
+ end