klaviyo-api-sdk 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (506) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +17 -0
  3. data/Gemfile +9 -0
  4. data/LICENSE.md +21 -0
  5. data/README.md +1316 -0
  6. data/Rakefile +10 -0
  7. data/docs/CatalogCategoryCreateJobCreateQuery.md +18 -0
  8. data/docs/CatalogCategoryCreateJobCreateQueryAsSubResource.md +20 -0
  9. data/docs/CatalogCategoryCreateJobCreateQueryAsSubResourceAttributes.md +18 -0
  10. data/docs/CatalogCategoryCreateQuery.md +18 -0
  11. data/docs/CatalogCategoryCreateQueryAsSubResource.md +22 -0
  12. data/docs/CatalogCategoryCreateQueryAsSubResourceAttributes.md +24 -0
  13. data/docs/CatalogCategoryDeleteJobCreateQuery.md +18 -0
  14. data/docs/CatalogCategoryDeleteJobCreateQueryAsSubResource.md +20 -0
  15. data/docs/CatalogCategoryDeleteJobCreateQueryAsSubResourceAttributes.md +18 -0
  16. data/docs/CatalogCategoryDeleteQueryAsSubResource.md +20 -0
  17. data/docs/CatalogCategoryItemOp.md +18 -0
  18. data/docs/CatalogCategoryUpdateJobCreateQuery.md +18 -0
  19. data/docs/CatalogCategoryUpdateJobCreateQueryAsSubResource.md +20 -0
  20. data/docs/CatalogCategoryUpdateJobCreateQueryAsSubResourceAttributes.md +18 -0
  21. data/docs/CatalogCategoryUpdateQuery.md +18 -0
  22. data/docs/CatalogCategoryUpdateQueryAsSubResource.md +24 -0
  23. data/docs/CatalogCategoryUpdateQueryAsSubResourceAttributes.md +18 -0
  24. data/docs/CatalogItemCategoryOp.md +18 -0
  25. data/docs/CatalogItemCreateJobCreateQuery.md +18 -0
  26. data/docs/CatalogItemCreateJobCreateQueryAsSubResource.md +20 -0
  27. data/docs/CatalogItemCreateJobCreateQueryAsSubResourceAttributes.md +18 -0
  28. data/docs/CatalogItemCreateQuery.md +18 -0
  29. data/docs/CatalogItemCreateQueryAsSubResource.md +22 -0
  30. data/docs/CatalogItemCreateQueryAsSubResourceAttributes.md +38 -0
  31. data/docs/CatalogItemCreateQueryAsSubResourceRelationships.md +18 -0
  32. data/docs/CatalogItemCreateQueryAsSubResourceRelationshipsCategories.md +18 -0
  33. data/docs/CatalogItemCreateQueryAsSubResourceRelationshipsCategoriesDataInner.md +20 -0
  34. data/docs/CatalogItemDeleteJobCreateQuery.md +18 -0
  35. data/docs/CatalogItemDeleteJobCreateQueryAsSubResource.md +20 -0
  36. data/docs/CatalogItemDeleteJobCreateQueryAsSubResourceAttributes.md +18 -0
  37. data/docs/CatalogItemDeleteQueryAsSubResource.md +20 -0
  38. data/docs/CatalogItemUpdateJobCreateQuery.md +18 -0
  39. data/docs/CatalogItemUpdateJobCreateQueryAsSubResource.md +20 -0
  40. data/docs/CatalogItemUpdateJobCreateQueryAsSubResourceAttributes.md +18 -0
  41. data/docs/CatalogItemUpdateQuery.md +18 -0
  42. data/docs/CatalogItemUpdateQueryAsSubResource.md +24 -0
  43. data/docs/CatalogItemUpdateQueryAsSubResourceAttributes.md +32 -0
  44. data/docs/CatalogJobErrorPayload.md +26 -0
  45. data/docs/CatalogVariantCreateJobCreateQuery.md +18 -0
  46. data/docs/CatalogVariantCreateJobCreateQueryAsSubResource.md +20 -0
  47. data/docs/CatalogVariantCreateJobCreateQueryAsSubResourceAttributes.md +18 -0
  48. data/docs/CatalogVariantCreateQuery.md +18 -0
  49. data/docs/CatalogVariantCreateQueryAsSubResource.md +22 -0
  50. data/docs/CatalogVariantCreateQueryAsSubResourceAttributes.md +46 -0
  51. data/docs/CatalogVariantCreateQueryAsSubResourceRelationships.md +18 -0
  52. data/docs/CatalogVariantCreateQueryAsSubResourceRelationshipsItems.md +18 -0
  53. data/docs/CatalogVariantCreateQueryAsSubResourceRelationshipsItemsDataInner.md +20 -0
  54. data/docs/CatalogVariantDeleteJobCreateQuery.md +18 -0
  55. data/docs/CatalogVariantDeleteJobCreateQueryAsSubResource.md +20 -0
  56. data/docs/CatalogVariantDeleteJobCreateQueryAsSubResourceAttributes.md +18 -0
  57. data/docs/CatalogVariantDeleteQueryAsSubResource.md +20 -0
  58. data/docs/CatalogVariantUpdateJobCreateQuery.md +18 -0
  59. data/docs/CatalogVariantUpdateJobCreateQueryAsSubResource.md +20 -0
  60. data/docs/CatalogVariantUpdateJobCreateQueryAsSubResourceAttributes.md +18 -0
  61. data/docs/CatalogVariantUpdateQuery.md +18 -0
  62. data/docs/CatalogVariantUpdateQueryAsSubResource.md +22 -0
  63. data/docs/CatalogVariantUpdateQueryAsSubResourceAttributes.md +38 -0
  64. data/docs/CatalogsApi.md +4048 -0
  65. data/docs/ClientApi.md +205 -0
  66. data/docs/EmailMessageContent.md +24 -0
  67. data/docs/EmailTrackingOptions.md +24 -0
  68. data/docs/ErrorSource.md +18 -0
  69. data/docs/EventCreateQuery.md +18 -0
  70. data/docs/EventCreateQueryAsSubResource.md +20 -0
  71. data/docs/EventCreateQueryAsSubResourceAttributes.md +28 -0
  72. data/docs/EventsApi.md +472 -0
  73. data/docs/FlowUpdateQuery.md +18 -0
  74. data/docs/FlowUpdateQueryAsSubResource.md +22 -0
  75. data/docs/FlowUpdateQueryAsSubResourceAttributes.md +18 -0
  76. data/docs/FlowsApi.md +951 -0
  77. data/docs/GetCatalogItems4XXResponse.md +18 -0
  78. data/docs/GetCatalogItems4XXResponseErrorsInner.md +26 -0
  79. data/docs/GetCatalogItems4XXResponseErrorsInnerSource.md +20 -0
  80. data/docs/IncludedCategories.md +24 -0
  81. data/docs/IncludedCategoriesAttributes.md +22 -0
  82. data/docs/IncludedFlowAction.md +24 -0
  83. data/docs/IncludedFlowActions.md +24 -0
  84. data/docs/IncludedFlowActionsAttributes.md +32 -0
  85. data/docs/IncludedFlowActionsAttributesTrackingOptions.md +49 -0
  86. data/docs/IncludedFlowMessages.md +24 -0
  87. data/docs/IncludedFlowMessagesAttributes.md +26 -0
  88. data/docs/IncludedFlowMessagesAttributesContent.md +49 -0
  89. data/docs/IncludedFlows.md +24 -0
  90. data/docs/IncludedFlowsAttributes.md +28 -0
  91. data/docs/IncludedItems.md +24 -0
  92. data/docs/IncludedItemsAttributes.md +38 -0
  93. data/docs/IncludedLists.md +24 -0
  94. data/docs/IncludedListsAttributes.md +22 -0
  95. data/docs/IncludedMetrics.md +24 -0
  96. data/docs/IncludedMetricsAttributes.md +24 -0
  97. data/docs/IncludedProfile.md +24 -0
  98. data/docs/IncludedProfiles.md +24 -0
  99. data/docs/IncludedProfilesAttributes.md +44 -0
  100. data/docs/IncludedSegments.md +24 -0
  101. data/docs/IncludedVariants.md +24 -0
  102. data/docs/IncludedVariantsAttributes.md +46 -0
  103. data/docs/IncludedVariantsLinks.md +18 -0
  104. data/docs/ListCreateQuery.md +18 -0
  105. data/docs/ListCreateQueryAsSubResource.md +20 -0
  106. data/docs/ListCreateQueryAsSubResourceAttributes.md +18 -0
  107. data/docs/ListDeleteQueryAsSubResource.md +20 -0
  108. data/docs/ListMembersAddQuery.md +18 -0
  109. data/docs/ListMembersAddQueryDataInner.md +20 -0
  110. data/docs/ListMembersDeleteQuery.md +18 -0
  111. data/docs/ListPartialUpdateQuery.md +18 -0
  112. data/docs/ListPartialUpdateQueryAsSubResource.md +22 -0
  113. data/docs/ListsApi.md +686 -0
  114. data/docs/MetricAggregateQuery.md +18 -0
  115. data/docs/MetricAggregateQueryAsSubResource.md +20 -0
  116. data/docs/MetricAggregateQueryAsSubResourceAttributes.md +36 -0
  117. data/docs/MetricAggregateRowDTO.md +20 -0
  118. data/docs/MetricCreateQuery.md +20 -0
  119. data/docs/MetricsApi.md +233 -0
  120. data/docs/OnsiteProfileCreateQuery.md +18 -0
  121. data/docs/OnsiteProfileCreateQueryAsSubResource.md +22 -0
  122. data/docs/OnsiteProfileMeta.md +18 -0
  123. data/docs/OnsiteProfileMetaIdentifiers.md +28 -0
  124. data/docs/OnsiteSubscriptionCreateQuery.md +18 -0
  125. data/docs/OnsiteSubscriptionCreateQueryAsSubResource.md +20 -0
  126. data/docs/OnsiteSubscriptionCreateQueryAsSubResourceAttributes.md +26 -0
  127. data/docs/ProfileCreateQuery.md +18 -0
  128. data/docs/ProfileCreateQueryAsSubResource.md +20 -0
  129. data/docs/ProfileCreateQueryAsSubResourceAttributes.md +38 -0
  130. data/docs/ProfileLocation.md +34 -0
  131. data/docs/ProfileLocationLatitude.md +49 -0
  132. data/docs/ProfilePartialUpdateQuery.md +18 -0
  133. data/docs/ProfilePartialUpdateQueryAsSubResource.md +22 -0
  134. data/docs/ProfilesApi.md +825 -0
  135. data/docs/SMSMessageContent.md +20 -0
  136. data/docs/SMSRenderOptions.md +24 -0
  137. data/docs/SMSTrackingOptions.md +20 -0
  138. data/docs/SegmentPartialUpdateQuery.md +18 -0
  139. data/docs/SegmentPartialUpdateQueryAsSubResource.md +22 -0
  140. data/docs/SegmentsApi.md +390 -0
  141. data/docs/SendOptions.md +20 -0
  142. data/docs/Subscription.md +20 -0
  143. data/docs/SubscriptionCreateJobCreateQuery.md +18 -0
  144. data/docs/SubscriptionCreateJobCreateQueryAsSubResource.md +20 -0
  145. data/docs/SubscriptionCreateJobCreateQueryAsSubResourceAttributes.md +22 -0
  146. data/docs/Suppression.md +18 -0
  147. data/docs/SuppressionCreateJobCreateQuery.md +18 -0
  148. data/docs/SuppressionCreateJobCreateQueryAsSubResource.md +20 -0
  149. data/docs/SuppressionCreateJobCreateQueryAsSubResourceAttributes.md +18 -0
  150. data/docs/TemplateCloneQuery.md +18 -0
  151. data/docs/TemplateCloneQueryAsSubResource.md +20 -0
  152. data/docs/TemplateCloneQueryAsSubResourceAttributes.md +20 -0
  153. data/docs/TemplateCreateQuery.md +18 -0
  154. data/docs/TemplateCreateQueryAsSubResource.md +20 -0
  155. data/docs/TemplateCreateQueryAsSubResourceAttributes.md +26 -0
  156. data/docs/TemplateDeleteQueryAsSubResource.md +20 -0
  157. data/docs/TemplateUpdateQuery.md +18 -0
  158. data/docs/TemplateUpdateQueryAsSubResource.md +22 -0
  159. data/docs/TemplateUpdateQueryAsSubResourceAttributes.md +24 -0
  160. data/docs/TemplatesApi.md +529 -0
  161. data/docs/UnsubscriptionCreateJobCreateQuery.md +18 -0
  162. data/docs/UnsubscriptionCreateJobCreateQueryAsSubResource.md +20 -0
  163. data/docs/UnsubscriptionCreateJobCreateQueryAsSubResourceAttributes.md +22 -0
  164. data/docs/UnsuppressionCreateJobCreateQuery.md +18 -0
  165. data/docs/UnsuppressionCreateJobCreateQueryAsSubResource.md +20 -0
  166. data/docs/UtmParamInfo.md +20 -0
  167. data/docs/V2TemplateRenderQuery.md +18 -0
  168. data/docs/V2TemplateRenderQueryAsSubResource.md +20 -0
  169. data/docs/V2TemplateRenderQueryAsSubResourceAttributes.md +20 -0
  170. data/git_push.sh +57 -0
  171. data/klaviyo-api-sdk.gemspec +40 -0
  172. data/lib/klaviyo-api-sdk/api/catalogs_api.rb +4095 -0
  173. data/lib/klaviyo-api-sdk/api/client_api.rb +249 -0
  174. data/lib/klaviyo-api-sdk/api/events_api.rb +505 -0
  175. data/lib/klaviyo-api-sdk/api/flows_api.rb +1009 -0
  176. data/lib/klaviyo-api-sdk/api/lists_api.rb +708 -0
  177. data/lib/klaviyo-api-sdk/api/metrics_api.rb +236 -0
  178. data/lib/klaviyo-api-sdk/api/profiles_api.rb +840 -0
  179. data/lib/klaviyo-api-sdk/api/segments_api.rb +392 -0
  180. data/lib/klaviyo-api-sdk/api/templates_api.rb +536 -0
  181. data/lib/klaviyo-api-sdk/api_client.rb +390 -0
  182. data/lib/klaviyo-api-sdk/api_error.rb +57 -0
  183. data/lib/klaviyo-api-sdk/configuration.rb +283 -0
  184. data/lib/klaviyo-api-sdk/models/catalog_category_create_job_create_query.rb +224 -0
  185. data/lib/klaviyo-api-sdk/models/catalog_category_create_job_create_query_as_sub_resource.rb +272 -0
  186. data/lib/klaviyo-api-sdk/models/catalog_category_create_job_create_query_as_sub_resource_attributes.rb +226 -0
  187. data/lib/klaviyo-api-sdk/models/catalog_category_create_query.rb +224 -0
  188. data/lib/klaviyo-api-sdk/models/catalog_category_create_query_as_sub_resource.rb +281 -0
  189. data/lib/klaviyo-api-sdk/models/catalog_category_create_query_as_sub_resource_attributes.rb +291 -0
  190. data/lib/klaviyo-api-sdk/models/catalog_category_delete_job_create_query.rb +224 -0
  191. data/lib/klaviyo-api-sdk/models/catalog_category_delete_job_create_query_as_sub_resource.rb +272 -0
  192. data/lib/klaviyo-api-sdk/models/catalog_category_delete_job_create_query_as_sub_resource_attributes.rb +226 -0
  193. data/lib/klaviyo-api-sdk/models/catalog_category_delete_query_as_sub_resource.rb +272 -0
  194. data/lib/klaviyo-api-sdk/models/catalog_category_item_op.rb +226 -0
  195. data/lib/klaviyo-api-sdk/models/catalog_category_update_job_create_query.rb +224 -0
  196. data/lib/klaviyo-api-sdk/models/catalog_category_update_job_create_query_as_sub_resource.rb +272 -0
  197. data/lib/klaviyo-api-sdk/models/catalog_category_update_job_create_query_as_sub_resource_attributes.rb +226 -0
  198. data/lib/klaviyo-api-sdk/models/catalog_category_update_query.rb +224 -0
  199. data/lib/klaviyo-api-sdk/models/catalog_category_update_query_as_sub_resource.rb +295 -0
  200. data/lib/klaviyo-api-sdk/models/catalog_category_update_query_as_sub_resource_attributes.rb +219 -0
  201. data/lib/klaviyo-api-sdk/models/catalog_item_category_op.rb +226 -0
  202. data/lib/klaviyo-api-sdk/models/catalog_item_create_job_create_query.rb +224 -0
  203. data/lib/klaviyo-api-sdk/models/catalog_item_create_job_create_query_as_sub_resource.rb +272 -0
  204. data/lib/klaviyo-api-sdk/models/catalog_item_create_job_create_query_as_sub_resource_attributes.rb +226 -0
  205. data/lib/klaviyo-api-sdk/models/catalog_item_create_query.rb +224 -0
  206. data/lib/klaviyo-api-sdk/models/catalog_item_create_query_as_sub_resource.rb +281 -0
  207. data/lib/klaviyo-api-sdk/models/catalog_item_create_query_as_sub_resource_attributes.rb +366 -0
  208. data/lib/klaviyo-api-sdk/models/catalog_item_create_query_as_sub_resource_relationships.rb +219 -0
  209. data/lib/klaviyo-api-sdk/models/catalog_item_create_query_as_sub_resource_relationships_categories.rb +226 -0
  210. data/lib/klaviyo-api-sdk/models/catalog_item_create_query_as_sub_resource_relationships_categories_data_inner.rb +272 -0
  211. data/lib/klaviyo-api-sdk/models/catalog_item_delete_job_create_query.rb +224 -0
  212. data/lib/klaviyo-api-sdk/models/catalog_item_delete_job_create_query_as_sub_resource.rb +272 -0
  213. data/lib/klaviyo-api-sdk/models/catalog_item_delete_job_create_query_as_sub_resource_attributes.rb +226 -0
  214. data/lib/klaviyo-api-sdk/models/catalog_item_delete_query_as_sub_resource.rb +272 -0
  215. data/lib/klaviyo-api-sdk/models/catalog_item_update_job_create_query.rb +224 -0
  216. data/lib/klaviyo-api-sdk/models/catalog_item_update_job_create_query_as_sub_resource.rb +272 -0
  217. data/lib/klaviyo-api-sdk/models/catalog_item_update_job_create_query_as_sub_resource_attributes.rb +226 -0
  218. data/lib/klaviyo-api-sdk/models/catalog_item_update_query.rb +224 -0
  219. data/lib/klaviyo-api-sdk/models/catalog_item_update_query_as_sub_resource.rb +295 -0
  220. data/lib/klaviyo-api-sdk/models/catalog_item_update_query_as_sub_resource_attributes.rb +284 -0
  221. data/lib/klaviyo-api-sdk/models/catalog_job_error_payload.rb +280 -0
  222. data/lib/klaviyo-api-sdk/models/catalog_variant_create_job_create_query.rb +224 -0
  223. data/lib/klaviyo-api-sdk/models/catalog_variant_create_job_create_query_as_sub_resource.rb +272 -0
  224. data/lib/klaviyo-api-sdk/models/catalog_variant_create_job_create_query_as_sub_resource_attributes.rb +226 -0
  225. data/lib/klaviyo-api-sdk/models/catalog_variant_create_query.rb +224 -0
  226. data/lib/klaviyo-api-sdk/models/catalog_variant_create_query_as_sub_resource.rb +281 -0
  227. data/lib/klaviyo-api-sdk/models/catalog_variant_create_query_as_sub_resource_attributes.rb +435 -0
  228. data/lib/klaviyo-api-sdk/models/catalog_variant_create_query_as_sub_resource_relationships.rb +219 -0
  229. data/lib/klaviyo-api-sdk/models/catalog_variant_create_query_as_sub_resource_relationships_items.rb +226 -0
  230. data/lib/klaviyo-api-sdk/models/catalog_variant_create_query_as_sub_resource_relationships_items_data_inner.rb +272 -0
  231. data/lib/klaviyo-api-sdk/models/catalog_variant_delete_job_create_query.rb +224 -0
  232. data/lib/klaviyo-api-sdk/models/catalog_variant_delete_job_create_query_as_sub_resource.rb +272 -0
  233. data/lib/klaviyo-api-sdk/models/catalog_variant_delete_job_create_query_as_sub_resource_attributes.rb +226 -0
  234. data/lib/klaviyo-api-sdk/models/catalog_variant_delete_query_as_sub_resource.rb +272 -0
  235. data/lib/klaviyo-api-sdk/models/catalog_variant_update_job_create_query.rb +224 -0
  236. data/lib/klaviyo-api-sdk/models/catalog_variant_update_job_create_query_as_sub_resource.rb +272 -0
  237. data/lib/klaviyo-api-sdk/models/catalog_variant_update_job_create_query_as_sub_resource_attributes.rb +226 -0
  238. data/lib/klaviyo-api-sdk/models/catalog_variant_update_query.rb +224 -0
  239. data/lib/klaviyo-api-sdk/models/catalog_variant_update_query_as_sub_resource.rb +286 -0
  240. data/lib/klaviyo-api-sdk/models/catalog_variant_update_query_as_sub_resource_attributes.rb +346 -0
  241. data/lib/klaviyo-api-sdk/models/email_message_content.rb +266 -0
  242. data/lib/klaviyo-api-sdk/models/email_tracking_options.rb +268 -0
  243. data/lib/klaviyo-api-sdk/models/error_source.rb +224 -0
  244. data/lib/klaviyo-api-sdk/models/event_create_query.rb +224 -0
  245. data/lib/klaviyo-api-sdk/models/event_create_query_as_sub_resource.rb +272 -0
  246. data/lib/klaviyo-api-sdk/models/event_create_query_as_sub_resource_attributes.rb +279 -0
  247. data/lib/klaviyo-api-sdk/models/flow_update_query.rb +224 -0
  248. data/lib/klaviyo-api-sdk/models/flow_update_query_as_sub_resource.rb +286 -0
  249. data/lib/klaviyo-api-sdk/models/flow_update_query_as_sub_resource_attributes.rb +224 -0
  250. data/lib/klaviyo-api-sdk/models/get_catalog_items4_xx_response.rb +226 -0
  251. data/lib/klaviyo-api-sdk/models/get_catalog_items4_xx_response_errors_inner.rb +275 -0
  252. data/lib/klaviyo-api-sdk/models/get_catalog_items4_xx_response_errors_inner_source.rb +228 -0
  253. data/lib/klaviyo-api-sdk/models/included_categories.rb +300 -0
  254. data/lib/klaviyo-api-sdk/models/included_categories_attributes.rb +237 -0
  255. data/lib/klaviyo-api-sdk/models/included_flow_action.rb +300 -0
  256. data/lib/klaviyo-api-sdk/models/included_flow_actions.rb +300 -0
  257. data/lib/klaviyo-api-sdk/models/included_flow_actions_attributes.rb +282 -0
  258. data/lib/klaviyo-api-sdk/models/included_flow_actions_attributes_tracking_options.rb +105 -0
  259. data/lib/klaviyo-api-sdk/models/included_flow_messages.rb +300 -0
  260. data/lib/klaviyo-api-sdk/models/included_flow_messages_attributes.rb +270 -0
  261. data/lib/klaviyo-api-sdk/models/included_flow_messages_attributes_content.rb +105 -0
  262. data/lib/klaviyo-api-sdk/models/included_flows.rb +300 -0
  263. data/lib/klaviyo-api-sdk/models/included_flows_attributes.rb +264 -0
  264. data/lib/klaviyo-api-sdk/models/included_items.rb +300 -0
  265. data/lib/klaviyo-api-sdk/models/included_items_attributes.rb +311 -0
  266. data/lib/klaviyo-api-sdk/models/included_lists.rb +300 -0
  267. data/lib/klaviyo-api-sdk/models/included_lists_attributes.rb +237 -0
  268. data/lib/klaviyo-api-sdk/models/included_metrics.rb +300 -0
  269. data/lib/klaviyo-api-sdk/models/included_metrics_attributes.rb +246 -0
  270. data/lib/klaviyo-api-sdk/models/included_profile.rb +300 -0
  271. data/lib/klaviyo-api-sdk/models/included_profiles.rb +300 -0
  272. data/lib/klaviyo-api-sdk/models/included_profiles_attributes.rb +336 -0
  273. data/lib/klaviyo-api-sdk/models/included_segments.rb +300 -0
  274. data/lib/klaviyo-api-sdk/models/included_variants.rb +300 -0
  275. data/lib/klaviyo-api-sdk/models/included_variants_attributes.rb +382 -0
  276. data/lib/klaviyo-api-sdk/models/included_variants_links.rb +224 -0
  277. data/lib/klaviyo-api-sdk/models/list_create_query.rb +224 -0
  278. data/lib/klaviyo-api-sdk/models/list_create_query_as_sub_resource.rb +272 -0
  279. data/lib/klaviyo-api-sdk/models/list_create_query_as_sub_resource_attributes.rb +224 -0
  280. data/lib/klaviyo-api-sdk/models/list_delete_query_as_sub_resource.rb +272 -0
  281. data/lib/klaviyo-api-sdk/models/list_members_add_query.rb +226 -0
  282. data/lib/klaviyo-api-sdk/models/list_members_add_query_data_inner.rb +272 -0
  283. data/lib/klaviyo-api-sdk/models/list_members_delete_query.rb +226 -0
  284. data/lib/klaviyo-api-sdk/models/list_partial_update_query.rb +224 -0
  285. data/lib/klaviyo-api-sdk/models/list_partial_update_query_as_sub_resource.rb +286 -0
  286. data/lib/klaviyo-api-sdk/models/metric_aggregate_query.rb +224 -0
  287. data/lib/klaviyo-api-sdk/models/metric_aggregate_query_as_sub_resource.rb +272 -0
  288. data/lib/klaviyo-api-sdk/models/metric_aggregate_query_as_sub_resource_attributes.rb +380 -0
  289. data/lib/klaviyo-api-sdk/models/metric_aggregate_row_dto.rb +240 -0
  290. data/lib/klaviyo-api-sdk/models/metric_create_query.rb +233 -0
  291. data/lib/klaviyo-api-sdk/models/onsite_profile_create_query.rb +224 -0
  292. data/lib/klaviyo-api-sdk/models/onsite_profile_create_query_as_sub_resource.rb +281 -0
  293. data/lib/klaviyo-api-sdk/models/onsite_profile_meta.rb +224 -0
  294. data/lib/klaviyo-api-sdk/models/onsite_profile_meta_identifiers.rb +264 -0
  295. data/lib/klaviyo-api-sdk/models/onsite_subscription_create_query.rb +224 -0
  296. data/lib/klaviyo-api-sdk/models/onsite_subscription_create_query_as_sub_resource.rb +272 -0
  297. data/lib/klaviyo-api-sdk/models/onsite_subscription_create_query_as_sub_resource_attributes.rb +260 -0
  298. data/lib/klaviyo-api-sdk/models/profile_create_query.rb +224 -0
  299. data/lib/klaviyo-api-sdk/models/profile_create_query_as_sub_resource.rb +272 -0
  300. data/lib/klaviyo-api-sdk/models/profile_create_query_as_sub_resource_attributes.rb +309 -0
  301. data/lib/klaviyo-api-sdk/models/profile_location.rb +291 -0
  302. data/lib/klaviyo-api-sdk/models/profile_location_latitude.rb +105 -0
  303. data/lib/klaviyo-api-sdk/models/profile_partial_update_query.rb +224 -0
  304. data/lib/klaviyo-api-sdk/models/profile_partial_update_query_as_sub_resource.rb +286 -0
  305. data/lib/klaviyo-api-sdk/models/segment_partial_update_query.rb +224 -0
  306. data/lib/klaviyo-api-sdk/models/segment_partial_update_query_as_sub_resource.rb +286 -0
  307. data/lib/klaviyo-api-sdk/models/send_options.rb +238 -0
  308. data/lib/klaviyo-api-sdk/models/sms_message_content.rb +238 -0
  309. data/lib/klaviyo-api-sdk/models/sms_render_options.rb +266 -0
  310. data/lib/klaviyo-api-sdk/models/sms_tracking_options.rb +240 -0
  311. data/lib/klaviyo-api-sdk/models/subscription.rb +228 -0
  312. data/lib/klaviyo-api-sdk/models/subscription_create_job_create_query.rb +224 -0
  313. data/lib/klaviyo-api-sdk/models/subscription_create_job_create_query_as_sub_resource.rb +272 -0
  314. data/lib/klaviyo-api-sdk/models/subscription_create_job_create_query_as_sub_resource_attributes.rb +249 -0
  315. data/lib/klaviyo-api-sdk/models/suppression.rb +224 -0
  316. data/lib/klaviyo-api-sdk/models/suppression_create_job_create_query.rb +224 -0
  317. data/lib/klaviyo-api-sdk/models/suppression_create_job_create_query_as_sub_resource.rb +272 -0
  318. data/lib/klaviyo-api-sdk/models/suppression_create_job_create_query_as_sub_resource_attributes.rb +226 -0
  319. data/lib/klaviyo-api-sdk/models/template_clone_query.rb +224 -0
  320. data/lib/klaviyo-api-sdk/models/template_clone_query_as_sub_resource.rb +272 -0
  321. data/lib/klaviyo-api-sdk/models/template_clone_query_as_sub_resource_attributes.rb +230 -0
  322. data/lib/klaviyo-api-sdk/models/template_create_query.rb +224 -0
  323. data/lib/klaviyo-api-sdk/models/template_create_query_as_sub_resource.rb +272 -0
  324. data/lib/klaviyo-api-sdk/models/template_create_query_as_sub_resource_attributes.rb +267 -0
  325. data/lib/klaviyo-api-sdk/models/template_delete_query_as_sub_resource.rb +272 -0
  326. data/lib/klaviyo-api-sdk/models/template_update_query.rb +224 -0
  327. data/lib/klaviyo-api-sdk/models/template_update_query_as_sub_resource.rb +286 -0
  328. data/lib/klaviyo-api-sdk/models/template_update_query_as_sub_resource_attributes.rb +248 -0
  329. data/lib/klaviyo-api-sdk/models/unsubscription_create_job_create_query.rb +224 -0
  330. data/lib/klaviyo-api-sdk/models/unsubscription_create_job_create_query_as_sub_resource.rb +272 -0
  331. data/lib/klaviyo-api-sdk/models/unsubscription_create_job_create_query_as_sub_resource_attributes.rb +246 -0
  332. data/lib/klaviyo-api-sdk/models/unsuppression_create_job_create_query.rb +224 -0
  333. data/lib/klaviyo-api-sdk/models/unsuppression_create_job_create_query_as_sub_resource.rb +272 -0
  334. data/lib/klaviyo-api-sdk/models/utm_param_info.rb +238 -0
  335. data/lib/klaviyo-api-sdk/models/v2_template_render_query.rb +224 -0
  336. data/lib/klaviyo-api-sdk/models/v2_template_render_query_as_sub_resource.rb +272 -0
  337. data/lib/klaviyo-api-sdk/models/v2_template_render_query_as_sub_resource_attributes.rb +235 -0
  338. data/lib/klaviyo-api-sdk/version.rb +15 -0
  339. data/lib/klaviyo-api-sdk.rb +253 -0
  340. data/spec/api/catalogs_api_spec.rb +759 -0
  341. data/spec/api/client_api_spec.rb +74 -0
  342. data/spec/api/events_api_spec.rb +120 -0
  343. data/spec/api/flows_api_spec.rb +209 -0
  344. data/spec/api/lists_api_spec.rb +156 -0
  345. data/spec/api/metrics_api_spec.rb +74 -0
  346. data/spec/api/profiles_api_spec.rb +178 -0
  347. data/spec/api/segments_api_spec.rb +103 -0
  348. data/spec/api/templates_api_spec.rb +126 -0
  349. data/spec/api_client_spec.rb +226 -0
  350. data/spec/configuration_spec.rb +42 -0
  351. data/spec/models/catalog_category_create_job_create_query_as_sub_resource_attributes_spec.rb +34 -0
  352. data/spec/models/catalog_category_create_job_create_query_as_sub_resource_spec.rb +44 -0
  353. data/spec/models/catalog_category_create_job_create_query_spec.rb +34 -0
  354. data/spec/models/catalog_category_create_query_as_sub_resource_attributes_spec.rb +56 -0
  355. data/spec/models/catalog_category_create_query_as_sub_resource_spec.rb +50 -0
  356. data/spec/models/catalog_category_create_query_spec.rb +34 -0
  357. data/spec/models/catalog_category_delete_job_create_query_as_sub_resource_attributes_spec.rb +34 -0
  358. data/spec/models/catalog_category_delete_job_create_query_as_sub_resource_spec.rb +44 -0
  359. data/spec/models/catalog_category_delete_job_create_query_spec.rb +34 -0
  360. data/spec/models/catalog_category_delete_query_as_sub_resource_spec.rb +44 -0
  361. data/spec/models/catalog_category_item_op_spec.rb +34 -0
  362. data/spec/models/catalog_category_update_job_create_query_as_sub_resource_attributes_spec.rb +34 -0
  363. data/spec/models/catalog_category_update_job_create_query_as_sub_resource_spec.rb +44 -0
  364. data/spec/models/catalog_category_update_job_create_query_spec.rb +34 -0
  365. data/spec/models/catalog_category_update_query_as_sub_resource_attributes_spec.rb +34 -0
  366. data/spec/models/catalog_category_update_query_as_sub_resource_spec.rb +56 -0
  367. data/spec/models/catalog_category_update_query_spec.rb +34 -0
  368. data/spec/models/catalog_item_category_op_spec.rb +34 -0
  369. data/spec/models/catalog_item_create_job_create_query_as_sub_resource_attributes_spec.rb +34 -0
  370. data/spec/models/catalog_item_create_job_create_query_as_sub_resource_spec.rb +44 -0
  371. data/spec/models/catalog_item_create_job_create_query_spec.rb +34 -0
  372. data/spec/models/catalog_item_create_query_as_sub_resource_attributes_spec.rb +98 -0
  373. data/spec/models/catalog_item_create_query_as_sub_resource_relationships_categories_data_inner_spec.rb +44 -0
  374. data/spec/models/catalog_item_create_query_as_sub_resource_relationships_categories_spec.rb +34 -0
  375. data/spec/models/catalog_item_create_query_as_sub_resource_relationships_spec.rb +34 -0
  376. data/spec/models/catalog_item_create_query_as_sub_resource_spec.rb +50 -0
  377. data/spec/models/catalog_item_create_query_spec.rb +34 -0
  378. data/spec/models/catalog_item_delete_job_create_query_as_sub_resource_attributes_spec.rb +34 -0
  379. data/spec/models/catalog_item_delete_job_create_query_as_sub_resource_spec.rb +44 -0
  380. data/spec/models/catalog_item_delete_job_create_query_spec.rb +34 -0
  381. data/spec/models/catalog_item_delete_query_as_sub_resource_spec.rb +44 -0
  382. data/spec/models/catalog_item_update_job_create_query_as_sub_resource_attributes_spec.rb +34 -0
  383. data/spec/models/catalog_item_update_job_create_query_as_sub_resource_spec.rb +44 -0
  384. data/spec/models/catalog_item_update_job_create_query_spec.rb +34 -0
  385. data/spec/models/catalog_item_update_query_as_sub_resource_attributes_spec.rb +76 -0
  386. data/spec/models/catalog_item_update_query_as_sub_resource_spec.rb +56 -0
  387. data/spec/models/catalog_item_update_query_spec.rb +34 -0
  388. data/spec/models/catalog_job_error_payload_spec.rb +58 -0
  389. data/spec/models/catalog_variant_create_job_create_query_as_sub_resource_attributes_spec.rb +34 -0
  390. data/spec/models/catalog_variant_create_job_create_query_as_sub_resource_spec.rb +44 -0
  391. data/spec/models/catalog_variant_create_job_create_query_spec.rb +34 -0
  392. data/spec/models/catalog_variant_create_query_as_sub_resource_attributes_spec.rb +126 -0
  393. data/spec/models/catalog_variant_create_query_as_sub_resource_relationships_items_data_inner_spec.rb +44 -0
  394. data/spec/models/catalog_variant_create_query_as_sub_resource_relationships_items_spec.rb +34 -0
  395. data/spec/models/catalog_variant_create_query_as_sub_resource_relationships_spec.rb +34 -0
  396. data/spec/models/catalog_variant_create_query_as_sub_resource_spec.rb +50 -0
  397. data/spec/models/catalog_variant_create_query_spec.rb +34 -0
  398. data/spec/models/catalog_variant_delete_job_create_query_as_sub_resource_attributes_spec.rb +34 -0
  399. data/spec/models/catalog_variant_delete_job_create_query_as_sub_resource_spec.rb +44 -0
  400. data/spec/models/catalog_variant_delete_job_create_query_spec.rb +34 -0
  401. data/spec/models/catalog_variant_delete_query_as_sub_resource_spec.rb +44 -0
  402. data/spec/models/catalog_variant_update_job_create_query_as_sub_resource_attributes_spec.rb +34 -0
  403. data/spec/models/catalog_variant_update_job_create_query_as_sub_resource_spec.rb +44 -0
  404. data/spec/models/catalog_variant_update_job_create_query_spec.rb +34 -0
  405. data/spec/models/catalog_variant_update_query_as_sub_resource_attributes_spec.rb +98 -0
  406. data/spec/models/catalog_variant_update_query_as_sub_resource_spec.rb +50 -0
  407. data/spec/models/catalog_variant_update_query_spec.rb +34 -0
  408. data/spec/models/email_message_content_spec.rb +52 -0
  409. data/spec/models/email_tracking_options_spec.rb +52 -0
  410. data/spec/models/error_source_spec.rb +34 -0
  411. data/spec/models/event_create_query_as_sub_resource_attributes_spec.rb +64 -0
  412. data/spec/models/event_create_query_as_sub_resource_spec.rb +44 -0
  413. data/spec/models/event_create_query_spec.rb +34 -0
  414. data/spec/models/flow_update_query_as_sub_resource_attributes_spec.rb +34 -0
  415. data/spec/models/flow_update_query_as_sub_resource_spec.rb +50 -0
  416. data/spec/models/flow_update_query_spec.rb +34 -0
  417. data/spec/models/get_catalog_items4_xx_response_errors_inner_source_spec.rb +40 -0
  418. data/spec/models/get_catalog_items4_xx_response_errors_inner_spec.rb +58 -0
  419. data/spec/models/get_catalog_items4_xx_response_spec.rb +34 -0
  420. data/spec/models/included_categories_attributes_spec.rb +46 -0
  421. data/spec/models/included_categories_spec.rb +56 -0
  422. data/spec/models/included_flow_action_spec.rb +56 -0
  423. data/spec/models/included_flow_actions_attributes_spec.rb +76 -0
  424. data/spec/models/included_flow_actions_attributes_tracking_options_spec.rb +31 -0
  425. data/spec/models/included_flow_actions_spec.rb +56 -0
  426. data/spec/models/included_flow_messages_attributes_content_spec.rb +31 -0
  427. data/spec/models/included_flow_messages_attributes_spec.rb +58 -0
  428. data/spec/models/included_flow_messages_spec.rb +56 -0
  429. data/spec/models/included_flows_attributes_spec.rb +64 -0
  430. data/spec/models/included_flows_spec.rb +56 -0
  431. data/spec/models/included_items_attributes_spec.rb +94 -0
  432. data/spec/models/included_items_spec.rb +56 -0
  433. data/spec/models/included_lists_attributes_spec.rb +46 -0
  434. data/spec/models/included_lists_spec.rb +56 -0
  435. data/spec/models/included_metrics_attributes_spec.rb +52 -0
  436. data/spec/models/included_metrics_spec.rb +56 -0
  437. data/spec/models/included_profile_spec.rb +56 -0
  438. data/spec/models/included_profiles_attributes_spec.rb +112 -0
  439. data/spec/models/included_profiles_spec.rb +56 -0
  440. data/spec/models/included_segments_spec.rb +56 -0
  441. data/spec/models/included_variants_attributes_spec.rb +122 -0
  442. data/spec/models/included_variants_links_spec.rb +34 -0
  443. data/spec/models/included_variants_spec.rb +56 -0
  444. data/spec/models/list_create_query_as_sub_resource_attributes_spec.rb +34 -0
  445. data/spec/models/list_create_query_as_sub_resource_spec.rb +44 -0
  446. data/spec/models/list_create_query_spec.rb +34 -0
  447. data/spec/models/list_delete_query_as_sub_resource_spec.rb +44 -0
  448. data/spec/models/list_members_add_query_data_inner_spec.rb +44 -0
  449. data/spec/models/list_members_add_query_spec.rb +34 -0
  450. data/spec/models/list_members_delete_query_spec.rb +34 -0
  451. data/spec/models/list_partial_update_query_as_sub_resource_spec.rb +50 -0
  452. data/spec/models/list_partial_update_query_spec.rb +34 -0
  453. data/spec/models/metric_aggregate_query_as_sub_resource_attributes_spec.rb +104 -0
  454. data/spec/models/metric_aggregate_query_as_sub_resource_spec.rb +44 -0
  455. data/spec/models/metric_aggregate_query_spec.rb +34 -0
  456. data/spec/models/metric_aggregate_row_dto_spec.rb +40 -0
  457. data/spec/models/metric_create_query_spec.rb +40 -0
  458. data/spec/models/onsite_profile_create_query_as_sub_resource_spec.rb +50 -0
  459. data/spec/models/onsite_profile_create_query_spec.rb +34 -0
  460. data/spec/models/onsite_profile_meta_identifiers_spec.rb +64 -0
  461. data/spec/models/onsite_profile_meta_spec.rb +34 -0
  462. data/spec/models/onsite_subscription_create_query_as_sub_resource_attributes_spec.rb +58 -0
  463. data/spec/models/onsite_subscription_create_query_as_sub_resource_spec.rb +44 -0
  464. data/spec/models/onsite_subscription_create_query_spec.rb +34 -0
  465. data/spec/models/profile_create_query_as_sub_resource_attributes_spec.rb +94 -0
  466. data/spec/models/profile_create_query_as_sub_resource_spec.rb +44 -0
  467. data/spec/models/profile_create_query_spec.rb +34 -0
  468. data/spec/models/profile_location_latitude_spec.rb +31 -0
  469. data/spec/models/profile_location_spec.rb +82 -0
  470. data/spec/models/profile_partial_update_query_as_sub_resource_spec.rb +50 -0
  471. data/spec/models/profile_partial_update_query_spec.rb +34 -0
  472. data/spec/models/segment_partial_update_query_as_sub_resource_spec.rb +50 -0
  473. data/spec/models/segment_partial_update_query_spec.rb +34 -0
  474. data/spec/models/send_options_spec.rb +40 -0
  475. data/spec/models/sms_message_content_spec.rb +40 -0
  476. data/spec/models/sms_render_options_spec.rb +52 -0
  477. data/spec/models/sms_tracking_options_spec.rb +40 -0
  478. data/spec/models/subscription_create_job_create_query_as_sub_resource_attributes_spec.rb +46 -0
  479. data/spec/models/subscription_create_job_create_query_as_sub_resource_spec.rb +44 -0
  480. data/spec/models/subscription_create_job_create_query_spec.rb +34 -0
  481. data/spec/models/subscription_spec.rb +40 -0
  482. data/spec/models/suppression_create_job_create_query_as_sub_resource_attributes_spec.rb +34 -0
  483. data/spec/models/suppression_create_job_create_query_as_sub_resource_spec.rb +44 -0
  484. data/spec/models/suppression_create_job_create_query_spec.rb +34 -0
  485. data/spec/models/suppression_spec.rb +34 -0
  486. data/spec/models/template_clone_query_as_sub_resource_attributes_spec.rb +40 -0
  487. data/spec/models/template_clone_query_as_sub_resource_spec.rb +44 -0
  488. data/spec/models/template_clone_query_spec.rb +34 -0
  489. data/spec/models/template_create_query_as_sub_resource_attributes_spec.rb +58 -0
  490. data/spec/models/template_create_query_as_sub_resource_spec.rb +44 -0
  491. data/spec/models/template_create_query_spec.rb +34 -0
  492. data/spec/models/template_delete_query_as_sub_resource_spec.rb +44 -0
  493. data/spec/models/template_update_query_as_sub_resource_attributes_spec.rb +52 -0
  494. data/spec/models/template_update_query_as_sub_resource_spec.rb +50 -0
  495. data/spec/models/template_update_query_spec.rb +34 -0
  496. data/spec/models/unsubscription_create_job_create_query_as_sub_resource_attributes_spec.rb +46 -0
  497. data/spec/models/unsubscription_create_job_create_query_as_sub_resource_spec.rb +44 -0
  498. data/spec/models/unsubscription_create_job_create_query_spec.rb +34 -0
  499. data/spec/models/unsuppression_create_job_create_query_as_sub_resource_spec.rb +44 -0
  500. data/spec/models/unsuppression_create_job_create_query_spec.rb +34 -0
  501. data/spec/models/utm_param_info_spec.rb +40 -0
  502. data/spec/models/v2_template_render_query_as_sub_resource_attributes_spec.rb +40 -0
  503. data/spec/models/v2_template_render_query_as_sub_resource_spec.rb +44 -0
  504. data/spec/models/v2_template_render_query_spec.rb +34 -0
  505. data/spec/spec_helper.rb +111 -0
  506. metadata +583 -0
