mencoro 1.0.1 → 2.0.1

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 (260) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +41 -5
  3. data/docs/AccountApi.md +1 -1
  4. data/docs/AnalyticsApi.md +96 -86
  5. data/docs/AsyncJobResource.md +3 -1
  6. data/docs/AsyncJobResourceError.md +20 -0
  7. data/docs/BillingApi.md +1 -1
  8. data/docs/CitedSourceRow.md +32 -0
  9. data/docs/CitedSourcesResponse.md +20 -0
  10. data/docs/ClusterBreakdownRow.md +82 -0
  11. data/docs/ClustersApi.md +74 -0
  12. data/docs/CompetitorCoOccurrenceResponse.md +18 -0
  13. data/docs/CompetitorCoOccurrenceRow.md +36 -0
  14. data/docs/CompetitorShareOfVoice.md +20 -0
  15. data/docs/CreateInvitation201Response.md +4 -0
  16. data/docs/CreateInvitationRequest.md +3 -1
  17. data/docs/CreateInvitationRequestProjectAccess.md +20 -0
  18. data/docs/DiscoveryApi.md +1 -1
  19. data/docs/GetMeStats200ResponseProjects.md +1 -1
  20. data/docs/GetOrganizationOverview200ResponseAggregate.md +1 -1
  21. data/docs/GetOrganizationOverview200ResponseProjectsInner.md +8 -2
  22. data/docs/GetOrganizationStats200ResponseInvitations.md +1 -1
  23. data/docs/GetOrganizationStats200ResponseMembers.md +1 -1
  24. data/docs/GetOrganizationStats200ResponseProjects.md +1 -1
  25. data/docs/InvitationResource.md +5 -1
  26. data/docs/JobsApi.md +1 -1
  27. data/docs/KeywordListingResource.md +12 -10
  28. data/docs/KeywordListingResourceCarriedPositions.md +24 -0
  29. data/docs/KeywordListingResourceCarriedPositionsSerp.md +20 -0
  30. data/docs/ListProjects200Response.md +1 -1
  31. data/docs/MemberResource.md +5 -1
  32. data/docs/MembersApi.md +78 -0
  33. data/docs/MentionMatchResource.md +44 -0
  34. data/docs/MentionSampleResponse.md +46 -0
  35. data/docs/MentionTypeCounts.md +26 -0
  36. data/docs/OrganizationsApi.md +3 -3
  37. data/docs/PerCompetitorSentiment.md +30 -0
  38. data/docs/PerEngineSentiment.md +28 -0
  39. data/docs/PerEntityMetrics.md +32 -0
  40. data/docs/PositionDistributionBucket.md +20 -0
  41. data/docs/ProjectMentionMixResponse.md +22 -0
  42. data/docs/ProjectMentionSamplesResponse.md +20 -0
  43. data/docs/ProjectRankTrackingClusterBreakdown.md +20 -0
  44. data/docs/ProjectRankTrackingStats.md +96 -0
  45. data/docs/ProjectRankTrackingTimeSeries.md +20 -0
  46. data/docs/ProjectSentimentBreakdown.md +20 -0
  47. data/docs/ProjectedMonthlyChecksResource.md +2 -2
  48. data/docs/ProjectsApi.md +76 -2
  49. data/docs/SearchTrackedQueryMentionMatches200Response.md +20 -0
  50. data/docs/SearchTrackedQuerySerpMatches200Response.md +20 -0
  51. data/docs/SerpMatchResource.md +30 -0
  52. data/docs/SetMemberProjectAccessRequest.md +20 -0
  53. data/docs/SubscriptionResource.md +1 -1
  54. data/docs/TimeSeriesPoint.md +22 -0
  55. data/docs/TrackedQueriesApi.md +175 -3
  56. data/docs/TrackedQueryCountResource.md +1 -1
  57. data/docs/TrackedQueryMoverRow.md +58 -0
  58. data/docs/TrackedQueryMoversResponse.md +22 -0
  59. data/docs/TrackedQueryRankTrackingTimeSeries.md +20 -0
  60. data/docs/TrackedQueryUsageResource.md +1 -1
  61. data/lib/mencoro/api/account_api.rb +3 -3
  62. data/lib/mencoro/api/analytics_api.rb +103 -85
  63. data/lib/mencoro/api/billing_api.rb +3 -3
  64. data/lib/mencoro/api/captures_api.rb +2 -2
  65. data/lib/mencoro/api/clusters_api.rb +76 -1
  66. data/lib/mencoro/api/discovery_api.rb +3 -3
  67. data/lib/mencoro/api/invitations_api.rb +1 -1
  68. data/lib/mencoro/api/jobs_api.rb +3 -3
  69. data/lib/mencoro/api/members_api.rb +95 -1
  70. data/lib/mencoro/api/organization_operations_api.rb +1 -1
  71. data/lib/mencoro/api/organizations_api.rb +7 -7
  72. data/lib/mencoro/api/projects_api.rb +80 -5
  73. data/lib/mencoro/api/tracked_queries_api.rb +220 -8
  74. data/lib/mencoro/api_client.rb +2 -2
  75. data/lib/mencoro/api_error.rb +1 -1
  76. data/lib/mencoro/api_model_base.rb +1 -1
  77. data/lib/mencoro/configuration.rb +1 -1
  78. data/lib/mencoro/models/accepted_job_resource.rb +1 -1
  79. data/lib/mencoro/models/ai_response_report_resource.rb +1 -1
  80. data/lib/mencoro/models/ai_response_resource.rb +1 -1
  81. data/lib/mencoro/models/apply_clustering_job_outcome.rb +1 -1
  82. data/lib/mencoro/models/apply_clustering_job_outcome_clusters_inner.rb +1 -1
  83. data/lib/mencoro/models/apply_clustering_job_outcome_failed_inner.rb +1 -1
  84. data/lib/mencoro/models/apply_clustering_job_outcome_skipped_clusters_inner.rb +1 -1
  85. data/lib/mencoro/models/apply_clustering_job_outcome_successful_inner.rb +1 -1
  86. data/lib/mencoro/models/async_job_resource.rb +17 -7
  87. data/lib/mencoro/models/async_job_resource_error.rb +217 -0
  88. data/lib/mencoro/models/batch_change_tracked_query_check_frequency_request_data.rb +1 -1
  89. data/lib/mencoro/models/batch_change_tracked_query_passes_request_data.rb +1 -1
  90. data/lib/mencoro/models/batch_create_query_clusters_outcome.rb +1 -1
  91. data/lib/mencoro/models/batch_create_query_clusters_outcome_failed_inner.rb +1 -1
  92. data/lib/mencoro/models/batch_create_query_clusters_outcome_successful_inner.rb +1 -1
  93. data/lib/mencoro/models/batch_create_query_clusters_request_data.rb +1 -1
  94. data/lib/mencoro/models/batch_create_tracked_queries_request_data.rb +1 -1
  95. data/lib/mencoro/models/batch_create_tracked_queries_result_resource.rb +1 -1
  96. data/lib/mencoro/models/batch_create_tracked_queries_result_resource_failed_inner.rb +1 -1
  97. data/lib/mencoro/models/batch_create_tracked_queries_result_resource_successful_inner.rb +1 -1
  98. data/lib/mencoro/models/batch_force_check_tracked_queries200_response.rb +1 -1
  99. data/lib/mencoro/models/batch_force_check_tracked_queries200_response_failed_inner.rb +1 -1
  100. data/lib/mencoro/models/batch_pause_tracked_queries200_response.rb +1 -1
  101. data/lib/mencoro/models/batch_pause_tracked_queries200_response_failed_inner.rb +1 -1
  102. data/lib/mencoro/models/batch_pause_tracked_queries200_response_successful_inner.rb +1 -1
  103. data/lib/mencoro/models/batch_resume_tracked_queries200_response.rb +1 -1
  104. data/lib/mencoro/models/batch_targets_request_data.rb +1 -1
  105. data/lib/mencoro/models/batch_write_outcome.rb +1 -1
  106. data/lib/mencoro/models/batch_write_outcome_failed_inner.rb +1 -1
  107. data/lib/mencoro/models/brand_profile_resource.rb +1 -1
  108. data/lib/mencoro/models/bulk_add_clusters_to_tracked_queries200_response.rb +1 -1
  109. data/lib/mencoro/models/bulk_add_clusters_to_tracked_queries_request.rb +1 -1
  110. data/lib/mencoro/models/bulk_remove_clusters_from_tracked_queries200_response.rb +1 -1
  111. data/lib/mencoro/models/bulk_remove_clusters_from_tracked_queries_request.rb +1 -1
  112. data/lib/mencoro/models/change_member_role_request.rb +1 -1
  113. data/lib/mencoro/models/change_tracked_query_check_frequency_request_data.rb +1 -1
  114. data/lib/mencoro/models/change_tracked_query_passes_request_data.rb +1 -1
  115. data/lib/mencoro/models/citation_resource.rb +1 -1
  116. data/lib/mencoro/models/cited_source_row.rb +298 -0
  117. data/lib/mencoro/models/cited_sources_response.rb +192 -0
  118. data/lib/mencoro/models/cluster_breakdown_row.rb +580 -0
  119. data/lib/mencoro/models/cluster_membership_request_data.rb +1 -1
  120. data/lib/mencoro/models/competitor_co_occurrence_response.rb +166 -0
  121. data/lib/mencoro/models/competitor_co_occurrence_row.rb +318 -0
  122. data/lib/mencoro/models/competitor_resource.rb +1 -1
  123. data/lib/mencoro/models/competitor_share_of_voice.rb +174 -0
  124. data/lib/mencoro/models/create_competitor_request.rb +1 -1
  125. data/lib/mencoro/models/create_invitation200_response.rb +1 -1
  126. data/lib/mencoro/models/create_invitation201_response.rb +60 -2
  127. data/lib/mencoro/models/create_invitation_request.rb +15 -5
  128. data/lib/mencoro/models/create_invitation_request_project_access.rb +201 -0
  129. data/lib/mencoro/models/create_organization201_response.rb +1 -1
  130. data/lib/mencoro/models/create_organization_request.rb +1 -1
  131. data/lib/mencoro/models/create_project_request.rb +1 -1
  132. data/lib/mencoro/models/create_project_request_competitors_inner.rb +1 -1
  133. data/lib/mencoro/models/create_query_cluster409_response.rb +1 -1
  134. data/lib/mencoro/models/create_query_cluster_request.rb +1 -1
  135. data/lib/mencoro/models/delete_query_cluster200_response.rb +1 -1
  136. data/lib/mencoro/models/entitlements_resource.rb +1 -1
  137. data/lib/mencoro/models/get_available_filters200_response.rb +1 -1
  138. data/lib/mencoro/models/get_available_filters200_response_clusters_inner.rb +1 -1
  139. data/lib/mencoro/models/get_me_stats200_response.rb +1 -1
  140. data/lib/mencoro/models/get_me_stats200_response_organizations.rb +1 -1
  141. data/lib/mencoro/models/get_me_stats200_response_projects.rb +2 -2
  142. data/lib/mencoro/models/get_membership_stats200_response.rb +1 -1
  143. data/lib/mencoro/models/get_mention_samples400_response.rb +1 -1
  144. data/lib/mencoro/models/get_mention_samples400_response_details_value_inner.rb +1 -1
  145. data/lib/mencoro/models/get_metric_glossary200_response.rb +1 -1
  146. data/lib/mencoro/models/get_metric_glossary200_response_metrics_inner.rb +1 -1
  147. data/lib/mencoro/models/get_organization_overview200_response.rb +1 -1
  148. data/lib/mencoro/models/get_organization_overview200_response_aggregate.rb +2 -2
  149. data/lib/mencoro/models/get_organization_overview200_response_projects_inner.rb +34 -3
  150. data/lib/mencoro/models/get_organization_stats200_response.rb +1 -1
  151. data/lib/mencoro/models/get_organization_stats200_response_invitations.rb +4 -7
  152. data/lib/mencoro/models/get_organization_stats200_response_members.rb +4 -7
  153. data/lib/mencoro/models/get_organization_stats200_response_projects.rb +2 -2
  154. data/lib/mencoro/models/get_share_of_voice_formula200_response.rb +1 -1
  155. data/lib/mencoro/models/get_tracking_coverage200_response.rb +1 -1
  156. data/lib/mencoro/models/get_tracking_coverage200_response_sample_inner.rb +1 -1
  157. data/lib/mencoro/models/invitation_resource.rb +64 -6
  158. data/lib/mencoro/models/keyword_listing_resource.rb +40 -14
  159. data/lib/mencoro/models/keyword_listing_resource_carried_positions.rb +187 -0
  160. data/lib/mencoro/models/keyword_listing_resource_carried_positions_serp.rb +192 -0
  161. data/lib/mencoro/models/keyword_listing_resource_mention_type_counts.rb +1 -1
  162. data/lib/mencoro/models/list_ai_responses200_response.rb +1 -1
  163. data/lib/mencoro/models/list_competitors200_response.rb +1 -1
  164. data/lib/mencoro/models/list_invitations200_response.rb +1 -1
  165. data/lib/mencoro/models/list_keyword_listings200_response.rb +1 -1
  166. data/lib/mencoro/models/list_members200_response.rb +1 -1
  167. data/lib/mencoro/models/list_organizations200_response.rb +1 -1
  168. data/lib/mencoro/models/list_projects200_response.rb +2 -2
  169. data/lib/mencoro/models/list_query_clusters200_response.rb +1 -1
  170. data/lib/mencoro/models/list_search_snapshots200_response.rb +1 -1
  171. data/lib/mencoro/models/list_shopping_snapshots200_response.rb +1 -1
  172. data/lib/mencoro/models/me_resource.rb +1 -1
  173. data/lib/mencoro/models/member_resource.rb +63 -5
  174. data/lib/mencoro/models/mention_match_resource.rb +432 -0
  175. data/lib/mencoro/models/mention_sample_response.rb +450 -0
  176. data/lib/mencoro/models/mention_type_counts.rb +268 -0
  177. data/lib/mencoro/models/operation_effect.rb +1 -1
  178. data/lib/mencoro/models/organization_resource.rb +1 -1
  179. data/lib/mencoro/models/per_competitor_sentiment.rb +304 -0
  180. data/lib/mencoro/models/per_engine_sentiment.rb +278 -0
  181. data/lib/mencoro/models/per_entity_metrics.rb +218 -0
  182. data/lib/mencoro/models/position_distribution_bucket.rb +190 -0
  183. data/lib/mencoro/models/preview_organization_operation200_response.rb +1 -1
  184. data/lib/mencoro/models/preview_organization_operation200_response_organization.rb +1 -1
  185. data/lib/mencoro/models/preview_organization_operation_request.rb +3 -3
  186. data/lib/mencoro/models/project_detail_resource.rb +1 -1
  187. data/lib/mencoro/models/project_detail_resource_competitors_inner.rb +1 -1
  188. data/lib/mencoro/models/project_mention_mix_response.rb +222 -0
  189. data/lib/mencoro/models/project_mention_samples_response.rb +192 -0
  190. data/lib/mencoro/models/project_rank_tracking_cluster_breakdown.rb +176 -0
  191. data/lib/mencoro/models/project_rank_tracking_stats.rb +718 -0
  192. data/lib/mencoro/models/project_rank_tracking_time_series.rb +176 -0
  193. data/lib/mencoro/models/project_resource.rb +1 -1
  194. data/lib/mencoro/models/project_sentiment_breakdown.rb +194 -0
  195. data/lib/mencoro/models/projected_monthly_checks_resource.rb +3 -3
  196. data/lib/mencoro/models/query_cluster_resource.rb +1 -1
  197. data/lib/mencoro/models/report_ai_response_request.rb +1 -1
  198. data/lib/mencoro/models/search_result_resource.rb +1 -1
  199. data/lib/mencoro/models/search_snapshot_resource.rb +1 -1
  200. data/lib/mencoro/models/search_tracked_queries200_response.rb +1 -1
  201. data/lib/mencoro/models/search_tracked_query_mention_matches200_response.rb +158 -0
  202. data/lib/mencoro/models/search_tracked_query_serp_matches200_response.rb +158 -0
  203. data/lib/mencoro/models/serp_match_resource.rb +314 -0
  204. data/lib/mencoro/models/set_member_project_access_request.rb +200 -0
  205. data/lib/mencoro/models/shopping_offer_resource.rb +1 -1
  206. data/lib/mencoro/models/shopping_snapshot_resource.rb +1 -1
  207. data/lib/mencoro/models/start_brand_discovery_job_request.rb +1 -1
  208. data/lib/mencoro/models/start_brand_name_suggestion_job_request.rb +1 -1
  209. data/lib/mencoro/models/start_clustering_job_request_data.rb +1 -1
  210. data/lib/mencoro/models/start_keyword_discovery_job_request.rb +1 -1
  211. data/lib/mencoro/models/start_prompt_discovery_job_request.rb +1 -1
  212. data/lib/mencoro/models/submitted_checks_resource.rb +1 -1
  213. data/lib/mencoro/models/subscription_resource.rb +3 -3
  214. data/lib/mencoro/models/time_series_point.rb +218 -0
  215. data/lib/mencoro/models/tracked_query_count_resource.rb +3 -3
  216. data/lib/mencoro/models/tracked_query_detail_resource.rb +3 -3
  217. data/lib/mencoro/models/tracked_query_mover_row.rb +492 -0
  218. data/lib/mencoro/models/tracked_query_movers_response.rb +202 -0
  219. data/lib/mencoro/models/tracked_query_rank_tracking_time_series.rb +176 -0
  220. data/lib/mencoro/models/tracked_query_resource.rb +3 -3
  221. data/lib/mencoro/models/tracked_query_usage_resource.rb +2 -2
  222. data/lib/mencoro/models/update_organization_request.rb +1 -1
  223. data/lib/mencoro/models/update_project_brand_profile_request.rb +1 -1
  224. data/lib/mencoro/models/update_project_request.rb +1 -1
  225. data/lib/mencoro/version.rb +2 -2
  226. data/lib/mencoro.rb +32 -1
  227. data/mencoro.gemspec +2 -2
  228. data/spec/models/async_job_resource_error_spec.rb +46 -0
  229. data/spec/models/cited_source_row_spec.rb +78 -0
  230. data/spec/models/cited_sources_response_spec.rb +42 -0
  231. data/spec/models/cluster_breakdown_row_spec.rb +228 -0
  232. data/spec/models/competitor_co_occurrence_response_spec.rb +36 -0
  233. data/spec/models/competitor_co_occurrence_row_spec.rb +90 -0
  234. data/spec/models/competitor_share_of_voice_spec.rb +42 -0
  235. data/spec/models/create_invitation_request_project_access_spec.rb +46 -0
  236. data/spec/models/keyword_listing_resource_carried_positions_serp_spec.rb +42 -0
  237. data/spec/models/keyword_listing_resource_carried_positions_spec.rb +54 -0
  238. data/spec/models/mention_match_resource_spec.rb +114 -0
  239. data/spec/models/mention_sample_response_spec.rb +114 -0
  240. data/spec/models/mention_type_counts_spec.rb +60 -0
  241. data/spec/models/per_competitor_sentiment_spec.rb +72 -0
  242. data/spec/models/per_engine_sentiment_spec.rb +66 -0
  243. data/spec/models/per_entity_metrics_spec.rb +78 -0
  244. data/spec/models/position_distribution_bucket_spec.rb +42 -0
  245. data/spec/models/project_mention_mix_response_spec.rb +48 -0
  246. data/spec/models/project_mention_samples_response_spec.rb +42 -0
  247. data/spec/models/project_rank_tracking_cluster_breakdown_spec.rb +42 -0
  248. data/spec/models/project_rank_tracking_stats_spec.rb +270 -0
  249. data/spec/models/project_rank_tracking_time_series_spec.rb +42 -0
  250. data/spec/models/project_sentiment_breakdown_spec.rb +42 -0
  251. data/spec/models/search_tracked_query_mention_matches200_response_spec.rb +42 -0
  252. data/spec/models/search_tracked_query_serp_matches200_response_spec.rb +42 -0
  253. data/spec/models/serp_match_resource_spec.rb +72 -0
  254. data/spec/models/set_member_project_access_request_spec.rb +46 -0
  255. data/spec/models/time_series_point_spec.rb +48 -0
  256. data/spec/models/tracked_query_mover_row_spec.rb +156 -0
  257. data/spec/models/tracked_query_movers_response_spec.rb +48 -0
  258. data/spec/models/tracked_query_rank_tracking_time_series_spec.rb +42 -0
  259. data/spec/spec_helper.rb +1 -1
  260. metadata +235 -108