@@ -0,0 +1,840 @@
1
+ =begin
2
+ #Klaviyo API
3
+
4
+ #The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details.
5
+
6
+ The version of the OpenAPI document: 2022-10-17
7
+ Contact: developers@klaviyo.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 6.0.1
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module KlaviyoAPI
16
+ class ProfilesApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Create Profile
23
+ # Create a new profile.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `Profiles Write`
24
+ # @param profile_create_query [ProfileCreateQuery]
25
+ # @param [Hash] opts the optional parameters
26
+ # @return [Hash<String, Object>]
27
+ def create_profile(profile_create_query, opts = {})
28
+ data, _status_code, _headers = create_profile_with_http_info(profile_create_query, opts)
29
+ data
30
+ end
31
+
32
+ # Create Profile
33
+ # Create a new profile.&lt;br&gt;&lt;br&gt;*Rate limits*:&lt;br&gt;Burst: &#x60;75/s&#x60;&lt;br&gt;Steady: &#x60;700/m&#x60; **Scopes:** &#x60;Profiles Write&#x60;
34
+ # @param profile_create_query [ProfileCreateQuery]
35
+ # @param [Hash] opts the optional parameters
36
+ # @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
37
+ def create_profile_with_http_info(profile_create_query, opts = {})
38
+ if @api_client.config.debugging
39
+ @api_client.config.logger.debug 'Calling API: ProfilesApi.create_profile ...'
40
+ end
41
+ # verify the required parameter 'profile_create_query' is set
42
+ if @api_client.config.client_side_validation && profile_create_query.nil?
43
+ fail ArgumentError, "Missing the required parameter 'profile_create_query' when calling ProfilesApi.create_profile"
44
+ end
45
+ # resource path
46
+ local_var_path = '/api/profiles/'
47
+
48
+ # query parameters
49
+ query_params = opts[:query_params] || {}
50
+
51
+ # header parameters
52
+ header_params = opts[:header_params] || {}
53
+ # klaviyo api revision
54
+ header_params['revision'] = ENV['API_REVISION'] || "2022-10-17"
55
+ # HTTP header 'Accept' (if needed)
56
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
57
+ # HTTP header 'Content-Type'
58
+ content_type = @api_client.select_header_content_type(['application/json'])
59
+ if !content_type.nil?
60
+ header_params['Content-Type'] = content_type
61
+ end
62
+
63
+ # form parameters
64
+ form_params = opts[:form_params] || {}
65
+
66
+ # http body (model)
67
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(profile_create_query)
68
+
69
+ # return_type
70
+ return_type = opts[:debug_return_type] || 'Hash<String, Object>'
71
+
72
+ # auth_names
73
+ auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
74
+
75
+ new_options = opts.merge(
76
+ :operation => :"ProfilesApi.create_profile",
77
+ :header_params => header_params,
78
+ :query_params => query_params,
79
+ :form_params => form_params,
80
+ :body => post_body,
81
+ :auth_names => auth_names,
82
+ :return_type => return_type
83
+ )
84
+
85
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
86
+ if @api_client.config.debugging
87
+ @api_client.config.logger.debug "API called: ProfilesApi#create_profile\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
88
+ end
89
+ return data, status_code, headers
90
+ end
91
+
92
+ # Get Profile
93
+ # Get the profile with the given profile ID. Request specific fields using [sparse fieldsets](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#sparse-fieldsets). Include parameters can be provided to get the following related resource data: `lists` memberships, `segments` memberships\"<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `Profiles Read`
94
+ # @param id [String]
95
+ # @param [Hash] opts the optional parameters
96
+ # @option opts [Array<String>] :fields_list For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets
97
+ # @option opts [Array<String>] :fields_profile For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets
98
+ # @option opts [Array<String>] :fields_segment For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets
99
+ # @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#relationships
100
+ # @return [Hash<String, Object>]
101
+ def get_profile(id, opts = {})
102
+ data, _status_code, _headers = get_profile_with_http_info(id, opts)
103
+ data
104
+ end
105
+
106
+ # Get Profile
107
+ # Get the profile with the given profile ID. Request specific fields using [sparse fieldsets](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#sparse-fieldsets). Include parameters can be provided to get the following related resource data: &#x60;lists&#x60; memberships, &#x60;segments&#x60; memberships\&quot;&lt;br&gt;&lt;br&gt;*Rate limits*:&lt;br&gt;Burst: &#x60;75/s&#x60;&lt;br&gt;Steady: &#x60;700/m&#x60; **Scopes:** &#x60;Profiles Read&#x60;
108
+ # @param id [String]
109
+ # @param [Hash] opts the optional parameters
110
+ # @option opts [Array<String>] :fields_list For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets
111
+ # @option opts [Array<String>] :fields_profile For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets
112
+ # @option opts [Array<String>] :fields_segment For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets
113
+ # @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#relationships
114
+ # @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
115
+ def get_profile_with_http_info(id, opts = {})
116
+ if @api_client.config.debugging
117
+ @api_client.config.logger.debug 'Calling API: ProfilesApi.get_profile ...'
118
+ end
119
+ # verify the required parameter 'id' is set
120
+ if @api_client.config.client_side_validation && id.nil?
121
+ fail ArgumentError, "Missing the required parameter 'id' when calling ProfilesApi.get_profile"
122
+ end
123
+ allowable_values = ["name", "created", "updated"]
124
+ if @api_client.config.client_side_validation && opts[:'fields_list'] && !opts[:'fields_list'].all? { |item| allowable_values.include?(item) }
125
+ fail ArgumentError, "invalid value for \"fields_list\", must include one of #{allowable_values}"
126
+ end
127
+ allowable_values = ["email", "phone_number", "external_id", "anonymous_id", "first_name", "last_name", "organization", "title", "image", "created", "updated", "last_event_date", "location", "location.address1", "location.address2", "location.city", "location.country", "location.latitude", "location.longitude", "location.region", "location.zip", "location.timezone", "properties"]
128
+ if @api_client.config.client_side_validation && opts[:'fields_profile'] && !opts[:'fields_profile'].all? { |item| allowable_values.include?(item) }
129
+ fail ArgumentError, "invalid value for \"fields_profile\", must include one of #{allowable_values}"
130
+ end
131
+ allowable_values = ["name", "created", "updated"]
132
+ if @api_client.config.client_side_validation && opts[:'fields_segment'] && !opts[:'fields_segment'].all? { |item| allowable_values.include?(item) }
133
+ fail ArgumentError, "invalid value for \"fields_segment\", must include one of #{allowable_values}"
134
+ end
135
+ allowable_values = ["lists", "segments"]
136
+ if @api_client.config.client_side_validation && opts[:'include'] && !opts[:'include'].all? { |item| allowable_values.include?(item) }
137
+ fail ArgumentError, "invalid value for \"include\", must include one of #{allowable_values}"
138
+ end
139
+ # resource path
140
+ local_var_path = '/api/profiles/{id}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
141
+
142
+ # query parameters
143
+ query_params = opts[:query_params] || {}
144
+ query_params[:'fields[list]'] = @api_client.build_collection_param(opts[:'fields_list'], :csv) if !opts[:'fields_list'].nil?
145
+ query_params[:'fields[profile]'] = @api_client.build_collection_param(opts[:'fields_profile'], :csv) if !opts[:'fields_profile'].nil?
146
+ query_params[:'fields[segment]'] = @api_client.build_collection_param(opts[:'fields_segment'], :csv) if !opts[:'fields_segment'].nil?
147
+ query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil?
148
+
149
+ # header parameters
150
+ header_params = opts[:header_params] || {}
151
+ # klaviyo api revision
152
+ header_params['revision'] = ENV['API_REVISION'] || "2022-10-17"
153
+ # HTTP header 'Accept' (if needed)
154
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
155
+
156
+ # form parameters
157
+ form_params = opts[:form_params] || {}
158
+
159
+ # http body (model)
160
+ post_body = opts[:debug_body]
161
+
162
+ # return_type
163
+ return_type = opts[:debug_return_type] || 'Hash<String, Object>'
164
+
165
+ # auth_names
166
+ auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
167
+
168
+ new_options = opts.merge(
169
+ :operation => :"ProfilesApi.get_profile",
170
+ :header_params => header_params,
171
+ :query_params => query_params,
172
+ :form_params => form_params,
173
+ :body => post_body,
174
+ :auth_names => auth_names,
175
+ :return_type => return_type
176
+ )
177
+
178
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
179
+ if @api_client.config.debugging
180
+ @api_client.config.logger.debug "API called: ProfilesApi#get_profile\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
181
+ end
182
+ return data, status_code, headers
183
+ end
184
+
185
+ # Get Profile Lists
186
+ # Get list memberships for a profile with the given profile ID.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `List Read` `Profiles Read`
187
+ # @param profile_id [String]
188
+ # @param [Hash] opts the optional parameters
189
+ # @option opts [Array<String>] :fields_list For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets
190
+ # @return [Hash<String, Object>]
191
+ def get_profile_lists(profile_id, opts = {})
192
+ data, _status_code, _headers = get_profile_lists_with_http_info(profile_id, opts)
193
+ data
194
+ end
195
+
196
+ # Get Profile Lists
197
+ # Get list memberships for a profile with the given profile ID.&lt;br&gt;&lt;br&gt;*Rate limits*:&lt;br&gt;Burst: &#x60;3/s&#x60;&lt;br&gt;Steady: &#x60;60/m&#x60; **Scopes:** &#x60;List Read&#x60; &#x60;Profiles Read&#x60;
198
+ # @param profile_id [String]
199
+ # @param [Hash] opts the optional parameters
200
+ # @option opts [Array<String>] :fields_list For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets
201
+ # @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
202
+ def get_profile_lists_with_http_info(profile_id, opts = {})
203
+ if @api_client.config.debugging
204
+ @api_client.config.logger.debug 'Calling API: ProfilesApi.get_profile_lists ...'
205
+ end
206
+ # verify the required parameter 'profile_id' is set
207
+ if @api_client.config.client_side_validation && profile_id.nil?
208
+ fail ArgumentError, "Missing the required parameter 'profile_id' when calling ProfilesApi.get_profile_lists"
209
+ end
210
+ allowable_values = ["name", "created", "updated"]
211
+ if @api_client.config.client_side_validation && opts[:'fields_list'] && !opts[:'fields_list'].all? { |item| allowable_values.include?(item) }
212
+ fail ArgumentError, "invalid value for \"fields_list\", must include one of #{allowable_values}"
213
+ end
214
+ # resource path
215
+ local_var_path = '/api/profiles/{profile_id}/lists/'.sub('{' + 'profile_id' + '}', CGI.escape(profile_id.to_s))
216
+
217
+ # query parameters
218
+ query_params = opts[:query_params] || {}
219
+ query_params[:'fields[list]'] = @api_client.build_collection_param(opts[:'fields_list'], :csv) if !opts[:'fields_list'].nil?
220
+
221
+ # header parameters
222
+ header_params = opts[:header_params] || {}
223
+ # klaviyo api revision
224
+ header_params['revision'] = ENV['API_REVISION'] || "2022-10-17"
225
+ # HTTP header 'Accept' (if needed)
226
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
227
+
228
+ # form parameters
229
+ form_params = opts[:form_params] || {}
230
+
231
+ # http body (model)
232
+ post_body = opts[:debug_body]
233
+
234
+ # return_type
235
+ return_type = opts[:debug_return_type] || 'Hash<String, Object>'
236
+
237
+ # auth_names
238
+ auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
239
+
240
+ new_options = opts.merge(
241
+ :operation => :"ProfilesApi.get_profile_lists",
242
+ :header_params => header_params,
243
+ :query_params => query_params,
244
+ :form_params => form_params,
245
+ :body => post_body,
246
+ :auth_names => auth_names,
247
+ :return_type => return_type
248
+ )
249
+
250
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
251
+ if @api_client.config.debugging
252
+ @api_client.config.logger.debug "API called: ProfilesApi#get_profile_lists\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
253
+ end
254
+ return data, status_code, headers
255
+ end
256
+
257
+ # Get Profile Relationships
258
+ # Get list membership or segment membership relationships for a profile with the given profile ID.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `Profiles Read` `Segments Read`
259
+ # @param id [String]
260
+ # @param related_resource [String]
261
+ # @param [Hash] opts the optional parameters
262
+ # @return [Hash<String, Object>]
263
+ def get_profile_relationships(id, related_resource, opts = {})
264
+ data, _status_code, _headers = get_profile_relationships_with_http_info(id, related_resource, opts)
265
+ data
266
+ end
267
+
268
+ # Get Profile Relationships
269
+ # Get list membership or segment membership relationships for a profile with the given profile ID.&lt;br&gt;&lt;br&gt;*Rate limits*:&lt;br&gt;Burst: &#x60;3/s&#x60;&lt;br&gt;Steady: &#x60;60/m&#x60; **Scopes:** &#x60;Profiles Read&#x60; &#x60;Segments Read&#x60;
270
+ # @param id [String]
271
+ # @param related_resource [String]
272
+ # @param [Hash] opts the optional parameters
273
+ # @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
274
+ def get_profile_relationships_with_http_info(id, related_resource, opts = {})
275
+ if @api_client.config.debugging
276
+ @api_client.config.logger.debug 'Calling API: ProfilesApi.get_profile_relationships ...'
277
+ end
278
+ # verify the required parameter 'id' is set
279
+ if @api_client.config.client_side_validation && id.nil?
280
+ fail ArgumentError, "Missing the required parameter 'id' when calling ProfilesApi.get_profile_relationships"
281
+ end
282
+ # verify the required parameter 'related_resource' is set
283
+ if @api_client.config.client_side_validation && related_resource.nil?
284
+ fail ArgumentError, "Missing the required parameter 'related_resource' when calling ProfilesApi.get_profile_relationships"
285
+ end
286
+ # verify enum value
287
+ allowable_values = ["lists", "segments"]
288
+ if @api_client.config.client_side_validation && !allowable_values.include?(related_resource)
289
+ fail ArgumentError, "invalid value for \"related_resource\", must be one of #{allowable_values}"
290
+ end
291
+ # resource path
292
+ local_var_path = '/api/profiles/{id}/relationships/{related_resource}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)).sub('{' + 'related_resource' + '}', CGI.escape(related_resource.to_s))
293
+
294
+ # query parameters
295
+ query_params = opts[:query_params] || {}
296
+
297
+ # header parameters
298
+ header_params = opts[:header_params] || {}
299
+ # klaviyo api revision
300
+ header_params['revision'] = ENV['API_REVISION'] || "2022-10-17"
301
+ # HTTP header 'Accept' (if needed)
302
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
303
+
304
+ # form parameters
305
+ form_params = opts[:form_params] || {}
306
+
307
+ # http body (model)
308
+ post_body = opts[:debug_body]
309
+
310
+ # return_type
311
+ return_type = opts[:debug_return_type] || 'Hash<String, Object>'
312
+
313
+ # auth_names
314
+ auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
315
+
316
+ new_options = opts.merge(
317
+ :operation => :"ProfilesApi.get_profile_relationships",
318
+ :header_params => header_params,
319
+ :query_params => query_params,
320
+ :form_params => form_params,
321
+ :body => post_body,
322
+ :auth_names => auth_names,
323
+ :return_type => return_type
324
+ )
325
+
326
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
327
+ if @api_client.config.debugging
328
+ @api_client.config.logger.debug "API called: ProfilesApi#get_profile_relationships\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
329
+ end
330
+ return data, status_code, headers
331
+ end
332
+
333
+ # Get Profile Segments
334
+ # Get segment memberships for a profile with the given profile ID.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `Profiles Read` `Segments Read`
335
+ # @param profile_id [String]
336
+ # @param [Hash] opts the optional parameters
337
+ # @option opts [Array<String>] :fields_segment For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets
338
+ # @return [Hash<String, Object>]
339
+ def get_profile_segments(profile_id, opts = {})
340
+ data, _status_code, _headers = get_profile_segments_with_http_info(profile_id, opts)
341
+ data
342
+ end
343
+
344
+ # Get Profile Segments
345
+ # Get segment memberships for a profile with the given profile ID.&lt;br&gt;&lt;br&gt;*Rate limits*:&lt;br&gt;Burst: &#x60;3/s&#x60;&lt;br&gt;Steady: &#x60;60/m&#x60; **Scopes:** &#x60;Profiles Read&#x60; &#x60;Segments Read&#x60;
346
+ # @param profile_id [String]
347
+ # @param [Hash] opts the optional parameters
348
+ # @option opts [Array<String>] :fields_segment For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets
349
+ # @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
350
+ def get_profile_segments_with_http_info(profile_id, opts = {})
351
+ if @api_client.config.debugging
352
+ @api_client.config.logger.debug 'Calling API: ProfilesApi.get_profile_segments ...'
353
+ end
354
+ # verify the required parameter 'profile_id' is set
355
+ if @api_client.config.client_side_validation && profile_id.nil?
356
+ fail ArgumentError, "Missing the required parameter 'profile_id' when calling ProfilesApi.get_profile_segments"
357
+ end
358
+ allowable_values = ["name", "created", "updated"]
359
+ if @api_client.config.client_side_validation && opts[:'fields_segment'] && !opts[:'fields_segment'].all? { |item| allowable_values.include?(item) }
360
+ fail ArgumentError, "invalid value for \"fields_segment\", must include one of #{allowable_values}"
361
+ end
362
+ # resource path
363
+ local_var_path = '/api/profiles/{profile_id}/segments/'.sub('{' + 'profile_id' + '}', CGI.escape(profile_id.to_s))
364
+
365
+ # query parameters
366
+ query_params = opts[:query_params] || {}
367
+ query_params[:'fields[segment]'] = @api_client.build_collection_param(opts[:'fields_segment'], :csv) if !opts[:'fields_segment'].nil?
368
+
369
+ # header parameters
370
+ header_params = opts[:header_params] || {}
371
+ # klaviyo api revision
372
+ header_params['revision'] = ENV['API_REVISION'] || "2022-10-17"
373
+ # HTTP header 'Accept' (if needed)
374
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
375
+
376
+ # form parameters
377
+ form_params = opts[:form_params] || {}
378
+
379
+ # http body (model)
380
+ post_body = opts[:debug_body]
381
+
382
+ # return_type
383
+ return_type = opts[:debug_return_type] || 'Hash<String, Object>'
384
+
385
+ # auth_names
386
+ auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
387
+
388
+ new_options = opts.merge(
389
+ :operation => :"ProfilesApi.get_profile_segments",
390
+ :header_params => header_params,
391
+ :query_params => query_params,
392
+ :form_params => form_params,
393
+ :body => post_body,
394
+ :auth_names => auth_names,
395
+ :return_type => return_type
396
+ )
397
+
398
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
399
+ if @api_client.config.debugging
400
+ @api_client.config.logger.debug "API called: ProfilesApi#get_profile_segments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
401
+ end
402
+ return data, status_code, headers
403
+ end
404
+
405
+ # Get Profiles
406
+ # Get all profiles in an account. Profiles can be sorted by the following fields in ascending and descending order: `id`, `created`, `email` Use filters to narrow your results. Request specific fields using [sparse fieldsets](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#sparse-fieldsets). Returns a maximum of 20 profiles per page, which can be paginated with [cursor-based pagination](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#pagination).<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `Profiles Write`
407
+ # @param [Hash] opts the optional parameters
408
+ # @option opts [Array<String>] :fields_profile For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets
409
+ # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#filtering&lt;br&gt;Allowed field(s)/operator(s):&lt;br&gt;&#x60;id&#x60;: &#x60;any&#x60;, &#x60;equals&#x60;&lt;br&gt;&#x60;email&#x60;: &#x60;any&#x60;, &#x60;equals&#x60;&lt;br&gt;&#x60;phone_number&#x60;: &#x60;any&#x60;, &#x60;equals&#x60;&lt;br&gt;&#x60;external_id&#x60;: &#x60;any&#x60;, &#x60;equals&#x60;&lt;br&gt;&#x60;anonymous_id&#x60;: &#x60;any&#x60;, &#x60;equals&#x60;&lt;br&gt;&#x60;_kx&#x60;: &#x60;equals&#x60;&lt;br&gt;&#x60;created&#x60;: &#x60;greater-than&#x60;, &#x60;less-than&#x60;&lt;br&gt;&#x60;updated&#x60;: &#x60;greater-than&#x60;, &#x60;less-than&#x60;
410
+ # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#pagination
411
+ # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sorting
412
+ # @return [Hash<String, Object>]
413
+ def get_profiles(opts = {})
414
+ data, _status_code, _headers = get_profiles_with_http_info(opts)
415
+ data
416
+ end
417
+
418
+ # Get Profiles
419
+ # Get all profiles in an account. Profiles can be sorted by the following fields in ascending and descending order: &#x60;id&#x60;, &#x60;created&#x60;, &#x60;email&#x60; Use filters to narrow your results. Request specific fields using [sparse fieldsets](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#sparse-fieldsets). Returns a maximum of 20 profiles per page, which can be paginated with [cursor-based pagination](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#pagination).&lt;br&gt;&lt;br&gt;*Rate limits*:&lt;br&gt;Burst: &#x60;10/s&#x60;&lt;br&gt;Steady: &#x60;150/m&#x60; **Scopes:** &#x60;Profiles Write&#x60;
420
+ # @param [Hash] opts the optional parameters
421
+ # @option opts [Array<String>] :fields_profile For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets
422
+ # @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#filtering&lt;br&gt;Allowed field(s)/operator(s):&lt;br&gt;&#x60;id&#x60;: &#x60;any&#x60;, &#x60;equals&#x60;&lt;br&gt;&#x60;email&#x60;: &#x60;any&#x60;, &#x60;equals&#x60;&lt;br&gt;&#x60;phone_number&#x60;: &#x60;any&#x60;, &#x60;equals&#x60;&lt;br&gt;&#x60;external_id&#x60;: &#x60;any&#x60;, &#x60;equals&#x60;&lt;br&gt;&#x60;anonymous_id&#x60;: &#x60;any&#x60;, &#x60;equals&#x60;&lt;br&gt;&#x60;_kx&#x60;: &#x60;equals&#x60;&lt;br&gt;&#x60;created&#x60;: &#x60;greater-than&#x60;, &#x60;less-than&#x60;&lt;br&gt;&#x60;updated&#x60;: &#x60;greater-than&#x60;, &#x60;less-than&#x60;
423
+ # @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#pagination
424
+ # @option opts [String] :sort For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sorting
425
+ # @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
426
+ def get_profiles_with_http_info(opts = {})
427
+ if @api_client.config.debugging
428
+ @api_client.config.logger.debug 'Calling API: ProfilesApi.get_profiles ...'
429
+ end
430
+ allowable_values = ["email", "phone_number", "external_id", "anonymous_id", "first_name", "last_name", "organization", "title", "image", "created", "updated", "last_event_date", "location", "location.address1", "location.address2", "location.city", "location.country", "location.latitude", "location.longitude", "location.region", "location.zip", "location.timezone", "properties"]
431
+ if @api_client.config.client_side_validation && opts[:'fields_profile'] && !opts[:'fields_profile'].all? { |item| allowable_values.include?(item) }
432
+ fail ArgumentError, "invalid value for \"fields_profile\", must include one of #{allowable_values}"
433
+ end
434
+ allowable_values = ["created", "-created", "email", "-email", "id", "-id"]
435
+ if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
436
+ fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
437
+ end
438
+ # resource path
439
+ local_var_path = '/api/profiles/'
440
+
441
+ # query parameters
442
+ query_params = opts[:query_params] || {}
443
+ query_params[:'fields[profile]'] = @api_client.build_collection_param(opts[:'fields_profile'], :csv) if !opts[:'fields_profile'].nil?
444
+ query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil?
445
+ query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil?
446
+ query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
447
+
448
+ # header parameters
449
+ header_params = opts[:header_params] || {}
450
+ # klaviyo api revision
451
+ header_params['revision'] = ENV['API_REVISION'] || "2022-10-17"
452
+ # HTTP header 'Accept' (if needed)
453
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
454
+
455
+ # form parameters
456
+ form_params = opts[:form_params] || {}
457
+
458
+ # http body (model)
459
+ post_body = opts[:debug_body]
460
+
461
+ # return_type
462
+ return_type = opts[:debug_return_type] || 'Hash<String, Object>'
463
+
464
+ # auth_names
465
+ auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
466
+
467
+ new_options = opts.merge(
468
+ :operation => :"ProfilesApi.get_profiles",
469
+ :header_params => header_params,
470
+ :query_params => query_params,
471
+ :form_params => form_params,
472
+ :body => post_body,
473
+ :auth_names => auth_names,
474
+ :return_type => return_type
475
+ )
476
+
477
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
478
+ if @api_client.config.debugging
479
+ @api_client.config.logger.debug "API called: ProfilesApi#get_profiles\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
480
+ end
481
+ return data, status_code, headers
482
+ end
483
+
484
+ # Subscribe Profiles
485
+ # Subscribe one or more profiles to email marketing, SMS marketing, or both. If the list has double opt-in enabled, profiles will receive a message requiring their confirmation before subscribing. Otherwise, profiles will be immediately subscribed without receiving a confirmation message. To add someone to a list without changing their subscription status, use [Add Profile to List](https://developers.klaviyo.com/en/v2022-10-17/reference/create_list_relationships).<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `List Write` `Profiles Write` `Subscriptions Write`
486
+ # @param subscription_create_job_create_query [SubscriptionCreateJobCreateQuery] Subscribes one or more profiles to marketing. Currently, supports email and SMS only. All profiles will be added to the provided list. Either email or phone number is required. Both may be specified to subscribe to both channels. If a profile cannot be found matching the given identifier(s), a new profile will be created and then subscribed.
487
+ # @param [Hash] opts the optional parameters
488
+ # @return [nil]
489
+ def subscribe_profiles(subscription_create_job_create_query, opts = {})
490
+ subscribe_profiles_with_http_info(subscription_create_job_create_query, opts)
491
+ nil
492
+ end
493
+
494
+ # Subscribe Profiles
495
+ # Subscribe one or more profiles to email marketing, SMS marketing, or both. If the list has double opt-in enabled, profiles will receive a message requiring their confirmation before subscribing. Otherwise, profiles will be immediately subscribed without receiving a confirmation message. To add someone to a list without changing their subscription status, use [Add Profile to List](https://developers.klaviyo.com/en/v2022-10-17/reference/create_list_relationships).&lt;br&gt;&lt;br&gt;*Rate limits*:&lt;br&gt;Burst: &#x60;75/s&#x60;&lt;br&gt;Steady: &#x60;700/m&#x60; **Scopes:** &#x60;List Write&#x60; &#x60;Profiles Write&#x60; &#x60;Subscriptions Write&#x60;
496
+ # @param subscription_create_job_create_query [SubscriptionCreateJobCreateQuery] Subscribes one or more profiles to marketing. Currently, supports email and SMS only. All profiles will be added to the provided list. Either email or phone number is required. Both may be specified to subscribe to both channels. If a profile cannot be found matching the given identifier(s), a new profile will be created and then subscribed.
497
+ # @param [Hash] opts the optional parameters
498
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
499
+ def subscribe_profiles_with_http_info(subscription_create_job_create_query, opts = {})
500
+ if @api_client.config.debugging
501
+ @api_client.config.logger.debug 'Calling API: ProfilesApi.subscribe_profiles ...'
502
+ end
503
+ # verify the required parameter 'subscription_create_job_create_query' is set
504
+ if @api_client.config.client_side_validation && subscription_create_job_create_query.nil?
505
+ fail ArgumentError, "Missing the required parameter 'subscription_create_job_create_query' when calling ProfilesApi.subscribe_profiles"
506
+ end
507
+ # resource path
508
+ local_var_path = '/api/profile-subscription-bulk-create-jobs/'
509
+
510
+ # query parameters
511
+ query_params = opts[:query_params] || {}
512
+
513
+ # header parameters
514
+ header_params = opts[:header_params] || {}
515
+ # klaviyo api revision
516
+ header_params['revision'] = ENV['API_REVISION'] || "2022-10-17"
517
+ # HTTP header 'Accept' (if needed)
518
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
519
+ # HTTP header 'Content-Type'
520
+ content_type = @api_client.select_header_content_type(['application/json'])
521
+ if !content_type.nil?
522
+ header_params['Content-Type'] = content_type
523
+ end
524
+
525
+ # form parameters
526
+ form_params = opts[:form_params] || {}
527
+
528
+ # http body (model)
529
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(subscription_create_job_create_query)
530
+
531
+ # return_type
532
+ return_type = opts[:debug_return_type]
533
+
534
+ # auth_names
535
+ auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
536
+
537
+ new_options = opts.merge(
538
+ :operation => :"ProfilesApi.subscribe_profiles",
539
+ :header_params => header_params,
540
+ :query_params => query_params,
541
+ :form_params => form_params,
542
+ :body => post_body,
543
+ :auth_names => auth_names,
544
+ :return_type => return_type
545
+ )
546
+
547
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
548
+ if @api_client.config.debugging
549
+ @api_client.config.logger.debug "API called: ProfilesApi#subscribe_profiles\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
550
+ end
551
+ return data, status_code, headers
552
+ end
553
+
554
+ # Suppress Profiles
555
+ # Manually suppress one or more profiles. Manually suppressed profiles will not receive email marketing. Not supported for SMS marketing.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `Profiles Write` `Subscriptions Write`
556
+ # @param suppression_create_job_create_query [SuppressionCreateJobCreateQuery] Suppresses one or more profiles from receiving marketing. Currently, supports email only. If a profile is not found with the given email, one will be created and immediately suppressed.
557
+ # @param [Hash] opts the optional parameters
558
+ # @return [nil]
559
+ def suppress_profiles(suppression_create_job_create_query, opts = {})
560
+ suppress_profiles_with_http_info(suppression_create_job_create_query, opts)
561
+ nil
562
+ end
563
+
564
+ # Suppress Profiles
565
+ # Manually suppress one or more profiles. Manually suppressed profiles will not receive email marketing. Not supported for SMS marketing.&lt;br&gt;&lt;br&gt;*Rate limits*:&lt;br&gt;Burst: &#x60;75/s&#x60;&lt;br&gt;Steady: &#x60;700/m&#x60; **Scopes:** &#x60;Profiles Write&#x60; &#x60;Subscriptions Write&#x60;
566
+ # @param suppression_create_job_create_query [SuppressionCreateJobCreateQuery] Suppresses one or more profiles from receiving marketing. Currently, supports email only. If a profile is not found with the given email, one will be created and immediately suppressed.
567
+ # @param [Hash] opts the optional parameters
568
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
569
+ def suppress_profiles_with_http_info(suppression_create_job_create_query, opts = {})
570
+ if @api_client.config.debugging
571
+ @api_client.config.logger.debug 'Calling API: ProfilesApi.suppress_profiles ...'
572
+ end
573
+ # verify the required parameter 'suppression_create_job_create_query' is set
574
+ if @api_client.config.client_side_validation && suppression_create_job_create_query.nil?
575
+ fail ArgumentError, "Missing the required parameter 'suppression_create_job_create_query' when calling ProfilesApi.suppress_profiles"
576
+ end
577
+ # resource path
578
+ local_var_path = '/api/profile-suppression-bulk-create-jobs/'
579
+
580
+ # query parameters
581
+ query_params = opts[:query_params] || {}
582
+
583
+ # header parameters
584
+ header_params = opts[:header_params] || {}
585
+ # klaviyo api revision
586
+ header_params['revision'] = ENV['API_REVISION'] || "2022-10-17"
587
+ # HTTP header 'Accept' (if needed)
588
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
589
+ # HTTP header 'Content-Type'
590
+ content_type = @api_client.select_header_content_type(['application/json'])
591
+ if !content_type.nil?
592
+ header_params['Content-Type'] = content_type
593
+ end
594
+
595
+ # form parameters
596
+ form_params = opts[:form_params] || {}
597
+
598
+ # http body (model)
599
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(suppression_create_job_create_query)
600
+
601
+ # return_type
602
+ return_type = opts[:debug_return_type]
603
+
604
+ # auth_names
605
+ auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
606
+
607
+ new_options = opts.merge(
608
+ :operation => :"ProfilesApi.suppress_profiles",
609
+ :header_params => header_params,
610
+ :query_params => query_params,
611
+ :form_params => form_params,
612
+ :body => post_body,
613
+ :auth_names => auth_names,
614
+ :return_type => return_type
615
+ )
616
+
617
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
618
+ if @api_client.config.debugging
619
+ @api_client.config.logger.debug "API called: ProfilesApi#suppress_profiles\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
620
+ end
621
+ return data, status_code, headers
622
+ end
623
+
624
+ # Unsubscribe Profiles
625
+ # Unsubscribe one or more profiles to email marketing, SMS marketing, or both. To remove someone from a list without changing their subscription status, use [Remove Profile from List](https://developers.klaviyo.com/en/v2022-10-17/reference/delete_list_relationships).<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `List Write` `Profiles Write` `Subscriptions Write`
626
+ # @param unsubscription_create_job_create_query [UnsubscriptionCreateJobCreateQuery] Unsubscribes one or more profiles from marketing. Currently, supports email and SMS only. All profiles will be removed from the provided list. Either email or phone number is required. If a profile cannot be found matching the given identifier(s), a new profile will be created and then unsubscribed.
627
+ # @param [Hash] opts the optional parameters
628
+ # @return [nil]
629
+ def unsubscribe_profiles(unsubscription_create_job_create_query, opts = {})
630
+ unsubscribe_profiles_with_http_info(unsubscription_create_job_create_query, opts)
631
+ nil
632
+ end
633
+
634
+ # Unsubscribe Profiles
635
+ # Unsubscribe one or more profiles to email marketing, SMS marketing, or both. To remove someone from a list without changing their subscription status, use [Remove Profile from List](https://developers.klaviyo.com/en/v2022-10-17/reference/delete_list_relationships).&lt;br&gt;&lt;br&gt;*Rate limits*:&lt;br&gt;Burst: &#x60;75/s&#x60;&lt;br&gt;Steady: &#x60;700/m&#x60; **Scopes:** &#x60;List Write&#x60; &#x60;Profiles Write&#x60; &#x60;Subscriptions Write&#x60;
636
+ # @param unsubscription_create_job_create_query [UnsubscriptionCreateJobCreateQuery] Unsubscribes one or more profiles from marketing. Currently, supports email and SMS only. All profiles will be removed from the provided list. Either email or phone number is required. If a profile cannot be found matching the given identifier(s), a new profile will be created and then unsubscribed.
637
+ # @param [Hash] opts the optional parameters
638
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
639
+ def unsubscribe_profiles_with_http_info(unsubscription_create_job_create_query, opts = {})
640
+ if @api_client.config.debugging
641
+ @api_client.config.logger.debug 'Calling API: ProfilesApi.unsubscribe_profiles ...'
642
+ end
643
+ # verify the required parameter 'unsubscription_create_job_create_query' is set
644
+ if @api_client.config.client_side_validation && unsubscription_create_job_create_query.nil?
645
+ fail ArgumentError, "Missing the required parameter 'unsubscription_create_job_create_query' when calling ProfilesApi.unsubscribe_profiles"
646
+ end
647
+ # resource path
648
+ local_var_path = '/api/profile-unsubscription-bulk-create-jobs/'
649
+
650
+ # query parameters
651
+ query_params = opts[:query_params] || {}
652
+
653
+ # header parameters
654
+ header_params = opts[:header_params] || {}
655
+ # klaviyo api revision
656
+ header_params['revision'] = ENV['API_REVISION'] || "2022-10-17"
657
+ # HTTP header 'Accept' (if needed)
658
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
659
+ # HTTP header 'Content-Type'
660
+ content_type = @api_client.select_header_content_type(['application/json'])
661
+ if !content_type.nil?
662
+ header_params['Content-Type'] = content_type
663
+ end
664
+
665
+ # form parameters
666
+ form_params = opts[:form_params] || {}
667
+
668
+ # http body (model)
669
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(unsubscription_create_job_create_query)
670
+
671
+ # return_type
672
+ return_type = opts[:debug_return_type]
673
+
674
+ # auth_names
675
+ auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
676
+
677
+ new_options = opts.merge(
678
+ :operation => :"ProfilesApi.unsubscribe_profiles",
679
+ :header_params => header_params,
680
+ :query_params => query_params,
681
+ :form_params => form_params,
682
+ :body => post_body,
683
+ :auth_names => auth_names,
684
+ :return_type => return_type
685
+ )
686
+
687
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
688
+ if @api_client.config.debugging
689
+ @api_client.config.logger.debug "API called: ProfilesApi#unsubscribe_profiles\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
690
+ end
691
+ return data, status_code, headers
692
+ end
693
+
694
+ # Unsuppress Profiles
695
+ # Unsuppress one or more profiles. Unsuppressed profiles will receive email marketing. Not supported for SMS marketing. Profiles suppressed due to a hard bounced email will not be unsuppressed.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `Subscriptions Write`
696
+ # @param unsuppression_create_job_create_query [UnsuppressionCreateJobCreateQuery] Unsuppresses one or more profiles from receiving marketing. Currently, supports email only. If a profile is not found with the given email, no action will be taken.
697
+ # @param [Hash] opts the optional parameters
698
+ # @return [nil]
699
+ def unsuppress_profiles(unsuppression_create_job_create_query, opts = {})
700
+ unsuppress_profiles_with_http_info(unsuppression_create_job_create_query, opts)
701
+ nil
702
+ end
703
+
704
+ # Unsuppress Profiles
705
+ # Unsuppress one or more profiles. Unsuppressed profiles will receive email marketing. Not supported for SMS marketing. Profiles suppressed due to a hard bounced email will not be unsuppressed.&lt;br&gt;&lt;br&gt;*Rate limits*:&lt;br&gt;Burst: &#x60;75/s&#x60;&lt;br&gt;Steady: &#x60;700/m&#x60; **Scopes:** &#x60;Subscriptions Write&#x60;
706
+ # @param unsuppression_create_job_create_query [UnsuppressionCreateJobCreateQuery] Unsuppresses one or more profiles from receiving marketing. Currently, supports email only. If a profile is not found with the given email, no action will be taken.
707
+ # @param [Hash] opts the optional parameters
708
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
709
+ def unsuppress_profiles_with_http_info(unsuppression_create_job_create_query, opts = {})
710
+ if @api_client.config.debugging
711
+ @api_client.config.logger.debug 'Calling API: ProfilesApi.unsuppress_profiles ...'
712
+ end
713
+ # verify the required parameter 'unsuppression_create_job_create_query' is set
714
+ if @api_client.config.client_side_validation && unsuppression_create_job_create_query.nil?
715
+ fail ArgumentError, "Missing the required parameter 'unsuppression_create_job_create_query' when calling ProfilesApi.unsuppress_profiles"
716
+ end
717
+ # resource path
718
+ local_var_path = '/api/profile-unsuppression-bulk-create-jobs/'
719
+
720
+ # query parameters
721
+ query_params = opts[:query_params] || {}
722
+
723
+ # header parameters
724
+ header_params = opts[:header_params] || {}
725
+ # klaviyo api revision
726
+ header_params['revision'] = ENV['API_REVISION'] || "2022-10-17"
727
+ # HTTP header 'Accept' (if needed)
728
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
729
+ # HTTP header 'Content-Type'
730
+ content_type = @api_client.select_header_content_type(['application/json'])
731
+ if !content_type.nil?
732
+ header_params['Content-Type'] = content_type
733
+ end
734
+
735
+ # form parameters
736
+ form_params = opts[:form_params] || {}
737
+
738
+ # http body (model)
739
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(unsuppression_create_job_create_query)
740
+
741
+ # return_type
742
+ return_type = opts[:debug_return_type]
743
+
744
+ # auth_names
745
+ auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
746
+
747
+ new_options = opts.merge(
748
+ :operation => :"ProfilesApi.unsuppress_profiles",
749
+ :header_params => header_params,
750
+ :query_params => query_params,
751
+ :form_params => form_params,
752
+ :body => post_body,
753
+ :auth_names => auth_names,
754
+ :return_type => return_type
755
+ )
756
+
757
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
758
+ if @api_client.config.debugging
759
+ @api_client.config.logger.debug "API called: ProfilesApi#unsuppress_profiles\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
760
+ end
761
+ return data, status_code, headers
762
+ end
763
+
764
+ # Update Profile
765
+ # Update the profile with the given profile ID.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m` **Scopes:** `Profiles Write`
766
+ # @param id [String]
767
+ # @param profile_partial_update_query [ProfilePartialUpdateQuery]
768
+ # @param [Hash] opts the optional parameters
769
+ # @return [Hash<String, Object>]
770
+ def update_profile(id, profile_partial_update_query, opts = {})
771
+ data, _status_code, _headers = update_profile_with_http_info(id, profile_partial_update_query, opts)
772
+ data
773
+ end
774
+
775
+ # Update Profile
776
+ # Update the profile with the given profile ID.&lt;br&gt;&lt;br&gt;*Rate limits*:&lt;br&gt;Burst: &#x60;75/s&#x60;&lt;br&gt;Steady: &#x60;700/m&#x60; **Scopes:** &#x60;Profiles Write&#x60;
777
+ # @param id [String]
778
+ # @param profile_partial_update_query [ProfilePartialUpdateQuery]
779
+ # @param [Hash] opts the optional parameters
780
+ # @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
781
+ def update_profile_with_http_info(id, profile_partial_update_query, opts = {})
782
+ if @api_client.config.debugging
783
+ @api_client.config.logger.debug 'Calling API: ProfilesApi.update_profile ...'
784
+ end
785
+ # verify the required parameter 'id' is set
786
+ if @api_client.config.client_side_validation && id.nil?
787
+ fail ArgumentError, "Missing the required parameter 'id' when calling ProfilesApi.update_profile"
788
+ end
789
+ # verify the required parameter 'profile_partial_update_query' is set
790
+ if @api_client.config.client_side_validation && profile_partial_update_query.nil?
791
+ fail ArgumentError, "Missing the required parameter 'profile_partial_update_query' when calling ProfilesApi.update_profile"
792
+ end
793
+ # resource path
794
+ local_var_path = '/api/profiles/{id}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
795
+
796
+ # query parameters
797
+ query_params = opts[:query_params] || {}
798
+
799
+ # header parameters
800
+ header_params = opts[:header_params] || {}
801
+ # klaviyo api revision
802
+ header_params['revision'] = ENV['API_REVISION'] || "2022-10-17"
803
+ # HTTP header 'Accept' (if needed)
804
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
805
+ # HTTP header 'Content-Type'
806
+ content_type = @api_client.select_header_content_type(['application/json'])
807
+ if !content_type.nil?
808
+ header_params['Content-Type'] = content_type
809
+ end
810
+
811
+ # form parameters
812
+ form_params = opts[:form_params] || {}
813
+
814
+ # http body (model)
815
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(profile_partial_update_query)
816
+
817
+ # return_type
818
+ return_type = opts[:debug_return_type] || 'Hash<String, Object>'
819
+
820
+ # auth_names
821
+ auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
822
+
823
+ new_options = opts.merge(
824
+ :operation => :"ProfilesApi.update_profile",
825
+ :header_params => header_params,
826
+ :query_params => query_params,
827
+ :form_params => form_params,
828
+ :body => post_body,
829
+ :auth_names => auth_names,
830
+ :return_type => return_type
831
+ )
832
+
833
+ data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
834
+ if @api_client.config.debugging
835
+ @api_client.config.logger.debug "API called: ProfilesApi#update_profile\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
836
+ end
837
+ return data, status_code, headers
838
+ end
839
+ end
840
+ end