@@ -1,7 +1,7 @@
1
1
  =begin
2
2
  #Mencoro API
3
3
 
4
- #Public API for Mencoro customers. Authenticate with an API key: `Authorization: Bearer mencoro_sk_...`.
4
+ #Public API for Mencoro customers. Authenticate with an API key: `Authorization: Bearer mencoro_sk_...`. Every write operation requires an `Idempotency-Key` header: a retry carrying the same key and body within 30 days is answered from the stored result without running again; after 30 days the key is forgotten and a retry runs as a new operation.
5
5
 
6
6
  The version of the OpenAPI document: 1.0.0
7
7
  Contact: support@mencoro.com
@@ -1,7 +1,7 @@
1
1
  =begin
2
2
  #Mencoro API
3
3
 
4
- #Public API for Mencoro customers. Authenticate with an API key: `Authorization: Bearer mencoro_sk_...`.
4
+ #Public API for Mencoro customers. Authenticate with an API key: `Authorization: Bearer mencoro_sk_...`. Every write operation requires an `Idempotency-Key` header: a retry carrying the same key and body within 30 days is answered from the stored result without running again; after 30 days the key is forgotten and a retry runs as a new operation.
5
5
 
6
6
  The version of the OpenAPI document: 1.0.0
7
7
  Contact: support@mencoro.com
@@ -0,0 +1,304 @@
1
+ =begin
2
+ #Mencoro API
3
+
4
+ #Public API for Mencoro customers. Authenticate with an API key: `Authorization: Bearer mencoro_sk_...`. Every write operation requires an `Idempotency-Key` header: a retry carrying the same key and body within 30 days is answered from the stored result without running again; after 30 days the key is forgotten and a retry runs as a new operation.
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 'date'
14
+ require 'time'
15
+
16
+ module Mencoro
17
+ class PerCompetitorSentiment < ApiModelBase
18
+ attr_accessor :competitor_id
19
+
20
+ attr_accessor :positive
21
+
22
+ attr_accessor :neutral
23
+
24
+ attr_accessor :negative
25
+
26
+ attr_accessor :mention_count
27
+
28
+ attr_accessor :positivity_index
29
+
30
+ attr_accessor :mention_type_counts
31
+
32
+ # Attribute mapping from ruby-style variable name to JSON key.
33
+ def self.attribute_map
34
+ {
35
+ :'competitor_id' => :'competitorId',
36
+ :'positive' => :'positive',
37
+ :'neutral' => :'neutral',
38
+ :'negative' => :'negative',
39
+ :'mention_count' => :'mentionCount',
40
+ :'positivity_index' => :'positivityIndex',
41
+ :'mention_type_counts' => :'mentionTypeCounts'
42
+ }
43
+ end
44
+
45
+ # Returns attribute mapping this model knows about
46
+ def self.acceptable_attribute_map
47
+ attribute_map
48
+ end
49
+
50
+ # Returns all the JSON keys this model knows about
51
+ def self.acceptable_attributes
52
+ acceptable_attribute_map.values
53
+ end
54
+
55
+ # Attribute type mapping.
56
+ def self.openapi_types
57
+ {
58
+ :'competitor_id' => :'String',
59
+ :'positive' => :'Integer',
60
+ :'neutral' => :'Integer',
61
+ :'negative' => :'Integer',
62
+ :'mention_count' => :'Integer',
63
+ :'positivity_index' => :'Integer',
64
+ :'mention_type_counts' => :'MentionTypeCounts'
65
+ }
66
+ end
67
+
68
+ # List of attributes with nullable: true
69
+ def self.openapi_nullable
70
+ Set.new([
71
+ :'positivity_index',
72
+ ])
73
+ end
74
+
75
+ # Initializes the object
76
+ # @param [Hash] attributes Model attributes in the form of hash
77
+ def initialize(attributes = {})
78
+ if (!attributes.is_a?(Hash))
79
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Mencoro::PerCompetitorSentiment` initialize method"
80
+ end
81
+
82
+ # check to see if the attribute exists and convert string to symbol for hash key
83
+ acceptable_attribute_map = self.class.acceptable_attribute_map
84
+ attributes = attributes.each_with_object({}) { |(k, v), h|
85
+ if (!acceptable_attribute_map.key?(k.to_sym))
86
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Mencoro::PerCompetitorSentiment`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
87
+ end
88
+ h[k.to_sym] = v
89
+ }
90
+
91
+ if attributes.key?(:'competitor_id')
92
+ self.competitor_id = attributes[:'competitor_id']
93
+ else
94
+ self.competitor_id = nil
95
+ end
96
+
97
+ if attributes.key?(:'positive')
98
+ self.positive = attributes[:'positive']
99
+ else
100
+ self.positive = nil
101
+ end
102
+
103
+ if attributes.key?(:'neutral')
104
+ self.neutral = attributes[:'neutral']
105
+ else
106
+ self.neutral = nil
107
+ end
108
+
109
+ if attributes.key?(:'negative')
110
+ self.negative = attributes[:'negative']
111
+ else
112
+ self.negative = nil
113
+ end
114
+
115
+ if attributes.key?(:'mention_count')
116
+ self.mention_count = attributes[:'mention_count']
117
+ else
118
+ self.mention_count = nil
119
+ end
120
+
121
+ if attributes.key?(:'positivity_index')
122
+ self.positivity_index = attributes[:'positivity_index']
123
+ end
124
+
125
+ if attributes.key?(:'mention_type_counts')
126
+ self.mention_type_counts = attributes[:'mention_type_counts']
127
+ else
128
+ self.mention_type_counts = nil
129
+ end
130
+ end
131
+
132
+ # Show invalid properties with the reasons. Usually used together with valid?
133
+ # @return Array for valid properties with the reasons
134
+ def list_invalid_properties
135
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
136
+ invalid_properties = Array.new
137
+ if @competitor_id.nil?
138
+ invalid_properties.push('invalid value for "competitor_id", competitor_id cannot be nil.')
139
+ end
140
+
141
+ if @positive.nil?
142
+ invalid_properties.push('invalid value for "positive", positive cannot be nil.')
143
+ end
144
+
145
+ if @neutral.nil?
146
+ invalid_properties.push('invalid value for "neutral", neutral cannot be nil.')
147
+ end
148
+
149
+ if @negative.nil?
150
+ invalid_properties.push('invalid value for "negative", negative cannot be nil.')
151
+ end
152
+
153
+ if @mention_count.nil?
154
+ invalid_properties.push('invalid value for "mention_count", mention_count cannot be nil.')
155
+ end
156
+
157
+ if @mention_type_counts.nil?
158
+ invalid_properties.push('invalid value for "mention_type_counts", mention_type_counts cannot be nil.')
159
+ end
160
+
161
+ invalid_properties
162
+ end
163
+
164
+ # Check to see if the all the properties in the model are valid
165
+ # @return true if the model is valid
166
+ def valid?
167
+ warn '[DEPRECATED] the `valid?` method is obsolete'
168
+ return false if @competitor_id.nil?
169
+ return false if @positive.nil?
170
+ return false if @neutral.nil?
171
+ return false if @negative.nil?
172
+ return false if @mention_count.nil?
173
+ return false if @mention_type_counts.nil?
174
+ true
175
+ end
176
+
177
+ # Custom attribute writer method with validation
178
+ # @param [Object] competitor_id Value to be assigned
179
+ def competitor_id=(competitor_id)
180
+ if competitor_id.nil?
181
+ fail ArgumentError, 'competitor_id cannot be nil'
182
+ end
183
+
184
+ @competitor_id = competitor_id
185
+ end
186
+
187
+ # Custom attribute writer method with validation
188
+ # @param [Object] positive Value to be assigned
189
+ def positive=(positive)
190
+ if positive.nil?
191
+ fail ArgumentError, 'positive cannot be nil'
192
+ end
193
+
194
+ @positive = positive
195
+ end
196
+
197
+ # Custom attribute writer method with validation
198
+ # @param [Object] neutral Value to be assigned
199
+ def neutral=(neutral)
200
+ if neutral.nil?
201
+ fail ArgumentError, 'neutral cannot be nil'
202
+ end
203
+
204
+ @neutral = neutral
205
+ end
206
+
207
+ # Custom attribute writer method with validation
208
+ # @param [Object] negative Value to be assigned
209
+ def negative=(negative)
210
+ if negative.nil?
211
+ fail ArgumentError, 'negative cannot be nil'
212
+ end
213
+
214
+ @negative = negative
215
+ end
216
+
217
+ # Custom attribute writer method with validation
218
+ # @param [Object] mention_count Value to be assigned
219
+ def mention_count=(mention_count)
220
+ if mention_count.nil?
221
+ fail ArgumentError, 'mention_count cannot be nil'
222
+ end
223
+
224
+ @mention_count = mention_count
225
+ end
226
+
227
+ # Custom attribute writer method with validation
228
+ # @param [Object] mention_type_counts Value to be assigned
229
+ def mention_type_counts=(mention_type_counts)
230
+ if mention_type_counts.nil?
231
+ fail ArgumentError, 'mention_type_counts cannot be nil'
232
+ end
233
+
234
+ @mention_type_counts = mention_type_counts
235
+ end
236
+
237
+ # Checks equality by comparing each attribute.
238
+ # @param [Object] Object to be compared
239
+ def ==(o)
240
+ return true if self.equal?(o)
241
+ self.class == o.class &&
242
+ competitor_id == o.competitor_id &&
243
+ positive == o.positive &&
244
+ neutral == o.neutral &&
245
+ negative == o.negative &&
246
+ mention_count == o.mention_count &&
247
+ positivity_index == o.positivity_index &&
248
+ mention_type_counts == o.mention_type_counts
249
+ end
250
+
251
+ # @see the `==` method
252
+ # @param [Object] Object to be compared
253
+ def eql?(o)
254
+ self == o
255
+ end
256
+
257
+ # Calculates hash code according to all attributes.
258
+ # @return [Integer] Hash code
259
+ def hash
260
+ [competitor_id, positive, neutral, negative, mention_count, positivity_index, mention_type_counts].hash
261
+ end
262
+
263
+ # Builds the object from hash
264
+ # @param [Hash] attributes Model attributes in the form of hash
265
+ # @return [Object] Returns the model itself
266
+ def self.build_from_hash(attributes)
267
+ return nil unless attributes.is_a?(Hash)
268
+ attributes = attributes.transform_keys(&:to_sym)
269
+ transformed_hash = {}
270
+ openapi_types.each_pair do |key, type|
271
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
272
+ transformed_hash["#{key}"] = nil
273
+ elsif type =~ /\AArray<(.*)>/i
274
+ # check to ensure the input is an array given that the attribute
275
+ # is documented as an array but the input is not
276
+ if attributes[attribute_map[key]].is_a?(Array)
277
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
278
+ end
279
+ elsif !attributes[attribute_map[key]].nil?
280
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
281
+ end
282
+ end
283
+ new(transformed_hash)
284
+ end
285
+
286
+ # Returns the object in the form of hash
287
+ # @return [Hash] Returns the object in the form of hash
288
+ def to_hash
289
+ hash = {}
290
+ self.class.attribute_map.each_pair do |attr, param|
291
+ value = self.send(attr)
292
+ if value.nil?
293
+ is_nullable = self.class.openapi_nullable.include?(attr)
294
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
295
+ end
296
+
297
+ hash[param] = _to_hash(value)
298
+ end
299
+ hash
300
+ end
301
+
302
+ end
303
+
304
+ end
@@ -0,0 +1,278 @@
1
+ =begin
2
+ #Mencoro API
3
+
4
+ #Public API for Mencoro customers. Authenticate with an API key: `Authorization: Bearer mencoro_sk_...`. Every write operation requires an `Idempotency-Key` header: a retry carrying the same key and body within 30 days is answered from the stored result without running again; after 30 days the key is forgotten and a retry runs as a new operation.
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 'date'
14
+ require 'time'
15
+
16
+ module Mencoro
17
+ class PerEngineSentiment < ApiModelBase
18
+ attr_accessor :engine
19
+
20
+ attr_accessor :positive
21
+
22
+ attr_accessor :neutral
23
+
24
+ attr_accessor :negative
25
+
26
+ attr_accessor :mention_count
27
+
28
+ attr_accessor :positivity_index
29
+
30
+ # Attribute mapping from ruby-style variable name to JSON key.
31
+ def self.attribute_map
32
+ {
33
+ :'engine' => :'engine',
34
+ :'positive' => :'positive',
35
+ :'neutral' => :'neutral',
36
+ :'negative' => :'negative',
37
+ :'mention_count' => :'mentionCount',
38
+ :'positivity_index' => :'positivityIndex'
39
+ }
40
+ end
41
+
42
+ # Returns attribute mapping this model knows about
43
+ def self.acceptable_attribute_map
44
+ attribute_map
45
+ end
46
+
47
+ # Returns all the JSON keys this model knows about
48
+ def self.acceptable_attributes
49
+ acceptable_attribute_map.values
50
+ end
51
+
52
+ # Attribute type mapping.
53
+ def self.openapi_types
54
+ {
55
+ :'engine' => :'String',
56
+ :'positive' => :'Integer',
57
+ :'neutral' => :'Integer',
58
+ :'negative' => :'Integer',
59
+ :'mention_count' => :'Integer',
60
+ :'positivity_index' => :'Integer'
61
+ }
62
+ end
63
+
64
+ # List of attributes with nullable: true
65
+ def self.openapi_nullable
66
+ Set.new([
67
+ :'positivity_index'
68
+ ])
69
+ end
70
+
71
+ # Initializes the object
72
+ # @param [Hash] attributes Model attributes in the form of hash
73
+ def initialize(attributes = {})
74
+ if (!attributes.is_a?(Hash))
75
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Mencoro::PerEngineSentiment` initialize method"
76
+ end
77
+
78
+ # check to see if the attribute exists and convert string to symbol for hash key
79
+ acceptable_attribute_map = self.class.acceptable_attribute_map
80
+ attributes = attributes.each_with_object({}) { |(k, v), h|
81
+ if (!acceptable_attribute_map.key?(k.to_sym))
82
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Mencoro::PerEngineSentiment`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
83
+ end
84
+ h[k.to_sym] = v
85
+ }
86
+
87
+ if attributes.key?(:'engine')
88
+ self.engine = attributes[:'engine']
89
+ else
90
+ self.engine = nil
91
+ end
92
+
93
+ if attributes.key?(:'positive')
94
+ self.positive = attributes[:'positive']
95
+ else
96
+ self.positive = nil
97
+ end
98
+
99
+ if attributes.key?(:'neutral')
100
+ self.neutral = attributes[:'neutral']
101
+ else
102
+ self.neutral = nil
103
+ end
104
+
105
+ if attributes.key?(:'negative')
106
+ self.negative = attributes[:'negative']
107
+ else
108
+ self.negative = nil
109
+ end
110
+
111
+ if attributes.key?(:'mention_count')
112
+ self.mention_count = attributes[:'mention_count']
113
+ else
114
+ self.mention_count = nil
115
+ end
116
+
117
+ if attributes.key?(:'positivity_index')
118
+ self.positivity_index = attributes[:'positivity_index']
119
+ end
120
+ end
121
+
122
+ # Show invalid properties with the reasons. Usually used together with valid?
123
+ # @return Array for valid properties with the reasons
124
+ def list_invalid_properties
125
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
126
+ invalid_properties = Array.new
127
+ if @engine.nil?
128
+ invalid_properties.push('invalid value for "engine", engine cannot be nil.')
129
+ end
130
+
131
+ if @positive.nil?
132
+ invalid_properties.push('invalid value for "positive", positive cannot be nil.')
133
+ end
134
+
135
+ if @neutral.nil?
136
+ invalid_properties.push('invalid value for "neutral", neutral cannot be nil.')
137
+ end
138
+
139
+ if @negative.nil?
140
+ invalid_properties.push('invalid value for "negative", negative cannot be nil.')
141
+ end
142
+
143
+ if @mention_count.nil?
144
+ invalid_properties.push('invalid value for "mention_count", mention_count cannot be nil.')
145
+ end
146
+
147
+ invalid_properties
148
+ end
149
+
150
+ # Check to see if the all the properties in the model are valid
151
+ # @return true if the model is valid
152
+ def valid?
153
+ warn '[DEPRECATED] the `valid?` method is obsolete'
154
+ return false if @engine.nil?
155
+ return false if @positive.nil?
156
+ return false if @neutral.nil?
157
+ return false if @negative.nil?
158
+ return false if @mention_count.nil?
159
+ true
160
+ end
161
+
162
+ # Custom attribute writer method with validation
163
+ # @param [Object] engine Value to be assigned
164
+ def engine=(engine)
165
+ if engine.nil?
166
+ fail ArgumentError, 'engine cannot be nil'
167
+ end
168
+
169
+ @engine = engine
170
+ end
171
+
172
+ # Custom attribute writer method with validation
173
+ # @param [Object] positive Value to be assigned
174
+ def positive=(positive)
175
+ if positive.nil?
176
+ fail ArgumentError, 'positive cannot be nil'
177
+ end
178
+
179
+ @positive = positive
180
+ end
181
+
182
+ # Custom attribute writer method with validation
183
+ # @param [Object] neutral Value to be assigned
184
+ def neutral=(neutral)
185
+ if neutral.nil?
186
+ fail ArgumentError, 'neutral cannot be nil'
187
+ end
188
+
189
+ @neutral = neutral
190
+ end
191
+
192
+ # Custom attribute writer method with validation
193
+ # @param [Object] negative Value to be assigned
194
+ def negative=(negative)
195
+ if negative.nil?
196
+ fail ArgumentError, 'negative cannot be nil'
197
+ end
198
+
199
+ @negative = negative
200
+ end
201
+
202
+ # Custom attribute writer method with validation
203
+ # @param [Object] mention_count Value to be assigned
204
+ def mention_count=(mention_count)
205
+ if mention_count.nil?
206
+ fail ArgumentError, 'mention_count cannot be nil'
207
+ end
208
+
209
+ @mention_count = mention_count
210
+ end
211
+
212
+ # Checks equality by comparing each attribute.
213
+ # @param [Object] Object to be compared
214
+ def ==(o)
215
+ return true if self.equal?(o)
216
+ self.class == o.class &&
217
+ engine == o.engine &&
218
+ positive == o.positive &&
219
+ neutral == o.neutral &&
220
+ negative == o.negative &&
221
+ mention_count == o.mention_count &&
222
+ positivity_index == o.positivity_index
223
+ end
224
+
225
+ # @see the `==` method
226
+ # @param [Object] Object to be compared
227
+ def eql?(o)
228
+ self == o
229
+ end
230
+
231
+ # Calculates hash code according to all attributes.
232
+ # @return [Integer] Hash code
233
+ def hash
234
+ [engine, positive, neutral, negative, mention_count, positivity_index].hash
235
+ end
236
+
237
+ # Builds the object from hash
238
+ # @param [Hash] attributes Model attributes in the form of hash
239
+ # @return [Object] Returns the model itself
240
+ def self.build_from_hash(attributes)
241
+ return nil unless attributes.is_a?(Hash)
242
+ attributes = attributes.transform_keys(&:to_sym)
243
+ transformed_hash = {}
244
+ openapi_types.each_pair do |key, type|
245
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
246
+ transformed_hash["#{key}"] = nil
247
+ elsif type =~ /\AArray<(.*)>/i
248
+ # check to ensure the input is an array given that the attribute
249
+ # is documented as an array but the input is not
250
+ if attributes[attribute_map[key]].is_a?(Array)
251
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
252
+ end
253
+ elsif !attributes[attribute_map[key]].nil?
254
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
255
+ end
256
+ end
257
+ new(transformed_hash)
258
+ end
259
+
260
+ # Returns the object in the form of hash
261
+ # @return [Hash] Returns the object in the form of hash
262
+ def to_hash
263
+ hash = {}
264
+ self.class.attribute_map.each_pair do |attr, param|
265
+ value = self.send(attr)
266
+ if value.nil?
267
+ is_nullable = self.class.openapi_nullable.include?(attr)
268
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
269
+ end
270
+
271
+ hash[param] = _to_hash(value)
272
+ end
273
+ hash
274
+ end
275
+
276
+ end
277
+
278
+ end